@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
|
@@ -9369,6 +9369,24 @@ var managed = object({
|
|
|
9369
9369
|
action: text,
|
|
9370
9370
|
connectionId: text.optional()
|
|
9371
9371
|
}),
|
|
9372
|
+
object({
|
|
9373
|
+
kind: literal("openapi"),
|
|
9374
|
+
sourceUrl: text,
|
|
9375
|
+
method: text,
|
|
9376
|
+
path: text,
|
|
9377
|
+
serverUrl: text,
|
|
9378
|
+
document: json,
|
|
9379
|
+
auth: array(object({
|
|
9380
|
+
id: text,
|
|
9381
|
+
type: _enum([
|
|
9382
|
+
"bearer",
|
|
9383
|
+
"basic",
|
|
9384
|
+
"apiKey"
|
|
9385
|
+
]),
|
|
9386
|
+
name: text.optional(),
|
|
9387
|
+
in: _enum(["header", "query"]).optional()
|
|
9388
|
+
}))
|
|
9389
|
+
}),
|
|
9372
9390
|
object({
|
|
9373
9391
|
kind: literal("llm"),
|
|
9374
9392
|
mode: _enum(["chat", "json"])
|
|
@@ -9789,6 +9807,11 @@ var shapes = {
|
|
|
9789
9807
|
before: text.optional(),
|
|
9790
9808
|
value: text.optional()
|
|
9791
9809
|
},
|
|
9810
|
+
"task.openapi.set": {
|
|
9811
|
+
taskId: text,
|
|
9812
|
+
before: managed,
|
|
9813
|
+
value: managed
|
|
9814
|
+
},
|
|
9792
9815
|
"task.agent.set": {
|
|
9793
9816
|
taskId: text,
|
|
9794
9817
|
before: managed,
|
package/dist/common/mcp.js
CHANGED
|
@@ -5877,6 +5877,15 @@ var runStatuses = [
|
|
|
5877
5877
|
//#region src/execution/common/wait.ts
|
|
5878
5878
|
/** Shared by decision entry points, the editor, and durable decision storage. */
|
|
5879
5879
|
var waitCommentSchema = string$1().trim().refine((value) => [...value].length <= 2e3, "Wait comment must contain at most 2,000 Unicode code points.").nullable().optional();
|
|
5880
|
+
//#endregion
|
|
5881
|
+
//#region src/openapi/common/authBindings.ts
|
|
5882
|
+
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
5883
|
+
function assertOpenApiAuthBindings(document) {
|
|
5884
|
+
for (const graph of [document.graph, ...Object.values(document.subflows).map((subflow) => subflow.graph)]) for (const node of Object.values(graph.nodes)) {
|
|
5885
|
+
if (node.kind != "task" || node.taskId == null || document.tasks[node.taskId]?.executor.kind != "openapi") continue;
|
|
5886
|
+
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.");
|
|
5887
|
+
}
|
|
5888
|
+
}
|
|
5880
5889
|
function checkJsonDepth(value, depth = 0) {
|
|
5881
5890
|
if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
|
|
5882
5891
|
if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
|
|
@@ -6007,6 +6016,24 @@ var managed = object({
|
|
|
6007
6016
|
action: text,
|
|
6008
6017
|
connectionId: text.optional()
|
|
6009
6018
|
}),
|
|
6019
|
+
object({
|
|
6020
|
+
kind: literal("openapi"),
|
|
6021
|
+
sourceUrl: text,
|
|
6022
|
+
method: text,
|
|
6023
|
+
path: text,
|
|
6024
|
+
serverUrl: text,
|
|
6025
|
+
document: json$2,
|
|
6026
|
+
auth: array(object({
|
|
6027
|
+
id: text,
|
|
6028
|
+
type: _enum([
|
|
6029
|
+
"bearer",
|
|
6030
|
+
"basic",
|
|
6031
|
+
"apiKey"
|
|
6032
|
+
]),
|
|
6033
|
+
name: text.optional(),
|
|
6034
|
+
in: _enum(["header", "query"]).optional()
|
|
6035
|
+
}))
|
|
6036
|
+
}),
|
|
6010
6037
|
object({
|
|
6011
6038
|
kind: literal("llm"),
|
|
6012
6039
|
mode: _enum(["chat", "json"])
|
|
@@ -6273,6 +6300,7 @@ function decodeRevisionContent(value) {
|
|
|
6273
6300
|
checkJsonDepth(value);
|
|
6274
6301
|
const content = revision.parse(value);
|
|
6275
6302
|
checkErrorModelVersion(content);
|
|
6303
|
+
assertOpenApiAuthBindings(content.document);
|
|
6276
6304
|
return content;
|
|
6277
6305
|
}
|
|
6278
6306
|
var shapes = {
|
|
@@ -6434,6 +6462,11 @@ var shapes = {
|
|
|
6434
6462
|
before: text.optional(),
|
|
6435
6463
|
value: text.optional()
|
|
6436
6464
|
},
|
|
6465
|
+
"task.openapi.set": {
|
|
6466
|
+
taskId: text,
|
|
6467
|
+
before: managed,
|
|
6468
|
+
value: managed
|
|
6469
|
+
},
|
|
6437
6470
|
"task.agent.set": {
|
|
6438
6471
|
taskId: text,
|
|
6439
6472
|
before: managed,
|
|
@@ -6638,14 +6671,19 @@ function accessPermissions(value) {
|
|
|
6638
6671
|
exact(source, [
|
|
6639
6672
|
"actionIds",
|
|
6640
6673
|
"allActions",
|
|
6674
|
+
"triggerIds",
|
|
6675
|
+
"allTriggers",
|
|
6641
6676
|
"configured",
|
|
6642
6677
|
"proxy"
|
|
6643
6678
|
]);
|
|
6644
|
-
if (!Array.isArray(source.actionIds) || typeof source.allActions != "boolean" || typeof source.configured != "boolean" || typeof source.proxy != "boolean") return invalidResponse();
|
|
6679
|
+
if (!Array.isArray(source.triggerIds) || typeof source.allTriggers != "boolean" || !Array.isArray(source.actionIds) || typeof source.allActions != "boolean" || typeof source.configured != "boolean" || typeof source.proxy != "boolean") return invalidResponse();
|
|
6645
6680
|
const actionIds = source.actionIds.map(string);
|
|
6646
|
-
|
|
6681
|
+
const triggerIds = source.triggerIds.map(string);
|
|
6682
|
+
if (new Set(actionIds).size != actionIds.length || source.allActions && actionIds.length != 0 || new Set(triggerIds).size != triggerIds.length || source.allTriggers && triggerIds.length != 0 || source.proxy && (!source.allActions || !source.allTriggers || source.configured)) return invalidResponse();
|
|
6647
6683
|
return {
|
|
6648
6684
|
actionIds,
|
|
6685
|
+
triggerIds,
|
|
6686
|
+
allTriggers: source.allTriggers,
|
|
6649
6687
|
allActions: source.allActions,
|
|
6650
6688
|
configured: source.configured,
|
|
6651
6689
|
proxy: source.proxy
|
|
@@ -10193,6 +10231,7 @@ function flow$1(value) {
|
|
|
10193
10231
|
revisionId: string(target.revisionId)
|
|
10194
10232
|
} },
|
|
10195
10233
|
createdAt: string(source.createdAt),
|
|
10234
|
+
...source.connectorTeamId == null ? {} : { connectorTeamId: string(source.connectorTeamId) },
|
|
10196
10235
|
draftRevisionId: string(source.draftRevisionId),
|
|
10197
10236
|
flowId: string(source.flowId),
|
|
10198
10237
|
name: string(source.name),
|
|
@@ -10774,7 +10813,7 @@ function decodeRunEvent(value) {
|
|
|
10774
10813
|
switch (kind) {
|
|
10775
10814
|
case "node.started": {
|
|
10776
10815
|
const nodeKind = payload.nodeKind;
|
|
10777
|
-
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "subflow" && nodeKind !== "value" && nodeKind !== "wait") return invalidResponse();
|
|
10816
|
+
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "openapi" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "subflow" && nodeKind !== "value" && nodeKind !== "wait") return invalidResponse();
|
|
10778
10817
|
return {
|
|
10779
10818
|
...base,
|
|
10780
10819
|
kind,
|
|
@@ -10883,6 +10922,18 @@ var ControlClient = class {
|
|
|
10883
10922
|
constructor(requestControl) {
|
|
10884
10923
|
this.requestControl = requestControl;
|
|
10885
10924
|
}
|
|
10925
|
+
async loadOpenApiDocument(url, signal) {
|
|
10926
|
+
const result = record(await this.request("/v1/openapi/document", {
|
|
10927
|
+
method: "POST",
|
|
10928
|
+
body: JSON.stringify({
|
|
10929
|
+
url,
|
|
10930
|
+
version: 1
|
|
10931
|
+
}),
|
|
10932
|
+
signal
|
|
10933
|
+
}));
|
|
10934
|
+
if (result.version != 1) return invalidResponse();
|
|
10935
|
+
return jsonValue(result.document);
|
|
10936
|
+
}
|
|
10886
10937
|
async listFlows(options = {}) {
|
|
10887
10938
|
const parameters = new URLSearchParams();
|
|
10888
10939
|
if (options.cursor != null) parameters.set("cursor", options.cursor);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { JsonValue, ManagedTaskDefinition } from '../browser/flow-change.js';
|
|
2
|
+
type ObjectValue = {
|
|
3
|
+
[key: string]: JsonValue;
|
|
4
|
+
};
|
|
5
|
+
export interface OpenApiAuth {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly type: 'bearer' | 'basic' | 'apiKey';
|
|
8
|
+
readonly name?: string;
|
|
9
|
+
readonly in?: 'header' | 'query';
|
|
10
|
+
}
|
|
11
|
+
export interface OpenApiExecutor {
|
|
12
|
+
readonly kind: 'openapi';
|
|
13
|
+
readonly sourceUrl: string;
|
|
14
|
+
readonly method: string;
|
|
15
|
+
readonly path: string;
|
|
16
|
+
readonly serverUrl: string;
|
|
17
|
+
readonly document: JsonValue;
|
|
18
|
+
readonly auth: readonly OpenApiAuth[];
|
|
19
|
+
}
|
|
20
|
+
export interface OpenApiOperation {
|
|
21
|
+
readonly method: string;
|
|
22
|
+
readonly path: string;
|
|
23
|
+
readonly label: string;
|
|
24
|
+
readonly tag: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function object(value: unknown): ObjectValue;
|
|
27
|
+
export declare function httpUrl(value: string, base?: string): string;
|
|
28
|
+
export declare function parseOpenApi(value: unknown): ObjectValue;
|
|
29
|
+
export declare function listOperations(documentValue: JsonValue): OpenApiOperation[];
|
|
30
|
+
export declare function servers(value: JsonValue, path: string, method: string): readonly ObjectValue[];
|
|
31
|
+
export declare function serverAddress(server: ObjectValue, sourceUrl: string, variables?: Readonly<Record<string, string>>): string;
|
|
32
|
+
export declare function securityOptions(value: JsonValue, path: string, method: string): readonly {
|
|
33
|
+
label: string;
|
|
34
|
+
auth?: readonly OpenApiAuth[];
|
|
35
|
+
error?: string;
|
|
36
|
+
}[];
|
|
37
|
+
export declare function snapshot(documentValue: JsonValue, path: string, method: string): JsonValue;
|
|
38
|
+
export declare function authHandles(auth: readonly OpenApiAuth[]): string[];
|
|
39
|
+
export declare function openApiTask(config: OpenApiExecutor, name?: string): ManagedTaskDefinition;
|
|
40
|
+
export interface OpenApiFieldIssue {
|
|
41
|
+
readonly field: 'sourceUrl' | 'operation' | 'serverUrl';
|
|
42
|
+
readonly message: string;
|
|
43
|
+
}
|
|
44
|
+
/** The canvas validator and property panel share the same configuration contract. */
|
|
45
|
+
export declare function openApiFieldIssues(task: ManagedTaskDefinition): OpenApiFieldIssue[];
|
|
46
|
+
export declare function openApiIssues(task: ManagedTaskDefinition): string[];
|
|
47
|
+
export declare function selectOperation(value: JsonValue, sourceUrl: string, path: string, method: string): OpenApiExecutor;
|
|
48
|
+
export declare function buildRequest(config: OpenApiExecutor, input: Readonly<Record<string, JsonValue>>): {
|
|
49
|
+
url: string;
|
|
50
|
+
init: RequestInit;
|
|
51
|
+
};
|
|
52
|
+
export declare function parseResponse(config: OpenApiExecutor, status: number, headers: Headers, text: string): Record<string, JsonValue>;
|
|
53
|
+
export {};
|