@flowrunner/cli 0.1.19-dev.1 → 0.1.19-dev.3
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/02-zod-types.md +6 -5
- 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/17-client-certificates.md +4 -5
- package/ai-docs/instructions/service-code-format/README.md +2 -2
- package/dist/cli.js +322 -896
- package/dist/cli.js.map +4 -4
- package/dist/index.js +340 -908
- 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/constants/testing.d.ts +13 -6
- 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 +20 -0
- package/dist/types/shared/src/constants/flow-catalog.d.ts +54 -0
- package/dist/types/shared/src/constants/index.d.ts +2 -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/flow-catalog.d.ts +37 -0
- package/dist/types/shared/src/errors/index.d.ts +2 -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/flow-catalog/analysis.d.ts +190 -0
- package/dist/types/shared/src/scheme/flow-catalog/index.d.ts +6 -0
- package/dist/types/shared/src/scheme/flow-catalog/pack.d.ts +144 -0
- package/dist/types/shared/src/scheme/flow-catalog/requests.d.ts +664 -0
- package/dist/types/shared/src/scheme/flow-catalog/summary.d.ts +69 -0
- package/dist/types/shared/src/scheme/flow-catalog/version.d.ts +132 -0
- 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 +102 -0
- package/dist/types/shared/src/scheme/flowrunner/workspace-dashboard.dto.d.ts +207 -0
- package/dist/types/shared/src/scheme/index.d.ts +1 -0
- package/dist/types/shared/src/scheme/integration-connection/dto.d.ts +22 -0
- package/dist/types/shared/src/scheme/knowledge-base/dto.d.ts +12 -12
- 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/properties/index.d.ts +1 -0
- package/dist/types/shared/src/scheme/properties/secret.d.ts +12 -0
- package/dist/types/shared/src/scheme/remote-mcp-server/dto.d.ts +142 -29
- package/dist/types/shared/src/scheme/shared-extensions/base.d.ts +0 -4
- package/dist/types/shared/src/scheme/shared-extensions/config.d.ts +20 -2
- 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/rest.d.ts +1 -0
- 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 -7
- package/project-files/sandbox/files-mock.js +3 -5
- package/project-files/sandbox/nock-mock.js +61 -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,7 +10044,7 @@ 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;
|
|
@@ -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: fs20 }) {
|
|
12322
|
+
var _path = path22 || "", _obj = newAttr(), _stat = null;
|
|
12323
12323
|
function newAttr() {
|
|
12324
12324
|
return {
|
|
12325
12325
|
directory: false,
|
|
@@ -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.3",
|
|
14512
14512
|
publishConfig: {
|
|
14513
14513
|
access: "public"
|
|
14514
14514
|
},
|
|
@@ -14543,21 +14543,15 @@ var require_package = __commonJS({
|
|
|
14543
14543
|
dependencies: {
|
|
14544
14544
|
"@types/node": "^20.0.0",
|
|
14545
14545
|
"adm-zip": "^0.6.1",
|
|
14546
|
-
archiver: "^7.0.0",
|
|
14547
14546
|
commander: "^12.0.0",
|
|
14548
|
-
jsdoc: "^4.0.0",
|
|
14549
|
-
requizzle: "^0.2.4",
|
|
14550
14547
|
zod: "^4.6.2"
|
|
14551
14548
|
},
|
|
14552
14549
|
devDependencies: {
|
|
14553
14550
|
"@asteasolutions/zod-to-openapi": "^8.4.0",
|
|
14554
14551
|
"@flowrunner/flow-extension-runner": "*",
|
|
14555
|
-
"@flowrunner/jsdoc-parser": "*",
|
|
14556
14552
|
"@types/adm-zip": "^0.5.7",
|
|
14557
|
-
"@types/archiver": "^6.0.0",
|
|
14558
14553
|
esbuild: "^0.28.2",
|
|
14559
14554
|
nock: "^14.0.17",
|
|
14560
|
-
"query-string": "^7.1.3",
|
|
14561
14555
|
"tsconfig-paths": "^4.2.0",
|
|
14562
14556
|
tsx: "^4.0.0",
|
|
14563
14557
|
typescript: "^5.4.0"
|
|
@@ -14627,8 +14621,10 @@ var TESTING_FILES = [
|
|
|
14627
14621
|
];
|
|
14628
14622
|
var TEST_DEV_DEPENDENCIES = {
|
|
14629
14623
|
jest: "^30.0.0",
|
|
14630
|
-
nock: "^14.0.0"
|
|
14631
|
-
|
|
14624
|
+
nock: "^14.0.0"
|
|
14625
|
+
};
|
|
14626
|
+
var TEST_OVERRIDES = {
|
|
14627
|
+
glob: "^13.0.7"
|
|
14632
14628
|
};
|
|
14633
14629
|
var TEST_SCRIPTS = {
|
|
14634
14630
|
test: "jest",
|
|
@@ -15506,11 +15502,11 @@ async function downloadRemoteService(credentials, serviceId) {
|
|
|
15506
15502
|
|
|
15507
15503
|
// src/operations/deploy/index.ts
|
|
15508
15504
|
var import_fs12 = __toESM(require("fs"));
|
|
15509
|
-
var
|
|
15505
|
+
var import_path16 = __toESM(require("path"));
|
|
15510
15506
|
|
|
15511
15507
|
// src/operations/deploy/discover-services.ts
|
|
15512
|
-
var
|
|
15513
|
-
var
|
|
15508
|
+
var import_fs8 = __toESM(require("fs"));
|
|
15509
|
+
var import_path12 = __toESM(require("path"));
|
|
15514
15510
|
|
|
15515
15511
|
// ../../flow-extension-runner/src/namespace.ts
|
|
15516
15512
|
var import_backendless_request2 = __toESM(require_lib());
|
|
@@ -15555,9 +15551,9 @@ var FlowExtensionErrorCodes = {
|
|
|
15555
15551
|
DUPLICATE_ITEM_ID: "FR_EXT_DUPLICATE_ITEM_ID",
|
|
15556
15552
|
// No v2 extension registered for the given serviceId after requiring the module.
|
|
15557
15553
|
EXTENSION_NOT_REGISTERED: "FR_EXT_NOT_REGISTERED",
|
|
15558
|
-
// A declared config value is missing or the wrong shape (see
|
|
15554
|
+
// A declared config value is missing or the wrong shape (see params/schema/normalize).
|
|
15559
15555
|
INVALID_CONFIG: "FR_EXT_INVALID_CONFIG",
|
|
15560
|
-
// A schema slot that must be a z.object was declared as something else (see
|
|
15556
|
+
// A schema slot that must be a z.object was declared as something else (see params/schema/assert-object-schema).
|
|
15561
15557
|
INVALID_SCHEMA: "FR_EXT_INVALID_SCHEMA",
|
|
15562
15558
|
// A polling trigger declared zero or multiple mechanisms, or is missing its fetch.
|
|
15563
15559
|
INVALID_TRIGGER_CONFIG: "FR_EXT_INVALID_TRIGGER_CONFIG",
|
|
@@ -15652,7 +15648,7 @@ var InvalidConfigError = class extends FlowExtensionError {
|
|
|
15652
15648
|
};
|
|
15653
15649
|
var InvalidSchemaError = class extends FlowExtensionError {
|
|
15654
15650
|
// `message` is composed by the guard, which knows how to describe what was received and what to do
|
|
15655
|
-
// about it (see
|
|
15651
|
+
// about it (see params/schema/assert-object-schema.ts).
|
|
15656
15652
|
constructor(message, details) {
|
|
15657
15653
|
super(FlowExtensionErrorCodes.INVALID_SCHEMA, 400, message, details);
|
|
15658
15654
|
}
|
|
@@ -15704,12 +15700,12 @@ var InvalidDictionaryOutputScheme = class extends FlowExtensionError {
|
|
|
15704
15700
|
}
|
|
15705
15701
|
};
|
|
15706
15702
|
|
|
15707
|
-
// ../../flow-extension-runner/src/
|
|
15703
|
+
// ../../flow-extension-runner/src/loaders/loader-owner.ts
|
|
15708
15704
|
var sampleResultLoaderName = (ownerId) => `${ownerId}_SampleResultLoader`;
|
|
15709
15705
|
var dynamicParamsLoaderName = (ownerId) => `${ownerId}_DynamicParams`;
|
|
15710
15706
|
var dynamicPropsLoaderName = (ownerId, field) => `${ownerId}_${field}_DynamicProps`;
|
|
15711
15707
|
|
|
15712
|
-
// ../../flow-extension-runner/src/
|
|
15708
|
+
// ../../flow-extension-runner/src/params/schema/assert-object-schema.ts
|
|
15713
15709
|
var WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish", "default", "prefault"]);
|
|
15714
15710
|
var typeOf = (value) => value?._zod?.def?.type;
|
|
15715
15711
|
function describe(value) {
|
|
@@ -15758,7 +15754,7 @@ function assertObjectSchema(scheme, source) {
|
|
|
15758
15754
|
);
|
|
15759
15755
|
}
|
|
15760
15756
|
|
|
15761
|
-
// ../../flow-extension-runner/src/
|
|
15757
|
+
// ../../flow-extension-runner/src/params/widget-types.ts
|
|
15762
15758
|
var FlowExtensionParamGroupTypes = {
|
|
15763
15759
|
FILE_UPLOAD_OPTIONS: "FILE_UPLOAD_OPTIONS",
|
|
15764
15760
|
FILE_LIST_OPTIONS: "FILE_LIST_OPTIONS",
|
|
@@ -15785,7 +15781,7 @@ var FlowExtensionParamWidgetTypes = {
|
|
|
15785
15781
|
TIME_PICKER: "TIME_PICKER"
|
|
15786
15782
|
};
|
|
15787
15783
|
|
|
15788
|
-
// ../../flow-extension-runner/src/
|
|
15784
|
+
// ../../flow-extension-runner/src/params/schema/introspect.ts
|
|
15789
15785
|
var OPTIONAL_WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish"]);
|
|
15790
15786
|
var DEFAULT_WRAPPERS = /* @__PURE__ */ new Set(["default", "prefault"]);
|
|
15791
15787
|
var TRANSPARENT_WRAPPERS = /* @__PURE__ */ new Set(["readonly", "pipe", "lazy"]);
|
|
@@ -15941,7 +15937,7 @@ function shapeEntries(schema) {
|
|
|
15941
15937
|
return shape && typeof shape === "object" ? Object.entries(shape) : [];
|
|
15942
15938
|
}
|
|
15943
15939
|
|
|
15944
|
-
// ../../flow-extension-runner/src/
|
|
15940
|
+
// ../../flow-extension-runner/src/params/schema/date-format.ts
|
|
15945
15941
|
var ISO_PATTERNS = {
|
|
15946
15942
|
date: "yyyy-MM-dd",
|
|
15947
15943
|
datetime: "yyyy-MM-dd'T'HH:mm",
|
|
@@ -16287,7 +16283,7 @@ function hasDateFormat(schema, seen = /* @__PURE__ */ new Set()) {
|
|
|
16287
16283
|
return children.some((child) => hasDateFormat(child, seen));
|
|
16288
16284
|
}
|
|
16289
16285
|
|
|
16290
|
-
// ../../flow-extension-runner/src/
|
|
16286
|
+
// ../../flow-extension-runner/src/params/schema/dictionary-binding.ts
|
|
16291
16287
|
var DictionaryScope = class _DictionaryScope {
|
|
16292
16288
|
constructor(top, visible) {
|
|
16293
16289
|
this.top = top;
|
|
@@ -16320,7 +16316,7 @@ function publishedBinding(binding, scope2) {
|
|
|
16320
16316
|
return { id: binding.id, dependsOn: resolveDependsOn(binding, scope2).dependsOn };
|
|
16321
16317
|
}
|
|
16322
16318
|
|
|
16323
|
-
// ../../flow-extension-runner/src/
|
|
16319
|
+
// ../../flow-extension-runner/src/params/schema/assert-supported-schema.ts
|
|
16324
16320
|
var GUARDED_KINDS = /* @__PURE__ */ new Set(["action", "dictionary", "polling trigger", "realtime trigger", "extension"]);
|
|
16325
16321
|
var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
|
|
16326
16322
|
"string",
|
|
@@ -16341,31 +16337,31 @@ var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
|
|
|
16341
16337
|
]);
|
|
16342
16338
|
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
16339
|
var MODIFIER_SPELLING = ".optional(), .nullable(), .nullish(), .default(v), .prefault(v), .readonly(), .nonoptional(), .pipe(\u2026)/.transform(\u2026) and z.lazy(\u2026)";
|
|
16344
|
-
function subjectOf(source,
|
|
16340
|
+
function subjectOf(source, path22) {
|
|
16345
16341
|
const kind = source.kind ?? "extension";
|
|
16346
16342
|
const subject = source.itemId ? `${kind} "${source.itemId}": ` : "";
|
|
16347
|
-
return `${subject}\`${
|
|
16343
|
+
return `${subject}\`${path22}\``;
|
|
16348
16344
|
}
|
|
16349
|
-
function refuse(message, source,
|
|
16345
|
+
function refuse(message, source, path22, received) {
|
|
16350
16346
|
throw new InvalidSchemaError(
|
|
16351
16347
|
`[flow-extension:${source.serviceId}] ${message}`,
|
|
16352
|
-
{ serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path:
|
|
16348
|
+
{ serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path: path22, received }
|
|
16353
16349
|
);
|
|
16354
16350
|
}
|
|
16355
|
-
function refuseCatch(source,
|
|
16351
|
+
function refuseCatch(source, path22) {
|
|
16356
16352
|
refuse(
|
|
16357
|
-
`${subjectOf(source,
|
|
16353
|
+
`${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
16354
|
source,
|
|
16359
|
-
|
|
16355
|
+
path22,
|
|
16360
16356
|
"catch"
|
|
16361
16357
|
);
|
|
16362
16358
|
}
|
|
16363
|
-
function refuseType(source,
|
|
16359
|
+
function refuseType(source, path22, type) {
|
|
16364
16360
|
const received = type ? `z.${type}()` : "a value that is not a zod schema";
|
|
16365
16361
|
refuse(
|
|
16366
|
-
`${subjectOf(source,
|
|
16362
|
+
`${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
16363
|
source,
|
|
16368
|
-
|
|
16364
|
+
path22,
|
|
16369
16365
|
type ?? "unknown"
|
|
16370
16366
|
);
|
|
16371
16367
|
}
|
|
@@ -16381,7 +16377,7 @@ function isLooseObject(schema) {
|
|
|
16381
16377
|
function isDynamicPropsSlot(source, topLevel) {
|
|
16382
16378
|
return topLevel && source.kind === "action" && source.slot === "params";
|
|
16383
16379
|
}
|
|
16384
|
-
function assertDynamicProps(schema, name, siblings, source,
|
|
16380
|
+
function assertDynamicProps(schema, name, siblings, source, path22) {
|
|
16385
16381
|
const ins = inspect(schema);
|
|
16386
16382
|
const spec = ins.meta.frDynamicProps;
|
|
16387
16383
|
if (!spec) {
|
|
@@ -16392,49 +16388,49 @@ function assertDynamicProps(schema, name, siblings, source, path23) {
|
|
|
16392
16388
|
}
|
|
16393
16389
|
if (typeof spec.execute !== "function") {
|
|
16394
16390
|
refuse(
|
|
16395
|
-
`${subjectOf(source,
|
|
16391
|
+
`${subjectOf(source, path22)}: \`.dynamicProps()\` needs an \`execute\` function that returns the loaded fields.`,
|
|
16396
16392
|
source,
|
|
16397
|
-
|
|
16393
|
+
path22,
|
|
16398
16394
|
typeof spec.execute
|
|
16399
16395
|
);
|
|
16400
16396
|
}
|
|
16401
16397
|
if (spec.dependsOn !== void 0 && (!Array.isArray(spec.dependsOn) || spec.dependsOn.some((item) => typeof item !== "string"))) {
|
|
16402
16398
|
refuse(
|
|
16403
|
-
`${subjectOf(source,
|
|
16399
|
+
`${subjectOf(source, path22)}: \`.dynamicProps()\` \`dependsOn\` must be an array of param names.`,
|
|
16404
16400
|
source,
|
|
16405
|
-
|
|
16401
|
+
path22,
|
|
16406
16402
|
"dependsOn"
|
|
16407
16403
|
);
|
|
16408
16404
|
}
|
|
16409
16405
|
for (const dependency of spec.dependsOn ?? []) {
|
|
16410
16406
|
if (dependency === name || !siblings.includes(dependency)) {
|
|
16411
16407
|
refuse(
|
|
16412
|
-
`${subjectOf(source,
|
|
16408
|
+
`${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
16409
|
source,
|
|
16414
|
-
|
|
16410
|
+
path22,
|
|
16415
16411
|
dependency
|
|
16416
16412
|
);
|
|
16417
16413
|
}
|
|
16418
16414
|
}
|
|
16419
16415
|
if (ins.meta.frDictionary) {
|
|
16420
16416
|
refuse(
|
|
16421
|
-
`${subjectOf(source,
|
|
16417
|
+
`${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
16418
|
source,
|
|
16423
|
-
|
|
16419
|
+
path22,
|
|
16424
16420
|
"dictionary"
|
|
16425
16421
|
);
|
|
16426
16422
|
}
|
|
16427
16423
|
const element = ins.resolvedType === "array" ? ins.core?._zod?.def?.element : void 0;
|
|
16428
16424
|
if (!isLooseObject(schema) && !isLooseObject(element)) {
|
|
16429
16425
|
refuse(
|
|
16430
|
-
`${subjectOf(source,
|
|
16426
|
+
`${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
16427
|
source,
|
|
16432
|
-
|
|
16428
|
+
path22,
|
|
16433
16429
|
ins.resolvedType ?? "unknown"
|
|
16434
16430
|
);
|
|
16435
16431
|
}
|
|
16436
16432
|
}
|
|
16437
|
-
function assertDictionaryBinding(schema, source,
|
|
16433
|
+
function assertDictionaryBinding(schema, source, path22, scope2) {
|
|
16438
16434
|
const binding = inspect(schema).meta.frDictionary;
|
|
16439
16435
|
if (!binding) {
|
|
16440
16436
|
return;
|
|
@@ -16442,14 +16438,14 @@ function assertDictionaryBinding(schema, source, path23, scope2) {
|
|
|
16442
16438
|
const { clash } = resolveDependsOn(binding, scope2);
|
|
16443
16439
|
if (clash) {
|
|
16444
16440
|
refuse(
|
|
16445
|
-
`${subjectOf(source,
|
|
16441
|
+
`${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
16442
|
source,
|
|
16447
|
-
|
|
16443
|
+
path22,
|
|
16448
16444
|
clash.names.join(", ")
|
|
16449
16445
|
);
|
|
16450
16446
|
}
|
|
16451
16447
|
}
|
|
16452
|
-
function assertDateString(schema, source,
|
|
16448
|
+
function assertDateString(schema, source, path22) {
|
|
16453
16449
|
const ins = inspect(schema);
|
|
16454
16450
|
const pattern = ins.meta.frDateFormat;
|
|
16455
16451
|
const kind = dateStringKind(ins);
|
|
@@ -16457,9 +16453,9 @@ function assertDateString(schema, source, path23) {
|
|
|
16457
16453
|
const format = ins.core?._zod?.def?.format;
|
|
16458
16454
|
const zoned = ins.coreType === "string" && format === "datetime";
|
|
16459
16455
|
refuse(
|
|
16460
|
-
`${subjectOf(source,
|
|
16456
|
+
`${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
16457
|
source,
|
|
16462
|
-
|
|
16458
|
+
path22,
|
|
16463
16459
|
zoned ? "datetime" : ins.resolvedType ?? "unknown"
|
|
16464
16460
|
);
|
|
16465
16461
|
}
|
|
@@ -16471,7 +16467,7 @@ function assertDateString(schema, source, path23) {
|
|
|
16471
16467
|
compilePattern(pattern, kind);
|
|
16472
16468
|
} catch (error) {
|
|
16473
16469
|
if (error instanceof DateFormatError) {
|
|
16474
|
-
refuse(`${subjectOf(source,
|
|
16470
|
+
refuse(`${subjectOf(source, path22)}: \`.dateFormat('${pattern}')\` ${error.message}.`, source, path22, pattern);
|
|
16475
16471
|
}
|
|
16476
16472
|
throw error;
|
|
16477
16473
|
}
|
|
@@ -16484,14 +16480,14 @@ function assertDateString(schema, source, path23) {
|
|
|
16484
16480
|
const fits = typeof fallback === "string" && (pattern !== void 0 ? !!parseInPattern(fallback, pattern, kind) : ((parts) => !!parts && toCanonical(parts, kind) === fallback)(parseIso(fallback, kind)));
|
|
16485
16481
|
if (!fits) {
|
|
16486
16482
|
refuse(
|
|
16487
|
-
`${subjectOf(source,
|
|
16483
|
+
`${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
16484
|
source,
|
|
16489
|
-
|
|
16485
|
+
path22,
|
|
16490
16486
|
String(fallback)
|
|
16491
16487
|
);
|
|
16492
16488
|
}
|
|
16493
16489
|
}
|
|
16494
|
-
function assertField(schema, source,
|
|
16490
|
+
function assertField(schema, source, path22, seen, scope2, topLevel = false) {
|
|
16495
16491
|
if (!schema || seen.has(schema)) {
|
|
16496
16492
|
return;
|
|
16497
16493
|
}
|
|
@@ -16499,35 +16495,35 @@ function assertField(schema, source, path23, seen, scope2, topLevel = false) {
|
|
|
16499
16495
|
const ins = inspect(schema);
|
|
16500
16496
|
if (ins.meta.frDynamicProps && !isDynamicPropsSlot(source, topLevel)) {
|
|
16501
16497
|
refuse(
|
|
16502
|
-
`${subjectOf(source,
|
|
16498
|
+
`${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
16499
|
source,
|
|
16504
|
-
|
|
16500
|
+
path22,
|
|
16505
16501
|
"dynamicProps"
|
|
16506
16502
|
);
|
|
16507
16503
|
}
|
|
16508
16504
|
if (ins.resolvedType === "catch") {
|
|
16509
|
-
refuseCatch(source,
|
|
16505
|
+
refuseCatch(source, path22);
|
|
16510
16506
|
}
|
|
16511
|
-
assertDictionaryBinding(schema, source,
|
|
16512
|
-
assertDateString(schema, source,
|
|
16507
|
+
assertDictionaryBinding(schema, source, path22, scope2);
|
|
16508
|
+
assertDateString(schema, source, path22);
|
|
16513
16509
|
if (!ins.resolvedType || !SUPPORTED_TYPES.has(ins.resolvedType)) {
|
|
16514
|
-
refuseType(source,
|
|
16510
|
+
refuseType(source, path22, ins.resolvedType);
|
|
16515
16511
|
}
|
|
16516
16512
|
if (ins.branches) {
|
|
16517
|
-
ins.branches.forEach((branch, index) => assertField(branch, source, `${
|
|
16513
|
+
ins.branches.forEach((branch, index) => assertField(branch, source, `${path22}|branch ${index + 1}`, seen, scope2));
|
|
16518
16514
|
}
|
|
16519
16515
|
const def = ins.core._zod?.def ?? {};
|
|
16520
16516
|
if (ins.resolvedType === "array") {
|
|
16521
|
-
assertField(def.element, source, `${
|
|
16517
|
+
assertField(def.element, source, `${path22}[]`, seen, scope2);
|
|
16522
16518
|
}
|
|
16523
16519
|
if (ins.resolvedType === "record") {
|
|
16524
|
-
assertField(def.valueType, source, `${
|
|
16520
|
+
assertField(def.valueType, source, `${path22}{}`, seen, scope2);
|
|
16525
16521
|
}
|
|
16526
16522
|
if (ins.resolvedType === "object") {
|
|
16527
16523
|
const properties = shapeEntries(ins.core);
|
|
16528
16524
|
const inner = scope2.enter(properties.map(([name]) => name));
|
|
16529
16525
|
for (const [name, property] of properties) {
|
|
16530
|
-
assertField(property, source, `${
|
|
16526
|
+
assertField(property, source, `${path22}.${name}`, seen, inner);
|
|
16531
16527
|
}
|
|
16532
16528
|
}
|
|
16533
16529
|
}
|
|
@@ -16548,7 +16544,7 @@ function assertSupportedSchema(scheme, source) {
|
|
|
16548
16544
|
}
|
|
16549
16545
|
}
|
|
16550
16546
|
|
|
16551
|
-
// ../../flow-extension-runner/src/
|
|
16547
|
+
// ../../flow-extension-runner/src/params/schema/dates.ts
|
|
16552
16548
|
var DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
16553
16549
|
var HAS_TIME = /^(\d{4}-\d{2}-\d{2})[T ](.+)$/;
|
|
16554
16550
|
var ZONE = /(Z|[+-]\d{2}:?\d{2})$/;
|
|
@@ -16627,7 +16623,7 @@ function hasPassThroughDate(schema, inspectSchema, entriesOf) {
|
|
|
16627
16623
|
return children.some((child) => hasPassThroughDate(child, inspectSchema, entriesOf));
|
|
16628
16624
|
}
|
|
16629
16625
|
|
|
16630
|
-
// ../../flow-extension-runner/src/
|
|
16626
|
+
// ../../flow-extension-runner/src/params/schema/labels.ts
|
|
16631
16627
|
var ACRONYMS = /* @__PURE__ */ new Set([
|
|
16632
16628
|
"id",
|
|
16633
16629
|
"url",
|
|
@@ -16661,7 +16657,7 @@ function humanizeKey(name) {
|
|
|
16661
16657
|
}
|
|
16662
16658
|
var labelOf = (name, schema) => inspect(schema).meta.title || humanizeKey(name) || name;
|
|
16663
16659
|
|
|
16664
|
-
// ../../flow-extension-runner/src/
|
|
16660
|
+
// ../../flow-extension-runner/src/params/schema/field-plan.ts
|
|
16665
16661
|
function declaredAbsence(schema) {
|
|
16666
16662
|
let current = schema;
|
|
16667
16663
|
let acceptsUndefined = false;
|
|
@@ -16772,7 +16768,7 @@ function planField(name, schema) {
|
|
|
16772
16768
|
};
|
|
16773
16769
|
}
|
|
16774
16770
|
|
|
16775
|
-
// ../../flow-extension-runner/src/
|
|
16771
|
+
// ../../flow-extension-runner/src/params/schema/notices.ts
|
|
16776
16772
|
var sink;
|
|
16777
16773
|
var currentField;
|
|
16778
16774
|
function collectNotices(fn) {
|
|
@@ -16799,7 +16795,7 @@ function notice(entry) {
|
|
|
16799
16795
|
sink?.push({ field: currentField, ...entry });
|
|
16800
16796
|
}
|
|
16801
16797
|
|
|
16802
|
-
// ../../flow-extension-runner/src/
|
|
16798
|
+
// ../../flow-extension-runner/src/params/schema/coerce.ts
|
|
16803
16799
|
var ok = (value) => ({ ok: true, value });
|
|
16804
16800
|
var fail2 = (expected) => ({ ok: false, expected });
|
|
16805
16801
|
var TRUE = /* @__PURE__ */ new Set(["true", "1", "yes", "y", "t", "on", "checked", "enabled", "enable", "active"]);
|
|
@@ -17031,7 +17027,7 @@ function absentAs(schema, value) {
|
|
|
17031
17027
|
return absence === "null" ? null : void 0;
|
|
17032
17028
|
}
|
|
17033
17029
|
|
|
17034
|
-
// ../../flow-extension-runner/src/
|
|
17030
|
+
// ../../flow-extension-runner/src/params/schema/defaults.ts
|
|
17035
17031
|
var WIDGET_DESCRIPTIONS = {
|
|
17036
17032
|
[FlowExtensionParamWidgetTypes.MULTI_LINE_TEXT]: "Expects text; line breaks are allowed"
|
|
17037
17033
|
};
|
|
@@ -17068,7 +17064,7 @@ var FORMAT_DESCRIPTIONS = {
|
|
|
17068
17064
|
cidrv6: "Expects an IPv6 range, e.g. 2001:db8::/32"
|
|
17069
17065
|
};
|
|
17070
17066
|
|
|
17071
|
-
// ../../flow-extension-runner/src/
|
|
17067
|
+
// ../../flow-extension-runner/src/params/schema/messages.ts
|
|
17072
17068
|
var EXPECTED = {
|
|
17073
17069
|
string: "a string",
|
|
17074
17070
|
number: "a number",
|
|
@@ -17189,55 +17185,55 @@ function isAuthored(issue) {
|
|
|
17189
17185
|
}
|
|
17190
17186
|
function toFieldIssue(plan2, issue, fieldValue) {
|
|
17191
17187
|
const segments = (issue.path ?? []).map(String).filter(Boolean);
|
|
17192
|
-
const
|
|
17188
|
+
const path22 = segments.length ? `${plan2.name}.${segments.join(".")}` : plan2.name;
|
|
17193
17189
|
const code = issue.code ?? "custom";
|
|
17194
17190
|
const target = resolveTarget(plan2, segments, fieldValue);
|
|
17195
17191
|
const named = { ...plan2, label: target.label };
|
|
17196
17192
|
if (isAuthored(issue)) {
|
|
17197
|
-
return { path:
|
|
17193
|
+
return { path: path22, code, message: issue.message };
|
|
17198
17194
|
}
|
|
17199
17195
|
if (code === "invalid_format" && target.schema && inspect(target.schema).branches) {
|
|
17200
17196
|
const combined = unionPhrases(target.schema, target.value);
|
|
17201
17197
|
if (combined.length > 1) {
|
|
17202
|
-
return { path:
|
|
17198
|
+
return { path: path22, code: "invalid_union", message: `\xAB${target.label}\xBB must be ${combined.join(", or ")}` };
|
|
17203
17199
|
}
|
|
17204
17200
|
}
|
|
17205
17201
|
const dateKind = target.schema ? dateStringKind(inspect(target.schema)) : void 0;
|
|
17206
17202
|
const dateMissing = target.value == null || target.value === "";
|
|
17207
17203
|
if (dateKind && (code === "invalid_type" || code === "invalid_format")) {
|
|
17208
|
-
return dateMissing ? { path:
|
|
17204
|
+
return dateMissing ? { path: path22, code, message: requiredMessage(named) } : { path: path22, code, message: invalidTypeMessage(named, expectedDateString(inspect(target.schema), dateKind)) };
|
|
17209
17205
|
}
|
|
17210
17206
|
if (code === "invalid_type") {
|
|
17211
17207
|
const received = issue.received;
|
|
17212
17208
|
const absent = segments.length ? target.found && target.value == null : received === "undefined" || received === "null" || issue.expected === void 0;
|
|
17213
|
-
return absent ? { path:
|
|
17209
|
+
return absent ? { path: path22, code, message: requiredMessage(named) } : { path: path22, code, message: invalidTypeMessage(named, issue.expected ?? "") };
|
|
17214
17210
|
}
|
|
17215
17211
|
if (code === "too_small") {
|
|
17216
|
-
return { path:
|
|
17212
|
+
return { path: path22, code, message: `\xAB${target.label}\xBB must be at least ${bound(issue.minimum, plan2)}` };
|
|
17217
17213
|
}
|
|
17218
17214
|
if (code === "too_big") {
|
|
17219
|
-
return { path:
|
|
17215
|
+
return { path: path22, code, message: `\xAB${target.label}\xBB must be at most ${bound(issue.maximum, plan2)}` };
|
|
17220
17216
|
}
|
|
17221
17217
|
if (code === "invalid_value") {
|
|
17222
|
-
return { path:
|
|
17218
|
+
return { path: path22, code, message: `\xAB${target.label}\xBB must be ${oneOf(issue.values ?? [])}` };
|
|
17223
17219
|
}
|
|
17224
17220
|
if (code === "invalid_format") {
|
|
17225
17221
|
const described = FORMAT_DESCRIPTIONS[issue.format ?? ""];
|
|
17226
|
-
return described ? { path:
|
|
17222
|
+
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
17223
|
}
|
|
17228
17224
|
if (code === "invalid_union") {
|
|
17229
17225
|
if (segments.length && target.found && target.value == null) {
|
|
17230
|
-
return { path:
|
|
17226
|
+
return { path: path22, code, message: requiredMessage(named) };
|
|
17231
17227
|
}
|
|
17232
17228
|
const combined = unionIssue(plan2, issue, target.schema, target.value, fieldValue);
|
|
17233
17229
|
if (combined) {
|
|
17234
|
-
return combined.path ? combined : { path:
|
|
17230
|
+
return combined.path ? combined : { path: path22, code, message: `\xAB${target.label}\xBB ${combined.message}` };
|
|
17235
17231
|
}
|
|
17236
17232
|
}
|
|
17237
|
-
return { path:
|
|
17233
|
+
return { path: path22, code, message: `\xAB${target.label}\xBB is invalid` };
|
|
17238
17234
|
}
|
|
17239
17235
|
|
|
17240
|
-
// ../../flow-extension-runner/src/
|
|
17236
|
+
// ../../flow-extension-runner/src/params/schema/normalize.ts
|
|
17241
17237
|
var resolved2 = (value) => ({ value, present: true, issues: [] });
|
|
17242
17238
|
var rejected = (issues) => ({ present: false, issues });
|
|
17243
17239
|
function isAbsent(value, plan2) {
|
|
@@ -17345,7 +17341,7 @@ function restoreDeep(output, original, schema) {
|
|
|
17345
17341
|
}
|
|
17346
17342
|
var isPlain = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
17347
17343
|
|
|
17348
|
-
// ../../flow-extension-runner/src/
|
|
17344
|
+
// ../../flow-extension-runner/src/params/schema/parse.ts
|
|
17349
17345
|
var EXPECTED2 = {
|
|
17350
17346
|
string: "a string",
|
|
17351
17347
|
number: "a number",
|
|
@@ -17355,10 +17351,10 @@ var EXPECTED2 = {
|
|
|
17355
17351
|
};
|
|
17356
17352
|
function toIssues(error, param) {
|
|
17357
17353
|
return (error?.issues ?? []).map((issue) => {
|
|
17358
|
-
const
|
|
17354
|
+
const path22 = (issue.path ?? []).map(String).join(".");
|
|
17359
17355
|
const expected = issue.expected;
|
|
17360
|
-
const restated = param && !
|
|
17361
|
-
return { path:
|
|
17356
|
+
const restated = param && !path22 && issue.code === "invalid_type" && expected ? `\xAB${param}\xBB must be ${EXPECTED2[expected] ?? expected}` : void 0;
|
|
17357
|
+
return { path: path22, message: restated ?? issue.message ?? "invalid value", code: issue.code };
|
|
17362
17358
|
});
|
|
17363
17359
|
}
|
|
17364
17360
|
function parseSchema(schema, value, fail3, param) {
|
|
@@ -17372,7 +17368,7 @@ function parseSchema(schema, value, fail3, param) {
|
|
|
17372
17368
|
return result.data;
|
|
17373
17369
|
}
|
|
17374
17370
|
|
|
17375
|
-
// ../../flow-extension-runner/src/
|
|
17371
|
+
// ../../flow-extension-runner/src/params/params.ts
|
|
17376
17372
|
var Params = class {
|
|
17377
17373
|
constructor(scheme, source = {}) {
|
|
17378
17374
|
this.source = source;
|
|
@@ -17427,7 +17423,7 @@ var Params = class {
|
|
|
17427
17423
|
}
|
|
17428
17424
|
};
|
|
17429
17425
|
|
|
17430
|
-
// ../../flow-extension-runner/src/
|
|
17426
|
+
// ../../flow-extension-runner/src/params/config-params.ts
|
|
17431
17427
|
var ConfigParams = class _ConfigParams extends Params {
|
|
17432
17428
|
static of(scheme, source = {}) {
|
|
17433
17429
|
return new _ConfigParams(scheme, source);
|
|
@@ -17450,7 +17446,7 @@ var ConfigParams = class _ConfigParams extends Params {
|
|
|
17450
17446
|
}
|
|
17451
17447
|
};
|
|
17452
17448
|
|
|
17453
|
-
// ../../flow-extension-runner/src/
|
|
17449
|
+
// ../../flow-extension-runner/src/params/method-params.ts
|
|
17454
17450
|
var MethodParams = class _MethodParams extends Params {
|
|
17455
17451
|
static of(scheme, source = {}) {
|
|
17456
17452
|
return new _MethodParams(scheme, source);
|
|
@@ -17476,10 +17472,10 @@ var MethodParams = class _MethodParams extends Params {
|
|
|
17476
17472
|
}
|
|
17477
17473
|
};
|
|
17478
17474
|
|
|
17479
|
-
// ../../flow-extension-runner/src/
|
|
17475
|
+
// ../../flow-extension-runner/src/params/zod.ts
|
|
17480
17476
|
var import_zod3 = require("zod");
|
|
17481
17477
|
|
|
17482
|
-
// ../../flow-extension-runner/src/
|
|
17478
|
+
// ../../flow-extension-runner/src/params/files-options.ts
|
|
17483
17479
|
var import_zod2 = require("zod");
|
|
17484
17480
|
var SCOPE_VALUES = ["WORKSPACE", "FLOW", "EXECUTION"];
|
|
17485
17481
|
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 +17531,7 @@ function filesDeleteOptions(include) {
|
|
|
17535
17531
|
return group("filesDeleteOptions", FlowExtensionParamWidgetTypes.FILE_DELETE_OPTIONS, DELETE_FIELDS, include);
|
|
17536
17532
|
}
|
|
17537
17533
|
|
|
17538
|
-
// ../../flow-extension-runner/src/
|
|
17534
|
+
// ../../flow-extension-runner/src/params/zod.ts
|
|
17539
17535
|
var extended = false;
|
|
17540
17536
|
function extendPrototype() {
|
|
17541
17537
|
if (extended) {
|
|
@@ -17606,7 +17602,7 @@ Object.defineProperties(namespace, {
|
|
|
17606
17602
|
});
|
|
17607
17603
|
var z2 = namespace;
|
|
17608
17604
|
|
|
17609
|
-
// ../../flow-extension-runner/src/
|
|
17605
|
+
// ../../flow-extension-runner/src/params/json/values.ts
|
|
17610
17606
|
function toJsonValue(value) {
|
|
17611
17607
|
if (typeof value === "bigint") {
|
|
17612
17608
|
return { $bigint: value.toString() };
|
|
@@ -17623,7 +17619,7 @@ function toJsonValue(value) {
|
|
|
17623
17619
|
return value;
|
|
17624
17620
|
}
|
|
17625
17621
|
|
|
17626
|
-
// ../../flow-extension-runner/src/
|
|
17622
|
+
// ../../flow-extension-runner/src/params/json/checks.ts
|
|
17627
17623
|
var defOf = (check) => check?._zod?.def ?? {};
|
|
17628
17624
|
function messageOf(source) {
|
|
17629
17625
|
const { error } = source;
|
|
@@ -17702,10 +17698,10 @@ function encodeChecks(core) {
|
|
|
17702
17698
|
return { checks, unsupported };
|
|
17703
17699
|
}
|
|
17704
17700
|
|
|
17705
|
-
// ../../flow-extension-runner/src/
|
|
17701
|
+
// ../../flow-extension-runner/src/params/json/types.ts
|
|
17706
17702
|
var SCHEMA_JSON_VERSION = 1;
|
|
17707
17703
|
|
|
17708
|
-
// ../../flow-extension-runner/src/
|
|
17704
|
+
// ../../flow-extension-runner/src/params/json/decode.ts
|
|
17709
17705
|
var FORMAT_FACTORIES = {
|
|
17710
17706
|
url: z2.url,
|
|
17711
17707
|
email: z2.email,
|
|
@@ -17735,7 +17731,7 @@ var FORMAT_FACTORIES = {
|
|
|
17735
17731
|
duration: z2.iso?.duration
|
|
17736
17732
|
};
|
|
17737
17733
|
|
|
17738
|
-
// ../../flow-extension-runner/src/
|
|
17734
|
+
// ../../flow-extension-runner/src/params/json/encode.ts
|
|
17739
17735
|
var FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
17740
17736
|
"string",
|
|
17741
17737
|
"number",
|
|
@@ -17903,7 +17899,7 @@ function encodeParams(scheme, options = {}) {
|
|
|
17903
17899
|
};
|
|
17904
17900
|
}
|
|
17905
17901
|
|
|
17906
|
-
// ../../flow-extension-runner/src/
|
|
17902
|
+
// ../../flow-extension-runner/src/context/method-input.ts
|
|
17907
17903
|
var MethodInput = class {
|
|
17908
17904
|
constructor(serviceId, methodName, data = {}) {
|
|
17909
17905
|
this.serviceId = serviceId;
|
|
@@ -17961,7 +17957,7 @@ var MethodInput = class {
|
|
|
17961
17957
|
}
|
|
17962
17958
|
};
|
|
17963
17959
|
|
|
17964
|
-
// ../../flow-extension-runner/src/
|
|
17960
|
+
// ../../flow-extension-runner/src/method.ts
|
|
17965
17961
|
var ExtensionMethod = class {
|
|
17966
17962
|
constructor(extension) {
|
|
17967
17963
|
this.extension = extension;
|
|
@@ -17990,7 +17986,7 @@ var ExtensionMethod = class {
|
|
|
17990
17986
|
}
|
|
17991
17987
|
};
|
|
17992
17988
|
|
|
17993
|
-
// ../../flow-extension-runner/src/
|
|
17989
|
+
// ../../flow-extension-runner/src/params/config-types.ts
|
|
17994
17990
|
var ServiceConfigItemTypes = {
|
|
17995
17991
|
STRING: "string",
|
|
17996
17992
|
BOOL: "bool",
|
|
@@ -17999,7 +17995,7 @@ var ServiceConfigItemTypes = {
|
|
|
17999
17995
|
TEXT: "text"
|
|
18000
17996
|
};
|
|
18001
17997
|
|
|
18002
|
-
// ../../flow-extension-runner/src/
|
|
17998
|
+
// ../../flow-extension-runner/src/model/field-mapper.ts
|
|
18003
17999
|
var descriptionOf = (schema) => inspect(schema).meta.description || "";
|
|
18004
18000
|
var isRequired = (schema) => absenceOf(schema).absence === "required";
|
|
18005
18001
|
var isParamGroup = (ins) => ins.coreType === "object" && !!ins.meta.frWidget;
|
|
@@ -18106,7 +18102,7 @@ function fieldToConfigItem(name, schema) {
|
|
|
18106
18102
|
};
|
|
18107
18103
|
}
|
|
18108
18104
|
|
|
18109
|
-
// ../../flow-extension-runner/src/
|
|
18105
|
+
// ../../flow-extension-runner/src/model/method-model.ts
|
|
18110
18106
|
function opaqueParam(name, type = "OBJECT") {
|
|
18111
18107
|
return { name, required: false, description: "", type };
|
|
18112
18108
|
}
|
|
@@ -18128,7 +18124,7 @@ function argsFromParams(params) {
|
|
|
18128
18124
|
return args;
|
|
18129
18125
|
}
|
|
18130
18126
|
|
|
18131
|
-
// ../../flow-extension-runner/src/
|
|
18127
|
+
// ../../flow-extension-runner/src/model/params-model.ts
|
|
18132
18128
|
function toBodyParams(params) {
|
|
18133
18129
|
const scope2 = DictionaryScope.ROOT.enter(params.keys());
|
|
18134
18130
|
return params.fields().map(([name, schema]) => fieldToParam(name, schema, { scope: scope2 }));
|
|
@@ -18147,7 +18143,7 @@ function toConfigItems(config) {
|
|
|
18147
18143
|
return config.fields().map(([name, schema]) => fieldToConfigItem(name, schema));
|
|
18148
18144
|
}
|
|
18149
18145
|
|
|
18150
|
-
// ../../flow-extension-runner/src/
|
|
18146
|
+
// ../../flow-extension-runner/src/result.ts
|
|
18151
18147
|
function inferReturnType(value) {
|
|
18152
18148
|
if (Array.isArray(value)) {
|
|
18153
18149
|
return "LIST";
|
|
@@ -18215,7 +18211,7 @@ var ResultSpec = class _ResultSpec {
|
|
|
18215
18211
|
}
|
|
18216
18212
|
};
|
|
18217
18213
|
|
|
18218
|
-
// ../../flow-extension-runner/src/
|
|
18214
|
+
// ../../flow-extension-runner/src/actions/action-method.ts
|
|
18219
18215
|
var ActionMethod = class extends ExtensionMethod {
|
|
18220
18216
|
constructor(extension, props) {
|
|
18221
18217
|
super(extension);
|
|
@@ -18341,7 +18337,7 @@ var ActionMethod = class extends ExtensionMethod {
|
|
|
18341
18337
|
}
|
|
18342
18338
|
};
|
|
18343
18339
|
|
|
18344
|
-
// ../../flow-extension-runner/src/
|
|
18340
|
+
// ../../flow-extension-runner/src/context/files.ts
|
|
18345
18341
|
var import_backendless_request = __toESM(require_lib());
|
|
18346
18342
|
var FileScope = {
|
|
18347
18343
|
WORKSPACE: "WORKSPACE",
|
|
@@ -18349,7 +18345,7 @@ var FileScope = {
|
|
|
18349
18345
|
EXECUTION: "EXECUTION"
|
|
18350
18346
|
};
|
|
18351
18347
|
|
|
18352
|
-
// ../../flow-extension-runner/src/
|
|
18348
|
+
// ../../flow-extension-runner/src/context/logger.ts
|
|
18353
18349
|
var defaultLogger = {
|
|
18354
18350
|
debug: () => {
|
|
18355
18351
|
},
|
|
@@ -18359,7 +18355,7 @@ var defaultLogger = {
|
|
|
18359
18355
|
error: (...args) => console.error(...args)
|
|
18360
18356
|
};
|
|
18361
18357
|
|
|
18362
|
-
// ../../flow-extension-runner/src/
|
|
18358
|
+
// ../../flow-extension-runner/src/context/proxies.ts
|
|
18363
18359
|
function createThrowingProxy(feature, hint3) {
|
|
18364
18360
|
const fail3 = () => {
|
|
18365
18361
|
throw new FeatureNotEnabledError(feature, hint3);
|
|
@@ -18379,7 +18375,7 @@ function createThrowingProxy(feature, hint3) {
|
|
|
18379
18375
|
);
|
|
18380
18376
|
}
|
|
18381
18377
|
|
|
18382
|
-
// ../../flow-extension-runner/src/
|
|
18378
|
+
// ../../flow-extension-runner/src/context/execution-context.ts
|
|
18383
18379
|
var ExecutionContext = class _ExecutionContext {
|
|
18384
18380
|
#extension;
|
|
18385
18381
|
#options;
|
|
@@ -18481,14 +18477,14 @@ var ExecutionContext = class _ExecutionContext {
|
|
|
18481
18477
|
}
|
|
18482
18478
|
};
|
|
18483
18479
|
|
|
18484
|
-
// ../../flow-extension-runner/src/
|
|
18480
|
+
// ../../flow-extension-runner/src/dictionaries/payload-schema.ts
|
|
18485
18481
|
var DictionaryPayloadSchema = z2.looseObject({
|
|
18486
18482
|
search: z2.string().optional(),
|
|
18487
18483
|
cursor: z2.union([z2.string(), z2.number()]).nullish(),
|
|
18488
18484
|
criteria: z2.record(z2.string(), z2.unknown()).optional()
|
|
18489
18485
|
});
|
|
18490
18486
|
|
|
18491
|
-
// ../../flow-extension-runner/src/
|
|
18487
|
+
// ../../flow-extension-runner/src/dictionaries/dictionary-method.ts
|
|
18492
18488
|
var isBlank2 = (value) => value === void 0 || value === null || value === "";
|
|
18493
18489
|
var DictionaryMethod = class extends ExtensionMethod {
|
|
18494
18490
|
constructor(extension, props) {
|
|
@@ -18633,7 +18629,7 @@ var DictionaryMethod = class extends ExtensionMethod {
|
|
|
18633
18629
|
};
|
|
18634
18630
|
}
|
|
18635
18631
|
// Describe the full payload shape so the method advertises a complete, labelled input scheme (nested
|
|
18636
|
-
// props inline their own labels — mirroring the v1
|
|
18632
|
+
// props inline their own labels — mirroring the layout the v1 JSDoc parser established).
|
|
18637
18633
|
#payloadParam() {
|
|
18638
18634
|
const properties = [
|
|
18639
18635
|
{ name: "search", required: false, description: "Optional search string to filter results.", type: "STRING", label: "Search" },
|
|
@@ -18659,12 +18655,12 @@ var DictionaryMethod = class extends ExtensionMethod {
|
|
|
18659
18655
|
}
|
|
18660
18656
|
};
|
|
18661
18657
|
|
|
18662
|
-
// ../../flow-extension-runner/src/
|
|
18658
|
+
// ../../flow-extension-runner/src/loaders/payload-schema.ts
|
|
18663
18659
|
var LoaderPayloadSchema = z2.looseObject({
|
|
18664
18660
|
criteria: z2.record(z2.string(), z2.unknown()).optional()
|
|
18665
18661
|
});
|
|
18666
18662
|
|
|
18667
|
-
// ../../flow-extension-runner/src/
|
|
18663
|
+
// ../../flow-extension-runner/src/loaders/loader-method.ts
|
|
18668
18664
|
var LoaderMethod = class extends ExtensionMethod {
|
|
18669
18665
|
constructor(extension, owner) {
|
|
18670
18666
|
super(extension);
|
|
@@ -18818,17 +18814,17 @@ var DynamicPropsLoaderMethod = class extends ParamsLoaderMethod {
|
|
|
18818
18814
|
}
|
|
18819
18815
|
};
|
|
18820
18816
|
|
|
18821
|
-
// ../../flow-extension-runner/src/
|
|
18817
|
+
// ../../flow-extension-runner/src/oauth/oauth2.ts
|
|
18822
18818
|
var import_crypto = __toESM(require("crypto"));
|
|
18823
18819
|
|
|
18824
|
-
// ../../flow-extension-runner/src/
|
|
18820
|
+
// ../../flow-extension-runner/src/oauth/method-names.ts
|
|
18825
18821
|
var OAUTH_SYSTEM_METHODS = {
|
|
18826
18822
|
CONNECTION_URL: "getOAuth2ConnectionURL",
|
|
18827
18823
|
EXECUTE_CALLBACK: "executeCallback",
|
|
18828
18824
|
REFRESH_TOKEN: "refreshToken"
|
|
18829
18825
|
};
|
|
18830
18826
|
|
|
18831
|
-
// ../../flow-extension-runner/src/
|
|
18827
|
+
// ../../flow-extension-runner/src/oauth/system-params.ts
|
|
18832
18828
|
var OAuthCallbackObjectSchema = z2.looseObject({
|
|
18833
18829
|
code: z2.string().optional(),
|
|
18834
18830
|
redirectURI: z2.string().optional(),
|
|
@@ -18837,7 +18833,7 @@ var OAuthCallbackObjectSchema = z2.looseObject({
|
|
|
18837
18833
|
});
|
|
18838
18834
|
var RefreshTokenSchema = z2.string().min(1);
|
|
18839
18835
|
|
|
18840
|
-
// ../../flow-extension-runner/src/
|
|
18836
|
+
// ../../flow-extension-runner/src/oauth/oauth2.ts
|
|
18841
18837
|
var OAuth2 = class {
|
|
18842
18838
|
constructor(extension, props) {
|
|
18843
18839
|
this.extension = extension;
|
|
@@ -18982,10 +18978,10 @@ function userDataOf(token) {
|
|
|
18982
18978
|
return token && typeof token === "object" ? token.userData : void 0;
|
|
18983
18979
|
}
|
|
18984
18980
|
|
|
18985
|
-
// ../../flow-extension-runner/src/
|
|
18981
|
+
// ../../flow-extension-runner/src/polling-triggers/method-names.ts
|
|
18986
18982
|
var POLLING_SYSTEM_METHOD = "handleTriggerPollingForEvent";
|
|
18987
18983
|
|
|
18988
|
-
// ../../flow-extension-runner/src/
|
|
18984
|
+
// ../../flow-extension-runner/src/polling-triggers/system-params.ts
|
|
18989
18985
|
var PollingInvocationSchema = z2.looseObject({
|
|
18990
18986
|
eventName: z2.string().min(1),
|
|
18991
18987
|
// The trigger instance's configured params — validated against the trigger's own schema separately.
|
|
@@ -18995,7 +18991,7 @@ var PollingInvocationSchema = z2.looseObject({
|
|
|
18995
18991
|
connectionId: z2.string().nullish()
|
|
18996
18992
|
});
|
|
18997
18993
|
|
|
18998
|
-
// ../../flow-extension-runner/src/
|
|
18994
|
+
// ../../flow-extension-runner/src/polling-triggers/polling-triggers.ts
|
|
18999
18995
|
var PollingTriggers = class {
|
|
19000
18996
|
constructor(extension) {
|
|
19001
18997
|
this.extension = extension;
|
|
@@ -19034,15 +19030,15 @@ var PollingTriggers = class {
|
|
|
19034
19030
|
}
|
|
19035
19031
|
};
|
|
19036
19032
|
|
|
19037
|
-
// ../../flow-extension-runner/src/
|
|
19038
|
-
function getPath(source,
|
|
19039
|
-
return
|
|
19033
|
+
// ../../flow-extension-runner/src/path.ts
|
|
19034
|
+
function getPath(source, path22) {
|
|
19035
|
+
return path22.split(".").reduce(
|
|
19040
19036
|
(acc, key) => acc == null ? acc : acc[key],
|
|
19041
19037
|
source
|
|
19042
19038
|
);
|
|
19043
19039
|
}
|
|
19044
19040
|
|
|
19045
|
-
// ../../flow-extension-runner/src/
|
|
19041
|
+
// ../../flow-extension-runner/src/polling-triggers/mechanisms.ts
|
|
19046
19042
|
var PollingMechanism = class {
|
|
19047
19043
|
/**
|
|
19048
19044
|
* Pick the strategy an author declared, rejecting the combinations that cannot work. Runs at REGISTRATION
|
|
@@ -19176,7 +19172,7 @@ var WatermarkMechanism = class extends FetchingMechanism {
|
|
|
19176
19172
|
}
|
|
19177
19173
|
};
|
|
19178
19174
|
|
|
19179
|
-
// ../../flow-extension-runner/src/
|
|
19175
|
+
// ../../flow-extension-runner/src/polling-triggers/trigger-method.ts
|
|
19180
19176
|
var PollingTriggerMethod = class extends ExtensionMethod {
|
|
19181
19177
|
constructor(extension, props) {
|
|
19182
19178
|
super(extension);
|
|
@@ -19246,7 +19242,7 @@ var PollingTriggerMethod = class extends ExtensionMethod {
|
|
|
19246
19242
|
}
|
|
19247
19243
|
};
|
|
19248
19244
|
|
|
19249
|
-
// ../../flow-extension-runner/src/
|
|
19245
|
+
// ../../flow-extension-runner/src/realtime-triggers/method-names.ts
|
|
19250
19246
|
var REALTIME_SYSTEM_METHODS = {
|
|
19251
19247
|
UPSERT: "handleTriggerUpsertWebhook",
|
|
19252
19248
|
RESOLVE: "handleTriggerResolveEvents",
|
|
@@ -19255,7 +19251,7 @@ var REALTIME_SYSTEM_METHODS = {
|
|
|
19255
19251
|
REFRESH: "handleTriggerRefreshWebhook"
|
|
19256
19252
|
};
|
|
19257
19253
|
|
|
19258
|
-
// ../../flow-extension-runner/src/
|
|
19254
|
+
// ../../flow-extension-runner/src/realtime-triggers/system-params.ts
|
|
19259
19255
|
var anyRecord = () => z2.record(z2.string(), z2.unknown());
|
|
19260
19256
|
var SubscriptionEventSchema = z2.looseObject({
|
|
19261
19257
|
name: z2.string().min(1),
|
|
@@ -19291,7 +19287,7 @@ var RealtimeSelectInvocationSchema = z2.looseObject({
|
|
|
19291
19287
|
})).default([])
|
|
19292
19288
|
});
|
|
19293
19289
|
|
|
19294
|
-
// ../../flow-extension-runner/src/
|
|
19290
|
+
// ../../flow-extension-runner/src/realtime-triggers/verify.ts
|
|
19295
19291
|
function verifyDeclarative(verify, rawBody, headers, config, webhookData) {
|
|
19296
19292
|
const secret = verify.secret(config, { webhookData });
|
|
19297
19293
|
if (!secret) {
|
|
@@ -19314,7 +19310,7 @@ function verifyDeclarative(verify, rawBody, headers, config, webhookData) {
|
|
|
19314
19310
|
return true;
|
|
19315
19311
|
}
|
|
19316
19312
|
|
|
19317
|
-
// ../../flow-extension-runner/src/
|
|
19313
|
+
// ../../flow-extension-runner/src/realtime-triggers/realtime-setup.ts
|
|
19318
19314
|
function readExtract(extract, body) {
|
|
19319
19315
|
if (typeof extract === "function") {
|
|
19320
19316
|
return extract({ requestBody: body });
|
|
@@ -19610,7 +19606,7 @@ var RealtimeSetup = class {
|
|
|
19610
19606
|
}
|
|
19611
19607
|
};
|
|
19612
19608
|
|
|
19613
|
-
// ../../flow-extension-runner/src/
|
|
19609
|
+
// ../../flow-extension-runner/src/realtime-triggers/trigger-method.ts
|
|
19614
19610
|
function isFilled(value) {
|
|
19615
19611
|
return value != null && value !== "";
|
|
19616
19612
|
}
|
|
@@ -19706,12 +19702,12 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
|
|
|
19706
19702
|
if (typeof match === "function") {
|
|
19707
19703
|
return !!await match({ params, providerEventData, webhookData });
|
|
19708
19704
|
}
|
|
19709
|
-
for (const [paramKey,
|
|
19705
|
+
for (const [paramKey, path22] of Object.entries(match)) {
|
|
19710
19706
|
const paramValue = params[paramKey];
|
|
19711
19707
|
if (!isFilled(paramValue)) {
|
|
19712
19708
|
continue;
|
|
19713
19709
|
}
|
|
19714
|
-
if (`${paramValue}` !== `${getPath(providerEventData,
|
|
19710
|
+
if (`${paramValue}` !== `${getPath(providerEventData, path22)}`) {
|
|
19715
19711
|
return false;
|
|
19716
19712
|
}
|
|
19717
19713
|
}
|
|
@@ -19747,7 +19743,7 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
|
|
|
19747
19743
|
}
|
|
19748
19744
|
};
|
|
19749
19745
|
|
|
19750
|
-
// ../../flow-extension-runner/src/
|
|
19746
|
+
// ../../flow-extension-runner/src/system-method.ts
|
|
19751
19747
|
var SystemMethod = class extends ExtensionMethod {
|
|
19752
19748
|
constructor(extension, spec) {
|
|
19753
19749
|
super(extension);
|
|
@@ -19804,7 +19800,7 @@ var SystemMethod = class extends ExtensionMethod {
|
|
|
19804
19800
|
}
|
|
19805
19801
|
};
|
|
19806
19802
|
|
|
19807
|
-
// ../../flow-extension-runner/src/
|
|
19803
|
+
// ../../flow-extension-runner/src/extension.ts
|
|
19808
19804
|
var Extension = class {
|
|
19809
19805
|
#props;
|
|
19810
19806
|
#config;
|
|
@@ -19960,8 +19956,8 @@ var Extension = class {
|
|
|
19960
19956
|
};
|
|
19961
19957
|
}
|
|
19962
19958
|
/**
|
|
19963
|
-
* The published model — the
|
|
19964
|
-
*
|
|
19959
|
+
* The published model — the `{ serviceInfo, methodsMap }` shape the console consumes, the same one the
|
|
19960
|
+
* removed v1 JSDoc parser produced.
|
|
19965
19961
|
*
|
|
19966
19962
|
* Every method describes itself, so this is one pass with no per-kind branches: what a service publishes
|
|
19967
19963
|
* is exactly what it registered.
|
|
@@ -19974,8 +19970,6 @@ var Extension = class {
|
|
|
19974
19970
|
}
|
|
19975
19971
|
}
|
|
19976
19972
|
return {
|
|
19977
|
-
runnerVersion: "v2",
|
|
19978
|
-
//TODO: temp
|
|
19979
19973
|
serviceInfo: this.toServiceInfo(),
|
|
19980
19974
|
methodsMap,
|
|
19981
19975
|
configSchema: encodeParams(this.config.scheme)
|
|
@@ -20015,7 +20009,7 @@ var Extension = class {
|
|
|
20015
20009
|
}
|
|
20016
20010
|
};
|
|
20017
20011
|
|
|
20018
|
-
// ../../flow-extension-runner/src/
|
|
20012
|
+
// ../../flow-extension-runner/src/registry.ts
|
|
20019
20013
|
var ExtensionRegistry = class {
|
|
20020
20014
|
#extensions = /* @__PURE__ */ new Map();
|
|
20021
20015
|
register(extension) {
|
|
@@ -20035,15 +20029,19 @@ var ExtensionRegistry = class {
|
|
|
20035
20029
|
* which imports it.
|
|
20036
20030
|
*/
|
|
20037
20031
|
load(id, entryPointPath) {
|
|
20038
|
-
|
|
20039
|
-
require(entryPointPath);
|
|
20040
|
-
}
|
|
20041
|
-
const extension = this.get(id);
|
|
20032
|
+
const extension = this.tryLoad(id, entryPointPath);
|
|
20042
20033
|
if (!extension) {
|
|
20043
20034
|
throw new ExtensionNotRegisteredError(id, entryPointPath);
|
|
20044
20035
|
}
|
|
20045
20036
|
return extension;
|
|
20046
20037
|
}
|
|
20038
|
+
/** As `load`, but `undefined` instead of throwing when the module registers no extension under `id`. */
|
|
20039
|
+
tryLoad(id, entryPointPath) {
|
|
20040
|
+
if (!this.get(id)) {
|
|
20041
|
+
require(entryPointPath);
|
|
20042
|
+
}
|
|
20043
|
+
return this.get(id);
|
|
20044
|
+
}
|
|
20047
20045
|
// Test-only: clear the registry between isolated cases.
|
|
20048
20046
|
reset() {
|
|
20049
20047
|
this.#extensions.clear();
|
|
@@ -20054,7 +20052,7 @@ function getExtension(id) {
|
|
|
20054
20052
|
return registry.get(id);
|
|
20055
20053
|
}
|
|
20056
20054
|
|
|
20057
|
-
// ../../flow-extension-runner/src/
|
|
20055
|
+
// ../../flow-extension-runner/src/create-extension.ts
|
|
20058
20056
|
function createExtension(props) {
|
|
20059
20057
|
const extension = new Extension(props);
|
|
20060
20058
|
const api = {
|
|
@@ -20082,7 +20080,7 @@ function createExtension(props) {
|
|
|
20082
20080
|
return api;
|
|
20083
20081
|
}
|
|
20084
20082
|
|
|
20085
|
-
// ../../flow-extension-runner/src/
|
|
20083
|
+
// ../../flow-extension-runner/src/crypto.ts
|
|
20086
20084
|
var import_crypto2 = __toESM(require("crypto"));
|
|
20087
20085
|
var crypto2 = {
|
|
20088
20086
|
hmac(algo, key, data, encoding = "hex") {
|
|
@@ -20118,689 +20116,99 @@ var flowrunnerRuntime = {
|
|
|
20118
20116
|
z: z2,
|
|
20119
20117
|
crypto: crypto2,
|
|
20120
20118
|
createExtension,
|
|
20121
|
-
getExtension
|
|
20122
|
-
ServerCode: null
|
|
20119
|
+
getExtension
|
|
20123
20120
|
};
|
|
20124
20121
|
global.Flowrunner = flowrunnerRuntime;
|
|
20125
20122
|
|
|
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
|
-
}
|
|
20123
|
+
// ../../flow-extension-runner/src/index.ts
|
|
20184
20124
|
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
20125
|
return registry.load(serviceId, serviceEntryPointPath).toConfigItems();
|
|
20192
20126
|
}
|
|
20193
20127
|
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
|
-
};
|
|
20128
|
+
return registry.tryLoad(serviceId, serviceEntryPointPath)?.toDefinition() ?? null;
|
|
20720
20129
|
}
|
|
20721
20130
|
|
|
20722
20131
|
// src/operations/deploy/discover-services.ts
|
|
20723
20132
|
function discoverServices(projectRoot = process.cwd()) {
|
|
20724
|
-
const servicesDir =
|
|
20725
|
-
if (!
|
|
20133
|
+
const servicesDir = import_path12.default.resolve(projectRoot, "services");
|
|
20134
|
+
if (!import_fs8.default.existsSync(servicesDir)) {
|
|
20726
20135
|
return { services: [], skipped: [] };
|
|
20727
20136
|
}
|
|
20728
|
-
const serviceIds =
|
|
20729
|
-
const
|
|
20137
|
+
const serviceIds = import_fs8.default.readdirSync(servicesDir, { withFileTypes: true }).filter((file) => file.isDirectory()).map((file) => file.name);
|
|
20138
|
+
const services = [];
|
|
20730
20139
|
const skipped = [];
|
|
20731
20140
|
for (const serviceId of serviceIds) {
|
|
20732
|
-
const serviceDir =
|
|
20733
|
-
const serviceDISTEntryPoint =
|
|
20734
|
-
const serviceSRCEntryPoint =
|
|
20141
|
+
const serviceDir = import_path12.default.resolve(servicesDir, serviceId);
|
|
20142
|
+
const serviceDISTEntryPoint = import_path12.default.resolve(serviceDir, "./dist/index.js");
|
|
20143
|
+
const serviceSRCEntryPoint = import_path12.default.resolve(serviceDir, "./src/index.js");
|
|
20735
20144
|
let serviceFilePath = null;
|
|
20736
20145
|
try {
|
|
20737
|
-
if (
|
|
20146
|
+
if (import_fs8.default.existsSync(serviceDISTEntryPoint)) {
|
|
20738
20147
|
serviceFilePath = serviceDISTEntryPoint;
|
|
20739
|
-
} else if (
|
|
20148
|
+
} else if (import_fs8.default.existsSync(serviceSRCEntryPoint)) {
|
|
20740
20149
|
serviceFilePath = serviceSRCEntryPoint;
|
|
20741
20150
|
}
|
|
20742
20151
|
if (!serviceFilePath) {
|
|
20743
20152
|
skipped.push({ serviceId, reason: "it has neither a dist/index.js nor a src/index.js" });
|
|
20744
20153
|
continue;
|
|
20745
20154
|
}
|
|
20746
|
-
const
|
|
20747
|
-
|
|
20748
|
-
|
|
20749
|
-
skipped.push({ serviceId, reason: "its entry point does not define a service" });
|
|
20155
|
+
const definition = buildServiceDefinition(serviceId, serviceFilePath);
|
|
20156
|
+
if (!definition?.serviceInfo) {
|
|
20157
|
+
skipped.push({ serviceId, reason: "its entry point does not define a service with createExtension" });
|
|
20750
20158
|
continue;
|
|
20751
20159
|
}
|
|
20160
|
+
const { methodsMap, serviceInfo } = definition;
|
|
20752
20161
|
let configDescriptions = [];
|
|
20753
20162
|
try {
|
|
20754
|
-
configDescriptions =
|
|
20163
|
+
configDescriptions = getServiceConfigs(serviceId, serviceFilePath);
|
|
20755
20164
|
} catch (error) {
|
|
20756
20165
|
skipped.push({
|
|
20757
20166
|
serviceId,
|
|
20758
20167
|
reason: `its config items could not be read (${error.message}) \u2014 deployed without them`
|
|
20759
20168
|
});
|
|
20760
20169
|
}
|
|
20761
|
-
|
|
20170
|
+
services.push({
|
|
20762
20171
|
// Relative to the service, because the deployed archive's root IS the service.
|
|
20763
|
-
serviceFilePath:
|
|
20172
|
+
serviceFilePath: import_path12.default.relative(serviceDir, serviceFilePath),
|
|
20764
20173
|
serviceId,
|
|
20765
20174
|
serviceInfo,
|
|
20766
20175
|
methodsMap,
|
|
20767
20176
|
configDescriptions,
|
|
20768
|
-
//
|
|
20177
|
+
// The console renders the config dialog from the schema itself rather than from the
|
|
20769
20178
|
// `configDescriptions` projection, so both travel: the schema for the new path, the projection for
|
|
20770
20179
|
// every consumer that predates it.
|
|
20771
|
-
|
|
20772
|
-
configSchema: v2Definition?.configSchema ?? null
|
|
20180
|
+
configSchema: definition.configSchema ?? null
|
|
20773
20181
|
});
|
|
20774
20182
|
} catch (error) {
|
|
20775
20183
|
skipped.push({ serviceId, reason: error.message });
|
|
20776
20184
|
}
|
|
20777
20185
|
}
|
|
20778
|
-
return { services
|
|
20186
|
+
return { services, skipped };
|
|
20779
20187
|
}
|
|
20780
20188
|
|
|
20781
20189
|
// src/operations/deploy/hash.ts
|
|
20782
20190
|
var import_crypto4 = require("crypto");
|
|
20783
|
-
var
|
|
20784
|
-
var
|
|
20191
|
+
var import_fs9 = __toESM(require("fs"));
|
|
20192
|
+
var import_path13 = __toESM(require("path"));
|
|
20785
20193
|
async function computeServiceHash(projectRoot, serviceId) {
|
|
20786
20194
|
const hash = (0, import_crypto4.createHash)("sha256");
|
|
20787
|
-
const serviceDir =
|
|
20195
|
+
const serviceDir = import_path13.default.resolve(projectRoot, "services", serviceId);
|
|
20788
20196
|
const files = [];
|
|
20789
20197
|
collectFiles(serviceDir, "", files);
|
|
20790
20198
|
files.sort();
|
|
20791
20199
|
for (const file of files) {
|
|
20792
20200
|
hash.update(file);
|
|
20793
|
-
hash.update(
|
|
20201
|
+
hash.update(import_fs9.default.readFileSync(import_path13.default.resolve(serviceDir, file)));
|
|
20794
20202
|
}
|
|
20795
20203
|
return hash.digest("hex");
|
|
20796
20204
|
}
|
|
20797
20205
|
function collectFiles(serviceDir, relativeDir, files) {
|
|
20798
|
-
const entries =
|
|
20206
|
+
const entries = import_fs9.default.readdirSync(import_path13.default.resolve(serviceDir, relativeDir), { withFileTypes: true });
|
|
20799
20207
|
for (const entry of entries) {
|
|
20800
20208
|
if (HASH_EXCLUDED_FOLDERS.includes(entry.name)) {
|
|
20801
20209
|
continue;
|
|
20802
20210
|
}
|
|
20803
|
-
const relativePath = relativeDir ?
|
|
20211
|
+
const relativePath = relativeDir ? import_path13.default.join(relativeDir, entry.name) : entry.name;
|
|
20804
20212
|
if (!entry.isSymbolicLink()) {
|
|
20805
20213
|
if (entry.isDirectory()) {
|
|
20806
20214
|
collectFiles(serviceDir, relativePath, files);
|
|
@@ -20812,14 +20220,14 @@ function collectFiles(serviceDir, relativeDir, files) {
|
|
|
20812
20220
|
}
|
|
20813
20221
|
|
|
20814
20222
|
// src/operations/deploy/public-files.ts
|
|
20815
|
-
var
|
|
20816
|
-
var
|
|
20817
|
-
function collectPublicFiles(
|
|
20223
|
+
var import_fs10 = __toESM(require("fs"));
|
|
20224
|
+
var import_path14 = __toESM(require("path"));
|
|
20225
|
+
function collectPublicFiles(services, projectRoot = process.cwd()) {
|
|
20818
20226
|
const files = [];
|
|
20819
20227
|
const missing = [];
|
|
20820
|
-
for (const service of
|
|
20821
|
-
const servicePublicDir =
|
|
20822
|
-
if (!
|
|
20228
|
+
for (const service of services) {
|
|
20229
|
+
const servicePublicDir = import_path14.default.resolve(projectRoot, "services", service.serviceId, "public");
|
|
20230
|
+
if (!import_fs10.default.existsSync(servicePublicDir)) {
|
|
20823
20231
|
continue;
|
|
20824
20232
|
}
|
|
20825
20233
|
const iconPath = service.serviceInfo.integrationIcon;
|
|
@@ -20827,18 +20235,18 @@ function collectPublicFiles(services2, projectRoot = process.cwd()) {
|
|
|
20827
20235
|
continue;
|
|
20828
20236
|
}
|
|
20829
20237
|
const relativePath = iconPath.replace(/^\//, "");
|
|
20830
|
-
const fullPath =
|
|
20831
|
-
if (!fullPath.startsWith(servicePublicDir +
|
|
20238
|
+
const fullPath = import_path14.default.resolve(servicePublicDir, relativePath);
|
|
20239
|
+
if (!fullPath.startsWith(servicePublicDir + import_path14.default.sep)) {
|
|
20832
20240
|
continue;
|
|
20833
20241
|
}
|
|
20834
|
-
if (!
|
|
20242
|
+
if (!import_fs10.default.existsSync(fullPath)) {
|
|
20835
20243
|
missing.push({ serviceId: service.serviceId, relativePath });
|
|
20836
20244
|
continue;
|
|
20837
20245
|
}
|
|
20838
20246
|
files.push({
|
|
20839
20247
|
relativePath,
|
|
20840
20248
|
serviceId: service.serviceId,
|
|
20841
|
-
buffer:
|
|
20249
|
+
buffer: import_fs10.default.readFileSync(fullPath)
|
|
20842
20250
|
});
|
|
20843
20251
|
}
|
|
20844
20252
|
return { files, missing };
|
|
@@ -20863,19 +20271,31 @@ function selectServices(available, selection = {}) {
|
|
|
20863
20271
|
}
|
|
20864
20272
|
|
|
20865
20273
|
// src/operations/deploy/zip.ts
|
|
20866
|
-
var
|
|
20867
|
-
var
|
|
20274
|
+
var import_adm_zip = __toESM(require_adm_zip());
|
|
20275
|
+
var import_fs11 = __toESM(require("fs"));
|
|
20276
|
+
var import_path15 = __toESM(require("path"));
|
|
20277
|
+
var S_IFLNK = 40960;
|
|
20868
20278
|
async function createServiceZip(definition, projectRoot, serviceId) {
|
|
20869
|
-
|
|
20870
|
-
|
|
20871
|
-
|
|
20872
|
-
|
|
20873
|
-
|
|
20874
|
-
|
|
20875
|
-
|
|
20876
|
-
|
|
20877
|
-
|
|
20878
|
-
|
|
20279
|
+
const zip = new import_adm_zip.default();
|
|
20280
|
+
addDirectory(zip, import_path15.default.resolve(projectRoot, "services", serviceId), "package");
|
|
20281
|
+
zip.addFile("definition.json", Buffer.from(JSON.stringify(definition, null, 2)));
|
|
20282
|
+
return zip.toBuffer();
|
|
20283
|
+
}
|
|
20284
|
+
function addDirectory(zip, dir, zipDir) {
|
|
20285
|
+
for (const name of import_fs11.default.readdirSync(dir)) {
|
|
20286
|
+
const fullPath = import_path15.default.join(dir, name);
|
|
20287
|
+
const zipPath = `${zipDir}/${name}`;
|
|
20288
|
+
const stats = import_fs11.default.lstatSync(fullPath);
|
|
20289
|
+
if (stats.isDirectory()) {
|
|
20290
|
+
zip.addFile(`${zipPath}/`, Buffer.alloc(0), "", stats);
|
|
20291
|
+
addDirectory(zip, fullPath, zipPath);
|
|
20292
|
+
} else if (stats.isSymbolicLink()) {
|
|
20293
|
+
const entry = zip.addFile(zipPath, Buffer.from(import_fs11.default.readlinkSync(fullPath)), "", stats);
|
|
20294
|
+
entry.attr = (S_IFLNK | stats.mode & 4095) << 16 >>> 0;
|
|
20295
|
+
} else if (stats.isFile()) {
|
|
20296
|
+
zip.addFile(zipPath, import_fs11.default.readFileSync(fullPath), "", stats);
|
|
20297
|
+
}
|
|
20298
|
+
}
|
|
20879
20299
|
}
|
|
20880
20300
|
|
|
20881
20301
|
// src/operations/deploy/index.ts
|
|
@@ -20905,7 +20325,7 @@ async function deploy(options = {}) {
|
|
|
20905
20325
|
const { serverUrl, workspaceId, workspaceName, deployToken } = await resolveAuth(projectRoot, options.onAuthRequired);
|
|
20906
20326
|
const credentials = { serverUrl, workspaceId, deployToken };
|
|
20907
20327
|
const workspace = { workspaceId, workspaceName };
|
|
20908
|
-
if (!import_fs12.default.existsSync(
|
|
20328
|
+
if (!import_fs12.default.existsSync(import_path16.default.resolve(projectRoot, "services"))) {
|
|
20909
20329
|
throw new NoServicesDirectoryError();
|
|
20910
20330
|
}
|
|
20911
20331
|
emit({ type: "connecting", serverUrl, workspace });
|
|
@@ -21039,7 +20459,7 @@ var ERROR_HTML = (error) => `<!DOCTYPE html>
|
|
|
21039
20459
|
</body></html>`;
|
|
21040
20460
|
|
|
21041
20461
|
// src/server/routes/callback.ts
|
|
21042
|
-
function callbackRoute(
|
|
20462
|
+
function callbackRoute(path22 = "/callback") {
|
|
21043
20463
|
let resolveCode = null;
|
|
21044
20464
|
let rejectCode = null;
|
|
21045
20465
|
const respond = (route2, html) => {
|
|
@@ -21048,7 +20468,7 @@ function callbackRoute(path23 = "/callback") {
|
|
|
21048
20468
|
};
|
|
21049
20469
|
const route = {
|
|
21050
20470
|
method: "GET",
|
|
21051
|
-
path:
|
|
20471
|
+
path: path22,
|
|
21052
20472
|
handle: (context) => {
|
|
21053
20473
|
const code = context.url.searchParams.get("code");
|
|
21054
20474
|
const error = context.url.searchParams.get("error");
|
|
@@ -21206,7 +20626,7 @@ async function waitForEnter(message) {
|
|
|
21206
20626
|
}
|
|
21207
20627
|
|
|
21208
20628
|
// src/cli/reporter.ts
|
|
21209
|
-
var
|
|
20629
|
+
var import_path17 = __toESM(require("path"));
|
|
21210
20630
|
|
|
21211
20631
|
// src/utils/server-name.ts
|
|
21212
20632
|
var CLUSTER_LABELS = {
|
|
@@ -21227,7 +20647,7 @@ var SEGMENT_WORDING = {
|
|
|
21227
20647
|
unchanged: "The FlowRunner instructions block was already up to date"
|
|
21228
20648
|
};
|
|
21229
20649
|
function readablePath(fullPath) {
|
|
21230
|
-
const relative =
|
|
20650
|
+
const relative = import_path17.default.relative(process.cwd(), fullPath);
|
|
21231
20651
|
return !relative || relative.startsWith("..") ? fullPath : relative;
|
|
21232
20652
|
}
|
|
21233
20653
|
var STATUS_WORDING = {
|
|
@@ -21377,7 +20797,7 @@ function reportInitClaude(event) {
|
|
|
21377
20797
|
return;
|
|
21378
20798
|
}
|
|
21379
20799
|
case "segment":
|
|
21380
|
-
section(` ${SEGMENT_WORDING[event.outcome]} in ${
|
|
20800
|
+
section(` ${SEGMENT_WORDING[event.outcome]} in ${import_path17.default.basename(event.file)}.`);
|
|
21381
20801
|
return;
|
|
21382
20802
|
case "warning":
|
|
21383
20803
|
sayWarning(` ${event.message}`);
|
|
@@ -21847,31 +21267,31 @@ async function createServiceCommand(templateId, options = {}) {
|
|
|
21847
21267
|
}
|
|
21848
21268
|
|
|
21849
21269
|
// src/cli/commands/init.ts
|
|
21850
|
-
var
|
|
21270
|
+
var import_path21 = __toESM(require("path"));
|
|
21851
21271
|
|
|
21852
21272
|
// src/operations/init/index.ts
|
|
21853
21273
|
var import_child_process = require("child_process");
|
|
21854
21274
|
var import_fs14 = __toESM(require("fs"));
|
|
21855
|
-
var
|
|
21275
|
+
var import_path19 = __toESM(require("path"));
|
|
21856
21276
|
|
|
21857
21277
|
// src/operations/init/testing.ts
|
|
21858
21278
|
var import_fs13 = __toESM(require("fs"));
|
|
21859
|
-
var
|
|
21279
|
+
var import_path18 = __toESM(require("path"));
|
|
21860
21280
|
function testingFilesDirectory() {
|
|
21861
|
-
return
|
|
21281
|
+
return import_path18.default.join(packageRoot(), PROJECT_FILES_DIRECTORY);
|
|
21862
21282
|
}
|
|
21863
21283
|
function writeTestingFiles(projectRoot) {
|
|
21864
21284
|
const source = testingFilesDirectory();
|
|
21865
21285
|
const created = [];
|
|
21866
21286
|
const skipped = [];
|
|
21867
21287
|
for (const file of TESTING_FILES) {
|
|
21868
|
-
const target =
|
|
21288
|
+
const target = import_path18.default.join(projectRoot, file);
|
|
21869
21289
|
if (import_fs13.default.existsSync(target)) {
|
|
21870
21290
|
skipped.push(file);
|
|
21871
21291
|
continue;
|
|
21872
21292
|
}
|
|
21873
|
-
const contents = import_fs13.default.readFileSync(
|
|
21874
|
-
import_fs13.default.mkdirSync(
|
|
21293
|
+
const contents = import_fs13.default.readFileSync(import_path18.default.join(source, file));
|
|
21294
|
+
import_fs13.default.mkdirSync(import_path18.default.dirname(target), { recursive: true });
|
|
21875
21295
|
import_fs13.default.writeFileSync(target, contents);
|
|
21876
21296
|
created.push(file);
|
|
21877
21297
|
}
|
|
@@ -21883,10 +21303,10 @@ var GITIGNORE_ENTRIES = ["node_modules/", `${TOKEN_DIR}/`, ...TEST_GITIGNORE_ENT
|
|
|
21883
21303
|
var CLI_PACKAGE = "@flowrunner/cli";
|
|
21884
21304
|
var CLI_PACKAGE_NAMES = [CLI_PACKAGE, "flowrunner-cli"];
|
|
21885
21305
|
function cliVersion() {
|
|
21886
|
-
return JSON.parse(import_fs14.default.readFileSync(
|
|
21306
|
+
return JSON.parse(import_fs14.default.readFileSync(import_path19.default.join(packageRoot(), "package.json"), "utf-8")).version;
|
|
21887
21307
|
}
|
|
21888
21308
|
function packageNameFrom(directory) {
|
|
21889
|
-
const name =
|
|
21309
|
+
const name = import_path19.default.basename(import_path19.default.resolve(directory)).toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[._-]+|[-._]+$/g, "");
|
|
21890
21310
|
return name || "flowrunner-extensions";
|
|
21891
21311
|
}
|
|
21892
21312
|
function addMissing(section2, additions, placeholders = {}) {
|
|
@@ -21900,10 +21320,11 @@ function addMissing(section2, additions, placeholders = {}) {
|
|
|
21900
21320
|
return changed;
|
|
21901
21321
|
}
|
|
21902
21322
|
function writePackageJson(projectRoot, tests) {
|
|
21903
|
-
const fullPath =
|
|
21323
|
+
const fullPath = import_path19.default.join(projectRoot, "package.json");
|
|
21904
21324
|
const version2 = cliVersion();
|
|
21905
21325
|
const devDependencies = { [CLI_PACKAGE]: version2, ...tests ? TEST_DEV_DEPENDENCIES : {} };
|
|
21906
21326
|
const scripts = { deploy: "flowrunner deploy --all", ...tests ? TEST_SCRIPTS : {} };
|
|
21327
|
+
const overrides = tests ? TEST_OVERRIDES : {};
|
|
21907
21328
|
if (!import_fs14.default.existsSync(fullPath)) {
|
|
21908
21329
|
const manifest2 = {
|
|
21909
21330
|
name: packageNameFrom(projectRoot),
|
|
@@ -21911,7 +21332,8 @@ function writePackageJson(projectRoot, tests) {
|
|
|
21911
21332
|
private: true,
|
|
21912
21333
|
description: "FlowRunner custom extensions.",
|
|
21913
21334
|
scripts,
|
|
21914
|
-
devDependencies
|
|
21335
|
+
devDependencies,
|
|
21336
|
+
...tests ? { overrides } : {}
|
|
21915
21337
|
};
|
|
21916
21338
|
import_fs14.default.writeFileSync(fullPath, JSON.stringify(manifest2, null, 2) + "\n", "utf-8");
|
|
21917
21339
|
return "created";
|
|
@@ -21921,9 +21343,13 @@ function writePackageJson(projectRoot, tests) {
|
|
|
21921
21343
|
const additions = alreadyDeclared ? Object.fromEntries(Object.entries(devDependencies).filter(([name]) => name !== CLI_PACKAGE)) : devDependencies;
|
|
21922
21344
|
manifest.devDependencies ??= {};
|
|
21923
21345
|
manifest.scripts ??= {};
|
|
21346
|
+
if (tests) {
|
|
21347
|
+
manifest.overrides ??= {};
|
|
21348
|
+
}
|
|
21924
21349
|
const changed = [
|
|
21925
21350
|
addMissing(manifest.devDependencies, additions),
|
|
21926
|
-
addMissing(manifest.scripts, tests ? TEST_SCRIPTS : {}, PLACEHOLDER_SCRIPTS)
|
|
21351
|
+
addMissing(manifest.scripts, tests ? TEST_SCRIPTS : {}, PLACEHOLDER_SCRIPTS),
|
|
21352
|
+
tests && addMissing(manifest.overrides, overrides)
|
|
21927
21353
|
].some(Boolean);
|
|
21928
21354
|
if (!changed) {
|
|
21929
21355
|
return "skipped";
|
|
@@ -21932,7 +21358,7 @@ function writePackageJson(projectRoot, tests) {
|
|
|
21932
21358
|
return "updated";
|
|
21933
21359
|
}
|
|
21934
21360
|
function writeGitignore(projectRoot) {
|
|
21935
|
-
const fullPath =
|
|
21361
|
+
const fullPath = import_path19.default.join(projectRoot, ".gitignore");
|
|
21936
21362
|
if (!import_fs14.default.existsSync(fullPath)) {
|
|
21937
21363
|
import_fs14.default.writeFileSync(fullPath, GITIGNORE_ENTRIES.join("\n") + "\n", "utf-8");
|
|
21938
21364
|
return "created";
|
|
@@ -21991,7 +21417,7 @@ The authoring reference the CLI ships lives in
|
|
|
21991
21417
|
\`.flowrunner/token\` is the deploy token and must not.
|
|
21992
21418
|
`;
|
|
21993
21419
|
function writeReadme(projectRoot) {
|
|
21994
|
-
const fullPath =
|
|
21420
|
+
const fullPath = import_path19.default.join(projectRoot, "README.md");
|
|
21995
21421
|
if (import_fs14.default.existsSync(fullPath)) {
|
|
21996
21422
|
return "skipped";
|
|
21997
21423
|
}
|
|
@@ -22007,7 +21433,7 @@ var JSCONFIG = {
|
|
|
22007
21433
|
include: ["services/*/src/**/*.js"]
|
|
22008
21434
|
};
|
|
22009
21435
|
function writeJsconfig(projectRoot) {
|
|
22010
|
-
const fullPath =
|
|
21436
|
+
const fullPath = import_path19.default.join(projectRoot, "jsconfig.json");
|
|
22011
21437
|
if (import_fs14.default.existsSync(fullPath)) {
|
|
22012
21438
|
return "skipped";
|
|
22013
21439
|
}
|
|
@@ -22085,7 +21511,7 @@ function describeTarget(projectRoot) {
|
|
|
22085
21511
|
return { projectRoot, lines, defaultYes: false };
|
|
22086
21512
|
}
|
|
22087
21513
|
async function init(options = {}) {
|
|
22088
|
-
const projectRoot =
|
|
21514
|
+
const projectRoot = import_path19.default.resolve(options.cwd ?? ".");
|
|
22089
21515
|
const emit = emitter(options);
|
|
22090
21516
|
const warn = (message) => emit({ type: "warning", message });
|
|
22091
21517
|
const template = options.template ? resolveTemplateId(options.template) : null;
|
|
@@ -22158,9 +21584,9 @@ async function init(options = {}) {
|
|
|
22158
21584
|
// src/cli/offer-global-install.ts
|
|
22159
21585
|
var import_child_process2 = require("child_process");
|
|
22160
21586
|
var import_fs15 = __toESM(require("fs"));
|
|
22161
|
-
var
|
|
21587
|
+
var import_path20 = __toESM(require("path"));
|
|
22162
21588
|
function runningVersion() {
|
|
22163
|
-
return JSON.parse(import_fs15.default.readFileSync(
|
|
21589
|
+
return JSON.parse(import_fs15.default.readFileSync(import_path20.default.join(packageRoot(), "package.json"), "utf-8")).version;
|
|
22164
21590
|
}
|
|
22165
21591
|
async function offerGlobalInstall() {
|
|
22166
21592
|
if (!process.stdin.isTTY || hasGlobalInstall()) {
|
|
@@ -22211,7 +21637,7 @@ async function initCommand(templateId, options = {}) {
|
|
|
22211
21637
|
if (result.cancelled) {
|
|
22212
21638
|
return;
|
|
22213
21639
|
}
|
|
22214
|
-
const relative =
|
|
21640
|
+
const relative = import_path21.default.relative(process.cwd(), result.projectRoot);
|
|
22215
21641
|
const where = !relative || relative.startsWith("..") ? result.projectRoot : relative;
|
|
22216
21642
|
const step = (index2, text2) => say(` ${index2}. ${text2}`);
|
|
22217
21643
|
const option = (text2) => say(` ${text2}`);
|
|
@@ -22248,7 +21674,7 @@ async function initCommand(templateId, options = {}) {
|
|
|
22248
21674
|
|
|
22249
21675
|
// src/operations/init-claude/index.ts
|
|
22250
21676
|
var import_fs16 = __toESM(require("fs"));
|
|
22251
|
-
var
|
|
21677
|
+
var import_path22 = __toESM(require("path"));
|
|
22252
21678
|
|
|
22253
21679
|
// src/operations/init-claude/segment.ts
|
|
22254
21680
|
var BEGIN_MARKER = "<!-- flowrunner-cli:ai:start -->";
|
|
@@ -22283,7 +21709,7 @@ function mergeSegment(current, segment, file) {
|
|
|
22283
21709
|
|
|
22284
21710
|
// src/operations/init-claude/index.ts
|
|
22285
21711
|
function providerDirectory(provider = CLAUDE_PROVIDER) {
|
|
22286
|
-
return
|
|
21712
|
+
return import_path22.default.join(packageRoot(), AI_PROVIDERS_DIRECTORY, provider);
|
|
22287
21713
|
}
|
|
22288
21714
|
function packedAgents(directory) {
|
|
22289
21715
|
if (!import_fs16.default.existsSync(directory)) {
|
|
@@ -22292,7 +21718,7 @@ function packedAgents(directory) {
|
|
|
22292
21718
|
return import_fs16.default.readdirSync(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".md")).map((entry) => entry.name).sort();
|
|
22293
21719
|
}
|
|
22294
21720
|
function writeAgents(sourceDirectory, projectRoot, layout) {
|
|
22295
|
-
const directory =
|
|
21721
|
+
const directory = import_path22.default.join(projectRoot, layout.agentsDirectory);
|
|
22296
21722
|
const agents = packedAgents(sourceDirectory);
|
|
22297
21723
|
const created = [];
|
|
22298
21724
|
const updated = [];
|
|
@@ -22304,8 +21730,8 @@ function writeAgents(sourceDirectory, projectRoot, layout) {
|
|
|
22304
21730
|
}
|
|
22305
21731
|
import_fs16.default.mkdirSync(directory, { recursive: true });
|
|
22306
21732
|
for (const agent of agents) {
|
|
22307
|
-
const contents = import_fs16.default.readFileSync(
|
|
22308
|
-
const target =
|
|
21733
|
+
const contents = import_fs16.default.readFileSync(import_path22.default.join(sourceDirectory, agent), "utf-8");
|
|
21734
|
+
const target = import_path22.default.join(directory, agent);
|
|
22309
21735
|
if (contents.length === 0) {
|
|
22310
21736
|
warnings.push(`${agent} is empty in the installed CLI \u2014 written as an empty file.`);
|
|
22311
21737
|
}
|
|
@@ -22324,8 +21750,8 @@ function writeAgents(sourceDirectory, projectRoot, layout) {
|
|
|
22324
21750
|
return { directory, created, updated, unchanged, warnings };
|
|
22325
21751
|
}
|
|
22326
21752
|
function writeSegment(sourceDirectory, projectRoot, layout) {
|
|
22327
|
-
const file =
|
|
22328
|
-
const source =
|
|
21753
|
+
const file = import_path22.default.join(projectRoot, layout.instructionsFile);
|
|
21754
|
+
const source = import_path22.default.join(sourceDirectory, ORCHESTRATOR_SEGMENT_FILE);
|
|
22329
21755
|
const warnings = [];
|
|
22330
21756
|
if (!import_fs16.default.existsSync(source)) {
|
|
22331
21757
|
warnings.push(`The installed CLI ships no ${ORCHESTRATOR_SEGMENT_FILE} \u2014 ${layout.instructionsFile} was left alone.`);
|
|
@@ -22343,18 +21769,18 @@ function writeSegment(sourceDirectory, projectRoot, layout) {
|
|
|
22343
21769
|
return { file, outcome: merged.outcome, warnings };
|
|
22344
21770
|
}
|
|
22345
21771
|
async function initClaude(options = {}) {
|
|
22346
|
-
const projectRoot =
|
|
21772
|
+
const projectRoot = import_path22.default.resolve(options.cwd ?? ".");
|
|
22347
21773
|
const emit = emitter(options);
|
|
22348
21774
|
const warnAll = (messages) => messages.forEach((message) => emit({ type: "warning", message }));
|
|
22349
21775
|
const layout = PROVIDERS[CLAUDE_PROVIDER];
|
|
22350
21776
|
const sourceDirectory = providerDirectory(layout.id);
|
|
22351
21777
|
if (!import_fs16.default.existsSync(sourceDirectory)) {
|
|
22352
|
-
throw new AiDocsMissingError(
|
|
21778
|
+
throw new AiDocsMissingError(import_path22.default.join(AI_PROVIDERS_DIRECTORY, CLAUDE_PROVIDER));
|
|
22353
21779
|
}
|
|
22354
21780
|
if (!import_fs16.default.existsSync(projectRoot)) {
|
|
22355
21781
|
import_fs16.default.mkdirSync(projectRoot, { recursive: true });
|
|
22356
21782
|
}
|
|
22357
|
-
const agents = writeAgents(
|
|
21783
|
+
const agents = writeAgents(import_path22.default.join(sourceDirectory, PROVIDER_AGENTS_DIRECTORY), projectRoot, layout);
|
|
22358
21784
|
emit({
|
|
22359
21785
|
type: "agents",
|
|
22360
21786
|
directory: agents.directory,
|
|
@@ -22427,13 +21853,13 @@ async function logoutCommand() {
|
|
|
22427
21853
|
}
|
|
22428
21854
|
|
|
22429
21855
|
// src/operations/pull/index.ts
|
|
22430
|
-
var
|
|
21856
|
+
var import_adm_zip2 = __toESM(require_adm_zip());
|
|
22431
21857
|
var import_fs18 = __toESM(require("fs"));
|
|
22432
|
-
var
|
|
21858
|
+
var import_path24 = __toESM(require("path"));
|
|
22433
21859
|
|
|
22434
21860
|
// src/operations/pull/extract.ts
|
|
22435
21861
|
var import_fs17 = __toESM(require("fs"));
|
|
22436
|
-
var
|
|
21862
|
+
var import_path23 = __toESM(require("path"));
|
|
22437
21863
|
var PACKAGE_PREFIX = "package/";
|
|
22438
21864
|
var SAFE_SERVICE_ID = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
22439
21865
|
function isSafeServiceId(serviceId) {
|
|
@@ -22452,11 +21878,11 @@ function extractService(archive, directory) {
|
|
|
22452
21878
|
let written = 0;
|
|
22453
21879
|
for (const entry of serviceEntries(archive)) {
|
|
22454
21880
|
const relativePath = entry.entryName.slice(PACKAGE_PREFIX.length);
|
|
22455
|
-
const target =
|
|
22456
|
-
if (target !== directory && !target.startsWith(directory +
|
|
21881
|
+
const target = import_path23.default.resolve(directory, relativePath);
|
|
21882
|
+
if (target !== directory && !target.startsWith(directory + import_path23.default.sep)) {
|
|
22457
21883
|
continue;
|
|
22458
21884
|
}
|
|
22459
|
-
import_fs17.default.mkdirSync(
|
|
21885
|
+
import_fs17.default.mkdirSync(import_path23.default.dirname(target), { recursive: true });
|
|
22460
21886
|
import_fs17.default.writeFileSync(target, entry.getData());
|
|
22461
21887
|
written++;
|
|
22462
21888
|
}
|
|
@@ -22477,7 +21903,7 @@ function declaredDependencies(archive) {
|
|
|
22477
21903
|
|
|
22478
21904
|
// src/operations/pull/index.ts
|
|
22479
21905
|
async function localState(projectRoot, service) {
|
|
22480
|
-
if (!import_fs18.default.existsSync(
|
|
21906
|
+
if (!import_fs18.default.existsSync(import_path24.default.resolve(projectRoot, "services", service.serviceId))) {
|
|
22481
21907
|
return "absent";
|
|
22482
21908
|
}
|
|
22483
21909
|
try {
|
|
@@ -22522,7 +21948,7 @@ async function pull(options = {}) {
|
|
|
22522
21948
|
emit({ type: "skipped", serviceId: service.serviceId, reason });
|
|
22523
21949
|
continue;
|
|
22524
21950
|
}
|
|
22525
|
-
const directory =
|
|
21951
|
+
const directory = import_path24.default.resolve(projectRoot, "services", service.serviceId);
|
|
22526
21952
|
const state = await localState(projectRoot, service);
|
|
22527
21953
|
if (state === "same") {
|
|
22528
21954
|
upToDate.push({
|
|
@@ -22541,7 +21967,7 @@ async function pull(options = {}) {
|
|
|
22541
21967
|
}
|
|
22542
21968
|
const exists = state === "different";
|
|
22543
21969
|
const zipBuffer = await guard(() => downloadRemoteService(credentials, service.serviceId));
|
|
22544
|
-
const archive = new
|
|
21970
|
+
const archive = new import_adm_zip2.default(zipBuffer);
|
|
22545
21971
|
if (exists) {
|
|
22546
21972
|
import_fs18.default.rmSync(directory, { recursive: true, force: true });
|
|
22547
21973
|
}
|