eutaxy 0.4.0 → 0.5.1
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 +2 -2
- package/dist/aws.d.mts +7 -5
- package/dist/aws.d.mts.map +1 -1
- package/dist/aws.mjs +41 -135
- package/dist/aws.mjs.map +1 -1
- package/dist/bin.mjs +2 -2
- package/dist/checked-CGpA2-F0.d.mts +285 -0
- package/dist/checked-CGpA2-F0.d.mts.map +1 -0
- package/dist/cli-IJrKkeYS.mjs +2 -0
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cloudflare.d.mts +232 -51
- package/dist/cloudflare.d.mts.map +1 -1
- package/dist/cloudflare.mjs +3 -1083
- package/dist/delivery-invariants-BraYqcYN.d.mts +5 -0
- package/dist/delivery-invariants-BraYqcYN.d.mts.map +1 -0
- package/dist/delivery-invariants-Cuxdna28.mjs +39 -0
- package/dist/delivery-invariants-Cuxdna28.mjs.map +1 -0
- package/dist/index.d.mts +66 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +81 -5
- package/dist/index.mjs.map +1 -0
- package/dist/{platform-TwATAkL3.d.mts → platform-DfMwknw1.d.mts} +179 -42
- package/dist/platform-DfMwknw1.d.mts.map +1 -0
- package/dist/src-Bqc9Eyb1.mjs +2655 -0
- package/dist/src-Bqc9Eyb1.mjs.map +1 -0
- package/dist/src-DKb-fkdb.mjs +3399 -0
- package/dist/src-DKb-fkdb.mjs.map +1 -0
- package/dist/src-Dxl9ZlKn.mjs +1752 -0
- package/dist/src-Dxl9ZlKn.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/cli-Dr-Ziogu.mjs +0 -2
- package/dist/cloudflare.mjs.map +0 -1
- package/dist/explore-YVHTRjjS.d.mts +0 -63
- package/dist/explore-YVHTRjjS.d.mts.map +0 -1
- package/dist/platform-TwATAkL3.d.mts.map +0 -1
- package/dist/src-BBXd0WEp.mjs +0 -117
- package/dist/src-BBXd0WEp.mjs.map +0 -1
- package/dist/src-BGdIBGkN.mjs +0 -311
- package/dist/src-BGdIBGkN.mjs.map +0 -1
- package/dist/src-Brt0dfNL.mjs +0 -1286
- package/dist/src-Brt0dfNL.mjs.map +0 -1
- package/dist/src-s6uYyC0B.mjs +0 -89
- package/dist/src-s6uYyC0B.mjs.map +0 -1
- package/dist/verdict-evEM5Gxx.mjs +0 -12
- package/dist/verdict-evEM5Gxx.mjs.map +0 -1
package/dist/aws.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-C1I3wEg2.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { S as canonicalJson, _ as defaultBounds, c as CrashSignal, f as patchGlobals, g as toJson$1, h as patchProperty, i as proxiedSide, m as settleOn, n as DifferentialStuck, p as realTick, r as compareSides, u as installScriptedFetch, v as validateScenario } from "./src-Bqc9Eyb1.mjs";
|
|
3
|
+
import { n as atLeastOncePerMessage$1, r as atMostOncePerKey } from "./delivery-invariants-Cuxdna28.mjs";
|
|
4
4
|
import { $ as booleanSelector, $t as ServiceException, A as BinaryDecisionDiagram, An as isValidHostLabel, B as NODE_REGION_CONFIG_FILE_OPTIONS, C as isIpAddress, Ct as dateToUtcString, Dt as parseRfc7231DateTime, E as EndpointError, En as normalizeProvider$1, Et as parseRfc3339DateTimeWithOffset, F as init_config$1, Fn as hasOwn, G as NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, H as REGION_ENV_NAME, Ht as NoOpLogger, It as fromBase64, Jt as resolveDefaultRuntimeConfig, Kt as getDefaultExtensionConfiguration, L as resolveDefaultsModeConfig, Ln as getSmithyContext, N as resolveParams, Nn as HttpRequest, Nt as toBase64, O as EndpointCache, On as isValidHostname, Ot as expectUnion, P as config_exports, Pt as fromUtf8, Qt as loadConfigsForDefaultMode, Rt as client_exports$1, Sn as parseUrl, Tt as parseEpochTimestamp, U as REGION_INI_NAME, V as NODE_REGION_CONFIG_OPTIONS, Vt as makeBuilder, Wt as getValueFromTextNode, X as loadConfig, Yt as emitWarningIfUnsupportedVersion$1, Z as SelectorType, _ as resolveEndpointConfig, _t as _parseRfc7231DateTime, b as decideEndpoint, bn as init_transport, bt as quoteHeader, c as generateIdempotencyToken, cn as TypeRegistry, ct as NumericValue, d as v4, en as decorateServiceException, ft as splitHeader, g as init_endpoints, gn as deref, gt as _parseRfc3339DateTimeWithOffset, h as getEndpointPlugin, ht as _parseEpochTimestamp, in as Command, jn as HttpResponse, jt as toUtf8, l as init_serde, m as endpoints_exports, mn as getSchemaSerdePlugin, mt as splitEvery, n as init_checksum, nn as createAggregatedClient, on as init_schema, p as sdkStreamMixin, pn as translateTraits, q as NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, r as Sha256Node, rt as calculateBodyLength, s as Uint8ArrayBlobAdapter, sn as schema_exports, t as checksum_exports, tt as ProviderError, u as serde_exports, un as NormalizedSchema, ut as nv, vn as Client$1, w as customEndpointFunctions, wn as parseQueryString, xt as LazyJsonString, y as resolveEndpoint, z as resolveRegionConfig, zn as require_dist_cjs$20, zt as init_client$1 } from "./checksum-DhS6ofSm.mjs";
|
|
5
5
|
import { Readable } from "node:stream";
|
|
6
6
|
import { platform, release } from "node:os";
|
|
@@ -22967,26 +22967,13 @@ var require_dist_cjs$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
22967
22967
|
// packages/aws/src/json.ts
|
|
22968
22968
|
var import_dist_cjs = require_dist_cjs$2();
|
|
22969
22969
|
var import_dist_cjs$1 = require_dist_cjs$1();
|
|
22970
|
-
/**
|
|
22971
|
-
function
|
|
22972
|
-
|
|
22973
|
-
|
|
22974
|
-
|
|
22975
|
-
|
|
22976
|
-
|
|
22977
|
-
case "bigint": return value.toString();
|
|
22978
|
-
case "object": {
|
|
22979
|
-
if (depth > 10) return "<nested>";
|
|
22980
|
-
if (Array.isArray(value)) return value.map((v) => toJson(v, depth + 1));
|
|
22981
|
-
if (value instanceof Uint8Array) return `base64:${Buffer.from(value).toString("base64")}`;
|
|
22982
|
-
if (value instanceof Date) return value.toISOString();
|
|
22983
|
-
if (value instanceof Set) return [...value].map((v) => toJson(v, depth + 1));
|
|
22984
|
-
const out = {};
|
|
22985
|
-
for (const k of Object.keys(value).sort()) out[k] = toJson(value[k], depth + 1);
|
|
22986
|
-
return out;
|
|
22987
|
-
}
|
|
22988
|
-
default: return `<${typeof value}>`;
|
|
22989
|
-
}
|
|
22970
|
+
/** Binary DynamoDB values keep their contents, so two different binary keys stay distinct. */
|
|
22971
|
+
function bytesAsBase64(value) {
|
|
22972
|
+
return value instanceof Uint8Array ? `base64:${Buffer.from(value).toString("base64")}` : void 0;
|
|
22973
|
+
}
|
|
22974
|
+
/** Core's `toJson`, with bytes in base64. */
|
|
22975
|
+
function toJson(value) {
|
|
22976
|
+
return toJson$1(value, bytesAsBase64);
|
|
22990
22977
|
}
|
|
22991
22978
|
// packages/aws/src/sdk.ts
|
|
22992
22979
|
var import_dist_cjs$2 = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -23441,7 +23428,7 @@ function normalizeOp(commandName) {
|
|
|
23441
23428
|
return DOCUMENT_ALIASES[op] ?? op;
|
|
23442
23429
|
}
|
|
23443
23430
|
/** The tables a DynamoDB command touches, including batch and transactional ones. */
|
|
23444
|
-
function tablesOf
|
|
23431
|
+
function tablesOf(op, input) {
|
|
23445
23432
|
if (!input) return [];
|
|
23446
23433
|
const names = /* @__PURE__ */ new Set();
|
|
23447
23434
|
if (typeof input["TableName"] === "string") names.add(input["TableName"]);
|
|
@@ -23461,7 +23448,7 @@ function rawSend(client, command) {
|
|
|
23461
23448
|
/** `DynamoDB:<table>`, or `DynamoDB:<a>+<b>` for a batch or transaction spanning several tables. */
|
|
23462
23449
|
function targetOf(serviceId, op, input) {
|
|
23463
23450
|
if (serviceId === "DynamoDB") {
|
|
23464
|
-
const tables = tablesOf
|
|
23451
|
+
const tables = tablesOf(op, input);
|
|
23465
23452
|
return tables.length > 0 ? `DynamoDB:${tables.join("+")}` : "DynamoDB";
|
|
23466
23453
|
}
|
|
23467
23454
|
const name = input?.["QueueUrl"] ?? input?.["Bucket"] ?? input?.["TopicArn"];
|
|
@@ -23492,8 +23479,6 @@ function summarize(op, result, input) {
|
|
|
23492
23479
|
}
|
|
23493
23480
|
/** Replace `Client.prototype.send` for a run; returns the function that restores it. Safe to call twice. */
|
|
23494
23481
|
function installSdkProxy(options) {
|
|
23495
|
-
const proto = import_dist_cjs$2.Client.prototype;
|
|
23496
|
-
const saved = proto.send;
|
|
23497
23482
|
const patched = async function(command, ...rest) {
|
|
23498
23483
|
const className = this.constructor.name;
|
|
23499
23484
|
const local = options.clients[className];
|
|
@@ -23526,16 +23511,14 @@ function installSdkProxy(options) {
|
|
|
23526
23511
|
};
|
|
23527
23512
|
return options.hooks.effect(point, perform, (r) => summarize(op, r, input));
|
|
23528
23513
|
};
|
|
23529
|
-
|
|
23530
|
-
let restored = false;
|
|
23531
|
-
return () => {
|
|
23532
|
-
if (restored) return;
|
|
23533
|
-
restored = true;
|
|
23534
|
-
proto.send = saved;
|
|
23535
|
-
};
|
|
23514
|
+
return patchProperty(import_dist_cjs$2.Client.prototype, "send", { value: patched });
|
|
23536
23515
|
}
|
|
23537
23516
|
// packages/aws/src/dynamodb.ts
|
|
23538
23517
|
/** DynamoDB table reset and end-of-run snapshots, through the real local client (never effects). */
|
|
23518
|
+
/** The DynamoDB tables a scenario sets up. */
|
|
23519
|
+
function scenarioTables(spec) {
|
|
23520
|
+
return spec.setup.filter((s) => s.kind === "dynamodb-table");
|
|
23521
|
+
}
|
|
23539
23522
|
async function waitActive(client, name) {
|
|
23540
23523
|
for (let i = 0; i < 100; i++) {
|
|
23541
23524
|
if ((await rawSend(client, new import_dist_cjs.DescribeTableCommand({ TableName: name }))).Table?.TableStatus === "ACTIVE") return;
|
|
@@ -23669,19 +23652,6 @@ function createAwsPlatform(options) {
|
|
|
23669
23652
|
let currentInvocation = "";
|
|
23670
23653
|
let hooksRef = null;
|
|
23671
23654
|
let restoreProxy = null;
|
|
23672
|
-
const platformInvocations = /* @__PURE__ */ new WeakMap();
|
|
23673
|
-
function tablesOf(spec) {
|
|
23674
|
-
return spec.setup.filter((s) => s.kind === "dynamodb-table");
|
|
23675
|
-
}
|
|
23676
|
-
function platformInvocation(hooks) {
|
|
23677
|
-
let id = platformInvocations.get(hooks);
|
|
23678
|
-
if (id === void 0) {
|
|
23679
|
-
id = "platform";
|
|
23680
|
-
hooks.startInvocation(id);
|
|
23681
|
-
platformInvocations.set(hooks, id);
|
|
23682
|
-
}
|
|
23683
|
-
return id;
|
|
23684
|
-
}
|
|
23685
23655
|
function ensureProxy(hooks) {
|
|
23686
23656
|
if (hooksRef === hooks && restoreProxy) return;
|
|
23687
23657
|
restoreProxy?.();
|
|
@@ -23697,16 +23667,16 @@ function createAwsPlatform(options) {
|
|
|
23697
23667
|
name: "aws",
|
|
23698
23668
|
assumptions,
|
|
23699
23669
|
async reset(spec) {
|
|
23700
|
-
const tables =
|
|
23670
|
+
const tables = scenarioTables(spec);
|
|
23701
23671
|
if (tables.length === 0) return;
|
|
23702
23672
|
if (!dynamo) throw new Error("the scenario sets up DynamoDB tables but no DynamoDBClient was given in clients");
|
|
23703
23673
|
await resetTables(dynamo, tables);
|
|
23704
23674
|
},
|
|
23705
23675
|
async finish(spec, hooks) {
|
|
23706
|
-
const tables =
|
|
23676
|
+
const tables = scenarioTables(spec);
|
|
23707
23677
|
if (tables.length === 0 || !dynamo) return;
|
|
23708
23678
|
const snapshot = await snapshotTables(dynamo, tables);
|
|
23709
|
-
hooks.snapshot(
|
|
23679
|
+
hooks.snapshot(hooks.bookkeeping(), "DynamoDB", { tables: snapshot });
|
|
23710
23680
|
},
|
|
23711
23681
|
async cleanup() {
|
|
23712
23682
|
restoreProxy?.();
|
|
@@ -23782,7 +23752,7 @@ function createAwsPlatform(options) {
|
|
|
23782
23752
|
attempt: event.attempt + 1
|
|
23783
23753
|
});
|
|
23784
23754
|
else hooks.effectSync({
|
|
23785
|
-
invocation:
|
|
23755
|
+
invocation: hooks.bookkeeping(),
|
|
23786
23756
|
target: queueTarget,
|
|
23787
23757
|
op: "dead_letter",
|
|
23788
23758
|
args: {
|
|
@@ -23801,64 +23771,24 @@ function createAwsPlatform(options) {
|
|
|
23801
23771
|
};
|
|
23802
23772
|
}
|
|
23803
23773
|
// packages/aws/src/differential.ts
|
|
23804
|
-
/** The raw side cannot abandon an invocation the way the engine does; a stuck handler ends the comparison. */
|
|
23805
|
-
var StuckError = class extends Error {
|
|
23806
|
-
name = "StuckError";
|
|
23807
|
-
constructor() {
|
|
23808
|
-
super("raw side: the handler is waiting on something outside the run (no SDK call in flight, no timer due)");
|
|
23809
|
-
}
|
|
23810
|
-
};
|
|
23811
|
-
function tablesOf(spec) {
|
|
23812
|
-
return spec.setup.filter((s) => s.kind === "dynamodb-table");
|
|
23813
|
-
}
|
|
23814
23774
|
async function eutaxySide(spec, options) {
|
|
23815
|
-
const
|
|
23816
|
-
|
|
23817
|
-
|
|
23818
|
-
|
|
23819
|
-
|
|
23820
|
-
|
|
23821
|
-
},
|
|
23822
|
-
bounds: spec.bounds,
|
|
23823
|
-
faultProbability: 0
|
|
23824
|
-
});
|
|
23825
|
-
const attempts = [];
|
|
23826
|
-
await platform.reset(spec);
|
|
23827
|
-
run.install(spec.externals);
|
|
23828
|
-
try {
|
|
23829
|
-
try {
|
|
23830
|
-
const pending = [...platform.initialEvents(spec)];
|
|
23831
|
-
while (pending.length > 0) {
|
|
23832
|
-
const event = pending.shift();
|
|
23833
|
-
const before = run.log.entries.length;
|
|
23834
|
-
const result = await platform.deliver(event, run, spec);
|
|
23835
|
-
const deleted = run.log.entries.slice(before).some((e) => e.kind === "result" && e.op === "delete");
|
|
23836
|
-
attempts.push({
|
|
23837
|
-
event: event.id,
|
|
23838
|
-
attempt: event.attempt,
|
|
23839
|
-
status: result.status === "completed" ? "completed" : "errored",
|
|
23840
|
-
deleted
|
|
23841
|
-
});
|
|
23842
|
-
pending.push(...result.followUps);
|
|
23843
|
-
}
|
|
23844
|
-
} finally {
|
|
23845
|
-
run.uninstall();
|
|
23846
|
-
}
|
|
23847
|
-
await platform.finish?.(spec, run);
|
|
23848
|
-
} finally {
|
|
23849
|
-
await platform.cleanup?.(spec);
|
|
23850
|
-
}
|
|
23775
|
+
const { attempts, unsupported } = await proxiedSide(spec, createAwsPlatform(options), (event, result, entries) => ({
|
|
23776
|
+
event: event.id,
|
|
23777
|
+
attempt: event.attempt,
|
|
23778
|
+
status: result.status === "completed" ? "completed" : "errored",
|
|
23779
|
+
deleted: entries.some((e) => e.kind === "result" && e.op === "delete")
|
|
23780
|
+
}));
|
|
23851
23781
|
const dynamo = options.clients["DynamoDBClient"];
|
|
23852
23782
|
return {
|
|
23853
23783
|
attempts,
|
|
23854
|
-
tables: dynamo ? await snapshotTables(dynamo,
|
|
23855
|
-
unsupported
|
|
23784
|
+
tables: dynamo ? await snapshotTables(dynamo, scenarioTables(spec)) : {},
|
|
23785
|
+
unsupported
|
|
23856
23786
|
};
|
|
23857
23787
|
}
|
|
23858
23788
|
async function rawSide(spec, options) {
|
|
23859
23789
|
const drive = spec.drive;
|
|
23860
23790
|
const dynamo = options.clients["DynamoDBClient"];
|
|
23861
|
-
if (dynamo) await resetTables(dynamo,
|
|
23791
|
+
if (dynamo) await resetTables(dynamo, scenarioTables(spec));
|
|
23862
23792
|
const patched = patchGlobals(0);
|
|
23863
23793
|
const reasons = [];
|
|
23864
23794
|
const restoreFetch = installScriptedFetch(spec.externals, null, (r) => reasons.push(r), () => patched.clock.advance(1));
|
|
@@ -23901,12 +23831,12 @@ async function rawSide(spec, options) {
|
|
|
23901
23831
|
inFlight: () => io.n,
|
|
23902
23832
|
crashed: () => false,
|
|
23903
23833
|
stuck: () => {
|
|
23904
|
-
throw new
|
|
23834
|
+
throw new DifferentialStuck();
|
|
23905
23835
|
}
|
|
23906
23836
|
});
|
|
23907
23837
|
status = "completed";
|
|
23908
23838
|
} catch (err) {
|
|
23909
|
-
if (err instanceof
|
|
23839
|
+
if (err instanceof DifferentialStuck) throw err;
|
|
23910
23840
|
status = "errored";
|
|
23911
23841
|
}
|
|
23912
23842
|
const failed = batchFailed(response, event.id, [event.id]);
|
|
@@ -23930,23 +23860,19 @@ async function rawSide(spec, options) {
|
|
|
23930
23860
|
if (reasons.length > 0) throw new Error(`raw side: ${reasons.join("; ")}`);
|
|
23931
23861
|
return {
|
|
23932
23862
|
attempts,
|
|
23933
|
-
tables: dynamo ? await snapshotTables(dynamo,
|
|
23863
|
+
tables: dynamo ? await snapshotTables(dynamo, scenarioTables(spec)) : {}
|
|
23934
23864
|
};
|
|
23935
23865
|
}
|
|
23936
23866
|
async function runAwsDifferential(spec, options) {
|
|
23937
23867
|
const { unsupported, ...eutaxy } = await eutaxySide(spec, options);
|
|
23938
23868
|
const raw = await rawSide(spec, options);
|
|
23939
|
-
const differences =
|
|
23940
|
-
|
|
23941
|
-
|
|
23942
|
-
|
|
23943
|
-
|
|
23944
|
-
|
|
23945
|
-
|
|
23946
|
-
const x = canonicalJson(eutaxy.tables[t] ?? []);
|
|
23947
|
-
const y = canonicalJson(raw.tables[t] ?? []);
|
|
23948
|
-
if (x !== y) differences.push(`${t} differs:\n eutaxy ${x}\n raw ${y}`);
|
|
23949
|
-
}
|
|
23869
|
+
const differences = compareSides({
|
|
23870
|
+
attempts: eutaxy.attempts,
|
|
23871
|
+
state: eutaxy.tables
|
|
23872
|
+
}, {
|
|
23873
|
+
attempts: raw.attempts,
|
|
23874
|
+
state: raw.tables
|
|
23875
|
+
}, unsupported);
|
|
23950
23876
|
return {
|
|
23951
23877
|
equal: differences.length === 0,
|
|
23952
23878
|
eutaxy,
|
|
@@ -24008,29 +23934,9 @@ function sqsDelete(queue) {
|
|
|
24008
23934
|
kind: "result"
|
|
24009
23935
|
};
|
|
24010
23936
|
}
|
|
24011
|
-
|
|
24012
|
-
return {
|
|
24013
|
-
kind: "atMostOncePerKey",
|
|
24014
|
-
name,
|
|
24015
|
-
effect,
|
|
24016
|
-
key
|
|
24017
|
-
};
|
|
24018
|
-
}
|
|
23937
|
+
/** Every message's `bodyKey` value must appear at least once as `key` in a selected effect. */
|
|
24019
23938
|
function atLeastOncePerMessage(name, drive, effect, key, bodyKey) {
|
|
24020
|
-
|
|
24021
|
-
for (const m of drive.messages) {
|
|
24022
|
-
const v = getPath(m.body, bodyKey);
|
|
24023
|
-
if (v === void 0) throw new Error(`message ${m.id} has no ${JSON.stringify(bodyKey)} in its body`);
|
|
24024
|
-
expected.push(v);
|
|
24025
|
-
}
|
|
24026
|
-
return {
|
|
24027
|
-
kind: "atLeastOnce",
|
|
24028
|
-
name,
|
|
24029
|
-
effect,
|
|
24030
|
-
key,
|
|
24031
|
-
expected,
|
|
24032
|
-
perMessage: { bodyKey }
|
|
24033
|
-
};
|
|
23939
|
+
return atLeastOncePerMessage$1(name, drive.messages, effect, key, bodyKey);
|
|
24034
23940
|
}
|
|
24035
23941
|
/** Build and validate a scenario spec for the AWS platform; throws with every problem listed. */
|
|
24036
23942
|
function defineAwsScenario(input) {
|