@oomol-lab/open-flow 0.1.0-beta.51 → 0.1.0-beta.53
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-BDtXpRSt.js → createResourceDialog-BsaBMf7_.js} +2 -1
- package/dist/browser/flow-authoring.js +46 -3
- package/dist/browser/flow-change.d.ts +6 -1
- package/dist/browser/flow-change.js +46 -3
- package/dist/browser/{flowChanges-BWSXSnMX.js → flowChanges-CcscgZsW.js} +3492 -1939
- package/dist/browser/{flowWorkspace-DBaq2Eks.js → flowWorkspace-CoT_ewLX.js} +904 -330
- package/dist/browser/{workbenchSelect-C9kwcUmN.js → icons-0s-Q_3lp.js} +48 -32
- package/dist/browser/licenses.md +204 -0
- package/dist/browser/preview.css +282 -179
- package/dist/browser/preview.js +4311 -2200
- package/dist/browser/theme.css +2 -0
- package/dist/browser/ui-hostNavigationActions.d.ts +13 -0
- package/dist/browser/ui-hostTooltip.d.ts +8 -0
- package/dist/browser/ui-logo.d.ts +5 -0
- package/dist/browser/ui.css +82 -8
- package/dist/browser/ui.d.ts +3 -0
- package/dist/browser/ui.js +172 -8
- package/dist/browser/workbench-contract.d.ts +4 -11
- package/dist/browser/workbench.css +346 -200
- package/dist/browser/workbench.d.ts +1 -1
- package/dist/browser/workbench.js +1056 -367
- package/dist/browser/workbenchSelect-BqUPacsr.js +31 -0
- package/dist/common/authoringExamples.d.ts +4 -3
- package/dist/common/connector-proxy.d.ts +32 -0
- package/dist/common/control-api-conformance.js +54 -3
- package/dist/common/control-api.d.ts +6 -0
- package/dist/common/control-api.js +58 -4
- package/dist/common/control-requests.d.ts +4 -0
- package/dist/common/control-requests.js +1299 -68
- package/dist/common/feishu-subscriptions.d.ts +1 -5
- package/dist/common/flow-connectionUsage.d.ts +1 -0
- package/dist/common/flow-encoding.js +34 -0
- package/dist/common/flow-semantics.js +675 -252
- package/dist/common/integration-trigger.js +23 -0
- package/dist/common/mcp.js +54 -3
- package/dist/common/openapi.d.ts +53 -0
- package/dist/common/openapi.js +10390 -0
- package/dist/common/poll-trigger.js +23 -0
- package/dist/common/provider-triggers.d.ts +1 -1
- package/dist/common/provider-triggers.js +166 -16204
- package/dist/common/run-events.js +1 -0
- package/dist/common/scheduler.d.ts +1 -1
- package/dist/common/scheduler.js +31 -1
- package/dist/common/webhook-trigger.js +23 -0
- package/package.json +5 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { i as useTranslate } from "./main-BPABKzwN.js";
|
|
2
|
-
import { C as
|
|
2
|
+
import { C as FieldError, Pr as Button, S as FieldDescription, T as FieldLabel, b as Spinner, c as DialogTitle, i as DialogContent, jn as Input, n as Dialog, o as DialogFooter, r as DialogClose, s as DialogHeader, t as Icon, w as FieldGroup, x as Field } from "./icons-0s-Q_3lp.js";
|
|
3
|
+
import { t as WorkbenchSelect } from "./workbenchSelect-BqUPacsr.js";
|
|
3
4
|
import { useEffect, useRef, useState } from "react";
|
|
4
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
//#region src/workbench/browser/runtime/shell/createResourceDialog.tsx
|
|
@@ -128,6 +128,15 @@ function rename(moduleId, before, name) {
|
|
|
128
128
|
}];
|
|
129
129
|
}
|
|
130
130
|
//#endregion
|
|
131
|
+
//#region src/openapi/common/authBindings.ts
|
|
132
|
+
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
133
|
+
function assertOpenApiAuthBindings(document) {
|
|
134
|
+
for (const graph of [document.graph, ...Object.values(document.subflows).map((subflow) => subflow.graph)]) for (const node of Object.values(graph.nodes)) {
|
|
135
|
+
if (node.kind != "task" || node.taskId == null || document.tasks[node.taskId]?.executor.kind != "openapi") continue;
|
|
136
|
+
for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && (mapping.kind == "value" || mapping.kind == "sources" && mapping.sources.some((source) => source.kind == "flow"))) throw new TypeError("OpenAPI authentication accepts deployment variables and upstream outputs only.");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
131
140
|
//#region src/flow/common/inputValue.ts
|
|
132
141
|
/** Converts explicit user values at authoring boundaries, never persisted legacy data. */
|
|
133
142
|
function inputValues(values) {
|
|
@@ -5847,6 +5856,24 @@ var managed = object({
|
|
|
5847
5856
|
action: text,
|
|
5848
5857
|
connectionId: text.optional()
|
|
5849
5858
|
}),
|
|
5859
|
+
object({
|
|
5860
|
+
kind: literal("openapi"),
|
|
5861
|
+
sourceUrl: text,
|
|
5862
|
+
method: text,
|
|
5863
|
+
path: text,
|
|
5864
|
+
serverUrl: text,
|
|
5865
|
+
document: json,
|
|
5866
|
+
auth: array(object({
|
|
5867
|
+
id: text,
|
|
5868
|
+
type: _enum([
|
|
5869
|
+
"bearer",
|
|
5870
|
+
"basic",
|
|
5871
|
+
"apiKey"
|
|
5872
|
+
]),
|
|
5873
|
+
name: text.optional(),
|
|
5874
|
+
in: _enum(["header", "query"]).optional()
|
|
5875
|
+
}))
|
|
5876
|
+
}),
|
|
5850
5877
|
object({
|
|
5851
5878
|
kind: literal("llm"),
|
|
5852
5879
|
mode: _enum(["chat", "json"])
|
|
@@ -6267,6 +6294,11 @@ var shapes = {
|
|
|
6267
6294
|
before: text.optional(),
|
|
6268
6295
|
value: text.optional()
|
|
6269
6296
|
},
|
|
6297
|
+
"task.openapi.set": {
|
|
6298
|
+
taskId: text,
|
|
6299
|
+
before: managed,
|
|
6300
|
+
value: managed
|
|
6301
|
+
},
|
|
6270
6302
|
"task.agent.set": {
|
|
6271
6303
|
taskId: text,
|
|
6272
6304
|
before: managed,
|
|
@@ -6505,8 +6537,8 @@ function applyFlowChanges(content, operations) {
|
|
|
6505
6537
|
case "graph.trigger.sources.set": {
|
|
6506
6538
|
const graph = document.graph;
|
|
6507
6539
|
const node = graph.nodes[operation.nodeId];
|
|
6508
|
-
if (node?.kind != "error") invalid("The Error
|
|
6509
|
-
if (!dequal(node.sourceFlowIds, operation.before)) invalid("The Error
|
|
6540
|
+
if (node?.kind != "error") invalid("The Flow Error node does not exist.");
|
|
6541
|
+
if (!dequal(node.sourceFlowIds, operation.before)) invalid("The Flow Error node’s sources changed before this operation was applied.");
|
|
6510
6542
|
const { sourceFlowIds: _, ...base } = node;
|
|
6511
6543
|
const updated = operation.value == null ? base : {
|
|
6512
6544
|
...base,
|
|
@@ -6611,7 +6643,7 @@ function applyFlowChanges(content, operations) {
|
|
|
6611
6643
|
const graph = selectedGraph(document, operation.target);
|
|
6612
6644
|
if (graph.nodes[operation.nodeId] != null) invalid("A Node with this ID already exists in the target graph.");
|
|
6613
6645
|
if (operation.target.kind == "subflow" && !("inputs" in operation.node)) invalid("Trigger Nodes cannot be created inside a Subflow.");
|
|
6614
|
-
if (operation.node.kind == "error" && Object.values(graph.nodes).some((node) => node.kind == "error")) invalid("A graph can contain only one Error
|
|
6646
|
+
if (operation.node.kind == "error" && Object.values(graph.nodes).some((node) => node.kind == "error")) invalid("A graph can contain only one Flow Error node.");
|
|
6615
6647
|
if (operation.node.kind == "manual" && Object.values(graph.nodes).some((node) => node.kind == "manual")) invalid("A graph can contain only one manual Trigger.");
|
|
6616
6648
|
if (operation.node.kind == "task" && operation.node.task?.capabilities !== void 0) decodeConnectorCapabilities(operation.node.task.capabilities);
|
|
6617
6649
|
if (operation.node.name == null) invalid("A Node name cannot be empty.");
|
|
@@ -6949,6 +6981,16 @@ function applyFlowChanges(content, operations) {
|
|
|
6949
6981
|
document.tasks = tasks;
|
|
6950
6982
|
break;
|
|
6951
6983
|
}
|
|
6984
|
+
case "task.openapi.set": {
|
|
6985
|
+
const task = document.tasks[operation.taskId];
|
|
6986
|
+
if (task?.executor.kind != "openapi" || operation.value.executor.kind != "openapi") invalid("The OpenAPI Task does not exist.");
|
|
6987
|
+
if (!dequal(task, operation.before)) invalid("The OpenAPI Task changed before this operation was applied.");
|
|
6988
|
+
document.tasks = {
|
|
6989
|
+
...document.tasks,
|
|
6990
|
+
[operation.taskId]: operation.value
|
|
6991
|
+
};
|
|
6992
|
+
break;
|
|
6993
|
+
}
|
|
6952
6994
|
case "task.agent.set": {
|
|
6953
6995
|
const task = document.tasks[operation.taskId];
|
|
6954
6996
|
if (task?.executor.kind != "agent" || operation.value.executor.kind != "agent") invalid("The Agent Task does not exist.");
|
|
@@ -6989,6 +7031,7 @@ function applyFlowChanges(content, operations) {
|
|
|
6989
7031
|
break;
|
|
6990
7032
|
}
|
|
6991
7033
|
}
|
|
7034
|
+
assertOpenApiAuthBindings(document);
|
|
6992
7035
|
return {
|
|
6993
7036
|
document,
|
|
6994
7037
|
modelVersion: 5,
|
|
@@ -119,7 +119,7 @@ export interface ConditionNode extends GraphNodeBase {
|
|
|
119
119
|
readonly matchMode: 'first' | 'all';
|
|
120
120
|
readonly kind: 'condition';
|
|
121
121
|
}
|
|
122
|
-
export type ManagedTaskExecutor = {
|
|
122
|
+
export type ManagedTaskExecutor = import('../common/openapi.js').OpenApiExecutor | {
|
|
123
123
|
readonly kind: 'connector';
|
|
124
124
|
readonly action: string;
|
|
125
125
|
readonly connectionId?: string;
|
|
@@ -495,6 +495,11 @@ export type ChangeOperation = {
|
|
|
495
495
|
} | {
|
|
496
496
|
readonly kind: 'task.delete';
|
|
497
497
|
readonly taskId: string;
|
|
498
|
+
} | {
|
|
499
|
+
readonly before: ManagedTaskDefinition;
|
|
500
|
+
readonly kind: 'task.openapi.set';
|
|
501
|
+
readonly taskId: string;
|
|
502
|
+
readonly value: ManagedTaskDefinition;
|
|
498
503
|
} | {
|
|
499
504
|
readonly before: ManagedTaskDefinition;
|
|
500
505
|
readonly kind: 'task.agent.set';
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
//#region src/openapi/common/authBindings.ts
|
|
2
|
+
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
3
|
+
function assertOpenApiAuthBindings(document) {
|
|
4
|
+
for (const graph of [document.graph, ...Object.values(document.subflows).map((subflow) => subflow.graph)]) for (const node of Object.values(graph.nodes)) {
|
|
5
|
+
if (node.kind != "task" || node.taskId == null || document.tasks[node.taskId]?.executor.kind != "openapi") continue;
|
|
6
|
+
for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && (mapping.kind == "value" || mapping.kind == "sources" && mapping.sources.some((source) => source.kind == "flow"))) throw new TypeError("OpenAPI authentication accepts deployment variables and upstream outputs only.");
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
1
10
|
//#region src/flow/common/inputValue.ts
|
|
2
11
|
/** An explicit clear suppresses the default; absent mappings still inherit it. */
|
|
3
12
|
function inputValue(mapping, fallback) {
|
|
@@ -5939,6 +5948,24 @@ var managed = object({
|
|
|
5939
5948
|
action: text,
|
|
5940
5949
|
connectionId: text.optional()
|
|
5941
5950
|
}),
|
|
5951
|
+
object({
|
|
5952
|
+
kind: literal("openapi"),
|
|
5953
|
+
sourceUrl: text,
|
|
5954
|
+
method: text,
|
|
5955
|
+
path: text,
|
|
5956
|
+
serverUrl: text,
|
|
5957
|
+
document: json,
|
|
5958
|
+
auth: array(object({
|
|
5959
|
+
id: text,
|
|
5960
|
+
type: _enum([
|
|
5961
|
+
"bearer",
|
|
5962
|
+
"basic",
|
|
5963
|
+
"apiKey"
|
|
5964
|
+
]),
|
|
5965
|
+
name: text.optional(),
|
|
5966
|
+
in: _enum(["header", "query"]).optional()
|
|
5967
|
+
}))
|
|
5968
|
+
}),
|
|
5942
5969
|
object({
|
|
5943
5970
|
kind: literal("llm"),
|
|
5944
5971
|
mode: _enum(["chat", "json"])
|
|
@@ -6359,6 +6386,11 @@ var shapes = {
|
|
|
6359
6386
|
before: text.optional(),
|
|
6360
6387
|
value: text.optional()
|
|
6361
6388
|
},
|
|
6389
|
+
"task.openapi.set": {
|
|
6390
|
+
taskId: text,
|
|
6391
|
+
before: managed,
|
|
6392
|
+
value: managed
|
|
6393
|
+
},
|
|
6362
6394
|
"task.agent.set": {
|
|
6363
6395
|
taskId: text,
|
|
6364
6396
|
before: managed,
|
|
@@ -6671,8 +6703,8 @@ function applyFlowChanges(content, operations) {
|
|
|
6671
6703
|
case "graph.trigger.sources.set": {
|
|
6672
6704
|
const graph = document.graph;
|
|
6673
6705
|
const node = graph.nodes[operation.nodeId];
|
|
6674
|
-
if (node?.kind != "error") invalid("The Error
|
|
6675
|
-
if (!dequal(node.sourceFlowIds, operation.before)) invalid("The Error
|
|
6706
|
+
if (node?.kind != "error") invalid("The Flow Error node does not exist.");
|
|
6707
|
+
if (!dequal(node.sourceFlowIds, operation.before)) invalid("The Flow Error node’s sources changed before this operation was applied.");
|
|
6676
6708
|
const { sourceFlowIds: _, ...base } = node;
|
|
6677
6709
|
const updated = operation.value == null ? base : {
|
|
6678
6710
|
...base,
|
|
@@ -6777,7 +6809,7 @@ function applyFlowChanges(content, operations) {
|
|
|
6777
6809
|
const graph = selectedGraph(document, operation.target);
|
|
6778
6810
|
if (graph.nodes[operation.nodeId] != null) invalid("A Node with this ID already exists in the target graph.");
|
|
6779
6811
|
if (operation.target.kind == "subflow" && !("inputs" in operation.node)) invalid("Trigger Nodes cannot be created inside a Subflow.");
|
|
6780
|
-
if (operation.node.kind == "error" && Object.values(graph.nodes).some((node) => node.kind == "error")) invalid("A graph can contain only one Error
|
|
6812
|
+
if (operation.node.kind == "error" && Object.values(graph.nodes).some((node) => node.kind == "error")) invalid("A graph can contain only one Flow Error node.");
|
|
6781
6813
|
if (operation.node.kind == "manual" && Object.values(graph.nodes).some((node) => node.kind == "manual")) invalid("A graph can contain only one manual Trigger.");
|
|
6782
6814
|
if (operation.node.kind == "task" && operation.node.task?.capabilities !== void 0) decodeConnectorCapabilities(operation.node.task.capabilities);
|
|
6783
6815
|
if (operation.node.name == null) invalid("A Node name cannot be empty.");
|
|
@@ -7115,6 +7147,16 @@ function applyFlowChanges(content, operations) {
|
|
|
7115
7147
|
document.tasks = tasks;
|
|
7116
7148
|
break;
|
|
7117
7149
|
}
|
|
7150
|
+
case "task.openapi.set": {
|
|
7151
|
+
const task = document.tasks[operation.taskId];
|
|
7152
|
+
if (task?.executor.kind != "openapi" || operation.value.executor.kind != "openapi") invalid("The OpenAPI Task does not exist.");
|
|
7153
|
+
if (!dequal(task, operation.before)) invalid("The OpenAPI Task changed before this operation was applied.");
|
|
7154
|
+
document.tasks = {
|
|
7155
|
+
...document.tasks,
|
|
7156
|
+
[operation.taskId]: operation.value
|
|
7157
|
+
};
|
|
7158
|
+
break;
|
|
7159
|
+
}
|
|
7118
7160
|
case "task.agent.set": {
|
|
7119
7161
|
const task = document.tasks[operation.taskId];
|
|
7120
7162
|
if (task?.executor.kind != "agent" || operation.value.executor.kind != "agent") invalid("The Agent Task does not exist.");
|
|
@@ -7155,6 +7197,7 @@ function applyFlowChanges(content, operations) {
|
|
|
7155
7197
|
break;
|
|
7156
7198
|
}
|
|
7157
7199
|
}
|
|
7200
|
+
assertOpenApiAuthBindings(document);
|
|
7158
7201
|
return {
|
|
7159
7202
|
document,
|
|
7160
7203
|
modelVersion: 5,
|