eutaxy 0.15.1 → 0.16.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/README.md +6 -6
- package/dist/aws.d.mts +2 -2
- package/dist/aws.d.mts.map +1 -1
- package/dist/aws.mjs +53 -79
- package/dist/aws.mjs.map +1 -1
- package/dist/bin.mjs +1 -1
- package/dist/{cli-DT4lxaPK.mjs → cli-DbLlYHTY.mjs} +180 -162
- package/dist/cli-DbLlYHTY.mjs.map +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/cloudflare.d.mts +7 -7
- package/dist/cloudflare.d.mts.map +1 -1
- package/dist/cloudflare.mjs +2 -2
- package/dist/delivery-invariants-90c5xBcd.mjs +44 -0
- package/dist/delivery-invariants-90c5xBcd.mjs.map +1 -0
- package/dist/{delivery-invariants-DzMy3iPs.d.mts → delivery-invariants-B8ZZnCZg.d.mts} +2 -2
- package/dist/{delivery-invariants-DzMy3iPs.d.mts.map → delivery-invariants-B8ZZnCZg.d.mts.map} +1 -1
- package/dist/{explore-B52m-wmk.d.mts → explore-DlwIUowm.d.mts} +2 -2
- package/dist/{explore-B52m-wmk.d.mts.map → explore-DlwIUowm.d.mts.map} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{platform-Ba1Kvdza.d.mts → platform-DPJTjpSr.d.mts} +56 -4
- package/dist/{platform-Ba1Kvdza.d.mts.map → platform-DPJTjpSr.d.mts.map} +1 -1
- package/dist/{src-CPuihHZh.mjs → src-CmHdPsZy.mjs} +1089 -159
- package/dist/src-CmHdPsZy.mjs.map +1 -0
- package/dist/{src-wa0JZa-T.mjs → src-Dz9Wn2vL.mjs} +2 -2
- package/dist/{src-wa0JZa-T.mjs.map → src-Dz9Wn2vL.mjs.map} +1 -1
- package/dist/{workerd-DvhVDnQW.mjs → workerd-D9cUGjYv.mjs} +561 -480
- package/dist/workerd-D9cUGjYv.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/cli-DT4lxaPK.mjs.map +0 -1
- package/dist/delivery-invariants-Dr658H1W.mjs +0 -67
- package/dist/delivery-invariants-Dr658H1W.mjs.map +0 -1
- package/dist/src-CPuihHZh.mjs.map +0 -1
- package/dist/workerd-DvhVDnQW.mjs.map +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { I as getPath } from "./src-CPuihHZh.mjs";
|
|
2
|
-
// packages/core/src/delivery.ts
|
|
3
|
-
/** The invocation one attempt of an event runs as: `<event>#<attempt>`, so a schedule's faults stay keyed when other events are removed. */
|
|
4
|
-
function invocationOf(event) {
|
|
5
|
-
return `${event.id}#${event.attempt}`;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* The next attempt of an event that was not handled (a message not
|
|
9
|
-
* acknowledged or deleted, a request its caller resends, an alarm that
|
|
10
|
-
* failed), or null when it is dropped (dead-lettered, given up on). It is
|
|
11
|
-
* delivered again while both the platform's own limit on redeliveries
|
|
12
|
-
* (Queues' `max_retries`, the caller's `retries`, SQS's `maxReceiveCount`
|
|
13
|
-
* less the first delivery, an alarm's six retries) and the scenario's
|
|
14
|
-
* `maxRedeliveries` leave room; the redeliveries so far are `attempt - 1`.
|
|
15
|
-
* Pure.
|
|
16
|
-
*/
|
|
17
|
-
function redelivery(event, limit, bounds) {
|
|
18
|
-
const redeliveries = event.attempt - 1;
|
|
19
|
-
if (redeliveries >= limit || redeliveries >= bounds.maxRedeliveries) return null;
|
|
20
|
-
return {
|
|
21
|
-
...event,
|
|
22
|
-
attempt: event.attempt + 1
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
// packages/core/src/delivery-invariants.ts
|
|
26
|
-
/**
|
|
27
|
-
* No two selected effects share the value at `key` (a dot path into the effect's payload): nothing
|
|
28
|
-
* happened twice for one key, a payment recorded twice, a message sent twice.
|
|
29
|
-
*/
|
|
30
|
-
function atMostOncePerKey(name, effect, key) {
|
|
31
|
-
return {
|
|
32
|
-
kind: "atMostOncePerKey",
|
|
33
|
-
name,
|
|
34
|
-
effect,
|
|
35
|
-
key
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/** Every value in `expected` appears at least once as `key` in a selected effect: nothing was lost. */
|
|
39
|
-
function atLeastOnce(name, effect, key, expected) {
|
|
40
|
-
return {
|
|
41
|
-
kind: "atLeastOnce",
|
|
42
|
-
name,
|
|
43
|
-
effect,
|
|
44
|
-
key,
|
|
45
|
-
expected
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Every event's `bodyKey` value must appear at least once as `key` in a
|
|
50
|
-
* selected effect. The expected keys are re-derived from the bodies that
|
|
51
|
-
* remain when shrinking removes events.
|
|
52
|
-
*/
|
|
53
|
-
function atLeastOncePerMessage(name, events, effect, key, bodyKey) {
|
|
54
|
-
const expected = [];
|
|
55
|
-
for (const e of events) {
|
|
56
|
-
const v = getPath(e.body, bodyKey);
|
|
57
|
-
if (v === void 0) throw new Error(`event ${e.id} has no ${JSON.stringify(bodyKey)} in its body`);
|
|
58
|
-
expected.push(v);
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
...atLeastOnce(name, effect, key, expected),
|
|
62
|
-
perMessage: { bodyKey }
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
export { redelivery as a, invocationOf as i, atLeastOncePerMessage as n, atMostOncePerKey as r, atLeastOnce as t };
|
|
66
|
-
|
|
67
|
-
//# sourceMappingURL=delivery-invariants-Dr658H1W.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-invariants-Dr658H1W.mjs","names":[],"sources":["../../core/src/delivery.ts","../../core/src/delivery-invariants.ts"],"sourcesContent":["/**\n * The delivery conventions every platform shares, and the differential\n * runner's raw sides with them: how an attempt names its invocation, and\n * the redelivery rule, which applies the same reading of a platform's limit\n * without any of its proxy code.\n */\n\nimport type { EventRef } from \"./platform.ts\";\nimport type { Bounds } from \"./scenario.ts\";\n\n/** The invocation one attempt of an event runs as: `<event>#<attempt>`, so a schedule's faults stay keyed when other events are removed. */\nexport function invocationOf(event: EventRef): string {\n return `${event.id}#${event.attempt}`;\n}\n\n/**\n * The next attempt of an event that was not handled (a message not\n * acknowledged or deleted, a request its caller resends, an alarm that\n * failed), or null when it is dropped (dead-lettered, given up on). It is\n * delivered again while both the platform's own limit on redeliveries\n * (Queues' `max_retries`, the caller's `retries`, SQS's `maxReceiveCount`\n * less the first delivery, an alarm's six retries) and the scenario's\n * `maxRedeliveries` leave room; the redeliveries so far are `attempt - 1`.\n * Pure.\n */\nexport function redelivery(\n event: EventRef,\n limit: number,\n bounds: Pick<Bounds, \"maxRedeliveries\">,\n): EventRef | null {\n const redeliveries = event.attempt - 1;\n if (redeliveries >= limit || redeliveries >= bounds.maxRedeliveries) return null;\n return { ...event, attempt: event.attempt + 1 };\n}\n","/**\n * Constructors for the delivery invariants every platform's scenarios use:\n * nothing delivered twice, nothing lost. Platforms wrap them to take their\n * own drive shapes.\n */\n\nimport type { JsonValue } from \"./canonical-json.ts\";\nimport type { AtLeastOnce, AtMostOncePerKey } from \"./invariants.ts\";\nimport { type EffectSelector, getPath } from \"./selectors.ts\";\n\n/**\n * No two selected effects share the value at `key` (a dot path into the effect's payload): nothing\n * happened twice for one key, a payment recorded twice, a message sent twice.\n */\nexport function atMostOncePerKey(\n name: string,\n effect: EffectSelector,\n key: string,\n): AtMostOncePerKey {\n return { kind: \"atMostOncePerKey\", name, effect, key };\n}\n\n/** Every value in `expected` appears at least once as `key` in a selected effect: nothing was lost. */\nexport function atLeastOnce(\n name: string,\n effect: EffectSelector,\n key: string,\n expected: readonly JsonValue[],\n): AtLeastOnce {\n return { kind: \"atLeastOnce\", name, effect, key, expected };\n}\n\n/**\n * Every event's `bodyKey` value must appear at least once as `key` in a\n * selected effect. The expected keys are re-derived from the bodies that\n * remain when shrinking removes events.\n */\nexport function atLeastOncePerMessage(\n name: string,\n events: readonly { readonly id: string; readonly body: JsonValue }[],\n effect: EffectSelector,\n key: string,\n bodyKey: string,\n): AtLeastOnce {\n const expected: JsonValue[] = [];\n for (const e of events) {\n const v = getPath(e.body, bodyKey);\n if (v === undefined)\n throw new Error(`event ${e.id} has no ${JSON.stringify(bodyKey)} in its body`);\n expected.push(v);\n }\n return { ...atLeastOnce(name, effect, key, expected), perMessage: { bodyKey } };\n}\n"],"mappings":";;;AAWA,SAAgB,aAAa,OAAyB;CACpD,OAAO,GAAG,MAAM,GAAG,GAAG,MAAM;AAC9B;;;;;;;;;;;AAYA,SAAgB,WACd,OACA,OACA,QACiB;CACjB,MAAM,eAAe,MAAM,UAAU;CACrC,IAAI,gBAAgB,SAAS,gBAAgB,OAAO,iBAAiB,OAAO;CAC5E,OAAO;EAAE,GAAG;EAAO,SAAS,MAAM,UAAU;CAAE;AAChD;;;;;;ACnBA,SAAgB,iBACd,MACA,QACA,KACkB;CAClB,OAAO;EAAE,MAAM;EAAoB;EAAM;EAAQ;CAAI;AACvD;;AAGA,SAAgB,YACd,MACA,QACA,KACA,UACa;CACb,OAAO;EAAE,MAAM;EAAe;EAAM;EAAQ;EAAK;CAAS;AAC5D;;;;;;AAOA,SAAgB,sBACd,MACA,QACA,QACA,KACA,SACa;CACb,MAAM,WAAwB,CAAC;CAC/B,KAAK,MAAM,KAAK,QAAQ;EACtB,MAAM,IAAI,QAAQ,EAAE,MAAM,OAAO;EACjC,IAAI,MAAM,KAAA,GACR,MAAM,IAAI,MAAM,SAAS,EAAE,GAAG,UAAU,KAAK,UAAU,OAAO,EAAE,aAAa;EAC/E,SAAS,KAAK,CAAC;CACjB;CACA,OAAO;EAAE,GAAG,YAAY,MAAM,QAAQ,KAAK,QAAQ;EAAG,YAAY,EAAE,QAAQ;CAAE;AAChF"}
|