@vertesia/common 1.5.0-dev.20260804.124748Z → 1.5.0-dev.20260807.073259Z

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.
Files changed (179) hide show
  1. package/lib/Progress.d.ts.map +1 -1
  2. package/lib/Progress.js.map +1 -1
  3. package/lib/access-control-values.d.ts +2 -2
  4. package/lib/access-control-values.d.ts.map +1 -1
  5. package/lib/account-values.d.ts +1 -1
  6. package/lib/account-values.d.ts.map +1 -1
  7. package/lib/api-schemas/access-control.d.ts +19 -19
  8. package/lib/api-schemas/adapter.d.ts +1 -0
  9. package/lib/api-schemas/adapter.d.ts.map +1 -1
  10. package/lib/api-schemas/adapter.js +1 -1
  11. package/lib/api-schemas/adapter.js.map +1 -1
  12. package/lib/api-schemas/agent-runs.d.ts +660 -515
  13. package/lib/api-schemas/agent-runs.d.ts.map +1 -1
  14. package/lib/api-schemas/agent-runs.js +11 -2
  15. package/lib/api-schemas/agent-runs.js.map +1 -1
  16. package/lib/api-schemas/analytics.d.ts +12 -12
  17. package/lib/api-schemas/apikey.d.ts +10 -10
  18. package/lib/api-schemas/app-lifecycle.d.ts +186 -152
  19. package/lib/api-schemas/app-lifecycle.d.ts.map +1 -1
  20. package/lib/api-schemas/app-lifecycle.js +51 -0
  21. package/lib/api-schemas/app-lifecycle.js.map +1 -1
  22. package/lib/api-schemas/app-runtime.d.ts +4493 -2122
  23. package/lib/api-schemas/app-runtime.d.ts.map +1 -1
  24. package/lib/api-schemas/app-runtime.js +93 -1
  25. package/lib/api-schemas/app-runtime.js.map +1 -1
  26. package/lib/api-schemas/apps.d.ts +43 -19
  27. package/lib/api-schemas/apps.d.ts.map +1 -1
  28. package/lib/api-schemas/apps.js +63 -3
  29. package/lib/api-schemas/apps.js.map +1 -1
  30. package/lib/api-schemas/audit-trail.d.ts +129 -129
  31. package/lib/api-schemas/bulk-operation.d.ts +10 -10
  32. package/lib/api-schemas/content.d.ts +542 -398
  33. package/lib/api-schemas/content.d.ts.map +1 -1
  34. package/lib/api-schemas/content.js +12 -0
  35. package/lib/api-schemas/content.js.map +1 -1
  36. package/lib/api-schemas/cost-analytics.d.ts +12 -12
  37. package/lib/api-schemas/dashboard.d.ts +10 -10
  38. package/lib/api-schemas/data-store.d.ts +556 -556
  39. package/lib/api-schemas/document-processing.d.ts +280 -196
  40. package/lib/api-schemas/document-processing.d.ts.map +1 -1
  41. package/lib/api-schemas/embeddings.d.ts +12 -12
  42. package/lib/api-schemas/environment.d.ts +20 -18
  43. package/lib/api-schemas/environment.d.ts.map +1 -1
  44. package/lib/api-schemas/events.d.ts +988 -698
  45. package/lib/api-schemas/events.d.ts.map +1 -1
  46. package/lib/api-schemas/events.js +59 -3
  47. package/lib/api-schemas/events.js.map +1 -1
  48. package/lib/api-schemas/files.d.ts +1 -1
  49. package/lib/api-schemas/group.d.ts +3 -3
  50. package/lib/api-schemas/indexing.d.ts +3 -3
  51. package/lib/api-schemas/integrations.d.ts +4 -4
  52. package/lib/api-schemas/interaction.d.ts +3894 -2752
  53. package/lib/api-schemas/interaction.d.ts.map +1 -1
  54. package/lib/api-schemas/interaction.js +6 -0
  55. package/lib/api-schemas/interaction.js.map +1 -1
  56. package/lib/api-schemas/invites.d.ts +9 -9
  57. package/lib/api-schemas/oauth-server.d.ts +36 -36
  58. package/lib/api-schemas/parameters.js.map +1 -1
  59. package/lib/api-schemas/process.d.ts +47 -47
  60. package/lib/api-schemas/project-configuration.d.ts +944 -664
  61. package/lib/api-schemas/project-configuration.d.ts.map +1 -1
  62. package/lib/api-schemas/project.d.ts +1403 -983
  63. package/lib/api-schemas/project.d.ts.map +1 -1
  64. package/lib/api-schemas/registry.d.ts +19119 -13557
  65. package/lib/api-schemas/registry.d.ts.map +1 -1
  66. package/lib/api-schemas/registry.js +170 -18
  67. package/lib/api-schemas/registry.js.map +1 -1
  68. package/lib/api-schemas/secrets.d.ts +4 -4
  69. package/lib/api-schemas/store.d.ts +4624 -3224
  70. package/lib/api-schemas/store.d.ts.map +1 -1
  71. package/lib/api-schemas/sts.d.ts +46 -36
  72. package/lib/api-schemas/sts.d.ts.map +1 -1
  73. package/lib/api-schemas/sts.js +11 -0
  74. package/lib/api-schemas/sts.js.map +1 -1
  75. package/lib/api-schemas/task.d.ts +30 -30
  76. package/lib/api-schemas/tools.d.ts +9 -9
  77. package/lib/api-schemas/user.d.ts +6 -6
  78. package/lib/api-schemas/view-execution.d.ts +626 -570
  79. package/lib/api-schemas/view-execution.d.ts.map +1 -1
  80. package/lib/api-schemas/views.d.ts +1293 -1125
  81. package/lib/api-schemas/views.d.ts.map +1 -1
  82. package/lib/api-schemas/workflow-runs.d.ts +325 -268
  83. package/lib/api-schemas/workflow-runs.d.ts.map +1 -1
  84. package/lib/apps.d.ts +38 -24
  85. package/lib/apps.d.ts.map +1 -1
  86. package/lib/apps.js +4 -0
  87. package/lib/apps.js.map +1 -1
  88. package/lib/audit-trail.d.ts +3 -3
  89. package/lib/audit-trail.d.ts.map +1 -1
  90. package/lib/data-platform.d.ts +31 -31
  91. package/lib/data-platform.d.ts.map +1 -1
  92. package/lib/environment.d.ts +3 -3
  93. package/lib/index.d.ts +1 -0
  94. package/lib/index.d.ts.map +1 -1
  95. package/lib/index.js +1 -0
  96. package/lib/index.js.map +1 -1
  97. package/lib/platform-event-validation.d.ts.map +1 -1
  98. package/lib/platform-event-validation.js +15 -2
  99. package/lib/platform-event-validation.js.map +1 -1
  100. package/lib/platform-event.d.ts +31 -3
  101. package/lib/platform-event.d.ts.map +1 -1
  102. package/lib/platform-event.js.map +1 -1
  103. package/lib/project.d.ts +1 -1
  104. package/lib/schema-for-extraction.js.map +1 -1
  105. package/lib/store/agent-approval.d.ts +1 -1
  106. package/lib/store/agent-approval.d.ts.map +1 -1
  107. package/lib/store/intake-policy-schema.generated.d.ts.map +1 -1
  108. package/lib/store/intake-policy-schema.generated.js +36 -0
  109. package/lib/store/intake-policy-schema.generated.js.map +1 -1
  110. package/lib/store/process-schema.d.ts +1 -1
  111. package/lib/store/process-schema.d.ts.map +1 -1
  112. package/lib/store/process-validation.js.map +1 -1
  113. package/lib/store/schedule.d.ts +6 -6
  114. package/lib/store/schedule.d.ts.map +1 -1
  115. package/lib/store/store.d.ts +3 -3
  116. package/lib/store/store.d.ts.map +1 -1
  117. package/lib/store/workflow.d.ts +6 -0
  118. package/lib/store/workflow.d.ts.map +1 -1
  119. package/lib/store/workflow.js +8 -0
  120. package/lib/store/workflow.js.map +1 -1
  121. package/lib/sts-errors.d.ts +7 -0
  122. package/lib/sts-errors.d.ts.map +1 -0
  123. package/lib/sts-errors.js +11 -0
  124. package/lib/sts-errors.js.map +1 -0
  125. package/lib/sts-token-types.d.ts +2 -1
  126. package/lib/sts-token-types.d.ts.map +1 -1
  127. package/lib/sts-token-types.js.map +1 -1
  128. package/lib/user.d.ts +1 -1
  129. package/lib/user.d.ts.map +1 -1
  130. package/lib/user.js +1 -1
  131. package/lib/user.js.map +1 -1
  132. package/lib/versions.d.ts +10 -0
  133. package/lib/versions.d.ts.map +1 -1
  134. package/lib/versions.js +10 -0
  135. package/lib/versions.js.map +1 -1
  136. package/lib/vertesia-common.js +3 -3
  137. package/lib/vertesia-common.js.map +1 -1
  138. package/lib/view-configuration-validation.js.map +1 -1
  139. package/lib/view-query-validation.js.map +1 -1
  140. package/lib/view-validation-helpers.d.ts +1 -1
  141. package/lib/view-validation-helpers.d.ts.map +1 -1
  142. package/lib/views-schema.d.ts +51 -51
  143. package/lib/views-schema.d.ts.map +1 -1
  144. package/lib/views-validation.js.map +1 -1
  145. package/lib/views.d.ts +2 -2
  146. package/lib/views.d.ts.map +1 -1
  147. package/lib/workflow-analytics.d.ts +10 -3
  148. package/lib/workflow-analytics.d.ts.map +1 -1
  149. package/package.json +4 -4
  150. package/src/api-schemas/adapter.ts +1 -1
  151. package/src/api-schemas/agent-runs.ts +12 -2
  152. package/src/api-schemas/api-discriminators.test.ts +84 -0
  153. package/src/api-schemas/app-delete-summary.contract.test.ts +67 -0
  154. package/src/api-schemas/app-lifecycle.ts +59 -0
  155. package/src/api-schemas/app-runtime.ts +103 -0
  156. package/src/api-schemas/apps.ts +72 -3
  157. package/src/api-schemas/content.ts +13 -0
  158. package/src/api-schemas/events.ts +63 -3
  159. package/src/api-schemas/interaction.contract.test.ts +27 -0
  160. package/src/api-schemas/interaction.ts +7 -0
  161. package/src/api-schemas/mcp-api-key.contract.test.ts +86 -0
  162. package/src/api-schemas/registry.ts +200 -18
  163. package/src/api-schemas/store.contract.test.ts +21 -0
  164. package/src/api-schemas/sts.contract.test.ts +33 -1
  165. package/src/api-schemas/sts.ts +13 -0
  166. package/src/apps.test.ts +82 -0
  167. package/src/apps.ts +50 -16
  168. package/src/index.ts +1 -0
  169. package/src/platform-event-validation.test.ts +26 -0
  170. package/src/platform-event-validation.ts +15 -2
  171. package/src/platform-event.ts +43 -0
  172. package/src/store/intake-policy-schema.generated.ts +36 -0
  173. package/src/store/workflow.ts +9 -0
  174. package/src/sts-errors.ts +13 -0
  175. package/src/sts-token-types.ts +2 -0
  176. package/src/user.ts +1 -1
  177. package/src/versions.test.ts +13 -0
  178. package/src/versions.ts +12 -0
  179. package/src/workflow-analytics.ts +10 -3
