@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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Ir as cn, ct as SelectContent, ft as SelectTrigger, lt as SelectGroup, ot as Select, pt as SelectValue, ut as SelectItem } from "./icons-0s-Q_3lp.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/workbench/browser/runtime/shell/workbenchSelect.tsx
|
|
4
|
+
function WorkbenchSelect({ ariaLabel, className, disabled = false, id, onValueChange, options, portalRoot, size, value, variant }) {
|
|
5
|
+
return /* @__PURE__ */ jsxs(Select, {
|
|
6
|
+
disabled,
|
|
7
|
+
onValueChange: (next) => {
|
|
8
|
+
if (next != null) onValueChange(next);
|
|
9
|
+
},
|
|
10
|
+
value,
|
|
11
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
12
|
+
"aria-label": ariaLabel,
|
|
13
|
+
className: cn("min-w-32", className),
|
|
14
|
+
id,
|
|
15
|
+
size,
|
|
16
|
+
variant,
|
|
17
|
+
children: /* @__PURE__ */ jsx(SelectValue, { children: options.find((option) => option.value == value)?.label ?? value })
|
|
18
|
+
}), /* @__PURE__ */ jsx(SelectContent, {
|
|
19
|
+
align: "end",
|
|
20
|
+
alignItemWithTrigger: false,
|
|
21
|
+
container: portalRoot,
|
|
22
|
+
children: /* @__PURE__ */ jsx(SelectGroup, { children: options.map((option) => /* @__PURE__ */ jsx(SelectItem, {
|
|
23
|
+
disabled: option.disabled,
|
|
24
|
+
value: option.value,
|
|
25
|
+
children: option.label
|
|
26
|
+
}, option.value)) })
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { WorkbenchSelect as t };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { DraftOperation } from './draftOperations.js';
|
|
2
2
|
declare const descriptions: {
|
|
3
3
|
readonly manual: 'A Manual start node.';
|
|
4
|
-
readonly error: '
|
|
4
|
+
readonly error: 'A Flow Error node. Select upstream Flows, then publish and enable this Flow to listen for failures in their automatic runs.';
|
|
5
5
|
readonly webhook: 'A Webhook start node.';
|
|
6
6
|
readonly cron: 'An hourly scheduled start node.';
|
|
7
7
|
readonly poll: 'Gmail polling by key; replace CONNECTION_ID with an active Gmail connection.';
|
|
8
8
|
readonly integration: 'Telegram webhook integration by key; replace CONNECTION_ID with an active Telegram connection.';
|
|
9
|
+
readonly openapi: 'A fixed JSON API operation. Replace the example document and URL before running.';
|
|
9
10
|
readonly connector: 'A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show.';
|
|
10
11
|
readonly code: 'A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions.';
|
|
11
12
|
readonly condition: 'A condition with true and false execution branches.';
|
|
@@ -19,8 +20,8 @@ declare const descriptions: {
|
|
|
19
20
|
};
|
|
20
21
|
export declare const authoringExampleNames: (keyof typeof descriptions)[];
|
|
21
22
|
export declare const authoringExamples: {
|
|
22
|
-
name: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "error" | "integration" | "llm-chat" | "llm-json" | "manual" | "poll" | "poll-notification" | "value" | "wait" | "webhook";
|
|
23
|
-
description: "A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show." | "A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions." | "A Manual start node." | "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 value node." | "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
|
|
23
|
+
name: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "error" | "integration" | "llm-chat" | "llm-json" | "manual" | "openapi" | "poll" | "poll-notification" | "value" | "wait" | "webhook";
|
|
24
|
+
description: "A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show." | "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 Manual start node." | "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." | "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 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.";
|
|
24
25
|
}[];
|
|
25
26
|
export declare function authoringExample(name: string): {
|
|
26
27
|
version: 1;
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
import type { JsonValue } from '../browser/flow-change.js';
|
|
2
|
+
export type TriggerOperationRequest = {
|
|
3
|
+
readonly operation: 'read';
|
|
4
|
+
readonly config: Readonly<Record<string, JsonValue>>;
|
|
5
|
+
readonly checkpoint: JsonValue;
|
|
6
|
+
} | {
|
|
7
|
+
readonly operation: 'options';
|
|
8
|
+
readonly config: Readonly<Record<string, JsonValue>>;
|
|
9
|
+
readonly field: string;
|
|
10
|
+
} | {
|
|
11
|
+
readonly operation: 'reconcile';
|
|
12
|
+
readonly subscriptionId?: string;
|
|
13
|
+
readonly config: Readonly<Record<string, JsonValue>>;
|
|
14
|
+
readonly requestKey: string;
|
|
15
|
+
readonly endpointUrl: string;
|
|
16
|
+
readonly active: boolean;
|
|
17
|
+
} | {
|
|
18
|
+
readonly operation: 'receive';
|
|
19
|
+
readonly subscriptionId: string;
|
|
20
|
+
readonly method: string;
|
|
21
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
22
|
+
readonly query: Readonly<Record<string, string>>;
|
|
23
|
+
readonly rawBody: string;
|
|
24
|
+
readonly admit: boolean;
|
|
25
|
+
readonly current: boolean;
|
|
26
|
+
} | {
|
|
27
|
+
readonly operation: 'resource';
|
|
28
|
+
readonly config: Readonly<Record<string, JsonValue>>;
|
|
29
|
+
readonly requestKey: string;
|
|
30
|
+
readonly active: boolean;
|
|
31
|
+
};
|
|
1
32
|
export interface ConnectorProxyRequest {
|
|
2
33
|
readonly body?: unknown;
|
|
3
34
|
readonly endpoint: string;
|
|
@@ -10,5 +41,6 @@ export interface ConnectorProxyResult {
|
|
|
10
41
|
readonly status: number;
|
|
11
42
|
}
|
|
12
43
|
export interface ConnectorProxy {
|
|
44
|
+
trigger?(request: TriggerOperationRequest, signal?: AbortSignal): Promise<unknown>;
|
|
13
45
|
execute(request: ConnectorProxyRequest, signal?: AbortSignal): Promise<ConnectorProxyResult>;
|
|
14
46
|
}
|
|
@@ -5799,6 +5799,15 @@ function json$3(params) {
|
|
|
5799
5799
|
});
|
|
5800
5800
|
return jsonSchema;
|
|
5801
5801
|
}
|
|
5802
|
+
//#endregion
|
|
5803
|
+
//#region src/openapi/common/authBindings.ts
|
|
5804
|
+
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
5805
|
+
function assertOpenApiAuthBindings(document) {
|
|
5806
|
+
for (const graph of [document.graph, ...Object.values(document.subflows).map((subflow) => subflow.graph)]) for (const node of Object.values(graph.nodes)) {
|
|
5807
|
+
if (node.kind != "task" || node.taskId == null || document.tasks[node.taskId]?.executor.kind != "openapi") continue;
|
|
5808
|
+
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.");
|
|
5809
|
+
}
|
|
5810
|
+
}
|
|
5802
5811
|
function checkJsonDepth(value, depth = 0) {
|
|
5803
5812
|
if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
|
|
5804
5813
|
if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
|
|
@@ -5929,6 +5938,24 @@ var managed = object({
|
|
|
5929
5938
|
action: text,
|
|
5930
5939
|
connectionId: text.optional()
|
|
5931
5940
|
}),
|
|
5941
|
+
object({
|
|
5942
|
+
kind: literal("openapi"),
|
|
5943
|
+
sourceUrl: text,
|
|
5944
|
+
method: text,
|
|
5945
|
+
path: text,
|
|
5946
|
+
serverUrl: text,
|
|
5947
|
+
document: json$2,
|
|
5948
|
+
auth: array(object({
|
|
5949
|
+
id: text,
|
|
5950
|
+
type: _enum([
|
|
5951
|
+
"bearer",
|
|
5952
|
+
"basic",
|
|
5953
|
+
"apiKey"
|
|
5954
|
+
]),
|
|
5955
|
+
name: text.optional(),
|
|
5956
|
+
in: _enum(["header", "query"]).optional()
|
|
5957
|
+
}))
|
|
5958
|
+
}),
|
|
5932
5959
|
object({
|
|
5933
5960
|
kind: literal("llm"),
|
|
5934
5961
|
mode: _enum(["chat", "json"])
|
|
@@ -6195,6 +6222,7 @@ function decodeRevisionContent(value) {
|
|
|
6195
6222
|
checkJsonDepth(value);
|
|
6196
6223
|
const content = revision.parse(value);
|
|
6197
6224
|
checkErrorModelVersion(content);
|
|
6225
|
+
assertOpenApiAuthBindings(content.document);
|
|
6198
6226
|
return content;
|
|
6199
6227
|
}
|
|
6200
6228
|
var shapes = {
|
|
@@ -6356,6 +6384,11 @@ var shapes = {
|
|
|
6356
6384
|
before: text.optional(),
|
|
6357
6385
|
value: text.optional()
|
|
6358
6386
|
},
|
|
6387
|
+
"task.openapi.set": {
|
|
6388
|
+
taskId: text,
|
|
6389
|
+
before: managed,
|
|
6390
|
+
value: managed
|
|
6391
|
+
},
|
|
6359
6392
|
"task.agent.set": {
|
|
6360
6393
|
taskId: text,
|
|
6361
6394
|
before: managed,
|
|
@@ -6419,14 +6452,19 @@ function accessPermissions(value) {
|
|
|
6419
6452
|
exact(source, [
|
|
6420
6453
|
"actionIds",
|
|
6421
6454
|
"allActions",
|
|
6455
|
+
"triggerIds",
|
|
6456
|
+
"allTriggers",
|
|
6422
6457
|
"configured",
|
|
6423
6458
|
"proxy"
|
|
6424
6459
|
]);
|
|
6425
|
-
if (!Array.isArray(source.actionIds) || typeof source.allActions != "boolean" || typeof source.configured != "boolean" || typeof source.proxy != "boolean") return invalidResponse();
|
|
6460
|
+
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();
|
|
6426
6461
|
const actionIds = source.actionIds.map(string$1);
|
|
6427
|
-
|
|
6462
|
+
const triggerIds = source.triggerIds.map(string$1);
|
|
6463
|
+
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();
|
|
6428
6464
|
return {
|
|
6429
6465
|
actionIds,
|
|
6466
|
+
triggerIds,
|
|
6467
|
+
allTriggers: source.allTriggers,
|
|
6430
6468
|
allActions: source.allActions,
|
|
6431
6469
|
configured: source.configured,
|
|
6432
6470
|
proxy: source.proxy
|
|
@@ -9980,6 +10018,7 @@ function flow(value) {
|
|
|
9980
10018
|
revisionId: string$1(target.revisionId)
|
|
9981
10019
|
} },
|
|
9982
10020
|
createdAt: string$1(source.createdAt),
|
|
10021
|
+
...source.connectorTeamId == null ? {} : { connectorTeamId: string$1(source.connectorTeamId) },
|
|
9983
10022
|
draftRevisionId: string$1(source.draftRevisionId),
|
|
9984
10023
|
flowId: string$1(source.flowId),
|
|
9985
10024
|
name: string$1(source.name),
|
|
@@ -10572,7 +10611,7 @@ function decodeRunEvent(value) {
|
|
|
10572
10611
|
switch (kind) {
|
|
10573
10612
|
case "node.started": {
|
|
10574
10613
|
const nodeKind = payload.nodeKind;
|
|
10575
|
-
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "subflow" && nodeKind !== "value" && nodeKind !== "wait") return invalidResponse();
|
|
10614
|
+
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();
|
|
10576
10615
|
return {
|
|
10577
10616
|
...base,
|
|
10578
10617
|
kind,
|
|
@@ -10681,6 +10720,18 @@ var ControlClient = class {
|
|
|
10681
10720
|
constructor(requestControl) {
|
|
10682
10721
|
this.requestControl = requestControl;
|
|
10683
10722
|
}
|
|
10723
|
+
async loadOpenApiDocument(url, signal) {
|
|
10724
|
+
const result = record$2(await this.request("/v1/openapi/document", {
|
|
10725
|
+
method: "POST",
|
|
10726
|
+
body: JSON.stringify({
|
|
10727
|
+
url,
|
|
10728
|
+
version: 1
|
|
10729
|
+
}),
|
|
10730
|
+
signal
|
|
10731
|
+
}));
|
|
10732
|
+
if (result.version != 1) return invalidResponse();
|
|
10733
|
+
return jsonValue(result.document);
|
|
10734
|
+
}
|
|
10684
10735
|
async listFlows(options = {}) {
|
|
10685
10736
|
const parameters = new URLSearchParams();
|
|
10686
10737
|
if (options.cursor != null) parameters.set("cursor", options.cursor);
|
|
@@ -40,6 +40,8 @@ export interface Flow {
|
|
|
40
40
|
readonly createdAt: string;
|
|
41
41
|
readonly draftRevisionId: string;
|
|
42
42
|
readonly flowId: string;
|
|
43
|
+
/** Connector Team scope used by the OOMOL resource cache. */
|
|
44
|
+
readonly connectorTeamId?: string;
|
|
43
45
|
readonly name: string;
|
|
44
46
|
readonly status: 'active' | 'retiring';
|
|
45
47
|
readonly updatedAt: string;
|
|
@@ -174,6 +176,8 @@ export interface ProviderAccessBindingCandidate extends ProviderAccessIdentity {
|
|
|
174
176
|
readonly permissions?: {
|
|
175
177
|
readonly actionIds: readonly string[];
|
|
176
178
|
readonly allActions: boolean;
|
|
179
|
+
readonly triggerIds: readonly string[];
|
|
180
|
+
readonly allTriggers: boolean;
|
|
177
181
|
readonly configured: boolean;
|
|
178
182
|
readonly proxy: boolean;
|
|
179
183
|
};
|
|
@@ -388,6 +392,7 @@ export interface RunPage {
|
|
|
388
392
|
}
|
|
389
393
|
export type RunEvent = Readonly<ReturnType<typeof decodeRunEvent>>;
|
|
390
394
|
export type RunEventKind = RunEvent['kind'];
|
|
395
|
+
export declare function isRunTerminalEvent(event: RunEvent | undefined): boolean;
|
|
391
396
|
export interface RunEvents {
|
|
392
397
|
readonly done: boolean;
|
|
393
398
|
readonly events: readonly RunEvent[];
|
|
@@ -719,6 +724,7 @@ export type ConditionalResult<T> = {
|
|
|
719
724
|
export declare class ControlClient {
|
|
720
725
|
private readonly requestControl;
|
|
721
726
|
constructor(requestControl: ControlRequest);
|
|
727
|
+
loadOpenApiDocument(url: string, signal?: AbortSignal): Promise<JsonValue>;
|
|
722
728
|
listFlows(options?: {
|
|
723
729
|
readonly cursor?: string;
|
|
724
730
|
readonly includeTotal?: boolean;
|
|
@@ -5822,6 +5822,15 @@ function json$2(params) {
|
|
|
5822
5822
|
});
|
|
5823
5823
|
return jsonSchema;
|
|
5824
5824
|
}
|
|
5825
|
+
//#endregion
|
|
5826
|
+
//#region src/openapi/common/authBindings.ts
|
|
5827
|
+
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
5828
|
+
function assertOpenApiAuthBindings(document) {
|
|
5829
|
+
for (const graph of [document.graph, ...Object.values(document.subflows).map((subflow) => subflow.graph)]) for (const node of Object.values(graph.nodes)) {
|
|
5830
|
+
if (node.kind != "task" || node.taskId == null || document.tasks[node.taskId]?.executor.kind != "openapi") continue;
|
|
5831
|
+
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.");
|
|
5832
|
+
}
|
|
5833
|
+
}
|
|
5825
5834
|
function checkJsonDepth(value, depth = 0) {
|
|
5826
5835
|
if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
|
|
5827
5836
|
if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
|
|
@@ -5955,6 +5964,24 @@ var managed = object({
|
|
|
5955
5964
|
action: text,
|
|
5956
5965
|
connectionId: text.optional()
|
|
5957
5966
|
}),
|
|
5967
|
+
object({
|
|
5968
|
+
kind: literal("openapi"),
|
|
5969
|
+
sourceUrl: text,
|
|
5970
|
+
method: text,
|
|
5971
|
+
path: text,
|
|
5972
|
+
serverUrl: text,
|
|
5973
|
+
document: json$1,
|
|
5974
|
+
auth: array(object({
|
|
5975
|
+
id: text,
|
|
5976
|
+
type: _enum([
|
|
5977
|
+
"bearer",
|
|
5978
|
+
"basic",
|
|
5979
|
+
"apiKey"
|
|
5980
|
+
]),
|
|
5981
|
+
name: text.optional(),
|
|
5982
|
+
in: _enum(["header", "query"]).optional()
|
|
5983
|
+
}))
|
|
5984
|
+
}),
|
|
5958
5985
|
object({
|
|
5959
5986
|
kind: literal("llm"),
|
|
5960
5987
|
mode: _enum(["chat", "json"])
|
|
@@ -6221,6 +6248,7 @@ function decodeRevisionContent(value) {
|
|
|
6221
6248
|
checkJsonDepth(value);
|
|
6222
6249
|
const content = revision.parse(value);
|
|
6223
6250
|
checkErrorModelVersion(content);
|
|
6251
|
+
assertOpenApiAuthBindings(content.document);
|
|
6224
6252
|
return content;
|
|
6225
6253
|
}
|
|
6226
6254
|
var shapes = {
|
|
@@ -6382,6 +6410,11 @@ var shapes = {
|
|
|
6382
6410
|
before: text.optional(),
|
|
6383
6411
|
value: text.optional()
|
|
6384
6412
|
},
|
|
6413
|
+
"task.openapi.set": {
|
|
6414
|
+
taskId: text,
|
|
6415
|
+
before: managed,
|
|
6416
|
+
value: managed
|
|
6417
|
+
},
|
|
6385
6418
|
"task.agent.set": {
|
|
6386
6419
|
taskId: text,
|
|
6387
6420
|
before: managed,
|
|
@@ -6498,14 +6531,19 @@ function accessPermissions(value) {
|
|
|
6498
6531
|
exact(source, [
|
|
6499
6532
|
"actionIds",
|
|
6500
6533
|
"allActions",
|
|
6534
|
+
"triggerIds",
|
|
6535
|
+
"allTriggers",
|
|
6501
6536
|
"configured",
|
|
6502
6537
|
"proxy"
|
|
6503
6538
|
]);
|
|
6504
|
-
if (!Array.isArray(source.actionIds) || typeof source.allActions != "boolean" || typeof source.configured != "boolean" || typeof source.proxy != "boolean") return invalidResponse();
|
|
6539
|
+
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();
|
|
6505
6540
|
const actionIds = source.actionIds.map(string$1);
|
|
6506
|
-
|
|
6541
|
+
const triggerIds = source.triggerIds.map(string$1);
|
|
6542
|
+
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();
|
|
6507
6543
|
return {
|
|
6508
6544
|
actionIds,
|
|
6545
|
+
triggerIds,
|
|
6546
|
+
allTriggers: source.allTriggers,
|
|
6509
6547
|
allActions: source.allActions,
|
|
6510
6548
|
configured: source.configured,
|
|
6511
6549
|
proxy: source.proxy
|
|
@@ -10570,6 +10608,7 @@ function flow(value) {
|
|
|
10570
10608
|
revisionId: string$1(target.revisionId)
|
|
10571
10609
|
} },
|
|
10572
10610
|
createdAt: string$1(source.createdAt),
|
|
10611
|
+
...source.connectorTeamId == null ? {} : { connectorTeamId: string$1(source.connectorTeamId) },
|
|
10573
10612
|
draftRevisionId: string$1(source.draftRevisionId),
|
|
10574
10613
|
flowId: string$1(source.flowId),
|
|
10575
10614
|
name: string$1(source.name),
|
|
@@ -11068,6 +11107,9 @@ function randomId() {
|
|
|
11068
11107
|
}
|
|
11069
11108
|
//#endregion
|
|
11070
11109
|
//#region src/control/common/api.ts
|
|
11110
|
+
function isRunTerminalEvent(event) {
|
|
11111
|
+
return event?.kind == "run.completed" || event?.kind == "run.failed" || event?.kind == "run.canceled" || event?.kind == "run.indeterminate";
|
|
11112
|
+
}
|
|
11071
11113
|
function decodeRunEvent(value) {
|
|
11072
11114
|
const source = record$1(value);
|
|
11073
11115
|
const sequence = integer$1(source.sequence);
|
|
@@ -11162,7 +11204,7 @@ function decodeRunEvent(value) {
|
|
|
11162
11204
|
switch (kind) {
|
|
11163
11205
|
case "node.started": {
|
|
11164
11206
|
const nodeKind = payload.nodeKind;
|
|
11165
|
-
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "subflow" && nodeKind !== "value" && nodeKind !== "wait") return invalidResponse();
|
|
11207
|
+
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();
|
|
11166
11208
|
return {
|
|
11167
11209
|
...base,
|
|
11168
11210
|
kind,
|
|
@@ -11271,6 +11313,18 @@ var ControlClient = class {
|
|
|
11271
11313
|
constructor(requestControl) {
|
|
11272
11314
|
this.requestControl = requestControl;
|
|
11273
11315
|
}
|
|
11316
|
+
async loadOpenApiDocument(url, signal) {
|
|
11317
|
+
const result = record$1(await this.request("/v1/openapi/document", {
|
|
11318
|
+
method: "POST",
|
|
11319
|
+
body: JSON.stringify({
|
|
11320
|
+
url,
|
|
11321
|
+
version: 1
|
|
11322
|
+
}),
|
|
11323
|
+
signal
|
|
11324
|
+
}));
|
|
11325
|
+
if (result.version != 1) return invalidResponse();
|
|
11326
|
+
return jsonValue(result.document);
|
|
11327
|
+
}
|
|
11274
11328
|
async listFlows(options = {}) {
|
|
11275
11329
|
const parameters = new URLSearchParams();
|
|
11276
11330
|
if (options.cursor != null) parameters.set("cursor", options.cursor);
|
|
@@ -11832,4 +11886,4 @@ var ControlClient = class {
|
|
|
11832
11886
|
}
|
|
11833
11887
|
};
|
|
11834
11888
|
//#endregion
|
|
11835
|
-
export { ApiError, ControlClient, actionSummary, controlErrorCode, controlErrorMetadata, connectorAccess as decodeConnectorAccess, connectorAccessSnapshot as decodeConnectorAccessSnapshot, decodeEventSource, decodeEventSources, decodeResultList, decodeResultRead, decodeRunEvent, decodeTriggerCatalog, flowInspection, inspectFlowDraft, nodeDetails, parseProviderAccessSource, parseResultQuery, providerAccessBindingId, providerIconAppearance, readResult, searchTriggerKeys };
|
|
11889
|
+
export { ApiError, ControlClient, actionSummary, controlErrorCode, controlErrorMetadata, connectorAccess as decodeConnectorAccess, connectorAccessSnapshot as decodeConnectorAccessSnapshot, decodeEventSource, decodeEventSources, decodeResultList, decodeResultRead, decodeRunEvent, decodeTriggerCatalog, flowInspection, inspectFlowDraft, isRunTerminalEvent, nodeDetails, parseProviderAccessSource, parseResultQuery, providerAccessBindingId, providerIconAppearance, readResult, searchTriggerKeys };
|