@memberjunction/communication-engine 6.3.0-edge.1 → 6.3.0-edge.3

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 (83) hide show
  1. package/README.md +203 -0
  2. package/dist/CommsActivityWorker.d.ts +130 -0
  3. package/dist/CommsActivityWorker.d.ts.map +1 -0
  4. package/dist/CommsActivityWorker.js +1054 -0
  5. package/dist/CommsActivityWorker.js.map +1 -0
  6. package/dist/DefaultCommunicationPrincipal.d.ts +62 -0
  7. package/dist/DefaultCommunicationPrincipal.d.ts.map +1 -0
  8. package/dist/DefaultCommunicationPrincipal.js +382 -0
  9. package/dist/DefaultCommunicationPrincipal.js.map +1 -0
  10. package/dist/Engine.d.ts +54 -1
  11. package/dist/Engine.d.ts.map +1 -1
  12. package/dist/Engine.js +123 -2
  13. package/dist/Engine.js.map +1 -1
  14. package/dist/LocalJsonCommunicationProvider.d.ts +133 -0
  15. package/dist/LocalJsonCommunicationProvider.d.ts.map +1 -0
  16. package/dist/LocalJsonCommunicationProvider.js +1337 -0
  17. package/dist/LocalJsonCommunicationProvider.js.map +1 -0
  18. package/dist/V2SendService.d.ts +293 -0
  19. package/dist/V2SendService.d.ts.map +1 -0
  20. package/dist/V2SendService.js +2035 -0
  21. package/dist/V2SendService.js.map +1 -0
  22. package/dist/compliance/ComplianceGate.d.ts +56 -0
  23. package/dist/compliance/ComplianceGate.d.ts.map +1 -0
  24. package/dist/compliance/ComplianceGate.js +452 -0
  25. package/dist/compliance/ComplianceGate.js.map +1 -0
  26. package/dist/compliance/JurisdictionResolver.d.ts +82 -0
  27. package/dist/compliance/JurisdictionResolver.d.ts.map +1 -0
  28. package/dist/compliance/JurisdictionResolver.js +249 -0
  29. package/dist/compliance/JurisdictionResolver.js.map +1 -0
  30. package/dist/compliance/index.d.ts +4 -0
  31. package/dist/compliance/index.d.ts.map +1 -0
  32. package/dist/compliance/index.js +4 -0
  33. package/dist/compliance/index.js.map +1 -0
  34. package/dist/compliance/rules/ConsentEvidenceRuleDriver.d.ts +22 -0
  35. package/dist/compliance/rules/ConsentEvidenceRuleDriver.d.ts.map +1 -0
  36. package/dist/compliance/rules/ConsentEvidenceRuleDriver.js +76 -0
  37. package/dist/compliance/rules/ConsentEvidenceRuleDriver.js.map +1 -0
  38. package/dist/compliance/rules/ConsentExpiryRuleDriver.d.ts +20 -0
  39. package/dist/compliance/rules/ConsentExpiryRuleDriver.d.ts.map +1 -0
  40. package/dist/compliance/rules/ConsentExpiryRuleDriver.js +70 -0
  41. package/dist/compliance/rules/ConsentExpiryRuleDriver.js.map +1 -0
  42. package/dist/compliance/rules/ConsentModelRuleDriver.d.ts +22 -0
  43. package/dist/compliance/rules/ConsentModelRuleDriver.d.ts.map +1 -0
  44. package/dist/compliance/rules/ConsentModelRuleDriver.js +65 -0
  45. package/dist/compliance/rules/ConsentModelRuleDriver.js.map +1 -0
  46. package/dist/compliance/rules/QuietHoursRuleDriver.d.ts +37 -0
  47. package/dist/compliance/rules/QuietHoursRuleDriver.d.ts.map +1 -0
  48. package/dist/compliance/rules/QuietHoursRuleDriver.js +144 -0
  49. package/dist/compliance/rules/QuietHoursRuleDriver.js.map +1 -0
  50. package/dist/compliance/rules/RequireDoubleOptInRuleDriver.d.ts +16 -0
  51. package/dist/compliance/rules/RequireDoubleOptInRuleDriver.d.ts.map +1 -0
  52. package/dist/compliance/rules/RequireDoubleOptInRuleDriver.js +40 -0
  53. package/dist/compliance/rules/RequireDoubleOptInRuleDriver.js.map +1 -0
  54. package/dist/compliance/rules/RuleParamUtils.d.ts +13 -0
  55. package/dist/compliance/rules/RuleParamUtils.d.ts.map +1 -0
  56. package/dist/compliance/rules/RuleParamUtils.js +51 -0
  57. package/dist/compliance/rules/RuleParamUtils.js.map +1 -0
  58. package/dist/compliance/rules/SenderIdentificationRuleDriver.d.ts +17 -0
  59. package/dist/compliance/rules/SenderIdentificationRuleDriver.d.ts.map +1 -0
  60. package/dist/compliance/rules/SenderIdentificationRuleDriver.js +64 -0
  61. package/dist/compliance/rules/SenderIdentificationRuleDriver.js.map +1 -0
  62. package/dist/compliance/rules/TrackingConsentRuleDriver.d.ts +23 -0
  63. package/dist/compliance/rules/TrackingConsentRuleDriver.d.ts.map +1 -0
  64. package/dist/compliance/rules/TrackingConsentRuleDriver.js +81 -0
  65. package/dist/compliance/rules/TrackingConsentRuleDriver.js.map +1 -0
  66. package/dist/compliance/rules/UnsubscribeHonorWindowRuleDriver.d.ts +21 -0
  67. package/dist/compliance/rules/UnsubscribeHonorWindowRuleDriver.d.ts.map +1 -0
  68. package/dist/compliance/rules/UnsubscribeHonorWindowRuleDriver.js +33 -0
  69. package/dist/compliance/rules/UnsubscribeHonorWindowRuleDriver.js.map +1 -0
  70. package/dist/compliance/rules/UnsubscribeMechanismRuleDriver.d.ts +19 -0
  71. package/dist/compliance/rules/UnsubscribeMechanismRuleDriver.d.ts.map +1 -0
  72. package/dist/compliance/rules/UnsubscribeMechanismRuleDriver.js +73 -0
  73. package/dist/compliance/rules/UnsubscribeMechanismRuleDriver.js.map +1 -0
  74. package/dist/compliance/rules/index.d.ts +10 -0
  75. package/dist/compliance/rules/index.d.ts.map +1 -0
  76. package/dist/compliance/rules/index.js +10 -0
  77. package/dist/compliance/rules/index.js.map +1 -0
  78. package/dist/index.d.ts +5 -0
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +5 -0
  81. package/dist/index.js.map +1 -1
  82. package/dist/tsconfig.tsbuildinfo +1 -1
  83. package/package.json +9 -9
