@oomol-lab/open-flow 0.1.0-alpha.5 → 0.1.0-alpha.6
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/{addNodeOptions-B6tOfd2Y.js → addNodeOptions-C4wix0_u.js} +957 -1377
- package/dist/browser/{createLucideIcon-BlEx4FzJ.js → createLucideIcon-ggJB9CTC.js} +6 -37
- package/dist/browser/{createResourceDialog-CrBp3E8P.js → createResourceDialog-CESUCxOM.js} +2 -2
- package/dist/browser/{field-Daq9Lk-Y.js → field-CIrv7Rez.js} +1 -1
- package/dist/browser/{project-authoring-edge.d.ts → flow-authoring-edge.d.ts} +1 -1
- package/dist/browser/{project-authoring-module.d.ts → flow-authoring-module.d.ts} +1 -1
- package/dist/browser/{project-authoring-node.d.ts → flow-authoring-node.d.ts} +6 -12
- package/dist/browser/flow-authoring.d.ts +3 -0
- package/dist/browser/{project-authoring.js → flow-authoring.js} +43 -68
- package/dist/browser/{project-change.d.ts → flow-change.d.ts} +11 -26
- package/dist/browser/{project-change.js → flow-change.js} +8 -39
- package/dist/browser/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
- package/dist/browser/{flowWorkspace-CylW6hge.js → flowWorkspace-Bo0bz1Uz.js} +6351 -6516
- package/dist/browser/workbench-contract.d.ts +4 -4
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +1 -1
- package/dist/browser/workbench.js +896 -1051
- package/dist/common/control-api-conformance.js +136 -360
- package/dist/common/control-api-errors.d.ts +16 -24
- package/dist/common/control-api.d.ts +38 -67
- package/dist/common/control-api.js +135 -188
- package/dist/common/cron-trigger.d.ts +1 -1
- package/dist/common/{project-encoding.d.ts → flow-encoding.d.ts} +3 -3
- package/dist/common/{project-encoding.js → flow-encoding.js} +3 -6
- package/dist/common/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
- package/dist/common/{project-semantics.d.ts → flow-semantics.d.ts} +9 -12
- package/dist/common/{project-semantics.js → flow-semantics.js} +100 -110
- package/dist/common/integration-trigger.d.ts +1 -1
- package/dist/common/poll-trigger.d.ts +1 -1
- package/dist/common/runtime-contract.d.ts +1 -1
- package/dist/common/scheduler.d.ts +3 -2
- package/dist/common/scheduler.js +4 -4
- package/dist/common/webhook-trigger.d.ts +1 -1
- package/dist/common/webhook-trigger.js +1 -1
- package/package.json +13 -13
- package/dist/browser/project-authoring-flow.d.ts +0 -4
- package/dist/browser/project-authoring.d.ts +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region src/
|
|
1
|
+
//#region src/flow/common/encoding.ts
|
|
2
2
|
var e = new TextEncoder(), t = 64;
|
|
3
3
|
function n(e) {
|
|
4
4
|
if (e == null || typeof e == "boolean" || typeof e == "string" || typeof e == "number") return JSON.stringify(e);
|
|
@@ -206,10 +206,7 @@ function v(e) {
|
|
|
206
206
|
function y(e) {
|
|
207
207
|
return {
|
|
208
208
|
bindings: Object.fromEntries(a(e.bindings)),
|
|
209
|
-
|
|
210
|
-
graph: f(t.graph),
|
|
211
|
-
name: t.name
|
|
212
|
-
}])),
|
|
209
|
+
graph: f(e.graph),
|
|
213
210
|
subflows: Object.fromEntries(a(e.subflows).map(([e, t]) => [e, {
|
|
214
211
|
graph: f(t.graph),
|
|
215
212
|
inputs: s(t.inputs),
|
|
@@ -229,7 +226,7 @@ function b(e) {
|
|
|
229
226
|
function x(e) {
|
|
230
227
|
return {
|
|
231
228
|
document: y(e.document),
|
|
232
|
-
kind: "open-flow-
|
|
229
|
+
kind: "open-flow-flow-revision",
|
|
233
230
|
modelVersion: e.modelVersion,
|
|
234
231
|
modules: Object.fromEntries(a(e.modules).map(([e, t]) => [e, b(t)])),
|
|
235
232
|
version: 1
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface FlowCatalogEvent {
|
|
2
|
+
readonly kind: 'flows.changed';
|
|
3
|
+
readonly version: 1;
|
|
4
|
+
}
|
|
5
|
+
export type FlowChangeEvent = {
|
|
2
6
|
readonly kind: 'draft.changed';
|
|
3
|
-
readonly
|
|
7
|
+
readonly flowId: string;
|
|
4
8
|
readonly revisionId: string;
|
|
5
9
|
readonly version: 1;
|
|
6
10
|
} | {
|
|
7
11
|
readonly flowId: string;
|
|
8
12
|
readonly kind: 'run.created';
|
|
9
|
-
readonly projectId: string;
|
|
10
13
|
readonly runId: string;
|
|
11
14
|
readonly version: 1;
|
|
12
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FlowDocument, Graph, JsonValue, RevisionContent, TriggerNode } from '@oomol-lab/open-flow/flow-change';
|
|
2
2
|
import type { EngineContract } from './engine-contract.js';
|
|
3
3
|
import type { RuntimeProgram } from './runtime-contract.js';
|
|
4
4
|
export interface SemanticClosure {
|
|
@@ -11,7 +11,7 @@ export interface SemanticClosure {
|
|
|
11
11
|
};
|
|
12
12
|
readonly digest: string;
|
|
13
13
|
}
|
|
14
|
-
export declare function flowClosure(content: RevisionContent
|
|
14
|
+
export declare function flowClosure(content: RevisionContent): Promise<SemanticClosure>;
|
|
15
15
|
export interface Diagnostic {
|
|
16
16
|
readonly code: string;
|
|
17
17
|
readonly column: number;
|
|
@@ -26,30 +26,27 @@ export interface FlowValidation {
|
|
|
26
26
|
}
|
|
27
27
|
export declare function triggerPayloadSchema(trigger: TriggerNode): JsonValue;
|
|
28
28
|
export declare function matchesSchema(value: JsonValue, schema: JsonValue): boolean;
|
|
29
|
-
export type FlowInputsValidation = '
|
|
30
|
-
export declare function validateFlowInputs(revision: RevisionContent,
|
|
29
|
+
export type FlowInputsValidation = 'invalid' | 'valid';
|
|
30
|
+
export declare function validateFlowInputs(revision: RevisionContent, value: unknown): FlowInputsValidation;
|
|
31
31
|
export declare function validateModules(revision: RevisionContent, moduleIds: readonly string[], engine: EngineContract): readonly Diagnostic[];
|
|
32
|
-
export declare function validateFlow(revision: RevisionContent,
|
|
32
|
+
export declare function validateFlow(revision: RevisionContent, engine: EngineContract): Promise<FlowValidation>;
|
|
33
33
|
export interface PreparedFlow {
|
|
34
34
|
readonly closureDigest: string;
|
|
35
35
|
readonly engineContract: string;
|
|
36
|
-
readonly
|
|
37
|
-
readonly flowId: string;
|
|
36
|
+
readonly graph: Graph;
|
|
38
37
|
readonly modules: RevisionContent['modules'];
|
|
39
|
-
readonly subflows:
|
|
40
|
-
readonly tasks:
|
|
38
|
+
readonly subflows: FlowDocument['subflows'];
|
|
39
|
+
readonly tasks: FlowDocument['tasks'];
|
|
41
40
|
}
|
|
42
41
|
export type PrepareFlowResult = {
|
|
43
42
|
readonly kind: 'engine-unsupported';
|
|
44
43
|
} | {
|
|
45
44
|
readonly kind: 'flow-invalid';
|
|
46
45
|
readonly validation: FlowValidation;
|
|
47
|
-
} | {
|
|
48
|
-
readonly kind: 'flow-not-found';
|
|
49
46
|
} | {
|
|
50
47
|
readonly flow: PreparedFlow;
|
|
51
48
|
readonly kind: 'prepared';
|
|
52
49
|
readonly validation: FlowValidation;
|
|
53
50
|
};
|
|
54
|
-
export declare function prepareFlow(revision: RevisionContent,
|
|
51
|
+
export declare function prepareFlow(revision: RevisionContent, engineContract: string): Promise<PrepareFlowResult>;
|
|
55
52
|
export declare function createRuntimeProgram(prepared: PreparedFlow, entryModuleId: string, engineDigest: string): RuntimeProgram | undefined;
|
|
@@ -7862,7 +7862,7 @@ function An(e) {
|
|
|
7862
7862
|
return e == "open-flow-engine/v1" ? kn : void 0;
|
|
7863
7863
|
}
|
|
7864
7864
|
//#endregion
|
|
7865
|
-
//#region src/
|
|
7865
|
+
//#region src/flow/common/encoding.ts
|
|
7866
7866
|
var jn = new TextEncoder();
|
|
7867
7867
|
function Mn(e) {
|
|
7868
7868
|
if (e == null || typeof e == "boolean" || typeof e == "string" || typeof e == "number") return JSON.stringify(e);
|
|
@@ -8075,59 +8075,53 @@ function Jn(e) {
|
|
|
8075
8075
|
};
|
|
8076
8076
|
}
|
|
8077
8077
|
//#endregion
|
|
8078
|
-
//#region src/
|
|
8078
|
+
//#region src/flow/common/semantics.ts
|
|
8079
8079
|
function Yn(e) {
|
|
8080
8080
|
return Object.keys(e).toSorted().map((t) => [t, e[t]]);
|
|
8081
8081
|
}
|
|
8082
|
-
async function Xn(e
|
|
8083
|
-
let n =
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
function c(e) {
|
|
8087
|
-
r.add(e);
|
|
8082
|
+
async function Xn(e) {
|
|
8083
|
+
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
8084
|
+
function o(e) {
|
|
8085
|
+
t.add(e);
|
|
8088
8086
|
}
|
|
8089
|
-
function
|
|
8090
|
-
if (
|
|
8091
|
-
|
|
8087
|
+
function s(t) {
|
|
8088
|
+
if (r.has(t)) return;
|
|
8089
|
+
r.add(t);
|
|
8092
8090
|
let n = e.modules[t];
|
|
8093
|
-
if (n != null) for (let e of n.imports.toSorted())
|
|
8091
|
+
if (n != null) for (let e of n.imports.toSorted()) s(e);
|
|
8094
8092
|
}
|
|
8095
|
-
function
|
|
8096
|
-
for (let t of Object.values(e)) if (t.kind == "sources") for (let e of t.sources) e.kind == "binding" && (
|
|
8093
|
+
function c(e) {
|
|
8094
|
+
for (let t of Object.values(e)) if (t.kind == "sources") for (let e of t.sources) e.kind == "binding" && (n.add(e.bindingId), o(e.bindingId));
|
|
8097
8095
|
}
|
|
8098
|
-
function
|
|
8099
|
-
for (let [, t] of Yn(e.nodes)) switch ("inputs" in t &&
|
|
8096
|
+
function l(e) {
|
|
8097
|
+
for (let [, t] of Yn(e.nodes)) switch ("inputs" in t && c(t.inputs), t.kind) {
|
|
8100
8098
|
case "condition": break;
|
|
8101
8099
|
case "subflow":
|
|
8102
|
-
|
|
8100
|
+
u(t.subflowId);
|
|
8103
8101
|
break;
|
|
8104
8102
|
case "task":
|
|
8105
|
-
t.task == null ?
|
|
8103
|
+
t.task == null ? a.add(t.taskId) : s(t.task.moduleId);
|
|
8106
8104
|
break;
|
|
8107
8105
|
case "value": break;
|
|
8108
8106
|
case "poll":
|
|
8109
|
-
case "integration":
|
|
8107
|
+
case "integration": o(t.bindingId);
|
|
8110
8108
|
}
|
|
8111
8109
|
}
|
|
8112
|
-
function
|
|
8113
|
-
if (
|
|
8114
|
-
|
|
8110
|
+
function u(t) {
|
|
8111
|
+
if (i.has(t)) return;
|
|
8112
|
+
i.add(t);
|
|
8115
8113
|
let n = e.document.subflows[t];
|
|
8116
|
-
n != null &&
|
|
8114
|
+
n != null && l(n.graph);
|
|
8117
8115
|
}
|
|
8118
|
-
|
|
8119
|
-
let
|
|
8120
|
-
bindings: Object.fromEntries([...
|
|
8121
|
-
|
|
8122
|
-
graph: Vn(n.graph),
|
|
8123
|
-
id: t,
|
|
8124
|
-
name: n.name
|
|
8125
|
-
},
|
|
8116
|
+
l(e.document.graph);
|
|
8117
|
+
let d = Nn({
|
|
8118
|
+
bindings: Object.fromEntries([...t].toSorted().map((t) => [t, e.document.bindings[t] ?? null])),
|
|
8119
|
+
graph: Vn(e.document.graph),
|
|
8126
8120
|
kind: "open-flow-semantic-closure",
|
|
8127
8121
|
modelVersion: e.modelVersion,
|
|
8128
|
-
modules: Object.fromEntries([...
|
|
8129
|
-
tasks: Object.fromEntries([...
|
|
8130
|
-
subflows: Object.fromEntries([...
|
|
8122
|
+
modules: Object.fromEntries([...r].toSorted().map((t) => [t, e.modules[t] == null ? null : Jn(e.modules[t])])),
|
|
8123
|
+
tasks: Object.fromEntries([...a].toSorted().map((t) => [t, e.document.tasks[t] == null ? null : Hn(e.document.tasks[t])])),
|
|
8124
|
+
subflows: Object.fromEntries([...i].toSorted().map((t) => {
|
|
8131
8125
|
let n = e.document.subflows[t];
|
|
8132
8126
|
return n == null ? [t, null] : [t, {
|
|
8133
8127
|
graph: Vn(n.graph),
|
|
@@ -8140,13 +8134,13 @@ async function Xn(e, t) {
|
|
|
8140
8134
|
});
|
|
8141
8135
|
return {
|
|
8142
8136
|
dependencies: {
|
|
8143
|
-
bindings:
|
|
8144
|
-
inputBindings:
|
|
8145
|
-
modules:
|
|
8146
|
-
subflows:
|
|
8147
|
-
tasks:
|
|
8137
|
+
bindings: t,
|
|
8138
|
+
inputBindings: n,
|
|
8139
|
+
modules: r,
|
|
8140
|
+
subflows: i,
|
|
8141
|
+
tasks: a
|
|
8148
8142
|
},
|
|
8149
|
-
digest: await Pn(
|
|
8143
|
+
digest: await Pn(d)
|
|
8150
8144
|
};
|
|
8151
8145
|
}
|
|
8152
8146
|
function Zn(e) {
|
|
@@ -8473,44 +8467,43 @@ function dr(e, t, n, r, i, a) {
|
|
|
8473
8467
|
}
|
|
8474
8468
|
ur(e, i, a);
|
|
8475
8469
|
}
|
|
8476
|
-
function fr(e, t
|
|
8477
|
-
let
|
|
8478
|
-
function a
|
|
8479
|
-
for (let [s, c] of Object.entries(
|
|
8470
|
+
function fr(e, t) {
|
|
8471
|
+
let n = /* @__PURE__ */ new Set(), r = [];
|
|
8472
|
+
function i(a, o) {
|
|
8473
|
+
for (let [s, c] of Object.entries(a.nodes)) {
|
|
8480
8474
|
if (c.kind != "subflow" || e.subflows[c.subflowId] == null) continue;
|
|
8481
|
-
let
|
|
8482
|
-
if (
|
|
8483
|
-
|
|
8475
|
+
let a = r.indexOf(c.subflowId);
|
|
8476
|
+
if (a >= 0) {
|
|
8477
|
+
t.push(Y("subflow.cycle", `Subflow cycle is not executable: ${[...r.slice(a), c.subflowId].join(" -> ")}.`, `${o}/nodes/${s}/subflowId`));
|
|
8484
8478
|
continue;
|
|
8485
8479
|
}
|
|
8486
|
-
|
|
8480
|
+
n.has(c.subflowId) || (n.add(c.subflowId), r.push(c.subflowId), i(e.subflows[c.subflowId].graph, `/document/subflows/${c.subflowId}/graph`), r.pop());
|
|
8487
8481
|
}
|
|
8488
8482
|
}
|
|
8489
|
-
|
|
8483
|
+
i(e.graph, "/document/graph");
|
|
8490
8484
|
}
|
|
8491
|
-
function pr(e, t
|
|
8492
|
-
let
|
|
8493
|
-
dr(
|
|
8494
|
-
for (let
|
|
8495
|
-
let
|
|
8496
|
-
if (
|
|
8497
|
-
let i = `/document/subflows/${
|
|
8498
|
-
dr(
|
|
8499
|
-
for (let [
|
|
8500
|
-
}
|
|
8501
|
-
return fr(e.document,
|
|
8502
|
-
}
|
|
8503
|
-
function mr(e, t
|
|
8504
|
-
if (typeof
|
|
8505
|
-
let
|
|
8506
|
-
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
let a = or(e.document, n);
|
|
8485
|
+
function pr(e, t) {
|
|
8486
|
+
let n = [];
|
|
8487
|
+
dr(e.document.graph, e.document, void 0, !0, "/document/graph", n);
|
|
8488
|
+
for (let r of [...t.dependencies.subflows].toSorted()) {
|
|
8489
|
+
let t = e.document.subflows[r];
|
|
8490
|
+
if (t == null) continue;
|
|
8491
|
+
let i = `/document/subflows/${r}`, a = new Set(Object.keys(t.inputs));
|
|
8492
|
+
dr(t.graph, e.document, a, !1, `${i}/graph`, n);
|
|
8493
|
+
for (let [r, o] of Object.entries(t.outputs)) for (let s of o.sources) cr(s, t.graph, e.document, a, void 0, `${i}/outputs/${r}/sources`, n);
|
|
8494
|
+
}
|
|
8495
|
+
return fr(e.document, n), n;
|
|
8496
|
+
}
|
|
8497
|
+
function mr(e, t) {
|
|
8498
|
+
if (typeof t != "object" || !t || Array.isArray(t)) return "invalid";
|
|
8499
|
+
let n = e.document.graph;
|
|
8500
|
+
for (let [r, i] of Object.entries(t)) {
|
|
8501
|
+
let t = n.nodes[r];
|
|
8502
|
+
if (t == null || !("inputs" in t) || typeof i != "object" || !i || Array.isArray(i)) return "invalid";
|
|
8503
|
+
let a = or(e.document, t);
|
|
8511
8504
|
for (let e of Object.keys(i)) {
|
|
8512
|
-
let
|
|
8513
|
-
if (
|
|
8505
|
+
let n = a[e];
|
|
8506
|
+
if (n == null || t.inputs[e] != null || Object.hasOwn(n, "value")) return "invalid";
|
|
8514
8507
|
}
|
|
8515
8508
|
}
|
|
8516
8509
|
return "valid";
|
|
@@ -8596,45 +8589,44 @@ function hr(e, t, n) {
|
|
|
8596
8589
|
function gr(e, t, n) {
|
|
8597
8590
|
return hr(e, t, n).diagnostics.toSorted(nr);
|
|
8598
8591
|
}
|
|
8599
|
-
async function _r(e, t
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
i.
|
|
8603
|
-
let a = [[`/document/flows/${t}/graph`, e.document.flows[t].graph], ...[...r.dependencies.subflows].toSorted().flatMap((t) => {
|
|
8592
|
+
async function _r(e, t) {
|
|
8593
|
+
let n = await Xn(e), r = hr(e, [...n.dependencies.modules], t);
|
|
8594
|
+
r.diagnostics.push(...pr(e, n));
|
|
8595
|
+
let i = [["/document/graph", e.document.graph], ...[...n.dependencies.subflows].toSorted().flatMap((t) => {
|
|
8604
8596
|
let n = e.document.subflows[t];
|
|
8605
8597
|
return n == null ? [] : [[`/document/subflows/${t}/graph`, n.graph]];
|
|
8606
|
-
})],
|
|
8607
|
-
for (let [t, n] of
|
|
8608
|
-
e.modules[
|
|
8598
|
+
})], a = /* @__PURE__ */ new Set();
|
|
8599
|
+
for (let [t, n] of i) for (let [i, o] of Object.entries(n.nodes)) if (o.kind == "task" && o.task != null) {
|
|
8600
|
+
e.modules[o.task.moduleId] == null ? r.diagnostics.push({
|
|
8609
8601
|
code: "task.module-missing",
|
|
8610
8602
|
column: 0,
|
|
8611
8603
|
line: 1,
|
|
8612
|
-
message: `Inline Task "${
|
|
8613
|
-
path: `${t}/nodes/${
|
|
8614
|
-
}) : !
|
|
8604
|
+
message: `Inline Task "${i}" references missing CodeModule "${o.task.moduleId}".`,
|
|
8605
|
+
path: `${t}/nodes/${i}/task/moduleId`
|
|
8606
|
+
}) : !r.analysis.get(o.task.moduleId)?.exports.has("default") && !a.has(o.task.moduleId) && (a.add(o.task.moduleId), r.diagnostics.push({
|
|
8615
8607
|
code: "task.missing-entry",
|
|
8616
8608
|
column: 0,
|
|
8617
8609
|
line: 1,
|
|
8618
|
-
message: `CodeModule "${
|
|
8619
|
-
path: `/modules/${
|
|
8610
|
+
message: `CodeModule "${o.task.moduleId}" used by an Inline Task must export a default function.`,
|
|
8611
|
+
path: `/modules/${o.task.moduleId}/source`
|
|
8620
8612
|
}));
|
|
8621
|
-
for (let [e, n] of (
|
|
8613
|
+
for (let [e, n] of (o.task.capabilities ?? []).entries()) n.action.length > 0 && n.connectionId.length > 0 || r.diagnostics.push({
|
|
8622
8614
|
code: "task.capability-incomplete",
|
|
8623
8615
|
column: 0,
|
|
8624
8616
|
line: 1,
|
|
8625
|
-
message: `Inline Task "${
|
|
8626
|
-
path: `${t}/nodes/${
|
|
8617
|
+
message: `Inline Task "${i}" has an incomplete Connector Capability.`,
|
|
8618
|
+
path: `${t}/nodes/${i}/task/capabilities/${e}`
|
|
8627
8619
|
});
|
|
8628
8620
|
}
|
|
8629
|
-
for (let t of [...
|
|
8621
|
+
for (let t of [...n.dependencies.tasks].toSorted()) {
|
|
8630
8622
|
let n = e.document.tasks[t];
|
|
8631
|
-
n != null && (n.executor.kind == "connector" && n.executor.action.length == 0 &&
|
|
8623
|
+
n != null && (n.executor.kind == "connector" && n.executor.action.length == 0 && r.diagnostics.push({
|
|
8632
8624
|
code: "task.connector-incomplete",
|
|
8633
8625
|
column: 0,
|
|
8634
8626
|
line: 1,
|
|
8635
8627
|
message: `Connector Task "${t}" requires an action.`,
|
|
8636
8628
|
path: `/document/tasks/${t}/executor`
|
|
8637
|
-
}), n.executor.kind == "connector" && n.executor.connectionId == null &&
|
|
8629
|
+
}), n.executor.kind == "connector" && n.executor.connectionId == null && r.diagnostics.push({
|
|
8638
8630
|
code: "task.connector-connection-required",
|
|
8639
8631
|
column: 0,
|
|
8640
8632
|
line: 1,
|
|
@@ -8642,35 +8634,33 @@ async function _r(e, t, n) {
|
|
|
8642
8634
|
path: `/document/tasks/${t}/executor/connectionId`
|
|
8643
8635
|
}));
|
|
8644
8636
|
}
|
|
8645
|
-
let
|
|
8637
|
+
let o = r.diagnostics.toSorted(nr);
|
|
8646
8638
|
return {
|
|
8647
|
-
closure:
|
|
8648
|
-
diagnostics:
|
|
8649
|
-
valid:
|
|
8639
|
+
closure: n,
|
|
8640
|
+
diagnostics: o,
|
|
8641
|
+
valid: o.length == 0
|
|
8650
8642
|
};
|
|
8651
8643
|
}
|
|
8652
|
-
async function vr(e, t
|
|
8653
|
-
let
|
|
8654
|
-
if (
|
|
8655
|
-
let
|
|
8656
|
-
if (
|
|
8657
|
-
if (!i.valid) return {
|
|
8644
|
+
async function vr(e, t) {
|
|
8645
|
+
let n = An(t);
|
|
8646
|
+
if (n == null) return { kind: "engine-unsupported" };
|
|
8647
|
+
let r = await _r(e, n);
|
|
8648
|
+
if (!r.valid) return {
|
|
8658
8649
|
kind: "flow-invalid",
|
|
8659
|
-
validation:
|
|
8650
|
+
validation: r
|
|
8660
8651
|
};
|
|
8661
|
-
let { closure:
|
|
8652
|
+
let { closure: i } = r;
|
|
8662
8653
|
return {
|
|
8663
8654
|
flow: {
|
|
8664
|
-
closureDigest:
|
|
8665
|
-
engineContract:
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
tasks: Object.fromEntries([...a.dependencies.tasks].toSorted().map((t) => [t, e.document.tasks[t]]))
|
|
8655
|
+
closureDigest: i.digest,
|
|
8656
|
+
engineContract: t,
|
|
8657
|
+
graph: e.document.graph,
|
|
8658
|
+
modules: Object.fromEntries([...i.dependencies.modules].toSorted().map((t) => [t, e.modules[t]])),
|
|
8659
|
+
subflows: Object.fromEntries([...i.dependencies.subflows].toSorted().map((t) => [t, e.document.subflows[t]])),
|
|
8660
|
+
tasks: Object.fromEntries([...i.dependencies.tasks].toSorted().map((t) => [t, e.document.tasks[t]]))
|
|
8671
8661
|
},
|
|
8672
8662
|
kind: "prepared",
|
|
8673
|
-
validation:
|
|
8663
|
+
validation: r
|
|
8674
8664
|
};
|
|
8675
8665
|
}
|
|
8676
8666
|
function yr(e, t, n) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConnectorProxy } from './connector-proxy.js';
|
|
2
|
-
import type { IntegrationEndpointMethod, JsonValue, TriggerKeySnapshot } from '../browser/
|
|
2
|
+
import type { IntegrationEndpointMethod, JsonValue, TriggerKeySnapshot } from '../browser/flow-change.js';
|
|
3
3
|
export declare const maximumIntegrationBodyBytes: number;
|
|
4
4
|
export declare const maximumIntegrationDeliveryPages = 5;
|
|
5
5
|
export type IntegrationReceiveResult = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConnectorProxy } from './connector-proxy.js';
|
|
2
|
-
import type { JsonValue, TriggerKeySnapshot, TriggerSchedule } from '../browser/
|
|
2
|
+
import type { JsonValue, TriggerKeySnapshot, TriggerSchedule } from '../browser/flow-change.js';
|
|
3
3
|
export declare const maximumPollCheckpointBytes: number;
|
|
4
4
|
export declare const maximumPollDedupeKeyBytes = 1024;
|
|
5
5
|
export declare const maximumPollEventsPerPage = 100;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CodeModule, JsonValue } from '../browser/
|
|
1
|
+
import type { CodeModule, JsonValue } from '../browser/flow-change.js';
|
|
2
2
|
export { currentEngineContract, findEngineContract, type EngineContract } from './engine-contract.js';
|
|
3
3
|
export type RuntimeModule = Pick<CodeModule, 'imports' | 'source'>;
|
|
4
4
|
export interface RuntimeProgram {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ConnectorCapability, JsonValue } from '../browser/
|
|
2
|
-
import type { PreparedFlow } from './
|
|
1
|
+
import type { ConnectorCapability, JsonValue } from '../browser/flow-change.js';
|
|
2
|
+
import type { PreparedFlow } from './flow-semantics.js';
|
|
3
3
|
export type SchedulerEvent = {
|
|
4
4
|
readonly flowId: string;
|
|
5
5
|
readonly parentJobId?: string;
|
|
@@ -88,6 +88,7 @@ export interface SchedulerFailure {
|
|
|
88
88
|
export interface FlowRunOptions {
|
|
89
89
|
readonly createId: () => string;
|
|
90
90
|
readonly emit?: (event: SchedulerEvent) => void | Promise<void>;
|
|
91
|
+
readonly flowId: string;
|
|
91
92
|
readonly inputs?: Readonly<Record<string, Readonly<Record<string, JsonValue>>>>;
|
|
92
93
|
readonly invokeTask: (invocation: TaskInvocation) => Promise<unknown>;
|
|
93
94
|
readonly projectFailure?: (error: unknown) => SchedulerFailure;
|
package/dist/common/scheduler.js
CHANGED
|
@@ -356,8 +356,8 @@ async function h(t, n, u, p, g, v, y = {}, b, x) {
|
|
|
356
356
|
}), W;
|
|
357
357
|
}
|
|
358
358
|
async function g(e, t) {
|
|
359
|
-
let n = async (e) => await t.emit?.(e), r = t.signal ?? new AbortController().signal, i = t.trigger == null ? void 0 : e.
|
|
360
|
-
if (t.trigger != null && (i == null || "inputs" in i)) throw Error(`Node "${t.trigger.nodeId}" is not a TriggerNode in Flow "${
|
|
359
|
+
let n = async (e) => await t.emit?.(e), r = t.signal ?? new AbortController().signal, i = t.trigger == null ? void 0 : e.graph.nodes[t.trigger.nodeId];
|
|
360
|
+
if (t.trigger != null && (i == null || "inputs" in i)) throw Error(`Node "${t.trigger.nodeId}" is not a TriggerNode in Flow "${t.flowId}".`);
|
|
361
361
|
return await h({
|
|
362
362
|
createId: t.createId,
|
|
363
363
|
emit: n,
|
|
@@ -365,8 +365,8 @@ async function g(e, t) {
|
|
|
365
365
|
prepared: e,
|
|
366
366
|
projectFailure: t.projectFailure
|
|
367
367
|
}, {
|
|
368
|
-
flowId:
|
|
369
|
-
graph: _(e.
|
|
368
|
+
flowId: t.flowId,
|
|
369
|
+
graph: _(e.graph),
|
|
370
370
|
inputs: {},
|
|
371
371
|
kind: "flow",
|
|
372
372
|
outputs: {}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JsonValue, WebhookInputDefinition, WebhookOptions } from '../browser/
|
|
1
|
+
import type { JsonValue, WebhookInputDefinition, 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>;
|
|
@@ -159,7 +159,7 @@ var u = [], d = [{
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
|
-
name: "prevents
|
|
162
|
+
name: "prevents Flow responses from becoming executable or controlling deployment headers",
|
|
163
163
|
async verify(e) {
|
|
164
164
|
await c(await l(e), {
|
|
165
165
|
body: "<script>globalThis.compromised = true<\/script>",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oomol-lab/open-flow",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.6",
|
|
4
4
|
"description": "TypeScript contracts and Browser runtime for Open Flow.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -45,21 +45,21 @@
|
|
|
45
45
|
"types": "./dist/common/provider-triggers.d.ts",
|
|
46
46
|
"import": "./dist/common/provider-triggers.js"
|
|
47
47
|
},
|
|
48
|
-
"./
|
|
49
|
-
"types": "./dist/browser/
|
|
50
|
-
"import": "./dist/browser/
|
|
48
|
+
"./flow-authoring": {
|
|
49
|
+
"types": "./dist/browser/flow-authoring.d.ts",
|
|
50
|
+
"import": "./dist/browser/flow-authoring.js"
|
|
51
51
|
},
|
|
52
|
-
"./
|
|
53
|
-
"types": "./dist/browser/
|
|
54
|
-
"import": "./dist/browser/
|
|
52
|
+
"./flow-change": {
|
|
53
|
+
"types": "./dist/browser/flow-change.d.ts",
|
|
54
|
+
"import": "./dist/browser/flow-change.js"
|
|
55
55
|
},
|
|
56
|
-
"./
|
|
57
|
-
"types": "./dist/common/
|
|
58
|
-
"import": "./dist/common/
|
|
56
|
+
"./flow-encoding": {
|
|
57
|
+
"types": "./dist/common/flow-encoding.d.ts",
|
|
58
|
+
"import": "./dist/common/flow-encoding.js"
|
|
59
59
|
},
|
|
60
|
-
"./
|
|
61
|
-
"types": "./dist/common/
|
|
62
|
-
"import": "./dist/common/
|
|
60
|
+
"./flow-semantics": {
|
|
61
|
+
"types": "./dist/common/flow-semantics.d.ts",
|
|
62
|
+
"import": "./dist/common/flow-semantics.js"
|
|
63
63
|
},
|
|
64
64
|
"./run-lifecycle": {
|
|
65
65
|
"types": "./dist/common/run-lifecycle.d.ts",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ChangeOperation } from './project-change.js';
|
|
2
|
-
export declare function createFlow(flowId: string, name: string): readonly ChangeOperation[];
|
|
3
|
-
export declare function renameFlow(flowId: string, name: string): readonly ChangeOperation[];
|
|
4
|
-
export declare function deleteFlow(flowId: string): readonly ChangeOperation[];
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { connect, disconnect } from './project-authoring-edge.js';
|
|
2
|
-
export { createFlow, deleteFlow, renameFlow } from './project-authoring-flow.js';
|
|
3
|
-
export { imports as moduleImports, rename as renameModule, replaceSource as replaceModuleSource } from './project-authoring-module.js';
|
|
4
|
-
export { createBuiltinTrigger, createCodeTask, createCondition, createLlmTask, createManagedTask, createProviderTrigger, createValue, deleteNodes, setConnectorConnection, setInputValues, setTriggerConnection, updateSettings, updateTrigger, } from './project-authoring-node.js';
|