@happyvertical/smrt-marketing 0.42.7 → 0.43.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.
- package/AGENTS.md +14 -1
- package/README.md +45 -0
- package/dist/collections/CampaignCollection.d.ts +29 -2
- package/dist/collections/CampaignCollection.d.ts.map +1 -1
- package/dist/customer-scope.d.ts +14 -0
- package/dist/customer-scope.d.ts.map +1 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +362 -11
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +144 -8
- package/dist/models/Campaign.d.ts +5 -0
- package/dist/models/Campaign.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +67 -9
- package/dist/types.d.ts +24 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +6 -5
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-marketing",
|
|
6
|
-
"packageVersion": "0.
|
|
6
|
+
"packageVersion": "0.43.0",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
12
|
-
"agents": "
|
|
10
|
+
"manifest": "cabc318cb37de0034c02656d4d2bab2744a1279cef88551cff197e405bb9bd29",
|
|
11
|
+
"packageJson": "66ecf6d9a8818eea421257a24f1c9ac002bec0423edaec57acbcc044ca46b2ab",
|
|
12
|
+
"agents": "0d11e523b80990f78607047ca887445747292970990881333c60231397703924"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
|
15
15
|
".",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"@happyvertical/smrt-core": "workspace:*",
|
|
22
22
|
"@happyvertical/smrt-tenancy": "workspace:*",
|
|
23
23
|
"@happyvertical/smrt-ui": "workspace:*",
|
|
24
|
+
"@happyvertical/smrt-commerce": "workspace:*",
|
|
24
25
|
"@happyvertical/smrt-vitest": "workspace:*",
|
|
25
26
|
"@happyvertical/sql": "catalog:",
|
|
26
27
|
"@sveltejs/package": "^2.5.8",
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
"vitest": "4.1.10"
|
|
36
37
|
},
|
|
37
38
|
"smrtDependencies": [
|
|
39
|
+
"@happyvertical/smrt-commerce",
|
|
38
40
|
"@happyvertical/smrt-core",
|
|
39
41
|
"@happyvertical/smrt-tenancy",
|
|
40
42
|
"@happyvertical/smrt-ui",
|
|
@@ -96,7 +98,11 @@
|
|
|
96
98
|
"relationships": [],
|
|
97
99
|
"methods": [
|
|
98
100
|
"findByCampaignKey",
|
|
99
|
-
"findByStatus"
|
|
101
|
+
"findByStatus",
|
|
102
|
+
"get",
|
|
103
|
+
"list",
|
|
104
|
+
"listByCustomer",
|
|
105
|
+
"summarizeByCustomers"
|
|
100
106
|
],
|
|
101
107
|
"methodSignatures": [
|
|
102
108
|
{
|
|
@@ -115,6 +121,42 @@
|
|
|
115
121
|
"status: CampaignStatus"
|
|
116
122
|
],
|
|
117
123
|
"returns": "Promise<Campaign[]>"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "get",
|
|
127
|
+
"async": true,
|
|
128
|
+
"params": [
|
|
129
|
+
"filter: string | SmrtWhereClause<Campaign>",
|
|
130
|
+
"options?: object"
|
|
131
|
+
],
|
|
132
|
+
"returns": "Promise<Campaign | null>"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "list",
|
|
136
|
+
"async": true,
|
|
137
|
+
"params": [
|
|
138
|
+
"options?: SmrtListOptions<Campaign>"
|
|
139
|
+
],
|
|
140
|
+
"returns": "Promise<Campaign[] | Record<string>[]>"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "listByCustomer",
|
|
144
|
+
"async": true,
|
|
145
|
+
"params": [
|
|
146
|
+
"tenantId: string | null",
|
|
147
|
+
"customerId: string",
|
|
148
|
+
"options?: ListCampaignsByCustomerOptions"
|
|
149
|
+
],
|
|
150
|
+
"returns": "Promise<CampaignCustomerPage>"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "summarizeByCustomers",
|
|
154
|
+
"async": true,
|
|
155
|
+
"params": [
|
|
156
|
+
"tenantId: string | null",
|
|
157
|
+
"customerIds: string[]"
|
|
158
|
+
],
|
|
159
|
+
"returns": "Promise<CampaignCustomerSummary[]>"
|
|
118
160
|
}
|
|
119
161
|
],
|
|
120
162
|
"surfaces": [],
|
|
@@ -194,6 +236,13 @@
|
|
|
194
236
|
"required": false,
|
|
195
237
|
"columnType": "UUID"
|
|
196
238
|
},
|
|
239
|
+
{
|
|
240
|
+
"name": "customerId",
|
|
241
|
+
"type": "crossPackageRef",
|
|
242
|
+
"required": false,
|
|
243
|
+
"related": "@happyvertical/smrt-commerce:Customer",
|
|
244
|
+
"columnType": "UUID"
|
|
245
|
+
},
|
|
197
246
|
{
|
|
198
247
|
"name": "campaignKey",
|
|
199
248
|
"type": "text",
|
|
@@ -256,7 +305,15 @@
|
|
|
256
305
|
"default": "{}"
|
|
257
306
|
}
|
|
258
307
|
],
|
|
259
|
-
"relationships": [
|
|
308
|
+
"relationships": [
|
|
309
|
+
{
|
|
310
|
+
"name": "customerId",
|
|
311
|
+
"type": "crossPackageRef",
|
|
312
|
+
"required": false,
|
|
313
|
+
"related": "@happyvertical/smrt-commerce:Customer",
|
|
314
|
+
"columnType": "UUID"
|
|
315
|
+
}
|
|
316
|
+
],
|
|
260
317
|
"methods": [
|
|
261
318
|
"getMetadata",
|
|
262
319
|
"initialize",
|
|
@@ -386,6 +443,7 @@
|
|
|
386
443
|
}
|
|
387
444
|
],
|
|
388
445
|
"relationshipFeatures": [
|
|
446
|
+
"crossPackageRef",
|
|
389
447
|
"uuidColumns"
|
|
390
448
|
],
|
|
391
449
|
"tags": [],
|
|
@@ -1042,11 +1100,11 @@
|
|
|
1042
1100
|
"prompts": [],
|
|
1043
1101
|
"relationshipsV2": {
|
|
1044
1102
|
"foreignKeyFields": 3,
|
|
1045
|
-
"crossPackageRefFields":
|
|
1103
|
+
"crossPackageRefFields": 1,
|
|
1046
1104
|
"junctionCollections": 0,
|
|
1047
1105
|
"hierarchicalObjects": 0,
|
|
1048
1106
|
"polymorphicAssociations": 0,
|
|
1049
|
-
"uuidColumns":
|
|
1107
|
+
"uuidColumns": 13
|
|
1050
1108
|
},
|
|
1051
|
-
"agentDoc": "# @happyvertical/smrt-marketing\n\nCross-channel campaign coordination for SMRT. This package owns Campaign\nidentity, budgets, lifecycle, execution links, immutable performance evidence,\ncomputed pacing, and props-driven Svelte surfaces. It does not execute ads,\npublish social posts, send messages, or own sales attribution.\n\n## Validation\n\nRun `pnpm --filter @happyvertical/smrt-marketing test` and\n`pnpm --filter @happyvertical/smrt-marketing typecheck`; use `test:coverage`\nto exercise the model/service and component coverage configurations.\nNatural-key changes must also run\n`pnpm --filter @happyvertical/smrt-marketing test:postgres` when\nthe disposable PostgreSQL harness is available. Use\n`pnpm --filter @happyvertical/smrt-marketing build` and `verify:pack` for\npublish-surface changes.\n\n## Models\n\n- **Campaign**: optional-tenant umbrella with stable natural key\n `(tenant_id, campaign_key)`, open objective, integer-cent budget, currency,\n schedule, guarded metadata helpers, and lifecycle\n `draft → scheduled → active ↔ paused → completed → archived`. Raw saves are\n protected by an authoritative prior-status re-read; use\n `CampaignLifecycleService` for lifecycle writes.\n- **CampaignChannel**: one generic execution link per\n `(campaign_id, channel_kind, channel_ref)`. `channelKind`/`channelRef` are\n intentionally plain strings so ads, social, messages, content, events, and\n referral programs remain peer packages. Allocation and schedule overrides\n use integer cents and dates.\n- **CampaignMetricSnapshot**: immutable period evidence with a global\n `dedupe_key` natural key. A snapshot always carries `campaignId`; a null\n `campaignChannelId` means campaign-level rollup evidence; when present, the\n channel must belong to that same campaign. API/MCP/CLI expose create/list/get\n only, and the save guard rejects hydrated edits, blind-id overwrites, and\n natural-key overwrites. Programmatic deletion is rejected.\n\nEvery model is `@TenantScoped({ mode: 'optional' })` with nullable `tenantId`.\nAll generated surfaces are explicit; never omit `api`, `mcp`, or `cli` config.\n\n## Services\n\n- **CampaignLifecycleService** loads the current row before applying one legal\n transition. Paused campaigns may resume; completed campaigns may only be\n archived; archived campaigns are terminal.\n- **MetricIngestionService** validates required scope/source/period fields and\n delegates to `getOrCreateByDedupeKey()`. A replay returns the original row\n unchanged even if the replay payload differs.\n- **BudgetPacingService** computes campaign/channel pacing from snapshots and\n never persists derived balances. For each exact reporting period, campaign\n pacing prefers campaign rollups and otherwise sums channel snapshots,\n preventing double counting without dropping channel-only periods. Status\n uses a five-percent budget tolerance around schedule-derived expected spend.\n\n## Svelte\n\n`@happyvertical/smrt-marketing/svelte` exports `MarketingDashboard`,\n`CampaignList`, `CampaignDetail`, `ChannelMix`, and `BudgetPacing`, plus view\ninterfaces and pure helpers. Components are props-only: no fetching, no model\nimports, no providers. Use Provider-free `smrt-ui` primitives, `--smrt-*`\ntokens, named `$props()` interfaces, and integer-cent inputs formatted only at\nrender time.\n\n## Boundaries and gotchas\n\n- Runtime dependencies stay limited to `smrt-core`, `smrt-tenancy`, and\n `smrt-ui`. Never statically import sibling domain packages.\n- Lead loop-closing is conventional: CRM stores `sourceKind: 'campaign'` and a\n campaign key in `sourceId`; marketing does not import or mutate Lead.\n- Attribution math remains in sales/referrals. Marketing stores performance\n evidence only.\n- Campaign rollups and channel snapshots may describe the same period. The\n pacing service deliberately chooses one evidence level instead of summing\n both.\n- Corrections append a new metric snapshot with a new dedupe key; never edit\n persisted evidence.\n- Table names are global: `campaigns`, `campaign_channels`, and\n `campaign_metric_snapshots`.\n"
|
|
1109
|
+
"agentDoc": "# @happyvertical/smrt-marketing\n\nCross-channel campaign coordination for SMRT. This package owns Campaign\nidentity, budgets, lifecycle, execution links, immutable performance evidence,\ncomputed pacing, and props-driven Svelte surfaces. It does not execute ads,\npublish social posts, send messages, or own sales attribution.\n\n## Validation\n\nRun `pnpm --filter @happyvertical/smrt-marketing test` and\n`pnpm --filter @happyvertical/smrt-marketing typecheck`; use `test:coverage`\nto exercise the model/service and component coverage configurations.\nNatural-key changes must also run\n`pnpm --filter @happyvertical/smrt-marketing test:postgres` when\nthe disposable PostgreSQL harness is available. Use\n`pnpm --filter @happyvertical/smrt-marketing build` and `verify:pack` for\npublish-surface changes.\n\n## Models\n\n- **Campaign**: optional-tenant umbrella with stable natural key\n `(tenant_id, campaign_key)`, open objective, integer-cent budget, currency,\n schedule, optional native UUID reference to the canonical commerce Customer,\n guarded metadata helpers, and lifecycle\n `draft → scheduled → active ↔ paused → completed → archived`. Raw saves are\n protected by an authoritative prior-status re-read; use\n `CampaignLifecycleService` for lifecycle writes.\n- **CampaignChannel**: one generic execution link per\n `(campaign_id, channel_kind, channel_ref)`. `channelKind`/`channelRef` are\n intentionally plain strings so ads, social, messages, content, events, and\n referral programs remain peer packages. Allocation and schedule overrides\n use integer cents and dates.\n- **CampaignMetricSnapshot**: immutable period evidence with a global\n `dedupe_key` natural key. A snapshot always carries `campaignId`; a null\n `campaignChannelId` means campaign-level rollup evidence; when present, the\n channel must belong to that same campaign. API/MCP/CLI expose create/list/get\n only, and the save guard rejects hydrated edits, blind-id overwrites, and\n natural-key overwrites. Programmatic deletion is rejected.\n\nEvery model is `@TenantScoped({ mode: 'optional' })` with nullable `tenantId`.\nAll generated surfaces are explicit; never omit `api`, `mcp`, or `cli` config.\n\n## Services\n\n- **CampaignLifecycleService** loads the current row before applying one legal\n transition. Paused campaigns may resume; completed campaigns may only be\n archived; archived campaigns are terminal.\n- **MetricIngestionService** validates required scope/source/period fields and\n delegates to `getOrCreateByDedupeKey()`. A replay returns the original row\n unchanged even if the replay payload differs.\n- **BudgetPacingService** computes campaign/channel pacing from snapshots and\n never persists derived balances. For each exact reporting period, campaign\n pacing prefers campaign rollups and otherwise sums channel snapshots,\n preventing double counting without dropping channel-only periods. Status\n uses a five-percent budget tolerance around schedule-derived expected spend.\n- **CampaignCollection** exposes bounded, tenant-and-Customer-scoped cursor\n pages ordered by `start_at DESC, id DESC` and bounded batch summaries for\n total count, active count, and latest start time. Customer scope is validated\n through runtime relationship metadata; there is no static commerce import or\n tenant-wide campaign materialization.\n\n## Svelte\n\n`@happyvertical/smrt-marketing/svelte` exports `MarketingDashboard`,\n`CampaignList`, `CampaignDetail`, `ChannelMix`, and `BudgetPacing`, plus view\ninterfaces and pure helpers. Components are props-only: no fetching, no model\nimports, no providers. Use Provider-free `smrt-ui` primitives, `--smrt-*`\ntokens, named `$props()` interfaces, and integer-cent inputs formatted only at\nrender time.\n\n## Boundaries and gotchas\n\n- Runtime dependencies stay limited to `smrt-core`, `smrt-tenancy`, and\n `smrt-ui`. Never statically import sibling domain packages.\n- `Campaign.customerId` targets `@happyvertical/smrt-commerce:Customer` through\n `@crossPackageRef`. Saves and customer-scoped reads require exact tenant\n agreement (including global-to-global only) and fail without revealing\n whether a Customer is absent or belongs elsewhere. Associated saves validate\n and persist through one transaction-bound Campaign instance; scoped reads\n validate and query through one fresh transaction-bound collection. PostgreSQL\n locks the validated Customer rows for the duration of each operation.\n- Lead loop-closing is conventional: CRM stores `sourceKind: 'campaign'` and a\n campaign key in `sourceId`; marketing does not import or mutate Lead.\n- Attribution math remains in sales/referrals. Marketing stores performance\n evidence only.\n- Campaign rollups and channel snapshots may describe the same period. The\n pacing service deliberately chooses one evidence level instead of summing\n both.\n- Corrections append a new metric snapshot with a new dedupe key; never edit\n persisted evidence.\n- Table names are global: `campaigns`, `campaign_channels`, and\n `campaign_metric_snapshots`.\n"
|
|
1052
1110
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SmrtObjectOptions } from '@happyvertical/smrt-core';
|
|
2
|
+
import { Campaign } from './models/Campaign.js';
|
|
2
3
|
export declare const CAMPAIGN_STATUSES: readonly ["draft", "scheduled", "active", "paused", "completed", "archived"];
|
|
3
4
|
export type CampaignStatus = (typeof CAMPAIGN_STATUSES)[number];
|
|
4
5
|
export declare const CAMPAIGN_CHANNEL_KINDS: readonly ["ad_group", "social_post", "message", "content", "event", "referral_program"];
|
|
@@ -7,6 +8,7 @@ export declare const CAMPAIGN_CHANNEL_STATUSES: readonly ["planned", "scheduled"
|
|
|
7
8
|
export type CampaignChannelStatus = (typeof CAMPAIGN_CHANNEL_STATUSES)[number];
|
|
8
9
|
export interface CampaignOptions extends SmrtObjectOptions {
|
|
9
10
|
tenantId?: string | null;
|
|
11
|
+
customerId?: string | null;
|
|
10
12
|
campaignKey?: string;
|
|
11
13
|
name?: string;
|
|
12
14
|
objective?: string;
|
|
@@ -17,6 +19,28 @@ export interface CampaignOptions extends SmrtObjectOptions {
|
|
|
17
19
|
currency?: string;
|
|
18
20
|
metadata?: string;
|
|
19
21
|
}
|
|
22
|
+
export interface CampaignCustomerCursorInput {
|
|
23
|
+
startAt: Date | string | number | null;
|
|
24
|
+
id: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CampaignCustomerCursor {
|
|
27
|
+
startAt: Date | null;
|
|
28
|
+
id: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ListCampaignsByCustomerOptions {
|
|
31
|
+
limit?: number;
|
|
32
|
+
after?: CampaignCustomerCursorInput;
|
|
33
|
+
}
|
|
34
|
+
export interface CampaignCustomerPage {
|
|
35
|
+
items: Campaign[];
|
|
36
|
+
nextCursor: CampaignCustomerCursor | null;
|
|
37
|
+
}
|
|
38
|
+
export interface CampaignCustomerSummary {
|
|
39
|
+
customerId: string;
|
|
40
|
+
totalCount: number;
|
|
41
|
+
activeCount: number;
|
|
42
|
+
latestStartAt: Date | null;
|
|
43
|
+
}
|
|
20
44
|
export interface CampaignChannelOptions extends SmrtObjectOptions {
|
|
21
45
|
tenantId?: string | null;
|
|
22
46
|
campaignId?: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,eAAO,MAAM,iBAAiB,8EAOpB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,eAAO,MAAM,sBAAsB,yFAOzB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC3B,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,GACvC,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,eAAO,MAAM,yBAAyB,iFAO5B,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,IAAI,GAAG,MA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-
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/** Shared model and service contracts for @happyvertical/smrt-marketing. */\n\nimport type { SmrtObjectOptions } from '@happyvertical/smrt-core';\n\nexport const CAMPAIGN_STATUSES = [\n 'draft',\n 'scheduled',\n 'active',\n 'paused',\n 'completed',\n 'archived',\n] as const;\n\nexport type CampaignStatus = (typeof CAMPAIGN_STATUSES)[number];\n\nexport const CAMPAIGN_CHANNEL_KINDS = [\n 'ad_group',\n 'social_post',\n 'message',\n 'content',\n 'event',\n 'referral_program',\n] as const;\n\nexport type CampaignChannelKind =\n | (typeof CAMPAIGN_CHANNEL_KINDS)[number]\n | (string & {});\n\nexport const CAMPAIGN_CHANNEL_STATUSES = [\n 'planned',\n 'scheduled',\n 'active',\n 'paused',\n 'completed',\n 'cancelled',\n] as const;\n\nexport type CampaignChannelStatus = (typeof CAMPAIGN_CHANNEL_STATUSES)[number];\n\nexport interface CampaignOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n campaignKey?: string;\n name?: string;\n objective?: string;\n status?: CampaignStatus;\n startAt?: Date | string | number | null;\n endAt?: Date | string | number | null;\n budgetCents?: number;\n currency?: string;\n metadata?: string;\n}\n\nexport interface CampaignChannelOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n campaignId?: string;\n channelKind?: CampaignChannelKind;\n channelRef?: string;\n allocatedBudgetCents?: number;\n startAt?: Date | string | number | null;\n endAt?: Date | string | number | null;\n status?: CampaignChannelStatus;\n}\n\nexport interface CampaignMetricSnapshotOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n campaignId?: string;\n campaignChannelId?: string | null;\n periodStart?: Date | string | number;\n periodEnd?: Date | string | number;\n spendCents?: number;\n impressions?: number;\n clicks?: number;\n conversions?: number;\n leads?: number;\n revenueCents?: number | null;\n source?: string;\n dedupeKey?: string;\n}\n\nexport type BudgetPacingStatus =\n | 'unbudgeted'\n | 'not_started'\n | 'behind'\n | 'on_track'\n | 'ahead'\n | 'over_budget'\n | 'complete';\n\nexport interface BudgetPacingResult {\n campaignId: string;\n campaignChannelId?: string;\n currency: string;\n budgetCents: number;\n spendCents: number;\n remainingCents: number;\n expectedSpendCents: number | null;\n varianceCents: number | null;\n budgetFraction: number | null;\n elapsedFraction: number | null;\n status: BudgetPacingStatus;\n snapshotCount: number;\n usedCampaignRollups: boolean;\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/** Shared model and service contracts for @happyvertical/smrt-marketing. */\n\nimport type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport type { Campaign } from './models/Campaign.js';\n\nexport const CAMPAIGN_STATUSES = [\n 'draft',\n 'scheduled',\n 'active',\n 'paused',\n 'completed',\n 'archived',\n] as const;\n\nexport type CampaignStatus = (typeof CAMPAIGN_STATUSES)[number];\n\nexport const CAMPAIGN_CHANNEL_KINDS = [\n 'ad_group',\n 'social_post',\n 'message',\n 'content',\n 'event',\n 'referral_program',\n] as const;\n\nexport type CampaignChannelKind =\n | (typeof CAMPAIGN_CHANNEL_KINDS)[number]\n | (string & {});\n\nexport const CAMPAIGN_CHANNEL_STATUSES = [\n 'planned',\n 'scheduled',\n 'active',\n 'paused',\n 'completed',\n 'cancelled',\n] as const;\n\nexport type CampaignChannelStatus = (typeof CAMPAIGN_CHANNEL_STATUSES)[number];\n\nexport interface CampaignOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n customerId?: string | null;\n campaignKey?: string;\n name?: string;\n objective?: string;\n status?: CampaignStatus;\n startAt?: Date | string | number | null;\n endAt?: Date | string | number | null;\n budgetCents?: number;\n currency?: string;\n metadata?: string;\n}\n\nexport interface CampaignCustomerCursorInput {\n startAt: Date | string | number | null;\n id: string;\n}\n\nexport interface CampaignCustomerCursor {\n startAt: Date | null;\n id: string;\n}\n\nexport interface ListCampaignsByCustomerOptions {\n limit?: number;\n after?: CampaignCustomerCursorInput;\n}\n\nexport interface CampaignCustomerPage {\n items: Campaign[];\n nextCursor: CampaignCustomerCursor | null;\n}\n\nexport interface CampaignCustomerSummary {\n customerId: string;\n totalCount: number;\n activeCount: number;\n latestStartAt: Date | null;\n}\n\nexport interface CampaignChannelOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n campaignId?: string;\n channelKind?: CampaignChannelKind;\n channelRef?: string;\n allocatedBudgetCents?: number;\n startAt?: Date | string | number | null;\n endAt?: Date | string | number | null;\n status?: CampaignChannelStatus;\n}\n\nexport interface CampaignMetricSnapshotOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n campaignId?: string;\n campaignChannelId?: string | null;\n periodStart?: Date | string | number;\n periodEnd?: Date | string | number;\n spendCents?: number;\n impressions?: number;\n clicks?: number;\n conversions?: number;\n leads?: number;\n revenueCents?: number | null;\n source?: string;\n dedupeKey?: string;\n}\n\nexport type BudgetPacingStatus =\n | 'unbudgeted'\n | 'not_started'\n | 'behind'\n | 'on_track'\n | 'ahead'\n | 'over_budget'\n | 'complete';\n\nexport interface BudgetPacingResult {\n campaignId: string;\n campaignChannelId?: string;\n currency: string;\n budgetCents: number;\n spendCents: number;\n remainingCents: number;\n expectedSpendCents: number | null;\n varianceCents: number | null;\n budgetFraction: number | null;\n elapsedFraction: number | null;\n status: BudgetPacingStatus;\n snapshotCount: number;\n usedCampaignRollups: boolean;\n}\n"],"mappings":";AAKO,IAAM,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;AACF;AAIO,IAAM,yBAAyB;CACpC;CACA;CACA;CACA;CACA;CACA;AACF;AAMO,IAAM,4BAA4B;CACvC;CACA;CACA;CACA;CACA;CACA;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-marketing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "Cross-channel campaign coordination, immutable performance evidence, budget pacing, and reusable Svelte marketing surfaces for SMRT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"./manifest.json": "./dist/manifest.json"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@happyvertical/smrt-core": "0.
|
|
28
|
-
"@happyvertical/smrt-tenancy": "0.
|
|
29
|
-
"@happyvertical/smrt-ui": "0.
|
|
27
|
+
"@happyvertical/smrt-core": "0.43.0",
|
|
28
|
+
"@happyvertical/smrt-tenancy": "0.43.0",
|
|
29
|
+
"@happyvertical/smrt-ui": "0.43.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"svelte": "^5.56.4"
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"typescript": "5.9.3",
|
|
44
44
|
"vite": "8.1.4",
|
|
45
45
|
"vitest": "4.1.10",
|
|
46
|
-
"@happyvertical/smrt-vitest": "0.
|
|
46
|
+
"@happyvertical/smrt-vitest": "0.43.0",
|
|
47
|
+
"@happyvertical/smrt-commerce": "0.43.0"
|
|
47
48
|
},
|
|
48
49
|
"smrtRawPrimitives": "strict",
|
|
49
50
|
"keywords": [
|