@vertesia/common 1.5.0-dev.20260807.073259Z → 1.5.0-dev.20260901.005903Z
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/lib/access-control.d.ts +0 -14
- package/lib/access-control.d.ts.map +1 -1
- package/lib/access-control.js +0 -23
- package/lib/access-control.js.map +1 -1
- package/lib/account-values.d.ts +0 -10
- package/lib/account-values.d.ts.map +1 -1
- package/lib/account-values.js +0 -44
- package/lib/account-values.js.map +1 -1
- package/lib/api-contract/components.generated.json +40405 -0
- package/lib/api-contract/index.d.ts +186 -0
- package/lib/api-contract/index.d.ts.map +1 -0
- package/lib/api-contract/index.js +554 -0
- package/lib/api-contract/index.js.map +1 -0
- package/lib/api-schemas/agent-communication.d.ts +199 -0
- package/lib/api-schemas/agent-communication.d.ts.map +1 -0
- package/lib/api-schemas/agent-communication.js +150 -0
- package/lib/api-schemas/agent-communication.js.map +1 -0
- package/lib/api-schemas/agent-runs.d.ts +593 -0
- package/lib/api-schemas/agent-runs.d.ts.map +1 -1
- package/lib/api-schemas/agent-runs.js +44 -2
- package/lib/api-schemas/agent-runs.js.map +1 -1
- package/lib/api-schemas/app-lifecycle.d.ts +19 -0
- package/lib/api-schemas/app-lifecycle.d.ts.map +1 -1
- package/lib/api-schemas/app-lifecycle.js +34 -4
- package/lib/api-schemas/app-lifecycle.js.map +1 -1
- package/lib/api-schemas/app-runtime.d.ts +9871 -9257
- package/lib/api-schemas/app-runtime.d.ts.map +1 -1
- package/lib/api-schemas/app-runtime.js +7 -0
- package/lib/api-schemas/app-runtime.js.map +1 -1
- package/lib/api-schemas/apps.d.ts +1 -0
- package/lib/api-schemas/apps.d.ts.map +1 -1
- package/lib/api-schemas/apps.js +4 -3
- package/lib/api-schemas/apps.js.map +1 -1
- package/lib/api-schemas/content-query.d.ts +39 -0
- package/lib/api-schemas/content-query.d.ts.map +1 -0
- package/lib/api-schemas/content-query.js +30 -0
- package/lib/api-schemas/content-query.js.map +1 -0
- package/lib/api-schemas/content.d.ts +835 -29
- package/lib/api-schemas/content.d.ts.map +1 -1
- package/lib/api-schemas/content.js +82 -15
- package/lib/api-schemas/content.js.map +1 -1
- package/lib/api-schemas/dashboard.d.ts +4 -0
- package/lib/api-schemas/dashboard.d.ts.map +1 -1
- package/lib/api-schemas/dashboard.js +3 -0
- package/lib/api-schemas/dashboard.js.map +1 -1
- package/lib/api-schemas/document-processing.d.ts +333 -0
- package/lib/api-schemas/document-processing.d.ts.map +1 -1
- package/lib/api-schemas/events.d.ts +1007 -4
- package/lib/api-schemas/events.d.ts.map +1 -1
- package/lib/api-schemas/events.js +4 -1
- package/lib/api-schemas/events.js.map +1 -1
- package/lib/api-schemas/files.d.ts +17 -0
- package/lib/api-schemas/files.d.ts.map +1 -1
- package/lib/api-schemas/files.js +23 -0
- package/lib/api-schemas/files.js.map +1 -1
- package/lib/api-schemas/group.d.ts +7 -0
- package/lib/api-schemas/group.d.ts.map +1 -1
- package/lib/api-schemas/group.js +9 -0
- package/lib/api-schemas/group.js.map +1 -1
- package/lib/api-schemas/index.d.ts +4 -0
- package/lib/api-schemas/index.d.ts.map +1 -1
- package/lib/api-schemas/index.js +4 -0
- package/lib/api-schemas/index.js.map +1 -1
- package/lib/api-schemas/integrations.d.ts +19 -5
- package/lib/api-schemas/integrations.d.ts.map +1 -1
- package/lib/api-schemas/integrations.js +25 -2
- package/lib/api-schemas/integrations.js.map +1 -1
- package/lib/api-schemas/interaction.d.ts +8399 -1076
- package/lib/api-schemas/interaction.d.ts.map +1 -1
- package/lib/api-schemas/interaction.js +161 -9
- package/lib/api-schemas/interaction.js.map +1 -1
- package/lib/api-schemas/oauth-server.d.ts +131 -3
- package/lib/api-schemas/oauth-server.d.ts.map +1 -1
- package/lib/api-schemas/oauth-server.js +137 -3
- package/lib/api-schemas/oauth-server.js.map +1 -1
- package/lib/api-schemas/process.d.ts +1295 -0
- package/lib/api-schemas/process.d.ts.map +1 -1
- package/lib/api-schemas/process.js +318 -2
- package/lib/api-schemas/process.js.map +1 -1
- package/lib/api-schemas/project-configuration.d.ts +1118 -1
- package/lib/api-schemas/project-configuration.d.ts.map +1 -1
- package/lib/api-schemas/project-configuration.js +6 -2
- package/lib/api-schemas/project-configuration.js.map +1 -1
- package/lib/api-schemas/project.d.ts +1680 -6
- package/lib/api-schemas/project.d.ts.map +1 -1
- package/lib/api-schemas/registry.d.ts +87529 -69142
- package/lib/api-schemas/registry.d.ts.map +1 -1
- package/lib/api-schemas/registry.js +234 -413
- package/lib/api-schemas/registry.js.map +1 -1
- package/lib/api-schemas/schema-primitives.d.ts +4 -0
- package/lib/api-schemas/schema-primitives.d.ts.map +1 -1
- package/lib/api-schemas/schema-primitives.js +10 -0
- package/lib/api-schemas/schema-primitives.js.map +1 -1
- package/lib/api-schemas/store.d.ts +5596 -37
- package/lib/api-schemas/store.d.ts.map +1 -1
- package/lib/api-schemas/store.js +53 -8
- package/lib/api-schemas/store.js.map +1 -1
- package/lib/api-schemas/tools.d.ts +115 -0
- package/lib/api-schemas/tools.d.ts.map +1 -1
- package/lib/api-schemas/tools.js +55 -0
- package/lib/api-schemas/tools.js.map +1 -1
- package/lib/api-schemas/view-execution.d.ts +330 -854
- package/lib/api-schemas/view-execution.d.ts.map +1 -1
- package/lib/api-schemas/view-execution.js +26 -2
- package/lib/api-schemas/view-execution.js.map +1 -1
- package/lib/api-schemas/views.d.ts +452 -2562
- package/lib/api-schemas/views.d.ts.map +1 -1
- package/lib/api-schemas/views.js +119 -3
- package/lib/api-schemas/views.js.map +1 -1
- package/lib/api-schemas/workflow-runs.d.ts +344 -5
- package/lib/api-schemas/workflow-runs.d.ts.map +1 -1
- package/lib/api-schemas/workflow-runs.js +9 -7
- package/lib/api-schemas/workflow-runs.js.map +1 -1
- package/lib/apps.d.ts +8 -145
- package/lib/apps.d.ts.map +1 -1
- package/lib/apps.js +1 -54
- package/lib/apps.js.map +1 -1
- package/lib/ask-user.d.ts +2 -1
- package/lib/ask-user.d.ts.map +1 -1
- package/lib/audit-trail.d.ts +2 -2
- package/lib/audit-trail.d.ts.map +1 -1
- package/lib/audit-trail.js +2 -2
- package/lib/audit-trail.js.map +1 -1
- package/lib/browser-credentials.d.ts +2 -7
- package/lib/browser-credentials.d.ts.map +1 -1
- package/lib/common.d.ts +4 -1
- package/lib/common.d.ts.map +1 -1
- package/lib/content-query.d.ts +5 -0
- package/lib/content-query.d.ts.map +1 -0
- package/lib/content-query.js +2 -0
- package/lib/content-query.js.map +1 -0
- package/lib/data-platform.d.ts +4 -46
- package/lib/data-platform.d.ts.map +1 -1
- package/lib/data-platform.js.map +1 -1
- package/lib/email.d.ts +12 -18
- package/lib/email.d.ts.map +1 -1
- package/lib/email.js.map +1 -1
- package/lib/environment.d.ts +0 -10
- package/lib/environment.d.ts.map +1 -1
- package/lib/environment.js +1 -12
- package/lib/environment.js.map +1 -1
- package/lib/facets.d.ts +0 -4
- package/lib/facets.d.ts.map +1 -1
- package/lib/group.d.ts +2 -12
- package/lib/group.d.ts.map +1 -1
- package/lib/group.js.map +1 -1
- package/lib/index.d.ts +3 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -10
- package/lib/index.js.map +1 -1
- package/lib/integrations.d.ts +1 -27
- package/lib/integrations.d.ts.map +1 -1
- package/lib/integrations.js +0 -6
- package/lib/integrations.js.map +1 -1
- package/lib/interaction.d.ts +10 -222
- package/lib/interaction.d.ts.map +1 -1
- package/lib/interaction.js +0 -31
- package/lib/interaction.js.map +1 -1
- package/lib/meters.d.ts +5 -10
- package/lib/meters.d.ts.map +1 -1
- package/lib/meters.js +1 -9
- package/lib/meters.js.map +1 -1
- package/lib/oauth-scopes.d.ts +2 -16
- package/lib/oauth-scopes.d.ts.map +1 -1
- package/lib/oauth-scopes.js +9 -49
- package/lib/oauth-scopes.js.map +1 -1
- package/lib/oauth-server.d.ts +16 -195
- package/lib/oauth-server.d.ts.map +1 -1
- package/lib/payload.d.ts +2 -5
- package/lib/payload.d.ts.map +1 -1
- package/lib/pending-asks.d.ts +9 -41
- package/lib/pending-asks.d.ts.map +1 -1
- package/lib/platform-event.d.ts +4 -142
- package/lib/platform-event.d.ts.map +1 -1
- package/lib/platform-event.js.map +1 -1
- package/lib/project.d.ts +7 -46
- package/lib/project.d.ts.map +1 -1
- package/lib/project.js +2 -132
- package/lib/project.js.map +1 -1
- package/lib/prompt.d.ts +4 -7
- package/lib/prompt.d.ts.map +1 -1
- package/lib/prompt.js.map +1 -1
- package/lib/query.d.ts +0 -8
- package/lib/query.d.ts.map +1 -1
- package/lib/rate-limiter.d.ts +4 -3
- package/lib/rate-limiter.d.ts.map +1 -1
- package/lib/runs.d.ts +5 -1
- package/lib/runs.d.ts.map +1 -1
- package/lib/schema-for-extraction.d.ts +0 -1
- package/lib/schema-for-extraction.d.ts.map +1 -1
- package/lib/schema-for-extraction.js +1 -1
- package/lib/schema-for-extraction.js.map +1 -1
- package/lib/secrets.d.ts +2 -1
- package/lib/secrets.d.ts.map +1 -1
- package/lib/skill.d.ts +0 -13
- package/lib/skill.d.ts.map +1 -1
- package/lib/store/activity-catalog.d.ts +2 -0
- package/lib/store/activity-catalog.d.ts.map +1 -1
- package/lib/store/agent-approval.d.ts +0 -1
- package/lib/store/agent-approval.d.ts.map +1 -1
- package/lib/store/agent-approval.js +0 -3
- package/lib/store/agent-approval.js.map +1 -1
- package/lib/store/agent-run.d.ts +32 -69
- package/lib/store/agent-run.d.ts.map +1 -1
- package/lib/store/collections.d.ts +2 -6
- package/lib/store/collections.d.ts.map +1 -1
- package/lib/store/collections.js.map +1 -1
- package/lib/store/conversation-state.d.ts +11 -12
- package/lib/store/conversation-state.d.ts.map +1 -1
- package/lib/store/conversation-state.js +0 -18
- package/lib/store/conversation-state.js.map +1 -1
- package/lib/store/doc-analyzer.d.ts +0 -22
- package/lib/store/doc-analyzer.d.ts.map +1 -1
- package/lib/store/dsl-workflow.d.ts +22 -5
- package/lib/store/dsl-workflow.d.ts.map +1 -1
- package/lib/store/dsl-workflow.js.map +1 -1
- package/lib/store/grounded-extraction.d.ts +0 -14
- package/lib/store/grounded-extraction.d.ts.map +1 -1
- package/lib/store/grounded-extraction.js +1 -7
- package/lib/store/grounded-extraction.js.map +1 -1
- package/lib/store/index.d.ts +0 -5
- package/lib/store/index.d.ts.map +1 -1
- package/lib/store/index.js +0 -6
- package/lib/store/index.js.map +1 -1
- package/lib/store/intake-policy-schema.generated.d.ts.map +1 -1
- package/lib/store/intake-policy-schema.generated.js +279 -1
- package/lib/store/intake-policy-schema.generated.js.map +1 -1
- package/lib/store/process.d.ts +43 -1
- package/lib/store/process.d.ts.map +1 -1
- package/lib/store/process.js.map +1 -1
- package/lib/store/rendering.d.ts +3 -5
- package/lib/store/rendering.d.ts.map +1 -1
- package/lib/store/rendering.js +0 -4
- package/lib/store/rendering.js.map +1 -1
- package/lib/store/schedule.d.ts +0 -16
- package/lib/store/schedule.d.ts.map +1 -1
- package/lib/store/schedule.js.map +1 -1
- package/lib/store/signals.d.ts +12 -0
- package/lib/store/signals.d.ts.map +1 -1
- package/lib/store/store.d.ts +80 -94
- package/lib/store/store.d.ts.map +1 -1
- package/lib/store/store.js +5 -25
- package/lib/store/store.js.map +1 -1
- package/lib/store/workflow.d.ts +35 -86
- package/lib/store/workflow.d.ts.map +1 -1
- package/lib/store/workflow.js +0 -47
- package/lib/store/workflow.js.map +1 -1
- package/lib/sts-errors.d.ts +0 -1
- package/lib/sts-errors.d.ts.map +1 -1
- package/lib/sts-token-types.d.ts +2 -8
- package/lib/sts-token-types.d.ts.map +1 -1
- package/lib/sts-token-types.js +1 -19
- package/lib/sts-token-types.js.map +1 -1
- package/lib/tools.d.ts +6 -1
- package/lib/tools.d.ts.map +1 -1
- package/lib/transient-tokens.d.ts +0 -2
- package/lib/transient-tokens.d.ts.map +1 -1
- package/lib/user.d.ts +0 -17
- package/lib/user.d.ts.map +1 -1
- package/lib/user.js.map +1 -1
- package/lib/utils/schemas.d.ts +2 -24
- package/lib/utils/schemas.d.ts.map +1 -1
- package/lib/utils/schemas.js +0 -151
- package/lib/utils/schemas.js.map +1 -1
- package/lib/vertesia-common.js +3 -4
- package/lib/vertesia-common.js.map +1 -1
- package/lib/views.d.ts +23 -27
- package/lib/views.d.ts.map +1 -1
- package/lib/views.js +5 -26
- package/lib/views.js.map +1 -1
- package/lib/workflow-analytics.d.ts +12 -34
- package/lib/workflow-analytics.d.ts.map +1 -1
- package/package.json +12 -6
- package/src/access-control.ts +0 -26
- package/src/account-values.ts +0 -49
- package/src/agent-resources.test.ts +1 -12
- package/src/api-contract/components.contract.test.ts +99 -0
- package/src/api-contract/components.generated.json +40405 -0
- package/src/api-contract/index.ts +664 -0
- package/src/api-schemas/agent-communication.contract.test.ts +90 -0
- package/src/api-schemas/agent-communication.ts +169 -0
- package/src/api-schemas/agent-runs.ts +46 -1
- package/src/api-schemas/api-discriminators.test.ts +101 -0
- package/src/api-schemas/app-lifecycle.ts +39 -4
- package/src/api-schemas/app-runtime.ts +8 -0
- package/src/api-schemas/apps.ts +4 -3
- package/src/api-schemas/content-query.ts +31 -0
- package/src/api-schemas/content.ts +88 -15
- package/src/api-schemas/dashboard.contract.test.ts +16 -5
- package/src/api-schemas/dashboard.ts +3 -0
- package/src/api-schemas/events.ts +9 -1
- package/src/api-schemas/files.ts +27 -0
- package/src/api-schemas/group.ts +10 -0
- package/src/api-schemas/index.ts +4 -0
- package/src/api-schemas/integrations.ts +27 -2
- package/src/api-schemas/interaction.contract.test.ts +204 -1
- package/src/api-schemas/interaction.ts +176 -8
- package/src/api-schemas/llumiverse.contract.test.ts +33 -2
- package/src/api-schemas/oauth-server.ts +152 -3
- package/src/api-schemas/oauth.contract.test.ts +64 -1
- package/src/api-schemas/process.ts +352 -2
- package/src/api-schemas/project-configuration.ts +11 -7
- package/src/api-schemas/project.contract.test.ts +83 -6
- package/src/api-schemas/registry.ts +290 -457
- package/src/api-schemas/schema-primitives.ts +13 -0
- package/src/api-schemas/store.contract.test.ts +30 -1
- package/src/api-schemas/store.ts +58 -11
- package/src/api-schemas/tools.ts +62 -0
- package/src/api-schemas/view-execution.ts +28 -2
- package/src/api-schemas/views.contract.test.ts +119 -0
- package/src/api-schemas/views.ts +142 -3
- package/src/api-schemas/workflow-runs.ts +9 -7
- package/src/api-schemas/zeno-response-contracts.test.ts +344 -0
- package/src/apps.test.ts +2 -40
- package/src/apps.ts +14 -181
- package/src/ask-user.ts +1 -1
- package/src/audit-trail.ts +3 -3
- package/src/browser-credentials.ts +3 -7
- package/src/common.ts +13 -1
- package/src/content-query.ts +5 -0
- package/src/data-platform.ts +4 -51
- package/src/email.ts +24 -18
- package/src/environment.ts +1 -14
- package/src/facets.ts +0 -6
- package/src/group.ts +2 -12
- package/src/index.ts +3 -15
- package/src/integrations.ts +1 -52
- package/src/interaction.ts +12 -271
- package/src/meters.ts +10 -11
- package/src/oauth-scopes.test.ts +15 -0
- package/src/oauth-scopes.ts +10 -64
- package/src/oauth-server.ts +28 -215
- package/src/payload.ts +1 -6
- package/src/pending-asks.ts +17 -42
- package/src/platform-event.ts +3 -156
- package/src/project.ts +12 -160
- package/src/prompt.ts +9 -8
- package/src/query.ts +0 -9
- package/src/rate-limiter.ts +3 -3
- package/src/runs.ts +8 -0
- package/src/schema-for-extraction.ts +1 -1
- package/src/secrets.ts +3 -0
- package/src/skill.ts +0 -15
- package/src/store/activity-catalog.ts +3 -0
- package/src/store/agent-approval.ts +0 -4
- package/src/store/agent-run.ts +39 -93
- package/src/store/collections.ts +3 -6
- package/src/store/conversation-state.ts +12 -25
- package/src/store/doc-analyzer.ts +0 -26
- package/src/store/dsl-workflow.ts +28 -5
- package/src/store/grounded-extraction.ts +0 -18
- package/src/store/index.ts +0 -6
- package/src/store/intake-policy-schema.generated.ts +293 -1
- package/src/store/process.ts +84 -0
- package/src/store/rendering.ts +3 -8
- package/src/store/schedule.ts +0 -19
- package/src/store/signals.ts +14 -0
- package/src/store/store.ts +118 -127
- package/src/store/workflow.ts +32 -120
- package/src/sts-errors.ts +0 -2
- package/src/sts-token-types.ts +3 -28
- package/src/tools.ts +15 -0
- package/src/transient-tokens.ts +0 -2
- package/src/user.ts +0 -20
- package/src/utils/schemas.ts +2 -159
- package/src/views.ts +50 -47
- package/src/workflow-analytics.ts +12 -40
- package/tsconfig.dist.json +4 -1
- package/lib/Progress.d.ts +0 -22
- package/lib/Progress.d.ts.map +0 -1
- package/lib/Progress.js +0 -57
- package/lib/Progress.js.map +0 -1
- package/lib/agent-request-template.d.ts +0 -4
- package/lib/agent-request-template.d.ts.map +0 -1
- package/lib/agent-request-template.js +0 -46
- package/lib/agent-request-template.js.map +0 -1
- package/lib/channels.d.ts +0 -22
- package/lib/channels.d.ts.map +0 -1
- package/lib/channels.js +0 -57
- package/lib/channels.js.map +0 -1
- package/lib/host-utils.d.ts +0 -8
- package/lib/host-utils.d.ts.map +0 -1
- package/lib/host-utils.js +0 -84
- package/lib/host-utils.js.map +0 -1
- package/lib/platform-event-validation.d.ts +0 -45
- package/lib/platform-event-validation.d.ts.map +0 -1
- package/lib/platform-event-validation.js +0 -336
- package/lib/platform-event-validation.js.map +0 -1
- package/lib/store/hive-memory.d.ts +0 -117
- package/lib/store/hive-memory.d.ts.map +0 -1
- package/lib/store/hive-memory.js +0 -2
- package/lib/store/hive-memory.js.map +0 -1
- package/lib/store/object-types.d.ts +0 -24
- package/lib/store/object-types.d.ts.map +0 -1
- package/lib/store/object-types.js +0 -95
- package/lib/store/object-types.js.map +0 -1
- package/lib/store/process-schema.d.ts +0 -561
- package/lib/store/process-schema.d.ts.map +0 -1
- package/lib/store/process-schema.js +0 -561
- package/lib/store/process-schema.js.map +0 -1
- package/lib/store/process-validation.d.ts +0 -17
- package/lib/store/process-validation.d.ts.map +0 -1
- package/lib/store/process-validation.js +0 -515
- package/lib/store/process-validation.js.map +0 -1
- package/lib/store/temporalio.d.ts +0 -17
- package/lib/store/temporalio.d.ts.map +0 -1
- package/lib/store/temporalio.js +0 -41
- package/lib/store/temporalio.js.map +0 -1
- package/lib/view-configuration-validation.d.ts +0 -15
- package/lib/view-configuration-validation.d.ts.map +0 -1
- package/lib/view-configuration-validation.js +0 -63
- package/lib/view-configuration-validation.js.map +0 -1
- package/lib/view-query-validation.d.ts +0 -13
- package/lib/view-query-validation.d.ts.map +0 -1
- package/lib/view-query-validation.js +0 -266
- package/lib/view-query-validation.js.map +0 -1
- package/lib/view-validation-helpers.d.ts +0 -15
- package/lib/view-validation-helpers.d.ts.map +0 -1
- package/lib/view-validation-helpers.js +0 -25
- package/lib/view-validation-helpers.js.map +0 -1
- package/lib/views-schema.d.ts +0 -1992
- package/lib/views-schema.d.ts.map +0 -1
- package/lib/views-schema.js +0 -674
- package/lib/views-schema.js.map +0 -1
- package/lib/views-validation.d.ts +0 -21
- package/lib/views-validation.d.ts.map +0 -1
- package/lib/views-validation.js +0 -164
- package/lib/views-validation.js.map +0 -1
- package/src/Progress.ts +0 -59
- package/src/agent-request-template.test.ts +0 -40
- package/src/agent-request-template.ts +0 -45
- package/src/channels.ts +0 -70
- package/src/host-utils.test.ts +0 -61
- package/src/host-utils.ts +0 -93
- package/src/platform-event-validation.test.ts +0 -251
- package/src/platform-event-validation.ts +0 -372
- package/src/project.test.ts +0 -44
- package/src/store/hive-memory.ts +0 -167
- package/src/store/object-types.ts +0 -123
- package/src/store/process-schema.test.ts +0 -149
- package/src/store/process-schema.ts +0 -564
- package/src/store/process-validation.test.ts +0 -635
- package/src/store/process-validation.ts +0 -646
- package/src/store/temporalio.ts +0 -54
- package/src/view-configuration-validation.ts +0 -74
- package/src/view-query-validation.test.ts +0 -21
- package/src/view-query-validation.ts +0 -319
- package/src/view-validation-helpers.ts +0 -28
- package/src/views-schema.test.ts +0 -372
- package/src/views-schema.ts +0 -689
- package/src/views-validation.ts +0 -234
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { type JsonObject } from '../api-schemas/adapter.js';
|
|
2
|
+
import { type ApiParameterLocation, type NormalizedApiParameters, type RawApiParameters } from '../api-schemas/parameters.js';
|
|
3
|
+
import type { ApiComponentName, ApiComponentType } from '../api-schemas/registry.js';
|
|
4
|
+
/**
|
|
5
|
+
* The canonical `components.schemas` for all documented endpoints.
|
|
6
|
+
*
|
|
7
|
+
* This exact object is what the OpenAPI spec publishes AND what AJV compiles, so the published
|
|
8
|
+
* contract and the enforced contract cannot diverge. It is the prebuilt emission of the Zod
|
|
9
|
+
* registry rather than a live conversion of it — see the module comment.
|
|
10
|
+
*
|
|
11
|
+
* Widened on import on purpose: `resolveJsonModule` would otherwise infer the literal type of a
|
|
12
|
+
* 1187-key document and bake it into this package's `.d.ts`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ApiSchemaComponents: Readonly<Record<string, JsonObject>>;
|
|
15
|
+
export type { ApiComponentName, ApiComponentType, ApiParameterLocation, NormalizedApiParameters, RawApiParameters };
|
|
16
|
+
/**
|
|
17
|
+
* A canonical component as a SELF-CONTAINED JSON Schema, for consumers that compile it directly.
|
|
18
|
+
*
|
|
19
|
+
* `components` defaults to the generated artifact, which is what a server wants. A GENERATOR must
|
|
20
|
+
* pass `buildApiSchemaComponents()` instead: the artifact on disk is the previous run's output, so
|
|
21
|
+
* bundling from it would emit an artifact derived from the last contract rather than the current Zod
|
|
22
|
+
* schemas — and, run in the wrong order, would leave the two generated files describing different
|
|
23
|
+
* shapes. Passing the fresh emission makes each generator independent of the others' ordering.
|
|
24
|
+
*
|
|
25
|
+
* The published component `$ref`s its neighbours through `#/components/schemas/...`, which resolves
|
|
26
|
+
* only inside the OpenAPI document. AJV and the Monaco editor need a document they can compile on
|
|
27
|
+
* its own, so the transitive closure is inlined under `$defs` and the pointers rewritten. Nothing
|
|
28
|
+
* about the shapes changes — this is a re-rooting of the same objects, plus the removal of the
|
|
29
|
+
* OpenAPI-only discriminator keywords described below, which is what lets a generated artifact be
|
|
30
|
+
* compared with the component it came from.
|
|
31
|
+
*/
|
|
32
|
+
export declare function bundleCanonicalComponent(name: ApiComponentName, components?: Readonly<Record<string, JsonObject>>): JsonObject;
|
|
33
|
+
/** The `$ref` pointer for a component, in the same spelling the spec publishes. */
|
|
34
|
+
export declare function apiComponentRef(name: ApiComponentName): string;
|
|
35
|
+
/**
|
|
36
|
+
* One validation failure, with the undeclared property names kept AS NAMES.
|
|
37
|
+
*
|
|
38
|
+
* The structure exists because the rendered line cannot be taken apart again. Property names are
|
|
39
|
+
* arbitrary JSON strings: `{"customer secret token": 1}` and `{"a, b": 1}` are both valid, so
|
|
40
|
+
* neither a space nor a comma is a reliable separator once the names have been joined. Any consumer
|
|
41
|
+
* that needs to shorten the list — the HTTP boundary does, the log does not — has to do it here,
|
|
42
|
+
* on the array, where a name can be dropped whole.
|
|
43
|
+
*/
|
|
44
|
+
export interface ApiValidationIssue {
|
|
45
|
+
/**
|
|
46
|
+
* AJV's `instancePath` for the failing value, with `'/'` substituted for the root.
|
|
47
|
+
*
|
|
48
|
+
* Not quite a JSON Pointer: the pointer for a document root is the empty string, which reads as
|
|
49
|
+
* a missing path in a message. `'/'` is a display sentinel, so treat this as human-facing rather
|
|
50
|
+
* than as something to resolve against the payload.
|
|
51
|
+
*/
|
|
52
|
+
path: string;
|
|
53
|
+
/** AJV's own message, e.g. `must NOT have additional properties`. */
|
|
54
|
+
message: string;
|
|
55
|
+
/** Undeclared property names at {@link path}, in the order AJV reported them. */
|
|
56
|
+
undeclared?: string[];
|
|
57
|
+
/**
|
|
58
|
+
* The union candidate this issue is a claim ABOUT, when it is not a fact about the value.
|
|
59
|
+
*
|
|
60
|
+
* Set on every issue produced by expanding a failed untagged `oneOf`/`anyOf` — see
|
|
61
|
+
* {@link collectIssues}. Under such a union each candidate rejects the value for its own
|
|
62
|
+
* reasons, most of which are irrelevant to the shape the value actually meant, so an issue
|
|
63
|
+
* carrying a component must be read as "as a `<component>`, this is wrong" and never as
|
|
64
|
+
* "this is wrong".
|
|
65
|
+
*
|
|
66
|
+
* Absent means the opposite and stronger thing: the issue holds against the component the
|
|
67
|
+
* payload is being validated as, whatever candidate it turns out to be.
|
|
68
|
+
*/
|
|
69
|
+
component?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The complete rendering of one issue — every name, no budget.
|
|
73
|
+
*
|
|
74
|
+
* This is what gets logged. A caller-facing message renders from {@link ApiValidationIssue} itself
|
|
75
|
+
* with a length limit rather than shortening this string; see `reportableErrors` in the enforcer.
|
|
76
|
+
*/
|
|
77
|
+
export declare function renderApiValidationIssue(issue: ApiValidationIssue): string;
|
|
78
|
+
/**
|
|
79
|
+
* Everything in a rendered issue except the property names: `<path> [as <component>]: <message>`.
|
|
80
|
+
*
|
|
81
|
+
* Exported because it is not the only renderer. A caller that has to bound the length of a message
|
|
82
|
+
* cannot use {@link renderApiValidationIssue} — it emits every name — and has to rebuild the line
|
|
83
|
+
* from {@link ApiValidationIssue} with its own budget for the names. Rebuilding the HEAD too is what
|
|
84
|
+
* lets the two drift: when `component` was added, the bounded renderer at the HTTP boundary went on
|
|
85
|
+
* concatenating path and message and silently dropped it, so callers were told
|
|
86
|
+
* `must NOT have additional properties: to, when` with no sign it was one candidate's claim. There is
|
|
87
|
+
* one definition of the head so that cannot happen again.
|
|
88
|
+
*/
|
|
89
|
+
export declare function renderApiValidationIssueHead(issue: ApiValidationIssue): string;
|
|
90
|
+
export type ValidateApiPayloadResult<T> = {
|
|
91
|
+
valid: true;
|
|
92
|
+
data: T;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* `errors` is the rendered form, complete and ready to log; `issues` is the same failures with
|
|
96
|
+
* the property names still separable. Shorten from `issues`, never from `errors`.
|
|
97
|
+
*/
|
|
98
|
+
| {
|
|
99
|
+
valid: false;
|
|
100
|
+
errors: string[];
|
|
101
|
+
issues: ApiValidationIssue[];
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Validates an untyped request body against the component the endpoint publishes.
|
|
105
|
+
*
|
|
106
|
+
* Non-mutating by design. AJV's removal modes are never used here: the server would then accept a
|
|
107
|
+
* body the published schema declares invalid, silently disagreeing with its own spec — and
|
|
108
|
+
* `removeAdditional: 'all'` additionally empties freeform maps. An undeclared property is reported,
|
|
109
|
+
* not deleted.
|
|
110
|
+
*
|
|
111
|
+
* The component type is handed back only on the `valid` branch, so a body missing required fields
|
|
112
|
+
* cannot be typed as complete. What the caller does with a failure — reject, or log and continue —
|
|
113
|
+
* is the endpoint's policy, not this function's.
|
|
114
|
+
*/
|
|
115
|
+
export declare function validateApiRequest<N extends ApiComponentName>(name: N, value: unknown): ValidateApiPayloadResult<ApiComponentType<N>>;
|
|
116
|
+
/**
|
|
117
|
+
* Validates an already-mapped response against the component it is published as.
|
|
118
|
+
*
|
|
119
|
+
* Separate from {@link pruneAndValidateApiResponse} because a resource mapper has already produced
|
|
120
|
+
* the wire shape: there is nothing to prune, and pruning would only mask a mapper bug. Use this at
|
|
121
|
+
* the response boundary to detect drift between what the mapper builds and what the spec promises.
|
|
122
|
+
*/
|
|
123
|
+
export declare function validateApiResponse<N extends ApiComponentName>(name: N, value: unknown): ValidateApiPayloadResult<ApiComponentType<N>>;
|
|
124
|
+
/**
|
|
125
|
+
* Best-effort normalization of a response payload towards the fields its published component
|
|
126
|
+
* declares. Use this on the response path INSTEAD of an AJV removal mode, which would empty
|
|
127
|
+
* freeform maps such as `Account.feature_flags`.
|
|
128
|
+
*
|
|
129
|
+
* NOT a secret-removal boundary. Ambiguous schema shapes pass values through untouched — see
|
|
130
|
+
* {@link pruneToSchema} and check a component with {@link findUnprunablePaths} before treating its
|
|
131
|
+
* output as closed. Fields that must never ship still need an explicit response mapper.
|
|
132
|
+
*
|
|
133
|
+
* Never throws and never rejects: an undocumented field is server-side drift, and failing the
|
|
134
|
+
* response would punish the caller for it.
|
|
135
|
+
*
|
|
136
|
+
* Takes a value the caller has already typed as the component. Pruning only REMOVES undeclared
|
|
137
|
+
* extras, so a conforming input yields a conforming output and the return type is honest. It does
|
|
138
|
+
* NOT validate, which is why it cannot accept `unknown` — narrowing a payload that is missing
|
|
139
|
+
* required fields would hand TypeScript a complete `Account` that does not exist at runtime. Use
|
|
140
|
+
* {@link pruneAndValidateApiResponse} when the payload's shape is not already established.
|
|
141
|
+
*
|
|
142
|
+
* Request validation stays separate and non-mutating — pruning a request would make the server
|
|
143
|
+
* silently disagree with the permissive schema it publishes.
|
|
144
|
+
*/
|
|
145
|
+
export declare function pruneApiResponse<N extends ApiComponentName>(name: N, value: ApiComponentType<N>): ApiComponentType<N>;
|
|
146
|
+
export type PruneAndValidateResult<T> = {
|
|
147
|
+
valid: true;
|
|
148
|
+
data: T;
|
|
149
|
+
} | {
|
|
150
|
+
valid: false;
|
|
151
|
+
data: unknown;
|
|
152
|
+
errors: string[];
|
|
153
|
+
issues: ApiValidationIssue[];
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Prunes an untyped payload and validates the result against the published component.
|
|
157
|
+
*
|
|
158
|
+
* The only sound entry point for a payload of unknown shape: the component type is handed back
|
|
159
|
+
* exclusively on the `valid` branch, so a document missing required fields cannot be typed as
|
|
160
|
+
* complete. On failure the pruned value is still returned — the caller decides whether to ship it
|
|
161
|
+
* and log, or fail — which keeps the "never turn drift into a 500" property a policy choice rather
|
|
162
|
+
* than something baked in here.
|
|
163
|
+
*
|
|
164
|
+
*/
|
|
165
|
+
export declare function pruneAndValidateApiResponse<N extends ApiComponentName>(name: N, value: unknown): PruneAndValidateResult<ApiComponentType<N>>;
|
|
166
|
+
/**
|
|
167
|
+
* Paths inside a component where pruning cannot narrow. Empty means no STRUCTURAL gaps for
|
|
168
|
+
* schema-conforming input — see {@link findUnprunablePaths} for why that is weaker than "nothing
|
|
169
|
+
* can escape". Anything listed needs an explicit response mapper.
|
|
170
|
+
*/
|
|
171
|
+
export declare function findUnprunableApiPaths(name: ApiComponentName): string[];
|
|
172
|
+
/**
|
|
173
|
+
* Normalizes raw query or header text into the value a component describes.
|
|
174
|
+
*
|
|
175
|
+
* Binds {@link normalizeParameters} to {@link ApiSchemaComponents} — the same objects the OpenAPI
|
|
176
|
+
* document publishes and {@link validateApiRequest} compiles. That is what keeps the published
|
|
177
|
+
* parameter and the enforced one the same declaration: the scanner expands this component's
|
|
178
|
+
* properties into `in: query` parameters, and the coercion below is decided by those same property
|
|
179
|
+
* schemas, so neither can be changed without changing the other.
|
|
180
|
+
*
|
|
181
|
+
* Validate the result with {@link validateApiRequest}, which is non-coercing: everything type-related
|
|
182
|
+
* has already happened here, so a value this could not coerce is reported against the published
|
|
183
|
+
* schema rather than by a second rule.
|
|
184
|
+
*/
|
|
185
|
+
export declare function normalizeApiParameters(name: ApiComponentName, raw: RawApiParameters, location: ApiParameterLocation): NormalizedApiParameters;
|
|
186
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-contract/index.ts"],"names":[],"mappings":"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"}
|