Skip to content

Commit da79754

Browse files
Copilothotlong
andcommitted
Fix TypeScript errors in example files (partial progress)
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent a5d1377 commit da79754

File tree

4 files changed

+383
-783
lines changed

4 files changed

+383
-783
lines changed

examples/basic/api-protocols-example.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ export const graphqlConfig: GraphQLConfig = {
5656
name: 'DateTime',
5757
object: 'scalar',
5858
description: 'ISO 8601 date-time string',
59+
isInterface: false,
5960
},
6061
{
6162
name: 'JSON',
6263
object: 'scalar',
6364
description: 'JSON object',
65+
isInterface: false,
6466
},
6567
{
6668
name: 'AggregationResult',
@@ -84,6 +86,7 @@ export const graphqlConfig: GraphQLConfig = {
8486
name: 'convertLead',
8587
object: 'lead',
8688
type: 'custom',
89+
authRequired: true,
8790
description: 'Convert a lead to an account',
8891
input: {
8992
fields: {

examples/basic/hub-marketplace-example.ts

Lines changed: 35 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export const crmPluginRegistry: PluginRegistryEntry = {
148148
version: { major: 1, minor: 0, patch: 0 },
149149
},
150150
conformance: 'full',
151+
certified: false,
151152
},
152153
{
153154
protocol: {
@@ -157,6 +158,7 @@ export const crmPluginRegistry: PluginRegistryEntry = {
157158
},
158159
conformance: 'partial',
159160
implementedFeatures: ['reporting', 'dashboards'],
161+
certified: false,
160162
},
161163
],
162164

@@ -244,15 +246,16 @@ export const crmPluginRegistry: PluginRegistryEntry = {
244246

245247
export const crmMarketplaceListing: MarketplaceListing = {
246248
// Registry reference
247-
pluginId: 'com.acme.crm.advanced',
249+
id: 'com.acme.crm.advanced',
250+
label: 'Advanced CRM',
248251
version: '2.1.0',
249252

250253
// Pricing
251254
pricing: {
252-
model: 'paid',
253-
price: 29,
255+
type: 'recurring',
256+
amount: 29,
254257
currency: 'USD',
255-
billingPeriod: 'monthly',
258+
interval: 'month',
256259
},
257260
};
258261
/* Removed detailed pricing tiers due to schema mismatch */
@@ -446,39 +449,21 @@ export const crmLicense: License = {
446449
issuedAt: '2024-01-01T00:00:00Z',
447450
expiresAt: '2025-01-01T00:00:00Z',
448451

449-
// License type
450-
type: 'subscription',
451-
452-
// Licensee
453-
licensee: {
454-
organization: 'My Company Inc.',
455-
email: 'admin@mycompany.com',
456-
457-
// Contact
458-
contact: {
459-
name: 'John Admin',
460-
email: 'john@mycompany.com',
461-
},
462-
},
463-
464-
// Tier
465-
tier: 'professional',
452+
// Custom features beyond plan
453+
customFeatures: [
454+
'advanced-analytics',
455+
'ai-lead-scoring',
456+
],
466457

467-
// Entitlements
468-
entitlements: {
458+
// Custom limits
459+
customLimits: {
469460
users: 50,
470-
records: 100000,
471-
apiCalls: 1000000,
472-
473-
// Features
474-
features: [
475-
'advanced-analytics',
476-
'ai-lead-scoring',
477-
'workflow-automation',
478-
'priority-support',
479-
],
461+
storage_gb: 100,
480462
},
481463

464+
// Authorized plugins
465+
plugins: ['com.acme.crm.advanced'],
466+
482467
// Validity period
483468
validity: {
484469
startDate: '2024-01-01T00:00:00Z',
@@ -543,34 +528,23 @@ export const tenantConfig: Tenant = {
543528
// Tenant isolation level
544529
isolationLevel: 'shared_schema',
545530

546-
// Subscription
547-
subscription: {
548-
plan: 'enterprise',
549-
status: 'active',
550-
551-
// Billing
552-
billing: {
553-
cycle: 'annual',
554-
startDate: '2024-01-01T00:00:00Z',
555-
nextBillingDate: '2025-01-01T00:00:00Z',
556-
557-
amount: 9540, // $199 * 50 users * 0.9 (10% discount)
558-
currency: 'USD',
559-
},
531+
// Resource quotas
532+
quotas: {
533+
maxUsers: 50,
534+
maxStorage: 100 * 1024 * 1024 * 1024, // 100GB
535+
apiRateLimit: 1000,
560536
},
561537

562-
// Limits and quotas
563-
limits: {
564-
users: 50,
565-
records: 100000,
566-
storage: 100 * 1024 * 1024 * 1024, // 100GB
567-
apiCalls: 1000000,
568-
569-
// Custom objects
570-
customObjects: 50,
571-
572-
// Plugins
573-
plugins: 20,
538+
// Custom configuration
539+
customizations: {
540+
branding: {
541+
primaryColor: '#0052CC',
542+
logo: 'https://mycompany.com/logo.png',
543+
},
544+
features: {
545+
advancedAnalytics: true,
546+
aiLeadScoring: true,
547+
},
574548
},
575549

576550
// Current usage
@@ -708,6 +682,8 @@ export const salesSpace: Space = {
708682
name: 'Sales Team',
709683
slug: 'sales',
710684
ownerId: 'user-001',
685+
createdAt: '2024-01-01T00:00:00Z',
686+
updatedAt: '2024-01-02T00:00:00Z',
711687

712688
bom: {
713689
tenantId: 'tenant-12345',

0 commit comments

Comments
 (0)