@@ -0,0 +1,249 @@
1
+ import { UUIDMap, UUIDSet, UUIDsEqual } from '@memberjunction/global';
2
+ import { CommunicationEngineBase } from '@memberjunction/communication-types';
3
+ const JURISDICTION_TIMEZONE_MAP = {
4
+ US: ['America/New_York', 'America/Chicago', 'America/Denver', 'America/Los_Angeles'],
5
+ 'US-CA': ['America/Los_Angeles'],
6
+ 'US-TX': ['America/Chicago'],
7
+ 'US-NY': ['America/New_York'],
8
+ 'US-FL': ['America/New_York'],
9
+ 'US-IL': ['America/Chicago'],
10
+ 'US-WA': ['America/Los_Angeles'],
11
+ CA: ['America/Toronto', 'America/Winnipeg', 'America/Edmonton', 'America/Vancouver'],
12
+ 'CA-ON': ['America/Toronto'],
13
+ 'CA-QC': ['America/Toronto'],
14
+ 'CA-BC': ['America/Vancouver'],
15
+ GB: ['Europe/London'],
16
+ UK: ['Europe/London'],
17
+ AU: [
18
+ 'Australia/Sydney',
19
+ 'Australia/Melbourne',
20
+ 'Australia/Brisbane',
21
+ 'Australia/Adelaide',
22
+ 'Australia/Perth',
23
+ ],
24
+ 'AU-NSW': ['Australia/Sydney'],
25
+ 'AU-VIC': ['Australia/Melbourne'],
26
+ 'AU-QLD': ['Australia/Brisbane'],
27
+ 'AU-WA': ['Australia/Perth'],
28
+ DE: ['Europe/Berlin'],
29
+ FR: ['Europe/Paris'],
30
+ ES: ['Europe/Madrid'],
31
+ IT: ['Europe/Rome'],
32
+ NL: ['Europe/Amsterdam'],
33
+ IE: ['Europe/Dublin'],
34
+ NZ: ['Pacific/Auckland'],
35
+ JP: ['Asia/Tokyo'],
36
+ SG: ['Asia/Singapore'],
37
+ IN: ['Asia/Kolkata'],
38
+ };
39
+ /**
40
+ * Builds an in-memory JurisdictionMember containment graph for O(1) jurisdiction
41
+ * expansion and collects active compliance regimes and rules.
42
+ */
43
+ export class JurisdictionResolver {
44
+ constructor(source) {
45
+ this.jurisdictionsById = new UUIDMap();
46
+ this.jurisdictionsByCode = new Map();
47
+ this.parentGroupsByMember = new UUIDMap();
48
+ this.expandedById = new UUIDMap();
49
+ this.regimeJurisdictions = new UUIDMap();
50
+ this.ruleTypesById = new UUIDMap();
51
+ this.source = source ?? CommunicationEngineBase.Instance;
52
+ this.buildGraph();
53
+ }
54
+ buildGraph() {
55
+ for (const j of this.source.Jurisdictions) {
56
+ if (j.Status !== 'Active')
57
+ continue;
58
+ this.jurisdictionsById.Set(j.ID, j);
59
+ if (j.Code) {
60
+ this.jurisdictionsByCode.set(j.Code.trim().toUpperCase(), j);
61
+ }
62
+ }
63
+ for (const m of this.source.JurisdictionMembers) {
64
+ if (!this.jurisdictionsById.Has(m.GroupJurisdictionID))
65
+ continue;
66
+ const existing = this.parentGroupsByMember.Get(m.MemberJurisdictionID) ?? [];
67
+ existing.push(m.GroupJurisdictionID);
68
+ this.parentGroupsByMember.Set(m.MemberJurisdictionID, existing);
69
+ }
70
+ // Precompute O(1) expansion for every active jurisdiction
71
+ for (const j of this.jurisdictionsById.Values()) {
72
+ this.expandedById.Set(j.ID, this.computeAncestors(j.ID));
73
+ }
74
+ for (const rj of this.source.ComplianceRegimeJurisdictions) {
75
+ let set = this.regimeJurisdictions.Get(rj.CommunicationComplianceRegimeID);
76
+ if (!set) {
77
+ set = new UUIDSet();
78
+ this.regimeJurisdictions.Set(rj.CommunicationComplianceRegimeID, set);
79
+ }
80
+ set.Add(rj.JurisdictionID);
81
+ }
82
+ for (const rt of this.source.ComplianceRuleTypes) {
83
+ if (rt.Status === 'Active') {
84
+ this.ruleTypesById.Set(rt.ID, rt);
85
+ }
86
+ }
87
+ }
88
+ computeAncestors(startId) {
89
+ const visited = new UUIDSet();
90
+ const queue = [startId];
91
+ const result = [];
92
+ while (queue.length > 0) {
93
+ const current = queue.shift();
94
+ if (visited.Has(current))
95
+ continue;
96
+ visited.Add(current);
97
+ result.push(current);
98
+ const parents = this.parentGroupsByMember.Get(current) ?? [];
99
+ for (const parentId of parents) {
100
+ if (!visited.Has(parentId)) {
101
+ queue.push(parentId);
102
+ }
103
+ }
104
+ }
105
+ return result;
106
+ }
107
+ /**
108
+ * Resolves an `MJ: Jurisdictions` ID or `Code` (case-insensitive) to the ID of an active
109
+ * jurisdiction, or `null`.
110
+ */
111
+ ResolveJurisdictionID(idOrCode) {
112
+ if (!idOrCode || !idOrCode.trim())
113
+ return null;
114
+ const trimmed = idOrCode.trim();
115
+ const byId = this.jurisdictionsById.Get(trimmed);
116
+ if (byId)
117
+ return byId.ID;
118
+ const byCode = this.jurisdictionsByCode.get(trimmed.toUpperCase());
119
+ return byCode ? byCode.ID : null;
120
+ }
121
+ /**
122
+ * Returns the jurisdiction's ID followed by the IDs of every group that contains it, directly or
123
+ * through other groups. Empty when the jurisdiction is unknown.
124
+ */
125
+ ExpandJurisdiction(idOrCode) {
126
+ const id = this.ResolveJurisdictionID(idOrCode);
127
+ if (!id)
128
+ return [];
129
+ return this.expandedById.Get(id) ?? [id];
130
+ }
131
+ /** Maps jurisdiction IDs to their codes, skipping unknown IDs. */
132
+ GetJurisdictionCodes(jurisdictionIds) {
133
+ const codes = [];
134
+ for (const id of jurisdictionIds) {
135
+ const entity = this.jurisdictionsById.Get(id);
136
+ if (entity) {
137
+ codes.push(entity.Code);
138
+ }
139
+ }
140
+ return codes;
141
+ }
142
+ /**
143
+ * Returns the IANA time zones of the most specific jurisdiction in the expansion that has a
144
+ * built-in mapping. Empty when none does.
145
+ */
146
+ GetJurisdictionTimezones(idOrCode) {
147
+ const expanded = this.ExpandJurisdiction(idOrCode);
148
+ const seen = new Set();
149
+ const zones = [];
150
+ for (const id of expanded) {
151
+ const entity = this.jurisdictionsById.Get(id);
152
+ if (!entity?.Code)
153
+ continue;
154
+ const mapped = JURISDICTION_TIMEZONE_MAP[entity.Code.trim().toUpperCase()];
155
+ if (mapped) {
156
+ for (const tz of mapped) {
157
+ if (!seen.has(tz)) {
158
+ seen.add(tz);
159
+ zones.push(tz);
160
+ }
161
+ }
162
+ // Prefer the most specific jurisdiction match first (self before parent country/group)
163
+ if (zones.length > 0) {
164
+ return zones;
165
+ }
166
+ }
167
+ }
168
+ return zones;
169
+ }
170
+ /**
171
+ * Selects the active regimes that apply. A regime applies when its `AppliesBy` side (recipient,
172
+ * sender, or either) has a jurisdiction attached to the regime, or when that side's jurisdiction
173
+ * is unknown and the regime has `AppliesWhenJurisdictionUnknown`.
174
+ */
175
+ CollectActiveRegimes(params) {
176
+ const expandedRecipient = this.ExpandJurisdiction(params.RecipientJurisdiction);
177
+ const expandedSender = this.ExpandJurisdiction(params.SenderJurisdiction);
178
+ const recipientSet = new UUIDSet(expandedRecipient);
179
+ const senderSet = new UUIDSet(expandedSender);
180
+ const recipientKnown = expandedRecipient.length > 0;
181
+ const senderKnown = expandedSender.length > 0;
182
+ const matchingRegimes = [];
183
+ for (const regime of this.source.ComplianceRegimes) {
184
+ if (regime.Status !== 'Active')
185
+ continue;
186
+ const attached = this.regimeJurisdictions.Get(regime.ID);
187
+ const matchesRecipient = (recipientKnown && this.intersects(attached, recipientSet)) ||
188
+ (!recipientKnown && regime.AppliesWhenJurisdictionUnknown);
189
+ const matchesSender = (senderKnown && this.intersects(attached, senderSet)) ||
190
+ (!senderKnown && regime.AppliesWhenJurisdictionUnknown);
191
+ const applies = regime.AppliesBy === 'Recipient'
192
+ ? matchesRecipient
193
+ : regime.AppliesBy === 'Sender'
194
+ ? matchesSender
195
+ : matchesRecipient || matchesSender;
196
+ if (applies) {
197
+ matchingRegimes.push(regime);
198
+ }
199
+ }
200
+ return {
201
+ Regimes: matchingRegimes,
202
+ ExpandedRecipientJurisdictions: expandedRecipient,
203
+ ExpandedSenderJurisdictions: expandedSender,
204
+ };
205
+ }
206
+ /**
207
+ * Returns the active rules of the given regimes that match the channel and message class (a rule
208
+ * with no channel or no class matches all), grouped by active rule type.
209
+ */
210
+ CollectRulesByType(regimes, channelID, messageClass) {
211
+ const activeRegimeIds = new UUIDSet(regimes.map((r) => r.ID));
212
+ const rulesByType = new UUIDMap();
213
+ for (const rule of this.source.ComplianceRegimeRules) {
214
+ if (rule.Status !== 'Active')
215
+ continue;
216
+ if (!activeRegimeIds.Has(rule.CommunicationComplianceRegimeID))
217
+ continue;
218
+ if (rule.BaseMessageTypeID !== null && !UUIDsEqual(rule.BaseMessageTypeID, channelID)) {
219
+ continue;
220
+ }
221
+ if (rule.MessageClass !== null && rule.MessageClass !== messageClass) {
222
+ continue;
223
+ }
224
+ const list = rulesByType.Get(rule.CommunicationComplianceRuleTypeID) ?? [];
225
+ list.push(rule);
226
+ rulesByType.Set(rule.CommunicationComplianceRuleTypeID, list);
227
+ }
228
+ const grouped = [];
229
+ for (const [ruleTypeId, rules] of rulesByType) {
230
+ const ruleType = this.ruleTypesById.Get(ruleTypeId);
231
+ if (ruleType) {
232
+ grouped.push({ RuleType: ruleType, Rules: rules });
233
+ }
234
+ }
235
+ return grouped;
236
+ }
237
+ intersects(attached, candidateSet) {
238
+ if (!attached || attached.Size === 0 || candidateSet.Size === 0) {
239
+ return false;
240
+ }
241
+ for (const id of candidateSet) {
242
+ if (attached.Has(id)) {
243
+ return true;
244
+ }
245
+ }
246
+ return false;
247
+ }
248
+ }
249
+ //# sourceMappingURL=JurisdictionResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JurisdictionResolver.js","sourceRoot":"","sources":["../../src/compliance/JurisdictionResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AA6C9E,MAAM,yBAAyB,GAA6B;IAC1D,EAAE,EAAE,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,qBAAqB,CAAC;IACpF,OAAO,EAAE,CAAC,qBAAqB,CAAC;IAChC,OAAO,EAAE,CAAC,iBAAiB,CAAC;IAC5B,OAAO,EAAE,CAAC,kBAAkB,CAAC;IAC7B,OAAO,EAAE,CAAC,kBAAkB,CAAC;IAC7B,OAAO,EAAE,CAAC,iBAAiB,CAAC;IAC5B,OAAO,EAAE,CAAC,qBAAqB,CAAC;IAChC,EAAE,EAAE,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,CAAC;IACpF,OAAO,EAAE,CAAC,iBAAiB,CAAC;IAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;IAC5B,OAAO,EAAE,CAAC,mBAAmB,CAAC;IAC9B,EAAE,EAAE,CAAC,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YAAY,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAChE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,KAAK,MAAM,EAAE,IAAI,YAAY,EAAE,CAAC;YAC9B,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;gBACrB,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ export * from './rules/index.js';
2
+ export * from './JurisdictionResolver.js';
3
+ export * from './ComplianceGate.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compliance/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './rules/index.js';
2
+ export * from './JurisdictionResolver.js';
3
+ export * from './ComplianceGate.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/compliance/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { BaseComplianceRule, ComplianceEvalContext, ComplianceRuleOutcome } from '@memberjunction/communication-types';
2
+ /**
3
+ * Merged `ConsentEvidence` requirement: which proof of consent must be on the principal preference
4
+ * row.
5
+ */
6
+ export interface ConsentEvidenceMerged {
7
+ /** `ConsentSource` must be recorded. */
8
+ RequireSource: boolean;
9
+ /** `ConsentAt` must be recorded. */
10
+ RequireTimestamp: boolean;
11
+ /** `ConsentText` (the wording the recipient agreed to) must be recorded. */
12
+ RequireConsentText: boolean;
13
+ }
14
+ /**
15
+ * Resolves consent evidence requirements across applicable regimes:
16
+ * - `true` wins per field (`source`, `timestamp`, `consentText`).
17
+ */
18
+ export declare class ConsentEvidenceRuleDriver extends BaseComplianceRule<ConsentEvidenceMerged> {
19
+ MergeStrictest(parameterSets: ReadonlyArray<Record<string, unknown>>): ConsentEvidenceMerged;
20
+ Evaluate(merged: ConsentEvidenceMerged, ctx: ComplianceEvalContext): ComplianceRuleOutcome;
21
+ }
22
+ //# sourceMappingURL=ConsentEvidenceRuleDriver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsentEvidenceRuleDriver.d.ts","sourceRoot":"","sources":["../../../src/compliance/rules/ConsentEvidenceRuleDriver.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,qCAAqC,CAAC;AAG7C;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,aAAa,EAAE,OAAO,CAAC;IACvB,oCAAoC;IACpC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,4EAA4E;IAC5E,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED;;;GAGG;AACH,qBACa,yBAA0B,SAAQ,kBAAkB,CAAC,qBAAqB,CAAC;IAC/E,cAAc,CACnB,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACpD,qBAAqB;IAmCjB,QAAQ,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,qBAAqB,GAAG,qBAAqB;CAyClG"}
@@ -0,0 +1,76 @@
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
+ import { RegisterClass } from '@memberjunction/global';
8
+ import { BaseComplianceRule, } from '@memberjunction/communication-types';
9
+ import { ReadBooleanParam } from './RuleParamUtils.js';
10
+ /**
11
+ * Resolves consent evidence requirements across applicable regimes:
12
+ * - `true` wins per field (`source`, `timestamp`, `consentText`).
13
+ */
14
+ let ConsentEvidenceRuleDriver = class ConsentEvidenceRuleDriver extends BaseComplianceRule {
15
+ MergeStrictest(parameterSets) {
16
+ let requireSource = false;
17
+ let requireTimestamp = false;
18
+ let requireConsentText = false;
19
+ for (const params of parameterSets) {
20
+ if (ReadBooleanParam(params, 'requireSource', 'RequireSource', 'source', 'Source') === true) {
21
+ requireSource = true;
22
+ }
23
+ if (ReadBooleanParam(params, 'requireTimestamp', 'RequireTimestamp', 'timestamp', 'Timestamp') ===
24
+ true) {
25
+ requireTimestamp = true;
26
+ }
27
+ if (ReadBooleanParam(params, 'requireConsentText', 'RequireConsentText', 'consentText', 'ConsentText') === true) {
28
+ requireConsentText = true;
29
+ }
30
+ }
31
+ return {
32
+ RequireSource: requireSource,
33
+ RequireTimestamp: requireTimestamp,
34
+ RequireConsentText: requireConsentText,
35
+ };
36
+ }
37
+ Evaluate(merged, ctx) {
38
+ if (ctx.MessageClass === 'Transactional') {
39
+ return { Passed: true };
40
+ }
41
+ if (!merged.RequireSource && !merged.RequireTimestamp && !merged.RequireConsentText) {
42
+ return { Passed: true };
43
+ }
44
+ if (!ctx.PrincipalPreference) {
45
+ return {
46
+ Passed: false,
47
+ Decision: 'Blocked',
48
+ FailureReason: 'Consent evidence is required but no principal preference record exists',
49
+ };
50
+ }
51
+ const missing = [];
52
+ if (merged.RequireSource && !ctx.PrincipalPreference.ConsentSource) {
53
+ missing.push('ConsentSource');
54
+ }
55
+ if (merged.RequireTimestamp && !ctx.PrincipalPreference.ConsentAt) {
56
+ missing.push('ConsentAt');
57
+ }
58
+ if (merged.RequireConsentText &&
59
+ (!ctx.PrincipalPreference.ConsentText || ctx.PrincipalPreference.ConsentText.trim().length === 0)) {
60
+ missing.push('ConsentText');
61
+ }
62
+ if (missing.length > 0) {
63
+ return {
64
+ Passed: false,
65
+ Decision: 'Blocked',
66
+ FailureReason: `Required consent evidence missing: ${missing.join(', ')}`,
67
+ };
68
+ }
69
+ return { Passed: true };
70
+ }
71
+ };
72
+ ConsentEvidenceRuleDriver = __decorate([
73
+ RegisterClass(BaseComplianceRule, 'ConsentEvidenceRuleDriver')
74
+ ], ConsentEvidenceRuleDriver);
75
+ export { ConsentEvidenceRuleDriver };
76
+ //# sourceMappingURL=ConsentEvidenceRuleDriver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsentEvidenceRuleDriver.js","sourceRoot":"","sources":["../../../src/compliance/rules/ConsentEvidenceRuleDriver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,kBAAkB,GAGnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAepD;;;GAGG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,kBAAyC;IAC/E,cAAc,CACnB,aAAqD;QAErD,IAAI,aAAa,GAAG,KAAK,CAAC;QAC1B,IAAI,gBAAgB,GAAG,KAAK,CAAC;QAC7B,IAAI,kBAAkB,GAAG,KAAK,CAAC;QAE/B,KAAK,MAAM,MAAM,IAAI,aAAa,EAAE,CAAC;YACnC,IAAI,gBAAgB,CAAC,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC5F,aAAa,GAAG,IAAI,CAAC;YACvB,CAAC;YACD,IACE,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,WAAW,EAAE,WAAW,CAAC;gBAC1F,IAAI,EACJ,CAAC;gBACD,gBA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,CAAC,mBAAmB,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,EACjG,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC9B,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO;gBACL,MAAM,EAAE,KAAK;gBACb,QAAQ,EAAE,SAAS;gBACnB,aAAa,EAAE,sCAAsC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;aAC1E,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;CACF,CAAA;AA/EY,yBAAyB;IADrC,aAAa,CAAC,kBAAkB,EAAE,2BAA2B,CAAC;GAClD,yBAAyB,CA+ErC"}
@@ -0,0 +1,20 @@
1
+ import { BaseComplianceRule, ComplianceEvalContext, ComplianceRuleOutcome } from '@memberjunction/communication-types';
2
+ /** Merged `ConsentExpiry` requirement. */
3
+ export interface ConsentExpiryMerged {
4
+ /** Days after `ConsentAt` that consent stays valid; `null` for no limit. */
5
+ MaxDays: number | null;
6
+ /** When `true`, `MaxDays` expires only implied consent, not an express opt-in. */
7
+ ImpliedOnly: boolean;
8
+ }
9
+ /**
10
+ * Resolves consent expiry across applicable regimes:
11
+ * - Shortest positive `maxDays` wins.
12
+ * - When `impliedOnly: true`, `maxDays` only expires implied consent (not express opt-ins).
13
+ * - Checks `ExpiresAt` and `ConsentAt + MaxDays` against `ctx.Now`.
14
+ */
15
+ export declare class ConsentExpiryRuleDriver extends BaseComplianceRule<ConsentExpiryMerged> {
16
+ MergeStrictest(parameterSets: ReadonlyArray<Record<string, unknown>>): ConsentExpiryMerged;
17
+ Evaluate(merged: ConsentExpiryMerged, ctx: ComplianceEvalContext): ComplianceRuleOutcome;
18
+ private isExpressConsent;
19
+ }
20
+ //# sourceMappingURL=ConsentExpiryRuleDriver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsentExpiryRuleDriver.d.ts","sourceRoot":"","sources":["../../../src/compliance/rules/ConsentExpiryRuleDriver.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,qCAAqC,CAAC;AAG7C,0CAA0C;AAC1C,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,kFAAkF;IAClF,WAAW,EAAE,OAAO,CAAC;CACtB;AAID;;;;;GAKG;AACH,qBACa,uBAAwB,SAAQ,kBAAkB,CAAC,mBAAmB,CAAC;IAC3E,cAAc,CAAC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,mBAAmB;IAiB1F,QAAQ,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAE,qBAAqB,GAAG,qBAAqB;IA+B/F,OAAO,CAAC,gBAAgB;CAQzB"}
@@ -0,0 +1,70 @@
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
+ import { RegisterClass } from '@memberjunction/global';
8
+ import { BaseComplianceRule, } from '@memberjunction/communication-types';
9
+ import { ReadBooleanParam, ReadNumberParam } from './RuleParamUtils.js';
10
+ const MS_PER_DAY = 86_400_000;
11
+ /**
12
+ * Resolves consent expiry across applicable regimes:
13
+ * - Shortest positive `maxDays` wins.
14
+ * - When `impliedOnly: true`, `maxDays` only expires implied consent (not express opt-ins).
15
+ * - Checks `ExpiresAt` and `ConsentAt + MaxDays` against `ctx.Now`.
16
+ */
17
+ let ConsentExpiryRuleDriver = class ConsentExpiryRuleDriver extends BaseComplianceRule {
18
+ MergeStrictest(parameterSets) {
19
+ let shortestDays = null;
20
+ let allImpliedOnly = parameterSets.length > 0;
21
+ for (const params of parameterSets) {
22
+ const maxDays = ReadNumberParam(params, 'maxDays', 'MaxDays');
23
+ if (maxDays !== undefined && maxDays > 0) {
24
+ shortestDays = shortestDays === null ? maxDays : Math.min(shortestDays, maxDays);
25
+ }
26
+ if (ReadBooleanParam(params, 'impliedOnly', 'ImpliedOnly') !== true) {
27
+ allImpliedOnly = false;
28
+ }
29
+ }
30
+ return { MaxDays: shortestDays, ImpliedOnly: allImpliedOnly };
31
+ }
32
+ Evaluate(merged, ctx) {
33
+ if (ctx.MessageClass === 'Transactional' || !ctx.PrincipalPreference) {
34
+ return { Passed: true };
35
+ }
36
+ const nowMs = ctx.Now.getTime();
37
+ if (ctx.PrincipalPreference.ExpiresAt && ctx.PrincipalPreference.ExpiresAt.getTime() <= nowMs) {
38
+ return {
39
+ Passed: false,
40
+ Decision: 'Blocked',
41
+ FailureReason: 'Consent has expired (ExpiresAt)',
42
+ };
43
+ }
44
+ if (merged.MaxDays !== null && ctx.PrincipalPreference.ConsentAt) {
45
+ if (merged.ImpliedOnly && this.isExpressConsent(ctx.PrincipalPreference)) {
46
+ return { Passed: true };
47
+ }
48
+ const expiresAtMs = ctx.PrincipalPreference.ConsentAt.getTime() + merged.MaxDays * MS_PER_DAY;
49
+ if (expiresAtMs <= nowMs) {
50
+ return {
51
+ Passed: false,
52
+ Decision: 'Blocked',
53
+ FailureReason: `Consent has exceeded maximum validity of ${merged.MaxDays} days`,
54
+ };
55
+ }
56
+ }
57
+ return { Passed: true };
58
+ }
59
+ isExpressConsent(pp) {
60
+ return (pp.OptInMethod === 'Single' ||
61
+ pp.OptInMethod === 'Double' ||
62
+ pp.ConsentSource === 'Signup Form' ||
63
+ pp.ConsentSource === 'Preference Center');
64
+ }
65
+ };
66
+ ConsentExpiryRuleDriver = __decorate([
67
+ RegisterClass(BaseComplianceRule, 'ConsentExpiryRuleDriver')
68
+ ], ConsentExpiryRuleDriver);
69
+ export { ConsentExpiryRuleDriver };
70
+ //# sourceMappingURL=ConsentExpiryRuleDriver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsentExpiryRuleDriver.js","sourceRoot":"","sources":["../../../src/compliance/rules/ConsentExpiryRuleDriver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,kBAAkB,GAGnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAUrE,MAAM,UAAU,GAAG,UAAU,CAAC;AAE9B;;;;;GAKG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,kBAAuC;IAC3E,cAAc,CAAC,aAAqD;QACzE,IAAI,YAAY,GAAkB,IAAI,CAAC;QACvC,IAAI,cAAc,GAAG,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;QAE9C,KAAK,MAAM,MAAM,IAAI,aAAa,EAAE,CAAC;YACnC,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;YAC9D,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;gBACzC,YAAY,GAAG,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;YACnF,CAAC;YACD,IAAI,gBAAgB,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC;gBACpE,cAAc,GAAG,KAAK,CAAC;YACzB,CAAC;QACH,CAAC;QAED,OAAO,EAAE,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,CAAC,WAAW,KAAK,QAAQ;YAC3B,EAAE,CAAC,WAAW,KAAK,QAAQ;YAC3B,EAAE,CAAC,aAAa,KAAK,aAAa;YAClC,EAAE,CAAC,aAAa,KAAK,mBAAmB,CACzC,CAAC;IACJ,CAAC;CACF,CAAA;AAzDY,uBAAuB;IADnC,aAAa,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;GAChD,uBAAuB,CAyDnC"}
@@ -0,0 +1,22 @@
1
+ import { BaseComplianceRule, ComplianceEvalContext, ComplianceRuleOutcome } from '@memberjunction/communication-types';
2
+ /** Merged `ConsentModel` requirement. */
3
+ export interface ConsentModelMerged {
4
+ /** `'opt-in'` when any applicable regime requires prior consent, else `'opt-out'`. */
5
+ Model: 'opt-in' | 'opt-out';
6
+ /**
7
+ * Whether an existing customer may be sent to without a recorded opt-in. `true` only when every
8
+ * opt-in regime allows it.
9
+ */
10
+ SoftOptIn: boolean;
11
+ }
12
+ /**
13
+ * Resolves consent model across applicable regimes:
14
+ * - `opt-in` beats `opt-out`.
15
+ * - Any other `model` value throws, which blocks the send (fail closed).
16
+ * - `softOptIn` is preserved only if all applicable `opt-in` regimes allow it.
17
+ */
18
+ export declare class ConsentModelRuleDriver extends BaseComplianceRule<ConsentModelMerged> {
19
+ MergeStrictest(parameterSets: ReadonlyArray<Record<string, unknown>>): ConsentModelMerged;
20
+ Evaluate(merged: ConsentModelMerged, ctx: ComplianceEvalContext): ComplianceRuleOutcome;
21
+ }
22
+ //# sourceMappingURL=ConsentModelRuleDriver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsentModelRuleDriver.d.ts","sourceRoot":"","sources":["../../../src/compliance/rules/ConsentModelRuleDriver.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,qCAAqC,CAAC;AAG7C,yCAAyC;AACzC,MAAM,WAAW,kBAAkB;IACjC,sFAAsF;IACtF,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,qBACa,sBAAuB,SAAQ,kBAAkB,CAAC,kBAAkB,CAAC;IACzE,cAAc,CAAC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,kBAAkB;IA8BzF,QAAQ,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,qBAAqB,GAAG,qBAAqB;CAuB/F"}
@@ -0,0 +1,65 @@
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
+ import { RegisterClass } from '@memberjunction/global';
8
+ import { BaseComplianceRule, } from '@memberjunction/communication-types';
9
+ import { ReadBooleanParam, ReadStringParam } from './RuleParamUtils.js';
10
+ /**
11
+ * Resolves consent model across applicable regimes:
12
+ * - `opt-in` beats `opt-out`.
13
+ * - Any other `model` value throws, which blocks the send (fail closed).
14
+ * - `softOptIn` is preserved only if all applicable `opt-in` regimes allow it.
15
+ */
16
+ let ConsentModelRuleDriver = class ConsentModelRuleDriver extends BaseComplianceRule {
17
+ MergeStrictest(parameterSets) {
18
+ const optInSets = [];
19
+ for (const params of parameterSets) {
20
+ const rawModel = ReadStringParam(params, 'model', 'Model')?.toLowerCase();
21
+ if (rawModel === 'opt-in') {
22
+ const softOptIn = ReadBooleanParam(params, 'softOptIn', 'SoftOptIn') === true;
23
+ optInSets.push({ SoftOptIn: softOptIn });
24
+ }
25
+ else if (rawModel !== 'opt-out') {
26
+ // A missing or misspelled model ('optin', 'Opt In') must not silently become opt-out:
27
+ // the gate turns this error into a block for the whole rule.
28
+ throw new Error(`ConsentModel 'model' must be 'opt-in' or 'opt-out'; got ${rawModel === undefined ? 'nothing' : `'${rawModel}'`}`);
29
+ }
30
+ }
31
+ if (optInSets.length > 0) {
32
+ return {
33
+ Model: 'opt-in',
34
+ SoftOptIn: optInSets.every((s) => s.SoftOptIn),
35
+ };
36
+ }
37
+ return {
38
+ Model: 'opt-out',
39
+ SoftOptIn: false,
40
+ };
41
+ }
42
+ Evaluate(merged, ctx) {
43
+ if (ctx.MessageClass === 'Transactional' || merged.Model === 'opt-out') {
44
+ return { Passed: true };
45
+ }
46
+ if (ctx.PrincipalPreference?.State === 'Opted In') {
47
+ return { Passed: true };
48
+ }
49
+ if (!ctx.PrincipalPreference &&
50
+ merged.SoftOptIn &&
51
+ ctx.PrincipalAttributes?.IsExistingCustomer === true) {
52
+ return { Passed: true };
53
+ }
54
+ return {
55
+ Passed: false,
56
+ Decision: 'Blocked',
57
+ FailureReason: 'Explicit opt-in consent is required under applicable compliance regime',
58
+ };
59
+ }
60
+ };
61
+ ConsentModelRuleDriver = __decorate([
62
+ RegisterClass(BaseComplianceRule, 'ConsentModelRuleDriver')
63
+ ], ConsentModelRuleDriver);
64
+ export { ConsentModelRuleDriver };
65
+ //# sourceMappingURL=ConsentModelRuleDriver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsentModelRuleDriver.js","sourceRoot":"","sources":["../../../src/compliance/rules/ConsentModelRuleDriver.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,kBAAkB,GAGnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAarE;;;;;GAKG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,kBAA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AClD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAC1B,CAAC;QAED,IACE,CAAC,GAAG,CAAC,mBAAmB;YACxB,MAAM,CAAC,SAAS;YAChB,GAAG,CAAC,mBAAmB,EAAE,kBAAkB,KAAK,IAAI,EACpD,CAAC;YACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAC1B,CAAC;QAED,OAAO;YACL,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,SAAS;YACnB,aAAa,EAAE,wEAAwE;SACxF,CAAC;IACJ,CAAC;CACF,CAAA;AAtDY,sBAAsB;IADlC,aAAa,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;GAC/C,sBAAsB,CAsDlC"}
@@ -0,0 +1,37 @@
1
+ import { BaseComplianceRule, ComplianceEvalContext, ComplianceRuleOutcome } from '@memberjunction/communication-types';
2
+ /**
3
+ * A daily window, in the recipient's local time, during which messages are held. `StartHour` is
4
+ * inclusive and `EndHour` exclusive (0-23); a window may wrap past midnight.
5
+ */
6
+ export interface QuietHoursWindow {
7
+ StartHour: number;
8
+ EndHour: number;
9
+ }
10
+ /** Merged `QuietHours` requirement: the union of every applicable regime's windows. */
11
+ export interface QuietHoursMerged {
12
+ Windows: QuietHoursWindow[];
13
+ }
14
+ /**
15
+ * The rule context plus the time zones of the recipient's jurisdiction, which the gate adds for
16
+ * every rule driver.
17
+ */
18
+ export interface QuietHoursEvalContext extends ComplianceEvalContext {
19
+ /**
20
+ * IANA time zones of the recipient's jurisdiction. A message is held when any of them is inside a
21
+ * window.
22
+ */
23
+ JurisdictionTimezones?: string[];
24
+ }
25
+ /**
26
+ * Resolves quiet hours across applicable regimes:
27
+ * - Union of blocked local-time windows wins.
28
+ * - Timezone fallback: principal timezone -> jurisdiction timezone(s) -> sender timezone -> UTC.
29
+ */
30
+ export declare class QuietHoursRuleDriver extends BaseComplianceRule<QuietHoursMerged> {
31
+ MergeStrictest(parameterSets: ReadonlyArray<Record<string, unknown>>): QuietHoursMerged;
32
+ Evaluate(merged: QuietHoursMerged, ctx: QuietHoursEvalContext): ComplianceRuleOutcome;
33
+ private resolveTimezones;
34
+ private isBlockedAt;
35
+ private computeDeferUntil;
36
+ }
37
+ //# sourceMappingURL=QuietHoursRuleDriver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuietHoursRuleDriver.d.ts","sourceRoot":"","sources":["../../../src/compliance/rules/QuietHoursRuleDriver.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,qCAAqC,CAAC;AAG7C;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,uFAAuF;AACvF,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AA0DD;;;;GAIG;AACH,qBACa,oBAAqB,SAAQ,kBAAkB,CAAC,gBAAgB,CAAC;IACrE,cAAc,CAAC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,gBAAgB;IAyBvF,QAAQ,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,qBAAqB,GAAG,qBAAqB;IAmB5F,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,iBAAiB;CAe1B"}