@oomol-lab/open-flow 0.1.0-alpha.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/LICENSE +201 -0
- package/NOTICE +47 -0
- package/README.md +18 -0
- package/dist/browser/_virtual_open-flow-twemoji-DJwKsM_w.js +5067 -0
- package/dist/browser/addNodeOptions-DqoIueCR.js +33746 -0
- package/dist/browser/assets/font-00b26ac825e20950.woff2 +0 -0
- package/dist/browser/assets/font-036d4e95149b69ff.woff2 +0 -0
- package/dist/browser/assets/font-07d8e303ce4fc12b.ttf +0 -0
- package/dist/browser/assets/font-08ce98e51b04d589.ttf +0 -0
- package/dist/browser/assets/font-0cdd387c9590a1a9.woff2 +0 -0
- package/dist/browser/assets/font-0d85ae7cc30f2379.ttf +0 -0
- package/dist/browser/assets/font-0f60d1b897938ec9.woff2 +0 -0
- package/dist/browser/assets/font-11e4dc8a6471ff6d.woff +0 -0
- package/dist/browser/assets/font-138ac28d1663b303.ttf +0 -0
- package/dist/browser/assets/font-1ae6bd7475590e97.woff +0 -0
- package/dist/browser/assets/font-1c67f068fea8bb09.ttf +0 -0
- package/dist/browser/assets/font-1e6f9579e90e2cac.ttf +0 -0
- package/dist/browser/assets/font-1ece03f79f95277d.ttf +0 -0
- package/dist/browser/assets/font-2014c523c3210bcc.woff +0 -0
- package/dist/browser/assets/font-30da91e84c893f87.woff +0 -0
- package/dist/browser/assets/font-3398dd02302557a7.woff +0 -0
- package/dist/browser/assets/font-3931dd81faed86ba.ttf +0 -0
- package/dist/browser/assets/font-500e04d54f0d5166.ttf +0 -0
- package/dist/browser/assets/font-51814d270d06ff02.woff2 +0 -0
- package/dist/browser/assets/font-5d53e70ad607c235.woff2 +0 -0
- package/dist/browser/assets/font-5e28753be717dac9.woff +0 -0
- package/dist/browser/assets/font-68534840bcfdd2bf.ttf +0 -0
- package/dist/browser/assets/font-68e8c73ef42afd3c.woff2 +0 -0
- package/dist/browser/assets/font-6ab6b62e9b62dae2.woff +0 -0
- package/dist/browser/assets/font-6b47c40166b6dbe2.woff2 +0 -0
- package/dist/browser/assets/font-70ee1f64a20f2048.ttf +0 -0
- package/dist/browser/assets/font-71d517d67827787c.woff2 +0 -0
- package/dist/browser/assets/font-73d591271b160496.woff2 +0 -0
- package/dist/browser/assets/font-74444efd593c005e.woff2 +0 -0
- package/dist/browser/assets/font-7af58c5ec8f132a2.woff2 +0 -0
- package/dist/browser/assets/font-850c0af5c2238497.woff +0 -0
- package/dist/browser/assets/font-8a8d244581371912.woff +0 -0
- package/dist/browser/assets/font-9163df9c7122432e.ttf +0 -0
- package/dist/browser/assets/font-91ee67500cc0129a.woff +0 -0
- package/dist/browser/assets/font-95b6d2f1a50173bf.ttf +0 -0
- package/dist/browser/assets/font-97479ca6cce906ab.woff2 +0 -0
- package/dist/browser/assets/font-99cd42a3c072d918.woff2 +0 -0
- package/dist/browser/assets/font-99f9c6750b489c94.woff +0 -0
- package/dist/browser/assets/font-9be7ceb88004ab8a.woff +0 -0
- package/dist/browser/assets/font-a4af7d414440a1c1.woff2 +0 -0
- package/dist/browser/assets/font-a6b2099fb555c60e.ttf +0 -0
- package/dist/browser/assets/font-a6f7ec0d846ac7ad.woff +0 -0
- package/dist/browser/assets/font-c2342cd8b869e017.woff2 +0 -0
- package/dist/browser/assets/font-c6368d87e8a1a3a5.woff +0 -0
- package/dist/browser/assets/font-c647367d1dd4e162.ttf +0 -0
- package/dist/browser/assets/font-c76c5d696297d51b.woff +0 -0
- package/dist/browser/assets/font-c943cc986384f59e.woff +0 -0
- package/dist/browser/assets/font-d0332f52868370fd.ttf +0 -0
- package/dist/browser/assets/font-d04c54219f9eaec6.woff2 +0 -0
- package/dist/browser/assets/font-d96cdf2b3bdd4d64.woff +0 -0
- package/dist/browser/assets/font-dc47344dbb6cb5b6.woff2 +0 -0
- package/dist/browser/assets/font-de7701e42cf1f4cf.woff2 +0 -0
- package/dist/browser/assets/font-e14fed02b1aba7ce.woff +0 -0
- package/dist/browser/assets/font-e99ae51144bf1232.woff2 +0 -0
- package/dist/browser/assets/font-ece03cfd83e22c21.woff +0 -0
- package/dist/browser/assets/font-ed0b74372feefcbb.ttf +0 -0
- package/dist/browser/assets/font-f01f3e87d9c6a61c.ttf +0 -0
- package/dist/browser/assets/font-f1d6ef86f3b11a52.woff +0 -0
- package/dist/browser/assets/font-f36ea897e19f4a2e.ttf +0 -0
- package/dist/browser/assets/font-f9377ab0271cda59.ttf +0 -0
- package/dist/browser/carbon-nMY84Amv.js +53 -0
- package/dist/browser/composite-7VwgfnXx.js +6088 -0
- package/dist/browser/createResourceDialog-ByuJWdSL.js +439 -0
- package/dist/browser/dist-7oZK9QXZ.js +50088 -0
- package/dist/browser/dist-B9OV3YTx.js +881 -0
- package/dist/browser/dist-BLk5M0uK.js +1816 -0
- package/dist/browser/dist-BbyiRq3c.js +3285 -0
- package/dist/browser/dist-CIq6ue3I.js +6646 -0
- package/dist/browser/dist-CLZJNoWB.js +89 -0
- package/dist/browser/dist-CvcmLAMW.js +1620 -0
- package/dist/browser/dist-DL0SDskM.js +2327 -0
- package/dist/browser/dist-Djd02JSy.js +1247 -0
- package/dist/browser/dist-aWSZx4q1.js +850 -0
- package/dist/browser/dist-n-z5HtaO.js +4 -0
- package/dist/browser/dist-o4dBuwiG.js +320 -0
- package/dist/browser/dist-zyY--HOV.js +1543 -0
- package/dist/browser/esm-DXw7EADW.js +218 -0
- package/dist/browser/favicon.svg +7 -0
- package/dist/browser/flowWorkspace-DwVMpcar.js +22092 -0
- package/dist/browser/lib-S4ccuMeT.js +7857 -0
- package/dist/browser/licenses.md +4973 -0
- package/dist/browser/markdownContent-ZZFfSRqO.js +44545 -0
- package/dist/browser/project-change.d.ts +311 -0
- package/dist/browser/project-change.js +259 -0
- package/dist/browser/project-notifications.d.ts +12 -0
- package/dist/browser/rolldown-runtime-CEFd7nDs.js +30 -0
- package/dist/browser/workbench-contract.d.ts +28 -0
- package/dist/browser/workbench.css +2 -0
- package/dist/browser/workbench.css.d.ts +1 -0
- package/dist/browser/workbench.d.ts +14 -0
- package/dist/browser/workbench.js +3364 -0
- package/dist/common/connector-action.d.ts +20 -0
- package/dist/common/connector-action.js +106 -0
- package/dist/common/connector-proxy.d.ts +14 -0
- package/dist/common/connector-proxy.js +0 -0
- package/dist/common/control-api-conformance.d.ts +13 -0
- package/dist/common/control-api-conformance.js +518 -0
- package/dist/common/control-api-errors.d.ts +121 -0
- package/dist/common/control-api.d.ts +349 -0
- package/dist/common/control-api.js +884 -0
- package/dist/common/cron-trigger.d.ts +21 -0
- package/dist/common/cron-trigger.js +834 -0
- package/dist/common/engine-contract.d.ts +7 -0
- package/dist/common/favicon.svg +7 -0
- package/dist/common/integration-trigger.d.ts +111 -0
- package/dist/common/integration-trigger.js +290 -0
- package/dist/common/licenses.md +27 -0
- package/dist/common/poll-trigger.d.ts +69 -0
- package/dist/common/poll-trigger.js +155 -0
- package/dist/common/project-encoding.d.ts +11 -0
- package/dist/common/project-encoding.js +242 -0
- package/dist/common/project-notifications.d.ts +12 -0
- package/dist/common/project-semantics.d.ts +55 -0
- package/dist/common/project-semantics.js +8687 -0
- package/dist/common/provider-triggers.d.ts +6 -0
- package/dist/common/provider-triggers.js +4614 -0
- package/dist/common/run-events.d.ts +9 -0
- package/dist/common/run-events.js +192 -0
- package/dist/common/run-lifecycle.d.ts +69 -0
- package/dist/common/run-lifecycle.js +169 -0
- package/dist/common/runtime-contract.d.ts +53 -0
- package/dist/common/runtime-contract.js +151 -0
- package/dist/common/scheduler.d.ts +99 -0
- package/dist/common/scheduler.js +379 -0
- package/dist/common/webhook-trigger.d.ts +22 -0
- package/dist/common/webhook-trigger.js +270 -0
- package/dist/index.d.ts +66 -0
- package/package.json +102 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface EngineContract {
|
|
2
|
+
readonly platformExports: ReadonlySet<string>;
|
|
3
|
+
readonly platformModule: string;
|
|
4
|
+
readonly platformSource: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const currentEngineContract = "open-flow-engine/v1";
|
|
7
|
+
export declare function findEngineContract(contract: string): EngineContract | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
|
2
|
+
<style>
|
|
3
|
+
path { fill: #24292f; }
|
|
4
|
+
@media (prefers-color-scheme: dark) { path { fill: #f0f3f6; } }
|
|
5
|
+
</style>
|
|
6
|
+
<path d="M9.5 8h10.6a5 5 0 1 0 0-2H9.5a5.5 5.5 0 0 0 0 11h11a3.5 3.5 0 0 1 0 7h-8.6a5 5 0 1 0 0 2h8.6a5.5 5.5 0 0 0 0-11h-11a3.5 3.5 0 0 1 0-7zM25 4a3 3 0 1 1-3 3 3 3 0 0 1 3-3zM7 28a3 3 0 1 1 3-3 3 3 0 0 1-3 3z" />
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { ConnectorProxy } from './connector-proxy.js';
|
|
2
|
+
import type { IntegrationEndpointMethod, JsonValue, TriggerKeySnapshot } from '../browser/project-change.js';
|
|
3
|
+
export declare const maximumIntegrationBodyBytes: number;
|
|
4
|
+
export declare const maximumIntegrationDeliveryPages = 5;
|
|
5
|
+
export type IntegrationReceiveResult = {
|
|
6
|
+
readonly checkpoint?: JsonValue;
|
|
7
|
+
readonly continue?: boolean;
|
|
8
|
+
readonly dedupeKey?: string;
|
|
9
|
+
readonly outcome: 'event';
|
|
10
|
+
readonly payload: Readonly<Record<string, JsonValue>>;
|
|
11
|
+
} | {
|
|
12
|
+
readonly checkpoint?: JsonValue;
|
|
13
|
+
readonly continue?: boolean;
|
|
14
|
+
readonly outcome: 'ignored';
|
|
15
|
+
readonly reason: string;
|
|
16
|
+
} | {
|
|
17
|
+
readonly body: string;
|
|
18
|
+
readonly contentType: string;
|
|
19
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
20
|
+
readonly outcome: 'respond';
|
|
21
|
+
readonly status: number;
|
|
22
|
+
};
|
|
23
|
+
export interface IntegrationStateContext {
|
|
24
|
+
readonly checkpoint: JsonValue;
|
|
25
|
+
readonly subscription: Readonly<Record<string, JsonValue>>;
|
|
26
|
+
readonly saveCheckpoint: (checkpoint: JsonValue) => Promise<void>;
|
|
27
|
+
readonly saveSubscription: (subscription: Readonly<Record<string, JsonValue>>, reconcileAt: Date) => Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export interface IntegrationReceiveContext {
|
|
30
|
+
readonly admit: boolean;
|
|
31
|
+
readonly allow?: () => Promise<boolean>;
|
|
32
|
+
readonly bindingId: string;
|
|
33
|
+
readonly callbackSecret: string;
|
|
34
|
+
readonly config: Readonly<Record<string, JsonValue>>;
|
|
35
|
+
readonly connector: ConnectorProxy;
|
|
36
|
+
readonly current: boolean;
|
|
37
|
+
readonly header: (name: string) => string | undefined;
|
|
38
|
+
readonly method: IntegrationEndpointMethod;
|
|
39
|
+
readonly now: Date;
|
|
40
|
+
readonly payload: JsonValue;
|
|
41
|
+
readonly query: (name: string) => string | undefined;
|
|
42
|
+
readonly state?: IntegrationStateContext;
|
|
43
|
+
}
|
|
44
|
+
export interface IntegrationReconcileContext {
|
|
45
|
+
readonly active: boolean;
|
|
46
|
+
readonly callbackSecret: string;
|
|
47
|
+
readonly config: Readonly<Record<string, JsonValue>>;
|
|
48
|
+
readonly connector: ConnectorProxy;
|
|
49
|
+
readonly endpointUrl: string;
|
|
50
|
+
readonly now: Date;
|
|
51
|
+
readonly signal?: AbortSignal;
|
|
52
|
+
readonly state?: IntegrationStateContext;
|
|
53
|
+
}
|
|
54
|
+
export interface IntegrationReconcileResult {
|
|
55
|
+
readonly outcome: 'pending' | 'ready';
|
|
56
|
+
}
|
|
57
|
+
export interface IntegrationDefinition {
|
|
58
|
+
readonly initialState?: {
|
|
59
|
+
readonly checkpoint: JsonValue;
|
|
60
|
+
readonly subscription: Readonly<Record<string, JsonValue>>;
|
|
61
|
+
};
|
|
62
|
+
readonly receive: (context: IntegrationReceiveContext) => IntegrationReceiveResult | Promise<IntegrationReceiveResult>;
|
|
63
|
+
readonly reconcile: (context: IntegrationReconcileContext) => Promise<IntegrationReconcileResult>;
|
|
64
|
+
readonly snapshot: TriggerKeySnapshot & {
|
|
65
|
+
readonly type: 'integration';
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export declare class IntegrationConnectionError extends Error {
|
|
69
|
+
readonly name = "IntegrationConnectionError";
|
|
70
|
+
}
|
|
71
|
+
export declare class PermanentIntegrationError extends Error {
|
|
72
|
+
readonly name = "PermanentIntegrationError";
|
|
73
|
+
}
|
|
74
|
+
export declare class TransientIntegrationError extends Error {
|
|
75
|
+
readonly name = "TransientIntegrationError";
|
|
76
|
+
}
|
|
77
|
+
export declare function integrationEndpointId(url: URL): string | undefined;
|
|
78
|
+
export declare function integrationCallbackSecret(callbackKey: string | undefined, endpointId: string): Promise<string>;
|
|
79
|
+
export declare function integrationOccurrenceId(bindingId: string, runtimeVersion: number, definitionKey: string, dedupeKey: string | null): Promise<string>;
|
|
80
|
+
export interface IntegrationConformanceFixture {
|
|
81
|
+
readonly config: Readonly<Record<string, JsonValue>>;
|
|
82
|
+
readonly connectionId: string;
|
|
83
|
+
readonly definition: Pick<IntegrationDefinition, 'initialState' | 'receive' | 'reconcile'>;
|
|
84
|
+
readonly publishedAt: string;
|
|
85
|
+
}
|
|
86
|
+
export interface IntegrationConformanceState {
|
|
87
|
+
readonly checkpoint: JsonValue | null;
|
|
88
|
+
readonly health: 'healthy' | 'initializing';
|
|
89
|
+
readonly payloads: readonly JsonValue[];
|
|
90
|
+
readonly receiveCalls: number;
|
|
91
|
+
readonly reconcileCalls: number;
|
|
92
|
+
readonly runtimeVersion: number;
|
|
93
|
+
readonly subscription: Readonly<Record<string, JsonValue>> | null;
|
|
94
|
+
}
|
|
95
|
+
export interface IntegrationConformanceHarness {
|
|
96
|
+
readonly callbackSecret: string;
|
|
97
|
+
readonly endpointUrl: string;
|
|
98
|
+
dispose(): Promise<void>;
|
|
99
|
+
reconcile(at: string): Promise<void>;
|
|
100
|
+
republish(at: string): Promise<void>;
|
|
101
|
+
request(request: Request): Promise<Response>;
|
|
102
|
+
restart(): Promise<void>;
|
|
103
|
+
retire(at: string): Promise<void>;
|
|
104
|
+
state(): Promise<IntegrationConformanceState>;
|
|
105
|
+
}
|
|
106
|
+
export interface IntegrationConformanceCase {
|
|
107
|
+
readonly fixture: IntegrationConformanceFixture;
|
|
108
|
+
readonly name: string;
|
|
109
|
+
verify(harness: IntegrationConformanceHarness): Promise<void>;
|
|
110
|
+
}
|
|
111
|
+
export declare const integrationConformanceCases: readonly IntegrationConformanceCase[];
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
//#region ../../node_modules/dequal/lite/index.mjs
|
|
2
|
+
var e = Object.prototype.hasOwnProperty;
|
|
3
|
+
function t(n, r) {
|
|
4
|
+
var i, a;
|
|
5
|
+
if (n === r) return !0;
|
|
6
|
+
if (n && r && (i = n.constructor) === r.constructor) {
|
|
7
|
+
if (i === Date) return n.getTime() === r.getTime();
|
|
8
|
+
if (i === RegExp) return n.toString() === r.toString();
|
|
9
|
+
if (i === Array) {
|
|
10
|
+
if ((a = n.length) === r.length) for (; a-- && t(n[a], r[a]););
|
|
11
|
+
return a === -1;
|
|
12
|
+
}
|
|
13
|
+
if (!i || typeof n == "object") {
|
|
14
|
+
for (i in a = 0, n) if (e.call(n, i) && ++a && !e.call(r, i) || !(i in r) || !t(n[i], r[i])) return !1;
|
|
15
|
+
return Object.keys(r).length === a;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return n !== n && r !== r;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/trigger/common/integration.ts
|
|
22
|
+
var n = 65536, r = 5, i = /^\/v1\/integrations\/(endpoint_[0-9a-f]{32})$/, a = new TextEncoder(), o = class extends Error {
|
|
23
|
+
constructor(...e) {
|
|
24
|
+
super(...e), this.name = "IntegrationConnectionError";
|
|
25
|
+
}
|
|
26
|
+
}, s = class extends Error {
|
|
27
|
+
constructor(...e) {
|
|
28
|
+
super(...e), this.name = "PermanentIntegrationError";
|
|
29
|
+
}
|
|
30
|
+
}, c = class extends Error {
|
|
31
|
+
constructor(...e) {
|
|
32
|
+
super(...e), this.name = "TransientIntegrationError";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
function l(e) {
|
|
36
|
+
return i.exec(e.pathname)?.[1];
|
|
37
|
+
}
|
|
38
|
+
async function u(e, t) {
|
|
39
|
+
if (e == null || e.length == 0) throw TypeError("Integration callback key is required.");
|
|
40
|
+
let n = await crypto.subtle.importKey("raw", a.encode(e), {
|
|
41
|
+
hash: "SHA-256",
|
|
42
|
+
name: "HMAC"
|
|
43
|
+
}, !1, ["sign"]), r = new Uint8Array(await crypto.subtle.sign("HMAC", n, a.encode(`open-flow-integration/v1/${t}`)));
|
|
44
|
+
return btoa(String.fromCharCode(...r)).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
|
|
45
|
+
}
|
|
46
|
+
async function d(e, t, n, r) {
|
|
47
|
+
if (r == null) return `integration_${crypto.randomUUID().replaceAll("-", "")}`;
|
|
48
|
+
let i = JSON.stringify([
|
|
49
|
+
1,
|
|
50
|
+
"integration-occurrence",
|
|
51
|
+
e,
|
|
52
|
+
t,
|
|
53
|
+
n,
|
|
54
|
+
r
|
|
55
|
+
]);
|
|
56
|
+
return [...new Uint8Array(await crypto.subtle.digest("SHA-256", a.encode(i)))].map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
57
|
+
}
|
|
58
|
+
var f = {
|
|
59
|
+
config: { source: "primary" },
|
|
60
|
+
connectionId: "connection-primary",
|
|
61
|
+
definition: {
|
|
62
|
+
initialState: {
|
|
63
|
+
checkpoint: null,
|
|
64
|
+
subscription: {}
|
|
65
|
+
},
|
|
66
|
+
receive(e) {
|
|
67
|
+
if (e.header("x-integration-secret") != e.callbackSecret) return {
|
|
68
|
+
body: "",
|
|
69
|
+
contentType: "text/plain",
|
|
70
|
+
outcome: "respond",
|
|
71
|
+
status: 404
|
|
72
|
+
};
|
|
73
|
+
let t = _(e.payload);
|
|
74
|
+
if (t?.action == "handshake") return {
|
|
75
|
+
body: "accepted",
|
|
76
|
+
contentType: "text/plain",
|
|
77
|
+
headers: { "x-integration-response": "conformance" },
|
|
78
|
+
outcome: "respond",
|
|
79
|
+
status: 201
|
|
80
|
+
};
|
|
81
|
+
if (t?.action == "ignored") return {
|
|
82
|
+
outcome: "ignored",
|
|
83
|
+
reason: "Conformance delivery was ignored."
|
|
84
|
+
};
|
|
85
|
+
if (t?.action == "pages") {
|
|
86
|
+
let n = _(e.state?.checkpoint), r = typeof n?.page == "number" ? n.page + 1 : 1, i = typeof t.pages == "number" ? t.pages : 1, a = typeof t.deliveryId == "string" ? t.deliveryId : "pages";
|
|
87
|
+
return {
|
|
88
|
+
checkpoint: { page: r },
|
|
89
|
+
continue: r < i,
|
|
90
|
+
dedupeKey: `${a}:${r}`,
|
|
91
|
+
outcome: "event",
|
|
92
|
+
payload: {
|
|
93
|
+
body: { page: r },
|
|
94
|
+
deliveryId: a,
|
|
95
|
+
event: "conformance"
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
let n = typeof t?.deliveryId == "string" ? t.deliveryId : "delivery", r = _(t?.body) ?? {};
|
|
100
|
+
return {
|
|
101
|
+
checkpoint: { deliveryId: n },
|
|
102
|
+
dedupeKey: n,
|
|
103
|
+
outcome: "event",
|
|
104
|
+
payload: {
|
|
105
|
+
body: r,
|
|
106
|
+
deliveryId: n,
|
|
107
|
+
event: "conformance"
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
async reconcile(e) {
|
|
112
|
+
if (e.state == null) throw new s("Conformance Integration state is missing.");
|
|
113
|
+
return await e.state.saveSubscription(e.active ? { endpointUrl: e.endpointUrl } : {}, new Date(e.now.getTime() + 6e4)), { outcome: "ready" };
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
publishedAt: "2026-08-21T00:00:30.000Z"
|
|
117
|
+
}, p = [
|
|
118
|
+
{
|
|
119
|
+
fixture: f,
|
|
120
|
+
name: "enforces callback routing, method, body, and handshake boundaries",
|
|
121
|
+
async verify(e) {
|
|
122
|
+
let t = new URL(e.endpointUrl);
|
|
123
|
+
await v(await m(e, { url: new URL("/v1/integrations/not-an-endpoint", t).href }), { status: 404 }, "Malformed endpoint"), await v(await m(e, { url: new URL("/v1/integrations/endpoint_00000000000000000000000000000000", t).href }), { status: 404 }, "Unknown endpoint"), await v(await m(e, { method: "GET" }), {
|
|
124
|
+
headers: { allow: "POST" },
|
|
125
|
+
status: 405
|
|
126
|
+
}, "Method"), await v(await m(e, { body: "{" }), { status: 400 }, "Invalid JSON"), await v(await m(e, {
|
|
127
|
+
body: "a=1",
|
|
128
|
+
headers: { "content-type": "application/x-www-form-urlencoded" }
|
|
129
|
+
}), { status: 400 }, "Unsupported body format"), await v(await m(e, { body: "x".repeat(65537) }), { status: 413 }, "Oversized body"), await v(await h(e, { action: "handshake" }), {
|
|
130
|
+
body: "accepted",
|
|
131
|
+
headers: {
|
|
132
|
+
"content-type": "text/plain",
|
|
133
|
+
"x-integration-response": "conformance"
|
|
134
|
+
},
|
|
135
|
+
status: 201
|
|
136
|
+
}, "Handshake");
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
fixture: f,
|
|
141
|
+
name: "verifies initializing callbacks before activating the subscription",
|
|
142
|
+
async verify(e) {
|
|
143
|
+
await v(await h(e, {
|
|
144
|
+
action: "event",
|
|
145
|
+
body: { value: "before" },
|
|
146
|
+
deliveryId: "before"
|
|
147
|
+
}, !1), { status: 404 }, "Secret"), await v(await h(e, {
|
|
148
|
+
action: "event",
|
|
149
|
+
body: { value: "before" },
|
|
150
|
+
deliveryId: "before"
|
|
151
|
+
}), { status: 202 }, "Initializing delivery"), g(await e.state(), {
|
|
152
|
+
checkpoint: null,
|
|
153
|
+
health: "initializing",
|
|
154
|
+
payloads: [],
|
|
155
|
+
receiveCalls: 2,
|
|
156
|
+
reconcileCalls: 0,
|
|
157
|
+
runtimeVersion: 1,
|
|
158
|
+
subscription: {}
|
|
159
|
+
}, "Initializing state"), await e.reconcile("2026-08-21T00:00:31.000Z"), g(await e.state(), {
|
|
160
|
+
checkpoint: null,
|
|
161
|
+
health: "healthy",
|
|
162
|
+
payloads: [],
|
|
163
|
+
receiveCalls: 2,
|
|
164
|
+
reconcileCalls: 1,
|
|
165
|
+
runtimeVersion: 1,
|
|
166
|
+
subscription: { endpointUrl: e.endpointUrl }
|
|
167
|
+
}, "Active subscription");
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
fixture: f,
|
|
172
|
+
name: "deduplicates keyed events and rejects conflicting payloads",
|
|
173
|
+
async verify(e) {
|
|
174
|
+
await e.reconcile("2026-08-21T00:00:31.000Z");
|
|
175
|
+
let t = {
|
|
176
|
+
action: "event",
|
|
177
|
+
body: { value: "first" },
|
|
178
|
+
deliveryId: "delivery-1"
|
|
179
|
+
};
|
|
180
|
+
await v(await h(e, t), { status: 202 }, "Initial event"), await v(await h(e, t), { status: 202 }, "Repeated event"), await v(await h(e, {
|
|
181
|
+
...t,
|
|
182
|
+
body: { value: "changed" }
|
|
183
|
+
}), { status: 409 }, "Conflicting event");
|
|
184
|
+
let n = await e.state();
|
|
185
|
+
g(n.checkpoint, { deliveryId: "delivery-1" }, "Event checkpoint"), g(n.payloads, [{
|
|
186
|
+
body: { value: "first" },
|
|
187
|
+
deliveryId: "delivery-1",
|
|
188
|
+
event: "conformance"
|
|
189
|
+
}], "Event payloads");
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
fixture: f,
|
|
194
|
+
name: "bounds callback pages and resumes from the durable checkpoint",
|
|
195
|
+
async verify(e) {
|
|
196
|
+
await e.reconcile("2026-08-21T00:00:31.000Z");
|
|
197
|
+
let t = {
|
|
198
|
+
action: "pages",
|
|
199
|
+
deliveryId: "delivery-pages",
|
|
200
|
+
pages: 7
|
|
201
|
+
};
|
|
202
|
+
await v(await h(e, t), { status: 202 }, "First page batch");
|
|
203
|
+
let n = await e.state();
|
|
204
|
+
g(n.checkpoint, { page: 5 }, "Bounded checkpoint"), g(n.payloads.length, 5, "Bounded payload count"), await v(await h(e, t), { status: 202 }, "Resumed page batch"), n = await e.state(), g(n.checkpoint, { page: 7 }, "Resumed checkpoint"), g(n.payloads.length, 7, "Resumed payload count");
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
fixture: f,
|
|
209
|
+
name: "restores subscription state and callback admission after restart",
|
|
210
|
+
async verify(e) {
|
|
211
|
+
await e.reconcile("2026-08-21T00:00:31.000Z"), await h(e, {
|
|
212
|
+
action: "event",
|
|
213
|
+
body: { value: "before" },
|
|
214
|
+
deliveryId: "before"
|
|
215
|
+
}), await e.restart(), await h(e, {
|
|
216
|
+
action: "event",
|
|
217
|
+
body: { value: "after" },
|
|
218
|
+
deliveryId: "after"
|
|
219
|
+
});
|
|
220
|
+
let t = await e.state();
|
|
221
|
+
g(t.checkpoint, { deliveryId: "after" }, "Restart checkpoint"), g(t.payloads, [{
|
|
222
|
+
body: { value: "before" },
|
|
223
|
+
deliveryId: "before",
|
|
224
|
+
event: "conformance"
|
|
225
|
+
}, {
|
|
226
|
+
body: { value: "after" },
|
|
227
|
+
deliveryId: "after",
|
|
228
|
+
event: "conformance"
|
|
229
|
+
}], "Restart payloads");
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
fixture: f,
|
|
234
|
+
name: "retires the old runtime before activating a republished target",
|
|
235
|
+
async verify(e) {
|
|
236
|
+
await e.reconcile("2026-08-21T00:00:31.000Z");
|
|
237
|
+
let t = {
|
|
238
|
+
action: "event",
|
|
239
|
+
body: { value: "event" },
|
|
240
|
+
deliveryId: "same-delivery"
|
|
241
|
+
};
|
|
242
|
+
await h(e, t);
|
|
243
|
+
let n = e.endpointUrl;
|
|
244
|
+
await e.republish("2026-08-21T00:00:40.000Z"), g(e.endpointUrl, n, "Republished endpoint"), await v(await h(e, t), { status: 202 }, "Old runtime delivery"), g((await e.state()).payloads.length, 1, "Old runtime payload count"), await e.reconcile("2026-08-21T00:00:41.000Z"), await v(await h(e, t), { status: 202 }, "New runtime delivery");
|
|
245
|
+
let r = await e.state();
|
|
246
|
+
g(r.runtimeVersion, 2, "Republished runtime"), g(r.health, "healthy", "Republished health"), g(r.payloads.length, 2, "Republished payload count");
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
fixture: f,
|
|
251
|
+
name: "retires the remote subscription and rejects later callbacks",
|
|
252
|
+
async verify(e) {
|
|
253
|
+
await e.reconcile("2026-08-21T00:00:31.000Z"), await e.retire("2026-08-21T00:00:40.000Z"), await v(await h(e, {
|
|
254
|
+
action: "event",
|
|
255
|
+
deliveryId: "retired"
|
|
256
|
+
}), { status: 404 }, "Retired callback"), await e.reconcile("2026-08-21T00:00:41.000Z"), await v(await h(e, {
|
|
257
|
+
action: "event",
|
|
258
|
+
deliveryId: "retired"
|
|
259
|
+
}), { status: 404 }, "Reconciled retirement"), g((await e.state()).payloads, [], "Retired payloads");
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
];
|
|
263
|
+
function m(e, t = {}) {
|
|
264
|
+
return e.request(new Request(t.url ?? e.endpointUrl, {
|
|
265
|
+
...t.body == null ? {} : { body: t.body },
|
|
266
|
+
headers: {
|
|
267
|
+
...t.body == null ? {} : { "content-type": "application/json" },
|
|
268
|
+
...t.headers
|
|
269
|
+
},
|
|
270
|
+
method: t.method ?? "POST"
|
|
271
|
+
}));
|
|
272
|
+
}
|
|
273
|
+
function h(e, t, n = !0) {
|
|
274
|
+
return m(e, {
|
|
275
|
+
body: JSON.stringify(t),
|
|
276
|
+
headers: n ? { "x-integration-secret": e.callbackSecret } : {}
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
function g(e, n, r) {
|
|
280
|
+
if (!t(e, n)) throw Error(`${r}: expected ${JSON.stringify(n)}, received ${JSON.stringify(e)}.`);
|
|
281
|
+
}
|
|
282
|
+
function _(e) {
|
|
283
|
+
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
284
|
+
}
|
|
285
|
+
async function v(e, t, n) {
|
|
286
|
+
g(e.status, t.status, `${n} status`), t.body != null && g(await e.text(), t.body, `${n} body`);
|
|
287
|
+
for (let [r, i] of Object.entries(t.headers ?? {})) g(e.headers.get(r), i, `${n} header ${r}`);
|
|
288
|
+
}
|
|
289
|
+
//#endregion
|
|
290
|
+
export { o as IntegrationConnectionError, s as PermanentIntegrationError, c as TransientIntegrationError, u as integrationCallbackSecret, p as integrationConformanceCases, l as integrationEndpointId, d as integrationOccurrenceId, n as maximumIntegrationBodyBytes, r as maximumIntegrationDeliveryPages };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Licenses
|
|
2
|
+
|
|
3
|
+
The app bundles dependencies which contain the following licenses:
|
|
4
|
+
|
|
5
|
+
## dequal - 2.0.3 (MIT)
|
|
6
|
+
|
|
7
|
+
The MIT License (MIT)
|
|
8
|
+
|
|
9
|
+
Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in
|
|
19
|
+
all copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
27
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { ConnectorProxy } from './connector-proxy.js';
|
|
2
|
+
import type { JsonValue, TriggerKeySnapshot, TriggerSchedule } from '../browser/project-change.js';
|
|
3
|
+
export declare const maximumPollCheckpointBytes: number;
|
|
4
|
+
export declare const maximumPollDedupeKeyBytes = 1024;
|
|
5
|
+
export declare const maximumPollEventsPerPage = 100;
|
|
6
|
+
export interface PollEvent {
|
|
7
|
+
readonly dedupeKey: string;
|
|
8
|
+
readonly payload: Readonly<Record<string, JsonValue>>;
|
|
9
|
+
}
|
|
10
|
+
export interface PollResult {
|
|
11
|
+
readonly checkpoint: JsonValue;
|
|
12
|
+
readonly events: readonly PollEvent[];
|
|
13
|
+
readonly filtered?: number;
|
|
14
|
+
readonly hasMore?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface PollContext {
|
|
17
|
+
readonly checkpoint: JsonValue;
|
|
18
|
+
readonly config: Readonly<Record<string, JsonValue>>;
|
|
19
|
+
readonly connector: ConnectorProxy;
|
|
20
|
+
readonly now: Date;
|
|
21
|
+
readonly signal?: AbortSignal;
|
|
22
|
+
}
|
|
23
|
+
export interface PollDefinition {
|
|
24
|
+
readonly poll: (context: PollContext) => Promise<PollResult>;
|
|
25
|
+
readonly snapshot: TriggerKeySnapshot & {
|
|
26
|
+
readonly type: 'poll';
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export declare class PollConnectionError extends Error {
|
|
30
|
+
readonly name = "PollConnectionError";
|
|
31
|
+
}
|
|
32
|
+
export declare class PermanentPollError extends Error {
|
|
33
|
+
readonly name = "PermanentPollError";
|
|
34
|
+
}
|
|
35
|
+
export declare class TransientPollError extends Error {
|
|
36
|
+
readonly name = "TransientPollError";
|
|
37
|
+
}
|
|
38
|
+
export declare function pollPageClaimId(bindingId: string, runtimeVersion: number, rootOccurrenceId: string, page: number): Promise<string>;
|
|
39
|
+
export declare function providerEventId(bindingId: string, triggerKey: string, dedupeKey: string): Promise<string>;
|
|
40
|
+
export interface PollConformanceFixture {
|
|
41
|
+
readonly config: Readonly<Record<string, JsonValue>>;
|
|
42
|
+
readonly connectionId: string;
|
|
43
|
+
readonly publishedAt: string;
|
|
44
|
+
readonly rules: readonly TriggerSchedule[];
|
|
45
|
+
}
|
|
46
|
+
export interface PollConformanceState {
|
|
47
|
+
readonly calls: number;
|
|
48
|
+
readonly checkpoint: JsonValue;
|
|
49
|
+
readonly health: 'healthy' | 'initializing';
|
|
50
|
+
readonly payloads: readonly JsonValue[];
|
|
51
|
+
}
|
|
52
|
+
export interface PollConformanceHarness {
|
|
53
|
+
dispose(): Promise<void>;
|
|
54
|
+
replayLast(): Promise<void>;
|
|
55
|
+
republish(at: string, change?: {
|
|
56
|
+
readonly config?: Readonly<Record<string, JsonValue>>;
|
|
57
|
+
readonly connectionId?: string;
|
|
58
|
+
}): Promise<void>;
|
|
59
|
+
restart(): Promise<void>;
|
|
60
|
+
retire(at: string): Promise<void>;
|
|
61
|
+
state(): Promise<PollConformanceState>;
|
|
62
|
+
tick(at: string, pages: readonly PollResult[]): Promise<void>;
|
|
63
|
+
}
|
|
64
|
+
export interface PollConformanceCase {
|
|
65
|
+
readonly fixture: PollConformanceFixture;
|
|
66
|
+
readonly name: string;
|
|
67
|
+
verify(harness: PollConformanceHarness): Promise<void>;
|
|
68
|
+
}
|
|
69
|
+
export declare const pollConformanceCases: readonly PollConformanceCase[];
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
//#region src/trigger/common/poll.ts
|
|
2
|
+
var e = new TextEncoder(), t = 65536, n = 1024, r = 100, i = class extends Error {
|
|
3
|
+
constructor(...e) {
|
|
4
|
+
super(...e), this.name = "PollConnectionError";
|
|
5
|
+
}
|
|
6
|
+
}, a = class extends Error {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.name = "PermanentPollError";
|
|
9
|
+
}
|
|
10
|
+
}, o = class extends Error {
|
|
11
|
+
constructor(...e) {
|
|
12
|
+
super(...e), this.name = "TransientPollError";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
async function s(e, t, n, r) {
|
|
16
|
+
if (!Number.isSafeInteger(r) || r <= 0) throw RangeError("Poll continuation page must be a positive integer.");
|
|
17
|
+
return await d(`${e}\0${t}\0${n}\0${r}`);
|
|
18
|
+
}
|
|
19
|
+
async function c(t, n, r) {
|
|
20
|
+
if (e.encode(r).byteLength > 1024) throw RangeError("Poll event dedupe key exceeds 1024 bytes.");
|
|
21
|
+
return await d(`${t}\0${n}\0${r}`);
|
|
22
|
+
}
|
|
23
|
+
var l = {
|
|
24
|
+
config: { source: "primary" },
|
|
25
|
+
connectionId: "connection-primary",
|
|
26
|
+
publishedAt: "2026-08-21T00:00:30.000Z",
|
|
27
|
+
rules: [{
|
|
28
|
+
type: "every",
|
|
29
|
+
unit: "minute",
|
|
30
|
+
value: 1
|
|
31
|
+
}]
|
|
32
|
+
}, u = [
|
|
33
|
+
{
|
|
34
|
+
fixture: l,
|
|
35
|
+
name: "baselines every continuation page before becoming healthy",
|
|
36
|
+
async verify(e) {
|
|
37
|
+
await e.tick("2026-08-21T00:01:00.000Z", [{
|
|
38
|
+
checkpoint: { cursor: "baseline-1" },
|
|
39
|
+
events: [{
|
|
40
|
+
dedupeKey: "old-1",
|
|
41
|
+
payload: { value: "old-1" }
|
|
42
|
+
}],
|
|
43
|
+
hasMore: !0
|
|
44
|
+
}, {
|
|
45
|
+
checkpoint: { cursor: "baseline-2" },
|
|
46
|
+
events: [{
|
|
47
|
+
dedupeKey: "old-2",
|
|
48
|
+
payload: { value: "old-2" }
|
|
49
|
+
}]
|
|
50
|
+
}]), f(await e.state(), {
|
|
51
|
+
calls: 2,
|
|
52
|
+
checkpoint: { cursor: "baseline-2" },
|
|
53
|
+
health: "healthy",
|
|
54
|
+
payloads: []
|
|
55
|
+
}, "Baseline state");
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
fixture: l,
|
|
60
|
+
name: "batches fresh page events and suppresses duplicate identities",
|
|
61
|
+
async verify(e) {
|
|
62
|
+
await e.tick("2026-08-21T00:01:00.000Z", [{
|
|
63
|
+
checkpoint: { cursor: "baseline" },
|
|
64
|
+
events: []
|
|
65
|
+
}]);
|
|
66
|
+
let t = {
|
|
67
|
+
dedupeKey: "event-1",
|
|
68
|
+
payload: { value: "first" }
|
|
69
|
+
};
|
|
70
|
+
await e.tick("2026-08-21T00:02:00.000Z", [{
|
|
71
|
+
checkpoint: { cursor: "next" },
|
|
72
|
+
events: [
|
|
73
|
+
t,
|
|
74
|
+
t,
|
|
75
|
+
{
|
|
76
|
+
dedupeKey: "event-2",
|
|
77
|
+
payload: { value: "second" }
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}]), await e.tick("2026-08-21T00:03:00.000Z", [{
|
|
81
|
+
checkpoint: { cursor: "last" },
|
|
82
|
+
events: [t]
|
|
83
|
+
}]), f(await e.state(), {
|
|
84
|
+
calls: 3,
|
|
85
|
+
checkpoint: { cursor: "last" },
|
|
86
|
+
health: "healthy",
|
|
87
|
+
payloads: [{ events: [{ value: "first" }, { value: "second" }] }]
|
|
88
|
+
}, "Deduplicated state");
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
fixture: l,
|
|
93
|
+
name: "replays a completed root across restart without polling again",
|
|
94
|
+
async verify(e) {
|
|
95
|
+
await e.tick("2026-08-21T00:01:00.000Z", [{
|
|
96
|
+
checkpoint: { cursor: "baseline" },
|
|
97
|
+
events: []
|
|
98
|
+
}]), await e.tick("2026-08-21T00:02:00.000Z", [{
|
|
99
|
+
checkpoint: { cursor: "event" },
|
|
100
|
+
events: [{
|
|
101
|
+
dedupeKey: "event-1",
|
|
102
|
+
payload: { value: "first" }
|
|
103
|
+
}]
|
|
104
|
+
}]), await e.restart(), await e.replayLast(), f(await e.state(), {
|
|
105
|
+
calls: 2,
|
|
106
|
+
checkpoint: { cursor: "event" },
|
|
107
|
+
health: "healthy",
|
|
108
|
+
payloads: [{ events: [{ value: "first" }] }]
|
|
109
|
+
}, "Replayed state");
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
fixture: l,
|
|
114
|
+
name: "preserves an unchanged checkpoint and baselines changed semantics",
|
|
115
|
+
async verify(e) {
|
|
116
|
+
await e.tick("2026-08-21T00:01:00.000Z", [{
|
|
117
|
+
checkpoint: { cursor: "baseline" },
|
|
118
|
+
events: []
|
|
119
|
+
}]), await e.republish("2026-08-21T00:01:30.000Z"), f(await e.state(), {
|
|
120
|
+
calls: 1,
|
|
121
|
+
checkpoint: { cursor: "baseline" },
|
|
122
|
+
health: "healthy",
|
|
123
|
+
payloads: []
|
|
124
|
+
}, "Unchanged publication state"), await e.republish("2026-08-21T00:01:40.000Z", { config: { source: "secondary" } }), await e.tick("2026-08-21T00:02:00.000Z", [{
|
|
125
|
+
checkpoint: { cursor: "secondary-baseline" },
|
|
126
|
+
events: [{
|
|
127
|
+
dedupeKey: "old-secondary",
|
|
128
|
+
payload: { value: "old" }
|
|
129
|
+
}]
|
|
130
|
+
}]), f(await e.state(), {
|
|
131
|
+
calls: 2,
|
|
132
|
+
checkpoint: { cursor: "secondary-baseline" },
|
|
133
|
+
health: "healthy",
|
|
134
|
+
payloads: []
|
|
135
|
+
}, "Changed publication state"), await e.retire("2026-08-21T00:02:30.000Z"), await e.tick("2026-08-21T00:03:00.000Z", [{
|
|
136
|
+
checkpoint: { cursor: "retired" },
|
|
137
|
+
events: []
|
|
138
|
+
}]), f(await e.state(), {
|
|
139
|
+
calls: 2,
|
|
140
|
+
checkpoint: { cursor: "secondary-baseline" },
|
|
141
|
+
health: "healthy",
|
|
142
|
+
payloads: []
|
|
143
|
+
}, "Retired state");
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
];
|
|
147
|
+
async function d(t) {
|
|
148
|
+
let n = new Uint8Array(await crypto.subtle.digest("SHA-256", e.encode(t)));
|
|
149
|
+
return `sha256:${Array.from(n, (e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
150
|
+
}
|
|
151
|
+
function f(e, t, n) {
|
|
152
|
+
if (JSON.stringify(e) != JSON.stringify(t)) throw Error(`${n}: expected ${JSON.stringify(t)}, received ${JSON.stringify(e)}.`);
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
155
|
+
export { a as PermanentPollError, i as PollConnectionError, o as TransientPollError, t as maximumPollCheckpointBytes, n as maximumPollDedupeKeyBytes, r as maximumPollEventsPerPage, u as pollConformanceCases, s as pollPageClaimId, c as providerEventId };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CodeModule, Graph, InputPortDefinition, JsonValue, OutputMapping, PortDefinition, ProjectDocument, RevisionContent } from '@oomol-lab/open-flow/project-change';
|
|
2
|
+
export declare const maxJsonDepth = 64;
|
|
3
|
+
export declare function canonicalJsonBytes(value: JsonValue): Uint8Array;
|
|
4
|
+
export declare function digestBytes(bytes: Uint8Array): Promise<string>;
|
|
5
|
+
export declare function canonicalPorts(value: Readonly<Record<string, InputPortDefinition | PortDefinition>>): JsonValue;
|
|
6
|
+
export declare function canonicalOutputs(value: Readonly<Record<string, OutputMapping & PortDefinition>>): JsonValue;
|
|
7
|
+
export declare function canonicalGraph(value: Graph): JsonValue;
|
|
8
|
+
export declare function canonicalTask(task: ProjectDocument['tasks'][string]): JsonValue;
|
|
9
|
+
export declare function canonicalDocument(document: ProjectDocument): JsonValue;
|
|
10
|
+
export declare function canonicalModule(module: CodeModule): JsonValue;
|
|
11
|
+
export declare function encodeRevision(content: RevisionContent): Uint8Array;
|