@@ -7,13 +7,13 @@ import ajvFormats from 'ajv-formats';
7
7
  import { z } from 'zod';
8
8
  import { ACECreatePayloadSchema, ACEUpdatePayloadSchema, AccessControlEntryArraySchema, AccessControlEntrySchema, RoleDefinitionArraySchema, SystemRoleDefinitionArraySchema, } from './access-control.js';
9
9
  import { AccountSchema, StripeBillingStatusResponseSchema, UpdateAccountPayloadSchema } from './account.js';
10
- import { findUnprunablePaths, pruneToSchema, toOpenApiComponents } from './adapter.js';
10
+ import { findUnprunablePaths, isPlainObject, pruneToSchema, toOpenApiComponents } from './adapter.js';
11
11
  import * as AgentRunSchemas from './agent-runs.js';
12
12
  import { AnalyticsAxisSchema, RunAnalyticsGroupBySchema, RunAnalyticsQuerySchema, RunAnalyticsResultArraySchema, RunAnalyticsResultSchema, TimeResolutionSchema, } from './analytics.js';
13
13
  import { ApiKeyArraySchema, ApiKeyListQuerySchema, ApiKeyReadQuerySchema, ApiKeyReadResponseSchema, ApiKeySchema, ApiKeyWithValueSchema, AuthTokenResponseSchema, CreateApiKeyPayloadSchema, DeleteOperationResultSchema, ProjectRefArraySchema, UpdateApiKeyPayloadSchema, } from './apikey.js';
