@aglyn/aglyn 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +11 -11
- package/src/lib/app-utils/business-details.d.ts +93 -0
- package/src/lib/app-utils/business-details.js +145 -0
- package/src/lib/app-utils/business-details.js.map +1 -0
- package/src/lib/app-utils/business-profile.d.ts +20 -3
- package/src/lib/app-utils/business-profile.js +31 -7
- package/src/lib/app-utils/business-profile.js.map +1 -1
- package/src/lib/app-utils/content-authors.d.ts +2 -0
- package/src/lib/app-utils/content-authors.js.map +1 -1
- package/src/lib/app-utils/docs-help-sections.generated.js +0 -1
- package/src/lib/app-utils/docs-help-sections.generated.js.map +1 -1
- package/src/lib/app-utils/docs-help.generated.js +0 -1
- package/src/lib/app-utils/docs-help.generated.js.map +1 -1
- package/src/lib/app-utils/docs-index.generated.js +15 -15
- package/src/lib/app-utils/docs-index.generated.js.map +1 -1
- package/src/lib/app-utils/health-report.d.ts +39 -0
- package/src/lib/app-utils/health-report.js +41 -0
- package/src/lib/app-utils/health-report.js.map +1 -1
- package/src/lib/app-utils/host-tokens.d.ts +53 -11
- package/src/lib/app-utils/host-tokens.js +173 -18
- package/src/lib/app-utils/host-tokens.js.map +1 -1
- package/src/lib/app-utils/site-email-chrome.js +3 -0
- package/src/lib/app-utils/site-email-chrome.js.map +1 -1
- package/src/lib/app-utils/site-entity-json-ld.js +17 -2
- package/src/lib/app-utils/site-entity-json-ld.js.map +1 -1
- package/src/lib/app-utils/weekly-summary.d.ts +15 -4
- package/src/lib/app-utils/weekly-summary.js +76 -21
- package/src/lib/app-utils/weekly-summary.js.map +1 -1
- package/src/lib/plugin-manager/plugin-figures.d.ts +22 -2
- package/src/lib/plugin-manager/plugin-figures.js +5 -0
- package/src/lib/plugin-manager/plugin-figures.js.map +1 -1
|
@@ -1279,6 +1279,45 @@ export declare const WEBHOOK_FAILURE_WINDOW_MINUTES = 60;
|
|
|
1279
1279
|
* retries on its own, so a failure visible here is not one unlucky packet.
|
|
1280
1280
|
*/
|
|
1281
1281
|
export declare const MAX_FAILED_DELIVERIES_PER_WINDOW = 0;
|
|
1282
|
+
/**
|
|
1283
|
+
* How long a new event can sit on Stripe's undelivered list before it can
|
|
1284
|
+
* count at all (AGL-4133).
|
|
1285
|
+
*
|
|
1286
|
+
* `delivery_success=false` returns events "still pending" as well as events
|
|
1287
|
+
* that failed, so every event starts its life on that list. This is the time
|
|
1288
|
+
* a first attempt gets to land, because a probe memoized for minutes must not
|
|
1289
|
+
* hold that instant as a red.
|
|
1290
|
+
*/
|
|
1291
|
+
export declare const WEBHOOK_EVENT_IN_FLIGHT_MS: number;
|
|
1292
|
+
/**
|
|
1293
|
+
* How long a clean claim outranks Stripe's undelivered list (AGL-4133).
|
|
1294
|
+
*
|
|
1295
|
+
* The list lags the deliveries. On 2026-11-03 one new subscription produced
|
|
1296
|
+
* seven events, all seven answered 200 on the first attempt inside five
|
|
1297
|
+
* seconds, and Stripe went on listing one of them with `pending_webhooks: 1`
|
|
1298
|
+
* for about eight minutes before it cleared with no second POST. That read
|
|
1299
|
+
* `deliveries-failing` on a window with no failure in it.
|
|
1300
|
+
*
|
|
1301
|
+
* A claim says the handler STARTED, though, and a function killed mid-dispatch
|
|
1302
|
+
* leaves one behind, so it cannot vouch forever. Eight minutes is a lag; half
|
|
1303
|
+
* an hour is a delivery Stripe never got an answer to, and past this the list
|
|
1304
|
+
* is believed again.
|
|
1305
|
+
*/
|
|
1306
|
+
export declare const WEBHOOK_CLAIM_VOUCHES_FOR_MS: number;
|
|
1307
|
+
/**
|
|
1308
|
+
* How many events on Stripe's `delivery_success=false` list really went
|
|
1309
|
+
* undelivered (AGL-4133).
|
|
1310
|
+
*
|
|
1311
|
+
* `claimed` is the events our handler took and did not fail on. Every real
|
|
1312
|
+
* failure stays out of it by construction: a rejected delivery returns 400
|
|
1313
|
+
* before it claims, an early throw deletes its claim, and a half-applied
|
|
1314
|
+
* dispatch holds its claim with `failedAfterEffects` set. An event with no
|
|
1315
|
+
* `created` counts, because an unreadable fact must not read as calm.
|
|
1316
|
+
*/
|
|
1317
|
+
export declare function countUndeliveredEvents(listed: ReadonlyArray<{
|
|
1318
|
+
id?: string;
|
|
1319
|
+
created?: number;
|
|
1320
|
+
}>, claimed: ReadonlySet<string>, nowMs: number): number;
|
|
1282
1321
|
/**
|
|
1283
1322
|
* Inert deliveries tolerated in the window (AGL-1954).
|
|
1284
1323
|
*
|
|
@@ -1046,6 +1046,47 @@ export function renderHealth(outcome, host, ms) {
|
|
|
1046
1046
|
* "Stripe tried to tell us something about money and could not". Stripe
|
|
1047
1047
|
* retries on its own, so a failure visible here is not one unlucky packet.
|
|
1048
1048
|
*/ export const MAX_FAILED_DELIVERIES_PER_WINDOW = 0;
|
|
1049
|
+
/**
|
|
1050
|
+
* How long a new event can sit on Stripe's undelivered list before it can
|
|
1051
|
+
* count at all (AGL-4133).
|
|
1052
|
+
*
|
|
1053
|
+
* `delivery_success=false` returns events "still pending" as well as events
|
|
1054
|
+
* that failed, so every event starts its life on that list. This is the time
|
|
1055
|
+
* a first attempt gets to land, because a probe memoized for minutes must not
|
|
1056
|
+
* hold that instant as a red.
|
|
1057
|
+
*/ export const WEBHOOK_EVENT_IN_FLIGHT_MS = 2 * 60000;
|
|
1058
|
+
/**
|
|
1059
|
+
* How long a clean claim outranks Stripe's undelivered list (AGL-4133).
|
|
1060
|
+
*
|
|
1061
|
+
* The list lags the deliveries. On 2026-11-03 one new subscription produced
|
|
1062
|
+
* seven events, all seven answered 200 on the first attempt inside five
|
|
1063
|
+
* seconds, and Stripe went on listing one of them with `pending_webhooks: 1`
|
|
1064
|
+
* for about eight minutes before it cleared with no second POST. That read
|
|
1065
|
+
* `deliveries-failing` on a window with no failure in it.
|
|
1066
|
+
*
|
|
1067
|
+
* A claim says the handler STARTED, though, and a function killed mid-dispatch
|
|
1068
|
+
* leaves one behind, so it cannot vouch forever. Eight minutes is a lag; half
|
|
1069
|
+
* an hour is a delivery Stripe never got an answer to, and past this the list
|
|
1070
|
+
* is believed again.
|
|
1071
|
+
*/ export const WEBHOOK_CLAIM_VOUCHES_FOR_MS = 30 * 60000;
|
|
1072
|
+
/**
|
|
1073
|
+
* How many events on Stripe's `delivery_success=false` list really went
|
|
1074
|
+
* undelivered (AGL-4133).
|
|
1075
|
+
*
|
|
1076
|
+
* `claimed` is the events our handler took and did not fail on. Every real
|
|
1077
|
+
* failure stays out of it by construction: a rejected delivery returns 400
|
|
1078
|
+
* before it claims, an early throw deletes its claim, and a half-applied
|
|
1079
|
+
* dispatch holds its claim with `failedAfterEffects` set. An event with no
|
|
1080
|
+
* `created` counts, because an unreadable fact must not read as calm.
|
|
1081
|
+
*/ export function countUndeliveredEvents(listed, claimed, nowMs) {
|
|
1082
|
+
return listed.filter((event)=>{
|
|
1083
|
+
var _event_created;
|
|
1084
|
+
const ageMs = nowMs - ((_event_created = event.created) != null ? _event_created : 0) * 1000;
|
|
1085
|
+
if (ageMs < WEBHOOK_EVENT_IN_FLIGHT_MS) return false;
|
|
1086
|
+
const vouched = ageMs < WEBHOOK_CLAIM_VOUCHES_FOR_MS && claimed.has(String(event.id));
|
|
1087
|
+
return !vouched;
|
|
1088
|
+
}).length;
|
|
1089
|
+
}
|
|
1049
1090
|
/**
|
|
1050
1091
|
* Inert deliveries tolerated in the window (AGL-1954).
|
|
1051
1092
|
*
|