@aglyn/aglyn 1.0.0-beta.206 → 1.0.0-beta.209
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/package.json +11 -11
- package/src/lib/app-utils/announce-site-wide-change.d.ts +45 -0
- package/src/lib/app-utils/announce-site-wide-change.js +58 -0
- package/src/lib/app-utils/announce-site-wide-change.js.map +1 -0
- package/src/lib/app-utils/console-routes.d.ts +2 -0
- package/src/lib/app-utils/console-routes.js +3 -0
- package/src/lib/app-utils/console-routes.js.map +1 -1
- package/src/lib/app-utils/content-authors.d.ts +12 -64
- package/src/lib/app-utils/content-authors.js +0 -133
- package/src/lib/app-utils/content-authors.js.map +1 -1
- package/src/lib/app-utils/docs-help.generated.d.ts +6 -0
- package/src/lib/app-utils/docs-help.generated.js +61 -0
- package/src/lib/app-utils/docs-help.generated.js.map +1 -1
- package/src/lib/app-utils/docs-index.generated.js +4 -4
- package/src/lib/app-utils/docs-index.generated.js.map +1 -1
- package/src/lib/app-utils/health-report.js +13 -0
- package/src/lib/app-utils/health-report.js.map +1 -1
- package/src/lib/app-utils/host-transfer.d.ts +55 -0
- package/src/lib/app-utils/host-transfer.js +23 -0
- package/src/lib/app-utils/host-transfer.js.map +1 -0
- package/src/lib/app-utils/local-business.d.ts +161 -0
- package/src/lib/app-utils/local-business.js +253 -0
- package/src/lib/app-utils/local-business.js.map +1 -0
- package/src/lib/app-utils/notifications.d.ts +1 -13
- package/src/lib/app-utils/notifications.js +1 -16
- package/src/lib/app-utils/notifications.js.map +1 -1
- package/src/lib/app-utils/operator-alerts.d.ts +132 -0
- package/src/lib/app-utils/operator-alerts.js +513 -0
- package/src/lib/app-utils/operator-alerts.js.map +1 -0
- package/src/lib/app-utils/screen-link-value.d.ts +4 -0
- package/src/lib/app-utils/screen-link-value.js +6 -2
- package/src/lib/app-utils/screen-link-value.js.map +1 -1
- package/src/lib/app-utils/server.d.ts +1 -0
- package/src/lib/app-utils/server.js +9 -0
- package/src/lib/app-utils/server.js.map +1 -1
- package/src/lib/app-utils/site-entity-json-ld.d.ts +96 -0
- package/src/lib/app-utils/site-entity-json-ld.js +220 -0
- package/src/lib/app-utils/site-entity-json-ld.js.map +1 -0
- package/src/lib/foundation/definitions/platform.types.d.ts +24 -0
- package/src/lib/foundation/definitions/platform.types.js.map +1 -1
- package/src/lib/plugin-manager/feature-plugins.d.ts +9 -0
- package/src/lib/plugin-manager/feature-plugins.js +9 -0
- package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
- package/src/lib/plugin-manager/first-party-plugins.generated.js +8 -1
- package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
- package/src/lib/plugin-manager/operator-alerts.d.ts +37 -0
- package/src/lib/plugin-manager/operator-alerts.js +80 -0
- package/src/lib/plugin-manager/operator-alerts.js.map +1 -0
- package/src/lib/plugin-manager/plugin-host-collections.d.ts +11 -0
- package/src/lib/plugin-manager/plugin-host-collections.js.map +1 -1
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ /** The notification type an alert without its own writes under. */ export const OPERATOR_ALERT_DEFAULT_NOTIFICATION_TYPE = 'system.operatorAlert';
|
|
17
|
+
export const OPERATOR_ALERT_TIER_LABELS = {
|
|
18
|
+
must: 'Must know',
|
|
19
|
+
should: 'Should know',
|
|
20
|
+
low: 'Routine'
|
|
21
|
+
};
|
|
22
|
+
export const OPERATOR_ALERT_CATEGORY_LABELS = {
|
|
23
|
+
billing: 'Billing',
|
|
24
|
+
payments: 'Payments & payouts',
|
|
25
|
+
legal: 'Legal',
|
|
26
|
+
data: 'Data protection',
|
|
27
|
+
ops: 'Operations',
|
|
28
|
+
deliverability: 'Email deliverability',
|
|
29
|
+
security: 'Security',
|
|
30
|
+
support: 'Support'
|
|
31
|
+
};
|
|
32
|
+
const DAY = 24 * 60;
|
|
33
|
+
/**
|
|
34
|
+
* Core's alerts. Plugins contribute theirs through the plugin-manager
|
|
35
|
+
* registry; nothing plugin-specific belongs in this list.
|
|
36
|
+
*/ export const CORE_OPERATOR_ALERTS = [
|
|
37
|
+
// ── Fraud, risk and legal duties already alerting before AGL-3377 ──────
|
|
38
|
+
{
|
|
39
|
+
type: 'system.abuseReportUrgent',
|
|
40
|
+
label: 'Urgent abuse, fraud or risk alert',
|
|
41
|
+
description: 'Phishing, malware or CSAM reported on a site, card testing, a flagged or disputed payment, a held phishing email, a seller under review. Review it on Staff → Abuse reports.',
|
|
42
|
+
tier: 'must',
|
|
43
|
+
category: 'security',
|
|
44
|
+
title: '{{title}}',
|
|
45
|
+
body: '{{body}}',
|
|
46
|
+
link: '/admin/abuse-reports',
|
|
47
|
+
delivery: 'immediate',
|
|
48
|
+
dedupeWindowMinutes: 0,
|
|
49
|
+
defaultEnabled: true,
|
|
50
|
+
notificationType: 'system.abuseReportUrgent'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: 'system.disputeUnattributed',
|
|
54
|
+
label: 'Card dispute with no owner',
|
|
55
|
+
description: 'A chargeback arrived that no subscription, order or marketplace purchase claimed, so nothing is answering it. Find the charge in Stripe and respond before the evidence deadline.',
|
|
56
|
+
tier: 'must',
|
|
57
|
+
category: 'billing',
|
|
58
|
+
title: '{{title}}',
|
|
59
|
+
body: '{{body}}',
|
|
60
|
+
delivery: 'immediate',
|
|
61
|
+
dedupeWindowMinutes: 0,
|
|
62
|
+
defaultEnabled: true,
|
|
63
|
+
notificationType: 'system.disputeUnattributed'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: 'system.dmcaCounterNotice',
|
|
67
|
+
label: 'DMCA counter-notice',
|
|
68
|
+
description: 'A customer contested a takedown. The statutory clock is already running; forward it to the complainant and restore on time unless they file suit.',
|
|
69
|
+
tier: 'must',
|
|
70
|
+
category: 'legal',
|
|
71
|
+
title: '{{title}}',
|
|
72
|
+
body: '{{body}}',
|
|
73
|
+
delivery: 'immediate',
|
|
74
|
+
dedupeWindowMinutes: 0,
|
|
75
|
+
defaultEnabled: true,
|
|
76
|
+
notificationType: 'system.dmcaCounterNotice'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'system.billingWebhookHalfApplied',
|
|
80
|
+
label: 'Billing webhook half applied',
|
|
81
|
+
description: 'A Stripe event threw after its handlers began, so its effects may be partly applied and Stripe will not retry it. Reconcile the event by hand.',
|
|
82
|
+
tier: 'must',
|
|
83
|
+
category: 'billing',
|
|
84
|
+
title: '{{title}}',
|
|
85
|
+
body: '{{body}}',
|
|
86
|
+
delivery: 'immediate',
|
|
87
|
+
dedupeWindowMinutes: 0,
|
|
88
|
+
defaultEnabled: true,
|
|
89
|
+
notificationType: 'system.billingWebhookHalfApplied'
|
|
90
|
+
},
|
|
91
|
+
// ── MUST: billing ───────────────────────────────────────────────────────
|
|
92
|
+
{
|
|
93
|
+
type: 'billing.platformDisputeLost',
|
|
94
|
+
label: 'Subscription dispute lost',
|
|
95
|
+
description: 'A card dispute on a workspace subscription closed as lost: the money has been taken back. Decide whether the workspace keeps its plan.',
|
|
96
|
+
tier: 'must',
|
|
97
|
+
category: 'billing',
|
|
98
|
+
title: 'Subscription dispute lost on workspace {{orgId}}',
|
|
99
|
+
body: 'The card dispute {{disputeId}} on invoice {{invoiceId}} closed as lost ({{reason}}), and {{amount}} was taken back. The workspace keeps its plan until somebody decides otherwise.',
|
|
100
|
+
link: '/admin/orgs/{{orgId}}',
|
|
101
|
+
delivery: 'immediate',
|
|
102
|
+
dedupeWindowMinutes: 30 * DAY,
|
|
103
|
+
defaultEnabled: true
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: 'billing.orphanedSubscription',
|
|
107
|
+
label: 'Stripe is billing a workspace that does not exist',
|
|
108
|
+
description: 'A subscription names a workspace that was deleted or erased, so the customer keeps being charged for nothing. Cancel or refund it in Stripe.',
|
|
109
|
+
tier: 'must',
|
|
110
|
+
category: 'billing',
|
|
111
|
+
title: 'Subscription bills a missing workspace',
|
|
112
|
+
body: 'Stripe subscription {{subscriptionId}} (customer {{customerId}}, plan {{plan}}) names workspace {{orgId}}, which {{reason}}. The {{eventType}} event changed nothing. Cancel or refund it in Stripe.',
|
|
113
|
+
delivery: 'immediate',
|
|
114
|
+
dedupeWindowMinutes: DAY,
|
|
115
|
+
defaultEnabled: true
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: 'billing.usageNotReported',
|
|
119
|
+
label: 'Metered usage not reported to Stripe',
|
|
120
|
+
description: 'A closed month measured billable usage and it reached no invoice. Report it to Stripe by hand or the revenue is lost.',
|
|
121
|
+
tier: 'must',
|
|
122
|
+
category: 'billing',
|
|
123
|
+
title: 'Usage for {{month}} not billed on {{orgId}}',
|
|
124
|
+
body: 'The closed month {{month}} measured {{amount}} of billable usage on workspace {{orgId}}, and it was not reported to Stripe ({{reason}}). Nothing will invoice it until somebody does.',
|
|
125
|
+
link: '/admin/orgs/{{orgId}}',
|
|
126
|
+
delivery: 'immediate',
|
|
127
|
+
dedupeWindowMinutes: 7 * DAY,
|
|
128
|
+
defaultEnabled: true
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
type: 'billing.webhookSignatureRejected',
|
|
132
|
+
label: 'Billing webhook failing its signature check',
|
|
133
|
+
description: 'Repeated deliveries to the billing webhook were refused because their signature did not match. Usually a rolled signing secret: until it is fixed, Stripe cannot tell the install about money.',
|
|
134
|
+
tier: 'must',
|
|
135
|
+
category: 'billing',
|
|
136
|
+
title: 'Billing webhook is refusing deliveries',
|
|
137
|
+
body: 'The billing webhook refused several signed deliveries within six hours because their Stripe signature matched none of the configured secrets. If Stripe is the sender, its signing secret no longer matches this install’s, and no billing event is being applied.',
|
|
138
|
+
link: '/admin/health',
|
|
139
|
+
delivery: 'immediate',
|
|
140
|
+
dedupeWindowMinutes: 6 * 60,
|
|
141
|
+
minOccurrences: 3,
|
|
142
|
+
defaultEnabled: true
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
type: 'billing.webhookInert',
|
|
146
|
+
label: 'Billing webhook delivery moved nothing',
|
|
147
|
+
description: 'Stripe delivered an event this install subscribed to, and no handler did anything with it. Usually a handler that stopped being registered.',
|
|
148
|
+
tier: 'must',
|
|
149
|
+
category: 'billing',
|
|
150
|
+
title: 'A {{eventType}} delivery changed nothing',
|
|
151
|
+
body: 'Stripe event {{eventId}} ({{eventType}}) was accepted and no handler acted on it. Check which handler stopped being registered, then replay the event.',
|
|
152
|
+
link: '/admin/health',
|
|
153
|
+
delivery: 'immediate',
|
|
154
|
+
dedupeWindowMinutes: 6 * 60,
|
|
155
|
+
defaultEnabled: true
|
|
156
|
+
},
|
|
157
|
+
// ── MUST: data protection and records ───────────────────────────────────
|
|
158
|
+
{
|
|
159
|
+
type: 'data.personErasureFailed',
|
|
160
|
+
label: 'Personal data erasure failed',
|
|
161
|
+
description: 'A data subject’s erasure request failed. It will be retried, but the legal deadline keeps running: read the error and fix the cause.',
|
|
162
|
+
tier: 'must',
|
|
163
|
+
category: 'data',
|
|
164
|
+
title: 'Erasure request {{requestId}} failed',
|
|
165
|
+
body: 'The erasure request {{requestId}} on workspace {{orgId}} failed (attempt {{attempt}}): {{error}}. The statutory deadline keeps running while it retries.',
|
|
166
|
+
delivery: 'immediate',
|
|
167
|
+
dedupeWindowMinutes: DAY,
|
|
168
|
+
defaultEnabled: true
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
type: 'data.orgErasureFailed',
|
|
172
|
+
label: 'Workspace erasure failed',
|
|
173
|
+
description: 'A workspace scheduled for erasure could not be erased. Its data is still held after the date it was promised gone.',
|
|
174
|
+
tier: 'must',
|
|
175
|
+
category: 'data',
|
|
176
|
+
title: 'Workspace {{orgId}} could not be erased',
|
|
177
|
+
body: 'The scheduled erasure of workspace {{orgName}} ({{orgId}}) did not complete: {{reason}}. It will be retried on the next run; its data is held until it succeeds.',
|
|
178
|
+
link: '/admin/orgs/{{orgId}}',
|
|
179
|
+
delivery: 'immediate',
|
|
180
|
+
dedupeWindowMinutes: DAY,
|
|
181
|
+
defaultEnabled: true
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
type: 'data.backupExportFailed',
|
|
185
|
+
label: 'Database export failed',
|
|
186
|
+
description: 'The scheduled database export did not start. A stale export means the worst day has nothing to restore from.',
|
|
187
|
+
tier: 'must',
|
|
188
|
+
category: 'data',
|
|
189
|
+
title: 'Database export failed',
|
|
190
|
+
body: 'The scheduled database export did not start ({{reason}}). The last good export is getting older; check the service account’s export permission and the bucket.',
|
|
191
|
+
link: '/admin/health',
|
|
192
|
+
delivery: 'immediate',
|
|
193
|
+
dedupeWindowMinutes: 12 * 60,
|
|
194
|
+
defaultEnabled: true
|
|
195
|
+
},
|
|
196
|
+
// ── MUST: legal ─────────────────────────────────────────────────────────
|
|
197
|
+
{
|
|
198
|
+
type: 'legal.abuseReportHigh',
|
|
199
|
+
label: 'Takedown, impersonation or illegal-content report',
|
|
200
|
+
description: 'A DMCA takedown, impersonation or illegal-content report. Each carries a response duty; review it on Staff → Abuse reports.',
|
|
201
|
+
tier: 'must',
|
|
202
|
+
category: 'legal',
|
|
203
|
+
title: '{{category}} report on {{site}}',
|
|
204
|
+
body: '{{site}} was reported for {{category}}. Reference {{reference}}. Review it and respond within the policy’s window.',
|
|
205
|
+
link: '/admin/abuse-reports',
|
|
206
|
+
delivery: 'immediate',
|
|
207
|
+
dedupeWindowMinutes: 0,
|
|
208
|
+
defaultEnabled: true
|
|
209
|
+
},
|
|
210
|
+
// ── MUST/SHOULD: health ─────────────────────────────────────────────────
|
|
211
|
+
{
|
|
212
|
+
type: 'system.healthDegraded',
|
|
213
|
+
label: 'Health check degraded',
|
|
214
|
+
description: 'A health check went from healthy to degraded: scheduled jobs silent, backups stale, billing deliveries failing, sign-ups refused, server errors, a site not rendering. Told once per incident.',
|
|
215
|
+
tier: 'must',
|
|
216
|
+
category: 'ops',
|
|
217
|
+
title: '{{check}} is degraded',
|
|
218
|
+
body: '{{check}} went from healthy to degraded. {{detail}}',
|
|
219
|
+
link: '/admin/health',
|
|
220
|
+
delivery: 'immediate',
|
|
221
|
+
// A check flapping across the line is told once an hour, not on
|
|
222
|
+
// every swing.
|
|
223
|
+
dedupeWindowMinutes: 60,
|
|
224
|
+
defaultEnabled: true
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
type: 'system.healthRecovered',
|
|
228
|
+
label: 'Health check recovered',
|
|
229
|
+
description: 'A degraded health check is healthy again.',
|
|
230
|
+
tier: 'should',
|
|
231
|
+
category: 'ops',
|
|
232
|
+
title: '{{check}} recovered',
|
|
233
|
+
body: '{{check}} is healthy again after {{duration}}.',
|
|
234
|
+
link: '/admin/health',
|
|
235
|
+
delivery: 'immediate',
|
|
236
|
+
// A check flapping across the line is told once an hour, not on
|
|
237
|
+
// every swing.
|
|
238
|
+
dedupeWindowMinutes: 60,
|
|
239
|
+
defaultEnabled: true
|
|
240
|
+
},
|
|
241
|
+
// ── SHOULD: billing ─────────────────────────────────────────────────────
|
|
242
|
+
{
|
|
243
|
+
type: 'billing.autoLocked',
|
|
244
|
+
label: 'Workspace billing locked automatically',
|
|
245
|
+
description: 'A workspace crossed its spend guard and the platform locked its billable activity. Check it is not a false positive before the customer notices.',
|
|
246
|
+
tier: 'should',
|
|
247
|
+
category: 'billing',
|
|
248
|
+
title: 'Billing locked on {{orgName}}',
|
|
249
|
+
body: 'Workspace {{orgName}} ({{orgId}}) was locked automatically: {{reason}}.',
|
|
250
|
+
link: '/admin/orgs/{{orgId}}',
|
|
251
|
+
delivery: 'immediate',
|
|
252
|
+
dedupeWindowMinutes: DAY,
|
|
253
|
+
defaultEnabled: true
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
type: 'billing.platformInvoiceUncollectible',
|
|
257
|
+
label: 'Subscription invoice voided or uncollectible',
|
|
258
|
+
description: 'A workspace invoice was voided or marked uncollectible: revenue the books expected is not coming.',
|
|
259
|
+
tier: 'should',
|
|
260
|
+
category: 'billing',
|
|
261
|
+
title: 'Invoice {{status}} on {{orgId}}',
|
|
262
|
+
body: 'Invoice {{invoiceId}} for {{amount}} on workspace {{orgId}} was marked {{status}}.',
|
|
263
|
+
link: '/admin/orgs/{{orgId}}',
|
|
264
|
+
delivery: 'immediate',
|
|
265
|
+
dedupeWindowMinutes: 30 * DAY,
|
|
266
|
+
defaultEnabled: true
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
type: 'billing.connectPayoutFailed',
|
|
270
|
+
label: 'Connected account payout or transfer failed',
|
|
271
|
+
description: 'Money due to a merchant or seller did not arrive. Stripe retries on its own schedule; a human decides what happens next.',
|
|
272
|
+
tier: 'should',
|
|
273
|
+
category: 'billing',
|
|
274
|
+
title: 'A {{kind}} to {{account}} failed',
|
|
275
|
+
body: 'Stripe {{kind}} {{stripeId}} to connected account {{account}} failed ({{reason}}). The merchant’s funds are not where the ledger says.',
|
|
276
|
+
delivery: 'immediate',
|
|
277
|
+
dedupeWindowMinutes: 30 * DAY,
|
|
278
|
+
defaultEnabled: true
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
type: 'staff.paymentFailed',
|
|
282
|
+
label: 'Workspace payment failed',
|
|
283
|
+
description: 'A paying workspace’s renewal failed. Stripe is retrying; the customer has been told.',
|
|
284
|
+
tier: 'should',
|
|
285
|
+
category: 'billing',
|
|
286
|
+
title: '{{title}}',
|
|
287
|
+
body: '{{body}}',
|
|
288
|
+
delivery: 'immediate',
|
|
289
|
+
dedupeWindowMinutes: 0,
|
|
290
|
+
defaultEnabled: true,
|
|
291
|
+
notificationType: 'staff.paymentFailed'
|
|
292
|
+
},
|
|
293
|
+
// ── SHOULD: security ────────────────────────────────────────────────────
|
|
294
|
+
{
|
|
295
|
+
type: 'security.staffGranted',
|
|
296
|
+
label: 'Staff access granted or raised',
|
|
297
|
+
description: 'Somebody was made staff, or a staff role was raised. If nobody on the team did it, revoke it and rotate credentials.',
|
|
298
|
+
tier: 'should',
|
|
299
|
+
category: 'security',
|
|
300
|
+
title: '{{target}} is now {{role}} staff',
|
|
301
|
+
body: '{{actor}} granted {{target}} the {{role}} staff role (was {{previous}}).',
|
|
302
|
+
link: '/admin/users',
|
|
303
|
+
delivery: 'immediate',
|
|
304
|
+
dedupeWindowMinutes: 0,
|
|
305
|
+
defaultEnabled: true
|
|
306
|
+
},
|
|
307
|
+
// ── SHOULD: support ─────────────────────────────────────────────────────
|
|
308
|
+
{
|
|
309
|
+
type: 'support.slaBreached',
|
|
310
|
+
label: 'Support ticket past its response time',
|
|
311
|
+
description: 'A support ticket passed its promised response time without a staff reply.',
|
|
312
|
+
tier: 'should',
|
|
313
|
+
category: 'support',
|
|
314
|
+
title: 'Ticket past its response time: {{subject}}',
|
|
315
|
+
body: 'The {{tier}} ticket “{{subject}}” on workspace {{orgId}} was due a first response {{overdue}} ago and has none.',
|
|
316
|
+
link: '/admin/support',
|
|
317
|
+
delivery: 'immediate',
|
|
318
|
+
dedupeWindowMinutes: DAY,
|
|
319
|
+
defaultEnabled: true
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
type: 'support.ticketOpened',
|
|
323
|
+
label: 'New support ticket',
|
|
324
|
+
description: 'A subscriber opened a support ticket.',
|
|
325
|
+
tier: 'should',
|
|
326
|
+
category: 'support',
|
|
327
|
+
title: '{{title}}',
|
|
328
|
+
body: '{{body}}',
|
|
329
|
+
delivery: 'digest',
|
|
330
|
+
dedupeWindowMinutes: 0,
|
|
331
|
+
defaultEnabled: true,
|
|
332
|
+
notificationType: 'support.ticketOpened'
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
type: 'support.ticketReply',
|
|
336
|
+
label: 'Support ticket reply',
|
|
337
|
+
description: 'A subscriber replied on a support ticket.',
|
|
338
|
+
tier: 'should',
|
|
339
|
+
category: 'support',
|
|
340
|
+
title: '{{title}}',
|
|
341
|
+
body: '{{body}}',
|
|
342
|
+
delivery: 'digest',
|
|
343
|
+
dedupeWindowMinutes: 0,
|
|
344
|
+
defaultEnabled: true,
|
|
345
|
+
notificationType: 'support.ticketReply'
|
|
346
|
+
},
|
|
347
|
+
// ── SHOULD: deliverability ──────────────────────────────────────────────
|
|
348
|
+
{
|
|
349
|
+
type: 'deliverability.sendRateSaturated',
|
|
350
|
+
label: 'Email send-rate governor saturated',
|
|
351
|
+
description: 'The platform’s email send-rate budget is exhausted, so sends are being deferred. Raise the budget or find the sender filling it.',
|
|
352
|
+
tier: 'should',
|
|
353
|
+
category: 'deliverability',
|
|
354
|
+
title: 'Email sending is being throttled',
|
|
355
|
+
body: 'The {{scope}} send-rate budget is full ({{detail}}), so sends are being deferred.',
|
|
356
|
+
link: '/admin/emails',
|
|
357
|
+
delivery: 'immediate',
|
|
358
|
+
dedupeWindowMinutes: 6 * 60,
|
|
359
|
+
defaultEnabled: true
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
type: 'deliverability.sendRateUnavailable',
|
|
363
|
+
label: 'Email send-rate governor unavailable',
|
|
364
|
+
description: 'The send-rate governor could not read its counters, so mail is going out unmetered: nothing is holding the shared domains under their hourly ceiling.',
|
|
365
|
+
tier: 'should',
|
|
366
|
+
category: 'deliverability',
|
|
367
|
+
title: 'Email send-rate governor unavailable',
|
|
368
|
+
body: 'The send-rate governor could not read its counters ({{error}}), so sends are being allowed unmetered until it can.',
|
|
369
|
+
link: '/admin/emails',
|
|
370
|
+
delivery: 'immediate',
|
|
371
|
+
dedupeWindowMinutes: 6 * 60,
|
|
372
|
+
defaultEnabled: true
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
type: 'deliverability.gatewayBlocking',
|
|
376
|
+
label: 'A recipient gateway is blocking the shared domain',
|
|
377
|
+
description: 'A mail gateway is refusing mail from the shared sending domain, so everyone behind that gateway stops receiving it.',
|
|
378
|
+
tier: 'should',
|
|
379
|
+
category: 'deliverability',
|
|
380
|
+
title: '{{gateway}} is blocking {{domain}}',
|
|
381
|
+
body: 'Mail from {{domain}} is being refused by {{gateway}} ({{detail}}). Recipients behind that gateway are not receiving it.',
|
|
382
|
+
link: '/admin/emails',
|
|
383
|
+
delivery: 'immediate',
|
|
384
|
+
dedupeWindowMinutes: DAY,
|
|
385
|
+
defaultEnabled: true
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
type: 'deliverability.providerCredentialsRejected',
|
|
389
|
+
label: 'Email provider rejected the credentials',
|
|
390
|
+
description: 'The email provider refused the API key, or a sending pool is unhealthy: invites, password resets and receipts are not leaving. The webhook channel is the one that still reaches you.',
|
|
391
|
+
tier: 'should',
|
|
392
|
+
category: 'deliverability',
|
|
393
|
+
title: 'Email delivery is failing: {{problem}}',
|
|
394
|
+
body: '{{detail}}',
|
|
395
|
+
link: '/admin/emails',
|
|
396
|
+
delivery: 'immediate',
|
|
397
|
+
dedupeWindowMinutes: 6 * 60,
|
|
398
|
+
defaultEnabled: true
|
|
399
|
+
},
|
|
400
|
+
// ── SHOULD: operations ──────────────────────────────────────────────────
|
|
401
|
+
{
|
|
402
|
+
type: 'ops.reaperStuck',
|
|
403
|
+
label: 'A reaper is stuck or failing',
|
|
404
|
+
description: 'A cleanup job (sending domains, unverified workspaces) could not finish, so what it removes keeps accumulating.',
|
|
405
|
+
tier: 'should',
|
|
406
|
+
category: 'ops',
|
|
407
|
+
title: '{{job}} is stuck',
|
|
408
|
+
body: '{{job}} could not finish: {{detail}}',
|
|
409
|
+
delivery: 'immediate',
|
|
410
|
+
dedupeWindowMinutes: DAY,
|
|
411
|
+
defaultEnabled: true
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
type: 'ops.pluginJobFailed',
|
|
415
|
+
label: 'A plugin job failed',
|
|
416
|
+
description: 'A plugin’s scheduled job threw: consent-group changes, the publish outbox, sending-domain provisioning, a plugin cron.',
|
|
417
|
+
tier: 'should',
|
|
418
|
+
category: 'ops',
|
|
419
|
+
title: '{{job}} failed',
|
|
420
|
+
body: 'The scheduled job {{job}} failed: {{error}}',
|
|
421
|
+
delivery: 'immediate',
|
|
422
|
+
dedupeWindowMinutes: 6 * 60,
|
|
423
|
+
defaultEnabled: true
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
type: 'system.pluginVerifierRegression',
|
|
427
|
+
label: 'Plugin verifier regression',
|
|
428
|
+
description: 'A live plugin version stopped passing the static verifier.',
|
|
429
|
+
tier: 'should',
|
|
430
|
+
category: 'security',
|
|
431
|
+
title: '{{title}}',
|
|
432
|
+
body: '{{body}}',
|
|
433
|
+
delivery: 'immediate',
|
|
434
|
+
dedupeWindowMinutes: 0,
|
|
435
|
+
defaultEnabled: true,
|
|
436
|
+
notificationType: 'system.pluginVerifierRegression'
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
type: 'system.bandwidthCeilingTripped',
|
|
440
|
+
label: 'Bandwidth ceiling reached',
|
|
441
|
+
description: 'A site crossed the per-month bandwidth abuse ceiling.',
|
|
442
|
+
tier: 'should',
|
|
443
|
+
category: 'ops',
|
|
444
|
+
title: '{{title}}',
|
|
445
|
+
body: '{{body}}',
|
|
446
|
+
delivery: 'immediate',
|
|
447
|
+
dedupeWindowMinutes: 0,
|
|
448
|
+
defaultEnabled: true,
|
|
449
|
+
notificationType: 'system.bandwidthCeilingTripped'
|
|
450
|
+
},
|
|
451
|
+
// ── LOW ─────────────────────────────────────────────────────────────────
|
|
452
|
+
{
|
|
453
|
+
type: 'marketplace.review',
|
|
454
|
+
label: 'Plugin listing waiting for review',
|
|
455
|
+
description: 'A plugin listing or version was submitted for review.',
|
|
456
|
+
tier: 'low',
|
|
457
|
+
category: 'security',
|
|
458
|
+
title: '{{title}}',
|
|
459
|
+
body: '{{body}}',
|
|
460
|
+
delivery: 'digest',
|
|
461
|
+
dedupeWindowMinutes: 0,
|
|
462
|
+
defaultEnabled: true,
|
|
463
|
+
notificationType: 'marketplace.review'
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
type: 'system.scopeDrift',
|
|
467
|
+
label: 'Resources missing a sharing scope',
|
|
468
|
+
description: 'The weekly sweep found documents invisible to every site-scoped read: a creation path forgot the field.',
|
|
469
|
+
tier: 'low',
|
|
470
|
+
category: 'data',
|
|
471
|
+
title: '{{title}}',
|
|
472
|
+
body: '{{body}}',
|
|
473
|
+
delivery: 'digest',
|
|
474
|
+
dedupeWindowMinutes: 0,
|
|
475
|
+
defaultEnabled: true,
|
|
476
|
+
notificationType: 'system.scopeDrift'
|
|
477
|
+
}
|
|
478
|
+
];
|
|
479
|
+
/** An amount in minor units, as an alert prints it: `$12.40`. */ export function formatOperatorAlertAmount(cents, currency = 'usd') {
|
|
480
|
+
const value = Number(cents) / 100;
|
|
481
|
+
if (!Number.isFinite(value)) return '';
|
|
482
|
+
try {
|
|
483
|
+
return new Intl.NumberFormat('en-US', {
|
|
484
|
+
style: 'currency',
|
|
485
|
+
currency: String(currency || 'usd').toUpperCase()
|
|
486
|
+
}).format(value);
|
|
487
|
+
} catch (unused) {
|
|
488
|
+
return `${value.toFixed(2)} ${String(currency).toUpperCase()}`;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
/** Replaces each `{{token}}` with its context value, or nothing. */ export function renderOperatorAlertTemplate(template, context) {
|
|
492
|
+
return String(template != null ? template : '').replace(/\{\{\s*([\w.]+)\s*\}\}/g, (_match, name)=>{
|
|
493
|
+
const value = context == null ? void 0 : context[name];
|
|
494
|
+
return value === null || value === undefined ? '' : String(value);
|
|
495
|
+
}).replace(/\(\s*\)/g, '').replace(/[ \t]{2,}/g, ' ').replace(/ ([.,;:])/g, '$1').trim();
|
|
496
|
+
}
|
|
497
|
+
/** Whether a type is on, and how it is delivered, after staff's answers. */ export function effectiveOperatorAlertSetting(definition, settings) {
|
|
498
|
+
var _settings_types;
|
|
499
|
+
const answer = settings == null ? void 0 : (_settings_types = settings.types) == null ? void 0 : _settings_types[definition.type];
|
|
500
|
+
return {
|
|
501
|
+
enabled: typeof (answer == null ? void 0 : answer.enabled) === 'boolean' ? answer.enabled : definition.defaultEnabled,
|
|
502
|
+
delivery: (answer == null ? void 0 : answer.delivery) === 'immediate' || (answer == null ? void 0 : answer.delivery) === 'digest' ? answer.delivery : definition.delivery
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Staff notification types whose alert emails the operator on a coded
|
|
507
|
+
* default of immediate (AGL-3375), derived from the catalog so there is one
|
|
508
|
+
* list.
|
|
509
|
+
*/ export const OPERATOR_ALERT_NOTIFICATION_TYPES = new Set(CORE_OPERATOR_ALERTS.flatMap((definition)=>definition.notificationType ? [
|
|
510
|
+
definition.notificationType
|
|
511
|
+
] : []));
|
|
512
|
+
|
|
513
|
+
//# sourceMappingURL=operator-alerts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/operator-alerts.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AglynNotificationType } from './notifications'\n\n/**\n * OPERATOR ALERTS (AGL-3377): the events whoever runs an install must hear\n * about, as one typed catalog.\n *\n * Every alert is an entry here (or a plugin's entry in the same shape,\n * registered through `@aglyn/aglyn/plugin-manager/operator-alerts`) and is\n * raised through ONE server entry point, `raiseOperatorAlert` in\n * `@aglyn/tenant-data-admin/server/operator-alerts`. That entry point writes\n * the staff console notification, dedupes a flapping condition, honours the\n * per-type switches staff set on Staff → Operator alerts, and delivers by\n * email (the `operator-alert` system email) and the optional out-of-band\n * webhook. No call site composes or sends its own mail.\n *\n * The catalog holds nothing install-specific: no address, no domain, no\n * host. Recipients come from `resolveStaffAlertRecipients()` and the webhook\n * from `OPERATOR_ALERT_WEBHOOK_URL`, so an entry reads the same on aglyn.com,\n * on a self-hosted install and in an OSS consumer's deployment.\n *\n * Copy is written against merge tokens (`{{orgId}}`), filled from the\n * `context` the call site passes. A token the call site did not supply is\n * blanked, so every sentence must still read when its optional tokens are\n * empty. Never put a data subject's address or other personal data into a\n * context: the alert travels to an inbox and a webhook, not only the console.\n */\n\n/**\n * How much an alert matters.\n *\n * - `must` — money moving with nobody looking, a legal duty unmet, data not\n * protected or not erased. On and immediate unless staff change it.\n * - `should` — a fault an operator wants to know about today.\n * - `low` — routine review work; on, and batched into the daily digest.\n */\nexport type OperatorAlertTier = 'must' | 'should' | 'low'\n\nexport type OperatorAlertCategory =\n | 'billing'\n | 'payments'\n | 'legal'\n | 'data'\n | 'ops'\n | 'deliverability'\n | 'security'\n | 'support'\n\n/** `digest` batches the alert into the once-a-day operator digest. */\nexport type OperatorAlertDelivery = 'immediate' | 'digest'\n\nexport interface OperatorAlertDefinition {\n /**\n * Stable id, also the key of its settings row. Never rename: staff\n * switches are stored under it. A plugin's types start with its plugin id\n * and a dot (`commerce.taxNotReversed`).\n */\n type: string\n /** The settings row's name. */\n label: string\n /** What it means and the first thing to do, for the settings page. */\n description: string\n tier: OperatorAlertTier\n category: OperatorAlertCategory\n /** The notification title and email subject, with `{{tokens}}`. */\n title: string\n /** What happened and what to do, with `{{tokens}}`. */\n body: string\n /** Console path the alert opens, with `{{tokens}}`; the call may override. */\n link?: string\n /** The coded default; staff may change it. */\n delivery: OperatorAlertDelivery\n /**\n * How long one `dedupeKey` stays quiet after it fired, in minutes. A\n * condition that flaps inside the window is told once. `0` never dedupes.\n * A call without a `dedupeKey` is never deduped.\n */\n dedupeWindowMinutes: number\n /**\n * Fire only once the same `dedupeKey` has been raised this many times\n * inside the window — for an endpoint any stranger can hit, where one\n * refused request is noise and several are a broken secret. Default 1.\n */\n minOccurrences?: number\n /** The coded default; staff may change it. */\n defaultEnabled: boolean\n /**\n * The console notification's type. Absent is the generic\n * `system.operatorAlert`; a type that already had its own notification\n * keeps it, so its icon, label and everyone's mutes are unchanged.\n */\n notificationType?: AglynNotificationType\n /** The plugin that contributed it; absent for core's own. */\n pluginId?: string\n}\n\n/** Values a call site passes for an alert's `{{tokens}}`. */\nexport type OperatorAlertContext = Readonly<\n Record<string, string | number | boolean | null | undefined>\n>\n\n/** The notification type an alert without its own writes under. */\nexport const OPERATOR_ALERT_DEFAULT_NOTIFICATION_TYPE: AglynNotificationType =\n 'system.operatorAlert'\n\nexport const OPERATOR_ALERT_TIER_LABELS: Record<OperatorAlertTier, string> = {\n must: 'Must know',\n should: 'Should know',\n low: 'Routine',\n}\n\nexport const OPERATOR_ALERT_CATEGORY_LABELS: Record<\n OperatorAlertCategory,\n string\n> = {\n billing: 'Billing',\n payments: 'Payments & payouts',\n legal: 'Legal',\n data: 'Data protection',\n ops: 'Operations',\n deliverability: 'Email deliverability',\n security: 'Security',\n support: 'Support',\n}\n\nconst DAY = 24 * 60\n\n/**\n * Core's alerts. Plugins contribute theirs through the plugin-manager\n * registry; nothing plugin-specific belongs in this list.\n */\nexport const CORE_OPERATOR_ALERTS: readonly OperatorAlertDefinition[] = [\n // ── Fraud, risk and legal duties already alerting before AGL-3377 ──────\n {\n type: 'system.abuseReportUrgent',\n label: 'Urgent abuse, fraud or risk alert',\n description:\n 'Phishing, malware or CSAM reported on a site, card testing, a flagged or disputed payment, a held phishing email, a seller under review. Review it on Staff → Abuse reports.',\n tier: 'must',\n category: 'security',\n title: '{{title}}',\n body: '{{body}}',\n link: '/admin/abuse-reports',\n delivery: 'immediate',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n notificationType: 'system.abuseReportUrgent',\n },\n {\n type: 'system.disputeUnattributed',\n label: 'Card dispute with no owner',\n description:\n 'A chargeback arrived that no subscription, order or marketplace purchase claimed, so nothing is answering it. Find the charge in Stripe and respond before the evidence deadline.',\n tier: 'must',\n category: 'billing',\n title: '{{title}}',\n body: '{{body}}',\n delivery: 'immediate',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n notificationType: 'system.disputeUnattributed',\n },\n {\n type: 'system.dmcaCounterNotice',\n label: 'DMCA counter-notice',\n description:\n 'A customer contested a takedown. The statutory clock is already running; forward it to the complainant and restore on time unless they file suit.',\n tier: 'must',\n category: 'legal',\n title: '{{title}}',\n body: '{{body}}',\n delivery: 'immediate',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n notificationType: 'system.dmcaCounterNotice',\n },\n {\n type: 'system.billingWebhookHalfApplied',\n label: 'Billing webhook half applied',\n description:\n 'A Stripe event threw after its handlers began, so its effects may be partly applied and Stripe will not retry it. Reconcile the event by hand.',\n tier: 'must',\n category: 'billing',\n title: '{{title}}',\n body: '{{body}}',\n delivery: 'immediate',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n notificationType: 'system.billingWebhookHalfApplied',\n },\n\n // ── MUST: billing ───────────────────────────────────────────────────────\n {\n type: 'billing.platformDisputeLost',\n label: 'Subscription dispute lost',\n description:\n 'A card dispute on a workspace subscription closed as lost: the money has been taken back. Decide whether the workspace keeps its plan.',\n tier: 'must',\n category: 'billing',\n title: 'Subscription dispute lost on workspace {{orgId}}',\n body:\n 'The card dispute {{disputeId}} on invoice {{invoiceId}} closed as lost ({{reason}}), and {{amount}} was taken back. The workspace keeps its plan until somebody decides otherwise.',\n link: '/admin/orgs/{{orgId}}',\n delivery: 'immediate',\n dedupeWindowMinutes: 30 * DAY,\n defaultEnabled: true,\n },\n {\n type: 'billing.orphanedSubscription',\n label: 'Stripe is billing a workspace that does not exist',\n description:\n 'A subscription names a workspace that was deleted or erased, so the customer keeps being charged for nothing. Cancel or refund it in Stripe.',\n tier: 'must',\n category: 'billing',\n title: 'Subscription bills a missing workspace',\n body:\n 'Stripe subscription {{subscriptionId}} (customer {{customerId}}, plan {{plan}}) names workspace {{orgId}}, which {{reason}}. The {{eventType}} event changed nothing. Cancel or refund it in Stripe.',\n delivery: 'immediate',\n dedupeWindowMinutes: DAY,\n defaultEnabled: true,\n },\n {\n type: 'billing.usageNotReported',\n label: 'Metered usage not reported to Stripe',\n description:\n 'A closed month measured billable usage and it reached no invoice. Report it to Stripe by hand or the revenue is lost.',\n tier: 'must',\n category: 'billing',\n title: 'Usage for {{month}} not billed on {{orgId}}',\n body:\n 'The closed month {{month}} measured {{amount}} of billable usage on workspace {{orgId}}, and it was not reported to Stripe ({{reason}}). Nothing will invoice it until somebody does.',\n link: '/admin/orgs/{{orgId}}',\n delivery: 'immediate',\n dedupeWindowMinutes: 7 * DAY,\n defaultEnabled: true,\n },\n {\n type: 'billing.webhookSignatureRejected',\n label: 'Billing webhook failing its signature check',\n description:\n 'Repeated deliveries to the billing webhook were refused because their signature did not match. Usually a rolled signing secret: until it is fixed, Stripe cannot tell the install about money.',\n tier: 'must',\n category: 'billing',\n title: 'Billing webhook is refusing deliveries',\n body:\n 'The billing webhook refused several signed deliveries within six hours because their Stripe signature matched none of the configured secrets. If Stripe is the sender, its signing secret no longer matches this install’s, and no billing event is being applied.',\n link: '/admin/health',\n delivery: 'immediate',\n dedupeWindowMinutes: 6 * 60,\n minOccurrences: 3,\n defaultEnabled: true,\n },\n {\n type: 'billing.webhookInert',\n label: 'Billing webhook delivery moved nothing',\n description:\n 'Stripe delivered an event this install subscribed to, and no handler did anything with it. Usually a handler that stopped being registered.',\n tier: 'must',\n category: 'billing',\n title: 'A {{eventType}} delivery changed nothing',\n body:\n 'Stripe event {{eventId}} ({{eventType}}) was accepted and no handler acted on it. Check which handler stopped being registered, then replay the event.',\n link: '/admin/health',\n delivery: 'immediate',\n dedupeWindowMinutes: 6 * 60,\n defaultEnabled: true,\n },\n\n // ── MUST: data protection and records ───────────────────────────────────\n {\n type: 'data.personErasureFailed',\n label: 'Personal data erasure failed',\n description:\n 'A data subject’s erasure request failed. It will be retried, but the legal deadline keeps running: read the error and fix the cause.',\n tier: 'must',\n category: 'data',\n title: 'Erasure request {{requestId}} failed',\n body:\n 'The erasure request {{requestId}} on workspace {{orgId}} failed (attempt {{attempt}}): {{error}}. The statutory deadline keeps running while it retries.',\n delivery: 'immediate',\n dedupeWindowMinutes: DAY,\n defaultEnabled: true,\n },\n {\n type: 'data.orgErasureFailed',\n label: 'Workspace erasure failed',\n description:\n 'A workspace scheduled for erasure could not be erased. Its data is still held after the date it was promised gone.',\n tier: 'must',\n category: 'data',\n title: 'Workspace {{orgId}} could not be erased',\n body:\n 'The scheduled erasure of workspace {{orgName}} ({{orgId}}) did not complete: {{reason}}. It will be retried on the next run; its data is held until it succeeds.',\n link: '/admin/orgs/{{orgId}}',\n delivery: 'immediate',\n dedupeWindowMinutes: DAY,\n defaultEnabled: true,\n },\n {\n type: 'data.backupExportFailed',\n label: 'Database export failed',\n description:\n 'The scheduled database export did not start. A stale export means the worst day has nothing to restore from.',\n tier: 'must',\n category: 'data',\n title: 'Database export failed',\n body:\n 'The scheduled database export did not start ({{reason}}). The last good export is getting older; check the service account’s export permission and the bucket.',\n link: '/admin/health',\n delivery: 'immediate',\n dedupeWindowMinutes: 12 * 60,\n defaultEnabled: true,\n },\n\n // ── MUST: legal ─────────────────────────────────────────────────────────\n {\n type: 'legal.abuseReportHigh',\n label: 'Takedown, impersonation or illegal-content report',\n description:\n 'A DMCA takedown, impersonation or illegal-content report. Each carries a response duty; review it on Staff → Abuse reports.',\n tier: 'must',\n category: 'legal',\n title: '{{category}} report on {{site}}',\n body:\n '{{site}} was reported for {{category}}. Reference {{reference}}. Review it and respond within the policy’s window.',\n link: '/admin/abuse-reports',\n delivery: 'immediate',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n },\n\n // ── MUST/SHOULD: health ─────────────────────────────────────────────────\n {\n type: 'system.healthDegraded',\n label: 'Health check degraded',\n description:\n 'A health check went from healthy to degraded: scheduled jobs silent, backups stale, billing deliveries failing, sign-ups refused, server errors, a site not rendering. Told once per incident.',\n tier: 'must',\n category: 'ops',\n title: '{{check}} is degraded',\n body: '{{check}} went from healthy to degraded. {{detail}}',\n link: '/admin/health',\n delivery: 'immediate',\n // A check flapping across the line is told once an hour, not on\n // every swing.\n dedupeWindowMinutes: 60,\n defaultEnabled: true,\n },\n {\n type: 'system.healthRecovered',\n label: 'Health check recovered',\n description: 'A degraded health check is healthy again.',\n tier: 'should',\n category: 'ops',\n title: '{{check}} recovered',\n body: '{{check}} is healthy again after {{duration}}.',\n link: '/admin/health',\n delivery: 'immediate',\n // A check flapping across the line is told once an hour, not on\n // every swing.\n dedupeWindowMinutes: 60,\n defaultEnabled: true,\n },\n\n // ── SHOULD: billing ─────────────────────────────────────────────────────\n {\n type: 'billing.autoLocked',\n label: 'Workspace billing locked automatically',\n description:\n 'A workspace crossed its spend guard and the platform locked its billable activity. Check it is not a false positive before the customer notices.',\n tier: 'should',\n category: 'billing',\n title: 'Billing locked on {{orgName}}',\n body:\n 'Workspace {{orgName}} ({{orgId}}) was locked automatically: {{reason}}.',\n link: '/admin/orgs/{{orgId}}',\n delivery: 'immediate',\n dedupeWindowMinutes: DAY,\n defaultEnabled: true,\n },\n {\n type: 'billing.platformInvoiceUncollectible',\n label: 'Subscription invoice voided or uncollectible',\n description:\n 'A workspace invoice was voided or marked uncollectible: revenue the books expected is not coming.',\n tier: 'should',\n category: 'billing',\n title: 'Invoice {{status}} on {{orgId}}',\n body:\n 'Invoice {{invoiceId}} for {{amount}} on workspace {{orgId}} was marked {{status}}.',\n link: '/admin/orgs/{{orgId}}',\n delivery: 'immediate',\n dedupeWindowMinutes: 30 * DAY,\n defaultEnabled: true,\n },\n {\n type: 'billing.connectPayoutFailed',\n label: 'Connected account payout or transfer failed',\n description:\n 'Money due to a merchant or seller did not arrive. Stripe retries on its own schedule; a human decides what happens next.',\n tier: 'should',\n category: 'billing',\n title: 'A {{kind}} to {{account}} failed',\n body:\n 'Stripe {{kind}} {{stripeId}} to connected account {{account}} failed ({{reason}}). The merchant’s funds are not where the ledger says.',\n delivery: 'immediate',\n dedupeWindowMinutes: 30 * DAY,\n defaultEnabled: true,\n },\n {\n type: 'staff.paymentFailed',\n label: 'Workspace payment failed',\n description:\n 'A paying workspace’s renewal failed. Stripe is retrying; the customer has been told.',\n tier: 'should',\n category: 'billing',\n title: '{{title}}',\n body: '{{body}}',\n delivery: 'immediate',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n notificationType: 'staff.paymentFailed',\n },\n\n // ── SHOULD: security ────────────────────────────────────────────────────\n {\n type: 'security.staffGranted',\n label: 'Staff access granted or raised',\n description:\n 'Somebody was made staff, or a staff role was raised. If nobody on the team did it, revoke it and rotate credentials.',\n tier: 'should',\n category: 'security',\n title: '{{target}} is now {{role}} staff',\n body: '{{actor}} granted {{target}} the {{role}} staff role (was {{previous}}).',\n link: '/admin/users',\n delivery: 'immediate',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n },\n\n // ── SHOULD: support ─────────────────────────────────────────────────────\n {\n type: 'support.slaBreached',\n label: 'Support ticket past its response time',\n description:\n 'A support ticket passed its promised response time without a staff reply.',\n tier: 'should',\n category: 'support',\n title: 'Ticket past its response time: {{subject}}',\n body:\n 'The {{tier}} ticket “{{subject}}” on workspace {{orgId}} was due a first response {{overdue}} ago and has none.',\n link: '/admin/support',\n delivery: 'immediate',\n dedupeWindowMinutes: DAY,\n defaultEnabled: true,\n },\n {\n type: 'support.ticketOpened',\n label: 'New support ticket',\n description: 'A subscriber opened a support ticket.',\n tier: 'should',\n category: 'support',\n title: '{{title}}',\n body: '{{body}}',\n delivery: 'digest',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n notificationType: 'support.ticketOpened',\n },\n {\n type: 'support.ticketReply',\n label: 'Support ticket reply',\n description: 'A subscriber replied on a support ticket.',\n tier: 'should',\n category: 'support',\n title: '{{title}}',\n body: '{{body}}',\n delivery: 'digest',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n notificationType: 'support.ticketReply',\n },\n\n // ── SHOULD: deliverability ──────────────────────────────────────────────\n {\n type: 'deliverability.sendRateSaturated',\n label: 'Email send-rate governor saturated',\n description:\n 'The platform’s email send-rate budget is exhausted, so sends are being deferred. Raise the budget or find the sender filling it.',\n tier: 'should',\n category: 'deliverability',\n title: 'Email sending is being throttled',\n body:\n 'The {{scope}} send-rate budget is full ({{detail}}), so sends are being deferred.',\n link: '/admin/emails',\n delivery: 'immediate',\n dedupeWindowMinutes: 6 * 60,\n defaultEnabled: true,\n },\n {\n type: 'deliverability.sendRateUnavailable',\n label: 'Email send-rate governor unavailable',\n description:\n 'The send-rate governor could not read its counters, so mail is going out unmetered: nothing is holding the shared domains under their hourly ceiling.',\n tier: 'should',\n category: 'deliverability',\n title: 'Email send-rate governor unavailable',\n body:\n 'The send-rate governor could not read its counters ({{error}}), so sends are being allowed unmetered until it can.',\n link: '/admin/emails',\n delivery: 'immediate',\n dedupeWindowMinutes: 6 * 60,\n defaultEnabled: true,\n },\n {\n type: 'deliverability.gatewayBlocking',\n label: 'A recipient gateway is blocking the shared domain',\n description:\n 'A mail gateway is refusing mail from the shared sending domain, so everyone behind that gateway stops receiving it.',\n tier: 'should',\n category: 'deliverability',\n title: '{{gateway}} is blocking {{domain}}',\n body:\n 'Mail from {{domain}} is being refused by {{gateway}} ({{detail}}). Recipients behind that gateway are not receiving it.',\n link: '/admin/emails',\n delivery: 'immediate',\n dedupeWindowMinutes: DAY,\n defaultEnabled: true,\n },\n {\n type: 'deliverability.providerCredentialsRejected',\n label: 'Email provider rejected the credentials',\n description:\n 'The email provider refused the API key, or a sending pool is unhealthy: invites, password resets and receipts are not leaving. The webhook channel is the one that still reaches you.',\n tier: 'should',\n category: 'deliverability',\n title: 'Email delivery is failing: {{problem}}',\n body: '{{detail}}',\n link: '/admin/emails',\n delivery: 'immediate',\n dedupeWindowMinutes: 6 * 60,\n defaultEnabled: true,\n },\n\n // ── SHOULD: operations ──────────────────────────────────────────────────\n {\n type: 'ops.reaperStuck',\n label: 'A reaper is stuck or failing',\n description:\n 'A cleanup job (sending domains, unverified workspaces) could not finish, so what it removes keeps accumulating.',\n tier: 'should',\n category: 'ops',\n title: '{{job}} is stuck',\n body: '{{job}} could not finish: {{detail}}',\n delivery: 'immediate',\n dedupeWindowMinutes: DAY,\n defaultEnabled: true,\n },\n {\n type: 'ops.pluginJobFailed',\n label: 'A plugin job failed',\n description:\n 'A plugin’s scheduled job threw: consent-group changes, the publish outbox, sending-domain provisioning, a plugin cron.',\n tier: 'should',\n category: 'ops',\n title: '{{job}} failed',\n body: 'The scheduled job {{job}} failed: {{error}}',\n delivery: 'immediate',\n dedupeWindowMinutes: 6 * 60,\n defaultEnabled: true,\n },\n {\n type: 'system.pluginVerifierRegression',\n label: 'Plugin verifier regression',\n description:\n 'A live plugin version stopped passing the static verifier.',\n tier: 'should',\n category: 'security',\n title: '{{title}}',\n body: '{{body}}',\n delivery: 'immediate',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n notificationType: 'system.pluginVerifierRegression',\n },\n {\n type: 'system.bandwidthCeilingTripped',\n label: 'Bandwidth ceiling reached',\n description:\n 'A site crossed the per-month bandwidth abuse ceiling.',\n tier: 'should',\n category: 'ops',\n title: '{{title}}',\n body: '{{body}}',\n delivery: 'immediate',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n notificationType: 'system.bandwidthCeilingTripped',\n },\n\n // ── LOW ─────────────────────────────────────────────────────────────────\n {\n type: 'marketplace.review',\n label: 'Plugin listing waiting for review',\n description: 'A plugin listing or version was submitted for review.',\n tier: 'low',\n category: 'security',\n title: '{{title}}',\n body: '{{body}}',\n delivery: 'digest',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n notificationType: 'marketplace.review',\n },\n {\n type: 'system.scopeDrift',\n label: 'Resources missing a sharing scope',\n description:\n 'The weekly sweep found documents invisible to every site-scoped read: a creation path forgot the field.',\n tier: 'low',\n category: 'data',\n title: '{{title}}',\n body: '{{body}}',\n delivery: 'digest',\n dedupeWindowMinutes: 0,\n defaultEnabled: true,\n notificationType: 'system.scopeDrift',\n },\n]\n\n/** An amount in minor units, as an alert prints it: `$12.40`. */\nexport function formatOperatorAlertAmount(\n cents: number,\n currency = 'usd',\n): string {\n const value = Number(cents) / 100\n if (!Number.isFinite(value)) return ''\n try {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: String(currency || 'usd').toUpperCase(),\n }).format(value)\n } catch {\n return `${value.toFixed(2)} ${String(currency).toUpperCase()}`\n }\n}\n\n/** Replaces each `{{token}}` with its context value, or nothing. */\nexport function renderOperatorAlertTemplate(\n template: string,\n context: OperatorAlertContext | undefined,\n): string {\n return String(template ?? '')\n .replace(/\\{\\{\\s*([\\w.]+)\\s*\\}\\}/g, (_match, name: string) => {\n const value = context?.[name]\n return value === null || value === undefined ? '' : String(value)\n })\n .replace(/\\(\\s*\\)/g, '')\n .replace(/[ \\t]{2,}/g, ' ')\n .replace(/ ([.,;:])/g, '$1')\n .trim()\n}\n\n/** A staff member's answer for one type; an absent key keeps the default. */\nexport interface OperatorAlertTypeSetting {\n enabled?: boolean\n delivery?: OperatorAlertDelivery\n}\n\n/** `platformSettings/operatorAlerts`, keyed by alert type. */\nexport interface OperatorAlertSettings {\n types?: Record<string, OperatorAlertTypeSetting>\n}\n\n/** Whether a type is on, and how it is delivered, after staff's answers. */\nexport function effectiveOperatorAlertSetting(\n definition: Pick<OperatorAlertDefinition, 'type' | 'delivery' | 'defaultEnabled'>,\n settings: OperatorAlertSettings | null | undefined,\n): { enabled: boolean; delivery: OperatorAlertDelivery } {\n const answer = settings?.types?.[definition.type]\n return {\n enabled:\n typeof answer?.enabled === 'boolean'\n ? answer.enabled\n : definition.defaultEnabled,\n delivery:\n answer?.delivery === 'immediate' || answer?.delivery === 'digest'\n ? answer.delivery\n : definition.delivery,\n }\n}\n\n/**\n * Staff notification types whose alert emails the operator on a coded\n * default of immediate (AGL-3375), derived from the catalog so there is one\n * list.\n */\nexport const OPERATOR_ALERT_NOTIFICATION_TYPES: ReadonlySet<string> = new Set(\n CORE_OPERATOR_ALERTS.flatMap((definition) =>\n definition.notificationType ? [definition.notificationType] : [],\n ),\n)\n"],"names":["OPERATOR_ALERT_DEFAULT_NOTIFICATION_TYPE","OPERATOR_ALERT_TIER_LABELS","must","should","low","OPERATOR_ALERT_CATEGORY_LABELS","billing","payments","legal","data","ops","deliverability","security","support","DAY","CORE_OPERATOR_ALERTS","type","label","description","tier","category","title","body","link","delivery","dedupeWindowMinutes","defaultEnabled","notificationType","minOccurrences","formatOperatorAlertAmount","cents","currency","value","Number","isFinite","Intl","NumberFormat","style","String","toUpperCase","format","toFixed","renderOperatorAlertTemplate","template","context","replace","_match","name","undefined","trim","effectiveOperatorAlertSetting","definition","settings","answer","types","enabled","OPERATOR_ALERT_NOTIFICATION_TYPES","Set","flatMap"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAsGD,iEAAiE,GACjE,OAAO,MAAMA,2CACX,uBAAsB;AAExB,OAAO,MAAMC,6BAAgE;IAC3EC,MAAM;IACNC,QAAQ;IACRC,KAAK;AACP,EAAC;AAED,OAAO,MAAMC,iCAGT;IACFC,SAAS;IACTC,UAAU;IACVC,OAAO;IACPC,MAAM;IACNC,KAAK;IACLC,gBAAgB;IAChBC,UAAU;IACVC,SAAS;AACX,EAAC;AAED,MAAMC,MAAM,KAAK;AAEjB;;;CAGC,GACD,OAAO,MAAMC,uBAA2D;IACtE,0EAA0E;IAC1E;QACEC,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNC,MAAM;QACNC,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;QAChBC,kBAAkB;IACpB;IACA;QACEX,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNE,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;QAChBC,kBAAkB;IACpB;IACA;QACEX,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNE,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;QAChBC,kBAAkB;IACpB;IACA;QACEX,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNE,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;QAChBC,kBAAkB;IACpB;IAEA,2EAA2E;IAC3E;QACEX,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqB,KAAKX;QAC1BY,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFE,UAAU;QACVC,qBAAqBX;QACrBY,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqB,IAAIX;QACzBY,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqB,IAAI;QACzBG,gBAAgB;QAChBF,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqB,IAAI;QACzBC,gBAAgB;IAClB;IAEA,2EAA2E;IAC3E;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFE,UAAU;QACVC,qBAAqBX;QACrBY,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqBX;QACrBY,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqB,KAAK;QAC1BC,gBAAgB;IAClB;IAEA,2EAA2E;IAC3E;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;IAClB;IAEA,2EAA2E;IAC3E;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNC,MAAM;QACNC,UAAU;QACV,gEAAgE;QAChE,eAAe;QACfC,qBAAqB;QACrBC,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aAAa;QACbC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNC,MAAM;QACNC,UAAU;QACV,gEAAgE;QAChE,eAAe;QACfC,qBAAqB;QACrBC,gBAAgB;IAClB;IAEA,2EAA2E;IAC3E;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqBX;QACrBY,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqB,KAAKX;QAC1BY,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFE,UAAU;QACVC,qBAAqB,KAAKX;QAC1BY,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNE,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;QAChBC,kBAAkB;IACpB;IAEA,2EAA2E;IAC3E;QACEX,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNC,MAAM;QACNC,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;IAClB;IAEA,2EAA2E;IAC3E;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqBX;QACrBY,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aAAa;QACbC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNE,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;QAChBC,kBAAkB;IACpB;IACA;QACEX,MAAM;QACNC,OAAO;QACPC,aAAa;QACbC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNE,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;QAChBC,kBAAkB;IACpB;IAEA,2EAA2E;IAC3E;QACEX,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqB,IAAI;QACzBC,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqB,IAAI;QACzBC,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MACE;QACFC,MAAM;QACNC,UAAU;QACVC,qBAAqBX;QACrBY,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNC,MAAM;QACNC,UAAU;QACVC,qBAAqB,IAAI;QACzBC,gBAAgB;IAClB;IAEA,2EAA2E;IAC3E;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNE,UAAU;QACVC,qBAAqBX;QACrBY,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNE,UAAU;QACVC,qBAAqB,IAAI;QACzBC,gBAAgB;IAClB;IACA;QACEV,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNE,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;QAChBC,kBAAkB;IACpB;IACA;QACEX,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNE,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;QAChBC,kBAAkB;IACpB;IAEA,2EAA2E;IAC3E;QACEX,MAAM;QACNC,OAAO;QACPC,aAAa;QACbC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNE,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;QAChBC,kBAAkB;IACpB;IACA;QACEX,MAAM;QACNC,OAAO;QACPC,aACE;QACFC,MAAM;QACNC,UAAU;QACVC,OAAO;QACPC,MAAM;QACNE,UAAU;QACVC,qBAAqB;QACrBC,gBAAgB;QAChBC,kBAAkB;IACpB;CACD,CAAA;AAED,+DAA+D,GAC/D,OAAO,SAASE,0BACdC,KAAa,EACbC,WAAW,KAAK;IAEhB,MAAMC,QAAQC,OAAOH,SAAS;IAC9B,IAAI,CAACG,OAAOC,QAAQ,CAACF,QAAQ,OAAO;IACpC,IAAI;QACF,OAAO,IAAIG,KAAKC,YAAY,CAAC,SAAS;YACpCC,OAAO;YACPN,UAAUO,OAAOP,YAAY,OAAOQ,WAAW;QACjD,GAAGC,MAAM,CAACR;IACZ,EAAE,eAAM;QACN,OAAO,GAAGA,MAAMS,OAAO,CAAC,GAAG,CAAC,EAAEH,OAAOP,UAAUQ,WAAW,IAAI;IAChE;AACF;AAEA,kEAAkE,GAClE,OAAO,SAASG,4BACdC,QAAgB,EAChBC,OAAyC;IAEzC,OAAON,OAAOK,mBAAAA,WAAY,IACvBE,OAAO,CAAC,2BAA2B,CAACC,QAAQC;QAC3C,MAAMf,QAAQY,2BAAAA,OAAS,CAACG,KAAK;QAC7B,OAAOf,UAAU,QAAQA,UAAUgB,YAAY,KAAKV,OAAON;IAC7D,GACCa,OAAO,CAAC,YAAY,IACpBA,OAAO,CAAC,cAAc,KACtBA,OAAO,CAAC,cAAc,MACtBI,IAAI;AACT;AAaA,0EAA0E,GAC1E,OAAO,SAASC,8BACdC,UAAiF,EACjFC,QAAkD;QAEnCA;IAAf,MAAMC,SAASD,6BAAAA,kBAAAA,SAAUE,KAAK,qBAAfF,eAAiB,CAACD,WAAWnC,IAAI,CAAC;IACjD,OAAO;QACLuC,SACE,QAAOF,0BAAAA,OAAQE,OAAO,MAAK,YACvBF,OAAOE,OAAO,GACdJ,WAAWzB,cAAc;QAC/BF,UACE6B,CAAAA,0BAAAA,OAAQ7B,QAAQ,MAAK,eAAe6B,CAAAA,0BAAAA,OAAQ7B,QAAQ,MAAK,WACrD6B,OAAO7B,QAAQ,GACf2B,WAAW3B,QAAQ;IAC3B;AACF;AAEA;;;;CAIC,GACD,OAAO,MAAMgC,oCAAyD,IAAIC,IACxE1C,qBAAqB2C,OAAO,CAAC,CAACP,aAC5BA,WAAWxB,gBAAgB,GAAG;QAACwB,WAAWxB,gBAAgB;KAAC,GAAG,EAAE,GAEnE"}
|
|
@@ -164,6 +164,10 @@ export declare function screenRoutesAnswerFor(screens: ScreenRouteMap | undefine
|
|
|
164
164
|
* Navigable protocols only. A stored `javascript:`/`data:` href would
|
|
165
165
|
* execute in visitors' browsers, so the guard the linking components each
|
|
166
166
|
* carried is here instead — one copy, one place to harden.
|
|
167
|
+
*
|
|
168
|
+
* `sms:` sits beside `tel:` (AGL-3388): it opens the visitor's messaging app
|
|
169
|
+
* and executes nothing, the same list `safe-url-scheme.ts` keeps. Leaving it
|
|
170
|
+
* out rendered every "Text us" button as a button with no link.
|
|
167
171
|
*/
|
|
168
172
|
export declare const SAFE_HREF_PATTERN: RegExp;
|
|
169
173
|
/** Of those, the ones that actually leave the site (new-tab decisions). */
|
|
@@ -206,8 +206,12 @@
|
|
|
206
206
|
* Navigable protocols only. A stored `javascript:`/`data:` href would
|
|
207
207
|
* execute in visitors' browsers, so the guard the linking components each
|
|
208
208
|
* carried is here instead — one copy, one place to harden.
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
*
|
|
210
|
+
* `sms:` sits beside `tel:` (AGL-3388): it opens the visitor's messaging app
|
|
211
|
+
* and executes nothing, the same list `safe-url-scheme.ts` keeps. Leaving it
|
|
212
|
+
* out rendered every "Text us" button as a button with no link.
|
|
213
|
+
*/ export const SAFE_HREF_PATTERN = /^(https?:\/\/|mailto:|tel:|sms:|\/|#)/i;
|
|
214
|
+
/** Of those, the ones that actually leave the site (new-tab decisions). */ export const EXTERNAL_HREF_PATTERN = /^(https?:\/\/|mailto:|tel:|sms:)/i;
|
|
211
215
|
/**
|
|
212
216
|
* The id a link value jumps to when a fragment is ALL it holds — `#watch`
|
|
213
217
|
* gives `watch` — or `undefined` for any other value (AGL-2867).
|