14
- import { AgentRunSearchHitSchema, AgentRunStatusSchema, AgentRunTypeSchema, AgentToolApprovalClassSchema, AgentToolDefinitionSchema, AppBuildProgressSchema, AppBuildProgressStatusSchema, AppBuildTriggerSchema, AppDevelopmentTaskDetailsSchema, AppDevelopmentTaskListSchema, AppDevelopmentTaskSchema, AppInspectionCapabilityReportSchema, AppInspectionIssueSchema, AppInspectionResultSchema, AppInstallationKindSchema, AppInstallationOAuthBindingSchema, AppInstallationPayloadSchema, AppInstallationProjectsQuerySchema, AppInstallationProviderBindingSchema, AppInstallationsQuerySchema, AppOAuthCollectionParamsSchema, AppOAuthProviderParamsSchema, AppPackageScopeSchema, AppRepoBranchSchema, AppRepoCommitSchema, AppRepoCommitsSchema, AppRepoDocumentCommitSchema, AppRepoRefSchema, AppRepoRefsSchema, AppRepoTreeEntrySchema, AppRepoTreeSchema, AppScaffoldModuleSchema, AppScaffoldProgressSchema, AppScaffoldProgressStatusSchema, AppToolCollectionArraySchema, AppToolCollectionSchema, AppVersionGitRefTypeSchema, AppVersionGitSourceSchema, AppVersionKindSchema, AppVersionRecordArraySchema, AppVersionRecordSchema, AppVersionStateSchema, AppVersionStorageSchema, AppVersionTargetSchema, AppVersionUrlsSchema, ContentObjectTypeRefSchema, ConversationActivityStateSchema, DeleteAppVersionResponseSchema, EventRefSchema, Extract_AppVersionGitRefType_branch_tag_commitSchema, InCodeTypeRefSchema, OAuthClientCredentialsMapSchema, OAuthClientCredentialsSchema, RunKindSchema, RunTypeSchema, StartAppBuildRequestSchema, StartAppBuildResponseSchema, StartAppScaffoldRequestSchema, StartAppScaffoldResponseSchema, StoredTypeRefSchema, SystemPackageQuerySchema, UpdateAppInstallationToolAllowlistPayloadSchema, UpsertAppVersionRequestSchema, ValidateUrlRequestSchema, ValidateUrlResponseSchema, } from './app-lifecycle.js';
14
+ import { AgentRunSearchHitSchema, AgentRunStatusSchema, AgentRunTypeSchema, AgentToolApprovalClassSchema, AgentToolDefinitionSchema, AppApiKeyCollectionParamsSchema, AppBuildProgressSchema, AppBuildProgressStatusSchema, AppBuildTriggerSchema, AppDeleteSummarySchema, AppDevelopmentTaskDetailsSchema, AppDevelopmentTaskListSchema, AppDevelopmentTaskSchema, AppInspectionCapabilityReportSchema, AppInspectionIssueSchema, AppInspectionResultSchema, AppInstallationKindSchema, AppInstallationOAuthBindingSchema, AppInstallationPayloadSchema, AppInstallationProjectsQuerySchema, AppInstallationProviderBindingSchema, AppInstallationsQuerySchema, AppOAuthCollectionParamsSchema, AppOAuthProviderParamsSchema, AppPackageScopeSchema, AppRepoBranchSchema, AppRepoCommitSchema, AppRepoCommitsSchema, AppRepoDocumentCommitSchema, AppRepoRefSchema, AppRepoRefsSchema, AppRepoTreeEntrySchema, AppRepoTreeSchema, AppScaffoldModuleSchema, AppScaffoldProgressSchema, AppScaffoldProgressStatusSchema, AppToolCollectionArraySchema, AppToolCollectionSchema, AppVersionGitRefTypeSchema, AppVersionGitSourceSchema, AppVersionKindSchema, AppVersionRecordArraySchema, AppVersionRecordSchema, AppVersionStateSchema, AppVersionStorageSchema, AppVersionTargetSchema, AppVersionUrlsSchema, ContentObjectTypeRefSchema, ConversationActivityStateSchema, DeleteAppVersionResponseSchema, EventRefSchema, Extract_AppVersionGitRefType_branch_tag_commitSchema, InCodeTypeRefSchema, McpApiKeyCredentialSchema, OAuthClientCredentialsMapSchema, OAuthClientCredentialsSchema, RunKindSchema, RunTypeSchema, StartAppBuildRequestSchema, StartAppBuildResponseSchema, StartAppScaffoldRequestSchema, StartAppScaffoldResponseSchema, StoredTypeRefSchema, SystemPackageQuerySchema, UpdateAppInstallationToolAllowlistPayloadSchema, UpsertAppVersionRequestSchema, ValidateUrlRequestSchema, ValidateUrlResponseSchema, } from './app-lifecycle.js';
15
15
  import * as AppRuntimeSchemas from './app-runtime.js';
