@flowrunner/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +148 -0
- package/ai-docs/instructions/service-code-format/01-service-structure.md +180 -0
- package/ai-docs/instructions/service-code-format/02-zod-types.md +260 -0
- package/ai-docs/instructions/service-code-format/03-parameters.md +193 -0
- package/ai-docs/instructions/service-code-format/04-http-requests.md +257 -0
- package/ai-docs/instructions/service-code-format/05-dictionaries.md +103 -0
- package/ai-docs/instructions/service-code-format/06-oauth2.md +42 -0
- package/ai-docs/instructions/service-code-format/07-actions.md +171 -0
- package/ai-docs/instructions/service-code-format/08-polling-triggers.md +54 -0
- package/ai-docs/instructions/service-code-format/09-realtime-triggers.md +269 -0
- package/ai-docs/instructions/service-code-format/10-files-api.md +148 -0
- package/ai-docs/instructions/service-code-format/11-output-model.md +142 -0
- package/ai-docs/instructions/service-code-format/12-service-readme.md +69 -0
- package/ai-docs/instructions/service-code-format/13-runtime-contracts.md +193 -0
- package/ai-docs/instructions/service-code-format/14-reference-service.md +341 -0
- package/ai-docs/instructions/service-code-format/15-unit-tests.md +361 -0
- package/ai-docs/instructions/service-code-format/16-gotchas.md +201 -0
- package/ai-docs/instructions/service-code-format/17-client-certificates.md +162 -0
- package/ai-docs/instructions/service-code-format/18-test-recipes.md +160 -0
- package/ai-docs/instructions/service-code-format/README.md +120 -0
- package/ai-docs/providers/claude/agents/flowrunner-service-code-engineer.md +139 -0
- package/ai-docs/providers/claude/agents/flowrunner-service-test-engineer.md +497 -0
- package/ai-docs/providers/claude/main-orchestrator-segment.md +51 -0
- package/bin/flowrunner.js +66 -0
- package/bin/resolve-local.js +98 -0
- package/dist/cli.js +10972 -0
- package/dist/cli.js.map +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +10131 -0
- package/dist/index.js.map +7 -0
- package/dist/types/flow-extension-runner/src/common/config.d.ts +12 -0
- package/dist/types/flow-extension-runner/src/common/constants.d.ts +9 -0
- package/dist/types/flow-extension-runner/src/common/context-files.d.ts +107 -0
- package/dist/types/flow-extension-runner/src/common/context.d.ts +6 -0
- package/dist/types/flow-extension-runner/src/common/types.d.ts +11 -0
- package/dist/types/flow-extension-runner/src/errors/base.d.ts +17 -0
- package/dist/types/flow-extension-runner/src/errors/codes.d.ts +17 -0
- package/dist/types/flow-extension-runner/src/errors/errors.d.ts +48 -0
- package/dist/types/flow-extension-runner/src/errors/index.d.ts +3 -0
- package/dist/types/flow-extension-runner/src/global.d.ts +34 -0
- package/dist/types/flow-extension-runner/src/index.d.ts +15 -0
- package/dist/types/flow-extension-runner/src/namespace.d.ts +3 -0
- package/dist/types/flow-extension-runner/src/v1/config.d.ts +3 -0
- package/dist/types/flow-extension-runner/src/v1/constants.d.ts +4 -0
- package/dist/types/flow-extension-runner/src/v1/index.d.ts +11 -0
- package/dist/types/flow-extension-runner/src/v1/namespace.d.ts +9 -0
- package/dist/types/flow-extension-runner/src/v1/service.d.ts +29 -0
- package/dist/types/flow-extension-runner/src/v1/types.d.ts +13 -0
- package/dist/types/flow-extension-runner/src/v2/actions/action-method.d.ts +34 -0
- package/dist/types/flow-extension-runner/src/v2/context/execution-context.d.ts +25 -0
- package/dist/types/flow-extension-runner/src/v2/context/logger.d.ts +2 -0
- package/dist/types/flow-extension-runner/src/v2/context/method-input.d.ts +27 -0
- package/dist/types/flow-extension-runner/src/v2/context/proxies.d.ts +1 -0
- package/dist/types/flow-extension-runner/src/v2/create-extension.d.ts +2 -0
- package/dist/types/flow-extension-runner/src/v2/crypto.d.ts +6 -0
- package/dist/types/flow-extension-runner/src/v2/dictionaries/dictionary-method.d.ts +24 -0
- package/dist/types/flow-extension-runner/src/v2/dictionaries/payload-schema.d.ts +10 -0
- package/dist/types/flow-extension-runner/src/v2/extension.d.ts +51 -0
- package/dist/types/flow-extension-runner/src/v2/index.d.ts +39 -0
- package/dist/types/flow-extension-runner/src/v2/loaders/loader-method.d.ts +31 -0
- package/dist/types/flow-extension-runner/src/v2/loaders/loader-owner.d.ts +17 -0
- package/dist/types/flow-extension-runner/src/v2/loaders/payload-schema.d.ts +3 -0
- package/dist/types/flow-extension-runner/src/v2/method.d.ts +22 -0
- package/dist/types/flow-extension-runner/src/v2/model/field-mapper.d.ts +10 -0
- package/dist/types/flow-extension-runner/src/v2/model/method-model.d.ts +3 -0
- package/dist/types/flow-extension-runner/src/v2/model/model-types.d.ts +70 -0
- package/dist/types/flow-extension-runner/src/v2/model/params-model.d.ts +16 -0
- package/dist/types/flow-extension-runner/src/v2/oauth/method-names.d.ts +5 -0
- package/dist/types/flow-extension-runner/src/v2/oauth/oauth2.d.ts +9 -0
- package/dist/types/flow-extension-runner/src/v2/oauth/system-params.d.ts +6 -0
- package/dist/types/flow-extension-runner/src/v2/oauth/types.d.ts +54 -0
- package/dist/types/flow-extension-runner/src/v2/params/config-params.d.ts +14 -0
- package/dist/types/flow-extension-runner/src/v2/params/files-options.d.ts +58 -0
- package/dist/types/flow-extension-runner/src/v2/params/index.d.ts +19 -0
- package/dist/types/flow-extension-runner/src/v2/params/json/checks.d.ts +26 -0
- package/dist/types/flow-extension-runner/src/v2/params/json/decode.d.ts +24 -0
- package/dist/types/flow-extension-runner/src/v2/params/json/encode.d.ts +20 -0
- package/dist/types/flow-extension-runner/src/v2/params/json/types.d.ts +86 -0
- package/dist/types/flow-extension-runner/src/v2/params/json/values.d.ts +5 -0
- package/dist/types/flow-extension-runner/src/v2/params/method-params.d.ts +17 -0
- package/dist/types/flow-extension-runner/src/v2/params/params.d.ts +26 -0
- package/dist/types/flow-extension-runner/src/v2/params/schema/assert-object-schema.d.ts +6 -0
- package/dist/types/flow-extension-runner/src/v2/params/schema/assert-supported-schema.d.ts +8 -0
- package/dist/types/flow-extension-runner/src/v2/params/schema/coerce.d.ts +54 -0
- package/dist/types/flow-extension-runner/src/v2/params/schema/dates.d.ts +40 -0
- package/dist/types/flow-extension-runner/src/v2/params/schema/defaults.d.ts +36 -0
- package/dist/types/flow-extension-runner/src/v2/params/schema/field-plan.d.ts +33 -0
- package/dist/types/flow-extension-runner/src/v2/params/schema/introspect.d.ts +58 -0
- package/dist/types/flow-extension-runner/src/v2/params/schema/labels.d.ts +3 -0
- package/dist/types/flow-extension-runner/src/v2/params/schema/messages.d.ts +16 -0
- package/dist/types/flow-extension-runner/src/v2/params/schema/normalize.d.ts +8 -0
- package/dist/types/flow-extension-runner/src/v2/params/schema/parse.d.ts +7 -0
- package/dist/types/flow-extension-runner/src/v2/params/types.d.ts +29 -0
- package/dist/types/flow-extension-runner/src/v2/params/widget-types.d.ts +40 -0
- package/dist/types/flow-extension-runner/src/v2/params/zod.d.ts +86 -0
- package/dist/types/flow-extension-runner/src/v2/path.d.ts +1 -0
- package/dist/types/flow-extension-runner/src/v2/polling-triggers/mechanisms.d.ts +19 -0
- package/dist/types/flow-extension-runner/src/v2/polling-triggers/method-names.d.ts +1 -0
- package/dist/types/flow-extension-runner/src/v2/polling-triggers/polling-triggers.d.ts +11 -0
- package/dist/types/flow-extension-runner/src/v2/polling-triggers/system-params.d.ts +7 -0
- package/dist/types/flow-extension-runner/src/v2/polling-triggers/trigger-method.d.ts +25 -0
- package/dist/types/flow-extension-runner/src/v2/polling-triggers/types.d.ts +46 -0
- package/dist/types/flow-extension-runner/src/v2/realtime-triggers/method-names.d.ts +7 -0
- package/dist/types/flow-extension-runner/src/v2/realtime-triggers/realtime-setup.d.ts +10 -0
- package/dist/types/flow-extension-runner/src/v2/realtime-triggers/system-params.d.ts +29 -0
- package/dist/types/flow-extension-runner/src/v2/realtime-triggers/trigger-method.d.ts +33 -0
- package/dist/types/flow-extension-runner/src/v2/realtime-triggers/types.d.ts +147 -0
- package/dist/types/flow-extension-runner/src/v2/realtime-triggers/verify.d.ts +2 -0
- package/dist/types/flow-extension-runner/src/v2/registry.d.ts +20 -0
- package/dist/types/flow-extension-runner/src/v2/result.d.ts +13 -0
- package/dist/types/flow-extension-runner/src/v2/system-method.d.ts +41 -0
- package/dist/types/flow-extension-runner/src/v2/types.d.ts +126 -0
- package/dist/types/jsdoc-parser/src/custom-type-defs/files.d.ts +2 -0
- package/dist/types/jsdoc-parser/src/index.d.ts +2 -0
- package/dist/types/jsdoc-parser/src/lib.d.ts +42 -0
- package/dist/types/jsdoc-parser/src/types.d.ts +2 -0
- package/dist/types/packages/cli/src/api/console-client.d.ts +69 -0
- package/dist/types/packages/cli/src/constants/index.d.ts +5 -0
- package/dist/types/packages/cli/src/constants/packaging.d.ts +7 -0
- package/dist/types/packages/cli/src/constants/project.d.ts +9 -0
- package/dist/types/packages/cli/src/constants/providers.d.ts +30 -0
- package/dist/types/packages/cli/src/constants/server.d.ts +29 -0
- package/dist/types/packages/cli/src/constants/testing.d.ts +32 -0
- package/dist/types/packages/cli/src/errors.d.ts +131 -0
- package/dist/types/packages/cli/src/index.d.ts +29 -0
- package/dist/types/packages/cli/src/operations/deploy/discover-services.d.ts +26 -0
- package/dist/types/packages/cli/src/operations/deploy/hash.d.ts +1 -0
- package/dist/types/packages/cli/src/operations/deploy/index.d.ts +94 -0
- package/dist/types/packages/cli/src/operations/deploy/public-files.d.ts +20 -0
- package/dist/types/packages/cli/src/operations/deploy/select.d.ts +9 -0
- package/dist/types/packages/cli/src/operations/deploy/zip.d.ts +1 -0
- package/dist/types/packages/cli/src/operations/init/answers.d.ts +35 -0
- package/dist/types/packages/cli/src/operations/init/create-service.d.ts +39 -0
- package/dist/types/packages/cli/src/operations/init/index.d.ts +79 -0
- package/dist/types/packages/cli/src/operations/init/testing.d.ts +13 -0
- package/dist/types/packages/cli/src/operations/init-claude/index.d.ts +40 -0
- package/dist/types/packages/cli/src/operations/init-claude/segment.d.ts +25 -0
- package/dist/types/packages/cli/src/operations/login.d.ts +38 -0
- package/dist/types/packages/cli/src/operations/logout.d.ts +19 -0
- package/dist/types/packages/cli/src/operations/pull/extract.d.ts +23 -0
- package/dist/types/packages/cli/src/operations/pull/index.d.ts +87 -0
- package/dist/types/packages/cli/src/operations/server-target.d.ts +14 -0
- package/dist/types/packages/cli/src/operations/types.d.ts +20 -0
- package/dist/types/packages/cli/src/operations/use-server.d.ts +17 -0
- package/dist/types/packages/cli/src/project/auth.d.ts +41 -0
- package/dist/types/packages/cli/src/project/config.d.ts +31 -0
- package/dist/types/packages/cli/src/project/token.d.ts +5 -0
- package/dist/types/packages/cli/src/server/index.d.ts +14 -0
- package/dist/types/packages/cli/src/server/pages.d.ts +2 -0
- package/dist/types/packages/cli/src/server/routes/callback.d.ts +6 -0
- package/dist/types/packages/cli/src/server/types.d.ts +12 -0
- package/dist/types/packages/cli/src/templates/index.d.ts +8 -0
- package/dist/types/packages/cli/src/templates/manifest.d.ts +97 -0
- package/dist/types/packages/cli/src/templates/package-root.d.ts +3 -0
- package/dist/types/packages/cli/src/templates/paths.d.ts +3 -0
- package/dist/types/packages/cli/src/templates/registry.d.ts +13 -0
- package/dist/types/packages/cli/src/templates/render.d.ts +13 -0
- package/dist/types/packages/cli/src/templates/scaffold.d.ts +25 -0
- package/dist/types/packages/cli/src/utils/invocation.d.ts +28 -0
- package/dist/types/packages/cli/src/utils/open-browser.d.ts +2 -0
- package/dist/types/shared/src/constants/ai-agent-tools.d.ts +20 -0
- package/dist/types/shared/src/constants/ai.d.ts +11 -0
- package/dist/types/shared/src/constants/api-keys.d.ts +1 -0
- package/dist/types/shared/src/constants/app.d.ts +58 -0
- package/dist/types/shared/src/constants/billing.d.ts +16 -0
- package/dist/types/shared/src/constants/compliances.d.ts +3 -0
- package/dist/types/shared/src/constants/data-types.d.ts +26 -0
- package/dist/types/shared/src/constants/error-codes.d.ts +16 -0
- package/dist/types/shared/src/constants/flow.d.ts +12 -0
- package/dist/types/shared/src/constants/index.d.ts +16 -0
- package/dist/types/shared/src/constants/knowledge-base.d.ts +13 -0
- package/dist/types/shared/src/constants/notification-types.d.ts +985 -0
- package/dist/types/shared/src/constants/notifications.d.ts +10 -0
- package/dist/types/shared/src/constants/patterns.d.ts +28 -0
- package/dist/types/shared/src/constants/retry-policy.d.ts +30 -0
- package/dist/types/shared/src/constants/severity.d.ts +9 -0
- package/dist/types/shared/src/constants/shared-extensions-search.d.ts +6 -0
- package/dist/types/shared/src/constants/shared-extensions.d.ts +35 -0
- package/dist/types/shared/src/constants/zod.d.ts +2 -0
- package/dist/types/shared/src/errors/api.d.ts +4 -0
- package/dist/types/shared/src/errors/base.d.ts +38 -0
- package/dist/types/shared/src/errors/common.d.ts +39 -0
- package/dist/types/shared/src/errors/index.d.ts +13 -0
- package/dist/types/shared/src/errors/k8s.d.ts +4 -0
- package/dist/types/shared/src/errors/message.d.ts +48 -0
- package/dist/types/shared/src/errors/open-search.d.ts +4 -0
- package/dist/types/shared/src/errors/s3.d.ts +11 -0
- package/dist/types/shared/src/extensions/zod.d.ts +25 -0
- package/dist/types/shared/src/scheme/account/dto.d.ts +60 -0
- package/dist/types/shared/src/scheme/account/index.d.ts +1 -0
- package/dist/types/shared/src/scheme/ai-agent-tools/dto.d.ts +69 -0
- package/dist/types/shared/src/scheme/ai-agent-tools/index.d.ts +2 -0
- package/dist/types/shared/src/scheme/ai-agent-tools/parameters.d.ts +7 -0
- package/dist/types/shared/src/scheme/ai-router/dto.d.ts +23 -0
- package/dist/types/shared/src/scheme/ai-router/index.d.ts +2 -0
- package/dist/types/shared/src/scheme/api-keys/dto.d.ts +28 -0
- package/dist/types/shared/src/scheme/api-keys/index.d.ts +2 -0
- package/dist/types/shared/src/scheme/app/index.d.ts +1 -0
- package/dist/types/shared/src/scheme/app/java.dto.d.ts +6 -0
- package/dist/types/shared/src/scheme/billing/index.d.ts +1 -0
- package/dist/types/shared/src/scheme/billing/java.dto.d.ts +163 -0
- package/dist/types/shared/src/scheme/crm/billing.d.ts +149 -0
- package/dist/types/shared/src/scheme/crm/dto.d.ts +212 -0
- package/dist/types/shared/src/scheme/crm/index.d.ts +3 -0
- package/dist/types/shared/src/scheme/data-types/index.d.ts +1 -0
- package/dist/types/shared/src/scheme/data-types/java.dto.d.ts +23 -0
- package/dist/types/shared/src/scheme/dynamic-forms/dto.d.ts +30 -0
- package/dist/types/shared/src/scheme/dynamic-forms/index.d.ts +2 -0
- package/dist/types/shared/src/scheme/extensions/index.d.ts +1 -0
- package/dist/types/shared/src/scheme/extensions/params-to-zod.d.ts +14 -0
- package/dist/types/shared/src/scheme/flowrunner/custom-elements.d.ts +368 -0
- package/dist/types/shared/src/scheme/flowrunner/index.d.ts +3 -0
- package/dist/types/shared/src/scheme/flowrunner/java.dto.d.ts +628 -0
- package/dist/types/shared/src/scheme/index.d.ts +19 -0
- package/dist/types/shared/src/scheme/integration-connection/dto.d.ts +81 -0
- package/dist/types/shared/src/scheme/integration-connection/index.d.ts +2 -0
- package/dist/types/shared/src/scheme/knowledge-base/dto.d.ts +540 -0
- package/dist/types/shared/src/scheme/knowledge-base/index.d.ts +2 -0
- package/dist/types/shared/src/scheme/mcp-oauth/dto.d.ts +7 -0
- package/dist/types/shared/src/scheme/mcp-oauth/index.d.ts +2 -0
- package/dist/types/shared/src/scheme/notifications/dto.d.ts +111 -0
- package/dist/types/shared/src/scheme/notifications/index.d.ts +3 -0
- package/dist/types/shared/src/scheme/notifications/rest.d.ts +148 -0
- package/dist/types/shared/src/scheme/properties/account.d.ts +3 -0
- package/dist/types/shared/src/scheme/properties/app.d.ts +5 -0
- package/dist/types/shared/src/scheme/properties/billing.d.ts +12 -0
- package/dist/types/shared/src/scheme/properties/common.d.ts +2 -0
- package/dist/types/shared/src/scheme/properties/db.d.ts +8 -0
- package/dist/types/shared/src/scheme/properties/flow-extensions.d.ts +7 -0
- package/dist/types/shared/src/scheme/properties/index.d.ts +7 -0
- package/dist/types/shared/src/scheme/remote-mcp-server/dto.d.ts +278 -0
- package/dist/types/shared/src/scheme/remote-mcp-server/index.d.ts +2 -0
- package/dist/types/shared/src/scheme/shared-extensions/base.d.ts +56 -0
- package/dist/types/shared/src/scheme/shared-extensions/config.d.ts +96 -0
- package/dist/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +485 -0
- package/dist/types/shared/src/scheme/shared-extensions/extension.d.ts +387 -0
- package/dist/types/shared/src/scheme/shared-extensions/flow-extensions.d.ts +64 -0
- package/dist/types/shared/src/scheme/shared-extensions/index.d.ts +15 -0
- package/dist/types/shared/src/scheme/shared-extensions/light.d.ts +38 -0
- package/dist/types/shared/src/scheme/shared-extensions/logs.d.ts +21 -0
- package/dist/types/shared/src/scheme/shared-extensions/methods.d.ts +80 -0
- package/dist/types/shared/src/scheme/shared-extensions/params-schema.d.ts +47 -0
- package/dist/types/shared/src/scheme/shared-extensions/popular-pool.d.ts +11 -0
- package/dist/types/shared/src/scheme/shared-extensions/resolve.d.ts +364 -0
- package/dist/types/shared/src/scheme/shared-extensions/rest.d.ts +9 -0
- package/dist/types/shared/src/scheme/shared-extensions/search.d.ts +177 -0
- package/dist/types/shared/src/scheme/shared-extensions/service-identity.d.ts +10 -0
- package/dist/types/shared/src/scheme/shared-extensions/service-info.d.ts +15 -0
- package/dist/types/shared/src/scheme/workspace/dto.d.ts +40 -0
- package/dist/types/shared/src/scheme/workspace/index.d.ts +1 -0
- package/dist/types/shared/src/utils/object.d.ts +8 -0
- package/dist/types/shared/src/utils/uuid.d.ts +5 -0
- package/dist/types/shared/src/utils/versions.d.ts +4 -0
- package/dist/types/types/backendless-request.d.ts +40 -0
- package/package.json +66 -0
- package/project-files/jest.config.js +38 -0
- package/project-files/jest.setup.js +24 -0
- package/project-files/sandbox/files-mock.js +654 -0
- package/project-files/sandbox/index.js +32 -0
- package/project-files/sandbox/nock-mock.js +600 -0
- package/project-files/sandbox/service.js +145 -0
- package/runtime/index.d.ts +2 -0
- package/runtime/index.js +5665 -0
- package/runtime/index.js.map +7 -0
- package/runtime/types/flow-extension-runner/src/common/config.d.ts +12 -0
- package/runtime/types/flow-extension-runner/src/common/constants.d.ts +9 -0
- package/runtime/types/flow-extension-runner/src/common/context-files.d.ts +107 -0
- package/runtime/types/flow-extension-runner/src/common/context.d.ts +6 -0
- package/runtime/types/flow-extension-runner/src/common/types.d.ts +11 -0
- package/runtime/types/flow-extension-runner/src/errors/base.d.ts +17 -0
- package/runtime/types/flow-extension-runner/src/errors/codes.d.ts +17 -0
- package/runtime/types/flow-extension-runner/src/errors/errors.d.ts +48 -0
- package/runtime/types/flow-extension-runner/src/errors/index.d.ts +3 -0
- package/runtime/types/flow-extension-runner/src/global.d.ts +34 -0
- package/runtime/types/flow-extension-runner/src/index.d.ts +15 -0
- package/runtime/types/flow-extension-runner/src/namespace.d.ts +3 -0
- package/runtime/types/flow-extension-runner/src/v1/config.d.ts +3 -0
- package/runtime/types/flow-extension-runner/src/v1/constants.d.ts +4 -0
- package/runtime/types/flow-extension-runner/src/v1/index.d.ts +11 -0
- package/runtime/types/flow-extension-runner/src/v1/namespace.d.ts +9 -0
- package/runtime/types/flow-extension-runner/src/v1/service.d.ts +29 -0
- package/runtime/types/flow-extension-runner/src/v1/types.d.ts +13 -0
- package/runtime/types/flow-extension-runner/src/v2/actions/action-method.d.ts +34 -0
- package/runtime/types/flow-extension-runner/src/v2/context/execution-context.d.ts +25 -0
- package/runtime/types/flow-extension-runner/src/v2/context/logger.d.ts +2 -0
- package/runtime/types/flow-extension-runner/src/v2/context/method-input.d.ts +27 -0
- package/runtime/types/flow-extension-runner/src/v2/context/proxies.d.ts +1 -0
- package/runtime/types/flow-extension-runner/src/v2/create-extension.d.ts +2 -0
- package/runtime/types/flow-extension-runner/src/v2/crypto.d.ts +6 -0
- package/runtime/types/flow-extension-runner/src/v2/dictionaries/dictionary-method.d.ts +24 -0
- package/runtime/types/flow-extension-runner/src/v2/dictionaries/payload-schema.d.ts +10 -0
- package/runtime/types/flow-extension-runner/src/v2/extension.d.ts +51 -0
- package/runtime/types/flow-extension-runner/src/v2/index.d.ts +39 -0
- package/runtime/types/flow-extension-runner/src/v2/loaders/loader-method.d.ts +31 -0
- package/runtime/types/flow-extension-runner/src/v2/loaders/loader-owner.d.ts +17 -0
- package/runtime/types/flow-extension-runner/src/v2/loaders/payload-schema.d.ts +3 -0
- package/runtime/types/flow-extension-runner/src/v2/method.d.ts +22 -0
- package/runtime/types/flow-extension-runner/src/v2/model/field-mapper.d.ts +10 -0
- package/runtime/types/flow-extension-runner/src/v2/model/method-model.d.ts +3 -0
- package/runtime/types/flow-extension-runner/src/v2/model/model-types.d.ts +70 -0
- package/runtime/types/flow-extension-runner/src/v2/model/params-model.d.ts +16 -0
- package/runtime/types/flow-extension-runner/src/v2/oauth/method-names.d.ts +5 -0
- package/runtime/types/flow-extension-runner/src/v2/oauth/oauth2.d.ts +9 -0
- package/runtime/types/flow-extension-runner/src/v2/oauth/system-params.d.ts +6 -0
- package/runtime/types/flow-extension-runner/src/v2/oauth/types.d.ts +54 -0
- package/runtime/types/flow-extension-runner/src/v2/params/config-params.d.ts +14 -0
- package/runtime/types/flow-extension-runner/src/v2/params/files-options.d.ts +58 -0
- package/runtime/types/flow-extension-runner/src/v2/params/index.d.ts +19 -0
- package/runtime/types/flow-extension-runner/src/v2/params/json/checks.d.ts +26 -0
- package/runtime/types/flow-extension-runner/src/v2/params/json/decode.d.ts +24 -0
- package/runtime/types/flow-extension-runner/src/v2/params/json/encode.d.ts +20 -0
- package/runtime/types/flow-extension-runner/src/v2/params/json/types.d.ts +86 -0
- package/runtime/types/flow-extension-runner/src/v2/params/json/values.d.ts +5 -0
- package/runtime/types/flow-extension-runner/src/v2/params/method-params.d.ts +17 -0
- package/runtime/types/flow-extension-runner/src/v2/params/params.d.ts +26 -0
- package/runtime/types/flow-extension-runner/src/v2/params/schema/assert-object-schema.d.ts +6 -0
- package/runtime/types/flow-extension-runner/src/v2/params/schema/assert-supported-schema.d.ts +8 -0
- package/runtime/types/flow-extension-runner/src/v2/params/schema/coerce.d.ts +54 -0
- package/runtime/types/flow-extension-runner/src/v2/params/schema/dates.d.ts +40 -0
- package/runtime/types/flow-extension-runner/src/v2/params/schema/defaults.d.ts +36 -0
- package/runtime/types/flow-extension-runner/src/v2/params/schema/field-plan.d.ts +33 -0
- package/runtime/types/flow-extension-runner/src/v2/params/schema/introspect.d.ts +58 -0
- package/runtime/types/flow-extension-runner/src/v2/params/schema/labels.d.ts +3 -0
- package/runtime/types/flow-extension-runner/src/v2/params/schema/messages.d.ts +16 -0
- package/runtime/types/flow-extension-runner/src/v2/params/schema/normalize.d.ts +8 -0
- package/runtime/types/flow-extension-runner/src/v2/params/schema/parse.d.ts +7 -0
- package/runtime/types/flow-extension-runner/src/v2/params/types.d.ts +29 -0
- package/runtime/types/flow-extension-runner/src/v2/params/widget-types.d.ts +40 -0
- package/runtime/types/flow-extension-runner/src/v2/params/zod.d.ts +86 -0
- package/runtime/types/flow-extension-runner/src/v2/path.d.ts +1 -0
- package/runtime/types/flow-extension-runner/src/v2/polling-triggers/mechanisms.d.ts +19 -0
- package/runtime/types/flow-extension-runner/src/v2/polling-triggers/method-names.d.ts +1 -0
- package/runtime/types/flow-extension-runner/src/v2/polling-triggers/polling-triggers.d.ts +11 -0
- package/runtime/types/flow-extension-runner/src/v2/polling-triggers/system-params.d.ts +7 -0
- package/runtime/types/flow-extension-runner/src/v2/polling-triggers/trigger-method.d.ts +25 -0
- package/runtime/types/flow-extension-runner/src/v2/polling-triggers/types.d.ts +46 -0
- package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/method-names.d.ts +7 -0
- package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/realtime-setup.d.ts +10 -0
- package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/system-params.d.ts +29 -0
- package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/trigger-method.d.ts +33 -0
- package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/types.d.ts +147 -0
- package/runtime/types/flow-extension-runner/src/v2/realtime-triggers/verify.d.ts +2 -0
- package/runtime/types/flow-extension-runner/src/v2/registry.d.ts +20 -0
- package/runtime/types/flow-extension-runner/src/v2/result.d.ts +13 -0
- package/runtime/types/flow-extension-runner/src/v2/system-method.d.ts +41 -0
- package/runtime/types/flow-extension-runner/src/v2/types.d.ts +126 -0
- package/runtime/types/jsdoc-parser/src/custom-type-defs/files.d.ts +2 -0
- package/runtime/types/jsdoc-parser/src/index.d.ts +2 -0
- package/runtime/types/jsdoc-parser/src/lib.d.ts +42 -0
- package/runtime/types/jsdoc-parser/src/types.d.ts +2 -0
- package/runtime/types/packages/cli/src/runtime/index.d.ts +5 -0
- package/runtime/types/shared/src/constants/ai-agent-tools.d.ts +20 -0
- package/runtime/types/shared/src/constants/ai.d.ts +11 -0
- package/runtime/types/shared/src/constants/api-keys.d.ts +1 -0
- package/runtime/types/shared/src/constants/app.d.ts +58 -0
- package/runtime/types/shared/src/constants/billing.d.ts +16 -0
- package/runtime/types/shared/src/constants/compliances.d.ts +3 -0
- package/runtime/types/shared/src/constants/data-types.d.ts +26 -0
- package/runtime/types/shared/src/constants/error-codes.d.ts +16 -0
- package/runtime/types/shared/src/constants/flow.d.ts +12 -0
- package/runtime/types/shared/src/constants/index.d.ts +16 -0
- package/runtime/types/shared/src/constants/knowledge-base.d.ts +13 -0
- package/runtime/types/shared/src/constants/notification-types.d.ts +985 -0
- package/runtime/types/shared/src/constants/notifications.d.ts +10 -0
- package/runtime/types/shared/src/constants/patterns.d.ts +28 -0
- package/runtime/types/shared/src/constants/retry-policy.d.ts +30 -0
- package/runtime/types/shared/src/constants/severity.d.ts +9 -0
- package/runtime/types/shared/src/constants/shared-extensions-search.d.ts +6 -0
- package/runtime/types/shared/src/constants/shared-extensions.d.ts +35 -0
- package/runtime/types/shared/src/constants/zod.d.ts +2 -0
- package/runtime/types/shared/src/errors/api.d.ts +4 -0
- package/runtime/types/shared/src/errors/base.d.ts +38 -0
- package/runtime/types/shared/src/errors/common.d.ts +39 -0
- package/runtime/types/shared/src/errors/index.d.ts +13 -0
- package/runtime/types/shared/src/errors/k8s.d.ts +4 -0
- package/runtime/types/shared/src/errors/message.d.ts +48 -0
- package/runtime/types/shared/src/errors/open-search.d.ts +4 -0
- package/runtime/types/shared/src/errors/s3.d.ts +11 -0
- package/runtime/types/shared/src/extensions/zod.d.ts +25 -0
- package/runtime/types/shared/src/scheme/account/dto.d.ts +60 -0
- package/runtime/types/shared/src/scheme/account/index.d.ts +1 -0
- package/runtime/types/shared/src/scheme/ai-agent-tools/dto.d.ts +69 -0
- package/runtime/types/shared/src/scheme/ai-agent-tools/index.d.ts +2 -0
- package/runtime/types/shared/src/scheme/ai-agent-tools/parameters.d.ts +7 -0
- package/runtime/types/shared/src/scheme/ai-router/dto.d.ts +23 -0
- package/runtime/types/shared/src/scheme/ai-router/index.d.ts +2 -0
- package/runtime/types/shared/src/scheme/api-keys/dto.d.ts +28 -0
- package/runtime/types/shared/src/scheme/api-keys/index.d.ts +2 -0
- package/runtime/types/shared/src/scheme/app/index.d.ts +1 -0
- package/runtime/types/shared/src/scheme/app/java.dto.d.ts +6 -0
- package/runtime/types/shared/src/scheme/billing/index.d.ts +1 -0
- package/runtime/types/shared/src/scheme/billing/java.dto.d.ts +163 -0
- package/runtime/types/shared/src/scheme/crm/billing.d.ts +149 -0
- package/runtime/types/shared/src/scheme/crm/dto.d.ts +212 -0
- package/runtime/types/shared/src/scheme/crm/index.d.ts +3 -0
- package/runtime/types/shared/src/scheme/data-types/index.d.ts +1 -0
- package/runtime/types/shared/src/scheme/data-types/java.dto.d.ts +23 -0
- package/runtime/types/shared/src/scheme/dynamic-forms/dto.d.ts +30 -0
- package/runtime/types/shared/src/scheme/dynamic-forms/index.d.ts +2 -0
- package/runtime/types/shared/src/scheme/extensions/index.d.ts +1 -0
- package/runtime/types/shared/src/scheme/extensions/params-to-zod.d.ts +14 -0
- package/runtime/types/shared/src/scheme/flowrunner/custom-elements.d.ts +368 -0
- package/runtime/types/shared/src/scheme/flowrunner/index.d.ts +3 -0
- package/runtime/types/shared/src/scheme/flowrunner/java.dto.d.ts +628 -0
- package/runtime/types/shared/src/scheme/index.d.ts +19 -0
- package/runtime/types/shared/src/scheme/integration-connection/dto.d.ts +81 -0
- package/runtime/types/shared/src/scheme/integration-connection/index.d.ts +2 -0
- package/runtime/types/shared/src/scheme/knowledge-base/dto.d.ts +540 -0
- package/runtime/types/shared/src/scheme/knowledge-base/index.d.ts +2 -0
- package/runtime/types/shared/src/scheme/mcp-oauth/dto.d.ts +7 -0
- package/runtime/types/shared/src/scheme/mcp-oauth/index.d.ts +2 -0
- package/runtime/types/shared/src/scheme/notifications/dto.d.ts +111 -0
- package/runtime/types/shared/src/scheme/notifications/index.d.ts +3 -0
- package/runtime/types/shared/src/scheme/notifications/rest.d.ts +148 -0
- package/runtime/types/shared/src/scheme/properties/account.d.ts +3 -0
- package/runtime/types/shared/src/scheme/properties/app.d.ts +5 -0
- package/runtime/types/shared/src/scheme/properties/billing.d.ts +12 -0
- package/runtime/types/shared/src/scheme/properties/common.d.ts +2 -0
- package/runtime/types/shared/src/scheme/properties/db.d.ts +8 -0
- package/runtime/types/shared/src/scheme/properties/flow-extensions.d.ts +7 -0
- package/runtime/types/shared/src/scheme/properties/index.d.ts +7 -0
- package/runtime/types/shared/src/scheme/remote-mcp-server/dto.d.ts +278 -0
- package/runtime/types/shared/src/scheme/remote-mcp-server/index.d.ts +2 -0
- package/runtime/types/shared/src/scheme/shared-extensions/base.d.ts +56 -0
- package/runtime/types/shared/src/scheme/shared-extensions/config.d.ts +96 -0
- package/runtime/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +485 -0
- package/runtime/types/shared/src/scheme/shared-extensions/extension.d.ts +387 -0
- package/runtime/types/shared/src/scheme/shared-extensions/flow-extensions.d.ts +64 -0
- package/runtime/types/shared/src/scheme/shared-extensions/index.d.ts +15 -0
- package/runtime/types/shared/src/scheme/shared-extensions/light.d.ts +38 -0
- package/runtime/types/shared/src/scheme/shared-extensions/logs.d.ts +21 -0
- package/runtime/types/shared/src/scheme/shared-extensions/methods.d.ts +80 -0
- package/runtime/types/shared/src/scheme/shared-extensions/params-schema.d.ts +47 -0
- package/runtime/types/shared/src/scheme/shared-extensions/popular-pool.d.ts +11 -0
- package/runtime/types/shared/src/scheme/shared-extensions/resolve.d.ts +364 -0
- package/runtime/types/shared/src/scheme/shared-extensions/rest.d.ts +9 -0
- package/runtime/types/shared/src/scheme/shared-extensions/search.d.ts +177 -0
- package/runtime/types/shared/src/scheme/shared-extensions/service-identity.d.ts +10 -0
- package/runtime/types/shared/src/scheme/shared-extensions/service-info.d.ts +15 -0
- package/runtime/types/shared/src/scheme/workspace/dto.d.ts +40 -0
- package/runtime/types/shared/src/scheme/workspace/index.d.ts +1 -0
- package/runtime/types/shared/src/utils/object.d.ts +8 -0
- package/runtime/types/shared/src/utils/uuid.d.ts +5 -0
- package/runtime/types/shared/src/utils/versions.d.ts +4 -0
- package/runtime/types/types/backendless-request.d.ts +40 -0
- package/templates/blank/files/README.md +28 -0
- package/templates/blank/files/package.json +8 -0
- package/templates/blank/files/public/icon.svg +5 -0
- package/templates/blank/files/src/index.js +130 -0
- package/templates/blank/template.json +61 -0
- package/templates/demo-todo-list/files/README.md +54 -0
- package/templates/demo-todo-list/files/package.json +8 -0
- package/templates/demo-todo-list/files/public/icon.svg +8 -0
- package/templates/demo-todo-list/files/src/index.js +590 -0
- package/templates/demo-todo-list/template.json +44 -0
- package/templates/qa-test/files/README.md +88 -0
- package/templates/qa-test/files/package.json +8 -0
- package/templates/qa-test/files/public/icon.svg +8 -0
- package/templates/qa-test/files/src/index.js +755 -0
- package/templates/qa-test/template.json +62 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MethodParams } from '../params';
|
|
2
|
+
import type { ResultSpec } from '../result';
|
|
3
|
+
import type { AnySchema, HandlerBag } from '../types';
|
|
4
|
+
export declare const sampleResultLoaderName: (ownerId: string) => string;
|
|
5
|
+
export declare const dynamicParamsLoaderName: (ownerId: string) => string;
|
|
6
|
+
export interface LoaderOwner {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly category: string;
|
|
9
|
+
readonly params: MethodParams;
|
|
10
|
+
readonly result: ResultSpec;
|
|
11
|
+
}
|
|
12
|
+
export interface DynamicParamsOwner extends LoaderOwner {
|
|
13
|
+
readonly dynamicParamsCriteria: MethodParams;
|
|
14
|
+
resolveDynamicParams(bag: HandlerBag & {
|
|
15
|
+
criteria: Record<string, unknown>;
|
|
16
|
+
}): AnySchema | Promise<AnySchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ExecutionContext } from './context/execution-context';
|
|
2
|
+
import { MethodInput } from './context/method-input';
|
|
3
|
+
import type { Extension } from './extension';
|
|
4
|
+
import type { SharedExtensionMethod } from './model/model-types';
|
|
5
|
+
export declare abstract class ExtensionMethod {
|
|
6
|
+
protected readonly extension: Extension;
|
|
7
|
+
constructor(extension: Extension);
|
|
8
|
+
abstract get name(): string;
|
|
9
|
+
abstract get registerAs(): string;
|
|
10
|
+
abstract toModel(): SharedExtensionMethod;
|
|
11
|
+
get oauth2Scopes(): string[];
|
|
12
|
+
/**
|
|
13
|
+
* Whether this method appears in the published `methodsMap`. Almost always yes — but the realtime refresh
|
|
14
|
+
* seam is callable whether or not the author declared a `refresh` handler (the runtime answers `{}` when
|
|
15
|
+
* they did not), while only being ADVERTISED when they did. Callable and advertised are therefore two
|
|
16
|
+
* different questions, and this is the second one.
|
|
17
|
+
*/
|
|
18
|
+
get published(): boolean;
|
|
19
|
+
validate(methodData: Record<string, unknown>): unknown;
|
|
20
|
+
abstract execute(params: unknown, ctx: ExecutionContext): unknown;
|
|
21
|
+
protected input(methodData: Record<string, unknown>): MethodInput;
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ConfigItem } from '../../common/types';
|
|
2
|
+
import { type AnyZod } from '../params/schema/introspect';
|
|
3
|
+
import type { SharedExtensionMetaInfoArg, SharedExtensionParam } from './model-types';
|
|
4
|
+
export interface FieldToParamOptions {
|
|
5
|
+
nested?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function fieldToParam(name: string, schema: AnyZod, options?: FieldToParamOptions): SharedExtensionParam;
|
|
8
|
+
export declare function propertiesOf(objectCore: AnyZod | undefined): SharedExtensionParam[];
|
|
9
|
+
export declare function fieldToArg(name: string, schema: AnyZod): SharedExtensionMetaInfoArg;
|
|
10
|
+
export declare function fieldToConfigItem(name: string, schema: AnyZod): ConfigItem;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SharedExtensionMetaInfoArg, SharedExtensionParam } from './model-types';
|
|
2
|
+
export declare function opaqueParam(name: string, type?: string): SharedExtensionParam;
|
|
3
|
+
export declare function argsFromParams(params: SharedExtensionParam[]): Record<string, SharedExtensionMetaInfoArg>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ParamsSchemaJSON } from '../params';
|
|
2
|
+
export interface SharedExtensionParam {
|
|
3
|
+
name: string;
|
|
4
|
+
required: boolean;
|
|
5
|
+
description?: string;
|
|
6
|
+
type: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
properties?: SharedExtensionParam[];
|
|
9
|
+
items?: {
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
uiComponent?: Record<string, unknown>;
|
|
13
|
+
dependsOn?: string[];
|
|
14
|
+
dictionary?: string;
|
|
15
|
+
defaultValue?: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface SharedExtensionMetaInfoArg {
|
|
18
|
+
label?: string;
|
|
19
|
+
dictionary?: string;
|
|
20
|
+
dependsOn?: string[];
|
|
21
|
+
uiComponent?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export interface SharedExtensionMetaInfo {
|
|
24
|
+
args?: Record<string, SharedExtensionMetaInfoArg>;
|
|
25
|
+
sampleResult?: unknown;
|
|
26
|
+
sampleResultLoader?: {
|
|
27
|
+
methodName: string;
|
|
28
|
+
dependsOn?: string[];
|
|
29
|
+
} | null;
|
|
30
|
+
dynamicParams?: {
|
|
31
|
+
methodName: string;
|
|
32
|
+
dependsOn?: string[];
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface SharedExtensionMethod {
|
|
36
|
+
name: string;
|
|
37
|
+
operationName?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
registerAs?: string;
|
|
40
|
+
category?: string;
|
|
41
|
+
colorStart?: string;
|
|
42
|
+
colorEnd?: string;
|
|
43
|
+
customIcon?: string | null;
|
|
44
|
+
returnType?: string;
|
|
45
|
+
queryParams: SharedExtensionParam[];
|
|
46
|
+
bodyParams: SharedExtensionParam[];
|
|
47
|
+
metaInfo: SharedExtensionMetaInfo;
|
|
48
|
+
/**
|
|
49
|
+
* The method's declared input schema, for the kinds that are RENDERED AS A FORM — actions and both
|
|
50
|
+
* trigger kinds. `null` when such a method declares no params.
|
|
51
|
+
*
|
|
52
|
+
* Absent entirely on the helper routes (dictionaries, generated loaders, the SYSTEM seam): those are
|
|
53
|
+
* invoked by the runtime with a whole wrapper object rather than through a form, so their `bodyParams` is
|
|
54
|
+
* a single opaque param and a schema for it would describe nothing anyone renders.
|
|
55
|
+
*/
|
|
56
|
+
paramsSchema?: ParamsSchemaJSON | null;
|
|
57
|
+
}
|
|
58
|
+
export interface SharedExtensionServiceInfo {
|
|
59
|
+
serviceClassName: string;
|
|
60
|
+
integrationName: string;
|
|
61
|
+
integrationIcon: string | null;
|
|
62
|
+
integrationTriggersScope: string | null;
|
|
63
|
+
requireOAuth?: boolean | null;
|
|
64
|
+
}
|
|
65
|
+
export interface SharedExtensionDefinition {
|
|
66
|
+
runnerVersion: 'v1' | 'v2';
|
|
67
|
+
methodsMap: Record<string, SharedExtensionMethod>;
|
|
68
|
+
serviceInfo: SharedExtensionServiceInfo;
|
|
69
|
+
configSchema?: ParamsSchemaJSON | null;
|
|
70
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ConfigItem } from '../../common/types';
|
|
2
|
+
import type { ConfigParams, MethodParams, Params } from '../params';
|
|
3
|
+
import type { SharedExtensionMetaInfoArg, SharedExtensionParam } from './model-types';
|
|
4
|
+
export declare function toBodyParams(params: MethodParams): SharedExtensionParam[];
|
|
5
|
+
export declare function toArgs(params: MethodParams): Record<string, SharedExtensionMetaInfoArg>;
|
|
6
|
+
/**
|
|
7
|
+
* Top-level params rendered OPAQUELY: one entry per declared key, typed from its schema, with no recursion
|
|
8
|
+
* into nested properties and nothing ever marked required.
|
|
9
|
+
*
|
|
10
|
+
* This is the SYSTEM seam's model shape. Those methods are invoked by the runtime with a whole invocation
|
|
11
|
+
* object, never through a rendered form, so publishing their internals would be noise — and the v1 seam they
|
|
12
|
+
* must stay compatible with declares them exactly this way.
|
|
13
|
+
*/
|
|
14
|
+
export declare function toOpaqueBodyParams(params: MethodParams): SharedExtensionParam[];
|
|
15
|
+
export declare function toProperties(params: Params): SharedExtensionParam[];
|
|
16
|
+
export declare function toConfigItems(config: ConfigParams): ConfigItem[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Extension } from '../extension';
|
|
2
|
+
import type { OAuth2Props, OAuthBag } from './types';
|
|
3
|
+
export declare class OAuth2 {
|
|
4
|
+
#private;
|
|
5
|
+
private readonly extension;
|
|
6
|
+
private readonly props;
|
|
7
|
+
constructor(extension: Extension, props: OAuth2Props);
|
|
8
|
+
buildBag(accessToken?: string): OAuthBag;
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const OAuthCallbackObjectSchema: import("zod").ZodObject<{
|
|
2
|
+
code: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3
|
+
redirectURI: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
|
+
state: import("zod").ZodOptional<import("zod").ZodString>;
|
|
5
|
+
}, import("zod/v4/core").$loose>;
|
|
6
|
+
export declare const RefreshTokenSchema: import("zod").ZodString;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { AnyShape, ExtensionShape, HandlerBag, ProviderPayload } from '../types';
|
|
2
|
+
export interface OAuthCallbackObject {
|
|
3
|
+
code?: string;
|
|
4
|
+
redirectURI?: string;
|
|
5
|
+
state?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface OAuthCallbackResult {
|
|
8
|
+
token: string;
|
|
9
|
+
expirationInSeconds?: number;
|
|
10
|
+
refreshToken?: string;
|
|
11
|
+
connectionIdentityName?: string;
|
|
12
|
+
connectionIdentityImageURL?: string | null;
|
|
13
|
+
overwrite?: boolean;
|
|
14
|
+
userData?: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface OAuthRefreshResult {
|
|
17
|
+
token: string;
|
|
18
|
+
expirationInSeconds?: number;
|
|
19
|
+
refreshToken?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface OAuthBag<TToken = unknown> {
|
|
22
|
+
accessToken?: string;
|
|
23
|
+
token?: TToken;
|
|
24
|
+
}
|
|
25
|
+
export interface OAuth2Props<TShape extends ExtensionShape = AnyShape, TToken = unknown> {
|
|
26
|
+
scopes?: string[];
|
|
27
|
+
authorizeUrl?: string;
|
|
28
|
+
tokenUrl?: string;
|
|
29
|
+
pkce?: boolean;
|
|
30
|
+
clientAuth?: 'basic' | 'body';
|
|
31
|
+
clientIdConfig?: string;
|
|
32
|
+
clientSecretConfig?: string;
|
|
33
|
+
identityRequest?: (bag: HandlerBag<TShape>) => unknown;
|
|
34
|
+
identity?: (raw: ProviderPayload) => {
|
|
35
|
+
name?: string;
|
|
36
|
+
imageUrl?: string | null;
|
|
37
|
+
userData?: unknown;
|
|
38
|
+
};
|
|
39
|
+
serializeToken?: (data: {
|
|
40
|
+
accessToken: string;
|
|
41
|
+
refreshToken?: string;
|
|
42
|
+
userData?: unknown;
|
|
43
|
+
}) => string;
|
|
44
|
+
deserializeToken?: (accessToken: string) => TToken;
|
|
45
|
+
getConnectionURL?: (bag: HandlerBag<TShape> & {
|
|
46
|
+
scopes: string[];
|
|
47
|
+
}) => string | Promise<string>;
|
|
48
|
+
executeCallback?: (bag: HandlerBag<TShape> & {
|
|
49
|
+
callbackObject: OAuthCallbackObject;
|
|
50
|
+
}) => OAuthCallbackResult | Promise<OAuthCallbackResult>;
|
|
51
|
+
refreshToken?: (bag: HandlerBag<TShape> & {
|
|
52
|
+
refreshToken: string;
|
|
53
|
+
}) => OAuthRefreshResult | Promise<OAuthRefreshResult>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ServiceConfigsValues } from '../../common/constants';
|
|
2
|
+
import { Params } from './params';
|
|
3
|
+
import type { SchemaSource } from './types';
|
|
4
|
+
export declare class ConfigParams extends Params {
|
|
5
|
+
static of(scheme?: unknown, source?: SchemaSource): ConfigParams;
|
|
6
|
+
static empty(): ConfigParams;
|
|
7
|
+
/**
|
|
8
|
+
* The effective config for one invocation.
|
|
9
|
+
*
|
|
10
|
+
* Fails with every offending field at once rather than the first, so a half-configured service reports its
|
|
11
|
+
* whole form. A field the schema resolved to "not present" is simply absent from the result.
|
|
12
|
+
*/
|
|
13
|
+
resolve(configs?: ServiceConfigsValues): ServiceConfigsValues;
|
|
14
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z as baseZod } from 'zod';
|
|
2
|
+
declare const SCOPE_VALUES: readonly ["WORKSPACE", "FLOW", "EXECUTION"];
|
|
3
|
+
type FieldTable = Record<string, () => baseZod.ZodType>;
|
|
4
|
+
declare const UPLOAD_FIELDS: {
|
|
5
|
+
scope: () => baseZod.ZodDefault<baseZod.ZodEnum<{
|
|
6
|
+
WORKSPACE: "WORKSPACE";
|
|
7
|
+
FLOW: "FLOW";
|
|
8
|
+
EXECUTION: "EXECUTION";
|
|
9
|
+
}>>;
|
|
10
|
+
filename: () => baseZod.ZodOptional<baseZod.ZodString>;
|
|
11
|
+
ttl: () => baseZod.ZodOptional<baseZod.ZodNumber>;
|
|
12
|
+
objectTtl: () => baseZod.ZodOptional<baseZod.ZodNumber>;
|
|
13
|
+
overwrite: () => baseZod.ZodOptional<baseZod.ZodBoolean>;
|
|
14
|
+
generateUrl: () => baseZod.ZodDefault<baseZod.ZodBoolean>;
|
|
15
|
+
};
|
|
16
|
+
declare const LIST_FIELDS: {
|
|
17
|
+
scope: () => baseZod.ZodDefault<baseZod.ZodEnum<{
|
|
18
|
+
WORKSPACE: "WORKSPACE";
|
|
19
|
+
FLOW: "FLOW";
|
|
20
|
+
EXECUTION: "EXECUTION";
|
|
21
|
+
}>>;
|
|
22
|
+
limit: () => baseZod.ZodOptional<baseZod.ZodNumber>;
|
|
23
|
+
ttl: () => baseZod.ZodOptional<baseZod.ZodNumber>;
|
|
24
|
+
generateUrl: () => baseZod.ZodDefault<baseZod.ZodBoolean>;
|
|
25
|
+
cursor: () => baseZod.ZodOptional<baseZod.ZodString>;
|
|
26
|
+
};
|
|
27
|
+
declare const GET_FIELDS: {
|
|
28
|
+
scope: () => baseZod.ZodDefault<baseZod.ZodEnum<{
|
|
29
|
+
WORKSPACE: "WORKSPACE";
|
|
30
|
+
FLOW: "FLOW";
|
|
31
|
+
EXECUTION: "EXECUTION";
|
|
32
|
+
}>>;
|
|
33
|
+
ttl: () => baseZod.ZodOptional<baseZod.ZodNumber>;
|
|
34
|
+
generateUrl: () => baseZod.ZodDefault<baseZod.ZodBoolean>;
|
|
35
|
+
};
|
|
36
|
+
declare const DELETE_FIELDS: {
|
|
37
|
+
scope: () => baseZod.ZodDefault<baseZod.ZodEnum<{
|
|
38
|
+
WORKSPACE: "WORKSPACE";
|
|
39
|
+
FLOW: "FLOW";
|
|
40
|
+
EXECUTION: "EXECUTION";
|
|
41
|
+
}>>;
|
|
42
|
+
};
|
|
43
|
+
type Group<T extends FieldTable, K extends keyof T> = baseZod.ZodObject<{
|
|
44
|
+
[P in K]: ReturnType<T[P]>;
|
|
45
|
+
}>;
|
|
46
|
+
export type FilesUploadOptionsField = keyof typeof UPLOAD_FIELDS & string;
|
|
47
|
+
export type FilesListOptionsField = keyof typeof LIST_FIELDS & string;
|
|
48
|
+
export type FilesGetOptionsField = keyof typeof GET_FIELDS & string;
|
|
49
|
+
export type FilesDeleteOptionsField = keyof typeof DELETE_FIELDS & string;
|
|
50
|
+
/** Options for `ctx.files.uploadFile()`. `z.filesUploadOptions(['scope'])` is the form the catalog uses. */
|
|
51
|
+
export declare function filesUploadOptions<K extends FilesUploadOptionsField = FilesUploadOptionsField>(include?: readonly K[]): Group<typeof UPLOAD_FIELDS, K>;
|
|
52
|
+
/** Options for `ctx.files.list()`. */
|
|
53
|
+
export declare function filesListOptions<K extends FilesListOptionsField = FilesListOptionsField>(include?: readonly K[]): Group<typeof LIST_FIELDS, K>;
|
|
54
|
+
/** Options for `ctx.files.get()`. */
|
|
55
|
+
export declare function filesGetOptions<K extends FilesGetOptionsField = FilesGetOptionsField>(include?: readonly K[]): Group<typeof GET_FIELDS, K>;
|
|
56
|
+
/** Options for `ctx.files.delete()`. */
|
|
57
|
+
export declare function filesDeleteOptions<K extends FilesDeleteOptionsField = FilesDeleteOptionsField>(include?: readonly K[]): Group<typeof DELETE_FIELDS, K>;
|
|
58
|
+
export { SCOPE_VALUES };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { ConfigParams } from './config-params';
|
|
2
|
+
export { MethodParams } from './method-params';
|
|
3
|
+
export { Params } from './params';
|
|
4
|
+
export type { NormalizedInput, SchemaSource, ZodIssue, ZodSchema } from './types';
|
|
5
|
+
export * from './widget-types';
|
|
6
|
+
export { describeField, FORMAT_DESCRIPTIONS, TYPE_DESCRIPTIONS, WIDGET_DESCRIPTIONS, } from './schema/defaults';
|
|
7
|
+
export type { AnyZod, Inspected, WidgetInfo } from './schema/introspect';
|
|
8
|
+
export { deriveWidget, fieldLabels, inspect, shapeEntries } from './schema/introspect';
|
|
9
|
+
export { humanizeKey, labelOf } from './schema/labels';
|
|
10
|
+
export { coerceValue } from './schema/coerce';
|
|
11
|
+
export { absenceOf, type AbsencePolicy, type FieldPlan, planField } from './schema/field-plan';
|
|
12
|
+
export { type FieldResult, normalizeField } from './schema/normalize';
|
|
13
|
+
export { type FailFn, parseSchema, toIssues } from './schema/parse';
|
|
14
|
+
export { decodeField, decodeParams } from './json/decode';
|
|
15
|
+
export { encodeField, encodeParams } from './json/encode';
|
|
16
|
+
export type { CheckJSON, FieldJSON, FieldType, JsonValue, MetaJSON, ParamsSchemaJSON, RegexJSON, } from './json/types';
|
|
17
|
+
export { SCHEMA_JSON_VERSION } from './json/types';
|
|
18
|
+
export { type DictionaryRef, type ExtendedZod, type FrMeta, z } from './zod';
|
|
19
|
+
export type { FilesDeleteOptionsField, FilesGetOptionsField, FilesListOptionsField, FilesUploadOptionsField, } from './files-options';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AnyZod } from '../schema/introspect';
|
|
2
|
+
import type { CheckJSON, FieldType } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* An author's own message, if they wrote one.
|
|
5
|
+
*
|
|
6
|
+
* zod normalizes a string message into a function, so the string is only reachable by CALLING it. A message
|
|
7
|
+
* the author wrote as a function reads the issue and cannot be replayed here — the call is guarded and the
|
|
8
|
+
* pipeline's own wording applies instead.
|
|
9
|
+
*/
|
|
10
|
+
export declare function messageOf(source: {
|
|
11
|
+
error?: unknown;
|
|
12
|
+
}): string | undefined;
|
|
13
|
+
export interface EncodedChecks {
|
|
14
|
+
checks: CheckJSON[];
|
|
15
|
+
unsupported: string[];
|
|
16
|
+
}
|
|
17
|
+
/** Every check a core schema carries. What cannot cross is NAMED rather than silently dropped. */
|
|
18
|
+
export declare function encodeChecks(core: AnyZod | undefined): EncodedChecks;
|
|
19
|
+
/**
|
|
20
|
+
* Re-apply one wire check to a rebuilt schema.
|
|
21
|
+
*
|
|
22
|
+
* `type` decides nothing about WHICH method to call — `.min()` is `.min()` on a string, a number and an
|
|
23
|
+
* array — it only guards the numeric-only ones. A check whose method is missing on this type is skipped
|
|
24
|
+
* rather than thrown: a schema decoded slightly loose is the documented failure mode.
|
|
25
|
+
*/
|
|
26
|
+
export declare function applyCheck(schema: unknown, check: CheckJSON, type: FieldType): unknown;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type FieldJSON, type ParamsSchemaJSON } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* One field, rebuilt.
|
|
4
|
+
*
|
|
5
|
+
* Order is load-bearing:
|
|
6
|
+
* 1. the base type — a format helper, not a hand-rolled regex
|
|
7
|
+
* 2. the author's checks — `.min()`, `.regex()`, …
|
|
8
|
+
* 3. `.meta()` LAST of the three, because a check clones the schema and metadata does not follow the clone
|
|
9
|
+
* 4. the modifiers, canonically: nullable → optional → default
|
|
10
|
+
*
|
|
11
|
+
* Step 4's canonical order is why the wire form can record modifiers as flags — see ./encode.ts.
|
|
12
|
+
*/
|
|
13
|
+
export declare function decodeField(field: FieldJSON): unknown;
|
|
14
|
+
/**
|
|
15
|
+
* A whole stored schema, rebuilt as the `z.object` every slot must be. Nothing usable in ⇒ `undefined` out,
|
|
16
|
+
* which callers already treat as "this slot declares nothing".
|
|
17
|
+
*
|
|
18
|
+
* An envelope whose `v` this build does not know is refused rather than read as if it were the current
|
|
19
|
+
* shape. Stored payloads outlive the code that wrote them — a definition is encoded once at deploy time and
|
|
20
|
+
* decoded by whatever is deployed later — so a future `v: 2` would otherwise be silently misread field by
|
|
21
|
+
* field. Refusing degrades to "no schema" and the caller falls back to the legacy projection, which is the
|
|
22
|
+
* same direction every other loss in this codec takes (see ./types.ts).
|
|
23
|
+
*/
|
|
24
|
+
export declare function decodeParams(json: ParamsSchemaJSON | null | undefined): unknown;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type AnyZod } from '../schema/introspect';
|
|
2
|
+
import { type FieldJSON, type ParamsSchemaJSON } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* One declared field → its wire form.
|
|
5
|
+
*
|
|
6
|
+
* `seen` holds the declarations this field is currently INSIDE — the ancestors on the walk, not everything
|
|
7
|
+
* already encoded — so a schema that legitimately appears twice side by side is still encoded twice. It is
|
|
8
|
+
* added before descending and removed after, which makes the check below a cycle test rather than a
|
|
9
|
+
* deduplication.
|
|
10
|
+
*/
|
|
11
|
+
export declare function encodeField(name: string, schema: AnyZod, seen?: Set<unknown>): FieldJSON;
|
|
12
|
+
/**
|
|
13
|
+
* A whole declared slot → its wire form. `null` for an undeclared slot, which is legal everywhere: a method
|
|
14
|
+
* with no params publishes no schema rather than an empty one.
|
|
15
|
+
*
|
|
16
|
+
* Takes `unknown` because this is a boundary: callers hold a schema through whichever view they happen to
|
|
17
|
+
* have (`Params.scheme`, an author's `z.object`, a decoded rebuild), and none of those structural views are
|
|
18
|
+
* assignable to each other. Narrowing once here beats a cast at every call site.
|
|
19
|
+
*/
|
|
20
|
+
export declare function encodeParams(scheme: unknown): ParamsSchemaJSON | null;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { FrWidgetToken } from '../widget-types';
|
|
2
|
+
export type JsonValue = string | number | boolean | null | {
|
|
3
|
+
$bigint: string;
|
|
4
|
+
} | {
|
|
5
|
+
$date: string;
|
|
6
|
+
} | JsonValue[] | {
|
|
7
|
+
[key: string]: JsonValue;
|
|
8
|
+
};
|
|
9
|
+
/** A constraint the author declared. `min`/`max` cover both length and magnitude — zod spells them alike. */
|
|
10
|
+
export interface CheckJSON {
|
|
11
|
+
kind: 'min' | 'max' | 'length' | 'int' | 'multipleOf' | 'regex' | 'startsWith' | 'endsWith' | 'includes';
|
|
12
|
+
value?: JsonValue;
|
|
13
|
+
exclusive?: true;
|
|
14
|
+
message?: string;
|
|
15
|
+
}
|
|
16
|
+
/** A serialized regex — `RegExp` itself is not JSON. Indexable so it satisfies `JsonValue`. */
|
|
17
|
+
export interface RegexJSON {
|
|
18
|
+
[key: string]: JsonValue;
|
|
19
|
+
source: string;
|
|
20
|
+
flags: string;
|
|
21
|
+
}
|
|
22
|
+
export interface MetaJSON {
|
|
23
|
+
title?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
examples?: JsonValue[];
|
|
26
|
+
frShared?: boolean;
|
|
27
|
+
frWidget?: FrWidgetToken;
|
|
28
|
+
frSecret?: boolean;
|
|
29
|
+
frDictionary?: {
|
|
30
|
+
id: string;
|
|
31
|
+
dependsOn: string[];
|
|
32
|
+
};
|
|
33
|
+
frLabels?: Record<string, string>;
|
|
34
|
+
}
|
|
35
|
+
export type FieldType = 'string' | 'number' | 'bigint' | 'boolean' | 'date' | 'enum' | 'literal' | 'object' | 'array' | 'record' | 'union'
|
|
36
|
+
/**
|
|
37
|
+
* Anything the encoder does not model — and also where a declared `z.any()` / `z.unknown()` legitimately
|
|
38
|
+
* lands, since "validates nothing" is exactly what those two declare. The `unsupported` breadcrumb is what
|
|
39
|
+
* separates the two cases: a modelling gap carries `['type:…']`, a declared pass-through carries nothing.
|
|
40
|
+
*
|
|
41
|
+
* Decodes to `z.unknown()` either way, so it validates nothing.
|
|
42
|
+
*/
|
|
43
|
+
| 'unknown';
|
|
44
|
+
export interface FieldJSON {
|
|
45
|
+
name: string;
|
|
46
|
+
type: FieldType;
|
|
47
|
+
format?: string;
|
|
48
|
+
optional?: true;
|
|
49
|
+
nullable?: true;
|
|
50
|
+
default?: JsonValue;
|
|
51
|
+
checks?: CheckJSON[];
|
|
52
|
+
values?: JsonValue[];
|
|
53
|
+
meta?: MetaJSON;
|
|
54
|
+
message?: string;
|
|
55
|
+
properties?: FieldJSON[];
|
|
56
|
+
element?: FieldJSON;
|
|
57
|
+
/**
|
|
58
|
+
* type === 'union' — every declared branch, in declaration order.
|
|
59
|
+
*
|
|
60
|
+
* All of them are carried, not just the first. The first decides what the console DRAWS, but the rebuilt
|
|
61
|
+
* schema has to accept everything the author's does: `json/types.ts`'s one-directional invariant is that a
|
|
62
|
+
* decoded schema is never STRICTER than the author's, and encoding one branch would break it — the form
|
|
63
|
+
* would reject a shape execution accepts.
|
|
64
|
+
*/
|
|
65
|
+
options?: FieldJSON[];
|
|
66
|
+
/**
|
|
67
|
+
* type === 'record' — the schema its VALUES are held to. Keys are not modelled: the runtime only ever
|
|
68
|
+
* walks a record's values (see ../schema/coerce.ts), and a decoded `z.record` therefore accepts any string
|
|
69
|
+
* key, which keeps it no stricter than the author's.
|
|
70
|
+
*/
|
|
71
|
+
value?: FieldJSON;
|
|
72
|
+
/**
|
|
73
|
+
* What could not cross the wire — `['check:overwrite']`, `['wrapper:prefault']`, `['format:xyz']`.
|
|
74
|
+
*
|
|
75
|
+
* Functions cannot be serialized, so `.refine()`, `.transform()`, `.trim()` and friends are dropped. The
|
|
76
|
+
* invariant that follows is deliberate and one-directional: **a decoded schema is never STRICTER than the
|
|
77
|
+
* author's**. The console may therefore accept a value the runtime later rejects, but never reject one the
|
|
78
|
+
* runtime would accept — and the runtime re-validates every invocation, so it stays the authority.
|
|
79
|
+
*/
|
|
80
|
+
unsupported?: string[];
|
|
81
|
+
}
|
|
82
|
+
export interface ParamsSchemaJSON {
|
|
83
|
+
v: 1;
|
|
84
|
+
fields: FieldJSON[];
|
|
85
|
+
}
|
|
86
|
+
export declare const SCHEMA_JSON_VERSION: 1;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JsonValue } from './types';
|
|
2
|
+
/** A declared value (a `.default()`, an enum member, a constraint bound) on its way out. */
|
|
3
|
+
export declare function toJsonValue(value: unknown): JsonValue;
|
|
4
|
+
/** The same value on its way back in. */
|
|
5
|
+
export declare function fromJsonValue(value: JsonValue): unknown;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Params } from './params';
|
|
2
|
+
import type { FailFn } from './schema/parse';
|
|
3
|
+
import type { SchemaSource } from './types';
|
|
4
|
+
export declare class MethodParams extends Params {
|
|
5
|
+
static of(scheme?: unknown, source?: SchemaSource): MethodParams;
|
|
6
|
+
static empty(): MethodParams;
|
|
7
|
+
/**
|
|
8
|
+
* Run the shared normalize → coerce → validate pipeline and hand the issues to `fail` (which throws).
|
|
9
|
+
*
|
|
10
|
+
* `carryUnknown` keeps the input's undeclared keys underneath the normalized ones. Two slots need it: an
|
|
11
|
+
* action with `dynamicParams`, whose generated top-level fields are not in the static schema, and the
|
|
12
|
+
* generated loaders, whose owner's `result` fn may read those same fields.
|
|
13
|
+
*/
|
|
14
|
+
normalize<T extends Record<string, unknown>>(input: Record<string, unknown> | undefined, fail: FailFn, options?: {
|
|
15
|
+
carryUnknown?: boolean;
|
|
16
|
+
}): T;
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type FieldPlan } from './schema/field-plan';
|
|
2
|
+
import { type AnyZod } from './schema/introspect';
|
|
3
|
+
import { type FailFn } from './schema/parse';
|
|
4
|
+
import type { NormalizedInput, SchemaSource, ZodSchema } from './types';
|
|
5
|
+
export declare abstract class Params {
|
|
6
|
+
#private;
|
|
7
|
+
readonly source: SchemaSource;
|
|
8
|
+
readonly scheme?: ZodSchema;
|
|
9
|
+
protected constructor(scheme?: unknown, source?: SchemaSource);
|
|
10
|
+
keys(): string[];
|
|
11
|
+
fields(): [name: string, schema: AnyZod][];
|
|
12
|
+
protected plans(): FieldPlan[];
|
|
13
|
+
/**
|
|
14
|
+
* Normalize, coerce and validate a whole input object against the declared fields.
|
|
15
|
+
*
|
|
16
|
+
* Only declared fields appear in the output — an undeclared key is dropped, as it always was. Every
|
|
17
|
+
* declared field appears, holding whatever it resolved to, which for an absent `.optional()` is
|
|
18
|
+
* `undefined`: the key is there, so a handler asks `params.x === undefined` rather than `'x' in params`.
|
|
19
|
+
* A field is omitted only when it FAILED, and then the caller is looking at `issues` instead.
|
|
20
|
+
*
|
|
21
|
+
* Every field is attempted even after one fails, so the caller can report the whole form at once instead
|
|
22
|
+
* of making a user fix one field per attempt.
|
|
23
|
+
*/
|
|
24
|
+
normalizeInput(input?: Record<string, unknown>): NormalizedInput;
|
|
25
|
+
parse<T>(value: unknown, fail: FailFn): T;
|
|
26
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SchemaSource } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Throws unless `scheme` is a `z.object` (including `z.looseObject` / `z.strictObject`). `undefined` passes —
|
|
4
|
+
* an undeclared slot is legal everywhere.
|
|
5
|
+
*/
|
|
6
|
+
export declare function assertObjectSchema(scheme: unknown, source: SchemaSource): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SchemaSource } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Throws unless every field `scheme` declares, at every depth, is something the runtime can publish, render
|
|
4
|
+
* and coerce. `undefined` passes — an undeclared slot is legal everywhere.
|
|
5
|
+
*
|
|
6
|
+
* Only author-declared slots are checked (see `GUARDED_KINDS`).
|
|
7
|
+
*/
|
|
8
|
+
export declare function assertSupportedSchema(scheme: unknown, source: SchemaSource): void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type AnyZod, type Inspected } from './introspect';
|
|
2
|
+
export interface Coerced {
|
|
3
|
+
ok: boolean;
|
|
4
|
+
value?: unknown;
|
|
5
|
+
expected?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Coerce one SCALAR `value` for a field whose core zod type is `coreType`. Types with no meaningful coercion
|
|
9
|
+
* — enum, and everything the runtime does not special-case — pass through for the author's schema to judge:
|
|
10
|
+
* membership is zod's job, not ours.
|
|
11
|
+
*
|
|
12
|
+
* Dates need the SCHEMA rather than the type name, because `z.date()`, `z.coerce.date()` and `z.iso.date()`
|
|
13
|
+
* convert differently — see `coerceLeaf`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function coerceValue(value: unknown, coreType: string): Coerced;
|
|
16
|
+
/** Whether a schema accepts a value outright. A probe, so a throwing refinement reads as "no". */
|
|
17
|
+
export declare function accepts(schema: AnyZod, value: unknown): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The same coercion, applied at every DEPTH — inside a declared object's properties and inside a list's
|
|
20
|
+
* elements, not only at the top of a field.
|
|
21
|
+
*
|
|
22
|
+
* Without this a declaration means different things depending on where it sits: `z.string()` takes `42` at
|
|
23
|
+
* the top level but `z.array(z.string())` rejects `[42]`, and `z.object({ zip: z.string() })` rejects
|
|
24
|
+
* `{ zip: 12345 }`. The transport is no more type-faithful inside a container than outside one.
|
|
25
|
+
*
|
|
26
|
+
* The rule is simply: **walk whatever declares its contents, convert whatever declares a type, and leave
|
|
27
|
+
* everything else alone.** A `z.record(z.string(), z.unknown())` therefore coerces nothing — not because
|
|
28
|
+
* records are exempt, but because `unknown` declares no type to coerce to — while
|
|
29
|
+
* `z.record(z.string(), z.number())` converts its values like any other declaration.
|
|
30
|
+
*
|
|
31
|
+
* BEST-EFFORT below the top level: a value that cannot be converted is left exactly as it arrived, for the
|
|
32
|
+
* author's own schema to reject. That keeps the failure reported against the property that actually failed
|
|
33
|
+
* (`tags.1`, `address.zip`) rather than as a coercion error naming the whole field, and it keeps this step
|
|
34
|
+
* incapable of making anything stricter — it only ever converts.
|
|
35
|
+
*
|
|
36
|
+
* Absence is resolved at every depth too, by the same rule the top level uses: ask the sub-schema which
|
|
37
|
+
* absent forms it accepts, and hand it the one it wants. Without that, `.optional()` means one thing on a
|
|
38
|
+
* field and another inside a list — `z.array(z.string().optional())` would reject `[null]` while a bare
|
|
39
|
+
* `z.string().optional()` accepts it.
|
|
40
|
+
*
|
|
41
|
+
* A sub-schema that accepts NO absent form is left exactly as it arrived, so zod raises it and the message
|
|
42
|
+
* is built against the property that failed (`«City» is required`) — this step never invents an error.
|
|
43
|
+
*/
|
|
44
|
+
export declare function coerceDeep(value: unknown, schema: AnyZod | undefined): unknown;
|
|
45
|
+
/** True when a field's own type is a container this module walks rather than converts. */
|
|
46
|
+
export declare const isContainer: (coreType: string) => boolean;
|
|
47
|
+
/**
|
|
48
|
+
* One leaf, converted for VALIDATION.
|
|
49
|
+
*
|
|
50
|
+
* Everything reaches zod as the type it declared: a date arrives as a `Date` whatever form the host sent, and
|
|
51
|
+
* an ISO field arrives as a string in its own declared shape. What the HANDLER receives is a separate
|
|
52
|
+
* question — a `z.date()` value is restored to the original afterwards (see ../normalize.ts).
|
|
53
|
+
*/
|
|
54
|
+
export declare function coerceLeaf(value: unknown, ins: Inspected): Coerced;
|