primitive-admin 1.2.0-alpha.9 → 1.3.0-alpha.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 +258 -186
- package/assets/skill/skills/primitive-platform/SKILL.md +93 -27
- package/dist/bin/primitive.js +15 -89
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.js +80 -17
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/agent-sessions.d.ts +129 -0
- package/dist/src/commands/agent-sessions.js +532 -20
- package/dist/src/commands/agent-sessions.js.map +1 -1
- package/dist/src/commands/analytics.js +207 -155
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps-children.js +3 -0
- package/dist/src/commands/apps-children.js.map +1 -1
- package/dist/src/commands/apps-transitions.d.ts +39 -0
- package/dist/src/commands/apps-transitions.js +198 -0
- package/dist/src/commands/apps-transitions.js.map +1 -0
- package/dist/src/commands/apps.d.ts +17 -0
- package/dist/src/commands/apps.js +108 -3
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth-sessions.js +2 -0
- package/dist/src/commands/auth-sessions.js.map +1 -1
- package/dist/src/commands/auth.js +138 -44
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/blob-buckets.js +2 -0
- package/dist/src/commands/blob-buckets.js.map +1 -1
- package/dist/src/commands/collections.js +318 -256
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/comparisons.js +2 -0
- package/dist/src/commands/comparisons.js.map +1 -1
- package/dist/src/commands/config.d.ts +2 -2
- package/dist/src/commands/config.js +59 -33
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/connections.js +2 -0
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/database-type-configs.js +5 -3
- package/dist/src/commands/database-type-configs.js.map +1 -1
- package/dist/src/commands/databases.js +6 -4
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/db3-types.d.ts +15 -0
- package/dist/src/commands/db3-types.js +159 -0
- package/dist/src/commands/db3-types.js.map +1 -0
- package/dist/src/commands/db3.d.ts +24 -0
- package/dist/src/commands/db3.js +1444 -0
- package/dist/src/commands/db3.js.map +1 -0
- package/dist/src/commands/documents.d.ts +110 -10
- package/dist/src/commands/documents.js +1012 -748
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.js +74 -0
- package/dist/src/commands/email-templates.js.map +1 -1
- package/dist/src/commands/env.js +8 -4
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/function-trigger-commands.d.ts +28 -0
- package/dist/src/commands/function-trigger-commands.js +341 -0
- package/dist/src/commands/function-trigger-commands.js.map +1 -0
- package/dist/src/commands/functions.js +376 -30
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/groups.js +168 -50
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.js +7 -5
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/hosting.d.ts +8 -0
- package/dist/src/commands/hosting.js +346 -0
- package/dist/src/commands/hosting.js.map +1 -0
- package/dist/src/commands/init.js +129 -38
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +82 -53
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/locks.d.ts +5 -3
- package/dist/src/commands/locks.js +19 -61
- package/dist/src/commands/locks.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.d.ts +2 -2
- package/dist/src/commands/metadata-category-configs.js +4 -2
- package/dist/src/commands/metadata-category-configs.js.map +1 -1
- package/dist/src/commands/metadata.js +41 -0
- package/dist/src/commands/metadata.js.map +1 -1
- package/dist/src/commands/prompts.js +75 -52
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rate-counters.d.ts +19 -0
- package/dist/src/commands/rate-counters.js +104 -0
- package/dist/src/commands/rate-counters.js.map +1 -0
- package/dist/src/commands/rule-sets.d.ts +1 -1
- package/dist/src/commands/rule-sets.js +2 -1
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/schemas.d.ts +15 -0
- package/dist/src/commands/schemas.js +122 -0
- package/dist/src/commands/schemas.js.map +1 -0
- package/dist/src/commands/scripts.d.ts +9 -17
- package/dist/src/commands/scripts.js +24 -479
- package/dist/src/commands/scripts.js.map +1 -1
- package/dist/src/commands/secrets.js +47 -3
- package/dist/src/commands/secrets.js.map +1 -1
- package/dist/src/commands/sessions.js +2 -0
- package/dist/src/commands/sessions.js.map +1 -1
- package/dist/src/commands/skill.js +2 -0
- package/dist/src/commands/skill.js.map +1 -1
- package/dist/src/commands/sync-schemas.d.ts +202 -0
- package/dist/src/commands/sync-schemas.js +629 -0
- package/dist/src/commands/sync-schemas.js.map +1 -0
- package/dist/src/commands/sync-user-properties.d.ts +118 -0
- package/dist/src/commands/sync-user-properties.js +276 -0
- package/dist/src/commands/sync-user-properties.js.map +1 -0
- package/dist/src/commands/sync.d.ts +518 -546
- package/dist/src/commands/sync.js +3010 -4877
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +5 -3
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/transitions.d.ts +54 -0
- package/dist/src/commands/transitions.js +418 -0
- package/dist/src/commands/transitions.js.map +1 -0
- package/dist/src/commands/usage.d.ts +18 -0
- package/dist/src/commands/usage.js +343 -0
- package/dist/src/commands/usage.js.map +1 -0
- package/dist/src/commands/user-properties.d.ts +14 -0
- package/dist/src/commands/user-properties.js +79 -0
- package/dist/src/commands/user-properties.js.map +1 -0
- package/dist/src/commands/users.js +911 -18
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.js +2 -0
- package/dist/src/commands/vars.js.map +1 -1
- package/dist/src/commands/waitlist.js +39 -4
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/workflows.d.ts +5 -83
- package/dist/src/commands/workflows.js +57 -2282
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/analytics-query.d.ts +58 -0
- package/dist/src/lib/analytics-query.js +134 -0
- package/dist/src/lib/analytics-query.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +1818 -438
- package/dist/src/lib/api-client.js +965 -544
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +1 -1
- package/dist/src/lib/app-settings-descriptor.js +6 -0
- package/dist/src/lib/app-settings-descriptor.js.map +1 -1
- package/dist/src/lib/auth-fixtures.d.ts +44 -0
- package/dist/src/lib/auth-fixtures.js +61 -0
- package/dist/src/lib/auth-fixtures.js.map +1 -0
- package/dist/src/lib/auth-flow.d.ts +34 -1
- package/dist/src/lib/auth-flow.js +429 -13
- package/dist/src/lib/auth-flow.js.map +1 -1
- package/dist/src/lib/block-layout.d.ts +12 -23
- package/dist/src/lib/block-layout.js +26 -92
- package/dist/src/lib/block-layout.js.map +1 -1
- package/dist/src/lib/block-selector.d.ts +8 -14
- package/dist/src/lib/block-selector.js +8 -19
- package/dist/src/lib/block-selector.js.map +1 -1
- package/dist/src/lib/child-apps-local.d.ts +3 -1
- package/dist/src/lib/child-apps-local.js +9 -1
- package/dist/src/lib/child-apps-local.js.map +1 -1
- package/dist/src/lib/cli-manifest.d.ts +9 -0
- package/dist/src/lib/cli-manifest.js +10 -1
- package/dist/src/lib/cli-manifest.js.map +1 -1
- package/dist/src/lib/cli-version.d.ts +14 -0
- package/dist/src/lib/cli-version.js +38 -0
- package/dist/src/lib/cli-version.js.map +1 -0
- package/dist/src/lib/codegen-shared/prettierStable.d.ts +41 -0
- package/dist/src/lib/codegen-shared/prettierStable.js +146 -24
- package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -1
- package/dist/src/lib/collection-export.d.ts +76 -15
- package/dist/src/lib/collection-export.js +116 -23
- package/dist/src/lib/collection-export.js.map +1 -1
- package/dist/src/lib/collection-principal.d.ts +22 -0
- package/dist/src/lib/collection-principal.js +35 -0
- package/dist/src/lib/collection-principal.js.map +1 -0
- package/dist/src/lib/command-groups.d.ts +30 -0
- package/dist/src/lib/command-groups.js +109 -0
- package/dist/src/lib/command-groups.js.map +1 -0
- package/dist/src/lib/command-status.d.ts +147 -0
- package/dist/src/lib/command-status.js +266 -0
- package/dist/src/lib/command-status.js.map +1 -0
- package/dist/src/lib/config-object-descriptor.d.ts +9 -22
- package/dist/src/lib/config-object-descriptor.js +107 -276
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +3 -7
- package/dist/src/lib/config-surface.js +9 -13
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/config-toml.d.ts +11 -2
- package/dist/src/lib/config-toml.js +25 -2
- package/dist/src/lib/config-toml.js.map +1 -1
- package/dist/src/lib/credentials-home.d.ts +7 -0
- package/dist/src/lib/credentials-home.js +45 -10
- package/dist/src/lib/credentials-home.js.map +1 -1
- package/dist/src/lib/credentials-lock.d.ts +14 -6
- package/dist/src/lib/credentials-lock.js +90 -10
- package/dist/src/lib/credentials-lock.js.map +1 -1
- package/dist/src/lib/credentials-store.d.ts +123 -70
- package/dist/src/lib/credentials-store.js +358 -113
- package/dist/src/lib/credentials-store.js.map +1 -1
- package/dist/src/lib/custodian.d.ts +8 -0
- package/dist/src/lib/custodian.js +18 -0
- package/dist/src/lib/custodian.js.map +1 -0
- package/dist/src/lib/data-input.d.ts +1 -1
- package/dist/src/lib/data-input.js +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.js +3 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +38 -1
- package/dist/src/lib/db-codegen/dbTypeIR.js +29 -7
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
- package/dist/src/lib/db-type-records.d.ts +106 -0
- package/dist/src/lib/db-type-records.js +224 -0
- package/dist/src/lib/db-type-records.js.map +1 -0
- package/dist/src/lib/db3-export.d.ts +287 -0
- package/dist/src/lib/db3-export.js +647 -0
- package/dist/src/lib/db3-export.js.map +1 -0
- package/dist/src/lib/db3-index-output.d.ts +116 -0
- package/dist/src/lib/db3-index-output.js +223 -0
- package/dist/src/lib/db3-index-output.js.map +1 -0
- package/dist/src/lib/db3-type-models.d.ts +134 -0
- package/dist/src/lib/db3-type-models.js +452 -0
- package/dist/src/lib/db3-type-models.js.map +1 -0
- package/dist/src/lib/deprecation.d.ts +2 -2
- package/dist/src/lib/deprecation.js +2 -2
- package/dist/src/lib/document-ingest-artifact.d.ts +13 -0
- package/dist/src/lib/document-ingest-artifact.js +36 -6
- package/dist/src/lib/document-ingest-artifact.js.map +1 -1
- package/dist/src/lib/document-ingest-format2.d.ts +36 -0
- package/dist/src/lib/document-ingest-format2.js +78 -0
- package/dist/src/lib/document-ingest-format2.js.map +1 -0
- package/dist/src/lib/document-ingest-input.d.ts +9 -0
- package/dist/src/lib/document-ingest-input.js +28 -1
- package/dist/src/lib/document-ingest-input.js.map +1 -1
- package/dist/src/lib/document-ingest.d.ts +11 -1
- package/dist/src/lib/document-ingest.js +16 -0
- package/dist/src/lib/document-ingest.js.map +1 -1
- package/dist/src/lib/document-schema-rows.d.ts +42 -0
- package/dist/src/lib/document-schema-rows.js +53 -0
- package/dist/src/lib/document-schema-rows.js.map +1 -0
- package/dist/src/lib/experimental-apis.d.ts +36 -0
- package/dist/src/lib/experimental-apis.js +46 -0
- package/dist/src/lib/experimental-apis.js.map +1 -0
- package/dist/src/lib/file-attachment.d.ts +24 -0
- package/dist/src/lib/file-attachment.js +31 -0
- package/dist/src/lib/file-attachment.js.map +1 -0
- package/dist/src/lib/function-authorize-check.d.ts +142 -0
- package/dist/src/lib/function-authorize-check.js +311 -0
- package/dist/src/lib/function-authorize-check.js.map +1 -0
- package/dist/src/lib/function-authorize-view.d.ts +27 -0
- package/dist/src/lib/function-authorize-view.js +88 -0
- package/dist/src/lib/function-authorize-view.js.map +1 -0
- package/dist/src/lib/function-bundle.d.ts +27 -5
- package/dist/src/lib/function-bundle.js +142 -7
- package/dist/src/lib/function-bundle.js.map +1 -1
- package/dist/src/lib/function-collect.d.ts +90 -12
- package/dist/src/lib/function-collect.js +482 -12
- package/dist/src/lib/function-collect.js.map +1 -1
- package/dist/src/lib/function-db-types.d.ts +65 -11
- package/dist/src/lib/function-db-types.js +297 -157
- package/dist/src/lib/function-db-types.js.map +1 -1
- package/dist/src/lib/function-document-types.d.ts +19 -7
- package/dist/src/lib/function-document-types.js +24 -12
- package/dist/src/lib/function-document-types.js.map +1 -1
- package/dist/src/lib/function-lint.d.ts +57 -0
- package/dist/src/lib/function-lint.js +234 -0
- package/dist/src/lib/function-lint.js.map +1 -0
- package/dist/src/lib/function-log-row.js +21 -2
- package/dist/src/lib/function-log-row.js.map +1 -1
- package/dist/src/lib/function-run.d.ts +13 -21
- package/dist/src/lib/function-run.js +14 -27
- package/dist/src/lib/function-run.js.map +1 -1
- package/dist/src/lib/function-schema-codegen.d.ts +86 -22
- package/dist/src/lib/function-schema-codegen.js +194 -88
- package/dist/src/lib/function-schema-codegen.js.map +1 -1
- package/dist/src/lib/function-schema-refs.d.ts +98 -0
- package/dist/src/lib/function-schema-refs.js +177 -0
- package/dist/src/lib/function-schema-refs.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +109 -6
- package/dist/src/lib/function-sync.js +179 -26
- package/dist/src/lib/function-sync.js.map +1 -1
- package/dist/src/lib/function-trigger-listing.d.ts +11 -6
- package/dist/src/lib/function-trigger-listing.js +32 -11
- package/dist/src/lib/function-trigger-listing.js.map +1 -1
- package/dist/src/lib/function-typecheck.d.ts +52 -0
- package/dist/src/lib/function-typecheck.js +174 -54
- package/dist/src/lib/function-typecheck.js.map +1 -1
- package/dist/src/lib/function-versions.d.ts +2 -0
- package/dist/src/lib/function-versions.js +1 -0
- package/dist/src/lib/function-versions.js.map +1 -1
- package/dist/src/lib/generated-build-flags.d.ts +13 -0
- package/dist/src/lib/generated-build-flags.js +14 -0
- package/dist/src/lib/generated-build-flags.js.map +1 -0
- package/dist/src/lib/generated-command-status.d.ts +6 -0
- package/dist/src/lib/generated-command-status.js +469 -0
- package/dist/src/lib/generated-command-status.js.map +1 -0
- package/dist/src/lib/generated-config-surfaces.d.ts +538 -141
- package/dist/src/lib/generated-config-surfaces.js +1772 -1854
- package/dist/src/lib/generated-config-surfaces.js.map +1 -1
- package/dist/src/lib/generated-sdk-types.d.ts +1 -1
- package/dist/src/lib/generated-sdk-types.js +1 -1
- package/dist/src/lib/generated-sdk-types.js.map +1 -1
- package/dist/src/lib/hosting-build.d.ts +97 -0
- package/dist/src/lib/hosting-build.js +204 -0
- package/dist/src/lib/hosting-build.js.map +1 -0
- package/dist/src/lib/hosting-client.d.ts +167 -0
- package/dist/src/lib/hosting-client.js +340 -0
- package/dist/src/lib/hosting-client.js.map +1 -0
- package/dist/src/lib/hosting-environments.d.ts +32 -0
- package/dist/src/lib/hosting-environments.js +74 -0
- package/dist/src/lib/hosting-environments.js.map +1 -0
- package/dist/src/lib/hosting-errors.d.ts +30 -0
- package/dist/src/lib/hosting-errors.js +43 -0
- package/dist/src/lib/hosting-errors.js.map +1 -0
- package/dist/src/lib/hosting-token.d.ts +46 -0
- package/dist/src/lib/hosting-token.js +60 -0
- package/dist/src/lib/hosting-token.js.map +1 -0
- package/dist/src/lib/hosting-wait.d.ts +42 -0
- package/dist/src/lib/hosting-wait.js +84 -0
- package/dist/src/lib/hosting-wait.js.map +1 -0
- package/dist/src/lib/hosting-wfp-upload.d.ts +86 -0
- package/dist/src/lib/hosting-wfp-upload.js +149 -0
- package/dist/src/lib/hosting-wfp-upload.js.map +1 -0
- package/dist/src/lib/init-assets.d.ts +2 -6
- package/dist/src/lib/init-assets.js +11 -27
- package/dist/src/lib/init-assets.js.map +1 -1
- package/dist/src/lib/init-ios-links.d.ts +11 -7
- package/dist/src/lib/init-ios-links.js +28 -22
- package/dist/src/lib/init-ios-links.js.map +1 -1
- package/dist/src/lib/init-login-note.d.ts +13 -0
- package/dist/src/lib/init-login-note.js +22 -0
- package/dist/src/lib/init-login-note.js.map +1 -0
- package/dist/src/lib/init-schema.d.ts +15 -0
- package/dist/src/lib/init-schema.js +54 -0
- package/dist/src/lib/init-schema.js.map +1 -1
- package/dist/src/lib/integration-test-request.d.ts +54 -0
- package/dist/src/lib/integration-test-request.js +207 -0
- package/dist/src/lib/integration-test-request.js.map +1 -0
- package/dist/src/lib/invoker-shared-enums.d.ts +35 -0
- package/dist/src/lib/invoker-shared-enums.js +98 -0
- package/dist/src/lib/invoker-shared-enums.js.map +1 -0
- package/dist/src/lib/json-value.d.ts +6 -0
- package/dist/src/lib/json-value.js +13 -0
- package/dist/src/lib/json-value.js.map +1 -0
- package/dist/src/lib/load-routes.d.ts +33 -0
- package/dist/src/lib/load-routes.js +35 -0
- package/dist/src/lib/load-routes.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +23 -4
- package/dist/src/lib/log-inspection.js +14 -5
- package/dist/src/lib/log-inspection.js.map +1 -1
- package/dist/src/lib/login-exchange-check.d.ts +18 -0
- package/dist/src/lib/login-exchange-check.js +27 -0
- package/dist/src/lib/login-exchange-check.js.map +1 -0
- package/dist/src/lib/login-scope-lines.d.ts +17 -7
- package/dist/src/lib/login-scope-lines.js +33 -10
- package/dist/src/lib/login-scope-lines.js.map +1 -1
- package/dist/src/lib/metadata-report.d.ts +85 -0
- package/dist/src/lib/metadata-report.js +81 -0
- package/dist/src/lib/metadata-report.js.map +1 -0
- package/dist/src/lib/object-status-filter.d.ts +9 -1
- package/dist/src/lib/object-status-filter.js +9 -1
- package/dist/src/lib/object-status-filter.js.map +1 -1
- package/dist/src/lib/output.d.ts +1 -1
- package/dist/src/lib/output.js +3 -1
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/pin-refusal-hint.d.ts +12 -0
- package/dist/src/lib/pin-refusal-hint.js +35 -0
- package/dist/src/lib/pin-refusal-hint.js.map +1 -0
- package/dist/src/lib/platform-owned.js +5 -0
- package/dist/src/lib/platform-owned.js.map +1 -1
- package/dist/src/lib/primitive-declaration-names.d.ts +21 -0
- package/dist/src/lib/primitive-declaration-names.js +22 -0
- package/dist/src/lib/primitive-declaration-names.js.map +1 -0
- package/dist/src/lib/primitive-declaration.d.ts +174 -0
- package/dist/src/lib/primitive-declaration.js +792 -0
- package/dist/src/lib/primitive-declaration.js.map +1 -0
- package/dist/src/lib/primitive-env-plugin.d.ts +99 -0
- package/dist/src/lib/primitive-env-plugin.js +408 -0
- package/dist/src/lib/primitive-env-plugin.js.map +1 -0
- package/dist/src/lib/project-login-apps.d.ts +8 -0
- package/dist/src/lib/project-login-apps.js +27 -0
- package/dist/src/lib/project-login-apps.js.map +1 -0
- package/dist/src/lib/prompt-schema-codegen.d.ts +36 -12
- package/dist/src/lib/prompt-schema-codegen.js +96 -100
- package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
- package/dist/src/lib/prompt-schema-document.d.ts +35 -0
- package/dist/src/lib/prompt-schema-document.js +92 -0
- package/dist/src/lib/prompt-schema-document.js.map +1 -0
- package/dist/src/lib/prompt-schema-refs.d.ts +173 -0
- package/dist/src/lib/prompt-schema-refs.js +478 -0
- package/dist/src/lib/prompt-schema-refs.js.map +1 -0
- package/dist/src/lib/records-verbs.d.ts +79 -0
- package/dist/src/lib/records-verbs.js +45 -0
- package/dist/src/lib/records-verbs.js.map +1 -0
- package/dist/src/lib/register-commands.d.ts +36 -0
- package/dist/src/lib/register-commands.js +37 -0
- package/dist/src/lib/register-commands.js.map +1 -0
- package/dist/src/lib/retired-imports.d.ts +53 -0
- package/dist/src/lib/retired-imports.js +120 -0
- package/dist/src/lib/retired-imports.js.map +1 -0
- package/dist/src/lib/run-status.d.ts +1 -1
- package/dist/src/lib/run-status.generated.d.ts +2 -2
- package/dist/src/lib/run-status.generated.js +3 -1
- package/dist/src/lib/run-status.generated.js.map +1 -1
- package/dist/src/lib/run-status.js +1 -1
- package/dist/src/lib/schema-codegen/compiledSpace.d.ts +62 -0
- package/dist/src/lib/schema-codegen/compiledSpace.js +103 -0
- package/dist/src/lib/schema-codegen/compiledSpace.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.d.ts +86 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.js +227 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.d.ts +85 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js +86 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.d.ts +218 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.js +397 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-field-table.d.ts +80 -0
- package/dist/src/lib/schema-codegen/generated-field-table.js +542 -0
- package/dist/src/lib/schema-codegen/generated-field-table.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.d.ts +195 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.js +503 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.d.ts +258 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +422 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.d.ts +129 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.js +475 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.d.ts +115 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.js +274 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.d.ts +366 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.js +1789 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.d.ts +27 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.js +126 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.js.map +1 -0
- package/dist/src/lib/schema-codegen/namedRefs.d.ts +56 -0
- package/dist/src/lib/schema-codegen/namedRefs.js +143 -0
- package/dist/src/lib/schema-codegen/namedRefs.js.map +1 -0
- package/dist/src/lib/schema-codegen/naming.d.ts +35 -0
- package/dist/src/lib/schema-codegen/naming.js +83 -0
- package/dist/src/lib/schema-codegen/naming.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaChanges.d.ts +74 -0
- package/dist/src/lib/schema-codegen/schemaChanges.js +277 -0
- package/dist/src/lib/schema-codegen/schemaChanges.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaDocs.d.ts +69 -0
- package/dist/src/lib/schema-codegen/schemaDocs.js +219 -0
- package/dist/src/lib/schema-codegen/schemaDocs.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaIR.d.ts +158 -0
- package/dist/src/lib/schema-codegen/schemaIR.js +279 -0
- package/dist/src/lib/schema-codegen/schemaIR.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaToTs.d.ts +109 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js +269 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -0
- package/dist/src/lib/schema-codegen/valuesLists.d.ts +48 -0
- package/dist/src/lib/schema-codegen/valuesLists.js +144 -0
- package/dist/src/lib/schema-codegen/valuesLists.js.map +1 -0
- package/dist/src/lib/schema-family-index.d.ts +228 -0
- package/dist/src/lib/schema-family-index.js +813 -0
- package/dist/src/lib/schema-family-index.js.map +1 -0
- package/dist/src/lib/schema-pins.d.ts +82 -0
- package/dist/src/lib/schema-pins.js +198 -0
- package/dist/src/lib/schema-pins.js.map +1 -0
- package/dist/src/lib/schema-preview.d.ts +244 -0
- package/dist/src/lib/schema-preview.js +498 -0
- package/dist/src/lib/schema-preview.js.map +1 -0
- package/dist/src/lib/scope-request.d.ts +23 -11
- package/dist/src/lib/scope-request.js +69 -31
- package/dist/src/lib/scope-request.js.map +1 -1
- package/dist/src/lib/session-scope.d.ts +26 -0
- package/dist/src/lib/session-scope.js +58 -0
- package/dist/src/lib/session-scope.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +2 -2
- package/dist/src/lib/skill-installer.js +2 -21
- package/dist/src/lib/skill-installer.js.map +1 -1
- package/dist/src/lib/step-run-table.d.ts +1 -2
- package/dist/src/lib/step-run-table.js +1 -2
- package/dist/src/lib/step-run-table.js.map +1 -1
- package/dist/src/lib/swift-codegen/agentGenerator.d.ts +2 -1
- package/dist/src/lib/swift-codegen/agentGenerator.js +25 -23
- package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/banners.d.ts +12 -0
- package/dist/src/lib/swift-codegen/banners.js +12 -0
- package/dist/src/lib/swift-codegen/banners.js.map +1 -1
- package/dist/src/lib/swift-codegen/functionGenerator.d.ts +36 -1
- package/dist/src/lib/swift-codegen/functionGenerator.js +169 -51
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +33 -9
- package/dist/src/lib/swift-codegen/schemaToSwift.js +215 -179
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
- package/dist/src/lib/swift-codegen/sharedGenerator.d.ts +45 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.js +165 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/swiftKeys.d.ts +19 -0
- package/dist/src/lib/swift-codegen/swiftKeys.js +31 -0
- package/dist/src/lib/swift-codegen/swiftKeys.js.map +1 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.d.ts +30 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.js +69 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.js.map +1 -0
- package/dist/src/lib/sync-resource-types.d.ts +117 -31
- package/dist/src/lib/sync-resource-types.js +197 -189
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/sync-selectors.d.ts +7 -0
- package/dist/src/lib/sync-selectors.js +22 -2
- package/dist/src/lib/sync-selectors.js.map +1 -1
- package/dist/src/lib/template.d.ts +39 -3
- package/dist/src/lib/template.js +103 -14
- package/dist/src/lib/template.js.map +1 -1
- package/dist/src/lib/test-case-file-names.d.ts +3 -5
- package/dist/src/lib/test-case-file-names.js +3 -5
- package/dist/src/lib/test-case-file-names.js.map +1 -1
- package/dist/src/lib/test-runs.d.ts +45 -0
- package/dist/src/lib/test-runs.js +150 -0
- package/dist/src/lib/test-runs.js.map +1 -0
- package/dist/src/lib/test-users.d.ts +25 -0
- package/dist/src/lib/test-users.js +36 -0
- package/dist/src/lib/test-users.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +4 -2
- package/dist/src/lib/toml-database-config.js +11 -6
- package/dist/src/lib/toml-database-config.js.map +1 -1
- package/dist/src/lib/toml-scalar-edit.js +6 -4
- package/dist/src/lib/toml-scalar-edit.js.map +1 -1
- package/dist/src/lib/transition-warnings.d.ts +21 -0
- package/dist/src/lib/transition-warnings.js +49 -0
- package/dist/src/lib/transition-warnings.js.map +1 -0
- package/dist/src/lib/user-index.d.ts +80 -0
- package/dist/src/lib/user-index.js +166 -0
- package/dist/src/lib/user-index.js.map +1 -0
- package/dist/src/lib/user-properties/generated-properties-schema.d.ts +159 -0
- package/dist/src/lib/user-properties/generated-properties-schema.js +471 -0
- package/dist/src/lib/user-properties/generated-properties-schema.js.map +1 -0
- package/dist/src/lib/user-properties/user-properties-codegen.d.ts +55 -0
- package/dist/src/lib/user-properties/user-properties-codegen.js +129 -0
- package/dist/src/lib/user-properties/user-properties-codegen.js.map +1 -0
- package/dist/src/lib/user-walk.d.ts +31 -0
- package/dist/src/lib/user-walk.js +102 -0
- package/dist/src/lib/user-walk.js.map +1 -0
- package/dist/src/lib/webhook-capture.d.ts +43 -0
- package/dist/src/lib/webhook-capture.js +91 -0
- package/dist/src/lib/webhook-capture.js.map +1 -0
- package/dist/src/lib/webhook-deliver.d.ts +18 -20
- package/dist/src/lib/webhook-deliver.js +34 -89
- package/dist/src/lib/webhook-deliver.js.map +1 -1
- package/dist/src/lib/webhook-test-run.d.ts +32 -0
- package/dist/src/lib/webhook-test-run.js +108 -0
- package/dist/src/lib/webhook-test-run.js.map +1 -0
- package/dist/src/lib/worker-perf-format.d.ts +22 -0
- package/dist/src/lib/worker-perf-format.js +27 -0
- package/dist/src/lib/worker-perf-format.js.map +1 -0
- package/dist/src/types/index.d.ts +20 -65
- package/dist/src/validators.d.ts +7 -55
- package/dist/src/validators.js +7 -53
- package/dist/src/validators.js.map +1 -1
- package/dist/src/vite.d.ts +17 -0
- package/dist/src/vite.js +18 -0
- package/dist/src/vite.js.map +1 -0
- package/package.json +20 -9
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED FILE — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Vendored byte-for-byte from the canonical server module
|
|
5
|
+
* `src/function-runs/schema-descriptor.ts` — the SAME interpretation the server
|
|
6
|
+
* validator (`validateValue`) enforces. The CLI cannot import server `src/`
|
|
7
|
+
* at runtime, so the CLI's schema type converters import this committed
|
|
8
|
+
* copy instead.
|
|
9
|
+
*
|
|
10
|
+
* Regenerate with:
|
|
11
|
+
* node cli/scripts/gen-schema-descriptor.mjs (runs at CLI prebuild)
|
|
12
|
+
*
|
|
13
|
+
* A CI freshness guard
|
|
14
|
+
* (`cli/scripts/gen-schema-descriptor.mjs --check`, also asserted by
|
|
15
|
+
* `cli/tests/unit/schema-codegen-descriptor-drift-guard.test.ts`) fails if
|
|
16
|
+
* this committed copy does not match the source — see issue #1442 / #998.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Canonical interpretation of the JSON-Schema subset the workflow platform
|
|
20
|
+
* supports (issue #1442).
|
|
21
|
+
*
|
|
22
|
+
* The server validator (`validateValue` in `schema-validation.ts`) and the CLI
|
|
23
|
+
* schema type converter (`schema-codegen/schemaToTs.ts`) must agree EXACTLY
|
|
24
|
+
* on how an `inputSchema`/`outputSchema` is interpreted —
|
|
25
|
+
* otherwise a generated `<Key>Input` type promises a shape the runtime does not
|
|
26
|
+
* enforce (or rejects a value the runtime accepts). Previously the converter
|
|
27
|
+
* re-derived those interpretation decisions by hand, which drifts from the
|
|
28
|
+
* validator over time.
|
|
29
|
+
*
|
|
30
|
+
* This module is the single source of that interpretation. Both consumers read
|
|
31
|
+
* from `describeSchema` + `isType`:
|
|
32
|
+
*
|
|
33
|
+
* - the type gate is checked before `enum` (a value failing `type` is
|
|
34
|
+
* rejected before `enum` is consulted);
|
|
35
|
+
* - a type UNION (`type: ["string","null"]`) never descends into
|
|
36
|
+
* `properties`/`items` — only the exact string types `"object"`/`"array"`
|
|
37
|
+
* do;
|
|
38
|
+
* - `integer` means `Number.isInteger`;
|
|
39
|
+
* - `additionalProperties` only closes an object; it is not a nested schema.
|
|
40
|
+
*
|
|
41
|
+
* It also carries the keyword table (`SCHEMA_KEYWORDS`, #5529): every
|
|
42
|
+
* JSON-Schema keyword any schema reader names, classified once as enforced,
|
|
43
|
+
* annotation or refused. The validator, the function push refusal list, the
|
|
44
|
+
* route keyword guard, the published-spec guard and the Gemini translator all
|
|
45
|
+
* read it, so they cannot disagree about a keyword.
|
|
46
|
+
*
|
|
47
|
+
* It is deliberately dependency-free (no imports) so the CLI can vendor a
|
|
48
|
+
* byte-for-byte copy as a committed artifact via
|
|
49
|
+
* `cli/scripts/gen-workflow-schema-descriptor.mjs` (the #998 gen-allowlist
|
|
50
|
+
* pattern). A drift-guard test runs that generator in `--check` mode, so a
|
|
51
|
+
* change here that isn't regenerated into the CLI artifact fails CI. The CLI
|
|
52
|
+
* never imports server `src/` at runtime — only the build-time generator reads
|
|
53
|
+
* this file.
|
|
54
|
+
*/
|
|
55
|
+
/** Does a value satisfy a JSON-schema `type` name? `integer` = `Number.isInteger`. */
|
|
56
|
+
export declare function isType(value: any, type: string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The interpretation of a single schema node, normalized so both the validator
|
|
59
|
+
* and the type converter can consume it without re-reading raw schema fields.
|
|
60
|
+
*/
|
|
61
|
+
export interface SchemaDescriptor {
|
|
62
|
+
/** True when `schema.type` is an array (a type union). */
|
|
63
|
+
isUnion: boolean;
|
|
64
|
+
/** `schema.type` when it is a single string; null for a union or absent type. */
|
|
65
|
+
singularType: string | null;
|
|
66
|
+
/**
|
|
67
|
+
* The declared type(s) normalized to an array. An array `type` is kept as-is;
|
|
68
|
+
* a single string becomes a one-element array; an absent/falsy type is `[]`
|
|
69
|
+
* (no type gate). Matches the validator's `allowedTypes` normalization.
|
|
70
|
+
*/
|
|
71
|
+
types: string[];
|
|
72
|
+
/** The `enum` array when present, else null. */
|
|
73
|
+
enumValues: any[] | null;
|
|
74
|
+
/**
|
|
75
|
+
* Object descent info — non-null ONLY when `schema.type` is exactly the
|
|
76
|
+
* string `"object"` AND `properties` is a declared object (matching the
|
|
77
|
+
* validator's `schema.type === "object" && schema.properties` descent gate).
|
|
78
|
+
* A type UNION containing `"object"` never descends.
|
|
79
|
+
*/
|
|
80
|
+
object: {
|
|
81
|
+
/** The raw `properties` map (child schemas). May be empty `{}`. */
|
|
82
|
+
properties: Record<string, any>;
|
|
83
|
+
/** The raw `required` list (unfiltered, as the validator reads it). */
|
|
84
|
+
required: any[];
|
|
85
|
+
/** True when `additionalProperties === false` (a closed object). */
|
|
86
|
+
additionalPropertiesClosed: boolean;
|
|
87
|
+
} | null;
|
|
88
|
+
/**
|
|
89
|
+
* Array descent info — non-null ONLY when `schema.type` is exactly the string
|
|
90
|
+
* `"array"` AND `items` is present (matching the validator's
|
|
91
|
+
* `schema.type === "array" && schema.items` descent gate).
|
|
92
|
+
*/
|
|
93
|
+
array: {
|
|
94
|
+
/** The raw `items` schema (may be a tuple array the validator no-ops on). */
|
|
95
|
+
items: any;
|
|
96
|
+
} | null;
|
|
97
|
+
/**
|
|
98
|
+
* Discriminated-union (tagged-union) interpretation of a `oneOf` node (#1511).
|
|
99
|
+
*
|
|
100
|
+
* Populated ONLY when the node carries a `oneOf` (or `anyOf`) array whose
|
|
101
|
+
* members are ALL `type: "object"` — a clearly-intended tagged union. A
|
|
102
|
+
* `oneOf`/`anyOf` with any non-object member is NOT a tagged union: `oneOf`
|
|
103
|
+
* stays `null` here and is ignored (renders `unknown` / validates
|
|
104
|
+
* permissively) exactly as before, preserving backward compatibility.
|
|
105
|
+
*
|
|
106
|
+
* - `kind: "valid"` — a clean discriminated union: ≥2 object members sharing
|
|
107
|
+
* exactly one discriminator property declared as a single-literal `enum`
|
|
108
|
+
* in every member with distinct literals across members. The validator
|
|
109
|
+
* branch-selects by `discriminant` and validates only the matched member;
|
|
110
|
+
* the type converter renders the `|`-union of member object types.
|
|
111
|
+
* - `kind: "invalid"` — an all-object-member union that LOOKS like a tagged
|
|
112
|
+
* union but is defective (fewer than 2 members, no/ambiguous discriminator,
|
|
113
|
+
* or `anyOf` — unsupported in v1). `reason` is the codegen error message.
|
|
114
|
+
* The runtime validator ignores this (stays permissive); the codegen
|
|
115
|
+
* converter throws `reason` (Fork 3 = strict, resolved by the maintainer).
|
|
116
|
+
*/
|
|
117
|
+
oneOf: {
|
|
118
|
+
kind: "valid";
|
|
119
|
+
/** The auto-detected discriminator property name. */
|
|
120
|
+
discriminant: string;
|
|
121
|
+
/** One entry per member: its discriminant literal + raw member schema. */
|
|
122
|
+
members: Array<{
|
|
123
|
+
discriminantValue: any;
|
|
124
|
+
schema: any;
|
|
125
|
+
}>;
|
|
126
|
+
} | {
|
|
127
|
+
kind: "invalid";
|
|
128
|
+
reason: string;
|
|
129
|
+
} | null;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Sibling constraint keywords that make a `oneOf` node a MIXED schema rather
|
|
133
|
+
* than a clean tagged union (#1511). A clean discriminated union carries only
|
|
134
|
+
* the `oneOf` keyword (plus annotations like `description`/`title`); it never
|
|
135
|
+
* combines with a top-level `type`/`properties`/`required`/`additionalProperties`/
|
|
136
|
+
* `items`/`enum`. When any of these co-occur with `oneOf`, the validator's
|
|
137
|
+
* branch-select would early-return and skip those sibling constraints, silently
|
|
138
|
+
* loosening validation. So a mixed node is NOT treated as a clean tagged union.
|
|
139
|
+
*/
|
|
140
|
+
export declare const ONEOF_SIBLING_CONSTRAINT_KEYS: readonly ["type", "properties", "required", "additionalProperties", "items", "enum"];
|
|
141
|
+
/**
|
|
142
|
+
* Interpret a parsed schema node. A non-object schema (null, array, scalar)
|
|
143
|
+
* enforces nothing → the empty descriptor.
|
|
144
|
+
*/
|
|
145
|
+
export declare function describeSchema(schema: any): SchemaDescriptor;
|
|
146
|
+
/**
|
|
147
|
+
* What the platform does with a keyword:
|
|
148
|
+
*
|
|
149
|
+
* - `enforced`: the validator checks it, the generated types render it, and
|
|
150
|
+
* each provider translates it or refuses it;
|
|
151
|
+
* - `annotation`: accepted and passed through, constraining nothing. Unknown
|
|
152
|
+
* keys are annotations too, but they are not rows: a reader that admits
|
|
153
|
+
* only named rows (the route guard) refuses them;
|
|
154
|
+
* - `refused`: the function push refuses a schema that carries it, because
|
|
155
|
+
* the validator would not enforce it.
|
|
156
|
+
*/
|
|
157
|
+
export type SchemaKeywordClass = "enforced" | "annotation" | "refused";
|
|
158
|
+
/**
|
|
159
|
+
* How much of the table a validator caller enforces. `full` is every enforced
|
|
160
|
+
* row; `structural` is the `level: "structural"` rows only, which is what the
|
|
161
|
+
* validator enforced before every caller held schemas to their bounds.
|
|
162
|
+
*/
|
|
163
|
+
export type SchemaValidationLevel = "full" | "structural";
|
|
164
|
+
/**
|
|
165
|
+
* What the Gemini translator (`src/config-surface/provider-schema.ts`) does
|
|
166
|
+
* with the keyword: send it as written (`pass`), drop it because it means
|
|
167
|
+
* nothing to a value (`drop`), rewrite it by a rule of its own (`rule`), or
|
|
168
|
+
* refuse the schema (`refuse`). OpenRouter is identity for every keyword.
|
|
169
|
+
*/
|
|
170
|
+
export type GeminiKeywordVerdict = "pass" | "drop" | "rule" | "refuse";
|
|
171
|
+
/**
|
|
172
|
+
* Which change to the keyword narrows what a schema accepts: raising it
|
|
173
|
+
* (`minimum`), lowering it (`maxLength`), adding an entry (`required`),
|
|
174
|
+
* removing one (`enum`, `properties`), setting it where it was absent or to
|
|
175
|
+
* another value (`pattern`, or a refused applicator such as `not`), or any
|
|
176
|
+
* change at all (`any`). A boolean keyword reads its polarity: `on` narrows
|
|
177
|
+
* when the keyword becomes `true` (`uniqueItems`), `off` when a `true` goes
|
|
178
|
+
* (`nullable`), and `close` when it becomes `false` or a schema where it was
|
|
179
|
+
* absent, `true` or another schema (`additionalProperties`). `never` is a
|
|
180
|
+
* keyword no change of which narrows anything.
|
|
181
|
+
*/
|
|
182
|
+
export type SchemaKeywordTightens = "raise" | "lower" | "add" | "remove" | "set" | "on" | "off" | "close" | "any" | "never";
|
|
183
|
+
/**
|
|
184
|
+
* How the CLI's generated TypeScript and Swift render the keyword: as part of
|
|
185
|
+
* the generated type (`shape`), as a doc comment on the member or type the
|
|
186
|
+
* keyword's node renders as (`doc`), or not at all (`none`, for a keyword a
|
|
187
|
+
* push never stores).
|
|
188
|
+
*/
|
|
189
|
+
export type SchemaKeywordRender = "shape" | "doc" | "none";
|
|
190
|
+
/** The columns every row carries, whatever its class. */
|
|
191
|
+
interface SchemaKeywordColumns {
|
|
192
|
+
gemini: GeminiKeywordVerdict;
|
|
193
|
+
tightens: SchemaKeywordTightens;
|
|
194
|
+
/**
|
|
195
|
+
* The merge gate's breaking-change extractor compares this keyword
|
|
196
|
+
* (`schemaBreaks` in `tools/pl-orchestrator/src/breaking-changes.ts`). A
|
|
197
|
+
* change in the `tightens` direction to such a row is breaking, even when the
|
|
198
|
+
* row is an annotation (`format`, `$ref`), so a classifier reading this table
|
|
199
|
+
* never calls additive a change the gate calls breaking.
|
|
200
|
+
*/
|
|
201
|
+
extractor: boolean;
|
|
202
|
+
render: SchemaKeywordRender;
|
|
203
|
+
}
|
|
204
|
+
/** One keyword's row in `SCHEMA_KEYWORDS`. */
|
|
205
|
+
export type SchemaKeywordRow = (SchemaKeywordColumns & {
|
|
206
|
+
class: "enforced";
|
|
207
|
+
/** `structural`: enforced at both levels. `constraint`: at the full level only. */
|
|
208
|
+
level: "structural" | "constraint";
|
|
209
|
+
}) | (SchemaKeywordColumns & {
|
|
210
|
+
class: "annotation";
|
|
211
|
+
/** A `validateRequest` route schema may carry it. */
|
|
212
|
+
routes: boolean;
|
|
213
|
+
}) | (SchemaKeywordColumns & {
|
|
214
|
+
class: "refused";
|
|
215
|
+
});
|
|
216
|
+
/**
|
|
217
|
+
* Every JSON-Schema keyword a schema reader names, in exactly one class.
|
|
218
|
+
*
|
|
219
|
+
* Readers: the validator (`schema-validation.ts`, which enforces the
|
|
220
|
+
* `enforced` rows at the level its caller selects), the function push refusal
|
|
221
|
+
* list (the `refused` rows), the route keyword guard (the structural rows plus
|
|
222
|
+
* the `routes: true` annotations), the published-spec guard
|
|
223
|
+
* (`scripts/lib/spec-schemas.mjs`), the Gemini translator (the `gemini`
|
|
224
|
+
* column) and the CLI's TypeScript and Swift codegen (the `render` column).
|
|
225
|
+
* Look a keyword up with `Object.prototype.hasOwnProperty`, never by
|
|
226
|
+
* plain indexing: `constructor` is not a row.
|
|
227
|
+
*/
|
|
228
|
+
export declare const SCHEMA_KEYWORDS: Readonly<Record<string, SchemaKeywordRow>>;
|
|
229
|
+
/**
|
|
230
|
+
* The validator callers that do not enforce the whole table, each selected by
|
|
231
|
+
* name at its call site. `validateRequest` routes stay at the structural level
|
|
232
|
+
* for good, because route request validation does not change.
|
|
233
|
+
*/
|
|
234
|
+
export declare const SCHEMA_LEVEL_EXCEPTIONS: Readonly<{
|
|
235
|
+
readonly validateRequest: Readonly<{
|
|
236
|
+
level: "structural";
|
|
237
|
+
until: "permanent";
|
|
238
|
+
}>;
|
|
239
|
+
}>;
|
|
240
|
+
/**
|
|
241
|
+
* How generated types render `keyword`: its row's `render`, and `doc` for a key
|
|
242
|
+
* that is not a row, because an unknown key is an annotation. Looked up as an
|
|
243
|
+
* own property, so `constructor` and `__proto__` are unknown keys.
|
|
244
|
+
*/
|
|
245
|
+
export declare function schemaKeywordRender(keyword: string): SchemaKeywordRender;
|
|
246
|
+
/** The keywords the validator enforces at `level`. */
|
|
247
|
+
export declare function enforcedSchemaKeywords(level: SchemaValidationLevel): ReadonlySet<string>;
|
|
248
|
+
/** The keywords the function push refuses, in table order. Always the same array. */
|
|
249
|
+
export declare function refusedSchemaKeywords(): readonly string[];
|
|
250
|
+
/**
|
|
251
|
+
* What a `validateRequest` route schema may carry: the keywords its
|
|
252
|
+
* structural-level validation enforces, and the annotations named for routes.
|
|
253
|
+
*/
|
|
254
|
+
export declare function routeGuardSchemaKeywords(): {
|
|
255
|
+
enforced: ReadonlySet<string>;
|
|
256
|
+
annotations: ReadonlySet<string>;
|
|
257
|
+
};
|
|
258
|
+
export {};
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED FILE — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Vendored byte-for-byte from the canonical server module
|
|
5
|
+
* `src/function-runs/schema-descriptor.ts` — the SAME interpretation the server
|
|
6
|
+
* validator (`validateValue`) enforces. The CLI cannot import server `src/`
|
|
7
|
+
* at runtime, so the CLI's schema type converters import this committed
|
|
8
|
+
* copy instead.
|
|
9
|
+
*
|
|
10
|
+
* Regenerate with:
|
|
11
|
+
* node cli/scripts/gen-schema-descriptor.mjs (runs at CLI prebuild)
|
|
12
|
+
*
|
|
13
|
+
* A CI freshness guard
|
|
14
|
+
* (`cli/scripts/gen-schema-descriptor.mjs --check`, also asserted by
|
|
15
|
+
* `cli/tests/unit/schema-codegen-descriptor-drift-guard.test.ts`) fails if
|
|
16
|
+
* this committed copy does not match the source — see issue #1442 / #998.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Canonical interpretation of the JSON-Schema subset the workflow platform
|
|
20
|
+
* supports (issue #1442).
|
|
21
|
+
*
|
|
22
|
+
* The server validator (`validateValue` in `schema-validation.ts`) and the CLI
|
|
23
|
+
* schema type converter (`schema-codegen/schemaToTs.ts`) must agree EXACTLY
|
|
24
|
+
* on how an `inputSchema`/`outputSchema` is interpreted —
|
|
25
|
+
* otherwise a generated `<Key>Input` type promises a shape the runtime does not
|
|
26
|
+
* enforce (or rejects a value the runtime accepts). Previously the converter
|
|
27
|
+
* re-derived those interpretation decisions by hand, which drifts from the
|
|
28
|
+
* validator over time.
|
|
29
|
+
*
|
|
30
|
+
* This module is the single source of that interpretation. Both consumers read
|
|
31
|
+
* from `describeSchema` + `isType`:
|
|
32
|
+
*
|
|
33
|
+
* - the type gate is checked before `enum` (a value failing `type` is
|
|
34
|
+
* rejected before `enum` is consulted);
|
|
35
|
+
* - a type UNION (`type: ["string","null"]`) never descends into
|
|
36
|
+
* `properties`/`items` — only the exact string types `"object"`/`"array"`
|
|
37
|
+
* do;
|
|
38
|
+
* - `integer` means `Number.isInteger`;
|
|
39
|
+
* - `additionalProperties` only closes an object; it is not a nested schema.
|
|
40
|
+
*
|
|
41
|
+
* It also carries the keyword table (`SCHEMA_KEYWORDS`, #5529): every
|
|
42
|
+
* JSON-Schema keyword any schema reader names, classified once as enforced,
|
|
43
|
+
* annotation or refused. The validator, the function push refusal list, the
|
|
44
|
+
* route keyword guard, the published-spec guard and the Gemini translator all
|
|
45
|
+
* read it, so they cannot disagree about a keyword.
|
|
46
|
+
*
|
|
47
|
+
* It is deliberately dependency-free (no imports) so the CLI can vendor a
|
|
48
|
+
* byte-for-byte copy as a committed artifact via
|
|
49
|
+
* `cli/scripts/gen-workflow-schema-descriptor.mjs` (the #998 gen-allowlist
|
|
50
|
+
* pattern). A drift-guard test runs that generator in `--check` mode, so a
|
|
51
|
+
* change here that isn't regenerated into the CLI artifact fails CI. The CLI
|
|
52
|
+
* never imports server `src/` at runtime — only the build-time generator reads
|
|
53
|
+
* this file.
|
|
54
|
+
*/
|
|
55
|
+
/** Does a value satisfy a JSON-schema `type` name? `integer` = `Number.isInteger`. */
|
|
56
|
+
export function isType(value, type) {
|
|
57
|
+
if (type === "array")
|
|
58
|
+
return Array.isArray(value);
|
|
59
|
+
if (type === "object")
|
|
60
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
61
|
+
if (type === "string")
|
|
62
|
+
return typeof value === "string";
|
|
63
|
+
if (type === "number")
|
|
64
|
+
return typeof value === "number" && !Number.isNaN(value);
|
|
65
|
+
if (type === "integer")
|
|
66
|
+
return Number.isInteger(value);
|
|
67
|
+
if (type === "boolean")
|
|
68
|
+
return typeof value === "boolean";
|
|
69
|
+
if (type === "null")
|
|
70
|
+
return value === null;
|
|
71
|
+
// Unknown type name: nothing to enforce, so treat as a match (the validator
|
|
72
|
+
// must not reject a value against a keyword it does not model).
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
const EMPTY_DESCRIPTOR = {
|
|
76
|
+
isUnion: false,
|
|
77
|
+
singularType: null,
|
|
78
|
+
types: [],
|
|
79
|
+
enumValues: null,
|
|
80
|
+
object: null,
|
|
81
|
+
array: null,
|
|
82
|
+
oneOf: null,
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Sibling constraint keywords that make a `oneOf` node a MIXED schema rather
|
|
86
|
+
* than a clean tagged union (#1511). A clean discriminated union carries only
|
|
87
|
+
* the `oneOf` keyword (plus annotations like `description`/`title`); it never
|
|
88
|
+
* combines with a top-level `type`/`properties`/`required`/`additionalProperties`/
|
|
89
|
+
* `items`/`enum`. When any of these co-occur with `oneOf`, the validator's
|
|
90
|
+
* branch-select would early-return and skip those sibling constraints, silently
|
|
91
|
+
* loosening validation. So a mixed node is NOT treated as a clean tagged union.
|
|
92
|
+
*/
|
|
93
|
+
export const ONEOF_SIBLING_CONSTRAINT_KEYS = [
|
|
94
|
+
"type",
|
|
95
|
+
"properties",
|
|
96
|
+
"required",
|
|
97
|
+
"additionalProperties",
|
|
98
|
+
"items",
|
|
99
|
+
"enum",
|
|
100
|
+
];
|
|
101
|
+
function hasOneOfSiblingConstraints(schema) {
|
|
102
|
+
return ONEOF_SIBLING_CONSTRAINT_KEYS.some((k) => Object.prototype.hasOwnProperty.call(schema, k));
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* A discriminator tag must be a comparable scalar (string/number/boolean) so
|
|
106
|
+
* the validator's strict-`===` branch-select can match it against a JSON-parsed
|
|
107
|
+
* value (#1511). An object/array literal is structurally identical after a JSON
|
|
108
|
+
* round-trip but never the same reference, so it would always "match no case".
|
|
109
|
+
* Restricting the auto-detected discriminator to scalars keeps a non-scalar tag
|
|
110
|
+
* from being treated as a (never-matchable) discriminator.
|
|
111
|
+
*/
|
|
112
|
+
function isScalarDiscriminatorLiteral(value) {
|
|
113
|
+
return (typeof value === "string" ||
|
|
114
|
+
typeof value === "number" ||
|
|
115
|
+
typeof value === "boolean");
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Interpret a `oneOf`/`anyOf` node as a discriminated (tagged) union (#1511).
|
|
119
|
+
*
|
|
120
|
+
* The tagged-union interpretation is scoped to a clearly-intended tagged union:
|
|
121
|
+
* EVERY member must be `type: "object"`. Anything else (a mixed/scalar `oneOf`)
|
|
122
|
+
* returns `null` and is ignored downstream, exactly as before.
|
|
123
|
+
*
|
|
124
|
+
* Within that scope:
|
|
125
|
+
* - `anyOf` is not supported in v1 → `invalid` (codegen error suggests `oneOf`);
|
|
126
|
+
* - a `oneOf` with fewer than 2 members → `invalid`;
|
|
127
|
+
* - the discriminator is auto-detected: the single property present in EVERY
|
|
128
|
+
* member as a single-literal `enum` whose literal is a comparable scalar
|
|
129
|
+
* (string/number/boolean), with distinct literals across members (a
|
|
130
|
+
* non-scalar literal is not a candidate — see `isScalarDiscriminatorLiteral`);
|
|
131
|
+
* - zero or more-than-one candidate discriminator → `invalid` (ambiguity).
|
|
132
|
+
*
|
|
133
|
+
* Pure and dependency-free so the CLI can vendor a byte-for-byte copy.
|
|
134
|
+
*/
|
|
135
|
+
function describeOneOf(schema) {
|
|
136
|
+
const rawOneOf = Array.isArray(schema.oneOf) ? schema.oneOf : null;
|
|
137
|
+
const rawAnyOf = Array.isArray(schema.anyOf) ? schema.anyOf : null;
|
|
138
|
+
// `oneOf` takes precedence; only one keyword is interpreted per node.
|
|
139
|
+
const keyword = rawOneOf
|
|
140
|
+
? "oneOf"
|
|
141
|
+
: rawAnyOf
|
|
142
|
+
? "anyOf"
|
|
143
|
+
: null;
|
|
144
|
+
const members = rawOneOf ?? rawAnyOf;
|
|
145
|
+
if (!keyword || !members)
|
|
146
|
+
return null;
|
|
147
|
+
// Scope to a clearly-intended tagged union: every member is `type: "object"`.
|
|
148
|
+
// A member that is not a plain object type means this is NOT a tagged union;
|
|
149
|
+
// leave it to the existing ignore-and-render-`unknown` path (backward compat).
|
|
150
|
+
const allObjects = members.length >= 1 &&
|
|
151
|
+
members.every((m) => !!m &&
|
|
152
|
+
typeof m === "object" &&
|
|
153
|
+
!Array.isArray(m) &&
|
|
154
|
+
m.type === "object");
|
|
155
|
+
if (!allObjects)
|
|
156
|
+
return null;
|
|
157
|
+
// `anyOf` is not supported in v1 (resolved Fork 1 = oneOf only). An all-object
|
|
158
|
+
// `anyOf` that looks like a tagged union gets a clear error suggesting oneOf.
|
|
159
|
+
if (keyword === "anyOf") {
|
|
160
|
+
return {
|
|
161
|
+
kind: "invalid",
|
|
162
|
+
reason: "anyOf is not supported for discriminated unions (issue #1511). Use oneOf instead.",
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
if (members.length < 2) {
|
|
166
|
+
return {
|
|
167
|
+
kind: "invalid",
|
|
168
|
+
reason: "A discriminated-union oneOf needs at least 2 object members (issue #1511).",
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
// For each member, collect its single-literal-enum properties → { name: literal }.
|
|
172
|
+
// The literal must be a comparable scalar (string/number/boolean): the
|
|
173
|
+
// validator branch-selects with strict `===`, so a non-scalar tag (object or
|
|
174
|
+
// array) on a JSON-parsed value is never the same reference as the schema
|
|
175
|
+
// literal and would always "match no case". Restricting the auto-detected
|
|
176
|
+
// discriminator to scalars means a non-scalar tag is not a candidate, so the
|
|
177
|
+
// union routes through the normal not-a-tagged-union path (below) instead of
|
|
178
|
+
// being accepted as a union that can never validate.
|
|
179
|
+
const memberLiteralProps = members.map((m) => {
|
|
180
|
+
const map = new Map();
|
|
181
|
+
const props = m.properties;
|
|
182
|
+
if (props && typeof props === "object" && !Array.isArray(props)) {
|
|
183
|
+
for (const [name, sub] of Object.entries(props)) {
|
|
184
|
+
if (sub &&
|
|
185
|
+
typeof sub === "object" &&
|
|
186
|
+
Array.isArray(sub.enum) &&
|
|
187
|
+
sub.enum.length === 1 &&
|
|
188
|
+
isScalarDiscriminatorLiteral(sub.enum[0])) {
|
|
189
|
+
map.set(name, sub.enum[0]);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return map;
|
|
194
|
+
});
|
|
195
|
+
// A candidate discriminator is present as a single-literal enum in EVERY
|
|
196
|
+
// member, with distinct literals across members (so a value's tag selects
|
|
197
|
+
// exactly one branch).
|
|
198
|
+
const candidates = [];
|
|
199
|
+
for (const name of memberLiteralProps[0].keys()) {
|
|
200
|
+
if (!memberLiteralProps.every((mp) => mp.has(name)))
|
|
201
|
+
continue;
|
|
202
|
+
const literals = memberLiteralProps.map((mp) => mp.get(name));
|
|
203
|
+
const distinct = new Set(literals.map((l) => JSON.stringify(l)));
|
|
204
|
+
if (distinct.size === literals.length)
|
|
205
|
+
candidates.push(name);
|
|
206
|
+
}
|
|
207
|
+
if (candidates.length !== 1) {
|
|
208
|
+
return {
|
|
209
|
+
kind: "invalid",
|
|
210
|
+
reason: candidates.length === 0
|
|
211
|
+
? "No discriminator found for the oneOf tagged union (issue #1511): every member must share exactly one property declared as a distinct single-literal enum."
|
|
212
|
+
: `Ambiguous discriminator for the oneOf tagged union (issue #1511): multiple candidate properties (${candidates.join(", ")}). Exactly one is required.`,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
// A clean tagged union carries ONLY `oneOf`. If it co-occurs with sibling
|
|
216
|
+
// top-level constraints (`type`, `properties`, `required`,
|
|
217
|
+
// `additionalProperties`, `items`, `enum`), it is a MIXED schema, not a clean
|
|
218
|
+
// tagged union: the validator's branch-select would early-return and skip
|
|
219
|
+
// those siblings, loosening validation. Reject-mixed keeps all three
|
|
220
|
+
// consumers fail-closed — the validator falls through to the normal
|
|
221
|
+
// type/object gates (still enforcing the siblings, exactly as before #1511),
|
|
222
|
+
// codegen throws this `reason`, and the request guard flags `unsupported-oneof`.
|
|
223
|
+
if (hasOneOfSiblingConstraints(schema)) {
|
|
224
|
+
return {
|
|
225
|
+
kind: "invalid",
|
|
226
|
+
reason: "A discriminated-union oneOf must be the only top-level constraint (issue #1511): it cannot be combined with sibling type/properties/required/additionalProperties/items/enum. Move the shared constraints into each member instead.",
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
const discriminant = candidates[0];
|
|
230
|
+
return {
|
|
231
|
+
kind: "valid",
|
|
232
|
+
discriminant,
|
|
233
|
+
members: members.map((m, i) => ({
|
|
234
|
+
discriminantValue: memberLiteralProps[i].get(discriminant),
|
|
235
|
+
schema: m,
|
|
236
|
+
})),
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Interpret a parsed schema node. A non-object schema (null, array, scalar)
|
|
241
|
+
* enforces nothing → the empty descriptor.
|
|
242
|
+
*/
|
|
243
|
+
export function describeSchema(schema) {
|
|
244
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema)) {
|
|
245
|
+
return EMPTY_DESCRIPTOR;
|
|
246
|
+
}
|
|
247
|
+
const typeSpec = schema.type;
|
|
248
|
+
const isUnion = Array.isArray(typeSpec);
|
|
249
|
+
const singularType = typeof typeSpec === "string" ? typeSpec : null;
|
|
250
|
+
// Mirror the validator's normalization exactly: an array stays an array; a
|
|
251
|
+
// truthy non-array becomes `[typeSpec]`; anything falsy is `[]`.
|
|
252
|
+
const types = isUnion ? typeSpec : typeSpec ? [typeSpec] : [];
|
|
253
|
+
const enumValues = Array.isArray(schema.enum)
|
|
254
|
+
? schema.enum
|
|
255
|
+
: null;
|
|
256
|
+
const props = schema.properties;
|
|
257
|
+
const object = singularType === "object" &&
|
|
258
|
+
props &&
|
|
259
|
+
typeof props === "object" &&
|
|
260
|
+
!Array.isArray(props)
|
|
261
|
+
? {
|
|
262
|
+
properties: props,
|
|
263
|
+
required: Array.isArray(schema.required)
|
|
264
|
+
? schema.required
|
|
265
|
+
: [],
|
|
266
|
+
additionalPropertiesClosed: schema.additionalProperties === false,
|
|
267
|
+
}
|
|
268
|
+
: null;
|
|
269
|
+
const array = singularType === "array" && schema.items
|
|
270
|
+
? { items: schema.items }
|
|
271
|
+
: null;
|
|
272
|
+
const oneOf = describeOneOf(schema);
|
|
273
|
+
return { isUnion, singularType, types, enumValues, object, array, oneOf };
|
|
274
|
+
}
|
|
275
|
+
const structural = (gemini, tightens, extractor) => ({ class: "enforced", level: "structural", gemini, tightens, extractor, render: "shape" });
|
|
276
|
+
const constraint = (gemini, tightens) => ({ class: "enforced", level: "constraint", gemini, tightens, extractor: false, render: "doc" });
|
|
277
|
+
const annotation = (routes, gemini, tightens = "never", extractor = false) => ({ class: "annotation", routes, gemini, tightens, extractor, render: "doc" });
|
|
278
|
+
const refused = (tightens, extractor = false) => ({
|
|
279
|
+
class: "refused",
|
|
280
|
+
gemini: "refuse",
|
|
281
|
+
tightens,
|
|
282
|
+
extractor,
|
|
283
|
+
render: "none",
|
|
284
|
+
});
|
|
285
|
+
/**
|
|
286
|
+
* Every JSON-Schema keyword a schema reader names, in exactly one class.
|
|
287
|
+
*
|
|
288
|
+
* Readers: the validator (`schema-validation.ts`, which enforces the
|
|
289
|
+
* `enforced` rows at the level its caller selects), the function push refusal
|
|
290
|
+
* list (the `refused` rows), the route keyword guard (the structural rows plus
|
|
291
|
+
* the `routes: true` annotations), the published-spec guard
|
|
292
|
+
* (`scripts/lib/spec-schemas.mjs`), the Gemini translator (the `gemini`
|
|
293
|
+
* column) and the CLI's TypeScript and Swift codegen (the `render` column).
|
|
294
|
+
* Look a keyword up with `Object.prototype.hasOwnProperty`, never by
|
|
295
|
+
* plain indexing: `constructor` is not a row.
|
|
296
|
+
*/
|
|
297
|
+
export const SCHEMA_KEYWORDS = Object.freeze({
|
|
298
|
+
// Enforced at both levels: the shape of a value.
|
|
299
|
+
type: structural("rule", "any", true),
|
|
300
|
+
enum: structural("rule", "remove", true),
|
|
301
|
+
properties: structural("rule", "remove", true),
|
|
302
|
+
required: structural("pass", "add", true),
|
|
303
|
+
items: structural("rule", "any", true),
|
|
304
|
+
additionalProperties: structural("rule", "close", false),
|
|
305
|
+
// The structural level enforces only an enum-tagged union; the full level
|
|
306
|
+
// enforces every shape.
|
|
307
|
+
oneOf: structural("rule", "any", true),
|
|
308
|
+
// Enforced at the full level: the bounds of a value. `const`, `anyOf` and
|
|
309
|
+
// `nullable` change what a value may be, so generated types render them as
|
|
310
|
+
// part of the type (#5544).
|
|
311
|
+
const: { ...constraint("rule", "set"), render: "shape" },
|
|
312
|
+
anyOf: { class: "enforced", level: "constraint", gemini: "rule", tightens: "any", extractor: true, render: "shape" },
|
|
313
|
+
nullable: { ...constraint("pass", "off"), render: "shape" },
|
|
314
|
+
minimum: constraint("pass", "raise"),
|
|
315
|
+
maximum: constraint("pass", "lower"),
|
|
316
|
+
exclusiveMinimum: constraint("refuse", "raise"),
|
|
317
|
+
exclusiveMaximum: constraint("refuse", "lower"),
|
|
318
|
+
multipleOf: constraint("refuse", "set"),
|
|
319
|
+
minLength: constraint("pass", "raise"),
|
|
320
|
+
maxLength: constraint("pass", "lower"),
|
|
321
|
+
pattern: constraint("pass", "set"),
|
|
322
|
+
minItems: constraint("pass", "raise"),
|
|
323
|
+
maxItems: constraint("pass", "lower"),
|
|
324
|
+
uniqueItems: constraint("refuse", "on"),
|
|
325
|
+
minProperties: constraint("pass", "raise"),
|
|
326
|
+
maxProperties: constraint("pass", "lower"),
|
|
327
|
+
// Annotations a `validateRequest` route schema may carry.
|
|
328
|
+
title: annotation(true, "pass"),
|
|
329
|
+
description: annotation(true, "pass"),
|
|
330
|
+
default: annotation(true, "pass"),
|
|
331
|
+
format: annotation(true, "rule", "any", true),
|
|
332
|
+
examples: annotation(true, "refuse"),
|
|
333
|
+
$comment: annotation(true, "drop"),
|
|
334
|
+
deprecated: annotation(true, "refuse"),
|
|
335
|
+
// Annotations a route schema may not carry: identifiers, references, and
|
|
336
|
+
// keys other passes read.
|
|
337
|
+
$schema: annotation(false, "drop"),
|
|
338
|
+
$id: annotation(false, "drop"),
|
|
339
|
+
example: annotation(false, "pass"),
|
|
340
|
+
propertyOrdering: annotation(false, "pass"),
|
|
341
|
+
readOnly: annotation(false, "refuse"),
|
|
342
|
+
writeOnly: annotation(false, "refuse"),
|
|
343
|
+
contentMediaType: annotation(false, "refuse"),
|
|
344
|
+
contentEncoding: annotation(false, "refuse"),
|
|
345
|
+
// Inert at run time: the validator never resolves a reference.
|
|
346
|
+
$ref: annotation(false, "refuse", "any", true),
|
|
347
|
+
// The shared-shapes ref keyword (`ref = "schemas.<file>.<Name>"`): resolved
|
|
348
|
+
// and inlined when a schema is written, so it reads as `$ref` does. The
|
|
349
|
+
// merge gate's extractor compares `$ref` and not `ref`, so only that column
|
|
350
|
+
// differs.
|
|
351
|
+
ref: annotation(false, "refuse", "any", false),
|
|
352
|
+
$defs: annotation(false, "refuse"),
|
|
353
|
+
definitions: annotation(false, "refuse"),
|
|
354
|
+
// Read by the function input coercion pass, never by the validator.
|
|
355
|
+
coerce: annotation(false, "refuse"),
|
|
356
|
+
// Refused at push: the validator would not enforce them.
|
|
357
|
+
$dynamicRef: refused("set"),
|
|
358
|
+
$recursiveRef: refused("set"),
|
|
359
|
+
allOf: refused("any", true),
|
|
360
|
+
not: refused("set"),
|
|
361
|
+
if: refused("set"),
|
|
362
|
+
then: refused("set"),
|
|
363
|
+
else: refused("set"),
|
|
364
|
+
patternProperties: refused("set"),
|
|
365
|
+
propertyNames: refused("set"),
|
|
366
|
+
dependencies: refused("set"),
|
|
367
|
+
dependentRequired: refused("set"),
|
|
368
|
+
dependentSchemas: refused("set"),
|
|
369
|
+
unevaluatedProperties: refused("set"),
|
|
370
|
+
contains: refused("set"),
|
|
371
|
+
minContains: refused("set"),
|
|
372
|
+
maxContains: refused("set"),
|
|
373
|
+
prefixItems: refused("set"),
|
|
374
|
+
additionalItems: refused("set"),
|
|
375
|
+
unevaluatedItems: refused("set"),
|
|
376
|
+
});
|
|
377
|
+
/**
|
|
378
|
+
* The validator callers that do not enforce the whole table, each selected by
|
|
379
|
+
* name at its call site. `validateRequest` routes stay at the structural level
|
|
380
|
+
* for good, because route request validation does not change.
|
|
381
|
+
*/
|
|
382
|
+
export const SCHEMA_LEVEL_EXCEPTIONS = Object.freeze({
|
|
383
|
+
validateRequest: Object.freeze({ level: "structural", until: "permanent" }),
|
|
384
|
+
});
|
|
385
|
+
function keywordsWhere(predicate) {
|
|
386
|
+
return Object.keys(SCHEMA_KEYWORDS).filter((keyword) => predicate(SCHEMA_KEYWORDS[keyword]));
|
|
387
|
+
}
|
|
388
|
+
const ENFORCED_BY_LEVEL = {
|
|
389
|
+
full: new Set(keywordsWhere((row) => row.class === "enforced")),
|
|
390
|
+
structural: new Set(keywordsWhere((row) => row.class === "enforced" && row.level === "structural")),
|
|
391
|
+
};
|
|
392
|
+
const REFUSED_KEYWORDS = Object.freeze(keywordsWhere((row) => row.class === "refused"));
|
|
393
|
+
const ROUTE_GUARD_KEYWORDS = {
|
|
394
|
+
enforced: ENFORCED_BY_LEVEL.structural,
|
|
395
|
+
annotations: new Set(keywordsWhere((row) => row.class === "annotation" && row.routes)),
|
|
396
|
+
};
|
|
397
|
+
/**
|
|
398
|
+
* How generated types render `keyword`: its row's `render`, and `doc` for a key
|
|
399
|
+
* that is not a row, because an unknown key is an annotation. Looked up as an
|
|
400
|
+
* own property, so `constructor` and `__proto__` are unknown keys.
|
|
401
|
+
*/
|
|
402
|
+
export function schemaKeywordRender(keyword) {
|
|
403
|
+
return Object.prototype.hasOwnProperty.call(SCHEMA_KEYWORDS, keyword)
|
|
404
|
+
? SCHEMA_KEYWORDS[keyword].render
|
|
405
|
+
: "doc";
|
|
406
|
+
}
|
|
407
|
+
/** The keywords the validator enforces at `level`. */
|
|
408
|
+
export function enforcedSchemaKeywords(level) {
|
|
409
|
+
return ENFORCED_BY_LEVEL[level];
|
|
410
|
+
}
|
|
411
|
+
/** The keywords the function push refuses, in table order. Always the same array. */
|
|
412
|
+
export function refusedSchemaKeywords() {
|
|
413
|
+
return REFUSED_KEYWORDS;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* What a `validateRequest` route schema may carry: the keywords its
|
|
417
|
+
* structural-level validation enforces, and the annotations named for routes.
|
|
418
|
+
*/
|
|
419
|
+
export function routeGuardSchemaKeywords() {
|
|
420
|
+
return ROUTE_GUARD_KEYWORDS;
|
|
421
|
+
}
|
|
422
|
+
//# sourceMappingURL=generated-schema-descriptor.js.map
|