@happyvertical/smrt-marketing 0.39.16

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 (67) hide show
  1. package/AGENTS.md +79 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +7 -0
  4. package/README.md +67 -0
  5. package/dist/__smrt-register__.d.ts +2 -0
  6. package/dist/__smrt-register__.d.ts.map +1 -0
  7. package/dist/collections/CampaignChannelCollection.d.ts +9 -0
  8. package/dist/collections/CampaignChannelCollection.d.ts.map +1 -0
  9. package/dist/collections/CampaignCollection.d.ts +10 -0
  10. package/dist/collections/CampaignCollection.d.ts.map +1 -0
  11. package/dist/collections/CampaignMetricSnapshotCollection.d.ts +15 -0
  12. package/dist/collections/CampaignMetricSnapshotCollection.d.ts.map +1 -0
  13. package/dist/collections/index.d.ts +4 -0
  14. package/dist/collections/index.d.ts.map +1 -0
  15. package/dist/index.d.ts +5 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +625 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/manifest.json +1173 -0
  20. package/dist/models/Campaign.d.ts +31 -0
  21. package/dist/models/Campaign.d.ts.map +1 -0
  22. package/dist/models/CampaignChannel.d.ts +22 -0
  23. package/dist/models/CampaignChannel.d.ts.map +1 -0
  24. package/dist/models/CampaignMetricSnapshot.d.ts +29 -0
  25. package/dist/models/CampaignMetricSnapshot.d.ts.map +1 -0
  26. package/dist/models/index.d.ts +4 -0
  27. package/dist/models/index.d.ts.map +1 -0
  28. package/dist/services/BudgetPacingService.d.ts +25 -0
  29. package/dist/services/BudgetPacingService.d.ts.map +1 -0
  30. package/dist/services/CampaignLifecycleService.d.ts +19 -0
  31. package/dist/services/CampaignLifecycleService.d.ts.map +1 -0
  32. package/dist/services/MetricIngestionService.d.ts +16 -0
  33. package/dist/services/MetricIngestionService.d.ts.map +1 -0
  34. package/dist/services/index.d.ts +4 -0
  35. package/dist/services/index.d.ts.map +1 -0
  36. package/dist/smrt-knowledge.json +875 -0
  37. package/dist/svelte/__tests__/components.test.js +115 -0
  38. package/dist/svelte/__tests__/helpers.test.js +94 -0
  39. package/dist/svelte/components/BudgetPacing.svelte +129 -0
  40. package/dist/svelte/components/BudgetPacing.svelte.d.ts +10 -0
  41. package/dist/svelte/components/BudgetPacing.svelte.d.ts.map +1 -0
  42. package/dist/svelte/components/CampaignDetail.svelte +208 -0
  43. package/dist/svelte/components/CampaignDetail.svelte.d.ts +14 -0
  44. package/dist/svelte/components/CampaignDetail.svelte.d.ts.map +1 -0
  45. package/dist/svelte/components/CampaignList.svelte +140 -0
  46. package/dist/svelte/components/CampaignList.svelte.d.ts +11 -0
  47. package/dist/svelte/components/CampaignList.svelte.d.ts.map +1 -0
  48. package/dist/svelte/components/ChannelMix.svelte +138 -0
  49. package/dist/svelte/components/ChannelMix.svelte.d.ts +10 -0
  50. package/dist/svelte/components/ChannelMix.svelte.d.ts.map +1 -0
  51. package/dist/svelte/components/MarketingDashboard.svelte +129 -0
  52. package/dist/svelte/components/MarketingDashboard.svelte.d.ts +13 -0
  53. package/dist/svelte/components/MarketingDashboard.svelte.d.ts.map +1 -0
  54. package/dist/svelte/format.d.ts +8 -0
  55. package/dist/svelte/format.d.ts.map +1 -0
  56. package/dist/svelte/format.js +42 -0
  57. package/dist/svelte/index.d.ts +8 -0
  58. package/dist/svelte/index.d.ts.map +1 -0
  59. package/dist/svelte/index.js +7 -0
  60. package/dist/svelte/types.d.ts +73 -0
  61. package/dist/svelte/types.d.ts.map +1 -0
  62. package/dist/svelte/types.js +80 -0
  63. package/dist/types.d.ts +61 -0
  64. package/dist/types.d.ts.map +1 -0
  65. package/dist/types.js +29 -0
  66. package/dist/types.js.map +1 -0
  67. package/package.json +79 -0
