digital-products 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/.turbo/turbo-build.log +5 -0
  2. package/CHANGELOG.md +9 -0
  3. package/README.md +535 -0
  4. package/dist/api.d.ts +99 -0
  5. package/dist/api.d.ts.map +1 -0
  6. package/dist/api.js +129 -0
  7. package/dist/api.js.map +1 -0
  8. package/dist/app.d.ts +79 -0
  9. package/dist/app.d.ts.map +1 -0
  10. package/dist/app.js +107 -0
  11. package/dist/app.js.map +1 -0
  12. package/dist/content.d.ts +58 -0
  13. package/dist/content.d.ts.map +1 -0
  14. package/dist/content.js +78 -0
  15. package/dist/content.js.map +1 -0
  16. package/dist/data.d.ts +67 -0
  17. package/dist/data.d.ts.map +1 -0
  18. package/dist/data.js +107 -0
  19. package/dist/data.js.map +1 -0
  20. package/dist/dataset.d.ts +32 -0
  21. package/dist/dataset.d.ts.map +1 -0
  22. package/dist/dataset.js +50 -0
  23. package/dist/dataset.js.map +1 -0
  24. package/dist/entities/ai.d.ts +53 -0
  25. package/dist/entities/ai.d.ts.map +1 -0
  26. package/dist/entities/ai.js +859 -0
  27. package/dist/entities/ai.js.map +1 -0
  28. package/dist/entities/content.d.ts +52 -0
  29. package/dist/entities/content.d.ts.map +1 -0
  30. package/dist/entities/content.js +784 -0
  31. package/dist/entities/content.js.map +1 -0
  32. package/dist/entities/index.d.ts +112 -0
  33. package/dist/entities/index.d.ts.map +1 -0
  34. package/dist/entities/index.js +89 -0
  35. package/dist/entities/index.js.map +1 -0
  36. package/dist/entities/interfaces.d.ts +67 -0
  37. package/dist/entities/interfaces.d.ts.map +1 -0
  38. package/dist/entities/interfaces.js +930 -0
  39. package/dist/entities/interfaces.js.map +1 -0
  40. package/dist/entities/lifecycle.d.ts +51 -0
  41. package/dist/entities/lifecycle.d.ts.map +1 -0
  42. package/dist/entities/lifecycle.js +804 -0
  43. package/dist/entities/lifecycle.js.map +1 -0
  44. package/dist/entities/products.d.ts +53 -0
  45. package/dist/entities/products.d.ts.map +1 -0
  46. package/dist/entities/products.js +798 -0
  47. package/dist/entities/products.js.map +1 -0
  48. package/dist/entities/web.d.ts +44 -0
  49. package/dist/entities/web.d.ts.map +1 -0
  50. package/dist/entities/web.js +658 -0
  51. package/dist/entities/web.js.map +1 -0
  52. package/dist/index.d.ts +29 -0
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +36 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/mcp.d.ts +101 -0
  57. package/dist/mcp.d.ts.map +1 -0
  58. package/dist/mcp.js +140 -0
  59. package/dist/mcp.js.map +1 -0
  60. package/dist/product.d.ts +37 -0
  61. package/dist/product.d.ts.map +1 -0
  62. package/dist/product.js +54 -0
  63. package/dist/product.js.map +1 -0
  64. package/dist/registry.d.ts +9 -0
  65. package/dist/registry.d.ts.map +1 -0
  66. package/dist/registry.js +32 -0
  67. package/dist/registry.js.map +1 -0
  68. package/dist/sdk.d.ts +99 -0
  69. package/dist/sdk.d.ts.map +1 -0
  70. package/dist/sdk.js +128 -0
  71. package/dist/sdk.js.map +1 -0
  72. package/dist/site.d.ts +85 -0
  73. package/dist/site.d.ts.map +1 -0
  74. package/dist/site.js +113 -0
  75. package/dist/site.js.map +1 -0
  76. package/dist/types.d.ts +528 -0
  77. package/dist/types.d.ts.map +1 -0
  78. package/dist/types.js +5 -0
  79. package/dist/types.js.map +1 -0
  80. package/example.ts +236 -0
  81. package/package.json +35 -0
  82. package/src/api.ts +140 -0
  83. package/src/app.ts +117 -0
  84. package/src/content.ts +82 -0
  85. package/src/data.ts +129 -0
  86. package/src/dataset.ts +53 -0
  87. package/src/entities/ai.ts +932 -0
  88. package/src/entities/content.ts +851 -0
  89. package/src/entities/index.ts +156 -0
  90. package/src/entities/interfaces.ts +1017 -0
  91. package/src/entities/lifecycle.ts +872 -0
  92. package/src/entities/products.ts +867 -0
  93. package/src/entities/web.ts +719 -0
  94. package/src/index.ts +55 -0
  95. package/src/mcp.ts +163 -0
  96. package/src/product.ts +59 -0
  97. package/src/registry.ts +41 -0
  98. package/src/sdk.ts +148 -0
  99. package/src/site.ts +127 -0
  100. package/src/types.ts +558 -0
  101. package/test/api.test.ts +247 -0
  102. package/test/app.test.ts +220 -0
  103. package/test/content.test.ts +171 -0
  104. package/test/data.test.ts +201 -0
  105. package/test/dataset.test.ts +181 -0
  106. package/test/mcp.test.ts +230 -0
  107. package/test/product.test.ts +200 -0
  108. package/test/sdk.test.ts +236 -0
  109. package/test/site.test.ts +245 -0
  110. package/tsconfig.json +9 -0
