@opengeni/api-router 0.30.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-grant-rls.d.ts +3 -0
- package/dist/admission-trace.d.ts +8 -0
- package/dist/api-websocket.d.ts +18 -0
- package/dist/app.d.ts +50 -2
- package/dist/app.js +12 -1
- package/dist/artifact-catalog-cursor.d.ts +27 -0
- package/dist/auth/managed-auth-attempt-context.d.ts +10 -0
- package/dist/auth/managed-auth-rate-limits.d.ts +167 -0
- package/dist/auth/managed-auth-session-adapter.d.ts +6 -0
- package/dist/auth/managed-auth.d.ts +102 -3
- package/dist/auth/managed-email.d.ts +29 -0
- package/dist/auth/managed-sign-in-notifications.d.ts +4 -0
- package/dist/auth/new-signups-gate.d.ts +23 -0
- package/dist/auth/organization-user-setup.d.ts +80 -0
- package/dist/auth/signup-funnel-metrics.d.ts +44 -0
- package/dist/browser-controller-authority.d.ts +1 -61
- package/dist/browser-ephemeral.d.ts +5 -0
- package/dist/browser-state-authority.d.ts +1 -27
- package/dist/chunk-6TZ5LG3O.js +123948 -0
- package/dist/chunk-6TZ5LG3O.js.map +1 -0
- package/dist/chunk-OGQDXVXY.js +18 -0
- package/dist/chunk-OGQDXVXY.js.map +1 -0
- package/dist/claude-subscription-account-conflicts.d.ts +1 -0
- package/dist/claude-subscription-account-usage.d.ts +39 -0
- package/dist/claude-subscription-oauth.d.ts +25 -0
- package/dist/claude-subscription-profile.d.ts +9 -0
- package/dist/claude-subscription-usage.d.ts +44 -0
- package/dist/claude-workspace-connection.d.ts +15 -0
- package/dist/codemode.d.ts +32 -1
- package/dist/company-brain-okf.d.ts +24 -0
- package/dist/connected-machine-computer-access.d.ts +11 -0
- package/dist/connection-ownership.d.ts +54 -0
- package/dist/controller-data-plane.d.ts +32 -0
- package/dist/editable-artifact-office-import.d.ts +7 -4
- package/dist/editable-artifact-source-session.d.ts +3 -0
- package/dist/editable-artifact-websocket.d.ts +10 -18
- package/dist/editable-artifact-workspace-files.d.ts +1 -1
- package/dist/fatal-process-boundary.d.ts +25 -0
- package/dist/github-access.d.ts +31 -2
- package/dist/http/acting-person.d.ts +24 -0
- package/dist/http/api-contract-compat.d.ts +19 -0
- package/dist/http/api-error.d.ts +27 -1
- package/dist/http/cors.d.ts +17 -0
- package/dist/http/deprecation.d.ts +42 -0
- package/dist/http/interaction-control-error.d.ts +13 -0
- package/dist/http/keyed-admission.d.ts +12 -0
- package/dist/http/local-browser-boundary.d.ts +72 -0
- package/dist/http/metrics-listener.d.ts +22 -0
- package/dist/http/path-identifier.d.ts +17 -0
- package/dist/http/registered-route-label.d.ts +16 -0
- package/dist/http/request-body.d.ts +27 -0
- package/dist/http/request-source.d.ts +52 -0
- package/dist/http/sse.d.ts +17 -6
- package/dist/http/unmatched-route.d.ts +18 -0
- package/dist/http/user-content.d.ts +36 -0
- package/dist/http/websocket-upgrade-dispatch.d.ts +18 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.js +1129 -166
- package/dist/index.js.map +1 -1
- package/dist/integration-endpoint-test.d.ts +20 -0
- package/dist/integrations/api-integrations.d.ts +2 -2
- package/dist/integrations/atlassian.d.ts +29 -3
- package/dist/integrations/connect-authority.d.ts +1 -0
- package/dist/integrations/connect-callback-return.d.ts +6 -0
- package/dist/integrations/fiken.d.ts +16 -2
- package/dist/integrations/github-app-connect.d.ts +47 -0
- package/dist/integrations/github-installation-proof.d.ts +3 -0
- package/dist/integrations/github-lens-connect.d.ts +116 -0
- package/dist/integrations/github-skill-source.d.ts +1 -5
- package/dist/integrations/google-drive.d.ts +25 -0
- package/dist/integrations/integration-commit-authority.d.ts +13 -0
- package/dist/integrations/marketplace-plugin.d.ts +2691 -0
- package/dist/integrations/oauth-client.d.ts +178 -18
- package/dist/integrations/oauth-profiles.d.ts +222 -0
- package/dist/integrations/oauth-return-path.d.ts +1 -0
- package/dist/integrations/personal-github-repositories.d.ts +84 -0
- package/dist/integrations/personal-github.d.ts +42 -0
- package/dist/integrations/pr-review-provider.d.ts +22 -0
- package/dist/integrations/provider-oauth.d.ts +19 -1
- package/dist/integrations/slack-app-home.d.ts +24 -0
- package/dist/integrations/slack-bot.d.ts +367 -12
- package/dist/integrations/slack-file-upload-flow.d.ts +62 -0
- package/dist/integrations/slack-install.d.ts +20 -0
- package/dist/integrations/slack-interactions.d.ts +113 -10
- package/dist/integrations/slack-mrkdwn.d.ts +41 -0
- package/dist/integrations/slack-routing.d.ts +120 -0
- package/dist/integrations/slack-session-defaults.d.ts +58 -0
- package/dist/integrations/slack-task-file-upload.d.ts +36 -0
- package/dist/integrations/social-oauth.d.ts +7 -0
- package/dist/interaction-agent-access.d.ts +15 -0
- package/dist/interaction-frame-proxy.d.ts +68 -0
- package/dist/interaction-metrics.d.ts +2 -0
- package/dist/mcp/action-catalog-types.d.ts +9 -0
- package/dist/mcp/action-catalog.gen.d.ts +2 -0
- package/dist/mcp/capability-account-readiness.d.ts +7 -0
- package/dist/mcp/child-read-evidence.d.ts +9 -0
- package/dist/mcp/command-read.d.ts +24 -0
- package/dist/mcp/company-profile-agent-admin.d.ts +44 -0
- package/dist/mcp/contract-input.d.ts +11 -0
- package/dist/mcp/documents.d.ts +7 -5
- package/dist/mcp/files.d.ts +2 -2
- package/dist/mcp/first-party-tool-permissions.d.ts +650 -0
- package/dist/mcp/knowledge-entries.d.ts +5 -0
- package/dist/mcp/orchestration-failure-diagnostic.d.ts +43 -0
- package/dist/mcp/receipts.d.ts +9 -0
- package/dist/mcp/request-abort.d.ts +19 -0
- package/dist/mcp/scheduled-task-input.d.ts +1189 -0
- package/dist/mcp/scheduled-task-view.d.ts +22 -4
- package/dist/mcp/server.d.ts +255 -3
- package/dist/mcp/session-event-view.d.ts +94 -0
- package/dist/mcp/session-view.d.ts +66 -2
- package/dist/mcp/session-wait.d.ts +174 -0
- package/dist/mcp-oauth.d.ts +52 -0
- package/dist/model-catalog.d.ts +11 -31
- package/dist/observability.d.ts +3 -1
- package/dist/organization-mcp.d.ts +52 -0
- package/dist/organization-recovery-notifications.d.ts +41 -0
- package/dist/routes/analytics-consent.d.ts +26 -0
- package/dist/routes/api-integrations.d.ts +25 -0
- package/dist/routes/api-keys.d.ts +17 -0
- package/dist/routes/artifact-catalog.d.ts +6 -0
- package/dist/routes/automations.d.ts +19 -0
- package/dist/routes/billing.d.ts +49 -0
- package/dist/routes/browser-sessions.d.ts +71 -3
- package/dist/routes/claude-subscription-accounts.d.ts +3 -0
- package/dist/routes/claude-subscription-oauth.d.ts +3 -0
- package/dist/routes/client-errors.d.ts +146 -0
- package/dist/routes/codex.d.ts +76 -2
- package/dist/routes/company-brain.d.ts +3 -0
- package/dist/routes/company-profile.d.ts +2 -1
- package/dist/routes/computer-sessions.d.ts +14 -0
- package/dist/routes/connect.d.ts +5 -0
- package/dist/routes/editable-artifacts.d.ts +2 -0
- package/dist/routes/external-identity-links.d.ts +6 -0
- package/dist/routes/feedback.d.ts +3 -0
- package/dist/routes/files.d.ts +4 -0
- package/dist/routes/github-browser-pages.d.ts +12 -0
- package/dist/routes/github.d.ts +2 -0
- package/dist/routes/insights-response-cache.d.ts +10 -0
- package/dist/routes/insights-usage.d.ts +12 -0
- package/dist/routes/insights.d.ts +30 -1
- package/dist/routes/knowledge.d.ts +3 -0
- package/dist/routes/managed-auth-session-sets.d.ts +26 -0
- package/dist/routes/managed-onboarding.d.ts +29 -0
- package/dist/routes/managed-sign-in-methods.d.ts +6 -0
- package/dist/routes/model-connection-access.d.ts +3 -0
- package/dist/routes/organization-integration-policy.d.ts +3 -0
- package/dist/routes/organization-integrations.d.ts +6 -0
- package/dist/routes/organization-mcp-connections.d.ts +3 -0
- package/dist/routes/organization-model-providers.d.ts +3 -0
- package/dist/routes/organization-recovery.d.ts +19 -0
- package/dist/routes/organization-service-accounts.d.ts +3 -0
- package/dist/routes/organization-sessions.d.ts +26 -0
- package/dist/routes/personal-github-git-broker.d.ts +29 -0
- package/dist/routes/personal-github.d.ts +3 -0
- package/dist/routes/pr-review-github.d.ts +3 -0
- package/dist/routes/pr-review.d.ts +3 -0
- package/dist/routes/session-artifact-associations.d.ts +4 -0
- package/dist/routes/session-history-imports.d.ts +9 -0
- package/dist/routes/sessions.d.ts +44 -6
- package/dist/routes/skill-content.d.ts +4 -0
- package/dist/routes/skill-install-authority.d.ts +6 -0
- package/dist/routes/subscription-account-pools.d.ts +34 -0
- package/dist/routes/subscription-pool-access.d.ts +16 -0
- package/dist/routes/supergrok.d.ts +6 -1
- package/dist/routes/usage-allowances.d.ts +12 -0
- package/dist/routes/user-resource-authorities.d.ts +3 -0
- package/dist/routes/workspace-artifacts.d.ts +2 -1
- package/dist/routes/workspace-capture.d.ts +10 -2
- package/dist/routes/workspace-integrations.d.ts +35 -0
- package/dist/routes/workspace-learning.d.ts +3 -0
- package/dist/routes/workspace-model-providers.d.ts +4 -0
- package/dist/routes/workspaces.d.ts +29 -0
- package/dist/sandbox/auth-callout.d.ts +8 -0
- package/dist/sandbox/channel-a.d.ts +19 -1
- package/dist/sandbox/connection-authority.d.ts +3 -0
- package/dist/sandbox/enrollment.d.ts +9 -1
- package/dist/sandbox/machines.d.ts +5 -2
- package/dist/sandbox/metrics-ingestion.d.ts +28 -20
- package/dist/sandbox/rematerialize.d.ts +2 -0
- package/dist/sandbox/session-attach-variable-sets.d.ts +30 -0
- package/dist/sandbox/viewer.d.ts +26 -1
- package/dist/sandbox-file-artifacts.d.ts +50 -0
- package/dist/scheduled-task-deletion.d.ts +13 -0
- package/dist/session-create-observability.d.ts +5 -0
- package/dist/session-event-view-MPS2OZD3.js +292 -0
- package/dist/session-event-view-MPS2OZD3.js.map +1 -0
- package/dist/site-session-origin.d.ts +13 -0
- package/dist/site-uploads.d.ts +41 -0
- package/dist/slack-reaction-files.d.ts +1 -1
- package/dist/temporal-schedule-cleanup.d.ts +1 -0
- package/dist/temporal-schedule-sync.d.ts +26 -0
- package/dist/transcription/providers/xai-subscription.d.ts +1 -0
- package/dist/transcription/service.d.ts +2 -1
- package/dist/work-discovery-observability.d.ts +33 -0
- package/dist/workspace-artifact-content.d.ts +28 -0
- package/dist/workspace-artifact-provenance.d.ts +7 -0
- package/dist/workspace-delete-observability.d.ts +10 -0
- package/dist/workspace-deletion.d.ts +6 -0
- package/dist/workspace-state-projection.d.ts +3 -5
- package/dist/workspace-tool-gateway-observability.d.ts +17 -0
- package/dist/workspace-tool-gateway.d.ts +123 -0
- package/dist/workspace-webhook-dispatch.d.ts +26 -0
- package/package.json +23 -19
- package/src/access-grant-rls.ts +75 -0
- package/src/admission-trace.ts +14 -0
- package/src/api-websocket.ts +23 -0
- package/src/app.ts +1974 -256
- package/src/artifact-catalog-cursor.ts +60 -0
- package/src/auth/managed-auth-attempt-context.ts +70 -0
- package/src/auth/managed-auth-rate-limits.ts +252 -0
- package/src/auth/managed-auth-session-adapter.ts +222 -0
- package/src/auth/managed-auth.ts +536 -60
- package/src/auth/managed-email.ts +174 -0
- package/src/auth/managed-sign-in-notifications.ts +81 -0
- package/src/auth/new-signups-gate.ts +49 -0
- package/src/auth/organization-user-setup.ts +307 -0
- package/src/auth/signup-funnel-metrics.ts +164 -0
- package/src/browser-controller-authority.ts +1 -186
- package/src/browser-ephemeral.ts +39 -0
- package/src/browser-state-authority.ts +1 -236
- package/src/claude-subscription-account-conflicts.ts +12 -0
- package/src/claude-subscription-account-usage.ts +48 -0
- package/src/claude-subscription-oauth.ts +362 -0
- package/src/claude-subscription-profile.ts +73 -0
- package/src/claude-subscription-usage.ts +97 -0
- package/src/claude-workspace-connection.ts +82 -0
- package/src/codemode.ts +194 -30
- package/src/codex-realtime.ts +8 -2
- package/src/company-brain-okf.ts +340 -0
- package/src/connected-machine-computer-access.ts +33 -0
- package/src/connection-ownership.ts +199 -0
- package/src/controller-data-plane.ts +81 -0
- package/src/editable-artifact-native-kernel.ts +26 -15
- package/src/editable-artifact-office-import.ts +77 -9
- package/src/editable-artifact-production.ts +23 -7
- package/src/editable-artifact-source-session.ts +123 -0
- package/src/editable-artifact-websocket.ts +27 -21
- package/src/editable-artifact-workspace-files.ts +31 -6
- package/src/fatal-process-boundary.ts +246 -0
- package/src/gateway-realtime.ts +1 -1
- package/src/github-access.ts +147 -5
- package/src/http/acting-person.ts +71 -0
- package/src/http/api-contract-compat.ts +49 -0
- package/src/http/api-error.ts +115 -1
- package/src/http/auth.ts +48 -0
- package/src/http/cors.ts +67 -0
- package/src/http/deprecation.ts +118 -0
- package/src/http/interaction-control-error.ts +164 -0
- package/src/http/keyed-admission.ts +29 -0
- package/src/http/local-browser-boundary.ts +343 -0
- package/src/http/metrics-listener.ts +57 -0
- package/src/http/path-identifier.ts +54 -0
- package/src/http/registered-route-label.ts +34 -0
- package/src/http/request-body.ts +127 -0
- package/src/http/request-source.ts +178 -0
- package/src/http/sse.ts +486 -132
- package/src/http/unmatched-route.ts +60 -0
- package/src/http/user-content.ts +158 -0
- package/src/http/websocket-upgrade-dispatch.ts +29 -0
- package/src/index.ts +157 -52
- package/src/integration-endpoint-test.ts +291 -0
- package/src/integrations/api-integrations.ts +98 -11
- package/src/integrations/atlassian.ts +474 -136
- package/src/integrations/connect-authority.ts +2 -0
- package/src/integrations/connect-callback-return.ts +86 -0
- package/src/integrations/fiken.ts +354 -64
- package/src/integrations/github-app-connect.ts +435 -0
- package/src/integrations/github-installation-proof.ts +60 -0
- package/src/integrations/github-lens-connect.ts +76 -0
- package/src/integrations/github-skill-source.ts +2 -142
- package/src/integrations/google-drive.ts +820 -222
- package/src/integrations/integration-commit-authority.ts +69 -0
- package/src/integrations/marketplace-plugin.ts +48 -0
- package/src/integrations/oauth-client.ts +1356 -459
- package/src/integrations/oauth-profiles.ts +537 -0
- package/src/integrations/oauth-return-path.ts +18 -0
- package/src/integrations/personal-github-repositories.ts +674 -0
- package/src/integrations/personal-github.ts +825 -0
- package/src/integrations/pr-review-provider.ts +246 -0
- package/src/integrations/provider-oauth.ts +250 -22
- package/src/integrations/slack-app-home.ts +300 -0
- package/src/integrations/slack-bot.ts +963 -239
- package/src/integrations/slack-file-upload-flow.ts +147 -0
- package/src/integrations/slack-install.ts +83 -0
- package/src/integrations/slack-interactions.ts +3170 -474
- package/src/integrations/slack-mrkdwn.ts +193 -0
- package/src/integrations/slack-routing.ts +337 -0
- package/src/integrations/slack-session-defaults.ts +224 -0
- package/src/integrations/slack-task-file-upload.ts +323 -0
- package/src/integrations/social-oauth.ts +213 -15
- package/src/interaction-agent-access.ts +48 -0
- package/src/interaction-frame-proxy.ts +409 -0
- package/src/interaction-metrics.ts +30 -0
- package/src/mcp/action-catalog-types.ts +9 -0
- package/src/mcp/action-catalog.gen.ts +6696 -0
- package/src/mcp/capability-account-readiness.ts +17 -0
- package/src/mcp/child-read-evidence.ts +19 -0
- package/src/mcp/command-read.ts +109 -0
- package/src/mcp/company-profile-agent-admin.ts +198 -0
- package/src/mcp/contract-input.ts +141 -0
- package/src/mcp/documents.ts +65 -377
- package/src/mcp/editable-artifacts.ts +12 -6
- package/src/mcp/files.ts +80 -38
- package/src/mcp/first-party-tool-permissions.ts +305 -0
- package/src/mcp/knowledge-entries.ts +322 -0
- package/src/mcp/orchestration-failure-diagnostic.ts +43 -0
- package/src/mcp/receipts.ts +34 -0
- package/src/mcp/request-abort.ts +44 -0
- package/src/mcp/scheduled-task-input.ts +76 -0
- package/src/mcp/scheduled-task-view.ts +44 -3
- package/src/mcp/server.ts +3030 -1267
- package/src/mcp/session-event-view.ts +383 -0
- package/src/mcp/session-view.ts +84 -3
- package/src/mcp/session-wait.ts +665 -0
- package/src/mcp-oauth.ts +1123 -0
- package/src/model-catalog.ts +91 -333
- package/src/observability.ts +15 -1
- package/src/organization-mcp.ts +397 -0
- package/src/organization-recovery-notifications.ts +103 -0
- package/src/routes/analytics-consent.ts +123 -0
- package/src/routes/api-integrations.ts +364 -74
- package/src/routes/api-keys.ts +336 -10
- package/src/routes/artifact-catalog.ts +279 -0
- package/src/routes/automations.ts +768 -0
- package/src/routes/billing.ts +461 -46
- package/src/routes/browser-sessions.ts +839 -131
- package/src/routes/canonical-human-identities.ts +90 -14
- package/src/routes/capabilities.ts +107 -6
- package/src/routes/channels.ts +20 -3
- package/src/routes/claude-subscription-accounts.ts +334 -0
- package/src/routes/claude-subscription-oauth.ts +142 -0
- package/src/routes/client-errors.ts +362 -0
- package/src/routes/codex.ts +833 -116
- package/src/routes/company-brain.ts +322 -0
- package/src/routes/company-profile.ts +65 -1
- package/src/routes/computer-sessions.ts +557 -106
- package/src/routes/connect.ts +1938 -0
- package/src/routes/connections.ts +1040 -349
- package/src/routes/documents.ts +488 -287
- package/src/routes/editable-artifacts.ts +79 -9
- package/src/routes/enrollments.ts +135 -39
- package/src/routes/environments.ts +154 -58
- package/src/routes/external-identity-links.ts +201 -0
- package/src/routes/feedback.ts +113 -0
- package/src/routes/files.ts +337 -39
- package/src/routes/github-browser-pages.ts +162 -0
- package/src/routes/github.ts +446 -144
- package/src/routes/insights-response-cache.ts +83 -0
- package/src/routes/insights-usage.ts +345 -0
- package/src/routes/insights.ts +153 -19
- package/src/routes/install.ts +133 -38
- package/src/routes/integration-facets.ts +107 -33
- package/src/routes/interaction-resources.ts +30 -3
- package/src/routes/knowledge.ts +488 -0
- package/src/routes/machines.ts +313 -15
- package/src/routes/managed-auth-session-sets.ts +1218 -0
- package/src/routes/managed-onboarding.ts +337 -0
- package/src/routes/managed-sign-in-methods.ts +433 -0
- package/src/routes/memory-slack-publications.ts +3 -2
- package/src/routes/model-connection-access.ts +208 -0
- package/src/routes/organization-integration-policy.ts +116 -0
- package/src/routes/organization-integrations.ts +326 -0
- package/src/routes/organization-mcp-connections.ts +178 -0
- package/src/routes/organization-memberships.ts +1019 -27
- package/src/routes/organization-model-providers.ts +293 -0
- package/src/routes/organization-recovery.ts +325 -0
- package/src/routes/organization-service-accounts.ts +128 -0
- package/src/routes/organization-sessions.ts +350 -0
- package/src/routes/personal-github-git-broker.ts +785 -0
- package/src/routes/personal-github.ts +370 -0
- package/src/routes/plugins.ts +251 -22
- package/src/routes/pr-review-github.ts +881 -0
- package/src/routes/pr-review.ts +622 -0
- package/src/routes/preference-registry.ts +12 -93
- package/src/routes/rigs.ts +167 -50
- package/src/routes/scheduled-tasks.ts +346 -41
- package/src/routes/session-artifact-associations.ts +87 -0
- package/src/routes/session-history-imports.ts +280 -0
- package/src/routes/sessions.ts +2306 -264
- package/src/routes/skill-content.ts +297 -0
- package/src/routes/skill-install-authority.ts +64 -0
- package/src/routes/skills.ts +62 -9
- package/src/routes/social.ts +46 -18
- package/src/routes/subscription-account-pools.ts +436 -0
- package/src/routes/subscription-pool-access.ts +126 -0
- package/src/routes/supergrok.ts +219 -303
- package/src/routes/transcription-recordings.ts +38 -3
- package/src/routes/transcriptions.ts +4 -0
- package/src/routes/usage-allowances.ts +378 -0
- package/src/routes/user-resource-authorities.ts +138 -0
- package/src/routes/video-generation.ts +14 -10
- package/src/routes/workspace-artifacts.ts +275 -69
- package/src/routes/workspace-capture.ts +21 -0
- package/src/routes/workspace-integrations.ts +576 -0
- package/src/routes/workspace-learning.ts +159 -0
- package/src/routes/workspace-model-providers.ts +148 -0
- package/src/routes/workspace-state.ts +38 -25
- package/src/routes/workspaces.ts +1004 -127
- package/src/sandbox/auth-callout.ts +96 -19
- package/src/sandbox/channel-a.ts +323 -24
- package/src/sandbox/connection-authority.ts +3 -0
- package/src/sandbox/enrollment.ts +81 -6
- package/src/sandbox/machines.ts +218 -76
- package/src/sandbox/metrics-ingestion.ts +411 -62
- package/src/sandbox/rematerialize.ts +121 -19
- package/src/sandbox/session-attach-variable-sets.ts +131 -0
- package/src/sandbox/viewer.ts +280 -25
- package/src/sandbox-file-artifacts.ts +413 -0
- package/src/scheduled-task-deletion.ts +138 -0
- package/src/session-create-observability.ts +46 -0
- package/src/session-realtime-context.ts +6 -3
- package/src/site-session-origin.ts +48 -0
- package/src/site-uploads.ts +224 -0
- package/src/slack-reaction-files.ts +16 -5
- package/src/temporal-schedule-cleanup.ts +13 -0
- package/src/temporal-schedule-sync.ts +74 -0
- package/src/transcription/providers/codex-subscription.ts +2 -0
- package/src/transcription/providers/openai.ts +1 -0
- package/src/transcription/providers/xai-subscription.ts +49 -3
- package/src/transcription/segmenter.ts +8 -2
- package/src/transcription/service.ts +43 -6
- package/src/work-discovery-observability.ts +121 -0
- package/src/workspace-artifact-content.ts +144 -0
- package/src/workspace-artifact-provenance.ts +104 -0
- package/src/workspace-delete-observability.ts +75 -0
- package/src/workspace-deletion.ts +73 -0
- package/src/workspace-state-projection.ts +18 -148
- package/src/workspace-tool-gateway-observability.ts +100 -0
- package/src/workspace-tool-gateway.ts +870 -0
- package/src/workspace-webhook-dispatch.ts +190 -0
- package/src/xai-subscription-auth.ts +9 -2
- package/dist/chunk-2PQMSRCB.js +0 -49759
- package/dist/chunk-2PQMSRCB.js.map +0 -1
- package/dist/routes/packs.d.ts +0 -3
- package/src/routes/packs.ts +0 -729
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ActivatePreferenceRegistryRevisionRequest,
|
|
3
2
|
ChangePreferenceRegistryScopeRequest,
|
|
4
|
-
CorrectPreferenceRegistryRequest,
|
|
5
|
-
CreatePreferenceRegistryProposalRequest,
|
|
6
3
|
DeactivatePreferenceRegistryRequest,
|
|
7
4
|
PreferenceRegistryConflictResponse,
|
|
8
5
|
PreferenceRegistryDetailResponse,
|
|
@@ -11,7 +8,6 @@ import {
|
|
|
11
8
|
PreferenceRegistryListQuery,
|
|
12
9
|
PreferenceRegistryListResponse,
|
|
13
10
|
PreferenceRegistryMutationResponse,
|
|
14
|
-
PreferenceRegistryRecord,
|
|
15
11
|
PreferenceRegistrySnapshot,
|
|
16
12
|
RejectPreferenceRegistryProposalRequest,
|
|
17
13
|
SupersedePreferenceRegistryRequest,
|
|
@@ -26,10 +22,7 @@ import {
|
|
|
26
22
|
type ApiRouteDeps,
|
|
27
23
|
} from "@opengeni/core";
|
|
28
24
|
import {
|
|
29
|
-
activatePreferenceRegistryRevision,
|
|
30
25
|
changePreferenceRegistryScope,
|
|
31
|
-
correctPreferenceRegistry,
|
|
32
|
-
createPreferenceRegistryProposal,
|
|
33
26
|
deactivatePreferenceRegistry,
|
|
34
27
|
getOrCreatePreferenceRegistrySnapshot,
|
|
35
28
|
getPreferenceRegistryDetail,
|
|
@@ -214,34 +207,20 @@ export function registerPreferenceRegistryRoutes(app: Hono, deps: ApiRouteDeps):
|
|
|
214
207
|
}
|
|
215
208
|
});
|
|
216
209
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
context,
|
|
221
|
-
deps,
|
|
222
|
-
workspaceId,
|
|
223
|
-
"workspace:read",
|
|
224
|
-
);
|
|
225
|
-
const { grant } = access;
|
|
226
|
-
const request = await parseBody(context, CreatePreferenceRegistryProposalRequest);
|
|
227
|
-
authorizePreferenceRegistryScopeMutation(access, request.scope);
|
|
228
|
-
try {
|
|
210
|
+
// Retain an explicit migration response, not a second single-text writer.
|
|
211
|
+
for (const path of ["/proposals", "/:preferenceId/activate", "/:preferenceId/correct"]) {
|
|
212
|
+
app.post(`${base}${path}`, async (context) => {
|
|
213
|
+
await requireAccessGrant(context, deps, context.req.param("workspaceId"), "workspace:read");
|
|
229
214
|
return context.json(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
principalKind: grant.principalKind,
|
|
237
|
-
}),
|
|
238
|
-
),
|
|
239
|
-
201,
|
|
215
|
+
{
|
|
216
|
+
code: "SKILL_FILE_LIFECYCLE_REQUIRED",
|
|
217
|
+
message:
|
|
218
|
+
"Use the Skill content save, approve, or restore API. Skill metadata comes from SKILL.md frontmatter; this legacy endpoint makes no change.",
|
|
219
|
+
},
|
|
220
|
+
410,
|
|
240
221
|
);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
});
|
|
222
|
+
});
|
|
223
|
+
}
|
|
245
224
|
|
|
246
225
|
app.get(`${base}/summary`, async (context) => {
|
|
247
226
|
const workspaceId = context.req.param("workspaceId");
|
|
@@ -300,66 +279,6 @@ export function registerPreferenceRegistryRoutes(app: Hono, deps: ApiRouteDeps):
|
|
|
300
279
|
}
|
|
301
280
|
});
|
|
302
281
|
|
|
303
|
-
app.post(`${base}/:preferenceId/activate`, async (context) => {
|
|
304
|
-
const workspaceId = context.req.param("workspaceId");
|
|
305
|
-
const access = await requireAccessGrantAuthorization(
|
|
306
|
-
context,
|
|
307
|
-
deps,
|
|
308
|
-
workspaceId,
|
|
309
|
-
"workspace:read",
|
|
310
|
-
);
|
|
311
|
-
const { grant } = access;
|
|
312
|
-
const id = preferenceId(context);
|
|
313
|
-
const request = await parseBody(context, ActivatePreferenceRegistryRevisionRequest);
|
|
314
|
-
try {
|
|
315
|
-
return context.json(
|
|
316
|
-
PreferenceRegistryMutationResponse.parse(
|
|
317
|
-
await activatePreferenceRegistryRevision(deps.db, {
|
|
318
|
-
accountId: grant.accountId,
|
|
319
|
-
workspaceId,
|
|
320
|
-
actorSubjectId: grant.subjectId,
|
|
321
|
-
principalKind: grant.principalKind,
|
|
322
|
-
preferenceId: id,
|
|
323
|
-
authorizeScope: (scope) => authorizePreferenceRegistryScopeMutation(access, scope),
|
|
324
|
-
...request,
|
|
325
|
-
}),
|
|
326
|
-
),
|
|
327
|
-
);
|
|
328
|
-
} catch (error) {
|
|
329
|
-
return preferenceError(context, error);
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
app.post(`${base}/:preferenceId/correct`, async (context) => {
|
|
334
|
-
const workspaceId = context.req.param("workspaceId");
|
|
335
|
-
const access = await requireAccessGrantAuthorization(
|
|
336
|
-
context,
|
|
337
|
-
deps,
|
|
338
|
-
workspaceId,
|
|
339
|
-
"workspace:read",
|
|
340
|
-
);
|
|
341
|
-
const { grant } = access;
|
|
342
|
-
const id = preferenceId(context);
|
|
343
|
-
const request = await parseBody(context, CorrectPreferenceRegistryRequest);
|
|
344
|
-
try {
|
|
345
|
-
return context.json(
|
|
346
|
-
PreferenceRegistryMutationResponse.parse(
|
|
347
|
-
await correctPreferenceRegistry(deps.db, {
|
|
348
|
-
...request,
|
|
349
|
-
accountId: grant.accountId,
|
|
350
|
-
workspaceId,
|
|
351
|
-
actorSubjectId: grant.subjectId,
|
|
352
|
-
principalKind: grant.principalKind,
|
|
353
|
-
preferenceId: id,
|
|
354
|
-
authorizeScope: (scope) => authorizePreferenceRegistryScopeMutation(access, scope),
|
|
355
|
-
}),
|
|
356
|
-
),
|
|
357
|
-
);
|
|
358
|
-
} catch (error) {
|
|
359
|
-
return preferenceError(context, error);
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
|
|
363
282
|
app.post(`${base}/:preferenceId/scope`, async (context) => {
|
|
364
283
|
const workspaceId = context.req.param("workspaceId");
|
|
365
284
|
const access = await requireAccessGrantAuthorization(
|
package/src/routes/rigs.ts
CHANGED
|
@@ -10,8 +10,14 @@ import {
|
|
|
10
10
|
RigChangeTransitionError,
|
|
11
11
|
} from "@opengeni/db";
|
|
12
12
|
import type { Hono } from "hono";
|
|
13
|
+
import type { Context } from "hono";
|
|
13
14
|
import { HTTPException } from "hono/http-exception";
|
|
14
|
-
import {
|
|
15
|
+
import type { ZodType } from "zod";
|
|
16
|
+
import {
|
|
17
|
+
requireAccessGrant,
|
|
18
|
+
requireAccessGrantAuthorization,
|
|
19
|
+
requirePermission,
|
|
20
|
+
} from "@opengeni/core";
|
|
15
21
|
import type { ApiRouteDeps } from "@opengeni/core";
|
|
16
22
|
import {
|
|
17
23
|
activateRigVersionForApi,
|
|
@@ -27,10 +33,64 @@ import {
|
|
|
27
33
|
updateRigForApi,
|
|
28
34
|
} from "@opengeni/core";
|
|
29
35
|
import { boundedLimit } from "../http/common";
|
|
36
|
+
import { ApiHttpError } from "../http/api-error";
|
|
37
|
+
|
|
38
|
+
async function parseRigRequest<T>(c: Context, schema: ZodType<T>, label: string): Promise<T> {
|
|
39
|
+
const body: unknown = await c.req.json().catch(() => null);
|
|
40
|
+
const bodyRecord = body && typeof body === "object" ? (body as Record<string, unknown>) : null;
|
|
41
|
+
const payloadRecord =
|
|
42
|
+
bodyRecord?.payload && typeof bodyRecord.payload === "object"
|
|
43
|
+
? (bodyRecord.payload as Record<string, unknown>)
|
|
44
|
+
: null;
|
|
45
|
+
const imageOverrideUnsupported = Boolean(
|
|
46
|
+
(bodyRecord && Object.hasOwn(bodyRecord, "image")) ||
|
|
47
|
+
(payloadRecord && Object.hasOwn(payloadRecord, "image")),
|
|
48
|
+
);
|
|
49
|
+
const parsed = schema.safeParse(body);
|
|
50
|
+
if (parsed.success && !imageOverrideUnsupported) return parsed.data;
|
|
51
|
+
throw new ApiHttpError(422, {
|
|
52
|
+
code: "validation_failed",
|
|
53
|
+
message: imageOverrideUnsupported
|
|
54
|
+
? "Sandbox Environment base-image overrides are not supported; Sandbox Environments use the deployment-managed platform sandbox."
|
|
55
|
+
: `Invalid ${label}.`,
|
|
56
|
+
retryable: false,
|
|
57
|
+
details: {
|
|
58
|
+
...(imageOverrideUnsupported ? { code: "RIG_IMAGE_OVERRIDE_UNSUPPORTED" } : {}),
|
|
59
|
+
fields: parsed.success
|
|
60
|
+
? []
|
|
61
|
+
: parsed.error.issues.slice(0, 16).map((issue) => ({
|
|
62
|
+
path: issue.path,
|
|
63
|
+
code: issue.code,
|
|
64
|
+
})),
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
30
68
|
|
|
31
69
|
export function registerRigRoutes(app: Hono, deps: ApiRouteDeps): void {
|
|
32
70
|
const { db, workflowClient } = deps;
|
|
33
71
|
|
|
72
|
+
async function requireRigMutation(
|
|
73
|
+
c: Context,
|
|
74
|
+
workspaceId: string,
|
|
75
|
+
permission: "rigs:manage" | "rigs:use",
|
|
76
|
+
) {
|
|
77
|
+
const authorization = await requireAccessGrantAuthorization(c, deps, workspaceId, permission);
|
|
78
|
+
const rigId = c.req.param("rigId");
|
|
79
|
+
if (!rigId) {
|
|
80
|
+
throw new HTTPException(400, { message: "sandbox environment id is required" });
|
|
81
|
+
}
|
|
82
|
+
const rig = await requireRigForApi(db, authorization.grant, rigId);
|
|
83
|
+
if (
|
|
84
|
+
rig.scope === "organization" &&
|
|
85
|
+
authorization.accountGrant?.permissions.includes("account:admin") !== true
|
|
86
|
+
) {
|
|
87
|
+
throw new HTTPException(403, {
|
|
88
|
+
message: "missing permission: account:admin",
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return { authorization, grant: authorization.grant, rig };
|
|
92
|
+
}
|
|
93
|
+
|
|
34
94
|
async function startChangeVerification(
|
|
35
95
|
workspaceId: string,
|
|
36
96
|
changeId: string,
|
|
@@ -66,7 +126,7 @@ export function registerRigRoutes(app: Hono, deps: ApiRouteDeps): void {
|
|
|
66
126
|
// The verifying transition already committed. Keep its deterministic
|
|
67
127
|
// attempt identity retryable instead of reporting an opaque 5xx after a
|
|
68
128
|
// durable mutation or inventing a second attempt after an ambiguous start.
|
|
69
|
-
deps.observability?.warn("
|
|
129
|
+
deps.observability?.warn("sandbox environment change verification start failed", {
|
|
70
130
|
workspaceId,
|
|
71
131
|
changeId,
|
|
72
132
|
attempt,
|
|
@@ -103,26 +163,45 @@ export function registerRigRoutes(app: Hono, deps: ApiRouteDeps): void {
|
|
|
103
163
|
// Creation already committed. The rig remains fully usable through its
|
|
104
164
|
// runtime setup fallback and can be re-verified explicitly; never turn a
|
|
105
165
|
// successful create into an unretryable 5xx because Temporal was down.
|
|
106
|
-
deps.observability?.warn(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
166
|
+
deps.observability?.warn(
|
|
167
|
+
"initial sandbox environment provider-image verification start failed",
|
|
168
|
+
{
|
|
169
|
+
workspaceId,
|
|
170
|
+
versionId,
|
|
171
|
+
error: error instanceof Error ? error.message : String(error),
|
|
172
|
+
},
|
|
173
|
+
);
|
|
111
174
|
return false;
|
|
112
175
|
}
|
|
113
176
|
}
|
|
114
177
|
|
|
115
178
|
app.get("/v1/workspaces/:workspaceId/rigs", async (c) => {
|
|
116
179
|
const workspaceId = c.req.param("workspaceId");
|
|
117
|
-
await requireAccessGrant(c, deps, workspaceId, "rigs:use");
|
|
118
|
-
return c.json(await listRigs(db,
|
|
180
|
+
const grant = await requireAccessGrant(c, deps, workspaceId, "rigs:use");
|
|
181
|
+
return c.json(await listRigs(db, grant));
|
|
119
182
|
});
|
|
120
183
|
|
|
121
184
|
app.post("/v1/workspaces/:workspaceId/rigs", async (c) => {
|
|
122
185
|
const workspaceId = c.req.param("workspaceId");
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
|
|
186
|
+
const authorization = await requireAccessGrantAuthorization(c, deps, workspaceId);
|
|
187
|
+
const grant = authorization.grant;
|
|
188
|
+
requirePermission(grant, "rigs:manage");
|
|
189
|
+
const payload = await parseRigRequest(
|
|
190
|
+
c,
|
|
191
|
+
CreateRigRequest,
|
|
192
|
+
"Sandbox Environment create request",
|
|
193
|
+
);
|
|
194
|
+
const allowOrganization =
|
|
195
|
+
payload.scope === "organization" &&
|
|
196
|
+
authorization.accountGrant?.permissions.includes("account:admin") === true;
|
|
197
|
+
if (payload.scope === "organization" && !allowOrganization) {
|
|
198
|
+
throw new HTTPException(403, {
|
|
199
|
+
message: "missing permission: account:admin",
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
const rig = await createRigForApi({ db }, grant, payload, {
|
|
203
|
+
allowOrganization,
|
|
204
|
+
});
|
|
126
205
|
if (rig.activeVersion) {
|
|
127
206
|
const started = await tryStartInitialVersionVerification(workspaceId, rig.activeVersion.id);
|
|
128
207
|
if (!started) c.header("OpenGeni-Rig-Verification", "deferred");
|
|
@@ -132,40 +211,67 @@ export function registerRigRoutes(app: Hono, deps: ApiRouteDeps): void {
|
|
|
132
211
|
|
|
133
212
|
app.get("/v1/workspaces/:workspaceId/rigs/:rigId", async (c) => {
|
|
134
213
|
const workspaceId = c.req.param("workspaceId");
|
|
135
|
-
await requireAccessGrant(c, deps, workspaceId, "rigs:use");
|
|
136
|
-
return c.json(await requireRigForApi(db,
|
|
214
|
+
const grant = await requireAccessGrant(c, deps, workspaceId, "rigs:use");
|
|
215
|
+
return c.json(await requireRigForApi(db, grant, c.req.param("rigId")));
|
|
137
216
|
});
|
|
138
217
|
|
|
139
218
|
app.patch("/v1/workspaces/:workspaceId/rigs/:rigId", async (c) => {
|
|
140
219
|
const workspaceId = c.req.param("workspaceId");
|
|
141
|
-
const
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
220
|
+
const authorization = await requireAccessGrantAuthorization(c, deps, workspaceId);
|
|
221
|
+
const grant = authorization.grant;
|
|
222
|
+
requirePermission(grant, "rigs:manage");
|
|
223
|
+
const rig = await requireRigForApi(db, grant, c.req.param("rigId"));
|
|
224
|
+
const allowOrganization =
|
|
225
|
+
rig.scope === "organization" &&
|
|
226
|
+
authorization.accountGrant?.permissions.includes("account:admin") === true;
|
|
227
|
+
if (rig.scope === "organization" && !allowOrganization) {
|
|
228
|
+
throw new HTTPException(403, {
|
|
229
|
+
message: "missing permission: account:admin",
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
const payload = await parseRigRequest(
|
|
233
|
+
c,
|
|
234
|
+
UpdateRigRequest,
|
|
235
|
+
"Sandbox Environment update request",
|
|
236
|
+
);
|
|
237
|
+
return c.json(await updateRigForApi({ db }, grant, rig, payload, { allowOrganization }));
|
|
145
238
|
});
|
|
146
239
|
|
|
147
240
|
app.delete("/v1/workspaces/:workspaceId/rigs/:rigId", async (c) => {
|
|
148
241
|
const workspaceId = c.req.param("workspaceId");
|
|
149
|
-
const
|
|
150
|
-
const
|
|
151
|
-
|
|
242
|
+
const authorization = await requireAccessGrantAuthorization(c, deps, workspaceId);
|
|
243
|
+
const grant = authorization.grant;
|
|
244
|
+
requirePermission(grant, "rigs:manage");
|
|
245
|
+
const rig = await requireRigForApi(db, grant, c.req.param("rigId"));
|
|
246
|
+
const allowOrganization =
|
|
247
|
+
rig.scope === "organization" &&
|
|
248
|
+
authorization.accountGrant?.permissions.includes("account:admin") === true;
|
|
249
|
+
if (rig.scope === "organization" && !allowOrganization) {
|
|
250
|
+
throw new HTTPException(403, {
|
|
251
|
+
message: "missing permission: account:admin",
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
await deleteRigForApi({ db }, grant, rig, { allowOrganization });
|
|
152
255
|
return c.json({ ok: true });
|
|
153
256
|
});
|
|
154
257
|
|
|
155
258
|
app.get("/v1/workspaces/:workspaceId/rigs/:rigId/versions", async (c) => {
|
|
156
259
|
const workspaceId = c.req.param("workspaceId");
|
|
157
|
-
await requireAccessGrant(c, deps, workspaceId, "rigs:use");
|
|
158
|
-
const rig = await requireRigForApi(db,
|
|
159
|
-
return c.json(await listRigVersionsForApi({ db }, workspaceId, rig.id));
|
|
260
|
+
const grant = await requireAccessGrant(c, deps, workspaceId, "rigs:use");
|
|
261
|
+
const rig = await requireRigForApi(db, grant, c.req.param("rigId"));
|
|
262
|
+
return c.json(await listRigVersionsForApi({ db }, rig.workspaceId, rig.id));
|
|
160
263
|
});
|
|
161
264
|
|
|
162
265
|
app.post("/v1/workspaces/:workspaceId/rigs/:rigId/versions", async (c) => {
|
|
163
266
|
const workspaceId = c.req.param("workspaceId");
|
|
164
|
-
const grant = await
|
|
165
|
-
const
|
|
166
|
-
|
|
267
|
+
const { grant, rig } = await requireRigMutation(c, workspaceId, "rigs:manage");
|
|
268
|
+
const payload = await parseRigRequest(
|
|
269
|
+
c,
|
|
270
|
+
RigDefinitionEditPayload,
|
|
271
|
+
"Sandbox Environment version request",
|
|
272
|
+
);
|
|
167
273
|
const version = await createRigVersionForApi({ db }, grant, rig, payload);
|
|
168
|
-
const started = await tryStartInitialVersionVerification(workspaceId, version.id);
|
|
274
|
+
const started = await tryStartInitialVersionVerification(rig.workspaceId, version.id);
|
|
169
275
|
if (!started) c.header("OpenGeni-Rig-Verification", "deferred");
|
|
170
276
|
return c.json(version, 201);
|
|
171
277
|
});
|
|
@@ -173,18 +279,22 @@ export function registerRigRoutes(app: Hono, deps: ApiRouteDeps): void {
|
|
|
173
279
|
// Rollback / promote-activate: flips which existing version is active.
|
|
174
280
|
app.post("/v1/workspaces/:workspaceId/rigs/:rigId/versions/:versionId/activate", async (c) => {
|
|
175
281
|
const workspaceId = c.req.param("workspaceId");
|
|
176
|
-
const grant = await
|
|
177
|
-
const rig = await requireRigForApi(db, workspaceId, c.req.param("rigId"));
|
|
282
|
+
const { grant, rig } = await requireRigMutation(c, workspaceId, "rigs:manage");
|
|
178
283
|
const version = await activateRigVersionForApi({ db }, grant, rig, c.req.param("versionId"));
|
|
179
284
|
return c.json(version);
|
|
180
285
|
});
|
|
181
286
|
|
|
182
287
|
app.get("/v1/workspaces/:workspaceId/rigs/:rigId/changes", async (c) => {
|
|
183
288
|
const workspaceId = c.req.param("workspaceId");
|
|
184
|
-
await requireAccessGrant(c, deps, workspaceId, "rigs:use");
|
|
185
|
-
const rig = await requireRigForApi(db,
|
|
289
|
+
const grant = await requireAccessGrant(c, deps, workspaceId, "rigs:use");
|
|
290
|
+
const rig = await requireRigForApi(db, grant, c.req.param("rigId"));
|
|
186
291
|
return c.json(
|
|
187
|
-
await listRigChangesForApi(
|
|
292
|
+
await listRigChangesForApi(
|
|
293
|
+
{ db },
|
|
294
|
+
rig.workspaceId,
|
|
295
|
+
rig.id,
|
|
296
|
+
boundedLimit(c.req.query("limit")),
|
|
297
|
+
),
|
|
188
298
|
);
|
|
189
299
|
});
|
|
190
300
|
|
|
@@ -193,54 +303,61 @@ export function registerRigRoutes(app: Hono, deps: ApiRouteDeps): void {
|
|
|
193
303
|
// promote gate (definition_edit) land in M4.
|
|
194
304
|
app.post("/v1/workspaces/:workspaceId/rigs/:rigId/changes", async (c) => {
|
|
195
305
|
const workspaceId = c.req.param("workspaceId");
|
|
196
|
-
const grant = await
|
|
197
|
-
const
|
|
198
|
-
|
|
306
|
+
const { grant, rig } = await requireRigMutation(c, workspaceId, "rigs:use");
|
|
307
|
+
const request = await parseRigRequest(
|
|
308
|
+
c,
|
|
309
|
+
ProposeRigChangeRequest,
|
|
310
|
+
"Sandbox Environment change request",
|
|
311
|
+
);
|
|
199
312
|
const change = await proposeRigChangeForApi({ db }, grant, rig, request);
|
|
200
|
-
const verification = await startChangeVerification(workspaceId, change.id);
|
|
313
|
+
const verification = await startChangeVerification(rig.workspaceId, change.id);
|
|
201
314
|
if (!verification.started) c.header("OpenGeni-Rig-Verification", "deferred");
|
|
202
315
|
return c.json(verification.change, 201);
|
|
203
316
|
});
|
|
204
317
|
|
|
205
318
|
app.get("/v1/workspaces/:workspaceId/rigs/:rigId/changes/:changeId", async (c) => {
|
|
206
319
|
const workspaceId = c.req.param("workspaceId");
|
|
207
|
-
await requireAccessGrant(c, deps, workspaceId, "rigs:use");
|
|
320
|
+
const grant = await requireAccessGrant(c, deps, workspaceId, "rigs:use");
|
|
321
|
+
const rig = await requireRigForApi(db, grant, c.req.param("rigId"));
|
|
208
322
|
return c.json(
|
|
209
|
-
await requireRigChangeForApi(db, workspaceId,
|
|
323
|
+
await requireRigChangeForApi(db, rig.workspaceId, rig.id, c.req.param("changeId")),
|
|
210
324
|
);
|
|
211
325
|
});
|
|
212
326
|
|
|
213
327
|
app.post("/v1/workspaces/:workspaceId/rigs/:rigId/changes/:changeId/verify", async (c) => {
|
|
214
328
|
const workspaceId = c.req.param("workspaceId");
|
|
215
|
-
await
|
|
329
|
+
const { rig } = await requireRigMutation(c, workspaceId, "rigs:use");
|
|
216
330
|
const change = await requireRigChangeForApi(
|
|
217
331
|
db,
|
|
218
|
-
workspaceId,
|
|
219
|
-
|
|
332
|
+
rig.workspaceId,
|
|
333
|
+
rig.id,
|
|
220
334
|
c.req.param("changeId"),
|
|
221
335
|
);
|
|
222
|
-
const verification = await startChangeVerification(workspaceId, change.id);
|
|
336
|
+
const verification = await startChangeVerification(rig.workspaceId, change.id);
|
|
223
337
|
if (!verification.started) c.header("OpenGeni-Rig-Verification", "deferred");
|
|
224
338
|
return c.json(verification.change, 202);
|
|
225
339
|
});
|
|
226
340
|
|
|
227
341
|
app.post("/v1/workspaces/:workspaceId/rigs/:rigId/changes/:changeId/promote", async (c) => {
|
|
228
342
|
const workspaceId = c.req.param("workspaceId");
|
|
229
|
-
const grant = await
|
|
230
|
-
const
|
|
231
|
-
|
|
343
|
+
const { grant, rig } = await requireRigMutation(c, workspaceId, "rigs:manage");
|
|
344
|
+
const change = await requireRigChangeForApi(
|
|
345
|
+
db,
|
|
346
|
+
rig.workspaceId,
|
|
347
|
+
rig.id,
|
|
348
|
+
c.req.param("changeId"),
|
|
349
|
+
);
|
|
232
350
|
const promoted = await promoteVerifiedDefinitionEditChangeForApi({ db }, grant, rig, change);
|
|
233
351
|
return c.json(promoted.version, 201);
|
|
234
352
|
});
|
|
235
353
|
|
|
236
354
|
app.post("/v1/workspaces/:workspaceId/rigs/:rigId/verify", async (c) => {
|
|
237
355
|
const workspaceId = c.req.param("workspaceId");
|
|
238
|
-
await
|
|
239
|
-
const rig = await requireRigForApi(db, workspaceId, c.req.param("rigId"));
|
|
356
|
+
const { rig } = await requireRigMutation(c, workspaceId, "rigs:use");
|
|
240
357
|
if (!rig.activeVersion) {
|
|
241
|
-
return c.json({ error: "
|
|
358
|
+
return c.json({ error: "sandbox environment has no active version" }, 422);
|
|
242
359
|
}
|
|
243
|
-
await startVersionVerification(workspaceId, rig.activeVersion.id);
|
|
360
|
+
await startVersionVerification(rig.workspaceId, rig.activeVersion.id);
|
|
244
361
|
return c.json({ ok: true, versionId: rig.activeVersion.id }, 202);
|
|
245
362
|
});
|
|
246
363
|
}
|