@@ -0,0 +1,1173 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "timestamp": 1784065581918,
4
+ "packageName": "@happyvertical/smrt-marketing",
5
+ "packageVersion": "0.39.16",
6
+ "objects": {
7
+ "@happyvertical/smrt-marketing:CampaignChannelCollection": {
8
+ "name": "campaignchannelcollection",
9
+ "className": "CampaignChannelCollection",
10
+ "qualifiedName": "@happyvertical/smrt-marketing:CampaignChannelCollection",
11
+ "collection": "campaignchannels",
12
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-sqm7p-runner-5xldd/smrt/smrt/packages/marketing/src/collections/CampaignChannelCollection.ts",
13
+ "packageName": "@happyvertical/smrt-marketing",
14
+ "fields": {},
15
+ "methods": {
16
+ "findByCampaign": {
17
+ "name": "findByCampaign",
18
+ "async": true,
19
+ "parameters": [
20
+ {
21
+ "name": "campaignId",
22
+ "type": "string",
23
+ "optional": false
24
+ }
25
+ ],
26
+ "returnType": "Promise<CampaignChannel[]>",
27
+ "isStatic": false,
28
+ "isPublic": true
29
+ },
30
+ "findByExecutionRef": {
31
+ "name": "findByExecutionRef",
32
+ "async": true,
33
+ "parameters": [
34
+ {
35
+ "name": "channelKind",
36
+ "type": "string",
37
+ "optional": false
38
+ },
39
+ {
40
+ "name": "channelRef",
41
+ "type": "string",
42
+ "optional": false
43
+ }
44
+ ],
45
+ "returnType": "Promise<CampaignChannel[]>",
46
+ "isStatic": false,
47
+ "isPublic": true
48
+ }
49
+ },
50
+ "decoratorConfig": {
51
+ "tableName": "campaign_channels"
52
+ },
53
+ "extends": "SmrtCollection",
54
+ "extendsTypeArg": "CampaignChannel",
55
+ "exportName": "CampaignChannelCollection",
56
+ "collectionExportName": "CampaignChannelCollectionCollection",
57
+ "schema": {
58
+ "tableName": "campaign_channels",
59
+ "ddl": "CREATE TABLE IF NOT EXISTS \"campaign_channels\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
60
+ "columns": {
61
+ "id": {
62
+ "type": "UUID",
63
+ "primaryKey": true,
64
+ "referenceKind": "id",
65
+ "notNull": true
66
+ },
67
+ "slug": {
68
+ "type": "TEXT",
69
+ "notNull": true
70
+ },
71
+ "context": {
72
+ "type": "TEXT",
73
+ "notNull": true,
74
+ "default": ""
75
+ },
76
+ "created_at": {
77
+ "type": "TIMESTAMP",
78
+ "notNull": true,
79
+ "default": "current_timestamp"
80
+ },
81
+ "updated_at": {
82
+ "type": "TIMESTAMP",
83
+ "notNull": true,
84
+ "default": "current_timestamp"
85
+ }
86
+ },
87
+ "indexes": [
88
+ {
89
+ "name": "campaign_channels_id_idx",
90
+ "columns": [
91
+ "id"
92
+ ]
93
+ },
94
+ {
95
+ "name": "campaign_channels_slug_context_idx",
96
+ "columns": [
97
+ "slug",
98
+ "context"
99
+ ],
100
+ "unique": true
101
+ }
102
+ ],
103
+ "version": "b64ea87b"
104
+ }
105
+ },
106
+ "@happyvertical/smrt-marketing:CampaignCollection": {
107
+ "name": "campaigncollection",
108
+ "className": "CampaignCollection",
109
+ "qualifiedName": "@happyvertical/smrt-marketing:CampaignCollection",
110
+ "collection": "campaigns",
111
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-sqm7p-runner-5xldd/smrt/smrt/packages/marketing/src/collections/CampaignCollection.ts",
112
+ "packageName": "@happyvertical/smrt-marketing",
113
+ "fields": {},
114
+ "methods": {
115
+ "findByCampaignKey": {
116
+ "name": "findByCampaignKey",
117
+ "async": true,
118
+ "parameters": [
119
+ {
120
+ "name": "campaignKey",
121
+ "type": "string",
122
+ "optional": false
123
+ },
124
+ {
125
+ "name": "tenantId",
126
+ "type": "string | null",
127
+ "optional": true
128
+ }
129
+ ],
130
+ "returnType": "Promise<Campaign | null>",
131
+ "isStatic": false,
132
+ "isPublic": true
133
+ },
134
+ "findByStatus": {
135
+ "name": "findByStatus",
136
+ "async": true,
137
+ "parameters": [
138
+ {
139
+ "name": "status",
140
+ "type": "CampaignStatus",
141
+ "optional": false
142
+ }
143
+ ],
144
+ "returnType": "Promise<Campaign[]>",
145
+ "isStatic": false,
146
+ "isPublic": true
147
+ }
148
+ },
149
+ "decoratorConfig": {
150
+ "tableName": "campaigns"
151
+ },
152
+ "extends": "SmrtCollection",
153
+ "extendsTypeArg": "Campaign",
154
+ "exportName": "CampaignCollection",
155
+ "collectionExportName": "CampaignCollectionCollection",
156
+ "schema": {
157
+ "tableName": "campaigns",
158
+ "ddl": "CREATE TABLE IF NOT EXISTS \"campaigns\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
159
+ "columns": {
160
+ "id": {
161
+ "type": "UUID",
162
+ "primaryKey": true,
163
+ "referenceKind": "id",
164
+ "notNull": true
165
+ },
166
+ "slug": {
167
+ "type": "TEXT",
168
+ "notNull": true
169
+ },
170
+ "context": {
171
+ "type": "TEXT",
172
+ "notNull": true,
173
+ "default": ""
174
+ },
175
+ "created_at": {
176
+ "type": "TIMESTAMP",
177
+ "notNull": true,
178
+ "default": "current_timestamp"
179
+ },
180
+ "updated_at": {
181
+ "type": "TIMESTAMP",
182
+ "notNull": true,
183
+ "default": "current_timestamp"
184
+ }
185
+ },
186
+ "indexes": [
187
+ {
188
+ "name": "campaigns_id_idx",
189
+ "columns": [
190
+ "id"
191
+ ]
192
+ },
193
+ {
194
+ "name": "campaigns_slug_context_idx",
195
+ "columns": [
196
+ "slug",
197
+ "context"
198
+ ],
199
+ "unique": true
200
+ }
201
+ ],
202
+ "version": "b1cd973d"
203
+ }
204
+ },
205
+ "@happyvertical/smrt-marketing:CampaignMetricSnapshotCollection": {
206
+ "name": "campaignmetricsnapshotcollection",
207
+ "className": "CampaignMetricSnapshotCollection",
208
+ "qualifiedName": "@happyvertical/smrt-marketing:CampaignMetricSnapshotCollection",
209
+ "collection": "campaignmetricsnapshots",
210
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-sqm7p-runner-5xldd/smrt/smrt/packages/marketing/src/collections/CampaignMetricSnapshotCollection.ts",
211
+ "packageName": "@happyvertical/smrt-marketing",
212
+ "fields": {},
213
+ "methods": {
214
+ "findByDedupeKey": {
215
+ "name": "findByDedupeKey",
216
+ "async": true,
217
+ "parameters": [
218
+ {
219
+ "name": "dedupeKey",
220
+ "type": "string",
221
+ "optional": false
222
+ }
223
+ ],
224
+ "returnType": "Promise<CampaignMetricSnapshot | null>",
225
+ "isStatic": false,
226
+ "isPublic": true
227
+ },
228
+ "getOrCreateByDedupeKey": {
229
+ "name": "getOrCreateByDedupeKey",
230
+ "async": true,
231
+ "parameters": [
232
+ {
233
+ "name": "options",
234
+ "type": "CampaignMetricSnapshotOptions",
235
+ "optional": false
236
+ }
237
+ ],
238
+ "returnType": "Promise<object>",
239
+ "isStatic": false,
240
+ "isPublic": true
241
+ },
242
+ "findByCampaign": {
243
+ "name": "findByCampaign",
244
+ "async": true,
245
+ "parameters": [
246
+ {
247
+ "name": "campaignId",
248
+ "type": "string",
249
+ "optional": false
250
+ }
251
+ ],
252
+ "returnType": "Promise<CampaignMetricSnapshot[]>",
253
+ "isStatic": false,
254
+ "isPublic": true
255
+ },
256
+ "findByChannel": {
257
+ "name": "findByChannel",
258
+ "async": true,
259
+ "parameters": [
260
+ {
261
+ "name": "campaignChannelId",
262
+ "type": "string",
263
+ "optional": false
264
+ }
265
+ ],
266
+ "returnType": "Promise<CampaignMetricSnapshot[]>",
267
+ "isStatic": false,
268
+ "isPublic": true
269
+ }
270
+ },
271
+ "decoratorConfig": {
272
+ "tableName": "campaign_metric_snapshots"
273
+ },
274
+ "extends": "SmrtCollection",
275
+ "extendsTypeArg": "CampaignMetricSnapshot",
276
+ "exportName": "CampaignMetricSnapshotCollection",
277
+ "collectionExportName": "CampaignMetricSnapshotCollectionCollection",
278
+ "schema": {
279
+ "tableName": "campaign_metric_snapshots",
280
+ "ddl": "CREATE TABLE IF NOT EXISTS \"campaign_metric_snapshots\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
281
+ "columns": {
282
+ "id": {
283
+ "type": "UUID",
284
+ "primaryKey": true,
285
+ "referenceKind": "id",
286
+ "notNull": true
287
+ },
288
+ "slug": {
289
+ "type": "TEXT",
290
+ "notNull": true
291
+ },
292
+ "context": {
293
+ "type": "TEXT",
294
+ "notNull": true,
295
+ "default": ""
296
+ },
297
+ "created_at": {
298
+ "type": "TIMESTAMP",
299
+ "notNull": true,
300
+ "default": "current_timestamp"
301
+ },
302
+ "updated_at": {
303
+ "type": "TIMESTAMP",
304
+ "notNull": true,
305
+ "default": "current_timestamp"
306
+ }
307
+ },
308
+ "indexes": [
309
+ {
310
+ "name": "campaign_metric_snapshots_id_idx",
311
+ "columns": [
312
+ "id"
313
+ ]
314
+ },
315
+ {
316
+ "name": "campaign_metric_snapshots_slug_context_idx",
317
+ "columns": [
318
+ "slug",
319
+ "context"
320
+ ],
321
+ "unique": true
322
+ }
323
+ ],
324
+ "version": "268285ee"
325
+ }
326
+ },
327
+ "@happyvertical/smrt-marketing:Campaign": {
328
+ "name": "campaign",
329
+ "className": "Campaign",
330
+ "qualifiedName": "@happyvertical/smrt-marketing:Campaign",
331
+ "collection": "campaigns",
332
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-sqm7p-runner-5xldd/smrt/smrt/packages/marketing/src/models/Campaign.ts",
333
+ "packageName": "@happyvertical/smrt-marketing",
334
+ "fields": {
335
+ "tenantId": {
336
+ "type": "text",
337
+ "required": false,
338
+ "_meta": {
339
+ "sqlType": "UUID",
340
+ "nullable": true,
341
+ "__tenancy": {
342
+ "isTenantIdField": true,
343
+ "autoFilter": true,
344
+ "required": false,
345
+ "autoPopulate": true,
346
+ "nullable": true,
347
+ "mode": "optional",
348
+ "field": "tenantId",
349
+ "allowSuperAdminBypass": false
350
+ }
351
+ }
352
+ },
353
+ "campaignKey": {
354
+ "type": "text",
355
+ "required": true,
356
+ "default": "",
357
+ "_meta": {
358
+ "required": true
359
+ }
360
+ },
361
+ "name": {
362
+ "type": "text",
363
+ "required": true,
364
+ "default": "",
365
+ "_meta": {
366
+ "required": true
367
+ }
368
+ },
369
+ "objective": {
370
+ "type": "text",
371
+ "required": false,
372
+ "default": ""
373
+ },
374
+ "status": {
375
+ "type": "text",
376
+ "required": false,
377
+ "default": "draft"
378
+ },
379
+ "startAt": {
380
+ "type": "datetime",
381
+ "required": false
382
+ },
383
+ "endAt": {
384
+ "type": "datetime",
385
+ "required": false
386
+ },
387
+ "budgetCents": {
388
+ "type": "integer",
389
+ "required": false,
390
+ "default": 0
391
+ },
392
+ "currency": {
393
+ "type": "text",
394
+ "required": false,
395
+ "default": "USD"
396
+ },
397
+ "metadata": {
398
+ "type": "text",
399
+ "required": false,
400
+ "default": "{}"
401
+ }
402
+ },
403
+ "methods": {
404
+ "initialize": {
405
+ "name": "initialize",
406
+ "async": true,
407
+ "parameters": [],
408
+ "returnType": "Promise",
409
+ "isStatic": false,
410
+ "isPublic": true
411
+ },
412
+ "save": {
413
+ "name": "save",
414
+ "async": true,
415
+ "parameters": [],
416
+ "returnType": "Promise",
417
+ "isStatic": false,
418
+ "isPublic": true
419
+ },
420
+ "transitionTo": {
421
+ "name": "transitionTo",
422
+ "async": false,
423
+ "parameters": [
424
+ {
425
+ "name": "next",
426
+ "type": "CampaignStatus",
427
+ "optional": false
428
+ }
429
+ ],
430
+ "returnType": "any",
431
+ "isStatic": false,
432
+ "isPublic": true
433
+ },
434
+ "getMetadata": {
435
+ "name": "getMetadata",
436
+ "async": false,
437
+ "parameters": [],
438
+ "returnType": "Record<string>",
439
+ "isStatic": false,
440
+ "isPublic": true
441
+ },
442
+ "setMetadata": {
443
+ "name": "setMetadata",
444
+ "async": false,
445
+ "parameters": [
446
+ {
447
+ "name": "metadata",
448
+ "type": "Record<string>",
449
+ "optional": false
450
+ }
451
+ ],
452
+ "returnType": "void",
453
+ "isStatic": false,
454
+ "isPublic": true
455
+ }
456
+ },
457
+ "decoratorConfig": {
458
+ "tableName": "campaigns",
459
+ "conflictColumns": [
460
+ "tenant_id",
461
+ "campaign_key"
462
+ ],
463
+ "api": {
464
+ "include": [
465
+ "list",
466
+ "get",
467
+ "create",
468
+ "update"
469
+ ]
470
+ },
471
+ "mcp": {
472
+ "include": [
473
+ "list",
474
+ "get",
475
+ "create",
476
+ "update"
477
+ ]
478
+ },
479
+ "cli": {
480
+ "include": [
481
+ "list",
482
+ "get",
483
+ "create",
484
+ "update"
485
+ ]
486
+ },
487
+ "tenantScoped": {
488
+ "mode": "optional"
489
+ }
490
+ },
491
+ "extends": "SmrtObject",
492
+ "exportName": "Campaign",
493
+ "collectionExportName": "CampaignCollection",
494
+ "validationRules": [
495
+ {
496
+ "field": "campaignKey",
497
+ "rule": "required",
498
+ "fieldType": "text"
499
+ },
500
+ {
501
+ "field": "name",
502
+ "rule": "required",
503
+ "fieldType": "text"
504
+ }
505
+ ],
506
+ "schema": {
507
+ "tableName": "campaigns",
508
+ "ddl": "CREATE TABLE IF NOT EXISTS \"campaigns\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"campaign_key\" TEXT NOT NULL DEFAULT '',\n \"name\" TEXT NOT NULL DEFAULT '',\n \"objective\" TEXT DEFAULT '',\n \"status\" TEXT DEFAULT 'draft',\n \"start_at\" TIMESTAMP,\n \"end_at\" TIMESTAMP,\n \"budget_cents\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"metadata\" TEXT DEFAULT '{}'\n);",
509
+ "columns": {
510
+ "id": {
511
+ "type": "UUID",
512
+ "primaryKey": true,
513
+ "referenceKind": "id",
514
+ "notNull": true
515
+ },
516
+ "slug": {
517
+ "type": "TEXT",
518
+ "notNull": true
519
+ },
520
+ "context": {
521
+ "type": "TEXT",
522
+ "notNull": true,
523
+ "default": ""
524
+ },
525
+ "created_at": {
526
+ "type": "TIMESTAMP",
527
+ "notNull": true,
528
+ "default": "current_timestamp"
529
+ },
530
+ "updated_at": {
531
+ "type": "TIMESTAMP",
532
+ "notNull": true,
533
+ "default": "current_timestamp"
534
+ },
535
+ "tenant_id": {
536
+ "type": "UUID",
537
+ "referenceKind": "tenantId",
538
+ "notNull": false,
539
+ "unique": false
540
+ },
541
+ "campaign_key": {
542
+ "type": "TEXT",
543
+ "notNull": true,
544
+ "unique": false,
545
+ "default": ""
546
+ },
547
+ "name": {
548
+ "type": "TEXT",
549
+ "notNull": true,
550
+ "unique": false,
551
+ "default": ""
552
+ },
553
+ "objective": {
554
+ "type": "TEXT",
555
+ "notNull": false,
556
+ "unique": false,
557
+ "default": ""
558
+ },
559
+ "status": {
560
+ "type": "TEXT",
561
+ "notNull": false,
562
+ "unique": false,
563
+ "default": "draft"
564
+ },
565
+ "start_at": {
566
+ "type": "TIMESTAMP",
567
+ "notNull": false,
568
+ "unique": false
569
+ },
570
+ "end_at": {
571
+ "type": "TIMESTAMP",
572
+ "notNull": false,
573
+ "unique": false
574
+ },
575
+ "budget_cents": {
576
+ "type": "INTEGER",
577
+ "notNull": false,
578
+ "unique": false,
579
+ "default": 0
580
+ },
581
+ "currency": {
582
+ "type": "TEXT",
583
+ "notNull": false,
584
+ "unique": false,
585
+ "default": "USD"
586
+ },
587
+ "metadata": {
588
+ "type": "TEXT",
589
+ "notNull": false,
590
+ "unique": false,
591
+ "default": "{}"
592
+ }
593
+ },
594
+ "indexes": [
595
+ {
596
+ "name": "campaigns_id_idx",
597
+ "columns": [
598
+ "id"
599
+ ]
600
+ },
601
+ {
602
+ "name": "campaigns_tenant_id_campaign_key_idx",
603
+ "columns": [
604
+ "tenant_id",
605
+ "campaign_key"
606
+ ],
607
+ "unique": true
608
+ }
609
+ ],
610
+ "version": "1963ebd3"
611
+ }
612
+ },
613
+ "@happyvertical/smrt-marketing:CampaignChannel": {
614
+ "name": "campaignchannel",
615
+ "className": "CampaignChannel",
616
+ "qualifiedName": "@happyvertical/smrt-marketing:CampaignChannel",
617
+ "collection": "campaignchannels",
618
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-sqm7p-runner-5xldd/smrt/smrt/packages/marketing/src/models/CampaignChannel.ts",
619
+ "packageName": "@happyvertical/smrt-marketing",
620
+ "fields": {
621
+ "tenantId": {
622
+ "type": "text",
623
+ "required": false,
624
+ "_meta": {
625
+ "sqlType": "UUID",
626
+ "nullable": true,
627
+ "__tenancy": {
628
+ "isTenantIdField": true,
629
+ "autoFilter": true,
630
+ "required": false,
631
+ "autoPopulate": true,
632
+ "nullable": true,
633
+ "mode": "optional",
634
+ "field": "tenantId",
635
+ "allowSuperAdminBypass": false
636
+ }
637
+ }
638
+ },
639
+ "campaignId": {
640
+ "type": "foreignKey",
641
+ "required": true,
642
+ "related": "Campaign",
643
+ "_meta": {
644
+ "required": true
645
+ }
646
+ },
647
+ "channelKind": {
648
+ "type": "text",
649
+ "required": true,
650
+ "default": "",
651
+ "_meta": {
652
+ "required": true
653
+ }
654
+ },
655
+ "channelRef": {
656
+ "type": "text",
657
+ "required": true,
658
+ "default": "",
659
+ "_meta": {
660
+ "required": true
661
+ }
662
+ },
663
+ "allocatedBudgetCents": {
664
+ "type": "integer",
665
+ "required": false,
666
+ "default": 0
667
+ },
668
+ "startAt": {
669
+ "type": "datetime",
670
+ "required": false
671
+ },
672
+ "endAt": {
673
+ "type": "datetime",
674
+ "required": false
675
+ },
676
+ "status": {
677
+ "type": "text",
678
+ "required": false,
679
+ "default": "planned"
680
+ }
681
+ },
682
+ "methods": {
683
+ "initialize": {
684
+ "name": "initialize",
685
+ "async": true,
686
+ "parameters": [],
687
+ "returnType": "Promise",
688
+ "isStatic": false,
689
+ "isPublic": true
690
+ },
691
+ "save": {
692
+ "name": "save",
693
+ "async": true,
694
+ "parameters": [],
695
+ "returnType": "Promise",
696
+ "isStatic": false,
697
+ "isPublic": true
698
+ }
699
+ },
700
+ "decoratorConfig": {
701
+ "tableName": "campaign_channels",
702
+ "conflictColumns": [
703
+ "campaign_id",
704
+ "channel_kind",
705
+ "channel_ref"
706
+ ],
707
+ "api": {
708
+ "include": [
709
+ "list",
710
+ "get",
711
+ "create",
712
+ "update",
713
+ "delete"
714
+ ]
715
+ },
716
+ "mcp": {
717
+ "include": [
718
+ "list",
719
+ "get",
720
+ "create",
721
+ "update"
722
+ ]
723
+ },
724
+ "cli": {
725
+ "include": [
726
+ "list",
727
+ "get",
728
+ "create",
729
+ "update",
730
+ "delete"
731
+ ]
732
+ },
733
+ "tenantScoped": {
734
+ "mode": "optional"
735
+ }
736
+ },
737
+ "extends": "SmrtObject",
738
+ "exportName": "CampaignChannel",
739
+ "collectionExportName": "CampaignChannelCollection",
740
+ "validationRules": [
741
+ {
742
+ "field": "campaignId",
743
+ "rule": "required",
744
+ "fieldType": "foreignKey"
745
+ },
746
+ {
747
+ "field": "channelKind",
748
+ "rule": "required",
749
+ "fieldType": "text"
750
+ },
751
+ {
752
+ "field": "channelRef",
753
+ "rule": "required",
754
+ "fieldType": "text"
755
+ }
756
+ ],
757
+ "schema": {
758
+ "tableName": "campaign_channels",
759
+ "ddl": "CREATE TABLE IF NOT EXISTS \"campaign_channels\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"campaign_id\" UUID NOT NULL,\n \"channel_kind\" TEXT NOT NULL DEFAULT '',\n \"channel_ref\" TEXT NOT NULL DEFAULT '',\n \"allocated_budget_cents\" INTEGER DEFAULT 0,\n \"start_at\" TIMESTAMP,\n \"end_at\" TIMESTAMP,\n \"status\" TEXT DEFAULT 'planned'\n);",
760
+ "columns": {
761
+ "id": {
762
+ "type": "UUID",
763
+ "primaryKey": true,
764
+ "referenceKind": "id",
765
+ "notNull": true
766
+ },
767
+ "slug": {
768
+ "type": "TEXT",
769
+ "notNull": true
770
+ },
771
+ "context": {
772
+ "type": "TEXT",
773
+ "notNull": true,
774
+ "default": ""
775
+ },
776
+ "created_at": {
777
+ "type": "TIMESTAMP",
778
+ "notNull": true,
779
+ "default": "current_timestamp"
780
+ },
781
+ "updated_at": {
782
+ "type": "TIMESTAMP",
783
+ "notNull": true,
784
+ "default": "current_timestamp"
785
+ },
786
+ "tenant_id": {
787
+ "type": "UUID",
788
+ "referenceKind": "tenantId",
789
+ "notNull": false,
790
+ "unique": false
791
+ },
792
+ "campaign_id": {
793
+ "type": "UUID",
794
+ "referenceKind": "foreignKey",
795
+ "notNull": true,
796
+ "unique": false
797
+ },
798
+ "channel_kind": {
799
+ "type": "TEXT",
800
+ "notNull": true,
801
+ "unique": false,
802
+ "default": ""
803
+ },
804
+ "channel_ref": {
805
+ "type": "TEXT",
806
+ "notNull": true,
807
+ "unique": false,
808
+ "default": ""
809
+ },
810
+ "allocated_budget_cents": {
811
+ "type": "INTEGER",
812
+ "notNull": false,
813
+ "unique": false,
814
+ "default": 0
815
+ },
816
+ "start_at": {
817
+ "type": "TIMESTAMP",
818
+ "notNull": false,
819
+ "unique": false
820
+ },
821
+ "end_at": {
822
+ "type": "TIMESTAMP",
823
+ "notNull": false,
824
+ "unique": false
825
+ },
826
+ "status": {
827
+ "type": "TEXT",
828
+ "notNull": false,
829
+ "unique": false,
830
+ "default": "planned"
831
+ }
832
+ },
833
+ "indexes": [
834
+ {
835
+ "name": "campaign_channels_id_idx",
836
+ "columns": [
837
+ "id"
838
+ ]
839
+ },
840
+ {
841
+ "name": "campaign_channels_campaign_id_channel_kind_idx",
842
+ "columns": [
843
+ "campaign_id",
844
+ "channel_kind",
845
+ "channel_ref"
846
+ ],
847
+ "unique": true
848
+ }
849
+ ],
850
+ "version": "40163dfc"
851
+ }
852
+ },
853
+ "@happyvertical/smrt-marketing:CampaignMetricSnapshot": {
854
+ "name": "campaignmetricsnapshot",
855
+ "className": "CampaignMetricSnapshot",
856
+ "qualifiedName": "@happyvertical/smrt-marketing:CampaignMetricSnapshot",
857
+ "collection": "campaignmetricsnapshots",
858
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-sqm7p-runner-5xldd/smrt/smrt/packages/marketing/src/models/CampaignMetricSnapshot.ts",
859
+ "packageName": "@happyvertical/smrt-marketing",
860
+ "fields": {
861
+ "tenantId": {
862
+ "type": "text",
863
+ "required": false,
864
+ "_meta": {
865
+ "sqlType": "UUID",
866
+ "nullable": true,
867
+ "__tenancy": {
868
+ "isTenantIdField": true,
869
+ "autoFilter": true,
870
+ "required": false,
871
+ "autoPopulate": true,
872
+ "nullable": true,
873
+ "mode": "optional",
874
+ "field": "tenantId",
875
+ "allowSuperAdminBypass": false
876
+ }
877
+ }
878
+ },
879
+ "campaignId": {
880
+ "type": "foreignKey",
881
+ "required": true,
882
+ "related": "Campaign",
883
+ "_meta": {
884
+ "required": true
885
+ }
886
+ },
887
+ "campaignChannelId": {
888
+ "type": "foreignKey",
889
+ "required": false,
890
+ "related": "CampaignChannel",
891
+ "_meta": {
892
+ "nullable": true
893
+ }
894
+ },
895
+ "periodStart": {
896
+ "type": "datetime",
897
+ "required": true,
898
+ "_meta": {
899
+ "required": true
900
+ }
901
+ },
902
+ "periodEnd": {
903
+ "type": "datetime",
904
+ "required": true,
905
+ "_meta": {
906
+ "required": true
907
+ }
908
+ },
909
+ "spendCents": {
910
+ "type": "integer",
911
+ "required": false,
912
+ "default": 0
913
+ },
914
+ "impressions": {
915
+ "type": "integer",
916
+ "required": false,
917
+ "default": 0
918
+ },
919
+ "clicks": {
920
+ "type": "integer",
921
+ "required": false,
922
+ "default": 0
923
+ },
924
+ "conversions": {
925
+ "type": "integer",
926
+ "required": false,
927
+ "default": 0
928
+ },
929
+ "leads": {
930
+ "type": "integer",
931
+ "required": false,
932
+ "default": 0
933
+ },
934
+ "revenueCents": {
935
+ "type": "integer",
936
+ "required": false,
937
+ "_meta": {
938
+ "nullable": true
939
+ }
940
+ },
941
+ "source": {
942
+ "type": "text",
943
+ "required": true,
944
+ "default": "",
945
+ "_meta": {
946
+ "required": true
947
+ }
948
+ },
949
+ "dedupeKey": {
950
+ "type": "text",
951
+ "required": true,
952
+ "default": "",
953
+ "_meta": {
954
+ "required": true
955
+ }
956
+ }
957
+ },
958
+ "methods": {
959
+ "initialize": {
960
+ "name": "initialize",
961
+ "async": true,
962
+ "parameters": [],
963
+ "returnType": "Promise",
964
+ "isStatic": false,
965
+ "isPublic": true
966
+ },
967
+ "save": {
968
+ "name": "save",
969
+ "async": true,
970
+ "parameters": [],
971
+ "returnType": "Promise",
972
+ "isStatic": false,
973
+ "isPublic": true
974
+ },
975
+ "delete": {
976
+ "name": "delete",
977
+ "async": true,
978
+ "parameters": [],
979
+ "returnType": "Promise<void>",
980
+ "isStatic": false,
981
+ "isPublic": true
982
+ }
983
+ },
984
+ "decoratorConfig": {
985
+ "tableName": "campaign_metric_snapshots",
986
+ "conflictColumns": [
987
+ "dedupe_key"
988
+ ],
989
+ "api": {
990
+ "include": [
991
+ "list",
992
+ "get",
993
+ "create"
994
+ ]
995
+ },
996
+ "mcp": {
997
+ "include": [
998
+ "list",
999
+ "get",
1000
+ "create"
1001
+ ]
1002
+ },
1003
+ "cli": {
1004
+ "include": [
1005
+ "list",
1006
+ "get",
1007
+ "create"
1008
+ ]
1009
+ },
1010
+ "tenantScoped": {
1011
+ "mode": "optional"
1012
+ }
1013
+ },
1014
+ "extends": "SmrtObject",
1015
+ "exportName": "CampaignMetricSnapshot",
1016
+ "collectionExportName": "CampaignMetricSnapshotCollection",
1017
+ "validationRules": [
1018
+ {
1019
+ "field": "campaignId",
1020
+ "rule": "required",
1021
+ "fieldType": "foreignKey"
1022
+ },
1023
+ {
1024
+ "field": "periodStart",
1025
+ "rule": "required",
1026
+ "fieldType": "datetime"
1027
+ },
1028
+ {
1029
+ "field": "periodEnd",
1030
+ "rule": "required",
1031
+ "fieldType": "datetime"
1032
+ },
1033
+ {
1034
+ "field": "source",
1035
+ "rule": "required",
1036
+ "fieldType": "text"
1037
+ },
1038
+ {
1039
+ "field": "dedupeKey",
1040
+ "rule": "required",
1041
+ "fieldType": "text"
1042
+ }
1043
+ ],
1044
+ "schema": {
1045
+ "tableName": "campaign_metric_snapshots",
1046
+ "ddl": "CREATE TABLE IF NOT EXISTS \"campaign_metric_snapshots\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"campaign_id\" UUID NOT NULL,\n \"campaign_channel_id\" UUID,\n \"period_start\" TIMESTAMP NOT NULL,\n \"period_end\" TIMESTAMP NOT NULL,\n \"spend_cents\" INTEGER DEFAULT 0,\n \"impressions\" INTEGER DEFAULT 0,\n \"clicks\" INTEGER DEFAULT 0,\n \"conversions\" INTEGER DEFAULT 0,\n \"leads\" INTEGER DEFAULT 0,\n \"revenue_cents\" INTEGER,\n \"source\" TEXT NOT NULL DEFAULT '',\n \"dedupe_key\" TEXT NOT NULL DEFAULT ''\n);",
1047
+ "columns": {
1048
+ "id": {
1049
+ "type": "UUID",
1050
+ "primaryKey": true,
1051
+ "referenceKind": "id",
1052
+ "notNull": true
1053
+ },
1054
+ "slug": {
1055
+ "type": "TEXT",
1056
+ "notNull": true
1057
+ },
1058
+ "context": {
1059
+ "type": "TEXT",
1060
+ "notNull": true,
1061
+ "default": ""
1062
+ },
1063
+ "created_at": {
1064
+ "type": "TIMESTAMP",
1065
+ "notNull": true,
1066
+ "default": "current_timestamp"
1067
+ },
1068
+ "updated_at": {
1069
+ "type": "TIMESTAMP",
1070
+ "notNull": true,
1071
+ "default": "current_timestamp"
1072
+ },
1073
+ "tenant_id": {
1074
+ "type": "UUID",
1075
+ "referenceKind": "tenantId",
1076
+ "notNull": false,
1077
+ "unique": false
1078
+ },
1079
+ "campaign_id": {
1080
+ "type": "UUID",
1081
+ "referenceKind": "foreignKey",
1082
+ "notNull": true,
1083
+ "unique": false
1084
+ },
1085
+ "campaign_channel_id": {
1086
+ "type": "UUID",
1087
+ "referenceKind": "foreignKey",
1088
+ "notNull": false,
1089
+ "unique": false
1090
+ },
1091
+ "period_start": {
1092
+ "type": "TIMESTAMP",
1093
+ "notNull": true,
1094
+ "unique": false
1095
+ },
1096
+ "period_end": {
1097
+ "type": "TIMESTAMP",
1098
+ "notNull": true,
1099
+ "unique": false
1100
+ },
1101
+ "spend_cents": {
1102
+ "type": "INTEGER",
1103
+ "notNull": false,
1104
+ "unique": false,
1105
+ "default": 0
1106
+ },
1107
+ "impressions": {
1108
+ "type": "INTEGER",
1109
+ "notNull": false,
1110
+ "unique": false,
1111
+ "default": 0
1112
+ },
1113
+ "clicks": {
1114
+ "type": "INTEGER",
1115
+ "notNull": false,
1116
+ "unique": false,
1117
+ "default": 0
1118
+ },
1119
+ "conversions": {
1120
+ "type": "INTEGER",
1121
+ "notNull": false,
1122
+ "unique": false,
1123
+ "default": 0
1124
+ },
1125
+ "leads": {
1126
+ "type": "INTEGER",
1127
+ "notNull": false,
1128
+ "unique": false,
1129
+ "default": 0
1130
+ },
1131
+ "revenue_cents": {
1132
+ "type": "INTEGER",
1133
+ "notNull": false,
1134
+ "unique": false
1135
+ },
1136
+ "source": {
1137
+ "type": "TEXT",
1138
+ "notNull": true,
1139
+ "unique": false,
1140
+ "default": ""
1141
+ },
1142
+ "dedupe_key": {
1143
+ "type": "TEXT",
1144
+ "notNull": true,
1145
+ "unique": false,
1146
+ "default": ""
1147
+ }
1148
+ },
1149
+ "indexes": [
1150
+ {
1151
+ "name": "campaign_metric_snapshots_id_idx",
1152
+ "columns": [
1153
+ "id"
1154
+ ]
1155
+ },
1156
+ {
1157
+ "name": "campaign_metric_snapshots_dedupe_key_idx",
1158
+ "columns": [
1159
+ "dedupe_key"
1160
+ ],
1161
+ "unique": true
1162
+ }
1163
+ ],
1164
+ "version": "87e87389"
1165
+ }
1166
+ }
1167
+ },
1168
+ "moduleType": "smrt",
1169
+ "smrtDependencies": [
1170
+ "@happyvertical/smrt-core",
1171
+ "@happyvertical/smrt-tenancy"
1172
+ ]
1173
+ }