business-as-code 0.2.1 → 2.0.2

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 (190) hide show
  1. package/.turbo/turbo-build.log +5 -0
  2. package/CHANGELOG.md +17 -0
  3. package/IMPLEMENTATION.md +226 -0
  4. package/README.md +1133 -193
  5. package/dist/business.d.ts +62 -0
  6. package/dist/business.d.ts.map +1 -0
  7. package/dist/business.js +109 -0
  8. package/dist/business.js.map +1 -0
  9. package/dist/dollar.d.ts +60 -0
  10. package/dist/dollar.d.ts.map +1 -0
  11. package/dist/dollar.js +107 -0
  12. package/dist/dollar.js.map +1 -0
  13. package/dist/entities/assets.d.ts +21 -0
  14. package/dist/entities/assets.d.ts.map +1 -0
  15. package/dist/entities/assets.js +323 -0
  16. package/dist/entities/assets.js.map +1 -0
  17. package/dist/entities/business.d.ts +36 -0
  18. package/dist/entities/business.d.ts.map +1 -0
  19. package/dist/entities/business.js +370 -0
  20. package/dist/entities/business.js.map +1 -0
  21. package/dist/entities/communication.d.ts +21 -0
  22. package/dist/entities/communication.d.ts.map +1 -0
  23. package/dist/entities/communication.js +255 -0
  24. package/dist/entities/communication.js.map +1 -0
  25. package/dist/entities/customers.d.ts +58 -0
  26. package/dist/entities/customers.d.ts.map +1 -0
  27. package/dist/entities/customers.js +989 -0
  28. package/dist/entities/customers.js.map +1 -0
  29. package/dist/entities/financials.d.ts +59 -0
  30. package/dist/entities/financials.d.ts.map +1 -0
  31. package/dist/entities/financials.js +932 -0
  32. package/dist/entities/financials.js.map +1 -0
  33. package/dist/entities/goals.d.ts +58 -0
  34. package/dist/entities/goals.d.ts.map +1 -0
  35. package/dist/entities/goals.js +800 -0
  36. package/dist/entities/goals.js.map +1 -0
  37. package/dist/entities/index.d.ts +299 -0
  38. package/dist/entities/index.d.ts.map +1 -0
  39. package/dist/entities/index.js +198 -0
  40. package/dist/entities/index.js.map +1 -0
  41. package/dist/entities/legal.d.ts +21 -0
  42. package/dist/entities/legal.d.ts.map +1 -0
  43. package/dist/entities/legal.js +301 -0
  44. package/dist/entities/legal.js.map +1 -0
  45. package/dist/entities/market.d.ts +21 -0
  46. package/dist/entities/market.d.ts.map +1 -0
  47. package/dist/entities/market.js +301 -0
  48. package/dist/entities/market.js.map +1 -0
  49. package/dist/entities/marketing.d.ts +67 -0
  50. package/dist/entities/marketing.d.ts.map +1 -0
  51. package/dist/entities/marketing.js +1157 -0
  52. package/dist/entities/marketing.js.map +1 -0
  53. package/dist/entities/offerings.d.ts +51 -0
  54. package/dist/entities/offerings.d.ts.map +1 -0
  55. package/dist/entities/offerings.js +727 -0
  56. package/dist/entities/offerings.js.map +1 -0
  57. package/dist/entities/operations.d.ts +58 -0
  58. package/dist/entities/operations.d.ts.map +1 -0
  59. package/dist/entities/operations.js +787 -0
  60. package/dist/entities/operations.js.map +1 -0
  61. package/dist/entities/organization.d.ts +57 -0
  62. package/dist/entities/organization.d.ts.map +1 -0
  63. package/dist/entities/organization.js +807 -0
  64. package/dist/entities/organization.js.map +1 -0
  65. package/dist/entities/partnerships.d.ts +21 -0
  66. package/dist/entities/partnerships.d.ts.map +1 -0
  67. package/dist/entities/partnerships.js +300 -0
  68. package/dist/entities/partnerships.js.map +1 -0
  69. package/dist/entities/planning.d.ts +87 -0
  70. package/dist/entities/planning.d.ts.map +1 -0
  71. package/dist/entities/planning.js +271 -0
  72. package/dist/entities/planning.js.map +1 -0
  73. package/dist/entities/projects.d.ts +25 -0
  74. package/dist/entities/projects.d.ts.map +1 -0
  75. package/dist/entities/projects.js +349 -0
  76. package/dist/entities/projects.js.map +1 -0
  77. package/dist/entities/risk.d.ts +21 -0
  78. package/dist/entities/risk.d.ts.map +1 -0
  79. package/dist/entities/risk.js +293 -0
  80. package/dist/entities/risk.js.map +1 -0
  81. package/dist/entities/sales.d.ts +72 -0
  82. package/dist/entities/sales.d.ts.map +1 -0
  83. package/dist/entities/sales.js +1248 -0
  84. package/dist/entities/sales.js.map +1 -0
  85. package/dist/financials.d.ts +130 -0
  86. package/dist/financials.d.ts.map +1 -0
  87. package/dist/financials.js +297 -0
  88. package/dist/financials.js.map +1 -0
  89. package/dist/goals.d.ts +87 -0
  90. package/dist/goals.d.ts.map +1 -0
  91. package/dist/goals.js +215 -0
  92. package/dist/goals.js.map +1 -0
  93. package/dist/index.d.ts +97 -4
  94. package/dist/index.d.ts.map +1 -0
  95. package/dist/index.js +131 -1079
  96. package/dist/index.js.map +1 -1
  97. package/dist/kpis.d.ts +118 -0
  98. package/dist/kpis.d.ts.map +1 -0
  99. package/dist/kpis.js +232 -0
  100. package/dist/kpis.js.map +1 -0
  101. package/dist/metrics.d.ts +448 -0
  102. package/dist/metrics.d.ts.map +1 -0
  103. package/dist/metrics.js +325 -0
  104. package/dist/metrics.js.map +1 -0
  105. package/dist/okrs.d.ts +123 -0
  106. package/dist/okrs.d.ts.map +1 -0
  107. package/dist/okrs.js +269 -0
  108. package/dist/okrs.js.map +1 -0
  109. package/dist/organization.d.ts +585 -0
  110. package/dist/organization.d.ts.map +1 -0
  111. package/dist/organization.js +173 -0
  112. package/dist/organization.js.map +1 -0
  113. package/dist/process.d.ts +112 -0
  114. package/dist/process.d.ts.map +1 -0
  115. package/dist/process.js +241 -0
  116. package/dist/process.js.map +1 -0
  117. package/dist/product.d.ts +85 -0
  118. package/dist/product.d.ts.map +1 -0
  119. package/dist/product.js +145 -0
  120. package/dist/product.js.map +1 -0
  121. package/dist/queries.d.ts +304 -0
  122. package/dist/queries.d.ts.map +1 -0
  123. package/dist/queries.js +415 -0
  124. package/dist/queries.js.map +1 -0
  125. package/dist/roles.d.ts +340 -0
  126. package/dist/roles.d.ts.map +1 -0
  127. package/dist/roles.js +255 -0
  128. package/dist/roles.js.map +1 -0
  129. package/dist/service.d.ts +61 -0
  130. package/dist/service.d.ts.map +1 -0
  131. package/dist/service.js +140 -0
  132. package/dist/service.js.map +1 -0
  133. package/dist/types.d.ts +459 -0
  134. package/dist/types.d.ts.map +1 -0
  135. package/dist/types.js +5 -0
  136. package/dist/types.js.map +1 -0
  137. package/dist/vision.d.ts +38 -0
  138. package/dist/vision.d.ts.map +1 -0
  139. package/dist/vision.js +68 -0
  140. package/dist/vision.js.map +1 -0
  141. package/dist/workflow.d.ts +115 -0
  142. package/dist/workflow.d.ts.map +1 -0
  143. package/dist/workflow.js +247 -0
  144. package/dist/workflow.js.map +1 -0
  145. package/examples/basic-usage.ts +307 -0
  146. package/package.json +19 -60
  147. package/src/business.ts +121 -0
  148. package/src/dollar.ts +132 -0
  149. package/src/entities/assets.ts +332 -0
  150. package/src/entities/business.ts +406 -0
  151. package/src/entities/communication.ts +264 -0
  152. package/src/entities/customers.ts +1072 -0
  153. package/src/entities/financials.ts +1011 -0
  154. package/src/entities/goals.ts +871 -0
  155. package/src/entities/index.ts +383 -0
  156. package/src/entities/legal.ts +310 -0
  157. package/src/entities/market.ts +310 -0
  158. package/src/entities/marketing.ts +1249 -0
  159. package/src/entities/offerings.ts +789 -0
  160. package/src/entities/operations.ts +861 -0
  161. package/src/entities/organization.ts +876 -0
  162. package/src/entities/partnerships.ts +309 -0
  163. package/src/entities/planning.ts +307 -0
  164. package/src/entities/projects.ts +360 -0
  165. package/src/entities/risk.ts +302 -0
  166. package/src/entities/sales.ts +1352 -0
  167. package/src/financials.ts +352 -0
  168. package/src/goals.ts +250 -0
  169. package/src/index.test.ts +336 -0
  170. package/src/index.ts +530 -0
  171. package/src/kpis.ts +275 -0
  172. package/src/metrics.ts +825 -0
  173. package/src/okrs.ts +325 -0
  174. package/src/organization.ts +909 -0
  175. package/src/process.ts +272 -0
  176. package/src/product.ts +178 -0
  177. package/src/queries.ts +767 -0
  178. package/src/roles.ts +686 -0
  179. package/src/service.ts +164 -0
  180. package/src/types.ts +493 -0
  181. package/src/vision.ts +88 -0
  182. package/src/workflow.ts +280 -0
  183. package/tsconfig.json +9 -0
  184. package/dist/loaders/index.d.ts +0 -174
  185. package/dist/loaders/index.js +0 -366
  186. package/dist/loaders/index.js.map +0 -1
  187. package/dist/schema/index.d.ts +0 -146
  188. package/dist/schema/index.js +0 -716
  189. package/dist/schema/index.js.map +0 -1
  190. package/dist/types-CJ9eGS_C.d.ts +0 -86
@@ -0,0 +1,1157 @@
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
+ };
1157
+ //# sourceMappingURL=marketing.js.map