@oomol-lab/open-flow 0.1.0-beta.85 → 0.1.0-beta.86
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/{FlowCanvas-CZoHhB1y.js → FlowCanvas-CHIaMaBv.js} +3 -3
- package/dist/browser/{createResourceDialog-Bi4fUnbD.js → createResourceDialog-C0E5yPe6.js} +3 -3
- package/dist/browser/{dialog-BzoSxhXQ.js → dialog-b3hsdu8i.js} +291 -143
- package/dist/browser/{exportPng-CXVWVlLc.js → exportPng-DGHcejgy.js} +2 -2
- package/dist/browser/{flowChanges-C567g-Pc.js → flowChanges-BvSWezEb.js} +375 -83
- package/dist/browser/{flowWorkspace-BNdBKtla.js → flowWorkspace-BKnMRClO.js} +1619 -475
- package/dist/browser/fr-CNTSedYU.js +593 -0
- package/dist/browser/ja-CxQBHr2J.js +593 -0
- package/dist/browser/ko-D1Exiv1h.js +593 -0
- package/dist/browser/licenses.md +1 -1
- package/dist/browser/{markdownContent-DF39sd9T.js → markdownContent-BR9-1ikU.js} +1 -1
- package/dist/browser/preview.css +181 -181
- package/dist/browser/preview.js +1994 -623
- package/dist/browser/ru-BzLZv0B7.js +593 -0
- package/dist/browser/{tooltip-DGj5pudg.js → tooltip-DSBF3bRw.js} +55 -23
- package/dist/browser/workbench.css +181 -181
- package/dist/browser/workbench.js +86 -17
- package/dist/browser/{workbenchSelect-BIaEVTx6.js → workbenchSelect-Di1Bm_-d.js} +2 -2
- package/dist/browser/{wrapLayout-C4moMKgb.js → wrapLayout-B0AT8_-i.js} +1 -1
- package/dist/browser/zh-CN-Dg_xSGde.js +593 -0
- package/dist/browser/zh-TW-oxuLwsV0.js +593 -0
- package/dist/command/index.js +61 -57
- package/dist/command/licenses.md +28 -4
- package/dist/common/authoring.d.ts +5 -5
- package/dist/common/authoringExamples.d.ts +3 -2
- package/dist/common/authoringSchema.d.ts +41 -4
- package/dist/common/catalogCache.d.ts +46 -0
- package/dist/common/connector-action.js +13 -10
- package/dist/common/connector-proxy.d.ts +96 -0
- package/dist/common/connector-proxy.js +5209 -0
- package/dist/common/control-api-conformance.js +312 -46
- package/dist/common/control-api.d.ts +12 -1
- package/dist/common/control-api.js +303 -41
- package/dist/common/control-requests.d.ts +4 -3
- package/dist/common/control-requests.js +14111 -171
- package/dist/common/engine-contract.d.ts +3 -2
- package/dist/common/event-source.js +55 -23
- package/dist/common/flow-authoring-node.d.ts +2 -0
- package/dist/common/flow-authoring.js +6936 -6781
- package/dist/common/flow-change-schema.d.ts +1 -1
- package/dist/common/flow-change.d.ts +2 -2
- package/dist/common/flow-change.js +91 -36
- package/dist/common/flow-connectionUsage.d.ts +1 -1
- package/dist/common/flow-encoding.js +93 -38
- package/dist/common/flow-requestParameters.d.ts +34 -0
- package/dist/common/flow-semantics.js +9429 -9236
- package/dist/common/flow-state.js +55 -23
- package/dist/common/flow-workflowFile.d.ts +3 -1
- package/dist/common/http-request.d.ts +6 -11
- package/dist/common/http-request.js +192 -141
- package/dist/common/licenses.md +1 -1
- package/dist/common/mcp.d.ts +3 -3
- package/dist/common/mcp.js +303 -41
- package/dist/common/run-events.js +1 -0
- package/dist/common/runtime-contract.js +10 -4
- package/dist/common/runtime-nodejs-compat.js +55 -23
- package/dist/common/scheduler-checkpoint.d.ts +3 -3
- package/dist/common/scheduler-dependencies.d.ts +22 -28
- package/dist/common/scheduler-node-execution.d.ts +1 -0
- package/dist/common/scheduler.d.ts +8 -2
- package/dist/common/scheduler.js +274 -95
- package/dist/common/workflow.js +51 -19
- package/dist/common/workflowAuthoring.d.ts +411 -0
- package/dist/render/browser/licenses.md +1 -1
- package/dist/render/browser/runtime.js +180 -48
- package/dist/render/node/index.js +85 -30
- package/dist/render/node/licenses.md +1 -1
- package/package.json +1 -1
- package/skills/open-flow/references/flow-authoring.md +14 -13
- package/src/base/common/jsonSchema.ts +11 -0
- package/src/connector/common/actionSchema.ts +4 -11
- package/src/connector/common/proxy.ts +152 -0
- package/src/control/common/api.ts +99 -3
- package/src/control/common/authoring.ts +23 -9
- package/src/control/common/authoringExamples.ts +9 -0
- package/src/control/common/authoringSchema.ts +21 -12
- package/src/control/common/catalogCache.ts +145 -0
- package/src/control/common/conformance.ts +9 -3
- package/src/control/common/connectorQueries.ts +17 -2
- package/src/control/common/requests.ts +1 -0
- package/src/control/common/workflowAuthoring.ts +120 -0
- package/src/execution/common/checkpoint.ts +18 -12
- package/src/execution/common/dependencies.ts +132 -15
- package/src/execution/common/events.ts +3 -0
- package/src/execution/common/node-execution.ts +22 -15
- package/src/execution/common/scheduler.ts +20 -31
- package/src/flow/common/change.ts +2 -1
- package/src/flow/common/changeSchema.ts +11 -1
- package/src/flow/common/connectionUsage.ts +4 -2
- package/src/flow/common/errorHandling.ts +3 -1
- package/src/flow/common/nodeChanges.ts +35 -18
- package/src/flow/common/requestParameters.ts +120 -0
- package/src/flow/common/semantics.ts +51 -1
- package/src/flow/common/sourceField.ts +3 -2
- package/src/flow/common/workflowFile.ts +2 -2
- package/src/http/common/httpRequest.ts +28 -78
- package/src/runtime/common/engineContract.ts +6 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { i as __require, o as __toESM, t as __commonJSMin } from "./rolldown-runtime-CEgmsyvS.js";
|
|
2
|
-
import { A as DropdownMenuItem, E as DropdownMenu, O as DropdownMenuContent, P as DropdownMenuSeparator, Q as uiLocales, R as DropdownMenuTrigger, S as spriteIcon, T as useIconifyData, V as useCompositeItem, _ as Z, a as CompositeRoot, at as ja_default$3, b as imageIcon, c as PopoverContent, ct as I18n, et as waitBranchLocales, f as PopoverTitle, h as ScrollArea, i as Textarea, it as ko_default$3, lt as providerIconAppearance, n as wrapLayout, nt as zh_CN_default$3, o as ACTIVE_COMPOSITE_ITEM, ot as fr_default$3, p as PopoverTrigger, r as canvasDirection, rt as ru_default$3, s as Popover, st as en_default$3, tt as zh_TW_default$3, ut as Checkbox, v as ContentIcon, w as useIconifyCollectionLoader, x as placeholderIcon } from "./wrapLayout-
|
|
2
|
+
import { A as DropdownMenuItem, E as DropdownMenu, O as DropdownMenuContent, P as DropdownMenuSeparator, Q as uiLocales, R as DropdownMenuTrigger, S as spriteIcon, T as useIconifyData, V as useCompositeItem, _ as Z, a as CompositeRoot, at as ja_default$3, b as imageIcon, c as PopoverContent, ct as I18n, et as waitBranchLocales, f as PopoverTitle, h as ScrollArea, i as Textarea, it as ko_default$3, lt as providerIconAppearance, n as wrapLayout, nt as zh_CN_default$3, o as ACTIVE_COMPOSITE_ITEM, ot as fr_default$3, p as PopoverTrigger, r as canvasDirection, rt as ru_default$3, s as Popover, st as en_default$3, tt as zh_TW_default$3, ut as Checkbox, v as ContentIcon, w as useIconifyCollectionLoader, x as placeholderIcon } from "./wrapLayout-B0AT8_-i.js";
|
|
3
3
|
import { a as derive, i as compute, l as val, t as arrayShallowEqual } from "./dist-bO8nvHFH.js";
|
|
4
4
|
import { a as toPlainObject, l as useTranslate, o as I18nProvider, s as useI18n, u as useVal } from "./dist-BFmpkX4P.js";
|
|
5
|
-
import { $n as inputClear, A as string$1, Bn as transitionStatusMapping, Br as useStableCallback, C as literal, Cr as cn, Dn as getTarget, Dr as EMPTY_ARRAY, E as object$2, En as contains, Er as useRenderElement, Et as useFloatingRootContext, F as IndexGuessBehavior, Fr as formatErrorMessage, Ft as useDismiss, Gn as createGenericEventDetails, I as useCompositeListItem, In as useTransitionStatus, Ir as mergeProps, It as useClick, Jn as closePress, Kt as DROPDOWN_COLLISION_AVOIDANCE, Ln as useOpenChangeComplete, Lr as useIsoLayoutEffect, Lt as FloatingFocusManager, M as unknown, Mn as ownerDocument, Mr as useButton, Nn as useLabelableId, O as record$3, On as isAndroid, Or as EMPTY_OBJECT, Qn as inputChange, Qt as useStore, S as lazy$1, Sn as stopEvent, Sr as buttonVariants, T as number, Tn as activeElement, Tr as clsx, Un as useValueChanged, Vr as useRefWithInit, Wn as createChangeEventDetails, Wr as isElement, Wt as FloatingPortal, Yn as escapeKey, Zt as Store, _ as array, _r as fieldValidityMapping, an as useOnFirstRender, at as useAnchorPositioning, b as int, br as useControlled, bt as useListNavigation, ct as CompositeList, dr as useFormContext, er as inputPress, et as useAnchoredPopupScrollLock, fr as useRegisterFieldControl, ft as popupStateMapping, g as _enum, gr as DEFAULT_FIELD_STATE_ATTRIBUTES, ht as useOpenInteractionType, i as TooltipTrigger, in as useValueAsRef, it as InternalBackdrop, j as union, jr as useMergedRefs, k as strictObject, kn as isFirefox, kr as NOOP, lt as inertValue, mr as useBaseUiId, n as TooltipContent, nr as listNavigation, nt as usePositioner, p as timeZoneOffsetMinutes, pr as useFieldRootContext, pt as pressableTriggerOpenStateMapping, rn as createSelector, rr as none, rt as getDisabledMountTransitionStyles, sn as useTimeout, st as useDirection, t as Tooltip, tr as itemPress, ur as useLabelableContext, ut as getPseudoElementBounds, v as boolean, vr as visuallyHidden, vt as useTypeahead, wn as isInteractiveElement, wr as cva, x as json$3, xr as Button, xt as useInteractions, y as discriminatedUnion, yr as visuallyHiddenInput, zn as TransitionStatusDataAttributes } from "./tooltip-
|
|
6
|
-
import { $t as
|
|
5
|
+
import { $n as inputClear, A as string$1, Bn as transitionStatusMapping, Br as useStableCallback, C as literal, Cr as cn, Dn as getTarget, Dr as EMPTY_ARRAY, E as object$2, En as contains, Er as useRenderElement, Et as useFloatingRootContext, F as IndexGuessBehavior, Fr as formatErrorMessage, Ft as useDismiss, Gn as createGenericEventDetails, I as useCompositeListItem, In as useTransitionStatus, Ir as mergeProps, It as useClick, Jn as closePress, Kt as DROPDOWN_COLLISION_AVOIDANCE, Ln as useOpenChangeComplete, Lr as useIsoLayoutEffect, Lt as FloatingFocusManager, M as unknown, Mn as ownerDocument, Mr as useButton, Nn as useLabelableId, O as record$3, On as isAndroid, Or as EMPTY_OBJECT, Qn as inputChange, Qt as useStore, S as lazy$1, Sn as stopEvent, Sr as buttonVariants, T as number, Tn as activeElement, Tr as clsx, Un as useValueChanged, Vr as useRefWithInit, Wn as createChangeEventDetails, Wr as isElement, Wt as FloatingPortal, Yn as escapeKey, Zt as Store, _ as array, _r as fieldValidityMapping, an as useOnFirstRender, at as useAnchorPositioning, b as int, br as useControlled, bt as useListNavigation, ct as CompositeList, dr as useFormContext, er as inputPress, et as useAnchoredPopupScrollLock, fr as useRegisterFieldControl, ft as popupStateMapping, g as _enum, gr as DEFAULT_FIELD_STATE_ATTRIBUTES, ht as useOpenInteractionType, i as TooltipTrigger, in as useValueAsRef, it as InternalBackdrop, j as union, jr as useMergedRefs, k as strictObject, kn as isFirefox, kr as NOOP, lt as inertValue, mr as useBaseUiId, n as TooltipContent, nr as listNavigation, nt as usePositioner, p as timeZoneOffsetMinutes, pr as useFieldRootContext, pt as pressableTriggerOpenStateMapping, rn as createSelector, rr as none, rt as getDisabledMountTransitionStyles, sn as useTimeout, st as useDirection, t as Tooltip, tr as itemPress, ur as useLabelableContext, ut as getPseudoElementBounds, v as boolean, vr as visuallyHidden, vt as useTypeahead, wn as isInteractiveElement, wr as cva, x as json$3, xr as Button, xt as useInteractions, y as discriminatedUnion, yr as visuallyHiddenInput, zn as TransitionStatusDataAttributes } from "./tooltip-DSBF3bRw.js";
|
|
6
|
+
import { $t as SelectGroup, At as requestInputMappings, B as authoringDefinitionSchemas, Bt as schemaObject, Ct as connectorProxyInputs, D as nodeSystemOutputPorts, Dt as connectorProxyTask, G as workflowAgentToolSchema, Gt as flowStateValuesSchema, H as connectorCapabilitySchema, Ht as isSchemaKeyword, I as otherwiseOutput, It as webhookSupportsBody, J as webhookResponseAllowsBody, Jt as skipDuplicatesTask, K as webhookHeaderValuePort, Kt as flowStateViewSchema, Lt as comparePorts, Mt as renameOutputMapping, N as nodeInputMappings, Nt as renamedPort, Ot as withConnectorProxyParameterFields, Pt as httpHeaderNameIssue, Q as workflowOutputsPort, Qt as SelectContent, Rt as matchesSchema, S as resourceNameIssue, U as decodeRevisionContent, Ut as format, V as connectorAgentToolSchema, W as httpCapabilitySchema, Wt as flowStateSummarySchema, Xt as Select, Y as webhookResponseInputs, Yt as dequal$1, Z as webhookStatusCodePort, _ as applyFlowChanges$1, a as DialogFooter, an as hasNullItemLabel, bt as connectorProxyConfigSchema, cn as stringifyAsValue, d as Field, dn as findItemIndex, dt as withHttpParameterSource, en as SelectItem, fn as removeItem, gt as decisionTask, h as FieldLabel, hn as Input, i as DialogDescription, in as resolveAriaLabelledBy, it as checkJsonDepth, j as conditionInputPorts, jt as remapInputMappings, k as clearConditionBindings, kt as withConnectorProxyParameterSource, ln as compareItemEquality, lt as httpRequestTask, mn as Label, n as DialogClose, nn as SelectTrigger, nt as retryConfigurationSchema, o as DialogHeader, on as isGroupedItems, p as FieldError, pn as selectedValueIncludes, q as webhookHeadersPort, qt as skipDuplicatesConfigSchema, r as DialogContent, rn as SelectValue, s as DialogTitle, sn as stringifyAsLabel, st as httpRequestConfigSchema, t as Dialog, un as defaultItemEquality, ut as withHttpParameterFields, v as isTriggerNode, x as normalizeNodeName, xt as connectorProxyHasBody, y as nextNodeName, z as agentToolFields, zt as portsAssignable } from "./dialog-b3hsdu8i.js";
|
|
7
7
|
import { a as uiLanguages, n as isUiLanguage, r as resolveUiLanguage } from "./languages-gYzoQqCi.js";
|
|
8
8
|
import "./lib-Dws05GHj.js";
|
|
9
9
|
import { i as objectValue, s as valueType, t as initialValue } from "./value-BbFQZZ_V.js";
|
|
@@ -244,8 +244,8 @@ function optionalString(value) {
|
|
|
244
244
|
}
|
|
245
245
|
//#endregion
|
|
246
246
|
//#region src/runtime/common/engineContract.ts
|
|
247
|
-
/**
|
|
248
|
-
var currentEngineContract = "open-flow-engine/
|
|
247
|
+
/** v11 adds Provider API requests through Connector Proxy. */
|
|
248
|
+
var currentEngineContract = "open-flow-engine/v11";
|
|
249
249
|
/** The published v8 Node compatibility contract, retained for existing Publications and Runs. */
|
|
250
250
|
var nodejsEngineContract = "open-flow-engine/v8/nodejs-compat-v1";
|
|
251
251
|
var platformSource = (contract) => `export const engineContract = ${JSON.stringify(contract)}
|
|
@@ -295,13 +295,19 @@ var v9Contract = {
|
|
|
295
295
|
codeFetch: true,
|
|
296
296
|
platformSource: platformSource("open-flow-engine/v9")
|
|
297
297
|
};
|
|
298
|
-
var
|
|
298
|
+
var v10Contract = {
|
|
299
299
|
...v9Contract,
|
|
300
300
|
flowState: true,
|
|
301
|
+
platformSource: platformSource("open-flow-engine/v10")
|
|
302
|
+
};
|
|
303
|
+
var currentContract = {
|
|
304
|
+
...v10Contract,
|
|
305
|
+
connectorProxy: true,
|
|
301
306
|
platformSource: platformSource(currentEngineContract)
|
|
302
307
|
};
|
|
303
308
|
function findEngineContract(contract) {
|
|
304
|
-
if (contract == "open-flow-engine/
|
|
309
|
+
if (contract == "open-flow-engine/v11") return currentContract;
|
|
310
|
+
if (contract == "open-flow-engine/v10") return v10Contract;
|
|
305
311
|
if (contract == "open-flow-engine/v9") return v9Contract;
|
|
306
312
|
if (contract == "open-flow-engine/v8") return v8Contract;
|
|
307
313
|
if (contract == "open-flow-engine/v8/nodejs-compat-v1") return nodejsContract;
|
|
@@ -941,6 +947,7 @@ var type = _enum([
|
|
|
941
947
|
"integration",
|
|
942
948
|
"code",
|
|
943
949
|
"connector",
|
|
950
|
+
"connector-proxy",
|
|
944
951
|
"agent",
|
|
945
952
|
"llm",
|
|
946
953
|
"decision",
|
|
@@ -1075,6 +1082,7 @@ var authoringConfigurations = {
|
|
|
1075
1082
|
capabilities: authoringCapabilities.optional()
|
|
1076
1083
|
}),
|
|
1077
1084
|
"connector": authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
|
|
1085
|
+
"connector-proxy": connectorProxyConfigSchema,
|
|
1078
1086
|
"openapi": authoringOpenApiSchema,
|
|
1079
1087
|
"http-request": httpRequestConfigSchema,
|
|
1080
1088
|
"skip-duplicates": skipDuplicatesConfigSchema,
|
|
@@ -1764,6 +1772,13 @@ function connectionUsage$7(document) {
|
|
|
1764
1772
|
name
|
|
1765
1773
|
});
|
|
1766
1774
|
if (task?.executor.kind == "connector") add("connector", task.executor.action, task.executor.connectionId);
|
|
1775
|
+
if (task?.executor.kind == "connector-proxy") uses.push({
|
|
1776
|
+
kind: "connector-proxy",
|
|
1777
|
+
providerId: task.executor.providerId,
|
|
1778
|
+
connectionId: task.executor.connectionId,
|
|
1779
|
+
nodeId,
|
|
1780
|
+
name
|
|
1781
|
+
});
|
|
1767
1782
|
if (node.kind == "task" && "moduleId" in node.task) {
|
|
1768
1783
|
for (const capability of node.task.capabilities ?? []) if ("mode" in capability && capability.mode == "independent") for (const action of capability.actions) add("code", action.action, action.connectionId);
|
|
1769
1784
|
}
|
|
@@ -1792,7 +1807,7 @@ function clearNodeConnections(graph, connectionId) {
|
|
|
1792
1807
|
const { connectionId: _, ...rest } = value;
|
|
1793
1808
|
return rest;
|
|
1794
1809
|
};
|
|
1795
|
-
if (executor.kind == "connector") return [id, {
|
|
1810
|
+
if (executor.kind == "connector" || executor.kind == "connector-proxy") return [id, {
|
|
1796
1811
|
...node,
|
|
1797
1812
|
task: {
|
|
1798
1813
|
...node.task,
|
|
@@ -1925,8 +1940,8 @@ function cleanWorkflowFile(value) {
|
|
|
1925
1940
|
}
|
|
1926
1941
|
};
|
|
1927
1942
|
}
|
|
1928
|
-
function encodeWorkflowFile(file) {
|
|
1929
|
-
return `${JSON.stringify(cleanWorkflowFile(file).file, null, 2)}\n`;
|
|
1943
|
+
function encodeWorkflowFile(file, options = {}) {
|
|
1944
|
+
return `${JSON.stringify(options.clean === false ? decodeWorkflowFile(file) : cleanWorkflowFile(file).file, null, 2)}\n`;
|
|
1930
1945
|
}
|
|
1931
1946
|
function workflowFileName(name) {
|
|
1932
1947
|
return `${name.replace(/[<>:"/\\|?*\u0000-\u001f]/g, "_").replace(/[. ]+$/g, "") || "workflow"}.openflow.json`;
|
|
@@ -2615,6 +2630,17 @@ function normalizeTriggerOutputs(trigger, outputs) {
|
|
|
2615
2630
|
return matchesTriggerOutputs(trigger, normalized) ? normalized : void 0;
|
|
2616
2631
|
}
|
|
2617
2632
|
//#endregion
|
|
2633
|
+
//#region src/base/common/jsonSchema.ts
|
|
2634
|
+
/** Keep local definition references usable when a property becomes a standalone schema. */
|
|
2635
|
+
function propertySchemaWithDefinitions(root, schema) {
|
|
2636
|
+
const property = toPlainObject(schema);
|
|
2637
|
+
if (property == null) return schema;
|
|
2638
|
+
const result = Object.assign({}, property);
|
|
2639
|
+
if (result.$defs == null && root.$defs != null) result.$defs = root.$defs;
|
|
2640
|
+
if (result.definitions == null && root.definitions != null) result.definitions = root.definitions;
|
|
2641
|
+
return result;
|
|
2642
|
+
}
|
|
2643
|
+
//#endregion
|
|
2618
2644
|
//#region src/flow/common/sourceField.ts
|
|
2619
2645
|
/** Only explicitly declared, first-level object properties are selectable. */
|
|
2620
2646
|
function sourceFields(output) {
|
|
@@ -2631,7 +2657,7 @@ function sourceFields(output) {
|
|
|
2631
2657
|
field,
|
|
2632
2658
|
port: {
|
|
2633
2659
|
...typeof description == "string" ? { description } : {},
|
|
2634
|
-
jsonSchema,
|
|
2660
|
+
jsonSchema: propertySchemaWithDefinitions(schema, jsonSchema),
|
|
2635
2661
|
nullable: missingParent || !required.includes(field)
|
|
2636
2662
|
}
|
|
2637
2663
|
};
|
|
@@ -3195,6 +3221,118 @@ function decodeResultRead(value) {
|
|
|
3195
3221
|
}
|
|
3196
3222
|
new TextEncoder();
|
|
3197
3223
|
//#endregion
|
|
3224
|
+
//#region src/control/common/catalogCache.ts
|
|
3225
|
+
function cachedResponse(value) {
|
|
3226
|
+
if (value == null || typeof value != "object" || Array.isArray(value)) return;
|
|
3227
|
+
const entry = value;
|
|
3228
|
+
if (entry.version !== 1 || !Object.hasOwn(entry, "body") || !(entry.etag === null || typeof entry.etag == "string") || typeof entry.validatedAt != "number" || !Number.isFinite(entry.validatedAt) || entry.validatedAt < 0) return;
|
|
3229
|
+
return {
|
|
3230
|
+
version: 1,
|
|
3231
|
+
body: jsonValue(entry.body),
|
|
3232
|
+
etag: entry.etag,
|
|
3233
|
+
validatedAt: entry.validatedAt
|
|
3234
|
+
};
|
|
3235
|
+
}
|
|
3236
|
+
/** Cancellation belongs to each waiter, not the shared metadata request. */
|
|
3237
|
+
function wait$1(promise, signal) {
|
|
3238
|
+
if (signal == null) return promise;
|
|
3239
|
+
if (signal.aborted) {
|
|
3240
|
+
promise.catch(() => {});
|
|
3241
|
+
return Promise.reject(signal.reason);
|
|
3242
|
+
}
|
|
3243
|
+
return new Promise((resolve, reject) => {
|
|
3244
|
+
const abort = () => reject(signal.reason);
|
|
3245
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
3246
|
+
promise.then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
|
|
3247
|
+
});
|
|
3248
|
+
}
|
|
3249
|
+
/** Complete Flow API responses, never a merged store of catalog entities. */
|
|
3250
|
+
var ControlCatalogCache = class {
|
|
3251
|
+
#pending = /* @__PURE__ */ new Map();
|
|
3252
|
+
constructor(options) {
|
|
3253
|
+
this.options = options;
|
|
3254
|
+
if (!options.scope.trim()) throw new TypeError("Control cache scope must be nonempty.");
|
|
3255
|
+
if (options.maxAgeMs != null && (!Number.isFinite(options.maxAgeMs) || options.maxAgeMs < 0)) throw new TypeError("Control cache maxAgeMs must be finite and nonnegative.");
|
|
3256
|
+
}
|
|
3257
|
+
async read(query, load, maxAgeMs, signal, fresh = false) {
|
|
3258
|
+
signal?.throwIfAborted();
|
|
3259
|
+
const key = JSON.stringify([
|
|
3260
|
+
"open-flow:catalog",
|
|
3261
|
+
1,
|
|
3262
|
+
this.options.scope,
|
|
3263
|
+
query.path
|
|
3264
|
+
]);
|
|
3265
|
+
const result = await wait$1(this.#request(key, query, load, this.options.maxAgeMs ?? maxAgeMs, fresh || this.options.mode == "refresh"), signal);
|
|
3266
|
+
const data = query.decode(structuredClone(result.body));
|
|
3267
|
+
try {
|
|
3268
|
+
this.options.onRead?.({
|
|
3269
|
+
...result,
|
|
3270
|
+
body: structuredClone(result.body)
|
|
3271
|
+
});
|
|
3272
|
+
} catch {}
|
|
3273
|
+
return {
|
|
3274
|
+
data,
|
|
3275
|
+
etag: result.etag
|
|
3276
|
+
};
|
|
3277
|
+
}
|
|
3278
|
+
#request(key, query, load, maxAgeMs, fresh) {
|
|
3279
|
+
const previous = this.#pending.get(key);
|
|
3280
|
+
if (previous != null) {
|
|
3281
|
+
if (!fresh || previous.fresh) return previous.promise;
|
|
3282
|
+
return previous.promise.catch(() => void 0).then(() => this.#request(key, query, load, maxAgeMs, true));
|
|
3283
|
+
}
|
|
3284
|
+
const promise = this.#load(key, query, load, maxAgeMs, fresh).finally(() => {
|
|
3285
|
+
if (this.#pending.get(key)?.promise === promise) this.#pending.delete(key);
|
|
3286
|
+
});
|
|
3287
|
+
this.#pending.set(key, {
|
|
3288
|
+
fresh,
|
|
3289
|
+
promise
|
|
3290
|
+
});
|
|
3291
|
+
return promise;
|
|
3292
|
+
}
|
|
3293
|
+
async #load(key, query, load, maxAgeMs, fresh) {
|
|
3294
|
+
let cached;
|
|
3295
|
+
try {
|
|
3296
|
+
const stored = await this.options.delegate.get(key);
|
|
3297
|
+
cached = cachedResponse(stored);
|
|
3298
|
+
if (cached != null) query.decode(structuredClone(cached.body));
|
|
3299
|
+
if (stored !== void 0 && cached == null) await this.options.delegate.delete(key);
|
|
3300
|
+
} catch {
|
|
3301
|
+
cached = void 0;
|
|
3302
|
+
try {
|
|
3303
|
+
await this.options.delegate.delete(key);
|
|
3304
|
+
} catch {}
|
|
3305
|
+
}
|
|
3306
|
+
const now = Date.now();
|
|
3307
|
+
const stale = cached == null || cached.validatedAt > now || now - cached.validatedAt >= maxAgeMs;
|
|
3308
|
+
if (cached != null && (this.options.mode == "offline" || !fresh && !stale)) return {
|
|
3309
|
+
...cached,
|
|
3310
|
+
path: query.path,
|
|
3311
|
+
source: "cache",
|
|
3312
|
+
stale
|
|
3313
|
+
};
|
|
3314
|
+
if (this.options.mode == "offline") throw new ApiError(503, "catalog.cache-miss", `No compatible cached response for ${query.path}.`);
|
|
3315
|
+
const result = await load(cached?.etag ?? null);
|
|
3316
|
+
if (!result.modified && cached == null) throw new ApiError(502, "response.invalid", "A catalog returned 304 without a cached response.");
|
|
3317
|
+
const entry = {
|
|
3318
|
+
version: 1,
|
|
3319
|
+
body: result.modified ? result.data : cached.body,
|
|
3320
|
+
etag: result.etag ?? (result.modified ? null : cached.etag),
|
|
3321
|
+
validatedAt: Date.now()
|
|
3322
|
+
};
|
|
3323
|
+
query.decode(structuredClone(entry.body));
|
|
3324
|
+
try {
|
|
3325
|
+
await this.options.delegate.set(key, structuredClone({ ...entry }));
|
|
3326
|
+
} catch {}
|
|
3327
|
+
return {
|
|
3328
|
+
...entry,
|
|
3329
|
+
path: query.path,
|
|
3330
|
+
source: result.modified ? "network" : "revalidated",
|
|
3331
|
+
stale: false
|
|
3332
|
+
};
|
|
3333
|
+
}
|
|
3334
|
+
};
|
|
3335
|
+
//#endregion
|
|
3198
3336
|
//#region src/control/common/checkDecoders.ts
|
|
3199
3337
|
function schemaPath$1(value) {
|
|
3200
3338
|
if (!Array.isArray(value)) return invalidResponse();
|
|
@@ -3279,6 +3417,23 @@ function connectorActionQuery(actionId, flowId, locale) {
|
|
|
3279
3417
|
}
|
|
3280
3418
|
};
|
|
3281
3419
|
}
|
|
3420
|
+
function connectorActionMetadataQuery(actionId, flowId, locale) {
|
|
3421
|
+
const parameters = new URLSearchParams({
|
|
3422
|
+
...flowId == null ? {} : { flowId },
|
|
3423
|
+
...locale == null ? {} : { locale }
|
|
3424
|
+
}).toString();
|
|
3425
|
+
return {
|
|
3426
|
+
path: `/v1/connector/action-metadata/${encodeURIComponent(actionId)}${parameters ? `?${parameters}` : ""}`,
|
|
3427
|
+
decode: (value) => {
|
|
3428
|
+
const source = record$2(value);
|
|
3429
|
+
requiredFields(source, ["action", "version"]);
|
|
3430
|
+
if (source.version != 1) return invalidResponse();
|
|
3431
|
+
const action = connectorActionMetadata(source.action);
|
|
3432
|
+
if (action.actionId != actionId) return invalidResponse("action.actionId: does not match the requested Action.");
|
|
3433
|
+
return action;
|
|
3434
|
+
}
|
|
3435
|
+
};
|
|
3436
|
+
}
|
|
3282
3437
|
function allConnectorConnectionsQuery(flowId) {
|
|
3283
3438
|
return {
|
|
3284
3439
|
path: `/v1/connector/connections${scope$2(flowId)}`,
|
|
@@ -3975,7 +4130,7 @@ function decodeRunEvent(value) {
|
|
|
3975
4130
|
switch (kind) {
|
|
3976
4131
|
case "node.started": {
|
|
3977
4132
|
const nodeKind = payload.nodeKind;
|
|
3978
|
-
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "http-request" && nodeKind !== "skip-duplicates" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
|
|
4133
|
+
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "connector-proxy" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "http-request" && nodeKind !== "skip-duplicates" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
|
|
3979
4134
|
return {
|
|
3980
4135
|
...base,
|
|
3981
4136
|
kind,
|
|
@@ -4084,9 +4239,11 @@ function operationKey(operation) {
|
|
|
4084
4239
|
return `${operation}-${randomId()}`;
|
|
4085
4240
|
}
|
|
4086
4241
|
var ControlClient = class {
|
|
4087
|
-
constructor(requestControl, channel = "api") {
|
|
4242
|
+
constructor(requestControl, channel = "api", options = {}) {
|
|
4243
|
+
this.options = options;
|
|
4088
4244
|
this.channel = channel;
|
|
4089
4245
|
this.requestControl = requestControl;
|
|
4246
|
+
if (options.cache != null) this.catalogCache = new ControlCatalogCache(options.cache);
|
|
4090
4247
|
}
|
|
4091
4248
|
async loadOpenApiDocument(url, signal) {
|
|
4092
4249
|
const result = record$2(await this.request("/v1/openapi/document", {
|
|
@@ -4381,6 +4538,16 @@ var ControlClient = class {
|
|
|
4381
4538
|
};
|
|
4382
4539
|
}
|
|
4383
4540
|
async getTriggerCatalog(locale, cached, signal) {
|
|
4541
|
+
if (this.catalogCache != null) {
|
|
4542
|
+
const result = await this.catalogResponse({
|
|
4543
|
+
path: `/v1/trigger-keys/catalog?locale=${encodeURIComponent(locale)}`,
|
|
4544
|
+
decode: decodeTriggerCatalog
|
|
4545
|
+
}, 3e5, signal);
|
|
4546
|
+
return {
|
|
4547
|
+
data: result.data,
|
|
4548
|
+
etag: result.etag
|
|
4549
|
+
};
|
|
4550
|
+
}
|
|
4384
4551
|
const headers = new Headers();
|
|
4385
4552
|
if (cached?.etag) headers.set("if-none-match", cached.etag);
|
|
4386
4553
|
const response = await this.response(`/v1/trigger-keys/catalog?locale=${encodeURIComponent(locale)}`, {
|
|
@@ -4400,6 +4567,16 @@ var ControlClient = class {
|
|
|
4400
4567
|
};
|
|
4401
4568
|
}
|
|
4402
4569
|
async getTriggerKey(key, signal) {
|
|
4570
|
+
if (this.catalogCache != null) return (await this.catalogResponse({
|
|
4571
|
+
path: `/v1/trigger-keys/${segment$1(key)}`,
|
|
4572
|
+
decode: (value) => {
|
|
4573
|
+
const source = record$2(value);
|
|
4574
|
+
if (source.version != 1) return invalidResponse();
|
|
4575
|
+
const definition = triggerKey(source.definition);
|
|
4576
|
+
if (definition.key != key) return invalidResponse("Trigger key does not match the requested definition.");
|
|
4577
|
+
return definition;
|
|
4578
|
+
}
|
|
4579
|
+
}, 3e5, signal)).data;
|
|
4403
4580
|
const source = record$2(await this.request(`/v1/trigger-keys/${segment$1(key)}`, { signal }));
|
|
4404
4581
|
if (source.version != 1) return invalidResponse();
|
|
4405
4582
|
return triggerKey(source.definition);
|
|
@@ -4515,6 +4692,7 @@ var ControlClient = class {
|
|
|
4515
4692
|
}
|
|
4516
4693
|
async listConnectorProviders(signal, flowId, locale) {
|
|
4517
4694
|
const query = connectorProvidersQuery(flowId, locale);
|
|
4695
|
+
if (this.catalogCache != null) return (await this.catalogResponse(query, 3e5, signal)).data;
|
|
4518
4696
|
return this.connectorRequest(query.path, "providers", signal, query.decode);
|
|
4519
4697
|
}
|
|
4520
4698
|
async listLeinaBots(flowId, signal) {
|
|
@@ -4595,6 +4773,23 @@ var ControlClient = class {
|
|
|
4595
4773
|
const query = connectorActionQuery(actionId, flowId, locale);
|
|
4596
4774
|
return this.connectorRequest(query.path, "actions", signal, query.decode, fresh);
|
|
4597
4775
|
}
|
|
4776
|
+
async listConnectorActionMetadata(serviceId, signal, flowId, locale) {
|
|
4777
|
+
return this.connectorMetadata({
|
|
4778
|
+
...serviceId == null ? {} : { service: serviceId },
|
|
4779
|
+
...flowId == null ? {} : { flowId },
|
|
4780
|
+
...locale == null ? {} : { locale }
|
|
4781
|
+
}, signal);
|
|
4782
|
+
}
|
|
4783
|
+
async searchConnectorActionMetadata(query, signal, flowId, locale) {
|
|
4784
|
+
return this.connectorMetadata({
|
|
4785
|
+
q: query.trim(),
|
|
4786
|
+
...flowId == null ? {} : { flowId },
|
|
4787
|
+
...locale == null ? {} : { locale }
|
|
4788
|
+
}, signal);
|
|
4789
|
+
}
|
|
4790
|
+
async getConnectorActionMetadata(actionId, signal, flowId, locale, fresh = false) {
|
|
4791
|
+
return (await this.catalogResponse(connectorActionMetadataQuery(actionId, flowId, locale), 3e4, signal, fresh)).data;
|
|
4792
|
+
}
|
|
4598
4793
|
async listAllConnectorConnections(signal, flowId, fresh = false) {
|
|
4599
4794
|
const query = allConnectorConnectionsQuery(flowId);
|
|
4600
4795
|
return this.connectorRequest(query.path, "connections", signal, query.decode, fresh);
|
|
@@ -4826,6 +5021,30 @@ var ControlClient = class {
|
|
|
4826
5021
|
method: "POST"
|
|
4827
5022
|
}));
|
|
4828
5023
|
}
|
|
5024
|
+
async catalogResponse(query, maxAgeMs, signal, fresh = false) {
|
|
5025
|
+
if (this.catalogCache != null) return this.catalogCache.read(query, (etag) => this.readCatalog({
|
|
5026
|
+
path: query.path,
|
|
5027
|
+
decode: jsonValue
|
|
5028
|
+
}, etag), maxAgeMs, signal, fresh);
|
|
5029
|
+
const response = await this.readCatalog(query, null, signal);
|
|
5030
|
+
if (!response.modified) return invalidResponse();
|
|
5031
|
+
return {
|
|
5032
|
+
data: response.data,
|
|
5033
|
+
etag: response.etag
|
|
5034
|
+
};
|
|
5035
|
+
}
|
|
5036
|
+
async connectorMetadata(parameters, signal) {
|
|
5037
|
+
const query = new URLSearchParams(parameters).toString();
|
|
5038
|
+
return (await this.catalogResponse({
|
|
5039
|
+
path: `/v1/connector/action-metadata${query ? `?${query}` : ""}`,
|
|
5040
|
+
decode: (value) => {
|
|
5041
|
+
const source = record$2(value);
|
|
5042
|
+
requiredFields(source, ["actions", "version"]);
|
|
5043
|
+
if (source.version != 1 || !Array.isArray(source.actions)) return invalidResponse();
|
|
5044
|
+
return source.actions.map(connectorActionMetadata);
|
|
5045
|
+
}
|
|
5046
|
+
}, 3e4, signal)).data;
|
|
5047
|
+
}
|
|
4829
5048
|
async connectorActions(parameters, signal) {
|
|
4830
5049
|
const query = Object.entries(parameters).map(([key, value]) => `${segment$1(key)}=${segment$1(value)}`).join("&");
|
|
4831
5050
|
const suffix = query == "" ? "" : `?${query}`;
|
|
@@ -4840,6 +5059,7 @@ var ControlClient = class {
|
|
|
4840
5059
|
return decode(await this.request(path, { signal }));
|
|
4841
5060
|
}
|
|
4842
5061
|
async response(path, init, allowNotModified = false) {
|
|
5062
|
+
if (this.options.cache?.mode == "offline") throw new ApiError(503, "control.offline", "Network requests are disabled for this Control client.");
|
|
4843
5063
|
const headers = new Headers(init.headers);
|
|
4844
5064
|
if (init.body != null) headers.set("content-type", "application/json");
|
|
4845
5065
|
const response = await this.requestControl(path, {
|
|
@@ -5254,13 +5474,13 @@ var catalog = [
|
|
|
5254
5474
|
group: "contacts"
|
|
5255
5475
|
}
|
|
5256
5476
|
];
|
|
5257
|
-
function FeishuEventPicker({ value, onChange, disabled = false, allowedEvents }) {
|
|
5477
|
+
function FeishuEventPicker({ value, onChange, disabled = false, readOnly = false, allowedEvents }) {
|
|
5258
5478
|
const t = useTranslate();
|
|
5259
5479
|
const id = useId();
|
|
5260
5480
|
const [search, setSearch] = useState("");
|
|
5261
5481
|
const [custom, setCustom] = useState("");
|
|
5262
5482
|
const [invalid, setInvalid] = useState(false);
|
|
5263
|
-
const entries = [...catalog.filter((entry) => allowedEvents == null || allowedEvents.includes(entry.id)).map((entry) => ({
|
|
5483
|
+
const entries = [...catalog.filter((entry) => (allowedEvents == null || allowedEvents.includes(entry.id)) && (!readOnly || value.includes(entry.id))).map((entry) => ({
|
|
5264
5484
|
id: entry.id,
|
|
5265
5485
|
group: entry.group,
|
|
5266
5486
|
label: t(`eventSources.eventNames.${entry.id.replaceAll(".", "_")}`)
|
|
@@ -5289,7 +5509,7 @@ function FeishuEventPicker({ value, onChange, disabled = false, allowedEvents })
|
|
|
5289
5509
|
htmlFor: id,
|
|
5290
5510
|
children: t("eventSources.events")
|
|
5291
5511
|
}),
|
|
5292
|
-
value.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
5512
|
+
!readOnly && value.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
5293
5513
|
className: "flex flex-wrap gap-1.5",
|
|
5294
5514
|
children: value.map((event) => /* @__PURE__ */ jsxs(Button, {
|
|
5295
5515
|
type: "button",
|
|
@@ -5312,7 +5532,7 @@ function FeishuEventPicker({ value, onChange, disabled = false, allowedEvents })
|
|
|
5312
5532
|
id,
|
|
5313
5533
|
type: "search",
|
|
5314
5534
|
value: search,
|
|
5315
|
-
disabled,
|
|
5535
|
+
disabled: disabled && !readOnly,
|
|
5316
5536
|
placeholder: t("eventSources.searchEvents"),
|
|
5317
5537
|
"aria-label": t("eventSources.searchEvents"),
|
|
5318
5538
|
onChange: (event) => setSearch(event.target.value)
|
|
@@ -5331,7 +5551,7 @@ function FeishuEventPicker({ value, onChange, disabled = false, allowedEvents })
|
|
|
5331
5551
|
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
5332
5552
|
className: "mt-0.5",
|
|
5333
5553
|
checked: value.includes(entry.id),
|
|
5334
|
-
disabled: disabled || !value.includes(entry.id) && value.length >= 200,
|
|
5554
|
+
disabled: readOnly || disabled || !value.includes(entry.id) && value.length >= 200,
|
|
5335
5555
|
onCheckedChange: (checked) => onChange(checked === true ? [...value, entry.id] : value.filter((event) => event != entry.id))
|
|
5336
5556
|
}), /* @__PURE__ */ jsxs("span", {
|
|
5337
5557
|
className: "flex min-w-0 flex-col gap-0.5",
|
|
@@ -5349,7 +5569,7 @@ function FeishuEventPicker({ value, onChange, disabled = false, allowedEvents })
|
|
|
5349
5569
|
children: t("eventSources.noEventMatches")
|
|
5350
5570
|
})]
|
|
5351
5571
|
}),
|
|
5352
|
-
value.length == 0 && /* @__PURE__ */ jsx("p", {
|
|
5572
|
+
!readOnly && value.length == 0 && /* @__PURE__ */ jsx("p", {
|
|
5353
5573
|
className: "m-0 text-xs text-muted-foreground",
|
|
5354
5574
|
children: t("eventSources.chooseEvents")
|
|
5355
5575
|
}),
|
|
@@ -5362,7 +5582,7 @@ function FeishuEventPicker({ value, onChange, disabled = false, allowedEvents })
|
|
|
5362
5582
|
unavailable.join(", ")
|
|
5363
5583
|
]
|
|
5364
5584
|
}),
|
|
5365
|
-
allowedEvents == null && /* @__PURE__ */ jsxs("details", { children: [
|
|
5585
|
+
!readOnly && allowedEvents == null && /* @__PURE__ */ jsxs("details", { children: [
|
|
5366
5586
|
/* @__PURE__ */ jsx("summary", {
|
|
5367
5587
|
className: "cursor-pointer text-xs text-muted-foreground",
|
|
5368
5588
|
children: t("eventSources.customEvent")
|
|
@@ -7154,6 +7374,7 @@ var resources = {
|
|
|
7154
7374
|
"missingStatuses": "Some selected statuses are no longer available. Remove or replace them."
|
|
7155
7375
|
},
|
|
7156
7376
|
nodePicker: {
|
|
7377
|
+
"custom": "Custom",
|
|
7157
7378
|
"actionGroups": {
|
|
7158
7379
|
"read": "Read actions",
|
|
7159
7380
|
"write": "Write actions",
|
|
@@ -7382,6 +7603,12 @@ var resources = {
|
|
|
7382
7603
|
"connector": "Connector",
|
|
7383
7604
|
"workflow": "Workflow"
|
|
7384
7605
|
},
|
|
7606
|
+
connectorProxy: {
|
|
7607
|
+
"bodyUnsupported": "GET requests do not support a request body.",
|
|
7608
|
+
"title": "Custom API Request",
|
|
7609
|
+
"description": "Call a Provider API using its connected account.",
|
|
7610
|
+
"endpoint": "Endpoint"
|
|
7611
|
+
},
|
|
7385
7612
|
httpRequest: {
|
|
7386
7613
|
"title": "HTTP Request",
|
|
7387
7614
|
"description": "Send an HTTP request and use its response in the workflow.",
|
|
@@ -8544,6 +8771,7 @@ var resources = {
|
|
|
8544
8771
|
"missingStatuses": "部分已选状态不再可用,请移除或重新选择。"
|
|
8545
8772
|
},
|
|
8546
8773
|
nodePicker: {
|
|
8774
|
+
"custom": "自定义",
|
|
8547
8775
|
"actionGroups": {
|
|
8548
8776
|
"read": "读取接口",
|
|
8549
8777
|
"write": "写入接口",
|
|
@@ -8772,6 +9000,12 @@ var resources = {
|
|
|
8772
9000
|
"connector": "连接器",
|
|
8773
9001
|
"workflow": "工作流"
|
|
8774
9002
|
},
|
|
9003
|
+
connectorProxy: {
|
|
9004
|
+
"bodyUnsupported": "GET 请求不支持请求体。",
|
|
9005
|
+
"title": "自定义 API 请求",
|
|
9006
|
+
"description": "使用已连接账号调用 Provider API。",
|
|
9007
|
+
"endpoint": "接口路径"
|
|
9008
|
+
},
|
|
8775
9009
|
httpRequest: {
|
|
8776
9010
|
"title": "HTTP 请求",
|
|
8777
9011
|
"description": "发送 HTTP 请求,在工作流中使用响应数据。",
|
|
@@ -9934,6 +10168,7 @@ var resources = {
|
|
|
9934
10168
|
"missingStatuses": "部分已選狀態不再可用,請移除或重新選擇。"
|
|
9935
10169
|
},
|
|
9936
10170
|
nodePicker: {
|
|
10171
|
+
"custom": "自訂",
|
|
9937
10172
|
"actionGroups": {
|
|
9938
10173
|
"read": "讀取介面",
|
|
9939
10174
|
"write": "寫入介面",
|
|
@@ -10162,6 +10397,12 @@ var resources = {
|
|
|
10162
10397
|
"connector": "連接器",
|
|
10163
10398
|
"workflow": "工作流程"
|
|
10164
10399
|
},
|
|
10400
|
+
connectorProxy: {
|
|
10401
|
+
"bodyUnsupported": "GET 請求不支援請求本文。",
|
|
10402
|
+
"title": "自訂 API 請求",
|
|
10403
|
+
"description": "使用已連線帳號呼叫 Provider API。",
|
|
10404
|
+
"endpoint": "介面路徑"
|
|
10405
|
+
},
|
|
10165
10406
|
httpRequest: {
|
|
10166
10407
|
"title": "HTTP 請求",
|
|
10167
10408
|
"description": "傳送 HTTP 請求,在工作流程中使用回應資料。",
|
|
@@ -11324,6 +11565,7 @@ var resources = {
|
|
|
11324
11565
|
"missingStatuses": "選択したステータスの一部は利用できません。削除するか選び直してください。"
|
|
11325
11566
|
},
|
|
11326
11567
|
nodePicker: {
|
|
11568
|
+
"custom": "カスタム",
|
|
11327
11569
|
"actionGroups": {
|
|
11328
11570
|
"read": "読み取り操作",
|
|
11329
11571
|
"write": "書き込み操作",
|
|
@@ -11552,6 +11794,12 @@ var resources = {
|
|
|
11552
11794
|
"connector": "コネクター",
|
|
11553
11795
|
"workflow": "ワークフロー"
|
|
11554
11796
|
},
|
|
11797
|
+
connectorProxy: {
|
|
11798
|
+
"bodyUnsupported": "GET リクエストはリクエストボディに対応していません。",
|
|
11799
|
+
"title": "カスタム API リクエスト",
|
|
11800
|
+
"description": "接続済みアカウントで Provider API を呼び出します。",
|
|
11801
|
+
"endpoint": "エンドポイント"
|
|
11802
|
+
},
|
|
11555
11803
|
httpRequest: {
|
|
11556
11804
|
"title": "HTTP リクエスト",
|
|
11557
11805
|
"description": "HTTP リクエストを送信し、ワークフローでレスポンスを使用します。",
|
|
@@ -12714,6 +12962,7 @@ var resources = {
|
|
|
12714
12962
|
"missingStatuses": "선택한 상태 중 일부를 사용할 수 없습니다. 삭제하거나 다시 선택하세요."
|
|
12715
12963
|
},
|
|
12716
12964
|
nodePicker: {
|
|
12965
|
+
"custom": "사용자 지정",
|
|
12717
12966
|
"actionGroups": {
|
|
12718
12967
|
"read": "읽기 작업",
|
|
12719
12968
|
"write": "쓰기 작업",
|
|
@@ -12942,6 +13191,12 @@ var resources = {
|
|
|
12942
13191
|
"connector": "커넥터",
|
|
12943
13192
|
"workflow": "워크플로"
|
|
12944
13193
|
},
|
|
13194
|
+
connectorProxy: {
|
|
13195
|
+
"bodyUnsupported": "GET 요청은 요청 본문을 지원하지 않습니다.",
|
|
13196
|
+
"title": "사용자 지정 API 요청",
|
|
13197
|
+
"description": "연결된 계정으로 Provider API를 호출합니다.",
|
|
13198
|
+
"endpoint": "엔드포인트"
|
|
13199
|
+
},
|
|
12945
13200
|
httpRequest: {
|
|
12946
13201
|
"title": "HTTP 요청",
|
|
12947
13202
|
"description": "HTTP 요청을 보내고 워크플로에서 응답을 사용합니다.",
|
|
@@ -14104,6 +14359,7 @@ var resources = {
|
|
|
14104
14359
|
"missingStatuses": "Некоторые выбранные статусы больше недоступны. Удалите или замените их."
|
|
14105
14360
|
},
|
|
14106
14361
|
nodePicker: {
|
|
14362
|
+
"custom": "Пользовательские",
|
|
14107
14363
|
"actionGroups": {
|
|
14108
14364
|
"read": "Операции чтения",
|
|
14109
14365
|
"write": "Операции записи",
|
|
@@ -14332,6 +14588,12 @@ var resources = {
|
|
|
14332
14588
|
"connector": "Коннектор",
|
|
14333
14589
|
"workflow": "Рабочий процесс"
|
|
14334
14590
|
},
|
|
14591
|
+
connectorProxy: {
|
|
14592
|
+
"bodyUnsupported": "GET-запросы не поддерживают тело запроса.",
|
|
14593
|
+
"title": "Пользовательский API-запрос",
|
|
14594
|
+
"description": "Вызов API провайдера через подключённый аккаунт.",
|
|
14595
|
+
"endpoint": "Путь запроса"
|
|
14596
|
+
},
|
|
14335
14597
|
httpRequest: {
|
|
14336
14598
|
"title": "HTTP-запрос",
|
|
14337
14599
|
"description": "Отправить HTTP-запрос и использовать ответ в рабочем процессе.",
|
|
@@ -15494,6 +15756,7 @@ var resources = {
|
|
|
15494
15756
|
"missingStatuses": "Certains statuts sélectionnés ne sont plus disponibles. Supprimez-les ou remplacez-les."
|
|
15495
15757
|
},
|
|
15496
15758
|
nodePicker: {
|
|
15759
|
+
"custom": "Personnalisé",
|
|
15497
15760
|
"actionGroups": {
|
|
15498
15761
|
"read": "Actions de lecture",
|
|
15499
15762
|
"write": "Actions d’écriture",
|
|
@@ -15722,6 +15985,12 @@ var resources = {
|
|
|
15722
15985
|
"connector": "Connecteur",
|
|
15723
15986
|
"workflow": "Workflow"
|
|
15724
15987
|
},
|
|
15988
|
+
connectorProxy: {
|
|
15989
|
+
"bodyUnsupported": "Les requêtes GET ne prennent pas en charge de corps.",
|
|
15990
|
+
"title": "Requête API personnalisée",
|
|
15991
|
+
"description": "Appeler une API du fournisseur avec le compte connecté.",
|
|
15992
|
+
"endpoint": "Point de terminaison"
|
|
15993
|
+
},
|
|
15725
15994
|
httpRequest: {
|
|
15726
15995
|
"title": "Requête HTTP",
|
|
15727
15996
|
"description": "Envoyer une requête HTTP et utiliser sa réponse dans le workflow.",
|
|
@@ -22651,12 +22920,32 @@ function setInputValue$1(content, nodeId, handle, value) {
|
|
|
22651
22920
|
return setInputValues(content, nodeId, { [handle]: value });
|
|
22652
22921
|
}
|
|
22653
22922
|
function setInputValues(content, nodeId, values) {
|
|
22923
|
+
return setInputMappings(content, nodeId, Object.fromEntries(Object.entries(values).map(([handle, value]) => [handle, fixedInputValue(value)])));
|
|
22924
|
+
}
|
|
22925
|
+
/** Input sources own whether a Provider request includes a body and its generated port. */
|
|
22926
|
+
function setInputMappings(content, nodeId, mappings) {
|
|
22654
22927
|
const node = content.document.graph?.nodes[nodeId];
|
|
22655
22928
|
if (node == null || isTriggerNode(node)) return;
|
|
22656
22929
|
const operations = [];
|
|
22657
|
-
|
|
22930
|
+
const task = node.kind === "task" && "executor" in node.task && node.task.executor.kind === "connector-proxy" ? node.task : void 0;
|
|
22931
|
+
let bodyUndeclared = false;
|
|
22932
|
+
if (task?.executor.kind === "connector-proxy" && Object.hasOwn(mappings, "body")) {
|
|
22933
|
+
const port = task.inputs.find((input) => "handle" in input && input.handle === "body");
|
|
22934
|
+
const hasBody = connectorProxyHasBody(mappings.body, port?.value);
|
|
22935
|
+
bodyUndeclared = !hasBody && task.executor.bodyFormat === "none";
|
|
22936
|
+
if (hasBody && task.executor.bodyFormat === "none") operations.push({
|
|
22937
|
+
kind: "graph.node.task.set",
|
|
22938
|
+
nodeId,
|
|
22939
|
+
before: task,
|
|
22940
|
+
value: connectorProxyTask({
|
|
22941
|
+
...task.executor,
|
|
22942
|
+
bodyFormat: "json"
|
|
22943
|
+
}, task.name, task)
|
|
22944
|
+
});
|
|
22945
|
+
}
|
|
22946
|
+
for (const [handle, value] of Object.entries(mappings)) {
|
|
22658
22947
|
const before = nodeInputMappings(node)[handle];
|
|
22659
|
-
const next =
|
|
22948
|
+
const next = handle === "body" && bodyUndeclared ? void 0 : value;
|
|
22660
22949
|
if (dequal$1(before, next)) continue;
|
|
22661
22950
|
operations.push({
|
|
22662
22951
|
before,
|
|
@@ -22672,28 +22961,15 @@ function setInputValues(content, nodeId, values) {
|
|
|
22672
22961
|
function resetInputValues(content, nodeId, handles) {
|
|
22673
22962
|
const node = content.document.graph?.nodes[nodeId];
|
|
22674
22963
|
if (node == null || isTriggerNode(node)) return [];
|
|
22675
|
-
|
|
22676
|
-
return cleanVariableBindings(content, [...new Set(handles)].flatMap((handle) => mappings[handle] == null ? [] : [{
|
|
22677
|
-
kind: "graph.node.input.set",
|
|
22678
|
-
nodeId,
|
|
22679
|
-
handle,
|
|
22680
|
-
before: mappings[handle],
|
|
22681
|
-
value: void 0
|
|
22682
|
-
}]));
|
|
22964
|
+
return setInputMappings(content, nodeId, Object.fromEntries(handles.map((handle) => [handle, void 0]))) ?? [];
|
|
22683
22965
|
}
|
|
22684
22966
|
function setInputSources(content, nodeId, handle, sources) {
|
|
22685
22967
|
const node = content.document.graph?.nodes[nodeId];
|
|
22686
22968
|
if (node == null || isTriggerNode(node)) return [];
|
|
22687
|
-
return
|
|
22688
|
-
kind: "
|
|
22689
|
-
|
|
22690
|
-
|
|
22691
|
-
before: nodeInputMappings(node)[handle],
|
|
22692
|
-
value: {
|
|
22693
|
-
kind: "sources",
|
|
22694
|
-
sources
|
|
22695
|
-
}
|
|
22696
|
-
}]);
|
|
22969
|
+
return setInputMappings(content, nodeId, { [handle]: {
|
|
22970
|
+
kind: "sources",
|
|
22971
|
+
sources
|
|
22972
|
+
} }) ?? [];
|
|
22697
22973
|
}
|
|
22698
22974
|
function setInputVariable$1(content, nodeId, handle, name, bindingId) {
|
|
22699
22975
|
const node = content.document.graph?.nodes[nodeId];
|
|
@@ -22711,6 +22987,13 @@ function setInputVariable$1(content, nodeId, handle, name, bindingId) {
|
|
|
22711
22987
|
value: name
|
|
22712
22988
|
}];
|
|
22713
22989
|
}
|
|
22990
|
+
const next = {
|
|
22991
|
+
kind: "sources",
|
|
22992
|
+
sources: [{
|
|
22993
|
+
bindingId,
|
|
22994
|
+
kind: "binding"
|
|
22995
|
+
}]
|
|
22996
|
+
};
|
|
22714
22997
|
return [{
|
|
22715
22998
|
binding: {
|
|
22716
22999
|
kind: "variable",
|
|
@@ -22718,19 +23001,7 @@ function setInputVariable$1(content, nodeId, handle, name, bindingId) {
|
|
|
22718
23001
|
},
|
|
22719
23002
|
bindingId,
|
|
22720
23003
|
kind: "binding.create"
|
|
22721
|
-
}, ...
|
|
22722
|
-
before: mapping,
|
|
22723
|
-
handle,
|
|
22724
|
-
kind: "graph.node.input.set",
|
|
22725
|
-
nodeId,
|
|
22726
|
-
value: {
|
|
22727
|
-
kind: "sources",
|
|
22728
|
-
sources: [{
|
|
22729
|
-
bindingId,
|
|
22730
|
-
kind: "binding"
|
|
22731
|
-
}]
|
|
22732
|
-
}
|
|
22733
|
-
}])];
|
|
23004
|
+
}, ...setInputMappings(content, nodeId, { [handle]: next }) ?? []];
|
|
22734
23005
|
}
|
|
22735
23006
|
function cleanVariableBindings(content, operations) {
|
|
22736
23007
|
const before = bindingReferences(content.document);
|
|
@@ -22758,9 +23029,9 @@ function bindingReferences(document) {
|
|
|
22758
23029
|
}
|
|
22759
23030
|
function setConnectorConnection(content, nodeId, connectionId) {
|
|
22760
23031
|
const node = content.document.graph.nodes[nodeId];
|
|
22761
|
-
if (node?.kind != "task" || !("executor" in node.task) || node.task.executor.kind != "connector") return;
|
|
23032
|
+
if (node?.kind != "task" || !("executor" in node.task) || node.task.executor.kind != "connector" && node.task.executor.kind != "connector-proxy") return;
|
|
22762
23033
|
const task = node.task;
|
|
22763
|
-
if (task.executor.kind != "connector") return;
|
|
23034
|
+
if (task.executor.kind != "connector" && task.executor.kind != "connector-proxy") return;
|
|
22764
23035
|
if (task.executor.connectionId == connectionId) return [];
|
|
22765
23036
|
const { connectionId: _, ...executor } = task.executor;
|
|
22766
23037
|
return [{
|
|
@@ -22799,6 +23070,8 @@ function setServiceConnections(content, providerId, connectionId, previousConnec
|
|
|
22799
23070
|
if (capabilities != null) operations.push(...setCodeActions(content, nodeId, capabilities) ?? []);
|
|
22800
23071
|
} else if (task.executor.kind == "connector") {
|
|
22801
23072
|
if (assign(task.executor) !== task.executor) operations.push(...setConnectorConnection(content, nodeId, connectionId) ?? []);
|
|
23073
|
+
} else if (task.executor.kind === "connector-proxy") {
|
|
23074
|
+
if (task.executor.providerId === providerId && task.executor.connectionId === previousConnectionId) operations.push(...setConnectorConnection(content, nodeId, connectionId) ?? []);
|
|
22802
23075
|
} else if (task.executor.kind == "agent") {
|
|
22803
23076
|
const executor = {
|
|
22804
23077
|
...task.executor,
|
|
@@ -23409,8 +23682,13 @@ function scope$1(path) {
|
|
|
23409
23682
|
function nodeSection(node, suffix) {
|
|
23410
23683
|
if (node.kind == "outputs" && (suffix.startsWith("/outputDefs") || suffix.startsWith("/outputMappings"))) return "inputs";
|
|
23411
23684
|
if (node.kind == "start" && suffix.startsWith("/inputDefs")) return "outputs";
|
|
23412
|
-
if (suffix.startsWith("/inputs/"))
|
|
23685
|
+
if (suffix.startsWith("/inputs/")) {
|
|
23686
|
+
if (node.kind === "condition") return "condition";
|
|
23687
|
+
if (node.kind === "task" && "executor" in node.task && ["http-request", "connector-proxy"].includes(node.task.executor.kind)) return "task";
|
|
23688
|
+
return "inputs";
|
|
23689
|
+
}
|
|
23413
23690
|
if (node.kind == "task" && suffix.startsWith("/task")) {
|
|
23691
|
+
if ("executor" in node.task && node.task.executor.kind === "connector-proxy" && suffix.startsWith("/task/executor/connectionId")) return "account";
|
|
23414
23692
|
if ("executor" in node.task && node.task.executor.kind == "connector" && suffix.startsWith("/task/executor")) return "account";
|
|
23415
23693
|
return "task";
|
|
23416
23694
|
}
|
|
@@ -23720,7 +23998,10 @@ var RevisionView = class {
|
|
|
23720
23998
|
const separator = actionId.indexOf(".");
|
|
23721
23999
|
if (separator > 0) connectorProviderIds.add(actionId.slice(0, separator));
|
|
23722
24000
|
}
|
|
23723
|
-
for (const node of Object.values(this.#document.graph.nodes))
|
|
24001
|
+
for (const node of Object.values(this.#document.graph.nodes)) {
|
|
24002
|
+
if (node.kind == "integration" || node.kind == "poll") connectorProviderIds.add(node.definition.provider);
|
|
24003
|
+
if (node.kind === "task" && "executor" in node.task && node.task.executor.kind === "connector-proxy") connectorProviderIds.add(node.task.executor.providerId);
|
|
24004
|
+
}
|
|
23724
24005
|
this.connectorProviderIds = connectorProviderIds;
|
|
23725
24006
|
}
|
|
23726
24007
|
inputMappings(node) {
|
|
@@ -24471,7 +24752,12 @@ function actionSummary(entries, actions, providers) {
|
|
|
24471
24752
|
//#region src/workbench/browser/runtime/workspace.ts
|
|
24472
24753
|
function semanticNodeIcon(node, connectorActions, providers = {}) {
|
|
24473
24754
|
if (node.node.icon != null) return node.node.icon;
|
|
24474
|
-
if (node.kind != "task" || node.definition == null || !("executor" in node.definition)
|
|
24755
|
+
if (node.kind != "task" || node.definition == null || !("executor" in node.definition)) return nodeIcon(node);
|
|
24756
|
+
if (node.definition.executor.kind === "connector-proxy") {
|
|
24757
|
+
const provider = providers[node.definition.executor.providerId];
|
|
24758
|
+
return provider == null ? nodeIcon(node) : providerIcon(provider);
|
|
24759
|
+
}
|
|
24760
|
+
if (node.definition.executor.kind !== "connector") return nodeIcon(node);
|
|
24475
24761
|
const actionId = node.definition.executor.action;
|
|
24476
24762
|
const provider = connectorActions[actionId] ?? providers[actionId.split(".")[0]];
|
|
24477
24763
|
return provider == null ? nodeIcon(node) : providerIcon(provider);
|
|
@@ -24515,7 +24801,7 @@ function nodeIcon(node) {
|
|
|
24515
24801
|
if (task.executor.kind == "http-request") return ":lucide-light:globe:";
|
|
24516
24802
|
if (task.executor.kind == "skip-duplicates") return ":lucide-light:list-filter:";
|
|
24517
24803
|
if (task.executor.kind == "openapi") return ":logos:openapi-icon:";
|
|
24518
|
-
return task.executor.kind == "connector" ? ":carbon:connection-signal:" : ":carbon:machine-learning-model:";
|
|
24804
|
+
return task.executor.kind == "connector" || task.executor.kind === "connector-proxy" ? ":carbon:connection-signal:" : ":carbon:machine-learning-model:";
|
|
24519
24805
|
}
|
|
24520
24806
|
}
|
|
24521
24807
|
}
|
|
@@ -24778,7 +25064,8 @@ function executorName(task, providerName, t) {
|
|
|
24778
25064
|
if (task.executor.kind == "openapi") return "OpenAPI";
|
|
24779
25065
|
if (task.executor.kind == "skip-duplicates") return t?.("flowState.nodeTitle") ?? "Skip Duplicates";
|
|
24780
25066
|
if (task.executor.kind == "llm") return t?.("designer.executorLlm") ?? "LLM";
|
|
24781
|
-
|
|
25067
|
+
const providerId = task.executor.kind === "connector-proxy" ? task.executor.providerId : task.executor.action.split(".")[0];
|
|
25068
|
+
return `${t?.("designer.executorConnector") ?? "Connector"} · ${providerName ?? providerId}`;
|
|
24782
25069
|
}
|
|
24783
25070
|
function triggerIcon(trigger) {
|
|
24784
25071
|
switch (trigger.kind) {
|
|
@@ -24985,13 +25272,14 @@ function semanticDesignerNode(nodeId, resolved, ports, position, context) {
|
|
|
24985
25272
|
const inputs = groupedInputs(resolved, designerInputs(nodeId, node, ports, context.revision));
|
|
24986
25273
|
const outputs = groupedOutputs(resolved, designerOutputs(ports));
|
|
24987
25274
|
const task = resolved.kind == "task" ? resolved.definition : void 0;
|
|
24988
|
-
const connector = task != null && "executor" in task && task.executor.kind == "connector" ? task.executor : void 0;
|
|
24989
|
-
const connectorAction = connector
|
|
24990
|
-
const
|
|
24991
|
-
const
|
|
25275
|
+
const connector = task != null && "executor" in task && (task.executor.kind == "connector" || task.executor.kind === "connector-proxy") ? task.executor : void 0;
|
|
25276
|
+
const connectorAction = connector?.kind !== "connector" ? void 0 : context.connectorActions[connector.action];
|
|
25277
|
+
const providerId = connector?.kind === "connector-proxy" ? connector.providerId : connector?.action.split(".")[0];
|
|
25278
|
+
const connectorProvider = providerId == null ? void 0 : context.providers[providerId];
|
|
25279
|
+
const connections = providerId == null ? void 0 : context.connectionCatalogs[providerId];
|
|
24992
25280
|
const connectionId = connector?.connectionId;
|
|
24993
25281
|
const selectedConnection = connectionId == null ? void 0 : connections?.byId.get(connectionId);
|
|
24994
|
-
const connectionRequired = connectionId !== "" && connectorAction?.authenticated == true && (connector?.connectionId == null || connections != null && selectedConnection?.status != "active") || nodeDiagnosticCount(resolved, context.diagnostics.filter((diagnostic) => diagnostic.code === "task.action-connection-required")) > 0;
|
|
25282
|
+
const connectionRequired = connectionId !== "" && (connector?.kind === "connector-proxy" ? connectorProvider != null && !connectorProvider.noSetup : connectorAction?.authenticated == true) && (connector?.connectionId == null || connections != null && selectedConnection?.status != "active") || nodeDiagnosticCount(resolved, context.diagnostics.filter((diagnostic) => diagnostic.code === "task.action-connection-required")) > 0;
|
|
24995
25283
|
const nodeRun = context.runNodes.get(nodeId);
|
|
24996
25284
|
const common = {
|
|
24997
25285
|
description: node.description,
|
|
@@ -25862,8 +26150,8 @@ function inputPorts(schema) {
|
|
|
25862
26150
|
}
|
|
25863
26151
|
function connectorOutputMode(schema) {
|
|
25864
26152
|
const root = toPlainObject(schema);
|
|
25865
|
-
const
|
|
25866
|
-
return
|
|
26153
|
+
const patterns = toPlainObject(root?.patternProperties);
|
|
26154
|
+
return root?.type == "object" && root.additionalProperties === false && (patterns == null || Object.keys(patterns).length == 0) ? "fields" : "value";
|
|
25867
26155
|
}
|
|
25868
26156
|
function outputPorts(schema) {
|
|
25869
26157
|
const root = toPlainObject(schema);
|
|
@@ -25882,14 +26170,6 @@ function outputPorts(schema) {
|
|
|
25882
26170
|
nullable: !required.has(handle) || schemaAllowsNull(propertySchema, root)
|
|
25883
26171
|
}));
|
|
25884
26172
|
}
|
|
25885
|
-
function propertySchemaWithDefinitions(root, schema) {
|
|
25886
|
-
const property = toPlainObject(schema);
|
|
25887
|
-
if (property == null) return schema;
|
|
25888
|
-
const result = Object.assign({}, property);
|
|
25889
|
-
if (result.$defs == null && root.$defs != null) result.$defs = root.$defs;
|
|
25890
|
-
if (result.definitions == null && root.definitions != null) result.definitions = root.definitions;
|
|
25891
|
-
return result;
|
|
25892
|
-
}
|
|
25893
26173
|
function schemaDescription(root, schema) {
|
|
25894
26174
|
for (const object of referencedSchemas(root, schema)) if (typeof object.description == "string") return object.description;
|
|
25895
26175
|
}
|
|
@@ -26678,6 +26958,11 @@ function addNodeIntent(option, revision, t) {
|
|
|
26678
26958
|
action: option.connector,
|
|
26679
26959
|
kind: "connector"
|
|
26680
26960
|
};
|
|
26961
|
+
case "connector-proxy": return {
|
|
26962
|
+
kind: "connector-proxy",
|
|
26963
|
+
providerId: option.provider.serviceId,
|
|
26964
|
+
name: t("connectorProxy.title")
|
|
26965
|
+
};
|
|
26681
26966
|
case "connector-group": return;
|
|
26682
26967
|
case "trigger":
|
|
26683
26968
|
if (!("trigger" in option) || option.trigger.kind == "connect") return;
|
|
@@ -27283,8 +27568,8 @@ function editorComponent(schema) {
|
|
|
27283
27568
|
}
|
|
27284
27569
|
return Object.values(editorGroups).some((group) => group.includes(type)) ? type : "json";
|
|
27285
27570
|
}
|
|
27286
|
-
/**
|
|
27287
|
-
function defaultValueEditorSchema(schema) {
|
|
27571
|
+
/** Prefer schema hints; an explicit fallback respects the stored value's type without converting it. */
|
|
27572
|
+
function defaultValueEditorSchema(schema, fallback) {
|
|
27288
27573
|
const hints = { ...objectValue(schema) };
|
|
27289
27574
|
if (hints["ui:widget"] === "any") delete hints["ui:widget"];
|
|
27290
27575
|
delete hints.anyOf;
|
|
@@ -27295,7 +27580,8 @@ function defaultValueEditorSchema(schema) {
|
|
|
27295
27580
|
if (hints.properties != null) hints.type = "object";
|
|
27296
27581
|
else if (hints.items != null) hints.type = "array";
|
|
27297
27582
|
}
|
|
27298
|
-
|
|
27583
|
+
const component = fallback == null ? "string" : fallback.value == null ? fallback.component : valueType({}, fallback.value);
|
|
27584
|
+
return editorComponent(hints) === "json" ? schemaForEditor(component, schema) : hints;
|
|
27299
27585
|
}
|
|
27300
27586
|
/** Changing the editor replaces incompatible constraints, retaining descriptive metadata. */
|
|
27301
27587
|
function schemaForEditor(component, previous) {
|
|
@@ -27505,6 +27791,9 @@ function addNode(revision, nodeId, intent) {
|
|
|
27505
27791
|
case "http-request":
|
|
27506
27792
|
changes = createManagedTask({ nodeId }, httpRequestTask(void 0, intent.name));
|
|
27507
27793
|
break;
|
|
27794
|
+
case "connector-proxy":
|
|
27795
|
+
changes = createManagedTask({ nodeId }, connectorProxyTask(connectorProxyConfigSchema.parse({ providerId: intent.providerId }), intent.name));
|
|
27796
|
+
break;
|
|
27508
27797
|
case "openapi":
|
|
27509
27798
|
changes = createManagedTask({ nodeId }, {
|
|
27510
27799
|
name: intent.name,
|
|
@@ -27772,6 +28061,7 @@ function updateTask(revision, nodeId, settings) {
|
|
|
27772
28061
|
case "decision":
|
|
27773
28062
|
case "skip-duplicates":
|
|
27774
28063
|
case "http-request":
|
|
28064
|
+
case "connector-proxy":
|
|
27775
28065
|
case "openapi":
|
|
27776
28066
|
case "agent":
|
|
27777
28067
|
if (!dequal$1(node.task, settings.before)) return;
|
|
@@ -27965,7 +28255,7 @@ function replaceTaskPorts(revision, nodeId, task, values) {
|
|
|
27965
28255
|
}
|
|
27966
28256
|
for (const [currentNodeId, node] of Object.entries(graph.nodes)) {
|
|
27967
28257
|
if (isTriggerNode(node)) continue;
|
|
27968
|
-
const inputs = currentNodeId == nodeId ? "executor" in task && task.executor.kind == "http-request" && "executor" in previous ?
|
|
28258
|
+
const inputs = currentNodeId == nodeId ? "executor" in task && (task.executor.kind == "http-request" || task.executor.kind == "connector-proxy") && "executor" in previous ? task.executor.kind === "connector-proxy" ? connectorProxyInputs(revision.inputMappings(node), previous, task) : requestInputMappings(revision.inputMappings(node), previous, task) : updatedInputMappings(revision.inputMappings(node), previous.inputs, task.inputs, inputRename, values) : { ...revision.inputMappings(node) };
|
|
27969
28259
|
for (const [name, mapping] of Object.entries(inputs)) inputs[name] = renameOutputMapping(mapping, instances, outputRename);
|
|
27970
28260
|
if (currentNodeId == nodeId && "moduleId" in current.task) {
|
|
27971
28261
|
if (current.task.name != task.name) changes.push({
|
|
@@ -28050,11 +28340,13 @@ function updateOutputPorts(revision, nodeId, definitions, values) {
|
|
|
28050
28340
|
}));
|
|
28051
28341
|
return updateOutputsDefs(content, nodeId, ports, updatedInputMappings(node.outputMappings, node.outputDefs, ports, renamedPort(node.outputDefs, ports), values));
|
|
28052
28342
|
}
|
|
28053
|
-
function
|
|
28343
|
+
function updateRequestParameters(revision, nodeId, group, edit, bindingId) {
|
|
28054
28344
|
const node = revision.graph().nodes[nodeId];
|
|
28055
|
-
if (node?.kind !== "task" || !("executor" in node.task) || node.task.executor.kind !== "http-request") return;
|
|
28345
|
+
if (node?.kind !== "task" || !("executor" in node.task) || node.task.executor.kind !== "http-request" && node.task.executor.kind !== "connector-proxy") return;
|
|
28346
|
+
const withFields = node.task.executor.kind === "connector-proxy" ? withConnectorProxyParameterFields : withHttpParameterFields;
|
|
28347
|
+
const withSource = node.task.executor.kind === "connector-proxy" ? withConnectorProxyParameterSource : withHttpParameterSource;
|
|
28056
28348
|
const handle = edit.field == null ? group : `${group === "query" ? "query" : "header"}.${edit.field}`;
|
|
28057
|
-
let next = edit.kind === "fields" ?
|
|
28349
|
+
let next = edit.kind === "fields" ? withFields(node, group, edit.value) : edit.field != null ? withFields(node, group, edit.fields) : withSource(node, group, edit.kind === "source" ? {
|
|
28058
28350
|
kind: "sources",
|
|
28059
28351
|
sources: [edit.source]
|
|
28060
28352
|
} : void 0);
|
|
@@ -28082,4 +28374,4 @@ function updateHttpParameters(revision, nodeId, group, edit, bindingId) {
|
|
|
28082
28374
|
return cleanVariableBindings(content, [...operations, ...binding]);
|
|
28083
28375
|
}
|
|
28084
28376
|
//#endregion
|
|
28085
|
-
export { resourceValue as $, allConnectorConnectionsQuery as $n, WorkflowExportDialog as $t, schemaForEditor as A, TabsTrigger as An, serverAddress as Ar, actionWithConnections as At, datePickerValue as B, EmptyMedia as Bn, ApiError as Br, setNodeContentHidden as Bt, updateValue as C, selectors as Cn, inputValue as Cr, flowResourceReferences as Ct, defaultValueEditorSchema as D, Tabs as Dn, openApiTask as Dr, diagnosticMessage as Dt, supportsFeishuChatFilter as E, IconPickerButton as En, openApiFieldIssues as Er, diagnosticItems as Et, calendarChange as F, InputGroupInput as Fn, workflowCandidateGroup as Fr, removeComments as Ft, indexAddNodeOptions as G, SourceSelect as Gn, setCodeActions as Gt, isDateFormat as H, Badge as Hn, eventSourceKind as Hr, setVerticalNodeWidth as Ht, calendarDate as I, Empty as In, workflowCapability as Ir, restoreCanvasPresentation as It, scopedValue as J, EventSourceSetup as Jn, setServiceConnections as Jt, combineSources as K, createI18n as Kn, setConnectorConnection as Kt, dateFromTimeZone as L, EmptyContent as Ln, workflowSelectionTask as Lr, setCanvasLayout as Lt, getDefaultValue as M, followWorkbenchLink as Mn, sameWorkflowInterface as Mr, canvasPresentationChange as Mt, isUnconstrainedSchema as N, InputGroup as Nn, workflowAgentTool as Nr, commentIds as Nt, editorComponent as O, TabsContent as On, securityOptions as Or, diagnosticNodeId as Ot, typeOfSchema as P, InputGroupAddon as Pn, workflowCandidate as Pr, flowPresentation as Pt, resourceData as Q, randomId as Qn, WorkflowBundleSummary as Qt, dateInTimeZone as R, EmptyDescription as Rn, invalidResponse as Rr, setComment as Rt, updateTriggerConfig as S, ComboboxRoot as Sn, triggerConfigValues as Sr, revisionView as St, feishuResourceKind as T, useComboboxRootContext as Tn, object$1 as Tr, deriveInspectorDiagnostics as Tt, addNodeIntent as U, EventSourcesPage as Un, repairNodeNames as Ut, dateTimeWall as V, EmptyTitle as Vn, controlErrorCode as Vr, setNodePositions as Vt, deriveAddNodeOptions as W, SourceForm as Wn, resetInputValues as Wt, CacheResource as X, WorkbenchClient as Xn, updateTriggerSchedule as Xt, connectorActionPresentation as Y, errorNotice as Yn, updateStartInputDefs as Yt, observeResource as Z, normalizeFlowQuery as Zn, dequal as Zt,
|
|
28377
|
+
export { resourceValue as $, allConnectorConnectionsQuery as $n, WorkflowExportDialog as $t, schemaForEditor as A, TabsTrigger as An, serverAddress as Ar, actionWithConnections as At, datePickerValue as B, EmptyMedia as Bn, ApiError as Br, setNodeContentHidden as Bt, updateValue as C, selectors as Cn, inputValue as Cr, flowResourceReferences as Ct, defaultValueEditorSchema as D, Tabs as Dn, openApiTask as Dr, diagnosticMessage as Dt, supportsFeishuChatFilter as E, IconPickerButton as En, openApiFieldIssues as Er, diagnosticItems as Et, calendarChange as F, InputGroupInput as Fn, workflowCandidateGroup as Fr, removeComments as Ft, indexAddNodeOptions as G, SourceSelect as Gn, setCodeActions as Gt, isDateFormat as H, Badge as Hn, eventSourceKind as Hr, setVerticalNodeWidth as Ht, calendarDate as I, Empty as In, workflowCapability as Ir, restoreCanvasPresentation as It, scopedValue as J, EventSourceSetup as Jn, setServiceConnections as Jt, combineSources as K, createI18n as Kn, setConnectorConnection as Kt, dateFromTimeZone as L, EmptyContent as Ln, workflowSelectionTask as Lr, setCanvasLayout as Lt, getDefaultValue as M, followWorkbenchLink as Mn, sameWorkflowInterface as Mr, canvasPresentationChange as Mt, isUnconstrainedSchema as N, InputGroup as Nn, workflowAgentTool as Nr, commentIds as Nt, editorComponent as O, TabsContent as On, securityOptions as Or, diagnosticNodeId as Ot, typeOfSchema as P, InputGroupAddon as Pn, workflowCandidate as Pr, flowPresentation as Pt, resourceData as Q, randomId as Qn, WorkflowBundleSummary as Qt, dateInTimeZone as R, EmptyDescription as Rn, invalidResponse as Rr, setComment as Rt, updateTriggerConfig as S, ComboboxRoot as Sn, triggerConfigValues as Sr, revisionView as St, feishuResourceKind as T, useComboboxRootContext as Tn, object$1 as Tr, deriveInspectorDiagnostics as Tt, addNodeIntent as U, EventSourcesPage as Un, repairNodeNames as Ut, dateTimeWall as V, EmptyTitle as Vn, controlErrorCode as Vr, setNodePositions as Vt, deriveAddNodeOptions as W, SourceForm as Wn, resetInputValues as Wt, CacheResource as X, WorkbenchClient as Xn, updateTriggerSchedule as Xt, connectorActionPresentation as Y, errorNotice as Yn, updateStartInputDefs as Yt, observeResource as Z, normalizeFlowQuery as Zn, dequal as Zt, updateRequestParameters as _, ComboboxList as _n, workflowBundleFromPreview as _r, actionSummary as _t, nameCreatedNodes as a, FlowTagChips as an, webhookResponseDiagnostics as ar, getActionsCache as at, updateTaskAdditionalInputs as b, ComboboxInputGroup as bn, workflowNameFromFile as br, canCancelRun as bt, setInputVariable as c, selectionMenuItemClass as cn, normalizeTriggerOutputs as cr, getProvidersCache as ct, updateCondition as d, valueEditor_module_default as dn, isJsonObject as dr, loadJson as dt, WorkflowExportMenuItem as en, decodeResultList as er, action as et, updateNodeDescription as f, ComboboxItemIndicator as fn, isJsonValue as fr, designerGraph as ft, updateOutputPorts as g, ComboboxPortal as gn, parseWorkflowImportFile as gr, triggerNodeIcon as gt, updateNodeSettings as h, ComboboxPositioner as hn, encodeWorkflowBundle as hr, semanticNodeIcon as ht, deleteSelection as i, FlowSettingsDialog as in, resolutionOutputPorts as ir, decodeAppCatalogResponse as it, valueForEditor as j, useFlowQuery as jn, servers as jr, connectionCatalog as jt, editorGroups as k, TabsList as kn, selectOperation as kr, schemaMismatchMessage as kt, setTriggerConnection as l, ValueControl as ln, sampleErrorOutputs as lr, createPersistentCache as lt, updateNodeName as m, ComboboxPopup as mn, connectorActionMetadata as mr, nodeTitle as mt, agentTool as n, IdTooltip as nn, executionReachableNodes as nr, proxyResponse as nt, selectWebhookResponse as o, TagPicker as on, sourceOutputLabel as or, getAppCatalogCache as ot, updateNodeIcon as p, ComboboxItem as pn, connection as pr, nodeIcon as pt, mapSource as q, FeishuEventPicker as qn, setInputSources as qt, applyFlowChanges as r, FlowSettingsButton as rn, inputSourceCandidates as rr, validateAction as rt, setInputValue as s, selectionMenuContentClass as sn, sourcePort as sr, getConnectionsCache as st, addNode as t, useWorkflowExportAction as tn, decodeTriggerCatalog as tr, provider as tt, setTriggerEventSource as u, ValueEditorFeedback as un, triggerOutputDefinitions as ur, createSessionCache as ut, updateResolution as v, GroupCollectionProvider as vn, encodeWorkflowFile as vr, providerIcon as vt, updateWebhook as w, useComboboxInputValueContext as wn, listOperations as wr, Latest as wt, updateTaskPorts as x, ComboboxInput as xn, triggerConfigValue as xr, hasRunFilter as xt, updateTask as y, ComboboxTrigger as yn, workflowFileName as yr, RunStore as yt, datePickerChange as z, EmptyHeader as zn, record$2 as zr, setFlowViewport as zt };
|