@vertesia/common 1.5.0-dev.20260722.120446Z → 1.5.0-dev.20260804.124748Z
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-values.d.ts +98 -0
- package/lib/access-control-values.d.ts.map +1 -0
- package/lib/access-control-values.js +101 -0
- package/lib/access-control-values.js.map +1 -0
- package/lib/access-control.d.ts +22 -119
- package/lib/access-control.d.ts.map +1 -1
- package/lib/access-control.js +6 -78
- package/lib/access-control.js.map +1 -1
- package/lib/account-values.d.ts +53 -0
- package/lib/account-values.d.ts.map +1 -0
- package/lib/account-values.js +91 -0
- package/lib/account-values.js.map +1 -0
- package/lib/analytics.d.ts +12 -38
- package/lib/analytics.d.ts.map +1 -1
- package/lib/api-schemas/access-control.d.ts +215 -0
- package/lib/api-schemas/access-control.d.ts.map +1 -0
- package/lib/api-schemas/access-control.js +165 -0
- package/lib/api-schemas/access-control.js.map +1 -0
- package/lib/api-schemas/account.d.ts +101 -0
- package/lib/api-schemas/account.d.ts.map +1 -0
- package/lib/api-schemas/account.js +136 -0
- package/lib/api-schemas/account.js.map +1 -0
- package/lib/api-schemas/adapter.d.ts +80 -0
- package/lib/api-schemas/adapter.d.ts.map +1 -0
- package/lib/api-schemas/adapter.js +726 -0
- package/lib/api-schemas/adapter.js.map +1 -0
- package/lib/api-schemas/agent-runs.d.ts +3781 -0
- package/lib/api-schemas/agent-runs.d.ts.map +1 -0
- package/lib/api-schemas/agent-runs.js +991 -0
- package/lib/api-schemas/agent-runs.js.map +1 -0
- package/lib/api-schemas/analytics.d.ts +86 -0
- package/lib/api-schemas/analytics.d.ts.map +1 -0
- package/lib/api-schemas/analytics.js +58 -0
- package/lib/api-schemas/analytics.js.map +1 -0
- package/lib/api-schemas/apikey.d.ts +231 -0
- package/lib/api-schemas/apikey.d.ts.map +1 -0
- package/lib/api-schemas/apikey.js +172 -0
- package/lib/api-schemas/apikey.js.map +1 -0
- package/lib/api-schemas/app-lifecycle.d.ts +1114 -0
- package/lib/api-schemas/app-lifecycle.d.ts.map +1 -0
- package/lib/api-schemas/app-lifecycle.js +750 -0
- package/lib/api-schemas/app-lifecycle.js.map +1 -0
- package/lib/api-schemas/app-runtime.d.ts +9056 -0
- package/lib/api-schemas/app-runtime.d.ts.map +1 -0
- package/lib/api-schemas/app-runtime.js +782 -0
- package/lib/api-schemas/app-runtime.js.map +1 -0
- package/lib/api-schemas/apps.d.ts +247 -0
- package/lib/api-schemas/apps.d.ts.map +1 -0
- package/lib/api-schemas/apps.js +366 -0
- package/lib/api-schemas/apps.js.map +1 -0
- package/lib/api-schemas/audit-trail.d.ts +465 -0
- package/lib/api-schemas/audit-trail.d.ts.map +1 -0
- package/lib/api-schemas/audit-trail.js +218 -0
- package/lib/api-schemas/audit-trail.js.map +1 -0
- package/lib/api-schemas/bulk-operation.d.ts +104 -0
- package/lib/api-schemas/bulk-operation.d.ts.map +1 -0
- package/lib/api-schemas/bulk-operation.js +66 -0
- package/lib/api-schemas/bulk-operation.js.map +1 -0
- package/lib/api-schemas/commands.d.ts +50 -0
- package/lib/api-schemas/commands.d.ts.map +1 -0
- package/lib/api-schemas/commands.js +58 -0
- package/lib/api-schemas/commands.js.map +1 -0
- package/lib/api-schemas/content.d.ts +3561 -0
- package/lib/api-schemas/content.d.ts.map +1 -0
- package/lib/api-schemas/content.js +842 -0
- package/lib/api-schemas/content.js.map +1 -0
- package/lib/api-schemas/cost-analytics.d.ts +300 -0
- package/lib/api-schemas/cost-analytics.d.ts.map +1 -0
- package/lib/api-schemas/cost-analytics.js +218 -0
- package/lib/api-schemas/cost-analytics.js.map +1 -0
- package/lib/api-schemas/dashboard.d.ts +408 -0
- package/lib/api-schemas/dashboard.d.ts.map +1 -0
- package/lib/api-schemas/dashboard.js +311 -0
- package/lib/api-schemas/dashboard.js.map +1 -0
- package/lib/api-schemas/data-store.d.ts +1650 -0
- package/lib/api-schemas/data-store.d.ts.map +1 -0
- package/lib/api-schemas/data-store.js +504 -0
- package/lib/api-schemas/data-store.js.map +1 -0
- package/lib/api-schemas/document-processing.d.ts +1501 -0
- package/lib/api-schemas/document-processing.d.ts.map +1 -0
- package/lib/api-schemas/document-processing.js +312 -0
- package/lib/api-schemas/document-processing.js.map +1 -0
- package/lib/api-schemas/embeddings.d.ts +184 -0
- package/lib/api-schemas/embeddings.d.ts.map +1 -0
- package/lib/api-schemas/embeddings.js +102 -0
- package/lib/api-schemas/embeddings.js.map +1 -0
- package/lib/api-schemas/environment.d.ts +412 -0
- package/lib/api-schemas/environment.d.ts.map +1 -0
- package/lib/api-schemas/environment.js +170 -0
- package/lib/api-schemas/environment.js.map +1 -0
- package/lib/api-schemas/events.d.ts +4880 -0
- package/lib/api-schemas/events.d.ts.map +1 -0
- package/lib/api-schemas/events.js +832 -0
- package/lib/api-schemas/events.js.map +1 -0
- package/lib/api-schemas/files.d.ts +107 -0
- package/lib/api-schemas/files.d.ts.map +1 -0
- package/lib/api-schemas/files.js +137 -0
- package/lib/api-schemas/files.js.map +1 -0
- package/lib/api-schemas/group.d.ts +122 -0
- package/lib/api-schemas/group.d.ts.map +1 -0
- package/lib/api-schemas/group.js +142 -0
- package/lib/api-schemas/group.js.map +1 -0
- package/lib/api-schemas/index.d.ts +36 -0
- package/lib/api-schemas/index.d.ts.map +1 -0
- package/lib/api-schemas/index.js +36 -0
- package/lib/api-schemas/index.js.map +1 -0
- package/lib/api-schemas/indexing.d.ts +144 -0
- package/lib/api-schemas/indexing.d.ts.map +1 -0
- package/lib/api-schemas/indexing.js +217 -0
- package/lib/api-schemas/indexing.js.map +1 -0
- package/lib/api-schemas/integrations.d.ts +269 -0
- package/lib/api-schemas/integrations.d.ts.map +1 -0
- package/lib/api-schemas/integrations.js +335 -0
- package/lib/api-schemas/integrations.js.map +1 -0
- package/lib/api-schemas/interaction.d.ts +22454 -0
- package/lib/api-schemas/interaction.d.ts.map +1 -0
- package/lib/api-schemas/interaction.js +2065 -0
- package/lib/api-schemas/interaction.js.map +1 -0
- package/lib/api-schemas/invites.d.ts +162 -0
- package/lib/api-schemas/invites.d.ts.map +1 -0
- package/lib/api-schemas/invites.js +106 -0
- package/lib/api-schemas/invites.js.map +1 -0
- package/lib/api-schemas/oauth-server.d.ts +415 -0
- package/lib/api-schemas/oauth-server.d.ts.map +1 -0
- package/lib/api-schemas/oauth-server.js +193 -0
- package/lib/api-schemas/oauth-server.js.map +1 -0
- package/lib/api-schemas/oauth.d.ts +150 -0
- package/lib/api-schemas/oauth.d.ts.map +1 -0
- package/lib/api-schemas/oauth.js +148 -0
- package/lib/api-schemas/oauth.js.map +1 -0
- package/lib/api-schemas/parameters.d.ts +64 -0
- package/lib/api-schemas/parameters.d.ts.map +1 -0
- package/lib/api-schemas/parameters.js +246 -0
- package/lib/api-schemas/parameters.js.map +1 -0
- package/lib/api-schemas/process.d.ts +499 -0
- package/lib/api-schemas/process.d.ts.map +1 -0
- package/lib/api-schemas/process.js +817 -0
- package/lib/api-schemas/process.js.map +1 -0
- package/lib/api-schemas/project-configuration.d.ts +4900 -0
- package/lib/api-schemas/project-configuration.d.ts.map +1 -0
- package/lib/api-schemas/project-configuration.js +425 -0
- package/lib/api-schemas/project-configuration.js.map +1 -0
- package/lib/api-schemas/project.d.ts +7247 -0
- package/lib/api-schemas/project.d.ts.map +1 -0
- package/lib/api-schemas/project.js +185 -0
- package/lib/api-schemas/project.js.map +1 -0
- package/lib/api-schemas/prompt.d.ts +70 -0
- package/lib/api-schemas/prompt.d.ts.map +1 -0
- package/lib/api-schemas/prompt.js +77 -0
- package/lib/api-schemas/prompt.js.map +1 -0
- package/lib/api-schemas/quota.d.ts +90 -0
- package/lib/api-schemas/quota.d.ts.map +1 -0
- package/lib/api-schemas/quota.js +95 -0
- package/lib/api-schemas/quota.js.map +1 -0
- package/lib/api-schemas/registry.d.ts +97458 -0
- package/lib/api-schemas/registry.d.ts.map +1 -0
- package/lib/api-schemas/registry.js +2586 -0
- package/lib/api-schemas/registry.js.map +1 -0
- package/lib/api-schemas/schema-primitives.d.ts +5 -0
- package/lib/api-schemas/schema-primitives.d.ts.map +1 -0
- package/lib/api-schemas/schema-primitives.js +11 -0
- package/lib/api-schemas/schema-primitives.js.map +1 -0
- package/lib/api-schemas/secrets.d.ts +497 -0
- package/lib/api-schemas/secrets.d.ts.map +1 -0
- package/lib/api-schemas/secrets.js +298 -0
- package/lib/api-schemas/secrets.js.map +1 -0
- package/lib/api-schemas/store.d.ts +22140 -0
- package/lib/api-schemas/store.d.ts.map +1 -0
- package/lib/api-schemas/store.js +557 -0
- package/lib/api-schemas/store.js.map +1 -0
- package/lib/api-schemas/sts.d.ts +156 -0
- package/lib/api-schemas/sts.d.ts.map +1 -0
- package/lib/api-schemas/sts.js +96 -0
- package/lib/api-schemas/sts.js.map +1 -0
- package/lib/api-schemas/task.d.ts +215 -0
- package/lib/api-schemas/task.d.ts.map +1 -0
- package/lib/api-schemas/task.js +95 -0
- package/lib/api-schemas/task.js.map +1 -0
- package/lib/api-schemas/tools.d.ts +111 -0
- package/lib/api-schemas/tools.d.ts.map +1 -0
- package/lib/api-schemas/tools.js +122 -0
- package/lib/api-schemas/tools.js.map +1 -0
- package/lib/api-schemas/user.d.ts +208 -0
- package/lib/api-schemas/user.d.ts.map +1 -0
- package/lib/api-schemas/user.js +180 -0
- package/lib/api-schemas/user.js.map +1 -0
- package/lib/api-schemas/view-execution.d.ts +3163 -0
- package/lib/api-schemas/view-execution.d.ts.map +1 -0
- package/lib/api-schemas/view-execution.js +172 -0
- package/lib/api-schemas/view-execution.js.map +1 -0
- package/lib/api-schemas/views.d.ts +5990 -0
- package/lib/api-schemas/views.d.ts.map +1 -0
- package/lib/api-schemas/views.js +396 -0
- package/lib/api-schemas/views.js.map +1 -0
- package/lib/api-schemas/workflow-runs.d.ts +2209 -0
- package/lib/api-schemas/workflow-runs.d.ts.map +1 -0
- package/lib/api-schemas/workflow-runs.js +589 -0
- package/lib/api-schemas/workflow-runs.js.map +1 -0
- package/lib/apikey-values.d.ts +10 -0
- package/lib/apikey-values.d.ts.map +1 -0
- package/lib/apikey-values.js +11 -0
- package/lib/apikey-values.js.map +1 -0
- package/lib/apikey.d.ts +37 -36
- package/lib/apikey.d.ts.map +1 -1
- package/lib/apikey.js +5 -4
- package/lib/apikey.js.map +1 -1
- package/lib/apps.d.ts +116 -1121
- package/lib/apps.d.ts.map +1 -1
- package/lib/apps.js.map +1 -1
- package/lib/ask-user.d.ts +8 -1
- package/lib/ask-user.d.ts.map +1 -1
- package/lib/audit-trail.d.ts +17 -128
- package/lib/audit-trail.d.ts.map +1 -1
- package/lib/audit-trail.js.map +1 -1
- package/lib/browser-credentials.d.ts +11 -106
- package/lib/browser-credentials.d.ts.map +1 -1
- package/lib/common.d.ts +59 -81
- package/lib/common.d.ts.map +1 -1
- package/lib/cost-analytics.d.ts +14 -167
- package/lib/cost-analytics.d.ts.map +1 -1
- package/lib/cost-analytics.js.map +1 -1
- package/lib/data-platform.d.ts +122 -786
- package/lib/data-platform.d.ts.map +1 -1
- package/lib/data-platform.js +41 -61
- package/lib/data-platform.js.map +1 -1
- package/lib/email.d.ts +5 -17
- package/lib/email.d.ts.map +1 -1
- package/lib/email.js +0 -3
- package/lib/email.js.map +1 -1
- package/lib/embeddings.d.ts +14 -56
- package/lib/embeddings.d.ts.map +1 -1
- package/lib/environment.d.ts +19 -113
- package/lib/environment.d.ts.map +1 -1
- package/lib/environment.js +3 -0
- package/lib/environment.js.map +1 -1
- package/lib/facets.d.ts +4 -7
- package/lib/facets.d.ts.map +1 -1
- package/lib/group.d.ts +33 -39
- package/lib/group.d.ts.map +1 -1
- package/lib/group.js +0 -1
- package/lib/group.js.map +1 -1
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/integrations.d.ts +20 -108
- package/lib/integrations.d.ts.map +1 -1
- package/lib/integrations.js.map +1 -1
- package/lib/interaction-values.d.ts +11 -0
- package/lib/interaction-values.d.ts.map +1 -0
- package/lib/interaction-values.js +24 -0
- package/lib/interaction-values.js.map +1 -0
- package/lib/interaction.d.ts +116 -734
- package/lib/interaction.d.ts.map +1 -1
- package/lib/interaction.js +56 -12
- package/lib/interaction.js.map +1 -1
- package/lib/meters.d.ts +11 -7
- package/lib/meters.d.ts.map +1 -1
- package/lib/meters.js.map +1 -1
- package/lib/oauth-server.d.ts +33 -119
- package/lib/oauth-server.d.ts.map +1 -1
- package/lib/oauth.d.ts +14 -96
- package/lib/oauth.d.ts.map +1 -1
- package/lib/oauth.js +0 -4
- package/lib/oauth.js.map +1 -1
- package/lib/payload.d.ts +15 -38
- package/lib/payload.d.ts.map +1 -1
- package/lib/platform-event.d.ts +49 -462
- package/lib/platform-event.d.ts.map +1 -1
- package/lib/platform-event.js.map +1 -1
- package/lib/principal-context.d.ts +10 -15
- package/lib/principal-context.d.ts.map +1 -1
- package/lib/project-values.d.ts +24 -0
- package/lib/project-values.d.ts.map +1 -0
- package/lib/project-values.js +42 -0
- package/lib/project-values.js.map +1 -0
- package/lib/project.d.ts +55 -503
- package/lib/project.d.ts.map +1 -1
- package/lib/project.js +6 -76
- package/lib/project.js.map +1 -1
- package/lib/prompt.d.ts +20 -51
- package/lib/prompt.d.ts.map +1 -1
- package/lib/prompt.js.map +1 -1
- package/lib/query.d.ts +27 -88
- package/lib/query.d.ts.map +1 -1
- package/lib/rate-limiter.d.ts +19 -70
- package/lib/rate-limiter.d.ts.map +1 -1
- package/lib/rate-limiter.js +0 -3
- package/lib/rate-limiter.js.map +1 -1
- package/lib/refs.d.ts +3 -11
- package/lib/refs.d.ts.map +1 -1
- package/lib/refs.js.map +1 -1
- package/lib/roles/types.d.ts +14 -20
- package/lib/roles/types.d.ts.map +1 -1
- package/lib/roles/types.js +5 -9
- package/lib/roles/types.js.map +1 -1
- package/lib/runs.d.ts +6 -25
- package/lib/runs.d.ts.map +1 -1
- package/lib/secrets.d.ts +20 -105
- package/lib/secrets.d.ts.map +1 -1
- package/lib/store/agent-approval.d.ts +5 -14
- package/lib/store/agent-approval.d.ts.map +1 -1
- package/lib/store/agent-approval.js.map +1 -1
- package/lib/store/agent-run.d.ts +63 -342
- package/lib/store/agent-run.d.ts.map +1 -1
- package/lib/store/collections.d.ts +11 -63
- package/lib/store/collections.d.ts.map +1 -1
- package/lib/store/collections.js.map +1 -1
- package/lib/store/conversation-state.d.ts +63 -61
- package/lib/store/conversation-state.d.ts.map +1 -1
- package/lib/store/conversation-state.js +2 -0
- package/lib/store/conversation-state.js.map +1 -1
- package/lib/store/doc-analyzer.d.ts +9 -32
- package/lib/store/doc-analyzer.d.ts.map +1 -1
- package/lib/store/dsl-workflow.d.ts +37 -151
- package/lib/store/dsl-workflow.d.ts.map +1 -1
- package/lib/store/dsl-workflow.js.map +1 -1
- package/lib/store/editing-policy-schema.generated.d.ts +3 -0
- package/lib/store/editing-policy-schema.generated.d.ts.map +1 -0
- package/lib/store/editing-policy-schema.generated.js +28 -0
- package/lib/store/editing-policy-schema.generated.js.map +1 -0
- package/lib/store/grounded-extraction.d.ts +7 -104
- package/lib/store/grounded-extraction.d.ts.map +1 -1
- package/lib/store/grounded-extraction.js.map +1 -1
- package/lib/store/index.d.ts +2 -0
- package/lib/store/index.d.ts.map +1 -1
- package/lib/store/index.js +3 -0
- package/lib/store/index.js.map +1 -1
- package/lib/store/intake-policy-schema.generated.d.ts +3 -0
- package/lib/store/intake-policy-schema.generated.d.ts.map +1 -0
- package/lib/store/intake-policy-schema.generated.js +1425 -0
- package/lib/store/intake-policy-schema.generated.js.map +1 -0
- package/lib/store/process-schema.d.ts +80 -0
- package/lib/store/process-schema.d.ts.map +1 -1
- package/lib/store/process-schema.js +79 -0
- package/lib/store/process-schema.js.map +1 -1
- package/lib/store/process-validation.d.ts.map +1 -1
- package/lib/store/process-validation.js +70 -2
- package/lib/store/process-validation.js.map +1 -1
- package/lib/store/process.d.ts +36 -125
- package/lib/store/process.d.ts.map +1 -1
- package/lib/store/process.js.map +1 -1
- package/lib/store/rendering.d.ts +9 -64
- package/lib/store/rendering.d.ts.map +1 -1
- package/lib/store/rendering.js.map +1 -1
- package/lib/store/store.d.ts +98 -693
- package/lib/store/store.d.ts.map +1 -1
- package/lib/store/store.js +4 -443
- package/lib/store/store.js.map +1 -1
- package/lib/store/task.d.ts +15 -59
- package/lib/store/task.d.ts.map +1 -1
- package/lib/store/task.js +0 -3
- package/lib/store/task.js.map +1 -1
- package/lib/store/workflow.d.ts +56 -516
- package/lib/store/workflow.d.ts.map +1 -1
- package/lib/store/workflow.js +28 -11
- package/lib/store/workflow.js.map +1 -1
- package/lib/sts-token-types.d.ts +12 -66
- package/lib/sts-token-types.d.ts.map +1 -1
- package/lib/sts-token-types.js.map +1 -1
- package/lib/tools.d.ts +8 -100
- package/lib/tools.d.ts.map +1 -1
- package/lib/transient-tokens-values.d.ts +11 -0
- package/lib/transient-tokens-values.d.ts.map +1 -0
- package/lib/transient-tokens-values.js +12 -0
- package/lib/transient-tokens-values.js.map +1 -0
- package/lib/transient-tokens.d.ts +15 -13
- package/lib/transient-tokens.d.ts.map +1 -1
- package/lib/transient-tokens.js +5 -5
- package/lib/transient-tokens.js.map +1 -1
- package/lib/user.d.ts +54 -155
- package/lib/user.d.ts.map +1 -1
- package/lib/user.js +1 -78
- package/lib/user.js.map +1 -1
- package/lib/versions.d.ts +24 -1
- package/lib/versions.d.ts.map +1 -1
- package/lib/versions.js +23 -0
- package/lib/versions.js.map +1 -1
- package/lib/vertesia-common.js +6 -2
- package/lib/vertesia-common.js.map +1 -1
- package/lib/views-schema.d.ts +4 -4
- package/lib/views.d.ts +56 -312
- package/lib/views.d.ts.map +1 -1
- package/lib/views.js.map +1 -1
- package/package.json +14 -5
- package/src/access-control-values.ts +113 -0
- package/src/access-control.ts +33 -138
- package/src/account-values.ts +95 -0
- package/src/agent-resources.test.ts +100 -0
- package/src/analytics.ts +18 -42
- package/src/api-schemas/access-control.contract.test.ts +209 -0
- package/src/api-schemas/access-control.ts +208 -0
- package/src/api-schemas/account.contract.test.ts +318 -0
- package/src/api-schemas/account.ts +150 -0
- package/src/api-schemas/adapter-edge-cases.test.ts +480 -0
- package/src/api-schemas/adapter.ts +778 -0
- package/src/api-schemas/agent-runs.ts +1081 -0
- package/src/api-schemas/analytics.ts +65 -0
- package/src/api-schemas/apikey.contract.test.ts +270 -0
- package/src/api-schemas/apikey.ts +199 -0
- package/src/api-schemas/app-lifecycle.ts +841 -0
- package/src/api-schemas/app-runtime.ts +919 -0
- package/src/api-schemas/apps.ts +415 -0
- package/src/api-schemas/audit-trail.ts +243 -0
- package/src/api-schemas/bulk-operation.contract.test.ts +39 -0
- package/src/api-schemas/bulk-operation.ts +75 -0
- package/src/api-schemas/bundle-isolation.test.ts +80 -0
- package/src/api-schemas/commands.contract.test.ts +51 -0
- package/src/api-schemas/commands.ts +62 -0
- package/src/api-schemas/content.ts +939 -0
- package/src/api-schemas/cost-analytics.contract.test.ts +64 -0
- package/src/api-schemas/cost-analytics.ts +235 -0
- package/src/api-schemas/dashboard.contract.test.ts +127 -0
- package/src/api-schemas/dashboard.ts +351 -0
- package/src/api-schemas/data-store.contract.test.ts +91 -0
- package/src/api-schemas/data-store.ts +571 -0
- package/src/api-schemas/document-processing.contract.test.ts +76 -0
- package/src/api-schemas/document-processing.ts +344 -0
- package/src/api-schemas/embeddings.ts +113 -0
- package/src/api-schemas/environment.contract.test.ts +184 -0
- package/src/api-schemas/environment.ts +190 -0
- package/src/api-schemas/events.ts +921 -0
- package/src/api-schemas/files.ts +159 -0
- package/src/api-schemas/group.contract.test.ts +205 -0
- package/src/api-schemas/group.ts +155 -0
- package/src/api-schemas/index.ts +35 -0
- package/src/api-schemas/indexing.contract.test.ts +83 -0
- package/src/api-schemas/indexing.ts +234 -0
- package/src/api-schemas/integrations.ts +369 -0
- package/src/api-schemas/interaction.ts +2357 -0
- package/src/api-schemas/invites.contract.test.ts +268 -0
- package/src/api-schemas/invites.ts +127 -0
- package/src/api-schemas/llumiverse.contract.test.ts +108 -0
- package/src/api-schemas/oauth-server.ts +219 -0
- package/src/api-schemas/oauth.contract.test.ts +118 -0
- package/src/api-schemas/oauth.ts +166 -0
- package/src/api-schemas/parameters.test.ts +402 -0
- package/src/api-schemas/parameters.ts +310 -0
- package/src/api-schemas/process.ts +929 -0
- package/src/api-schemas/project-configuration.ts +478 -0
- package/src/api-schemas/project.contract.test.ts +365 -0
- package/src/api-schemas/project.ts +214 -0
- package/src/api-schemas/prompt.ts +88 -0
- package/src/api-schemas/pruning-limits.test.ts +189 -0
- package/src/api-schemas/quota.contract.test.ts +147 -0
- package/src/api-schemas/quota.ts +122 -0
- package/src/api-schemas/registry-groups.test.ts +91 -0
- package/src/api-schemas/registry.ts +3487 -0
- package/src/api-schemas/response-pruning.test.ts +260 -0
- package/src/api-schemas/schema-primitives.ts +12 -0
- package/src/api-schemas/secrets.ts +332 -0
- package/src/api-schemas/store.contract.test.ts +450 -0
- package/src/api-schemas/store.ts +604 -0
- package/src/api-schemas/sts.contract.test.ts +80 -0
- package/src/api-schemas/sts.ts +110 -0
- package/src/api-schemas/task.ts +104 -0
- package/src/api-schemas/tools.ts +140 -0
- package/src/api-schemas/user.contract.test.ts +191 -0
- package/src/api-schemas/user.ts +204 -0
- package/src/api-schemas/view-execution.ts +200 -0
- package/src/api-schemas/views.ts +437 -0
- package/src/api-schemas/workflow-runs.ts +653 -0
- package/src/apikey-values.ts +10 -0
- package/src/apikey.ts +49 -40
- package/src/apps.ts +249 -1179
- package/src/ask-user.ts +9 -1
- package/src/audit-trail.ts +45 -137
- package/src/browser-credentials.ts +21 -106
- package/src/common.ts +67 -78
- package/src/cost-analytics.ts +37 -176
- package/src/data-platform.ts +205 -776
- package/src/email.ts +5 -17
- package/src/embeddings.ts +22 -60
- package/src/environment.ts +52 -124
- package/src/facets.ts +4 -7
- package/src/group.ts +38 -42
- package/src/index.ts +11 -0
- package/src/integrations.ts +39 -129
- package/src/interaction-values.ts +23 -0
- package/src/interaction.ts +231 -841
- package/src/meters.ts +11 -7
- package/src/oauth-server.ts +58 -127
- package/src/oauth.ts +24 -108
- package/src/payload.ts +25 -40
- package/src/platform-event.ts +98 -484
- package/src/principal-context.ts +11 -15
- package/src/project-values.ts +41 -0
- package/src/project.ts +116 -588
- package/src/prompt.ts +34 -61
- package/src/query.ts +34 -93
- package/src/rate-limiter.ts +27 -75
- package/src/refs.ts +4 -11
- package/src/roles/types.ts +20 -20
- package/src/runs.ts +11 -24
- package/src/secrets.ts +38 -117
- package/src/store/agent-approval.ts +9 -14
- package/src/store/agent-run.ts +106 -434
- package/src/store/collections.ts +21 -63
- package/src/store/content-type-editing.test.ts +17 -0
- package/src/store/conversation-state.ts +78 -64
- package/src/store/doc-analyzer.ts +17 -33
- package/src/store/dsl-workflow.ts +62 -158
- package/src/store/editing-policy-schema.generated.ts +30 -0
- package/src/store/grounded-extraction.ts +13 -104
- package/src/store/index.ts +3 -0
- package/src/store/intake-policy-schema.generated.ts +1442 -0
- package/src/store/process-schema.test.ts +43 -0
- package/src/store/process-schema.ts +79 -0
- package/src/store/process-validation.test.ts +141 -0
- package/src/store/process-validation.ts +82 -2
- package/src/store/process.ts +70 -146
- package/src/store/rendering.ts +15 -64
- package/src/store/store.ts +197 -1182
- package/src/store/task.ts +25 -59
- package/src/store/workflow.ts +103 -554
- package/src/sts-token-types.ts +24 -75
- package/src/tools.ts +18 -97
- package/src/transient-tokens-values.ts +11 -0
- package/src/transient-tokens.ts +16 -13
- package/src/user.ts +74 -214
- package/src/versions.ts +24 -0
- package/src/views-schema.test.ts +9 -1
- package/src/views.ts +106 -329
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const StringValueMapSchema = z.object({}).catchall(z.string()).meta({ id: 'StringValueMap' });
|
|
4
|
+
|
|
5
|
+
export const FileMetadataUpdateResultSchema = z
|
|
6
|
+
.strictObject({
|
|
7
|
+
success: z.boolean(),
|
|
8
|
+
file: z.string(),
|
|
9
|
+
})
|
|
10
|
+
.meta({ id: 'FileMetadataUpdateResult' });
|
|
11
|
+
|
|
12
|
+
export const FileListResponseSchema = z
|
|
13
|
+
.strictObject({
|
|
14
|
+
files: z.array(z.string()),
|
|
15
|
+
})
|
|
16
|
+
.meta({ id: 'FileListResponse' });
|
|
17
|
+
|
|
18
|
+
export const GetUploadUrlPayloadSchema = z
|
|
19
|
+
.strictObject({
|
|
20
|
+
name: z.string(),
|
|
21
|
+
id: z.string().optional(),
|
|
22
|
+
mime_type: z.string().optional(),
|
|
23
|
+
ttl: z.number().optional(),
|
|
24
|
+
})
|
|
25
|
+
.meta({ id: 'GetUploadUrlPayload' });
|
|
26
|
+
|
|
27
|
+
export const FileMetadataResponseSchema = z
|
|
28
|
+
.strictObject({
|
|
29
|
+
name: z.string(),
|
|
30
|
+
size: z.number(),
|
|
31
|
+
contentType: z.string(),
|
|
32
|
+
contentDisposition: z.string().optional(),
|
|
33
|
+
etag: z.string().optional(),
|
|
34
|
+
customMetadata: StringValueMapSchema.optional(),
|
|
35
|
+
})
|
|
36
|
+
.meta({ id: 'FileMetadataResponse' });
|
|
37
|
+
|
|
38
|
+
export const GetFileUrlResponseSchema = z
|
|
39
|
+
.strictObject({
|
|
40
|
+
url: z.string(),
|
|
41
|
+
id: z.string(),
|
|
42
|
+
mime_type: z.string().optional(),
|
|
43
|
+
path: z.string(),
|
|
44
|
+
})
|
|
45
|
+
.meta({ id: 'GetFileUrlResponse' });
|
|
46
|
+
|
|
47
|
+
export const GetFileUrlPayloadSchema = z
|
|
48
|
+
.strictObject({
|
|
49
|
+
file: z.string(),
|
|
50
|
+
name: z.string().optional(),
|
|
51
|
+
disposition: z.enum(['inline', 'attachment']).optional(),
|
|
52
|
+
})
|
|
53
|
+
.meta({ id: 'GetFileUrlPayload' });
|
|
54
|
+
|
|
55
|
+
export const BulkUploadUrlsResponseSchema = z
|
|
56
|
+
.strictObject({
|
|
57
|
+
files: z.array(GetFileUrlResponseSchema),
|
|
58
|
+
})
|
|
59
|
+
.meta({ id: 'BulkUploadUrlsResponse' });
|
|
60
|
+
|
|
61
|
+
export const BulkUploadUrlsPayloadSchema = z
|
|
62
|
+
.strictObject({
|
|
63
|
+
files: z.array(
|
|
64
|
+
z.strictObject({
|
|
65
|
+
name: z.string(),
|
|
66
|
+
mime_type: z.string().optional(),
|
|
67
|
+
id: z.string().optional(),
|
|
68
|
+
}),
|
|
69
|
+
),
|
|
70
|
+
})
|
|
71
|
+
.meta({ id: 'BulkUploadUrlsPayload' });
|
|
72
|
+
|
|
73
|
+
export const FileBucketResponseSchema = z
|
|
74
|
+
.strictObject({
|
|
75
|
+
bucket: z.string(),
|
|
76
|
+
})
|
|
77
|
+
.meta({ id: 'FileBucketResponse' });
|
|
78
|
+
|
|
79
|
+
export const DeleteFileResultSchema = z
|
|
80
|
+
.strictObject({
|
|
81
|
+
success: z.boolean(),
|
|
82
|
+
count: z.number(),
|
|
83
|
+
message: z.string().optional(),
|
|
84
|
+
file: z.string().optional(),
|
|
85
|
+
})
|
|
86
|
+
.meta({ id: 'DeleteFileResult' });
|
|
87
|
+
|
|
88
|
+
export const CopyFileResponseSchema = z
|
|
89
|
+
.strictObject({
|
|
90
|
+
success: z.boolean(),
|
|
91
|
+
source: z.string(),
|
|
92
|
+
dest: z.string(),
|
|
93
|
+
})
|
|
94
|
+
.meta({ id: 'CopyFileResponse' });
|
|
95
|
+
|
|
96
|
+
export const CopyFilePayloadSchema = z
|
|
97
|
+
.strictObject({
|
|
98
|
+
source: z.string(),
|
|
99
|
+
dest: z.string(),
|
|
100
|
+
})
|
|
101
|
+
.meta({ id: 'CopyFilePayload' });
|
|
102
|
+
|
|
103
|
+
export const SetFileMetadataPayloadSchema = z
|
|
104
|
+
.strictObject({
|
|
105
|
+
file: z.string().meta({ description: 'The file path (relative to bucket) or full URI' }),
|
|
106
|
+
metadata: StringValueMapSchema.meta({ description: 'Custom metadata key-value pairs to set on the file' }),
|
|
107
|
+
})
|
|
108
|
+
.meta({ id: 'SetFileMetadataPayload' });
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The file query contracts.
|
|
112
|
+
*
|
|
113
|
+
* `file` and `prefix` are required, which the document already said and each handler restated as its
|
|
114
|
+
* own `ctx.throw(400, 'The … query parameter is required')`. Enforcing the component removes the
|
|
115
|
+
* restatement; the message changes wording and the status does not.
|
|
116
|
+
*/
|
|
117
|
+
export const FileMetadataQuerySchema = z
|
|
118
|
+
.strictObject({
|
|
119
|
+
file: z.string(),
|
|
120
|
+
})
|
|
121
|
+
.meta({ id: 'FileMetadataQuery' });
|
|
122
|
+
|
|
123
|
+
export const FileListQuerySchema = z
|
|
124
|
+
.strictObject({
|
|
125
|
+
prefix: z.string(),
|
|
126
|
+
})
|
|
127
|
+
.meta({ id: 'FileListQuery' });
|
|
128
|
+
|
|
129
|
+
export const FileDeleteQuerySchema = z
|
|
130
|
+
.strictObject({
|
|
131
|
+
prefix: z.boolean().optional(),
|
|
132
|
+
})
|
|
133
|
+
.meta({ id: 'FileDeleteQuery' });
|
|
134
|
+
|
|
135
|
+
export const BucketReadAccessQuerySchema = z
|
|
136
|
+
.strictObject({
|
|
137
|
+
principal: z.string(),
|
|
138
|
+
})
|
|
139
|
+
.meta({ id: 'BucketReadAccessQuery' });
|
|
140
|
+
|
|
141
|
+
export const EnsureBucketReadAccessPayloadSchema = BucketReadAccessQuerySchema.meta({
|
|
142
|
+
id: 'EnsureBucketReadAccessPayload',
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
export const EnsureBucketReadAccessResponseSchema = z
|
|
146
|
+
.strictObject({
|
|
147
|
+
bucket: z.string(),
|
|
148
|
+
principal: z.string(),
|
|
149
|
+
granted: z.boolean(),
|
|
150
|
+
})
|
|
151
|
+
.meta({ id: 'EnsureBucketReadAccessResponse' });
|
|
152
|
+
|
|
153
|
+
export const BucketReadAccessStatusResponseSchema = z
|
|
154
|
+
.strictObject({
|
|
155
|
+
bucket: z.string(),
|
|
156
|
+
principal: z.string(),
|
|
157
|
+
hasAccess: z.boolean(),
|
|
158
|
+
})
|
|
159
|
+
.meta({ id: 'BucketReadAccessStatusResponse' });
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { Ajv2020 } from 'ajv/dist/2020.js';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import type { CreateUserGroupPayload, UpdateUserGroupPayload, UserGroup } from '../group.js';
|
|
4
|
+
import type { User, UserRef } from '../user.js';
|
|
5
|
+
import type { JsonObject } from './adapter.js';
|
|
6
|
+
import type { UserGroupArrayFromSchema } from './group.js';
|
|
7
|
+
import { ApiSchemaComponents, apiComponentRef, validateApiRequest, validateApiResponse } from './registry.js';
|
|
8
|
+
import type { UserRefArrayFromSchema } from './user.js';
|
|
9
|
+
|
|
10
|
+
/** Exact type identity — `extends` in both directions is too weak (any/unknown slip through). */
|
|
11
|
+
type Equals<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false;
|
|
12
|
+
function assertType<T extends true>(_ok: T): void {}
|
|
13
|
+
|
|
14
|
+
function compile(name: string, components: Readonly<Record<string, JsonObject>> = ApiSchemaComponents) {
|
|
15
|
+
const ajv = new Ajv2020({ strictSchema: false, allErrors: true });
|
|
16
|
+
ajv.addSchema({ $id: 'vertesia://openapi', components: { schemas: components } });
|
|
17
|
+
return ajv.compile({ $ref: `vertesia://openapi${apiComponentRef(name as never)}` });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const VALID_GROUP = {
|
|
21
|
+
id: 'g1',
|
|
22
|
+
account: 'a1',
|
|
23
|
+
name: 'Engineering',
|
|
24
|
+
tags: ['eng'],
|
|
25
|
+
created_at: '2026-07-30T10:00:00.000Z',
|
|
26
|
+
updated_at: '2026-07-30T10:00:00.000Z',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const VALID_REF = { id: 'u1', name: 'Someone', email: 'someone@acme.com' };
|
|
30
|
+
|
|
31
|
+
describe('gate 1 — the schema is the single source of truth for the public group types', () => {
|
|
32
|
+
it('publishes the exact schema-derived type, not a hand-written twin', () => {
|
|
33
|
+
assertType<Equals<UserGroupArrayFromSchema, UserGroup[]>>(true);
|
|
34
|
+
assertType<Equals<UserRefArrayFromSchema, UserRef[]>>(true);
|
|
35
|
+
expect(true).toBe(true);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('types the timestamps as the strings a client actually receives', () => {
|
|
39
|
+
// They were `Date` on the public type while the document published `format: date-time`
|
|
40
|
+
// strings. JSON has no date type, so the old declaration described the Mongoose document
|
|
41
|
+
// rather than the response — this is the correction, and the reason it is a compile-time
|
|
42
|
+
// break for anyone who was calling `.getTime()` on one.
|
|
43
|
+
assertType<Equals<UserGroup['created_at'], string>>(true);
|
|
44
|
+
assertType<Equals<UserGroup['updated_at'], string>>(true);
|
|
45
|
+
assertType<Equals<UserGroup['tags'], string[]>>(true);
|
|
46
|
+
assertType<Equals<UserGroup['allowed_projects'], string[] | undefined>>(true);
|
|
47
|
+
expect(true).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('derives UserRef from User rather than restating four fields', () => {
|
|
51
|
+
// `.pick()` on UserSchema, so a change to how `User` declares one of these follows through
|
|
52
|
+
// instead of leaving a twin behind. The requiredness comes with it: `email` is required on
|
|
53
|
+
// both, which is why the members listing has to map rather than serialize.
|
|
54
|
+
assertType<Equals<UserRef['id'], User['id']>>(true);
|
|
55
|
+
assertType<Equals<UserRef['name'], User['name']>>(true);
|
|
56
|
+
assertType<Equals<UserRef['email'], User['email']>>(true);
|
|
57
|
+
assertType<Equals<UserRef['picture'], User['picture']>>(true);
|
|
58
|
+
// And nothing else came across.
|
|
59
|
+
assertType<Equals<keyof UserRef, 'id' | 'name' | 'email' | 'picture'>>(true);
|
|
60
|
+
expect(true).toBe(true);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('derives both payloads from the group rather than restating its fields', () => {
|
|
64
|
+
// Same reasoning as UserRef, applied to the write side: each payload is a subset of the
|
|
65
|
+
// group, so the field types follow the response. Only requiredness differs, and only where
|
|
66
|
+
// it should — `tags` is required on a group the server always populates and optional in a
|
|
67
|
+
// payload the caller need not send.
|
|
68
|
+
assertType<Equals<CreateUserGroupPayload['name'], UserGroup['name']>>(true);
|
|
69
|
+
assertType<Equals<CreateUserGroupPayload['description'], UserGroup['description']>>(true);
|
|
70
|
+
assertType<Equals<CreateUserGroupPayload['tags'], string[] | undefined>>(true);
|
|
71
|
+
assertType<Equals<keyof CreateUserGroupPayload, 'name' | 'description' | 'tags' | 'allowed_projects'>>(true);
|
|
72
|
+
assertType<Equals<UpdateUserGroupPayload['properties'], UserGroup['properties']>>(true);
|
|
73
|
+
assertType<Equals<UpdateUserGroupPayload['clearance'], UserGroup['clearance']>>(true);
|
|
74
|
+
assertType<Equals<UpdateUserGroupPayload['compartments'], UserGroup['compartments']>>(true);
|
|
75
|
+
// The whitelist is what the pick leaves out: nothing server-owned is writable.
|
|
76
|
+
assertType<
|
|
77
|
+
Equals<
|
|
78
|
+
keyof UpdateUserGroupPayload,
|
|
79
|
+
'name' | 'description' | 'tags' | 'properties' | 'clearance' | 'compartments' | 'allowed_projects'
|
|
80
|
+
>
|
|
81
|
+
>(true);
|
|
82
|
+
expect(true).toBe(true);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
describe('gate 2 — the published components match the closure the types come from', () => {
|
|
87
|
+
it('does not declare members on the group component', () => {
|
|
88
|
+
// Three handlers were shipping `members` — two by populating a `select: false` path, one by
|
|
89
|
+
// returning the in-memory document — while the component is closed and has never declared
|
|
90
|
+
// it. Members are published by their own route as UserRef[].
|
|
91
|
+
expect(Object.keys(ApiSchemaComponents.UserGroup.properties as JsonObject)).not.toContain('members');
|
|
92
|
+
expect(ApiSchemaComponents.UserGroup.additionalProperties).toBe(false);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('publishes UserRef as its own component, not a $ref back to User', () => {
|
|
96
|
+
// `.pick()` drops the `id: 'User'` metadata, which is what keeps the projection a separate
|
|
97
|
+
// component. If it carried the id across, every UserRef slot would suddenly promise a whole
|
|
98
|
+
// User to generated clients.
|
|
99
|
+
expect(JSON.stringify(ApiSchemaComponents.UserRef)).not.toContain('$ref');
|
|
100
|
+
expect(ApiSchemaComponents.UserRef.required).toEqual(['id', 'name', 'email']);
|
|
101
|
+
expect(ApiSchemaComponents.UserRefArray).toEqual({
|
|
102
|
+
type: 'array',
|
|
103
|
+
items: { $ref: '#/components/schemas/UserRef' },
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('keeps the timestamps enforceable rather than merely documented', () => {
|
|
108
|
+
const props = ApiSchemaComponents.UserGroup.properties as Record<string, JsonObject>;
|
|
109
|
+
expect(props.created_at).toEqual({ type: 'string', format: 'date-time' });
|
|
110
|
+
expect(ApiSchemaComponents.UserGroup.required).toEqual([
|
|
111
|
+
'id',
|
|
112
|
+
'account',
|
|
113
|
+
'name',
|
|
114
|
+
'tags',
|
|
115
|
+
'created_at',
|
|
116
|
+
'updated_at',
|
|
117
|
+
]);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
describe('gate 3 — AJV validates the same canonical objects that are published', () => {
|
|
122
|
+
it('accepts a minimal group and rejects a missing required field', () => {
|
|
123
|
+
const validate = compile('UserGroup');
|
|
124
|
+
expect(validate(VALID_GROUP)).toBe(true);
|
|
125
|
+
const { tags: _dropped, ...incomplete } = VALID_GROUP;
|
|
126
|
+
expect(validate(incomplete)).toBe(false);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('rejects the internal fields a serialized document would have leaked', () => {
|
|
130
|
+
const validate = compile('UserGroup');
|
|
131
|
+
expect(validate({ ...VALID_GROUP, members: ['u1'] })).toBe(false);
|
|
132
|
+
expect(validate({ ...VALID_GROUP, _id: 'deadbeef' })).toBe(false);
|
|
133
|
+
expect(validate({ ...VALID_GROUP, __v: 0 })).toBe(false);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('requires a name on the update payload, which both handlers checked by hand', () => {
|
|
137
|
+
const validate = compile('UpdateUserGroupPayload');
|
|
138
|
+
expect(validate({ name: 'Renamed' })).toBe(true);
|
|
139
|
+
expect(validate({})).toBe(false);
|
|
140
|
+
expect(validate({ name: 'Renamed', rogue_field: 1 })).toBe(false);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it('accepts a create payload with only a name', () => {
|
|
144
|
+
const validate = compile('CreateUserGroupPayload');
|
|
145
|
+
expect(validate({ name: 'Engineering' })).toBe(true);
|
|
146
|
+
expect(validate({ name: 'Engineering', allowed_projects: [] })).toBe(true);
|
|
147
|
+
// `properties` and `clearance` are updatable but not settable at creation, and never were.
|
|
148
|
+
expect(validate({ name: 'Engineering', clearance: 3 })).toBe(false);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('documents allowed_projects for the request rather than inheriting the response text', () => {
|
|
152
|
+
// The one field where picking is not enough: the response explains what an empty list MEANS,
|
|
153
|
+
// the request explains what sending one DOES. Overriding the picked field is how a payload
|
|
154
|
+
// keeps request-specific documentation — and the same mechanism a field with genuinely
|
|
155
|
+
// different request semantics would need.
|
|
156
|
+
const create = (ApiSchemaComponents.CreateUserGroupPayload.properties as Record<string, JsonObject>)
|
|
157
|
+
.allowed_projects;
|
|
158
|
+
const group = (ApiSchemaComponents.UserGroup.properties as Record<string, JsonObject>).allowed_projects;
|
|
159
|
+
expect(create.description).toBe('Restrict the new group to the given projects (empty/absent = org-wide).');
|
|
160
|
+
expect(create.description).not.toBe(group.description);
|
|
161
|
+
// Everything except the description still comes from the group.
|
|
162
|
+
expect({ ...create, description: undefined }).toEqual({ ...group, description: undefined });
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
describe('gate 4 — runtime enforcement uses the published components', () => {
|
|
167
|
+
it('enforces the date-time format the timestamps claim', () => {
|
|
168
|
+
// Through the registry rather than the local `compile` helper: the production validator
|
|
169
|
+
// registers ajv-formats, and a bare Ajv2020 ignores `format` entirely.
|
|
170
|
+
expect(validateApiResponse('UserGroup', { ...VALID_GROUP, created_at: 'yesterday' }).valid).toBe(false);
|
|
171
|
+
expect(validateApiResponse('UserGroup', VALID_GROUP).valid).toBe(true);
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it('rejects an undeclared update field without removing it', () => {
|
|
175
|
+
const payload: Record<string, unknown> = { name: 'Acme', rogue_field: 42 };
|
|
176
|
+
const result = validateApiRequest('UpdateUserGroupPayload', payload);
|
|
177
|
+
expect(result.valid).toBe(false);
|
|
178
|
+
expect(payload.rogue_field).toBe(42);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('checks every member of the group listing against the same UserGroup component', () => {
|
|
182
|
+
expect(validateApiResponse('UserGroupArray', [VALID_GROUP, VALID_GROUP]).valid).toBe(true);
|
|
183
|
+
expect(validateApiResponse('UserGroupArray', []).valid).toBe(true);
|
|
184
|
+
// One group still carrying its members is what the unmapped listing would have produced.
|
|
185
|
+
expect(validateApiResponse('UserGroupArray', [VALID_GROUP, { ...VALID_GROUP, members: [] }]).valid).toBe(false);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('checks every member of the members listing against UserRef', () => {
|
|
189
|
+
expect(validateApiResponse('UserRefArray', [VALID_REF]).valid).toBe(true);
|
|
190
|
+
// A user Mongo holds with no email — required on the wire, which is why the handler maps.
|
|
191
|
+
const { email: _dropped, ...withoutEmail } = VALID_REF;
|
|
192
|
+
expect(validateApiResponse('UserRefArray', [withoutEmail]).valid).toBe(false);
|
|
193
|
+
expect(validateApiResponse('UserRefArray', [{ ...VALID_REF, email: '' }]).valid).toBe(true);
|
|
194
|
+
// And the whole user document, which is what serializing the populated doc would send.
|
|
195
|
+
expect(validateApiResponse('UserRefArray', [{ ...VALID_REF, clearance: 3 }]).valid).toBe(false);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
it('hands back the component type on the valid branch', () => {
|
|
199
|
+
const result = validateApiResponse('UserGroup', VALID_GROUP);
|
|
200
|
+
expect(result.valid).toBe(true);
|
|
201
|
+
if (result.valid) {
|
|
202
|
+
assertType<Equals<typeof result.data, UserGroup>>(true);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
});
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Runtime API schemas for the IAM user-group endpoints.
|
|
5
|
+
*
|
|
6
|
+
* These contracts cross a persistence boundary, and the gap between document and wire is
|
|
7
|
+
* wider here. Three things the stored document carries are NOT in this contract and never were:
|
|
8
|
+
* `members` (the model marks it `select: false`, yet two handlers `populate()` it straight back into
|
|
9
|
+
* the response), `_id`, and `__v`. `UserGroup` is published `additionalProperties: false`, so those
|
|
10
|
+
* responses have been violating their own schema; the server now maps the document explicitly
|
|
11
|
+
* instead of serializing it, which is what makes the published contract true.
|
|
12
|
+
*
|
|
13
|
+
* `UserRef` lives in `./user.js` rather than here — it is the shape of a USER, published by the
|
|
14
|
+
* group members listing but not owned by it.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The user group as it crosses the wire.
|
|
19
|
+
*
|
|
20
|
+
* `created_at`/`updated_at` are declared `z.string()` while the public TypeScript type used to say
|
|
21
|
+
* `Date`. The document has always published `type: string, format: date-time`, and JSON has no date
|
|
22
|
+
* type, so the old type was wrong about what a client receives — it described the Mongoose document,
|
|
23
|
+
* not the response. Inferring the public type from this schema corrects it.
|
|
24
|
+
*/
|
|
25
|
+
export const UserGroupSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
id: z.string(),
|
|
28
|
+
account: z.string(),
|
|
29
|
+
name: z.string(),
|
|
30
|
+
description: z.string().optional(),
|
|
31
|
+
tags: z.array(z.string()),
|
|
32
|
+
created_at: z.string().meta({ format: 'date-time' }),
|
|
33
|
+
updated_at: z.string().meta({ format: 'date-time' }),
|
|
34
|
+
created_by: z.string().optional(),
|
|
35
|
+
updated_by: z.string().optional(),
|
|
36
|
+
properties: z
|
|
37
|
+
.record(z.string(), z.unknown())
|
|
38
|
+
.optional()
|
|
39
|
+
.meta({ description: 'Custom properties for dynamic permission matching' }),
|
|
40
|
+
clearance: z
|
|
41
|
+
.number()
|
|
42
|
+
.optional()
|
|
43
|
+
.meta({ description: 'BLP clearance level — merged with user clearance using max()' }),
|
|
44
|
+
compartments: z
|
|
45
|
+
.array(z.string())
|
|
46
|
+
.optional()
|
|
47
|
+
.meta({ description: 'Compartments — merged with user compartments using array union' }),
|
|
48
|
+
allowed_projects: z
|
|
49
|
+
.array(z.string())
|
|
50
|
+
.optional()
|
|
51
|
+
.meta({
|
|
52
|
+
description:
|
|
53
|
+
'Projects this group is allowed to be used in. When empty or absent the group is org-wide ' +
|
|
54
|
+
'(usable in any project). When set, the group may only be used to grant permissions in the ' +
|
|
55
|
+
'listed projects.',
|
|
56
|
+
}),
|
|
57
|
+
})
|
|
58
|
+
.meta({ id: 'UserGroup' });
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The group listing. Converted with `UserGroup` rather than later: its items `$ref` the canonical
|
|
62
|
+
* component, so publishing the array while returning an unmapped document would document the
|
|
63
|
+
* contract for every group and enforce it for none — the gap the account members listing had.
|
|
64
|
+
*/
|
|
65
|
+
export const UserGroupArraySchema = z.array(UserGroupSchema).meta({ id: 'UserGroupArray' });
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Both payloads are picked from {@link UserGroupSchema}, for the same reason `UserRef` is: they are
|
|
69
|
+
* subsets of the group, not parallel shapes. What each `.pick()` leaves out is the whitelist —
|
|
70
|
+
* `id`, `account`, the timestamps and `created_by`/`updated_by` are server-owned — and it can no
|
|
71
|
+
* longer widen silently, because adding a writable field means naming it here.
|
|
72
|
+
*
|
|
73
|
+
* `tags` is the one field whose requiredness genuinely differs: a group always HAS tags (the model
|
|
74
|
+
* defaults to `[]`), but neither payload makes the caller send them.
|
|
75
|
+
*/
|
|
76
|
+
const UserGroupWritableSchema = UserGroupSchema.pick({
|
|
77
|
+
name: true,
|
|
78
|
+
description: true,
|
|
79
|
+
tags: true,
|
|
80
|
+
allowed_projects: true,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* `allowed_projects` is overridden rather than inherited: on the response it explains what an empty
|
|
85
|
+
* list MEANS, while on a create request it tells the caller what sending one DOES. Same field, and
|
|
86
|
+
* genuinely different documentation — which is the general rule for picking. Anything where the
|
|
87
|
+
* request semantics differ (a `null` that clears a value, a coercion, a request-only bound) has to be
|
|
88
|
+
* overridden the same way instead of inherited.
|
|
89
|
+
*/
|
|
90
|
+
export const CreateUserGroupPayloadSchema = UserGroupWritableSchema.partial({ tags: true })
|
|
91
|
+
.extend({
|
|
92
|
+
allowed_projects: z
|
|
93
|
+
.array(z.string())
|
|
94
|
+
.optional()
|
|
95
|
+
.meta({ description: 'Restrict the new group to the given projects (empty/absent = org-wide).' }),
|
|
96
|
+
})
|
|
97
|
+
.meta({ id: 'CreateUserGroupPayload' });
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The update payload writes more than create does — the BLP and dynamic-matching fields are settable
|
|
101
|
+
* only after the group exists — so it picks a wider subset of the same schema.
|
|
102
|
+
*
|
|
103
|
+
* `name` is required, which the published component has always said and both update handlers
|
|
104
|
+
* enforced by hand with a 400. Validation now does it, so the hand-rolled check is redundant rather
|
|
105
|
+
* than load-bearing — it is kept for the same reason the user update whitelist was: removing it is a
|
|
106
|
+
* behaviour change that does not belong in a contract change.
|
|
107
|
+
*/
|
|
108
|
+
export const UpdateUserGroupPayloadSchema = UserGroupSchema.pick({
|
|
109
|
+
name: true,
|
|
110
|
+
description: true,
|
|
111
|
+
tags: true,
|
|
112
|
+
properties: true,
|
|
113
|
+
clearance: true,
|
|
114
|
+
compartments: true,
|
|
115
|
+
allowed_projects: true,
|
|
116
|
+
})
|
|
117
|
+
.partial({ tags: true })
|
|
118
|
+
.meta({ id: 'UpdateUserGroupPayload' });
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The group as it appears embedded in a token payload, and the one place a group crosses the wire
|
|
122
|
+
* without being the response of a group endpoint.
|
|
123
|
+
*
|
|
124
|
+
* Picked from {@link UserGroupSchema} for the same reason the payloads are — it is a subset of the
|
|
125
|
+
* group, not a parallel shape — and the subset is decided by what an authorization decision needs:
|
|
126
|
+
* identity (`id`, `name`), the dynamic-matching input (`tags`, `properties`) and the BLP inputs
|
|
127
|
+
* (`clearance`, `compartments`, `allowed_projects`). `account` and the audit fields are deliberately
|
|
128
|
+
* out: a token is not a place to restate who edited a group.
|
|
129
|
+
*
|
|
130
|
+
* `tags` is optional here while the group always has them, matching the payloads: the token mapper
|
|
131
|
+
* omits an empty list rather than emitting one.
|
|
132
|
+
*
|
|
133
|
+
* This is NOT the Mongoose projection that feeds it. The projection is a `select()` string that lives
|
|
134
|
+
* beside its query — token-server has one, studio-server's resource-reference endpoint has a
|
|
135
|
+
* different and much narrower one — and a single shared string would have to be the union of every
|
|
136
|
+
* caller's needs, which is how the previous `UserGroupRefPopulate` came to select a `description`
|
|
137
|
+
* that nothing emits.
|
|
138
|
+
*/
|
|
139
|
+
export const UserGroupRefSchema = UserGroupSchema.pick({
|
|
140
|
+
id: true,
|
|
141
|
+
name: true,
|
|
142
|
+
tags: true,
|
|
143
|
+
properties: true,
|
|
144
|
+
clearance: true,
|
|
145
|
+
compartments: true,
|
|
146
|
+
allowed_projects: true,
|
|
147
|
+
})
|
|
148
|
+
.partial({ tags: true })
|
|
149
|
+
.meta({ id: 'UserGroupRef' });
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The array components have no public alias of their own — `UserGroup[]` is what the client sees —
|
|
153
|
+
* so this exists only for the gate in `./group.contract.test.ts` to assert that equivalence.
|
|
154
|
+
*/
|
|
155
|
+
export type UserGroupArrayFromSchema = z.infer<typeof UserGroupArraySchema>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime API schema entry point — `@vertesia/common/api-schemas`.
|
|
3
|
+
*
|
|
4
|
+
* Kept OUT of the package root on purpose. `lib/index.js` is bundled wholesale into
|
|
5
|
+
* `lib/vertesia-common.js` (see `rolldown.config.js`) and served to browsers as a single shared
|
|
6
|
+
* library (see `apps/composable-ui/build/shared-libs.ts`), with no per-consumer tree-shaking. A
|
|
7
|
+
* runtime `export *` from the root would therefore ship zod to every UI user. The root re-exports
|
|
8
|
+
* only the derived TYPES, via `export type`, which tsc erases.
|
|
9
|
+
*
|
|
10
|
+
* Servers and the OpenAPI scanner import from this subpath explicitly.
|
|
11
|
+
*/
|
|
12
|
+
export * from './account.js';
|
|
13
|
+
export * from './adapter.js';
|
|
14
|
+
export * from './agent-runs.js';
|
|
15
|
+
export * from './analytics.js';
|
|
16
|
+
export * from './apikey.js';
|
|
17
|
+
export * from './app-runtime.js';
|
|
18
|
+
export * from './bulk-operation.js';
|
|
19
|
+
export * from './content.js';
|
|
20
|
+
export * from './cost-analytics.js';
|
|
21
|
+
export * from './dashboard.js';
|
|
22
|
+
export * from './data-store.js';
|
|
23
|
+
export * from './document-processing.js';
|
|
24
|
+
export * from './embeddings.js';
|
|
25
|
+
export * from './environment.js';
|
|
26
|
+
export * from './events.js';
|
|
27
|
+
export * from './indexing.js';
|
|
28
|
+
export * from './integrations.js';
|
|
29
|
+
export * from './parameters.js';
|
|
30
|
+
export * from './process.js';
|
|
31
|
+
export * from './quota.js';
|
|
32
|
+
export * from './registry.js';
|
|
33
|
+
export * from './secrets.js';
|
|
34
|
+
export * from './view-execution.js';
|
|
35
|
+
export * from './workflow-runs.js';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import type { GenericCommandResponse } from '../common.js';
|
|
3
|
+
import type {
|
|
4
|
+
DriftAnalysisStatusResponse,
|
|
5
|
+
EmbeddingsStatusResponse,
|
|
6
|
+
IndexingStatusResponse,
|
|
7
|
+
ProjectConfigurationEmbeddingEnablePayload,
|
|
8
|
+
ReindexAgentRunsPayload,
|
|
9
|
+
ReindexAgentRunsResponse,
|
|
10
|
+
StartProjectReindexPayload,
|
|
11
|
+
} from '../project.js';
|
|
12
|
+
import { WorkflowExecutionStatus } from '../store/workflow.js';
|
|
13
|
+
import type { GenericCommandResponseSchema } from './commands.js';
|
|
14
|
+
import type { EmbeddingsStatusResponseSchema, ProjectConfigurationEmbeddingEnablePayloadSchema } from './embeddings.js';
|
|
15
|
+
import type {
|
|
16
|
+
DriftAnalysisStatusResponseSchema,
|
|
17
|
+
IndexingStatusResponseSchema,
|
|
18
|
+
ReindexAgentRunsPayloadSchema,
|
|
19
|
+
ReindexAgentRunsResponseSchema,
|
|
20
|
+
StartProjectReindexPayloadSchema,
|
|
21
|
+
} from './indexing.js';
|
|
22
|
+
import { validateApiRequest, validateApiResponse } from './registry.js';
|
|
23
|
+
|
|
24
|
+
type Equals<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false;
|
|
25
|
+
function assertType<T extends true>(_value: T): void {}
|
|
26
|
+
|
|
27
|
+
describe('indexing and embedding API contracts', () => {
|
|
28
|
+
it('derives every public type from its domain schema', () => {
|
|
29
|
+
assertType<Equals<GenericCommandResponse, typeof GenericCommandResponseSchema._output>>(true);
|
|
30
|
+
assertType<Equals<EmbeddingsStatusResponse, typeof EmbeddingsStatusResponseSchema._output>>(true);
|
|
31
|
+
assertType<Equals<IndexingStatusResponse, typeof IndexingStatusResponseSchema._output>>(true);
|
|
32
|
+
assertType<Equals<DriftAnalysisStatusResponse, typeof DriftAnalysisStatusResponseSchema._output>>(true);
|
|
33
|
+
assertType<
|
|
34
|
+
Equals<
|
|
35
|
+
ProjectConfigurationEmbeddingEnablePayload,
|
|
36
|
+
typeof ProjectConfigurationEmbeddingEnablePayloadSchema._output
|
|
37
|
+
>
|
|
38
|
+
>(true);
|
|
39
|
+
assertType<Equals<StartProjectReindexPayload, typeof StartProjectReindexPayloadSchema._output>>(true);
|
|
40
|
+
assertType<Equals<ReindexAgentRunsPayload, typeof ReindexAgentRunsPayloadSchema._output>>(true);
|
|
41
|
+
assertType<Equals<ReindexAgentRunsResponse, typeof ReindexAgentRunsResponseSchema._output>>(true);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('rejects undeclared request fields while allowing both optional reindex bodies', () => {
|
|
45
|
+
expect(validateApiRequest('StartProjectReindexPayload', undefined).valid).toBe(false);
|
|
46
|
+
expect(validateApiRequest('StartProjectReindexPayload', {}).valid).toBe(true);
|
|
47
|
+
expect(validateApiRequest('StartProjectReindexPayload', { unexpected: true }).valid).toBe(false);
|
|
48
|
+
expect(validateApiRequest('ReindexAgentRunsPayload', {}).valid).toBe(true);
|
|
49
|
+
expect(validateApiRequest('ReindexAgentRunsPayload', { recreate_index: true, unexpected: true }).valid).toBe(
|
|
50
|
+
false,
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('keeps drift workflow status numeric and nullable identifiers explicit', () => {
|
|
55
|
+
expect(
|
|
56
|
+
validateApiResponse('DriftAnalysisStatusResponse', {
|
|
57
|
+
workflow_id: null,
|
|
58
|
+
workflow_run_id: null,
|
|
59
|
+
status: WorkflowExecutionStatus.UNKNOWN,
|
|
60
|
+
}).valid,
|
|
61
|
+
).toBe(true);
|
|
62
|
+
expect(
|
|
63
|
+
validateApiResponse('DriftAnalysisStatusResponse', {
|
|
64
|
+
workflow_id: null,
|
|
65
|
+
workflow_run_id: null,
|
|
66
|
+
status: 'NOT_FOUND',
|
|
67
|
+
}).valid,
|
|
68
|
+
).toBe(false);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('validates command and embedding responses against the published components', () => {
|
|
72
|
+
expect(validateApiResponse('GenericCommandResponse', { status: 'ok', message: 'done' }).valid).toBe(true);
|
|
73
|
+
expect(
|
|
74
|
+
validateApiResponse('GenericCommandResponse', { status: 'ok', message: 'done', extra: true }).valid,
|
|
75
|
+
).toBe(false);
|
|
76
|
+
expect(
|
|
77
|
+
validateApiResponse('EmbeddingsStatusResponse', {
|
|
78
|
+
status: 'success',
|
|
79
|
+
vectorIndex: { status: 'READY' },
|
|
80
|
+
}).valid,
|
|
81
|
+
).toBe(true);
|
|
82
|
+
});
|
|
83
|
+
});
|