business-as-code 2.1.1 → 2.3.0

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 (212) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +2 -0
  3. package/package.json +7 -4
  4. package/src/dollar.ts +5 -2
  5. package/src/entities/organization.ts +31 -18
  6. package/src/goals.ts +78 -12
  7. package/src/index.ts +48 -18
  8. package/src/kpis.ts +62 -8
  9. package/src/metrics.ts +92 -79
  10. package/src/okrs.ts +120 -20
  11. package/src/organization.ts +12 -15
  12. package/src/process.ts +11 -12
  13. package/src/product.ts +8 -9
  14. package/src/queries.ts +238 -75
  15. package/src/roles.ts +62 -61
  16. package/src/workflow.ts +22 -15
  17. package/test/business.test.ts +282 -0
  18. package/test/dollar.test.ts +270 -0
  19. package/test/entities.test.ts +628 -0
  20. package/test/financials.test.ts +539 -0
  21. package/test/goals.test.ts +451 -0
  22. package/{src → test}/index.test.ts +1 -1
  23. package/test/kpis.test.ts +440 -0
  24. package/test/metrics.test.ts +744 -0
  25. package/test/okrs.test.ts +741 -0
  26. package/test/organization.test.ts +548 -0
  27. package/test/process.test.ts +503 -0
  28. package/test/product.test.ts +430 -0
  29. package/test/queries.test.ts +556 -0
  30. package/test/roles.test.ts +546 -0
  31. package/test/service.test.ts +450 -0
  32. package/test/types.test.ts +1141 -0
  33. package/test/vision.test.ts +214 -0
  34. package/test/workflow.test.ts +501 -0
  35. package/vitest.config.ts +47 -0
  36. package/.turbo/turbo-build.log +0 -5
  37. package/dist/business.d.ts +0 -62
  38. package/dist/business.d.ts.map +0 -1
  39. package/dist/business.js +0 -109
  40. package/dist/business.js.map +0 -1
  41. package/dist/dollar.d.ts +0 -60
  42. package/dist/dollar.d.ts.map +0 -1
  43. package/dist/dollar.js +0 -107
  44. package/dist/dollar.js.map +0 -1
  45. package/dist/entities/assets.d.ts +0 -21
  46. package/dist/entities/assets.d.ts.map +0 -1
  47. package/dist/entities/assets.js +0 -323
  48. package/dist/entities/assets.js.map +0 -1
  49. package/dist/entities/business.d.ts +0 -36
  50. package/dist/entities/business.d.ts.map +0 -1
  51. package/dist/entities/business.js +0 -370
  52. package/dist/entities/business.js.map +0 -1
  53. package/dist/entities/communication.d.ts +0 -21
  54. package/dist/entities/communication.d.ts.map +0 -1
  55. package/dist/entities/communication.js +0 -255
  56. package/dist/entities/communication.js.map +0 -1
  57. package/dist/entities/customers.d.ts +0 -58
  58. package/dist/entities/customers.d.ts.map +0 -1
  59. package/dist/entities/customers.js +0 -989
  60. package/dist/entities/customers.js.map +0 -1
  61. package/dist/entities/financials.d.ts +0 -59
  62. package/dist/entities/financials.d.ts.map +0 -1
  63. package/dist/entities/financials.js +0 -932
  64. package/dist/entities/financials.js.map +0 -1
  65. package/dist/entities/goals.d.ts +0 -58
  66. package/dist/entities/goals.d.ts.map +0 -1
  67. package/dist/entities/goals.js +0 -800
  68. package/dist/entities/goals.js.map +0 -1
  69. package/dist/entities/index.d.ts +0 -299
  70. package/dist/entities/index.d.ts.map +0 -1
  71. package/dist/entities/index.js +0 -198
  72. package/dist/entities/index.js.map +0 -1
  73. package/dist/entities/legal.d.ts +0 -21
  74. package/dist/entities/legal.d.ts.map +0 -1
  75. package/dist/entities/legal.js +0 -301
  76. package/dist/entities/legal.js.map +0 -1
  77. package/dist/entities/market.d.ts +0 -21
  78. package/dist/entities/market.d.ts.map +0 -1
  79. package/dist/entities/market.js +0 -301
  80. package/dist/entities/market.js.map +0 -1
  81. package/dist/entities/marketing.d.ts +0 -67
  82. package/dist/entities/marketing.d.ts.map +0 -1
  83. package/dist/entities/marketing.js +0 -1157
  84. package/dist/entities/marketing.js.map +0 -1
  85. package/dist/entities/offerings.d.ts +0 -51
  86. package/dist/entities/offerings.d.ts.map +0 -1
  87. package/dist/entities/offerings.js +0 -727
  88. package/dist/entities/offerings.js.map +0 -1
  89. package/dist/entities/operations.d.ts +0 -58
  90. package/dist/entities/operations.d.ts.map +0 -1
  91. package/dist/entities/operations.js +0 -787
  92. package/dist/entities/operations.js.map +0 -1
  93. package/dist/entities/organization.d.ts +0 -57
  94. package/dist/entities/organization.d.ts.map +0 -1
  95. package/dist/entities/organization.js +0 -807
  96. package/dist/entities/organization.js.map +0 -1
  97. package/dist/entities/partnerships.d.ts +0 -21
  98. package/dist/entities/partnerships.d.ts.map +0 -1
  99. package/dist/entities/partnerships.js +0 -300
  100. package/dist/entities/partnerships.js.map +0 -1
  101. package/dist/entities/planning.d.ts +0 -87
  102. package/dist/entities/planning.d.ts.map +0 -1
  103. package/dist/entities/planning.js +0 -271
  104. package/dist/entities/planning.js.map +0 -1
  105. package/dist/entities/projects.d.ts +0 -25
  106. package/dist/entities/projects.d.ts.map +0 -1
  107. package/dist/entities/projects.js +0 -349
  108. package/dist/entities/projects.js.map +0 -1
  109. package/dist/entities/risk.d.ts +0 -21
  110. package/dist/entities/risk.d.ts.map +0 -1
  111. package/dist/entities/risk.js +0 -293
  112. package/dist/entities/risk.js.map +0 -1
  113. package/dist/entities/sales.d.ts +0 -72
  114. package/dist/entities/sales.d.ts.map +0 -1
  115. package/dist/entities/sales.js +0 -1248
  116. package/dist/entities/sales.js.map +0 -1
  117. package/dist/financials.d.ts +0 -130
  118. package/dist/financials.d.ts.map +0 -1
  119. package/dist/financials.js +0 -297
  120. package/dist/financials.js.map +0 -1
  121. package/dist/goals.d.ts +0 -87
  122. package/dist/goals.d.ts.map +0 -1
  123. package/dist/goals.js +0 -215
  124. package/dist/goals.js.map +0 -1
  125. package/dist/index.d.ts +0 -97
  126. package/dist/index.d.ts.map +0 -1
  127. package/dist/index.js +0 -132
  128. package/dist/index.js.map +0 -1
  129. package/dist/kpis.d.ts +0 -118
  130. package/dist/kpis.d.ts.map +0 -1
  131. package/dist/kpis.js +0 -232
  132. package/dist/kpis.js.map +0 -1
  133. package/dist/metrics.d.ts +0 -448
  134. package/dist/metrics.d.ts.map +0 -1
  135. package/dist/metrics.js +0 -325
  136. package/dist/metrics.js.map +0 -1
  137. package/dist/okrs.d.ts +0 -123
  138. package/dist/okrs.d.ts.map +0 -1
  139. package/dist/okrs.js +0 -269
  140. package/dist/okrs.js.map +0 -1
  141. package/dist/organization.d.ts +0 -585
  142. package/dist/organization.d.ts.map +0 -1
  143. package/dist/organization.js +0 -173
  144. package/dist/organization.js.map +0 -1
  145. package/dist/process.d.ts +0 -112
  146. package/dist/process.d.ts.map +0 -1
  147. package/dist/process.js +0 -241
  148. package/dist/process.js.map +0 -1
  149. package/dist/product.d.ts +0 -85
  150. package/dist/product.d.ts.map +0 -1
  151. package/dist/product.js +0 -145
  152. package/dist/product.js.map +0 -1
  153. package/dist/queries.d.ts +0 -304
  154. package/dist/queries.d.ts.map +0 -1
  155. package/dist/queries.js +0 -415
  156. package/dist/queries.js.map +0 -1
  157. package/dist/roles.d.ts +0 -340
  158. package/dist/roles.d.ts.map +0 -1
  159. package/dist/roles.js +0 -255
  160. package/dist/roles.js.map +0 -1
  161. package/dist/service.d.ts +0 -61
  162. package/dist/service.d.ts.map +0 -1
  163. package/dist/service.js +0 -140
  164. package/dist/service.js.map +0 -1
  165. package/dist/types.d.ts +0 -459
  166. package/dist/types.d.ts.map +0 -1
  167. package/dist/types.js +0 -5
  168. package/dist/types.js.map +0 -1
  169. package/dist/vision.d.ts +0 -38
  170. package/dist/vision.d.ts.map +0 -1
  171. package/dist/vision.js +0 -68
  172. package/dist/vision.js.map +0 -1
  173. package/dist/workflow.d.ts +0 -115
  174. package/dist/workflow.d.ts.map +0 -1
  175. package/dist/workflow.js +0 -247
  176. package/dist/workflow.js.map +0 -1
  177. package/src/business.js +0 -108
  178. package/src/dollar.js +0 -106
  179. package/src/entities/assets.js +0 -322
  180. package/src/entities/business.js +0 -369
  181. package/src/entities/communication.js +0 -254
  182. package/src/entities/customers.js +0 -988
  183. package/src/entities/financials.js +0 -931
  184. package/src/entities/goals.js +0 -799
  185. package/src/entities/index.js +0 -197
  186. package/src/entities/legal.js +0 -300
  187. package/src/entities/market.js +0 -300
  188. package/src/entities/marketing.js +0 -1156
  189. package/src/entities/offerings.js +0 -726
  190. package/src/entities/operations.js +0 -786
  191. package/src/entities/organization.js +0 -806
  192. package/src/entities/partnerships.js +0 -299
  193. package/src/entities/planning.js +0 -270
  194. package/src/entities/projects.js +0 -348
  195. package/src/entities/risk.js +0 -292
  196. package/src/entities/sales.js +0 -1247
  197. package/src/financials.js +0 -296
  198. package/src/goals.js +0 -214
  199. package/src/index.js +0 -131
  200. package/src/index.test.js +0 -274
  201. package/src/kpis.js +0 -231
  202. package/src/metrics.js +0 -324
  203. package/src/okrs.js +0 -268
  204. package/src/organization.js +0 -172
  205. package/src/process.js +0 -240
  206. package/src/product.js +0 -144
  207. package/src/queries.js +0 -414
  208. package/src/roles.js +0 -254
  209. package/src/service.js +0 -139
  210. package/src/types.js +0 -4
  211. package/src/vision.js +0 -67
  212. package/src/workflow.js +0 -246
