@endora-commerce/mod-newsletter 0.100.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/LICENSE +21 -0
- package/README.md +66 -0
- package/dist/admin/api/newsletter-client.d.ts +64 -0
- package/dist/admin/api/newsletter-client.d.ts.map +1 -0
- package/dist/admin/api/newsletter-client.js +71 -0
- package/dist/admin/api/newsletter-client.js.map +1 -0
- package/dist/admin/email-variables.d.ts +21 -0
- package/dist/admin/email-variables.d.ts.map +1 -0
- package/dist/admin/email-variables.js +48 -0
- package/dist/admin/email-variables.js.map +1 -0
- package/dist/admin/index.d.ts +44 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +149 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/pages/AutomationBuilder.d.ts +8 -0
- package/dist/admin/pages/AutomationBuilder.d.ts.map +1 -0
- package/dist/admin/pages/AutomationBuilder.js +131 -0
- package/dist/admin/pages/AutomationBuilder.js.map +1 -0
- package/dist/admin/pages/AutomationsPage.d.ts +8 -0
- package/dist/admin/pages/AutomationsPage.d.ts.map +1 -0
- package/dist/admin/pages/AutomationsPage.js +43 -0
- package/dist/admin/pages/AutomationsPage.js.map +1 -0
- package/dist/admin/pages/BlocksPage.d.ts +8 -0
- package/dist/admin/pages/BlocksPage.d.ts.map +1 -0
- package/dist/admin/pages/BlocksPage.js +110 -0
- package/dist/admin/pages/BlocksPage.js.map +1 -0
- package/dist/admin/pages/CampaignEditor.d.ts +8 -0
- package/dist/admin/pages/CampaignEditor.d.ts.map +1 -0
- package/dist/admin/pages/CampaignEditor.js +144 -0
- package/dist/admin/pages/CampaignEditor.js.map +1 -0
- package/dist/admin/pages/CampaignStats.d.ts +8 -0
- package/dist/admin/pages/CampaignStats.d.ts.map +1 -0
- package/dist/admin/pages/CampaignStats.js +45 -0
- package/dist/admin/pages/CampaignStats.js.map +1 -0
- package/dist/admin/pages/CampaignsPage.d.ts +8 -0
- package/dist/admin/pages/CampaignsPage.d.ts.map +1 -0
- package/dist/admin/pages/CampaignsPage.js +28 -0
- package/dist/admin/pages/CampaignsPage.js.map +1 -0
- package/dist/admin/pages/ProviderSettingsPage.d.ts +8 -0
- package/dist/admin/pages/ProviderSettingsPage.d.ts.map +1 -0
- package/dist/admin/pages/ProviderSettingsPage.js +64 -0
- package/dist/admin/pages/ProviderSettingsPage.js.map +1 -0
- package/dist/admin/pages/SubscribersPage.d.ts +8 -0
- package/dist/admin/pages/SubscribersPage.d.ts.map +1 -0
- package/dist/admin/pages/SubscribersPage.js +55 -0
- package/dist/admin/pages/SubscribersPage.js.map +1 -0
- package/dist/admin/pages/TagsPage.d.ts +8 -0
- package/dist/admin/pages/TagsPage.d.ts.map +1 -0
- package/dist/admin/pages/TagsPage.js +114 -0
- package/dist/admin/pages/TagsPage.js.map +1 -0
- package/dist/backend/entities/newsletter-automation-run.entity.d.ts +19 -0
- package/dist/backend/entities/newsletter-automation-run.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-automation-run.entity.js +72 -0
- package/dist/backend/entities/newsletter-automation-run.entity.js.map +1 -0
- package/dist/backend/entities/newsletter-automation.entity.d.ts +22 -0
- package/dist/backend/entities/newsletter-automation.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-automation.entity.js +86 -0
- package/dist/backend/entities/newsletter-automation.entity.js.map +1 -0
- package/dist/backend/entities/newsletter-campaign-subscriber.entity.d.ts +6 -0
- package/dist/backend/entities/newsletter-campaign-subscriber.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-campaign-subscriber.entity.js +30 -0
- package/dist/backend/entities/newsletter-campaign-subscriber.entity.js.map +1 -0
- package/dist/backend/entities/newsletter-campaign.entity.d.ts +22 -0
- package/dist/backend/entities/newsletter-campaign.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-campaign.entity.js +102 -0
- package/dist/backend/entities/newsletter-campaign.entity.js.map +1 -0
- package/dist/backend/entities/newsletter-custom-field.entity.d.ts +12 -0
- package/dist/backend/entities/newsletter-custom-field.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-custom-field.entity.js +53 -0
- package/dist/backend/entities/newsletter-custom-field.entity.js.map +1 -0
- package/dist/backend/entities/newsletter-email-block-sales-channel.entity.d.ts +7 -0
- package/dist/backend/entities/newsletter-email-block-sales-channel.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-email-block-sales-channel.entity.js +35 -0
- package/dist/backend/entities/newsletter-email-block-sales-channel.entity.js.map +1 -0
- package/dist/backend/entities/newsletter-email-block.entity.d.ts +21 -0
- package/dist/backend/entities/newsletter-email-block.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-email-block.entity.js +78 -0
- package/dist/backend/entities/newsletter-email-block.entity.js.map +1 -0
- package/dist/backend/entities/newsletter-engagement-event.entity.d.ts +12 -0
- package/dist/backend/entities/newsletter-engagement-event.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-engagement-event.entity.js +54 -0
- package/dist/backend/entities/newsletter-engagement-event.entity.js.map +1 -0
- package/dist/backend/entities/newsletter-send-record.entity.d.ts +23 -0
- package/dist/backend/entities/newsletter-send-record.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-send-record.entity.js +89 -0
- package/dist/backend/entities/newsletter-send-record.entity.js.map +1 -0
- package/dist/backend/entities/newsletter-subscriber-tag.entity.d.ts +6 -0
- package/dist/backend/entities/newsletter-subscriber-tag.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-subscriber-tag.entity.js +31 -0
- package/dist/backend/entities/newsletter-subscriber-tag.entity.js.map +1 -0
- package/dist/backend/entities/newsletter-subscriber.entity.d.ts +63 -0
- package/dist/backend/entities/newsletter-subscriber.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-subscriber.entity.js +147 -0
- package/dist/backend/entities/newsletter-subscriber.entity.js.map +1 -0
- package/dist/backend/entities/newsletter-suppression.entity.d.ts +14 -0
- package/dist/backend/entities/newsletter-suppression.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-suppression.entity.js +51 -0
- package/dist/backend/entities/newsletter-suppression.entity.js.map +1 -0
- package/dist/backend/entities/newsletter-tag.entity.d.ts +12 -0
- package/dist/backend/entities/newsletter-tag.entity.d.ts.map +1 -0
- package/dist/backend/entities/newsletter-tag.entity.js +53 -0
- package/dist/backend/entities/newsletter-tag.entity.js.map +1 -0
- package/dist/backend/index.d.ts +120 -0
- package/dist/backend/index.d.ts.map +1 -0
- package/dist/backend/index.js +139 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/plugin.d.ts +114 -0
- package/dist/backend/plugin.d.ts.map +1 -0
- package/dist/backend/plugin.js +171 -0
- package/dist/backend/plugin.js.map +1 -0
- package/dist/backend/routes.admin.d.ts +27 -0
- package/dist/backend/routes.admin.d.ts.map +1 -0
- package/dist/backend/routes.admin.js +118 -0
- package/dist/backend/routes.admin.js.map +1 -0
- package/dist/backend/routes.self.d.ts +15 -0
- package/dist/backend/routes.self.d.ts.map +1 -0
- package/dist/backend/routes.self.js +28 -0
- package/dist/backend/routes.self.js.map +1 -0
- package/dist/backend/routes.storefront.d.ts +24 -0
- package/dist/backend/routes.storefront.d.ts.map +1 -0
- package/dist/backend/routes.storefront.js +79 -0
- package/dist/backend/routes.storefront.js.map +1 -0
- package/dist/backend/services/audience-resolver.d.ts +20 -0
- package/dist/backend/services/audience-resolver.d.ts.map +1 -0
- package/dist/backend/services/audience-resolver.js +41 -0
- package/dist/backend/services/audience-resolver.js.map +1 -0
- package/dist/backend/services/automation.service.d.ts +58 -0
- package/dist/backend/services/automation.service.d.ts.map +1 -0
- package/dist/backend/services/automation.service.js +301 -0
- package/dist/backend/services/automation.service.js.map +1 -0
- package/dist/backend/services/campaign-dispatch.service.d.ts +50 -0
- package/dist/backend/services/campaign-dispatch.service.d.ts.map +1 -0
- package/dist/backend/services/campaign-dispatch.service.js +130 -0
- package/dist/backend/services/campaign-dispatch.service.js.map +1 -0
- package/dist/backend/services/campaign.service.d.ts +40 -0
- package/dist/backend/services/campaign.service.d.ts.map +1 -0
- package/dist/backend/services/campaign.service.js +195 -0
- package/dist/backend/services/campaign.service.js.map +1 -0
- package/dist/backend/services/consent-block-seeder.d.ts +30 -0
- package/dist/backend/services/consent-block-seeder.d.ts.map +1 -0
- package/dist/backend/services/consent-block-seeder.js +52 -0
- package/dist/backend/services/consent-block-seeder.js.map +1 -0
- package/dist/backend/services/content.service.d.ts +52 -0
- package/dist/backend/services/content.service.d.ts.map +1 -0
- package/dist/backend/services/content.service.js +48 -0
- package/dist/backend/services/content.service.js.map +1 -0
- package/dist/backend/services/custom-field.service.d.ts +16 -0
- package/dist/backend/services/custom-field.service.d.ts.map +1 -0
- package/dist/backend/services/custom-field.service.js +67 -0
- package/dist/backend/services/custom-field.service.js.map +1 -0
- package/dist/backend/services/email-block.service.d.ts +26 -0
- package/dist/backend/services/email-block.service.d.ts.map +1 -0
- package/dist/backend/services/email-block.service.js +120 -0
- package/dist/backend/services/email-block.service.js.map +1 -0
- package/dist/backend/services/opt-in.service.d.ts +25 -0
- package/dist/backend/services/opt-in.service.d.ts.map +1 -0
- package/dist/backend/services/opt-in.service.js +46 -0
- package/dist/backend/services/opt-in.service.js.map +1 -0
- package/dist/backend/services/provider/console-provider.d.ts +32 -0
- package/dist/backend/services/provider/console-provider.d.ts.map +1 -0
- package/dist/backend/services/provider/console-provider.js +31 -0
- package/dist/backend/services/provider/console-provider.js.map +1 -0
- package/dist/backend/services/provider/provider-registry.d.ts +51 -0
- package/dist/backend/services/provider/provider-registry.d.ts.map +1 -0
- package/dist/backend/services/provider/provider-registry.js +84 -0
- package/dist/backend/services/provider/provider-registry.js.map +1 -0
- package/dist/backend/services/provider/smtp-provider.d.ts +30 -0
- package/dist/backend/services/provider/smtp-provider.d.ts.map +1 -0
- package/dist/backend/services/provider/smtp-provider.js +42 -0
- package/dist/backend/services/provider/smtp-provider.js.map +1 -0
- package/dist/backend/services/provider-admin.service.d.ts +39 -0
- package/dist/backend/services/provider-admin.service.d.ts.map +1 -0
- package/dist/backend/services/provider-admin.service.js +59 -0
- package/dist/backend/services/provider-admin.service.js.map +1 -0
- package/dist/backend/services/provider-admin.types.d.ts +6 -0
- package/dist/backend/services/provider-admin.types.d.ts.map +1 -0
- package/dist/backend/services/provider-admin.types.js +2 -0
- package/dist/backend/services/provider-admin.types.js.map +1 -0
- package/dist/backend/services/queues/newsletter-queues.d.ts +34 -0
- package/dist/backend/services/queues/newsletter-queues.d.ts.map +1 -0
- package/dist/backend/services/queues/newsletter-queues.js +58 -0
- package/dist/backend/services/queues/newsletter-queues.js.map +1 -0
- package/dist/backend/services/self.service.d.ts +17 -0
- package/dist/backend/services/self.service.d.ts.map +1 -0
- package/dist/backend/services/self.service.js +44 -0
- package/dist/backend/services/self.service.js.map +1 -0
- package/dist/backend/services/stats.service.d.ts +10 -0
- package/dist/backend/services/stats.service.d.ts.map +1 -0
- package/dist/backend/services/stats.service.js +45 -0
- package/dist/backend/services/stats.service.js.map +1 -0
- package/dist/backend/services/subscriber-admin.service.d.ts +26 -0
- package/dist/backend/services/subscriber-admin.service.d.ts.map +1 -0
- package/dist/backend/services/subscriber-admin.service.js +163 -0
- package/dist/backend/services/subscriber-admin.service.js.map +1 -0
- package/dist/backend/services/subscriber.service.d.ts +91 -0
- package/dist/backend/services/subscriber.service.d.ts.map +1 -0
- package/dist/backend/services/subscriber.service.js +280 -0
- package/dist/backend/services/subscriber.service.js.map +1 -0
- package/dist/backend/services/tag.service.d.ts +16 -0
- package/dist/backend/services/tag.service.d.ts.map +1 -0
- package/dist/backend/services/tag.service.js +79 -0
- package/dist/backend/services/tag.service.js.map +1 -0
- package/dist/backend/services/token.helper.d.ts +32 -0
- package/dist/backend/services/token.helper.d.ts.map +1 -0
- package/dist/backend/services/token.helper.js +76 -0
- package/dist/backend/services/token.helper.js.map +1 -0
- package/dist/backend/services/tracking.service.d.ts +14 -0
- package/dist/backend/services/tracking.service.d.ts.map +1 -0
- package/dist/backend/services/tracking.service.js +45 -0
- package/dist/backend/services/tracking.service.js.map +1 -0
- package/dist/manifest.d.ts +192 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +211 -0
- package/dist/manifest.js.map +1 -0
- package/dist/migrations/20260629T200954_newsletter_init.d.ts +6 -0
- package/dist/migrations/20260629T200954_newsletter_init.d.ts.map +1 -0
- package/dist/migrations/20260629T200954_newsletter_init.js +261 -0
- package/dist/migrations/20260629T200954_newsletter_init.js.map +1 -0
- package/dist/migrations/20260830T212736_newsletter_organization_attribution.d.ts +116 -0
- package/dist/migrations/20260830T212736_newsletter_organization_attribution.d.ts.map +1 -0
- package/dist/migrations/20260830T212736_newsletter_organization_attribution.js +186 -0
- package/dist/migrations/20260830T212736_newsletter_organization_attribution.js.map +1 -0
- package/dist/migrations/20260903T101752_newsletter_namespace_block_names.d.ts +6 -0
- package/dist/migrations/20260903T101752_newsletter_namespace_block_names.d.ts.map +1 -0
- package/dist/migrations/20260903T101752_newsletter_namespace_block_names.js +58 -0
- package/dist/migrations/20260903T101752_newsletter_namespace_block_names.js.map +1 -0
- package/dist/migrations/20260912T125702_newsletter_subscriber_tenant_scope_index.d.ts +23 -0
- package/dist/migrations/20260912T125702_newsletter_subscriber_tenant_scope_index.d.ts.map +1 -0
- package/dist/migrations/20260912T125702_newsletter_subscriber_tenant_scope_index.js +27 -0
- package/dist/migrations/20260912T125702_newsletter_subscriber_tenant_scope_index.js.map +1 -0
- package/dist/migrations/index.d.ts +30 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +35 -0
- package/dist/migrations/index.js.map +1 -0
- package/docs/newsletter.md +94 -0
- package/i18n/en.json +27 -0
- package/i18n/pl.json +27 -0
- package/package.json +119 -0
- package/tailwind.css +14 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Entity, Index, OptionalProps, PrimaryKey, Property } from '@mikro-orm/core';
|
|
11
|
+
import { GlobalEntity } from '@endora-commerce/platform/tenancy';
|
|
12
|
+
import { randomUUID } from 'crypto';
|
|
13
|
+
/**
|
|
14
|
+
* NewsletterSendRecord — feature 048. Per-recipient send + the atomic
|
|
15
|
+
* idempotency claim (Principle X). `id` is the stable provider messageId.
|
|
16
|
+
* Unique (campaign_id, subscriber_id) / (automation_run_id, step_index,
|
|
17
|
+
* subscriber_id) partial indexes are created in the migration.
|
|
18
|
+
*/
|
|
19
|
+
let NewsletterSendRecord = class NewsletterSendRecord {
|
|
20
|
+
[OptionalProps];
|
|
21
|
+
id = randomUUID();
|
|
22
|
+
campaignId = null;
|
|
23
|
+
automationRunId = null;
|
|
24
|
+
stepIndex = null;
|
|
25
|
+
subscriberId;
|
|
26
|
+
status = 'queued';
|
|
27
|
+
providerMessageId = null;
|
|
28
|
+
error = null;
|
|
29
|
+
openedAt = null;
|
|
30
|
+
clickCount = 0;
|
|
31
|
+
sentAt = null;
|
|
32
|
+
createdAt = new Date();
|
|
33
|
+
};
|
|
34
|
+
__decorate([
|
|
35
|
+
PrimaryKey({ type: 'uuid' }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], NewsletterSendRecord.prototype, "id", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
Property({ type: 'uuid', fieldName: 'campaign_id', nullable: true }),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], NewsletterSendRecord.prototype, "campaignId", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
Property({ type: 'uuid', fieldName: 'automation_run_id', nullable: true }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], NewsletterSendRecord.prototype, "automationRunId", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
Property({ type: 'integer', fieldName: 'step_index', nullable: true }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], NewsletterSendRecord.prototype, "stepIndex", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
Property({ type: 'uuid', fieldName: 'subscriber_id' }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], NewsletterSendRecord.prototype, "subscriberId", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
Property({ type: 'string', length: 16 }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], NewsletterSendRecord.prototype, "status", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
Property({ type: 'string', length: 255, fieldName: 'provider_message_id', nullable: true }),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], NewsletterSendRecord.prototype, "providerMessageId", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
Property({ type: 'text', nullable: true }),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], NewsletterSendRecord.prototype, "error", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
Property({ type: 'datetime', fieldName: 'opened_at', nullable: true }),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], NewsletterSendRecord.prototype, "openedAt", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
Property({ type: 'integer', fieldName: 'click_count' }),
|
|
72
|
+
__metadata("design:type", Number)
|
|
73
|
+
], NewsletterSendRecord.prototype, "clickCount", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
Property({ type: 'datetime', fieldName: 'sent_at', nullable: true }),
|
|
76
|
+
__metadata("design:type", Object)
|
|
77
|
+
], NewsletterSendRecord.prototype, "sentAt", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
Property({ type: 'datetime', fieldName: 'created_at', onCreate: () => new Date() }),
|
|
80
|
+
__metadata("design:type", Date)
|
|
81
|
+
], NewsletterSendRecord.prototype, "createdAt", void 0);
|
|
82
|
+
NewsletterSendRecord = __decorate([
|
|
83
|
+
GlobalEntity(),
|
|
84
|
+
Entity({ tableName: 'newsletter_send_records' }),
|
|
85
|
+
Index({ properties: ['subscriberId'] }),
|
|
86
|
+
Index({ properties: ['status'] })
|
|
87
|
+
], NewsletterSendRecord);
|
|
88
|
+
export { NewsletterSendRecord };
|
|
89
|
+
//# sourceMappingURL=newsletter-send-record.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"newsletter-send-record.entity.js","sourceRoot":"","sources":["../../../src/backend/entities/newsletter-send-record.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;;;;GAKG;AAKI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,CAAC,aAAa,CAAC,CAUC;IAGhB,EAAE,GAAW,UAAU,EAAE,CAAC;IAG1B,UAAU,GAAkB,IAAI,CAAC;IAGjC,eAAe,GAAkB,IAAI,CAAC;IAGtC,SAAS,GAAkB,IAAI,CAAC;IAGhC,YAAY,CAAU;IAGtB,MAAM,GAA4D,QAAQ,CAAC;IAG3E,iBAAiB,GAAkB,IAAI,CAAC;IAGxC,KAAK,GAAkB,IAAI,CAAC;IAG5B,QAAQ,GAAgB,IAAI,CAAC;IAG7B,UAAU,GAAW,CAAC,CAAC;IAGvB,MAAM,GAAgB,IAAI,CAAC;IAG3B,SAAS,GAAS,IAAI,IAAI,EAAE,CAAC;CAC9B,CAAA;AAlCC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDACH;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACpC;AAGjC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6DACrC;AAGtC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACvC;AAGhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;;0DACjC;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;oDACkC;AAG3E;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+DACpD;AAGxC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACf;AAG5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDAC1C;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;;wDACjC;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDAC1C;AAG3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BACzE,IAAI;uDAAc;AA/ClB,oBAAoB;IAJhC,YAAY,EAAE;IACd,MAAM,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,CAAC;IAChD,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC;IACvC,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;GACrB,oBAAoB,CAgDhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"newsletter-subscriber-tag.entity.d.ts","sourceRoot":"","sources":["../../../src/backend/entities/newsletter-subscriber-tag.entity.ts"],"names":[],"mappings":"AAGA,sEAAsE;AACtE,qBAGa,uBAAuB;IAElC,YAAY,EAAG,MAAM,CAAC;IAGtB,KAAK,EAAG,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Entity, Index, PrimaryKey } from '@mikro-orm/core';
|
|
11
|
+
import { GlobalEntity } from '@endora-commerce/platform/tenancy';
|
|
12
|
+
/** NewsletterSubscriberTag — feature 048. Bridge subscriber ⇆ tag. */
|
|
13
|
+
let NewsletterSubscriberTag = class NewsletterSubscriberTag {
|
|
14
|
+
subscriberId;
|
|
15
|
+
tagId;
|
|
16
|
+
};
|
|
17
|
+
__decorate([
|
|
18
|
+
PrimaryKey({ type: 'uuid', fieldName: 'subscriber_id' }),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], NewsletterSubscriberTag.prototype, "subscriberId", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
PrimaryKey({ type: 'uuid', fieldName: 'tag_id' }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], NewsletterSubscriberTag.prototype, "tagId", void 0);
|
|
25
|
+
NewsletterSubscriberTag = __decorate([
|
|
26
|
+
GlobalEntity(),
|
|
27
|
+
Entity({ tableName: 'newsletter_subscriber_tags' }),
|
|
28
|
+
Index({ properties: ['tagId'] })
|
|
29
|
+
], NewsletterSubscriberTag);
|
|
30
|
+
export { NewsletterSubscriberTag };
|
|
31
|
+
//# sourceMappingURL=newsletter-subscriber-tag.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"newsletter-subscriber-tag.entity.js","sourceRoot":"","sources":["../../../src/backend/entities/newsletter-subscriber-tag.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,sEAAsE;AAI/D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAElC,YAAY,CAAU;IAGtB,KAAK,CAAU;CAChB,CAAA;AAJC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;;6DACnC;AAGtB;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;;sDACnC;AALJ,uBAAuB;IAHnC,YAAY,EAAE;IACd,MAAM,CAAC,EAAE,SAAS,EAAE,4BAA4B,EAAE,CAAC;IACnD,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;GACpB,uBAAuB,CAMnC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { OptionalProps } from '@mikro-orm/core';
|
|
2
|
+
/**
|
|
3
|
+
* NewsletterSubscriber — feature 048. Identity is the email (global unique).
|
|
4
|
+
* `status` drives mailability (only `active` + not suppressed is mailable).
|
|
5
|
+
* `customFields` holds operator-defined values keyed by NewsletterCustomField.key.
|
|
6
|
+
*/
|
|
7
|
+
export declare class NewsletterSubscriber {
|
|
8
|
+
[OptionalProps]?: 'status' | 'source' | 'salesChannelId' | 'customerAccountId' | 'organizationId' | 'customFields' | 'consentAt' | 'confirmedAt' | 'unsubscribedAt' | 'unsubscribeReason' | 'deactivatedAt' | 'version' | 'createdAt' | 'updatedAt';
|
|
9
|
+
id: string;
|
|
10
|
+
email: string;
|
|
11
|
+
status: 'pending' | 'active' | 'unsubscribed' | 'deactivated';
|
|
12
|
+
source: string | null;
|
|
13
|
+
salesChannelId: string | null;
|
|
14
|
+
customerAccountId: string | null;
|
|
15
|
+
/**
|
|
16
|
+
* The organisation that owns this subscriber — feature 087 Group B, ruling
|
|
17
|
+
* D-187.
|
|
18
|
+
*
|
|
19
|
+
* Derived from {@link customerAccountId}'s account and stamped at the write,
|
|
20
|
+
* never resolved on read: `customerOrganizationColumn` asks the ORM's own
|
|
21
|
+
* metadata whether this property exists, so its presence is what makes
|
|
22
|
+
* `customerFilterCond`'s `allowed-set` arm **grant** on this table rather
|
|
23
|
+
* than refuse it whole. A sales representative assigned to the buyer's
|
|
24
|
+
* organisation sees this subscriber, and their CSV export of it, because
|
|
25
|
+
* this column is here.
|
|
26
|
+
*
|
|
27
|
+
* Nullable, and the constraint is an implication rather than an equivalence:
|
|
28
|
+
* `newsletter_subscribers_organization_attribution_chk` requires an
|
|
29
|
+
* organisation of a row that names an account and says nothing about a row
|
|
30
|
+
* that names none. On this table the ownerless row is the ordinary case
|
|
31
|
+
* rather than the edge — `POST /api/v1/newsletter/subscribe` passes no
|
|
32
|
+
* account at all, so every subscriber who has never signed in is one — and
|
|
33
|
+
* who they belong to is R-6's open question, which a constraint must not
|
|
34
|
+
* answer.
|
|
35
|
+
*
|
|
36
|
+
* It is written together with {@link customerAccountId} at both of this
|
|
37
|
+
* module's two write sites, and there is no third: `subscriber.service.ts`
|
|
38
|
+
* creates the row with an owner or without one, and adopts an ownerless row
|
|
39
|
+
* into an account when a subscriber who signed up anonymously later signs
|
|
40
|
+
* in. Nothing here ever clears the account, so unlike `pwa` there is no
|
|
41
|
+
* de-association direction, and unlike `pwa` the shape the implication
|
|
42
|
+
* leaves open — an ownerless row still carrying an organisation — is not
|
|
43
|
+
* reachable.
|
|
44
|
+
*
|
|
45
|
+
* **Not derived from {@link email}.** This column is globally unique and
|
|
46
|
+
* `customer_accounts` has an e-mail too, so a match is available and is
|
|
47
|
+
* deliberately not taken: it would attribute rows the schema does not link,
|
|
48
|
+
* silently and irreversibly, for whoever signed up with the address their
|
|
49
|
+
* employer later registered. That is R-6 answer (2) guessed rather than
|
|
50
|
+
* decided.
|
|
51
|
+
*/
|
|
52
|
+
organizationId: string | null;
|
|
53
|
+
customFields: Record<string, string | number | boolean | null>;
|
|
54
|
+
consentAt: Date | null;
|
|
55
|
+
confirmedAt: Date | null;
|
|
56
|
+
unsubscribedAt: Date | null;
|
|
57
|
+
unsubscribeReason: string | null;
|
|
58
|
+
deactivatedAt: Date | null;
|
|
59
|
+
version: number;
|
|
60
|
+
createdAt: Date;
|
|
61
|
+
updatedAt: Date;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=newsletter-subscriber.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"newsletter-subscriber.entity.d.ts","sourceRoot":"","sources":["../../../src/backend/entities/newsletter-subscriber.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,aAAa,EAAgC,MAAM,iBAAiB,CAAC;AAI7F;;;;GAIG;AACH,qBAEa,oBAAoB;IAC/B,CAAC,aAAa,CAAC,CAAC,EACZ,QAAQ,GACR,QAAQ,GACR,gBAAgB,GAChB,mBAAmB,GACnB,gBAAgB,GAChB,cAAc,GACd,WAAW,GACX,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,SAAS,GACT,WAAW,GACX,WAAW,CAAC;IAGhB,EAAE,EAAE,MAAM,CAAgB;IAI1B,KAAK,EAAG,MAAM,CAAC;IAIf,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,cAAc,GAAG,aAAa,CAAa;IAG1E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAQ;IAI7B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGrC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IAGH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGrC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAM;IAGpE,SAAS,EAAE,IAAI,GAAG,IAAI,CAAQ;IAG9B,WAAW,EAAE,IAAI,GAAG,IAAI,CAAQ;IAGhC,cAAc,EAAE,IAAI,GAAG,IAAI,CAAQ;IAGnC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGxC,aAAa,EAAE,IAAI,GAAG,IAAI,CAAQ;IAGlC,OAAO,EAAE,MAAM,CAAK;IAGpB,SAAS,EAAE,IAAI,CAAc;IAG7B,SAAS,EAAE,IAAI,CAAc;CAC9B"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Entity, Index, OptionalProps, PrimaryKey, Property, Unique } from '@mikro-orm/core';
|
|
11
|
+
import { CustomerScoped } from '@endora-commerce/platform/tenancy';
|
|
12
|
+
import { randomUUID } from 'crypto';
|
|
13
|
+
/**
|
|
14
|
+
* NewsletterSubscriber — feature 048. Identity is the email (global unique).
|
|
15
|
+
* `status` drives mailability (only `active` + not suppressed is mailable).
|
|
16
|
+
* `customFields` holds operator-defined values keyed by NewsletterCustomField.key.
|
|
17
|
+
*/
|
|
18
|
+
let NewsletterSubscriber = class NewsletterSubscriber {
|
|
19
|
+
[OptionalProps];
|
|
20
|
+
id = randomUUID();
|
|
21
|
+
email;
|
|
22
|
+
status = 'pending';
|
|
23
|
+
source = null;
|
|
24
|
+
salesChannelId = null;
|
|
25
|
+
customerAccountId = null;
|
|
26
|
+
/**
|
|
27
|
+
* The organisation that owns this subscriber — feature 087 Group B, ruling
|
|
28
|
+
* D-187.
|
|
29
|
+
*
|
|
30
|
+
* Derived from {@link customerAccountId}'s account and stamped at the write,
|
|
31
|
+
* never resolved on read: `customerOrganizationColumn` asks the ORM's own
|
|
32
|
+
* metadata whether this property exists, so its presence is what makes
|
|
33
|
+
* `customerFilterCond`'s `allowed-set` arm **grant** on this table rather
|
|
34
|
+
* than refuse it whole. A sales representative assigned to the buyer's
|
|
35
|
+
* organisation sees this subscriber, and their CSV export of it, because
|
|
36
|
+
* this column is here.
|
|
37
|
+
*
|
|
38
|
+
* Nullable, and the constraint is an implication rather than an equivalence:
|
|
39
|
+
* `newsletter_subscribers_organization_attribution_chk` requires an
|
|
40
|
+
* organisation of a row that names an account and says nothing about a row
|
|
41
|
+
* that names none. On this table the ownerless row is the ordinary case
|
|
42
|
+
* rather than the edge — `POST /api/v1/newsletter/subscribe` passes no
|
|
43
|
+
* account at all, so every subscriber who has never signed in is one — and
|
|
44
|
+
* who they belong to is R-6's open question, which a constraint must not
|
|
45
|
+
* answer.
|
|
46
|
+
*
|
|
47
|
+
* It is written together with {@link customerAccountId} at both of this
|
|
48
|
+
* module's two write sites, and there is no third: `subscriber.service.ts`
|
|
49
|
+
* creates the row with an owner or without one, and adopts an ownerless row
|
|
50
|
+
* into an account when a subscriber who signed up anonymously later signs
|
|
51
|
+
* in. Nothing here ever clears the account, so unlike `pwa` there is no
|
|
52
|
+
* de-association direction, and unlike `pwa` the shape the implication
|
|
53
|
+
* leaves open — an ownerless row still carrying an organisation — is not
|
|
54
|
+
* reachable.
|
|
55
|
+
*
|
|
56
|
+
* **Not derived from {@link email}.** This column is globally unique and
|
|
57
|
+
* `customer_accounts` has an e-mail too, so a match is available and is
|
|
58
|
+
* deliberately not taken: it would attribute rows the schema does not link,
|
|
59
|
+
* silently and irreversibly, for whoever signed up with the address their
|
|
60
|
+
* employer later registered. That is R-6 answer (2) guessed rather than
|
|
61
|
+
* decided.
|
|
62
|
+
*/
|
|
63
|
+
organizationId = null;
|
|
64
|
+
customFields = {};
|
|
65
|
+
consentAt = null;
|
|
66
|
+
confirmedAt = null;
|
|
67
|
+
unsubscribedAt = null;
|
|
68
|
+
unsubscribeReason = null;
|
|
69
|
+
deactivatedAt = null;
|
|
70
|
+
version = 1;
|
|
71
|
+
createdAt = new Date();
|
|
72
|
+
updatedAt = new Date();
|
|
73
|
+
};
|
|
74
|
+
__decorate([
|
|
75
|
+
PrimaryKey({ type: 'uuid' }),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], NewsletterSubscriber.prototype, "id", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
Property({ type: 'string', length: 320 }),
|
|
80
|
+
Unique(),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], NewsletterSubscriber.prototype, "email", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
Property({ type: 'string', length: 16 }),
|
|
85
|
+
Index(),
|
|
86
|
+
__metadata("design:type", String)
|
|
87
|
+
], NewsletterSubscriber.prototype, "status", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
Property({ type: 'string', length: 64, nullable: true }),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], NewsletterSubscriber.prototype, "source", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
Property({ type: 'uuid', fieldName: 'sales_channel_id', nullable: true }),
|
|
94
|
+
Index(),
|
|
95
|
+
__metadata("design:type", Object)
|
|
96
|
+
], NewsletterSubscriber.prototype, "salesChannelId", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
Property({ type: 'uuid', fieldName: 'customer_account_id', nullable: true }),
|
|
99
|
+
__metadata("design:type", Object)
|
|
100
|
+
], NewsletterSubscriber.prototype, "customerAccountId", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
Property({ type: 'uuid', fieldName: 'organization_id', nullable: true }),
|
|
103
|
+
Index(),
|
|
104
|
+
__metadata("design:type", Object)
|
|
105
|
+
], NewsletterSubscriber.prototype, "organizationId", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
Property({ type: 'json', fieldName: 'custom_fields' }),
|
|
108
|
+
__metadata("design:type", Object)
|
|
109
|
+
], NewsletterSubscriber.prototype, "customFields", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
Property({ type: 'datetime', fieldName: 'consent_at', nullable: true }),
|
|
112
|
+
__metadata("design:type", Object)
|
|
113
|
+
], NewsletterSubscriber.prototype, "consentAt", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
Property({ type: 'datetime', fieldName: 'confirmed_at', nullable: true }),
|
|
116
|
+
__metadata("design:type", Object)
|
|
117
|
+
], NewsletterSubscriber.prototype, "confirmedAt", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
Property({ type: 'datetime', fieldName: 'unsubscribed_at', nullable: true }),
|
|
120
|
+
__metadata("design:type", Object)
|
|
121
|
+
], NewsletterSubscriber.prototype, "unsubscribedAt", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
Property({ type: 'text', fieldName: 'unsubscribe_reason', nullable: true }),
|
|
124
|
+
__metadata("design:type", Object)
|
|
125
|
+
], NewsletterSubscriber.prototype, "unsubscribeReason", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
Property({ type: 'datetime', fieldName: 'deactivated_at', nullable: true }),
|
|
128
|
+
__metadata("design:type", Object)
|
|
129
|
+
], NewsletterSubscriber.prototype, "deactivatedAt", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
Property({ type: 'integer' }),
|
|
132
|
+
__metadata("design:type", Number)
|
|
133
|
+
], NewsletterSubscriber.prototype, "version", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
Property({ type: 'datetime', fieldName: 'created_at', onCreate: () => new Date() }),
|
|
136
|
+
__metadata("design:type", Date)
|
|
137
|
+
], NewsletterSubscriber.prototype, "createdAt", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
Property({ type: 'datetime', fieldName: 'updated_at', onUpdate: () => new Date() }),
|
|
140
|
+
__metadata("design:type", Date)
|
|
141
|
+
], NewsletterSubscriber.prototype, "updatedAt", void 0);
|
|
142
|
+
NewsletterSubscriber = __decorate([
|
|
143
|
+
CustomerScoped(),
|
|
144
|
+
Entity({ tableName: 'newsletter_subscribers' })
|
|
145
|
+
], NewsletterSubscriber);
|
|
146
|
+
export { NewsletterSubscriber };
|
|
147
|
+
//# sourceMappingURL=newsletter-subscriber.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"newsletter-subscriber.entity.js","sourceRoot":"","sources":["../../../src/backend/entities/newsletter-subscriber.entity.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OptionalProps } from '@mikro-orm/core';
|
|
2
|
+
/**
|
|
3
|
+
* NewsletterSuppression — feature 048. Email-keyed exclusion list that
|
|
4
|
+
* survives subscriber deletion and overrides all targeting.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NewsletterSuppression {
|
|
7
|
+
[OptionalProps]?: 'detail' | 'createdAt';
|
|
8
|
+
id: string;
|
|
9
|
+
email: string;
|
|
10
|
+
reason: 'unsubscribe' | 'bounce' | 'complaint';
|
|
11
|
+
detail: string | null;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=newsletter-suppression.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"newsletter-suppression.entity.d.ts","sourceRoot":"","sources":["../../../src/backend/entities/newsletter-suppression.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,aAAa,EAAgC,MAAM,iBAAiB,CAAC;AAItF;;;GAGG;AACH,qBAEa,qBAAqB;IAChC,CAAC,aAAa,CAAC,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;IAGzC,EAAE,EAAE,MAAM,CAAgB;IAI1B,KAAK,EAAG,MAAM,CAAC;IAGf,MAAM,EAAG,aAAa,GAAG,QAAQ,GAAG,WAAW,CAAC;IAGhD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAQ;IAG7B,SAAS,EAAE,IAAI,CAAc;CAC9B"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Entity, OptionalProps, PrimaryKey, Property, Unique } from '@mikro-orm/core';
|
|
11
|
+
import { GlobalEntity } from '@endora-commerce/platform/tenancy';
|
|
12
|
+
import { randomUUID } from 'crypto';
|
|
13
|
+
/**
|
|
14
|
+
* NewsletterSuppression — feature 048. Email-keyed exclusion list that
|
|
15
|
+
* survives subscriber deletion and overrides all targeting.
|
|
16
|
+
*/
|
|
17
|
+
let NewsletterSuppression = class NewsletterSuppression {
|
|
18
|
+
[OptionalProps];
|
|
19
|
+
id = randomUUID();
|
|
20
|
+
email;
|
|
21
|
+
reason;
|
|
22
|
+
detail = null;
|
|
23
|
+
createdAt = new Date();
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
PrimaryKey({ type: 'uuid' }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], NewsletterSuppression.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
Property({ type: 'string', length: 320 }),
|
|
31
|
+
Unique(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], NewsletterSuppression.prototype, "email", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
Property({ type: 'string', length: 16 }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], NewsletterSuppression.prototype, "reason", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
Property({ type: 'text', nullable: true }),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], NewsletterSuppression.prototype, "detail", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
Property({ type: 'datetime', fieldName: 'created_at', onCreate: () => new Date() }),
|
|
44
|
+
__metadata("design:type", Date)
|
|
45
|
+
], NewsletterSuppression.prototype, "createdAt", void 0);
|
|
46
|
+
NewsletterSuppression = __decorate([
|
|
47
|
+
GlobalEntity(),
|
|
48
|
+
Entity({ tableName: 'newsletter_suppressions' })
|
|
49
|
+
], NewsletterSuppression);
|
|
50
|
+
export { NewsletterSuppression };
|
|
51
|
+
//# sourceMappingURL=newsletter-suppression.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"newsletter-suppression.entity.js","sourceRoot":"","sources":["../../../src/backend/entities/newsletter-suppression.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;;GAGG;AAGI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,CAAC,aAAa,CAAC,CAA0B;IAGzC,EAAE,GAAW,UAAU,EAAE,CAAC;IAI1B,KAAK,CAAU;IAGf,MAAM,CAA0C;IAGhD,MAAM,GAAkB,IAAI,CAAC;IAG7B,SAAS,GAAS,IAAI,IAAI,EAAE,CAAC;CAC9B,CAAA;AAdC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDACH;AAI1B;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IACzC,MAAM,EAAE;;oDACM;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;qDACO;AAGhD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACd;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BACzE,IAAI;wDAAc;AAjBlB,qBAAqB;IAFjC,YAAY,EAAE;IACd,MAAM,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,CAAC;GACpC,qBAAqB,CAkBjC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OptionalProps } from '@mikro-orm/core';
|
|
2
|
+
/** NewsletterTag — feature 048. Operator-defined label for segmentation. */
|
|
3
|
+
export declare class NewsletterTag {
|
|
4
|
+
[OptionalProps]?: 'description' | 'createdAt' | 'updatedAt';
|
|
5
|
+
id: string;
|
|
6
|
+
code: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string | null;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
updatedAt: Date;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=newsletter-tag.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"newsletter-tag.entity.d.ts","sourceRoot":"","sources":["../../../src/backend/entities/newsletter-tag.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,aAAa,EAAgC,MAAM,iBAAiB,CAAC;AAItF,4EAA4E;AAC5E,qBAEa,aAAa;IACxB,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa,GAAG,WAAW,GAAG,WAAW,CAAC;IAG5D,EAAE,EAAE,MAAM,CAAgB;IAI1B,IAAI,EAAG,MAAM,CAAC;IAGd,IAAI,EAAG,MAAM,CAAC;IAGd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGlC,SAAS,EAAE,IAAI,CAAc;IAG7B,SAAS,EAAE,IAAI,CAAc;CAC9B"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Entity, OptionalProps, PrimaryKey, Property, Unique } from '@mikro-orm/core';
|
|
11
|
+
import { GlobalEntity } from '@endora-commerce/platform/tenancy';
|
|
12
|
+
import { randomUUID } from 'crypto';
|
|
13
|
+
/** NewsletterTag — feature 048. Operator-defined label for segmentation. */
|
|
14
|
+
let NewsletterTag = class NewsletterTag {
|
|
15
|
+
[OptionalProps];
|
|
16
|
+
id = randomUUID();
|
|
17
|
+
code;
|
|
18
|
+
name;
|
|
19
|
+
description = null;
|
|
20
|
+
createdAt = new Date();
|
|
21
|
+
updatedAt = new Date();
|
|
22
|
+
};
|
|
23
|
+
__decorate([
|
|
24
|
+
PrimaryKey({ type: 'uuid' }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], NewsletterTag.prototype, "id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
Property({ type: 'string', length: 64 }),
|
|
29
|
+
Unique(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], NewsletterTag.prototype, "code", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
Property({ type: 'string', length: 160 }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], NewsletterTag.prototype, "name", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
Property({ type: 'text', nullable: true }),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], NewsletterTag.prototype, "description", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
Property({ type: 'datetime', fieldName: 'created_at', onCreate: () => new Date() }),
|
|
42
|
+
__metadata("design:type", Date)
|
|
43
|
+
], NewsletterTag.prototype, "createdAt", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
Property({ type: 'datetime', fieldName: 'updated_at', onUpdate: () => new Date() }),
|
|
46
|
+
__metadata("design:type", Date)
|
|
47
|
+
], NewsletterTag.prototype, "updatedAt", void 0);
|
|
48
|
+
NewsletterTag = __decorate([
|
|
49
|
+
GlobalEntity(),
|
|
50
|
+
Entity({ tableName: 'newsletter_tags' })
|
|
51
|
+
], NewsletterTag);
|
|
52
|
+
export { NewsletterTag };
|
|
53
|
+
//# sourceMappingURL=newsletter-tag.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"newsletter-tag.entity.js","sourceRoot":"","sources":["../../../src/backend/entities/newsletter-tag.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,4EAA4E;AAGrE,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,CAAC,aAAa,CAAC,CAA6C;IAG5D,EAAE,GAAW,UAAU,EAAE,CAAC;IAI1B,IAAI,CAAU;IAGd,IAAI,CAAU;IAGd,WAAW,GAAkB,IAAI,CAAC;IAGlC,SAAS,GAAS,IAAI,IAAI,EAAE,CAAC;IAG7B,SAAS,GAAS,IAAI,IAAI,EAAE,CAAC;CAC9B,CAAA;AAjBC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACH;AAI1B;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACxC,MAAM,EAAE;;2CACK;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;2CAC5B;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACT;AAGlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BACzE,IAAI;gDAAc;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BACzE,IAAI;gDAAc;AApBlB,aAAa;IAFzB,YAAY,EAAE;IACd,MAAM,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;GAC5B,aAAa,CAqBzB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { EntityManager } from '@mikro-orm/postgresql';
|
|
2
|
+
import type { Redis } from 'ioredis';
|
|
3
|
+
import type { AuditPort } from '@endora-commerce/platform/kernel';
|
|
4
|
+
import type { EventBus } from '@endora-commerce/platform/events';
|
|
5
|
+
import type { ModuleContext } from '@endora-commerce/platform/kernel';
|
|
6
|
+
import type { RequireAdminFactory } from '@endora-commerce/platform/kernel';
|
|
7
|
+
import { newsletterModule, type NewsletterModuleOptions } from './plugin.js';
|
|
8
|
+
import { NewsletterAutomationRun } from './entities/newsletter-automation-run.entity.js';
|
|
9
|
+
import { NewsletterAutomation } from './entities/newsletter-automation.entity.js';
|
|
10
|
+
import { NewsletterCampaignSubscriber } from './entities/newsletter-campaign-subscriber.entity.js';
|
|
11
|
+
import { NewsletterCampaign } from './entities/newsletter-campaign.entity.js';
|
|
12
|
+
import { NewsletterCustomField } from './entities/newsletter-custom-field.entity.js';
|
|
13
|
+
import { NewsletterEmailBlockSalesChannel } from './entities/newsletter-email-block-sales-channel.entity.js';
|
|
14
|
+
import { NewsletterEmailBlock } from './entities/newsletter-email-block.entity.js';
|
|
15
|
+
import { NewsletterEngagementEvent } from './entities/newsletter-engagement-event.entity.js';
|
|
16
|
+
import { NewsletterSendRecord } from './entities/newsletter-send-record.entity.js';
|
|
17
|
+
import { NewsletterSubscriberTag } from './entities/newsletter-subscriber-tag.entity.js';
|
|
18
|
+
import { NewsletterSubscriber } from './entities/newsletter-subscriber.entity.js';
|
|
19
|
+
import { NewsletterSuppression } from './entities/newsletter-suppression.entity.js';
|
|
20
|
+
import { NewsletterTag } from './entities/newsletter-tag.entity.js';
|
|
21
|
+
/**
|
|
22
|
+
* `newsletter` — the module whose secret the harness pins (feature 072, wave 2,
|
|
23
|
+
* T114), and which assembled nine of its own inputs in a composition root until
|
|
24
|
+
* `specs/117-instance-bring-up/` Phase 6.
|
|
25
|
+
*
|
|
26
|
+
* **`newsletterBridge` is gone.** It was contributed by
|
|
27
|
+
* `backend/src/composition.ts` and by `backend/test/helpers/test-server.ts` and
|
|
28
|
+
* by nothing else, so a composition that is neither — which is every client
|
|
29
|
+
* instance, whose whole composition is one `composeApp({ deploymentRoot })`
|
|
30
|
+
* call — could not resolve it, and the module's own registration read
|
|
31
|
+
* `b.tokenSecret` eagerly, so that composition failed the moment anything
|
|
32
|
+
* touched `newsletter`.
|
|
33
|
+
*
|
|
34
|
+
* The argument for the bridge was that the harness differs from production and
|
|
35
|
+
* *"what the harness does differently is information about the seam"*. That is
|
|
36
|
+
* still true and it is an argument for a **contribution point**, not for a
|
|
37
|
+
* required value: a module default the harness overwrites says the same thing
|
|
38
|
+
* and leaves a composition that overwrites nothing with a working module.
|
|
39
|
+
* `newsletterEmailBranding`, eleven lines below, has been the right shape all
|
|
40
|
+
* along.
|
|
41
|
+
*
|
|
42
|
+
* Every member was a port, a platform contribution or an environment input —
|
|
43
|
+
* none was a judgement anybody makes:
|
|
44
|
+
*
|
|
45
|
+
* - `tokenSecret` -> `newsletterTokenSecret`, the platform's own value, so
|
|
46
|
+
* `NEWSLETTER_TOKEN_SECRET` stays a platform-declared input that
|
|
47
|
+
* `check:env-inputs` can see (T6-B1 route (b)).
|
|
48
|
+
* - `defaultChannelId` -> `salesChannelResolutionPort.getSystemDefault()`, as
|
|
49
|
+
* an accessor: it was the one member only a root could produce, because it
|
|
50
|
+
* was an *awaited value*.
|
|
51
|
+
* - `resolveChannelIdByCode` -> `salesChannelCodeIdPort`.
|
|
52
|
+
* - `publicBaseUrl` -> `resolvePublicApiBaseUrl()`, the platform's helper.
|
|
53
|
+
* - `storefrontBaseUrl` -> the platform's own registration of that name.
|
|
54
|
+
* - `loadCustomerEmail` -> `customerAccountReadPort`, already resolved eleven
|
|
55
|
+
* lines down for `customerAccounts`.
|
|
56
|
+
* - `mailer` -> `emailMailer`.
|
|
57
|
+
* - `emitEvent` -> `eventBus`.
|
|
58
|
+
* - `resolveCustomerAccountId` -> the platform's `customerAccountIdResolver`,
|
|
59
|
+
* which is the identical closure under its own name.
|
|
60
|
+
*
|
|
61
|
+
* `auditLog` stops being optional: subscribing and unsubscribing are consent
|
|
62
|
+
* records, and consent that was recorded nowhere is indistinguishable from
|
|
63
|
+
* consent that was never given.
|
|
64
|
+
*
|
|
65
|
+
* `resolveEmailBranding` is a **contribution point this module owns**, absent by
|
|
66
|
+
* default. The logo and accent come from `transactional_emails`, which hands
|
|
67
|
+
* them out through an `exposeBranding` callback a root holds — so a port would
|
|
68
|
+
* make `newsletter` declare a dependency on a module that only *later* announces
|
|
69
|
+
* the value. Absent, campaign email renders with the module's own neutral
|
|
70
|
+
* fallback, which is what the harness has always exercised.
|
|
71
|
+
*/
|
|
72
|
+
export interface NewsletterCradle {
|
|
73
|
+
readonly emFactory: () => EntityManager;
|
|
74
|
+
readonly auditLogService: AuditPort;
|
|
75
|
+
readonly requireAdmin: RequireAdminFactory;
|
|
76
|
+
readonly requireCustomer: NonNullable<NewsletterModuleOptions['requireCustomer']>;
|
|
77
|
+
readonly settingsReadPort: NonNullable<NewsletterModuleOptions['settings']>;
|
|
78
|
+
readonly settingsAdminService: NonNullable<NewsletterModuleOptions['settingsWrite']>;
|
|
79
|
+
readonly adminAuditActorResolver: NonNullable<NewsletterModuleOptions['resolveAuditContext']>;
|
|
80
|
+
readonly credentialsService: NonNullable<NewsletterModuleOptions['credentials']>;
|
|
81
|
+
/** Undefined in a composition with no queue infrastructure; dispatch then runs inline. */
|
|
82
|
+
readonly moduleQueueRedis: Redis | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* The key confirmation and unsubscribe links are signed with. The platform's
|
|
85
|
+
* own registration — `NEWSLETTER_TOKEN_SECRET`, falling back to the session
|
|
86
|
+
* key — so that the environment read stays in the tree `check:env-inputs`
|
|
87
|
+
* judges (T6-B1). A harness pins it, because a token signed on one request
|
|
88
|
+
* and verified on another has to be predictable for a test to assert a link.
|
|
89
|
+
*/
|
|
90
|
+
readonly newsletterTokenSecret: string;
|
|
91
|
+
readonly emailMailer: NonNullable<NewsletterModuleOptions['mailer']>;
|
|
92
|
+
readonly customerAccountIdResolver: NonNullable<NewsletterModuleOptions['resolveCustomerAccountId']>;
|
|
93
|
+
readonly storefrontBaseUrl: string;
|
|
94
|
+
readonly eventBus: EventBus;
|
|
95
|
+
readonly salesChannelResolutionPort: {
|
|
96
|
+
getSystemDefault(): Promise<{
|
|
97
|
+
id: string;
|
|
98
|
+
}>;
|
|
99
|
+
};
|
|
100
|
+
readonly salesChannelCodeIdPort: {
|
|
101
|
+
idByCode(code: string): Promise<string | null>;
|
|
102
|
+
};
|
|
103
|
+
/** Contribution point: absent means campaign email renders with the neutral fallback. */
|
|
104
|
+
readonly newsletterEmailBranding: NewsletterModuleOptions['resolveEmailBranding'];
|
|
105
|
+
readonly newsletter: ReturnType<typeof newsletterModule>;
|
|
106
|
+
}
|
|
107
|
+
export declare function registerModule(ctx: ModuleContext): void;
|
|
108
|
+
/**
|
|
109
|
+
* The module's persisted entity classes, on the `./backend` subpath, as one
|
|
110
|
+
* array and **no named class export** (D-168).
|
|
111
|
+
*
|
|
112
|
+
* This is the shape the platform reads when the package is *installed*: the
|
|
113
|
+
* boot-time loader (`src/packages/package-runtime.ts`, `exported['entities']`)
|
|
114
|
+
* and the static declaration reader (`scripts/lib/package-declarations.ts`),
|
|
115
|
+
* which is the third source of `check:module-boundary`'s `table→owner` map and
|
|
116
|
+
* the package pass of `check-entity-tenant-classification`. A missing array is
|
|
117
|
+
* answered with `[]` — zero entities registered, no error anywhere.
|
|
118
|
+
*/
|
|
119
|
+
export declare const entities: (typeof NewsletterSubscriber | typeof NewsletterTag | typeof NewsletterSubscriberTag | typeof NewsletterCustomField | typeof NewsletterSuppression | typeof NewsletterCampaign | typeof NewsletterSendRecord | typeof NewsletterCampaignSubscriber | typeof NewsletterAutomation | typeof NewsletterAutomationRun | typeof NewsletterEngagementEvent | typeof NewsletterEmailBlock | typeof NewsletterEmailBlockSalesChannel)[];
|
|
120
|
+
//# sourceMappingURL=index.d.ts.map
|