@oomol-lab/open-flow 0.1.0-beta.73 → 0.1.0-beta.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +36 -0
- package/NOTICE +7 -0
- package/README.md +41 -0
- package/dist/browser/{ContentIcon-CUQHjQIw.js → ContentIcon-FCpKiwjp.js} +2 -1
- package/dist/browser/{FlowCanvas-Dtf8_cQp.js → FlowCanvas-dzRBnlUT.js} +1 -1
- package/dist/browser/{createResourceDialog-BWJkjiOO.js → createResourceDialog-BeYDdUl-.js} +2 -2
- package/dist/browser/{dialog-CUy_fwx9.js → dialog-ZtpsFbl4.js} +337 -31
- package/dist/browser/{exportSvg-BOoy7-Db.js → exportSvg-DqXw1yf-.js} +2 -2
- package/dist/browser/{flowChanges-CgSnSqqP.js → flowChanges-b_5UobFj.js} +586 -87
- package/dist/browser/{flowWorkspace-Bf7H-r0t.js → flowWorkspace-ItojZbO4.js} +21162 -20242
- package/dist/browser/preview.css +254 -179
- package/dist/browser/preview.js +22201 -20625
- package/dist/browser/{typeScriptSession-B0hC-C8y.js → typeScriptSession-CSRwWmZm.js} +1 -1
- package/dist/browser/ui.css +72 -2
- package/dist/browser/workbench.css +254 -179
- package/dist/browser/workbench.js +22 -78
- package/dist/browser/{workbenchSelect-C3e4J93X.js → workbenchSelect-M441Lz0d.js} +1 -1
- package/dist/command/index.js +42 -42
- package/dist/common/authoring.d.ts +5 -5
- package/dist/common/authoringExamples.d.ts +3 -2
- package/dist/common/authoringFields.d.ts +1 -1
- package/dist/common/authoringSchema.d.ts +95 -8
- package/dist/common/connector-proxy.d.ts +1 -1
- package/dist/common/control-api-conformance.d.ts +1 -1
- package/dist/common/control-api-conformance.js +119 -31
- package/dist/common/control-api.d.ts +4 -3
- package/dist/common/control-api.js +117 -29
- package/dist/common/control-requests.d.ts +5 -4
- package/dist/common/control-requests.js +437 -103
- package/dist/common/cron-trigger.d.ts +1 -1
- package/dist/common/decision.d.ts +1 -1
- package/dist/common/draftOperations.d.ts +1 -1
- package/dist/common/engine-contract.d.ts +4 -2
- package/dist/common/event-source-definition.d.ts +1 -1
- package/dist/common/flow-agent.d.ts +1 -1
- package/dist/{browser → common}/flow-authoring-node.d.ts +3 -3
- package/dist/{browser → common}/flow-authoring.js +131 -30
- package/dist/{browser → common}/flow-change-schema.d.ts +177 -6
- package/dist/{browser → common}/flow-change.d.ts +35 -15
- package/dist/{browser → common}/flow-change.js +133 -32
- package/dist/common/flow-connectionUsage.d.ts +1 -1
- package/dist/common/flow-encoding.d.ts +1 -1
- package/dist/common/flow-encoding.js +89 -23
- package/dist/common/flow-errorHandling.d.ts +1 -1
- package/dist/common/flow-graph.d.ts +3 -2
- package/dist/common/flow-modules.d.ts +1 -1
- package/dist/common/flow-promptTemplate.d.ts +1 -1
- package/dist/common/flow-retry.d.ts +2 -2
- package/dist/common/flow-semantics.d.ts +1 -1
- package/dist/common/flow-semantics.js +966 -614
- package/dist/common/flow-workflowFile.d.ts +1 -1
- package/dist/common/flowInspection.d.ts +3 -3
- package/dist/common/http-request.d.ts +156 -0
- package/dist/common/http-request.js +5254 -0
- package/dist/common/integration-trigger.d.ts +1 -1
- package/dist/common/licenses.md +118 -1
- package/dist/common/liveDetails.d.ts +1 -1
- package/dist/common/mcp.d.ts +5 -4
- package/dist/common/mcp.js +117 -29
- package/dist/common/openapi.d.ts +1 -1
- package/dist/common/poll-trigger.d.ts +1 -1
- package/dist/common/run-events.js +11 -9
- package/dist/common/run-results.d.ts +8 -1
- package/dist/common/runtime-contract.d.ts +8 -2
- package/dist/common/runtime-contract.js +25 -5
- package/dist/common/scheduler-checkpoint.d.ts +1 -1
- package/dist/common/scheduler-dependencies.d.ts +1 -1
- package/dist/common/scheduler-node-execution.d.ts +1 -1
- package/dist/common/scheduler.d.ts +3 -3
- package/dist/common/scheduler.js +101 -33
- package/dist/common/trigger-catalog.d.ts +1 -1
- 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 -2
- package/dist/common/trigger-localization.d.ts +1 -1
- package/dist/common/webhook-response.d.ts +1 -3
- package/dist/common/webhook-trigger.d.ts +1 -1
- package/dist/common/webhook-trigger.js +12 -11
- package/dist/common/workflow.d.ts +17 -1
- package/dist/common/workflow.js +68 -22
- package/dist/index.d.ts +6 -3
- package/package.json +11 -6
- 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 +90 -0
- package/src/canvas/common/commands.ts +15 -0
- package/src/connector/common/actionSchema.ts +168 -0
- package/src/connector/common/proxy.ts +44 -0
- package/src/control/common/api.ts +1506 -0
- package/src/control/common/authoring.ts +923 -0
- package/src/control/common/authoringCondition.ts +110 -0
- package/src/control/common/authoringDiagnosticFields.ts +136 -0
- package/src/control/common/authoringExamples.ts +200 -0
- package/src/control/common/authoringFields.ts +53 -0
- package/src/control/common/authoringLlm.ts +70 -0
- package/src/control/common/authoringOpenApi.ts +129 -0
- package/src/control/common/authoringSchema.ts +410 -0
- package/src/control/common/authoringTools.ts +123 -0
- package/src/control/common/authoringTriggers.ts +26 -0
- package/src/control/common/checkDecoders.ts +65 -0
- package/src/control/common/conformance.ts +1989 -0
- package/src/control/common/connectorDecoders.ts +370 -0
- package/src/control/common/connectorQueries.ts +61 -0
- package/src/control/common/decoding.ts +60 -0
- package/src/control/common/draftOperations.ts +61 -0
- package/src/control/common/errors.ts +114 -0
- package/src/control/common/eventSourceSchemas.ts +13 -0
- package/src/control/common/eventSources.ts +186 -0
- package/src/control/common/flowDecoders.ts +153 -0
- package/src/control/common/flowInspection.ts +181 -0
- package/src/control/common/flowNotifications.ts +37 -0
- package/src/control/common/liveDetails.ts +124 -0
- package/src/control/common/mcp.ts +241 -0
- package/src/control/common/mcpConformance.ts +142 -0
- package/src/control/common/providerAccess.ts +28 -0
- package/src/control/common/providerIconSprite.ts +42 -0
- package/src/control/common/publicationDecoders.ts +98 -0
- package/src/control/common/random.ts +16 -0
- package/src/control/common/requests.ts +112 -0
- package/src/control/common/resultQuery.ts +8 -0
- package/src/control/common/results.ts +176 -0
- package/src/control/common/revisionDecoders.ts +52 -0
- package/src/control/common/runDecoders.ts +240 -0
- package/src/control/common/triggerCatalog.ts +89 -0
- package/src/control/common/triggerDecoders.ts +175 -0
- package/src/decision/common/decision.ts +168 -0
- package/src/event-source/common/catalog.generated.json +65 -0
- package/src/event-source/common/definition.ts +66 -0
- package/src/event-source/common/index.ts +99 -0
- package/src/execution/common/checkpoint.ts +311 -0
- package/src/execution/common/dependencies.ts +440 -0
- package/src/execution/common/engineContract.ts +84 -0
- package/src/execution/common/events.ts +331 -0
- package/src/execution/common/node-execution.ts +469 -0
- package/src/execution/common/runLifecycle.ts +250 -0
- package/src/execution/common/runtime.ts +563 -0
- package/src/execution/common/scheduler.ts +697 -0
- package/src/execution/common/wait.ts +36 -0
- package/src/flow/common/agent.ts +305 -0
- package/src/flow/common/authoring.ts +30 -0
- package/src/flow/common/change.ts +1037 -0
- package/src/flow/common/changeSchema.ts +792 -0
- package/src/flow/common/codePermissions.ts +2 -0
- package/src/flow/common/condition.ts +265 -0
- package/src/flow/common/connectionUsage.ts +131 -0
- package/src/flow/common/edgeChanges.ts +35 -0
- package/src/flow/common/encoding.ts +437 -0
- package/src/flow/common/errorHandling.ts +34 -0
- package/src/flow/common/graph.ts +898 -0
- package/src/flow/common/inputValue.ts +16 -0
- package/src/flow/common/json.ts +8 -0
- package/src/flow/common/moduleChanges.ts +31 -0
- package/src/flow/common/modules.ts +292 -0
- package/src/flow/common/nodeChanges.ts +762 -0
- package/src/flow/common/portChanges.ts +36 -0
- package/src/flow/common/promptTemplate.ts +15 -0
- package/src/flow/common/retry.ts +20 -0
- package/src/flow/common/schema.ts +162 -0
- package/src/flow/common/schemaCompare.ts +176 -0
- package/src/flow/common/schemaComparer.ts +178 -0
- package/src/flow/common/schemaKeywords.ts +53 -0
- package/src/flow/common/semantics.ts +531 -0
- package/src/flow/common/sourceField.ts +35 -0
- package/src/flow/common/triggerScheduleSchema.ts +8 -0
- package/src/flow/common/wait.ts +30 -0
- package/src/flow/common/webhookMethod.ts +7 -0
- package/src/flow/common/webhookResponse.ts +71 -0
- package/src/flow/common/workflowFile.ts +97 -0
- package/src/http/common/authBindings.ts +12 -0
- package/src/http/common/headers.ts +5 -0
- package/src/http/common/httpRequest.ts +251 -0
- package/src/json-schema-subset/checker/array.ts +142 -0
- package/src/json-schema-subset/checker/cache.ts +57 -0
- package/src/json-schema-subset/checker/checker.ts +230 -0
- package/src/json-schema-subset/checker/enumAndConst.ts +113 -0
- package/src/json-schema-subset/checker/equals.ts +93 -0
- package/src/json-schema-subset/checker/numeric/checker.ts +50 -0
- package/src/json-schema-subset/checker/numeric/float.ts +121 -0
- package/src/json-schema-subset/checker/numeric/index.ts +1 -0
- package/src/json-schema-subset/checker/numeric/integer.ts +119 -0
- package/src/json-schema-subset/checker/numeric/integerNormalizer.ts +72 -0
- package/src/json-schema-subset/checker/object.ts +354 -0
- package/src/json-schema-subset/checker/range.ts +91 -0
- package/src/json-schema-subset/checker/string.ts +60 -0
- package/src/json-schema-subset/checker/tools/index.ts +3 -0
- package/src/json-schema-subset/checker/tools/mark.ts +82 -0
- package/src/json-schema-subset/checker/tools/quantum.ts +106 -0
- package/src/json-schema-subset/checker/tools/range.ts +210 -0
- package/src/json-schema-subset/checker/validator.ts +23 -0
- package/src/json-schema-subset/compiler/array.ts +163 -0
- package/src/json-schema-subset/compiler/combination.ts +109 -0
- package/src/json-schema-subset/compiler/common.ts +99 -0
- package/src/json-schema-subset/compiler/compiler.ts +188 -0
- package/src/json-schema-subset/compiler/enumAndConst.ts +75 -0
- package/src/json-schema-subset/compiler/index.ts +11 -0
- package/src/json-schema-subset/compiler/object.ts +411 -0
- package/src/json-schema-subset/compiler/primitive.ts +144 -0
- package/src/json-schema-subset/compiler/utils.ts +24 -0
- package/src/json-schema-subset/compiler/wrapper.ts +192 -0
- package/src/json-schema-subset/error.ts +55 -0
- package/src/json-schema-subset/expression/calculator.ts +442 -0
- package/src/json-schema-subset/expression/combination.ts +49 -0
- package/src/json-schema-subset/expression/expression.ts +191 -0
- package/src/json-schema-subset/expression/index.ts +25 -0
- package/src/json-schema-subset/expression/result.ts +88 -0
- package/src/json-schema-subset/expression/types.ts +36 -0
- package/src/json-schema-subset/extends/extendsContext.ts +89 -0
- package/src/json-schema-subset/extends/index.ts +2 -0
- package/src/json-schema-subset/extends/types.ts +12 -0
- package/src/json-schema-subset/global.ts +60 -0
- package/src/json-schema-subset/index.ts +8 -0
- package/src/json-schema-subset/preprocessing.ts +74 -0
- package/src/json-schema-subset/types.ts +8 -0
- package/src/json-schema-subset/utils.ts +95 -0
- package/src/localization/common/languages.ts +118 -0
- package/src/localization/common/timeZone.ts +25 -0
- package/src/openapi/common/openapi.ts +459 -0
- package/src/trigger/common/config.ts +56 -0
- package/src/trigger/common/configOptions.ts +15 -0
- package/src/trigger/common/configSchema.ts +8 -0
- package/src/trigger/common/contract.ts +132 -0
- package/src/trigger/common/cron.ts +151 -0
- package/src/trigger/common/integration.ts +498 -0
- package/src/trigger/common/poll.ts +187 -0
- package/src/trigger/common/webhook.ts +413 -0
- package/src/trigger/providers/airtable/locales/fr.json +18 -0
- package/src/trigger/providers/airtable/locales/ja.json +18 -0
- package/src/trigger/providers/airtable/locales/ko.json +18 -0
- package/src/trigger/providers/airtable/locales/ru.json +18 -0
- package/src/trigger/providers/airtable/locales/zh-CN.json +18 -0
- package/src/trigger/providers/airtable/locales/zh-TW.json +18 -0
- package/src/trigger/providers/asana/locales/fr.json +15 -0
- package/src/trigger/providers/asana/locales/ja.json +15 -0
- package/src/trigger/providers/asana/locales/ko.json +15 -0
- package/src/trigger/providers/asana/locales/ru.json +15 -0
- package/src/trigger/providers/asana/locales/zh-CN.json +15 -0
- package/src/trigger/providers/asana/locales/zh-TW.json +15 -0
- package/src/trigger/providers/calendly/locales/fr.json +16 -0
- package/src/trigger/providers/calendly/locales/ja.json +16 -0
- package/src/trigger/providers/calendly/locales/ko.json +16 -0
- package/src/trigger/providers/calendly/locales/ru.json +16 -0
- package/src/trigger/providers/calendly/locales/zh-CN.json +16 -0
- package/src/trigger/providers/calendly/locales/zh-TW.json +16 -0
- package/src/trigger/providers/catalog.generated.json +4996 -0
- package/src/trigger/providers/clickup/locales/fr.json +16 -0
- package/src/trigger/providers/clickup/locales/ja.json +16 -0
- package/src/trigger/providers/clickup/locales/ko.json +16 -0
- package/src/trigger/providers/clickup/locales/ru.json +16 -0
- package/src/trigger/providers/clickup/locales/zh-CN.json +16 -0
- package/src/trigger/providers/clickup/locales/zh-TW.json +16 -0
- package/src/trigger/providers/definitions.ts +19 -0
- package/src/trigger/providers/feishu/locales/fr.json +20 -0
- package/src/trigger/providers/feishu/locales/ja.json +20 -0
- package/src/trigger/providers/feishu/locales/ko.json +20 -0
- package/src/trigger/providers/feishu/locales/ru.json +20 -0
- package/src/trigger/providers/feishu/locales/zh-CN.json +20 -0
- package/src/trigger/providers/feishu/locales/zh-TW.json +20 -0
- package/src/trigger/providers/fieldDescriptions.ts +392 -0
- package/src/trigger/providers/fieldLabels.ts +256 -0
- package/src/trigger/providers/fireflies/locales/fr.json +17 -0
- package/src/trigger/providers/fireflies/locales/ja.json +17 -0
- package/src/trigger/providers/fireflies/locales/ko.json +17 -0
- package/src/trigger/providers/fireflies/locales/ru.json +17 -0
- package/src/trigger/providers/fireflies/locales/zh-CN.json +17 -0
- package/src/trigger/providers/fireflies/locales/zh-TW.json +17 -0
- package/src/trigger/providers/github/locales/fr.json +30 -0
- package/src/trigger/providers/github/locales/ja.json +30 -0
- package/src/trigger/providers/github/locales/ko.json +30 -0
- package/src/trigger/providers/github/locales/ru.json +30 -0
- package/src/trigger/providers/github/locales/zh-CN.json +30 -0
- package/src/trigger/providers/github/locales/zh-TW.json +30 -0
- package/src/trigger/providers/gitlab/locales/fr.json +18 -0
- package/src/trigger/providers/gitlab/locales/ja.json +18 -0
- package/src/trigger/providers/gitlab/locales/ko.json +18 -0
- package/src/trigger/providers/gitlab/locales/ru.json +18 -0
- package/src/trigger/providers/gitlab/locales/zh-CN.json +18 -0
- package/src/trigger/providers/gitlab/locales/zh-TW.json +18 -0
- package/src/trigger/providers/gmail/locales/fr.json +18 -0
- package/src/trigger/providers/gmail/locales/ja.json +18 -0
- package/src/trigger/providers/gmail/locales/ko.json +18 -0
- package/src/trigger/providers/gmail/locales/ru.json +18 -0
- package/src/trigger/providers/gmail/locales/zh-CN.json +18 -0
- package/src/trigger/providers/gmail/locales/zh-TW.json +18 -0
- package/src/trigger/providers/google-calendar/locales/fr.json +15 -0
- package/src/trigger/providers/google-calendar/locales/ja.json +15 -0
- package/src/trigger/providers/google-calendar/locales/ko.json +15 -0
- package/src/trigger/providers/google-calendar/locales/ru.json +15 -0
- package/src/trigger/providers/google-calendar/locales/zh-CN.json +15 -0
- package/src/trigger/providers/google-calendar/locales/zh-TW.json +15 -0
- package/src/trigger/providers/google-drive/locales/fr.json +48 -0
- package/src/trigger/providers/google-drive/locales/ja.json +48 -0
- package/src/trigger/providers/google-drive/locales/ko.json +48 -0
- package/src/trigger/providers/google-drive/locales/ru.json +48 -0
- package/src/trigger/providers/google-drive/locales/zh-CN.json +48 -0
- package/src/trigger/providers/google-drive/locales/zh-TW.json +48 -0
- package/src/trigger/providers/google-sheets/locales/fr.json +19 -0
- package/src/trigger/providers/google-sheets/locales/ja.json +19 -0
- package/src/trigger/providers/google-sheets/locales/ko.json +19 -0
- package/src/trigger/providers/google-sheets/locales/ru.json +19 -0
- package/src/trigger/providers/google-sheets/locales/zh-CN.json +19 -0
- package/src/trigger/providers/google-sheets/locales/zh-TW.json +19 -0
- package/src/trigger/providers/intercom/locales/fr.json +17 -0
- package/src/trigger/providers/intercom/locales/ja.json +17 -0
- package/src/trigger/providers/intercom/locales/ko.json +17 -0
- package/src/trigger/providers/intercom/locales/ru.json +17 -0
- package/src/trigger/providers/intercom/locales/zh-CN.json +17 -0
- package/src/trigger/providers/intercom/locales/zh-TW.json +17 -0
- package/src/trigger/providers/jira/locales/fr.json +17 -0
- package/src/trigger/providers/jira/locales/ja.json +17 -0
- package/src/trigger/providers/jira/locales/ko.json +17 -0
- package/src/trigger/providers/jira/locales/ru.json +17 -0
- package/src/trigger/providers/jira/locales/zh-CN.json +17 -0
- package/src/trigger/providers/jira/locales/zh-TW.json +17 -0
- package/src/trigger/providers/linear/locales/fr.json +13 -0
- package/src/trigger/providers/linear/locales/ja.json +13 -0
- package/src/trigger/providers/linear/locales/ko.json +13 -0
- package/src/trigger/providers/linear/locales/ru.json +13 -0
- package/src/trigger/providers/linear/locales/zh-CN.json +13 -0
- package/src/trigger/providers/linear/locales/zh-TW.json +13 -0
- package/src/trigger/providers/locales/fr.ts +71 -0
- package/src/trigger/providers/locales/ja.ts +71 -0
- package/src/trigger/providers/locales/ko.ts +71 -0
- package/src/trigger/providers/locales/ru.ts +71 -0
- package/src/trigger/providers/locales/zh-CN.ts +71 -0
- package/src/trigger/providers/locales/zh-TW.ts +71 -0
- package/src/trigger/providers/localization.ts +59 -0
- package/src/trigger/providers/notion/locales/fr.json +16 -0
- package/src/trigger/providers/notion/locales/ja.json +16 -0
- package/src/trigger/providers/notion/locales/ko.json +16 -0
- package/src/trigger/providers/notion/locales/ru.json +16 -0
- package/src/trigger/providers/notion/locales/zh-CN.json +16 -0
- package/src/trigger/providers/notion/locales/zh-TW.json +16 -0
- package/src/trigger/providers/one-drive/locales/fr.json +16 -0
- package/src/trigger/providers/one-drive/locales/ja.json +16 -0
- package/src/trigger/providers/one-drive/locales/ko.json +16 -0
- package/src/trigger/providers/one-drive/locales/ru.json +16 -0
- package/src/trigger/providers/one-drive/locales/zh-CN.json +16 -0
- package/src/trigger/providers/one-drive/locales/zh-TW.json +16 -0
- package/src/trigger/providers/outlook/locales/fr.json +18 -0
- package/src/trigger/providers/outlook/locales/ja.json +18 -0
- package/src/trigger/providers/outlook/locales/ko.json +18 -0
- package/src/trigger/providers/outlook/locales/ru.json +18 -0
- package/src/trigger/providers/outlook/locales/zh-CN.json +18 -0
- package/src/trigger/providers/outlook/locales/zh-TW.json +18 -0
- package/src/trigger/providers/pandadoc/locales/fr.json +12 -0
- package/src/trigger/providers/pandadoc/locales/ja.json +12 -0
- package/src/trigger/providers/pandadoc/locales/ko.json +12 -0
- package/src/trigger/providers/pandadoc/locales/ru.json +12 -0
- package/src/trigger/providers/pandadoc/locales/zh-CN.json +12 -0
- package/src/trigger/providers/pandadoc/locales/zh-TW.json +12 -0
- package/src/trigger/providers/pipedrive/locales/fr.json +15 -0
- package/src/trigger/providers/pipedrive/locales/ja.json +15 -0
- package/src/trigger/providers/pipedrive/locales/ko.json +15 -0
- package/src/trigger/providers/pipedrive/locales/ru.json +15 -0
- package/src/trigger/providers/pipedrive/locales/zh-CN.json +15 -0
- package/src/trigger/providers/pipedrive/locales/zh-TW.json +15 -0
- package/src/trigger/providers/remote.ts +163 -0
- package/src/trigger/providers/resend/locales/fr.json +16 -0
- package/src/trigger/providers/resend/locales/ja.json +16 -0
- package/src/trigger/providers/resend/locales/ko.json +16 -0
- package/src/trigger/providers/resend/locales/ru.json +16 -0
- package/src/trigger/providers/resend/locales/zh-CN.json +16 -0
- package/src/trigger/providers/resend/locales/zh-TW.json +16 -0
- package/src/trigger/providers/sentry/locales/fr.json +19 -0
- package/src/trigger/providers/sentry/locales/ja.json +19 -0
- package/src/trigger/providers/sentry/locales/ko.json +19 -0
- package/src/trigger/providers/sentry/locales/ru.json +19 -0
- package/src/trigger/providers/sentry/locales/zh-CN.json +19 -0
- package/src/trigger/providers/sentry/locales/zh-TW.json +19 -0
- package/src/trigger/providers/shopify/locales/fr.json +18 -0
- package/src/trigger/providers/shopify/locales/ja.json +18 -0
- package/src/trigger/providers/shopify/locales/ko.json +18 -0
- package/src/trigger/providers/shopify/locales/ru.json +18 -0
- package/src/trigger/providers/shopify/locales/zh-CN.json +18 -0
- package/src/trigger/providers/shopify/locales/zh-TW.json +18 -0
- package/src/trigger/providers/slack/locales/fr.json +18 -0
- package/src/trigger/providers/slack/locales/ja.json +18 -0
- package/src/trigger/providers/slack/locales/ko.json +18 -0
- package/src/trigger/providers/slack/locales/ru.json +18 -0
- package/src/trigger/providers/slack/locales/zh-CN.json +18 -0
- package/src/trigger/providers/slack/locales/zh-TW.json +18 -0
- package/src/trigger/providers/slackbot/locales/fr.json +23 -0
- package/src/trigger/providers/slackbot/locales/ja.json +23 -0
- package/src/trigger/providers/slackbot/locales/ko.json +23 -0
- package/src/trigger/providers/slackbot/locales/ru.json +23 -0
- package/src/trigger/providers/slackbot/locales/zh-CN.json +23 -0
- package/src/trigger/providers/slackbot/locales/zh-TW.json +23 -0
- package/src/trigger/providers/source-events.ts +25 -0
- package/src/trigger/providers/stripe/locales/fr.json +17 -0
- package/src/trigger/providers/stripe/locales/ja.json +17 -0
- package/src/trigger/providers/stripe/locales/ko.json +17 -0
- package/src/trigger/providers/stripe/locales/ru.json +17 -0
- package/src/trigger/providers/stripe/locales/zh-CN.json +17 -0
- package/src/trigger/providers/stripe/locales/zh-TW.json +17 -0
- package/src/trigger/providers/tally/locales/fr.json +12 -0
- package/src/trigger/providers/tally/locales/ja.json +12 -0
- package/src/trigger/providers/tally/locales/ko.json +12 -0
- package/src/trigger/providers/tally/locales/ru.json +12 -0
- package/src/trigger/providers/tally/locales/zh-CN.json +12 -0
- package/src/trigger/providers/tally/locales/zh-TW.json +12 -0
- package/src/trigger/providers/telegram/locales/fr.json +17 -0
- package/src/trigger/providers/telegram/locales/ja.json +17 -0
- package/src/trigger/providers/telegram/locales/ko.json +17 -0
- package/src/trigger/providers/telegram/locales/ru.json +17 -0
- package/src/trigger/providers/telegram/locales/zh-CN.json +17 -0
- package/src/trigger/providers/telegram/locales/zh-TW.json +17 -0
- package/src/trigger/providers/typeform/locales/fr.json +12 -0
- package/src/trigger/providers/typeform/locales/ja.json +12 -0
- package/src/trigger/providers/typeform/locales/ko.json +12 -0
- package/src/trigger/providers/typeform/locales/ru.json +12 -0
- package/src/trigger/providers/typeform/locales/zh-CN.json +12 -0
- package/src/trigger/providers/typeform/locales/zh-TW.json +12 -0
- package/src/trigger/providers/vercel/locales/fr.json +18 -0
- package/src/trigger/providers/vercel/locales/ja.json +18 -0
- package/src/trigger/providers/vercel/locales/ko.json +18 -0
- package/src/trigger/providers/vercel/locales/ru.json +18 -0
- package/src/trigger/providers/vercel/locales/zh-CN.json +18 -0
- package/src/trigger/providers/vercel/locales/zh-TW.json +18 -0
- package/src/trigger/providers/woocommerce/locales/fr.json +19 -0
- package/src/trigger/providers/woocommerce/locales/ja.json +19 -0
- package/src/trigger/providers/woocommerce/locales/ko.json +19 -0
- package/src/trigger/providers/woocommerce/locales/ru.json +19 -0
- package/src/trigger/providers/woocommerce/locales/zh-CN.json +19 -0
- package/src/trigger/providers/woocommerce/locales/zh-TW.json +19 -0
- package/src/trigger/providers/zendesk/locales/fr.json +15 -0
- package/src/trigger/providers/zendesk/locales/ja.json +15 -0
- package/src/trigger/providers/zendesk/locales/ko.json +15 -0
- package/src/trigger/providers/zendesk/locales/ru.json +15 -0
- package/src/trigger/providers/zendesk/locales/zh-CN.json +15 -0
- package/src/trigger/providers/zendesk/locales/zh-TW.json +15 -0
- package/src/trigger/providers/zoom/locales/fr.json +17 -0
- package/src/trigger/providers/zoom/locales/ja.json +17 -0
- package/src/trigger/providers/zoom/locales/ko.json +17 -0
- package/src/trigger/providers/zoom/locales/ru.json +17 -0
- package/src/trigger/providers/zoom/locales/zh-CN.json +17 -0
- package/src/trigger/providers/zoom/locales/zh-TW.json +17 -0
- package/src/types/index.ts +112 -0
- package/src/workflow/common/workflow.ts +273 -0
- package/dist/browser/lib-DrKav3HG.js +0 -11403
- /package/dist/{browser → common}/flow-authoring-edge.d.ts +0 -0
- /package/dist/{browser → common}/flow-authoring-module.d.ts +0 -0
- /package/dist/{browser → common}/flow-authoring.d.ts +0 -0
- /package/dist/{browser → common}/flow-input-value.d.ts +0 -0
- /package/dist/{browser → common}/webhook-method.d.ts +0 -0
|
@@ -4128,446 +4128,84 @@ function decisionTaskIssues(task) {
|
|
|
4128
4128
|
}] : []];
|
|
4129
4129
|
}
|
|
4130
4130
|
//#endregion
|
|
4131
|
-
//#region
|
|
4132
|
-
|
|
4133
|
-
"
|
|
4134
|
-
|
|
4135
|
-
"post",
|
|
4136
|
-
"delete",
|
|
4137
|
-
"options",
|
|
4138
|
-
"head",
|
|
4139
|
-
"patch",
|
|
4140
|
-
"trace"
|
|
4141
|
-
];
|
|
4142
|
-
function object$1(value) {
|
|
4143
|
-
if (value == null || typeof value != "object" || Array.isArray(value)) throw new Error("Expected an OpenAPI object.");
|
|
4144
|
-
return value;
|
|
4145
|
-
}
|
|
4146
|
-
function httpUrl(value, base) {
|
|
4147
|
-
const url = new URL(value, base);
|
|
4148
|
-
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.hash) throw new Error("An HTTP(S) URL without credentials or fragment is required.");
|
|
4149
|
-
return url.href;
|
|
4131
|
+
//#region ../../node_modules/.bun/zod@4.6.5/node_modules/zod/v4/core/util.js
|
|
4132
|
+
function getEnumValues(entries) {
|
|
4133
|
+
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
4134
|
+
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
4150
4135
|
}
|
|
4151
|
-
function
|
|
4152
|
-
|
|
4153
|
-
if (typeof doc.openapi != "string" || !/^3\.[01]\.\d+$/.test(doc.openapi)) throw new Error("Only OpenAPI 3.0 and 3.1 JSON documents are supported.");
|
|
4154
|
-
object$1(doc.paths);
|
|
4155
|
-
return doc;
|
|
4136
|
+
function joinValues(array, separator = "|") {
|
|
4137
|
+
return array.map((val) => stringifyPrimitive(val)).join(separator);
|
|
4156
4138
|
}
|
|
4157
|
-
function
|
|
4158
|
-
if (
|
|
4159
|
-
let value = doc;
|
|
4160
|
-
for (const key of decodeURIComponent(ref.slice(2)).split("/").map((part) => part.replace(/~1/g, "/").replace(/~0/g, "~"))) {
|
|
4161
|
-
const source = object$1(value);
|
|
4162
|
-
if (!Object.hasOwn(source, key)) throw new Error("An OpenAPI reference is missing.");
|
|
4163
|
-
value = source[key];
|
|
4164
|
-
}
|
|
4139
|
+
function jsonStringifyReplacer(_, value) {
|
|
4140
|
+
if (typeof value === "bigint") return value.toString();
|
|
4165
4141
|
return value;
|
|
4166
4142
|
}
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
if (seen.has(result.$ref)) throw new Error("Circular non-schema reference is unsupported.");
|
|
4172
|
-
seen.add(result.$ref);
|
|
4173
|
-
const { $ref, ...siblings } = result;
|
|
4174
|
-
result = {
|
|
4175
|
-
...object$1(pointer(doc, $ref)),
|
|
4176
|
-
...siblings
|
|
4177
|
-
};
|
|
4143
|
+
var Cached = class {
|
|
4144
|
+
constructor(getter) {
|
|
4145
|
+
this._getter = getter;
|
|
4146
|
+
this._value = void 0;
|
|
4178
4147
|
}
|
|
4179
|
-
|
|
4148
|
+
get value() {
|
|
4149
|
+
const getter = this._getter;
|
|
4150
|
+
if (getter !== void 0) {
|
|
4151
|
+
this._value = getter();
|
|
4152
|
+
this._getter = void 0;
|
|
4153
|
+
}
|
|
4154
|
+
return this._value;
|
|
4155
|
+
}
|
|
4156
|
+
};
|
|
4157
|
+
function cached(getter) {
|
|
4158
|
+
return new Cached(getter);
|
|
4180
4159
|
}
|
|
4181
|
-
function
|
|
4182
|
-
|
|
4183
|
-
if (!methods.includes(method) || item[method] == null) throw new Error("The selected operation is no longer available.");
|
|
4184
|
-
return {
|
|
4185
|
-
item,
|
|
4186
|
-
op: object$1(item[method])
|
|
4187
|
-
};
|
|
4160
|
+
function nullish(input) {
|
|
4161
|
+
return input === null || input === void 0;
|
|
4188
4162
|
}
|
|
4189
|
-
function
|
|
4190
|
-
const
|
|
4191
|
-
const
|
|
4192
|
-
|
|
4193
|
-
if (!Array.isArray(entries) || entries.length == 0) return [{ url: "/" }];
|
|
4194
|
-
return entries.map(object$1);
|
|
4163
|
+
function cleanRegex(source) {
|
|
4164
|
+
const start = source.startsWith("^") ? 1 : 0;
|
|
4165
|
+
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
4166
|
+
return source.slice(start, end);
|
|
4195
4167
|
}
|
|
4196
|
-
function
|
|
4197
|
-
const
|
|
4198
|
-
const
|
|
4199
|
-
const
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
paths: { [path]: {
|
|
4203
|
-
[method]: op,
|
|
4204
|
-
...item.parameters == null ? {} : { parameters: item.parameters }
|
|
4205
|
-
} },
|
|
4206
|
-
servers: servers(doc, path, method),
|
|
4207
|
-
security
|
|
4208
|
-
};
|
|
4209
|
-
const visited = /* @__PURE__ */ new Set();
|
|
4210
|
-
function copy(ref) {
|
|
4211
|
-
if (visited.has(ref)) return;
|
|
4212
|
-
visited.add(ref);
|
|
4213
|
-
const value = pointer(doc, ref);
|
|
4214
|
-
const keys = decodeURIComponent(ref.slice(2)).split("/").map((part) => part.replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
4215
|
-
if (keys.some((key) => [
|
|
4216
|
-
"__proto__",
|
|
4217
|
-
"constructor",
|
|
4218
|
-
"prototype"
|
|
4219
|
-
].includes(key))) throw new Error("Unsupported reference key.");
|
|
4220
|
-
let target = result;
|
|
4221
|
-
for (const key of keys.slice(0, -1)) {
|
|
4222
|
-
if (!Object.hasOwn(target, key)) target[key] = {};
|
|
4223
|
-
target = object$1(target[key]);
|
|
4224
|
-
}
|
|
4225
|
-
target[keys.at(-1)] = structuredClone(value);
|
|
4226
|
-
visit(value);
|
|
4227
|
-
}
|
|
4228
|
-
function visit(value) {
|
|
4229
|
-
if (value == null || typeof value != "object") return;
|
|
4230
|
-
if (Array.isArray(value)) {
|
|
4231
|
-
value.forEach(visit);
|
|
4232
|
-
return;
|
|
4233
|
-
}
|
|
4234
|
-
if (typeof object$1(value).$ref == "string") copy(object$1(value).$ref);
|
|
4235
|
-
for (const [key, child] of Object.entries(value)) if (![
|
|
4236
|
-
"example",
|
|
4237
|
-
"examples",
|
|
4238
|
-
"default"
|
|
4239
|
-
].includes(key)) visit(child);
|
|
4240
|
-
}
|
|
4241
|
-
visit(result);
|
|
4242
|
-
for (const entry of security) for (const name of Object.keys(object$1(entry))) copy(`#/components/securitySchemes/${name.replace(/~/g, "~0").replace(/\//g, "~1")}`);
|
|
4243
|
-
return structuredClone(result);
|
|
4168
|
+
function floatSafeRemainder(val, step) {
|
|
4169
|
+
const ratio = val / step;
|
|
4170
|
+
const roundedRatio = Math.round(ratio);
|
|
4171
|
+
const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
4172
|
+
if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
|
|
4173
|
+
return ratio - roundedRatio;
|
|
4244
4174
|
}
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
if ([
|
|
4255
|
-
"nullable",
|
|
4256
|
-
"example",
|
|
4257
|
-
"xml",
|
|
4258
|
-
"discriminator",
|
|
4259
|
-
"__proto__"
|
|
4260
|
-
].includes(key)) continue;
|
|
4261
|
-
if (key == "$ref") {
|
|
4262
|
-
if (typeof child != "string") throw new Error("Invalid schema reference.");
|
|
4263
|
-
let id = ids.get(child);
|
|
4264
|
-
if (id == null) {
|
|
4265
|
-
id = `s${ids.size}`;
|
|
4266
|
-
ids.set(child, id);
|
|
4267
|
-
defs[id] = convert(pointer(doc, child));
|
|
4268
|
-
}
|
|
4269
|
-
result.$ref = `#/$defs/${id}`;
|
|
4270
|
-
} else if ([
|
|
4271
|
-
"properties",
|
|
4272
|
-
"patternProperties",
|
|
4273
|
-
"$defs",
|
|
4274
|
-
"definitions",
|
|
4275
|
-
"dependentSchemas"
|
|
4276
|
-
].includes(key)) result[key] = Object.fromEntries(Object.entries(object$1(child)).map(([name, childSchema]) => [name, convert(childSchema)]));
|
|
4277
|
-
else if ([
|
|
4278
|
-
"allOf",
|
|
4279
|
-
"anyOf",
|
|
4280
|
-
"oneOf",
|
|
4281
|
-
"prefixItems"
|
|
4282
|
-
].includes(key)) {
|
|
4283
|
-
if (!Array.isArray(child)) throw new Error("Invalid schema composition.");
|
|
4284
|
-
result[key] = child.map(convert);
|
|
4285
|
-
} else if ([
|
|
4286
|
-
"items",
|
|
4287
|
-
"additionalProperties",
|
|
4288
|
-
"not",
|
|
4289
|
-
"if",
|
|
4290
|
-
"then",
|
|
4291
|
-
"else",
|
|
4292
|
-
"contains",
|
|
4293
|
-
"propertyNames",
|
|
4294
|
-
"unevaluatedProperties"
|
|
4295
|
-
].includes(key)) result[key] = convert(child);
|
|
4296
|
-
else result[key] = child;
|
|
4297
|
-
}
|
|
4298
|
-
if (source.nullable === true) return { anyOf: [result, { type: "null" }] };
|
|
4299
|
-
for (const key of ["minimum", "maximum"]) {
|
|
4300
|
-
const exclusive = key == "minimum" ? "exclusiveMinimum" : "exclusiveMaximum";
|
|
4301
|
-
if (typeof result[exclusive] == "boolean") {
|
|
4302
|
-
if (result[exclusive] && typeof result[key] == "number") {
|
|
4303
|
-
result[exclusive] = result[key];
|
|
4304
|
-
delete result[key];
|
|
4305
|
-
} else delete result[exclusive];
|
|
4175
|
+
var EVALUATING = /* @__PURE__*/ Symbol("evaluating");
|
|
4176
|
+
function defineLazy(object, key, getter) {
|
|
4177
|
+
let value = void 0;
|
|
4178
|
+
Object.defineProperty(object, key, {
|
|
4179
|
+
get() {
|
|
4180
|
+
if (value === EVALUATING) return;
|
|
4181
|
+
if (value === void 0) {
|
|
4182
|
+
value = EVALUATING;
|
|
4183
|
+
value = getter();
|
|
4306
4184
|
}
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
converted = {
|
|
4315
|
-
...object$1(defs[id]),
|
|
4316
|
-
...siblings
|
|
4317
|
-
};
|
|
4318
|
-
}
|
|
4319
|
-
if (typeof converted == "boolean") return converted;
|
|
4320
|
-
return {
|
|
4321
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4322
|
-
...object$1(converted),
|
|
4323
|
-
...Object.keys(defs).length ? { $defs: defs } : {}
|
|
4324
|
-
};
|
|
4185
|
+
return value;
|
|
4186
|
+
},
|
|
4187
|
+
set(v) {
|
|
4188
|
+
Object.defineProperty(object, key, { value: v });
|
|
4189
|
+
},
|
|
4190
|
+
configurable: true
|
|
4191
|
+
});
|
|
4325
4192
|
}
|
|
4326
|
-
function
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
"path",
|
|
4334
|
-
"query",
|
|
4335
|
-
"header"
|
|
4336
|
-
].includes(String(p.in)) || typeof p.name != "string" || p.content != null) throw new Error("Only schema-based path, query and header parameters are supported.");
|
|
4337
|
-
if (p.allowReserved === true) throw new Error("allowReserved parameters are unsupported.");
|
|
4338
|
-
if ((p.style ?? (p.in == "query" ? "form" : "simple")) != (p.in == "query" ? "form" : "simple")) throw new Error("Only form query and simple path/header serialization are supported.");
|
|
4339
|
-
entries.set(`${p.in}.${p.in == "header" ? p.name.toLowerCase() : p.name}`, p);
|
|
4340
|
-
}
|
|
4341
|
-
return [...entries.values()];
|
|
4193
|
+
function assignProp(target, prop, value) {
|
|
4194
|
+
Object.defineProperty(target, prop, {
|
|
4195
|
+
value,
|
|
4196
|
+
writable: true,
|
|
4197
|
+
enumerable: true,
|
|
4198
|
+
configurable: true
|
|
4199
|
+
});
|
|
4342
4200
|
}
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
required: content.required === true,
|
|
4352
|
-
mediaType
|
|
4353
|
-
};
|
|
4354
|
-
}
|
|
4355
|
-
function authHandles(auth) {
|
|
4356
|
-
return auth.flatMap((scheme) => scheme.type == "basic" ? [`auth.${scheme.id}.username`, `auth.${scheme.id}.password`] : [`auth.${scheme.id}.token`]);
|
|
4357
|
-
}
|
|
4358
|
-
function openApiTask(config, name = "OpenAPI") {
|
|
4359
|
-
if (!config.path) return {
|
|
4360
|
-
name,
|
|
4361
|
-
executor: config,
|
|
4362
|
-
inputs: [],
|
|
4363
|
-
outputs: []
|
|
4364
|
-
};
|
|
4365
|
-
const doc = parseOpenApi(config.document);
|
|
4366
|
-
const { op } = operation(doc, config.path, config.method);
|
|
4367
|
-
const params = parameters(config);
|
|
4368
|
-
const inputs = params.map((p) => {
|
|
4369
|
-
const jsonSchema = schema$1(doc, p.schema ?? {});
|
|
4370
|
-
const defaultValue = typeof jsonSchema == "boolean" ? void 0 : object$1(jsonSchema).default;
|
|
4371
|
-
return {
|
|
4372
|
-
handle: `${p.in}.${p.name}`,
|
|
4373
|
-
jsonSchema,
|
|
4374
|
-
nullable: p.required !== true && p.in != "path" || matchesSchema(null, jsonSchema),
|
|
4375
|
-
...typeof p.description == "string" ? { description: p.description } : {},
|
|
4376
|
-
...defaultValue === void 0 ? {} : { value: defaultValue }
|
|
4377
|
-
};
|
|
4378
|
-
});
|
|
4379
|
-
if (op.requestBody != null) {
|
|
4380
|
-
if (config.method == "get" || config.method == "head") throw new Error("GET and HEAD request bodies are unsupported.");
|
|
4381
|
-
const body = jsonContent(doc, op.requestBody);
|
|
4382
|
-
inputs.push({
|
|
4383
|
-
handle: "body",
|
|
4384
|
-
jsonSchema: body.schema,
|
|
4385
|
-
nullable: !body.required || matchesSchema(null, body.schema)
|
|
4386
|
-
});
|
|
4387
|
-
}
|
|
4388
|
-
const occupied = new Set(params.map((p) => `${p.in}.${p.in == "header" ? String(p.name).toLowerCase() : p.name}`));
|
|
4389
|
-
for (const auth of config.auth) {
|
|
4390
|
-
const location = auth.type == "apiKey" ? `${auth.in}.${auth.in == "header" ? auth.name?.toLowerCase() : auth.name}` : "header.authorization";
|
|
4391
|
-
if (occupied.has(location)) throw new Error("Authentication conflicts with a parameter or another security scheme.");
|
|
4392
|
-
if (auth.type == "apiKey" && (!auth.name || !["header", "query"].includes(auth.in ?? ""))) throw new Error("API Key requires a name and location.");
|
|
4393
|
-
occupied.add(location);
|
|
4394
|
-
}
|
|
4395
|
-
inputs.push(...authHandles(config.auth).map((handle) => ({
|
|
4396
|
-
handle,
|
|
4397
|
-
jsonSchema: { type: "string" },
|
|
4398
|
-
nullable: false
|
|
4399
|
-
})));
|
|
4400
|
-
const responses = object$1(op.responses);
|
|
4401
|
-
const schemas = [];
|
|
4402
|
-
for (const [status, response] of Object.entries(responses)) if (/^2\d\d$|^2XX$/.test(status) || status == "default") {
|
|
4403
|
-
const r = resolved(doc, response);
|
|
4404
|
-
if (r.content == null) schemas.push({ type: "null" });
|
|
4405
|
-
else {
|
|
4406
|
-
jsonContent(doc, r);
|
|
4407
|
-
for (const [mediaType, media] of Object.entries(object$1(r.content))) if (/^application\/(json|.+\+json)$/.test(mediaType)) schemas.push(schema$1(doc, object$1(media).schema ?? {}));
|
|
4408
|
-
}
|
|
4409
|
-
}
|
|
4410
|
-
if (!schemas.length) throw new Error("A successful JSON response definition is required.");
|
|
4411
|
-
return {
|
|
4412
|
-
name,
|
|
4413
|
-
executor: config,
|
|
4414
|
-
inputs,
|
|
4415
|
-
outputs: [
|
|
4416
|
-
{
|
|
4417
|
-
handle: "body",
|
|
4418
|
-
jsonSchema: schemas.length == 1 ? schemas[0] : {
|
|
4419
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4420
|
-
anyOf: schemas.map((s, index) => inlineSchema(s, index))
|
|
4421
|
-
},
|
|
4422
|
-
nullable: config.method == "head" || schemas.some((item) => matchesSchema(null, item))
|
|
4423
|
-
},
|
|
4424
|
-
{
|
|
4425
|
-
handle: "statusCode",
|
|
4426
|
-
jsonSchema: { type: "integer" },
|
|
4427
|
-
nullable: false
|
|
4428
|
-
},
|
|
4429
|
-
{
|
|
4430
|
-
handle: "headers",
|
|
4431
|
-
jsonSchema: {
|
|
4432
|
-
type: "object",
|
|
4433
|
-
additionalProperties: { type: "string" }
|
|
4434
|
-
},
|
|
4435
|
-
nullable: false
|
|
4436
|
-
}
|
|
4437
|
-
]
|
|
4438
|
-
};
|
|
4439
|
-
}
|
|
4440
|
-
function inlineSchema(value, index) {
|
|
4441
|
-
if (Array.isArray(value)) return value.map((item) => inlineSchema(item, index));
|
|
4442
|
-
if (value == null || typeof value != "object") return value;
|
|
4443
|
-
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, key == "$ref" && typeof child == "string" && child.startsWith("#/") ? `#/anyOf/${index}/${child.slice(2)}` : inlineSchema(child, index)]));
|
|
4444
|
-
}
|
|
4445
|
-
/** The canvas validator and property panel share the same configuration contract. */
|
|
4446
|
-
function openApiFieldIssues(task) {
|
|
4447
|
-
if (task.executor.kind != "openapi") return [];
|
|
4448
|
-
const config = task.executor;
|
|
4449
|
-
let field = "sourceUrl";
|
|
4450
|
-
try {
|
|
4451
|
-
if (!config.sourceUrl.trim()) return [{
|
|
4452
|
-
field,
|
|
4453
|
-
message: "Enter an OpenAPI JSON document URL."
|
|
4454
|
-
}];
|
|
4455
|
-
httpUrl(config.sourceUrl);
|
|
4456
|
-
field = "operation";
|
|
4457
|
-
if (!config.path) return [{
|
|
4458
|
-
field,
|
|
4459
|
-
message: "Select an OpenAPI operation."
|
|
4460
|
-
}];
|
|
4461
|
-
field = "serverUrl";
|
|
4462
|
-
httpUrl(config.serverUrl);
|
|
4463
|
-
if (new URL(config.serverUrl).search) throw new Error("Server URLs must not contain a query string.");
|
|
4464
|
-
field = "operation";
|
|
4465
|
-
if (!dequal(config.document, snapshot(config.document, config.path, config.method))) return [{
|
|
4466
|
-
field,
|
|
4467
|
-
message: "Save only the selected operation and its dependencies."
|
|
4468
|
-
}];
|
|
4469
|
-
const expected = openApiTask(config, task.name);
|
|
4470
|
-
if (!dequal(expected.inputs, task.inputs) || !dequal(expected.outputs, task.outputs)) return [{
|
|
4471
|
-
field,
|
|
4472
|
-
message: "OpenAPI ports must match the saved operation."
|
|
4473
|
-
}];
|
|
4474
|
-
return [];
|
|
4475
|
-
} catch (error) {
|
|
4476
|
-
return [{
|
|
4477
|
-
field,
|
|
4478
|
-
message: error.message
|
|
4479
|
-
}];
|
|
4480
|
-
}
|
|
4481
|
-
}
|
|
4482
|
-
function openApiIssues(task) {
|
|
4483
|
-
return openApiFieldIssues(task).map((issue) => issue.message);
|
|
4484
|
-
}
|
|
4485
|
-
//#endregion
|
|
4486
|
-
//#region src/flow/common/inputValue.ts
|
|
4487
|
-
/** An explicit clear suppresses the default; absent mappings still inherit it. */
|
|
4488
|
-
function inputValue(mapping, fallback) {
|
|
4489
|
-
if (mapping?.kind === "unset") return void 0;
|
|
4490
|
-
return mapping?.kind === "value" ? mapping.value : fallback;
|
|
4491
|
-
}
|
|
4492
|
-
//#endregion
|
|
4493
|
-
//#region ../../node_modules/.bun/zod@4.6.5/node_modules/zod/v4/core/util.js
|
|
4494
|
-
function getEnumValues(entries) {
|
|
4495
|
-
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
4496
|
-
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
4497
|
-
}
|
|
4498
|
-
function joinValues(array, separator = "|") {
|
|
4499
|
-
return array.map((val) => stringifyPrimitive(val)).join(separator);
|
|
4500
|
-
}
|
|
4501
|
-
function jsonStringifyReplacer(_, value) {
|
|
4502
|
-
if (typeof value === "bigint") return value.toString();
|
|
4503
|
-
return value;
|
|
4504
|
-
}
|
|
4505
|
-
var Cached = class {
|
|
4506
|
-
constructor(getter) {
|
|
4507
|
-
this._getter = getter;
|
|
4508
|
-
this._value = void 0;
|
|
4509
|
-
}
|
|
4510
|
-
get value() {
|
|
4511
|
-
const getter = this._getter;
|
|
4512
|
-
if (getter !== void 0) {
|
|
4513
|
-
this._value = getter();
|
|
4514
|
-
this._getter = void 0;
|
|
4515
|
-
}
|
|
4516
|
-
return this._value;
|
|
4517
|
-
}
|
|
4518
|
-
};
|
|
4519
|
-
function cached(getter) {
|
|
4520
|
-
return new Cached(getter);
|
|
4521
|
-
}
|
|
4522
|
-
function nullish(input) {
|
|
4523
|
-
return input === null || input === void 0;
|
|
4524
|
-
}
|
|
4525
|
-
function cleanRegex(source) {
|
|
4526
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
4527
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
4528
|
-
return source.slice(start, end);
|
|
4529
|
-
}
|
|
4530
|
-
function floatSafeRemainder(val, step) {
|
|
4531
|
-
const ratio = val / step;
|
|
4532
|
-
const roundedRatio = Math.round(ratio);
|
|
4533
|
-
const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
4534
|
-
if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
|
|
4535
|
-
return ratio - roundedRatio;
|
|
4536
|
-
}
|
|
4537
|
-
var EVALUATING = /* @__PURE__*/ Symbol("evaluating");
|
|
4538
|
-
function defineLazy(object, key, getter) {
|
|
4539
|
-
let value = void 0;
|
|
4540
|
-
Object.defineProperty(object, key, {
|
|
4541
|
-
get() {
|
|
4542
|
-
if (value === EVALUATING) return;
|
|
4543
|
-
if (value === void 0) {
|
|
4544
|
-
value = EVALUATING;
|
|
4545
|
-
value = getter();
|
|
4546
|
-
}
|
|
4547
|
-
return value;
|
|
4548
|
-
},
|
|
4549
|
-
set(v) {
|
|
4550
|
-
Object.defineProperty(object, key, { value: v });
|
|
4551
|
-
},
|
|
4552
|
-
configurable: true
|
|
4553
|
-
});
|
|
4554
|
-
}
|
|
4555
|
-
function assignProp(target, prop, value) {
|
|
4556
|
-
Object.defineProperty(target, prop, {
|
|
4557
|
-
value,
|
|
4558
|
-
writable: true,
|
|
4559
|
-
enumerable: true,
|
|
4560
|
-
configurable: true
|
|
4561
|
-
});
|
|
4562
|
-
}
|
|
4563
|
-
/**
|
|
4564
|
-
* Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.
|
|
4565
|
-
*
|
|
4566
|
-
* Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.
|
|
4567
|
-
*/
|
|
4568
|
-
function rawShape(def) {
|
|
4569
|
-
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
4570
|
-
return desc?.get ? desc.get.raw : desc?.value;
|
|
4201
|
+
/**
|
|
4202
|
+
* Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.
|
|
4203
|
+
*
|
|
4204
|
+
* Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.
|
|
4205
|
+
*/
|
|
4206
|
+
function rawShape(def) {
|
|
4207
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
4208
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
4571
4209
|
}
|
|
4572
4210
|
function sourceShape(schema) {
|
|
4573
4211
|
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
@@ -9830,7 +9468,7 @@ var ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
|
|
|
9830
9468
|
return required(ZodNonOptional, this, args[0]);
|
|
9831
9469
|
}
|
|
9832
9470
|
});
|
|
9833
|
-
function object(shape, params) {
|
|
9471
|
+
function object$1(shape, params) {
|
|
9834
9472
|
return new ZodObject({
|
|
9835
9473
|
type: "object",
|
|
9836
9474
|
shape: shape ?? {},
|
|
@@ -10058,110 +9696,724 @@ function prefault(innerType, defaultValue) {
|
|
|
10058
9696
|
}
|
|
10059
9697
|
});
|
|
10060
9698
|
}
|
|
10061
|
-
var ZodNonOptional = /*@__PURE__*/ $constructor("ZodNonOptional", (inst, def) => {
|
|
10062
|
-
$ZodNonOptional.init(inst, def);
|
|
10063
|
-
ZodType.init(inst, def);
|
|
10064
|
-
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
10065
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
10066
|
-
});
|
|
10067
|
-
function nonoptional(innerType, params) {
|
|
10068
|
-
return new ZodNonOptional({
|
|
10069
|
-
type: "nonoptional",
|
|
10070
|
-
innerType,
|
|
10071
|
-
...normalizeParams(params)
|
|
10072
|
-
});
|
|
9699
|
+
var ZodNonOptional = /*@__PURE__*/ $constructor("ZodNonOptional", (inst, def) => {
|
|
9700
|
+
$ZodNonOptional.init(inst, def);
|
|
9701
|
+
ZodType.init(inst, def);
|
|
9702
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
9703
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
9704
|
+
});
|
|
9705
|
+
function nonoptional(innerType, params) {
|
|
9706
|
+
return new ZodNonOptional({
|
|
9707
|
+
type: "nonoptional",
|
|
9708
|
+
innerType,
|
|
9709
|
+
...normalizeParams(params)
|
|
9710
|
+
});
|
|
9711
|
+
}
|
|
9712
|
+
var ZodCatch = /*@__PURE__*/ $constructor("ZodCatch", (inst, def) => {
|
|
9713
|
+
$ZodCatch.init(inst, def);
|
|
9714
|
+
ZodType.init(inst, def);
|
|
9715
|
+
inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
|
|
9716
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
9717
|
+
inst.removeCatch = inst.unwrap;
|
|
9718
|
+
});
|
|
9719
|
+
function _catch(innerType, catchValue) {
|
|
9720
|
+
return new ZodCatch({
|
|
9721
|
+
type: "catch",
|
|
9722
|
+
innerType,
|
|
9723
|
+
catchValue: typeof catchValue === "function" ? catchValue : constantCatch(catchValue)
|
|
9724
|
+
});
|
|
9725
|
+
}
|
|
9726
|
+
var ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
|
|
9727
|
+
$ZodPipe.init(inst, def);
|
|
9728
|
+
ZodType.init(inst, def);
|
|
9729
|
+
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
9730
|
+
inst.in = def.in;
|
|
9731
|
+
inst.out = def.out;
|
|
9732
|
+
});
|
|
9733
|
+
function pipe(in_, out) {
|
|
9734
|
+
return new ZodPipe({
|
|
9735
|
+
type: "pipe",
|
|
9736
|
+
in: in_,
|
|
9737
|
+
out
|
|
9738
|
+
});
|
|
9739
|
+
}
|
|
9740
|
+
var ZodPreprocess = /*@__PURE__*/ $constructor("ZodPreprocess", (inst, def) => {
|
|
9741
|
+
ZodPipe.init(inst, def);
|
|
9742
|
+
$ZodPreprocess.init(inst, def);
|
|
9743
|
+
});
|
|
9744
|
+
var ZodReadonly = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => {
|
|
9745
|
+
$ZodReadonly.init(inst, def);
|
|
9746
|
+
ZodType.init(inst, def);
|
|
9747
|
+
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
9748
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
9749
|
+
});
|
|
9750
|
+
function readonly(innerType) {
|
|
9751
|
+
return new ZodReadonly({
|
|
9752
|
+
type: "readonly",
|
|
9753
|
+
innerType
|
|
9754
|
+
});
|
|
9755
|
+
}
|
|
9756
|
+
var ZodLazy = /*@__PURE__*/ $constructor("ZodLazy", (inst, def) => {
|
|
9757
|
+
$ZodLazy.init(inst, def);
|
|
9758
|
+
ZodType.init(inst, def);
|
|
9759
|
+
inst._zod.processJSONSchema = (ctx, json, params) => lazyProcessor(inst, ctx, json, params);
|
|
9760
|
+
inst.unwrap = () => inst._zod.def.getter();
|
|
9761
|
+
});
|
|
9762
|
+
function lazy(getter) {
|
|
9763
|
+
return new ZodLazy({
|
|
9764
|
+
type: "lazy",
|
|
9765
|
+
getter
|
|
9766
|
+
});
|
|
9767
|
+
}
|
|
9768
|
+
var ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
|
|
9769
|
+
$ZodCustom.init(inst, def);
|
|
9770
|
+
ZodType.init(inst, def);
|
|
9771
|
+
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
9772
|
+
});
|
|
9773
|
+
function refine(fn, _params = {}) {
|
|
9774
|
+
return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
|
|
9775
|
+
}
|
|
9776
|
+
function superRefine(fn, params) {
|
|
9777
|
+
return /* @__PURE__ */ _superRefine(fn, params);
|
|
9778
|
+
}
|
|
9779
|
+
function json$1(params) {
|
|
9780
|
+
const jsonSchema = lazy(() => {
|
|
9781
|
+
return union([
|
|
9782
|
+
string(params),
|
|
9783
|
+
number(),
|
|
9784
|
+
boolean(),
|
|
9785
|
+
_null(),
|
|
9786
|
+
array(jsonSchema),
|
|
9787
|
+
record$1(string(), jsonSchema)
|
|
9788
|
+
]);
|
|
9789
|
+
});
|
|
9790
|
+
return jsonSchema;
|
|
9791
|
+
}
|
|
9792
|
+
function preprocess(fn, schema) {
|
|
9793
|
+
return new ZodPreprocess({
|
|
9794
|
+
type: "pipe",
|
|
9795
|
+
in: transform(fn),
|
|
9796
|
+
out: schema
|
|
9797
|
+
});
|
|
9798
|
+
}
|
|
9799
|
+
//#endregion
|
|
9800
|
+
//#region ../../node_modules/.bun/zod@4.6.5/node_modules/zod/v4/classic/iso.js
|
|
9801
|
+
function datetime(params) {
|
|
9802
|
+
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
9803
|
+
}
|
|
9804
|
+
//#endregion
|
|
9805
|
+
//#region src/http/common/headers.ts
|
|
9806
|
+
/** Header names are case-insensitive; never silently combine duplicate business fields. */
|
|
9807
|
+
function httpHeaderNameIssue(name, names) {
|
|
9808
|
+
if (!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(name)) return "invalid";
|
|
9809
|
+
if (names.some((candidate) => candidate.toLowerCase() === name.toLowerCase())) return "duplicate";
|
|
9810
|
+
}
|
|
9811
|
+
//#endregion
|
|
9812
|
+
//#region src/http/common/httpRequest.ts
|
|
9813
|
+
var parameterSchema = strictObject({
|
|
9814
|
+
mode: _enum(["fields", "object"]).default("fields"),
|
|
9815
|
+
names: array(string()).default([])
|
|
9816
|
+
});
|
|
9817
|
+
var httpRequestConfigSchema = strictObject({
|
|
9818
|
+
method: _enum([
|
|
9819
|
+
"GET",
|
|
9820
|
+
"POST",
|
|
9821
|
+
"PUT",
|
|
9822
|
+
"PATCH",
|
|
9823
|
+
"DELETE",
|
|
9824
|
+
"HEAD",
|
|
9825
|
+
"OPTIONS"
|
|
9826
|
+
]).default("GET"),
|
|
9827
|
+
query: parameterSchema.default({
|
|
9828
|
+
mode: "fields",
|
|
9829
|
+
names: []
|
|
9830
|
+
}),
|
|
9831
|
+
headers: parameterSchema.default({
|
|
9832
|
+
mode: "fields",
|
|
9833
|
+
names: []
|
|
9834
|
+
}),
|
|
9835
|
+
bodyFormat: _enum([
|
|
9836
|
+
"none",
|
|
9837
|
+
"json",
|
|
9838
|
+
"text",
|
|
9839
|
+
"form"
|
|
9840
|
+
]).default("none"),
|
|
9841
|
+
authentication: union([
|
|
9842
|
+
strictObject({ type: literal("none") }),
|
|
9843
|
+
strictObject({ type: _enum(["bearer", "basic"]) }),
|
|
9844
|
+
strictObject({
|
|
9845
|
+
type: literal("apiKey"),
|
|
9846
|
+
name: string(),
|
|
9847
|
+
in: _enum(["header", "query"])
|
|
9848
|
+
})
|
|
9849
|
+
]).default({ type: "none" }),
|
|
9850
|
+
responseFormat: _enum([
|
|
9851
|
+
"auto",
|
|
9852
|
+
"json",
|
|
9853
|
+
"text"
|
|
9854
|
+
]).default("auto"),
|
|
9855
|
+
statusPolicy: _enum(["success", "all"]).default("success")
|
|
9856
|
+
});
|
|
9857
|
+
var httpRequestExecutorSchema = httpRequestConfigSchema.extend({ kind: literal("http-request") });
|
|
9858
|
+
var scalarSchema = { type: [
|
|
9859
|
+
"string",
|
|
9860
|
+
"number",
|
|
9861
|
+
"boolean"
|
|
9862
|
+
] };
|
|
9863
|
+
var queryValueSchema = { anyOf: [scalarSchema, {
|
|
9864
|
+
type: "array",
|
|
9865
|
+
items: scalarSchema
|
|
9866
|
+
}] };
|
|
9867
|
+
var httpHeaderSchema = {
|
|
9868
|
+
type: "object",
|
|
9869
|
+
additionalProperties: { type: "string" }
|
|
9870
|
+
};
|
|
9871
|
+
var httpQuerySchema = {
|
|
9872
|
+
type: "object",
|
|
9873
|
+
additionalProperties: queryValueSchema
|
|
9874
|
+
};
|
|
9875
|
+
function httpAuthHandles(config) {
|
|
9876
|
+
return config.authentication.type == "none" ? [] : config.authentication.type == "basic" ? ["auth.username", "auth.password"] : ["auth.token"];
|
|
9877
|
+
}
|
|
9878
|
+
function retain(ports, old) {
|
|
9879
|
+
const remaining = new Map(ports.map((port) => [port.handle, port]));
|
|
9880
|
+
return [...old.flatMap((item) => {
|
|
9881
|
+
if ("group" in item) return [item];
|
|
9882
|
+
const next = remaining.get(item.handle);
|
|
9883
|
+
if (next == null) return [];
|
|
9884
|
+
remaining.delete(item.handle);
|
|
9885
|
+
return [dequal(item.jsonSchema, next.jsonSchema) && item.nullable == next.nullable ? item : next];
|
|
9886
|
+
}), ...remaining.values()];
|
|
9887
|
+
}
|
|
9888
|
+
function httpRequestTask(config = httpRequestConfigSchema.parse({}), name = "HTTP Request", previous) {
|
|
9889
|
+
const inputs = [{
|
|
9890
|
+
handle: "url",
|
|
9891
|
+
jsonSchema: { type: "string" },
|
|
9892
|
+
nullable: false
|
|
9893
|
+
}];
|
|
9894
|
+
for (const group of ["query", "headers"]) if (config[group].mode == "object") inputs.push({
|
|
9895
|
+
handle: group,
|
|
9896
|
+
jsonSchema: group == "query" ? httpQuerySchema : httpHeaderSchema,
|
|
9897
|
+
nullable: true
|
|
9898
|
+
});
|
|
9899
|
+
else for (const parameterName of config[group].names.filter((value) => value.trim())) inputs.push({
|
|
9900
|
+
handle: `${group == "query" ? "query" : "header"}.${parameterName}`,
|
|
9901
|
+
jsonSchema: group == "query" ? queryValueSchema : { type: "string" },
|
|
9902
|
+
nullable: true
|
|
9903
|
+
});
|
|
9904
|
+
if (config.bodyFormat != "none") inputs.push({
|
|
9905
|
+
handle: "body",
|
|
9906
|
+
jsonSchema: config.bodyFormat == "json" ? {} : config.bodyFormat == "text" ? { type: "string" } : httpQuerySchema,
|
|
9907
|
+
nullable: config.bodyFormat == "json"
|
|
9908
|
+
});
|
|
9909
|
+
inputs.push(...httpAuthHandles(config).map((handle) => ({
|
|
9910
|
+
handle,
|
|
9911
|
+
jsonSchema: { type: "string" },
|
|
9912
|
+
nullable: false
|
|
9913
|
+
})));
|
|
9914
|
+
const outputs = [
|
|
9915
|
+
{
|
|
9916
|
+
handle: "body",
|
|
9917
|
+
jsonSchema: config.responseFormat == "text" ? { type: "string" } : {},
|
|
9918
|
+
nullable: true
|
|
9919
|
+
},
|
|
9920
|
+
{
|
|
9921
|
+
handle: "statusCode",
|
|
9922
|
+
jsonSchema: { type: "integer" },
|
|
9923
|
+
nullable: false
|
|
9924
|
+
},
|
|
9925
|
+
{
|
|
9926
|
+
handle: "headers",
|
|
9927
|
+
jsonSchema: httpHeaderSchema,
|
|
9928
|
+
nullable: false
|
|
9929
|
+
}
|
|
9930
|
+
];
|
|
9931
|
+
return {
|
|
9932
|
+
name,
|
|
9933
|
+
executor: {
|
|
9934
|
+
...config,
|
|
9935
|
+
kind: "http-request"
|
|
9936
|
+
},
|
|
9937
|
+
inputs: retain(inputs, previous?.inputs ?? []),
|
|
9938
|
+
outputs: retain(outputs, previous?.outputs ?? [])
|
|
9939
|
+
};
|
|
9940
|
+
}
|
|
9941
|
+
function httpRequestIssues(config) {
|
|
9942
|
+
const issues = [];
|
|
9943
|
+
if (["GET", "HEAD"].includes(config.method) && config.bodyFormat != "none") issues.push({
|
|
9944
|
+
field: "bodyFormat",
|
|
9945
|
+
code: "bodyUnsupported",
|
|
9946
|
+
message: "GET and HEAD do not support a request body."
|
|
9947
|
+
});
|
|
9948
|
+
for (const group of ["query", "headers"]) {
|
|
9949
|
+
if (config[group].mode != "fields") continue;
|
|
9950
|
+
const seen = /* @__PURE__ */ new Set();
|
|
9951
|
+
for (const [index, name] of config[group].names.entries()) {
|
|
9952
|
+
const key = group == "headers" ? name.toLowerCase() : name;
|
|
9953
|
+
if (!name.trim() || seen.has(key)) issues.push({
|
|
9954
|
+
field: group,
|
|
9955
|
+
index,
|
|
9956
|
+
code: "parameterNamesInvalid",
|
|
9957
|
+
message: "Parameter names must be nonempty and unique."
|
|
9958
|
+
});
|
|
9959
|
+
seen.add(key);
|
|
9960
|
+
if (group == "headers" && httpHeaderNameIssue(name, []) === "invalid") issues.push({
|
|
9961
|
+
field: group,
|
|
9962
|
+
index,
|
|
9963
|
+
code: "headerNameInvalid",
|
|
9964
|
+
message: "Invalid HTTP header name."
|
|
9965
|
+
});
|
|
9966
|
+
}
|
|
9967
|
+
}
|
|
9968
|
+
const auth = config.authentication;
|
|
9969
|
+
if (auth.type != "none") {
|
|
9970
|
+
const group = auth.type == "apiKey" && auth.in == "query" ? "query" : "headers";
|
|
9971
|
+
const name = auth.type == "apiKey" ? auth.name : "authorization";
|
|
9972
|
+
if (!name.trim()) issues.push({
|
|
9973
|
+
field: "authentication",
|
|
9974
|
+
code: "keyNameRequired",
|
|
9975
|
+
message: "API Key requires a name."
|
|
9976
|
+
});
|
|
9977
|
+
if (group == "headers" && name.trim() && httpHeaderNameIssue(name, []) === "invalid") issues.push({
|
|
9978
|
+
field: "authentication",
|
|
9979
|
+
code: "headerNameInvalid",
|
|
9980
|
+
message: "Invalid authentication header name."
|
|
9981
|
+
});
|
|
9982
|
+
if (config[group].mode == "fields" && config[group].names.some((item) => group == "headers" ? item.toLowerCase() == name.toLowerCase() : item == name)) issues.push({
|
|
9983
|
+
field: "authentication",
|
|
9984
|
+
code: "authConflict",
|
|
9985
|
+
message: "Authentication conflicts with a request parameter."
|
|
9986
|
+
});
|
|
9987
|
+
}
|
|
9988
|
+
return issues;
|
|
9989
|
+
}
|
|
9990
|
+
function httpRequestUrl(value) {
|
|
9991
|
+
if (typeof value != "string" || !value.trim()) throw new Error("A URL is required.");
|
|
9992
|
+
const url = new URL(value);
|
|
9993
|
+
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password) throw new Error("An HTTP(S) URL without credentials is required.");
|
|
9994
|
+
return url;
|
|
9995
|
+
}
|
|
9996
|
+
//#endregion
|
|
9997
|
+
//#region src/openapi/common/openapi.ts
|
|
9998
|
+
var methods = [
|
|
9999
|
+
"get",
|
|
10000
|
+
"put",
|
|
10001
|
+
"post",
|
|
10002
|
+
"delete",
|
|
10003
|
+
"options",
|
|
10004
|
+
"head",
|
|
10005
|
+
"patch",
|
|
10006
|
+
"trace"
|
|
10007
|
+
];
|
|
10008
|
+
function object(value) {
|
|
10009
|
+
if (value == null || typeof value != "object" || Array.isArray(value)) throw new Error("Expected an OpenAPI object.");
|
|
10010
|
+
return value;
|
|
10011
|
+
}
|
|
10012
|
+
function httpUrl(value, base) {
|
|
10013
|
+
const url = new URL(value, base);
|
|
10014
|
+
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.hash) throw new Error("An HTTP(S) URL without credentials or fragment is required.");
|
|
10015
|
+
return url.href;
|
|
10016
|
+
}
|
|
10017
|
+
function parseOpenApi(value) {
|
|
10018
|
+
const doc = object(value);
|
|
10019
|
+
if (typeof doc.openapi != "string" || !/^3\.[01]\.\d+$/.test(doc.openapi)) throw new Error("Only OpenAPI 3.0 and 3.1 JSON documents are supported.");
|
|
10020
|
+
object(doc.paths);
|
|
10021
|
+
return doc;
|
|
10022
|
+
}
|
|
10023
|
+
function pointer(doc, ref) {
|
|
10024
|
+
if (!ref.startsWith("#/")) throw new Error("External OpenAPI references are not supported.");
|
|
10025
|
+
let value = doc;
|
|
10026
|
+
for (const key of decodeURIComponent(ref.slice(2)).split("/").map((part) => part.replace(/~1/g, "/").replace(/~0/g, "~"))) {
|
|
10027
|
+
const source = object(value);
|
|
10028
|
+
if (!Object.hasOwn(source, key)) throw new Error("An OpenAPI reference is missing.");
|
|
10029
|
+
value = source[key];
|
|
10030
|
+
}
|
|
10031
|
+
return value;
|
|
10032
|
+
}
|
|
10033
|
+
function resolved(doc, value) {
|
|
10034
|
+
let result = object(value);
|
|
10035
|
+
const seen = /* @__PURE__ */ new Set();
|
|
10036
|
+
while (typeof result.$ref == "string") {
|
|
10037
|
+
if (seen.has(result.$ref)) throw new Error("Circular non-schema reference is unsupported.");
|
|
10038
|
+
seen.add(result.$ref);
|
|
10039
|
+
const { $ref, ...siblings } = result;
|
|
10040
|
+
result = {
|
|
10041
|
+
...object(pointer(doc, $ref)),
|
|
10042
|
+
...siblings
|
|
10043
|
+
};
|
|
10044
|
+
}
|
|
10045
|
+
return result;
|
|
10046
|
+
}
|
|
10047
|
+
function operation(doc, path, method) {
|
|
10048
|
+
const item = resolved(doc, object(doc.paths)[path]);
|
|
10049
|
+
if (!methods.includes(method) || item[method] == null) throw new Error("The selected operation is no longer available.");
|
|
10050
|
+
return {
|
|
10051
|
+
item,
|
|
10052
|
+
op: object(item[method])
|
|
10053
|
+
};
|
|
10054
|
+
}
|
|
10055
|
+
function servers(value, path, method) {
|
|
10056
|
+
const doc = parseOpenApi(value);
|
|
10057
|
+
const { item, op } = operation(doc, path, method);
|
|
10058
|
+
const entries = op.servers ?? item.servers ?? doc.servers;
|
|
10059
|
+
if (!Array.isArray(entries) || entries.length == 0) return [{ url: "/" }];
|
|
10060
|
+
return entries.map(object);
|
|
10061
|
+
}
|
|
10062
|
+
function snapshot(documentValue, path, method) {
|
|
10063
|
+
const doc = parseOpenApi(documentValue);
|
|
10064
|
+
const { item, op } = operation(doc, path, method);
|
|
10065
|
+
const security = op.security ?? doc.security ?? [];
|
|
10066
|
+
const result = {
|
|
10067
|
+
openapi: doc.openapi,
|
|
10068
|
+
paths: { [path]: {
|
|
10069
|
+
[method]: op,
|
|
10070
|
+
...item.parameters == null ? {} : { parameters: item.parameters }
|
|
10071
|
+
} },
|
|
10072
|
+
servers: servers(doc, path, method),
|
|
10073
|
+
security
|
|
10074
|
+
};
|
|
10075
|
+
const visited = /* @__PURE__ */ new Set();
|
|
10076
|
+
function copy(ref) {
|
|
10077
|
+
if (visited.has(ref)) return;
|
|
10078
|
+
visited.add(ref);
|
|
10079
|
+
const value = pointer(doc, ref);
|
|
10080
|
+
const keys = decodeURIComponent(ref.slice(2)).split("/").map((part) => part.replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
10081
|
+
if (keys.some((key) => [
|
|
10082
|
+
"__proto__",
|
|
10083
|
+
"constructor",
|
|
10084
|
+
"prototype"
|
|
10085
|
+
].includes(key))) throw new Error("Unsupported reference key.");
|
|
10086
|
+
let target = result;
|
|
10087
|
+
for (const key of keys.slice(0, -1)) {
|
|
10088
|
+
if (!Object.hasOwn(target, key)) target[key] = {};
|
|
10089
|
+
target = object(target[key]);
|
|
10090
|
+
}
|
|
10091
|
+
target[keys.at(-1)] = structuredClone(value);
|
|
10092
|
+
visit(value);
|
|
10093
|
+
}
|
|
10094
|
+
function visit(value) {
|
|
10095
|
+
if (value == null || typeof value != "object") return;
|
|
10096
|
+
if (Array.isArray(value)) {
|
|
10097
|
+
value.forEach(visit);
|
|
10098
|
+
return;
|
|
10099
|
+
}
|
|
10100
|
+
if (typeof object(value).$ref == "string") copy(object(value).$ref);
|
|
10101
|
+
for (const [key, child] of Object.entries(value)) if (![
|
|
10102
|
+
"example",
|
|
10103
|
+
"examples",
|
|
10104
|
+
"default"
|
|
10105
|
+
].includes(key)) visit(child);
|
|
10106
|
+
}
|
|
10107
|
+
visit(result);
|
|
10108
|
+
for (const entry of security) for (const name of Object.keys(object(entry))) copy(`#/components/securitySchemes/${name.replace(/~/g, "~0").replace(/\//g, "~1")}`);
|
|
10109
|
+
return structuredClone(result);
|
|
10110
|
+
}
|
|
10111
|
+
function schema$1(doc, schemaValue) {
|
|
10112
|
+
const defs = {};
|
|
10113
|
+
const ids = /* @__PURE__ */ new Map();
|
|
10114
|
+
function convert(value) {
|
|
10115
|
+
if (typeof value == "boolean") return value;
|
|
10116
|
+
const source = object(value);
|
|
10117
|
+
if (source.format == "binary" || source.$dynamicRef != null || source.$id != null) throw new Error("Binary and dynamically scoped schemas are unsupported.");
|
|
10118
|
+
const result = {};
|
|
10119
|
+
for (const [key, child] of Object.entries(source)) {
|
|
10120
|
+
if ([
|
|
10121
|
+
"nullable",
|
|
10122
|
+
"example",
|
|
10123
|
+
"xml",
|
|
10124
|
+
"discriminator",
|
|
10125
|
+
"__proto__"
|
|
10126
|
+
].includes(key)) continue;
|
|
10127
|
+
if (key == "$ref") {
|
|
10128
|
+
if (typeof child != "string") throw new Error("Invalid schema reference.");
|
|
10129
|
+
let id = ids.get(child);
|
|
10130
|
+
if (id == null) {
|
|
10131
|
+
id = `s${ids.size}`;
|
|
10132
|
+
ids.set(child, id);
|
|
10133
|
+
defs[id] = convert(pointer(doc, child));
|
|
10134
|
+
}
|
|
10135
|
+
result.$ref = `#/$defs/${id}`;
|
|
10136
|
+
} else if ([
|
|
10137
|
+
"properties",
|
|
10138
|
+
"patternProperties",
|
|
10139
|
+
"$defs",
|
|
10140
|
+
"definitions",
|
|
10141
|
+
"dependentSchemas"
|
|
10142
|
+
].includes(key)) result[key] = Object.fromEntries(Object.entries(object(child)).map(([name, childSchema]) => [name, convert(childSchema)]));
|
|
10143
|
+
else if ([
|
|
10144
|
+
"allOf",
|
|
10145
|
+
"anyOf",
|
|
10146
|
+
"oneOf",
|
|
10147
|
+
"prefixItems"
|
|
10148
|
+
].includes(key)) {
|
|
10149
|
+
if (!Array.isArray(child)) throw new Error("Invalid schema composition.");
|
|
10150
|
+
result[key] = child.map(convert);
|
|
10151
|
+
} else if ([
|
|
10152
|
+
"items",
|
|
10153
|
+
"additionalProperties",
|
|
10154
|
+
"not",
|
|
10155
|
+
"if",
|
|
10156
|
+
"then",
|
|
10157
|
+
"else",
|
|
10158
|
+
"contains",
|
|
10159
|
+
"propertyNames",
|
|
10160
|
+
"unevaluatedProperties"
|
|
10161
|
+
].includes(key)) result[key] = convert(child);
|
|
10162
|
+
else result[key] = child;
|
|
10163
|
+
}
|
|
10164
|
+
if (source.nullable === true) return { anyOf: [result, { type: "null" }] };
|
|
10165
|
+
for (const key of ["minimum", "maximum"]) {
|
|
10166
|
+
const exclusive = key == "minimum" ? "exclusiveMinimum" : "exclusiveMaximum";
|
|
10167
|
+
if (typeof result[exclusive] == "boolean") {
|
|
10168
|
+
if (result[exclusive] && typeof result[key] == "number") {
|
|
10169
|
+
result[exclusive] = result[key];
|
|
10170
|
+
delete result[key];
|
|
10171
|
+
} else delete result[exclusive];
|
|
10172
|
+
}
|
|
10173
|
+
}
|
|
10174
|
+
return result;
|
|
10175
|
+
}
|
|
10176
|
+
let converted = convert(schemaValue);
|
|
10177
|
+
if (typeof converted == "object" && converted != null && typeof object(converted).$ref == "string") {
|
|
10178
|
+
const id = String(object(converted).$ref).slice(8);
|
|
10179
|
+
const { $ref: _ref, ...siblings } = object(converted);
|
|
10180
|
+
converted = {
|
|
10181
|
+
...object(defs[id]),
|
|
10182
|
+
...siblings
|
|
10183
|
+
};
|
|
10184
|
+
}
|
|
10185
|
+
if (typeof converted == "boolean") return converted;
|
|
10186
|
+
return {
|
|
10187
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
10188
|
+
...object(converted),
|
|
10189
|
+
...Object.keys(defs).length ? { $defs: defs } : {}
|
|
10190
|
+
};
|
|
10191
|
+
}
|
|
10192
|
+
function parameters(config) {
|
|
10193
|
+
const doc = parseOpenApi(config.document);
|
|
10194
|
+
const { item, op } = operation(doc, config.path, config.method);
|
|
10195
|
+
const entries = /* @__PURE__ */ new Map();
|
|
10196
|
+
for (const value of [...item.parameters ?? [], ...op.parameters ?? []]) {
|
|
10197
|
+
const p = resolved(doc, value);
|
|
10198
|
+
if (![
|
|
10199
|
+
"path",
|
|
10200
|
+
"query",
|
|
10201
|
+
"header"
|
|
10202
|
+
].includes(String(p.in)) || typeof p.name != "string" || p.content != null) throw new Error("Only schema-based path, query and header parameters are supported.");
|
|
10203
|
+
if (p.allowReserved === true) throw new Error("allowReserved parameters are unsupported.");
|
|
10204
|
+
if ((p.style ?? (p.in == "query" ? "form" : "simple")) != (p.in == "query" ? "form" : "simple")) throw new Error("Only form query and simple path/header serialization are supported.");
|
|
10205
|
+
entries.set(`${p.in}.${p.in == "header" ? p.name.toLowerCase() : p.name}`, p);
|
|
10206
|
+
}
|
|
10207
|
+
return [...entries.values()];
|
|
10208
|
+
}
|
|
10209
|
+
function jsonContent(doc, value) {
|
|
10210
|
+
const content = resolved(doc, value);
|
|
10211
|
+
const media = object(content.content);
|
|
10212
|
+
const mediaType = media["application/json"] != null ? "application/json" : Object.keys(media).find((key) => /^application\/.+\+json$/.test(key));
|
|
10213
|
+
const json = mediaType == null ? void 0 : media[mediaType];
|
|
10214
|
+
if (json == null) throw new Error("Only JSON request and response bodies are supported.");
|
|
10215
|
+
return {
|
|
10216
|
+
schema: schema$1(doc, object(json).schema ?? {}),
|
|
10217
|
+
required: content.required === true,
|
|
10218
|
+
mediaType
|
|
10219
|
+
};
|
|
10220
|
+
}
|
|
10221
|
+
function authHandles(auth) {
|
|
10222
|
+
return auth.flatMap((scheme) => scheme.type == "basic" ? [`auth.${scheme.id}.username`, `auth.${scheme.id}.password`] : [`auth.${scheme.id}.token`]);
|
|
10223
|
+
}
|
|
10224
|
+
function openApiTask(config, name = "OpenAPI") {
|
|
10225
|
+
if (!config.path) return {
|
|
10226
|
+
name,
|
|
10227
|
+
executor: config,
|
|
10228
|
+
inputs: [],
|
|
10229
|
+
outputs: []
|
|
10230
|
+
};
|
|
10231
|
+
const doc = parseOpenApi(config.document);
|
|
10232
|
+
const { op } = operation(doc, config.path, config.method);
|
|
10233
|
+
const params = parameters(config);
|
|
10234
|
+
const inputs = params.map((p) => {
|
|
10235
|
+
const jsonSchema = schema$1(doc, p.schema ?? {});
|
|
10236
|
+
const defaultValue = typeof jsonSchema == "boolean" ? void 0 : object(jsonSchema).default;
|
|
10237
|
+
return {
|
|
10238
|
+
handle: `${p.in}.${p.name}`,
|
|
10239
|
+
jsonSchema,
|
|
10240
|
+
nullable: p.required !== true && p.in != "path" || matchesSchema(null, jsonSchema),
|
|
10241
|
+
...typeof p.description == "string" ? { description: p.description } : {},
|
|
10242
|
+
...defaultValue === void 0 ? {} : { value: defaultValue }
|
|
10243
|
+
};
|
|
10244
|
+
});
|
|
10245
|
+
if (op.requestBody != null) {
|
|
10246
|
+
if (config.method == "get" || config.method == "head") throw new Error("GET and HEAD request bodies are unsupported.");
|
|
10247
|
+
const body = jsonContent(doc, op.requestBody);
|
|
10248
|
+
inputs.push({
|
|
10249
|
+
handle: "body",
|
|
10250
|
+
jsonSchema: body.schema,
|
|
10251
|
+
nullable: !body.required || matchesSchema(null, body.schema)
|
|
10252
|
+
});
|
|
10253
|
+
}
|
|
10254
|
+
const occupied = new Set(params.map((p) => `${p.in}.${p.in == "header" ? String(p.name).toLowerCase() : p.name}`));
|
|
10255
|
+
for (const auth of config.auth) {
|
|
10256
|
+
const location = auth.type == "apiKey" ? `${auth.in}.${auth.in == "header" ? auth.name?.toLowerCase() : auth.name}` : "header.authorization";
|
|
10257
|
+
if (occupied.has(location)) throw new Error("Authentication conflicts with a parameter or another security scheme.");
|
|
10258
|
+
if (auth.type == "apiKey" && (!auth.name || !["header", "query"].includes(auth.in ?? ""))) throw new Error("API Key requires a name and location.");
|
|
10259
|
+
occupied.add(location);
|
|
10260
|
+
}
|
|
10261
|
+
inputs.push(...authHandles(config.auth).map((handle) => ({
|
|
10262
|
+
handle,
|
|
10263
|
+
jsonSchema: { type: "string" },
|
|
10264
|
+
nullable: false
|
|
10265
|
+
})));
|
|
10266
|
+
const responses = object(op.responses);
|
|
10267
|
+
const schemas = [];
|
|
10268
|
+
for (const [status, response] of Object.entries(responses)) if (/^2\d\d$|^2XX$/.test(status) || status == "default") {
|
|
10269
|
+
const r = resolved(doc, response);
|
|
10270
|
+
if (r.content == null) schemas.push({ type: "null" });
|
|
10271
|
+
else {
|
|
10272
|
+
jsonContent(doc, r);
|
|
10273
|
+
for (const [mediaType, media] of Object.entries(object(r.content))) if (/^application\/(json|.+\+json)$/.test(mediaType)) schemas.push(schema$1(doc, object(media).schema ?? {}));
|
|
10274
|
+
}
|
|
10275
|
+
}
|
|
10276
|
+
if (!schemas.length) throw new Error("A successful JSON response definition is required.");
|
|
10277
|
+
return {
|
|
10278
|
+
name,
|
|
10279
|
+
executor: config,
|
|
10280
|
+
inputs,
|
|
10281
|
+
outputs: [
|
|
10282
|
+
{
|
|
10283
|
+
handle: "body",
|
|
10284
|
+
jsonSchema: schemas.length == 1 ? schemas[0] : {
|
|
10285
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
10286
|
+
anyOf: schemas.map((s, index) => inlineSchema(s, index))
|
|
10287
|
+
},
|
|
10288
|
+
nullable: config.method == "head" || schemas.some((item) => matchesSchema(null, item))
|
|
10289
|
+
},
|
|
10290
|
+
{
|
|
10291
|
+
handle: "statusCode",
|
|
10292
|
+
jsonSchema: { type: "integer" },
|
|
10293
|
+
nullable: false
|
|
10294
|
+
},
|
|
10295
|
+
{
|
|
10296
|
+
handle: "headers",
|
|
10297
|
+
jsonSchema: {
|
|
10298
|
+
type: "object",
|
|
10299
|
+
additionalProperties: { type: "string" }
|
|
10300
|
+
},
|
|
10301
|
+
nullable: false
|
|
10302
|
+
}
|
|
10303
|
+
]
|
|
10304
|
+
};
|
|
10305
|
+
}
|
|
10306
|
+
function inlineSchema(value, index) {
|
|
10307
|
+
if (Array.isArray(value)) return value.map((item) => inlineSchema(item, index));
|
|
10308
|
+
if (value == null || typeof value != "object") return value;
|
|
10309
|
+
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, key == "$ref" && typeof child == "string" && child.startsWith("#/") ? `#/anyOf/${index}/${child.slice(2)}` : inlineSchema(child, index)]));
|
|
10073
10310
|
}
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10311
|
+
/** The canvas validator and property panel share the same configuration contract. */
|
|
10312
|
+
function openApiFieldIssues(task) {
|
|
10313
|
+
if (task.executor.kind != "openapi") return [];
|
|
10314
|
+
const config = task.executor;
|
|
10315
|
+
let field = "sourceUrl";
|
|
10316
|
+
try {
|
|
10317
|
+
if (!config.sourceUrl.trim()) return [{
|
|
10318
|
+
field,
|
|
10319
|
+
message: "Enter an OpenAPI JSON document URL."
|
|
10320
|
+
}];
|
|
10321
|
+
httpUrl(config.sourceUrl);
|
|
10322
|
+
field = "operation";
|
|
10323
|
+
if (!config.path) return [{
|
|
10324
|
+
field,
|
|
10325
|
+
message: "Select an OpenAPI operation."
|
|
10326
|
+
}];
|
|
10327
|
+
field = "serverUrl";
|
|
10328
|
+
httpUrl(config.serverUrl);
|
|
10329
|
+
if (new URL(config.serverUrl).search) throw new Error("Server URLs must not contain a query string.");
|
|
10330
|
+
field = "operation";
|
|
10331
|
+
if (!dequal(config.document, snapshot(config.document, config.path, config.method))) return [{
|
|
10332
|
+
field,
|
|
10333
|
+
message: "Save only the selected operation and its dependencies."
|
|
10334
|
+
}];
|
|
10335
|
+
const expected = openApiTask(config, task.name);
|
|
10336
|
+
if (!dequal(expected.inputs, task.inputs) || !dequal(expected.outputs, task.outputs)) return [{
|
|
10337
|
+
field,
|
|
10338
|
+
message: "OpenAPI ports must match the saved operation."
|
|
10339
|
+
}];
|
|
10340
|
+
return [];
|
|
10341
|
+
} catch (error) {
|
|
10342
|
+
return [{
|
|
10343
|
+
field,
|
|
10344
|
+
message: error.message
|
|
10345
|
+
}];
|
|
10346
|
+
}
|
|
10087
10347
|
}
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
ZodType.init(inst, def);
|
|
10091
|
-
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
10092
|
-
inst.in = def.in;
|
|
10093
|
-
inst.out = def.out;
|
|
10094
|
-
});
|
|
10095
|
-
function pipe(in_, out) {
|
|
10096
|
-
return new ZodPipe({
|
|
10097
|
-
type: "pipe",
|
|
10098
|
-
in: in_,
|
|
10099
|
-
out
|
|
10100
|
-
});
|
|
10348
|
+
function openApiIssues(task) {
|
|
10349
|
+
return openApiFieldIssues(task).map((issue) => issue.message);
|
|
10101
10350
|
}
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10351
|
+
//#endregion
|
|
10352
|
+
//#region src/workflow/common/workflow.ts
|
|
10353
|
+
var portSchema = object$1({
|
|
10354
|
+
handle: string().min(1),
|
|
10355
|
+
jsonSchema: json$1(),
|
|
10356
|
+
nullable: boolean(),
|
|
10357
|
+
description: string().optional()
|
|
10105
10358
|
});
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
10110
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
10359
|
+
strictObject({
|
|
10360
|
+
inputs: array(portSchema).nullable(),
|
|
10361
|
+
outputs: array(portSchema).nullable()
|
|
10111
10362
|
});
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
ZodType.init(inst, def);
|
|
10121
|
-
inst._zod.processJSONSchema = (ctx, json, params) => lazyProcessor(inst, ctx, json, params);
|
|
10122
|
-
inst.unwrap = () => inst._zod.def.getter();
|
|
10363
|
+
object$1({
|
|
10364
|
+
version: literal(1),
|
|
10365
|
+
flowId: string().min(1),
|
|
10366
|
+
name: string(),
|
|
10367
|
+
revisionId: string().min(1),
|
|
10368
|
+
publicationId: string().min(1),
|
|
10369
|
+
inputs: array(portSchema),
|
|
10370
|
+
outputs: array(portSchema).nullable()
|
|
10123
10371
|
});
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10372
|
+
object$1({
|
|
10373
|
+
version: literal(1),
|
|
10374
|
+
direction: _enum(["incoming", "outgoing"]),
|
|
10375
|
+
total: int().nonnegative(),
|
|
10376
|
+
nextOffset: int().nonnegative().optional(),
|
|
10377
|
+
references: array(object$1({
|
|
10378
|
+
flowId: string(),
|
|
10379
|
+
name: string().nullable(),
|
|
10380
|
+
available: boolean(),
|
|
10381
|
+
draft: boolean(),
|
|
10382
|
+
live: object$1({
|
|
10383
|
+
publicationId: string(),
|
|
10384
|
+
enabled: boolean()
|
|
10385
|
+
}).nullable()
|
|
10386
|
+
}))
|
|
10134
10387
|
});
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
}
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
}
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
in: transform(fn),
|
|
10158
|
-
out: schema
|
|
10159
|
-
});
|
|
10388
|
+
/** Workflow declarations share discovery across authoring, admission and resource indexing. */
|
|
10389
|
+
function nodeWorkflowReferences(node) {
|
|
10390
|
+
if (node.kind != "task") return [];
|
|
10391
|
+
if ("moduleId" in node.task) return (node.task.capabilities ?? []).flatMap((item, index) => item.kind == "workflow" ? [{
|
|
10392
|
+
target: item,
|
|
10393
|
+
path: `task/capabilities/${index}`,
|
|
10394
|
+
tool: item.name
|
|
10395
|
+
}] : []);
|
|
10396
|
+
if (node.task.executor.kind == "workflow") return [{
|
|
10397
|
+
target: {
|
|
10398
|
+
...node.task.executor,
|
|
10399
|
+
inputs: node.task.inputs.filter((port) => "handle" in port),
|
|
10400
|
+
outputs: node.task.outputs.filter((port) => "handle" in port)
|
|
10401
|
+
},
|
|
10402
|
+
path: "task/executor"
|
|
10403
|
+
}];
|
|
10404
|
+
if (node.task.executor.kind == "agent") return node.task.executor.tools.flatMap((item, index) => item.kind == "workflow" ? [{
|
|
10405
|
+
target: item,
|
|
10406
|
+
path: `task/executor/tools/${index}`,
|
|
10407
|
+
tool: item.name
|
|
10408
|
+
}] : []);
|
|
10409
|
+
return [];
|
|
10160
10410
|
}
|
|
10161
10411
|
//#endregion
|
|
10162
|
-
//#region
|
|
10163
|
-
|
|
10164
|
-
|
|
10412
|
+
//#region src/flow/common/inputValue.ts
|
|
10413
|
+
/** An explicit clear suppresses the default; absent mappings still inherit it. */
|
|
10414
|
+
function inputValue(mapping, fallback) {
|
|
10415
|
+
if (mapping?.kind === "unset") return void 0;
|
|
10416
|
+
return mapping?.kind === "value" ? mapping.value : fallback;
|
|
10165
10417
|
}
|
|
10166
10418
|
function checkJsonDepth(value, depth = 0) {
|
|
10167
10419
|
if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
|
|
@@ -10173,6 +10425,7 @@ var retryNodeTypes = [
|
|
|
10173
10425
|
"code",
|
|
10174
10426
|
"connector",
|
|
10175
10427
|
"openapi",
|
|
10428
|
+
"http-request",
|
|
10176
10429
|
"llm",
|
|
10177
10430
|
"decision"
|
|
10178
10431
|
];
|
|
@@ -10191,11 +10444,11 @@ function supportsNodeRetry(node) {
|
|
|
10191
10444
|
}
|
|
10192
10445
|
//#endregion
|
|
10193
10446
|
//#region src/flow/common/triggerScheduleSchema.ts
|
|
10194
|
-
var triggerScheduleSchema = array(union([object({
|
|
10447
|
+
var triggerScheduleSchema = array(union([object$1({
|
|
10195
10448
|
type: literal("cron"),
|
|
10196
10449
|
expression: string(),
|
|
10197
10450
|
timezone: string()
|
|
10198
|
-
}), object({
|
|
10451
|
+
}), object$1({
|
|
10199
10452
|
type: literal("every"),
|
|
10200
10453
|
unit: _enum([
|
|
10201
10454
|
"day",
|
|
@@ -10289,11 +10542,6 @@ function workflowOutputsPort(outputs) {
|
|
|
10289
10542
|
nullable: false
|
|
10290
10543
|
};
|
|
10291
10544
|
}
|
|
10292
|
-
/** Header names are case-insensitive; never silently combine duplicate business fields. */
|
|
10293
|
-
function webhookHeaderNameIssue(name, names) {
|
|
10294
|
-
if (!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(name)) return "invalid";
|
|
10295
|
-
if (names.some((candidate) => candidate.toLowerCase() === name.toLowerCase())) return "duplicate";
|
|
10296
|
-
}
|
|
10297
10545
|
/** Fixed inputs belong to the node, not author-supplied definitions. */
|
|
10298
10546
|
var webhookResponseInputs = [
|
|
10299
10547
|
{
|
|
@@ -10324,7 +10572,7 @@ function webhookHeaderValues(source) {
|
|
|
10324
10572
|
const headers = {};
|
|
10325
10573
|
const names = [];
|
|
10326
10574
|
for (const [name, value] of Object.entries(source)) {
|
|
10327
|
-
if (
|
|
10575
|
+
if (httpHeaderNameIssue(name, names) != null) return;
|
|
10328
10576
|
if (typeof value !== "string" && typeof value !== "boolean" && !(typeof value === "number" && Number.isFinite(value))) return;
|
|
10329
10577
|
const text = String(value);
|
|
10330
10578
|
if ([...text].some((character) => character.charCodeAt(0) > 255 || /[\0\r\n]/.test(character))) return;
|
|
@@ -10341,7 +10589,7 @@ var text = string();
|
|
|
10341
10589
|
var actionConnection = text.describe("Account selection: omit while unconfigured; use an account ID to select it; use \"\" to explicitly defer configuration. Deferred Actions fail if called; deferred Agent tools are excluded from the callable tool set. Not supported by Triggers.");
|
|
10342
10590
|
var json = json$1();
|
|
10343
10591
|
var strings = array(text);
|
|
10344
|
-
var port = object({
|
|
10592
|
+
var port = object$1({
|
|
10345
10593
|
description: text.optional(),
|
|
10346
10594
|
jsonSchema: json,
|
|
10347
10595
|
nullable: boolean(),
|
|
@@ -10349,25 +10597,25 @@ var port = object({
|
|
|
10349
10597
|
});
|
|
10350
10598
|
var workflowInputDefs = array(port.strict());
|
|
10351
10599
|
var input = port.extend({ value: json.optional() });
|
|
10352
|
-
var group = object({
|
|
10600
|
+
var group = object$1({
|
|
10353
10601
|
collapsed: boolean().optional(),
|
|
10354
10602
|
group: text
|
|
10355
10603
|
});
|
|
10356
|
-
var source = union([object({
|
|
10604
|
+
var source = union([object$1({
|
|
10357
10605
|
kind: literal("node"),
|
|
10358
10606
|
nodeId: text,
|
|
10359
10607
|
output: text,
|
|
10360
10608
|
system: literal(true).optional(),
|
|
10361
10609
|
field: text.optional()
|
|
10362
|
-
}), object({
|
|
10610
|
+
}), object$1({
|
|
10363
10611
|
kind: literal("binding"),
|
|
10364
10612
|
bindingId: text
|
|
10365
10613
|
})]);
|
|
10366
|
-
var fixedInput = union([object({ kind: literal("unset") }), object({
|
|
10614
|
+
var fixedInput = union([object$1({ kind: literal("unset") }), object$1({
|
|
10367
10615
|
kind: literal("value"),
|
|
10368
10616
|
value: json
|
|
10369
10617
|
})]);
|
|
10370
|
-
var mapping = union([fixedInput, object({
|
|
10618
|
+
var mapping = union([fixedInput, object$1({
|
|
10371
10619
|
kind: literal("sources"),
|
|
10372
10620
|
sources: array(source)
|
|
10373
10621
|
})]);
|
|
@@ -10376,7 +10624,7 @@ var ports = {
|
|
|
10376
10624
|
inputs: array(union([input, group])),
|
|
10377
10625
|
outputs: array(union([port, group]))
|
|
10378
10626
|
};
|
|
10379
|
-
var
|
|
10627
|
+
var connectorCapabilitySchema = union([
|
|
10380
10628
|
strictObject({
|
|
10381
10629
|
kind: literal("connector"),
|
|
10382
10630
|
action: text,
|
|
@@ -10408,20 +10656,43 @@ var capability = union([
|
|
|
10408
10656
|
})).optional()
|
|
10409
10657
|
})
|
|
10410
10658
|
]);
|
|
10411
|
-
var
|
|
10659
|
+
var workflowCapabilitySchema = strictObject({
|
|
10660
|
+
kind: literal("workflow"),
|
|
10661
|
+
name: text,
|
|
10662
|
+
flowId: text,
|
|
10663
|
+
revisionId: text,
|
|
10664
|
+
inputs: array(port),
|
|
10665
|
+
outputs: array(port).nullable()
|
|
10666
|
+
});
|
|
10667
|
+
var capability = union([connectorCapabilitySchema, workflowCapabilitySchema]);
|
|
10668
|
+
var inline = object$1({
|
|
10412
10669
|
...ports,
|
|
10413
10670
|
name: text,
|
|
10414
10671
|
moduleId: text,
|
|
10415
10672
|
capabilities: array(capability).optional()
|
|
10416
10673
|
});
|
|
10417
|
-
var agentValue = union([object({
|
|
10674
|
+
var agentValue = union([object$1({
|
|
10418
10675
|
kind: literal("value"),
|
|
10419
10676
|
value: json
|
|
10420
|
-
}), object({
|
|
10677
|
+
}), object$1({
|
|
10421
10678
|
kind: literal("input"),
|
|
10422
10679
|
input: text
|
|
10423
10680
|
})]);
|
|
10424
|
-
var agentInput$1 = union([agentValue, object({ kind: literal("model") })]);
|
|
10681
|
+
var agentInput$1 = union([agentValue, object$1({ kind: literal("model") })]);
|
|
10682
|
+
var agentToolFields = {
|
|
10683
|
+
id: text,
|
|
10684
|
+
name: text,
|
|
10685
|
+
description: text,
|
|
10686
|
+
approval: boolean(),
|
|
10687
|
+
inputs: array(input.extend({ source: agentInput$1 }))
|
|
10688
|
+
};
|
|
10689
|
+
var connectorAgentToolSchema = object$1({
|
|
10690
|
+
...agentToolFields,
|
|
10691
|
+
kind: literal("connector").optional(),
|
|
10692
|
+
action: text,
|
|
10693
|
+
connectionId: actionConnection.optional()
|
|
10694
|
+
});
|
|
10695
|
+
var workflowAgentToolSchema = workflowCapabilitySchema.extend(agentToolFields);
|
|
10425
10696
|
var decisionQuestion = discriminatedUnion("type", [
|
|
10426
10697
|
strictObject({
|
|
10427
10698
|
name: text,
|
|
@@ -10448,24 +10719,24 @@ var decisionQuestion = discriminatedUnion("type", [
|
|
|
10448
10719
|
criteria: strings
|
|
10449
10720
|
})
|
|
10450
10721
|
]);
|
|
10451
|
-
var managedFields = object({
|
|
10722
|
+
var managedFields = object$1({
|
|
10452
10723
|
...ports,
|
|
10453
10724
|
name: text,
|
|
10454
10725
|
executor: union([
|
|
10455
|
-
object({
|
|
10726
|
+
object$1({
|
|
10456
10727
|
kind: literal("connector"),
|
|
10457
10728
|
action: text,
|
|
10458
10729
|
connectionId: actionConnection.optional(),
|
|
10459
10730
|
outputMode: literal("value").optional()
|
|
10460
10731
|
}),
|
|
10461
|
-
object({
|
|
10732
|
+
object$1({
|
|
10462
10733
|
kind: literal("openapi"),
|
|
10463
10734
|
sourceUrl: text,
|
|
10464
10735
|
method: text,
|
|
10465
10736
|
path: text,
|
|
10466
10737
|
serverUrl: text,
|
|
10467
10738
|
document: json,
|
|
10468
|
-
auth: array(object({
|
|
10739
|
+
auth: array(object$1({
|
|
10469
10740
|
id: text,
|
|
10470
10741
|
type: _enum([
|
|
10471
10742
|
"bearer",
|
|
@@ -10480,26 +10751,18 @@ var managedFields = object({
|
|
|
10480
10751
|
kind: literal("decision"),
|
|
10481
10752
|
questions: array(decisionQuestion)
|
|
10482
10753
|
}),
|
|
10483
|
-
object({
|
|
10754
|
+
object$1({
|
|
10484
10755
|
kind: literal("llm"),
|
|
10485
10756
|
mode: _enum(["chat", "json"])
|
|
10486
10757
|
}),
|
|
10487
|
-
object({
|
|
10758
|
+
object$1({
|
|
10488
10759
|
kind: literal("agent"),
|
|
10489
10760
|
code: boolean().optional(),
|
|
10490
10761
|
model: text,
|
|
10491
10762
|
prompt: text,
|
|
10492
10763
|
maxRounds: number(),
|
|
10493
|
-
tools: array(
|
|
10494
|
-
|
|
10495
|
-
name: text,
|
|
10496
|
-
description: text,
|
|
10497
|
-
action: text,
|
|
10498
|
-
connectionId: actionConnection.optional(),
|
|
10499
|
-
approval: boolean(),
|
|
10500
|
-
inputs: array(input.extend({ source: agentInput$1 }))
|
|
10501
|
-
})),
|
|
10502
|
-
notification: object({
|
|
10764
|
+
tools: array(union([workflowAgentToolSchema, connectorAgentToolSchema])),
|
|
10765
|
+
notification: object$1({
|
|
10503
10766
|
action: text,
|
|
10504
10767
|
connectionId: actionConnection.optional(),
|
|
10505
10768
|
inputDefinitions: array(input),
|
|
@@ -10511,24 +10774,25 @@ var managedFields = object({
|
|
|
10511
10774
|
kind: literal("workflow"),
|
|
10512
10775
|
flowId: text,
|
|
10513
10776
|
revisionId: text
|
|
10514
|
-
})
|
|
10777
|
+
}),
|
|
10778
|
+
httpRequestExecutorSchema
|
|
10515
10779
|
])
|
|
10516
10780
|
});
|
|
10517
10781
|
var managed = managedFields.transform(limitDecisionTask);
|
|
10518
|
-
var operand = union([object({
|
|
10782
|
+
var operand = union([object$1({
|
|
10519
10783
|
kind: literal("value"),
|
|
10520
10784
|
value: json.optional(),
|
|
10521
10785
|
jsonSchema: json.optional()
|
|
10522
|
-
}), object({
|
|
10786
|
+
}), object$1({
|
|
10523
10787
|
kind: literal("source"),
|
|
10524
10788
|
source
|
|
10525
10789
|
})]);
|
|
10526
10790
|
var condition = {
|
|
10527
10791
|
matchMode: _enum(["first", "all"]),
|
|
10528
|
-
cases: array(object({
|
|
10792
|
+
cases: array(object$1({
|
|
10529
10793
|
description: text.optional(),
|
|
10530
10794
|
output: text,
|
|
10531
|
-
groups: array(object({ expressions: array(object({
|
|
10795
|
+
groups: array(object$1({ expressions: array(object$1({
|
|
10532
10796
|
left: operand,
|
|
10533
10797
|
operator: _enum([
|
|
10534
10798
|
"!=",
|
|
@@ -10560,7 +10824,7 @@ var wait = {
|
|
|
10560
10824
|
inputDefinitions: array(input),
|
|
10561
10825
|
prompt: text
|
|
10562
10826
|
};
|
|
10563
|
-
var webhookOptions = object({
|
|
10827
|
+
var webhookOptions = object$1({
|
|
10564
10828
|
allowedMethods: never().optional(),
|
|
10565
10829
|
allowedOrigins: strings.optional(),
|
|
10566
10830
|
noResponseBody: never().optional(),
|
|
@@ -10598,8 +10862,8 @@ var definition = {
|
|
|
10598
10862
|
outputs: array(port).refine((definitions) => new Set(definitions.map((output) => output.handle)).size === definitions.length, "Duplicate Trigger output handle."),
|
|
10599
10863
|
provider: text
|
|
10600
10864
|
};
|
|
10601
|
-
var endpoint = object({
|
|
10602
|
-
body: object({
|
|
10865
|
+
var endpoint = object$1({
|
|
10866
|
+
body: object$1({
|
|
10603
10867
|
allowArray: boolean(),
|
|
10604
10868
|
allowEmpty: boolean(),
|
|
10605
10869
|
formats: array(_enum([
|
|
@@ -10648,19 +10912,19 @@ var node = union([
|
|
|
10648
10912
|
outputDefs: array(port.strict()),
|
|
10649
10913
|
outputMappings: inputs
|
|
10650
10914
|
}).omit({ inputs: true }),
|
|
10651
|
-
object({
|
|
10915
|
+
object$1({
|
|
10652
10916
|
...base,
|
|
10653
10917
|
inputs: record$1(text, never()),
|
|
10654
10918
|
kind: literal("condition"),
|
|
10655
10919
|
...condition
|
|
10656
10920
|
}),
|
|
10657
|
-
object({
|
|
10921
|
+
object$1({
|
|
10658
10922
|
...base,
|
|
10659
10923
|
inputs: unknown().transform(() => ({})).default({}),
|
|
10660
10924
|
kind: literal("value"),
|
|
10661
10925
|
values: array(input)
|
|
10662
10926
|
}),
|
|
10663
|
-
object({
|
|
10927
|
+
object$1({
|
|
10664
10928
|
...base,
|
|
10665
10929
|
kind: literal("task"),
|
|
10666
10930
|
task: union([inline, managed]),
|
|
@@ -10677,7 +10941,7 @@ var node = union([
|
|
|
10677
10941
|
...wait,
|
|
10678
10942
|
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
10679
10943
|
}).omit({ timeoutMs: true }),
|
|
10680
|
-
object({
|
|
10944
|
+
object$1({
|
|
10681
10945
|
...trigger,
|
|
10682
10946
|
kind: literal("manual")
|
|
10683
10947
|
}),
|
|
@@ -10691,44 +10955,60 @@ var node = union([
|
|
|
10691
10955
|
kind: literal("error"),
|
|
10692
10956
|
sourceFlowIds: sourceFlowIds.optional()
|
|
10693
10957
|
}),
|
|
10694
|
-
object({
|
|
10958
|
+
object$1({
|
|
10695
10959
|
...trigger,
|
|
10696
10960
|
kind: literal("webhook"),
|
|
10697
10961
|
...webhook
|
|
10698
10962
|
}),
|
|
10699
|
-
object({
|
|
10963
|
+
object$1({
|
|
10700
10964
|
...trigger,
|
|
10701
10965
|
kind: literal("cron"),
|
|
10702
10966
|
cronTimes: triggerScheduleSchema
|
|
10703
10967
|
}),
|
|
10704
|
-
object({
|
|
10968
|
+
object$1({
|
|
10705
10969
|
...trigger,
|
|
10706
10970
|
kind: literal("poll"),
|
|
10707
10971
|
connectionId: text.min(1).optional(),
|
|
10708
10972
|
config: record$1(text, fixedInput),
|
|
10709
|
-
definition: object({
|
|
10973
|
+
definition: object$1({
|
|
10710
10974
|
...definition,
|
|
10711
10975
|
type: literal("poll")
|
|
10712
10976
|
}),
|
|
10713
10977
|
pollTimes: triggerScheduleSchema
|
|
10714
10978
|
}),
|
|
10715
|
-
object({
|
|
10979
|
+
object$1({
|
|
10716
10980
|
...trigger,
|
|
10717
10981
|
kind: literal("integration"),
|
|
10718
10982
|
connectionId: text.min(1).optional(),
|
|
10719
10983
|
config: record$1(text, fixedInput),
|
|
10720
|
-
definition: object({
|
|
10984
|
+
definition: object$1({
|
|
10721
10985
|
...definition,
|
|
10722
10986
|
type: literal("integration"),
|
|
10723
10987
|
endpoint
|
|
10724
10988
|
})
|
|
10725
10989
|
})
|
|
10726
10990
|
]);
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
|
|
10991
|
+
/** Configuration schemas shared by the node authoring boundary. */
|
|
10992
|
+
var authoringDefinitionSchemas = {
|
|
10993
|
+
input,
|
|
10994
|
+
port,
|
|
10995
|
+
ports,
|
|
10996
|
+
condition: strictObject(condition),
|
|
10997
|
+
wait: strictObject(wait),
|
|
10998
|
+
waitAutoContinue: waitAutoContinueSchema,
|
|
10999
|
+
webhook: strictObject(webhook),
|
|
11000
|
+
schedule: triggerScheduleSchema,
|
|
11001
|
+
capabilities: array(capability),
|
|
11002
|
+
connector: managedFields.shape.executor.options[0].omit({ kind: true }).strict(),
|
|
11003
|
+
openapi: managedFields.shape.executor.options[1].omit({ kind: true }).strict(),
|
|
11004
|
+
decision: managedFields.shape.executor.options[2].omit({ kind: true }).strict(),
|
|
11005
|
+
llm: managedFields.shape.executor.options[3].omit({ kind: true }).strict(),
|
|
11006
|
+
agent: managedFields.shape.executor.options[4].omit({
|
|
11007
|
+
kind: true,
|
|
11008
|
+
notification: true
|
|
11009
|
+
}).strict()
|
|
11010
|
+
};
|
|
11011
|
+
var edge = object$1({
|
|
10732
11012
|
source: text,
|
|
10733
11013
|
target: text,
|
|
10734
11014
|
sourceHandle: text.optional()
|
|
@@ -10737,24 +11017,24 @@ var at = {
|
|
|
10737
11017
|
nodeId: text,
|
|
10738
11018
|
target: never().optional()
|
|
10739
11019
|
};
|
|
10740
|
-
var graph = object({
|
|
11020
|
+
var graph = object$1({
|
|
10741
11021
|
nodes: record$1(text, node),
|
|
10742
11022
|
edges: array(edge).default([])
|
|
10743
11023
|
});
|
|
10744
|
-
var binding = object({
|
|
11024
|
+
var binding = object$1({
|
|
10745
11025
|
kind: literal("variable"),
|
|
10746
11026
|
target: text
|
|
10747
11027
|
});
|
|
10748
|
-
var module = object({
|
|
11028
|
+
var module = object$1({
|
|
10749
11029
|
name: text,
|
|
10750
11030
|
imports: strings,
|
|
10751
11031
|
source: text
|
|
10752
11032
|
});
|
|
10753
|
-
var document = preprocess(normalizeDocument, object({
|
|
11033
|
+
var document = preprocess(normalizeDocument, object$1({
|
|
10754
11034
|
bindings: record$1(text, binding),
|
|
10755
11035
|
graph
|
|
10756
11036
|
}));
|
|
10757
|
-
object({
|
|
11037
|
+
object$1({
|
|
10758
11038
|
modelVersion: union([
|
|
10759
11039
|
literal(2),
|
|
10760
11040
|
literal(4),
|
|
@@ -10763,7 +11043,8 @@ object({
|
|
|
10763
11043
|
literal(7),
|
|
10764
11044
|
literal(8),
|
|
10765
11045
|
literal(9),
|
|
10766
|
-
literal(10)
|
|
11046
|
+
literal(10),
|
|
11047
|
+
literal(11)
|
|
10767
11048
|
]),
|
|
10768
11049
|
document,
|
|
10769
11050
|
modules: record$1(text, module)
|
|
@@ -10824,21 +11105,21 @@ var shapes = {
|
|
|
10824
11105
|
},
|
|
10825
11106
|
"graph.node.delete": at,
|
|
10826
11107
|
"graph.node.field.set": union([
|
|
10827
|
-
object({
|
|
11108
|
+
object$1({
|
|
10828
11109
|
...at,
|
|
10829
11110
|
kind: literal("graph.node.field.set"),
|
|
10830
11111
|
field: literal("retry"),
|
|
10831
11112
|
before: retryConfigurationSchema.optional(),
|
|
10832
11113
|
value: retryConfigurationSchema.optional()
|
|
10833
11114
|
}),
|
|
10834
|
-
object({
|
|
11115
|
+
object$1({
|
|
10835
11116
|
...at,
|
|
10836
11117
|
kind: literal("graph.node.field.set"),
|
|
10837
11118
|
field: literal("connectionId"),
|
|
10838
11119
|
before: text.min(1).optional(),
|
|
10839
11120
|
value: text.min(1).optional()
|
|
10840
11121
|
}),
|
|
10841
|
-
object({
|
|
11122
|
+
object$1({
|
|
10842
11123
|
...at,
|
|
10843
11124
|
kind: literal("graph.node.field.set"),
|
|
10844
11125
|
field: _enum([
|
|
@@ -10850,14 +11131,14 @@ var shapes = {
|
|
|
10850
11131
|
before: text.optional(),
|
|
10851
11132
|
value: text.optional()
|
|
10852
11133
|
}),
|
|
10853
|
-
object({
|
|
11134
|
+
object$1({
|
|
10854
11135
|
...at,
|
|
10855
11136
|
kind: literal("graph.node.field.set"),
|
|
10856
11137
|
field: literal("maxExecutions"),
|
|
10857
11138
|
before: number().int().positive().max(Number.MAX_SAFE_INTEGER).optional(),
|
|
10858
11139
|
value: number().int().positive().max(Number.MAX_SAFE_INTEGER).optional()
|
|
10859
11140
|
}),
|
|
10860
|
-
object({
|
|
11141
|
+
object$1({
|
|
10861
11142
|
...at,
|
|
10862
11143
|
kind: literal("graph.node.field.set"),
|
|
10863
11144
|
field: literal("timeoutMs"),
|
|
@@ -10878,8 +11159,8 @@ var shapes = {
|
|
|
10878
11159
|
},
|
|
10879
11160
|
"graph.node.condition.set": {
|
|
10880
11161
|
...at,
|
|
10881
|
-
before: object(condition),
|
|
10882
|
-
value: object(condition)
|
|
11162
|
+
before: object$1(condition),
|
|
11163
|
+
value: object$1(condition)
|
|
10883
11164
|
},
|
|
10884
11165
|
"graph.node.values.set": {
|
|
10885
11166
|
...at,
|
|
@@ -10899,13 +11180,13 @@ var shapes = {
|
|
|
10899
11180
|
},
|
|
10900
11181
|
"graph.node.webhook.set": {
|
|
10901
11182
|
...at,
|
|
10902
|
-
before: object(webhook),
|
|
10903
|
-
value: object(webhook)
|
|
11183
|
+
before: object$1(webhook),
|
|
11184
|
+
value: object$1(webhook)
|
|
10904
11185
|
},
|
|
10905
11186
|
"graph.node.task.ports.set": {
|
|
10906
11187
|
...at,
|
|
10907
|
-
before: object(ports),
|
|
10908
|
-
value: object(ports)
|
|
11188
|
+
before: object$1(ports),
|
|
11189
|
+
value: object$1(ports)
|
|
10909
11190
|
},
|
|
10910
11191
|
"graph.node.task.name.set": {
|
|
10911
11192
|
...at,
|
|
@@ -10951,7 +11232,7 @@ var shapes = {
|
|
|
10951
11232
|
value: union([inline, managed])
|
|
10952
11233
|
}
|
|
10953
11234
|
};
|
|
10954
|
-
array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, shape instanceof ZodType ? shape : object({
|
|
11235
|
+
array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, shape instanceof ZodType ? shape : object$1({
|
|
10955
11236
|
kind: literal(kind),
|
|
10956
11237
|
...shape
|
|
10957
11238
|
})])).values()])).min(1);
|
|
@@ -11125,6 +11406,24 @@ function validVariableName(value) {
|
|
|
11125
11406
|
function portsByHandle(ports) {
|
|
11126
11407
|
return Object.fromEntries(ports.flatMap((port) => "handle" in port ? [[port.handle, port]] : []));
|
|
11127
11408
|
}
|
|
11409
|
+
var workflowToolNamePattern = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
|
|
11410
|
+
function workflowToolNameIssue(name, otherNames = []) {
|
|
11411
|
+
if (!workflowToolNamePattern.test(name)) return "invalid";
|
|
11412
|
+
for (const other of otherNames) if (other == name) return "duplicate";
|
|
11413
|
+
}
|
|
11414
|
+
function decodeTaskCapabilities(value) {
|
|
11415
|
+
if (!Array.isArray(value)) throw new TypeError("Task capabilities must be an array.");
|
|
11416
|
+
const parsed = authoringDefinitionSchemas.capabilities.parse(value);
|
|
11417
|
+
const connectors = decodeConnectorCapabilities(parsed.filter((item) => item.kind == "connector"));
|
|
11418
|
+
const names = /* @__PURE__ */ new Set();
|
|
11419
|
+
for (const item of parsed) {
|
|
11420
|
+
if (item.kind != "workflow") continue;
|
|
11421
|
+
if (workflowToolNameIssue(item.name, names)) throw new TypeError("Workflow tool names must be unique provider-compatible names.");
|
|
11422
|
+
names.add(item.name);
|
|
11423
|
+
}
|
|
11424
|
+
let connectorIndex = 0;
|
|
11425
|
+
return parsed.map((item) => item.kind == "connector" ? connectors[connectorIndex++] : item);
|
|
11426
|
+
}
|
|
11128
11427
|
function decodeConnectorCapabilities(value) {
|
|
11129
11428
|
if (!Array.isArray(value)) throw new TypeError("Connector capabilities must be an array.");
|
|
11130
11429
|
if (value.length == 0) return [];
|
|
@@ -11289,7 +11588,7 @@ function connectionUsage(document) {
|
|
|
11289
11588
|
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);
|
|
11290
11589
|
}
|
|
11291
11590
|
if (task?.executor.kind == "agent") {
|
|
11292
|
-
for (const tool of task.executor.tools) add("agent", tool.action, tool.connectionId);
|
|
11591
|
+
for (const tool of task.executor.tools) if (tool.kind != "workflow") add("agent", tool.action, tool.connectionId);
|
|
11293
11592
|
const notification = task.executor.notification;
|
|
11294
11593
|
if (notification != null) add("notification", notification.action, notification.connectionId);
|
|
11295
11594
|
}
|
|
@@ -11344,6 +11643,7 @@ function clearNodeConnections(graph, connectionId) {
|
|
|
11344
11643
|
return [id, node];
|
|
11345
11644
|
}
|
|
11346
11645
|
const capabilities = node.task.capabilities?.map((capability) => {
|
|
11646
|
+
if (capability.kind == "workflow") return capability;
|
|
11347
11647
|
if (!("mode" in capability)) {
|
|
11348
11648
|
if ("action" in capability) {
|
|
11349
11649
|
const { connectionId: selected, ...rest } = capability;
|
|
@@ -11589,9 +11889,11 @@ function normalizeTriggerOutputs(trigger, outputs) {
|
|
|
11589
11889
|
}
|
|
11590
11890
|
//#endregion
|
|
11591
11891
|
//#region src/execution/common/engineContract.ts
|
|
11592
|
-
var currentEngineContract = "open-flow-engine/
|
|
11593
|
-
var nodejsEngineContract = "open-flow-engine/
|
|
11892
|
+
var currentEngineContract = "open-flow-engine/v8";
|
|
11893
|
+
var nodejsEngineContract = "open-flow-engine/v8/nodejs-compat-v1";
|
|
11594
11894
|
var currentContract = {
|
|
11895
|
+
workflowTools: true,
|
|
11896
|
+
httpRequests: true,
|
|
11595
11897
|
waitAutoContinue: true,
|
|
11596
11898
|
webhookResponses: true,
|
|
11597
11899
|
platformExports: /* @__PURE__ */ new Set(["engineContract", "identity"]),
|
|
@@ -11633,10 +11935,18 @@ export function identity(value) { return value }
|
|
|
11633
11935
|
`
|
|
11634
11936
|
};
|
|
11635
11937
|
function findEngineContract(contract) {
|
|
11636
|
-
if (contract == "open-flow-engine/
|
|
11637
|
-
if (contract == "open-flow-engine/
|
|
11938
|
+
if (contract == "open-flow-engine/v8") return currentContract;
|
|
11939
|
+
if (contract == "open-flow-engine/v8/nodejs-compat-v1") return nodejsContract;
|
|
11940
|
+
if (contract == "open-flow-engine/v7" || contract == "open-flow-engine/v7/nodejs-compat-v1") return {
|
|
11941
|
+
...contract.endsWith("/nodejs-compat-v1") ? nodejsContract : currentContract,
|
|
11942
|
+
workflowTools: false,
|
|
11943
|
+
httpRequests: false,
|
|
11944
|
+
platformSource: `export const engineContract = ${JSON.stringify(contract)}\nexport function identity(value) { return value }\n`
|
|
11945
|
+
};
|
|
11638
11946
|
if (contract == "open-flow-engine/v6" || contract == "open-flow-engine/v6/nodejs-compat-v1") return {
|
|
11639
11947
|
...contract == "open-flow-engine/v6" ? currentContract : nodejsContract,
|
|
11948
|
+
workflowTools: false,
|
|
11949
|
+
httpRequests: false,
|
|
11640
11950
|
waitAutoContinue: false,
|
|
11641
11951
|
webhookResponses: false,
|
|
11642
11952
|
platformSource: `export const engineContract = ${JSON.stringify(contract)}
|
|
@@ -11839,7 +12149,7 @@ function agentConfigIssues(task) {
|
|
|
11839
12149
|
ids.add(tool.id);
|
|
11840
12150
|
names.add(tool.name);
|
|
11841
12151
|
if (tool.description.trim().length == 0) issues.push(`Tool ${tool.name} requires a description.`);
|
|
11842
|
-
if (!/^[A-Za-z0-9_-]+\.[A-Za-z0-9_.-]+$/.test(tool.action)) issues.push(`Tool ${tool.name} has an invalid Action or Connection.`);
|
|
12152
|
+
if (tool.kind != "workflow" && !/^[A-Za-z0-9_-]+\.[A-Za-z0-9_.-]+$/.test(tool.action)) issues.push(`Tool ${tool.name} has an invalid Action or Connection.`);
|
|
11843
12153
|
const fields = /* @__PURE__ */ new Set();
|
|
11844
12154
|
for (const port of tool.inputs) {
|
|
11845
12155
|
if (port.handle.length == 0 || fields.has(port.handle)) issues.push(`Tool ${tool.name} has an empty or duplicate input.`);
|
|
@@ -12324,7 +12634,7 @@ function webhookResponseDiagnostics(graph, triggerId, path = `/document/graph/no
|
|
|
12324
12634
|
if (headersSource == null) for (const [headers, location] of [[options.responseHeaders, `${path}/options/responseHeaders`], [headerOutputs, headersPath]]) {
|
|
12325
12635
|
const names = [];
|
|
12326
12636
|
for (const name of Object.keys(headers ?? {})) {
|
|
12327
|
-
if (
|
|
12637
|
+
if (httpHeaderNameIssue(name, names) != null) diagnostics.push(graphDiagnostic("trigger.webhook-response-header-name", "Use valid, unique HTTP header names.", location));
|
|
12328
12638
|
names.push(name);
|
|
12329
12639
|
}
|
|
12330
12640
|
}
|
|
@@ -24530,7 +24840,7 @@ function flowResourceReferences(content) {
|
|
|
24530
24840
|
});
|
|
24531
24841
|
}
|
|
24532
24842
|
return {
|
|
24533
|
-
calledFlowIds: [...new Set(Object.values(content.document.graph.nodes).flatMap((node) => node.
|
|
24843
|
+
calledFlowIds: [...new Set(Object.values(content.document.graph.nodes).flatMap((node) => nodeWorkflowReferences(node).map(({ target }) => target.flowId).filter(Boolean)))].toSorted(),
|
|
24534
24844
|
variableNames: [...new Set(Object.values(variableBindings(content, flowDependencies(content).bindings)))].toSorted(),
|
|
24535
24845
|
connections: [...connections].toSorted(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([, value]) => value),
|
|
24536
24846
|
errorSourceFlowIds: [...new Set(Object.values(content.document.graph.nodes).flatMap((node) => node.kind == "error" ? node.sourceFlowIds ?? [] : []))].toSorted()
|
|
@@ -24599,7 +24909,7 @@ async function validateFlow(revision, engine) {
|
|
|
24599
24909
|
});
|
|
24600
24910
|
}
|
|
24601
24911
|
try {
|
|
24602
|
-
|
|
24912
|
+
decodeTaskCapabilities(node.task.capabilities === void 0 ? [] : node.task.capabilities);
|
|
24603
24913
|
} catch {
|
|
24604
24914
|
checked.diagnostics.push({
|
|
24605
24915
|
code: "task.capability-incomplete",
|
|
@@ -24628,12 +24938,47 @@ async function validateFlow(revision, engine) {
|
|
|
24628
24938
|
message,
|
|
24629
24939
|
path: `/document/graph/nodes/${nodeId}/task/executor`
|
|
24630
24940
|
});
|
|
24631
|
-
if (task.executor.kind == "
|
|
24632
|
-
const
|
|
24941
|
+
if (task.executor.kind == "http-request") {
|
|
24942
|
+
for (const issue of httpRequestIssues(task.executor)) checked.diagnostics.push({
|
|
24943
|
+
code: "http-request.config-invalid",
|
|
24944
|
+
column: 0,
|
|
24945
|
+
line: 1,
|
|
24946
|
+
message: issue.message,
|
|
24947
|
+
path: `/document/graph/nodes/${nodeId}/task/executor/${issue.field}`
|
|
24948
|
+
});
|
|
24949
|
+
if (node.inputs.url?.kind == "value") try {
|
|
24950
|
+
httpRequestUrl(node.inputs.url.value);
|
|
24951
|
+
} catch {
|
|
24952
|
+
checked.diagnostics.push({
|
|
24953
|
+
code: "http-request.url-invalid",
|
|
24954
|
+
column: 0,
|
|
24955
|
+
line: 1,
|
|
24956
|
+
message: "Enter an HTTP(S) URL without embedded credentials.",
|
|
24957
|
+
path: `/document/graph/nodes/${nodeId}/inputs/url`
|
|
24958
|
+
});
|
|
24959
|
+
}
|
|
24960
|
+
if (task.executor.bodyFormat != "none" && (node.inputs.body == null || node.inputs.body.kind == "unset")) checked.diagnostics.push({
|
|
24961
|
+
code: "http-request.body-required",
|
|
24962
|
+
column: 0,
|
|
24963
|
+
line: 1,
|
|
24964
|
+
message: "Set or bind the request body; JSON null is an explicit value.",
|
|
24965
|
+
path: `/document/graph/nodes/${nodeId}/inputs/body`
|
|
24966
|
+
});
|
|
24967
|
+
const expected = httpRequestTask(task.executor);
|
|
24968
|
+
if (!dequal(httpPortContracts(task.inputs), httpPortContracts(expected.inputs)) || !dequal(httpPortContracts(task.outputs), httpPortContracts(expected.outputs))) checked.diagnostics.push({
|
|
24969
|
+
code: "http-request.ports-invalid",
|
|
24970
|
+
column: 0,
|
|
24971
|
+
line: 1,
|
|
24972
|
+
message: "HTTP Request ports must match its configuration.",
|
|
24973
|
+
path: `/document/graph/nodes/${nodeId}/task`
|
|
24974
|
+
});
|
|
24975
|
+
}
|
|
24976
|
+
if (task.executor.kind == "openapi" || task.executor.kind == "http-request") {
|
|
24977
|
+
const handles = task.executor.kind == "openapi" ? authHandles(task.executor.auth) : httpAuthHandles(task.executor);
|
|
24633
24978
|
for (const handle of handles) {
|
|
24634
24979
|
const mapping = node.inputs[handle];
|
|
24635
24980
|
if (mapping?.kind != "sources" || mapping.sources.length == 0) checked.diagnostics.push({
|
|
24636
|
-
code:
|
|
24981
|
+
code: `${task.executor.kind}.auth-source`,
|
|
24637
24982
|
column: 0,
|
|
24638
24983
|
line: 1,
|
|
24639
24984
|
message: "Authentication requires a deployment variable or upstream output.",
|
|
@@ -24719,9 +25064,16 @@ function runRevision(revision, triggerId) {
|
|
|
24719
25064
|
}
|
|
24720
25065
|
};
|
|
24721
25066
|
}
|
|
25067
|
+
var httpPortContracts = (ports) => ports.filter((port) => "handle" in port).map(({ handle, jsonSchema, nullable }) => ({
|
|
25068
|
+
handle,
|
|
25069
|
+
jsonSchema,
|
|
25070
|
+
nullable
|
|
25071
|
+
})).toSorted((a, b) => a.handle.localeCompare(b.handle));
|
|
24722
25072
|
async function prepareFlow(revision, engineContract, triggerId) {
|
|
24723
25073
|
const engine = findEngineContract(engineContract);
|
|
24724
25074
|
if (engine == null) return { kind: "engine-unsupported" };
|
|
25075
|
+
if (!engine.httpRequests && Object.values(revision.document.graph.nodes).some((node) => node.kind == "task" && "executor" in node.task && node.task.executor.kind == "http-request")) return { kind: "engine-unsupported" };
|
|
25076
|
+
if (!engine.workflowTools && Object.values(revision.document.graph.nodes).some((node) => nodeWorkflowReferences(node).some((ref) => ref.tool != null))) return { kind: "engine-unsupported" };
|
|
24725
25077
|
if (triggerId != null) {
|
|
24726
25078
|
const trigger = revision.document.graph.nodes[triggerId];
|
|
24727
25079
|
if (trigger == null || !isTriggerNode(trigger)) return {
|
|
@@ -24780,7 +25132,7 @@ function agentActions(flow) {
|
|
|
24780
25132
|
const task = node.task;
|
|
24781
25133
|
if (task.executor.kind != "agent") return [];
|
|
24782
25134
|
const notice = task.executor.notification;
|
|
24783
|
-
return [...task.executor.tools, ...notice != null ? [notice] : []].filter((tool) => tool.connectionId !== "").map((tool) => ({
|
|
25135
|
+
return [...task.executor.tools.filter((tool) => tool.kind != "workflow"), ...notice != null ? [notice] : []].filter((tool) => tool.connectionId !== "").map((tool) => ({
|
|
24784
25136
|
kind: "connector",
|
|
24785
25137
|
action: tool.action,
|
|
24786
25138
|
connections: tool.connectionId == null ? [] : [{ connectionId: tool.connectionId }]
|
|
@@ -24788,7 +25140,7 @@ function agentActions(flow) {
|
|
|
24788
25140
|
});
|
|
24789
25141
|
}
|
|
24790
25142
|
function codeActions(flow) {
|
|
24791
|
-
return Object.values(flow.graph.nodes).flatMap((node) => node.kind == "task" && "moduleId" in node.task ? node.task.capabilities ?? [] : []);
|
|
25143
|
+
return Object.values(flow.graph.nodes).flatMap((node) => node.kind == "task" && "moduleId" in node.task ? (node.task.capabilities ?? []).filter((item) => item.kind == "connector") : []);
|
|
24792
25144
|
}
|
|
24793
25145
|
//#endregion
|
|
24794
25146
|
export { agentActions, agentInput, agentToolInput, agentToolSchema, availableOutputs, codeActions, connectionUsage, createRuntimeProgram, encodeFlowClosure, flowClosure, flowDependencies, flowResourceReferences, graphOrder, matchesSchema, matchesTriggerOutputs, nodeInputPorts, normalizeRunTrigger, normalizeTriggerOutputs, prepareFlow, removeConnectionUsage, renderPrompt, schemaValidationErrors, triggerOutputDefinitions, triggerOutputPorts, validRunTrigger, validateFlow, validateFlowInputs, validateModules, variableBindings, variableInputCompatible };
|