@@ -0,0 +1,867 @@
1
+ /**
2
+ * Core Product Entity Types (Nouns)
3
+ *
4
+ * Base digital product definitions and primary product types:
5
+ * DigitalProduct, SaaSProduct, App, Platform, Marketplace
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+
10
+ import type { Noun } from 'ai-database'
11
+
12
+ // =============================================================================
13
+ // DigitalProduct
14
+ // =============================================================================
15
+
16
+ /**
17
+ * DigitalProduct entity
18
+ *
19
+ * Base entity for all digital products.
20
+ */
21
+ export const DigitalProduct: Noun = {
22
+ singular: 'digital-product',
23
+ plural: 'digital-products',
24
+ description: 'A digital product or software offering',
25
+
26
+ properties: {
27
+ // Identity
28
+ name: {
29
+ type: 'string',
30
+ description: 'Product name',
31
+ },
32
+ slug: {
33
+ type: 'string',
34
+ optional: true,
35
+ description: 'URL-friendly identifier',
36
+ },
37
+ description: {
38
+ type: 'string',
39
+ optional: true,
40
+ description: 'Product description',
41
+ },
42
+ tagline: {
43
+ type: 'string',
44
+ optional: true,
45
+ description: 'Short marketing tagline',
46
+ },
47
+
48
+ // Classification
49
+ type: {
50
+ type: 'string',
51
+ description: 'Product type',
52
+ examples: ['saas', 'app', 'api', 'platform', 'marketplace', 'content', 'data', 'sdk', 'plugin', 'ai'],
53
+ },
54
+ category: {
55
+ type: 'string',
56
+ optional: true,
57
+ description: 'Product category',
58
+ },
59
+ tags: {
60
+ type: 'string',
61
+ array: true,
62
+ optional: true,
63
+ description: 'Product tags',
64
+ },
65
+
66
+ // Versioning
67
+ version: {
68
+ type: 'string',
69
+ optional: true,
70
+ description: 'Current version',
71
+ },
72
+
73
+ // Market
74
+ targetAudience: {
75
+ type: 'string',
76
+ optional: true,
77
+ description: 'Target audience description',
78
+ },
79
+ valueProposition: {
80
+ type: 'string',
81
+ optional: true,
82
+ description: 'Core value proposition',
83
+ },
84
+ useCases: {
85
+ type: 'string',
86
+ array: true,
87
+ optional: true,
88
+ description: 'Primary use cases',
89
+ },
90
+
91
+ // Pricing
92
+ pricingModel: {
93
+ type: 'string',
94
+ optional: true,
95
+ description: 'Pricing model',
96
+ examples: ['free', 'freemium', 'subscription', 'one-time', 'usage-based', 'tiered', 'per-seat'],
97
+ },
98
+ price: {
99
+ type: 'number',
100
+ optional: true,
101
+ description: 'Base price',
102
+ },
103
+ currency: {
104
+ type: 'string',
105
+ optional: true,
106
+ description: 'Currency code (ISO 4217)',
107
+ },
108
+
109
+ // Lifecycle
110
+ stage: {
111
+ type: 'string',
112
+ optional: true,
113
+ description: 'Product lifecycle stage',
114
+ examples: ['concept', 'development', 'alpha', 'beta', 'ga', 'growth', 'mature', 'sunset'],
115
+ },
116
+ launchedAt: {
117
+ type: 'date',
118
+ optional: true,
119
+ description: 'Launch date',
120
+ },
121
+
122
+ // Status
123
+ status: {
124
+ type: 'string',
125
+ description: 'Product status',
126
+ examples: ['draft', 'active', 'paused', 'deprecated', 'archived'],
127
+ },
128
+ visibility: {
129
+ type: 'string',
130
+ optional: true,
131
+ description: 'Visibility level',
132
+ examples: ['public', 'private', 'unlisted', 'beta', 'waitlist'],
133
+ },
134
+
135
+ // URLs
136
+ websiteUrl: {
137
+ type: 'string',
138
+ optional: true,
139
+ description: 'Product website URL',
140
+ },
141
+ documentationUrl: {
142
+ type: 'string',
143
+ optional: true,
144
+ description: 'Documentation URL',
145
+ },
146
+ repositoryUrl: {
147
+ type: 'string',
148
+ optional: true,
149
+ description: 'Source repository URL',
150
+ },
151
+ },
152
+
153
+ relationships: {
154
+ owner: {
155
+ type: 'Organization',
156
+ required: false,
157
+ description: 'Owning organization',
158
+ },
159
+ team: {
160
+ type: 'Team',
161
+ required: false,
162
+ description: 'Product team',
163
+ },
164
+ features: {
165
+ type: 'Feature[]',
166
+ description: 'Product features',
167
+ },
168
+ versions: {
169
+ type: 'Version[]',
170
+ description: 'Product versions',
171
+ },
172
+ deployments: {
173
+ type: 'Deployment[]',
174
+ description: 'Active deployments',
175
+ },
176
+ },
177
+
178
+ actions: [
179
+ 'create',
180
+ 'update',
181
+ 'launch',
182
+ 'release',
183
+ 'deploy',
184
+ 'pause',
185
+ 'resume',
186
+ 'deprecate',
187
+ 'archive',
188
+ ],
189
+
190
+ events: [
191
+ 'created',
192
+ 'updated',
193
+ 'launched',
194
+ 'released',
195
+ 'deployed',
196
+ 'paused',
197
+ 'resumed',
198
+ 'deprecated',
199
+ 'archived',
200
+ ],
201
+ }
202
+
203
+ // =============================================================================
204
+ // SaaSProduct
205
+ // =============================================================================
206
+
207
+ /**
208
+ * SaaSProduct entity
209
+ *
210
+ * Software-as-a-Service product with subscription model.
211
+ */
212
+ export const SaaSProduct: Noun = {
213
+ singular: 'saas-product',
214
+ plural: 'saas-products',
215
+ description: 'A Software-as-a-Service product',
216
+
217
+ properties: {
218
+ // Identity
219
+ name: {
220
+ type: 'string',
221
+ description: 'Product name',
222
+ },
223
+ slug: {
224
+ type: 'string',
225
+ optional: true,
226
+ description: 'URL-friendly identifier',
227
+ },
228
+ description: {
229
+ type: 'string',
230
+ optional: true,
231
+ description: 'Product description',
232
+ },
233
+
234
+ // SaaS Specific
235
+ multiTenant: {
236
+ type: 'boolean',
237
+ optional: true,
238
+ description: 'Multi-tenant architecture',
239
+ },
240
+ selfService: {
241
+ type: 'boolean',
242
+ optional: true,
243
+ description: 'Self-service signup available',
244
+ },
245
+ trialDays: {
246
+ type: 'number',
247
+ optional: true,
248
+ description: 'Free trial period in days',
249
+ },
250
+
251
+ // Infrastructure
252
+ hostingModel: {
253
+ type: 'string',
254
+ optional: true,
255
+ description: 'Hosting model',
256
+ examples: ['cloud', 'hybrid', 'on-premise', 'self-hosted'],
257
+ },
258
+ regions: {
259
+ type: 'string',
260
+ array: true,
261
+ optional: true,
262
+ description: 'Available regions',
263
+ },
264
+
265
+ // Compliance
266
+ certifications: {
267
+ type: 'string',
268
+ array: true,
269
+ optional: true,
270
+ description: 'Security certifications',
271
+ examples: ['SOC2', 'HIPAA', 'GDPR', 'ISO27001', 'PCI-DSS'],
272
+ },
273
+ dataResidency: {
274
+ type: 'string',
275
+ array: true,
276
+ optional: true,
277
+ description: 'Data residency options',
278
+ },
279
+
280
+ // Usage
281
+ activeUsers: {
282
+ type: 'number',
283
+ optional: true,
284
+ description: 'Active user count',
285
+ },
286
+ monthlyActiveUsers: {
287
+ type: 'number',
288
+ optional: true,
289
+ description: 'Monthly active users',
290
+ },
291
+
292
+ // Revenue
293
+ mrr: {
294
+ type: 'number',
295
+ optional: true,
296
+ description: 'Monthly recurring revenue',
297
+ },
298
+ arr: {
299
+ type: 'number',
300
+ optional: true,
301
+ description: 'Annual recurring revenue',
302
+ },
303
+ churnRate: {
304
+ type: 'number',
305
+ optional: true,
306
+ description: 'Monthly churn rate',
307
+ },
308
+
309
+ // Status
310
+ status: {
311
+ type: 'string',
312
+ description: 'Product status',
313
+ examples: ['draft', 'beta', 'active', 'paused', 'sunset'],
314
+ },
315
+ },
316
+
317
+ relationships: {
318
+ product: {
319
+ type: 'DigitalProduct',
320
+ description: 'Parent digital product',
321
+ },
322
+ plans: {
323
+ type: 'PricingPlan[]',
324
+ description: 'Subscription plans',
325
+ },
326
+ tenants: {
327
+ type: 'Tenant[]',
328
+ description: 'Customer tenants',
329
+ },
330
+ integrations: {
331
+ type: 'Integration[]',
332
+ description: 'Available integrations',
333
+ },
334
+ },
335
+
336
+ actions: [
337
+ 'create',
338
+ 'update',
339
+ 'launch',
340
+ 'addPlan',
341
+ 'removePlan',
342
+ 'provisionTenant',
343
+ 'deprovisionTenant',
344
+ 'pause',
345
+ 'sunset',
346
+ ],
347
+
348
+ events: [
349
+ 'created',
350
+ 'updated',
351
+ 'launched',
352
+ 'planAdded',
353
+ 'planRemoved',
354
+ 'tenantProvisioned',
355
+ 'tenantDeprovisioned',
356
+ 'paused',
357
+ 'sunset',
358
+ ],
359
+ }
360
+
361
+ // =============================================================================
362
+ // App
363
+ // =============================================================================
364
+
365
+ /**
366
+ * App entity
367
+ *
368
+ * Interactive user-facing application.
369
+ */
370
+ export const App: Noun = {
371
+ singular: 'app',
372
+ plural: 'apps',
373
+ description: 'An interactive user-facing application',
374
+
375
+ properties: {
376
+ // Identity
377
+ name: {
378
+ type: 'string',
379
+ description: 'App name',
380
+ },
381
+ slug: {
382
+ type: 'string',
383
+ optional: true,
384
+ description: 'URL-friendly identifier',
385
+ },
386
+ description: {
387
+ type: 'string',
388
+ optional: true,
389
+ description: 'App description',
390
+ },
391
+
392
+ // Classification
393
+ type: {
394
+ type: 'string',
395
+ description: 'App type',
396
+ examples: ['web', 'mobile', 'desktop', 'cli', 'pwa', 'native', 'hybrid'],
397
+ },
398
+ platform: {
399
+ type: 'string',
400
+ optional: true,
401
+ description: 'Target platform',
402
+ examples: ['browser', 'ios', 'android', 'macos', 'windows', 'linux', 'cross-platform'],
403
+ },
404
+
405
+ // Technology
406
+ framework: {
407
+ type: 'string',
408
+ optional: true,
409
+ description: 'Primary framework',
410
+ examples: ['react', 'vue', 'svelte', 'solid', 'angular', 'next', 'nuxt', 'native', 'flutter', 'electron'],
411
+ },
412
+ language: {
413
+ type: 'string',
414
+ optional: true,
415
+ description: 'Primary language',
416
+ examples: ['typescript', 'javascript', 'swift', 'kotlin', 'dart', 'rust'],
417
+ },
418
+ runtime: {
419
+ type: 'string',
420
+ optional: true,
421
+ description: 'Runtime environment',
422
+ examples: ['browser', 'node', 'bun', 'deno', 'native'],
423
+ },
424
+
425
+ // Configuration
426
+ entryPoint: {
427
+ type: 'string',
428
+ optional: true,
429
+ description: 'Application entry point',
430
+ },
431
+ routes: {
432
+ type: 'json',
433
+ optional: true,
434
+ description: 'Application routes',
435
+ },
436
+
437
+ // Features
438
+ offlineCapable: {
439
+ type: 'boolean',
440
+ optional: true,
441
+ description: 'Works offline',
442
+ },
443
+ pushNotifications: {
444
+ type: 'boolean',
445
+ optional: true,
446
+ description: 'Push notification support',
447
+ },
448
+
449
+ // Distribution
450
+ appStoreUrl: {
451
+ type: 'string',
452
+ optional: true,
453
+ description: 'App store URL',
454
+ },
455
+ playStoreUrl: {
456
+ type: 'string',
457
+ optional: true,
458
+ description: 'Play store URL',
459
+ },
460
+
461
+ // Status
462
+ status: {
463
+ type: 'string',
464
+ description: 'App status',
465
+ examples: ['draft', 'development', 'testing', 'beta', 'production', 'deprecated'],
466
+ },
467
+ },
468
+
469
+ relationships: {
470
+ product: {
471
+ type: 'DigitalProduct',
472
+ description: 'Parent product',
473
+ },
474
+ features: {
475
+ type: 'Feature[]',
476
+ description: 'App features',
477
+ },
478
+ releases: {
479
+ type: 'Release[]',
480
+ description: 'App releases',
481
+ },
482
+ deployments: {
483
+ type: 'Deployment[]',
484
+ description: 'Active deployments',
485
+ },
486
+ components: {
487
+ type: 'Component[]',
488
+ description: 'UI components',
489
+ },
490
+ },
491
+
492
+ actions: [
493
+ 'create',
494
+ 'update',
495
+ 'build',
496
+ 'test',
497
+ 'deploy',
498
+ 'release',
499
+ 'rollback',
500
+ 'pause',
501
+ 'deprecate',
502
+ ],
503
+
504
+ events: [
505
+ 'created',
506
+ 'updated',
507
+ 'built',
508
+ 'tested',
509
+ 'deployed',
510
+ 'released',
511
+ 'rolledBack',
512
+ 'paused',
513
+ 'deprecated',
514
+ ],
515
+ }
516
+
517
+ // =============================================================================
518
+ // Platform
519
+ // =============================================================================
520
+
521
+ /**
522
+ * Platform entity
523
+ *
524
+ * Multi-sided platform connecting different user groups.
525
+ */
526
+ export const Platform: Noun = {
527
+ singular: 'platform',
528
+ plural: 'platforms',
529
+ description: 'A multi-sided platform connecting users and providers',
530
+
531
+ properties: {
532
+ // Identity
533
+ name: {
534
+ type: 'string',
535
+ description: 'Platform name',
536
+ },
537
+ slug: {
538
+ type: 'string',
539
+ optional: true,
540
+ description: 'URL-friendly identifier',
541
+ },
542
+ description: {
543
+ type: 'string',
544
+ optional: true,
545
+ description: 'Platform description',
546
+ },
547
+
548
+ // Platform Type
549
+ type: {
550
+ type: 'string',
551
+ description: 'Platform type',
552
+ examples: ['marketplace', 'social', 'developer', 'content', 'service', 'data', 'ai'],
553
+ },
554
+
555
+ // Sides/Participants
556
+ sides: {
557
+ type: 'string',
558
+ array: true,
559
+ optional: true,
560
+ description: 'Platform sides (e.g., buyers, sellers)',
561
+ },
562
+
563
+ // Network Effects
564
+ networkEffectType: {
565
+ type: 'string',
566
+ optional: true,
567
+ description: 'Type of network effect',
568
+ examples: ['same-side', 'cross-side', 'data', 'none'],
569
+ },
570
+
571
+ // Openness
572
+ openness: {
573
+ type: 'string',
574
+ optional: true,
575
+ description: 'Platform openness level',
576
+ examples: ['open', 'semi-open', 'closed', 'invite-only'],
577
+ },
578
+ apiAccess: {
579
+ type: 'boolean',
580
+ optional: true,
581
+ description: 'API access available',
582
+ },
583
+ developerProgram: {
584
+ type: 'boolean',
585
+ optional: true,
586
+ description: 'Developer program available',
587
+ },
588
+
589
+ // Governance
590
+ governanceModel: {
591
+ type: 'string',
592
+ optional: true,
593
+ description: 'Platform governance model',
594
+ examples: ['centralized', 'federated', 'decentralized', 'hybrid'],
595
+ },
596
+
597
+ // Economics
598
+ revenueModel: {
599
+ type: 'string',
600
+ optional: true,
601
+ description: 'Revenue model',
602
+ examples: ['commission', 'subscription', 'advertising', 'freemium', 'data', 'hybrid'],
603
+ },
604
+ takeRate: {
605
+ type: 'number',
606
+ optional: true,
607
+ description: 'Platform take rate percentage',
608
+ },
609
+
610
+ // Metrics
611
+ totalUsers: {
612
+ type: 'number',
613
+ optional: true,
614
+ description: 'Total registered users',
615
+ },
616
+ gmv: {
617
+ type: 'number',
618
+ optional: true,
619
+ description: 'Gross merchandise value',
620
+ },
621
+
622
+ // Status
623
+ status: {
624
+ type: 'string',
625
+ description: 'Platform status',
626
+ examples: ['draft', 'beta', 'active', 'scaling', 'mature'],
627
+ },
628
+ },
629
+
630
+ relationships: {
631
+ product: {
632
+ type: 'DigitalProduct',
633
+ description: 'Parent product',
634
+ },
635
+ apis: {
636
+ type: 'API[]',
637
+ description: 'Platform APIs',
638
+ },
639
+ plugins: {
640
+ type: 'Plugin[]',
641
+ description: 'Available plugins',
642
+ },
643
+ integrations: {
644
+ type: 'Integration[]',
645
+ description: 'Platform integrations',
646
+ },
647
+ },
648
+
649
+ actions: [
650
+ 'create',
651
+ 'update',
652
+ 'launch',
653
+ 'openAPI',
654
+ 'closeAPI',
655
+ 'addSide',
656
+ 'removeSide',
657
+ 'updateGovernance',
658
+ 'scale',
659
+ ],
660
+
661
+ events: [
662
+ 'created',
663
+ 'updated',
664
+ 'launched',
665
+ 'apiOpened',
666
+ 'apiClosed',
667
+ 'sideAdded',
668
+ 'sideRemoved',
669
+ 'governanceUpdated',
670
+ 'scaled',
671
+ ],
672
+ }
673
+
674
+ // =============================================================================
675
+ // Marketplace
676
+ // =============================================================================
677
+
678
+ /**
679
+ * Marketplace entity
680
+ *
681
+ * Platform for buying and selling products or services.
682
+ */
683
+ export const Marketplace: Noun = {
684
+ singular: 'marketplace',
685
+ plural: 'marketplaces',
686
+ description: 'A platform for buying and selling products or services',
687
+
688
+ properties: {
689
+ // Identity
690
+ name: {
691
+ type: 'string',
692
+ description: 'Marketplace name',
693
+ },
694
+ slug: {
695
+ type: 'string',
696
+ optional: true,
697
+ description: 'URL-friendly identifier',
698
+ },
699
+ description: {
700
+ type: 'string',
701
+ optional: true,
702
+ description: 'Marketplace description',
703
+ },
704
+
705
+ // Type
706
+ type: {
707
+ type: 'string',
708
+ description: 'Marketplace type',
709
+ examples: ['b2b', 'b2c', 'c2c', 'p2p', 'vertical', 'horizontal'],
710
+ },
711
+ vertical: {
712
+ type: 'string',
713
+ optional: true,
714
+ description: 'Industry vertical',
715
+ },
716
+
717
+ // What's Traded
718
+ itemType: {
719
+ type: 'string',
720
+ description: 'Type of items traded',
721
+ examples: ['products', 'services', 'digital-goods', 'subscriptions', 'labor', 'data'],
722
+ },
723
+
724
+ // Matching
725
+ matchingModel: {
726
+ type: 'string',
727
+ optional: true,
728
+ description: 'How buyers and sellers are matched',
729
+ examples: ['search', 'browse', 'auction', 'rfq', 'algorithmic', 'ai-powered'],
730
+ },
731
+
732
+ // Trust & Safety
733
+ trustModel: {
734
+ type: 'string',
735
+ optional: true,
736
+ description: 'Trust and safety model',
737
+ examples: ['reviews', 'verification', 'escrow', 'insurance', 'guarantee'],
738
+ },
739
+ disputeResolution: {
740
+ type: 'string',
741
+ optional: true,
742
+ description: 'Dispute resolution method',
743
+ examples: ['platform', 'arbitration', 'mediation', 'legal'],
744
+ },
745
+
746
+ // Transactions
747
+ paymentMethods: {
748
+ type: 'string',
749
+ array: true,
750
+ optional: true,
751
+ description: 'Supported payment methods',
752
+ },
753
+ escrowEnabled: {
754
+ type: 'boolean',
755
+ optional: true,
756
+ description: 'Escrow payments supported',
757
+ },
758
+
759
+ // Economics
760
+ commissionRate: {
761
+ type: 'number',
762
+ optional: true,
763
+ description: 'Commission rate percentage',
764
+ },
765
+ listingFee: {
766
+ type: 'number',
767
+ optional: true,
768
+ description: 'Fee per listing',
769
+ },
770
+ transactionFee: {
771
+ type: 'number',
772
+ optional: true,
773
+ description: 'Per-transaction fee',
774
+ },
775
+
776
+ // Metrics
777
+ totalListings: {
778
+ type: 'number',
779
+ optional: true,
780
+ description: 'Total active listings',
781
+ },
782
+ totalSellers: {
783
+ type: 'number',
784
+ optional: true,
785
+ description: 'Total registered sellers',
786
+ },
787
+ totalBuyers: {
788
+ type: 'number',
789
+ optional: true,
790
+ description: 'Total registered buyers',
791
+ },
792
+ gmv: {
793
+ type: 'number',
794
+ optional: true,
795
+ description: 'Gross merchandise value',
796
+ },
797
+
798
+ // Status
799
+ status: {
800
+ type: 'string',
801
+ description: 'Marketplace status',
802
+ examples: ['draft', 'beta', 'active', 'scaling', 'mature'],
803
+ },
804
+ },
805
+
806
+ relationships: {
807
+ platform: {
808
+ type: 'Platform',
809
+ description: 'Parent platform',
810
+ },
811
+ categories: {
812
+ type: 'Category[]',
813
+ description: 'Product categories',
814
+ },
815
+ sellers: {
816
+ type: 'Seller[]',
817
+ description: 'Marketplace sellers',
818
+ },
819
+ listings: {
820
+ type: 'Listing[]',
821
+ description: 'Active listings',
822
+ },
823
+ },
824
+
825
+ actions: [
826
+ 'create',
827
+ 'update',
828
+ 'launch',
829
+ 'addCategory',
830
+ 'removeCategory',
831
+ 'approveSeller',
832
+ 'suspendSeller',
833
+ 'updateFees',
834
+ 'resolveDispute',
835
+ ],
836
+
837
+ events: [
838
+ 'created',
839
+ 'updated',
840
+ 'launched',
841
+ 'categoryAdded',
842
+ 'categoryRemoved',
843
+ 'sellerApproved',
844
+ 'sellerSuspended',
845
+ 'feesUpdated',
846
+ 'disputeResolved',
847
+ ],
848
+ }
849
+
850
+ // =============================================================================
851
+ // Exports
852
+ // =============================================================================
853
+
854
+ export const ProductEntities = {
855
+ DigitalProduct,
856
+ SaaSProduct,
857
+ App,
858
+ Platform,
859
+ Marketplace,
860
+ }
861
+
862
+ export const ProductCategories = {
863
+ core: ['DigitalProduct'],
864
+ saas: ['SaaSProduct'],
865
+ apps: ['App'],
866
+ platforms: ['Platform', 'Marketplace'],
867
+ } as const