@oomol-lab/open-flow 0.1.0-beta.74 → 0.1.0-beta.75
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/README.md +1 -0
- package/dist/browser/{ContentIcon-CUQHjQIw.js → ContentIcon-FCpKiwjp.js} +2 -1
- package/dist/browser/{FlowCanvas-Dtf8_cQp.js → FlowCanvas-dzRBnlUT.js} +1 -1
- package/dist/browser/{createResourceDialog-DI9pL-Yr.js → createResourceDialog-BeYDdUl-.js} +2 -2
- package/dist/browser/{dialog-BYJGvItc.js → dialog-ZtpsFbl4.js} +284 -13
- package/dist/browser/{exportSvg-BOoy7-Db.js → exportSvg-DqXw1yf-.js} +2 -2
- package/dist/browser/{flowChanges-RL-H4CjD.js → flowChanges-b_5UobFj.js} +285 -44
- package/dist/browser/{flowWorkspace-BkDsETj0.js → flowWorkspace-ItojZbO4.js} +414 -53
- package/dist/browser/preview.css +181 -176
- package/dist/browser/preview.js +955 -182
- package/dist/browser/workbench.css +181 -176
- package/dist/browser/workbench.js +12 -6
- package/dist/browser/{workbenchSelect-BcWPWGzw.js → workbenchSelect-M441Lz0d.js} +1 -1
- package/dist/command/index.js +36 -36
- package/dist/common/authoring.d.ts +4 -4
- package/dist/common/authoringExamples.d.ts +3 -2
- package/dist/common/authoringSchema.d.ts +67 -4
- package/dist/common/control-api-conformance.js +58 -7
- package/dist/common/control-api.js +58 -7
- package/dist/common/control-requests.d.ts +3 -3
- package/dist/common/control-requests.js +234 -62
- package/dist/common/engine-contract.d.ts +1 -0
- package/dist/common/flow-authoring.js +56 -7
- package/dist/common/flow-change.d.ts +1 -1
- package/dist/common/flow-change.js +56 -7
- package/dist/common/flow-encoding.js +55 -7
- package/dist/common/flow-graph.d.ts +2 -1
- package/dist/common/flow-retry.d.ts +1 -1
- package/dist/common/flow-semantics.js +810 -577
- package/dist/common/http-request.d.ts +156 -0
- package/dist/common/http-request.js +5254 -0
- package/dist/common/mcp.d.ts +3 -3
- package/dist/common/mcp.js +58 -7
- package/dist/common/run-events.js +11 -9
- package/dist/common/runtime-contract.js +3 -0
- package/dist/common/scheduler.d.ts +1 -1
- package/dist/common/scheduler.js +70 -21
- package/dist/common/webhook-response.d.ts +0 -2
- package/dist/common/webhook-trigger.js +12 -11
- package/package.json +5 -1
- package/skills/open-flow/references/flow-authoring.md +1 -0
- package/skills/open-flow/references/flow-n8n-conversion.md +19 -15
- package/src/control/common/api.ts +1 -0
- package/src/control/common/authoring.ts +14 -3
- package/src/control/common/authoringExamples.ts +8 -0
- package/src/control/common/authoringSchema.ts +30 -24
- package/src/execution/common/engineContract.ts +4 -0
- package/src/execution/common/events.ts +3 -0
- package/src/execution/common/node-execution.ts +4 -2
- package/src/execution/common/scheduler.ts +1 -0
- package/src/flow/common/change.ts +3 -2
- package/src/flow/common/changeSchema.ts +12 -3
- package/src/flow/common/graph.ts +10 -4
- package/src/flow/common/retry.ts +1 -1
- package/src/flow/common/semantics.ts +60 -3
- package/src/flow/common/webhookResponse.ts +3 -7
- package/src/{openapi → http}/common/authBindings.ts +3 -3
- package/src/http/common/headers.ts +5 -0
- package/src/http/common/httpRequest.ts +251 -0
- package/src/trigger/common/webhook.ts +4 -3
|
@@ -10,7 +10,7 @@ export declare class AuthoringError extends Error {
|
|
|
10
10
|
}
|
|
11
11
|
export declare function authoringNode(content: RevisionContent, ref: string): {
|
|
12
12
|
ref: string;
|
|
13
|
-
type: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow";
|
|
13
|
+
type: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "http-request" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow";
|
|
14
14
|
name: string;
|
|
15
15
|
readOnly: boolean;
|
|
16
16
|
description?: string | undefined;
|
|
@@ -82,7 +82,6 @@ export declare function authoringNode(content: RevisionContent, ref: string): {
|
|
|
82
82
|
})[];
|
|
83
83
|
};
|
|
84
84
|
export declare function readAuthoring(content: RevisionContent, query?: AuthoringRead): {
|
|
85
|
-
nodes?: undefined;
|
|
86
85
|
text: {
|
|
87
86
|
node: string;
|
|
88
87
|
field: "code" | "prompt";
|
|
@@ -93,12 +92,13 @@ export declare function readAuthoring(content: RevisionContent, query?: Authorin
|
|
|
93
92
|
nextStart?: number | undefined;
|
|
94
93
|
truncated: boolean;
|
|
95
94
|
};
|
|
95
|
+
nodes?: undefined;
|
|
96
96
|
edges?: undefined;
|
|
97
97
|
} | {
|
|
98
98
|
text?: undefined;
|
|
99
99
|
nodes: {
|
|
100
100
|
ref: string;
|
|
101
|
-
type: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow";
|
|
101
|
+
type: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "http-request" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow";
|
|
102
102
|
name: string;
|
|
103
103
|
readOnly: boolean;
|
|
104
104
|
description?: string | undefined;
|
|
@@ -174,7 +174,7 @@ export declare function readAuthoring(content: RevisionContent, query?: Authorin
|
|
|
174
174
|
text?: undefined;
|
|
175
175
|
nodes: {
|
|
176
176
|
ref: string;
|
|
177
|
-
type: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow";
|
|
177
|
+
type: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "http-request" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow";
|
|
178
178
|
name: string;
|
|
179
179
|
readOnly: boolean;
|
|
180
180
|
inputHandles: string[];
|
|
@@ -8,6 +8,7 @@ declare const descriptions: {
|
|
|
8
8
|
readonly poll: 'Gmail polling by key; replace CONNECTION_ID with an active Gmail connection.';
|
|
9
9
|
readonly integration: 'Telegram webhook integration by key; replace CONNECTION_ID with an active Telegram connection.';
|
|
10
10
|
readonly decision: 'AI Decision evaluates named questions against target and returns a complete answer object per output. Configure target before running.';
|
|
11
|
+
readonly 'http-request': 'A single HTTP request. Bind url and request inputs; outputs are body, statusCode and headers.';
|
|
11
12
|
readonly openapi: 'A fixed JSON API operation. Replace the example document and URL before running.';
|
|
12
13
|
readonly connector: 'A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show. Set connectionId to an empty string to defer account configuration; execution will require an account.';
|
|
13
14
|
readonly code: 'A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions.';
|
|
@@ -22,8 +23,8 @@ declare const descriptions: {
|
|
|
22
23
|
};
|
|
23
24
|
export declare const authoringExampleNames: (keyof typeof descriptions)[];
|
|
24
25
|
export declare const authoringExamples: {
|
|
25
|
-
name: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "integration" | "llm-chat" | "llm-json" | "openapi" | "poll" | "poll-notification" | "start" | "value" | "wait" | "webhook" | "webhook-response";
|
|
26
|
-
description: "A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show. Set connectionId to an empty string to defer account configuration; execution will require an account." | "A Flow Error node. Select upstream Flows, then publish and enable this Flow to listen for failures in their automatic runs." | "A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions." | "A Start node with a required message parameter. Supply it through trigger.outputs." | "A Wait with a continue action and a built-in notification output." | "A Webhook start node." | "A condition with true and false execution branches." | "A fixed JSON API operation. Replace the example document and URL before running." | "A fixed value node." | "AI Decision evaluates named questions against target and returns a complete answer object per output. Configure target before running." | "An Agent with code computation enabled. Configure a model available in the deployment." | "An Approval with approve and reject decision branches and a built-in notification output." | "An HTTP response node with body, statusCode and headers inputs. Select it from a reachable Webhook." | "An LLM JSON Task and its node; configure a model available in the deployment." | "An LLM chat Task and its node; configure a model available in the deployment." | "An hourly scheduled start node." | "Gmail events → JavaScript text formatting → Connector notification. Replace connection/action IDs and match the notification input ports." | "Gmail polling by key; replace CONNECTION_ID with an active Gmail connection." | "Telegram webhook integration by key; replace CONNECTION_ID with an active Telegram connection.";
|
|
26
|
+
name: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "http-request" | "integration" | "llm-chat" | "llm-json" | "openapi" | "poll" | "poll-notification" | "start" | "value" | "wait" | "webhook" | "webhook-response";
|
|
27
|
+
description: "A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show. Set connectionId to an empty string to defer account configuration; execution will require an account." | "A Flow Error node. Select upstream Flows, then publish and enable this Flow to listen for failures in their automatic runs." | "A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions." | "A Start node with a required message parameter. Supply it through trigger.outputs." | "A Wait with a continue action and a built-in notification output." | "A Webhook start node." | "A condition with true and false execution branches." | "A fixed JSON API operation. Replace the example document and URL before running." | "A fixed value node." | "A single HTTP request. Bind url and request inputs; outputs are body, statusCode and headers." | "AI Decision evaluates named questions against target and returns a complete answer object per output. Configure target before running." | "An Agent with code computation enabled. Configure a model available in the deployment." | "An Approval with approve and reject decision branches and a built-in notification output." | "An HTTP response node with body, statusCode and headers inputs. Select it from a reachable Webhook." | "An LLM JSON Task and its node; configure a model available in the deployment." | "An LLM chat Task and its node; configure a model available in the deployment." | "An hourly scheduled start node." | "Gmail events → JavaScript text formatting → Connector notification. Replace connection/action IDs and match the notification input ports." | "Gmail polling by key; replace CONNECTION_ID with an active Gmail connection." | "Telegram webhook integration by key; replace CONNECTION_ID with an active Telegram connection.";
|
|
27
28
|
}[];
|
|
28
29
|
export declare function authoringExample(name: string): {
|
|
29
30
|
version: 1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JsonValue } from '../index.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export declare const authoringTypes: readonly ['start', 'outputs', 'webhook-response', 'workflow', 'webhook', 'cron', 'error', 'poll', 'integration', 'code', 'connector', 'agent', 'llm', 'decision', 'openapi', 'condition', 'value', 'wait', 'approval'];
|
|
3
|
+
export declare const authoringTypes: readonly ['start', 'outputs', 'webhook-response', 'workflow', 'webhook', 'cron', 'error', 'poll', 'integration', 'code', 'connector', 'agent', 'llm', 'decision', 'openapi', 'http-request', 'condition', 'value', 'wait', 'approval'];
|
|
4
4
|
declare const type: z.ZodEnum<{
|
|
5
5
|
agent: "agent";
|
|
6
6
|
approval: "approval";
|
|
@@ -10,6 +10,7 @@ declare const type: z.ZodEnum<{
|
|
|
10
10
|
cron: "cron";
|
|
11
11
|
decision: "decision";
|
|
12
12
|
error: "error";
|
|
13
|
+
"http-request": "http-request";
|
|
13
14
|
integration: "integration";
|
|
14
15
|
llm: "llm";
|
|
15
16
|
openapi: "openapi";
|
|
@@ -244,6 +245,61 @@ export declare const authoringConfigurations: {
|
|
|
244
245
|
}>;
|
|
245
246
|
}, z.core.$strict>]>>;
|
|
246
247
|
}, z.core.$strict>;
|
|
248
|
+
'http-request': z.ZodObject<{
|
|
249
|
+
method: z.ZodDefault<z.ZodEnum<{
|
|
250
|
+
DELETE: "DELETE";
|
|
251
|
+
GET: "GET";
|
|
252
|
+
HEAD: "HEAD";
|
|
253
|
+
OPTIONS: "OPTIONS";
|
|
254
|
+
PATCH: "PATCH";
|
|
255
|
+
POST: "POST";
|
|
256
|
+
PUT: "PUT";
|
|
257
|
+
}>>;
|
|
258
|
+
query: z.ZodDefault<z.ZodObject<{
|
|
259
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
260
|
+
fields: "fields";
|
|
261
|
+
object: "object";
|
|
262
|
+
}>>;
|
|
263
|
+
names: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
264
|
+
}, z.core.$strict>>;
|
|
265
|
+
headers: z.ZodDefault<z.ZodObject<{
|
|
266
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
267
|
+
fields: "fields";
|
|
268
|
+
object: "object";
|
|
269
|
+
}>>;
|
|
270
|
+
names: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
271
|
+
}, z.core.$strict>>;
|
|
272
|
+
bodyFormat: z.ZodDefault<z.ZodEnum<{
|
|
273
|
+
form: "form";
|
|
274
|
+
json: "json";
|
|
275
|
+
none: "none";
|
|
276
|
+
text: "text";
|
|
277
|
+
}>>;
|
|
278
|
+
authentication: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
279
|
+
type: z.ZodLiteral<"none">;
|
|
280
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
281
|
+
type: z.ZodEnum<{
|
|
282
|
+
basic: "basic";
|
|
283
|
+
bearer: "bearer";
|
|
284
|
+
}>;
|
|
285
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
286
|
+
type: z.ZodLiteral<"apiKey">;
|
|
287
|
+
name: z.ZodString;
|
|
288
|
+
in: z.ZodEnum<{
|
|
289
|
+
header: "header";
|
|
290
|
+
query: "query";
|
|
291
|
+
}>;
|
|
292
|
+
}, z.core.$strict>]>>;
|
|
293
|
+
responseFormat: z.ZodDefault<z.ZodEnum<{
|
|
294
|
+
auto: "auto";
|
|
295
|
+
json: "json";
|
|
296
|
+
text: "text";
|
|
297
|
+
}>>;
|
|
298
|
+
statusPolicy: z.ZodDefault<z.ZodEnum<{
|
|
299
|
+
all: "all";
|
|
300
|
+
success: "success";
|
|
301
|
+
}>>;
|
|
302
|
+
}, z.core.$strict>;
|
|
247
303
|
agent: z.ZodObject<{
|
|
248
304
|
code: z.ZodOptional<z.ZodBoolean>;
|
|
249
305
|
model: z.ZodString;
|
|
@@ -639,6 +695,7 @@ export declare const authoringEditSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
639
695
|
cron: "cron";
|
|
640
696
|
decision: "decision";
|
|
641
697
|
error: "error";
|
|
698
|
+
"http-request": "http-request";
|
|
642
699
|
integration: "integration";
|
|
643
700
|
llm: "llm";
|
|
644
701
|
openapi: "openapi";
|
|
@@ -809,6 +866,7 @@ export declare const authoringRequestSchema: z.ZodObject<{
|
|
|
809
866
|
cron: "cron";
|
|
810
867
|
decision: "decision";
|
|
811
868
|
error: "error";
|
|
869
|
+
"http-request": "http-request";
|
|
812
870
|
integration: "integration";
|
|
813
871
|
llm: "llm";
|
|
814
872
|
openapi: "openapi";
|
|
@@ -993,6 +1051,7 @@ export declare const authoringSearchSchema: z.ZodObject<{
|
|
|
993
1051
|
cron: "cron";
|
|
994
1052
|
decision: "decision";
|
|
995
1053
|
error: "error";
|
|
1054
|
+
"http-request": "http-request";
|
|
996
1055
|
integration: "integration";
|
|
997
1056
|
llm: "llm";
|
|
998
1057
|
openapi: "openapi";
|
|
@@ -1023,6 +1082,7 @@ export declare const authoringSchemaQuery: z.ZodObject<{
|
|
|
1023
1082
|
cron: "cron";
|
|
1024
1083
|
decision: "decision";
|
|
1025
1084
|
error: "error";
|
|
1085
|
+
"http-request": "http-request";
|
|
1026
1086
|
integration: "integration";
|
|
1027
1087
|
llm: "llm";
|
|
1028
1088
|
openapi: "openapi";
|
|
@@ -1054,6 +1114,7 @@ export declare function authoringRequestContract(name: string): {
|
|
|
1054
1114
|
cron: "cron";
|
|
1055
1115
|
decision: "decision";
|
|
1056
1116
|
error: "error";
|
|
1117
|
+
"http-request": "http-request";
|
|
1057
1118
|
integration: "integration";
|
|
1058
1119
|
llm: "llm";
|
|
1059
1120
|
openapi: "openapi";
|
|
@@ -1235,6 +1296,7 @@ export declare function authoringRequestContract(name: string): {
|
|
|
1235
1296
|
cron: "cron";
|
|
1236
1297
|
decision: "decision";
|
|
1237
1298
|
error: "error";
|
|
1299
|
+
"http-request": "http-request";
|
|
1238
1300
|
integration: "integration";
|
|
1239
1301
|
llm: "llm";
|
|
1240
1302
|
openapi: "openapi";
|
|
@@ -1333,7 +1395,7 @@ export declare function authoringRequestContract(name: string): {
|
|
|
1333
1395
|
} | undefined;
|
|
1334
1396
|
export declare function authoringSchema(kind?: AuthoringType): {
|
|
1335
1397
|
type?: undefined;
|
|
1336
|
-
types: readonly ["start", "outputs", "webhook-response", "workflow", "webhook", "cron", "error", "poll", "integration", "code", "connector", "agent", "llm", "decision", "openapi", "condition", "value", "wait", "approval"];
|
|
1398
|
+
types: readonly ["start", "outputs", "webhook-response", "workflow", "webhook", "cron", "error", "poll", "integration", "code", "connector", "agent", "llm", "decision", "openapi", "http-request", "condition", "value", "wait", "approval"];
|
|
1337
1399
|
request: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
1338
1400
|
baseRevision: z.ZodString;
|
|
1339
1401
|
requestId: z.ZodString;
|
|
@@ -1349,6 +1411,7 @@ export declare function authoringSchema(kind?: AuthoringType): {
|
|
|
1349
1411
|
cron: "cron";
|
|
1350
1412
|
decision: "decision";
|
|
1351
1413
|
error: "error";
|
|
1414
|
+
"http-request": "http-request";
|
|
1352
1415
|
integration: "integration";
|
|
1353
1416
|
llm: "llm";
|
|
1354
1417
|
openapi: "openapi";
|
|
@@ -1516,7 +1579,7 @@ export declare function authoringSchema(kind?: AuthoringType): {
|
|
|
1516
1579
|
} | {
|
|
1517
1580
|
types?: undefined;
|
|
1518
1581
|
request?: undefined;
|
|
1519
|
-
type: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow";
|
|
1582
|
+
type: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "http-request" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow";
|
|
1520
1583
|
onError: boolean | {
|
|
1521
1584
|
enum: string[];
|
|
1522
1585
|
};
|
|
@@ -1530,7 +1593,7 @@ export declare function authoringSchema(kind?: AuthoringType): {
|
|
|
1530
1593
|
example: {
|
|
1531
1594
|
op: string;
|
|
1532
1595
|
as: string;
|
|
1533
|
-
type: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow";
|
|
1596
|
+
type: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "http-request" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow";
|
|
1534
1597
|
name: string;
|
|
1535
1598
|
};
|
|
1536
1599
|
configuration: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{}, z.core.$strict>>;
|
|
@@ -51,12 +51,12 @@ var currentEngineContract = "open-flow-engine/v8";
|
|
|
51
51
|
"zlib"
|
|
52
52
|
].flatMap((name) => [name, `node:${name}`])), `${JSON.stringify("open-flow-engine/v8/nodejs-compat-v1")}`;
|
|
53
53
|
//#endregion
|
|
54
|
-
//#region src/
|
|
54
|
+
//#region src/http/common/authBindings.ts
|
|
55
55
|
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
56
|
-
function
|
|
56
|
+
function assertHttpAuthBindings(document) {
|
|
57
57
|
for (const node of Object.values(document.graph.nodes)) {
|
|
58
|
-
if (node.kind != "task" || !("executor" in node.task) || node.task.executor.kind
|
|
59
|
-
for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && mapping.kind == "value") throw new TypeError("
|
|
58
|
+
if (node.kind != "task" || !("executor" in node.task) || !["openapi", "http-request"].includes(node.task.executor.kind)) continue;
|
|
59
|
+
for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && mapping.kind == "value") throw new TypeError("HTTP authentication accepts deployment variables and upstream outputs only.");
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
//#endregion
|
|
@@ -8602,6 +8602,53 @@ function answerSchema(question) {
|
|
|
8602
8602
|
required: Object.keys(properties)
|
|
8603
8603
|
};
|
|
8604
8604
|
}
|
|
8605
|
+
//#endregion
|
|
8606
|
+
//#region src/http/common/httpRequest.ts
|
|
8607
|
+
var parameterSchema = strictObject({
|
|
8608
|
+
mode: _enum(["fields", "object"]).default("fields"),
|
|
8609
|
+
names: array(string$1()).default([])
|
|
8610
|
+
});
|
|
8611
|
+
var httpRequestConfigSchema = strictObject({
|
|
8612
|
+
method: _enum([
|
|
8613
|
+
"GET",
|
|
8614
|
+
"POST",
|
|
8615
|
+
"PUT",
|
|
8616
|
+
"PATCH",
|
|
8617
|
+
"DELETE",
|
|
8618
|
+
"HEAD",
|
|
8619
|
+
"OPTIONS"
|
|
8620
|
+
]).default("GET"),
|
|
8621
|
+
query: parameterSchema.default({
|
|
8622
|
+
mode: "fields",
|
|
8623
|
+
names: []
|
|
8624
|
+
}),
|
|
8625
|
+
headers: parameterSchema.default({
|
|
8626
|
+
mode: "fields",
|
|
8627
|
+
names: []
|
|
8628
|
+
}),
|
|
8629
|
+
bodyFormat: _enum([
|
|
8630
|
+
"none",
|
|
8631
|
+
"json",
|
|
8632
|
+
"text",
|
|
8633
|
+
"form"
|
|
8634
|
+
]).default("none"),
|
|
8635
|
+
authentication: union([
|
|
8636
|
+
strictObject({ type: literal("none") }),
|
|
8637
|
+
strictObject({ type: _enum(["bearer", "basic"]) }),
|
|
8638
|
+
strictObject({
|
|
8639
|
+
type: literal("apiKey"),
|
|
8640
|
+
name: string$1(),
|
|
8641
|
+
in: _enum(["header", "query"])
|
|
8642
|
+
})
|
|
8643
|
+
]).default({ type: "none" }),
|
|
8644
|
+
responseFormat: _enum([
|
|
8645
|
+
"auto",
|
|
8646
|
+
"json",
|
|
8647
|
+
"text"
|
|
8648
|
+
]).default("auto"),
|
|
8649
|
+
statusPolicy: _enum(["success", "all"]).default("success")
|
|
8650
|
+
});
|
|
8651
|
+
var httpRequestExecutorSchema = httpRequestConfigSchema.extend({ kind: literal("http-request") });
|
|
8605
8652
|
function checkJsonDepth(value, depth = 0) {
|
|
8606
8653
|
if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
|
|
8607
8654
|
if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
|
|
@@ -8881,7 +8928,8 @@ var managedFields = object({
|
|
|
8881
8928
|
kind: literal("workflow"),
|
|
8882
8929
|
flowId: text,
|
|
8883
8930
|
revisionId: text
|
|
8884
|
-
})
|
|
8931
|
+
}),
|
|
8932
|
+
httpRequestExecutorSchema
|
|
8885
8933
|
])
|
|
8886
8934
|
});
|
|
8887
8935
|
var managed = managedFields.transform(limitDecisionTask);
|
|
@@ -9181,7 +9229,7 @@ function decodeRevisionContent(value) {
|
|
|
9181
9229
|
checkJsonDepth(value);
|
|
9182
9230
|
const content = revision.parse(value);
|
|
9183
9231
|
checkModelVersion(content);
|
|
9184
|
-
|
|
9232
|
+
assertHttpAuthBindings(content.document);
|
|
9185
9233
|
return content;
|
|
9186
9234
|
}
|
|
9187
9235
|
var shapes = {
|
|
@@ -9351,6 +9399,7 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
9351
9399
|
...shape
|
|
9352
9400
|
})])).values()])).min(1);
|
|
9353
9401
|
function checkModelVersion(content) {
|
|
9402
|
+
if (content.modelVersion < 11 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "executor" in candidateNode.task && candidateNode.task.executor.kind == "http-request")) throw new TypeError("HTTP Request requires Flow model version 11.");
|
|
9354
9403
|
if (content.modelVersion < 11 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && ("moduleId" in candidateNode.task ? candidateNode.task.capabilities?.some((item) => item.kind == "workflow") : candidateNode.task.executor.kind == "agent" && candidateNode.task.executor.tools.some((item) => item.kind == "workflow")))) throw new TypeError("Workflow tools require Flow model version 11.");
|
|
9355
9404
|
if (content.modelVersion < 10 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "webhook" && (candidateNode.options?.responseBody != null || candidateNode.options?.responseStatusCodeOutput != null || candidateNode.options?.responseHeadersSource != null || candidateNode.options?.responseHeaderOutputs != null))) throw new TypeError("Dynamic Webhook responses require Flow model version 10.");
|
|
9356
9405
|
if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => "retry" in candidateNode && candidateNode.retry != null)) throw new TypeError("Node retries require Flow model version 9.");
|
|
@@ -9480,6 +9529,7 @@ var type = _enum([
|
|
|
9480
9529
|
"llm",
|
|
9481
9530
|
"decision",
|
|
9482
9531
|
"openapi",
|
|
9532
|
+
"http-request",
|
|
9483
9533
|
"condition",
|
|
9484
9534
|
"value",
|
|
9485
9535
|
"wait",
|
|
@@ -9605,6 +9655,7 @@ var authoringConfigurations = {
|
|
|
9605
9655
|
}),
|
|
9606
9656
|
"connector": authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
|
|
9607
9657
|
"openapi": authoringOpenApiSchema,
|
|
9658
|
+
"http-request": httpRequestConfigSchema,
|
|
9608
9659
|
"agent": authoringDefinitionSchemas.agent.omit({
|
|
9609
9660
|
prompt: true,
|
|
9610
9661
|
tools: true
|
|
@@ -11666,7 +11717,7 @@ function decodeRunEvent(value) {
|
|
|
11666
11717
|
switch (kind) {
|
|
11667
11718
|
case "node.started": {
|
|
11668
11719
|
const nodeKind = payload.nodeKind;
|
|
11669
|
-
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
|
|
11720
|
+
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "http-request" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
|
|
11670
11721
|
return {
|
|
11671
11722
|
...base,
|
|
11672
11723
|
kind,
|
|
@@ -8643,14 +8643,61 @@ function answerSchema(question) {
|
|
|
8643
8643
|
};
|
|
8644
8644
|
}
|
|
8645
8645
|
//#endregion
|
|
8646
|
-
//#region src/
|
|
8646
|
+
//#region src/http/common/authBindings.ts
|
|
8647
8647
|
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
8648
|
-
function
|
|
8648
|
+
function assertHttpAuthBindings(document) {
|
|
8649
8649
|
for (const node of Object.values(document.graph.nodes)) {
|
|
8650
|
-
if (node.kind != "task" || !("executor" in node.task) || node.task.executor.kind
|
|
8651
|
-
for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && mapping.kind == "value") throw new TypeError("
|
|
8650
|
+
if (node.kind != "task" || !("executor" in node.task) || !["openapi", "http-request"].includes(node.task.executor.kind)) continue;
|
|
8651
|
+
for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && mapping.kind == "value") throw new TypeError("HTTP authentication accepts deployment variables and upstream outputs only.");
|
|
8652
8652
|
}
|
|
8653
8653
|
}
|
|
8654
|
+
//#endregion
|
|
8655
|
+
//#region src/http/common/httpRequest.ts
|
|
8656
|
+
var parameterSchema = strictObject({
|
|
8657
|
+
mode: _enum(["fields", "object"]).default("fields"),
|
|
8658
|
+
names: array(string$1()).default([])
|
|
8659
|
+
});
|
|
8660
|
+
var httpRequestConfigSchema = strictObject({
|
|
8661
|
+
method: _enum([
|
|
8662
|
+
"GET",
|
|
8663
|
+
"POST",
|
|
8664
|
+
"PUT",
|
|
8665
|
+
"PATCH",
|
|
8666
|
+
"DELETE",
|
|
8667
|
+
"HEAD",
|
|
8668
|
+
"OPTIONS"
|
|
8669
|
+
]).default("GET"),
|
|
8670
|
+
query: parameterSchema.default({
|
|
8671
|
+
mode: "fields",
|
|
8672
|
+
names: []
|
|
8673
|
+
}),
|
|
8674
|
+
headers: parameterSchema.default({
|
|
8675
|
+
mode: "fields",
|
|
8676
|
+
names: []
|
|
8677
|
+
}),
|
|
8678
|
+
bodyFormat: _enum([
|
|
8679
|
+
"none",
|
|
8680
|
+
"json",
|
|
8681
|
+
"text",
|
|
8682
|
+
"form"
|
|
8683
|
+
]).default("none"),
|
|
8684
|
+
authentication: union([
|
|
8685
|
+
strictObject({ type: literal("none") }),
|
|
8686
|
+
strictObject({ type: _enum(["bearer", "basic"]) }),
|
|
8687
|
+
strictObject({
|
|
8688
|
+
type: literal("apiKey"),
|
|
8689
|
+
name: string$1(),
|
|
8690
|
+
in: _enum(["header", "query"])
|
|
8691
|
+
})
|
|
8692
|
+
]).default({ type: "none" }),
|
|
8693
|
+
responseFormat: _enum([
|
|
8694
|
+
"auto",
|
|
8695
|
+
"json",
|
|
8696
|
+
"text"
|
|
8697
|
+
]).default("auto"),
|
|
8698
|
+
statusPolicy: _enum(["success", "all"]).default("success")
|
|
8699
|
+
});
|
|
8700
|
+
var httpRequestExecutorSchema = httpRequestConfigSchema.extend({ kind: literal("http-request") });
|
|
8654
8701
|
function checkJsonDepth(value, depth = 0) {
|
|
8655
8702
|
if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
|
|
8656
8703
|
if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
|
|
@@ -8938,7 +8985,8 @@ var managedFields = object({
|
|
|
8938
8985
|
kind: literal("workflow"),
|
|
8939
8986
|
flowId: text,
|
|
8940
8987
|
revisionId: text
|
|
8941
|
-
})
|
|
8988
|
+
}),
|
|
8989
|
+
httpRequestExecutorSchema
|
|
8942
8990
|
])
|
|
8943
8991
|
});
|
|
8944
8992
|
var managed = managedFields.transform(limitDecisionTask);
|
|
@@ -9238,7 +9286,7 @@ function decodeRevisionContent(value) {
|
|
|
9238
9286
|
checkJsonDepth(value);
|
|
9239
9287
|
const content = revision.parse(value);
|
|
9240
9288
|
checkModelVersion(content);
|
|
9241
|
-
|
|
9289
|
+
assertHttpAuthBindings(content.document);
|
|
9242
9290
|
return content;
|
|
9243
9291
|
}
|
|
9244
9292
|
var shapes = {
|
|
@@ -9408,6 +9456,7 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
9408
9456
|
...shape
|
|
9409
9457
|
})])).values()])).min(1);
|
|
9410
9458
|
function checkModelVersion(content) {
|
|
9459
|
+
if (content.modelVersion < 11 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "executor" in candidateNode.task && candidateNode.task.executor.kind == "http-request")) throw new TypeError("HTTP Request requires Flow model version 11.");
|
|
9411
9460
|
if (content.modelVersion < 11 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && ("moduleId" in candidateNode.task ? candidateNode.task.capabilities?.some((item) => item.kind == "workflow") : candidateNode.task.executor.kind == "agent" && candidateNode.task.executor.tools.some((item) => item.kind == "workflow")))) throw new TypeError("Workflow tools require Flow model version 11.");
|
|
9412
9461
|
if (content.modelVersion < 10 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "webhook" && (candidateNode.options?.responseBody != null || candidateNode.options?.responseStatusCodeOutput != null || candidateNode.options?.responseHeadersSource != null || candidateNode.options?.responseHeaderOutputs != null))) throw new TypeError("Dynamic Webhook responses require Flow model version 10.");
|
|
9413
9462
|
if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => "retry" in candidateNode && candidateNode.retry != null)) throw new TypeError("Node retries require Flow model version 9.");
|
|
@@ -9470,6 +9519,7 @@ var type = _enum([
|
|
|
9470
9519
|
"llm",
|
|
9471
9520
|
"decision",
|
|
9472
9521
|
"openapi",
|
|
9522
|
+
"http-request",
|
|
9473
9523
|
"condition",
|
|
9474
9524
|
"value",
|
|
9475
9525
|
"wait",
|
|
@@ -9595,6 +9645,7 @@ var authoringConfigurations = {
|
|
|
9595
9645
|
}),
|
|
9596
9646
|
"connector": authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
|
|
9597
9647
|
"openapi": authoringOpenApiSchema,
|
|
9648
|
+
"http-request": httpRequestConfigSchema,
|
|
9598
9649
|
"agent": authoringDefinitionSchemas.agent.omit({
|
|
9599
9650
|
prompt: true,
|
|
9600
9651
|
tools: true
|
|
@@ -12354,7 +12405,7 @@ function decodeRunEvent(value) {
|
|
|
12354
12405
|
switch (kind) {
|
|
12355
12406
|
case "node.started": {
|
|
12356
12407
|
const nodeKind = payload.nodeKind;
|
|
12357
|
-
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
|
|
12408
|
+
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "http-request" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
|
|
12358
12409
|
return {
|
|
12359
12410
|
...base,
|
|
12360
12411
|
kind,
|
|
@@ -35,7 +35,7 @@ export declare const controlRequests: {
|
|
|
35
35
|
edits: ({
|
|
36
36
|
op: "node.add";
|
|
37
37
|
as: string;
|
|
38
|
-
type: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow";
|
|
38
|
+
type: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "http-request" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow";
|
|
39
39
|
name: string;
|
|
40
40
|
onError?: "error" | "stop" | undefined;
|
|
41
41
|
retry?: {
|
|
@@ -178,12 +178,12 @@ export declare const controlRequests: {
|
|
|
178
178
|
authoringSearch: (value: unknown) => {
|
|
179
179
|
revision?: string | undefined;
|
|
180
180
|
query: string;
|
|
181
|
-
type?: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow" | undefined;
|
|
181
|
+
type?: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "http-request" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow" | undefined;
|
|
182
182
|
offset: number;
|
|
183
183
|
limit: number;
|
|
184
184
|
};
|
|
185
185
|
authoringSchema: (value: unknown) => {
|
|
186
|
-
type?: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow" | undefined;
|
|
186
|
+
type?: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "http-request" | "integration" | "llm" | "openapi" | "outputs" | "poll" | "start" | "value" | "wait" | "webhook" | "webhook-response" | "workflow" | undefined;
|
|
187
187
|
action?: string | undefined;
|
|
188
188
|
};
|
|
189
189
|
loadOpenApiDocument: (value: unknown) => {
|