@flowrunner/cli 0.1.19-dev.1 → 0.1.19-dev.2
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/ai-docs/instructions/service-code-format/01-service-structure.md +1 -1
- package/ai-docs/instructions/service-code-format/05-dictionaries.md +1 -1
- package/ai-docs/instructions/service-code-format/11-output-model.md +2 -5
- package/ai-docs/instructions/service-code-format/13-runtime-contracts.md +2 -3
- package/ai-docs/instructions/service-code-format/README.md +2 -2
- package/dist/cli.js +335 -926
- package/dist/cli.js.map +4 -4
- package/dist/index.js +368 -956
- package/dist/index.js.map +4 -4
- package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/context/execution-context.d.ts +2 -2
- package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/extension.d.ts +3 -3
- package/dist/types/flow-extension-runner/src/global.d.ts +6 -18
- package/dist/types/flow-extension-runner/src/index.d.ts +39 -13
- package/dist/types/flow-extension-runner/src/{v2/model → model}/field-mapper.d.ts +1 -1
- package/dist/types/flow-extension-runner/src/{v2/model → model}/model-types.d.ts +11 -1
- package/dist/types/flow-extension-runner/src/{v2/model → model}/params-model.d.ts +1 -1
- package/dist/types/flow-extension-runner/src/{v2/params → params}/config-params.d.ts +1 -1
- package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/schema/messages.d.ts +1 -1
- package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/schema/normalize.d.ts +1 -1
- package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/parse.d.ts +1 -1
- package/dist/types/flow-extension-runner/src/{v2/params → params}/types.d.ts +1 -1
- package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/registry.d.ts +2 -0
- package/dist/types/flow-extension-runner/src/{v2/types.d.ts → types.d.ts} +1 -1
- package/dist/types/packages/cli/src/operations/deploy/discover-services.d.ts +2 -4
- package/dist/types/shared/src/constants/activity-log.d.ts +248 -2
- package/dist/types/shared/src/constants/error-codes.d.ts +6 -0
- package/dist/types/shared/src/constants/index.d.ts +1 -0
- package/dist/types/shared/src/constants/notification-types.d.ts +309 -0
- package/dist/types/shared/src/constants/panic-mode.d.ts +17 -0
- package/dist/types/shared/src/constants/shared-extensions.d.ts +10 -0
- package/dist/types/shared/src/errors/index.d.ts +1 -0
- package/dist/types/shared/src/errors/secrets.d.ts +16 -0
- package/dist/types/shared/src/scheme/access-keys/dto.d.ts +35 -13
- package/dist/types/shared/src/scheme/api-keys/dto.d.ts +29 -4
- package/dist/types/shared/src/scheme/flowrunner/custom-elements.d.ts +0 -16
- package/dist/types/shared/src/scheme/flowrunner/index.d.ts +1 -0
- package/dist/types/shared/src/scheme/flowrunner/java.dto.d.ts +26 -0
- package/dist/types/shared/src/scheme/flowrunner/workspace-dashboard.dto.d.ts +207 -0
- package/dist/types/shared/src/scheme/integration-connection/dto.d.ts +22 -0
- package/dist/types/shared/src/scheme/notifications/dto.d.ts +10 -0
- package/dist/types/shared/src/scheme/notifications/rest.d.ts +20 -0
- package/dist/types/shared/src/scheme/remote-mcp-server/dto.d.ts +153 -29
- package/dist/types/shared/src/scheme/shared-extensions/base.d.ts +0 -4
- package/dist/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +0 -24
- package/dist/types/shared/src/scheme/shared-extensions/extension.d.ts +0 -18
- package/dist/types/shared/src/scheme/shared-extensions/flow-extensions.d.ts +0 -3
- package/dist/types/shared/src/scheme/shared-extensions/index.d.ts +1 -0
- package/dist/types/shared/src/scheme/shared-extensions/list.d.ts +0 -28
- package/dist/types/shared/src/scheme/shared-extensions/methods.d.ts +0 -1
- package/dist/types/shared/src/scheme/shared-extensions/resolve.d.ts +0 -12
- package/dist/types/shared/src/scheme/shared-extensions/search.d.ts +0 -8
- package/dist/types/shared/src/scheme/shared-extensions/usage-stats.d.ts +189 -0
- package/package.json +1 -4
- package/project-files/sandbox/files-mock.js +3 -5
- package/project-files/sandbox/service.js +10 -11
- package/runtime/index.js +178 -863
- package/runtime/index.js.map +4 -4
- package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/context/execution-context.d.ts +2 -2
- package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/extension.d.ts +3 -3
- package/runtime/types/flow-extension-runner/src/global.d.ts +6 -18
- package/runtime/types/flow-extension-runner/src/index.d.ts +39 -13
- package/runtime/types/flow-extension-runner/src/{v2/model → model}/field-mapper.d.ts +1 -1
- package/runtime/types/flow-extension-runner/src/{v2/model → model}/model-types.d.ts +11 -1
- package/runtime/types/flow-extension-runner/src/{v2/model → model}/params-model.d.ts +1 -1
- package/runtime/types/flow-extension-runner/src/{v2/params → params}/config-params.d.ts +1 -1
- package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/schema/messages.d.ts +1 -1
- package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/schema/normalize.d.ts +1 -1
- package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/parse.d.ts +1 -1
- package/runtime/types/flow-extension-runner/src/{v2/params → params}/types.d.ts +1 -1
- package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/registry.d.ts +2 -0
- package/runtime/types/flow-extension-runner/src/{v2/types.d.ts → types.d.ts} +1 -1
- package/runtime/types/packages/cli/src/runtime/index.d.ts +6 -5
- package/dist/types/flow-extension-runner/src/common/config.d.ts +0 -12
- package/dist/types/flow-extension-runner/src/common/context.d.ts +0 -6
- package/dist/types/flow-extension-runner/src/common/types.d.ts +0 -11
- package/dist/types/flow-extension-runner/src/v1/config.d.ts +0 -3
- package/dist/types/flow-extension-runner/src/v1/constants.d.ts +0 -4
- package/dist/types/flow-extension-runner/src/v1/index.d.ts +0 -11
- package/dist/types/flow-extension-runner/src/v1/namespace.d.ts +0 -9
- package/dist/types/flow-extension-runner/src/v1/service.d.ts +0 -29
- package/dist/types/flow-extension-runner/src/v1/types.d.ts +0 -13
- package/dist/types/flow-extension-runner/src/v2/index.d.ts +0 -39
- package/dist/types/jsdoc-parser/src/custom-type-defs/files.d.ts +0 -2
- package/dist/types/jsdoc-parser/src/index.d.ts +0 -2
- package/dist/types/jsdoc-parser/src/lib.d.ts +0 -42
- package/dist/types/jsdoc-parser/src/types.d.ts +0 -2
- package/runtime/types/flow-extension-runner/src/common/config.d.ts +0 -12
- package/runtime/types/flow-extension-runner/src/common/context.d.ts +0 -6
- package/runtime/types/flow-extension-runner/src/common/types.d.ts +0 -11
- package/runtime/types/flow-extension-runner/src/v1/config.d.ts +0 -3
- package/runtime/types/flow-extension-runner/src/v1/constants.d.ts +0 -4
- package/runtime/types/flow-extension-runner/src/v1/index.d.ts +0 -11
- package/runtime/types/flow-extension-runner/src/v1/namespace.d.ts +0 -9
- package/runtime/types/flow-extension-runner/src/v1/service.d.ts +0 -29
- package/runtime/types/flow-extension-runner/src/v1/types.d.ts +0 -13
- package/runtime/types/flow-extension-runner/src/v2/index.d.ts +0 -39
- package/runtime/types/jsdoc-parser/src/custom-type-defs/files.d.ts +0 -2
- package/runtime/types/jsdoc-parser/src/index.d.ts +0 -2
- package/runtime/types/jsdoc-parser/src/lib.d.ts +0 -42
- package/runtime/types/jsdoc-parser/src/types.d.ts +0 -2
- package/runtime/types/shared/src/constants/activity-log.d.ts +0 -1573
- package/runtime/types/shared/src/constants/ai-agent-tools.d.ts +0 -20
- package/runtime/types/shared/src/constants/ai.d.ts +0 -11
- package/runtime/types/shared/src/constants/api-keys.d.ts +0 -1
- package/runtime/types/shared/src/constants/app.d.ts +0 -57
- package/runtime/types/shared/src/constants/billing.d.ts +0 -16
- package/runtime/types/shared/src/constants/compliances.d.ts +0 -3
- package/runtime/types/shared/src/constants/data-types.d.ts +0 -26
- package/runtime/types/shared/src/constants/docs.d.ts +0 -6
- package/runtime/types/shared/src/constants/error-codes.d.ts +0 -20
- package/runtime/types/shared/src/constants/flow.d.ts +0 -12
- package/runtime/types/shared/src/constants/index.d.ts +0 -18
- package/runtime/types/shared/src/constants/knowledge-base.d.ts +0 -15
- package/runtime/types/shared/src/constants/notification-types.d.ts +0 -1234
- package/runtime/types/shared/src/constants/notifications.d.ts +0 -10
- package/runtime/types/shared/src/constants/oauth-connection-error.d.ts +0 -3
- package/runtime/types/shared/src/constants/patterns.d.ts +0 -28
- package/runtime/types/shared/src/constants/retry-policy.d.ts +0 -30
- package/runtime/types/shared/src/constants/severity.d.ts +0 -9
- package/runtime/types/shared/src/constants/shared-extensions-search.d.ts +0 -6
- package/runtime/types/shared/src/constants/shared-extensions.d.ts +0 -56
- package/runtime/types/shared/src/constants/zod.d.ts +0 -2
- package/runtime/types/shared/src/errors/api.d.ts +0 -15
- package/runtime/types/shared/src/errors/base.d.ts +0 -38
- package/runtime/types/shared/src/errors/common.d.ts +0 -39
- package/runtime/types/shared/src/errors/index.d.ts +0 -14
- package/runtime/types/shared/src/errors/k8s.d.ts +0 -14
- package/runtime/types/shared/src/errors/message.d.ts +0 -48
- package/runtime/types/shared/src/errors/oauth-connection.d.ts +0 -4
- package/runtime/types/shared/src/errors/open-search.d.ts +0 -4
- package/runtime/types/shared/src/errors/s3.d.ts +0 -11
- package/runtime/types/shared/src/extensions/zod.d.ts +0 -25
- package/runtime/types/shared/src/scheme/access-keys/dto.d.ts +0 -101
- package/runtime/types/shared/src/scheme/access-keys/index.d.ts +0 -2
- package/runtime/types/shared/src/scheme/account/dto.d.ts +0 -63
- package/runtime/types/shared/src/scheme/account/index.d.ts +0 -1
- package/runtime/types/shared/src/scheme/activity-log-base.d.ts +0 -35
- package/runtime/types/shared/src/scheme/ai-agent-tools/dto.d.ts +0 -69
- package/runtime/types/shared/src/scheme/ai-agent-tools/index.d.ts +0 -2
- package/runtime/types/shared/src/scheme/ai-agent-tools/parameters.d.ts +0 -7
- package/runtime/types/shared/src/scheme/ai-router/dto.d.ts +0 -23
- package/runtime/types/shared/src/scheme/ai-router/index.d.ts +0 -2
- package/runtime/types/shared/src/scheme/api-keys/dto.d.ts +0 -28
- package/runtime/types/shared/src/scheme/api-keys/index.d.ts +0 -2
- package/runtime/types/shared/src/scheme/app/index.d.ts +0 -1
- package/runtime/types/shared/src/scheme/app/java.dto.d.ts +0 -6
- package/runtime/types/shared/src/scheme/billing/index.d.ts +0 -1
- package/runtime/types/shared/src/scheme/billing/java.dto.d.ts +0 -181
- package/runtime/types/shared/src/scheme/crm/billing.d.ts +0 -149
- package/runtime/types/shared/src/scheme/crm/dto.d.ts +0 -218
- package/runtime/types/shared/src/scheme/crm/index.d.ts +0 -3
- package/runtime/types/shared/src/scheme/data-types/index.d.ts +0 -1
- package/runtime/types/shared/src/scheme/data-types/java.dto.d.ts +0 -22
- package/runtime/types/shared/src/scheme/dynamic-forms/dto.d.ts +0 -30
- package/runtime/types/shared/src/scheme/dynamic-forms/index.d.ts +0 -2
- package/runtime/types/shared/src/scheme/extensions/index.d.ts +0 -1
- package/runtime/types/shared/src/scheme/extensions/params-to-zod.d.ts +0 -14
- package/runtime/types/shared/src/scheme/flowrunner/custom-elements.d.ts +0 -383
- package/runtime/types/shared/src/scheme/flowrunner/index.d.ts +0 -3
- package/runtime/types/shared/src/scheme/flowrunner/java.dto.d.ts +0 -655
- package/runtime/types/shared/src/scheme/index.d.ts +0 -21
- package/runtime/types/shared/src/scheme/integration-connection/dto.d.ts +0 -135
- package/runtime/types/shared/src/scheme/integration-connection/index.d.ts +0 -2
- package/runtime/types/shared/src/scheme/knowledge-base/dto.d.ts +0 -776
- package/runtime/types/shared/src/scheme/knowledge-base/index.d.ts +0 -2
- package/runtime/types/shared/src/scheme/mcp-oauth/dto.d.ts +0 -9
- package/runtime/types/shared/src/scheme/mcp-oauth/index.d.ts +0 -2
- package/runtime/types/shared/src/scheme/notifications/dto.d.ts +0 -118
- package/runtime/types/shared/src/scheme/notifications/index.d.ts +0 -3
- package/runtime/types/shared/src/scheme/notifications/rest.d.ts +0 -162
- package/runtime/types/shared/src/scheme/onboarding/dto.d.ts +0 -29
- package/runtime/types/shared/src/scheme/onboarding/index.d.ts +0 -1
- package/runtime/types/shared/src/scheme/properties/account.d.ts +0 -3
- package/runtime/types/shared/src/scheme/properties/app.d.ts +0 -5
- package/runtime/types/shared/src/scheme/properties/billing.d.ts +0 -12
- package/runtime/types/shared/src/scheme/properties/common.d.ts +0 -2
- package/runtime/types/shared/src/scheme/properties/db.d.ts +0 -8
- package/runtime/types/shared/src/scheme/properties/flow-extensions.d.ts +0 -7
- package/runtime/types/shared/src/scheme/properties/index.d.ts +0 -7
- package/runtime/types/shared/src/scheme/remote-mcp-server/dto.d.ts +0 -278
- package/runtime/types/shared/src/scheme/remote-mcp-server/index.d.ts +0 -2
- package/runtime/types/shared/src/scheme/shared-extensions/base.d.ts +0 -62
- package/runtime/types/shared/src/scheme/shared-extensions/config.d.ts +0 -96
- package/runtime/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +0 -631
- package/runtime/types/shared/src/scheme/shared-extensions/extension.d.ts +0 -411
- package/runtime/types/shared/src/scheme/shared-extensions/flow-extensions.d.ts +0 -64
- package/runtime/types/shared/src/scheme/shared-extensions/index.d.ts +0 -17
- package/runtime/types/shared/src/scheme/shared-extensions/light.d.ts +0 -38
- package/runtime/types/shared/src/scheme/shared-extensions/list.d.ts +0 -250
- package/runtime/types/shared/src/scheme/shared-extensions/logs.d.ts +0 -21
- package/runtime/types/shared/src/scheme/shared-extensions/methods.d.ts +0 -112
- package/runtime/types/shared/src/scheme/shared-extensions/params-schema.d.ts +0 -48
- package/runtime/types/shared/src/scheme/shared-extensions/popular-pool.d.ts +0 -11
- package/runtime/types/shared/src/scheme/shared-extensions/resolve.d.ts +0 -373
- package/runtime/types/shared/src/scheme/shared-extensions/rest.d.ts +0 -9
- package/runtime/types/shared/src/scheme/shared-extensions/search.d.ts +0 -189
- package/runtime/types/shared/src/scheme/shared-extensions/service-identity.d.ts +0 -10
- package/runtime/types/shared/src/scheme/shared-extensions/service-info.d.ts +0 -16
- package/runtime/types/shared/src/scheme/shared-extensions/workspace-stack.d.ts +0 -44
- package/runtime/types/shared/src/scheme/workspace/dto.d.ts +0 -40
- package/runtime/types/shared/src/scheme/workspace/index.d.ts +0 -1
- package/runtime/types/shared/src/utils/object.d.ts +0 -8
- package/runtime/types/shared/src/utils/uuid.d.ts +0 -5
- package/runtime/types/shared/src/utils/versions.d.ts +0 -4
- package/dist/types/flow-extension-runner/src/{v2/actions → actions}/action-method.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{common/context-files.d.ts → context/files.d.ts} +0 -0
- package/dist/types/flow-extension-runner/src/{v2/context → context}/logger.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{v2/context → context}/method-input.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{v2/context → context}/proxies.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{v2/create-extension.d.ts → create-extension.d.ts} +0 -0
- package/dist/types/flow-extension-runner/src/{v2/crypto.d.ts → crypto.d.ts} +0 -0
- package/dist/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/dictionary-method.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/payload-schema.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-method.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-owner.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{v2/loaders → loaders}/payload-schema.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{v2/method.d.ts → method.d.ts} +0 -0
- package/dist/types/flow-extension-runner/src/{v2/model → model}/method-model.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/method-names.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/oauth2.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/system-params.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/types.d.ts +0 -0
- package/dist/types/flow-extension-runner/src/{common/constants.d.ts → params/config-types.d.ts} +0 -0
- package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/files-options.d.ts +4 -4
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/index.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/checks.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/decode.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/encode.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/types.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/values.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/method-params.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/params.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/assert-object-schema.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/assert-supported-schema.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/coerce.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/date-format.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/dates.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/defaults.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/dictionary-binding.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/field-plan.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/introspect.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/labels.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/notices.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/widget-types.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/params → params}/zod.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/path.d.ts → path.d.ts} +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/mechanisms.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/method-names.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/polling-triggers.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/system-params.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/trigger-method.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/types.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/method-names.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/realtime-setup.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/system-params.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/trigger-method.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/types.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/verify.d.ts +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/result.d.ts → result.d.ts} +0 -0
- /package/dist/types/flow-extension-runner/src/{v2/system-method.d.ts → system-method.d.ts} +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/actions → actions}/action-method.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{common/context-files.d.ts → context/files.d.ts} +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/context → context}/logger.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/context → context}/method-input.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/context → context}/proxies.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/create-extension.d.ts → create-extension.d.ts} +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/crypto.d.ts → crypto.d.ts} +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/dictionary-method.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/payload-schema.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-method.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-owner.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/loaders → loaders}/payload-schema.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/method.d.ts → method.d.ts} +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/model → model}/method-model.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/method-names.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/oauth2.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/system-params.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/types.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{common/constants.d.ts → params/config-types.d.ts} +0 -0
- /package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/files-options.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/index.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/checks.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/decode.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/encode.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/types.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/values.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/method-params.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/params.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/assert-object-schema.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/assert-supported-schema.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/coerce.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/date-format.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/dates.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/defaults.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/dictionary-binding.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/field-plan.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/introspect.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/labels.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/notices.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/widget-types.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/params → params}/zod.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/path.d.ts → path.d.ts} +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/mechanisms.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/method-names.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/polling-triggers.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/system-params.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/trigger-method.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/types.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/method-names.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/realtime-setup.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/system-params.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/trigger-method.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/types.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/verify.d.ts +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/result.d.ts → result.d.ts} +0 -0
- /package/runtime/types/flow-extension-runner/src/{v2/system-method.d.ts → system-method.d.ts} +0 -0
package/dist/cli.js
CHANGED
|
@@ -8877,11 +8877,11 @@ var require_mime_types = __commonJS({
|
|
|
8877
8877
|
}
|
|
8878
8878
|
return exts[0];
|
|
8879
8879
|
}
|
|
8880
|
-
function lookup(
|
|
8881
|
-
if (!
|
|
8880
|
+
function lookup(path22) {
|
|
8881
|
+
if (!path22 || typeof path22 !== "string") {
|
|
8882
8882
|
return false;
|
|
8883
8883
|
}
|
|
8884
|
-
var extension2 = extname("x." +
|
|
8884
|
+
var extension2 = extname("x." + path22).toLowerCase().substr(1);
|
|
8885
8885
|
if (!extension2) {
|
|
8886
8886
|
return false;
|
|
8887
8887
|
}
|
|
@@ -10044,11 +10044,11 @@ var require_form_data = __commonJS({
|
|
|
10044
10044
|
"use strict";
|
|
10045
10045
|
var CombinedStream = require_combined_stream();
|
|
10046
10046
|
var util = require("util");
|
|
10047
|
-
var
|
|
10047
|
+
var path22 = require("path");
|
|
10048
10048
|
var http2 = require("http");
|
|
10049
10049
|
var https = require("https");
|
|
10050
10050
|
var parseUrl = require("url").parse;
|
|
10051
|
-
var
|
|
10051
|
+
var fs19 = require("fs");
|
|
10052
10052
|
var crypto3 = require("crypto");
|
|
10053
10053
|
var mime = require_mime_types();
|
|
10054
10054
|
var asynckit = require_asynckit();
|
|
@@ -10118,7 +10118,7 @@ var require_form_data = __commonJS({
|
|
|
10118
10118
|
if (value.end != null && value.end !== Infinity && value.start != null) {
|
|
10119
10119
|
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
10120
10120
|
} else {
|
|
10121
|
-
|
|
10121
|
+
fs19.stat(value.path, function(err, stat) {
|
|
10122
10122
|
var fileSize;
|
|
10123
10123
|
if (err) {
|
|
10124
10124
|
callback(err);
|
|
@@ -10176,11 +10176,11 @@ var require_form_data = __commonJS({
|
|
|
10176
10176
|
FormData2.prototype._getContentDisposition = function(value, options) {
|
|
10177
10177
|
var filename, contentDisposition;
|
|
10178
10178
|
if (typeof options.filepath === "string") {
|
|
10179
|
-
filename =
|
|
10179
|
+
filename = path22.normalize(options.filepath).replace(/\\/g, "/");
|
|
10180
10180
|
} else if (options.filename || value && (value.name || value.path)) {
|
|
10181
|
-
filename =
|
|
10181
|
+
filename = path22.basename(options.filename || value && (value.name || value.path));
|
|
10182
10182
|
} else if (value && value.readable && hasOwn(value, "httpVersion")) {
|
|
10183
|
-
filename =
|
|
10183
|
+
filename = path22.basename(value.client._httpMessage.path || "");
|
|
10184
10184
|
}
|
|
10185
10185
|
if (filename) {
|
|
10186
10186
|
contentDisposition = 'filename="' + escapeHeaderParam(filename) + '"';
|
|
@@ -10431,15 +10431,15 @@ var require_utils = __commonJS({
|
|
|
10431
10431
|
}
|
|
10432
10432
|
return uriComponent;
|
|
10433
10433
|
}
|
|
10434
|
-
function encodePath(
|
|
10435
|
-
return
|
|
10434
|
+
function encodePath(path22) {
|
|
10435
|
+
return path22.split("/").map(ensureComponentEncoding).join("/");
|
|
10436
10436
|
}
|
|
10437
|
-
function ensureEncoding(
|
|
10437
|
+
function ensureEncoding(path22) {
|
|
10438
10438
|
try {
|
|
10439
|
-
var url = new URL(
|
|
10440
|
-
return url.origin + encodePath(normalizeTrailingSlashInPath(
|
|
10439
|
+
var url = new URL(path22);
|
|
10440
|
+
return url.origin + encodePath(normalizeTrailingSlashInPath(path22, url)) + url.search;
|
|
10441
10441
|
} catch (_unused) {
|
|
10442
|
-
return encodePath(
|
|
10442
|
+
return encodePath(path22);
|
|
10443
10443
|
}
|
|
10444
10444
|
}
|
|
10445
10445
|
function normalizeTrailingSlashInPath(originPath, _ref) {
|
|
@@ -10794,15 +10794,15 @@ var require_client_node = __commonJS({
|
|
|
10794
10794
|
exports2.sendNodeAPIRequest = sendNodeAPIRequest;
|
|
10795
10795
|
var _utils = require_utils();
|
|
10796
10796
|
var _error = require_error();
|
|
10797
|
-
function sendNodeAPIRequest(
|
|
10797
|
+
function sendNodeAPIRequest(path22, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
|
|
10798
10798
|
return new Promise(function(resolve, reject) {
|
|
10799
|
-
var u = require("url").parse(
|
|
10799
|
+
var u = require("url").parse(path22);
|
|
10800
10800
|
var form = (0, _utils.isFormData)(body) && body;
|
|
10801
10801
|
var https = u.protocol === "https:";
|
|
10802
10802
|
var options = {
|
|
10803
10803
|
host: u.hostname,
|
|
10804
10804
|
port: u.port || (https ? 443 : 80),
|
|
10805
|
-
path: (0, _utils.normalizeTrailingSlashInPath)(
|
|
10805
|
+
path: (0, _utils.normalizeTrailingSlashInPath)(path22, u) + (u.search || ""),
|
|
10806
10806
|
method,
|
|
10807
10807
|
headers,
|
|
10808
10808
|
timeout
|
|
@@ -11210,12 +11210,12 @@ var require_request = __commonJS({
|
|
|
11210
11210
|
var Request = exports2.Request = /* @__PURE__ */ (function(_EventEmitter) {
|
|
11211
11211
|
_inherits(Request2, _EventEmitter);
|
|
11212
11212
|
var _super = _createSuper(Request2);
|
|
11213
|
-
function Request2(
|
|
11213
|
+
function Request2(path22, method, body) {
|
|
11214
11214
|
var _this;
|
|
11215
11215
|
_classCallCheck(this, Request2);
|
|
11216
11216
|
_this = _super.call(this);
|
|
11217
11217
|
_this.method = method;
|
|
11218
|
-
_this.path = (0, _utils.ensureEncoding)(
|
|
11218
|
+
_this.path = (0, _utils.ensureEncoding)(path22);
|
|
11219
11219
|
_this.body = body;
|
|
11220
11220
|
_this.unwrap = true;
|
|
11221
11221
|
_this.raw = false;
|
|
@@ -11444,10 +11444,10 @@ var require_request = __commonJS({
|
|
|
11444
11444
|
value: function send(body) {
|
|
11445
11445
|
var _this2 = this;
|
|
11446
11446
|
this.emit(REQUEST_EVENT, this);
|
|
11447
|
-
var
|
|
11447
|
+
var path22 = this.path;
|
|
11448
11448
|
var queryString = qs.stringify(this.queryParams);
|
|
11449
11449
|
if (queryString) {
|
|
11450
|
-
|
|
11450
|
+
path22 += "?" + queryString;
|
|
11451
11451
|
}
|
|
11452
11452
|
if (!(0, _utils.isFormData)(body) && (0, _utils.isWebFormData)(body)) {
|
|
11453
11453
|
body = toRequestFormData(body);
|
|
@@ -11464,11 +11464,11 @@ var require_request = __commonJS({
|
|
|
11464
11464
|
return _this2.unwrap ? res.body : res;
|
|
11465
11465
|
};
|
|
11466
11466
|
if (Request2.verbose) {
|
|
11467
|
-
console.log(this.method.toUpperCase(), decodeURIComponent(
|
|
11467
|
+
console.log(this.method.toUpperCase(), decodeURIComponent(path22), body, this.headers);
|
|
11468
11468
|
}
|
|
11469
11469
|
var withCredentials = typeof this.withCredentials === "boolean" ? this.withCredentials : Request2.withCredentials;
|
|
11470
11470
|
var syncError = new Error();
|
|
11471
|
-
var request = Request2.send(
|
|
11471
|
+
var request = Request2.send(path22, this.method.toUpperCase(), this.headers, body, this.encoding, this.timeout, withCredentials, this.tlsOptions).then(function(res) {
|
|
11472
11472
|
return parseBody(res, _this2.raw);
|
|
11473
11473
|
}).then(function(res) {
|
|
11474
11474
|
return ensureRawBody(res, _this2.raw);
|
|
@@ -11577,14 +11577,14 @@ var require_client_browser = __commonJS({
|
|
|
11577
11577
|
});
|
|
11578
11578
|
exports2.sendXmlHttpRequest = sendXmlHttpRequest;
|
|
11579
11579
|
var _request2 = require_request();
|
|
11580
|
-
function sendXmlHttpRequest(
|
|
11580
|
+
function sendXmlHttpRequest(path22, method, headers, body, encoding, timeout, withCredentials) {
|
|
11581
11581
|
return new Promise(function sendRequest(resolve, reject) {
|
|
11582
11582
|
var request = new _request2.Request.XMLHttpRequest();
|
|
11583
11583
|
request.timeout = timeout;
|
|
11584
11584
|
if (!encoding) {
|
|
11585
11585
|
request.responseType = "arraybuffer";
|
|
11586
11586
|
}
|
|
11587
|
-
request.open(method.toUpperCase(),
|
|
11587
|
+
request.open(method.toUpperCase(), path22, true);
|
|
11588
11588
|
if (typeof withCredentials === "boolean") {
|
|
11589
11589
|
request.withCredentials = withCredentials;
|
|
11590
11590
|
}
|
|
@@ -11657,16 +11657,16 @@ var require_lib = __commonJS({
|
|
|
11657
11657
|
}
|
|
11658
11658
|
});
|
|
11659
11659
|
_request.Request.XMLHttpRequest = typeof XMLHttpRequest !== "undefined" ? XMLHttpRequest : void 0;
|
|
11660
|
-
_request.Request.send = function(
|
|
11660
|
+
_request.Request.send = function(path22, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
|
|
11661
11661
|
var sender = typeof _request.Request.XMLHttpRequest !== "undefined" ? _clientBrowser.sendXmlHttpRequest : _clientNode.sendNodeAPIRequest;
|
|
11662
|
-
return sender(
|
|
11662
|
+
return sender(path22, method, headers, body, encoding, timeout, withCredentials, tlsOptions);
|
|
11663
11663
|
};
|
|
11664
11664
|
_request.Request.verbose = false;
|
|
11665
11665
|
_request.Request.withCredentials = false;
|
|
11666
11666
|
_request.Request.methods = ["get", "post", "put", "patch", "delete", "head", "options"];
|
|
11667
11667
|
_request.Request.methods.forEach(function(method) {
|
|
11668
|
-
_request.Request[method] = function(
|
|
11669
|
-
return new _request.Request(
|
|
11668
|
+
_request.Request[method] = function(path22, body) {
|
|
11669
|
+
return new _request.Request(path22, method, body);
|
|
11670
11670
|
};
|
|
11671
11671
|
});
|
|
11672
11672
|
exports2 = module2.exports = _request.Request;
|
|
@@ -12007,25 +12007,25 @@ var require_utils2 = __commonJS({
|
|
|
12007
12007
|
}
|
|
12008
12008
|
mkdirSync(folder);
|
|
12009
12009
|
};
|
|
12010
|
-
Utils.prototype.writeFileTo = function(
|
|
12010
|
+
Utils.prototype.writeFileTo = function(path22, content, overwrite, attr) {
|
|
12011
12011
|
const self = this;
|
|
12012
|
-
if (self.fs.existsSync(
|
|
12012
|
+
if (self.fs.existsSync(path22)) {
|
|
12013
12013
|
if (!overwrite) return false;
|
|
12014
|
-
var stat = self.fs.statSync(
|
|
12014
|
+
var stat = self.fs.statSync(path22);
|
|
12015
12015
|
if (stat.isDirectory()) {
|
|
12016
12016
|
return false;
|
|
12017
12017
|
}
|
|
12018
12018
|
}
|
|
12019
|
-
var folder = pth.dirname(
|
|
12019
|
+
var folder = pth.dirname(path22);
|
|
12020
12020
|
if (!self.fs.existsSync(folder)) {
|
|
12021
12021
|
self.makeDir(folder);
|
|
12022
12022
|
}
|
|
12023
12023
|
var fd;
|
|
12024
12024
|
try {
|
|
12025
|
-
fd = self.fs.openSync(
|
|
12025
|
+
fd = self.fs.openSync(path22, "w", 438);
|
|
12026
12026
|
} catch (e) {
|
|
12027
|
-
self.fs.chmodSync(
|
|
12028
|
-
fd = self.fs.openSync(
|
|
12027
|
+
self.fs.chmodSync(path22, 438);
|
|
12028
|
+
fd = self.fs.openSync(path22, "w", 438);
|
|
12029
12029
|
}
|
|
12030
12030
|
if (fd) {
|
|
12031
12031
|
try {
|
|
@@ -12034,22 +12034,22 @@ var require_utils2 = __commonJS({
|
|
|
12034
12034
|
self.fs.closeSync(fd);
|
|
12035
12035
|
}
|
|
12036
12036
|
}
|
|
12037
|
-
self.fs.chmodSync(
|
|
12037
|
+
self.fs.chmodSync(path22, attr || 438);
|
|
12038
12038
|
return true;
|
|
12039
12039
|
};
|
|
12040
|
-
Utils.prototype.writeFileToAsync = function(
|
|
12040
|
+
Utils.prototype.writeFileToAsync = function(path22, content, overwrite, attr, callback) {
|
|
12041
12041
|
if (typeof attr === "function") {
|
|
12042
12042
|
callback = attr;
|
|
12043
12043
|
attr = void 0;
|
|
12044
12044
|
}
|
|
12045
12045
|
const self = this;
|
|
12046
|
-
self.fs.exists(
|
|
12046
|
+
self.fs.exists(path22, function(exist) {
|
|
12047
12047
|
if (exist && !overwrite) return callback(false);
|
|
12048
|
-
self.fs.stat(
|
|
12048
|
+
self.fs.stat(path22, function(err, stat) {
|
|
12049
12049
|
if (exist && stat && stat.isDirectory()) {
|
|
12050
12050
|
return callback(false);
|
|
12051
12051
|
}
|
|
12052
|
-
var folder = pth.dirname(
|
|
12052
|
+
var folder = pth.dirname(path22);
|
|
12053
12053
|
self.fs.exists(folder, function(exists) {
|
|
12054
12054
|
if (!exists) {
|
|
12055
12055
|
try {
|
|
@@ -12062,16 +12062,16 @@ var require_utils2 = __commonJS({
|
|
|
12062
12062
|
self.fs.write(fd, content, 0, content.length, 0, function(writeErr) {
|
|
12063
12063
|
self.fs.close(fd, function() {
|
|
12064
12064
|
if (writeErr) return callback(false);
|
|
12065
|
-
self.fs.chmod(
|
|
12065
|
+
self.fs.chmod(path22, attr || 438, function() {
|
|
12066
12066
|
callback(true);
|
|
12067
12067
|
});
|
|
12068
12068
|
});
|
|
12069
12069
|
});
|
|
12070
12070
|
};
|
|
12071
|
-
self.fs.open(
|
|
12071
|
+
self.fs.open(path22, "w", 438, function(err2, fd) {
|
|
12072
12072
|
if (err2) {
|
|
12073
|
-
self.fs.chmod(
|
|
12074
|
-
self.fs.open(
|
|
12073
|
+
self.fs.chmod(path22, 438, function() {
|
|
12074
|
+
self.fs.open(path22, "w", 438, function(retryErr, fd2) {
|
|
12075
12075
|
if (retryErr || !fd2) return callback(false);
|
|
12076
12076
|
writeToFd(fd2);
|
|
12077
12077
|
});
|
|
@@ -12107,10 +12107,10 @@ var require_utils2 = __commonJS({
|
|
|
12107
12107
|
if (stat.isSymbolicLink()) throw Errors.FILE_IN_THE_WAY(`"${cur}"`);
|
|
12108
12108
|
}
|
|
12109
12109
|
};
|
|
12110
|
-
Utils.prototype.findFiles = function(
|
|
12110
|
+
Utils.prototype.findFiles = function(path22) {
|
|
12111
12111
|
const self = this;
|
|
12112
12112
|
const canLstat = typeof self.fs.lstatSync === "function";
|
|
12113
|
-
const rootReal = self.fs.realpathSync(
|
|
12113
|
+
const rootReal = self.fs.realpathSync(path22);
|
|
12114
12114
|
function escapesRoot(p) {
|
|
12115
12115
|
if (!canLstat) return false;
|
|
12116
12116
|
if (!self.fs.lstatSync(p).isSymbolicLink()) return false;
|
|
@@ -12129,23 +12129,23 @@ var require_utils2 = __commonJS({
|
|
|
12129
12129
|
}
|
|
12130
12130
|
let files = [];
|
|
12131
12131
|
self.fs.readdirSync(dir).forEach(function(file) {
|
|
12132
|
-
const
|
|
12133
|
-
if (escapesRoot(
|
|
12134
|
-
const stat = self.fs.statSync(
|
|
12135
|
-
if (!pattern || pattern.test(
|
|
12136
|
-
files.push(pth.normalize(
|
|
12132
|
+
const path23 = pth.join(dir, file);
|
|
12133
|
+
if (escapesRoot(path23)) return;
|
|
12134
|
+
const stat = self.fs.statSync(path23);
|
|
12135
|
+
if (!pattern || pattern.test(path23)) {
|
|
12136
|
+
files.push(pth.normalize(path23) + (stat.isDirectory() ? self.sep : ""));
|
|
12137
12137
|
}
|
|
12138
12138
|
if (stat.isDirectory() && recursive) {
|
|
12139
|
-
const realDir = self.fs.realpathSync(
|
|
12139
|
+
const realDir = self.fs.realpathSync(path23);
|
|
12140
12140
|
if (!visited.has(realDir)) {
|
|
12141
12141
|
visited.add(realDir);
|
|
12142
|
-
files = files.concat(findSync(
|
|
12142
|
+
files = files.concat(findSync(path23, pattern, recursive, visited));
|
|
12143
12143
|
}
|
|
12144
12144
|
}
|
|
12145
12145
|
});
|
|
12146
12146
|
return files;
|
|
12147
12147
|
}
|
|
12148
|
-
return findSync(
|
|
12148
|
+
return findSync(path22, void 0, true, /* @__PURE__ */ new Set([rootReal]));
|
|
12149
12149
|
};
|
|
12150
12150
|
Utils.prototype.findFilesAsync = function(dir, cb) {
|
|
12151
12151
|
const self = this;
|
|
@@ -12242,14 +12242,14 @@ var require_utils2 = __commonJS({
|
|
|
12242
12242
|
return "UNSUPPORTED (" + method + ")";
|
|
12243
12243
|
}
|
|
12244
12244
|
};
|
|
12245
|
-
Utils.canonical = function(
|
|
12246
|
-
if (!
|
|
12247
|
-
const safeSuffix = pth.posix.normalize("/" +
|
|
12245
|
+
Utils.canonical = function(path22) {
|
|
12246
|
+
if (!path22) return "";
|
|
12247
|
+
const safeSuffix = pth.posix.normalize("/" + path22.split("\\").join("/"));
|
|
12248
12248
|
return pth.join(".", safeSuffix);
|
|
12249
12249
|
};
|
|
12250
|
-
Utils.zipnamefix = function(
|
|
12251
|
-
if (!
|
|
12252
|
-
const safeSuffix = pth.posix.normalize("/" +
|
|
12250
|
+
Utils.zipnamefix = function(path22) {
|
|
12251
|
+
if (!path22) return "";
|
|
12252
|
+
const safeSuffix = pth.posix.normalize("/" + path22.split("\\").join("/"));
|
|
12253
12253
|
return pth.posix.join(".", safeSuffix);
|
|
12254
12254
|
};
|
|
12255
12255
|
Utils.findLast = function(arr, callback) {
|
|
@@ -12266,9 +12266,9 @@ var require_utils2 = __commonJS({
|
|
|
12266
12266
|
prefix = pth.resolve(pth.normalize(prefix));
|
|
12267
12267
|
var parts = name.split("/");
|
|
12268
12268
|
for (var i = 0, l = parts.length; i < l; i++) {
|
|
12269
|
-
var
|
|
12270
|
-
if (
|
|
12271
|
-
return
|
|
12269
|
+
var path22 = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
|
|
12270
|
+
if (path22 === prefix || path22.startsWith(prefix + pth.sep)) {
|
|
12271
|
+
return path22;
|
|
12272
12272
|
}
|
|
12273
12273
|
}
|
|
12274
12274
|
return pth.normalize(pth.join(prefix, pth.basename(name)));
|
|
@@ -12318,8 +12318,8 @@ var require_utils2 = __commonJS({
|
|
|
12318
12318
|
var require_fattr = __commonJS({
|
|
12319
12319
|
"node_modules/adm-zip/util/fattr.js"(exports2, module2) {
|
|
12320
12320
|
var pth = require("path");
|
|
12321
|
-
module2.exports = function(
|
|
12322
|
-
var _path =
|
|
12321
|
+
module2.exports = function(path22, { fs: fs19 }) {
|
|
12322
|
+
var _path = path22 || "", _obj = newAttr(), _stat = null;
|
|
12323
12323
|
function newAttr() {
|
|
12324
12324
|
return {
|
|
12325
12325
|
directory: false,
|
|
@@ -12330,8 +12330,8 @@ var require_fattr = __commonJS({
|
|
|
12330
12330
|
atime: 0
|
|
12331
12331
|
};
|
|
12332
12332
|
}
|
|
12333
|
-
if (_path &&
|
|
12334
|
-
_stat =
|
|
12333
|
+
if (_path && fs19.existsSync(_path)) {
|
|
12334
|
+
_stat = fs19.statSync(_path);
|
|
12335
12335
|
_obj.directory = _stat.isDirectory();
|
|
12336
12336
|
_obj.mtime = _stat.mtime;
|
|
12337
12337
|
_obj.atime = _stat.atime;
|
|
@@ -14508,7 +14508,7 @@ var require_package = __commonJS({
|
|
|
14508
14508
|
"package.json"(exports2, module2) {
|
|
14509
14509
|
module2.exports = {
|
|
14510
14510
|
name: "@flowrunner/cli",
|
|
14511
|
-
version: "0.1.19-dev.
|
|
14511
|
+
version: "0.1.19-dev.2",
|
|
14512
14512
|
publishConfig: {
|
|
14513
14513
|
access: "public"
|
|
14514
14514
|
},
|
|
@@ -14545,14 +14545,11 @@ var require_package = __commonJS({
|
|
|
14545
14545
|
"adm-zip": "^0.6.1",
|
|
14546
14546
|
archiver: "^7.0.0",
|
|
14547
14547
|
commander: "^12.0.0",
|
|
14548
|
-
jsdoc: "^4.0.0",
|
|
14549
|
-
requizzle: "^0.2.4",
|
|
14550
14548
|
zod: "^4.6.2"
|
|
14551
14549
|
},
|
|
14552
14550
|
devDependencies: {
|
|
14553
14551
|
"@asteasolutions/zod-to-openapi": "^8.4.0",
|
|
14554
14552
|
"@flowrunner/flow-extension-runner": "*",
|
|
14555
|
-
"@flowrunner/jsdoc-parser": "*",
|
|
14556
14553
|
"@types/adm-zip": "^0.5.7",
|
|
14557
14554
|
"@types/archiver": "^6.0.0",
|
|
14558
14555
|
esbuild: "^0.28.2",
|
|
@@ -15505,12 +15502,12 @@ async function downloadRemoteService(credentials, serviceId) {
|
|
|
15505
15502
|
}
|
|
15506
15503
|
|
|
15507
15504
|
// src/operations/deploy/index.ts
|
|
15508
|
-
var
|
|
15509
|
-
var
|
|
15505
|
+
var import_fs11 = __toESM(require("fs"));
|
|
15506
|
+
var import_path16 = __toESM(require("path"));
|
|
15510
15507
|
|
|
15511
15508
|
// src/operations/deploy/discover-services.ts
|
|
15512
|
-
var
|
|
15513
|
-
var
|
|
15509
|
+
var import_fs8 = __toESM(require("fs"));
|
|
15510
|
+
var import_path12 = __toESM(require("path"));
|
|
15514
15511
|
|
|
15515
15512
|
// ../../flow-extension-runner/src/namespace.ts
|
|
15516
15513
|
var import_backendless_request2 = __toESM(require_lib());
|
|
@@ -15555,9 +15552,9 @@ var FlowExtensionErrorCodes = {
|
|
|
15555
15552
|
DUPLICATE_ITEM_ID: "FR_EXT_DUPLICATE_ITEM_ID",
|
|
15556
15553
|
// No v2 extension registered for the given serviceId after requiring the module.
|
|
15557
15554
|
EXTENSION_NOT_REGISTERED: "FR_EXT_NOT_REGISTERED",
|
|
15558
|
-
// A declared config value is missing or the wrong shape (see
|
|
15555
|
+
// A declared config value is missing or the wrong shape (see params/schema/normalize).
|
|
15559
15556
|
INVALID_CONFIG: "FR_EXT_INVALID_CONFIG",
|
|
15560
|
-
// A schema slot that must be a z.object was declared as something else (see
|
|
15557
|
+
// A schema slot that must be a z.object was declared as something else (see params/schema/assert-object-schema).
|
|
15561
15558
|
INVALID_SCHEMA: "FR_EXT_INVALID_SCHEMA",
|
|
15562
15559
|
// A polling trigger declared zero or multiple mechanisms, or is missing its fetch.
|
|
15563
15560
|
INVALID_TRIGGER_CONFIG: "FR_EXT_INVALID_TRIGGER_CONFIG",
|
|
@@ -15652,7 +15649,7 @@ var InvalidConfigError = class extends FlowExtensionError {
|
|
|
15652
15649
|
};
|
|
15653
15650
|
var InvalidSchemaError = class extends FlowExtensionError {
|
|
15654
15651
|
// `message` is composed by the guard, which knows how to describe what was received and what to do
|
|
15655
|
-
// about it (see
|
|
15652
|
+
// about it (see params/schema/assert-object-schema.ts).
|
|
15656
15653
|
constructor(message, details) {
|
|
15657
15654
|
super(FlowExtensionErrorCodes.INVALID_SCHEMA, 400, message, details);
|
|
15658
15655
|
}
|
|
@@ -15704,12 +15701,12 @@ var InvalidDictionaryOutputScheme = class extends FlowExtensionError {
|
|
|
15704
15701
|
}
|
|
15705
15702
|
};
|
|
15706
15703
|
|
|
15707
|
-
// ../../flow-extension-runner/src/
|
|
15704
|
+
// ../../flow-extension-runner/src/loaders/loader-owner.ts
|
|
15708
15705
|
var sampleResultLoaderName = (ownerId) => `${ownerId}_SampleResultLoader`;
|
|
15709
15706
|
var dynamicParamsLoaderName = (ownerId) => `${ownerId}_DynamicParams`;
|
|
15710
15707
|
var dynamicPropsLoaderName = (ownerId, field) => `${ownerId}_${field}_DynamicProps`;
|
|
15711
15708
|
|
|
15712
|
-
// ../../flow-extension-runner/src/
|
|
15709
|
+
// ../../flow-extension-runner/src/params/schema/assert-object-schema.ts
|
|
15713
15710
|
var WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish", "default", "prefault"]);
|
|
15714
15711
|
var typeOf = (value) => value?._zod?.def?.type;
|
|
15715
15712
|
function describe(value) {
|
|
@@ -15758,7 +15755,7 @@ function assertObjectSchema(scheme, source) {
|
|
|
15758
15755
|
);
|
|
15759
15756
|
}
|
|
15760
15757
|
|
|
15761
|
-
// ../../flow-extension-runner/src/
|
|
15758
|
+
// ../../flow-extension-runner/src/params/widget-types.ts
|
|
15762
15759
|
var FlowExtensionParamGroupTypes = {
|
|
15763
15760
|
FILE_UPLOAD_OPTIONS: "FILE_UPLOAD_OPTIONS",
|
|
15764
15761
|
FILE_LIST_OPTIONS: "FILE_LIST_OPTIONS",
|
|
@@ -15785,7 +15782,7 @@ var FlowExtensionParamWidgetTypes = {
|
|
|
15785
15782
|
TIME_PICKER: "TIME_PICKER"
|
|
15786
15783
|
};
|
|
15787
15784
|
|
|
15788
|
-
// ../../flow-extension-runner/src/
|
|
15785
|
+
// ../../flow-extension-runner/src/params/schema/introspect.ts
|
|
15789
15786
|
var OPTIONAL_WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish"]);
|
|
15790
15787
|
var DEFAULT_WRAPPERS = /* @__PURE__ */ new Set(["default", "prefault"]);
|
|
15791
15788
|
var TRANSPARENT_WRAPPERS = /* @__PURE__ */ new Set(["readonly", "pipe", "lazy"]);
|
|
@@ -15941,7 +15938,7 @@ function shapeEntries(schema) {
|
|
|
15941
15938
|
return shape && typeof shape === "object" ? Object.entries(shape) : [];
|
|
15942
15939
|
}
|
|
15943
15940
|
|
|
15944
|
-
// ../../flow-extension-runner/src/
|
|
15941
|
+
// ../../flow-extension-runner/src/params/schema/date-format.ts
|
|
15945
15942
|
var ISO_PATTERNS = {
|
|
15946
15943
|
date: "yyyy-MM-dd",
|
|
15947
15944
|
datetime: "yyyy-MM-dd'T'HH:mm",
|
|
@@ -16287,7 +16284,7 @@ function hasDateFormat(schema, seen = /* @__PURE__ */ new Set()) {
|
|
|
16287
16284
|
return children.some((child) => hasDateFormat(child, seen));
|
|
16288
16285
|
}
|
|
16289
16286
|
|
|
16290
|
-
// ../../flow-extension-runner/src/
|
|
16287
|
+
// ../../flow-extension-runner/src/params/schema/dictionary-binding.ts
|
|
16291
16288
|
var DictionaryScope = class _DictionaryScope {
|
|
16292
16289
|
constructor(top, visible) {
|
|
16293
16290
|
this.top = top;
|
|
@@ -16320,7 +16317,7 @@ function publishedBinding(binding, scope2) {
|
|
|
16320
16317
|
return { id: binding.id, dependsOn: resolveDependsOn(binding, scope2).dependsOn };
|
|
16321
16318
|
}
|
|
16322
16319
|
|
|
16323
|
-
// ../../flow-extension-runner/src/
|
|
16320
|
+
// ../../flow-extension-runner/src/params/schema/assert-supported-schema.ts
|
|
16324
16321
|
var GUARDED_KINDS = /* @__PURE__ */ new Set(["action", "dictionary", "polling trigger", "realtime trigger", "extension"]);
|
|
16325
16322
|
var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
|
|
16326
16323
|
"string",
|
|
@@ -16341,31 +16338,31 @@ var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
|
|
|
16341
16338
|
]);
|
|
16342
16339
|
var SUPPORTED_SPELLING = "z.string(), z.number(), z.bigint(), z.boolean(), z.date(), z.enum([\u2026]), z.literal(\u2026), z.object({ \u2026 }), z.array(\u2026), z.record(\u2026), z.union([\u2026]), z.null(), z.any(), z.unknown()";
|
|
16343
16340
|
var MODIFIER_SPELLING = ".optional(), .nullable(), .nullish(), .default(v), .prefault(v), .readonly(), .nonoptional(), .pipe(\u2026)/.transform(\u2026) and z.lazy(\u2026)";
|
|
16344
|
-
function subjectOf(source,
|
|
16341
|
+
function subjectOf(source, path22) {
|
|
16345
16342
|
const kind = source.kind ?? "extension";
|
|
16346
16343
|
const subject = source.itemId ? `${kind} "${source.itemId}": ` : "";
|
|
16347
|
-
return `${subject}\`${
|
|
16344
|
+
return `${subject}\`${path22}\``;
|
|
16348
16345
|
}
|
|
16349
|
-
function refuse(message, source,
|
|
16346
|
+
function refuse(message, source, path22, received) {
|
|
16350
16347
|
throw new InvalidSchemaError(
|
|
16351
16348
|
`[flow-extension:${source.serviceId}] ${message}`,
|
|
16352
|
-
{ serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path:
|
|
16349
|
+
{ serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path: path22, received }
|
|
16353
16350
|
);
|
|
16354
16351
|
}
|
|
16355
|
-
function refuseCatch(source,
|
|
16352
|
+
function refuseCatch(source, path22) {
|
|
16356
16353
|
refuse(
|
|
16357
|
-
`${subjectOf(source,
|
|
16354
|
+
`${subjectOf(source, path22)} uses \`.catch(\u2026)\`, which a parameter may not: it replaces an invalid value with the fallback instead of reporting it, and drops the field out of type coercion. Use \`.default(v)\` \u2014 same fallback when the value is absent, and a supplied-but-invalid one still fails.`,
|
|
16358
16355
|
source,
|
|
16359
|
-
|
|
16356
|
+
path22,
|
|
16360
16357
|
"catch"
|
|
16361
16358
|
);
|
|
16362
16359
|
}
|
|
16363
|
-
function refuseType(source,
|
|
16360
|
+
function refuseType(source, path22, type) {
|
|
16364
16361
|
const received = type ? `z.${type}()` : "a value that is not a zod schema";
|
|
16365
16362
|
refuse(
|
|
16366
|
-
`${subjectOf(source,
|
|
16363
|
+
`${subjectOf(source, path22)} declares ${received}, which the runtime cannot publish as a parameter \u2014 it has no widget, no published type and no coercion for it. Supported: ${SUPPORTED_SPELLING}; each may carry ${MODIFIER_SPELLING}.`,
|
|
16367
16364
|
source,
|
|
16368
|
-
|
|
16365
|
+
path22,
|
|
16369
16366
|
type ?? "unknown"
|
|
16370
16367
|
);
|
|
16371
16368
|
}
|
|
@@ -16381,7 +16378,7 @@ function isLooseObject(schema) {
|
|
|
16381
16378
|
function isDynamicPropsSlot(source, topLevel) {
|
|
16382
16379
|
return topLevel && source.kind === "action" && source.slot === "params";
|
|
16383
16380
|
}
|
|
16384
|
-
function assertDynamicProps(schema, name, siblings, source,
|
|
16381
|
+
function assertDynamicProps(schema, name, siblings, source, path22) {
|
|
16385
16382
|
const ins = inspect(schema);
|
|
16386
16383
|
const spec = ins.meta.frDynamicProps;
|
|
16387
16384
|
if (!spec) {
|
|
@@ -16392,49 +16389,49 @@ function assertDynamicProps(schema, name, siblings, source, path23) {
|
|
|
16392
16389
|
}
|
|
16393
16390
|
if (typeof spec.execute !== "function") {
|
|
16394
16391
|
refuse(
|
|
16395
|
-
`${subjectOf(source,
|
|
16392
|
+
`${subjectOf(source, path22)}: \`.dynamicProps()\` needs an \`execute\` function that returns the loaded fields.`,
|
|
16396
16393
|
source,
|
|
16397
|
-
|
|
16394
|
+
path22,
|
|
16398
16395
|
typeof spec.execute
|
|
16399
16396
|
);
|
|
16400
16397
|
}
|
|
16401
16398
|
if (spec.dependsOn !== void 0 && (!Array.isArray(spec.dependsOn) || spec.dependsOn.some((item) => typeof item !== "string"))) {
|
|
16402
16399
|
refuse(
|
|
16403
|
-
`${subjectOf(source,
|
|
16400
|
+
`${subjectOf(source, path22)}: \`.dynamicProps()\` \`dependsOn\` must be an array of param names.`,
|
|
16404
16401
|
source,
|
|
16405
|
-
|
|
16402
|
+
path22,
|
|
16406
16403
|
"dependsOn"
|
|
16407
16404
|
);
|
|
16408
16405
|
}
|
|
16409
16406
|
for (const dependency of spec.dependsOn ?? []) {
|
|
16410
16407
|
if (dependency === name || !siblings.includes(dependency)) {
|
|
16411
16408
|
refuse(
|
|
16412
|
-
`${subjectOf(source,
|
|
16409
|
+
`${subjectOf(source, path22)}: \`.dynamicProps()\` depends on "${dependency}", which is not another param of this action. Name its sibling params: ${siblings.filter((sibling) => sibling !== name).join(", ") || "none"}.`,
|
|
16413
16410
|
source,
|
|
16414
|
-
|
|
16411
|
+
path22,
|
|
16415
16412
|
dependency
|
|
16416
16413
|
);
|
|
16417
16414
|
}
|
|
16418
16415
|
}
|
|
16419
16416
|
if (ins.meta.frDictionary) {
|
|
16420
16417
|
refuse(
|
|
16421
|
-
`${subjectOf(source,
|
|
16418
|
+
`${subjectOf(source, path22)} declares both \`.dynamicProps()\` and \`.dictionary()\`. A dictionary offers values for one field; dynamic props load the fields inside an object \u2014 use one or the other.`,
|
|
16422
16419
|
source,
|
|
16423
|
-
|
|
16420
|
+
path22,
|
|
16424
16421
|
"dictionary"
|
|
16425
16422
|
);
|
|
16426
16423
|
}
|
|
16427
16424
|
const element = ins.resolvedType === "array" ? ins.core?._zod?.def?.element : void 0;
|
|
16428
16425
|
if (!isLooseObject(schema) && !isLooseObject(element)) {
|
|
16429
16426
|
refuse(
|
|
16430
|
-
`${subjectOf(source,
|
|
16427
|
+
`${subjectOf(source, path22)}: \`.dynamicProps()\` needs a loose object \u2014 the loaded fields are not declared, so a plain \`z.object()\` would strip them. ${DYNAMIC_PROPS_FIX}`,
|
|
16431
16428
|
source,
|
|
16432
|
-
|
|
16429
|
+
path22,
|
|
16433
16430
|
ins.resolvedType ?? "unknown"
|
|
16434
16431
|
);
|
|
16435
16432
|
}
|
|
16436
16433
|
}
|
|
16437
|
-
function assertDictionaryBinding(schema, source,
|
|
16434
|
+
function assertDictionaryBinding(schema, source, path22, scope2) {
|
|
16438
16435
|
const binding = inspect(schema).meta.frDictionary;
|
|
16439
16436
|
if (!binding) {
|
|
16440
16437
|
return;
|
|
@@ -16442,14 +16439,14 @@ function assertDictionaryBinding(schema, source, path23, scope2) {
|
|
|
16442
16439
|
const { clash } = resolveDependsOn(binding, scope2);
|
|
16443
16440
|
if (clash) {
|
|
16444
16441
|
refuse(
|
|
16445
|
-
`${subjectOf(source,
|
|
16442
|
+
`${subjectOf(source, path22)} uses dictionary "${binding.id}", whose criteria "${clash.key}" can come from ${clash.names.map((name) => `"${name}"`).join(" or ")} \u2014 and this field can see all of them, so the dictionary cannot tell which one is meant. Rename one of the params, or bind this field to a dictionary without that alias.`,
|
|
16446
16443
|
source,
|
|
16447
|
-
|
|
16444
|
+
path22,
|
|
16448
16445
|
clash.names.join(", ")
|
|
16449
16446
|
);
|
|
16450
16447
|
}
|
|
16451
16448
|
}
|
|
16452
|
-
function assertDateString(schema, source,
|
|
16449
|
+
function assertDateString(schema, source, path22) {
|
|
16453
16450
|
const ins = inspect(schema);
|
|
16454
16451
|
const pattern = ins.meta.frDateFormat;
|
|
16455
16452
|
const kind = dateStringKind(ins);
|
|
@@ -16457,9 +16454,9 @@ function assertDateString(schema, source, path23) {
|
|
|
16457
16454
|
const format = ins.core?._zod?.def?.format;
|
|
16458
16455
|
const zoned = ins.coreType === "string" && format === "datetime";
|
|
16459
16456
|
refuse(
|
|
16460
|
-
`${subjectOf(source,
|
|
16457
|
+
`${subjectOf(source, path22)} uses \`.dateFormat()\` on ${zoned ? "z.iso.datetime() with a zone \u2014 an instant, not a wall clock" : "a type that is not a date string"}. Only z.iso.date(), z.iso.datetime({ local: true }) and z.iso.time() take a format.`,
|
|
16461
16458
|
source,
|
|
16462
|
-
|
|
16459
|
+
path22,
|
|
16463
16460
|
zoned ? "datetime" : ins.resolvedType ?? "unknown"
|
|
16464
16461
|
);
|
|
16465
16462
|
}
|
|
@@ -16471,7 +16468,7 @@ function assertDateString(schema, source, path23) {
|
|
|
16471
16468
|
compilePattern(pattern, kind);
|
|
16472
16469
|
} catch (error) {
|
|
16473
16470
|
if (error instanceof DateFormatError) {
|
|
16474
|
-
refuse(`${subjectOf(source,
|
|
16471
|
+
refuse(`${subjectOf(source, path22)}: \`.dateFormat('${pattern}')\` ${error.message}.`, source, path22, pattern);
|
|
16475
16472
|
}
|
|
16476
16473
|
throw error;
|
|
16477
16474
|
}
|
|
@@ -16484,14 +16481,14 @@ function assertDateString(schema, source, path23) {
|
|
|
16484
16481
|
const fits = typeof fallback === "string" && (pattern !== void 0 ? !!parseInPattern(fallback, pattern, kind) : ((parts) => !!parts && toCanonical(parts, kind) === fallback)(parseIso(fallback, kind)));
|
|
16485
16482
|
if (!fits) {
|
|
16486
16483
|
refuse(
|
|
16487
|
-
`${subjectOf(source,
|
|
16484
|
+
`${subjectOf(source, path22)} has the default ${JSON.stringify(fallback)}, which is not written in ${written.replace(/'T'/, "T")} \u2014 a default is handed to \`execute\` as written, so write it in the field's own format.`,
|
|
16488
16485
|
source,
|
|
16489
|
-
|
|
16486
|
+
path22,
|
|
16490
16487
|
String(fallback)
|
|
16491
16488
|
);
|
|
16492
16489
|
}
|
|
16493
16490
|
}
|
|
16494
|
-
function assertField(schema, source,
|
|
16491
|
+
function assertField(schema, source, path22, seen, scope2, topLevel = false) {
|
|
16495
16492
|
if (!schema || seen.has(schema)) {
|
|
16496
16493
|
return;
|
|
16497
16494
|
}
|
|
@@ -16499,35 +16496,35 @@ function assertField(schema, source, path23, seen, scope2, topLevel = false) {
|
|
|
16499
16496
|
const ins = inspect(schema);
|
|
16500
16497
|
if (ins.meta.frDynamicProps && !isDynamicPropsSlot(source, topLevel)) {
|
|
16501
16498
|
refuse(
|
|
16502
|
-
`${subjectOf(source,
|
|
16499
|
+
`${subjectOf(source, path22)} uses \`.dynamicProps()\`, which is supported on top-level action params only. For a list of objects, put it on the array rather than on its element.`,
|
|
16503
16500
|
source,
|
|
16504
|
-
|
|
16501
|
+
path22,
|
|
16505
16502
|
"dynamicProps"
|
|
16506
16503
|
);
|
|
16507
16504
|
}
|
|
16508
16505
|
if (ins.resolvedType === "catch") {
|
|
16509
|
-
refuseCatch(source,
|
|
16506
|
+
refuseCatch(source, path22);
|
|
16510
16507
|
}
|
|
16511
|
-
assertDictionaryBinding(schema, source,
|
|
16512
|
-
assertDateString(schema, source,
|
|
16508
|
+
assertDictionaryBinding(schema, source, path22, scope2);
|
|
16509
|
+
assertDateString(schema, source, path22);
|
|
16513
16510
|
if (!ins.resolvedType || !SUPPORTED_TYPES.has(ins.resolvedType)) {
|
|
16514
|
-
refuseType(source,
|
|
16511
|
+
refuseType(source, path22, ins.resolvedType);
|
|
16515
16512
|
}
|
|
16516
16513
|
if (ins.branches) {
|
|
16517
|
-
ins.branches.forEach((branch, index) => assertField(branch, source, `${
|
|
16514
|
+
ins.branches.forEach((branch, index) => assertField(branch, source, `${path22}|branch ${index + 1}`, seen, scope2));
|
|
16518
16515
|
}
|
|
16519
16516
|
const def = ins.core._zod?.def ?? {};
|
|
16520
16517
|
if (ins.resolvedType === "array") {
|
|
16521
|
-
assertField(def.element, source, `${
|
|
16518
|
+
assertField(def.element, source, `${path22}[]`, seen, scope2);
|
|
16522
16519
|
}
|
|
16523
16520
|
if (ins.resolvedType === "record") {
|
|
16524
|
-
assertField(def.valueType, source, `${
|
|
16521
|
+
assertField(def.valueType, source, `${path22}{}`, seen, scope2);
|
|
16525
16522
|
}
|
|
16526
16523
|
if (ins.resolvedType === "object") {
|
|
16527
16524
|
const properties = shapeEntries(ins.core);
|
|
16528
16525
|
const inner = scope2.enter(properties.map(([name]) => name));
|
|
16529
16526
|
for (const [name, property] of properties) {
|
|
16530
|
-
assertField(property, source, `${
|
|
16527
|
+
assertField(property, source, `${path22}.${name}`, seen, inner);
|
|
16531
16528
|
}
|
|
16532
16529
|
}
|
|
16533
16530
|
}
|
|
@@ -16548,7 +16545,7 @@ function assertSupportedSchema(scheme, source) {
|
|
|
16548
16545
|
}
|
|
16549
16546
|
}
|
|
16550
16547
|
|
|
16551
|
-
// ../../flow-extension-runner/src/
|
|
16548
|
+
// ../../flow-extension-runner/src/params/schema/dates.ts
|
|
16552
16549
|
var DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
16553
16550
|
var HAS_TIME = /^(\d{4}-\d{2}-\d{2})[T ](.+)$/;
|
|
16554
16551
|
var ZONE = /(Z|[+-]\d{2}:?\d{2})$/;
|
|
@@ -16627,7 +16624,7 @@ function hasPassThroughDate(schema, inspectSchema, entriesOf) {
|
|
|
16627
16624
|
return children.some((child) => hasPassThroughDate(child, inspectSchema, entriesOf));
|
|
16628
16625
|
}
|
|
16629
16626
|
|
|
16630
|
-
// ../../flow-extension-runner/src/
|
|
16627
|
+
// ../../flow-extension-runner/src/params/schema/labels.ts
|
|
16631
16628
|
var ACRONYMS = /* @__PURE__ */ new Set([
|
|
16632
16629
|
"id",
|
|
16633
16630
|
"url",
|
|
@@ -16661,7 +16658,7 @@ function humanizeKey(name) {
|
|
|
16661
16658
|
}
|
|
16662
16659
|
var labelOf = (name, schema) => inspect(schema).meta.title || humanizeKey(name) || name;
|
|
16663
16660
|
|
|
16664
|
-
// ../../flow-extension-runner/src/
|
|
16661
|
+
// ../../flow-extension-runner/src/params/schema/field-plan.ts
|
|
16665
16662
|
function declaredAbsence(schema) {
|
|
16666
16663
|
let current = schema;
|
|
16667
16664
|
let acceptsUndefined = false;
|
|
@@ -16772,7 +16769,7 @@ function planField(name, schema) {
|
|
|
16772
16769
|
};
|
|
16773
16770
|
}
|
|
16774
16771
|
|
|
16775
|
-
// ../../flow-extension-runner/src/
|
|
16772
|
+
// ../../flow-extension-runner/src/params/schema/notices.ts
|
|
16776
16773
|
var sink;
|
|
16777
16774
|
var currentField;
|
|
16778
16775
|
function collectNotices(fn) {
|
|
@@ -16799,7 +16796,7 @@ function notice(entry) {
|
|
|
16799
16796
|
sink?.push({ field: currentField, ...entry });
|
|
16800
16797
|
}
|
|
16801
16798
|
|
|
16802
|
-
// ../../flow-extension-runner/src/
|
|
16799
|
+
// ../../flow-extension-runner/src/params/schema/coerce.ts
|
|
16803
16800
|
var ok = (value) => ({ ok: true, value });
|
|
16804
16801
|
var fail2 = (expected) => ({ ok: false, expected });
|
|
16805
16802
|
var TRUE = /* @__PURE__ */ new Set(["true", "1", "yes", "y", "t", "on", "checked", "enabled", "enable", "active"]);
|
|
@@ -17031,7 +17028,7 @@ function absentAs(schema, value) {
|
|
|
17031
17028
|
return absence === "null" ? null : void 0;
|
|
17032
17029
|
}
|
|
17033
17030
|
|
|
17034
|
-
// ../../flow-extension-runner/src/
|
|
17031
|
+
// ../../flow-extension-runner/src/params/schema/defaults.ts
|
|
17035
17032
|
var WIDGET_DESCRIPTIONS = {
|
|
17036
17033
|
[FlowExtensionParamWidgetTypes.MULTI_LINE_TEXT]: "Expects text; line breaks are allowed"
|
|
17037
17034
|
};
|
|
@@ -17068,7 +17065,7 @@ var FORMAT_DESCRIPTIONS = {
|
|
|
17068
17065
|
cidrv6: "Expects an IPv6 range, e.g. 2001:db8::/32"
|
|
17069
17066
|
};
|
|
17070
17067
|
|
|
17071
|
-
// ../../flow-extension-runner/src/
|
|
17068
|
+
// ../../flow-extension-runner/src/params/schema/messages.ts
|
|
17072
17069
|
var EXPECTED = {
|
|
17073
17070
|
string: "a string",
|
|
17074
17071
|
number: "a number",
|
|
@@ -17189,55 +17186,55 @@ function isAuthored(issue) {
|
|
|
17189
17186
|
}
|
|
17190
17187
|
function toFieldIssue(plan2, issue, fieldValue) {
|
|
17191
17188
|
const segments = (issue.path ?? []).map(String).filter(Boolean);
|
|
17192
|
-
const
|
|
17189
|
+
const path22 = segments.length ? `${plan2.name}.${segments.join(".")}` : plan2.name;
|
|
17193
17190
|
const code = issue.code ?? "custom";
|
|
17194
17191
|
const target = resolveTarget(plan2, segments, fieldValue);
|
|
17195
17192
|
const named = { ...plan2, label: target.label };
|
|
17196
17193
|
if (isAuthored(issue)) {
|
|
17197
|
-
return { path:
|
|
17194
|
+
return { path: path22, code, message: issue.message };
|
|
17198
17195
|
}
|
|
17199
17196
|
if (code === "invalid_format" && target.schema && inspect(target.schema).branches) {
|
|
17200
17197
|
const combined = unionPhrases(target.schema, target.value);
|
|
17201
17198
|
if (combined.length > 1) {
|
|
17202
|
-
return { path:
|
|
17199
|
+
return { path: path22, code: "invalid_union", message: `\xAB${target.label}\xBB must be ${combined.join(", or ")}` };
|
|
17203
17200
|
}
|
|
17204
17201
|
}
|
|
17205
17202
|
const dateKind = target.schema ? dateStringKind(inspect(target.schema)) : void 0;
|
|
17206
17203
|
const dateMissing = target.value == null || target.value === "";
|
|
17207
17204
|
if (dateKind && (code === "invalid_type" || code === "invalid_format")) {
|
|
17208
|
-
return dateMissing ? { path:
|
|
17205
|
+
return dateMissing ? { path: path22, code, message: requiredMessage(named) } : { path: path22, code, message: invalidTypeMessage(named, expectedDateString(inspect(target.schema), dateKind)) };
|
|
17209
17206
|
}
|
|
17210
17207
|
if (code === "invalid_type") {
|
|
17211
17208
|
const received = issue.received;
|
|
17212
17209
|
const absent = segments.length ? target.found && target.value == null : received === "undefined" || received === "null" || issue.expected === void 0;
|
|
17213
|
-
return absent ? { path:
|
|
17210
|
+
return absent ? { path: path22, code, message: requiredMessage(named) } : { path: path22, code, message: invalidTypeMessage(named, issue.expected ?? "") };
|
|
17214
17211
|
}
|
|
17215
17212
|
if (code === "too_small") {
|
|
17216
|
-
return { path:
|
|
17213
|
+
return { path: path22, code, message: `\xAB${target.label}\xBB must be at least ${bound(issue.minimum, plan2)}` };
|
|
17217
17214
|
}
|
|
17218
17215
|
if (code === "too_big") {
|
|
17219
|
-
return { path:
|
|
17216
|
+
return { path: path22, code, message: `\xAB${target.label}\xBB must be at most ${bound(issue.maximum, plan2)}` };
|
|
17220
17217
|
}
|
|
17221
17218
|
if (code === "invalid_value") {
|
|
17222
|
-
return { path:
|
|
17219
|
+
return { path: path22, code, message: `\xAB${target.label}\xBB must be ${oneOf(issue.values ?? [])}` };
|
|
17223
17220
|
}
|
|
17224
17221
|
if (code === "invalid_format") {
|
|
17225
17222
|
const described = FORMAT_DESCRIPTIONS[issue.format ?? ""];
|
|
17226
|
-
return described ? { path:
|
|
17223
|
+
return described ? { path: path22, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path: path22, code, message: `\xAB${target.label}\xBB has an invalid format` };
|
|
17227
17224
|
}
|
|
17228
17225
|
if (code === "invalid_union") {
|
|
17229
17226
|
if (segments.length && target.found && target.value == null) {
|
|
17230
|
-
return { path:
|
|
17227
|
+
return { path: path22, code, message: requiredMessage(named) };
|
|
17231
17228
|
}
|
|
17232
17229
|
const combined = unionIssue(plan2, issue, target.schema, target.value, fieldValue);
|
|
17233
17230
|
if (combined) {
|
|
17234
|
-
return combined.path ? combined : { path:
|
|
17231
|
+
return combined.path ? combined : { path: path22, code, message: `\xAB${target.label}\xBB ${combined.message}` };
|
|
17235
17232
|
}
|
|
17236
17233
|
}
|
|
17237
|
-
return { path:
|
|
17234
|
+
return { path: path22, code, message: `\xAB${target.label}\xBB is invalid` };
|
|
17238
17235
|
}
|
|
17239
17236
|
|
|
17240
|
-
// ../../flow-extension-runner/src/
|
|
17237
|
+
// ../../flow-extension-runner/src/params/schema/normalize.ts
|
|
17241
17238
|
var resolved2 = (value) => ({ value, present: true, issues: [] });
|
|
17242
17239
|
var rejected = (issues) => ({ present: false, issues });
|
|
17243
17240
|
function isAbsent(value, plan2) {
|
|
@@ -17345,7 +17342,7 @@ function restoreDeep(output, original, schema) {
|
|
|
17345
17342
|
}
|
|
17346
17343
|
var isPlain = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
17347
17344
|
|
|
17348
|
-
// ../../flow-extension-runner/src/
|
|
17345
|
+
// ../../flow-extension-runner/src/params/schema/parse.ts
|
|
17349
17346
|
var EXPECTED2 = {
|
|
17350
17347
|
string: "a string",
|
|
17351
17348
|
number: "a number",
|
|
@@ -17355,10 +17352,10 @@ var EXPECTED2 = {
|
|
|
17355
17352
|
};
|
|
17356
17353
|
function toIssues(error, param) {
|
|
17357
17354
|
return (error?.issues ?? []).map((issue) => {
|
|
17358
|
-
const
|
|
17355
|
+
const path22 = (issue.path ?? []).map(String).join(".");
|
|
17359
17356
|
const expected = issue.expected;
|
|
17360
|
-
const restated = param && !
|
|
17361
|
-
return { path:
|
|
17357
|
+
const restated = param && !path22 && issue.code === "invalid_type" && expected ? `\xAB${param}\xBB must be ${EXPECTED2[expected] ?? expected}` : void 0;
|
|
17358
|
+
return { path: path22, message: restated ?? issue.message ?? "invalid value", code: issue.code };
|
|
17362
17359
|
});
|
|
17363
17360
|
}
|
|
17364
17361
|
function parseSchema(schema, value, fail3, param) {
|
|
@@ -17372,7 +17369,7 @@ function parseSchema(schema, value, fail3, param) {
|
|
|
17372
17369
|
return result.data;
|
|
17373
17370
|
}
|
|
17374
17371
|
|
|
17375
|
-
// ../../flow-extension-runner/src/
|
|
17372
|
+
// ../../flow-extension-runner/src/params/params.ts
|
|
17376
17373
|
var Params = class {
|
|
17377
17374
|
constructor(scheme, source = {}) {
|
|
17378
17375
|
this.source = source;
|
|
@@ -17427,7 +17424,7 @@ var Params = class {
|
|
|
17427
17424
|
}
|
|
17428
17425
|
};
|
|
17429
17426
|
|
|
17430
|
-
// ../../flow-extension-runner/src/
|
|
17427
|
+
// ../../flow-extension-runner/src/params/config-params.ts
|
|
17431
17428
|
var ConfigParams = class _ConfigParams extends Params {
|
|
17432
17429
|
static of(scheme, source = {}) {
|
|
17433
17430
|
return new _ConfigParams(scheme, source);
|
|
@@ -17450,7 +17447,7 @@ var ConfigParams = class _ConfigParams extends Params {
|
|
|
17450
17447
|
}
|
|
17451
17448
|
};
|
|
17452
17449
|
|
|
17453
|
-
// ../../flow-extension-runner/src/
|
|
17450
|
+
// ../../flow-extension-runner/src/params/method-params.ts
|
|
17454
17451
|
var MethodParams = class _MethodParams extends Params {
|
|
17455
17452
|
static of(scheme, source = {}) {
|
|
17456
17453
|
return new _MethodParams(scheme, source);
|
|
@@ -17476,10 +17473,10 @@ var MethodParams = class _MethodParams extends Params {
|
|
|
17476
17473
|
}
|
|
17477
17474
|
};
|
|
17478
17475
|
|
|
17479
|
-
// ../../flow-extension-runner/src/
|
|
17476
|
+
// ../../flow-extension-runner/src/params/zod.ts
|
|
17480
17477
|
var import_zod3 = require("zod");
|
|
17481
17478
|
|
|
17482
|
-
// ../../flow-extension-runner/src/
|
|
17479
|
+
// ../../flow-extension-runner/src/params/files-options.ts
|
|
17483
17480
|
var import_zod2 = require("zod");
|
|
17484
17481
|
var SCOPE_VALUES = ["WORKSPACE", "FLOW", "EXECUTION"];
|
|
17485
17482
|
var scope = () => import_zod2.z.enum(SCOPE_VALUES).label("Scope").describe("Storage scope: WORKSPACE (shared across flows), FLOW (this flow only), EXECUTION (this run only)").default("FLOW");
|
|
@@ -17535,7 +17532,7 @@ function filesDeleteOptions(include) {
|
|
|
17535
17532
|
return group("filesDeleteOptions", FlowExtensionParamWidgetTypes.FILE_DELETE_OPTIONS, DELETE_FIELDS, include);
|
|
17536
17533
|
}
|
|
17537
17534
|
|
|
17538
|
-
// ../../flow-extension-runner/src/
|
|
17535
|
+
// ../../flow-extension-runner/src/params/zod.ts
|
|
17539
17536
|
var extended = false;
|
|
17540
17537
|
function extendPrototype() {
|
|
17541
17538
|
if (extended) {
|
|
@@ -17606,7 +17603,7 @@ Object.defineProperties(namespace, {
|
|
|
17606
17603
|
});
|
|
17607
17604
|
var z2 = namespace;
|
|
17608
17605
|
|
|
17609
|
-
// ../../flow-extension-runner/src/
|
|
17606
|
+
// ../../flow-extension-runner/src/params/json/values.ts
|
|
17610
17607
|
function toJsonValue(value) {
|
|
17611
17608
|
if (typeof value === "bigint") {
|
|
17612
17609
|
return { $bigint: value.toString() };
|
|
@@ -17623,7 +17620,7 @@ function toJsonValue(value) {
|
|
|
17623
17620
|
return value;
|
|
17624
17621
|
}
|
|
17625
17622
|
|
|
17626
|
-
// ../../flow-extension-runner/src/
|
|
17623
|
+
// ../../flow-extension-runner/src/params/json/checks.ts
|
|
17627
17624
|
var defOf = (check) => check?._zod?.def ?? {};
|
|
17628
17625
|
function messageOf(source) {
|
|
17629
17626
|
const { error } = source;
|
|
@@ -17702,10 +17699,10 @@ function encodeChecks(core) {
|
|
|
17702
17699
|
return { checks, unsupported };
|
|
17703
17700
|
}
|
|
17704
17701
|
|
|
17705
|
-
// ../../flow-extension-runner/src/
|
|
17702
|
+
// ../../flow-extension-runner/src/params/json/types.ts
|
|
17706
17703
|
var SCHEMA_JSON_VERSION = 1;
|
|
17707
17704
|
|
|
17708
|
-
// ../../flow-extension-runner/src/
|
|
17705
|
+
// ../../flow-extension-runner/src/params/json/decode.ts
|
|
17709
17706
|
var FORMAT_FACTORIES = {
|
|
17710
17707
|
url: z2.url,
|
|
17711
17708
|
email: z2.email,
|
|
@@ -17735,7 +17732,7 @@ var FORMAT_FACTORIES = {
|
|
|
17735
17732
|
duration: z2.iso?.duration
|
|
17736
17733
|
};
|
|
17737
17734
|
|
|
17738
|
-
// ../../flow-extension-runner/src/
|
|
17735
|
+
// ../../flow-extension-runner/src/params/json/encode.ts
|
|
17739
17736
|
var FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
17740
17737
|
"string",
|
|
17741
17738
|
"number",
|
|
@@ -17903,7 +17900,7 @@ function encodeParams(scheme, options = {}) {
|
|
|
17903
17900
|
};
|
|
17904
17901
|
}
|
|
17905
17902
|
|
|
17906
|
-
// ../../flow-extension-runner/src/
|
|
17903
|
+
// ../../flow-extension-runner/src/context/method-input.ts
|
|
17907
17904
|
var MethodInput = class {
|
|
17908
17905
|
constructor(serviceId, methodName, data = {}) {
|
|
17909
17906
|
this.serviceId = serviceId;
|
|
@@ -17961,7 +17958,7 @@ var MethodInput = class {
|
|
|
17961
17958
|
}
|
|
17962
17959
|
};
|
|
17963
17960
|
|
|
17964
|
-
// ../../flow-extension-runner/src/
|
|
17961
|
+
// ../../flow-extension-runner/src/method.ts
|
|
17965
17962
|
var ExtensionMethod = class {
|
|
17966
17963
|
constructor(extension) {
|
|
17967
17964
|
this.extension = extension;
|
|
@@ -17990,7 +17987,7 @@ var ExtensionMethod = class {
|
|
|
17990
17987
|
}
|
|
17991
17988
|
};
|
|
17992
17989
|
|
|
17993
|
-
// ../../flow-extension-runner/src/
|
|
17990
|
+
// ../../flow-extension-runner/src/params/config-types.ts
|
|
17994
17991
|
var ServiceConfigItemTypes = {
|
|
17995
17992
|
STRING: "string",
|
|
17996
17993
|
BOOL: "bool",
|
|
@@ -17999,7 +17996,7 @@ var ServiceConfigItemTypes = {
|
|
|
17999
17996
|
TEXT: "text"
|
|
18000
17997
|
};
|
|
18001
17998
|
|
|
18002
|
-
// ../../flow-extension-runner/src/
|
|
17999
|
+
// ../../flow-extension-runner/src/model/field-mapper.ts
|
|
18003
18000
|
var descriptionOf = (schema) => inspect(schema).meta.description || "";
|
|
18004
18001
|
var isRequired = (schema) => absenceOf(schema).absence === "required";
|
|
18005
18002
|
var isParamGroup = (ins) => ins.coreType === "object" && !!ins.meta.frWidget;
|
|
@@ -18106,7 +18103,7 @@ function fieldToConfigItem(name, schema) {
|
|
|
18106
18103
|
};
|
|
18107
18104
|
}
|
|
18108
18105
|
|
|
18109
|
-
// ../../flow-extension-runner/src/
|
|
18106
|
+
// ../../flow-extension-runner/src/model/method-model.ts
|
|
18110
18107
|
function opaqueParam(name, type = "OBJECT") {
|
|
18111
18108
|
return { name, required: false, description: "", type };
|
|
18112
18109
|
}
|
|
@@ -18128,7 +18125,7 @@ function argsFromParams(params) {
|
|
|
18128
18125
|
return args;
|
|
18129
18126
|
}
|
|
18130
18127
|
|
|
18131
|
-
// ../../flow-extension-runner/src/
|
|
18128
|
+
// ../../flow-extension-runner/src/model/params-model.ts
|
|
18132
18129
|
function toBodyParams(params) {
|
|
18133
18130
|
const scope2 = DictionaryScope.ROOT.enter(params.keys());
|
|
18134
18131
|
return params.fields().map(([name, schema]) => fieldToParam(name, schema, { scope: scope2 }));
|
|
@@ -18147,7 +18144,7 @@ function toConfigItems(config) {
|
|
|
18147
18144
|
return config.fields().map(([name, schema]) => fieldToConfigItem(name, schema));
|
|
18148
18145
|
}
|
|
18149
18146
|
|
|
18150
|
-
// ../../flow-extension-runner/src/
|
|
18147
|
+
// ../../flow-extension-runner/src/result.ts
|
|
18151
18148
|
function inferReturnType(value) {
|
|
18152
18149
|
if (Array.isArray(value)) {
|
|
18153
18150
|
return "LIST";
|
|
@@ -18215,7 +18212,7 @@ var ResultSpec = class _ResultSpec {
|
|
|
18215
18212
|
}
|
|
18216
18213
|
};
|
|
18217
18214
|
|
|
18218
|
-
// ../../flow-extension-runner/src/
|
|
18215
|
+
// ../../flow-extension-runner/src/actions/action-method.ts
|
|
18219
18216
|
var ActionMethod = class extends ExtensionMethod {
|
|
18220
18217
|
constructor(extension, props) {
|
|
18221
18218
|
super(extension);
|
|
@@ -18341,7 +18338,7 @@ var ActionMethod = class extends ExtensionMethod {
|
|
|
18341
18338
|
}
|
|
18342
18339
|
};
|
|
18343
18340
|
|
|
18344
|
-
// ../../flow-extension-runner/src/
|
|
18341
|
+
// ../../flow-extension-runner/src/context/files.ts
|
|
18345
18342
|
var import_backendless_request = __toESM(require_lib());
|
|
18346
18343
|
var FileScope = {
|
|
18347
18344
|
WORKSPACE: "WORKSPACE",
|
|
@@ -18349,7 +18346,7 @@ var FileScope = {
|
|
|
18349
18346
|
EXECUTION: "EXECUTION"
|
|
18350
18347
|
};
|
|
18351
18348
|
|
|
18352
|
-
// ../../flow-extension-runner/src/
|
|
18349
|
+
// ../../flow-extension-runner/src/context/logger.ts
|
|
18353
18350
|
var defaultLogger = {
|
|
18354
18351
|
debug: () => {
|
|
18355
18352
|
},
|
|
@@ -18359,7 +18356,7 @@ var defaultLogger = {
|
|
|
18359
18356
|
error: (...args) => console.error(...args)
|
|
18360
18357
|
};
|
|
18361
18358
|
|
|
18362
|
-
// ../../flow-extension-runner/src/
|
|
18359
|
+
// ../../flow-extension-runner/src/context/proxies.ts
|
|
18363
18360
|
function createThrowingProxy(feature, hint3) {
|
|
18364
18361
|
const fail3 = () => {
|
|
18365
18362
|
throw new FeatureNotEnabledError(feature, hint3);
|
|
@@ -18379,7 +18376,7 @@ function createThrowingProxy(feature, hint3) {
|
|
|
18379
18376
|
);
|
|
18380
18377
|
}
|
|
18381
18378
|
|
|
18382
|
-
// ../../flow-extension-runner/src/
|
|
18379
|
+
// ../../flow-extension-runner/src/context/execution-context.ts
|
|
18383
18380
|
var ExecutionContext = class _ExecutionContext {
|
|
18384
18381
|
#extension;
|
|
18385
18382
|
#options;
|
|
@@ -18481,14 +18478,14 @@ var ExecutionContext = class _ExecutionContext {
|
|
|
18481
18478
|
}
|
|
18482
18479
|
};
|
|
18483
18480
|
|
|
18484
|
-
// ../../flow-extension-runner/src/
|
|
18481
|
+
// ../../flow-extension-runner/src/dictionaries/payload-schema.ts
|
|
18485
18482
|
var DictionaryPayloadSchema = z2.looseObject({
|
|
18486
18483
|
search: z2.string().optional(),
|
|
18487
18484
|
cursor: z2.union([z2.string(), z2.number()]).nullish(),
|
|
18488
18485
|
criteria: z2.record(z2.string(), z2.unknown()).optional()
|
|
18489
18486
|
});
|
|
18490
18487
|
|
|
18491
|
-
// ../../flow-extension-runner/src/
|
|
18488
|
+
// ../../flow-extension-runner/src/dictionaries/dictionary-method.ts
|
|
18492
18489
|
var isBlank2 = (value) => value === void 0 || value === null || value === "";
|
|
18493
18490
|
var DictionaryMethod = class extends ExtensionMethod {
|
|
18494
18491
|
constructor(extension, props) {
|
|
@@ -18633,7 +18630,7 @@ var DictionaryMethod = class extends ExtensionMethod {
|
|
|
18633
18630
|
};
|
|
18634
18631
|
}
|
|
18635
18632
|
// Describe the full payload shape so the method advertises a complete, labelled input scheme (nested
|
|
18636
|
-
// props inline their own labels — mirroring the v1
|
|
18633
|
+
// props inline their own labels — mirroring the layout the v1 JSDoc parser established).
|
|
18637
18634
|
#payloadParam() {
|
|
18638
18635
|
const properties = [
|
|
18639
18636
|
{ name: "search", required: false, description: "Optional search string to filter results.", type: "STRING", label: "Search" },
|
|
@@ -18659,12 +18656,12 @@ var DictionaryMethod = class extends ExtensionMethod {
|
|
|
18659
18656
|
}
|
|
18660
18657
|
};
|
|
18661
18658
|
|
|
18662
|
-
// ../../flow-extension-runner/src/
|
|
18659
|
+
// ../../flow-extension-runner/src/loaders/payload-schema.ts
|
|
18663
18660
|
var LoaderPayloadSchema = z2.looseObject({
|
|
18664
18661
|
criteria: z2.record(z2.string(), z2.unknown()).optional()
|
|
18665
18662
|
});
|
|
18666
18663
|
|
|
18667
|
-
// ../../flow-extension-runner/src/
|
|
18664
|
+
// ../../flow-extension-runner/src/loaders/loader-method.ts
|
|
18668
18665
|
var LoaderMethod = class extends ExtensionMethod {
|
|
18669
18666
|
constructor(extension, owner) {
|
|
18670
18667
|
super(extension);
|
|
@@ -18818,17 +18815,17 @@ var DynamicPropsLoaderMethod = class extends ParamsLoaderMethod {
|
|
|
18818
18815
|
}
|
|
18819
18816
|
};
|
|
18820
18817
|
|
|
18821
|
-
// ../../flow-extension-runner/src/
|
|
18818
|
+
// ../../flow-extension-runner/src/oauth/oauth2.ts
|
|
18822
18819
|
var import_crypto = __toESM(require("crypto"));
|
|
18823
18820
|
|
|
18824
|
-
// ../../flow-extension-runner/src/
|
|
18821
|
+
// ../../flow-extension-runner/src/oauth/method-names.ts
|
|
18825
18822
|
var OAUTH_SYSTEM_METHODS = {
|
|
18826
18823
|
CONNECTION_URL: "getOAuth2ConnectionURL",
|
|
18827
18824
|
EXECUTE_CALLBACK: "executeCallback",
|
|
18828
18825
|
REFRESH_TOKEN: "refreshToken"
|
|
18829
18826
|
};
|
|
18830
18827
|
|
|
18831
|
-
// ../../flow-extension-runner/src/
|
|
18828
|
+
// ../../flow-extension-runner/src/oauth/system-params.ts
|
|
18832
18829
|
var OAuthCallbackObjectSchema = z2.looseObject({
|
|
18833
18830
|
code: z2.string().optional(),
|
|
18834
18831
|
redirectURI: z2.string().optional(),
|
|
@@ -18837,7 +18834,7 @@ var OAuthCallbackObjectSchema = z2.looseObject({
|
|
|
18837
18834
|
});
|
|
18838
18835
|
var RefreshTokenSchema = z2.string().min(1);
|
|
18839
18836
|
|
|
18840
|
-
// ../../flow-extension-runner/src/
|
|
18837
|
+
// ../../flow-extension-runner/src/oauth/oauth2.ts
|
|
18841
18838
|
var OAuth2 = class {
|
|
18842
18839
|
constructor(extension, props) {
|
|
18843
18840
|
this.extension = extension;
|
|
@@ -18982,10 +18979,10 @@ function userDataOf(token) {
|
|
|
18982
18979
|
return token && typeof token === "object" ? token.userData : void 0;
|
|
18983
18980
|
}
|
|
18984
18981
|
|
|
18985
|
-
// ../../flow-extension-runner/src/
|
|
18982
|
+
// ../../flow-extension-runner/src/polling-triggers/method-names.ts
|
|
18986
18983
|
var POLLING_SYSTEM_METHOD = "handleTriggerPollingForEvent";
|
|
18987
18984
|
|
|
18988
|
-
// ../../flow-extension-runner/src/
|
|
18985
|
+
// ../../flow-extension-runner/src/polling-triggers/system-params.ts
|
|
18989
18986
|
var PollingInvocationSchema = z2.looseObject({
|
|
18990
18987
|
eventName: z2.string().min(1),
|
|
18991
18988
|
// The trigger instance's configured params — validated against the trigger's own schema separately.
|
|
@@ -18995,7 +18992,7 @@ var PollingInvocationSchema = z2.looseObject({
|
|
|
18995
18992
|
connectionId: z2.string().nullish()
|
|
18996
18993
|
});
|
|
18997
18994
|
|
|
18998
|
-
// ../../flow-extension-runner/src/
|
|
18995
|
+
// ../../flow-extension-runner/src/polling-triggers/polling-triggers.ts
|
|
18999
18996
|
var PollingTriggers = class {
|
|
19000
18997
|
constructor(extension) {
|
|
19001
18998
|
this.extension = extension;
|
|
@@ -19034,15 +19031,15 @@ var PollingTriggers = class {
|
|
|
19034
19031
|
}
|
|
19035
19032
|
};
|
|
19036
19033
|
|
|
19037
|
-
// ../../flow-extension-runner/src/
|
|
19038
|
-
function getPath(source,
|
|
19039
|
-
return
|
|
19034
|
+
// ../../flow-extension-runner/src/path.ts
|
|
19035
|
+
function getPath(source, path22) {
|
|
19036
|
+
return path22.split(".").reduce(
|
|
19040
19037
|
(acc, key) => acc == null ? acc : acc[key],
|
|
19041
19038
|
source
|
|
19042
19039
|
);
|
|
19043
19040
|
}
|
|
19044
19041
|
|
|
19045
|
-
// ../../flow-extension-runner/src/
|
|
19042
|
+
// ../../flow-extension-runner/src/polling-triggers/mechanisms.ts
|
|
19046
19043
|
var PollingMechanism = class {
|
|
19047
19044
|
/**
|
|
19048
19045
|
* Pick the strategy an author declared, rejecting the combinations that cannot work. Runs at REGISTRATION
|
|
@@ -19176,7 +19173,7 @@ var WatermarkMechanism = class extends FetchingMechanism {
|
|
|
19176
19173
|
}
|
|
19177
19174
|
};
|
|
19178
19175
|
|
|
19179
|
-
// ../../flow-extension-runner/src/
|
|
19176
|
+
// ../../flow-extension-runner/src/polling-triggers/trigger-method.ts
|
|
19180
19177
|
var PollingTriggerMethod = class extends ExtensionMethod {
|
|
19181
19178
|
constructor(extension, props) {
|
|
19182
19179
|
super(extension);
|
|
@@ -19246,7 +19243,7 @@ var PollingTriggerMethod = class extends ExtensionMethod {
|
|
|
19246
19243
|
}
|
|
19247
19244
|
};
|
|
19248
19245
|
|
|
19249
|
-
// ../../flow-extension-runner/src/
|
|
19246
|
+
// ../../flow-extension-runner/src/realtime-triggers/method-names.ts
|
|
19250
19247
|
var REALTIME_SYSTEM_METHODS = {
|
|
19251
19248
|
UPSERT: "handleTriggerUpsertWebhook",
|
|
19252
19249
|
RESOLVE: "handleTriggerResolveEvents",
|
|
@@ -19255,7 +19252,7 @@ var REALTIME_SYSTEM_METHODS = {
|
|
|
19255
19252
|
REFRESH: "handleTriggerRefreshWebhook"
|
|
19256
19253
|
};
|
|
19257
19254
|
|
|
19258
|
-
// ../../flow-extension-runner/src/
|
|
19255
|
+
// ../../flow-extension-runner/src/realtime-triggers/system-params.ts
|
|
19259
19256
|
var anyRecord = () => z2.record(z2.string(), z2.unknown());
|
|
19260
19257
|
var SubscriptionEventSchema = z2.looseObject({
|
|
19261
19258
|
name: z2.string().min(1),
|
|
@@ -19291,7 +19288,7 @@ var RealtimeSelectInvocationSchema = z2.looseObject({
|
|
|
19291
19288
|
})).default([])
|
|
19292
19289
|
});
|
|
19293
19290
|
|
|
19294
|
-
// ../../flow-extension-runner/src/
|
|
19291
|
+
// ../../flow-extension-runner/src/realtime-triggers/verify.ts
|
|
19295
19292
|
function verifyDeclarative(verify, rawBody, headers, config, webhookData) {
|
|
19296
19293
|
const secret = verify.secret(config, { webhookData });
|
|
19297
19294
|
if (!secret) {
|
|
@@ -19314,7 +19311,7 @@ function verifyDeclarative(verify, rawBody, headers, config, webhookData) {
|
|
|
19314
19311
|
return true;
|
|
19315
19312
|
}
|
|
19316
19313
|
|
|
19317
|
-
// ../../flow-extension-runner/src/
|
|
19314
|
+
// ../../flow-extension-runner/src/realtime-triggers/realtime-setup.ts
|
|
19318
19315
|
function readExtract(extract, body) {
|
|
19319
19316
|
if (typeof extract === "function") {
|
|
19320
19317
|
return extract({ requestBody: body });
|
|
@@ -19610,7 +19607,7 @@ var RealtimeSetup = class {
|
|
|
19610
19607
|
}
|
|
19611
19608
|
};
|
|
19612
19609
|
|
|
19613
|
-
// ../../flow-extension-runner/src/
|
|
19610
|
+
// ../../flow-extension-runner/src/realtime-triggers/trigger-method.ts
|
|
19614
19611
|
function isFilled(value) {
|
|
19615
19612
|
return value != null && value !== "";
|
|
19616
19613
|
}
|
|
@@ -19706,12 +19703,12 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
|
|
|
19706
19703
|
if (typeof match === "function") {
|
|
19707
19704
|
return !!await match({ params, providerEventData, webhookData });
|
|
19708
19705
|
}
|
|
19709
|
-
for (const [paramKey,
|
|
19706
|
+
for (const [paramKey, path22] of Object.entries(match)) {
|
|
19710
19707
|
const paramValue = params[paramKey];
|
|
19711
19708
|
if (!isFilled(paramValue)) {
|
|
19712
19709
|
continue;
|
|
19713
19710
|
}
|
|
19714
|
-
if (`${paramValue}` !== `${getPath(providerEventData,
|
|
19711
|
+
if (`${paramValue}` !== `${getPath(providerEventData, path22)}`) {
|
|
19715
19712
|
return false;
|
|
19716
19713
|
}
|
|
19717
19714
|
}
|
|
@@ -19747,7 +19744,7 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
|
|
|
19747
19744
|
}
|
|
19748
19745
|
};
|
|
19749
19746
|
|
|
19750
|
-
// ../../flow-extension-runner/src/
|
|
19747
|
+
// ../../flow-extension-runner/src/system-method.ts
|
|
19751
19748
|
var SystemMethod = class extends ExtensionMethod {
|
|
19752
19749
|
constructor(extension, spec) {
|
|
19753
19750
|
super(extension);
|
|
@@ -19804,7 +19801,7 @@ var SystemMethod = class extends ExtensionMethod {
|
|
|
19804
19801
|
}
|
|
19805
19802
|
};
|
|
19806
19803
|
|
|
19807
|
-
// ../../flow-extension-runner/src/
|
|
19804
|
+
// ../../flow-extension-runner/src/extension.ts
|
|
19808
19805
|
var Extension = class {
|
|
19809
19806
|
#props;
|
|
19810
19807
|
#config;
|
|
@@ -19960,8 +19957,8 @@ var Extension = class {
|
|
|
19960
19957
|
};
|
|
19961
19958
|
}
|
|
19962
19959
|
/**
|
|
19963
|
-
* The published model — the
|
|
19964
|
-
*
|
|
19960
|
+
* The published model — the `{ serviceInfo, methodsMap }` shape the console consumes, the same one the
|
|
19961
|
+
* removed v1 JSDoc parser produced.
|
|
19965
19962
|
*
|
|
19966
19963
|
* Every method describes itself, so this is one pass with no per-kind branches: what a service publishes
|
|
19967
19964
|
* is exactly what it registered.
|
|
@@ -19974,8 +19971,6 @@ var Extension = class {
|
|
|
19974
19971
|
}
|
|
19975
19972
|
}
|
|
19976
19973
|
return {
|
|
19977
|
-
runnerVersion: "v2",
|
|
19978
|
-
//TODO: temp
|
|
19979
19974
|
serviceInfo: this.toServiceInfo(),
|
|
19980
19975
|
methodsMap,
|
|
19981
19976
|
configSchema: encodeParams(this.config.scheme)
|
|
@@ -20015,7 +20010,7 @@ var Extension = class {
|
|
|
20015
20010
|
}
|
|
20016
20011
|
};
|
|
20017
20012
|
|
|
20018
|
-
// ../../flow-extension-runner/src/
|
|
20013
|
+
// ../../flow-extension-runner/src/registry.ts
|
|
20019
20014
|
var ExtensionRegistry = class {
|
|
20020
20015
|
#extensions = /* @__PURE__ */ new Map();
|
|
20021
20016
|
register(extension) {
|
|
@@ -20035,15 +20030,19 @@ var ExtensionRegistry = class {
|
|
|
20035
20030
|
* which imports it.
|
|
20036
20031
|
*/
|
|
20037
20032
|
load(id, entryPointPath) {
|
|
20038
|
-
|
|
20039
|
-
require(entryPointPath);
|
|
20040
|
-
}
|
|
20041
|
-
const extension = this.get(id);
|
|
20033
|
+
const extension = this.tryLoad(id, entryPointPath);
|
|
20042
20034
|
if (!extension) {
|
|
20043
20035
|
throw new ExtensionNotRegisteredError(id, entryPointPath);
|
|
20044
20036
|
}
|
|
20045
20037
|
return extension;
|
|
20046
20038
|
}
|
|
20039
|
+
/** As `load`, but `undefined` instead of throwing when the module registers no extension under `id`. */
|
|
20040
|
+
tryLoad(id, entryPointPath) {
|
|
20041
|
+
if (!this.get(id)) {
|
|
20042
|
+
require(entryPointPath);
|
|
20043
|
+
}
|
|
20044
|
+
return this.get(id);
|
|
20045
|
+
}
|
|
20047
20046
|
// Test-only: clear the registry between isolated cases.
|
|
20048
20047
|
reset() {
|
|
20049
20048
|
this.#extensions.clear();
|
|
@@ -20054,7 +20053,7 @@ function getExtension(id) {
|
|
|
20054
20053
|
return registry.get(id);
|
|
20055
20054
|
}
|
|
20056
20055
|
|
|
20057
|
-
// ../../flow-extension-runner/src/
|
|
20056
|
+
// ../../flow-extension-runner/src/create-extension.ts
|
|
20058
20057
|
function createExtension(props) {
|
|
20059
20058
|
const extension = new Extension(props);
|
|
20060
20059
|
const api = {
|
|
@@ -20082,7 +20081,7 @@ function createExtension(props) {
|
|
|
20082
20081
|
return api;
|
|
20083
20082
|
}
|
|
20084
20083
|
|
|
20085
|
-
// ../../flow-extension-runner/src/
|
|
20084
|
+
// ../../flow-extension-runner/src/crypto.ts
|
|
20086
20085
|
var import_crypto2 = __toESM(require("crypto"));
|
|
20087
20086
|
var crypto2 = {
|
|
20088
20087
|
hmac(algo, key, data, encoding = "hex") {
|
|
@@ -20118,689 +20117,99 @@ var flowrunnerRuntime = {
|
|
|
20118
20117
|
z: z2,
|
|
20119
20118
|
crypto: crypto2,
|
|
20120
20119
|
createExtension,
|
|
20121
|
-
getExtension
|
|
20122
|
-
ServerCode: null
|
|
20120
|
+
getExtension
|
|
20123
20121
|
};
|
|
20124
20122
|
global.Flowrunner = flowrunnerRuntime;
|
|
20125
20123
|
|
|
20126
|
-
// ../../flow-extension-runner/src/
|
|
20127
|
-
var ConfigValueAdapters = {
|
|
20128
|
-
[ServiceConfigItemTypes.BOOL]: {
|
|
20129
|
-
deserialize: (value) => typeof value === "string" ? value === "true" : !!value,
|
|
20130
|
-
isEmpty: (value) => typeof value !== "boolean"
|
|
20131
|
-
},
|
|
20132
|
-
default: {
|
|
20133
|
-
deserialize: (value) => value,
|
|
20134
|
-
isEmpty: (value) => !value
|
|
20135
|
-
}
|
|
20136
|
-
};
|
|
20137
|
-
|
|
20138
|
-
// ../../flow-extension-runner/src/v1/config.ts
|
|
20139
|
-
function normalizeConfigItems(sourceConfigItems) {
|
|
20140
|
-
return sourceConfigItems?.map((item) => ({
|
|
20141
|
-
name: item.name,
|
|
20142
|
-
type: item.type || ServiceConfigItemTypes.STRING,
|
|
20143
|
-
shared: !!item.shared,
|
|
20144
|
-
required: !!item.required,
|
|
20145
|
-
description: item.description || item.hint || "",
|
|
20146
|
-
label: item.label || item.displayName || item.name,
|
|
20147
|
-
defaultValue: item.defaultValue,
|
|
20148
|
-
options: item.options || []
|
|
20149
|
-
})) || [];
|
|
20150
|
-
}
|
|
20151
|
-
|
|
20152
|
-
// ../../flow-extension-runner/src/v1/namespace.ts
|
|
20153
|
-
var services = /* @__PURE__ */ new Map();
|
|
20154
|
-
function createFlowrunnerSandboxV1(serviceId, cb) {
|
|
20155
|
-
global.Flowrunner.ServerCode = {
|
|
20156
|
-
addService(ServiceClass, sourceConfigItems) {
|
|
20157
|
-
services.set(serviceId, {
|
|
20158
|
-
ServiceClass,
|
|
20159
|
-
configItems: normalizeConfigItems(sourceConfigItems)
|
|
20160
|
-
});
|
|
20161
|
-
},
|
|
20162
|
-
ConfigItems: {
|
|
20163
|
-
TYPES: ServiceConfigItemTypes
|
|
20164
|
-
}
|
|
20165
|
-
};
|
|
20166
|
-
try {
|
|
20167
|
-
cb();
|
|
20168
|
-
} finally {
|
|
20169
|
-
global.Flowrunner.ServerCode = null;
|
|
20170
|
-
}
|
|
20171
|
-
return services.get(serviceId);
|
|
20172
|
-
}
|
|
20173
|
-
|
|
20174
|
-
// ../../flow-extension-runner/src/v1/service.ts
|
|
20175
|
-
function requireService(serviceId, serviceEntryPointPath) {
|
|
20176
|
-
const registered = createFlowrunnerSandboxV1(serviceId, () => {
|
|
20177
|
-
require(serviceEntryPointPath);
|
|
20178
|
-
});
|
|
20179
|
-
if (!registered?.ServiceClass) {
|
|
20180
|
-
throw new Error(`There is no registered ServiceClass serviceEntryPointPath="${serviceEntryPointPath}"`);
|
|
20181
|
-
}
|
|
20182
|
-
return registered;
|
|
20183
|
-
}
|
|
20124
|
+
// ../../flow-extension-runner/src/index.ts
|
|
20184
20125
|
function getServiceConfigs(serviceId, serviceEntryPointPath) {
|
|
20185
|
-
const { configItems } = requireService(serviceId, serviceEntryPointPath);
|
|
20186
|
-
return configItems;
|
|
20187
|
-
}
|
|
20188
|
-
|
|
20189
|
-
// ../../flow-extension-runner/src/v2/index.ts
|
|
20190
|
-
function getServiceConfigs2(serviceId, serviceEntryPointPath) {
|
|
20191
20126
|
return registry.load(serviceId, serviceEntryPointPath).toConfigItems();
|
|
20192
20127
|
}
|
|
20193
20128
|
function buildServiceDefinition(serviceId, serviceEntryPointPath) {
|
|
20194
|
-
return registry.
|
|
20195
|
-
}
|
|
20196
|
-
|
|
20197
|
-
// ../../flow-extension-runner/src/index.ts
|
|
20198
|
-
function detectVersion(serviceId, serviceEntryPointPath) {
|
|
20199
|
-
createFlowrunnerSandboxV1(serviceId, () => {
|
|
20200
|
-
require(serviceEntryPointPath);
|
|
20201
|
-
});
|
|
20202
|
-
return getExtension(serviceId) ? "v2" : "v1";
|
|
20203
|
-
}
|
|
20204
|
-
function getServiceConfigs3(serviceId, serviceEntryPointPath) {
|
|
20205
|
-
return detectVersion(serviceId, serviceEntryPointPath) === "v2" ? getServiceConfigs2(serviceId, serviceEntryPointPath) : getServiceConfigs(serviceId, serviceEntryPointPath);
|
|
20206
|
-
}
|
|
20207
|
-
function buildServiceDefinition2(serviceId, serviceEntryPointPath) {
|
|
20208
|
-
return detectVersion(serviceId, serviceEntryPointPath) === "v2" ? buildServiceDefinition(serviceId, serviceEntryPointPath) : null;
|
|
20209
|
-
}
|
|
20210
|
-
|
|
20211
|
-
// ../../jsdoc-parser/src/custom-type-defs/files.ts
|
|
20212
|
-
var SCOPE_FIELD = {
|
|
20213
|
-
name: "scope",
|
|
20214
|
-
type: "String",
|
|
20215
|
-
required: false,
|
|
20216
|
-
label: "Scope",
|
|
20217
|
-
description: "Storage scope: WORKSPACE (shared across flows), FLOW (this flow only), EXECUTION (this run only)",
|
|
20218
|
-
uiComponent: { type: "DROPDOWN", options: { values: ["WORKSPACE", "FLOW", "EXECUTION"] } },
|
|
20219
|
-
defaultValue: "FLOW"
|
|
20220
|
-
};
|
|
20221
|
-
var filesTypeDefs = {
|
|
20222
|
-
FilesUploadOptions: [
|
|
20223
|
-
SCOPE_FIELD,
|
|
20224
|
-
{
|
|
20225
|
-
name: "filename",
|
|
20226
|
-
type: "String",
|
|
20227
|
-
required: false,
|
|
20228
|
-
label: "Filename",
|
|
20229
|
-
description: "Custom filename (defaults to the original name if omitted)",
|
|
20230
|
-
uiComponent: { type: "SINGLE_LINE_TEXT" }
|
|
20231
|
-
},
|
|
20232
|
-
{
|
|
20233
|
-
name: "ttl",
|
|
20234
|
-
type: "Number",
|
|
20235
|
-
required: false,
|
|
20236
|
-
label: "URL TTL (seconds)",
|
|
20237
|
-
description: "How long the download URL remains valid",
|
|
20238
|
-
uiComponent: { type: "NUMERIC" }
|
|
20239
|
-
},
|
|
20240
|
-
{
|
|
20241
|
-
name: "objectTtl",
|
|
20242
|
-
type: "Number",
|
|
20243
|
-
required: false,
|
|
20244
|
-
label: "File TTL (seconds)",
|
|
20245
|
-
description: "How long the file is kept in storage (omit for permanent storage)",
|
|
20246
|
-
uiComponent: { type: "NUMERIC" }
|
|
20247
|
-
},
|
|
20248
|
-
{
|
|
20249
|
-
name: "overwrite",
|
|
20250
|
-
type: "Boolean",
|
|
20251
|
-
required: false,
|
|
20252
|
-
label: "Overwrite existing",
|
|
20253
|
-
description: "Replace the file if one with the same name already exists",
|
|
20254
|
-
uiComponent: { type: "TOGGLE" }
|
|
20255
|
-
},
|
|
20256
|
-
{
|
|
20257
|
-
name: "generateUrl",
|
|
20258
|
-
type: "Boolean",
|
|
20259
|
-
required: false,
|
|
20260
|
-
label: "Generate download URL",
|
|
20261
|
-
description: "Include a pre-signed download URL in the response",
|
|
20262
|
-
uiComponent: { type: "TOGGLE" },
|
|
20263
|
-
defaultValue: true
|
|
20264
|
-
}
|
|
20265
|
-
],
|
|
20266
|
-
FilesListOptions: [
|
|
20267
|
-
SCOPE_FIELD,
|
|
20268
|
-
{
|
|
20269
|
-
name: "limit",
|
|
20270
|
-
type: "Number",
|
|
20271
|
-
required: false,
|
|
20272
|
-
label: "Limit",
|
|
20273
|
-
description: "Maximum number of files to return",
|
|
20274
|
-
uiComponent: { type: "NUMERIC" }
|
|
20275
|
-
},
|
|
20276
|
-
{
|
|
20277
|
-
name: "ttl",
|
|
20278
|
-
type: "Number",
|
|
20279
|
-
required: false,
|
|
20280
|
-
label: "URL TTL (seconds)",
|
|
20281
|
-
description: "How long the download URLs remain valid",
|
|
20282
|
-
uiComponent: { type: "NUMERIC" }
|
|
20283
|
-
},
|
|
20284
|
-
{
|
|
20285
|
-
name: "generateUrl",
|
|
20286
|
-
type: "Boolean",
|
|
20287
|
-
required: false,
|
|
20288
|
-
label: "Generate download URLs",
|
|
20289
|
-
description: "Include pre-signed download URLs in the response",
|
|
20290
|
-
uiComponent: { type: "TOGGLE" },
|
|
20291
|
-
defaultValue: true
|
|
20292
|
-
},
|
|
20293
|
-
{
|
|
20294
|
-
name: "cursor",
|
|
20295
|
-
type: "String",
|
|
20296
|
-
required: false,
|
|
20297
|
-
label: "Cursor",
|
|
20298
|
-
description: "Pagination cursor from a previous response",
|
|
20299
|
-
uiComponent: { type: "SINGLE_LINE_TEXT" }
|
|
20300
|
-
}
|
|
20301
|
-
],
|
|
20302
|
-
FilesGetOptions: [
|
|
20303
|
-
SCOPE_FIELD,
|
|
20304
|
-
{
|
|
20305
|
-
name: "ttl",
|
|
20306
|
-
type: "Number",
|
|
20307
|
-
required: false,
|
|
20308
|
-
label: "URL TTL (seconds)",
|
|
20309
|
-
description: "How long the download URL remains valid",
|
|
20310
|
-
uiComponent: { type: "NUMERIC" }
|
|
20311
|
-
},
|
|
20312
|
-
{
|
|
20313
|
-
name: "generateUrl",
|
|
20314
|
-
type: "Boolean",
|
|
20315
|
-
required: false,
|
|
20316
|
-
label: "Generate download URL",
|
|
20317
|
-
description: "Include a pre-signed download URL in the response",
|
|
20318
|
-
uiComponent: { type: "TOGGLE" },
|
|
20319
|
-
defaultValue: true
|
|
20320
|
-
}
|
|
20321
|
-
],
|
|
20322
|
-
FilesDeleteOptions: [
|
|
20323
|
-
SCOPE_FIELD
|
|
20324
|
-
]
|
|
20325
|
-
};
|
|
20326
|
-
|
|
20327
|
-
// ../../jsdoc-parser/src/lib.ts
|
|
20328
|
-
var import_fs8 = __toESM(require("fs"));
|
|
20329
|
-
var import_path12 = __toESM(require("path"));
|
|
20330
|
-
function resolveJSDocPath() {
|
|
20331
|
-
const jsDocHolders = require.resolve.paths("jsdoc/lib") || [];
|
|
20332
|
-
const jsDocPaths = jsDocHolders.map((p) => import_path12.default.join(p, "jsdoc/lib"));
|
|
20333
|
-
for (let i = 0; i < jsDocPaths.length; i++) {
|
|
20334
|
-
if (import_fs8.default.existsSync(jsDocPaths[i])) {
|
|
20335
|
-
return jsDocPaths[i];
|
|
20336
|
-
}
|
|
20337
|
-
}
|
|
20338
|
-
throw new Error("Can not resolve path to JSDoc module.");
|
|
20339
|
-
}
|
|
20340
|
-
var jsdocPath = resolveJSDocPath();
|
|
20341
|
-
var jsdocModulePath = (mod) => import_path12.default.join(jsdocPath, ...mod.split("/"));
|
|
20342
|
-
var _jsdocRequire;
|
|
20343
|
-
var jsdocRequire = (modulePath) => {
|
|
20344
|
-
if (!_jsdocRequire) {
|
|
20345
|
-
_jsdocRequire = require("requizzle")({
|
|
20346
|
-
infect: true,
|
|
20347
|
-
requirePaths: { before: [jsdocPath] }
|
|
20348
|
-
});
|
|
20349
|
-
const Config = _jsdocRequire(jsdocModulePath("jsdoc/config"));
|
|
20350
|
-
const env = _jsdocRequire(jsdocModulePath("jsdoc/env"));
|
|
20351
|
-
env.conf = new Config().get();
|
|
20352
|
-
}
|
|
20353
|
-
return _jsdocRequire(jsdocModulePath(modulePath));
|
|
20354
|
-
};
|
|
20355
|
-
function parseJSDoc(filePath) {
|
|
20356
|
-
const parser = jsdocRequire("jsdoc/src/parser").createParser();
|
|
20357
|
-
const handlers = jsdocRequire("jsdoc/src/handlers");
|
|
20358
|
-
handlers.attachTo(parser);
|
|
20359
|
-
return parser.parse([filePath]);
|
|
20360
|
-
}
|
|
20361
|
-
|
|
20362
|
-
// ../../jsdoc-parser/src/index.ts
|
|
20363
|
-
var customTypeDef = {
|
|
20364
|
-
FilesUploadOptions: filesTypeDefs.FilesUploadOptions,
|
|
20365
|
-
FilesListOptions: filesTypeDefs.FilesListOptions,
|
|
20366
|
-
FilesGetOptions: filesTypeDefs.FilesGetOptions,
|
|
20367
|
-
FilesDeleteOptions: filesTypeDefs.FilesDeleteOptions
|
|
20368
|
-
};
|
|
20369
|
-
function findServiceClassName(doclets) {
|
|
20370
|
-
const withIntegration = doclets.find((d) => {
|
|
20371
|
-
if (d.kind === "class" && d.tags) {
|
|
20372
|
-
return d.tags.find((t) => t.originalTitle === "integrationName");
|
|
20373
|
-
}
|
|
20374
|
-
});
|
|
20375
|
-
if (withIntegration) {
|
|
20376
|
-
return withIntegration.name;
|
|
20377
|
-
}
|
|
20378
|
-
return null;
|
|
20379
|
-
}
|
|
20380
|
-
function parseJSDocs(filePath) {
|
|
20381
|
-
const doclets = parseJSDoc(filePath);
|
|
20382
|
-
const className = findServiceClassName(doclets);
|
|
20383
|
-
let serviceInfo = null;
|
|
20384
|
-
const methods = [];
|
|
20385
|
-
const typedefsMap = {};
|
|
20386
|
-
doclets.forEach((d) => {
|
|
20387
|
-
if (d.kind === "class" && d.name === className) {
|
|
20388
|
-
serviceInfo = composeServiceInfo(d);
|
|
20389
|
-
} else if (d.kind === "function" && d.memberof === className && d.scope === "instance") {
|
|
20390
|
-
methods.push(composeMethod(d));
|
|
20391
|
-
} else if (d.kind === "typedef") {
|
|
20392
|
-
const typedefParams = collectTypedef(d);
|
|
20393
|
-
if (typedefParams) {
|
|
20394
|
-
typedefsMap[d.name] = typedefParams;
|
|
20395
|
-
}
|
|
20396
|
-
}
|
|
20397
|
-
});
|
|
20398
|
-
return {
|
|
20399
|
-
serviceInfo,
|
|
20400
|
-
methods,
|
|
20401
|
-
// Extension-defined typedefs override built-ins so authors can customise if needed
|
|
20402
|
-
typedefsMap: { ...customTypeDef, ...typedefsMap }
|
|
20403
|
-
};
|
|
20404
|
-
}
|
|
20405
|
-
var ServiceInfoTagsProcessors = {
|
|
20406
|
-
integrationName: (serviceInfo, tagValue) => {
|
|
20407
|
-
serviceInfo.integrationName = tagValue || void 0;
|
|
20408
|
-
},
|
|
20409
|
-
integrationIcon: (serviceInfo, tagValue) => {
|
|
20410
|
-
serviceInfo.integrationIcon = tagValue || null;
|
|
20411
|
-
},
|
|
20412
|
-
requireOAuth: (serviceInfo) => {
|
|
20413
|
-
serviceInfo.requireOAuth = true;
|
|
20414
|
-
},
|
|
20415
|
-
integrationTriggersScope: (serviceInfo, tagValue) => {
|
|
20416
|
-
serviceInfo.integrationTriggersScope = tagValue || null;
|
|
20417
|
-
}
|
|
20418
|
-
};
|
|
20419
|
-
function composeServiceInfo(d) {
|
|
20420
|
-
const serviceInfo = {
|
|
20421
|
-
serviceClassName: d.name,
|
|
20422
|
-
integrationName: d.name,
|
|
20423
|
-
integrationIcon: null,
|
|
20424
|
-
requireOAuth: void 0,
|
|
20425
|
-
integrationTriggersScope: null
|
|
20426
|
-
};
|
|
20427
|
-
iterateTags(d.tags, (tagName, tagValue) => {
|
|
20428
|
-
if (ServiceInfoTagsProcessors[tagName]) {
|
|
20429
|
-
ServiceInfoTagsProcessors[tagName](serviceInfo, tagValue);
|
|
20430
|
-
}
|
|
20431
|
-
});
|
|
20432
|
-
return serviceInfo;
|
|
20433
|
-
}
|
|
20434
|
-
function iterateTags(tags, cb) {
|
|
20435
|
-
if (tags) {
|
|
20436
|
-
tags.forEach((tag) => {
|
|
20437
|
-
const title = tag.originalTitle;
|
|
20438
|
-
const value = tag.value || tag.text || "";
|
|
20439
|
-
cb(title, value, tag);
|
|
20440
|
-
});
|
|
20441
|
-
}
|
|
20442
|
-
}
|
|
20443
|
-
var MethodTagsProcessors = {
|
|
20444
|
-
paramDef: (methodInfo, tagValue) => {
|
|
20445
|
-
if (tagValue) {
|
|
20446
|
-
const parsedValue = parseJSON(tagValue);
|
|
20447
|
-
if (parsedValue) {
|
|
20448
|
-
methodInfo.paramDefs.push(parsedValue);
|
|
20449
|
-
}
|
|
20450
|
-
}
|
|
20451
|
-
},
|
|
20452
|
-
route: (methodInfo, tagValue) => {
|
|
20453
|
-
if (tagValue) {
|
|
20454
|
-
methodInfo.route = tagValue;
|
|
20455
|
-
}
|
|
20456
|
-
},
|
|
20457
|
-
registerAs: (methodInfo, tagValue) => {
|
|
20458
|
-
if (tagValue) {
|
|
20459
|
-
methodInfo.registerAs = tagValue;
|
|
20460
|
-
}
|
|
20461
|
-
},
|
|
20462
|
-
operationName: (methodInfo, tagValue) => {
|
|
20463
|
-
if (tagValue) {
|
|
20464
|
-
methodInfo.operationName = tagValue;
|
|
20465
|
-
}
|
|
20466
|
-
},
|
|
20467
|
-
customIcon: (methodInfo, tagValue) => {
|
|
20468
|
-
if (tagValue) {
|
|
20469
|
-
methodInfo.customIcon = tagValue;
|
|
20470
|
-
}
|
|
20471
|
-
},
|
|
20472
|
-
category: (methodInfo, tagValue) => {
|
|
20473
|
-
if (tagValue) {
|
|
20474
|
-
methodInfo.category = tagValue;
|
|
20475
|
-
}
|
|
20476
|
-
},
|
|
20477
|
-
description: (methodInfo, tagValue) => {
|
|
20478
|
-
if (tagValue) {
|
|
20479
|
-
methodInfo.description = tagValue;
|
|
20480
|
-
}
|
|
20481
|
-
},
|
|
20482
|
-
appearanceColor: (methodInfo, tagValue) => {
|
|
20483
|
-
if (tagValue) {
|
|
20484
|
-
const colors = extractColors(tagValue);
|
|
20485
|
-
methodInfo.colorStart = colors.colorStart;
|
|
20486
|
-
methodInfo.colorEnd = colors.colorEnd;
|
|
20487
|
-
}
|
|
20488
|
-
},
|
|
20489
|
-
private: (methodInfo) => {
|
|
20490
|
-
methodInfo.private = true;
|
|
20491
|
-
},
|
|
20492
|
-
sampleResult: (methodInfo, tagValue) => {
|
|
20493
|
-
if (tagValue) {
|
|
20494
|
-
methodInfo.sampleResult = parseJSON(tagValue);
|
|
20495
|
-
}
|
|
20496
|
-
},
|
|
20497
|
-
sampleResultLoader: (methodInfo, tagValue) => {
|
|
20498
|
-
if (tagValue) {
|
|
20499
|
-
methodInfo.sampleResultLoader = parseJSON(tagValue);
|
|
20500
|
-
}
|
|
20501
|
-
}
|
|
20502
|
-
};
|
|
20503
|
-
function composeMethod(m) {
|
|
20504
|
-
const methodInfo = {
|
|
20505
|
-
name: m.name,
|
|
20506
|
-
description: m.description || "",
|
|
20507
|
-
returnType: mapReturnType(m.returns?.[0].type?.names?.[0]),
|
|
20508
|
-
registerAs: "",
|
|
20509
|
-
colorStart: "",
|
|
20510
|
-
colorEnd: "",
|
|
20511
|
-
private: m.access === "private",
|
|
20512
|
-
operationName: m.name,
|
|
20513
|
-
customIcon: "",
|
|
20514
|
-
category: "",
|
|
20515
|
-
sampleResult: null,
|
|
20516
|
-
sampleResultLoader: null,
|
|
20517
|
-
routeStr: "",
|
|
20518
|
-
paramDefs: []
|
|
20519
|
-
};
|
|
20520
|
-
if (m.params) {
|
|
20521
|
-
m.params.forEach((p) => {
|
|
20522
|
-
methodInfo.paramDefs.push({
|
|
20523
|
-
name: p.name,
|
|
20524
|
-
type: p.type?.names?.[0] || "String",
|
|
20525
|
-
required: !p.optional
|
|
20526
|
-
});
|
|
20527
|
-
});
|
|
20528
|
-
}
|
|
20529
|
-
iterateTags(m.tags, (tagName, tagValue) => {
|
|
20530
|
-
if (MethodTagsProcessors[tagName]) {
|
|
20531
|
-
MethodTagsProcessors[tagName](methodInfo, tagValue);
|
|
20532
|
-
}
|
|
20533
|
-
});
|
|
20534
|
-
return methodInfo;
|
|
20535
|
-
}
|
|
20536
|
-
var PRIMITIVES = ["String", "Object", "Boolean", "Number"];
|
|
20537
|
-
var ParamTypesMap = {
|
|
20538
|
-
String: "STRING",
|
|
20539
|
-
Object: "OBJECT",
|
|
20540
|
-
Boolean: "BOOLEAN",
|
|
20541
|
-
Number: "NUMBER"
|
|
20542
|
-
};
|
|
20543
|
-
function mapParamType(type) {
|
|
20544
|
-
if (!type) {
|
|
20545
|
-
return "STRING";
|
|
20546
|
-
}
|
|
20547
|
-
if (type.startsWith("Array")) {
|
|
20548
|
-
return "LIST";
|
|
20549
|
-
}
|
|
20550
|
-
return ParamTypesMap[type] || "STRING";
|
|
20551
|
-
}
|
|
20552
|
-
function mapReturnType(type) {
|
|
20553
|
-
if (type) {
|
|
20554
|
-
if (type === "Array" || type.startsWith("Array.") || type.startsWith("Array<")) return "LIST";
|
|
20555
|
-
if (type === "Object") return "OBJECT";
|
|
20556
|
-
if (type === "String") return "STRING";
|
|
20557
|
-
}
|
|
20558
|
-
return "VOID";
|
|
20559
|
-
}
|
|
20560
|
-
function collectTypedef(d) {
|
|
20561
|
-
const defs = [];
|
|
20562
|
-
iterateTags(d.tags, (title, value) => {
|
|
20563
|
-
if (title === "paramDef") {
|
|
20564
|
-
const parsedValue = parseJSON(value);
|
|
20565
|
-
if (parsedValue) {
|
|
20566
|
-
defs.push(parsedValue);
|
|
20567
|
-
}
|
|
20568
|
-
}
|
|
20569
|
-
});
|
|
20570
|
-
if (d.properties) {
|
|
20571
|
-
d.properties.forEach((property) => {
|
|
20572
|
-
const type = property?.type?.names?.[0];
|
|
20573
|
-
defs.push({
|
|
20574
|
-
name: property.name,
|
|
20575
|
-
required: !property.optional,
|
|
20576
|
-
description: property.description,
|
|
20577
|
-
type
|
|
20578
|
-
});
|
|
20579
|
-
});
|
|
20580
|
-
}
|
|
20581
|
-
if (defs.length > 0) {
|
|
20582
|
-
return defs;
|
|
20583
|
-
}
|
|
20584
|
-
}
|
|
20585
|
-
function buildParam(paramDef, typedefsMap, nested = false) {
|
|
20586
|
-
const isCustomType = !nested && paramDef.type && !PRIMITIVES.includes(paramDef.type) && !paramDef.type.startsWith("Array");
|
|
20587
|
-
let properties;
|
|
20588
|
-
if (isCustomType && typedefsMap[paramDef.type]) {
|
|
20589
|
-
let subDefs = typedefsMap[paramDef.type];
|
|
20590
|
-
if (paramDef.include?.length) {
|
|
20591
|
-
const includeSet = new Set(paramDef.include);
|
|
20592
|
-
subDefs = subDefs.filter((sd) => includeSet.has(sd.name));
|
|
20593
|
-
}
|
|
20594
|
-
if (subDefs.length > 0) {
|
|
20595
|
-
properties = subDefs.map((sp) => buildParam(sp, typedefsMap, true));
|
|
20596
|
-
}
|
|
20597
|
-
}
|
|
20598
|
-
const param = {
|
|
20599
|
-
name: paramDef.name,
|
|
20600
|
-
required: paramDef.required || false,
|
|
20601
|
-
description: paramDef.description || "",
|
|
20602
|
-
type: isCustomType ? "OBJECT" : mapParamType(paramDef.type)
|
|
20603
|
-
};
|
|
20604
|
-
if (nested) {
|
|
20605
|
-
if (paramDef.label !== void 0) {
|
|
20606
|
-
param.label = paramDef.label;
|
|
20607
|
-
}
|
|
20608
|
-
if (paramDef.uiComponent !== void 0) {
|
|
20609
|
-
param.uiComponent = paramDef.uiComponent;
|
|
20610
|
-
}
|
|
20611
|
-
if (paramDef.dependsOn !== void 0) {
|
|
20612
|
-
param.dependsOn = paramDef.dependsOn;
|
|
20613
|
-
}
|
|
20614
|
-
if (paramDef.dictionary !== void 0) {
|
|
20615
|
-
param.dictionary = paramDef.dictionary;
|
|
20616
|
-
}
|
|
20617
|
-
if (paramDef.defaultValue !== void 0) {
|
|
20618
|
-
param.defaultValue = paramDef.defaultValue;
|
|
20619
|
-
}
|
|
20620
|
-
}
|
|
20621
|
-
if (properties && properties.length > 0) {
|
|
20622
|
-
param.properties = properties;
|
|
20623
|
-
}
|
|
20624
|
-
if (param.type === "LIST") {
|
|
20625
|
-
param.items = { type: "OBJECT" };
|
|
20626
|
-
}
|
|
20627
|
-
return param;
|
|
20628
|
-
}
|
|
20629
|
-
function buildMetaInfoArgs(paramDefs, typedefsMap) {
|
|
20630
|
-
const args = {};
|
|
20631
|
-
for (const pd of paramDefs) {
|
|
20632
|
-
const isCustomType = pd.type && !PRIMITIVES.includes(pd.type) && !pd.type.startsWith("Array");
|
|
20633
|
-
if (isCustomType && typedefsMap[pd.type]) {
|
|
20634
|
-
const entry2 = {};
|
|
20635
|
-
if (pd.label) entry2.label = pd.label;
|
|
20636
|
-
args[pd.name] = entry2;
|
|
20637
|
-
continue;
|
|
20638
|
-
}
|
|
20639
|
-
const entry = {};
|
|
20640
|
-
if (pd.label) entry.label = pd.label;
|
|
20641
|
-
if (pd.dictionary) entry.dictionary = pd.dictionary;
|
|
20642
|
-
if (pd.dependsOn && pd.dependsOn.length > 0) entry.dependsOn = pd.dependsOn;
|
|
20643
|
-
if (pd.uiComponent) entry.uiComponent = pd.uiComponent;
|
|
20644
|
-
args[pd.name] = entry;
|
|
20645
|
-
}
|
|
20646
|
-
return args;
|
|
20647
|
-
}
|
|
20648
|
-
function extractColors(colorStr) {
|
|
20649
|
-
if (!colorStr) {
|
|
20650
|
-
return { colorStart: "", colorEnd: "" };
|
|
20651
|
-
}
|
|
20652
|
-
const colors = colorStr.split(/[,\s]+/).map((c) => c.trim()).filter(Boolean);
|
|
20653
|
-
return {
|
|
20654
|
-
colorStart: colors[0] || "",
|
|
20655
|
-
colorEnd: colors[1] || colors[0] || ""
|
|
20656
|
-
};
|
|
20657
|
-
}
|
|
20658
|
-
function parseJSON(str) {
|
|
20659
|
-
try {
|
|
20660
|
-
return JSON.parse(str);
|
|
20661
|
-
} catch {
|
|
20662
|
-
return null;
|
|
20663
|
-
}
|
|
20664
|
-
}
|
|
20665
|
-
function parseJsDocToServiceJson(entryPoint) {
|
|
20666
|
-
const { serviceInfo, methods, typedefsMap } = parseJSDocs(entryPoint);
|
|
20667
|
-
const methodsMap = {};
|
|
20668
|
-
for (const method of methods) {
|
|
20669
|
-
if (method.private) {
|
|
20670
|
-
continue;
|
|
20671
|
-
}
|
|
20672
|
-
const {
|
|
20673
|
-
name,
|
|
20674
|
-
route,
|
|
20675
|
-
registerAs,
|
|
20676
|
-
colorStart,
|
|
20677
|
-
colorEnd,
|
|
20678
|
-
operationName,
|
|
20679
|
-
customIcon,
|
|
20680
|
-
category,
|
|
20681
|
-
description,
|
|
20682
|
-
sampleResult,
|
|
20683
|
-
sampleResultLoader,
|
|
20684
|
-
paramDefs,
|
|
20685
|
-
returnType
|
|
20686
|
-
} = method;
|
|
20687
|
-
const isSystem = registerAs === "SYSTEM";
|
|
20688
|
-
const httpMethod = route ? route.split(/\s+/)[0].toUpperCase() : name.startsWith("get") ? "GET" : "POST";
|
|
20689
|
-
const isQueryPlacement = httpMethod === "GET";
|
|
20690
|
-
const params = paramDefs.map((pd) => buildParam(pd, typedefsMap));
|
|
20691
|
-
const queryParams = isQueryPlacement ? params : [];
|
|
20692
|
-
const bodyParams = isQueryPlacement ? [] : params;
|
|
20693
|
-
const metaInfoArgs = paramDefs.length > 0 ? buildMetaInfoArgs(paramDefs, typedefsMap) : {};
|
|
20694
|
-
methodsMap[name] = {
|
|
20695
|
-
colorStart,
|
|
20696
|
-
colorEnd,
|
|
20697
|
-
queryParams,
|
|
20698
|
-
// todo remove me
|
|
20699
|
-
bodyParams,
|
|
20700
|
-
customIcon: isSystem ? void 0 : customIcon,
|
|
20701
|
-
registerAs,
|
|
20702
|
-
category,
|
|
20703
|
-
metaInfo: {
|
|
20704
|
-
args: metaInfoArgs,
|
|
20705
|
-
sampleResult: isSystem ? void 0 : sampleResult,
|
|
20706
|
-
sampleResultLoader: isSystem ? void 0 : sampleResultLoader
|
|
20707
|
-
},
|
|
20708
|
-
returnType,
|
|
20709
|
-
description,
|
|
20710
|
-
operationName,
|
|
20711
|
-
name
|
|
20712
|
-
};
|
|
20713
|
-
}
|
|
20714
|
-
return {
|
|
20715
|
-
runnerVersion: "v1",
|
|
20716
|
-
//TODO: temp
|
|
20717
|
-
methodsMap,
|
|
20718
|
-
serviceInfo
|
|
20719
|
-
};
|
|
20129
|
+
return registry.tryLoad(serviceId, serviceEntryPointPath)?.toDefinition() ?? null;
|
|
20720
20130
|
}
|
|
20721
20131
|
|
|
20722
20132
|
// src/operations/deploy/discover-services.ts
|
|
20723
20133
|
function discoverServices(projectRoot = process.cwd()) {
|
|
20724
|
-
const servicesDir =
|
|
20725
|
-
if (!
|
|
20134
|
+
const servicesDir = import_path12.default.resolve(projectRoot, "services");
|
|
20135
|
+
if (!import_fs8.default.existsSync(servicesDir)) {
|
|
20726
20136
|
return { services: [], skipped: [] };
|
|
20727
20137
|
}
|
|
20728
|
-
const serviceIds =
|
|
20729
|
-
const
|
|
20138
|
+
const serviceIds = import_fs8.default.readdirSync(servicesDir, { withFileTypes: true }).filter((file) => file.isDirectory()).map((file) => file.name);
|
|
20139
|
+
const services = [];
|
|
20730
20140
|
const skipped = [];
|
|
20731
20141
|
for (const serviceId of serviceIds) {
|
|
20732
|
-
const serviceDir =
|
|
20733
|
-
const serviceDISTEntryPoint =
|
|
20734
|
-
const serviceSRCEntryPoint =
|
|
20142
|
+
const serviceDir = import_path12.default.resolve(servicesDir, serviceId);
|
|
20143
|
+
const serviceDISTEntryPoint = import_path12.default.resolve(serviceDir, "./dist/index.js");
|
|
20144
|
+
const serviceSRCEntryPoint = import_path12.default.resolve(serviceDir, "./src/index.js");
|
|
20735
20145
|
let serviceFilePath = null;
|
|
20736
20146
|
try {
|
|
20737
|
-
if (
|
|
20147
|
+
if (import_fs8.default.existsSync(serviceDISTEntryPoint)) {
|
|
20738
20148
|
serviceFilePath = serviceDISTEntryPoint;
|
|
20739
|
-
} else if (
|
|
20149
|
+
} else if (import_fs8.default.existsSync(serviceSRCEntryPoint)) {
|
|
20740
20150
|
serviceFilePath = serviceSRCEntryPoint;
|
|
20741
20151
|
}
|
|
20742
20152
|
if (!serviceFilePath) {
|
|
20743
20153
|
skipped.push({ serviceId, reason: "it has neither a dist/index.js nor a src/index.js" });
|
|
20744
20154
|
continue;
|
|
20745
20155
|
}
|
|
20746
|
-
const
|
|
20747
|
-
|
|
20748
|
-
|
|
20749
|
-
skipped.push({ serviceId, reason: "its entry point does not define a service" });
|
|
20156
|
+
const definition = buildServiceDefinition(serviceId, serviceFilePath);
|
|
20157
|
+
if (!definition?.serviceInfo) {
|
|
20158
|
+
skipped.push({ serviceId, reason: "its entry point does not define a service with createExtension" });
|
|
20750
20159
|
continue;
|
|
20751
20160
|
}
|
|
20161
|
+
const { methodsMap, serviceInfo } = definition;
|
|
20752
20162
|
let configDescriptions = [];
|
|
20753
20163
|
try {
|
|
20754
|
-
configDescriptions =
|
|
20164
|
+
configDescriptions = getServiceConfigs(serviceId, serviceFilePath);
|
|
20755
20165
|
} catch (error) {
|
|
20756
20166
|
skipped.push({
|
|
20757
20167
|
serviceId,
|
|
20758
20168
|
reason: `its config items could not be read (${error.message}) \u2014 deployed without them`
|
|
20759
20169
|
});
|
|
20760
20170
|
}
|
|
20761
|
-
|
|
20171
|
+
services.push({
|
|
20762
20172
|
// Relative to the service, because the deployed archive's root IS the service.
|
|
20763
|
-
serviceFilePath:
|
|
20173
|
+
serviceFilePath: import_path12.default.relative(serviceDir, serviceFilePath),
|
|
20764
20174
|
serviceId,
|
|
20765
20175
|
serviceInfo,
|
|
20766
20176
|
methodsMap,
|
|
20767
20177
|
configDescriptions,
|
|
20768
|
-
//
|
|
20178
|
+
// The console renders the config dialog from the schema itself rather than from the
|
|
20769
20179
|
// `configDescriptions` projection, so both travel: the schema for the new path, the projection for
|
|
20770
20180
|
// every consumer that predates it.
|
|
20771
|
-
|
|
20772
|
-
configSchema: v2Definition?.configSchema ?? null
|
|
20181
|
+
configSchema: definition.configSchema ?? null
|
|
20773
20182
|
});
|
|
20774
20183
|
} catch (error) {
|
|
20775
20184
|
skipped.push({ serviceId, reason: error.message });
|
|
20776
20185
|
}
|
|
20777
20186
|
}
|
|
20778
|
-
return { services
|
|
20187
|
+
return { services, skipped };
|
|
20779
20188
|
}
|
|
20780
20189
|
|
|
20781
20190
|
// src/operations/deploy/hash.ts
|
|
20782
20191
|
var import_crypto4 = require("crypto");
|
|
20783
|
-
var
|
|
20784
|
-
var
|
|
20192
|
+
var import_fs9 = __toESM(require("fs"));
|
|
20193
|
+
var import_path13 = __toESM(require("path"));
|
|
20785
20194
|
async function computeServiceHash(projectRoot, serviceId) {
|
|
20786
20195
|
const hash = (0, import_crypto4.createHash)("sha256");
|
|
20787
|
-
const serviceDir =
|
|
20196
|
+
const serviceDir = import_path13.default.resolve(projectRoot, "services", serviceId);
|
|
20788
20197
|
const files = [];
|
|
20789
20198
|
collectFiles(serviceDir, "", files);
|
|
20790
20199
|
files.sort();
|
|
20791
20200
|
for (const file of files) {
|
|
20792
20201
|
hash.update(file);
|
|
20793
|
-
hash.update(
|
|
20202
|
+
hash.update(import_fs9.default.readFileSync(import_path13.default.resolve(serviceDir, file)));
|
|
20794
20203
|
}
|
|
20795
20204
|
return hash.digest("hex");
|
|
20796
20205
|
}
|
|
20797
20206
|
function collectFiles(serviceDir, relativeDir, files) {
|
|
20798
|
-
const entries =
|
|
20207
|
+
const entries = import_fs9.default.readdirSync(import_path13.default.resolve(serviceDir, relativeDir), { withFileTypes: true });
|
|
20799
20208
|
for (const entry of entries) {
|
|
20800
20209
|
if (HASH_EXCLUDED_FOLDERS.includes(entry.name)) {
|
|
20801
20210
|
continue;
|
|
20802
20211
|
}
|
|
20803
|
-
const relativePath = relativeDir ?
|
|
20212
|
+
const relativePath = relativeDir ? import_path13.default.join(relativeDir, entry.name) : entry.name;
|
|
20804
20213
|
if (!entry.isSymbolicLink()) {
|
|
20805
20214
|
if (entry.isDirectory()) {
|
|
20806
20215
|
collectFiles(serviceDir, relativePath, files);
|
|
@@ -20812,14 +20221,14 @@ function collectFiles(serviceDir, relativeDir, files) {
|
|
|
20812
20221
|
}
|
|
20813
20222
|
|
|
20814
20223
|
// src/operations/deploy/public-files.ts
|
|
20815
|
-
var
|
|
20816
|
-
var
|
|
20817
|
-
function collectPublicFiles(
|
|
20224
|
+
var import_fs10 = __toESM(require("fs"));
|
|
20225
|
+
var import_path14 = __toESM(require("path"));
|
|
20226
|
+
function collectPublicFiles(services, projectRoot = process.cwd()) {
|
|
20818
20227
|
const files = [];
|
|
20819
20228
|
const missing = [];
|
|
20820
|
-
for (const service of
|
|
20821
|
-
const servicePublicDir =
|
|
20822
|
-
if (!
|
|
20229
|
+
for (const service of services) {
|
|
20230
|
+
const servicePublicDir = import_path14.default.resolve(projectRoot, "services", service.serviceId, "public");
|
|
20231
|
+
if (!import_fs10.default.existsSync(servicePublicDir)) {
|
|
20823
20232
|
continue;
|
|
20824
20233
|
}
|
|
20825
20234
|
const iconPath = service.serviceInfo.integrationIcon;
|
|
@@ -20827,18 +20236,18 @@ function collectPublicFiles(services2, projectRoot = process.cwd()) {
|
|
|
20827
20236
|
continue;
|
|
20828
20237
|
}
|
|
20829
20238
|
const relativePath = iconPath.replace(/^\//, "");
|
|
20830
|
-
const fullPath =
|
|
20831
|
-
if (!fullPath.startsWith(servicePublicDir +
|
|
20239
|
+
const fullPath = import_path14.default.resolve(servicePublicDir, relativePath);
|
|
20240
|
+
if (!fullPath.startsWith(servicePublicDir + import_path14.default.sep)) {
|
|
20832
20241
|
continue;
|
|
20833
20242
|
}
|
|
20834
|
-
if (!
|
|
20243
|
+
if (!import_fs10.default.existsSync(fullPath)) {
|
|
20835
20244
|
missing.push({ serviceId: service.serviceId, relativePath });
|
|
20836
20245
|
continue;
|
|
20837
20246
|
}
|
|
20838
20247
|
files.push({
|
|
20839
20248
|
relativePath,
|
|
20840
20249
|
serviceId: service.serviceId,
|
|
20841
|
-
buffer:
|
|
20250
|
+
buffer: import_fs10.default.readFileSync(fullPath)
|
|
20842
20251
|
});
|
|
20843
20252
|
}
|
|
20844
20253
|
return { files, missing };
|
|
@@ -20864,7 +20273,7 @@ function selectServices(available, selection = {}) {
|
|
|
20864
20273
|
|
|
20865
20274
|
// src/operations/deploy/zip.ts
|
|
20866
20275
|
var import_archiver = __toESM(require("archiver"));
|
|
20867
|
-
var
|
|
20276
|
+
var import_path15 = __toESM(require("path"));
|
|
20868
20277
|
async function createServiceZip(definition, projectRoot, serviceId) {
|
|
20869
20278
|
return new Promise((resolve, reject) => {
|
|
20870
20279
|
const archive = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
|
|
@@ -20872,7 +20281,7 @@ async function createServiceZip(definition, projectRoot, serviceId) {
|
|
|
20872
20281
|
archive.on("data", (chunk) => chunks.push(chunk));
|
|
20873
20282
|
archive.on("end", () => resolve(Buffer.concat(chunks)));
|
|
20874
20283
|
archive.on("error", reject);
|
|
20875
|
-
archive.directory(`${
|
|
20284
|
+
archive.directory(`${import_path15.default.resolve(projectRoot, "services", serviceId)}/`, "package");
|
|
20876
20285
|
archive.append(JSON.stringify(definition, null, 2), { name: "definition.json" });
|
|
20877
20286
|
archive.finalize();
|
|
20878
20287
|
});
|
|
@@ -20905,7 +20314,7 @@ async function deploy(options = {}) {
|
|
|
20905
20314
|
const { serverUrl, workspaceId, workspaceName, deployToken } = await resolveAuth(projectRoot, options.onAuthRequired);
|
|
20906
20315
|
const credentials = { serverUrl, workspaceId, deployToken };
|
|
20907
20316
|
const workspace = { workspaceId, workspaceName };
|
|
20908
|
-
if (!
|
|
20317
|
+
if (!import_fs11.default.existsSync(import_path16.default.resolve(projectRoot, "services"))) {
|
|
20909
20318
|
throw new NoServicesDirectoryError();
|
|
20910
20319
|
}
|
|
20911
20320
|
emit({ type: "connecting", serverUrl, workspace });
|
|
@@ -21039,7 +20448,7 @@ var ERROR_HTML = (error) => `<!DOCTYPE html>
|
|
|
21039
20448
|
</body></html>`;
|
|
21040
20449
|
|
|
21041
20450
|
// src/server/routes/callback.ts
|
|
21042
|
-
function callbackRoute(
|
|
20451
|
+
function callbackRoute(path22 = "/callback") {
|
|
21043
20452
|
let resolveCode = null;
|
|
21044
20453
|
let rejectCode = null;
|
|
21045
20454
|
const respond = (route2, html) => {
|
|
@@ -21048,7 +20457,7 @@ function callbackRoute(path23 = "/callback") {
|
|
|
21048
20457
|
};
|
|
21049
20458
|
const route = {
|
|
21050
20459
|
method: "GET",
|
|
21051
|
-
path:
|
|
20460
|
+
path: path22,
|
|
21052
20461
|
handle: (context) => {
|
|
21053
20462
|
const code = context.url.searchParams.get("code");
|
|
21054
20463
|
const error = context.url.searchParams.get("error");
|
|
@@ -21206,7 +20615,7 @@ async function waitForEnter(message) {
|
|
|
21206
20615
|
}
|
|
21207
20616
|
|
|
21208
20617
|
// src/cli/reporter.ts
|
|
21209
|
-
var
|
|
20618
|
+
var import_path17 = __toESM(require("path"));
|
|
21210
20619
|
|
|
21211
20620
|
// src/utils/server-name.ts
|
|
21212
20621
|
var CLUSTER_LABELS = {
|
|
@@ -21227,7 +20636,7 @@ var SEGMENT_WORDING = {
|
|
|
21227
20636
|
unchanged: "The FlowRunner instructions block was already up to date"
|
|
21228
20637
|
};
|
|
21229
20638
|
function readablePath(fullPath) {
|
|
21230
|
-
const relative =
|
|
20639
|
+
const relative = import_path17.default.relative(process.cwd(), fullPath);
|
|
21231
20640
|
return !relative || relative.startsWith("..") ? fullPath : relative;
|
|
21232
20641
|
}
|
|
21233
20642
|
var STATUS_WORDING = {
|
|
@@ -21377,7 +20786,7 @@ function reportInitClaude(event) {
|
|
|
21377
20786
|
return;
|
|
21378
20787
|
}
|
|
21379
20788
|
case "segment":
|
|
21380
|
-
section(` ${SEGMENT_WORDING[event.outcome]} in ${
|
|
20789
|
+
section(` ${SEGMENT_WORDING[event.outcome]} in ${import_path17.default.basename(event.file)}.`);
|
|
21381
20790
|
return;
|
|
21382
20791
|
case "warning":
|
|
21383
20792
|
sayWarning(` ${event.message}`);
|
|
@@ -21847,32 +21256,32 @@ async function createServiceCommand(templateId, options = {}) {
|
|
|
21847
21256
|
}
|
|
21848
21257
|
|
|
21849
21258
|
// src/cli/commands/init.ts
|
|
21850
|
-
var
|
|
21259
|
+
var import_path21 = __toESM(require("path"));
|
|
21851
21260
|
|
|
21852
21261
|
// src/operations/init/index.ts
|
|
21853
21262
|
var import_child_process = require("child_process");
|
|
21854
|
-
var import_fs14 = __toESM(require("fs"));
|
|
21855
|
-
var import_path20 = __toESM(require("path"));
|
|
21856
|
-
|
|
21857
|
-
// src/operations/init/testing.ts
|
|
21858
21263
|
var import_fs13 = __toESM(require("fs"));
|
|
21859
21264
|
var import_path19 = __toESM(require("path"));
|
|
21265
|
+
|
|
21266
|
+
// src/operations/init/testing.ts
|
|
21267
|
+
var import_fs12 = __toESM(require("fs"));
|
|
21268
|
+
var import_path18 = __toESM(require("path"));
|
|
21860
21269
|
function testingFilesDirectory() {
|
|
21861
|
-
return
|
|
21270
|
+
return import_path18.default.join(packageRoot(), PROJECT_FILES_DIRECTORY);
|
|
21862
21271
|
}
|
|
21863
21272
|
function writeTestingFiles(projectRoot) {
|
|
21864
21273
|
const source = testingFilesDirectory();
|
|
21865
21274
|
const created = [];
|
|
21866
21275
|
const skipped = [];
|
|
21867
21276
|
for (const file of TESTING_FILES) {
|
|
21868
|
-
const target =
|
|
21869
|
-
if (
|
|
21277
|
+
const target = import_path18.default.join(projectRoot, file);
|
|
21278
|
+
if (import_fs12.default.existsSync(target)) {
|
|
21870
21279
|
skipped.push(file);
|
|
21871
21280
|
continue;
|
|
21872
21281
|
}
|
|
21873
|
-
const contents =
|
|
21874
|
-
|
|
21875
|
-
|
|
21282
|
+
const contents = import_fs12.default.readFileSync(import_path18.default.join(source, file));
|
|
21283
|
+
import_fs12.default.mkdirSync(import_path18.default.dirname(target), { recursive: true });
|
|
21284
|
+
import_fs12.default.writeFileSync(target, contents);
|
|
21876
21285
|
created.push(file);
|
|
21877
21286
|
}
|
|
21878
21287
|
return { created, skipped };
|
|
@@ -21883,10 +21292,10 @@ var GITIGNORE_ENTRIES = ["node_modules/", `${TOKEN_DIR}/`, ...TEST_GITIGNORE_ENT
|
|
|
21883
21292
|
var CLI_PACKAGE = "@flowrunner/cli";
|
|
21884
21293
|
var CLI_PACKAGE_NAMES = [CLI_PACKAGE, "flowrunner-cli"];
|
|
21885
21294
|
function cliVersion() {
|
|
21886
|
-
return JSON.parse(
|
|
21295
|
+
return JSON.parse(import_fs13.default.readFileSync(import_path19.default.join(packageRoot(), "package.json"), "utf-8")).version;
|
|
21887
21296
|
}
|
|
21888
21297
|
function packageNameFrom(directory) {
|
|
21889
|
-
const name =
|
|
21298
|
+
const name = import_path19.default.basename(import_path19.default.resolve(directory)).toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[._-]+|[-._]+$/g, "");
|
|
21890
21299
|
return name || "flowrunner-extensions";
|
|
21891
21300
|
}
|
|
21892
21301
|
function addMissing(section2, additions, placeholders = {}) {
|
|
@@ -21900,11 +21309,11 @@ function addMissing(section2, additions, placeholders = {}) {
|
|
|
21900
21309
|
return changed;
|
|
21901
21310
|
}
|
|
21902
21311
|
function writePackageJson(projectRoot, tests) {
|
|
21903
|
-
const fullPath =
|
|
21312
|
+
const fullPath = import_path19.default.join(projectRoot, "package.json");
|
|
21904
21313
|
const version2 = cliVersion();
|
|
21905
21314
|
const devDependencies = { [CLI_PACKAGE]: version2, ...tests ? TEST_DEV_DEPENDENCIES : {} };
|
|
21906
21315
|
const scripts = { deploy: "flowrunner deploy --all", ...tests ? TEST_SCRIPTS : {} };
|
|
21907
|
-
if (!
|
|
21316
|
+
if (!import_fs13.default.existsSync(fullPath)) {
|
|
21908
21317
|
const manifest2 = {
|
|
21909
21318
|
name: packageNameFrom(projectRoot),
|
|
21910
21319
|
version: "0.0.1",
|
|
@@ -21913,10 +21322,10 @@ function writePackageJson(projectRoot, tests) {
|
|
|
21913
21322
|
scripts,
|
|
21914
21323
|
devDependencies
|
|
21915
21324
|
};
|
|
21916
|
-
|
|
21325
|
+
import_fs13.default.writeFileSync(fullPath, JSON.stringify(manifest2, null, 2) + "\n", "utf-8");
|
|
21917
21326
|
return "created";
|
|
21918
21327
|
}
|
|
21919
|
-
const manifest = JSON.parse(
|
|
21328
|
+
const manifest = JSON.parse(import_fs13.default.readFileSync(fullPath, "utf-8"));
|
|
21920
21329
|
const alreadyDeclared = CLI_PACKAGE_NAMES.some((name) => manifest.dependencies?.[name] || manifest.devDependencies?.[name]);
|
|
21921
21330
|
const additions = alreadyDeclared ? Object.fromEntries(Object.entries(devDependencies).filter(([name]) => name !== CLI_PACKAGE)) : devDependencies;
|
|
21922
21331
|
manifest.devDependencies ??= {};
|
|
@@ -21928,22 +21337,22 @@ function writePackageJson(projectRoot, tests) {
|
|
|
21928
21337
|
if (!changed) {
|
|
21929
21338
|
return "skipped";
|
|
21930
21339
|
}
|
|
21931
|
-
|
|
21340
|
+
import_fs13.default.writeFileSync(fullPath, JSON.stringify(manifest, null, 2) + "\n", "utf-8");
|
|
21932
21341
|
return "updated";
|
|
21933
21342
|
}
|
|
21934
21343
|
function writeGitignore(projectRoot) {
|
|
21935
|
-
const fullPath =
|
|
21936
|
-
if (!
|
|
21937
|
-
|
|
21344
|
+
const fullPath = import_path19.default.join(projectRoot, ".gitignore");
|
|
21345
|
+
if (!import_fs13.default.existsSync(fullPath)) {
|
|
21346
|
+
import_fs13.default.writeFileSync(fullPath, GITIGNORE_ENTRIES.join("\n") + "\n", "utf-8");
|
|
21938
21347
|
return "created";
|
|
21939
21348
|
}
|
|
21940
|
-
const content =
|
|
21349
|
+
const content = import_fs13.default.readFileSync(fullPath, "utf-8");
|
|
21941
21350
|
const lines = content.split("\n").map((line) => line.trim());
|
|
21942
21351
|
const missing = GITIGNORE_ENTRIES.filter((entry) => !lines.includes(entry) && !lines.includes(entry.replace(/\/$/, "")));
|
|
21943
21352
|
if (missing.length === 0) {
|
|
21944
21353
|
return "skipped";
|
|
21945
21354
|
}
|
|
21946
|
-
|
|
21355
|
+
import_fs13.default.appendFileSync(fullPath, `${content.endsWith("\n") ? "" : "\n"}${missing.join("\n")}
|
|
21947
21356
|
`);
|
|
21948
21357
|
return "updated";
|
|
21949
21358
|
}
|
|
@@ -21991,11 +21400,11 @@ The authoring reference the CLI ships lives in
|
|
|
21991
21400
|
\`.flowrunner/token\` is the deploy token and must not.
|
|
21992
21401
|
`;
|
|
21993
21402
|
function writeReadme(projectRoot) {
|
|
21994
|
-
const fullPath =
|
|
21995
|
-
if (
|
|
21403
|
+
const fullPath = import_path19.default.join(projectRoot, "README.md");
|
|
21404
|
+
if (import_fs13.default.existsSync(fullPath)) {
|
|
21996
21405
|
return "skipped";
|
|
21997
21406
|
}
|
|
21998
|
-
|
|
21407
|
+
import_fs13.default.writeFileSync(fullPath, README(packageNameFrom(projectRoot)), "utf-8");
|
|
21999
21408
|
return "created";
|
|
22000
21409
|
}
|
|
22001
21410
|
var JSCONFIG = {
|
|
@@ -22007,11 +21416,11 @@ var JSCONFIG = {
|
|
|
22007
21416
|
include: ["services/*/src/**/*.js"]
|
|
22008
21417
|
};
|
|
22009
21418
|
function writeJsconfig(projectRoot) {
|
|
22010
|
-
const fullPath =
|
|
22011
|
-
if (
|
|
21419
|
+
const fullPath = import_path19.default.join(projectRoot, "jsconfig.json");
|
|
21420
|
+
if (import_fs13.default.existsSync(fullPath)) {
|
|
22012
21421
|
return "skipped";
|
|
22013
21422
|
}
|
|
22014
|
-
|
|
21423
|
+
import_fs13.default.writeFileSync(fullPath, JSON.stringify(JSCONFIG, null, 2) + "\n", "utf-8");
|
|
22015
21424
|
return "created";
|
|
22016
21425
|
}
|
|
22017
21426
|
function git(projectRoot, args) {
|
|
@@ -22062,13 +21471,13 @@ function npmInstall(projectRoot, warn) {
|
|
|
22062
21471
|
}
|
|
22063
21472
|
}
|
|
22064
21473
|
function describeTarget(projectRoot) {
|
|
22065
|
-
if (!
|
|
21474
|
+
if (!import_fs13.default.existsSync(projectRoot)) {
|
|
22066
21475
|
return { projectRoot, lines: ["a new directory"], defaultYes: true };
|
|
22067
21476
|
}
|
|
22068
|
-
if (!
|
|
21477
|
+
if (!import_fs13.default.statSync(projectRoot).isDirectory()) {
|
|
22069
21478
|
return { projectRoot, lines: ["not a directory"], defaultYes: false };
|
|
22070
21479
|
}
|
|
22071
|
-
const entries =
|
|
21480
|
+
const entries = import_fs13.default.readdirSync(projectRoot).filter((entry) => entry !== ".git");
|
|
22072
21481
|
if (entries.length === 0) {
|
|
22073
21482
|
return { projectRoot, lines: ["an empty directory"], defaultYes: true };
|
|
22074
21483
|
}
|
|
@@ -22085,7 +21494,7 @@ function describeTarget(projectRoot) {
|
|
|
22085
21494
|
return { projectRoot, lines, defaultYes: false };
|
|
22086
21495
|
}
|
|
22087
21496
|
async function init(options = {}) {
|
|
22088
|
-
const projectRoot =
|
|
21497
|
+
const projectRoot = import_path19.default.resolve(options.cwd ?? ".");
|
|
22089
21498
|
const emit = emitter(options);
|
|
22090
21499
|
const warn = (message) => emit({ type: "warning", message });
|
|
22091
21500
|
const template = options.template ? resolveTemplateId(options.template) : null;
|
|
@@ -22112,10 +21521,10 @@ async function init(options = {}) {
|
|
|
22112
21521
|
committed: false
|
|
22113
21522
|
};
|
|
22114
21523
|
}
|
|
22115
|
-
if (!
|
|
22116
|
-
|
|
21524
|
+
if (!import_fs13.default.existsSync(projectRoot)) {
|
|
21525
|
+
import_fs13.default.mkdirSync(projectRoot, { recursive: true });
|
|
22117
21526
|
}
|
|
22118
|
-
if (!
|
|
21527
|
+
if (!import_fs13.default.statSync(projectRoot).isDirectory()) {
|
|
22119
21528
|
throw new PromptAbortedError(`${projectRoot} is not a directory.`);
|
|
22120
21529
|
}
|
|
22121
21530
|
const created = [];
|
|
@@ -22157,10 +21566,10 @@ async function init(options = {}) {
|
|
|
22157
21566
|
|
|
22158
21567
|
// src/cli/offer-global-install.ts
|
|
22159
21568
|
var import_child_process2 = require("child_process");
|
|
22160
|
-
var
|
|
22161
|
-
var
|
|
21569
|
+
var import_fs14 = __toESM(require("fs"));
|
|
21570
|
+
var import_path20 = __toESM(require("path"));
|
|
22162
21571
|
function runningVersion() {
|
|
22163
|
-
return JSON.parse(
|
|
21572
|
+
return JSON.parse(import_fs14.default.readFileSync(import_path20.default.join(packageRoot(), "package.json"), "utf-8")).version;
|
|
22164
21573
|
}
|
|
22165
21574
|
async function offerGlobalInstall() {
|
|
22166
21575
|
if (!process.stdin.isTTY || hasGlobalInstall()) {
|
|
@@ -22211,7 +21620,7 @@ async function initCommand(templateId, options = {}) {
|
|
|
22211
21620
|
if (result.cancelled) {
|
|
22212
21621
|
return;
|
|
22213
21622
|
}
|
|
22214
|
-
const relative =
|
|
21623
|
+
const relative = import_path21.default.relative(process.cwd(), result.projectRoot);
|
|
22215
21624
|
const where = !relative || relative.startsWith("..") ? result.projectRoot : relative;
|
|
22216
21625
|
const step = (index2, text2) => say(` ${index2}. ${text2}`);
|
|
22217
21626
|
const option = (text2) => say(` ${text2}`);
|
|
@@ -22247,8 +21656,8 @@ async function initCommand(templateId, options = {}) {
|
|
|
22247
21656
|
}
|
|
22248
21657
|
|
|
22249
21658
|
// src/operations/init-claude/index.ts
|
|
22250
|
-
var
|
|
22251
|
-
var
|
|
21659
|
+
var import_fs15 = __toESM(require("fs"));
|
|
21660
|
+
var import_path22 = __toESM(require("path"));
|
|
22252
21661
|
|
|
22253
21662
|
// src/operations/init-claude/segment.ts
|
|
22254
21663
|
var BEGIN_MARKER = "<!-- flowrunner-cli:ai:start -->";
|
|
@@ -22283,16 +21692,16 @@ function mergeSegment(current, segment, file) {
|
|
|
22283
21692
|
|
|
22284
21693
|
// src/operations/init-claude/index.ts
|
|
22285
21694
|
function providerDirectory(provider = CLAUDE_PROVIDER) {
|
|
22286
|
-
return
|
|
21695
|
+
return import_path22.default.join(packageRoot(), AI_PROVIDERS_DIRECTORY, provider);
|
|
22287
21696
|
}
|
|
22288
21697
|
function packedAgents(directory) {
|
|
22289
|
-
if (!
|
|
21698
|
+
if (!import_fs15.default.existsSync(directory)) {
|
|
22290
21699
|
return [];
|
|
22291
21700
|
}
|
|
22292
|
-
return
|
|
21701
|
+
return import_fs15.default.readdirSync(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".md")).map((entry) => entry.name).sort();
|
|
22293
21702
|
}
|
|
22294
21703
|
function writeAgents(sourceDirectory, projectRoot, layout) {
|
|
22295
|
-
const directory =
|
|
21704
|
+
const directory = import_path22.default.join(projectRoot, layout.agentsDirectory);
|
|
22296
21705
|
const agents = packedAgents(sourceDirectory);
|
|
22297
21706
|
const created = [];
|
|
22298
21707
|
const updated = [];
|
|
@@ -22302,59 +21711,59 @@ function writeAgents(sourceDirectory, projectRoot, layout) {
|
|
|
22302
21711
|
warnings.push(`The installed CLI ships no agent definitions in ${PROVIDER_AGENTS_DIRECTORY}/ \u2014 none were written.`);
|
|
22303
21712
|
return { directory, created, updated, unchanged, warnings };
|
|
22304
21713
|
}
|
|
22305
|
-
|
|
21714
|
+
import_fs15.default.mkdirSync(directory, { recursive: true });
|
|
22306
21715
|
for (const agent of agents) {
|
|
22307
|
-
const contents =
|
|
22308
|
-
const target =
|
|
21716
|
+
const contents = import_fs15.default.readFileSync(import_path22.default.join(sourceDirectory, agent), "utf-8");
|
|
21717
|
+
const target = import_path22.default.join(directory, agent);
|
|
22309
21718
|
if (contents.length === 0) {
|
|
22310
21719
|
warnings.push(`${agent} is empty in the installed CLI \u2014 written as an empty file.`);
|
|
22311
21720
|
}
|
|
22312
|
-
if (!
|
|
22313
|
-
|
|
21721
|
+
if (!import_fs15.default.existsSync(target)) {
|
|
21722
|
+
import_fs15.default.writeFileSync(target, contents, "utf-8");
|
|
22314
21723
|
created.push(agent);
|
|
22315
21724
|
continue;
|
|
22316
21725
|
}
|
|
22317
|
-
if (
|
|
21726
|
+
if (import_fs15.default.readFileSync(target, "utf-8") === contents) {
|
|
22318
21727
|
unchanged.push(agent);
|
|
22319
21728
|
continue;
|
|
22320
21729
|
}
|
|
22321
|
-
|
|
21730
|
+
import_fs15.default.writeFileSync(target, contents, "utf-8");
|
|
22322
21731
|
updated.push(agent);
|
|
22323
21732
|
}
|
|
22324
21733
|
return { directory, created, updated, unchanged, warnings };
|
|
22325
21734
|
}
|
|
22326
21735
|
function writeSegment(sourceDirectory, projectRoot, layout) {
|
|
22327
|
-
const file =
|
|
22328
|
-
const source =
|
|
21736
|
+
const file = import_path22.default.join(projectRoot, layout.instructionsFile);
|
|
21737
|
+
const source = import_path22.default.join(sourceDirectory, ORCHESTRATOR_SEGMENT_FILE);
|
|
22329
21738
|
const warnings = [];
|
|
22330
|
-
if (!
|
|
21739
|
+
if (!import_fs15.default.existsSync(source)) {
|
|
22331
21740
|
warnings.push(`The installed CLI ships no ${ORCHESTRATOR_SEGMENT_FILE} \u2014 ${layout.instructionsFile} was left alone.`);
|
|
22332
21741
|
return { file, outcome: "unchanged", warnings };
|
|
22333
21742
|
}
|
|
22334
|
-
const segment =
|
|
21743
|
+
const segment = import_fs15.default.readFileSync(source, "utf-8");
|
|
22335
21744
|
if (segment.trim().length === 0) {
|
|
22336
21745
|
warnings.push(`${ORCHESTRATOR_SEGMENT_FILE} is empty in the installed CLI \u2014 the marked block is empty.`);
|
|
22337
21746
|
}
|
|
22338
|
-
const current =
|
|
21747
|
+
const current = import_fs15.default.existsSync(file) ? import_fs15.default.readFileSync(file, "utf-8") : null;
|
|
22339
21748
|
const merged = mergeSegment(current, segment, layout.instructionsFile);
|
|
22340
21749
|
if (merged.outcome !== "unchanged") {
|
|
22341
|
-
|
|
21750
|
+
import_fs15.default.writeFileSync(file, merged.contents, "utf-8");
|
|
22342
21751
|
}
|
|
22343
21752
|
return { file, outcome: merged.outcome, warnings };
|
|
22344
21753
|
}
|
|
22345
21754
|
async function initClaude(options = {}) {
|
|
22346
|
-
const projectRoot =
|
|
21755
|
+
const projectRoot = import_path22.default.resolve(options.cwd ?? ".");
|
|
22347
21756
|
const emit = emitter(options);
|
|
22348
21757
|
const warnAll = (messages) => messages.forEach((message) => emit({ type: "warning", message }));
|
|
22349
21758
|
const layout = PROVIDERS[CLAUDE_PROVIDER];
|
|
22350
21759
|
const sourceDirectory = providerDirectory(layout.id);
|
|
22351
|
-
if (!
|
|
22352
|
-
throw new AiDocsMissingError(
|
|
21760
|
+
if (!import_fs15.default.existsSync(sourceDirectory)) {
|
|
21761
|
+
throw new AiDocsMissingError(import_path22.default.join(AI_PROVIDERS_DIRECTORY, CLAUDE_PROVIDER));
|
|
22353
21762
|
}
|
|
22354
|
-
if (!
|
|
22355
|
-
|
|
21763
|
+
if (!import_fs15.default.existsSync(projectRoot)) {
|
|
21764
|
+
import_fs15.default.mkdirSync(projectRoot, { recursive: true });
|
|
22356
21765
|
}
|
|
22357
|
-
const agents = writeAgents(
|
|
21766
|
+
const agents = writeAgents(import_path22.default.join(sourceDirectory, PROVIDER_AGENTS_DIRECTORY), projectRoot, layout);
|
|
22358
21767
|
emit({
|
|
22359
21768
|
type: "agents",
|
|
22360
21769
|
directory: agents.directory,
|
|
@@ -22428,12 +21837,12 @@ async function logoutCommand() {
|
|
|
22428
21837
|
|
|
22429
21838
|
// src/operations/pull/index.ts
|
|
22430
21839
|
var import_adm_zip = __toESM(require_adm_zip());
|
|
22431
|
-
var import_fs18 = __toESM(require("fs"));
|
|
22432
|
-
var import_path25 = __toESM(require("path"));
|
|
22433
|
-
|
|
22434
|
-
// src/operations/pull/extract.ts
|
|
22435
21840
|
var import_fs17 = __toESM(require("fs"));
|
|
22436
21841
|
var import_path24 = __toESM(require("path"));
|
|
21842
|
+
|
|
21843
|
+
// src/operations/pull/extract.ts
|
|
21844
|
+
var import_fs16 = __toESM(require("fs"));
|
|
21845
|
+
var import_path23 = __toESM(require("path"));
|
|
22437
21846
|
var PACKAGE_PREFIX = "package/";
|
|
22438
21847
|
var SAFE_SERVICE_ID = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
22439
21848
|
function isSafeServiceId(serviceId) {
|
|
@@ -22452,12 +21861,12 @@ function extractService(archive, directory) {
|
|
|
22452
21861
|
let written = 0;
|
|
22453
21862
|
for (const entry of serviceEntries(archive)) {
|
|
22454
21863
|
const relativePath = entry.entryName.slice(PACKAGE_PREFIX.length);
|
|
22455
|
-
const target =
|
|
22456
|
-
if (target !== directory && !target.startsWith(directory +
|
|
21864
|
+
const target = import_path23.default.resolve(directory, relativePath);
|
|
21865
|
+
if (target !== directory && !target.startsWith(directory + import_path23.default.sep)) {
|
|
22457
21866
|
continue;
|
|
22458
21867
|
}
|
|
22459
|
-
|
|
22460
|
-
|
|
21868
|
+
import_fs16.default.mkdirSync(import_path23.default.dirname(target), { recursive: true });
|
|
21869
|
+
import_fs16.default.writeFileSync(target, entry.getData());
|
|
22461
21870
|
written++;
|
|
22462
21871
|
}
|
|
22463
21872
|
return written;
|
|
@@ -22477,7 +21886,7 @@ function declaredDependencies(archive) {
|
|
|
22477
21886
|
|
|
22478
21887
|
// src/operations/pull/index.ts
|
|
22479
21888
|
async function localState(projectRoot, service) {
|
|
22480
|
-
if (!
|
|
21889
|
+
if (!import_fs17.default.existsSync(import_path24.default.resolve(projectRoot, "services", service.serviceId))) {
|
|
22481
21890
|
return "absent";
|
|
22482
21891
|
}
|
|
22483
21892
|
try {
|
|
@@ -22522,7 +21931,7 @@ async function pull(options = {}) {
|
|
|
22522
21931
|
emit({ type: "skipped", serviceId: service.serviceId, reason });
|
|
22523
21932
|
continue;
|
|
22524
21933
|
}
|
|
22525
|
-
const directory =
|
|
21934
|
+
const directory = import_path24.default.resolve(projectRoot, "services", service.serviceId);
|
|
22526
21935
|
const state = await localState(projectRoot, service);
|
|
22527
21936
|
if (state === "same") {
|
|
22528
21937
|
upToDate.push({
|
|
@@ -22543,7 +21952,7 @@ async function pull(options = {}) {
|
|
|
22543
21952
|
const zipBuffer = await guard(() => downloadRemoteService(credentials, service.serviceId));
|
|
22544
21953
|
const archive = new import_adm_zip.default(zipBuffer);
|
|
22545
21954
|
if (exists) {
|
|
22546
|
-
|
|
21955
|
+
import_fs17.default.rmSync(directory, { recursive: true, force: true });
|
|
22547
21956
|
}
|
|
22548
21957
|
const files = extractService(archive, directory);
|
|
22549
21958
|
const dependencies = declaredDependencies(archive);
|
|
@@ -22643,10 +22052,10 @@ async function pickServices2(available) {
|
|
|
22643
22052
|
}
|
|
22644
22053
|
|
|
22645
22054
|
// src/operations/use-server.ts
|
|
22646
|
-
var
|
|
22055
|
+
var import_fs18 = __toESM(require("fs"));
|
|
22647
22056
|
function useServer(target, options = {}) {
|
|
22648
22057
|
const projectRoot = options.cwd ?? process.cwd();
|
|
22649
|
-
if (!
|
|
22058
|
+
if (!import_fs18.default.existsSync(configPath(projectRoot))) {
|
|
22650
22059
|
throw new NotAProjectError();
|
|
22651
22060
|
}
|
|
22652
22061
|
const serverUrl = resolveServerTarget(target);
|