16
- import { AppAccessControlSchema, AppCapabilitiesSchema, AppManifestSourceSchema, AppSourceConfigSchema, AppUIConfigSchema, MCPToolAnnotationsSchema, McpOAuthConnectResponseSchema, McpOAuthDisconnectResponseSchema, McpOAuthTokenRequestSchema, McpOAuthTokenResponseSchema, OAuthAuthorizeResponseSchema, OAuthAuthStatusArraySchema, OAuthAuthStatusSchema, OAuthMetadataResponseSchema, ToolCollectionObjectSchema, } from './apps.js';
16
+ import { AppAccessControlSchema, AppCapabilitiesSchema, AppManifestSourceSchema, AppSourceConfigSchema, AppUIConfigSchema, MCPToolAnnotationsSchema, McpApiKeyStatusSchema, McpOAuthConnectResponseSchema, McpOAuthDisconnectResponseSchema, McpOAuthTokenRequestSchema, McpOAuthTokenResponseSchema, OAuthAuthorizeResponseSchema, OAuthAuthStatusArraySchema, OAuthAuthStatusSchema, OAuthMetadataResponseSchema, SetMcpApiKeyRequestSchema, ToolCollectionObjectSchema, } from './apps.js';
17
17
  import { AuditActionSchema, AuditAggregationDetailFieldSchema, AuditAggregationDetailFilterSchema, AuditAggregationDimensionMapSchema, AuditAggregationDimensionSchema, AuditAggregationDistinctFieldSchema, AuditAggregationFilterSchema, AuditAggregationGroupSchema, AuditAggregationMetricSchema, AuditAggregationOperationSchema, AuditAggregationQuerySchema, AuditAggregationResolutionSchema, AuditAggregationResponseSchema, AuditAggregationRowSchema, AuditMeterSchema, AuditTrailEventSchema, AuditTrailQuerySchema, AuditTrailResponseSchema, EventCategorySchema, KnownAuditActionSchema, } from './audit-trail.js';