@@ -1,1156 +0,0 @@
1
- /**
2
- * Marketing Entity Types (Nouns)
3
- *
4
- * Marketing and demand generation: Campaign, Lead, Audience, Channel, Content, Funnel, Event.
5
- *
6
- * @packageDocumentation
7
- */
8
- // =============================================================================
9
- // Campaign
10
- // =============================================================================
11
- /**
12
- * Campaign entity
13
- *
14
- * Represents a marketing campaign.
15
- */
16
- export const Campaign = {
17
- singular: 'campaign',
18
- plural: 'campaigns',
19
- description: 'A marketing campaign',
20
- properties: {
21
- // Identity
22
- name: {
23
- type: 'string',
24
- description: 'Campaign name',
25
- },
26
- description: {
27
- type: 'string',
28
- optional: true,
29
- description: 'Campaign description',
30
- },
31
- slug: {
32
- type: 'string',
33
- optional: true,
34
- description: 'URL slug',
35
- },
36
- // Type
37
- type: {
38
- type: 'string',
39
- description: 'Campaign type',
40
- examples: ['email', 'paid-ads', 'content', 'social', 'event', 'webinar', 'product-launch', 'referral', 'abm', 'outbound'],
41
- },
42
- channel: {
43
- type: 'string',
44
- optional: true,
45
- description: 'Primary channel',
46
- examples: ['email', 'google-ads', 'facebook', 'linkedin', 'twitter', 'youtube', 'podcast', 'blog', 'seo'],
47
- },
48
- // Objective
49
- objective: {
50
- type: 'string',
51
- optional: true,
52
- description: 'Campaign objective',
53
- examples: ['awareness', 'consideration', 'conversion', 'retention', 'expansion'],
54
- },
55
- goals: {
56
- type: 'string',
57
- array: true,
58
- optional: true,
59
- description: 'Campaign goals',
60
- },
61
- // Timeline
62
- startDate: {
63
- type: 'date',
64
- optional: true,
65
- description: 'Start date',
66
- },
67
- endDate: {
68
- type: 'date',
69
- optional: true,
70
- description: 'End date',
71
- },
72
- // Budget
73
- budget: {
74
- type: 'number',
75
- optional: true,
76
- description: 'Campaign budget',
77
- },
78
- spent: {
79
- type: 'number',
80
- optional: true,
81
- description: 'Amount spent',
82
- },
83
- currency: {
84
- type: 'string',
85
- optional: true,
86
- description: 'Currency code',
87
- },
88
- // Targeting
89
- targetPersonas: {
90
- type: 'string',
91
- array: true,
92
- optional: true,
93
- description: 'Target personas',
94
- },
95
- targetSegments: {
96
- type: 'string',
97
- array: true,
98
- optional: true,
99
- description: 'Target segments',
100
- },
101
- targetGeo: {
102
- type: 'string',
103
- array: true,
104
- optional: true,
105
- description: 'Target geographies',
106
- },
107
- // Performance
108
- impressions: {
109
- type: 'number',
110
- optional: true,
111
- description: 'Total impressions',
112
- },
113
- clicks: {
114
- type: 'number',
115
- optional: true,
116
- description: 'Total clicks',
117
- },
118
- ctr: {
119
- type: 'number',
120
- optional: true,
121
- description: 'Click-through rate',
122
- },
123
- leads: {
124
- type: 'number',
125
- optional: true,
126
- description: 'Leads generated',
127
- },
128
- conversions: {
129
- type: 'number',
130
- optional: true,
131
- description: 'Conversions',
132
- },
133
- revenue: {
134
- type: 'number',
135
- optional: true,
136
- description: 'Revenue attributed',
137
- },
138
- roi: {
139
- type: 'number',
140
- optional: true,
141
- description: 'Return on investment',
142
- },
143
- cpl: {
144
- type: 'number',
145
- optional: true,
146
- description: 'Cost per lead',
147
- },
148
- cac: {
149
- type: 'number',
150
- optional: true,
151
- description: 'Customer acquisition cost',
152
- },
153
- // UTM
154
- utmSource: {
155
- type: 'string',
156
- optional: true,
157
- description: 'UTM source',
158
- },
159
- utmMedium: {
160
- type: 'string',
161
- optional: true,
162
- description: 'UTM medium',
163
- },
164
- utmCampaign: {
165
- type: 'string',
166
- optional: true,
167
- description: 'UTM campaign',
168
- },
169
- // Status
170
- status: {
171
- type: 'string',
172
- description: 'Campaign status',
173
- examples: ['draft', 'scheduled', 'active', 'paused', 'completed', 'cancelled'],
174
- },
175
- },
176
- relationships: {
177
- owner: {
178
- type: 'Worker',
179
- required: false,
180
- description: 'Campaign owner',
181
- },
182
- team: {
183
- type: 'Team',
184
- required: false,
185
- description: 'Marketing team',
186
- },
187
- audiences: {
188
- type: 'Audience[]',
189
- description: 'Target audiences',
190
- },
191
- content: {
192
- type: 'Content[]',
193
- description: 'Campaign content',
194
- },
195
- leads: {
196
- type: 'Lead[]',
197
- description: 'Generated leads',
198
- },
199
- events: {
200
- type: 'MarketingEvent[]',
201
- description: 'Associated events',
202
- },
203
- },
204
- actions: [
205
- 'create',
206
- 'update',
207
- 'schedule',
208
- 'launch',
209
- 'pause',
210
- 'resume',
211
- 'complete',
212
- 'cancel',
213
- 'duplicate',
214
- 'archive',
215
- ],
216
- events: [
217
- 'created',
218
- 'updated',
219
- 'scheduled',
220
- 'launched',
221
- 'paused',
222
- 'resumed',
223
- 'completed',
224
- 'cancelled',
225
- 'duplicated',
226
- 'archived',
227
- ],
228
- };
229
- // =============================================================================
230
- // Lead
231
- // =============================================================================
232
- /**
233
- * Lead entity
234
- *
235
- * Represents a marketing lead.
236
- */
237
- export const Lead = {
238
- singular: 'lead',
239
- plural: 'leads',
240
- description: 'A marketing lead',
241
- properties: {
242
- // Identity
243
- email: {
244
- type: 'string',
245
- description: 'Email address',
246
- },
247
- firstName: {
248
- type: 'string',
249
- optional: true,
250
- description: 'First name',
251
- },
252
- lastName: {
253
- type: 'string',
254
- optional: true,
255
- description: 'Last name',
256
- },
257
- phone: {
258
- type: 'string',
259
- optional: true,
260
- description: 'Phone number',
261
- },
262
- // Company
263
- company: {
264
- type: 'string',
265
- optional: true,
266
- description: 'Company name',
267
- },
268
- title: {
269
- type: 'string',
270
- optional: true,
271
- description: 'Job title',
272
- },
273
- industry: {
274
- type: 'string',
275
- optional: true,
276
- description: 'Industry',
277
- },
278
- companySize: {
279
- type: 'string',
280
- optional: true,
281
- description: 'Company size',
282
- },
283
- website: {
284
- type: 'url',
285
- optional: true,
286
- description: 'Website URL',
287
- },
288
- // Source
289
- source: {
290
- type: 'string',
291
- description: 'Lead source',
292
- examples: ['organic', 'paid', 'referral', 'partner', 'event', 'webinar', 'content', 'outbound', 'social'],
293
- },
294
- medium: {
295
- type: 'string',
296
- optional: true,
297
- description: 'Source medium',
298
- },
299
- campaignId: {
300
- type: 'string',
301
- optional: true,
302
- description: 'Source campaign',
303
- },
304
- referrer: {
305
- type: 'string',
306
- optional: true,
307
- description: 'Referrer URL',
308
- },
309
- landingPage: {
310
- type: 'string',
311
- optional: true,
312
- description: 'Landing page URL',
313
- },
314
- // UTM
315
- utmSource: {
316
- type: 'string',
317
- optional: true,
318
- description: 'UTM source',
319
- },
320
- utmMedium: {
321
- type: 'string',
322
- optional: true,
323
- description: 'UTM medium',
324
- },
325
- utmCampaign: {
326
- type: 'string',
327
- optional: true,
328
- description: 'UTM campaign',
329
- },
330
- utmTerm: {
331
- type: 'string',
332
- optional: true,
333
- description: 'UTM term',
334
- },
335
- utmContent: {
336
- type: 'string',
337
- optional: true,
338
- description: 'UTM content',
339
- },
340
- // Scoring
341
- score: {
342
- type: 'number',
343
- optional: true,
344
- description: 'Lead score',
345
- },
346
- grade: {
347
- type: 'string',
348
- optional: true,
349
- description: 'Lead grade',
350
- examples: ['A', 'B', 'C', 'D', 'F'],
351
- },
352
- fit: {
353
- type: 'string',
354
- optional: true,
355
- description: 'Fit score',
356
- examples: ['ideal', 'good', 'moderate', 'poor'],
357
- },
358
- intent: {
359
- type: 'string',
360
- optional: true,
361
- description: 'Intent level',
362
- examples: ['high', 'medium', 'low'],
363
- },
364
- // Lifecycle
365
- stage: {
366
- type: 'string',
367
- description: 'Lead stage',
368
- examples: ['new', 'engaged', 'mql', 'sql', 'opportunity', 'customer', 'disqualified'],
369
- },
370
- qualifiedAt: {
371
- type: 'datetime',
372
- optional: true,
373
- description: 'MQL date',
374
- },
375
- convertedAt: {
376
- type: 'datetime',
377
- optional: true,
378
- description: 'Conversion date',
379
- },
380
- // Location
381
- country: {
382
- type: 'string',
383
- optional: true,
384
- description: 'Country',
385
- },
386
- region: {
387
- type: 'string',
388
- optional: true,
389
- description: 'Region',
390
- },
391
- city: {
392
- type: 'string',
393
- optional: true,
394
- description: 'City',
395
- },
396
- timezone: {
397
- type: 'string',
398
- optional: true,
399
- description: 'Timezone',
400
- },
401
- // Consent
402
- marketingConsent: {
403
- type: 'boolean',
404
- optional: true,
405
- description: 'Marketing consent',
406
- },
407
- consentDate: {
408
- type: 'datetime',
409
- optional: true,
410
- description: 'Consent date',
411
- },
412
- // Tags
413
- tags: {
414
- type: 'string',
415
- array: true,
416
- optional: true,
417
- description: 'Tags',
418
- },
419
- // Status
420
- status: {
421
- type: 'string',
422
- description: 'Lead status',
423
- examples: ['active', 'nurturing', 'converted', 'disqualified', 'unsubscribed'],
424
- },
425
- },
426
- relationships: {
427
- campaign: {
428
- type: 'Campaign',
429
- required: false,
430
- description: 'Source campaign',
431
- },
432
- owner: {
433
- type: 'Worker',
434
- required: false,
435
- description: 'Lead owner',
436
- },
437
- customer: {
438
- type: 'Customer',
439
- required: false,
440
- description: 'Converted customer',
441
- },
442
- deal: {
443
- type: 'Deal',
444
- required: false,
445
- description: 'Associated deal',
446
- },
447
- audiences: {
448
- type: 'Audience[]',
449
- description: 'Member of audiences',
450
- },
451
- interactions: {
452
- type: 'Interaction[]',
453
- description: 'Interactions',
454
- },
455
- },
456
- actions: [
457
- 'create',
458
- 'update',
459
- 'score',
460
- 'qualify',
461
- 'assignOwner',
462
- 'nurture',
463
- 'convert',
464
- 'disqualify',
465
- 'merge',
466
- 'archive',
467
- ],
468
- events: [
469
- 'created',
470
- 'updated',
471
- 'scored',
472
- 'qualified',
473
- 'ownerAssigned',
474
- 'nurtured',
475
- 'converted',
476
- 'disqualified',
477
- 'merged',
478
- 'unsubscribed',
479
- 'archived',
480
- ],
481
- };
482
- // =============================================================================
483
- // Audience
484
- // =============================================================================
485
- /**
486
- * Audience entity
487
- *
488
- * Represents a marketing audience.
489
- */
490
- export const Audience = {
491
- singular: 'audience',
492
- plural: 'audiences',
493
- description: 'A marketing audience',
494
- properties: {
495
- // Identity
496
- name: {
497
- type: 'string',
498
- description: 'Audience name',
499
- },
500
- description: {
501
- type: 'string',
502
- optional: true,
503
- description: 'Audience description',
504
- },
505
- // Type
506
- type: {
507
- type: 'string',
508
- description: 'Audience type',
509
- examples: ['static', 'dynamic', 'lookalike', 'retargeting', 'suppression'],
510
- },
511
- source: {
512
- type: 'string',
513
- optional: true,
514
- description: 'Audience source',
515
- examples: ['crm', 'website', 'import', 'integration', 'ad-platform'],
516
- },
517
- // Criteria
518
- criteria: {
519
- type: 'json',
520
- optional: true,
521
- description: 'Audience criteria/filters',
522
- },
523
- criteriaDescription: {
524
- type: 'string',
525
- optional: true,
526
- description: 'Human-readable criteria',
527
- },
528
- // Size
529
- size: {
530
- type: 'number',
531
- optional: true,
532
- description: 'Audience size',
533
- },
534
- lastSyncedAt: {
535
- type: 'datetime',
536
- optional: true,
537
- description: 'Last sync time',
538
- },
539
- // Sync
540
- syncToFacebook: {
541
- type: 'boolean',
542
- optional: true,
543
- description: 'Sync to Facebook',
544
- },
545
- syncToGoogle: {
546
- type: 'boolean',
547
- optional: true,
548
- description: 'Sync to Google',
549
- },
550
- syncToLinkedIn: {
551
- type: 'boolean',
552
- optional: true,
553
- description: 'Sync to LinkedIn',
554
- },
555
- // Status
556
- status: {
557
- type: 'string',
558
- description: 'Audience status',
559
- examples: ['active', 'building', 'inactive', 'archived'],
560
- },
561
- },
562
- relationships: {
563
- campaigns: {
564
- type: 'Campaign[]',
565
- description: 'Campaigns using this audience',
566
- },
567
- leads: {
568
- type: 'Lead[]',
569
- description: 'Leads in audience',
570
- },
571
- customers: {
572
- type: 'Customer[]',
573
- description: 'Customers in audience',
574
- },
575
- segment: {
576
- type: 'Segment',
577
- required: false,
578
- description: 'Based on segment',
579
- },
580
- },
581
- actions: [
582
- 'create',
583
- 'update',
584
- 'refresh',
585
- 'sync',
586
- 'addMember',
587
- 'removeMember',
588
- 'archive',
589
- ],
590
- events: [
591
- 'created',
592
- 'updated',
593
- 'refreshed',
594
- 'synced',
595
- 'memberAdded',
596
- 'memberRemoved',
597
- 'archived',
598
- ],
599
- };
600
- // =============================================================================
601
- // Content
602
- // =============================================================================
603
- /**
604
- * Content entity
605
- *
606
- * Represents marketing content.
607
- */
608
- export const Content = {
609
- singular: 'content',
610
- plural: 'contents',
611
- description: 'Marketing content',
612
- properties: {
613
- // Identity
614
- title: {
615
- type: 'string',
616
- description: 'Content title',
617
- },
618
- slug: {
619
- type: 'string',
620
- optional: true,
621
- description: 'URL slug',
622
- },
623
- description: {
624
- type: 'string',
625
- optional: true,
626
- description: 'Content description',
627
- },
628
- // Type
629
- type: {
630
- type: 'string',
631
- description: 'Content type',
632
- examples: ['blog-post', 'ebook', 'whitepaper', 'case-study', 'video', 'webinar', 'podcast', 'infographic', 'template', 'guide', 'landing-page', 'email'],
633
- },
634
- format: {
635
- type: 'string',
636
- optional: true,
637
- description: 'Content format',
638
- examples: ['text', 'video', 'audio', 'image', 'pdf', 'interactive'],
639
- },
640
- // Body
641
- body: {
642
- type: 'markdown',
643
- optional: true,
644
- description: 'Content body',
645
- },
646
- excerpt: {
647
- type: 'string',
648
- optional: true,
649
- description: 'Content excerpt',
650
- },
651
- // Media
652
- featuredImage: {
653
- type: 'url',
654
- optional: true,
655
- description: 'Featured image URL',
656
- },
657
- mediaUrl: {
658
- type: 'url',
659
- optional: true,
660
- description: 'Media URL (video, audio, etc.)',
661
- },
662
- // SEO
663
- metaTitle: {
664
- type: 'string',
665
- optional: true,
666
- description: 'Meta title',
667
- },
668
- metaDescription: {
669
- type: 'string',
670
- optional: true,
671
- description: 'Meta description',
672
- },
673
- keywords: {
674
- type: 'string',
675
- array: true,
676
- optional: true,
677
- description: 'Target keywords',
678
- },
679
- // Targeting
680
- targetPersonas: {
681
- type: 'string',
682
- array: true,
683
- optional: true,
684
- description: 'Target personas',
685
- },
686
- funnelStage: {
687
- type: 'string',
688
- optional: true,
689
- description: 'Funnel stage',
690
- examples: ['awareness', 'consideration', 'decision', 'retention'],
691
- },
692
- // Publishing
693
- publishedAt: {
694
- type: 'datetime',
695
- optional: true,
696
- description: 'Publish date',
697
- },
698
- expiresAt: {
699
- type: 'datetime',
700
- optional: true,
701
- description: 'Expiration date',
702
- },
703
- // Performance
704
- views: {
705
- type: 'number',
706
- optional: true,
707
- description: 'Total views',
708
- },
709
- uniqueViews: {
710
- type: 'number',
711
- optional: true,
712
- description: 'Unique views',
713
- },
714
- downloads: {
715
- type: 'number',
716
- optional: true,
717
- description: 'Downloads (for gated content)',
718
- },
719
- shares: {
720
- type: 'number',
721
- optional: true,
722
- description: 'Social shares',
723
- },
724
- avgTimeOnPage: {
725
- type: 'number',
726
- optional: true,
727
- description: 'Average time on page (seconds)',
728
- },
729
- // Gating
730
- isGated: {
731
- type: 'boolean',
732
- optional: true,
733
- description: 'Requires form fill',
734
- },
735
- // Tags
736
- tags: {
737
- type: 'string',
738
- array: true,
739
- optional: true,
740
- description: 'Tags',
741
- },
742
- categories: {
743
- type: 'string',
744
- array: true,
745
- optional: true,
746
- description: 'Categories',
747
- },
748
- // Status
749
- status: {
750
- type: 'string',
751
- description: 'Content status',
752
- examples: ['draft', 'review', 'scheduled', 'published', 'archived'],
753
- },
754
- },
755
- relationships: {
756
- author: {
757
- type: 'Worker',
758
- required: false,
759
- description: 'Content author',
760
- },
761
- campaigns: {
762
- type: 'Campaign[]',
763
- description: 'Associated campaigns',
764
- },
765
- personas: {
766
- type: 'Persona[]',
767
- description: 'Target personas',
768
- },
769
- },
770
- actions: [
771
- 'create',
772
- 'update',
773
- 'submit',
774
- 'approve',
775
- 'schedule',
776
- 'publish',
777
- 'unpublish',
778
- 'duplicate',
779
- 'archive',
780
- ],
781
- events: [
782
- 'created',
783
- 'updated',
784
- 'submitted',
785
- 'approved',
786
- 'scheduled',
787
- 'published',
788
- 'unpublished',
789
- 'duplicated',
790
- 'archived',
791
- ],
792
- };
793
- // =============================================================================
794
- // Funnel
795
- // =============================================================================
796
- /**
797
- * Funnel entity
798
- *
799
- * Represents a marketing/sales funnel.
800
- */
801
- export const Funnel = {
802
- singular: 'funnel',
803
- plural: 'funnels',
804
- description: 'A marketing or sales funnel',
805
- properties: {
806
- // Identity
807
- name: {
808
- type: 'string',
809
- description: 'Funnel name',
810
- },
811
- description: {
812
- type: 'string',
813
- optional: true,
814
- description: 'Funnel description',
815
- },
816
- // Type
817
- type: {
818
- type: 'string',
819
- optional: true,
820
- description: 'Funnel type',
821
- examples: ['marketing', 'sales', 'product', 'onboarding', 'conversion'],
822
- },
823
- // Metrics (top-level)
824
- totalEntries: {
825
- type: 'number',
826
- optional: true,
827
- description: 'Total funnel entries',
828
- },
829
- totalConversions: {
830
- type: 'number',
831
- optional: true,
832
- description: 'Total conversions',
833
- },
834
- conversionRate: {
835
- type: 'number',
836
- optional: true,
837
- description: 'Overall conversion rate',
838
- },
839
- avgTimeToConvert: {
840
- type: 'number',
841
- optional: true,
842
- description: 'Average time to convert (hours)',
843
- },
844
- // Status
845
- status: {
846
- type: 'string',
847
- description: 'Funnel status',
848
- examples: ['active', 'inactive', 'archived'],
849
- },
850
- },
851
- relationships: {
852
- stages: {
853
- type: 'FunnelStage[]',
854
- description: 'Funnel stages',
855
- },
856
- campaigns: {
857
- type: 'Campaign[]',
858
- description: 'Associated campaigns',
859
- },
860
- },
861
- actions: [
862
- 'create',
863
- 'update',
864
- 'addStage',
865
- 'removeStage',
866
- 'reorderStages',
867
- 'archive',
868
- ],
869
- events: [
870
- 'created',
871
- 'updated',
872
- 'stageAdded',
873
- 'stageRemoved',
874
- 'stagesReordered',
875
- 'archived',
876
- ],
877
- };
878
- // =============================================================================
879
- // FunnelStage
880
- // =============================================================================
881
- /**
882
- * FunnelStage entity
883
- *
884
- * Represents a stage in a funnel.
885
- */
886
- export const FunnelStage = {
887
- singular: 'funnel-stage',
888
- plural: 'funnel-stages',
889
- description: 'A stage in a marketing/sales funnel',
890
- properties: {
891
- // Identity
892
- name: {
893
- type: 'string',
894
- description: 'Stage name',
895
- },
896
- description: {
897
- type: 'string',
898
- optional: true,
899
- description: 'Stage description',
900
- },
901
- // Order
902
- order: {
903
- type: 'number',
904
- description: 'Stage order',
905
- },
906
- // Metrics
907
- entries: {
908
- type: 'number',
909
- optional: true,
910
- description: 'Entries to this stage',
911
- },
912
- exits: {
913
- type: 'number',
914
- optional: true,
915
- description: 'Exits from this stage',
916
- },
917
- conversionRate: {
918
- type: 'number',
919
- optional: true,
920
- description: 'Conversion to next stage',
921
- },
922
- dropoffRate: {
923
- type: 'number',
924
- optional: true,
925
- description: 'Drop-off rate',
926
- },
927
- avgTimeInStage: {
928
- type: 'number',
929
- optional: true,
930
- description: 'Average time in stage (hours)',
931
- },
932
- // Goals
933
- targetConversionRate: {
934
- type: 'number',
935
- optional: true,
936
- description: 'Target conversion rate',
937
- },
938
- },
939
- relationships: {
940
- funnel: {
941
- type: 'Funnel',
942
- description: 'Parent funnel',
943
- },
944
- },
945
- actions: [
946
- 'create',
947
- 'update',
948
- 'move',
949
- 'delete',
950
- ],
951
- events: [
952
- 'created',
953
- 'updated',
954
- 'moved',
955
- 'deleted',
956
- ],
957
- };
958
- // =============================================================================
959
- // MarketingEvent
960
- // =============================================================================
961
- /**
962
- * MarketingEvent entity
963
- *
964
- * Represents a marketing event (webinar, conference, meetup).
965
- */
966
- export const MarketingEvent = {
967
- singular: 'marketing-event',
968
- plural: 'marketing-events',
969
- description: 'A marketing event (webinar, conference, meetup)',
970
- properties: {
971
- // Identity
972
- name: {
973
- type: 'string',
974
- description: 'Event name',
975
- },
976
- description: {
977
- type: 'string',
978
- optional: true,
979
- description: 'Event description',
980
- },
981
- slug: {
982
- type: 'string',
983
- optional: true,
984
- description: 'URL slug',
985
- },
986
- // Type
987
- type: {
988
- type: 'string',
989
- description: 'Event type',
990
- examples: ['webinar', 'conference', 'meetup', 'workshop', 'demo-day', 'trade-show', 'virtual-event', 'hybrid'],
991
- },
992
- format: {
993
- type: 'string',
994
- optional: true,
995
- description: 'Event format',
996
- examples: ['in-person', 'virtual', 'hybrid'],
997
- },
998
- // Schedule
999
- startDate: {
1000
- type: 'datetime',
1001
- description: 'Start date/time',
1002
- },
1003
- endDate: {
1004
- type: 'datetime',
1005
- optional: true,
1006
- description: 'End date/time',
1007
- },
1008
- timezone: {
1009
- type: 'string',
1010
- optional: true,
1011
- description: 'Timezone',
1012
- },
1013
- duration: {
1014
- type: 'number',
1015
- optional: true,
1016
- description: 'Duration in minutes',
1017
- },
1018
- // Location
1019
- location: {
1020
- type: 'string',
1021
- optional: true,
1022
- description: 'Physical location',
1023
- },
1024
- virtualUrl: {
1025
- type: 'url',
1026
- optional: true,
1027
- description: 'Virtual event URL',
1028
- },
1029
- // Capacity
1030
- capacity: {
1031
- type: 'number',
1032
- optional: true,
1033
- description: 'Max capacity',
1034
- },
1035
- registrations: {
1036
- type: 'number',
1037
- optional: true,
1038
- description: 'Total registrations',
1039
- },
1040
- attendees: {
1041
- type: 'number',
1042
- optional: true,
1043
- description: 'Actual attendees',
1044
- },
1045
- attendanceRate: {
1046
- type: 'number',
1047
- optional: true,
1048
- description: 'Attendance rate',
1049
- },
1050
- // Budget
1051
- budget: {
1052
- type: 'number',
1053
- optional: true,
1054
- description: 'Event budget',
1055
- },
1056
- actualCost: {
1057
- type: 'number',
1058
- optional: true,
1059
- description: 'Actual cost',
1060
- },
1061
- currency: {
1062
- type: 'string',
1063
- optional: true,
1064
- description: 'Currency code',
1065
- },
1066
- // Results
1067
- leadsGenerated: {
1068
- type: 'number',
1069
- optional: true,
1070
- description: 'Leads generated',
1071
- },
1072
- pipelineGenerated: {
1073
- type: 'number',
1074
- optional: true,
1075
- description: 'Pipeline generated',
1076
- },
1077
- revenueAttributed: {
1078
- type: 'number',
1079
- optional: true,
1080
- description: 'Revenue attributed',
1081
- },
1082
- // Recording
1083
- recordingUrl: {
1084
- type: 'url',
1085
- optional: true,
1086
- description: 'Recording URL',
1087
- },
1088
- // Status
1089
- status: {
1090
- type: 'string',
1091
- description: 'Event status',
1092
- examples: ['draft', 'scheduled', 'registration-open', 'live', 'completed', 'cancelled'],
1093
- },
1094
- },
1095
- relationships: {
1096
- campaign: {
1097
- type: 'Campaign',
1098
- required: false,
1099
- description: 'Parent campaign',
1100
- },
1101
- owner: {
1102
- type: 'Worker',
1103
- required: false,
1104
- description: 'Event owner',
1105
- },
1106
- speakers: {
1107
- type: 'Worker[]',
1108
- description: 'Speakers',
1109
- },
1110
- registrants: {
1111
- type: 'Lead[]',
1112
- description: 'Registrants',
1113
- },
1114
- },
1115
- actions: [
1116
- 'create',
1117
- 'update',
1118
- 'schedule',
1119
- 'openRegistration',
1120
- 'closeRegistration',
1121
- 'start',
1122
- 'end',
1123
- 'cancel',
1124
- 'archive',
1125
- ],
1126
- events: [
1127
- 'created',
1128
- 'updated',
1129
- 'scheduled',
1130
- 'registrationOpened',
1131
- 'registrationClosed',
1132
- 'started',
1133
- 'ended',
1134
- 'cancelled',
1135
- 'archived',
1136
- ],
1137
- };
1138
- // =============================================================================
1139
- // Exports
1140
- // =============================================================================
1141
- export const MarketingEntities = {
1142
- Campaign,
1143
- Lead,
1144
- Audience,
1145
- Content,
1146
- Funnel,
1147
- FunnelStage,
1148
- MarketingEvent,
1149
- };
1150
- export const MarketingCategories = {
1151
- campaigns: ['Campaign'],
1152
- leads: ['Lead', 'Audience'],
1153
- content: ['Content'],
1154
- funnels: ['Funnel', 'FunnelStage'],
1155
- events: ['MarketingEvent'],
1156
- };