@oomol-lab/open-flow 0.1.0-beta.27 → 0.1.0-beta.29
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/dist/browser/{createResourceDialog-BwI2JmPE.js → createResourceDialog-C_8I3Fua.js} +1 -1
- package/dist/browser/dist-CoszrK7m.js +4 -0
- package/dist/browser/{switch-CyZ96-UF.js → editorComponent-Dq4IKp5R.js} +5787 -651
- package/dist/browser/flow-authoring-node.d.ts +6 -2
- package/dist/browser/flow-authoring.js +1489 -1638
- package/dist/browser/flow-change-schema.d.ts +4 -0
- package/dist/browser/flow-change.d.ts +20 -14
- package/dist/browser/flow-change.js +1057 -1179
- package/dist/browser/flow-notifications.d.ts +6 -2
- package/dist/browser/{flowChanges-DhEjA0n5.js → flowChanges-BBtkyUGd.js} +2192 -1975
- package/dist/browser/{flowRunInputEditorStore-BBqQIOCR.js → flowRunInputEditorStore-CTORQcA2.js} +378 -429
- package/dist/browser/{flowWorkspace-zcweMsLS.js → flowWorkspace-DNmBb3ZW.js} +62886 -66618
- package/dist/browser/host-conformance.js +7 -1
- package/dist/browser/{inputValues-C5ExCCf0.js → inputValues-BbSVOWQP.js} +2 -2
- package/dist/browser/{markdownContent-SIlWuHve.js → markdownContent-D2oHGWc6.js} +24 -24
- package/dist/browser/ui.css +1 -1
- package/dist/browser/value-DPg_9yXB.js +93 -0
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.js +769 -605
- package/dist/browser/{workbenchSelect-BUu7CjUA.js → workbenchSelect-CQOvpteT.js} +1507 -1642
- package/dist/common/authoringExamples.d.ts +28 -0
- package/dist/common/control-api-conformance.js +1449 -1556
- package/dist/common/control-api-errors.d.ts +8 -0
- package/dist/common/control-api.d.ts +12 -4
- package/dist/common/control-api.js +1480 -1560
- package/dist/common/control-requests.d.ts +13 -6
- package/dist/common/control-requests.js +1886 -1445
- package/dist/common/cron-trigger.d.ts +2 -1
- package/dist/common/cron-trigger.js +27 -24
- package/dist/common/draftOperations.d.ts +14 -0
- package/dist/common/engine-contract.d.ts +2 -2
- package/dist/common/flow-encoding.d.ts +3 -0
- package/dist/common/flow-encoding.js +1488 -1524
- package/dist/common/flow-graph.d.ts +18 -2
- package/dist/common/flow-notifications.d.ts +6 -2
- package/dist/common/flow-schema.d.ts +1 -2
- package/dist/common/flow-semantics.d.ts +2 -1
- package/dist/common/flow-semantics.js +7809 -7820
- package/dist/common/flowInspection.d.ts +16 -0
- package/dist/common/integration-trigger.d.ts +2 -2
- package/dist/common/integration-trigger.js +8 -8
- package/dist/common/mcp.d.ts +2 -1
- package/dist/common/mcp.js +985 -1060
- package/dist/common/poll-trigger.d.ts +3 -0
- package/dist/common/poll-trigger.js +26 -22
- package/dist/common/provider-triggers.js +3096 -3126
- package/dist/common/run-events.js +1 -0
- package/dist/common/runtime-contract.js +3 -3
- package/dist/common/scheduler.d.ts +6 -5
- package/dist/common/scheduler.js +2318 -2383
- package/dist/common/trigger-contract.d.ts +5 -0
- package/dist/common/webhook-trigger.d.ts +3 -3
- package/dist/common/webhook-trigger.js +64 -18
- package/package.json +1 -1
- package/dist/browser/dist-B_T-OpQp.js +0 -4
- package/dist/browser/languages-C0zQ4GSo.js +0 -42
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JsonValue, Port, PortDefinition, TriggerNode } from '../browser/flow-change.js';
|
|
2
|
+
export declare const webhookOutputs: readonly Port[];
|
|
3
|
+
export declare function triggerOutputDefinitions(trigger: TriggerNode): readonly Port[];
|
|
4
|
+
export declare function triggerOutputPorts(trigger: TriggerNode): Readonly<Record<string, PortDefinition>>;
|
|
5
|
+
export declare function matchesTriggerOutputs(trigger: TriggerNode, outputs: unknown): outputs is Readonly<Record<string, JsonValue>>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { JsonValue,
|
|
1
|
+
import type { JsonValue, WebhookBodyField, WebhookOptions } from '../browser/flow-change.js';
|
|
2
2
|
export declare const maximumWebhookBodyBytes: number;
|
|
3
3
|
export declare function webhookEndpointId(url: URL): string | undefined;
|
|
4
4
|
export declare function webhookOccurrenceId(endpointId: string, runtimeVersion: number, key: string | null): Promise<string | undefined>;
|
|
5
5
|
export interface WebhookConformanceFixture {
|
|
6
|
-
readonly
|
|
6
|
+
readonly bodyFields: readonly WebhookBodyField[];
|
|
7
7
|
readonly options?: WebhookOptions;
|
|
8
8
|
}
|
|
9
9
|
export interface WebhookConformanceHarness {
|
|
10
10
|
readonly endpointUrl: string;
|
|
11
11
|
dispose(): Promise<void>;
|
|
12
|
-
|
|
12
|
+
outputs(): Promise<readonly Readonly<Record<string, JsonValue>>[]>;
|
|
13
13
|
republish(): Promise<void>;
|
|
14
14
|
request(request: Request): Promise<Response>;
|
|
15
15
|
retire(): Promise<void>;
|
|
@@ -27,7 +27,7 @@ async function o(e, t, n) {
|
|
|
27
27
|
if (n == null) return `webhook_${crypto.randomUUID().replaceAll("-", "")}`;
|
|
28
28
|
if (n.trim().length == 0 || n.length > 256) return;
|
|
29
29
|
let r = JSON.stringify([
|
|
30
|
-
|
|
30
|
+
2,
|
|
31
31
|
"webhook-occurrence",
|
|
32
32
|
e,
|
|
33
33
|
t,
|
|
@@ -60,7 +60,53 @@ var u = [], d = [{
|
|
|
60
60
|
nullable: !1
|
|
61
61
|
}], f = { event: { message: "hello" } }, p = [
|
|
62
62
|
{
|
|
63
|
-
fixture: {
|
|
63
|
+
fixture: {
|
|
64
|
+
bodyFields: d,
|
|
65
|
+
options: { allowedMethods: ["POST", "PUT"] }
|
|
66
|
+
},
|
|
67
|
+
name: "stores complete outputs and compares method query and body for idempotency",
|
|
68
|
+
async verify(e) {
|
|
69
|
+
let t = `${e.endpointUrl}?tag=a&tag=b&single=x&__proto__=safe&constructor=value`, n = {
|
|
70
|
+
url: t,
|
|
71
|
+
body: JSON.stringify(f),
|
|
72
|
+
headers: {
|
|
73
|
+
"Idempotency-Key": "output-contract",
|
|
74
|
+
"X-Request-ID": "first",
|
|
75
|
+
"Content-Type": "application/json"
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
s((await Promise.all([l(e, n), l(e, n)])).map((e) => e.status), [200, 200], "Concurrent retry statuses");
|
|
79
|
+
let r = await e.outputs();
|
|
80
|
+
s(r.length, 1, "One admitted Run");
|
|
81
|
+
let i = r[0];
|
|
82
|
+
s(Object.keys(i).toSorted(), [
|
|
83
|
+
"body",
|
|
84
|
+
"headers",
|
|
85
|
+
"query",
|
|
86
|
+
"webhookUrl"
|
|
87
|
+
], "Exact output handles"), s(i.body, f, "Body"), s(i.query, JSON.parse("{\"tag\":[\"a\",\"b\"],\"single\":\"x\",\"__proto__\":\"safe\",\"constructor\":\"value\"}"), "Query"), s(i.webhookUrl, e.endpointUrl, "Endpoint without query"), s(i.headers["x-request-id"], "first", "Lowercase headers"), await c(await l(e, {
|
|
88
|
+
...n,
|
|
89
|
+
headers: {
|
|
90
|
+
...n.headers,
|
|
91
|
+
"X-Request-ID": "retry"
|
|
92
|
+
}
|
|
93
|
+
}), { status: 200 }, "Changed header retry"), await c(await l(e, {
|
|
94
|
+
...n,
|
|
95
|
+
url: t.replace(new URL(t).host, "retry.example.com")
|
|
96
|
+
}), { status: 200 }, "Changed request URL host"), s(await e.outputs(), r, "First outputs remain unchanged"), await c(await l(e, {
|
|
97
|
+
...n,
|
|
98
|
+
method: "PUT"
|
|
99
|
+
}), { status: 409 }, "Changed method"), await c(await l(e, {
|
|
100
|
+
...n,
|
|
101
|
+
url: `${t}&extra=1`
|
|
102
|
+
}), { status: 409 }, "Changed query"), await c(await l(e, {
|
|
103
|
+
...n,
|
|
104
|
+
body: JSON.stringify({ event: { message: "changed" } })
|
|
105
|
+
}), { status: 409 }, "Changed body");
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
fixture: { bodyFields: u },
|
|
64
110
|
name: "rejects malformed and unknown endpoint identities",
|
|
65
111
|
async verify(e) {
|
|
66
112
|
let t = new URL(e.endpointUrl);
|
|
@@ -76,7 +122,7 @@ var u = [], d = [{
|
|
|
76
122
|
}
|
|
77
123
|
},
|
|
78
124
|
{
|
|
79
|
-
fixture: {
|
|
125
|
+
fixture: { bodyFields: u },
|
|
80
126
|
name: "uses POST by default and decodes an empty body as an empty object",
|
|
81
127
|
async verify(e) {
|
|
82
128
|
await c(await l(e, { method: "GET" }), {
|
|
@@ -89,12 +135,12 @@ var u = [], d = [{
|
|
|
89
135
|
body: "",
|
|
90
136
|
headers: { "cache-control": "no-store" },
|
|
91
137
|
status: 200
|
|
92
|
-
}, "Empty payload"), s(await e.
|
|
138
|
+
}, "Empty payload"), s((await e.outputs()).map((e) => e.body), [{}], "Decoded empty payloads");
|
|
93
139
|
}
|
|
94
140
|
},
|
|
95
141
|
{
|
|
96
142
|
fixture: {
|
|
97
|
-
|
|
143
|
+
bodyFields: u,
|
|
98
144
|
options: {
|
|
99
145
|
allowedMethods: ["PUT"],
|
|
100
146
|
allowedOrigins: ["https://client.example"],
|
|
@@ -146,7 +192,7 @@ var u = [], d = [{
|
|
|
146
192
|
},
|
|
147
193
|
{
|
|
148
194
|
fixture: {
|
|
149
|
-
|
|
195
|
+
bodyFields: u,
|
|
150
196
|
options: {
|
|
151
197
|
responseData: "<script>globalThis.compromised = true<\/script>",
|
|
152
198
|
responseHeaders: {
|
|
@@ -179,7 +225,7 @@ var u = [], d = [{
|
|
|
179
225
|
}
|
|
180
226
|
},
|
|
181
227
|
{
|
|
182
|
-
fixture: {
|
|
228
|
+
fixture: { bodyFields: d },
|
|
183
229
|
name: "rejects invalid JSON, invalid payloads, invalid idempotency keys, and oversized bodies",
|
|
184
230
|
async verify(e) {
|
|
185
231
|
await c(await l(e, { body: "{" }), {
|
|
@@ -208,11 +254,11 @@ var u = [], d = [{
|
|
|
208
254
|
body: "",
|
|
209
255
|
headers: { "cache-control": "no-store" },
|
|
210
256
|
status: 413
|
|
211
|
-
}, "Oversized body"), s(await e.
|
|
257
|
+
}, "Oversized body"), s((await e.outputs()).map((e) => e.body), [], "Rejected payloads");
|
|
212
258
|
}
|
|
213
259
|
},
|
|
214
260
|
{
|
|
215
|
-
fixture: {
|
|
261
|
+
fixture: { bodyFields: d },
|
|
216
262
|
name: "replays one idempotent occurrence and rejects conflicting payloads",
|
|
217
263
|
async verify(e) {
|
|
218
264
|
let t = { "idempotency-key": "delivery-1" };
|
|
@@ -229,19 +275,19 @@ var u = [], d = [{
|
|
|
229
275
|
body: "",
|
|
230
276
|
headers: { "cache-control": "no-store" },
|
|
231
277
|
status: 409
|
|
232
|
-
}, "Conflicting delivery"), s(await e.
|
|
278
|
+
}, "Conflicting delivery"), s((await e.outputs()).map((e) => e.body), [f], "Idempotent payloads");
|
|
233
279
|
}
|
|
234
280
|
},
|
|
235
281
|
{
|
|
236
|
-
fixture: {
|
|
282
|
+
fixture: { bodyFields: d },
|
|
237
283
|
name: "admits requests without an idempotency key as separate occurrences",
|
|
238
284
|
async verify(e) {
|
|
239
285
|
let t = JSON.stringify(f);
|
|
240
|
-
await c(await l(e, { body: t }), { status: 200 }, "First unkeyed delivery"), await c(await l(e, { body: t }), { status: 200 }, "Second unkeyed delivery"), s(await e.
|
|
286
|
+
await c(await l(e, { body: t }), { status: 200 }, "First unkeyed delivery"), await c(await l(e, { body: t }), { status: 200 }, "Second unkeyed delivery"), s((await e.outputs()).map((e) => e.body), [f, f], "Unkeyed payloads");
|
|
241
287
|
}
|
|
242
288
|
},
|
|
243
289
|
{
|
|
244
|
-
fixture: {
|
|
290
|
+
fixture: { bodyFields: d },
|
|
245
291
|
name: "scopes occurrence identity to the current runtime version",
|
|
246
292
|
async verify(e) {
|
|
247
293
|
let t = JSON.stringify(f), n = { "idempotency-key": "delivery-across-publish" };
|
|
@@ -253,23 +299,23 @@ var u = [], d = [{
|
|
|
253
299
|
await e.republish(), s(e.endpointUrl, r, "Endpoint after publish"), await c(await l(e, {
|
|
254
300
|
body: t,
|
|
255
301
|
headers: n
|
|
256
|
-
}), { status: 200 }, "Delivery after publish"), s(await e.
|
|
302
|
+
}), { status: 200 }, "Delivery after publish"), s((await e.outputs()).map((e) => e.body), [f, f], "Payloads across publish");
|
|
257
303
|
}
|
|
258
304
|
},
|
|
259
305
|
{
|
|
260
|
-
fixture: {
|
|
306
|
+
fixture: { bodyFields: u },
|
|
261
307
|
name: "fails closed after its trigger is retired",
|
|
262
308
|
async verify(e) {
|
|
263
309
|
await e.retire(), await c(await l(e, { body: "{}" }), {
|
|
264
310
|
body: "",
|
|
265
311
|
headers: { "cache-control": "no-store" },
|
|
266
312
|
status: 404
|
|
267
|
-
}, "Retired endpoint"), s(await e.
|
|
313
|
+
}, "Retired endpoint"), s((await e.outputs()).map((e) => e.body), [], "Payloads after retirement");
|
|
268
314
|
}
|
|
269
315
|
},
|
|
270
316
|
{
|
|
271
317
|
fixture: {
|
|
272
|
-
|
|
318
|
+
bodyFields: u,
|
|
273
319
|
options: {
|
|
274
320
|
responseData: "ignored",
|
|
275
321
|
responseStatusCode: 204
|
|
@@ -285,7 +331,7 @@ var u = [], d = [{
|
|
|
285
331
|
},
|
|
286
332
|
{
|
|
287
333
|
fixture: {
|
|
288
|
-
|
|
334
|
+
bodyFields: u,
|
|
289
335
|
options: {
|
|
290
336
|
allowedMethods: ["HEAD"],
|
|
291
337
|
responseData: "ignored"
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.bun/@wopjs+cast@0.1.16/node_modules/@wopjs/cast/dist/index.mjs
|
|
2
|
-
var e = (e) => e !== void 0, t = (e) => e === !0 || e === !1, n = (e) => typeof e == "string", r = Array.isArray, i = (e) => typeof e == "object" && !!e, a = (e) => i(e) && !r(e), o = (e) => a(e) ? e : void 0;
|
|
3
|
-
//#endregion
|
|
4
|
-
export { n as a, a as i, t as n, o, e as r, r as t };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
//#region src/localization/common/languages.ts
|
|
2
|
-
var e = [
|
|
3
|
-
"en",
|
|
4
|
-
"zh-CN",
|
|
5
|
-
"zh-TW",
|
|
6
|
-
"ja",
|
|
7
|
-
"ko",
|
|
8
|
-
"ru",
|
|
9
|
-
"fr"
|
|
10
|
-
], t = {
|
|
11
|
-
en: "English",
|
|
12
|
-
"zh-CN": "简体中文",
|
|
13
|
-
"zh-TW": "繁體中文",
|
|
14
|
-
ja: "日本語",
|
|
15
|
-
ko: "한국어",
|
|
16
|
-
ru: "Русский",
|
|
17
|
-
fr: "Français"
|
|
18
|
-
}, n = new Map(e.map((e) => [e.toLowerCase(), e])), r = /* @__PURE__ */ new Set([
|
|
19
|
-
"hk",
|
|
20
|
-
"mo",
|
|
21
|
-
"tw"
|
|
22
|
-
]);
|
|
23
|
-
function i(e) {
|
|
24
|
-
return typeof e == "string" && n.get(e.toLowerCase()) == e;
|
|
25
|
-
}
|
|
26
|
-
function a(e, t = "en") {
|
|
27
|
-
for (let t of e) {
|
|
28
|
-
let e = t == null ? void 0 : o(t);
|
|
29
|
-
if (e != null) return e;
|
|
30
|
-
}
|
|
31
|
-
return t;
|
|
32
|
-
}
|
|
33
|
-
function o(e) {
|
|
34
|
-
let t = e.trim().toLowerCase();
|
|
35
|
-
if (t.length == 0) return;
|
|
36
|
-
let i = n.get(t);
|
|
37
|
-
if (i != null) return i;
|
|
38
|
-
let a = t.split("-");
|
|
39
|
-
return a[0] == "zh" ? a.includes("hant") ? "zh-TW" : a.includes("hans") ? "zh-CN" : a.some((e) => r.has(e)) ? "zh-TW" : "zh-CN" : n.get(a[0]);
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { e as i, a as n, t as r, i as t };
|