@oomol-lab/open-flow 0.1.0-beta.74 → 0.1.0-beta.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/browser/{ContentIcon-CUQHjQIw.js → ContentIcon-Cm1hbVzW.js} +4 -3
- package/dist/browser/{FlowCanvas-Dtf8_cQp.js → FlowCanvas-NzKtla_c.js} +62 -62
- package/dist/browser/{createResourceDialog-DI9pL-Yr.js → createResourceDialog-BgdedQqu.js} +3 -3
- package/dist/browser/{dialog-BYJGvItc.js → dialog-aSElFFw2.js} +322 -26
- package/dist/browser/{exportSvg-BOoy7-Db.js → exportSvg-Dcz4HTo_.js} +2 -2
- package/dist/browser/{flowChanges-RL-H4CjD.js → flowChanges-NZyS7HSp.js} +490 -438
- package/dist/browser/{flowWorkspace-BkDsETj0.js → flowWorkspace-Bl0SDehy.js} +499 -61
- package/dist/browser/preview.css +696 -825
- package/dist/browser/preview.js +1399 -717
- package/dist/browser/theme.css +114 -262
- package/dist/browser/{tooltip-wZJRB9oP.js → tooltip-3XMK9jkr.js} +1 -1
- package/dist/browser/{typeScriptSession-CSRwWmZm.js → typeScriptSession-C9sBGOKZ.js} +1 -1
- package/dist/browser/ui.css +354 -460
- package/dist/browser/ui.js +1 -1
- package/dist/browser/workbench.css +696 -825
- package/dist/browser/workbench.js +13 -7
- package/dist/browser/{workbenchSelect-BcWPWGzw.js → workbenchSelect-DBGP7Y4Z.js} +2 -2
- package/dist/command/index.js +41 -43
- package/dist/common/authoring.d.ts +5 -5
- package/dist/common/authoringExamples.d.ts +3 -2
- package/dist/common/authoringSchema.d.ts +70 -4
- package/dist/common/connector-proxy.d.ts +1 -1
- package/dist/common/control-api-conformance.js +250 -138
- package/dist/common/control-api.d.ts +3 -2
- package/dist/common/control-api.js +246 -134
- package/dist/common/control-requests.d.ts +3 -3
- package/dist/common/control-requests.js +353 -79
- package/dist/common/cron-trigger.d.ts +2 -1
- package/dist/common/decision.d.ts +4 -4
- package/dist/common/decision.js +5 -2
- package/dist/common/engine-contract.d.ts +6 -1
- package/dist/common/event-source-definition.d.ts +1 -1
- package/dist/common/event-source-view.d.ts +22 -0
- package/dist/common/event-source.d.ts +1 -1
- package/dist/common/event-source.js +24 -65
- package/dist/common/event-sources.d.ts +0 -21
- package/dist/common/flow-authoring.js +90 -19
- package/dist/common/flow-change-schema.d.ts +9 -1
- package/dist/common/flow-change.d.ts +7 -201
- package/dist/common/flow-change.js +96 -23
- package/dist/common/flow-encoding.js +89 -21
- package/dist/common/flow-graph.d.ts +2 -1
- package/dist/common/flow-input-value.d.ts +1 -1
- package/dist/common/flow-model.d.ts +121 -0
- package/dist/common/flow-notifications.d.ts +1 -1
- package/dist/common/flow-retry.d.ts +3 -5
- package/dist/common/flow-semantics.js +816 -586
- package/dist/common/flow-workflowReferences.d.ts +8 -0
- package/dist/common/flowInspection.d.ts +1 -1
- package/dist/common/http-hosts.d.ts +6 -0
- package/dist/common/http-request.d.ts +164 -0
- package/dist/common/http-request.js +5272 -0
- package/dist/common/integration-trigger.d.ts +2 -1
- package/dist/common/mcp.d.ts +3 -3
- package/dist/common/mcp.js +248 -136
- package/dist/common/openapi.d.ts +4 -4
- package/dist/common/openapi.js +4 -1
- package/dist/common/poll-trigger.d.ts +2 -1
- package/dist/common/run-events.js +11 -9
- package/dist/common/runtime-contract.d.ts +23 -1
- package/dist/common/runtime-contract.js +607 -72
- package/dist/common/runtime-nodejs-compat.d.ts +44 -0
- package/dist/common/runtime-nodejs-compat.js +5870 -0
- package/dist/common/scheduler-checkpoint.d.ts +1 -1
- package/dist/common/scheduler-node-execution.d.ts +1 -1
- package/dist/common/scheduler.d.ts +2 -2
- package/dist/common/scheduler.js +95 -25
- package/dist/common/trigger-catalog.d.ts +1 -7
- package/dist/common/trigger-config-options.d.ts +1 -1
- package/dist/common/trigger-config.d.ts +1 -1
- package/dist/common/trigger-contract.d.ts +2 -1
- package/dist/common/trigger-localization.d.ts +8 -2
- package/dist/common/trigger-model.d.ts +101 -0
- package/dist/common/webhook-response.d.ts +1 -3
- package/dist/common/webhook-trigger.d.ts +3 -1
- package/dist/common/webhook-trigger.js +12 -11
- package/dist/common/workflow.d.ts +3 -12
- package/dist/common/workflow.js +25 -23
- package/dist/index.d.ts +41 -14
- package/package.json +9 -1
- package/skills/open-flow/references/flow-authoring.md +1 -0
- package/skills/open-flow/references/flow-n8n-conversion.md +19 -15
- package/src/base/common/json.ts +1 -1
- package/src/connector/common/proxy.ts +1 -1
- package/src/control/common/api.ts +7 -5
- package/src/control/common/authoring.ts +14 -3
- package/src/control/common/authoringExamples.ts +8 -0
- package/src/control/common/authoringSchema.ts +38 -25
- package/src/control/common/authoringTools.ts +1 -1
- package/src/control/common/conformance.ts +1 -1
- package/src/control/common/connectorDecoders.ts +1 -1
- package/src/control/common/eventSources.ts +2 -29
- package/src/control/common/triggerCatalog.ts +1 -8
- package/src/decision/common/decision.ts +15 -7
- package/src/event-source/common/definition.ts +1 -1
- package/src/event-source/common/index.ts +1 -1
- package/src/event-source/common/view.ts +20 -0
- package/src/execution/common/checkpoint.ts +1 -1
- package/src/execution/common/events.ts +3 -0
- package/src/execution/common/node-execution.ts +5 -3
- package/src/execution/common/scheduler.ts +2 -1
- package/src/flow/common/change.ts +59 -192
- package/src/flow/common/changeSchema.ts +39 -5
- package/src/flow/common/connectionUsage.ts +1 -1
- package/src/flow/common/graph.ts +10 -4
- package/src/flow/common/inputValue.ts +1 -1
- package/src/flow/common/model.ts +130 -0
- package/src/flow/common/modules.ts +1 -1
- package/src/flow/common/portChanges.ts +1 -1
- package/src/flow/common/retry.ts +3 -5
- package/src/flow/common/semantics.ts +71 -7
- package/src/flow/common/webhookResponse.ts +4 -8
- package/src/flow/common/workflowReferences.ts +31 -0
- package/src/http/common/authBindings.ts +9 -0
- package/src/http/common/headers.ts +5 -0
- package/src/http/common/hosts.ts +13 -0
- package/src/http/common/httpRequest.ts +266 -0
- package/src/openapi/common/openapi.ts +9 -5
- package/src/{execution → runtime}/common/engineContract.ts +24 -15
- package/src/runtime/common/nodejsCompat.ts +275 -0
- package/src/runtime/common/nodejsGuest.generated.json +47 -0
- package/src/runtime/common/runtime.ts +1138 -0
- package/src/trigger/common/config.ts +1 -1
- package/src/trigger/common/configOptions.ts +1 -1
- package/src/trigger/common/contract.ts +2 -1
- package/src/trigger/common/cron.ts +2 -1
- package/src/trigger/common/integration.ts +2 -1
- package/src/trigger/common/model.ts +87 -0
- package/src/trigger/common/poll.ts +2 -1
- package/src/trigger/common/webhook.ts +7 -4
- package/src/trigger/providers/fieldDescriptions.ts +1 -1
- package/src/trigger/providers/localization.ts +9 -2
- package/src/trigger/providers/remote.ts +1 -1
- package/src/types/index.ts +44 -15
- package/src/workflow/common/workflow.ts +3 -44
- package/src/execution/common/runtime.ts +0 -563
- package/src/openapi/common/authBindings.ts +0 -12
- /package/src/{control → connector}/common/providerIconSprite.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as toPlainObject, i as isString } from "./dist-BFmpkX4P.js";
|
|
2
|
-
import { $ as useAnchoredPopupScrollLock, A as string, An as ownerDocument, At as useTriggerDataForwarding, Bn as useValueChanged, Br as isElement, C as literal, Cn as activeElement, Cr as useRenderElement, Ct as useSyncedFloatingRootContext, D as preprocess, Dt as PopupTriggerMap, E as object, Er as NOOP, Et as popupStoreSelectors, F as IndexGuessBehavior, Ft as FloatingFocusManager, Gn as closePress, Ht as FloatingPortal, I as useCompositeListItem, Ir as useStableCallback, Jn as imperativeAction, Jt as ReactStore, Ln as transitionStatusMapping, Lr as useRefWithInit, M as unknown, Mn as createLucideIcon, Mr as formatErrorMessage, Mt as platform, N as _isoDateTime, Nn as useTransitionStatus, Nr as mergeProps, Nt as useDismiss, O as record$1, Or as useMergedRefs, Ot as useImplicitActiveTrigger, P as Separator, Pn as useOpenChangeComplete, Pr as useIsoLayoutEffect, Pt as useClick, Q as useToolbarRootContext, Qn as itemPress, Rn as useAnimationFrame, T as number, Tn as getTarget, Tr as EMPTY_OBJECT, Tt as createInitialPopupStoreState, U as COMPOSITE_KEYS, Un as cancelOpen, Ut as CLICK_TRIGGER_IDENTIFIER, Vn as createChangeEventDetails, Wt as DROPDOWN_COLLISION_AVOIDANCE, Xt as useStore, Yt as Store, _ as array, _r as useControlled, _t as useRole, an as useTimeout, br as cn, cr as useFormContext, ct as inertValue, dr as useBaseUiId, dt as popupStateMapping, er as none, et as useScrollLock, f as isTimeZone, ft as pressableTriggerOpenStateMapping, g as _enum, gr as visuallyHiddenInput, gt as useTypeahead, h as ZodType, hr as visuallyHidden, i as TooltipTrigger, it as useAnchorPositioning, j as union, jn as Check, k as strictObject, kn as isWebKit, kr as useButton, kt as useOpenStateTransitions, lr as useRegisterFieldControl, lt as getPseudoElementBounds, m as ZodISODateTime, mr as fieldValidityMapping, mt as useOpenInteractionType, n as TooltipContent, nn as useValueAsRef, nt as getDisabledMountTransitionStyles, or as windowResize, ot as useDirection, pt as triggerOpenStateMapping, qt as addEventListener, rn as useOnFirstRender, rt as InternalBackdrop, sr as useLabelableContext, st as CompositeList, t as Tooltip, tn as createSelector, tt as usePositioner, ur as useFieldRootContext, ut as CommonPopupDataAttributes, v as boolean, vr as Button, vt as useListNavigation, w as never, wn as contains, wr as EMPTY_ARRAY, wt as useFloatingRootContext, x as json$1, xn as getFloatingFocusElement, xr as cva, y as discriminatedUnion, yn as rectToClientRect, yr as buttonVariants, yt as useInteractions, zr as getWindow } from "./tooltip-
|
|
2
|
+
import { $ as useAnchoredPopupScrollLock, A as string, An as ownerDocument, At as useTriggerDataForwarding, Bn as useValueChanged, Br as isElement, C as literal, Cn as activeElement, Cr as useRenderElement, Ct as useSyncedFloatingRootContext, D as preprocess, Dt as PopupTriggerMap, E as object, Er as NOOP, Et as popupStoreSelectors, F as IndexGuessBehavior, Ft as FloatingFocusManager, Gn as closePress, Ht as FloatingPortal, I as useCompositeListItem, Ir as useStableCallback, Jn as imperativeAction, Jt as ReactStore, Ln as transitionStatusMapping, Lr as useRefWithInit, M as unknown, Mn as createLucideIcon, Mr as formatErrorMessage, Mt as platform, N as _isoDateTime, Nn as useTransitionStatus, Nr as mergeProps, Nt as useDismiss, O as record$1, Or as useMergedRefs, Ot as useImplicitActiveTrigger, P as Separator, Pn as useOpenChangeComplete, Pr as useIsoLayoutEffect, Pt as useClick, Q as useToolbarRootContext, Qn as itemPress, Rn as useAnimationFrame, T as number, Tn as getTarget, Tr as EMPTY_OBJECT, Tt as createInitialPopupStoreState, U as COMPOSITE_KEYS, Un as cancelOpen, Ut as CLICK_TRIGGER_IDENTIFIER, Vn as createChangeEventDetails, Wt as DROPDOWN_COLLISION_AVOIDANCE, Xt as useStore, Yt as Store, _ as array, _r as useControlled, _t as useRole, an as useTimeout, br as cn, cr as useFormContext, ct as inertValue, dr as useBaseUiId, dt as popupStateMapping, er as none, et as useScrollLock, f as isTimeZone, ft as pressableTriggerOpenStateMapping, g as _enum, gr as visuallyHiddenInput, gt as useTypeahead, h as ZodType, hr as visuallyHidden, i as TooltipTrigger, it as useAnchorPositioning, j as union, jn as Check, k as strictObject, kn as isWebKit, kr as useButton, kt as useOpenStateTransitions, lr as useRegisterFieldControl, lt as getPseudoElementBounds, m as ZodISODateTime, mr as fieldValidityMapping, mt as useOpenInteractionType, n as TooltipContent, nn as useValueAsRef, nt as getDisabledMountTransitionStyles, or as windowResize, ot as useDirection, pt as triggerOpenStateMapping, qt as addEventListener, rn as useOnFirstRender, rt as InternalBackdrop, sr as useLabelableContext, st as CompositeList, t as Tooltip, tn as createSelector, tt as usePositioner, ur as useFieldRootContext, ut as CommonPopupDataAttributes, v as boolean, vr as Button, vt as useListNavigation, w as never, wn as contains, wr as EMPTY_ARRAY, wt as useFloatingRootContext, x as json$1, xn as getFloatingFocusElement, xr as cva, y as discriminatedUnion, yn as rectToClientRect, yr as buttonVariants, yt as useInteractions, zr as getWindow } from "./tooltip-3XMK9jkr.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -6290,6 +6290,9 @@ function webhookSupportsBody(method) {
|
|
|
6290
6290
|
}
|
|
6291
6291
|
//#endregion
|
|
6292
6292
|
//#region src/decision/common/decision.ts
|
|
6293
|
+
function isDecisionExecutor(executor) {
|
|
6294
|
+
return executor.kind === "decision";
|
|
6295
|
+
}
|
|
6293
6296
|
var decisionModel = "typesafe/jev";
|
|
6294
6297
|
var decisionLimits = {
|
|
6295
6298
|
choice: 255,
|
|
@@ -6313,7 +6316,7 @@ function limitDecisionQuestions(questions) {
|
|
|
6313
6316
|
}
|
|
6314
6317
|
/** Loading an oversized task also updates its previously generated output schemas. */
|
|
6315
6318
|
function limitDecisionTask(task) {
|
|
6316
|
-
if (task.executor
|
|
6319
|
+
if (!isDecisionExecutor(task.executor)) return task;
|
|
6317
6320
|
const original = task.executor.questions;
|
|
6318
6321
|
const questions = limitDecisionQuestions(original);
|
|
6319
6322
|
if (questions === original) return task;
|
|
@@ -6437,13 +6440,296 @@ function decisionTask(questions = [defaultDecisionQuestion()], name = "AI Decisi
|
|
|
6437
6440
|
};
|
|
6438
6441
|
}
|
|
6439
6442
|
//#endregion
|
|
6440
|
-
//#region src/
|
|
6441
|
-
/** Never allow credentials to enter a Revision as literal node
|
|
6442
|
-
function
|
|
6443
|
-
for (const
|
|
6444
|
-
|
|
6445
|
-
|
|
6443
|
+
//#region src/http/common/authBindings.ts
|
|
6444
|
+
/** Never allow credentials to enter a Revision as literal inputs of an OpenAPI or HTTP request node. */
|
|
6445
|
+
function assertHttpAuthBindings(inputs) {
|
|
6446
|
+
for (const [handle, mapping] of Object.entries(inputs)) if (handle.startsWith("auth.") && mapping.kind == "value") throw new TypeError("HTTP authentication accepts deployment variables and upstream outputs only.");
|
|
6447
|
+
}
|
|
6448
|
+
//#endregion
|
|
6449
|
+
//#region src/http/common/hosts.ts
|
|
6450
|
+
/** Hosts of a Code `http` Capability: lowercase DNS names or IPv4 addresses; `*.example.com` matches subdomains only. */
|
|
6451
|
+
var httpHostPattern = /^(?:\*\.)?(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
6452
|
+
/** Wildcards must name a registrable suffix, so `*.com` is rejected. */
|
|
6453
|
+
function isHttpHost(value) {
|
|
6454
|
+
return httpHostPattern.test(value) && (!value.startsWith("*.") || value.slice(2).includes("."));
|
|
6455
|
+
}
|
|
6456
|
+
//#endregion
|
|
6457
|
+
//#region src/flow/common/portChanges.ts
|
|
6458
|
+
function renamedPort(previous, next) {
|
|
6459
|
+
const previousNames = new Set(previous.flatMap((port) => "handle" in port ? [port.handle] : []));
|
|
6460
|
+
const nextNames = new Set(next.flatMap((port) => "handle" in port ? [port.handle] : []));
|
|
6461
|
+
const removed = [...previousNames].filter((name) => !nextNames.has(name));
|
|
6462
|
+
const added = [...nextNames].filter((name) => !previousNames.has(name));
|
|
6463
|
+
return removed.length == 1 && added.length == 1 ? [removed[0], added[0]] : void 0;
|
|
6464
|
+
}
|
|
6465
|
+
function renameOutputMapping(mapping, nodeIds, rename) {
|
|
6466
|
+
if (rename == null || mapping.kind != "sources") return mapping;
|
|
6467
|
+
const sources = mapping.sources.map((source) => source.kind == "node" && !source.system && nodeIds.has(source.nodeId) && source.output == rename[0] ? {
|
|
6468
|
+
...source,
|
|
6469
|
+
output: rename[1]
|
|
6470
|
+
} : source);
|
|
6471
|
+
return sources.every((source, index) => source === mapping.sources[index]) ? mapping : {
|
|
6472
|
+
kind: "sources",
|
|
6473
|
+
sources
|
|
6474
|
+
};
|
|
6475
|
+
}
|
|
6476
|
+
/** Carry saved mappings through a field rename and remove only fields absent from the new contract. */
|
|
6477
|
+
function remapInputMappings(mappings, ports, rename) {
|
|
6478
|
+
const inputs = { ...mappings };
|
|
6479
|
+
if (rename != null && Object.hasOwn(inputs, rename[0])) {
|
|
6480
|
+
Object.defineProperty(inputs, rename[1], {
|
|
6481
|
+
value: inputs[rename[0]],
|
|
6482
|
+
enumerable: true,
|
|
6483
|
+
configurable: true,
|
|
6484
|
+
writable: true
|
|
6485
|
+
});
|
|
6486
|
+
delete inputs[rename[0]];
|
|
6487
|
+
}
|
|
6488
|
+
const names = new Set(ports.flatMap((port) => "handle" in port ? [port.handle] : []));
|
|
6489
|
+
for (const name of Object.keys(inputs)) if (!names.has(name)) delete inputs[name];
|
|
6490
|
+
return inputs;
|
|
6491
|
+
}
|
|
6492
|
+
//#endregion
|
|
6493
|
+
//#region src/http/common/headers.ts
|
|
6494
|
+
/** Header names are case-insensitive; never silently combine duplicate business fields. */
|
|
6495
|
+
function httpHeaderNameIssue(name, names) {
|
|
6496
|
+
if (!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(name)) return "invalid";
|
|
6497
|
+
if (names.some((candidate) => candidate.toLowerCase() === name.toLowerCase())) return "duplicate";
|
|
6498
|
+
}
|
|
6499
|
+
//#endregion
|
|
6500
|
+
//#region src/http/common/httpRequest.ts
|
|
6501
|
+
var parameterSchema = strictObject({
|
|
6502
|
+
mode: _enum(["fields", "object"]).default("fields"),
|
|
6503
|
+
names: array(string()).default([])
|
|
6504
|
+
});
|
|
6505
|
+
var httpRequestConfigSchema = strictObject({
|
|
6506
|
+
method: _enum([
|
|
6507
|
+
"GET",
|
|
6508
|
+
"POST",
|
|
6509
|
+
"PUT",
|
|
6510
|
+
"PATCH",
|
|
6511
|
+
"DELETE",
|
|
6512
|
+
"HEAD",
|
|
6513
|
+
"OPTIONS"
|
|
6514
|
+
]).default("GET"),
|
|
6515
|
+
query: parameterSchema.default({
|
|
6516
|
+
mode: "fields",
|
|
6517
|
+
names: []
|
|
6518
|
+
}),
|
|
6519
|
+
headers: parameterSchema.default({
|
|
6520
|
+
mode: "fields",
|
|
6521
|
+
names: []
|
|
6522
|
+
}),
|
|
6523
|
+
bodyFormat: _enum([
|
|
6524
|
+
"none",
|
|
6525
|
+
"json",
|
|
6526
|
+
"text",
|
|
6527
|
+
"form"
|
|
6528
|
+
]).default("none"),
|
|
6529
|
+
authentication: union([
|
|
6530
|
+
strictObject({ type: literal("none") }),
|
|
6531
|
+
strictObject({ type: _enum(["bearer", "basic"]) }),
|
|
6532
|
+
strictObject({
|
|
6533
|
+
type: literal("apiKey"),
|
|
6534
|
+
name: string(),
|
|
6535
|
+
in: _enum(["header", "query"])
|
|
6536
|
+
})
|
|
6537
|
+
]).default({ type: "none" }),
|
|
6538
|
+
responseFormat: _enum([
|
|
6539
|
+
"auto",
|
|
6540
|
+
"json",
|
|
6541
|
+
"text"
|
|
6542
|
+
]).default("auto"),
|
|
6543
|
+
statusPolicy: _enum(["success", "all"]).default("success")
|
|
6544
|
+
});
|
|
6545
|
+
var httpRequestExecutorSchema = httpRequestConfigSchema.extend({ kind: literal("http-request") });
|
|
6546
|
+
var scalarSchema = { type: [
|
|
6547
|
+
"string",
|
|
6548
|
+
"number",
|
|
6549
|
+
"boolean"
|
|
6550
|
+
] };
|
|
6551
|
+
var queryValueSchema = { anyOf: [scalarSchema, {
|
|
6552
|
+
type: "array",
|
|
6553
|
+
items: scalarSchema
|
|
6554
|
+
}] };
|
|
6555
|
+
var httpHeaderSchema = {
|
|
6556
|
+
type: "object",
|
|
6557
|
+
additionalProperties: { type: "string" }
|
|
6558
|
+
};
|
|
6559
|
+
var httpQuerySchema = {
|
|
6560
|
+
type: "object",
|
|
6561
|
+
additionalProperties: queryValueSchema
|
|
6562
|
+
};
|
|
6563
|
+
function httpAuthHandles(config) {
|
|
6564
|
+
return config.authentication.type == "none" ? [] : config.authentication.type == "basic" ? ["auth.username", "auth.password"] : ["auth.token"];
|
|
6565
|
+
}
|
|
6566
|
+
function retain(ports, old) {
|
|
6567
|
+
const remaining = new Map(ports.map((port) => [port.handle, port]));
|
|
6568
|
+
return [...old.flatMap((item) => {
|
|
6569
|
+
if ("group" in item) return [item];
|
|
6570
|
+
const next = remaining.get(item.handle);
|
|
6571
|
+
if (next == null) return [];
|
|
6572
|
+
remaining.delete(item.handle);
|
|
6573
|
+
return [dequal(item.jsonSchema, next.jsonSchema) && item.nullable == next.nullable ? item : next];
|
|
6574
|
+
}), ...remaining.values()];
|
|
6575
|
+
}
|
|
6576
|
+
function httpRequestTask(config = httpRequestConfigSchema.parse({}), name = "HTTP Request", previous) {
|
|
6577
|
+
const inputs = [{
|
|
6578
|
+
handle: "url",
|
|
6579
|
+
jsonSchema: { type: "string" },
|
|
6580
|
+
nullable: false
|
|
6581
|
+
}];
|
|
6582
|
+
for (const group of ["query", "headers"]) if (config[group].mode == "object") inputs.push({
|
|
6583
|
+
handle: group,
|
|
6584
|
+
jsonSchema: group == "query" ? httpQuerySchema : httpHeaderSchema,
|
|
6585
|
+
nullable: true
|
|
6586
|
+
});
|
|
6587
|
+
else for (const parameterName of config[group].names.filter((value) => value.trim())) inputs.push({
|
|
6588
|
+
handle: `${group == "query" ? "query" : "header"}.${parameterName}`,
|
|
6589
|
+
jsonSchema: group == "query" ? queryValueSchema : { type: "string" },
|
|
6590
|
+
nullable: true
|
|
6591
|
+
});
|
|
6592
|
+
if (config.bodyFormat != "none") inputs.push({
|
|
6593
|
+
handle: "body",
|
|
6594
|
+
jsonSchema: config.bodyFormat == "json" ? {} : config.bodyFormat == "text" ? { type: "string" } : httpQuerySchema,
|
|
6595
|
+
nullable: config.bodyFormat == "json"
|
|
6596
|
+
});
|
|
6597
|
+
inputs.push(...httpAuthHandles(config).map((handle) => ({
|
|
6598
|
+
handle,
|
|
6599
|
+
jsonSchema: { type: "string" },
|
|
6600
|
+
nullable: false
|
|
6601
|
+
})));
|
|
6602
|
+
const outputs = [
|
|
6603
|
+
{
|
|
6604
|
+
handle: "body",
|
|
6605
|
+
jsonSchema: config.responseFormat == "text" ? { type: "string" } : {},
|
|
6606
|
+
nullable: true
|
|
6607
|
+
},
|
|
6608
|
+
{
|
|
6609
|
+
handle: "statusCode",
|
|
6610
|
+
jsonSchema: { type: "integer" },
|
|
6611
|
+
nullable: false
|
|
6612
|
+
},
|
|
6613
|
+
{
|
|
6614
|
+
handle: "headers",
|
|
6615
|
+
jsonSchema: httpHeaderSchema,
|
|
6616
|
+
nullable: false
|
|
6617
|
+
}
|
|
6618
|
+
];
|
|
6619
|
+
return {
|
|
6620
|
+
name,
|
|
6621
|
+
executor: {
|
|
6622
|
+
...config,
|
|
6623
|
+
kind: "http-request"
|
|
6624
|
+
},
|
|
6625
|
+
inputs: retain(inputs, previous?.inputs ?? []),
|
|
6626
|
+
outputs: retain(outputs, previous?.outputs ?? [])
|
|
6627
|
+
};
|
|
6628
|
+
}
|
|
6629
|
+
function httpRequestIssues(config) {
|
|
6630
|
+
const issues = [];
|
|
6631
|
+
if (["GET", "HEAD"].includes(config.method) && config.bodyFormat != "none") issues.push({
|
|
6632
|
+
field: "bodyFormat",
|
|
6633
|
+
code: "bodyUnsupported",
|
|
6634
|
+
message: "GET and HEAD do not support a request body."
|
|
6635
|
+
});
|
|
6636
|
+
for (const group of ["query", "headers"]) {
|
|
6637
|
+
if (config[group].mode != "fields") continue;
|
|
6638
|
+
const seen = /* @__PURE__ */ new Set();
|
|
6639
|
+
for (const [index, name] of config[group].names.entries()) {
|
|
6640
|
+
const key = group == "headers" ? name.toLowerCase() : name;
|
|
6641
|
+
if (!name.trim() || seen.has(key)) issues.push({
|
|
6642
|
+
field: group,
|
|
6643
|
+
index,
|
|
6644
|
+
code: "parameterNamesInvalid",
|
|
6645
|
+
message: "Parameter names must be nonempty and unique."
|
|
6646
|
+
});
|
|
6647
|
+
seen.add(key);
|
|
6648
|
+
if (group == "headers" && httpHeaderNameIssue(name, []) === "invalid") issues.push({
|
|
6649
|
+
field: group,
|
|
6650
|
+
index,
|
|
6651
|
+
code: "headerNameInvalid",
|
|
6652
|
+
message: "Invalid HTTP header name."
|
|
6653
|
+
});
|
|
6654
|
+
}
|
|
6655
|
+
}
|
|
6656
|
+
const auth = config.authentication;
|
|
6657
|
+
if (auth.type != "none") {
|
|
6658
|
+
const group = auth.type == "apiKey" && auth.in == "query" ? "query" : "headers";
|
|
6659
|
+
const name = auth.type == "apiKey" ? auth.name : "authorization";
|
|
6660
|
+
if (!name.trim()) issues.push({
|
|
6661
|
+
field: "authentication",
|
|
6662
|
+
code: "keyNameRequired",
|
|
6663
|
+
message: "API Key requires a name."
|
|
6664
|
+
});
|
|
6665
|
+
if (group == "headers" && name.trim() && httpHeaderNameIssue(name, []) === "invalid") issues.push({
|
|
6666
|
+
field: "authentication",
|
|
6667
|
+
code: "headerNameInvalid",
|
|
6668
|
+
message: "Invalid authentication header name."
|
|
6669
|
+
});
|
|
6670
|
+
if (config[group].mode == "fields" && config[group].names.some((item) => group == "headers" ? item.toLowerCase() == name.toLowerCase() : item == name)) issues.push({
|
|
6671
|
+
field: "authentication",
|
|
6672
|
+
code: "authConflict",
|
|
6673
|
+
message: "Authentication conflicts with a request parameter."
|
|
6674
|
+
});
|
|
6446
6675
|
}
|
|
6676
|
+
return issues;
|
|
6677
|
+
}
|
|
6678
|
+
/** Only a named parameter rename carries a value; changing source modes is not a rename. */
|
|
6679
|
+
function httpRequestInputs(mappings, previous, next) {
|
|
6680
|
+
const candidate = renamedPort(previous.inputs, next.inputs);
|
|
6681
|
+
const rename = candidate != null && ["query.", "header."].some((prefix) => candidate.every((name) => name.startsWith(prefix))) ? candidate : void 0;
|
|
6682
|
+
return remapInputMappings(mappings, next.inputs, rename);
|
|
6683
|
+
}
|
|
6684
|
+
function httpRequestExecutor(node) {
|
|
6685
|
+
const executor = node.task.executor;
|
|
6686
|
+
return executor?.kind === "http-request" ? executor : void 0;
|
|
6687
|
+
}
|
|
6688
|
+
/** The object editor assembles named inputs without changing unrelated request settings. */
|
|
6689
|
+
function withHttpParameterFields(node, group, values) {
|
|
6690
|
+
const config = httpRequestExecutor(node);
|
|
6691
|
+
if (config == null) return node;
|
|
6692
|
+
const task = httpRequestTask({
|
|
6693
|
+
...config,
|
|
6694
|
+
[group]: {
|
|
6695
|
+
mode: "fields",
|
|
6696
|
+
names: Object.keys(values)
|
|
6697
|
+
}
|
|
6698
|
+
}, node.task.name, node.task);
|
|
6699
|
+
const inputs = httpRequestInputs(node.inputs, node.task, task);
|
|
6700
|
+
const rename = renamedPort(node.task.inputs, task.inputs);
|
|
6701
|
+
for (const [name, value] of Object.entries(values)) {
|
|
6702
|
+
const handle = `${group === "query" ? "query" : "header"}.${name}`;
|
|
6703
|
+
const existing = config[group].mode === "fields" && (config[group].names.includes(name) || rename?.[1] === handle);
|
|
6704
|
+
if (inputs[handle] == null && !existing) inputs[handle] = {
|
|
6705
|
+
kind: "value",
|
|
6706
|
+
value
|
|
6707
|
+
};
|
|
6708
|
+
}
|
|
6709
|
+
return {
|
|
6710
|
+
...node,
|
|
6711
|
+
task,
|
|
6712
|
+
inputs
|
|
6713
|
+
};
|
|
6714
|
+
}
|
|
6715
|
+
function withHttpParameterSource(node, group, mapping) {
|
|
6716
|
+
const config = httpRequestExecutor(node);
|
|
6717
|
+
if (config == null) return node;
|
|
6718
|
+
const task = httpRequestTask({
|
|
6719
|
+
...config,
|
|
6720
|
+
[group]: {
|
|
6721
|
+
mode: "object",
|
|
6722
|
+
names: []
|
|
6723
|
+
}
|
|
6724
|
+
}, node.task.name, node.task);
|
|
6725
|
+
const inputs = httpRequestInputs(node.inputs, node.task, task);
|
|
6726
|
+
if (mapping == null) delete inputs[group];
|
|
6727
|
+
else inputs[group] = mapping;
|
|
6728
|
+
return {
|
|
6729
|
+
...node,
|
|
6730
|
+
task,
|
|
6731
|
+
inputs
|
|
6732
|
+
};
|
|
6447
6733
|
}
|
|
6448
6734
|
function checkJsonDepth(value, depth = 0) {
|
|
6449
6735
|
if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
|
|
@@ -6455,6 +6741,7 @@ var retryNodeTypes = [
|
|
|
6455
6741
|
"code",
|
|
6456
6742
|
"connector",
|
|
6457
6743
|
"openapi",
|
|
6744
|
+
"http-request",
|
|
6458
6745
|
"llm",
|
|
6459
6746
|
"decision"
|
|
6460
6747
|
];
|
|
@@ -6552,11 +6839,6 @@ function workflowOutputsPort(outputs) {
|
|
|
6552
6839
|
nullable: false
|
|
6553
6840
|
};
|
|
6554
6841
|
}
|
|
6555
|
-
/** Header names are case-insensitive; never silently combine duplicate business fields. */
|
|
6556
|
-
function webhookHeaderNameIssue(name, names) {
|
|
6557
|
-
if (!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(name)) return "invalid";
|
|
6558
|
-
if (names.some((candidate) => candidate.toLowerCase() === name.toLowerCase())) return "duplicate";
|
|
6559
|
-
}
|
|
6560
6842
|
/** Fixed inputs belong to the node, not author-supplied definitions. */
|
|
6561
6843
|
var webhookResponseInputs = [
|
|
6562
6844
|
{
|
|
@@ -6659,7 +6941,15 @@ var workflowCapabilitySchema = strictObject({
|
|
|
6659
6941
|
inputs: array(port),
|
|
6660
6942
|
outputs: array(port).nullable()
|
|
6661
6943
|
});
|
|
6662
|
-
var
|
|
6944
|
+
var httpCapabilitySchema = strictObject({
|
|
6945
|
+
kind: literal("http"),
|
|
6946
|
+
hosts: array(text.refine(isHttpHost, "Use a lowercase host name or IPv4 address, optionally prefixed by \"*.\" for subdomains.")).min(1).max(20).describe("Hosts Code may call with context.fetch. \"*.example.com\" matches subdomains only.")
|
|
6947
|
+
});
|
|
6948
|
+
var capability = union([
|
|
6949
|
+
connectorCapabilitySchema,
|
|
6950
|
+
workflowCapabilitySchema,
|
|
6951
|
+
httpCapabilitySchema
|
|
6952
|
+
]);
|
|
6663
6953
|
var inline = object({
|
|
6664
6954
|
...ports,
|
|
6665
6955
|
name: text,
|
|
@@ -6769,7 +7059,8 @@ var managedFields = object({
|
|
|
6769
7059
|
kind: literal("workflow"),
|
|
6770
7060
|
flowId: text,
|
|
6771
7061
|
revisionId: text
|
|
6772
|
-
})
|
|
7062
|
+
}),
|
|
7063
|
+
httpRequestExecutorSchema
|
|
6773
7064
|
])
|
|
6774
7065
|
});
|
|
6775
7066
|
var managed = managedFields.transform(limitDecisionTask);
|
|
@@ -7038,7 +7329,8 @@ var revision = object({
|
|
|
7038
7329
|
literal(8),
|
|
7039
7330
|
literal(9),
|
|
7040
7331
|
literal(10),
|
|
7041
|
-
literal(11)
|
|
7332
|
+
literal(11),
|
|
7333
|
+
literal(12)
|
|
7042
7334
|
]),
|
|
7043
7335
|
document,
|
|
7044
7336
|
modules: record$1(text, module)
|
|
@@ -7069,7 +7361,7 @@ function decodeRevisionContent(value) {
|
|
|
7069
7361
|
checkJsonDepth(value);
|
|
7070
7362
|
const content = revision.parse(value);
|
|
7071
7363
|
checkModelVersion(content);
|
|
7072
|
-
|
|
7364
|
+
assertDocumentHttpAuthBindings(content.document);
|
|
7073
7365
|
return content;
|
|
7074
7366
|
}
|
|
7075
7367
|
var shapes = {
|
|
@@ -7240,6 +7532,8 @@ var variants = new Map(Object.entries(shapes).map(([kind, shape]) => [kind, shap
|
|
|
7240
7532
|
})]));
|
|
7241
7533
|
array(union([...variants.values()])).min(1);
|
|
7242
7534
|
function checkModelVersion(content) {
|
|
7535
|
+
if (content.modelVersion < 12 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "moduleId" in candidateNode.task && candidateNode.task.capabilities?.some((item) => item.kind == "http"))) throw new TypeError("Code HTTP access requires Flow model version 12.");
|
|
7536
|
+
if (content.modelVersion < 11 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "executor" in candidateNode.task && candidateNode.task.executor.kind == "http-request")) throw new TypeError("HTTP Request requires Flow model version 11.");
|
|
7243
7537
|
if (content.modelVersion < 11 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && ("moduleId" in candidateNode.task ? candidateNode.task.capabilities?.some((item) => item.kind == "workflow") : candidateNode.task.executor.kind == "agent" && candidateNode.task.executor.tools.some((item) => item.kind == "workflow")))) throw new TypeError("Workflow tools require Flow model version 11.");
|
|
7244
7538
|
if (content.modelVersion < 10 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "webhook" && (candidateNode.options?.responseBody != null || candidateNode.options?.responseStatusCodeOutput != null || candidateNode.options?.responseHeadersSource != null || candidateNode.options?.responseHeaderOutputs != null))) throw new TypeError("Dynamic Webhook responses require Flow model version 10.");
|
|
7245
7539
|
if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => "retry" in candidateNode && candidateNode.retry != null)) throw new TypeError("Node retries require Flow model version 9.");
|
|
@@ -7254,6 +7548,9 @@ function checkModelVersion(content) {
|
|
|
7254
7548
|
if (content.modelVersion < 6 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "executor" in candidateNode.task)) throw new TypeError("Node-owned managed Tasks require Flow model version 6.");
|
|
7255
7549
|
if (content.modelVersion < 5 && Object.values(content.document.graph.nodes).some((itemNode) => itemNode.kind == "error")) throw new TypeError("Error workflows require Flow model version 5.");
|
|
7256
7550
|
}
|
|
7551
|
+
function assertDocumentHttpAuthBindings(content) {
|
|
7552
|
+
for (const graphNode of Object.values(content.graph.nodes)) if (graphNode.kind == "task" && "executor" in graphNode.task && ["openapi", "http-request"].includes(graphNode.task.executor.kind)) assertHttpAuthBindings(graphNode.inputs);
|
|
7553
|
+
}
|
|
7257
7554
|
//#endregion
|
|
7258
7555
|
//#region src/flow/common/condition.ts
|
|
7259
7556
|
var otherwiseOutput = "otherwise";
|
|
@@ -7492,9 +7789,6 @@ function resourceNameIssue(value) {
|
|
|
7492
7789
|
}
|
|
7493
7790
|
if (!/^[\p{L}\p{N}](?:[\p{L}\p{N} _-]*[\p{L}\p{N}])?$/u.test(name)) return "specialCharacter";
|
|
7494
7791
|
}
|
|
7495
|
-
function portsByHandle(ports) {
|
|
7496
|
-
return Object.fromEntries(ports.flatMap((port) => "handle" in port ? [[port.handle, port]] : []));
|
|
7497
|
-
}
|
|
7498
7792
|
var workflowToolNamePattern = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
|
|
7499
7793
|
function workflowToolNameIssue(name, otherNames = []) {
|
|
7500
7794
|
if (!workflowToolNamePattern.test(name)) return "invalid";
|
|
@@ -7510,6 +7804,8 @@ function decodeTaskCapabilities(value) {
|
|
|
7510
7804
|
if (workflowToolNameIssue(item.name, names)) throw new TypeError("Workflow tool names must be unique provider-compatible names.");
|
|
7511
7805
|
names.add(item.name);
|
|
7512
7806
|
}
|
|
7807
|
+
const http = parsed.filter((item) => item.kind == "http");
|
|
7808
|
+
if (http.length > 1 || http.some((item) => new Set(item.hosts).size != item.hosts.length)) throw new TypeError("Code declares HTTP hosts once, without duplicates.");
|
|
7513
7809
|
let connectorIndex = 0;
|
|
7514
7810
|
return parsed.map((item) => item.kind == "connector" ? connectors[connectorIndex++] : item);
|
|
7515
7811
|
}
|
|
@@ -7645,10 +7941,10 @@ function upgradeRevisionContent(content) {
|
|
|
7645
7941
|
function upgradeDecodedRevisionContent(content) {
|
|
7646
7942
|
const graph = content.document.graph;
|
|
7647
7943
|
const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
|
|
7648
|
-
if (!hasManual && content.modelVersion ==
|
|
7944
|
+
if (!hasManual && content.modelVersion == 12) return content;
|
|
7649
7945
|
return {
|
|
7650
7946
|
...content,
|
|
7651
|
-
modelVersion:
|
|
7947
|
+
modelVersion: 12,
|
|
7652
7948
|
document: {
|
|
7653
7949
|
...content.document,
|
|
7654
7950
|
graph: hasManual ? {
|
|
@@ -7695,7 +7991,7 @@ function invalid(message) {
|
|
|
7695
7991
|
throw new FlowChangeError(message);
|
|
7696
7992
|
}
|
|
7697
7993
|
function applyFlowChanges(content, operations) {
|
|
7698
|
-
const source = content.modelVersion !=
|
|
7994
|
+
const source = content.modelVersion != 12 || Object.values(content.document.graph.nodes).some((node) => node.kind == "manual") ? decodeRevisionContent(content) : content;
|
|
7699
7995
|
const document = { ...source.document };
|
|
7700
7996
|
const modules = { ...source.modules };
|
|
7701
7997
|
for (const operation of operations) switch (operation.kind) {
|
|
@@ -8140,10 +8436,10 @@ function applyFlowChanges(content, operations) {
|
|
|
8140
8436
|
break;
|
|
8141
8437
|
}
|
|
8142
8438
|
}
|
|
8143
|
-
|
|
8439
|
+
assertDocumentHttpAuthBindings(document);
|
|
8144
8440
|
return upgradeDecodedRevisionContent({
|
|
8145
8441
|
document,
|
|
8146
|
-
modelVersion:
|
|
8442
|
+
modelVersion: 12,
|
|
8147
8443
|
modules
|
|
8148
8444
|
});
|
|
8149
8445
|
}
|
|
@@ -9044,4 +9340,4 @@ function DialogDescription({ className, ...props }) {
|
|
|
9044
9340
|
});
|
|
9045
9341
|
}
|
|
9046
9342
|
//#endregion
|
|
9047
|
-
export {
|
|
9343
|
+
export { waitAutoContinueSchema as $, Input as $t, comparisonIssue as A, variableInputCompatible as At, authoringDefinitionSchemas as B, SelectTrigger as Bt, upgradeManualTrigger as C, limitDecisionQuestions as Ct, nodeSystemOutputPorts as D, matchesSchema as Dt, nodeErrorSchema as E, comparePorts as Et, operatorsForType as F, SelectChevron as Ft, workflowAgentToolSchema as G, stringifyAsLabel as Gt, connectorCapabilitySchema as H, resolveAriaLabelledBy as Ht, otherwiseOutput as I, SelectContent as It, webhookResponseAllowsBody as J, defaultItemEquality as Jt, webhookHeaderValuePort as K, stringifyAsValue as Kt, unaryOperator as L, SelectGroup as Lt, mapConditionSources as M, format as Mt, nodeInputMappings as N, dequal as Nt, supportsNodeErrorHandling as O, portsAssignable as Ot, operandHandle as P, Select as Pt, workflowOutputsPort as Q, Label as Qt, valueType as R, SelectItem as Rt, resourceNameIssue as S, defaultDecisionQuestion as St, workflowToolNameIssue as T, webhookSupportsBody as Tt, decodeRevisionContent as U, hasNullItemLabel as Ut, connectorAgentToolSchema as V, SelectValue as Vt, httpCapabilitySchema as W, isGroupedItems as Wt, webhookResponseTimeout as X, removeItem as Xt, webhookResponseInputs as Y, findItemIndex as Yt, webhookStatusCodePort as Z, selectedValueIncludes as Zt, applyFlowChanges as _, isHttpHost as _t, DialogFooter as a, httpHeaderSchema as at, nodeNameIssue as b, decisionQuestionIssues as bt, DialogTrigger as c, httpRequestInputs as ct, Field as d, withHttpParameterFields as dt, useLabelableId as en, defaultNodeRetry as et, FieldDescription as f, withHttpParameterSource as ft, FlowChangeError as g, renamedPort as gt, FieldLabel as h, renameOutputMapping as ht, DialogDescription as i, checkJsonDepth as it, conditionInputPorts as j, isSchemaKeyword as jt, clearConditionBindings as k, schemaObject as kt, Icon as l, httpRequestIssues as lt, FieldGroup as m, remapInputMappings as mt, DialogClose as n, retryConfigurationSchema as nt, DialogHeader as o, httpQuerySchema as ot, FieldError as p, httpHeaderNameIssue as pt, webhookHeadersPort as q, compareItemEquality as qt, DialogContent as r, supportsNodeRetry as rt, DialogTitle as s, httpRequestConfigSchema as st, Dialog as t, ChevronDown as tn, nodeRetryLimits as tt, Spinner as u, httpRequestTask as ut, isTriggerNode as v, decisionLimits as vt, upgradeRevisionContent as w, webhookMethods as wt, normalizeNodeName as x, decisionTask as xt, nextNodeName as y, decisionModel as yt, agentToolFields as z, SelectSeparator as zt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as IconImageCrossOriginContext, o as IconifyProvider } from "./ContentIcon-
|
|
2
|
-
import { t as FlowCanvas, v as CanvasStore } from "./FlowCanvas-
|
|
1
|
+
import { n as IconImageCrossOriginContext, o as IconifyProvider } from "./ContentIcon-Cm1hbVzW.js";
|
|
2
|
+
import { t as FlowCanvas, v as CanvasStore } from "./FlowCanvas-NzKtla_c.js";
|
|
3
3
|
import { createElement } from "react";
|
|
4
4
|
import { createRoot } from "react-dom/client";
|
|
5
5
|
//#region ../../node_modules/.bun/html-to-image@1.11.11/node_modules/html-to-image/es/util.js
|