18
18
  import { BulkObjectCreateResultSchema, BulkObjectDeleteResultSchema, BulkObjectUpdateResultSchema, BulkOperationPayloadSchema, BulkOperationResponseSchema, BulkOperationResultSchema, } from './bulk-operation.js';
19
19
  import { DeleteCountResultSchema, GenericCommandResponseSchema, MigrationListResponseSchema, RunMigrationPayloadSchema, RunMigrationResponseSchema, } from './commands.js';
@@ -863,17 +863,21 @@ const EVENT_DELIVERY_SCHEMAS = {
863
863
  EventOutboxStatus: EventSchemas.EventOutboxStatusSchema,
864
864
  EventDeliverySortField: EventSchemas.EventDeliverySortFieldSchema,
865
865
  WebhookEventDeliveryTarget: EventSchemas.WebhookEventDeliveryTargetSchema,
866
+ AppEventDeliveryTarget: EventSchemas.AppEventDeliveryTargetSchema,
866
867
  WorkflowEventDeliveryTarget: EventSchemas.WorkflowEventDeliveryTargetSchema,
867
868
  EventDeliveryQueueFailureSummary: EventSchemas.EventDeliveryQueueFailureSummarySchema,
868
869
  EventOutboxQueueSummary: EventSchemas.EventOutboxQueueSummarySchema,
869
870
  EventDeliveryQueueSortField: EventSchemas.EventDeliveryQueueSortFieldSchema,
870
871
  AgentEventDeliveryTarget: EventSchemas.AgentEventDeliveryTargetSchema,
871
872
  WebhookEventDeliveryTargetInput: EventSchemas.WebhookEventDeliveryTargetInputSchema,
873
+ AppEventDeliveryTargetInput: EventSchemas.AppEventDeliveryTargetInputSchema,
872
874
  WorkflowEventDeliveryTargetInput: EventSchemas.WorkflowEventDeliveryTargetInputSchema,
873
875
  SemanticEvaluator: EventSchemas.SemanticEvaluatorSchema,
874
876
  SemanticEvaluationRecord: EventSchemas.SemanticEvaluationRecordSchema,
875
877
  EventDeliveryQueueSubscriptionSummary: EventSchemas.EventDeliveryQueueSubscriptionSummarySchema,
876
878
  EventDeliveryQueueSummaryPayload: EventSchemas.EventDeliveryQueueSummaryPayloadSchema,
879
+ CancelEventDeliveryIntentsPayload: EventSchemas.CancelEventDeliveryIntentsPayloadSchema,
880
+ CancelEventDeliveryIntentsResponse: EventSchemas.CancelEventDeliveryIntentsResponseSchema,
877
881
  EventSemanticCondition: EventSchemas.EventSemanticConditionSchema,
878
882
  EventDeliveryIntentSummary: EventSchemas.EventDeliveryIntentSummarySchema,
879
883
  EventDeliveryQueueSummaryResponse: EventSchemas.EventDeliveryQueueSummaryResponseSchema,
@@ -1071,6 +1075,10 @@ const REMOTE_MCP_SCHEMAS = {
1071
1075
  McpOAuthConnectResponse: McpOAuthConnectResponseSchema,
1072
1076
  OAuthAuthorizeResponse: OAuthAuthorizeResponseSchema,
1073
1077
  OAuthAuthStatusArray: OAuthAuthStatusArraySchema,
1078
+ // The static-key alternative to that handshake: the key itself is write-only, so only the
1079
+ // setter payload and the configured/hint projection are published.
1080
+ SetMcpApiKeyRequest: SetMcpApiKeyRequestSchema,
1081
+ McpApiKeyStatus: McpApiKeyStatusSchema,
1074
1082
  };
1075
1083
  const AUDIT_TRAIL_SCHEMAS = {
1076
1084
  // The audit trail: the events the endpoint pages through and the aggregation it
@@ -1181,6 +1189,7 @@ const APP_LIFECYCLE_SCHEMAS = {
1181
1189
  RunType: RunTypeSchema,
1182
1190
  AppBuildProgressStatus: AppBuildProgressStatusSchema,
1183
1191
  DeleteAppVersionResponse: DeleteAppVersionResponseSchema,
1192
+ AppDeleteSummary: AppDeleteSummarySchema,
1184
1193
  AppRepoBranch: AppRepoBranchSchema,
1185
1194
  AppRepoDocumentCommit: AppRepoDocumentCommitSchema,
1186
1195
  AppVersionGitSource: AppVersionGitSourceSchema,
@@ -1190,6 +1199,8 @@ const APP_LIFECYCLE_SCHEMAS = {
1190
1199
  AppDevelopmentTaskList: AppDevelopmentTaskListSchema,
1191
1200
  OAuthClientCredentialsMap: OAuthClientCredentialsMapSchema,
1192
1201
  AppOAuthCollectionParams: AppOAuthCollectionParamsSchema,
1202
+ McpApiKeyCredential: McpApiKeyCredentialSchema,
1203
+ AppApiKeyCollectionParams: AppApiKeyCollectionParamsSchema,
1193
1204
  AppInspectionIssue: AppInspectionIssueSchema,
1194
1205
  AppScaffoldProgress: AppScaffoldProgressSchema,
1195
1206
  AppRepoTree: AppRepoTreeSchema,
@@ -1333,6 +1344,7 @@ const STS_SCHEMAS = {
1333
1344
  ServiceAccountTokenRequest: StsSchemas.ServiceAccountTokenRequestSchema,
1334
1345
  IssueTokenRequest: StsSchemas.IssueTokenRequestSchema,
1335
1346
  IssueTokenResponse: StsSchemas.IssueTokenResponseSchema,
1347
+ IssueTokenForbiddenResponse: StsSchemas.IssueTokenForbiddenResponseSchema,
1336
1348
  IssueTokenUnavailableResponse: StsSchemas.IssueTokenUnavailableResponseSchema,
1337
1349
  };
1338
1350
  const API_SCHEMA_GROUPS = [
@@ -1413,6 +1425,7 @@ const STRICT_COMPONENTS = new Set([
1413
1425
  'AgentTokenRequest',
1414
1426
  'ServiceAccountTokenRequest',
1415
1427
  'IssueTokenResponse',
1428
+ 'IssueTokenForbiddenResponse',
1416
1429
  'IssueTokenUnavailableResponse',
1417
1430
  'ApiKeyListQuery',
1418
1431
  // These payloads previously referenced closed generated utility components. They now own their
@@ -1560,6 +1573,7 @@ const STRICT_COMPONENTS = new Set([
1560
1573
  'AppUIConfig',
1561
1574
  'AppUINavItem',
1562
1575
  'MCPOAuthConfig',
1576
+ 'MCPApiKeyConfig',
1563
1577
  'MCPToolCollectionObject',
1564
1578
  'VertesiaSDKToolCollectionObject',
1565
1579
  // File, task, content-type and command components. Every one is published closed
@@ -1851,6 +1865,8 @@ const STRICT_COMPONENTS = new Set([
1851
1865
  'ListWorkflowRunsResponse',
1852
1866
  'EventDeliveryQueueSubscriptionSummary',
1853
1867
  'EventDeliveryQueueSummaryPayload',
1868
+ 'CancelEventDeliveryIntentsPayload',
1869
+ 'CancelEventDeliveryIntentsResponse',
1854
1870
  'ContentObjectExportStatusResponse',
1855
1871
  'TimerTask',
1856
1872
  'SignalTask',
@@ -2118,6 +2134,8 @@ const STRICT_COMPONENTS = new Set([
2118
2134
  'McpOAuthDisconnectResponse',
2119
2135
  'McpOAuthConnectResponse',
2120
2136
  'OAuthAuthorizeResponse',
2137
+ 'SetMcpApiKeyRequest',
2138
+ 'McpApiKeyStatus',
2121
2139
  'AuditMeter',
2122
2140
  'AuditAggregationDimensionMap',
2123
2141
  'AuditAggregationRow',
@@ -2171,6 +2189,7 @@ const STRICT_COMPONENTS = new Set([
2171
2189
  'AppInstallationProviderBinding',
2172
2190
  'AppInstallationOAuthBinding',
2173
2191
  'OAuthClientCredentials',
2192
+ 'McpApiKeyCredential',
2174
2193
  'AppInspectionCapabilityReport',
2175
2194
  'AppRepoTreeEntry',
2176
2195
  'AppRepoRef',
@@ -2179,6 +2198,7 @@ const STRICT_COMPONENTS = new Set([
2179
2198
  'InCodeTypeRef',
2180
2199
  'StoredTypeRef',
2181
2200
  'DeleteAppVersionResponse',
2201
+ 'AppDeleteSummary',
2182
2202
  'AppRepoBranch',
2183
2203
  'AppRepoDocumentCommit',
2184
2204
  'AppVersionGitSource',
@@ -2452,15 +2472,96 @@ const validators = new Map();
2452
2472
  * it reuse the compiled form of a component that two others reference.
2453
2473
  */
2454
2474
  let ajvInstance;
2475
+ /**
2476
+ * The published components as AJV can consume them: the same schemas, with the two adjustments
2477
+ * AJV's discriminator support requires and the OpenAPI document must not have.
2478
+ *
2479
+ * `discriminator: true` below is what makes AJV validate a discriminated union through the branch
2480
+ * its tag names, instead of trying every branch and reporting all of their failures at once. The
2481
+ * difference is not cosmetic — a legacy MCP tool collection missing `id` used to report the real
2482
+ * error alongside two impossible ones from the branch it was never meant to match:
2483
+ *
2484
+ * / must have required property 'id' <- the real one
2485
+ * / must NOT have additional properties: oauth_app <- vertesia_sdk branch
2486
+ * /type must be equal to constant <- vertesia_sdk branch
2487
+ * / must match exactly one schema in oneOf
2488
+ *
2489
+ * AJV rejects `mapping` outright ("discriminator: mapping is not supported"), because it derives
2490
+ * the tag-to-branch map from each branch's own `const`/`enum` instead. The OpenAPI document still
2491
+ * needs the mapping — a generated Java or Go client reads it to pick a concrete subtype — so both
2492
+ * fixups here apply to AJV's copy only, and `ApiSchemaComponents` is published exactly as built.
2493
+ *
2494
+ * AJV's remaining requirements — the tag required in every branch, carrying `const` or a
2495
+ * single-valued `enum`, with the union node typed as an object — are what `synthesizeDiscriminator`
2496
+ * in the adapter already checks before it emits a discriminator at all, and what the hand-written
2497
+ * `.meta({ discriminator })` declarations restate. `api-discriminators.test.ts` compiles every
2498
+ * registered component so a union satisfying neither fails the build rather than the request.
2499
+ */
2500
+ function toAjvComponents() {
2501
+ const schemas = structuredClone(ApiSchemaComponents);
2502
+ const resolve = (value) => {
2503
+ if (!isPlainObject(value))
2504
+ return undefined;
2505
+ const ref = value.$ref;
2506
+ if (typeof ref !== 'string' || !ref.startsWith(COMPONENT_REF_PREFIX))
2507
+ return value;
2508
+ return schemas[ref.slice(COMPONENT_REF_PREFIX.length)];
2509
+ };
2510
+ visitSchemaNodes(schemas, (node) => {
2511
+ const discriminator = node.discriminator;
2512
+ if (!isPlainObject(discriminator) || !Array.isArray(node.oneOf))
2513
+ return;
2514
+ // AJV derives the tag-to-branch map from each branch's own literal, so `mapping` is both
2515
+ // redundant and rejected.
2516
+ delete discriminator.mapping;
2517
+ const tag = discriminator.propertyName;
2518
+ if (typeof tag !== 'string')
2519
+ return;
2520
+ for (const member of node.oneOf) {
2521
+ const branch = resolve(member);
2522
+ const properties = branch && isPlainObject(branch.properties) ? branch.properties : undefined;
2523
+ const tagSchema = properties?.[tag];
2524
+ if (!isPlainObject(tagSchema) || tagSchema.const !== undefined || tagSchema.enum !== undefined)
2525
+ continue;
2526
+ // The tag is a `$ref` to a named literal component — `TaskType_ACTIVITY`,
2527
+ // `SupportedIntegrations_gladia` — because the literal carries its own `.meta({ id })`.
2528
+ // AJV reads `properties/<tag>` looking for `const` or `enum` and does not follow a
2529
+ // `$ref` to find one, so it refuses to compile the union at all. Restating the resolved
2530
+ // literal ALONGSIDE the `$ref` is validation-neutral: `$ref` has no special precedence
2531
+ // in 2020-12, both keywords apply, and they carry the same value by construction.
2532
+ const target = resolve(tagSchema);
2533
+ if (!target)
2534
+ continue;
2535
+ if (target.const !== undefined)
2536
+ tagSchema.const = target.const;
2537
+ else if (Array.isArray(target.enum))
2538
+ tagSchema.enum = target.enum;
2539
+ }
2540
+ });
2541
+ return schemas;
2542
+ }
2543
+ /** Every object node in the component graph, parents before children. */
2544
+ function visitSchemaNodes(value, visit) {
2545
+ if (Array.isArray(value)) {
2546
+ for (const item of value)
2547
+ visitSchemaNodes(item, visit);
2548
+ return;
2549
+ }
2550
+ if (!isPlainObject(value))
2551
+ return;
2552
+ visit(value);
2553
+ for (const item of Object.values(value))
2554
+ visitSchemaNodes(item, visit);
2555
+ }
2455
2556
  function getAjv() {
2456
2557
  if (ajvInstance)
2457
2558
  return ajvInstance;
2458
- const ajv = new Ajv2020({ strictSchema: false, allErrors: true });
2559
+ const ajv = new Ajv2020({ strictSchema: false, allErrors: true, discriminator: true });
2459
2560
  // Without this, AJV treats `format` as an annotation and ignores it, so a `date-time` property
2460
2561
  // would document a constraint nothing checks — the exact spec/enforcement gap this design is
2461
2562
  // meant to close.
2462
2563
  addFormats(ajv);
2463
- ajv.addSchema({ $id: 'vertesia://openapi', components: { schemas: ApiSchemaComponents } });
2564
+ ajv.addSchema({ $id: 'vertesia://openapi', components: { schemas: toAjvComponents() } });
2464
2565
  ajvInstance = ajv;
2465
2566
  return ajv;
2466
2567
  }
@@ -2472,17 +2573,68 @@ function getValidator(name) {
2472
2573
  validators.set(name, validate);
2473
2574
  return validate;
2474
2575
  }
2475
- function formatErrors(validate) {
2476
- return (validate.errors ?? []).map((error) => {
2576
+ function additionalProperty(error) {
2577
+ // AJV writes "must NOT have additional properties" and puts the offending key in `params`,
2578
+ // so the message alone says a body is wrong without saying which property made it wrong.
2579
+ // Every other keyword names its subject already — `required` quotes the missing property,
2580
+ // `enum` and `type` describe the value in place — and this is the one a caller most often
2581
+ // trips, so it is the one worth spelling out rather than reformatting all of them.
2582
+ return error.params?.additionalProperty;
2583
+ }
2584
+ /**
2585
+ * The failures, with all undeclared properties at a given path gathered into ONE issue.
2586
+ *
2587
+ * AJV reports `additionalProperties` per property, so a value carrying a whole foreign object —
2588
+ * a Mongoose document that reached the response mapper unmapped, say — produces one error per own
2589
+ * key and buries every other failure in the payload. Gathering is lossless: every name is kept, in
2590
+ * the order AJV found it, on the issue for the path it belongs to.
2591
+ */
2592
+ function collectIssues(validate) {
2593
+ const errors = validate.errors ?? [];
2594
+ const undeclaredByPath = new Map();
2595
+ for (const error of errors) {
2596
+ const additional = additionalProperty(error);
2597
+ if (additional === undefined)
2598
+ continue;
2477
2599
  const where = error.instancePath || '/';
2478
- // AJV writes "must NOT have additional properties" and puts the offending key in `params`,
2479
- // so the message alone says a body is wrong without saying which property made it wrong.
2480
- // Every other keyword names its subject already — `required` quotes the missing property,
2481
- // `enum` and `type` describe the value in place — and this is the one a caller most often
2482
- // trips, so it is the one worth spelling out rather than reformatting all of them.
2483
- const additional = error.params?.additionalProperty;
2484
- return additional ? `${where} ${error.message}: ${additional}` : `${where} ${error.message}`;
2485
- });
2600
+ const names = undeclaredByPath.get(where);
2601
+ // A union whose branches all reject the same property reports it once per branch. The name
2602
+ // is the same fact each time, so it is listed once.
2603
+ if (names)
2604
+ names.add(additional);
2605
+ else
2606
+ undeclaredByPath.set(where, new Set([additional]));
2607
+ }
2608
+ const gathered = new Set();
2609
+ const issues = [];
2610
+ for (const error of errors) {
2611
+ const path = error.instancePath || '/';
2612
+ const message = error.message ?? 'is invalid';
2613
+ if (additionalProperty(error) === undefined) {
2614
+ issues.push({ path, message });
2615
+ continue;
2616
+ }
2617
+ if (gathered.has(path))
2618
+ continue;
2619
+ gathered.add(path);
2620
+ issues.push({ path, message, undeclared: [...(undeclaredByPath.get(path) ?? [])] });
2621
+ }
2622
+ return issues;
2623
+ }
2624
+ /**
2625
+ * The complete rendering of one issue — every name, no budget.
2626
+ *
2627
+ * This is what gets logged. A caller-facing message renders from {@link ApiValidationIssue} itself
2628
+ * with a length limit rather than shortening this string; see `reportableErrors` in the enforcer.
2629
+ */
2630
+ export function renderApiValidationIssue(issue) {
2631
+ const head = `${issue.path} ${issue.message}`;
2632
+ return issue.undeclared?.length ? `${head}: ${issue.undeclared.join(', ')}` : head;
2633
+ }
2634
+ /** The failed branch of every validator here, so the two views cannot be built inconsistently. */
2635
+ function invalidResult(validate) {
2636
+ const issues = collectIssues(validate);
2637
+ return { valid: false, errors: issues.map(renderApiValidationIssue), issues };
2486
2638
  }
2487
2639
  /**
2488
2640
  * Validates an untyped request body against the component the endpoint publishes.
@@ -2501,7 +2653,7 @@ export function validateApiRequest(name, value) {
2501
2653
  if (validate(value)) {
2502
2654
  return { valid: true, data: value };
2503
2655
  }
2504
- return { valid: false, errors: formatErrors(validate) };
2656
+ return invalidResult(validate);
2505
2657
  }
2506
2658
  /**
2507
2659
  * Validates an already-mapped response against the component it is published as.
@@ -2515,7 +2667,7 @@ export function validateApiResponse(name, value) {
2515
2667
  if (validate(value)) {
2516
2668
  return { valid: true, data: value };
2517
2669
  }
2518
- return { valid: false, errors: formatErrors(validate) };
2670
+ return invalidResult(validate);
2519
2671
  }
2520
2672
  /**
2521
2673
  * Best-effort normalization of a response payload towards the fields its published component
@@ -2557,7 +2709,7 @@ export function pruneAndValidateApiResponse(name, value) {
2557
2709
  if (validate(pruned)) {
2558
2710
  return { valid: true, data: pruned };
2559
2711
  }
2560
- return { valid: false, data: pruned, errors: formatErrors(validate) };
2712
+ return { ...invalidResult(validate), data: pruned };
2561
2713
  }
2562
2714
  /**
2563
2715
  * Paths inside a component where pruning cannot narrow. Empty means no STRUCTURAL gaps for