diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd066e6f..f5fc5df9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' @@ -17,12 +19,12 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/gitpod-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version: '20' @@ -36,15 +38,15 @@ jobs: timeout-minutes: 5 name: build runs-on: ${{ github.repository == 'stainless-sdks/gitpod-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') permissions: contents: read id-token: write steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version: '20' @@ -55,14 +57,18 @@ jobs: run: ./scripts/build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/gitpod-typescript' + if: |- + github.repository == 'stainless-sdks/gitpod-typescript' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/gitpod-typescript' + if: |- + github.repository == 'stainless-sdks/gitpod-typescript' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} @@ -74,10 +80,10 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/gitpod-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version: '20' diff --git a/.gitignore b/.gitignore index 2412bb77..c85fe684 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .prism.log +.stdy.log node_modules yarn-error.log codegen.log diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ed21d28c..727e2bea 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.13.0" + ".": "0.14.0" } diff --git a/.stats.yml b/.stats.yml index f91b5129..82c3873e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-1923b5d3865532d64d80c22746aa63991bbf227cf1cbefc8cdb14a374c4c5b89.yml -openapi_spec_hash: 304200ebfa8622f5f6846895528f06e3 -config_hash: 469d30a2d44895c8c53a5aac370a56f1 +configured_endpoints: 193 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-dabc0ff98cd7b9d91850b3c0dbada4e487e698333cd0b7257959e4819d9a29d6.yml +openapi_spec_hash: b974bdc6025a26cfa62857bf74ec379b +config_hash: 13514c5eb422e4eb01767e718798de1e diff --git a/CHANGELOG.md b/CHANGELOG.md index 6590a4f8..c4a175c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,100 @@ # Changelog +## 0.14.0 (2026-04-02) + +Full Changelog: [v0.13.0...v0.14.0](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.13.0...v0.14.0) + +### Features + +* [backend/api] add backend search for group members ([d7dee78](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/d7dee782586a5d1685a6a3c740e3fa2dc4d80bd5)) +* **agents:** enforce sub-agent depth and concurrency limits in backend ([091e1e1](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/091e1e1dcdb3f67bba806f330766274004234736)) +* **api:** add acknowledgeToken parameter to environments start method ([4e4cf9c](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/4e4cf9c8c51749944cd4d37f98ca46fd48524b0f)) +* **api:** add AGENT_EXECUTION_VIEWER role to ResourceRole type ([e728590](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e728590a07f53977b6e22ae1e49db5dedfaf37e6)) +* **api:** add agentMessage param and AgentMessage/Type types to agents ([3116d62](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/3116d62117a33546b4293d0914819e26836688c4)) +* **api:** add automations resource with workflows/executions/actions ([c714e29](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/c714e295b0d1f65f804fc85a93487e9549a47d1d)) +* **api:** add bpfDebugLevel field to KernelControlsConfig in environments ([a287ad3](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a287ad3af6bf663011161691ca7913a446541a42)) +* **api:** add claimsExpression field to SSO configurations ([d341ea2](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/d341ea27e87d728ff4001679b665cb629335ee63)) +* **api:** add conversation_sharing_policy to agent policy ([bf403a1](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/bf403a175281b9b5e61d644015548d4e1f5f2607)) +* **api:** add CountResponseRelation type ([b873069](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/b87306930d710a13c53c98b56b96b812c3521d84)) +* **api:** add credentialProxy field to environments Secret ([02863e6](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/02863e6b7f366348e46cb44e53c15404aea596ce)) +* **api:** add customAgents field and CustomSecurityAgent type to policies ([1a61b78](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/1a61b782581ec2402a5c628e4f57feb676669323)) +* **api:** add desiredSize field to WarmPoolStatus in prebuilds ([353883c](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/353883cb024626e7994a08f2deecea0dd60a1849)) +* **api:** add disabled parameter to automation update method ([badc257](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/badc257d04b0aecb4a3becba683862e2d6d64d0f)) +* **api:** add environment field to agent wake events ([992e5d0](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/992e5d0e42c8e6546be7ec08e3ace411edaf015c)) +* **api:** add exclude_team_ids parameter to organization list members ([272e39c](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/272e39c392b6a5a6c459e6bbd40407d4a8a6294b)) +* **api:** add excludePromptContent parameter to agents list prompts method ([49a254a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/49a254a20c1966e30bbd4d0e7efe1a124fd0f12e)) +* **api:** add filter parameter to groups list method ([8bc4dd7](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/8bc4dd780908d6853d89b803caa340bf25537f4d)) +* **api:** add hasFailedExecutionSince parameter to automations list method ([217a0b3](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/217a0b3270e3962bf8097c1c0e9748f0d9a4c271)) +* **api:** add lockdownAt field to EnvironmentStatus ([1b40ec9](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/1b40ec9b2d39a90bc0c82691bf7b7c5b47f2799c)) +* **api:** add loop conditions to agents, update wake event types ([e2f1f5d](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e2f1f5d8f0cc088a0f5b2cf503ad003b4833b4c1)) +* **api:** add managedMetricsEnabled field to runners MetricsConfiguration ([b7d2e42](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/b7d2e429e498e58bdde9c171e67f90aaacd087da)) +* **api:** add min_size and max_size to prebuilds warm pools ([50e0e9c](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/50e0e9c4da97de8fe91ea2b193930556f33dfe74)) +* **api:** add organizationTier to identity authenticated response ([510f3f8](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/510f3f8486518e6fb69f44cbc7b34e842b22c1ca)) +* **api:** add read_only field to PersonalAccessToken proto messages ([9dbc9a5](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/9dbc9a5410b59c6e1161e886a72e5c50ae221bf1)) +* **api:** add RESOURCE_ROLE_ORG_AUDIT_LOG_READER to ResourceRole enum ([811b8f3](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/811b8f37b3caed8228b561180d61981c9278f299)) +* **api:** add RESOURCE_TYPE_NOTIFICATION to ResourceType enum ([f605d55](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/f605d55f111bf83b4e472fe8b639d0953361ef9e)) +* **api:** add resourceIds to role assignments, simplify executable deny list in policies ([a2c14c0](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a2c14c0e1702564a2855ea6d7f49605dd6e7e4c1)) +* **api:** add resourceTypeFilters parameter to events watch method ([07bb8ec](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/07bb8ec587dd0b5b1d5b43ed506ab8733ebbd073)) +* **api:** add role/senderExecutionId fields to agents AgentMessage ([2c815f0](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/2c815f0c52891d6b0d7869bffdccd28890520b22)) +* **api:** add RUNNER_CAPABILITY_WARM_POOL to RunnerCapability enum ([f7ee363](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/f7ee36368822b4dbad149abf3d1944a6d3f1a2fb)) +* **api:** add search parameter to agents list prompts method ([7e78aca](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/7e78aca647ff60acafe52ab90c0846207190df66)) +* **api:** add SESSION_ADMIN and SESSION_USER to ResourceRole enum ([186e30f](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/186e30fccfe1a41601816d1a46bf163e00c24b18)) +* **api:** add sessionId parameter to agents and environments ([0ef9494](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/0ef9494e37d62933fea68a26d73c8932f7ebce11)) +* **api:** add sessionId parameter to environments create from project ([693174b](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/693174bb0cc890681450918bde61b0b29656f122)) +* **api:** add sessionIds filter to agents/environments list methods ([52e0a3a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/52e0a3afe617f580ce1dbca45eb761cdd8e9034b)) +* **api:** add snapshotSizeBytes field to PrebuildStatus ([17124f0](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/17124f098f482d4d8160f40b26439eb0f741b5e0)) +* **api:** add SONNET_4_6 model variants to AgentExecution ([8646e6e](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/8646e6ea9fc56779c5785cb0a614116064320cbc)) +* **api:** add sort option to ListAuditLogs ([e617fb0](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e617fb005b9122702ee2987a316d12d46bc22c35)) +* **api:** add sort parameter to projects list and Sort/SortOrder types ([3322c72](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/3322c72b72dd47a46c674074f580aef9a36dcedd)) +* **api:** add SUPPORTED_MODEL_HAIKU_4_5 to AgentExecution model ([eb7a869](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/eb7a869bec5729291aededfc320b4b9ea499a5f7)) +* **api:** add TEAM_ADMIN and TEAM_VIEWER to ResourceRole ([4428302](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/442830279d79a2181f304c53bacc465616989c42)) +* **api:** add terminal field to RunsOn ([a285f60](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a285f6013dd1382c2dcd5e3d520e90f44af02354)) +* **api:** add time range filters to event list method ([1b2c056](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/1b2c0567bfad884aadcb3bbeb81af84c76afe1c3)) +* **api:** add updateWindow field to runners configuration ([54c0225](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/54c0225d6cfbeb43cd5c7163667c29a5e28c08b6)) +* **api:** add WakeEvent type and wakeEvent parameter to agents ([ea254b6](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/ea254b67bf12c9dca3b8d205d56883c53179dd20)) +* **api:** add warm pool CRUD methods and types to prebuilds ([2ebb4cd](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/2ebb4cdb5f1461a96bac9b29cc4ffcf1dbf9c439)) +* **api:** allow min_size >= 0 for warm pool dynamic scaling ([a72b6c8](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a72b6c81385168933314a76794899bb91c6114cf)) +* **backend/api,dashboard:** add server-side `recentlyCompleted` sort for `ListWorkflows` ([567bc3a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/567bc3a93c2cc65fd939527a3a0868cf30fd1e44)) +* **ec2:** add RUNNER_CAPABILITY_ASG_WARM_POOL capability ([993a447](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/993a447ef3390cd787661868a28bb2116345821e)) +* **types:** remove agent execution enum values from Principal and ResourceRole ([4378ae7](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/4378ae76a8d9b668c2b428009c39ec35aa8dc781)) + + +### Bug Fixes + +* **api:** remove acknowledgeToken parameter from environments start method ([77917e4](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/77917e43fbdc905617e238b8f2d0c1a9e5c9fade)) +* **api:** rename executableDenyList to vetoExecPolicy in policies ([84bf167](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/84bf167dd9dd77c72968cd5267d9a2b25a6caa76)) +* **client:** preserve URL params already embedded in path ([7424783](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/7424783edb1c99c339910557206e36d02cc9ad75)) +* **docs/contributing:** correct pnpm link command ([43ff14c](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/43ff14ca7e7126233cd7dd75cd191766b96ab492)) +* fix request delays for retrying to be more respectful of high requested delays ([858345c](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/858345c8d80809668d46f6b0757c0fb14702cb73)) +* **types:** make id optional in CustomSecurityAgent ([25f783f](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/25f783f7f7490c965a8a9819547d943c95e1bf33)) + + +### Chores + +* **ci:** skip lint on metadata-only changes ([74a87ee](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/74a87ee1d29679c394c0c8417f57944f1fcf6b77)) +* **ci:** skip uploading artifacts on stainless-internal branches ([a4c7e10](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a4c7e10ee9bda8648752c8c56f49960a54cca88a)) +* **docs:** add missing descriptions ([ad400e2](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/ad400e2a897ed2b82a4dff08de92b16d74b0e6d1)) +* **internal:** move stringifyQuery implementation to internal function ([b25ce90](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/b25ce90fcccaa5dab211114e17d9c155f26b05c5)) +* **internal:** regenerate SDK with no functional changes ([c095797](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/c095797ffaf0db7caedd47aac75b3dc8baa8a3d5)) +* **internal:** regenerate SDK with no functional changes ([cc9b601](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/cc9b601ae180912ef05f7809e416f14e04af28c8)) +* **internal:** regenerate SDK with no functional changes ([ca8c11c](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/ca8c11c5e9b538421341f2f09c633dcf39439f15)) +* **internal:** regenerate SDK with no functional changes ([a7e1b02](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a7e1b02445a7bd5f00409acf0af72615c91c6202)) +* **internal:** regenerate SDK with no functional changes ([2b0fe0b](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/2b0fe0b585142ca23d6786d32312650514e4ddd0)) +* **internal:** remove mock server code ([d7effec](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/d7effeca87947f2c067de984a7fac9f4e498eaac)) +* **internal:** tweak CI branches ([834cba6](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/834cba602e5f46c845b48991abc643c43628aa94)) +* **internal:** update dependencies to address dependabot vulnerabilities ([3daa978](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/3daa97802cc6ccbfc732028820ff17c46f775503)) +* **internal:** update gitignore ([51da5bf](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/51da5bfc1509472e2a96ce199097bca3377e7b6a)) +* **test:** update skip reason message ([9e5570d](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/9e5570d13dbf4c3101e679038a8e4bdb2460882d)) +* **types:** move CountResponseRelation from organizations to shared ([c47174a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/c47174a9c78d9785316d7f4085a4aea653b11cc1)) +* update mock server docs ([cd79de5](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/cd79de5fbf0ffd6dcc51c8a0d930065335254f1f)) + + +### Documentation + +* **api:** clarify resourceId/resourceIds permission behavior in groups role assignments ([1b36502](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/1b36502903ea6f8a6b558bd152379137191907a8)) +* **api:** clarify timeout constraints in environments and organization policies ([8a68a4d](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/8a68a4d7213b28c0c5376ccc3eb873692f4961ba)) +* **api:** update annotations parameter examples in agents ([723978c](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/723978c628dab92a05195c67346c796b7232583c)) + ## 0.13.0 (2026-02-18) Full Changelog: [v0.12.0...v0.13.0](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.12.0...v0.13.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b3703f04..3103a72c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,7 +60,7 @@ $ yarn link @gitpod/sdk # With pnpm $ pnpm link --global $ cd ../my-package -$ pnpm link -—global @gitpod/sdk +$ pnpm link --global @gitpod/sdk ``` ## Running tests diff --git a/api.md b/api.md index fedc0405..96536d55 100644 --- a/api.md +++ b/api.md @@ -3,6 +3,7 @@ Types: - AutomationTrigger +- CountResponseRelation - EnvironmentClass - EnvironmentVariableItem - EnvironmentVariableSource @@ -17,6 +18,8 @@ Types: - ResourceType - RunsOn - SecretRef +- Sort +- SortOrder - State - Subject - Task @@ -57,11 +60,15 @@ Types: - AgentCodeContext - AgentExecution +- AgentMessage - AgentMode - Prompt - PromptMetadata - PromptSpec +- Role +- Type - UserInputBlock +- WakeEvent - AgentCreateExecutionConversationTokenResponse - AgentCreatePromptResponse - AgentDeleteExecutionResponse @@ -88,6 +95,44 @@ Methods: - client.agents.stopExecution({ ...params }) -> unknown - client.agents.updatePrompt({ ...params }) -> AgentUpdatePromptResponse +# Automations + +Types: + +- Workflow +- WorkflowAction +- WorkflowExecution +- WorkflowExecutionAction +- WorkflowStep +- WorkflowTrigger +- WorkflowTriggerContext +- AutomationCreateResponse +- AutomationRetrieveResponse +- AutomationUpdateResponse +- AutomationDeleteResponse +- AutomationCancelExecutionResponse +- AutomationCancelExecutionActionResponse +- AutomationListExecutionOutputsResponse +- AutomationRetrieveExecutionResponse +- AutomationRetrieveExecutionActionResponse +- AutomationStartExecutionResponse + +Methods: + +- client.automations.create({ ...params }) -> AutomationCreateResponse +- client.automations.retrieve({ ...params }) -> AutomationRetrieveResponse +- client.automations.update({ ...params }) -> AutomationUpdateResponse +- client.automations.list({ ...params }) -> WorkflowsWorkflowsPage +- client.automations.delete({ ...params }) -> unknown +- client.automations.cancelExecution({ ...params }) -> unknown +- client.automations.cancelExecutionAction({ ...params }) -> unknown +- client.automations.listExecutionActions({ ...params }) -> WorkflowExecutionActionsWorkflowExecutionActionsPage +- client.automations.listExecutionOutputs({ ...params }) -> AutomationListExecutionOutputsResponsesOutputsPage +- client.automations.listExecutions({ ...params }) -> WorkflowExecutionsWorkflowExecutionsPage +- client.automations.retrieveExecution({ ...params }) -> AutomationRetrieveExecutionResponse +- client.automations.retrieveExecutionAction({ ...params }) -> AutomationRetrieveExecutionActionResponse +- client.automations.startExecution({ ...params }) -> AutomationStartExecutionResponse + # Editors Types: @@ -108,6 +153,7 @@ Methods: Types: - AdmissionLevel +- BpfDebugLevel - Environment - EnvironmentActivitySignal - EnvironmentMetadata @@ -427,7 +473,10 @@ Methods: Types: - AgentPolicy +- ConversationSharingPolicy - CrowdStrikeConfig +- CustomAgentEnvMapping +- CustomSecurityAgent - KernelControlsAction - OrganizationPolicies - SecurityAgentPolicy @@ -491,11 +540,20 @@ Types: - PrebuildSpec - PrebuildStatus - PrebuildTrigger +- WarmPool +- WarmPoolMetadata +- WarmPoolPhase +- WarmPoolSpec +- WarmPoolStatus - PrebuildCreateResponse - PrebuildRetrieveResponse - PrebuildDeleteResponse - PrebuildCancelResponse - PrebuildCreateLogsTokenResponse +- PrebuildCreateWarmPoolResponse +- PrebuildDeleteWarmPoolResponse +- PrebuildRetrieveWarmPoolResponse +- PrebuildUpdateWarmPoolResponse Methods: @@ -505,6 +563,11 @@ Methods: - client.prebuilds.delete({ ...params }) -> unknown - client.prebuilds.cancel({ ...params }) -> PrebuildCancelResponse - client.prebuilds.createLogsToken({ ...params }) -> PrebuildCreateLogsTokenResponse +- client.prebuilds.createWarmPool({ ...params }) -> PrebuildCreateWarmPoolResponse +- client.prebuilds.deleteWarmPool({ ...params }) -> unknown +- client.prebuilds.listWarmPools({ ...params }) -> WarmPoolsWarmPoolsPage +- client.prebuilds.retrieveWarmPool({ ...params }) -> PrebuildRetrieveWarmPoolResponse +- client.prebuilds.updateWarmPool({ ...params }) -> PrebuildUpdateWarmPoolResponse # Projects @@ -583,6 +646,7 @@ Types: - RunnerStatus - RunnerVariant - SearchMode +- UpdateWindow - RunnerCreateResponse - RunnerRetrieveResponse - RunnerUpdateResponse diff --git a/package.json b/package.json index 0be43805..7364c376 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gitpod/sdk", - "version": "0.13.0", + "version": "0.14.0", "description": "The official TypeScript library for the Gitpod API", "author": "Gitpod ", "types": "dist/index.d.ts", @@ -54,6 +54,17 @@ "typescript": "5.8.3", "typescript-eslint": "8.31.1" }, + "overrides": { + "minimatch": "^9.0.5" + }, + "pnpm": { + "overrides": { + "minimatch": "^9.0.5" + } + }, + "resolutions": { + "minimatch": "^9.0.5" + }, "exports": { ".": { "import": "./dist/index.mjs", diff --git a/scripts/mock b/scripts/mock deleted file mode 100755 index 0b28f6ea..00000000 --- a/scripts/mock +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd "$(dirname "$0")/.." - -if [[ -n "$1" && "$1" != '--'* ]]; then - URL="$1" - shift -else - URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" -fi - -# Check if the URL is empty -if [ -z "$URL" ]; then - echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" - exit 1 -fi - -echo "==> Starting mock server with URL ${URL}" - -# Run prism mock on the given spec -if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & - - # Wait for server to come online - echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do - echo -n "." - sleep 0.1 - done - - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - - echo -else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" -fi diff --git a/scripts/test b/scripts/test index 7bce0516..548da9bb 100755 --- a/scripts/test +++ b/scripts/test @@ -4,53 +4,7 @@ set -e cd "$(dirname "$0")/.." -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 -} - -kill_server_on_port() { - pids=$(lsof -t -i tcp:"$1" || echo "") - if [ "$pids" != "" ]; then - kill "$pids" - echo "Stopped $pids." - fi -} - -function is_overriding_api_base_url() { - [ -n "$TEST_API_BASE_URL" ] -} - -if ! is_overriding_api_base_url && ! prism_is_running ; then - # When we exit this script, make sure to kill the background mock server process - trap 'kill_server_on_port 4010' EXIT - - # Start the dev server - ./scripts/mock --daemon -fi - -if is_overriding_api_base_url ; then - echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" - echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" - echo -e "running against your OpenAPI spec." - echo - echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" - echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" - echo - - exit 1 -else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" - echo -fi echo "==> Running tests" ./node_modules/.bin/jest "$@" diff --git a/src/client.ts b/src/client.ts index 4c6c90a2..ad0dd92c 100644 --- a/src/client.ts +++ b/src/client.ts @@ -18,6 +18,7 @@ import type { APIResponseProps } from './internal/parse'; import { getPlatformHeaders } from './internal/detect-platform'; import * as Shims from './internal/shims'; import * as Opts from './internal/request-options'; +import { stringifyQuery } from './internal/utils/query'; import { VERSION } from './version'; import * as Errors from './core/error'; import * as Pagination from './core/pagination'; @@ -51,6 +52,8 @@ import { LoginsPageResponse, type MembersPageParams, MembersPageResponse, + type OutputsPageParams, + OutputsPageResponse, type PersonalAccessTokensPageParams, PersonalAccessTokensPageResponse, type PoliciesPageParams, @@ -83,6 +86,14 @@ import { TasksPageResponse, type TokensPageParams, TokensPageResponse, + type WarmPoolsPageParams, + WarmPoolsPageResponse, + type WorkflowExecutionActionsPageParams, + WorkflowExecutionActionsPageResponse, + type WorkflowExecutionsPageParams, + WorkflowExecutionsPageResponse, + type WorkflowsPageParams, + WorkflowsPageResponse, } from './core/pagination'; import * as Uploads from './core/uploads'; import * as API from './resources/index'; @@ -121,6 +132,7 @@ import { AgentExecutionsAgentExecutionsPage, AgentListExecutionsParams, AgentListPromptsParams, + AgentMessage, AgentMode, AgentRetrieveExecutionParams, AgentRetrieveExecutionResponse, @@ -139,8 +151,48 @@ import { PromptMetadata, PromptSpec, PromptsPromptsPage, + Role, + Type, UserInputBlock, + WakeEvent, } from './resources/agents'; +import { + AutomationCancelExecutionActionParams, + AutomationCancelExecutionActionResponse, + AutomationCancelExecutionParams, + AutomationCancelExecutionResponse, + AutomationCreateParams, + AutomationCreateResponse, + AutomationDeleteParams, + AutomationDeleteResponse, + AutomationListExecutionActionsParams, + AutomationListExecutionOutputsParams, + AutomationListExecutionOutputsResponse, + AutomationListExecutionOutputsResponsesOutputsPage, + AutomationListExecutionsParams, + AutomationListParams, + AutomationRetrieveExecutionActionParams, + AutomationRetrieveExecutionActionResponse, + AutomationRetrieveExecutionParams, + AutomationRetrieveExecutionResponse, + AutomationRetrieveParams, + AutomationRetrieveResponse, + AutomationStartExecutionParams, + AutomationStartExecutionResponse, + AutomationUpdateParams, + AutomationUpdateResponse, + Automations, + Workflow, + WorkflowAction, + WorkflowExecution, + WorkflowExecutionAction, + WorkflowExecutionActionsWorkflowExecutionActionsPage, + WorkflowExecutionsWorkflowExecutionsPage, + WorkflowStep, + WorkflowTrigger, + WorkflowTriggerContext, + WorkflowsWorkflowsPage, +} from './resources/automations'; import { Editor, EditorListParams, @@ -192,18 +244,33 @@ import { PrebuildCreateLogsTokenResponse, PrebuildCreateParams, PrebuildCreateResponse, + PrebuildCreateWarmPoolParams, + PrebuildCreateWarmPoolResponse, PrebuildDeleteParams, PrebuildDeleteResponse, + PrebuildDeleteWarmPoolParams, + PrebuildDeleteWarmPoolResponse, PrebuildListParams, + PrebuildListWarmPoolsParams, PrebuildMetadata, PrebuildPhase, PrebuildRetrieveParams, PrebuildRetrieveResponse, + PrebuildRetrieveWarmPoolParams, + PrebuildRetrieveWarmPoolResponse, PrebuildSpec, PrebuildStatus, PrebuildTrigger, + PrebuildUpdateWarmPoolParams, + PrebuildUpdateWarmPoolResponse, Prebuilds, PrebuildsPrebuildsPage, + WarmPool, + WarmPoolMetadata, + WarmPoolPhase, + WarmPoolSpec, + WarmPoolStatus, + WarmPoolsWarmPoolsPage, } from './resources/prebuilds'; import { Secret, @@ -228,6 +295,7 @@ import { } from './resources/usage'; import { AdmissionLevel, + BpfDebugLevel, Environment, EnvironmentActivitySignal, EnvironmentCreateEnvironmentTokenParams, @@ -366,6 +434,7 @@ import { Runners, RunnersRunnersPage, SearchMode, + UpdateWindow, } from './resources/runners/runners'; import { User, @@ -568,21 +637,8 @@ export class Gitpod { /** * Basic re-implementation of `qs.stringify` for primitive types. */ - protected stringifyQuery(query: Record): string { - return Object.entries(query) - .filter(([_, value]) => typeof value !== 'undefined') - .map(([key, value]) => { - if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { - return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; - } - if (value === null) { - return `${encodeURIComponent(key)}=`; - } - throw new Errors.GitpodError( - `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`, - ); - }) - .join('&'); + protected stringifyQuery(query: object | Record): string { + return stringifyQuery(query); } private getUserAgent(): string { @@ -614,12 +670,13 @@ export class Gitpod { : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); const defaultQuery = this.defaultQuery(); - if (!isEmptyObj(defaultQuery)) { - query = { ...defaultQuery, ...query }; + const pathQuery = Object.fromEntries(url.searchParams); + if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) { + query = { ...pathQuery, ...defaultQuery, ...query }; } if (typeof query === 'object' && query && !Array.isArray(query)) { - url.search = this.stringifyQuery(query as Record); + url.search = this.stringifyQuery(query); } return url.toString(); @@ -948,9 +1005,9 @@ export class Gitpod { } } - // If the API asks us to wait a certain amount of time (and it's a reasonable amount), - // just do what it says, but otherwise calculate a default - if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) { + // If the API asks us to wait a certain amount of time, just do what it + // says, but otherwise calculate a default + if (timeoutMillis === undefined) { const maxRetries = options.maxRetries ?? this.maxRetries; timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); } @@ -1082,7 +1139,7 @@ export class Gitpod { ) { return { bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' }, - body: this.stringifyQuery(body as Record), + body: this.stringifyQuery(body), }; } else { return this.#encoder({ body, headers }); @@ -1110,24 +1167,37 @@ export class Gitpod { accounts: API.Accounts = new API.Accounts(this); agents: API.Agents = new API.Agents(this); + automations: API.Automations = new API.Automations(this); editors: API.Editors = new API.Editors(this); environments: API.Environments = new API.Environments(this); + /** + * ErrorsService provides endpoints for clients to report errors + * that will be sent to error reporting systems. + */ errors: API.Errors = new API.Errors(this); events: API.Events = new API.Events(this); gateways: API.Gateways = new API.Gateways(this); groups: API.Groups = new API.Groups(this); identity: API.Identity = new API.Identity(this); organizations: API.Organizations = new API.Organizations(this); + /** + * PrebuildService manages prebuilds for projects to enable faster environment startup times. + * Prebuilds create snapshots of environments that can be used to provision new environments quickly. + */ prebuilds: API.Prebuilds = new API.Prebuilds(this); projects: API.Projects = new API.Projects(this); runners: API.Runners = new API.Runners(this); secrets: API.Secrets = new API.Secrets(this); + /** + * UsageService provides usage information about environments, users, and projects. + */ usage: API.Usage = new API.Usage(this); users: API.Users = new API.Users(this); } Gitpod.Accounts = Accounts; Gitpod.Agents = Agents; +Gitpod.Automations = Automations; Gitpod.Editors = Editors; Gitpod.Environments = Environments; Gitpod.Errors = ErrorsAPIErrors; @@ -1212,6 +1282,9 @@ export declare namespace Gitpod { export import MembersPage = Pagination.MembersPage; export { type MembersPageParams as MembersPageParams, type MembersPageResponse as MembersPageResponse }; + export import OutputsPage = Pagination.OutputsPage; + export { type OutputsPageParams as OutputsPageParams, type OutputsPageResponse as OutputsPageResponse }; + export import PersonalAccessTokensPage = Pagination.PersonalAccessTokensPage; export { type PersonalAccessTokensPageParams as PersonalAccessTokensPageParams, @@ -1281,6 +1354,30 @@ export declare namespace Gitpod { export import TokensPage = Pagination.TokensPage; export { type TokensPageParams as TokensPageParams, type TokensPageResponse as TokensPageResponse }; + export import WarmPoolsPage = Pagination.WarmPoolsPage; + export { + type WarmPoolsPageParams as WarmPoolsPageParams, + type WarmPoolsPageResponse as WarmPoolsPageResponse, + }; + + export import WorkflowExecutionActionsPage = Pagination.WorkflowExecutionActionsPage; + export { + type WorkflowExecutionActionsPageParams as WorkflowExecutionActionsPageParams, + type WorkflowExecutionActionsPageResponse as WorkflowExecutionActionsPageResponse, + }; + + export import WorkflowExecutionsPage = Pagination.WorkflowExecutionsPage; + export { + type WorkflowExecutionsPageParams as WorkflowExecutionsPageParams, + type WorkflowExecutionsPageResponse as WorkflowExecutionsPageResponse, + }; + + export import WorkflowsPage = Pagination.WorkflowsPage; + export { + type WorkflowsPageParams as WorkflowsPageParams, + type WorkflowsPageResponse as WorkflowsPageResponse, + }; + export { Accounts as Accounts, type Account as Account, @@ -1306,11 +1403,15 @@ export declare namespace Gitpod { Agents as Agents, type AgentCodeContext as AgentCodeContext, type AgentExecution as AgentExecution, + type AgentMessage as AgentMessage, type AgentMode as AgentMode, type Prompt as Prompt, type PromptMetadata as PromptMetadata, type PromptSpec as PromptSpec, + type Role as Role, + type Type as Type, type UserInputBlock as UserInputBlock, + type WakeEvent as WakeEvent, type AgentCreateExecutionConversationTokenResponse as AgentCreateExecutionConversationTokenResponse, type AgentCreatePromptResponse as AgentCreatePromptResponse, type AgentDeleteExecutionResponse as AgentDeleteExecutionResponse, @@ -1337,6 +1438,44 @@ export declare namespace Gitpod { type AgentUpdatePromptParams as AgentUpdatePromptParams, }; + export { + Automations as Automations, + type Workflow as Workflow, + type WorkflowAction as WorkflowAction, + type WorkflowExecution as WorkflowExecution, + type WorkflowExecutionAction as WorkflowExecutionAction, + type WorkflowStep as WorkflowStep, + type WorkflowTrigger as WorkflowTrigger, + type WorkflowTriggerContext as WorkflowTriggerContext, + type AutomationCreateResponse as AutomationCreateResponse, + type AutomationRetrieveResponse as AutomationRetrieveResponse, + type AutomationUpdateResponse as AutomationUpdateResponse, + type AutomationDeleteResponse as AutomationDeleteResponse, + type AutomationCancelExecutionResponse as AutomationCancelExecutionResponse, + type AutomationCancelExecutionActionResponse as AutomationCancelExecutionActionResponse, + type AutomationListExecutionOutputsResponse as AutomationListExecutionOutputsResponse, + type AutomationRetrieveExecutionResponse as AutomationRetrieveExecutionResponse, + type AutomationRetrieveExecutionActionResponse as AutomationRetrieveExecutionActionResponse, + type AutomationStartExecutionResponse as AutomationStartExecutionResponse, + type WorkflowsWorkflowsPage as WorkflowsWorkflowsPage, + type WorkflowExecutionActionsWorkflowExecutionActionsPage as WorkflowExecutionActionsWorkflowExecutionActionsPage, + type AutomationListExecutionOutputsResponsesOutputsPage as AutomationListExecutionOutputsResponsesOutputsPage, + type WorkflowExecutionsWorkflowExecutionsPage as WorkflowExecutionsWorkflowExecutionsPage, + type AutomationCreateParams as AutomationCreateParams, + type AutomationRetrieveParams as AutomationRetrieveParams, + type AutomationUpdateParams as AutomationUpdateParams, + type AutomationListParams as AutomationListParams, + type AutomationDeleteParams as AutomationDeleteParams, + type AutomationCancelExecutionParams as AutomationCancelExecutionParams, + type AutomationCancelExecutionActionParams as AutomationCancelExecutionActionParams, + type AutomationListExecutionActionsParams as AutomationListExecutionActionsParams, + type AutomationListExecutionOutputsParams as AutomationListExecutionOutputsParams, + type AutomationListExecutionsParams as AutomationListExecutionsParams, + type AutomationRetrieveExecutionParams as AutomationRetrieveExecutionParams, + type AutomationRetrieveExecutionActionParams as AutomationRetrieveExecutionActionParams, + type AutomationStartExecutionParams as AutomationStartExecutionParams, + }; + export { Editors as Editors, type Editor as Editor, @@ -1352,6 +1491,7 @@ export declare namespace Gitpod { export { Environments as Environments, type AdmissionLevel as AdmissionLevel, + type BpfDebugLevel as BpfDebugLevel, type Environment as Environment, type EnvironmentActivitySignal as EnvironmentActivitySignal, type EnvironmentMetadata as EnvironmentMetadata, @@ -1469,18 +1609,33 @@ export declare namespace Gitpod { type PrebuildSpec as PrebuildSpec, type PrebuildStatus as PrebuildStatus, type PrebuildTrigger as PrebuildTrigger, + type WarmPool as WarmPool, + type WarmPoolMetadata as WarmPoolMetadata, + type WarmPoolPhase as WarmPoolPhase, + type WarmPoolSpec as WarmPoolSpec, + type WarmPoolStatus as WarmPoolStatus, type PrebuildCreateResponse as PrebuildCreateResponse, type PrebuildRetrieveResponse as PrebuildRetrieveResponse, type PrebuildDeleteResponse as PrebuildDeleteResponse, type PrebuildCancelResponse as PrebuildCancelResponse, type PrebuildCreateLogsTokenResponse as PrebuildCreateLogsTokenResponse, + type PrebuildCreateWarmPoolResponse as PrebuildCreateWarmPoolResponse, + type PrebuildDeleteWarmPoolResponse as PrebuildDeleteWarmPoolResponse, + type PrebuildRetrieveWarmPoolResponse as PrebuildRetrieveWarmPoolResponse, + type PrebuildUpdateWarmPoolResponse as PrebuildUpdateWarmPoolResponse, type PrebuildsPrebuildsPage as PrebuildsPrebuildsPage, + type WarmPoolsWarmPoolsPage as WarmPoolsWarmPoolsPage, type PrebuildCreateParams as PrebuildCreateParams, type PrebuildRetrieveParams as PrebuildRetrieveParams, type PrebuildListParams as PrebuildListParams, type PrebuildDeleteParams as PrebuildDeleteParams, type PrebuildCancelParams as PrebuildCancelParams, type PrebuildCreateLogsTokenParams as PrebuildCreateLogsTokenParams, + type PrebuildCreateWarmPoolParams as PrebuildCreateWarmPoolParams, + type PrebuildDeleteWarmPoolParams as PrebuildDeleteWarmPoolParams, + type PrebuildListWarmPoolsParams as PrebuildListWarmPoolsParams, + type PrebuildRetrieveWarmPoolParams as PrebuildRetrieveWarmPoolParams, + type PrebuildUpdateWarmPoolParams as PrebuildUpdateWarmPoolParams, }; export { @@ -1527,6 +1682,7 @@ export declare namespace Gitpod { type RunnerStatus as RunnerStatus, type RunnerVariant as RunnerVariant, type SearchMode as SearchMode, + type UpdateWindow as UpdateWindow, type RunnerCreateResponse as RunnerCreateResponse, type RunnerRetrieveResponse as RunnerRetrieveResponse, type RunnerUpdateResponse as RunnerUpdateResponse, @@ -1590,6 +1746,7 @@ export declare namespace Gitpod { }; export type AutomationTrigger = API.AutomationTrigger; + export type CountResponseRelation = API.CountResponseRelation; export type EnvironmentClass = API.EnvironmentClass; export type EnvironmentVariableItem = API.EnvironmentVariableItem; export type EnvironmentVariableSource = API.EnvironmentVariableSource; @@ -1604,6 +1761,8 @@ export declare namespace Gitpod { export type ResourceType = API.ResourceType; export type RunsOn = API.RunsOn; export type SecretRef = API.SecretRef; + export type Sort = API.Sort; + export type SortOrder = API.SortOrder; export type State = API.State; export type Subject = API.Subject; export type Task = API.Task; diff --git a/src/core/pagination.ts b/src/core/pagination.ts index 06774be0..d3e0bc6f 100644 --- a/src/core/pagination.ts +++ b/src/core/pagination.ts @@ -889,6 +889,61 @@ export class MembersPage extends AbstractPage implements MembersPage } } +export interface OutputsPageResponse { + outputs: Array; + + pagination: OutputsPageResponse.Pagination; +} + +export namespace OutputsPageResponse { + export interface Pagination { + nextToken?: string; + } +} + +export interface OutputsPageParams { + pageSize?: number; + + token?: string; +} + +export class OutputsPage extends AbstractPage implements OutputsPageResponse { + outputs: Array; + + pagination: OutputsPageResponse.Pagination; + + constructor( + client: Gitpod, + response: Response, + body: OutputsPageResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.outputs = body.outputs || []; + this.pagination = body.pagination || {}; + } + + getPaginatedItems(): Item[] { + return this.outputs ?? []; + } + + nextPageRequestOptions(): PageRequestOptions | null { + const cursor = this.pagination?.nextToken; + if (!cursor) { + return null; + } + + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + token: cursor, + }, + }; + } +} + export interface PersonalAccessTokensPageResponse { pagination: PersonalAccessTokensPageResponse.Pagination; @@ -1780,3 +1835,229 @@ export class TokensPage extends AbstractPage implements TokensPageRe }; } } + +export interface WarmPoolsPageResponse { + pagination: WarmPoolsPageResponse.Pagination; + + warmPools: Array; +} + +export namespace WarmPoolsPageResponse { + export interface Pagination { + nextToken?: string; + } +} + +export interface WarmPoolsPageParams { + pageSize?: number; + + token?: string; +} + +export class WarmPoolsPage extends AbstractPage implements WarmPoolsPageResponse { + pagination: WarmPoolsPageResponse.Pagination; + + warmPools: Array; + + constructor( + client: Gitpod, + response: Response, + body: WarmPoolsPageResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.pagination = body.pagination || {}; + this.warmPools = body.warmPools || []; + } + + getPaginatedItems(): Item[] { + return this.warmPools ?? []; + } + + nextPageRequestOptions(): PageRequestOptions | null { + const cursor = this.pagination?.nextToken; + if (!cursor) { + return null; + } + + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + token: cursor, + }, + }; + } +} + +export interface WorkflowExecutionActionsPageResponse { + pagination: WorkflowExecutionActionsPageResponse.Pagination; + + workflowExecutionActions: Array; +} + +export namespace WorkflowExecutionActionsPageResponse { + export interface Pagination { + nextToken?: string; + } +} + +export interface WorkflowExecutionActionsPageParams { + pageSize?: number; + + token?: string; +} + +export class WorkflowExecutionActionsPage + extends AbstractPage + implements WorkflowExecutionActionsPageResponse +{ + pagination: WorkflowExecutionActionsPageResponse.Pagination; + + workflowExecutionActions: Array; + + constructor( + client: Gitpod, + response: Response, + body: WorkflowExecutionActionsPageResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.pagination = body.pagination || {}; + this.workflowExecutionActions = body.workflowExecutionActions || []; + } + + getPaginatedItems(): Item[] { + return this.workflowExecutionActions ?? []; + } + + nextPageRequestOptions(): PageRequestOptions | null { + const cursor = this.pagination?.nextToken; + if (!cursor) { + return null; + } + + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + token: cursor, + }, + }; + } +} + +export interface WorkflowExecutionsPageResponse { + pagination: WorkflowExecutionsPageResponse.Pagination; + + workflowExecutions: Array; +} + +export namespace WorkflowExecutionsPageResponse { + export interface Pagination { + nextToken?: string; + } +} + +export interface WorkflowExecutionsPageParams { + pageSize?: number; + + token?: string; +} + +export class WorkflowExecutionsPage + extends AbstractPage + implements WorkflowExecutionsPageResponse +{ + pagination: WorkflowExecutionsPageResponse.Pagination; + + workflowExecutions: Array; + + constructor( + client: Gitpod, + response: Response, + body: WorkflowExecutionsPageResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.pagination = body.pagination || {}; + this.workflowExecutions = body.workflowExecutions || []; + } + + getPaginatedItems(): Item[] { + return this.workflowExecutions ?? []; + } + + nextPageRequestOptions(): PageRequestOptions | null { + const cursor = this.pagination?.nextToken; + if (!cursor) { + return null; + } + + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + token: cursor, + }, + }; + } +} + +export interface WorkflowsPageResponse { + pagination: WorkflowsPageResponse.Pagination; + + workflows: Array; +} + +export namespace WorkflowsPageResponse { + export interface Pagination { + nextToken?: string; + } +} + +export interface WorkflowsPageParams { + pageSize?: number; + + token?: string; +} + +export class WorkflowsPage extends AbstractPage implements WorkflowsPageResponse { + pagination: WorkflowsPageResponse.Pagination; + + workflows: Array; + + constructor( + client: Gitpod, + response: Response, + body: WorkflowsPageResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.pagination = body.pagination || {}; + this.workflows = body.workflows || []; + } + + getPaginatedItems(): Item[] { + return this.workflows ?? []; + } + + nextPageRequestOptions(): PageRequestOptions | null { + const cursor = this.pagination?.nextToken; + if (!cursor) { + return null; + } + + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + token: cursor, + }, + }; + } +} diff --git a/src/internal/utils.ts b/src/internal/utils.ts index 3cbfacce..c591353b 100644 --- a/src/internal/utils.ts +++ b/src/internal/utils.ts @@ -6,3 +6,4 @@ export * from './utils/env'; export * from './utils/log'; export * from './utils/uuid'; export * from './utils/sleep'; +export * from './utils/query'; diff --git a/src/internal/utils/query.ts b/src/internal/utils/query.ts new file mode 100644 index 00000000..202dd642 --- /dev/null +++ b/src/internal/utils/query.ts @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { GitpodError } from '../../core/error'; + +/** + * Basic re-implementation of `qs.stringify` for primitive types. + */ +export function stringifyQuery(query: object | Record) { + return Object.entries(query) + .filter(([_, value]) => typeof value !== 'undefined') + .map(([key, value]) => { + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { + return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; + } + if (value === null) { + return `${encodeURIComponent(key)}=`; + } + throw new GitpodError( + `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`, + ); + }) + .join('&'); +} diff --git a/src/resources/agents.ts b/src/resources/agents.ts index dd6e5dfe..27755f1c 100644 --- a/src/resources/agents.ts +++ b/src/resources/agents.ts @@ -730,6 +730,8 @@ export namespace AgentExecution { limits?: Spec.Limits; + loopConditions?: Array; + session?: string; /** @@ -748,6 +750,14 @@ export namespace AgentExecution { maxOutputTokens?: string; } + + export interface LoopCondition { + id?: string; + + description?: string; + + expression?: string; + } } /** @@ -850,12 +860,15 @@ export namespace AgentExecution { | 'SUPPORTED_MODEL_SONNET_4_EXTENDED' | 'SUPPORTED_MODEL_SONNET_4_5' | 'SUPPORTED_MODEL_SONNET_4_5_EXTENDED' + | 'SUPPORTED_MODEL_SONNET_4_6' + | 'SUPPORTED_MODEL_SONNET_4_6_EXTENDED' | 'SUPPORTED_MODEL_OPUS_4' | 'SUPPORTED_MODEL_OPUS_4_EXTENDED' | 'SUPPORTED_MODEL_OPUS_4_5' | 'SUPPORTED_MODEL_OPUS_4_5_EXTENDED' | 'SUPPORTED_MODEL_OPUS_4_6' | 'SUPPORTED_MODEL_OPUS_4_6_EXTENDED' + | 'SUPPORTED_MODEL_HAIKU_4_5' | 'SUPPORTED_MODEL_OPENAI_4O' | 'SUPPORTED_MODEL_OPENAI_4O_MINI' | 'SUPPORTED_MODEL_OPENAI_O1' @@ -963,6 +976,19 @@ export namespace AgentExecution { } } +/** + * AgentMessage is a message sent between agents (e.g. from a parent agent to a + * child agent execution, or vice versa). + */ +export interface AgentMessage { + /** + * Free-form payload of the message. + */ + payload?: string; + + type?: Type; +} + /** * AgentMode defines the operational mode of an agent */ @@ -1214,6 +1240,13 @@ export interface PromptSpec { prompt?: string; } +/** + * Role identifies the sender's relationship in the parent/child hierarchy. + */ +export type Role = 'ROLE_UNSPECIFIED' | 'ROLE_PARENT' | 'ROLE_CHILD'; + +export type Type = 'TYPE_UNSPECIFIED' | 'TYPE_UPDATE' | 'TYPE_COMPLETE'; + export interface UserInputBlock { id?: string; @@ -1287,6 +1320,65 @@ export namespace UserInputBlock { } } +/** + * WakeEvent is sent by the backend to wake an agent when a registered interest + * fires. Delivered via SendToAgentExecution as a new oneof variant. + */ +export interface WakeEvent { + environment?: WakeEvent.Environment; + + /** + * The interest ID that fired (from WaitingInfo.Interest.id). + */ + interestId?: string; + + loopRetrigger?: WakeEvent.LoopRetrigger; + + timer?: WakeEvent.Timer; +} + +export namespace WakeEvent { + export interface Environment { + environmentId?: string; + + failureMessage?: Array; + + /** + * The phase the environment reached (e.g. "running", "stopped", "deleted"). + */ + phase?: string; + } + + export interface LoopRetrigger { + outputs?: { [key: string]: string }; + + unmetConditions?: Array; + } + + export namespace LoopRetrigger { + export interface UnmetCondition { + id?: string; + + description?: string; + + expression?: string; + + iteration?: number; + + maxIterations?: number; + + reason?: string; + } + } + + export interface Timer { + /** + * The actual time the timer was evaluated as expired. + */ + firedAt?: string; + } +} + export interface AgentCreateExecutionConversationTokenResponse { token?: string; } @@ -1379,6 +1471,12 @@ export namespace AgentListExecutionsParams { 'AGENT_EXECUTION_ROLE_UNSPECIFIED' | 'AGENT_EXECUTION_ROLE_DEFAULT' | 'AGENT_EXECUTION_ROLE_WORKFLOW' >; + /** + * session_ids filters the response to only executions belonging to the specified + * sessions + */ + sessionIds?: Array; + statusPhases?: Array< 'PHASE_UNSPECIFIED' | 'PHASE_PENDING' | 'PHASE_RUNNING' | 'PHASE_WAITING_FOR_INPUT' | 'PHASE_STOPPED' >; @@ -1417,11 +1515,24 @@ export namespace AgentListPromptsParams { commandPrefix?: string; + /** + * exclude_prompt_content omits the large spec.prompt text from the response. Other + * spec fields (is_template, is_command, command, is_skill) are still returned. Use + * GetPrompt to retrieve the full prompt content when needed. + */ + excludePromptContent?: boolean; + isCommand?: boolean; isSkill?: boolean; isTemplate?: boolean; + + /** + * search performs case-insensitive search across prompt name, description, and + * command. + */ + search?: string; } export interface Pagination { @@ -1450,16 +1561,28 @@ export interface AgentRetrievePromptParams { export interface AgentSendToExecutionParams { agentExecutionId?: string; + /** + * AgentMessage is a message sent between agents (e.g. from a parent agent to a + * child agent execution, or vice versa). + */ + agentMessage?: AgentMessage; + userInput?: UserInputBlock; + + /** + * WakeEvent is sent by the backend to wake an agent when a registered interest + * fires. Delivered via SendToAgentExecution as a new oneof variant. + */ + wakeEvent?: WakeEvent; } export interface AgentStartExecutionParams { agentId?: string; /** - * annotations are key-value pairs for tracking external context (e.g., Linear + * annotations are key-value pairs for tracking external context (e.g., integration * session IDs, GitHub issue references). Keys should follow domain/name convention - * (e.g., "linear.app/session-id"). + * (e.g., "agent-client-session/id"). */ annotations?: { [key: string]: string }; @@ -1480,6 +1603,12 @@ export interface AgentStartExecutionParams { */ runnerId?: string; + /** + * session_id is the ID of the session this agent execution belongs to. If empty, a + * new session is created implicitly. + */ + sessionId?: string; + /** * workflow_action_id is an optional reference to the workflow execution action * that created this agent execution. Used for tracking and event correlation. @@ -1559,11 +1688,15 @@ export declare namespace Agents { export { type AgentCodeContext as AgentCodeContext, type AgentExecution as AgentExecution, + type AgentMessage as AgentMessage, type AgentMode as AgentMode, type Prompt as Prompt, type PromptMetadata as PromptMetadata, type PromptSpec as PromptSpec, + type Role as Role, + type Type as Type, type UserInputBlock as UserInputBlock, + type WakeEvent as WakeEvent, type AgentCreateExecutionConversationTokenResponse as AgentCreateExecutionConversationTokenResponse, type AgentCreatePromptResponse as AgentCreatePromptResponse, type AgentDeleteExecutionResponse as AgentDeleteExecutionResponse, diff --git a/src/resources/automations.ts b/src/resources/automations.ts new file mode 100644 index 00000000..9646efdb --- /dev/null +++ b/src/resources/automations.ts @@ -0,0 +1,2923 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../core/resource'; +import * as AutomationsAPI from './automations'; +import * as AgentsAPI from './agents'; +import * as Shared from './shared'; +import { APIPromise } from '../core/api-promise'; +import { + OutputsPage, + type OutputsPageParams, + PagePromise, + WorkflowExecutionActionsPage, + type WorkflowExecutionActionsPageParams, + WorkflowExecutionsPage, + type WorkflowExecutionsPageParams, + WorkflowsPage, + type WorkflowsPageParams, +} from '../core/pagination'; +import { RequestOptions } from '../internal/request-options'; + +export class Automations extends APIResource { + /** + * Creates a new workflow with specified configuration. + * + * Use this method to: + * + * - Set up automated workflows + * - Configure workflow triggers + * - Define workflow actions and steps + * - Set execution limits and constraints + * + * @example + * ```ts + * const automation = await client.automations.create({ + * action: { limits: {} }, + * }); + * ``` + */ + create(body: AutomationCreateParams, options?: RequestOptions): APIPromise { + return this._client.post('/gitpod.v1.WorkflowService/CreateWorkflow', { body, ...options }); + } + + /** + * Gets details about a specific workflow. + * + * Use this method to: + * + * - View workflow configuration + * - Check workflow status + * - Get workflow metadata + * + * ### Examples + * + * - Get workflow details: + * + * Retrieves information about a specific workflow. + * + * ```yaml + * workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * ``` + * + * @example + * ```ts + * const automation = await client.automations.retrieve({ + * workflowId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * }); + * ``` + */ + retrieve(body: AutomationRetrieveParams, options?: RequestOptions): APIPromise { + return this._client.post('/gitpod.v1.WorkflowService/GetWorkflow', { body, ...options }); + } + + /** + * Updates a workflow's configuration using full replacement semantics. + * + * Update Behavior: + * + * - All provided fields completely replace existing values + * - Optional fields that are not provided remain unchanged + * - Complex fields (triggers, action) are replaced entirely, not merged + * - To remove optional fields, explicitly set them to empty/default values + * + * Use this method to: + * + * - Modify workflow settings + * - Update triggers and actions + * - Change execution limits + * - Update workflow steps + * + * ### Examples + * + * - Update workflow name: + * + * Changes the workflow's display name. + * + * ```yaml + * workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * name: "Updated Workflow Name" + * ``` + * + * - Replace all triggers: + * + * Completely replaces the workflow's trigger configuration. + * + * ```yaml + * workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * triggers: + * - manual: {} + * context: + * projects: + * projectIds: ["new-project-id"] + * ``` + * + * - Update execution limits: + * + * Completely replaces the workflow's action configuration. + * + * ```yaml + * workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * action: + * limits: + * maxParallel: 10 + * maxTotal: 100 + * steps: + * - task: + * command: "npm test" + * ``` + * + * @example + * ```ts + * const automation = await client.automations.update({ + * triggers: [ + * { + * context: { + * projects: { projectIds: ['new-project-id'] }, + * }, + * manual: {}, + * }, + * ], + * workflowId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * }); + * ``` + */ + update(body: AutomationUpdateParams, options?: RequestOptions): APIPromise { + return this._client.post('/gitpod.v1.WorkflowService/UpdateWorkflow', { body, ...options }); + } + + /** + * ListWorkflows + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const workflow of client.automations.list()) { + * // ... + * } + * ``` + */ + list( + params: AutomationListParams, + options?: RequestOptions, + ): PagePromise { + const { token, pageSize, ...body } = params; + return this._client.getAPIList('/gitpod.v1.WorkflowService/ListWorkflows', WorkflowsPage, { + query: { token, pageSize }, + body, + method: 'post', + ...options, + }); + } + + /** + * Deletes a workflow permanently. + * + * Use this method to: + * + * - Remove unused workflows + * - Clean up test workflows + * - Delete obsolete configurations + * + * ### Examples + * + * - Delete workflow: + * + * Permanently removes a workflow. + * + * ```yaml + * workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * ``` + * + * @example + * ```ts + * const automation = await client.automations.delete({ + * workflowId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * }); + * ``` + */ + delete(body: AutomationDeleteParams, options?: RequestOptions): APIPromise { + return this._client.post('/gitpod.v1.WorkflowService/DeleteWorkflow', { body, ...options }); + } + + /** + * Cancels a running workflow execution. + * + * Use this method to: + * + * - Stop long-running executions + * - Cancel failed executions + * - Manage resource usage + * + * ### Examples + * + * - Cancel execution: + * + * Stops a running workflow execution. + * + * ```yaml + * workflowExecutionId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` + * + * @example + * ```ts + * const response = await client.automations.cancelExecution({ + * workflowExecutionId: + * 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * }); + * ``` + */ + cancelExecution(body: AutomationCancelExecutionParams, options?: RequestOptions): APIPromise { + return this._client.post('/gitpod.v1.WorkflowService/CancelWorkflowExecution', { body, ...options }); + } + + /** + * Cancels a running workflow execution action. + * + * Use this method to: + * + * - Stop long-running actions + * - Cancel failed actions + * - Manage resource usage + * + * ### Examples + * + * - Cancel execution action: + * + * Stops a running workflow execution action. + * + * ```yaml + * workflowExecutionActionId: "a1b2c3d4-5e6f-7890-abcd-ef1234567890" + * ``` + * + * @example + * ```ts + * const response = + * await client.automations.cancelExecutionAction({ + * workflowExecutionActionId: + * 'a1b2c3d4-5e6f-7890-abcd-ef1234567890', + * }); + * ``` + */ + cancelExecutionAction( + body: AutomationCancelExecutionActionParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.WorkflowService/CancelWorkflowExecutionAction', { + body, + ...options, + }); + } + + /** + * Lists workflow execution actions with optional filtering. + * + * Use this method to: + * + * - Monitor individual action execution status + * - Debug action failures + * - Track resource usage per action + * + * ### Examples + * + * - List execution actions for workflow execution: + * + * Shows all execution actions for a specific workflow execution. + * + * ```yaml + * filter: + * workflowExecutionIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + * pagination: + * pageSize: 20 + * ``` + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const workflowExecutionAction of client.automations.listExecutionActions( + * { + * filter: { + * workflowExecutionIds: [ + * 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * ], + * }, + * pagination: { pageSize: 20 }, + * }, + * )) { + * // ... + * } + * ``` + */ + listExecutionActions( + params: AutomationListExecutionActionsParams, + options?: RequestOptions, + ): PagePromise { + const { token, pageSize, ...body } = params; + return this._client.getAPIList( + '/gitpod.v1.WorkflowService/ListWorkflowExecutionActions', + WorkflowExecutionActionsPage, + { query: { token, pageSize }, body, method: 'post', ...options }, + ); + } + + /** + * Lists outputs produced by workflow execution actions. + * + * Use this method to: + * + * - Retrieve test results, coverage metrics, or other structured data from + * executions + * - Aggregate outputs across multiple workflow executions + * - Build dashboards or reports from execution data + * + * ### Examples + * + * - List outputs for a workflow execution: + * + * Retrieves all outputs produced by actions in the specified execution. + * + * ```yaml + * filter: + * workflowExecutionIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + * pagination: + * pageSize: 50 + * ``` + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const automationListExecutionOutputsResponse of client.automations.listExecutionOutputs( + * { + * filter: { + * workflowExecutionIds: [ + * 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * ], + * }, + * pagination: { pageSize: 50 }, + * }, + * )) { + * // ... + * } + * ``` + */ + listExecutionOutputs( + params: AutomationListExecutionOutputsParams, + options?: RequestOptions, + ): PagePromise { + const { token, pageSize, ...body } = params; + return this._client.getAPIList( + '/gitpod.v1.WorkflowService/ListWorkflowExecutionOutputs', + OutputsPage, + { query: { token, pageSize }, body, method: 'post', ...options }, + ); + } + + /** + * Lists workflow executions with optional filtering. + * + * Use this method to: + * + * - Monitor workflow execution history + * - Track execution status + * - Debug workflow issues + * + * ### Examples + * + * - List executions for workflow: + * + * Shows all executions for a specific workflow. + * + * ```yaml + * filter: + * workflowIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] + * pagination: + * pageSize: 20 + * ``` + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const workflowExecution of client.automations.listExecutions( + * { + * filter: { + * workflowIds: ['b0e12f6c-4c67-429d-a4a6-d9838b5da047'], + * }, + * pagination: { pageSize: 20 }, + * }, + * )) { + * // ... + * } + * ``` + */ + listExecutions( + params: AutomationListExecutionsParams, + options?: RequestOptions, + ): PagePromise { + const { token, pageSize, ...body } = params; + return this._client.getAPIList( + '/gitpod.v1.WorkflowService/ListWorkflowExecutions', + WorkflowExecutionsPage, + { query: { token, pageSize }, body, method: 'post', ...options }, + ); + } + + /** + * Gets details about a specific workflow execution. + * + * Use this method to: + * + * - Check execution status + * - View execution results + * - Monitor execution progress + * + * ### Examples + * + * - Get execution details: + * + * Retrieves information about a specific execution. + * + * ```yaml + * workflowExecutionId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` + * + * @example + * ```ts + * const response = await client.automations.retrieveExecution( + * { + * workflowExecutionId: + * 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * }, + * ); + * ``` + */ + retrieveExecution( + body: AutomationRetrieveExecutionParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.WorkflowService/GetWorkflowExecution', { body, ...options }); + } + + /** + * Gets details about a specific workflow execution action. + * + * Use this method to: + * + * - Check execution action status + * - View execution action results + * - Monitor execution action progress + * + * ### Examples + * + * - Get execution action details: + * + * Retrieves information about a specific execution action. + * + * ```yaml + * workflowExecutionActionId: "a1b2c3d4-5e6f-7890-abcd-ef1234567890" + * ``` + * + * @example + * ```ts + * const response = + * await client.automations.retrieveExecutionAction({ + * workflowExecutionActionId: + * 'a1b2c3d4-5e6f-7890-abcd-ef1234567890', + * }); + * ``` + */ + retrieveExecutionAction( + body: AutomationRetrieveExecutionActionParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.WorkflowService/GetWorkflowExecutionAction', { body, ...options }); + } + + /** + * Starts a workflow execution. + * + * Use this method to: + * + * - Start workflow execution on demand + * - Test workflow configurations + * - Run workflows outside of automatic triggers + * + * ### Examples + * + * - Start workflow: + * + * Starts a workflow execution manually. + * + * ```yaml + * workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * ``` + * + * @example + * ```ts + * const response = await client.automations.startExecution({ + * workflowId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * }); + * ``` + */ + startExecution( + body: AutomationStartExecutionParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.WorkflowService/StartWorkflow', { body, ...options }); + } +} + +export type WorkflowsWorkflowsPage = WorkflowsPage; + +export type WorkflowExecutionActionsWorkflowExecutionActionsPage = + WorkflowExecutionActionsPage; + +export type AutomationListExecutionOutputsResponsesOutputsPage = + OutputsPage; + +export type WorkflowExecutionsWorkflowExecutionsPage = WorkflowExecutionsPage; + +/** + * Workflow represents a workflow configuration. + */ +export interface Workflow { + id?: string; + + /** + * WorkflowMetadata contains workflow metadata. + */ + metadata?: Workflow.Metadata; + + spec?: Workflow.Spec; + + /** + * Webhook URL for triggering this workflow via HTTP POST Format: + * {base_url}/workflows/{workflow_id}/webhooks + */ + webhookUrl?: string; +} + +export namespace Workflow { + /** + * WorkflowMetadata contains workflow metadata. + */ + export interface Metadata { + /** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at nanosecond + * resolution. The count is relative to an epoch at UTC midnight on January 1, + * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + * backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a + * [24-hour linear smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + * zero-padded to two digits each. The fractional seconds, which can go up to 9 + * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + * serializer should always use UTC (as indicated by "Z") when printing the + * Timestamp type and a proto3 JSON parser should be able to accept both UTC and + * other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + * January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted to + * this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + * Joda Time's + * [`ISODateTimeFormat.dateTime()`]() + * to obtain a formatter capable of generating timestamps in this format. + */ + createdAt?: string; + + creator?: Shared.Subject; + + description?: string; + + executor?: Shared.Subject; + + name?: string; + + /** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at nanosecond + * resolution. The count is relative to an epoch at UTC midnight on January 1, + * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + * backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a + * [24-hour linear smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + * zero-padded to two digits each. The fractional seconds, which can go up to 9 + * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + * serializer should always use UTC (as indicated by "Z") when printing the + * Timestamp type and a proto3 JSON parser should be able to accept both UTC and + * other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + * January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted to + * this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + * Joda Time's + * [`ISODateTimeFormat.dateTime()`]() + * to obtain a formatter capable of generating timestamps in this format. + */ + updatedAt?: string; + } + + export interface Spec { + /** + * WorkflowAction defines the actions to be executed in a workflow. + */ + action?: AutomationsAPI.WorkflowAction; + + /** + * WorkflowAction defines the actions to be executed in a workflow. + */ + report?: AutomationsAPI.WorkflowAction; + + triggers?: Array; + } +} + +/** + * WorkflowAction defines the actions to be executed in a workflow. + */ +export interface WorkflowAction { + /** + * Limits defines execution limits for workflow actions. Concurrent actions limit + * cannot exceed total actions limit: + * + * ``` + * this.max_parallel <= this.max_total + * ``` + */ + limits: WorkflowAction.Limits; + + /** + * Automation must have between 1 and 50 steps: + * + * ``` + * size(this) >= 1 && size(this) <= 50 + * ``` + */ + steps?: Array; +} + +export namespace WorkflowAction { + /** + * Limits defines execution limits for workflow actions. Concurrent actions limit + * cannot exceed total actions limit: + * + * ``` + * this.max_parallel <= this.max_total + * ``` + */ + export interface Limits { + /** + * Maximum parallel actions must be between 1 and 25: + * + * ``` + * this >= 1 && this <= 25 + * ``` + */ + maxParallel?: number; + + /** + * Maximum total actions must be between 1 and 100: + * + * ``` + * this >= 1 && this <= 100 + * ``` + */ + maxTotal?: number; + + /** + * PerExecution defines limits per execution action. + */ + perExecution?: Limits.PerExecution; + } + + export namespace Limits { + /** + * PerExecution defines limits per execution action. + */ + export interface PerExecution { + /** + * Maximum time allowed for a single execution action. Use standard duration format + * (e.g., "30m" for 30 minutes, "2h" for 2 hours). + */ + maxTime?: string; + } + } +} + +/** + * WorkflowExecution represents a workflow execution instance. + */ +export interface WorkflowExecution { + id?: string; + + /** + * WorkflowExecutionMetadata contains workflow execution metadata. + */ + metadata?: WorkflowExecution.Metadata; + + /** + * WorkflowExecutionSpec contains the specification used for this execution. + */ + spec?: WorkflowExecution.Spec; + + /** + * WorkflowExecutionStatus contains the current status of a workflow execution. + */ + status?: WorkflowExecution.Status; +} + +export namespace WorkflowExecution { + /** + * WorkflowExecutionMetadata contains workflow execution metadata. + */ + export interface Metadata { + creator?: Shared.Subject; + + executor?: Shared.Subject; + + /** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at nanosecond + * resolution. The count is relative to an epoch at UTC midnight on January 1, + * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + * backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a + * [24-hour linear smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + * zero-padded to two digits each. The fractional seconds, which can go up to 9 + * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + * serializer should always use UTC (as indicated by "Z") when printing the + * Timestamp type and a proto3 JSON parser should be able to accept both UTC and + * other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + * January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted to + * this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + * Joda Time's + * [`ISODateTimeFormat.dateTime()`]() + * to obtain a formatter capable of generating timestamps in this format. + */ + finishedAt?: string; + + /** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at nanosecond + * resolution. The count is relative to an epoch at UTC midnight on January 1, + * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + * backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a + * [24-hour linear smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + * zero-padded to two digits each. The fractional seconds, which can go up to 9 + * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + * serializer should always use UTC (as indicated by "Z") when printing the + * Timestamp type and a proto3 JSON parser should be able to accept both UTC and + * other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + * January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted to + * this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + * Joda Time's + * [`ISODateTimeFormat.dateTime()`]() + * to obtain a formatter capable of generating timestamps in this format. + */ + startedAt?: string; + + workflowId?: string; + } + + /** + * WorkflowExecutionSpec contains the specification used for this execution. + */ + export interface Spec { + /** + * WorkflowAction defines the actions to be executed in a workflow. + */ + action?: AutomationsAPI.WorkflowAction; + + /** + * WorkflowAction defines the actions to be executed in a workflow. + */ + report?: AutomationsAPI.WorkflowAction; + + /** + * WorkflowExecutionTrigger represents a workflow execution trigger instance. + */ + trigger?: Spec.Trigger; + } + + export namespace Spec { + /** + * WorkflowExecutionTrigger represents a workflow execution trigger instance. + */ + export interface Trigger { + /** + * Context from the workflow trigger - copied at execution time for immutability. + * This allows the reconciler to create actions without fetching the workflow + * definition. + */ + context: AutomationsAPI.WorkflowTriggerContext; + + /** + * Manual trigger - empty message since no additional data needed + */ + manual?: unknown; + + /** + * PullRequest represents pull request metadata from source control systems. This + * message is used across workflow triggers, executions, and agent contexts to + * maintain consistent PR information throughout the system. + */ + pullRequest?: Trigger.PullRequest; + + /** + * Time trigger - just the timestamp when it was triggered + */ + time?: Trigger.Time; + } + + export namespace Trigger { + /** + * PullRequest represents pull request metadata from source control systems. This + * message is used across workflow triggers, executions, and agent contexts to + * maintain consistent PR information throughout the system. + */ + export interface PullRequest { + /** + * Unique identifier from the source system (e.g., "123" for GitHub PR #123) + */ + id?: string; + + /** + * Author name as provided by the SCM system + */ + author?: string; + + /** + * Whether this is a draft pull request + */ + draft?: boolean; + + /** + * Source branch name (the branch being merged from) + */ + fromBranch?: string; + + /** + * Repository information + */ + repository?: PullRequest.Repository; + + /** + * Current state of the pull request + */ + state?: Shared.State; + + /** + * Pull request title + */ + title?: string; + + /** + * Target branch name (the branch being merged into) + */ + toBranch?: string; + + /** + * Pull request URL (e.g., "https://github.com/owner/repo/pull/123") + */ + url?: string; + } + + export namespace PullRequest { + /** + * Repository information + */ + export interface Repository { + cloneUrl?: string; + + host?: string; + + name?: string; + + owner?: string; + } + } + + /** + * Time trigger - just the timestamp when it was triggered + */ + export interface Time { + /** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at nanosecond + * resolution. The count is relative to an epoch at UTC midnight on January 1, + * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + * backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a + * [24-hour linear smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + * zero-padded to two digits each. The fractional seconds, which can go up to 9 + * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + * serializer should always use UTC (as indicated by "Z") when printing the + * Timestamp type and a proto3 JSON parser should be able to accept both UTC and + * other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + * January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted to + * this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + * Joda Time's + * [`ISODateTimeFormat.dateTime()`]() + * to obtain a formatter capable of generating timestamps in this format. + */ + triggeredAt?: string; + } + } + } + + /** + * WorkflowExecutionStatus contains the current status of a workflow execution. + */ + export interface Status { + doneActionCount?: number; + + failedActionCount?: number; + + /** + * Structured failures that caused the workflow execution to fail. Provides + * detailed error codes, messages, and retry information. + */ + failures?: Array; + + pendingActionCount?: number; + + phase?: + | 'WORKFLOW_EXECUTION_PHASE_UNSPECIFIED' + | 'WORKFLOW_EXECUTION_PHASE_PENDING' + | 'WORKFLOW_EXECUTION_PHASE_RUNNING' + | 'WORKFLOW_EXECUTION_PHASE_STOPPING' + | 'WORKFLOW_EXECUTION_PHASE_STOPPED' + | 'WORKFLOW_EXECUTION_PHASE_DELETING' + | 'WORKFLOW_EXECUTION_PHASE_DELETED' + | 'WORKFLOW_EXECUTION_PHASE_COMPLETED'; + + runningActionCount?: number; + + stoppedActionCount?: number; + + /** + * Structured warnings about the workflow execution. Provides detailed warning + * codes and messages. + */ + warnings?: Array; + } + + export namespace Status { + /** + * WorkflowError provides structured error information for workflow failures. This + * enables the reconciler to make informed retry decisions and the frontend to + * display actionable error messages. + */ + export interface Failure { + /** + * Error code identifying the type of error. + */ + code?: + | 'WORKFLOW_ERROR_CODE_UNSPECIFIED' + | 'WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR' + | 'WORKFLOW_ERROR_CODE_AGENT_ERROR'; + + /** + * Human-readable error message. + */ + message?: string; + + /** + * Additional metadata about the error. Common keys include: + * + * - environment_id: ID of the environment + * - task_id: ID of the task + * - service_id: ID of the service + * - workflow_id: ID of the workflow + * - workflow_execution_id: ID of the workflow execution + */ + meta?: { [key: string]: string }; + + /** + * Reason explaining why the error occurred. Examples: "not_found", "stopped", + * "deleted", "creation_failed", "start_failed" + */ + reason?: string; + + /** + * Retry configuration. If not set, the error is considered non-retriable. + */ + retry?: Failure.Retry | null; + } + + export namespace Failure { + /** + * Retry configuration. If not set, the error is considered non-retriable. + */ + export interface Retry { + /** + * Whether the error is retriable. + */ + retriable?: boolean; + + /** + * Suggested duration to wait before retrying. Only meaningful when retriable is + * true. + */ + retryAfter?: string; + } + } + + /** + * WorkflowError provides structured error information for workflow failures. This + * enables the reconciler to make informed retry decisions and the frontend to + * display actionable error messages. + */ + export interface Warning { + /** + * Error code identifying the type of error. + */ + code?: + | 'WORKFLOW_ERROR_CODE_UNSPECIFIED' + | 'WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR' + | 'WORKFLOW_ERROR_CODE_AGENT_ERROR'; + + /** + * Human-readable error message. + */ + message?: string; + + /** + * Additional metadata about the error. Common keys include: + * + * - environment_id: ID of the environment + * - task_id: ID of the task + * - service_id: ID of the service + * - workflow_id: ID of the workflow + * - workflow_execution_id: ID of the workflow execution + */ + meta?: { [key: string]: string }; + + /** + * Reason explaining why the error occurred. Examples: "not_found", "stopped", + * "deleted", "creation_failed", "start_failed" + */ + reason?: string; + + /** + * Retry configuration. If not set, the error is considered non-retriable. + */ + retry?: Warning.Retry | null; + } + + export namespace Warning { + /** + * Retry configuration. If not set, the error is considered non-retriable. + */ + export interface Retry { + /** + * Whether the error is retriable. + */ + retriable?: boolean; + + /** + * Suggested duration to wait before retrying. Only meaningful when retriable is + * true. + */ + retryAfter?: string; + } + } + } +} + +/** + * WorkflowExecutionAction represents a workflow execution action instance. + */ +export interface WorkflowExecutionAction { + id?: string; + + /** + * WorkflowExecutionActionMetadata contains workflow execution action metadata. + */ + metadata?: WorkflowExecutionAction.Metadata; + + /** + * WorkflowExecutionActionSpec contains the specification for this execution + * action. + */ + spec?: WorkflowExecutionAction.Spec; + + /** + * WorkflowExecutionActionStatus contains the current status of a workflow + * execution action. + */ + status?: WorkflowExecutionAction.Status; +} + +export namespace WorkflowExecutionAction { + /** + * WorkflowExecutionActionMetadata contains workflow execution action metadata. + */ + export interface Metadata { + /** + * Human-readable name for this action based on its context. Examples: + * "gitpod-io/gitpod-next" for repository context, "My Project" for project + * context. Will be empty string for actions created before this field was added. + */ + actionName?: string; + + /** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at nanosecond + * resolution. The count is relative to an epoch at UTC midnight on January 1, + * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + * backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a + * [24-hour linear smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + * zero-padded to two digits each. The fractional seconds, which can go up to 9 + * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + * serializer should always use UTC (as indicated by "Z") when printing the + * Timestamp type and a proto3 JSON parser should be able to accept both UTC and + * other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + * January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted to + * this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + * Joda Time's + * [`ISODateTimeFormat.dateTime()`]() + * to obtain a formatter capable of generating timestamps in this format. + */ + finishedAt?: string; + + /** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at nanosecond + * resolution. The count is relative to an epoch at UTC midnight on January 1, + * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + * backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a + * [24-hour linear smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + * zero-padded to two digits each. The fractional seconds, which can go up to 9 + * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + * serializer should always use UTC (as indicated by "Z") when printing the + * Timestamp type and a proto3 JSON parser should be able to accept both UTC and + * other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + * January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted to + * this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + * Joda Time's + * [`ISODateTimeFormat.dateTime()`]() + * to obtain a formatter capable of generating timestamps in this format. + */ + startedAt?: string; + + workflowExecutionId?: string; + + workflowId?: string; + } + + /** + * WorkflowExecutionActionSpec contains the specification for this execution + * action. + */ + export interface Spec { + /** + * Context for the execution action - specifies where and how the action executes. + * This is resolved from the workflow trigger context and contains the specific + * project, repository, or agent context for this execution instance. + */ + context?: AgentsAPI.AgentCodeContext; + + /** + * PerExecution defines limits per execution action. + */ + limits?: Spec.Limits; + } + + export namespace Spec { + /** + * PerExecution defines limits per execution action. + */ + export interface Limits { + /** + * Maximum time allowed for a single execution action. Use standard duration format + * (e.g., "30m" for 30 minutes, "2h" for 2 hours). + */ + maxTime?: string; + } + } + + /** + * WorkflowExecutionActionStatus contains the current status of a workflow + * execution action. + */ + export interface Status { + agentExecutionId?: string; + + environmentId?: string; + + /** + * Structured failures that caused the workflow execution action to fail. Provides + * detailed error codes, messages, and retry information. + */ + failures?: Array; + + /** + * WorkflowExecutionActionPhase defines the phases of workflow execution action. + */ + phase?: + | 'WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_PENDING' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_RUNNING' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_STOPPING' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_STOPPED' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_DELETING' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_DELETED' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_DONE'; + + /** + * Step-level progress tracking + */ + stepStatuses?: Array; + + /** + * Structured warnings about the workflow execution action. Provides detailed + * warning codes and messages. + */ + warnings?: Array; + } + + export namespace Status { + /** + * WorkflowError provides structured error information for workflow failures. This + * enables the reconciler to make informed retry decisions and the frontend to + * display actionable error messages. + */ + export interface Failure { + /** + * Error code identifying the type of error. + */ + code?: + | 'WORKFLOW_ERROR_CODE_UNSPECIFIED' + | 'WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR' + | 'WORKFLOW_ERROR_CODE_AGENT_ERROR'; + + /** + * Human-readable error message. + */ + message?: string; + + /** + * Additional metadata about the error. Common keys include: + * + * - environment_id: ID of the environment + * - task_id: ID of the task + * - service_id: ID of the service + * - workflow_id: ID of the workflow + * - workflow_execution_id: ID of the workflow execution + */ + meta?: { [key: string]: string }; + + /** + * Reason explaining why the error occurred. Examples: "not_found", "stopped", + * "deleted", "creation_failed", "start_failed" + */ + reason?: string; + + /** + * Retry configuration. If not set, the error is considered non-retriable. + */ + retry?: Failure.Retry | null; + } + + export namespace Failure { + /** + * Retry configuration. If not set, the error is considered non-retriable. + */ + export interface Retry { + /** + * Whether the error is retriable. + */ + retriable?: boolean; + + /** + * Suggested duration to wait before retrying. Only meaningful when retriable is + * true. + */ + retryAfter?: string; + } + } + + /** + * WorkflowExecutionActionStepStatus represents the status of a single step + * execution. + */ + export interface StepStatus { + /** + * Structured error that caused the step to fail. Provides detailed error code, + * message, and retry information. + */ + error?: StepStatus.Error; + + /** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at nanosecond + * resolution. The count is relative to an epoch at UTC midnight on January 1, + * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + * backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a + * [24-hour linear smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + * zero-padded to two digits each. The fractional seconds, which can go up to 9 + * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + * serializer should always use UTC (as indicated by "Z") when printing the + * Timestamp type and a proto3 JSON parser should be able to accept both UTC and + * other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + * January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted to + * this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + * Joda Time's + * [`ISODateTimeFormat.dateTime()`]() + * to obtain a formatter capable of generating timestamps in this format. + */ + finishedAt?: string; + + phase?: + | 'STEP_PHASE_UNSPECIFIED' + | 'STEP_PHASE_PENDING' + | 'STEP_PHASE_RUNNING' + | 'STEP_PHASE_DONE' + | 'STEP_PHASE_FAILED' + | 'STEP_PHASE_CANCELLED'; + + /** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at nanosecond + * resolution. The count is relative to an epoch at UTC midnight on January 1, + * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + * backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a + * [24-hour linear smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + * zero-padded to two digits each. The fractional seconds, which can go up to 9 + * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + * serializer should always use UTC (as indicated by "Z") when printing the + * Timestamp type and a proto3 JSON parser should be able to accept both UTC and + * other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + * January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted to + * this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + * Joda Time's + * [`ISODateTimeFormat.dateTime()`]() + * to obtain a formatter capable of generating timestamps in this format. + */ + startedAt?: string; + + /** + * The step definition captured at execution time for immutability. This ensures + * the UI shows the correct step even if the workflow definition changes. + */ + step?: AutomationsAPI.WorkflowStep; + + /** + * Index of the step in the workflow action steps array + */ + stepIndex?: number; + } + + export namespace StepStatus { + /** + * Structured error that caused the step to fail. Provides detailed error code, + * message, and retry information. + */ + export interface Error { + /** + * Error code identifying the type of error. + */ + code?: + | 'WORKFLOW_ERROR_CODE_UNSPECIFIED' + | 'WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR' + | 'WORKFLOW_ERROR_CODE_AGENT_ERROR'; + + /** + * Human-readable error message. + */ + message?: string; + + /** + * Additional metadata about the error. Common keys include: + * + * - environment_id: ID of the environment + * - task_id: ID of the task + * - service_id: ID of the service + * - workflow_id: ID of the workflow + * - workflow_execution_id: ID of the workflow execution + */ + meta?: { [key: string]: string }; + + /** + * Reason explaining why the error occurred. Examples: "not_found", "stopped", + * "deleted", "creation_failed", "start_failed" + */ + reason?: string; + + /** + * Retry configuration. If not set, the error is considered non-retriable. + */ + retry?: Error.Retry | null; + } + + export namespace Error { + /** + * Retry configuration. If not set, the error is considered non-retriable. + */ + export interface Retry { + /** + * Whether the error is retriable. + */ + retriable?: boolean; + + /** + * Suggested duration to wait before retrying. Only meaningful when retriable is + * true. + */ + retryAfter?: string; + } + } + } + + /** + * WorkflowError provides structured error information for workflow failures. This + * enables the reconciler to make informed retry decisions and the frontend to + * display actionable error messages. + */ + export interface Warning { + /** + * Error code identifying the type of error. + */ + code?: + | 'WORKFLOW_ERROR_CODE_UNSPECIFIED' + | 'WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR' + | 'WORKFLOW_ERROR_CODE_AGENT_ERROR'; + + /** + * Human-readable error message. + */ + message?: string; + + /** + * Additional metadata about the error. Common keys include: + * + * - environment_id: ID of the environment + * - task_id: ID of the task + * - service_id: ID of the service + * - workflow_id: ID of the workflow + * - workflow_execution_id: ID of the workflow execution + */ + meta?: { [key: string]: string }; + + /** + * Reason explaining why the error occurred. Examples: "not_found", "stopped", + * "deleted", "creation_failed", "start_failed" + */ + reason?: string; + + /** + * Retry configuration. If not set, the error is considered non-retriable. + */ + retry?: Warning.Retry | null; + } + + export namespace Warning { + /** + * Retry configuration. If not set, the error is considered non-retriable. + */ + export interface Retry { + /** + * Whether the error is retriable. + */ + retriable?: boolean; + + /** + * Suggested duration to wait before retrying. Only meaningful when retriable is + * true. + */ + retryAfter?: string; + } + } + } +} + +/** + * WorkflowStep defines a single step in a workflow action. + */ +export interface WorkflowStep { + /** + * WorkflowAgentStep represents an agent step that executes with a prompt. + */ + agent?: WorkflowStep.Agent; + + /** + * WorkflowPullRequestStep represents a pull request creation step. + */ + pullRequest?: WorkflowStep.PullRequest; + + report?: WorkflowStep.Report; + + /** + * WorkflowTaskStep represents a task step that executes a command. + */ + task?: WorkflowStep.Task; +} + +export namespace WorkflowStep { + /** + * WorkflowAgentStep represents an agent step that executes with a prompt. + */ + export interface Agent { + /** + * Prompt must be between 1 and 20,000 characters: + * + * ``` + * size(this) >= 1 && size(this) <= 20000 + * ``` + */ + prompt?: string; + } + + /** + * WorkflowPullRequestStep represents a pull request creation step. + */ + export interface PullRequest { + /** + * Branch name must be between 1 and 255 characters: + * + * ``` + * size(this) >= 1 && size(this) <= 255 + * ``` + */ + branch?: string; + + /** + * Description must be at most 20,000 characters: + * + * ``` + * size(this) <= 20000 + * ``` + */ + description?: string; + + draft?: boolean; + + /** + * Title must be between 1 and 500 characters: + * + * ``` + * size(this) >= 1 && size(this) <= 500 + * ``` + */ + title?: string; + } + + export interface Report { + /** + * Report must have at least one output: + * + * ``` + * size(this) >= 1 + * ``` + */ + outputs?: Array; + } + + export namespace Report { + export interface Output {} + } + + /** + * WorkflowTaskStep represents a task step that executes a command. + */ + export interface Task { + /** + * Command must be between 1 and 20,000 characters: + * + * ``` + * size(this) >= 1 && size(this) <= 20000 + * ``` + */ + command?: string; + } +} + +/** + * WorkflowTrigger defines when a workflow should be executed. + * + * Each trigger type defines a specific condition that will cause the workflow to + * execute: + * + * - Manual: Triggered explicitly by user action via StartWorkflow RPC + * - Time: Triggered automatically based on cron schedule + * - PullRequest: Triggered automatically when specified PR events occur + * + * Trigger Semantics: + * + * - Each trigger instance can create multiple workflow executions + * - Multiple triggers of the same workflow can fire simultaneously + * - Each trigger execution is independent and tracked separately + * - Triggers are evaluated in the context specified by WorkflowTriggerContext + */ +export interface WorkflowTrigger { + /** + * WorkflowTriggerContext defines the context in which a workflow should run. + * + * Context determines where and how the workflow executes: + * + * - Projects: Execute in specific project environments + * - Repositories: Execute in environments created from repository URLs + * - Agent: Execute in agent-managed environments with custom prompts + * - FromTrigger: Use context derived from the trigger event (PR-specific) + * + * Context Usage by Trigger Type: + * + * - Manual: Can use any context type + * - Time: Typically uses Projects or Repositories context + * - PullRequest: Can use any context, FromTrigger uses PR repository context + */ + context: WorkflowTriggerContext; + + /** + * Manual trigger - executed when StartWorkflow RPC is called. No additional + * configuration needed. + */ + manual?: unknown; + + /** + * Pull request trigger - executed when specified PR events occur. Only triggers + * for PRs in repositories matching the trigger context. + */ + pullRequest?: WorkflowTrigger.PullRequest; + + /** + * Time-based trigger - executed automatically based on cron schedule. Uses + * standard cron expression format (minute hour day month weekday). + */ + time?: WorkflowTrigger.Time; +} + +export namespace WorkflowTrigger { + /** + * Pull request trigger - executed when specified PR events occur. Only triggers + * for PRs in repositories matching the trigger context. + */ + export interface PullRequest { + events?: Array< + | 'PULL_REQUEST_EVENT_UNSPECIFIED' + | 'PULL_REQUEST_EVENT_OPENED' + | 'PULL_REQUEST_EVENT_UPDATED' + | 'PULL_REQUEST_EVENT_APPROVED' + | 'PULL_REQUEST_EVENT_MERGED' + | 'PULL_REQUEST_EVENT_CLOSED' + | 'PULL_REQUEST_EVENT_READY_FOR_REVIEW' + >; + + /** + * webhook_id is the optional ID of a webhook that this trigger is bound to. When + * set, the trigger will be activated when the webhook receives events. This allows + * multiple workflows to share a single webhook endpoint. + */ + webhookId?: string | null; + } + + /** + * Time-based trigger - executed automatically based on cron schedule. Uses + * standard cron expression format (minute hour day month weekday). + */ + export interface Time { + /** + * Cron expression must be between 1 and 100 characters: + * + * ``` + * size(this) >= 1 && size(this) <= 100 + * ``` + */ + cronExpression?: string; + } +} + +/** + * WorkflowTriggerContext defines the context in which a workflow should run. + * + * Context determines where and how the workflow executes: + * + * - Projects: Execute in specific project environments + * - Repositories: Execute in environments created from repository URLs + * - Agent: Execute in agent-managed environments with custom prompts + * - FromTrigger: Use context derived from the trigger event (PR-specific) + * + * Context Usage by Trigger Type: + * + * - Manual: Can use any context type + * - Time: Typically uses Projects or Repositories context + * - PullRequest: Can use any context, FromTrigger uses PR repository context + */ +export interface WorkflowTriggerContext { + /** + * Execute workflow in agent-managed environments. Agent receives the specified + * prompt and manages execution context. + */ + agent?: WorkflowTriggerContext.Agent; + + /** + * Use context derived from the trigger event. Currently only supported for + * PullRequest triggers - uses PR repository context. + */ + fromTrigger?: unknown; + + /** + * Execute workflow in specific project environments. Creates environments for each + * specified project. + */ + projects?: WorkflowTriggerContext.Projects; + + /** + * Execute workflow in environments created from repository URLs. Supports both + * explicit repository URLs and search patterns. + */ + repositories?: WorkflowTriggerContext.Repositories; +} + +export namespace WorkflowTriggerContext { + /** + * Execute workflow in agent-managed environments. Agent receives the specified + * prompt and manages execution context. + */ + export interface Agent { + /** + * Agent prompt must be between 1 and 20,000 characters: + * + * ``` + * size(this) >= 1 && size(this) <= 20000 + * ``` + */ + prompt?: string; + } + + /** + * Execute workflow in specific project environments. Creates environments for each + * specified project. + */ + export interface Projects { + projectIds?: Array; + } + + /** + * Execute workflow in environments created from repository URLs. Supports both + * explicit repository URLs and search patterns. + */ + export interface Repositories { + environmentClassId?: string; + + /** + * RepositorySelector defines how to select repositories for workflow execution. + * Combines a search string with an SCM host to identify repositories. + */ + repoSelector?: Repositories.RepoSelector; + + /** + * RepositoryURLs contains a list of explicit repository URLs. Creates one action + * per repository URL. + */ + repositoryUrls?: Repositories.RepositoryURLs; + } + + export namespace Repositories { + /** + * RepositorySelector defines how to select repositories for workflow execution. + * Combines a search string with an SCM host to identify repositories. + */ + export interface RepoSelector { + /** + * Search string to match repositories using SCM-specific search patterns. For + * GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", + * "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM + * provider documentation for supported search patterns. + */ + repoSearchString?: string; + + /** + * SCM host where the search should be performed (e.g., "github.com", "gitlab.com") + */ + scmHost?: string; + } + + /** + * RepositoryURLs contains a list of explicit repository URLs. Creates one action + * per repository URL. + */ + export interface RepositoryURLs { + repoUrls?: Array; + } + } +} + +export interface AutomationCreateResponse { + /** + * Workflow represents a workflow configuration. + */ + workflow?: Workflow; +} + +export interface AutomationRetrieveResponse { + /** + * Workflow represents a workflow configuration. + */ + workflow?: Workflow; +} + +export interface AutomationUpdateResponse { + /** + * Workflow represents a workflow configuration. + */ + workflow?: Workflow; +} + +export type AutomationDeleteResponse = unknown; + +export type AutomationCancelExecutionResponse = unknown; + +export type AutomationCancelExecutionActionResponse = unknown; + +export interface AutomationListExecutionOutputsResponse { + actionId?: string; + + values?: { [key: string]: AutomationListExecutionOutputsResponse.Values }; +} + +export namespace AutomationListExecutionOutputsResponse { + export interface Values { + boolValue?: boolean; + + floatValue?: number; + + intValue?: string; + + stringValue?: string; + } +} + +export interface AutomationRetrieveExecutionResponse { + /** + * WorkflowExecution represents a workflow execution instance. + */ + workflowExecution?: WorkflowExecution; +} + +export interface AutomationRetrieveExecutionActionResponse { + /** + * WorkflowExecutionAction represents a workflow execution action instance. + */ + workflowExecutionAction?: WorkflowExecutionAction; +} + +export interface AutomationStartExecutionResponse { + /** + * WorkflowExecution represents a workflow execution instance. + */ + workflowExecution?: WorkflowExecution; +} + +export interface AutomationCreateParams { + /** + * WorkflowAction defines the actions to be executed in a workflow. + */ + action: WorkflowAction; + + /** + * Description must be at most 500 characters: + * + * ``` + * size(this) <= 500 + * ``` + */ + description?: string; + + /** + * Optional executor for the workflow. If not provided, defaults to the creator. + * Must be either the caller themselves or a service account. + */ + executor?: Shared.Subject | null; + + /** + * Name must be between 1 and 80 characters: + * + * ``` + * size(this) >= 1 && size(this) <= 80 + * ``` + */ + name?: string; + + /** + * WorkflowAction defines the actions to be executed in a workflow. + */ + report?: WorkflowAction; + + /** + * Automation must have between 1 and 10 triggers: + * + * ``` + * size(this) >= 1 && size(this) <= 10 + * ``` + */ + triggers?: Array; +} + +export interface AutomationRetrieveParams { + workflowId?: string; +} + +export interface AutomationUpdateParams { + /** + * WorkflowAction defines the actions to be executed in a workflow. + */ + action?: WorkflowAction | null; + + /** + * Description must be at most 500 characters: + * + * ``` + * size(this) <= 500 + * ``` + */ + description?: string | null; + + /** + * When set, enables or disables the workflow. A disabled workflow will not be + * triggered by any automatic trigger and manual starts are rejected. + */ + disabled?: boolean | null; + + executor?: Shared.Subject | null; + + /** + * Name must be between 1 and 80 characters: + * + * ``` + * size(this) >= 1 && size(this) <= 80 + * ``` + */ + name?: string | null; + + /** + * WorkflowAction defines the actions to be executed in a workflow. + */ + report?: WorkflowAction | null; + + /** + * Automation can have at most 10 triggers: + * + * ``` + * size(this) <= 10 + * ``` + */ + triggers?: Array; + + workflowId?: string; +} + +export interface AutomationListParams extends WorkflowsPageParams { + /** + * Body param + */ + filter?: AutomationListParams.Filter; + + /** + * Body param + */ + pagination?: AutomationListParams.Pagination; + + /** + * Body param: sort specifies the order of results. When unspecified, results are + * sorted alphabetically by name ascending. + */ + sort?: AutomationListParams.Sort; +} + +export namespace AutomationListParams { + export interface Filter { + /** + * creator_ids filters workflows by creator user IDs + */ + creatorIds?: Array; + + /** + * has_failed_execution_since filters workflows that have at least one failed + * execution with create_time >= the specified timestamp. A failed execution is one + * that is COMPLETED with failed_action_count > 0, or STOPPED with + * failed_action_count > 0 or a non-empty failure_message. This filter is mutually + * exclusive with status_phases. + */ + hasFailedExecutionSince?: string; + + /** + * search performs case-insensitive search across workflow name, description, and + * ID + */ + search?: string; + + /** + * status_phases filters workflows by the phase of their latest execution. Only + * workflows whose most recent execution matches one of the specified phases are + * returned. + */ + statusPhases?: Array< + | 'WORKFLOW_EXECUTION_PHASE_UNSPECIFIED' + | 'WORKFLOW_EXECUTION_PHASE_PENDING' + | 'WORKFLOW_EXECUTION_PHASE_RUNNING' + | 'WORKFLOW_EXECUTION_PHASE_STOPPING' + | 'WORKFLOW_EXECUTION_PHASE_STOPPED' + | 'WORKFLOW_EXECUTION_PHASE_DELETING' + | 'WORKFLOW_EXECUTION_PHASE_DELETED' + | 'WORKFLOW_EXECUTION_PHASE_COMPLETED' + >; + + workflowIds?: Array; + } + + export interface Pagination { + /** + * Token for the next set of results that was returned as next_token of a + * PaginationResponse + */ + token?: string; + + /** + * Page size is the maximum number of results to retrieve per page. Defaults to 25. + * Maximum 100. + */ + pageSize?: number; + } + + /** + * sort specifies the order of results. When unspecified, results are sorted + * alphabetically by name ascending. + */ + export interface Sort { + field?: 'SORT_FIELD_UNSPECIFIED' | 'SORT_FIELD_NAME' | 'SORT_FIELD_RECENTLY_COMPLETED'; + + order?: Shared.SortOrder; + } +} + +export interface AutomationDeleteParams { + /** + * force indicates whether to immediately delete the workflow and all related + * resources. When true, performs cascading deletion of: + * + * - All workflow executions + * - All workflow execution actions + * - All environments created by workflow actions + * - All agent executions created by workflow actions + * - The workflow itself When false (default), marks workflow executions for + * deletion and relies on background reconciliation to clean up resources. + */ + force?: boolean; + + workflowId?: string; +} + +export interface AutomationCancelExecutionParams { + workflowExecutionId?: string; +} + +export interface AutomationCancelExecutionActionParams { + workflowExecutionActionId?: string; +} + +export interface AutomationListExecutionActionsParams extends WorkflowExecutionActionsPageParams { + /** + * Body param + */ + filter?: AutomationListExecutionActionsParams.Filter; + + /** + * Body param + */ + pagination?: AutomationListExecutionActionsParams.Pagination; +} + +export namespace AutomationListExecutionActionsParams { + export interface Filter { + phases?: Array< + | 'WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_PENDING' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_RUNNING' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_STOPPING' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_STOPPED' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_DELETING' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_DELETED' + | 'WORKFLOW_EXECUTION_ACTION_PHASE_DONE' + >; + + workflowExecutionActionIds?: Array; + + workflowExecutionIds?: Array; + + workflowIds?: Array; + } + + export interface Pagination { + /** + * Token for the next set of results that was returned as next_token of a + * PaginationResponse + */ + token?: string; + + /** + * Page size is the maximum number of results to retrieve per page. Defaults to 25. + * Maximum 100. + */ + pageSize?: number; + } +} + +export interface AutomationListExecutionOutputsParams extends OutputsPageParams { + /** + * Body param + */ + filter?: AutomationListExecutionOutputsParams.Filter; + + /** + * Body param + */ + pagination?: AutomationListExecutionOutputsParams.Pagination; +} + +export namespace AutomationListExecutionOutputsParams { + export interface Filter { + workflowExecutionIds?: Array; + } + + export interface Pagination { + /** + * Token for the next set of results that was returned as next_token of a + * PaginationResponse + */ + token?: string; + + /** + * Page size is the maximum number of results to retrieve per page. Defaults to 25. + * Maximum 100. + */ + pageSize?: number; + } +} + +export interface AutomationListExecutionsParams extends WorkflowExecutionsPageParams { + /** + * Body param + */ + filter?: AutomationListExecutionsParams.Filter; + + /** + * Body param + */ + pagination?: AutomationListExecutionsParams.Pagination; + + /** + * Body param: sort specifies the order of results. When unspecified, results are + * sorted by operational priority (running first, then failed, then completed, then + * others). Supported sort fields: startedAt, finishedAt, createdAt. + */ + sort?: Shared.Sort; +} + +export namespace AutomationListExecutionsParams { + export interface Filter { + hasFailedActions?: boolean | null; + + /** + * search performs case-insensitive search across workflow execution ID and trigger + * type + */ + search?: string; + + statusPhases?: Array< + | 'WORKFLOW_EXECUTION_PHASE_UNSPECIFIED' + | 'WORKFLOW_EXECUTION_PHASE_PENDING' + | 'WORKFLOW_EXECUTION_PHASE_RUNNING' + | 'WORKFLOW_EXECUTION_PHASE_STOPPING' + | 'WORKFLOW_EXECUTION_PHASE_STOPPED' + | 'WORKFLOW_EXECUTION_PHASE_DELETING' + | 'WORKFLOW_EXECUTION_PHASE_DELETED' + | 'WORKFLOW_EXECUTION_PHASE_COMPLETED' + >; + + workflowExecutionIds?: Array; + + workflowIds?: Array; + } + + export interface Pagination { + /** + * Token for the next set of results that was returned as next_token of a + * PaginationResponse + */ + token?: string; + + /** + * Page size is the maximum number of results to retrieve per page. Defaults to 25. + * Maximum 100. + */ + pageSize?: number; + } +} + +export interface AutomationRetrieveExecutionParams { + workflowExecutionId?: string; +} + +export interface AutomationRetrieveExecutionActionParams { + workflowExecutionActionId?: string; +} + +export interface AutomationStartExecutionParams { + /** + * Optional context override for the execution. When provided, replaces the + * workflow's default trigger context. User must have appropriate permissions on + * the overridden resources. Supports Projects, Repositories, and Agent context + * types. FromTrigger context type is not supported for manual overrides. + */ + contextOverride?: WorkflowTriggerContext | null; + + /** + * Parameters to substitute into workflow steps using Go template syntax. Use + * {{ .Parameters.key_name }} in templatable fields (task.command, agent.prompt, + * pull*request.title/description/branch, trigger context agent.prompt). Keys must + * match pattern ^[a-zA-Z*][a-zA-Z0-9_]\*$ Maximum 10 parameters allowed. Empty map + * is treated as no parameters provided. + */ + parameters?: { [key: string]: string }; + + workflowId?: string; +} + +export declare namespace Automations { + export { + type Workflow as Workflow, + type WorkflowAction as WorkflowAction, + type WorkflowExecution as WorkflowExecution, + type WorkflowExecutionAction as WorkflowExecutionAction, + type WorkflowStep as WorkflowStep, + type WorkflowTrigger as WorkflowTrigger, + type WorkflowTriggerContext as WorkflowTriggerContext, + type AutomationCreateResponse as AutomationCreateResponse, + type AutomationRetrieveResponse as AutomationRetrieveResponse, + type AutomationUpdateResponse as AutomationUpdateResponse, + type AutomationDeleteResponse as AutomationDeleteResponse, + type AutomationCancelExecutionResponse as AutomationCancelExecutionResponse, + type AutomationCancelExecutionActionResponse as AutomationCancelExecutionActionResponse, + type AutomationListExecutionOutputsResponse as AutomationListExecutionOutputsResponse, + type AutomationRetrieveExecutionResponse as AutomationRetrieveExecutionResponse, + type AutomationRetrieveExecutionActionResponse as AutomationRetrieveExecutionActionResponse, + type AutomationStartExecutionResponse as AutomationStartExecutionResponse, + type WorkflowsWorkflowsPage as WorkflowsWorkflowsPage, + type WorkflowExecutionActionsWorkflowExecutionActionsPage as WorkflowExecutionActionsWorkflowExecutionActionsPage, + type AutomationListExecutionOutputsResponsesOutputsPage as AutomationListExecutionOutputsResponsesOutputsPage, + type WorkflowExecutionsWorkflowExecutionsPage as WorkflowExecutionsWorkflowExecutionsPage, + type AutomationCreateParams as AutomationCreateParams, + type AutomationRetrieveParams as AutomationRetrieveParams, + type AutomationUpdateParams as AutomationUpdateParams, + type AutomationListParams as AutomationListParams, + type AutomationDeleteParams as AutomationDeleteParams, + type AutomationCancelExecutionParams as AutomationCancelExecutionParams, + type AutomationCancelExecutionActionParams as AutomationCancelExecutionActionParams, + type AutomationListExecutionActionsParams as AutomationListExecutionActionsParams, + type AutomationListExecutionOutputsParams as AutomationListExecutionOutputsParams, + type AutomationListExecutionsParams as AutomationListExecutionsParams, + type AutomationRetrieveExecutionParams as AutomationRetrieveExecutionParams, + type AutomationRetrieveExecutionActionParams as AutomationRetrieveExecutionActionParams, + type AutomationStartExecutionParams as AutomationStartExecutionParams, + }; +} diff --git a/src/resources/environments/environments.ts b/src/resources/environments/environments.ts index 4475f7ee..eb9d7214 100644 --- a/src/resources/environments/environments.ts +++ b/src/resources/environments/environments.ts @@ -569,6 +569,15 @@ export type AdmissionLevel = | 'ADMISSION_LEVEL_ORGANIZATION' | 'ADMISSION_LEVEL_CREATOR_ONLY'; +/** + * BPFDebugLevel controls the verbosity of BPF trace_pipe output (bpf_printk). + * Applies to all BPF-based agents (veto exec, future agents). + */ +export type BpfDebugLevel = + | 'BPF_DEBUG_LEVEL_UNSPECIFIED' + | 'BPF_DEBUG_LEVEL_INFO' + | 'BPF_DEBUG_LEVEL_VERBOSE'; + /** * +resource get environment */ @@ -648,6 +657,13 @@ export interface EnvironmentMetadata { */ lastStartedAt?: string; + /** + * lockdown_at is the time at which the environment becomes locked down due to the + * organization's maximum environment lifetime policy. Nil when no lifetime policy + * applies. + */ + lockdownAt?: string; + /** * name is the name of the environment as specified by the user */ @@ -929,6 +945,16 @@ export namespace EnvironmentSpec { */ containerRegistryBasicAuthHost?: string; + /** + * credential_proxy configures transparent credential injection via the credential + * proxy. When set, the credential proxy intercepts HTTPS traffic to the target + * hosts and replaces the dummy secret value with the real value in the specified + * HTTP header. The real secret value is never exposed in the environment. This + * field is orthogonal to mount — a secret can be both mounted (e.g. as a git + * credential) and proxied at the same time. + */ + credentialProxy?: Secret.CredentialProxy; + environmentVariable?: string; /** @@ -972,6 +998,35 @@ export namespace EnvironmentSpec { sourceRef?: string; } + export namespace Secret { + /** + * credential_proxy configures transparent credential injection via the credential + * proxy. When set, the credential proxy intercepts HTTPS traffic to the target + * hosts and replaces the dummy secret value with the real value in the specified + * HTTP header. The real secret value is never exposed in the environment. This + * field is orthogonal to mount — a secret can be both mounted (e.g. as a git + * credential) and proxied at the same time. + */ + export interface CredentialProxy { + /** + * format describes how the secret value is encoded. The proxy uses this to decode + * the value before injecting it into the header. + */ + format?: 'FORMAT_UNSPECIFIED' | 'FORMAT_PLAIN' | 'FORMAT_BASE64'; + + /** + * header is the HTTP header name to inject (e.g. "Authorization"). + */ + header?: string; + + /** + * target_hosts lists the hostnames to intercept (for example "github.com" or + * "\*.github.com"). Wildcards are subdomain-only and do not match the apex domain. + */ + targetHosts?: Array; + } + } + export interface SSHPublicKey { /** * id is the unique identifier of the public key @@ -990,7 +1045,12 @@ export namespace EnvironmentSpec { export interface Timeout { /** * inacitivity is the maximum time of disconnection before the environment is - * stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. + * stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. value + * must be 0s (disabled) or at least 1800s (30 minutes): + * + * ``` + * this == duration('0s') || this >= duration('1800s') + * ``` */ disconnected?: string; } @@ -1589,6 +1649,12 @@ export interface EnvironmentCreateParams { */ name?: string | null; + /** + * session_id is the ID of the session this environment belongs to. If empty, a new + * session is created implicitly. + */ + sessionId?: string; + /** * spec is the configuration of the environment that's required for the to start * the environment @@ -1757,7 +1823,12 @@ export namespace EnvironmentUpdateParams { export interface Timeout { /** * inacitivity is the maximum time of disconnection before the environment is - * stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. + * stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. value + * must be 0s (disabled) or at least 1800s (30 minutes): + * + * ``` + * this == duration('0s') || this >= duration('1800s') + * ``` */ disconnected?: string | null; } @@ -1821,6 +1892,12 @@ export namespace EnvironmentListParams { */ runnerKinds?: Array; + /** + * session_ids filters the response to only environments belonging to the specified + * sessions + */ + sessionIds?: Array; + /** * actual_phases is a list of phases the environment must be in for it to be * returned in the API call @@ -1880,6 +1957,12 @@ export interface EnvironmentCreateFromProjectParams { projectId?: string; + /** + * session_id is the ID of the session this environment belongs to. If empty, a new + * session is created implicitly. + */ + sessionId?: string; + /** * Spec is the configuration of the environment that's required for the runner to * start the environment Configuration already defined in the Project will override @@ -1941,6 +2024,7 @@ Environments.Classes = Classes; export declare namespace Environments { export { type AdmissionLevel as AdmissionLevel, + type BpfDebugLevel as BpfDebugLevel, type Environment as Environment, type EnvironmentActivitySignal as EnvironmentActivitySignal, type EnvironmentMetadata as EnvironmentMetadata, diff --git a/src/resources/environments/index.ts b/src/resources/environments/index.ts index cdbafd6f..b608089c 100644 --- a/src/resources/environments/index.ts +++ b/src/resources/environments/index.ts @@ -10,6 +10,7 @@ export { Classes, type ClassListParams } from './classes'; export { Environments, type AdmissionLevel, + type BpfDebugLevel, type Environment, type EnvironmentActivitySignal, type EnvironmentMetadata, diff --git a/src/resources/errors.ts b/src/resources/errors.ts index c78f5e2e..921bcfdd 100644 --- a/src/resources/errors.ts +++ b/src/resources/errors.ts @@ -4,6 +4,10 @@ import { APIResource } from '../core/resource'; import { APIPromise } from '../core/api-promise'; import { RequestOptions } from '../internal/request-options'; +/** + * ErrorsService provides endpoints for clients to report errors + * that will be sent to error reporting systems. + */ export class Errors extends APIResource { /** * ReportErrors allows clients to report batches of errors that will be sent to diff --git a/src/resources/events.ts b/src/resources/events.ts index 4fc6a446..70e2d30b 100644 --- a/src/resources/events.ts +++ b/src/resources/events.ts @@ -37,6 +37,16 @@ export class Events extends APIResource { * pageSize: 20 * ``` * + * - Filter by time range: + * + * ```yaml + * filter: + * from: "2024-01-01T00:00:00Z" + * to: "2024-02-01T00:00:00Z" + * pagination: + * pageSize: 20 + * ``` + * * @example * ```ts * // Automatically fetches more pages as needed. @@ -236,9 +246,16 @@ export interface EventListParams extends EntriesPageParams { filter?: EventListParams.Filter; /** - * Body param: pagination contains the pagination options for listing environments + * Body param: pagination contains the pagination options for listing audit logs */ pagination?: EventListParams.Pagination; + + /** + * Body param: sort specifies the order of results. When unspecified, results are + * sorted by creation time descending (newest first). Supported sort fields: + * createdAt. + */ + sort?: Shared.Sort; } export namespace EventListParams { @@ -247,13 +264,23 @@ export namespace EventListParams { actorPrincipals?: Array; + /** + * from filters audit logs created at or after this timestamp (inclusive). + */ + from?: string | null; + subjectIds?: Array; subjectTypes?: Array; + + /** + * to filters audit logs created before this timestamp (exclusive). + */ + to?: string | null; } /** - * pagination contains the pagination options for listing environments + * pagination contains the pagination options for listing audit logs */ export interface Pagination { /** @@ -283,6 +310,40 @@ export interface EventWatchParams { * events are produed. */ organization?: boolean; + + /** + * Filters to limit which events are delivered on organization-scoped streams. When + * empty, all events for the scope are delivered. When populated, only events + * matching at least one filter entry are forwarded. Not supported for + * environment-scoped streams; setting this field returns an error. + */ + resourceTypeFilters?: Array; +} + +export namespace EventWatchParams { + /** + * ResourceTypeFilter restricts which events are delivered for a specific resource + * type. + */ + export interface ResourceTypeFilter { + /** + * If non-empty, only events where the resource was created by one of these user + * IDs are delivered. Skipped for DELETE operations (creator info is unavailable + * after deletion). Events with no creator information are skipped when this filter + * is set (fail-closed). + */ + creatorIds?: Array; + + /** + * If non-empty, only events for these specific resource IDs are delivered. + */ + resourceIds?: Array; + + /** + * The resource type to filter for. + */ + resourceType?: Shared.ResourceType; + } } export declare namespace Events { diff --git a/src/resources/groups/groups.ts b/src/resources/groups/groups.ts index 6f472401..de059d7e 100644 --- a/src/resources/groups/groups.ts +++ b/src/resources/groups/groups.ts @@ -81,7 +81,7 @@ export class Groups extends APIResource { } /** - * Gets information about a specific group. + * Gets information about a specific group by ID or name. * * Use this method to: * @@ -91,12 +91,12 @@ export class Groups extends APIResource { * * ### Examples * - * - Get group details: + * - Get group by ID: * - * Retrieves information about a specific group. + * Retrieves information about a specific group by its unique ID. * * ```yaml - * groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" * ``` * * ### Authorization @@ -106,7 +106,7 @@ export class Groups extends APIResource { * @example * ```ts * const group = await client.groups.retrieve({ - * groupId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * id: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', * }); * ``` */ @@ -481,7 +481,20 @@ export interface GroupCreateParams { } export interface GroupRetrieveParams { + /** + * id looks up the group by its unique ID. + */ + id?: string; + + /** + * @deprecated Deprecated: use the group oneof instead. + */ groupId?: string; + + /** + * name looks up the group by its name within the caller's organization. + */ + name?: string; } export interface GroupUpdateParams { @@ -493,6 +506,11 @@ export interface GroupUpdateParams { } export interface GroupListParams extends GroupsPageParams { + /** + * Body param: filter contains options for filtering the list of groups. + */ + filter?: GroupListParams.Filter; + /** * Body param: pagination contains the pagination options for listing groups */ @@ -500,6 +518,33 @@ export interface GroupListParams extends GroupsPageParams { } export namespace GroupListParams { + /** + * filter contains options for filtering the list of groups. + */ + export interface Filter { + /** + * direct_share filters groups by their direct_share flag. When set, only groups + * matching this value are returned. + */ + directShare?: boolean | null; + + /** + * group_ids filters the response to only groups with the specified IDs + */ + groupIds?: Array; + + /** + * search performs case-insensitive search across group name, description, and ID + */ + search?: string; + + /** + * system_managed filters groups by their system_managed flag. When set, only + * groups matching this value are returned. + */ + systemManaged?: boolean | null; + } + /** * pagination contains the pagination options for listing groups */ diff --git a/src/resources/groups/memberships.ts b/src/resources/groups/memberships.ts index 977b08f2..b6ab33fd 100644 --- a/src/resources/groups/memberships.ts +++ b/src/resources/groups/memberships.ts @@ -245,6 +245,11 @@ export interface MembershipRetrieveParams { } export interface MembershipListParams extends MembersPageParams { + /** + * Body param: filter contains options for filtering the list of memberships. + */ + filter?: MembershipListParams.Filter; + /** * Body param */ @@ -257,6 +262,17 @@ export interface MembershipListParams extends MembersPageParams { } export namespace MembershipListParams { + /** + * filter contains options for filtering the list of memberships. + */ + export interface Filter { + /** + * search performs case-insensitive search across member name, email, ID, and + * service account name and description + */ + search?: string; + } + /** * pagination contains the pagination options for listing memberships */ diff --git a/src/resources/groups/role-assignments.ts b/src/resources/groups/role-assignments.ts index 25ad4e4b..1c8b950c 100644 --- a/src/resources/groups/role-assignments.ts +++ b/src/resources/groups/role-assignments.ts @@ -254,13 +254,20 @@ export namespace RoleAssignmentListParams { groupId?: string; /** - * resource_id filters the response to only role assignments for this specific - * resource When provided, users with :grant permission on the resource can see its - * role assignments even if they don't belong to the assigned groups Empty string - * is allowed and means no filtering by resource + * Filters by a single resource. Non-admin callers with :grant permission on the + * resource can see role assignments from groups they don't belong to. Mutually + * exclusive with resource_ids. */ resourceId?: string; + /** + * Filters by multiple resources in a single request. Non-admin callers with :grant + * permission on a resource can see all role assignments for that resource, even + * from groups they don't belong to. The :grant check is applied per-resource + * within the batch. Mutually exclusive with resource_id. + */ + resourceIds?: Array; + /** * resource_roles filters the response to only role assignments with these specific * roles diff --git a/src/resources/identity.ts b/src/resources/identity.ts index 3b2dc4bc..efe362aa 100644 --- a/src/resources/identity.ts +++ b/src/resources/identity.ts @@ -132,6 +132,8 @@ export interface IdentityExchangeTokenResponse { export interface IdentityGetAuthenticatedIdentityResponse { organizationId?: string; + organizationTier?: string; + /** * subject is the identity of the current user */ diff --git a/src/resources/index.ts b/src/resources/index.ts index a91cbd35..17be5025 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -25,11 +25,15 @@ export { Agents, type AgentCodeContext, type AgentExecution, + type AgentMessage, type AgentMode, type Prompt, type PromptMetadata, type PromptSpec, + type Role, + type Type, type UserInputBlock, + type WakeEvent, type AgentCreateExecutionConversationTokenResponse, type AgentCreatePromptResponse, type AgentDeleteExecutionResponse, @@ -55,6 +59,43 @@ export { type AgentExecutionsAgentExecutionsPage, type PromptsPromptsPage, } from './agents'; +export { + Automations, + type Workflow, + type WorkflowAction, + type WorkflowExecution, + type WorkflowExecutionAction, + type WorkflowStep, + type WorkflowTrigger, + type WorkflowTriggerContext, + type AutomationCreateResponse, + type AutomationRetrieveResponse, + type AutomationUpdateResponse, + type AutomationDeleteResponse, + type AutomationCancelExecutionResponse, + type AutomationCancelExecutionActionResponse, + type AutomationListExecutionOutputsResponse, + type AutomationRetrieveExecutionResponse, + type AutomationRetrieveExecutionActionResponse, + type AutomationStartExecutionResponse, + type AutomationCreateParams, + type AutomationRetrieveParams, + type AutomationUpdateParams, + type AutomationListParams, + type AutomationDeleteParams, + type AutomationCancelExecutionParams, + type AutomationCancelExecutionActionParams, + type AutomationListExecutionActionsParams, + type AutomationListExecutionOutputsParams, + type AutomationListExecutionsParams, + type AutomationRetrieveExecutionParams, + type AutomationRetrieveExecutionActionParams, + type AutomationStartExecutionParams, + type WorkflowsWorkflowsPage, + type WorkflowExecutionActionsWorkflowExecutionActionsPage, + type AutomationListExecutionOutputsResponsesOutputsPage, + type WorkflowExecutionsWorkflowExecutionsPage, +} from './automations'; export { Editors, type Editor, @@ -69,6 +110,7 @@ export { export { Environments, type AdmissionLevel, + type BpfDebugLevel, type Environment, type EnvironmentActivitySignal, type EnvironmentMetadata, @@ -179,18 +221,33 @@ export { type PrebuildSpec, type PrebuildStatus, type PrebuildTrigger, + type WarmPool, + type WarmPoolMetadata, + type WarmPoolPhase, + type WarmPoolSpec, + type WarmPoolStatus, type PrebuildCreateResponse, type PrebuildRetrieveResponse, type PrebuildDeleteResponse, type PrebuildCancelResponse, type PrebuildCreateLogsTokenResponse, + type PrebuildCreateWarmPoolResponse, + type PrebuildDeleteWarmPoolResponse, + type PrebuildRetrieveWarmPoolResponse, + type PrebuildUpdateWarmPoolResponse, type PrebuildCreateParams, type PrebuildRetrieveParams, type PrebuildListParams, type PrebuildDeleteParams, type PrebuildCancelParams, type PrebuildCreateLogsTokenParams, + type PrebuildCreateWarmPoolParams, + type PrebuildDeleteWarmPoolParams, + type PrebuildListWarmPoolsParams, + type PrebuildRetrieveWarmPoolParams, + type PrebuildUpdateWarmPoolParams, type PrebuildsPrebuildsPage, + type WarmPoolsWarmPoolsPage, } from './prebuilds'; export { Projects, @@ -235,6 +292,7 @@ export { type RunnerStatus, type RunnerVariant, type SearchMode, + type UpdateWindow, type RunnerCreateResponse, type RunnerRetrieveResponse, type RunnerUpdateResponse, diff --git a/src/resources/organizations/index.ts b/src/resources/organizations/index.ts index 82cec164..29e04f78 100644 --- a/src/resources/organizations/index.ts +++ b/src/resources/organizations/index.ts @@ -71,7 +71,10 @@ export { export { Policies, type AgentPolicy, + type ConversationSharingPolicy, type CrowdStrikeConfig, + type CustomAgentEnvMapping, + type CustomSecurityAgent, type KernelControlsAction, type OrganizationPolicies, type SecurityAgentPolicy, diff --git a/src/resources/organizations/organizations.ts b/src/resources/organizations/organizations.ts index 98605481..3cdc46f4 100644 --- a/src/resources/organizations/organizations.ts +++ b/src/resources/organizations/organizations.ts @@ -55,7 +55,10 @@ import { import * as PoliciesAPI from './policies'; import { AgentPolicy, + ConversationSharingPolicy, CrowdStrikeConfig, + CustomAgentEnvMapping, + CustomSecurityAgent, KernelControlsAction, OrganizationPolicies, Policies, @@ -905,6 +908,12 @@ export namespace OrganizationListMembersParams { */ excludeGroupIds?: Array; + /** + * exclude_members_in_any_team excludes members who belong to any team in the + * organization + */ + excludeMembersInAnyTeam?: boolean; + /** * roles filters members by their organization role */ @@ -952,7 +961,7 @@ export namespace OrganizationListMembersParams { export interface Sort { field?: 'SORT_FIELD_UNSPECIFIED' | 'SORT_FIELD_NAME' | 'SORT_FIELD_DATE_JOINED'; - order?: 'SORT_ORDER_UNSPECIFIED' | 'SORT_ORDER_ASC' | 'SORT_ORDER_DESC'; + order?: Shared.SortOrder; } } @@ -1048,7 +1057,10 @@ export declare namespace Organizations { export { Policies as Policies, type AgentPolicy as AgentPolicy, + type ConversationSharingPolicy as ConversationSharingPolicy, type CrowdStrikeConfig as CrowdStrikeConfig, + type CustomAgentEnvMapping as CustomAgentEnvMapping, + type CustomSecurityAgent as CustomSecurityAgent, type KernelControlsAction as KernelControlsAction, type OrganizationPolicies as OrganizationPolicies, type SecurityAgentPolicy as SecurityAgentPolicy, diff --git a/src/resources/organizations/policies.ts b/src/resources/organizations/policies.ts index 62c3924c..604b29e0 100644 --- a/src/resources/organizations/policies.ts +++ b/src/resources/organizations/policies.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; +import * as PoliciesAPI from './policies'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; @@ -112,6 +113,18 @@ export interface AgentPolicy { */ scmToolsDisabled: boolean; + /** + * conversation_sharing_policy controls whether agent conversations can be shared + */ + conversationSharingPolicy?: ConversationSharingPolicy; + + /** + * max_subagents_per_environment limits the number of non-terminal sub-agents a + * parent can have running simultaneously in the same environment. Valid range: + * 0-10. Zero means use the default (5). + */ + maxSubagentsPerEnvironment?: number; + /** * scm_tools_allowed_group_id restricts SCM tools access to members of this group. * Empty means no restriction (all users can use SCM tools if not disabled). @@ -119,6 +132,14 @@ export interface AgentPolicy { scmToolsAllowedGroupId?: string; } +/** + * ConversationSharingPolicy controls how agent conversations can be shared. + */ +export type ConversationSharingPolicy = + | 'CONVERSATION_SHARING_POLICY_UNSPECIFIED' + | 'CONVERSATION_SHARING_POLICY_DISABLED' + | 'CONVERSATION_SHARING_POLICY_ORGANIZATION'; + /** * CrowdStrikeConfig configures CrowdStrike Falcon sensor deployment */ @@ -151,6 +172,62 @@ export interface CrowdStrikeConfig { tags?: string; } +/** + * CustomAgentEnvMapping maps a script placeholder to an organization secret. The + * backend resolves the secret name to a UUID at runtime. + */ +export interface CustomAgentEnvMapping { + /** + * name is the environment variable name used as a placeholder in the start + * command. + */ + name?: string; + + /** + * secret_name is the name of the organization secret whose value populates this + * placeholder. + */ + secretName?: string; +} + +/** + * CustomSecurityAgent defines a custom security agent configured by an + * organization admin. + */ +export interface CustomSecurityAgent { + /** + * id is a unique identifier for this custom agent within the organization. + * Server-generated at save time if empty. + */ + id?: string; + + /** + * description is a human-readable description of what this agent does + */ + description?: string; + + /** + * enabled controls whether this custom agent is deployed to environments + */ + enabled?: boolean; + + /** + * env_mappings maps script placeholders to organization secret names, resolved to + * secret values at runtime. + */ + envMappings?: Array; + + /** + * name is the display name for this custom agent + */ + name?: string; + + /** + * start_command is the shell script that starts the agent + */ + startCommand?: string; +} + /** * KernelControlsAction defines how a kernel-level policy violation is handled. */ @@ -252,11 +329,6 @@ export interface OrganizationPolicies { */ editorVersionRestrictions?: { [key: string]: OrganizationPolicies.EditorVersionRestrictions }; - /** - * executable_deny_list contains the veto exec policy for environments. - */ - executableDenyList?: VetoExecPolicy; - /** * maximum_environment_lifetime controls for how long environments are allowed to * be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 @@ -267,7 +339,12 @@ export interface OrganizationPolicies { /** * maximum_environment_timeout controls the maximum timeout allowed for * environments in seconds. 0 means no limit (never). Minimum duration is 30 - * minutes (1800 seconds). + * minutes (1800 seconds). value must be 0s (no limit) or at least 1800s (30 + * minutes): + * + * ``` + * this == duration('0s') || this >= duration('1800s') + * ``` */ maximumEnvironmentTimeout?: string; @@ -277,6 +354,11 @@ export interface OrganizationPolicies { * environments. */ securityAgentPolicy?: SecurityAgentPolicy; + + /** + * veto_exec_policy contains the veto exec policy for environments. + */ + vetoExecPolicy?: VetoExecPolicy; } export namespace OrganizationPolicies { @@ -387,11 +469,6 @@ export interface PolicyUpdateParams { */ editorVersionRestrictions?: { [key: string]: PolicyUpdateParams.EditorVersionRestrictions }; - /** - * executable_deny_list contains the veto exec policy for environments. - */ - executableDenyList?: VetoExecPolicy | null; - /** * maximum_environment_lifetime controls for how long environments are allowed to * be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 @@ -408,7 +485,12 @@ export interface PolicyUpdateParams { /** * maximum_environment_timeout controls the maximum timeout allowed for * environments in seconds. 0 means no limit (never). Minimum duration is 30 - * minutes (1800 seconds). + * minutes (1800 seconds). value must be 0s (no limit) or at least 1800s (30 + * minutes): + * + * ``` + * this == duration('0s') || this >= duration('1800s') + * ``` */ maximumEnvironmentTimeout?: string | null; @@ -453,6 +535,11 @@ export interface PolicyUpdateParams { * security_agent_policy contains security agent configuration updates */ securityAgentPolicy?: PolicyUpdateParams.SecurityAgentPolicy | null; + + /** + * veto_exec_policy contains the veto exec policy for environments. + */ + vetoExecPolicy?: VetoExecPolicy | null; } export namespace PolicyUpdateParams { @@ -466,6 +553,18 @@ export namespace PolicyUpdateParams { */ commandDenyList?: Array; + /** + * conversation_sharing_policy controls whether agent conversations can be shared + */ + conversationSharingPolicy?: PoliciesAPI.ConversationSharingPolicy | null; + + /** + * max_subagents_per_environment limits the number of non-terminal sub-agents a + * parent can have running simultaneously in the same environment. Valid range: + * 0-10. Zero means use the default (5). + */ + maxSubagentsPerEnvironment?: number | null; + /** * mcp_disabled controls whether MCP (Model Context Protocol) is disabled for * agents @@ -545,7 +644,10 @@ export namespace PolicyUpdateParams { export declare namespace Policies { export { type AgentPolicy as AgentPolicy, + type ConversationSharingPolicy as ConversationSharingPolicy, type CrowdStrikeConfig as CrowdStrikeConfig, + type CustomAgentEnvMapping as CustomAgentEnvMapping, + type CustomSecurityAgent as CustomSecurityAgent, type KernelControlsAction as KernelControlsAction, type OrganizationPolicies as OrganizationPolicies, type SecurityAgentPolicy as SecurityAgentPolicy, diff --git a/src/resources/organizations/sso-configurations.ts b/src/resources/organizations/sso-configurations.ts index be2c8b73..08d20208 100644 --- a/src/resources/organizations/sso-configurations.ts +++ b/src/resources/organizations/sso-configurations.ts @@ -282,6 +282,15 @@ export interface SSOConfiguration { */ claims?: { [key: string]: string }; + /** + * claims_expression is a CEL (Common Expression Language) expression evaluated + * against the OIDC token claims during login. When set, the expression must + * evaluate to true for the login to succeed. The expression has access to a + * `claims` variable containing all token claims as a map. Example: + * `claims.email_verified && claims.email.endsWith("@example.com")` + */ + claimsExpression?: string; + /** * client_id is the client ID of the OIDC application set on the IdP */ @@ -342,6 +351,14 @@ export interface SSOConfigurationCreateParams { */ additionalScopes?: Array; + /** + * claims_expression is an optional CEL expression evaluated against OIDC token + * claims during login. When set, the expression must evaluate to true for the + * login to succeed. Example: + * `claims.email_verified && claims.email.endsWith("@example.com")` + */ + claimsExpression?: string | null; + displayName?: string; /** @@ -377,6 +394,13 @@ export interface SSOConfigurationUpdateParams { */ claims?: { [key: string]: string }; + /** + * claims_expression is a CEL expression evaluated against OIDC token claims during + * login. When set, the expression must evaluate to true for the login to succeed. + * When present with an empty string, the expression is cleared. + */ + claimsExpression?: string | null; + /** * client_id is the client ID of the SSO provider */ diff --git a/src/resources/prebuilds.ts b/src/resources/prebuilds.ts index 5857fed9..27212da8 100644 --- a/src/resources/prebuilds.ts +++ b/src/resources/prebuilds.ts @@ -4,9 +4,19 @@ import { APIResource } from '../core/resource'; import * as PrebuildsAPI from './prebuilds'; import * as Shared from './shared'; import { APIPromise } from '../core/api-promise'; -import { PagePromise, PrebuildsPage, type PrebuildsPageParams } from '../core/pagination'; +import { + PagePromise, + PrebuildsPage, + type PrebuildsPageParams, + WarmPoolsPage, + type WarmPoolsPageParams, +} from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; +/** + * PrebuildService manages prebuilds for projects to enable faster environment startup times. + * Prebuilds create snapshots of environments that can be used to provision new environments quickly. + */ export class Prebuilds extends APIResource { /** * Creates a prebuild for a project. @@ -198,10 +208,186 @@ export class Prebuilds extends APIResource { ): APIPromise { return this._client.post('/gitpod.v1.PrebuildService/CreatePrebuildLogsToken', { body, ...options }); } + + /** + * Creates a warm pool for a project and environment class. + * + * A warm pool maintains pre-created environment instances from a prebuild snapshot + * so that new environments can start near-instantly. + * + * Only one warm pool is allowed per pair. The + * environment class must have prebuilds enabled on the project. + * + * The pool's snapshot is managed automatically: when a new prebuild completes for + * the same project and environment class, the pool's snapshot is updated and the + * runner rotates instances. + * + * ### Examples + * + * - Create warm pool: + * + * Creates a warm pool with 2 instances for a project and environment class. + * + * ```yaml + * projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * desiredSize: 2 + * ``` + * + * @example + * ```ts + * const response = await client.prebuilds.createWarmPool({ + * environmentClassId: + * 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * desiredSize: 2, + * }); + * ``` + */ + createWarmPool( + body: PrebuildCreateWarmPoolParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.PrebuildService/CreateWarmPool', { body, ...options }); + } + + /** + * Deletes a warm pool. + * + * Deletion is processed asynchronously. The pool is marked for deletion and the + * runner drains instances in the background. + * + * Warm pools are also automatically deleted when prebuilds are disabled on the + * project or the environment class is removed from the prebuild configuration. + * + * ### Examples + * + * - Delete warm pool: + * + * ```yaml + * warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab" + * ``` + * + * @example + * ```ts + * const response = await client.prebuilds.deleteWarmPool({ + * warmPoolId: 'a1b2c3d4-5678-9abc-def0-1234567890ab', + * }); + * ``` + */ + deleteWarmPool(body: PrebuildDeleteWarmPoolParams, options?: RequestOptions): APIPromise { + return this._client.post('/gitpod.v1.PrebuildService/DeleteWarmPool', { body, ...options }); + } + + /** + * Lists warm pools with optional filtering. + * + * Use this method to: + * + * - View all warm pools for a project + * - Monitor warm pool status across environment classes + * + * ### Examples + * + * - List warm pools for a project: + * + * ```yaml + * filter: + * projectIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] + * ``` + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const warmPool of client.prebuilds.listWarmPools( + * { + * filter: { + * projectIds: ['b0e12f6c-4c67-429d-a4a6-d9838b5da047'], + * }, + * }, + * )) { + * // ... + * } + * ``` + */ + listWarmPools( + params: PrebuildListWarmPoolsParams, + options?: RequestOptions, + ): PagePromise { + const { token, pageSize, ...body } = params; + return this._client.getAPIList('/gitpod.v1.PrebuildService/ListWarmPools', WarmPoolsPage, { + query: { token, pageSize }, + body, + method: 'post', + ...options, + }); + } + + /** + * Gets details about a specific warm pool. + * + * Use this method to: + * + * - Check warm pool status and phase + * - View the current snapshot being warmed + * - Monitor pool health + * + * ### Examples + * + * - Get warm pool: + * + * ```yaml + * warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab" + * ``` + * + * @example + * ```ts + * const response = await client.prebuilds.retrieveWarmPool({ + * warmPoolId: 'a1b2c3d4-5678-9abc-def0-1234567890ab', + * }); + * ``` + */ + retrieveWarmPool( + body: PrebuildRetrieveWarmPoolParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.PrebuildService/GetWarmPool', { body, ...options }); + } + + /** + * Updates a warm pool's configuration. + * + * Use this method to change the desired pool size. + * + * ### Examples + * + * - Update pool size: + * + * ```yaml + * warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab" + * desiredSize: 5 + * ``` + * + * @example + * ```ts + * const response = await client.prebuilds.updateWarmPool({ + * warmPoolId: 'a1b2c3d4-5678-9abc-def0-1234567890ab', + * desiredSize: 5, + * }); + * ``` + */ + updateWarmPool( + body: PrebuildUpdateWarmPoolParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.PrebuildService/UpdateWarmPool', { body, ...options }); + } } export type PrebuildsPrebuildsPage = PrebuildsPage; +export type WarmPoolsWarmPoolsPage = WarmPoolsPage; + /** * Prebuild represents a prebuild for a project that creates a snapshot for faster * environment startup times. @@ -361,6 +547,12 @@ export interface PrebuildStatus { */ snapshotCompletionPercentage?: number; + /** + * snapshot_size_bytes is the size of the snapshot in bytes. Only populated when + * the snapshot is available (phase is COMPLETED). + */ + snapshotSizeBytes?: string; + /** * status_version is incremented each time the status is updated. Used for * optimistic concurrency control. @@ -384,6 +576,168 @@ export type PrebuildTrigger = | 'PREBUILD_TRIGGER_MANUAL' | 'PREBUILD_TRIGGER_SCHEDULED'; +/** + * WarmPool maintains pre-created environment instances from a prebuild snapshot + * for near-instant environment startup. One warm pool exists per pair. + */ +export interface WarmPool { + /** + * metadata contains organizational and ownership information + */ + metadata: WarmPoolMetadata; + + /** + * spec contains the desired configuration for this warm pool + */ + spec: WarmPoolSpec; + + /** + * status contains the current status reported by the runner + */ + status: WarmPoolStatus; + + /** + * id is the unique identifier for the warm pool + */ + id?: string; +} + +/** + * WarmPoolMetadata contains metadata about the warm pool + */ +export interface WarmPoolMetadata { + /** + * created_at is when the warm pool was created + */ + createdAt: string; + + /** + * updated_at is when the warm pool was last updated + */ + updatedAt: string; + + /** + * environment_class_id is the environment class whose instances are warmed + */ + environmentClassId?: string; + + /** + * organization_id is the ID of the organization that owns the warm pool + */ + organizationId?: string; + + /** + * project_id is the ID of the project this warm pool belongs to + */ + projectId?: string; + + /** + * runner_id is the runner that manages this warm pool. Derived from the + * environment class. + */ + runnerId?: string; +} + +/** + * WarmPoolPhase represents the lifecycle phase of a warm pool + */ +export type WarmPoolPhase = + | 'WARM_POOL_PHASE_UNSPECIFIED' + | 'WARM_POOL_PHASE_PENDING' + | 'WARM_POOL_PHASE_READY' + | 'WARM_POOL_PHASE_DEGRADED' + | 'WARM_POOL_PHASE_DELETING' + | 'WARM_POOL_PHASE_DELETED'; + +/** + * WarmPoolSpec contains the desired configuration for a warm pool + */ +export interface WarmPoolSpec { + /** + * desired_phase is the intended lifecycle phase for this warm pool. Managed by the + * API and reconciler. + */ + desiredPhase?: WarmPoolPhase; + + /** + * @deprecated desired_size is the number of warm instances to maintain. + * Deprecated: Use min_size and max_size instead for dynamic scaling. Existing + * pools will be migrated to min_size=max_size=desired_size. + */ + desiredSize?: number; + + /** + * max_size is the maximum number of warm instances to maintain. The pool will + * never scale above this value. Must be >= min_size and <= 20. + */ + maxSize?: number | null; + + /** + * min_size is the minimum number of warm instances to maintain. The pool will + * never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + * full scale-down. + */ + minSize?: number | null; + + /** + * snapshot_id is the prebuild snapshot to warm up in the pool. Updated by the + * reconciler when a new prebuild completes for this project and environment class. + * Empty when no completed prebuild exists yet. + */ + snapshotId?: string | null; + + /** + * spec_version is incremented each time the spec is updated. Used for optimistic + * concurrency control. + */ + specVersion?: string; +} + +/** + * WarmPoolStatus contains the current status of a warm pool as reported by the + * runner + */ +export interface WarmPoolStatus { + /** + * phase is the current phase of the warm pool lifecycle + */ + phase: WarmPoolPhase; + + /** + * desired_size is the current target number of instances the autoscaler has + * decided on. Unlike running_instances, this value is stable and does not + * fluctuate as instances are claimed and backfilled. + */ + desiredSize?: number; + + /** + * failure_message contains details about why the warm pool is degraded or failed + */ + failureMessage?: string; + + /** + * running_instances is the number of running warm instances in the pool, ready to + * be claimed for near-instant environment startup. + */ + runningInstances?: number; + + /** + * status_version is incremented each time the status is updated. Used for + * optimistic concurrency control. + */ + statusVersion?: string; + + /** + * stopped_instances is the number of pre-provisioned but stopped instances in the + * pool. When a running instance is claimed, stopped instances are used to backfill + * the running pool faster than provisioning from scratch. Stopped instances only + * incur storage costs, allowing a larger total pool at lower cost than keeping all + * instances running. + */ + stoppedInstances?: number; +} + export interface PrebuildCreateResponse { /** * Prebuild represents a prebuild for a project that creates a snapshot for faster @@ -417,6 +771,35 @@ export interface PrebuildCreateLogsTokenResponse { accessToken: string; } +export interface PrebuildCreateWarmPoolResponse { + /** + * WarmPool maintains pre-created environment instances from a prebuild snapshot + * for near-instant environment startup. One warm pool exists per pair. + */ + warmPool: WarmPool; +} + +export type PrebuildDeleteWarmPoolResponse = unknown; + +export interface PrebuildRetrieveWarmPoolResponse { + /** + * WarmPool maintains pre-created environment instances from a prebuild snapshot + * for near-instant environment startup. One warm pool exists per pair. + */ + warmPool: WarmPool; +} + +export interface PrebuildUpdateWarmPoolResponse { + /** + * WarmPool maintains pre-created environment instances from a prebuild snapshot + * for near-instant environment startup. One warm pool exists per pair. + */ + warmPool: WarmPool; +} + export interface PrebuildCreateParams { /** * project_id specifies the project to create a prebuild for @@ -526,6 +909,125 @@ export interface PrebuildCreateLogsTokenParams { prebuildId: string; } +export interface PrebuildCreateWarmPoolParams { + /** + * environment_class_id specifies which environment class to warm. Must be listed + * in the project's prebuild configuration environment_class_ids. + */ + environmentClassId: string; + + /** + * project_id specifies the project this warm pool belongs to. The project must + * have prebuilds enabled. + */ + projectId: string; + + /** + * @deprecated desired_size is the number of warm instances to maintain. + * Deprecated: Use min_size and max_size instead for dynamic scaling. + */ + desiredSize?: number; + + /** + * max_size is the maximum number of warm instances to maintain. The pool will + * never scale above this value. Must be >= min_size and <= 20. + */ + maxSize?: number | null; + + /** + * min_size is the minimum number of warm instances to maintain. The pool will + * never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + * full scale-down. + */ + minSize?: number | null; +} + +export interface PrebuildDeleteWarmPoolParams { + /** + * warm_pool_id specifies the warm pool to delete + */ + warmPoolId: string; +} + +export interface PrebuildListWarmPoolsParams extends WarmPoolsPageParams { + /** + * Body param: filter contains the filter options for listing warm pools + */ + filter?: PrebuildListWarmPoolsParams.Filter; + + /** + * Body param: pagination contains the pagination options for listing warm pools + */ + pagination?: PrebuildListWarmPoolsParams.Pagination; +} + +export namespace PrebuildListWarmPoolsParams { + /** + * filter contains the filter options for listing warm pools + */ + export interface Filter { + /** + * environment_class_ids filters warm pools to specific environment classes + */ + environmentClassIds?: Array; + + /** + * project_ids filters warm pools to specific projects + */ + projectIds?: Array; + } + + /** + * pagination contains the pagination options for listing warm pools + */ + export interface Pagination { + /** + * Token for the next set of results that was returned as next_token of a + * PaginationResponse + */ + token?: string; + + /** + * Page size is the maximum number of results to retrieve per page. Defaults to 25. + * Maximum 100. + */ + pageSize?: number; + } +} + +export interface PrebuildRetrieveWarmPoolParams { + /** + * warm_pool_id specifies the warm pool to retrieve + */ + warmPoolId: string; +} + +export interface PrebuildUpdateWarmPoolParams { + /** + * warm_pool_id specifies the warm pool to update + */ + warmPoolId: string; + + /** + * @deprecated desired_size updates the number of warm instances to maintain. + * Deprecated: Use min_size and max_size instead for dynamic scaling. + */ + desiredSize?: number | null; + + /** + * max_size updates the maximum number of warm instances to maintain. The pool will + * never scale above this value. Must be >= min_size and <= 20. + */ + maxSize?: number | null; + + /** + * min_size updates the minimum number of warm instances to maintain. The pool will + * never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow + * full scale-down. + */ + minSize?: number | null; +} + export declare namespace Prebuilds { export { type Prebuild as Prebuild, @@ -534,17 +1036,32 @@ export declare namespace Prebuilds { type PrebuildSpec as PrebuildSpec, type PrebuildStatus as PrebuildStatus, type PrebuildTrigger as PrebuildTrigger, + type WarmPool as WarmPool, + type WarmPoolMetadata as WarmPoolMetadata, + type WarmPoolPhase as WarmPoolPhase, + type WarmPoolSpec as WarmPoolSpec, + type WarmPoolStatus as WarmPoolStatus, type PrebuildCreateResponse as PrebuildCreateResponse, type PrebuildRetrieveResponse as PrebuildRetrieveResponse, type PrebuildDeleteResponse as PrebuildDeleteResponse, type PrebuildCancelResponse as PrebuildCancelResponse, type PrebuildCreateLogsTokenResponse as PrebuildCreateLogsTokenResponse, + type PrebuildCreateWarmPoolResponse as PrebuildCreateWarmPoolResponse, + type PrebuildDeleteWarmPoolResponse as PrebuildDeleteWarmPoolResponse, + type PrebuildRetrieveWarmPoolResponse as PrebuildRetrieveWarmPoolResponse, + type PrebuildUpdateWarmPoolResponse as PrebuildUpdateWarmPoolResponse, type PrebuildsPrebuildsPage as PrebuildsPrebuildsPage, + type WarmPoolsWarmPoolsPage as WarmPoolsWarmPoolsPage, type PrebuildCreateParams as PrebuildCreateParams, type PrebuildRetrieveParams as PrebuildRetrieveParams, type PrebuildListParams as PrebuildListParams, type PrebuildDeleteParams as PrebuildDeleteParams, type PrebuildCancelParams as PrebuildCancelParams, type PrebuildCreateLogsTokenParams as PrebuildCreateLogsTokenParams, + type PrebuildCreateWarmPoolParams as PrebuildCreateWarmPoolParams, + type PrebuildDeleteWarmPoolParams as PrebuildDeleteWarmPoolParams, + type PrebuildListWarmPoolsParams as PrebuildListWarmPoolsParams, + type PrebuildRetrieveWarmPoolParams as PrebuildRetrieveWarmPoolParams, + type PrebuildUpdateWarmPoolParams as PrebuildUpdateWarmPoolParams, }; } diff --git a/src/resources/projects/projects.ts b/src/resources/projects/projects.ts index a2c94140..e0c90c51 100644 --- a/src/resources/projects/projects.ts +++ b/src/resources/projects/projects.ts @@ -1089,6 +1089,19 @@ export interface ProjectListParams extends ProjectsPageParams { * Body param: pagination contains the pagination options for listing organizations */ pagination?: ProjectListParams.Pagination; + + /** + * Body param: sort specifies the order of results. Defaults to popularity + * descending. + * + * Supported fields: + * + * - "id": Sort by project ID (UUID v7, effectively creation order). Produces a + * stable, deterministic result set suitable for consistent pagination. + * - "popularity": Sort by popularity — a precomputed score based on recent + * environment creation activity. Updated periodically by a background job. + */ + sort?: Shared.Sort; } export namespace ProjectListParams { diff --git a/src/resources/runners/index.ts b/src/resources/runners/index.ts index fe5499a3..fb790837 100644 --- a/src/resources/runners/index.ts +++ b/src/resources/runners/index.ts @@ -37,6 +37,7 @@ export { type RunnerStatus, type RunnerVariant, type SearchMode, + type UpdateWindow, type RunnerCreateResponse, type RunnerRetrieveResponse, type RunnerUpdateResponse, diff --git a/src/resources/runners/runners.ts b/src/resources/runners/runners.ts index 31deff26..b3623212 100644 --- a/src/resources/runners/runners.ts +++ b/src/resources/runners/runners.ts @@ -546,6 +546,12 @@ export interface MetricsConfiguration { */ enabled?: boolean; + /** + * When true, the runner pushes metrics to the management plane via + * ReportRunnerMetrics instead of directly to the remote_write endpoint. + */ + managedMetricsEnabled?: boolean; + /** * password is the password to use for the metrics collector */ @@ -623,7 +629,9 @@ export type RunnerCapability = | 'RUNNER_CAPABILITY_PREBUILDS_BEFORE_SNAPSHOT_TRIGGER' | 'RUNNER_CAPABILITY_LIST_SCM_ORGANIZATIONS' | 'RUNNER_CAPABILITY_CHECK_REPOSITORY_ACCESS' - | 'RUNNER_CAPABILITY_RUNNER_SIDE_AGENT'; + | 'RUNNER_CAPABILITY_RUNNER_SIDE_AGENT' + | 'RUNNER_CAPABILITY_WARM_POOL' + | 'RUNNER_CAPABILITY_ASG_WARM_POOL'; export interface RunnerConfiguration { /** @@ -659,6 +667,12 @@ export interface RunnerConfiguration { * The release channel the runner is on */ releaseChannel?: RunnerReleaseChannel; + + /** + * update_window defines the daily time window (UTC) during which auto-updates are + * allowed. If not set, updates are allowed at any time. + */ + updateWindow?: UpdateWindow; } /** @@ -790,6 +804,24 @@ export type RunnerVariant = export type SearchMode = 'SEARCH_MODE_UNSPECIFIED' | 'SEARCH_MODE_KEYWORD' | 'SEARCH_MODE_NATIVE'; +/** + * UpdateWindow defines a daily time window (UTC) during which auto-updates are + * allowed. The window must be at least 2 hours long. Overnight windows are + * supported (e.g., start_hour=22, end_hour=4). + */ +export interface UpdateWindow { + /** + * end_hour is the end of the update window as a UTC hour (0-23). If not set, + * defaults to start_hour + 2. + */ + endHour?: number | null; + + /** + * start_hour is the beginning of the update window as a UTC hour (0-23). +required + */ + startHour?: number | null; +} + export interface RunnerCreateResponse { runner: Runner; @@ -1239,6 +1271,14 @@ export namespace RunnerUpdateParams { * The release channel the runner is on */ releaseChannel?: RunnersAPI.RunnerReleaseChannel | null; + + /** + * update_window defines the daily time window (UTC) during which auto-updates are + * allowed. start_hour is required. If end_hour is omitted, it defaults to + * start_hour + 2. Send an empty UpdateWindow (no start_hour or end_hour) to clear + * a custom window and allow updates at any time. + */ + updateWindow?: RunnersAPI.UpdateWindow | null; } export namespace Configuration { @@ -1251,6 +1291,12 @@ export namespace RunnerUpdateParams { */ enabled?: boolean | null; + /** + * When true, the runner pushes metrics to the management plane via + * ReportRunnerMetrics instead of directly to the remote_write endpoint. + */ + managedMetricsEnabled?: boolean | null; + /** * password is the password to use for the metrics collector */ @@ -1456,6 +1502,7 @@ export declare namespace Runners { type RunnerStatus as RunnerStatus, type RunnerVariant as RunnerVariant, type SearchMode as SearchMode, + type UpdateWindow as UpdateWindow, type RunnerCreateResponse as RunnerCreateResponse, type RunnerRetrieveResponse as RunnerRetrieveResponse, type RunnerUpdateResponse as RunnerUpdateResponse, diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 536a56d3..efb056cb 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -39,6 +39,11 @@ export interface AutomationTrigger { prebuild?: boolean; } +export type CountResponseRelation = + | 'COUNT_RESPONSE_RELATION_UNSPECIFIED' + | 'COUNT_RESPONSE_RELATION_EQ' + | 'COUNT_RESPONSE_RELATION_GTE'; + export interface EnvironmentClass { /** * id is the unique identifier of the environment class @@ -172,8 +177,7 @@ export type Principal = | 'PRINCIPAL_RUNNER' | 'PRINCIPAL_ENVIRONMENT' | 'PRINCIPAL_SERVICE_ACCOUNT' - | 'PRINCIPAL_RUNNER_MANAGER' - | 'PRINCIPAL_AGENT_EXECUTION'; + | 'PRINCIPAL_RUNNER_MANAGER'; export interface ProjectEnvironmentClass { /** @@ -205,6 +209,7 @@ export type ResourceRole = | 'RESOURCE_ROLE_ORG_PROJECTS_ADMIN' | 'RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN' | 'RESOURCE_ROLE_ORG_GROUPS_ADMIN' + | 'RESOURCE_ROLE_ORG_AUDIT_LOG_READER' | 'RESOURCE_ROLE_GROUP_ADMIN' | 'RESOURCE_ROLE_GROUP_VIEWER' | 'RESOURCE_ROLE_USER_IDENTITY' @@ -236,11 +241,11 @@ export type ResourceRole = | 'RESOURCE_ROLE_ENVIRONMENT_TASK_ENV' | 'RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY' | 'RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN' - | 'RESOURCE_ROLE_AGENT_EXECUTION_IDENTITY' | 'RESOURCE_ROLE_AGENT_EXECUTION_USER' | 'RESOURCE_ROLE_AGENT_EXECUTION_ADMIN' | 'RESOURCE_ROLE_AGENT_EXECUTION_RUNNER' | 'RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER' + | 'RESOURCE_ROLE_AGENT_EXECUTION_VIEWER' | 'RESOURCE_ROLE_AGENT_ADMIN' | 'RESOURCE_ROLE_AGENT_VIEWER' | 'RESOURCE_ROLE_AGENT_EXECUTOR' @@ -254,7 +259,11 @@ export type ResourceRole = | 'RESOURCE_ROLE_WEBHOOK_VIEWER' | 'RESOURCE_ROLE_WARMPOOL_RUNNER' | 'RESOURCE_ROLE_WARMPOOL_ADMIN' - | 'RESOURCE_ROLE_WARMPOOL_VIEWER'; + | 'RESOURCE_ROLE_WARMPOOL_VIEWER' + | 'RESOURCE_ROLE_SESSION_ADMIN' + | 'RESOURCE_ROLE_SESSION_USER' + | 'RESOURCE_ROLE_TEAM_ADMIN' + | 'RESOURCE_ROLE_TEAM_VIEWER'; export type ResourceType = | 'RESOURCE_TYPE_UNSPECIFIED' @@ -305,7 +314,8 @@ export type ResourceType = | 'RESOURCE_TYPE_ANNOUNCEMENT_BANNER' | 'RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN' | 'RESOURCE_TYPE_ROLE_ASSIGNMENT' - | 'RESOURCE_TYPE_WARM_POOL'; + | 'RESOURCE_TYPE_WARM_POOL' + | 'RESOURCE_TYPE_NOTIFICATION'; export interface RunsOn { docker?: RunsOn.Docker; @@ -314,6 +324,12 @@ export interface RunsOn { * Machine runs the service/task directly on the VM/machine level. */ machine?: unknown; + + /** + * Terminal runs the service inside a managed PTY terminal in the devcontainer. + * Users can attach to the terminal interactively via the terminal API. + */ + terminal?: unknown; } export namespace RunsOn { @@ -334,6 +350,17 @@ export interface SecretRef { id?: string; } +export interface Sort { + /** + * Field name to sort by, in camelCase. + */ + field?: string; + + order?: SortOrder; +} + +export type SortOrder = 'SORT_ORDER_UNSPECIFIED' | 'SORT_ORDER_ASC' | 'SORT_ORDER_DESC'; + /** * Current state of the pull request */ diff --git a/src/resources/usage.ts b/src/resources/usage.ts index fa5f052a..0782706e 100644 --- a/src/resources/usage.ts +++ b/src/resources/usage.ts @@ -4,6 +4,9 @@ import { APIResource } from '../core/resource'; import { PagePromise, RecordsPage, type RecordsPageParams } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; +/** + * UsageService provides usage information about environments, users, and projects. + */ export class Usage extends APIResource { /** * Lists completed environment runtime records within a specified date range. diff --git a/src/resources/users/pats.ts b/src/resources/users/pats.ts index 165fe066..38c83f31 100644 --- a/src/resources/users/pats.ts +++ b/src/resources/users/pats.ts @@ -408,6 +408,12 @@ export interface PersonalAccessToken { */ lastUsed?: string; + /** + * When true, the token can only be used for read operations. Mutations will be + * denied at the data layer. + */ + readOnly?: boolean; + userId?: string; } diff --git a/src/version.ts b/src/version.ts index 9d013cc2..e2b0672c 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.13.0'; // x-release-please-version +export const VERSION = '0.14.0'; // x-release-please-version diff --git a/tests/api-resources/accounts.test.ts b/tests/api-resources/accounts.test.ts index 11942fad..c632b8a1 100644 --- a/tests/api-resources/accounts.test.ts +++ b/tests/api-resources/accounts.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource accounts', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve', async () => { const responsePromise = client.accounts.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource accounts', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: only required params', async () => { const responsePromise = client.accounts.delete({ accountId: 'f53d2330-3795-4c5d-a1f3-453121af9c60' }); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource accounts', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: required and optional params', async () => { const response = await client.accounts.delete({ accountId: 'f53d2330-3795-4c5d-a1f3-453121af9c60', @@ -40,7 +40,7 @@ describe('resource accounts', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('getSSOLoginURL: only required params', async () => { const responsePromise = client.accounts.getSSOLoginURL({ email: 'user@company.com' }); const rawResponse = await responsePromise.asResponse(); @@ -52,7 +52,7 @@ describe('resource accounts', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('getSSOLoginURL: required and optional params', async () => { const response = await client.accounts.getSSOLoginURL({ email: 'user@company.com', @@ -60,7 +60,7 @@ describe('resource accounts', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('listJoinableOrganizations', async () => { const responsePromise = client.accounts.listJoinableOrganizations({}); const rawResponse = await responsePromise.asResponse(); @@ -72,7 +72,7 @@ describe('resource accounts', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('listLoginProviders', async () => { const responsePromise = client.accounts.listLoginProviders({}); const rawResponse = await responsePromise.asResponse(); @@ -84,7 +84,7 @@ describe('resource accounts', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('listSSOLogins: only required params', async () => { const responsePromise = client.accounts.listSSOLogins({ email: 'dev@stainless.com' }); const rawResponse = await responsePromise.asResponse(); @@ -96,7 +96,7 @@ describe('resource accounts', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('listSSOLogins: required and optional params', async () => { const response = await client.accounts.listSSOLogins({ email: 'dev@stainless.com', diff --git a/tests/api-resources/agents.test.ts b/tests/api-resources/agents.test.ts index a283db74..59366e28 100644 --- a/tests/api-resources/agents.test.ts +++ b/tests/api-resources/agents.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource agents', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('createExecutionConversationToken', async () => { const responsePromise = client.agents.createExecutionConversationToken({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource agents', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('createPrompt', async () => { const responsePromise = client.agents.createPrompt({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource agents', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('deleteExecution', async () => { const responsePromise = client.agents.deleteExecution({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource agents', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('deletePrompt', async () => { const responsePromise = client.agents.deletePrompt({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource agents', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('listExecutions', async () => { const responsePromise = client.agents.listExecutions({}); const rawResponse = await responsePromise.asResponse(); @@ -68,7 +68,7 @@ describe('resource agents', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('listPrompts', async () => { const responsePromise = client.agents.listPrompts({}); const rawResponse = await responsePromise.asResponse(); @@ -80,7 +80,7 @@ describe('resource agents', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieveExecution', async () => { const responsePromise = client.agents.retrieveExecution({}); const rawResponse = await responsePromise.asResponse(); @@ -92,7 +92,7 @@ describe('resource agents', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrievePrompt', async () => { const responsePromise = client.agents.retrievePrompt({}); const rawResponse = await responsePromise.asResponse(); @@ -104,7 +104,7 @@ describe('resource agents', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('sendToExecution', async () => { const responsePromise = client.agents.sendToExecution({}); const rawResponse = await responsePromise.asResponse(); @@ -116,7 +116,7 @@ describe('resource agents', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('startExecution', async () => { const responsePromise = client.agents.startExecution({}); const rawResponse = await responsePromise.asResponse(); @@ -128,7 +128,7 @@ describe('resource agents', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('stopExecution', async () => { const responsePromise = client.agents.stopExecution({}); const rawResponse = await responsePromise.asResponse(); @@ -140,7 +140,7 @@ describe('resource agents', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('updatePrompt', async () => { const responsePromise = client.agents.updatePrompt({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/automations.test.ts b/tests/api-resources/automations.test.ts new file mode 100644 index 00000000..0da8a86f --- /dev/null +++ b/tests/api-resources/automations.test.ts @@ -0,0 +1,263 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Gitpod from '@gitpod/sdk'; + +const client = new Gitpod({ + bearerToken: 'My Bearer Token', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource automations', () => { + // Mock server tests are disabled + test.skip('create: only required params', async () => { + const responsePromise = client.automations.create({ action: { limits: {} } }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('create: required and optional params', async () => { + const response = await client.automations.create({ + action: { + limits: { + maxParallel: 0, + maxTotal: 0, + perExecution: { maxTime: '+9125115.360s' }, + }, + steps: [ + { + agent: { prompt: 'prompt' }, + pullRequest: { + branch: 'branch', + description: 'description', + draft: true, + title: 'title', + }, + report: { + outputs: [ + { + acceptanceCriteria: 'acceptanceCriteria', + boolean: {}, + command: 'command', + float: { max: 0, min: 0 }, + integer: { max: 0, min: 0 }, + key: 'key', + prompt: 'prompt', + string: { pattern: 'pattern' }, + title: 'title', + }, + ], + }, + task: { command: 'command' }, + }, + ], + }, + description: 'description', + executor: { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', principal: 'PRINCIPAL_UNSPECIFIED' }, + name: 'name', + report: { + limits: { + maxParallel: 0, + maxTotal: 0, + perExecution: { maxTime: '+9125115.360s' }, + }, + steps: [ + { + agent: { prompt: 'prompt' }, + pullRequest: { + branch: 'branch', + description: 'description', + draft: true, + title: 'title', + }, + report: { + outputs: [ + { + acceptanceCriteria: 'acceptanceCriteria', + boolean: {}, + command: 'command', + float: { max: 0, min: 0 }, + integer: { max: 0, min: 0 }, + key: 'key', + prompt: 'prompt', + string: { pattern: 'pattern' }, + title: 'title', + }, + ], + }, + task: { command: 'command' }, + }, + ], + }, + triggers: [ + { + context: { + agent: { prompt: 'prompt' }, + fromTrigger: {}, + projects: { projectIds: ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'] }, + repositories: { + environmentClassId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + repoSelector: { repoSearchString: 'x', scmHost: 'x' }, + repositoryUrls: { repoUrls: ['x'] }, + }, + }, + manual: {}, + pullRequest: { + events: ['PULL_REQUEST_EVENT_UNSPECIFIED'], + webhookId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + time: { cronExpression: 'cronExpression' }, + }, + ], + }); + }); + + // Mock server tests are disabled + test.skip('retrieve', async () => { + const responsePromise = client.automations.retrieve({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('update', async () => { + const responsePromise = client.automations.update({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('list', async () => { + const responsePromise = client.automations.list({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('delete', async () => { + const responsePromise = client.automations.delete({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('cancelExecution', async () => { + const responsePromise = client.automations.cancelExecution({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('cancelExecutionAction', async () => { + const responsePromise = client.automations.cancelExecutionAction({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('listExecutionActions', async () => { + const responsePromise = client.automations.listExecutionActions({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('listExecutionOutputs', async () => { + const responsePromise = client.automations.listExecutionOutputs({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('listExecutions', async () => { + const responsePromise = client.automations.listExecutions({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('retrieveExecution', async () => { + const responsePromise = client.automations.retrieveExecution({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('retrieveExecutionAction', async () => { + const responsePromise = client.automations.retrieveExecutionAction({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('startExecution', async () => { + const responsePromise = client.automations.startExecution({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); +}); diff --git a/tests/api-resources/editors.test.ts b/tests/api-resources/editors.test.ts index 6979c29b..7ab4511e 100644 --- a/tests/api-resources/editors.test.ts +++ b/tests/api-resources/editors.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource editors', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.editors.retrieve({ id: 'd2c94c27-3b76-4a42-b88c-95a85e392c68' }); const rawResponse = await responsePromise.asResponse(); @@ -20,12 +20,12 @@ describe('resource editors', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.editors.retrieve({ id: 'd2c94c27-3b76-4a42-b88c-95a85e392c68' }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.editors.list({}); const rawResponse = await responsePromise.asResponse(); @@ -37,7 +37,7 @@ describe('resource editors', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('resolveURL: only required params', async () => { const responsePromise = client.editors.resolveURL({ editorId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -53,7 +53,7 @@ describe('resource editors', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('resolveURL: required and optional params', async () => { const response = await client.editors.resolveURL({ editorId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', diff --git a/tests/api-resources/environments/automations/automations.test.ts b/tests/api-resources/environments/automations/automations.test.ts index ed997129..18e6c4c4 100644 --- a/tests/api-resources/environments/automations/automations.test.ts +++ b/tests/api-resources/environments/automations/automations.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource automations', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('upsert', async () => { const responsePromise = client.environments.automations.upsert({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/environments/automations/services.test.ts b/tests/api-resources/environments/automations/services.test.ts index 23335143..90acd206 100644 --- a/tests/api-resources/environments/automations/services.test.ts +++ b/tests/api-resources/environments/automations/services.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource services', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.environments.automations.services.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource services', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve', async () => { const responsePromise = client.environments.automations.services.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource services', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update', async () => { const responsePromise = client.environments.automations.services.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource services', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.environments.automations.services.list({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource services', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.environments.automations.services.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -68,7 +68,7 @@ describe('resource services', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('start', async () => { const responsePromise = client.environments.automations.services.start({}); const rawResponse = await responsePromise.asResponse(); @@ -80,7 +80,7 @@ describe('resource services', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('stop', async () => { const responsePromise = client.environments.automations.services.stop({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/environments/automations/tasks/executions.test.ts b/tests/api-resources/environments/automations/tasks/executions.test.ts index 2c2bc87a..198d06da 100644 --- a/tests/api-resources/environments/automations/tasks/executions.test.ts +++ b/tests/api-resources/environments/automations/tasks/executions.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource executions', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve', async () => { const responsePromise = client.environments.automations.tasks.executions.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource executions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.environments.automations.tasks.executions.list({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource executions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('stop', async () => { const responsePromise = client.environments.automations.tasks.executions.stop({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/environments/automations/tasks/tasks.test.ts b/tests/api-resources/environments/automations/tasks/tasks.test.ts index d19f0356..467bfedc 100644 --- a/tests/api-resources/environments/automations/tasks/tasks.test.ts +++ b/tests/api-resources/environments/automations/tasks/tasks.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource tasks', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.environments.automations.tasks.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource tasks', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve', async () => { const responsePromise = client.environments.automations.tasks.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource tasks', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update', async () => { const responsePromise = client.environments.automations.tasks.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource tasks', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.environments.automations.tasks.list({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource tasks', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.environments.automations.tasks.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -68,7 +68,7 @@ describe('resource tasks', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('start', async () => { const responsePromise = client.environments.automations.tasks.start({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/environments/classes.test.ts b/tests/api-resources/environments/classes.test.ts index 91d2fa4a..0d97bd45 100644 --- a/tests/api-resources/environments/classes.test.ts +++ b/tests/api-resources/environments/classes.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource classes', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.environments.classes.list({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/environments/environments.test.ts b/tests/api-resources/environments/environments.test.ts index 6a295134..f2cec224 100644 --- a/tests/api-resources/environments/environments.test.ts +++ b/tests/api-resources/environments/environments.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource environments', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.environments.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.environments.retrieve({ environmentId: '07e03a28-65a5-4d98-b532-8ea67b188048', @@ -34,14 +34,14 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.environments.retrieve({ environmentId: '07e03a28-65a5-4d98-b532-8ea67b188048', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update', async () => { const responsePromise = client.environments.update({}); const rawResponse = await responsePromise.asResponse(); @@ -53,7 +53,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.environments.list({}); const rawResponse = await responsePromise.asResponse(); @@ -65,7 +65,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.environments.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -77,7 +77,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('createEnvironmentToken: only required params', async () => { const responsePromise = client.environments.createEnvironmentToken({ environmentId: '07e03a28-65a5-4d98-b532-8ea67b188048', @@ -91,14 +91,14 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('createEnvironmentToken: required and optional params', async () => { const response = await client.environments.createEnvironmentToken({ environmentId: '07e03a28-65a5-4d98-b532-8ea67b188048', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('createFromProject', async () => { const responsePromise = client.environments.createFromProject({}); const rawResponse = await responsePromise.asResponse(); @@ -110,7 +110,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('createLogsToken', async () => { const responsePromise = client.environments.createLogsToken({}); const rawResponse = await responsePromise.asResponse(); @@ -122,7 +122,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('markActive', async () => { const responsePromise = client.environments.markActive({}); const rawResponse = await responsePromise.asResponse(); @@ -134,7 +134,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('start', async () => { const responsePromise = client.environments.start({}); const rawResponse = await responsePromise.asResponse(); @@ -146,7 +146,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('stop', async () => { const responsePromise = client.environments.stop({}); const rawResponse = await responsePromise.asResponse(); @@ -158,7 +158,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('unarchive', async () => { const responsePromise = client.environments.unarchive({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/errors.test.ts b/tests/api-resources/errors.test.ts index f09b290b..ee413092 100644 --- a/tests/api-resources/errors.test.ts +++ b/tests/api-resources/errors.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource errors', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('reportErrors', async () => { const responsePromise = client.errors.reportErrors({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/events.test.ts b/tests/api-resources/events.test.ts index 55d5cc42..7cfdf0e8 100644 --- a/tests/api-resources/events.test.ts +++ b/tests/api-resources/events.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource events', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.events.list({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource events', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism doesn't support application/jsonl responses + // Mock server tests are disabled test.skip('watch', async () => { const responsePromise = client.events.watch({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/gateways.test.ts b/tests/api-resources/gateways.test.ts index fe35f0f6..4186e205 100644 --- a/tests/api-resources/gateways.test.ts +++ b/tests/api-resources/gateways.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource gateways', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.gateways.list({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/groups/groups.test.ts b/tests/api-resources/groups/groups.test.ts index 97c3ca06..3798086c 100644 --- a/tests/api-resources/groups/groups.test.ts +++ b/tests/api-resources/groups/groups.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource groups', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.groups.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource groups', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve', async () => { const responsePromise = client.groups.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource groups', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update', async () => { const responsePromise = client.groups.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource groups', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.groups.list({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource groups', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.groups.delete({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/groups/memberships.test.ts b/tests/api-resources/groups/memberships.test.ts index e28a932a..e9d8ad18 100644 --- a/tests/api-resources/groups/memberships.test.ts +++ b/tests/api-resources/groups/memberships.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource memberships', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.groups.memberships.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource memberships', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.groups.memberships.retrieve({ subject: {} }); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource memberships', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.groups.memberships.retrieve({ subject: { id: 'f53d2330-3795-4c5d-a1f3-453121af9c60', principal: 'PRINCIPAL_USER' }, @@ -40,7 +40,7 @@ describe('resource memberships', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.groups.memberships.list({}); const rawResponse = await responsePromise.asResponse(); @@ -52,7 +52,7 @@ describe('resource memberships', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.groups.memberships.delete({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/groups/role-assignments.test.ts b/tests/api-resources/groups/role-assignments.test.ts index 5b4a4eb4..6b07ee9c 100644 --- a/tests/api-resources/groups/role-assignments.test.ts +++ b/tests/api-resources/groups/role-assignments.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource roleAssignments', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.groups.roleAssignments.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource roleAssignments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.groups.roleAssignments.list({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource roleAssignments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.groups.roleAssignments.delete({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/groups/shares.test.ts b/tests/api-resources/groups/shares.test.ts index ad152ded..f86d3d6f 100644 --- a/tests/api-resources/groups/shares.test.ts +++ b/tests/api-resources/groups/shares.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource shares', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.groups.shares.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource shares', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.groups.shares.delete({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/identity.test.ts b/tests/api-resources/identity.test.ts index 64730a65..961c99fb 100644 --- a/tests/api-resources/identity.test.ts +++ b/tests/api-resources/identity.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource identity', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('exchangeToken', async () => { const responsePromise = client.identity.exchangeToken({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource identity', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('getAuthenticatedIdentity', async () => { const responsePromise = client.identity.getAuthenticatedIdentity({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource identity', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('getIDToken', async () => { const responsePromise = client.identity.getIDToken({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/organizations/announcement-banner.test.ts b/tests/api-resources/organizations/announcement-banner.test.ts index 6724f457..754c8e0f 100644 --- a/tests/api-resources/organizations/announcement-banner.test.ts +++ b/tests/api-resources/organizations/announcement-banner.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource announcementBanner', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('update: only required params', async () => { const responsePromise = client.organizations.announcementBanner.update({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -22,7 +22,7 @@ describe('resource announcementBanner', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update: required and optional params', async () => { const response = await client.organizations.announcementBanner.update({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -31,7 +31,7 @@ describe('resource announcementBanner', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('get: only required params', async () => { const responsePromise = client.organizations.announcementBanner.get({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -45,7 +45,7 @@ describe('resource announcementBanner', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('get: required and optional params', async () => { const response = await client.organizations.announcementBanner.get({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', diff --git a/tests/api-resources/organizations/custom-domains.test.ts b/tests/api-resources/organizations/custom-domains.test.ts index c3b3cac3..9dc81ff7 100644 --- a/tests/api-resources/organizations/custom-domains.test.ts +++ b/tests/api-resources/organizations/custom-domains.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource customDomains', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.organizations.customDomains.create({ domainName: 'workspaces.acme-corp.com', @@ -23,7 +23,7 @@ describe('resource customDomains', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: required and optional params', async () => { const response = await client.organizations.customDomains.create({ domainName: 'workspaces.acme-corp.com', @@ -34,7 +34,7 @@ describe('resource customDomains', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.customDomains.retrieve({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -48,14 +48,14 @@ describe('resource customDomains', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.customDomains.retrieve({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update: only required params', async () => { const responsePromise = client.organizations.customDomains.update({ domainName: 'workspaces.acme-corp.com', @@ -70,7 +70,7 @@ describe('resource customDomains', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update: required and optional params', async () => { const response = await client.organizations.customDomains.update({ domainName: 'workspaces.acme-corp.com', @@ -81,7 +81,7 @@ describe('resource customDomains', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: only required params', async () => { const responsePromise = client.organizations.customDomains.delete({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -95,7 +95,7 @@ describe('resource customDomains', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: required and optional params', async () => { const response = await client.organizations.customDomains.delete({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', diff --git a/tests/api-resources/organizations/domain-verifications.test.ts b/tests/api-resources/organizations/domain-verifications.test.ts index 6b753edc..c204dd68 100644 --- a/tests/api-resources/organizations/domain-verifications.test.ts +++ b/tests/api-resources/organizations/domain-verifications.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource domainVerifications', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.organizations.domainVerifications.create({ domain: 'acme-corp.com', @@ -23,7 +23,7 @@ describe('resource domainVerifications', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: required and optional params', async () => { const response = await client.organizations.domainVerifications.create({ domain: 'acme-corp.com', @@ -31,7 +31,7 @@ describe('resource domainVerifications', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.domainVerifications.retrieve({ domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -45,14 +45,14 @@ describe('resource domainVerifications', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.domainVerifications.retrieve({ domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list: only required params', async () => { const responsePromise = client.organizations.domainVerifications.list({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -66,7 +66,7 @@ describe('resource domainVerifications', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list: required and optional params', async () => { const response = await client.organizations.domainVerifications.list({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -76,7 +76,7 @@ describe('resource domainVerifications', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: only required params', async () => { const responsePromise = client.organizations.domainVerifications.delete({ domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -90,14 +90,14 @@ describe('resource domainVerifications', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: required and optional params', async () => { const response = await client.organizations.domainVerifications.delete({ domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('verify: only required params', async () => { const responsePromise = client.organizations.domainVerifications.verify({ domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -111,7 +111,7 @@ describe('resource domainVerifications', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('verify: required and optional params', async () => { const response = await client.organizations.domainVerifications.verify({ domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', diff --git a/tests/api-resources/organizations/invites.test.ts b/tests/api-resources/organizations/invites.test.ts index 5c5c0db2..5b82ca98 100644 --- a/tests/api-resources/organizations/invites.test.ts +++ b/tests/api-resources/organizations/invites.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource invites', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.organizations.invites.create({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -22,14 +22,14 @@ describe('resource invites', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: required and optional params', async () => { const response = await client.organizations.invites.create({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.invites.retrieve({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -43,14 +43,14 @@ describe('resource invites', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.invites.retrieve({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('getSummary: only required params', async () => { const responsePromise = client.organizations.invites.getSummary({ inviteId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -64,7 +64,7 @@ describe('resource invites', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('getSummary: required and optional params', async () => { const response = await client.organizations.invites.getSummary({ inviteId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', diff --git a/tests/api-resources/organizations/organizations.test.ts b/tests/api-resources/organizations/organizations.test.ts index 4a979d51..89665f2b 100644 --- a/tests/api-resources/organizations/organizations.test.ts +++ b/tests/api-resources/organizations/organizations.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource organizations', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.organizations.create({ name: 'Acme Corp Engineering' }); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: required and optional params', async () => { const response = await client.organizations.create({ name: 'Acme Corp Engineering', @@ -29,7 +29,7 @@ describe('resource organizations', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.retrieve({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -43,14 +43,14 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.retrieve({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update: only required params', async () => { const responsePromise = client.organizations.update({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -64,7 +64,7 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update: required and optional params', async () => { const response = await client.organizations.update({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -73,7 +73,7 @@ describe('resource organizations', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: only required params', async () => { const responsePromise = client.organizations.delete({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -87,14 +87,14 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: required and optional params', async () => { const response = await client.organizations.delete({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('join', async () => { const responsePromise = client.organizations.join({}); const rawResponse = await responsePromise.asResponse(); @@ -106,7 +106,7 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('leave: only required params', async () => { const responsePromise = client.organizations.leave({ userId: 'f53d2330-3795-4c5d-a1f3-453121af9c60' }); const rawResponse = await responsePromise.asResponse(); @@ -118,12 +118,12 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('leave: required and optional params', async () => { const response = await client.organizations.leave({ userId: 'f53d2330-3795-4c5d-a1f3-453121af9c60' }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('listMembers: only required params', async () => { const responsePromise = client.organizations.listMembers({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -137,7 +137,7 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('listMembers: required and optional params', async () => { const response = await client.organizations.listMembers({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -145,6 +145,7 @@ describe('resource organizations', () => { pageSize: 0, filter: { excludeGroupIds: ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'], + excludeMembersInAnyTeam: true, roles: ['ORGANIZATION_ROLE_UNSPECIFIED'], search: 'search', statuses: ['USER_STATUS_UNSPECIFIED'], @@ -155,7 +156,7 @@ describe('resource organizations', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('setRole: only required params', async () => { const responsePromise = client.organizations.setRole({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -170,7 +171,7 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('setRole: required and optional params', async () => { const response = await client.organizations.setRole({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', diff --git a/tests/api-resources/organizations/policies.test.ts b/tests/api-resources/organizations/policies.test.ts index 1cdd3501..7fd9de1a 100644 --- a/tests/api-resources/organizations/policies.test.ts +++ b/tests/api-resources/organizations/policies.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource policies', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.policies.retrieve({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -22,14 +22,14 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.policies.retrieve({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update: only required params', async () => { const responsePromise = client.organizations.policies.update({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -43,12 +43,14 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update: required and optional params', async () => { const response = await client.organizations.policies.update({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', agentPolicy: { commandDenyList: ['string'], + conversationSharingPolicy: 'CONVERSATION_SHARING_POLICY_UNSPECIFIED', + maxSubagentsPerEnvironment: 10, mcpDisabled: true, scmToolsAllowedGroupId: 'scmToolsAllowedGroupId', scmToolsDisabled: true, @@ -59,11 +61,6 @@ describe('resource policies', () => { defaultEnvironmentImage: 'defaultEnvironmentImage', deleteArchivedEnvironmentsAfter: '+9125115.360s', editorVersionRestrictions: { foo: { allowedVersions: ['string'] } }, - executableDenyList: { - action: 'KERNEL_CONTROLS_ACTION_UNSPECIFIED', - enabled: true, - executables: ['string'], - }, maximumEnvironmentLifetime: '+9125115.360s', maximumEnvironmentsPerUser: '20', maximumEnvironmentTimeout: '3600s', @@ -82,6 +79,11 @@ describe('resource policies', () => { tags: 'tags', }, }, + vetoExecPolicy: { + action: 'KERNEL_CONTROLS_ACTION_UNSPECIFIED', + enabled: true, + executables: ['string'], + }, }); }); }); diff --git a/tests/api-resources/organizations/scim-configurations.test.ts b/tests/api-resources/organizations/scim-configurations.test.ts index 7ac728b3..bf121156 100644 --- a/tests/api-resources/organizations/scim-configurations.test.ts +++ b/tests/api-resources/organizations/scim-configurations.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource scimConfigurations', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.organizations.scimConfigurations.create({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -23,7 +23,7 @@ describe('resource scimConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: required and optional params', async () => { const response = await client.organizations.scimConfigurations.create({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -33,7 +33,7 @@ describe('resource scimConfigurations', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.scimConfigurations.retrieve({ scimConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -47,14 +47,14 @@ describe('resource scimConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.scimConfigurations.retrieve({ scimConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update: only required params', async () => { const responsePromise = client.organizations.scimConfigurations.update({ scimConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -68,7 +68,7 @@ describe('resource scimConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update: required and optional params', async () => { const response = await client.organizations.scimConfigurations.update({ scimConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -78,7 +78,7 @@ describe('resource scimConfigurations', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.organizations.scimConfigurations.list({}); const rawResponse = await responsePromise.asResponse(); @@ -90,7 +90,7 @@ describe('resource scimConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: only required params', async () => { const responsePromise = client.organizations.scimConfigurations.delete({ scimConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -104,14 +104,14 @@ describe('resource scimConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: required and optional params', async () => { const response = await client.organizations.scimConfigurations.delete({ scimConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('regenerateToken: only required params', async () => { const responsePromise = client.organizations.scimConfigurations.regenerateToken({ scimConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -125,7 +125,7 @@ describe('resource scimConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('regenerateToken: required and optional params', async () => { const response = await client.organizations.scimConfigurations.regenerateToken({ scimConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', diff --git a/tests/api-resources/organizations/sso-configurations.test.ts b/tests/api-resources/organizations/sso-configurations.test.ts index 24160551..e6304844 100644 --- a/tests/api-resources/organizations/sso-configurations.test.ts +++ b/tests/api-resources/organizations/sso-configurations.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource ssoConfigurations', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.create({ clientId: '012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com', @@ -25,7 +25,7 @@ describe('resource ssoConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.create({ clientId: '012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com', @@ -33,13 +33,14 @@ describe('resource ssoConfigurations', () => { issuerUrl: 'https://accounts.google.com', organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', additionalScopes: ['x'], + claimsExpression: 'claimsExpression', displayName: 'displayName', emailDomain: 'acme-corp.com', emailDomains: ['sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB'], }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.retrieve({ ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -53,14 +54,14 @@ describe('resource ssoConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.retrieve({ ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.update({ ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -74,12 +75,13 @@ describe('resource ssoConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.update({ ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', additionalScopes: { scopes: ['x'] }, claims: { foo: 'string' }, + claimsExpression: 'claimsExpression', clientId: 'new-client-id', clientSecret: 'new-client-secret', displayName: 'displayName', @@ -90,7 +92,7 @@ describe('resource ssoConfigurations', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.list({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -104,7 +106,7 @@ describe('resource ssoConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.list({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -114,7 +116,7 @@ describe('resource ssoConfigurations', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.delete({ ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -128,7 +130,7 @@ describe('resource ssoConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.delete({ ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', diff --git a/tests/api-resources/prebuilds.test.ts b/tests/api-resources/prebuilds.test.ts index 8c9ffe8c..9308e71c 100644 --- a/tests/api-resources/prebuilds.test.ts +++ b/tests/api-resources/prebuilds.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource prebuilds', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.prebuilds.create({ projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -23,7 +23,7 @@ describe('resource prebuilds', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: required and optional params', async () => { const response = await client.prebuilds.create({ projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -36,7 +36,7 @@ describe('resource prebuilds', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.prebuilds.retrieve({ prebuildId: '07e03a28-65a5-4d98-b532-8ea67b188048' }); const rawResponse = await responsePromise.asResponse(); @@ -48,12 +48,12 @@ describe('resource prebuilds', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.prebuilds.retrieve({ prebuildId: '07e03a28-65a5-4d98-b532-8ea67b188048' }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.prebuilds.list({}); const rawResponse = await responsePromise.asResponse(); @@ -65,7 +65,7 @@ describe('resource prebuilds', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: only required params', async () => { const responsePromise = client.prebuilds.delete({ prebuildId: '07e03a28-65a5-4d98-b532-8ea67b188048' }); const rawResponse = await responsePromise.asResponse(); @@ -77,12 +77,12 @@ describe('resource prebuilds', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete: required and optional params', async () => { const response = await client.prebuilds.delete({ prebuildId: '07e03a28-65a5-4d98-b532-8ea67b188048' }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('cancel: only required params', async () => { const responsePromise = client.prebuilds.cancel({ prebuildId: '07e03a28-65a5-4d98-b532-8ea67b188048' }); const rawResponse = await responsePromise.asResponse(); @@ -94,12 +94,12 @@ describe('resource prebuilds', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('cancel: required and optional params', async () => { const response = await client.prebuilds.cancel({ prebuildId: '07e03a28-65a5-4d98-b532-8ea67b188048' }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('createLogsToken: only required params', async () => { const responsePromise = client.prebuilds.createLogsToken({ prebuildId: '07e03a28-65a5-4d98-b532-8ea67b188048', @@ -113,10 +113,114 @@ describe('resource prebuilds', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('createLogsToken: required and optional params', async () => { const response = await client.prebuilds.createLogsToken({ prebuildId: '07e03a28-65a5-4d98-b532-8ea67b188048', }); }); + + // Mock server tests are disabled + test.skip('createWarmPool: only required params', async () => { + const responsePromise = client.prebuilds.createWarmPool({ + environmentClassId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('createWarmPool: required and optional params', async () => { + const response = await client.prebuilds.createWarmPool({ + environmentClassId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + desiredSize: 2, + maxSize: 1, + minSize: 20, + }); + }); + + // Mock server tests are disabled + test.skip('deleteWarmPool: only required params', async () => { + const responsePromise = client.prebuilds.deleteWarmPool({ + warmPoolId: 'a1b2c3d4-5678-9abc-def0-1234567890ab', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('deleteWarmPool: required and optional params', async () => { + const response = await client.prebuilds.deleteWarmPool({ + warmPoolId: 'a1b2c3d4-5678-9abc-def0-1234567890ab', + }); + }); + + // Mock server tests are disabled + test.skip('listWarmPools', async () => { + const responsePromise = client.prebuilds.listWarmPools({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('retrieveWarmPool: only required params', async () => { + const responsePromise = client.prebuilds.retrieveWarmPool({ + warmPoolId: 'a1b2c3d4-5678-9abc-def0-1234567890ab', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('retrieveWarmPool: required and optional params', async () => { + const response = await client.prebuilds.retrieveWarmPool({ + warmPoolId: 'a1b2c3d4-5678-9abc-def0-1234567890ab', + }); + }); + + // Mock server tests are disabled + test.skip('updateWarmPool: only required params', async () => { + const responsePromise = client.prebuilds.updateWarmPool({ + warmPoolId: 'a1b2c3d4-5678-9abc-def0-1234567890ab', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('updateWarmPool: required and optional params', async () => { + const response = await client.prebuilds.updateWarmPool({ + warmPoolId: 'a1b2c3d4-5678-9abc-def0-1234567890ab', + desiredSize: 5, + maxSize: 1, + minSize: 20, + }); + }); }); diff --git a/tests/api-resources/projects/environment-clases.test.ts b/tests/api-resources/projects/environment-clases.test.ts index 1d6fe4fd..bd248651 100644 --- a/tests/api-resources/projects/environment-clases.test.ts +++ b/tests/api-resources/projects/environment-clases.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource environmentClases', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('update', async () => { const responsePromise = client.projects.environmentClases.update({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource environmentClases', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.projects.environmentClases.list({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/projects/policies.test.ts b/tests/api-resources/projects/policies.test.ts index cc633a7d..7a394d6c 100644 --- a/tests/api-resources/projects/policies.test.ts +++ b/tests/api-resources/projects/policies.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource policies', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.projects.policies.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update', async () => { const responsePromise = client.projects.policies.update({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.projects.policies.list({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.projects.policies.delete({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/projects/projects.test.ts b/tests/api-resources/projects/projects.test.ts index 02de0f17..7de717d1 100644 --- a/tests/api-resources/projects/projects.test.ts +++ b/tests/api-resources/projects/projects.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource projects', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.projects.create({ initializer: {} }); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('create: required and optional params', async () => { const response = await client.projects.create({ initializer: { @@ -52,7 +52,7 @@ describe('resource projects', () => { }); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve', async () => { const responsePromise = client.projects.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -64,7 +64,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update', async () => { const responsePromise = client.projects.update({}); const rawResponse = await responsePromise.asResponse(); @@ -76,7 +76,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.projects.list({}); const rawResponse = await responsePromise.asResponse(); @@ -88,7 +88,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.projects.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -100,7 +100,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('bulkCreate', async () => { const responsePromise = client.projects.bulkCreate({}); const rawResponse = await responsePromise.asResponse(); @@ -112,7 +112,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('bulkDelete', async () => { const responsePromise = client.projects.bulkDelete({}); const rawResponse = await responsePromise.asResponse(); @@ -124,7 +124,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('bulkUpdate', async () => { const responsePromise = client.projects.bulkUpdate({}); const rawResponse = await responsePromise.asResponse(); @@ -136,7 +136,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('createFromEnvironment', async () => { const responsePromise = client.projects.createFromEnvironment({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/configurations/configurations.test.ts b/tests/api-resources/runners/configurations/configurations.test.ts index c9d288c4..5c85a81f 100644 --- a/tests/api-resources/runners/configurations/configurations.test.ts +++ b/tests/api-resources/runners/configurations/configurations.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource configurations', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('validate', async () => { const responsePromise = client.runners.configurations.validate({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/configurations/environment-classes.test.ts b/tests/api-resources/runners/configurations/environment-classes.test.ts index 00956b2f..14262aca 100644 --- a/tests/api-resources/runners/configurations/environment-classes.test.ts +++ b/tests/api-resources/runners/configurations/environment-classes.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource environmentClasses', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.runners.configurations.environmentClasses.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource environmentClasses', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve', async () => { const responsePromise = client.runners.configurations.environmentClasses.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource environmentClasses', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update', async () => { const responsePromise = client.runners.configurations.environmentClasses.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource environmentClasses', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.runners.configurations.environmentClasses.list({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/configurations/host-authentication-tokens.test.ts b/tests/api-resources/runners/configurations/host-authentication-tokens.test.ts index c2fa2c6a..5f9d135d 100644 --- a/tests/api-resources/runners/configurations/host-authentication-tokens.test.ts +++ b/tests/api-resources/runners/configurations/host-authentication-tokens.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource hostAuthenticationTokens', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.runners.configurations.hostAuthenticationTokens.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource hostAuthenticationTokens', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve', async () => { const responsePromise = client.runners.configurations.hostAuthenticationTokens.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource hostAuthenticationTokens', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update', async () => { const responsePromise = client.runners.configurations.hostAuthenticationTokens.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource hostAuthenticationTokens', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.runners.configurations.hostAuthenticationTokens.list({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource hostAuthenticationTokens', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.runners.configurations.hostAuthenticationTokens.delete({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/configurations/schema.test.ts b/tests/api-resources/runners/configurations/schema.test.ts index 69e50381..006eb617 100644 --- a/tests/api-resources/runners/configurations/schema.test.ts +++ b/tests/api-resources/runners/configurations/schema.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource schema', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve', async () => { const responsePromise = client.runners.configurations.schema.retrieve({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/configurations/scm-integrations.test.ts b/tests/api-resources/runners/configurations/scm-integrations.test.ts index 76405f70..9aa22598 100644 --- a/tests/api-resources/runners/configurations/scm-integrations.test.ts +++ b/tests/api-resources/runners/configurations/scm-integrations.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource scmIntegrations', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.runners.configurations.scmIntegrations.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource scmIntegrations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve', async () => { const responsePromise = client.runners.configurations.scmIntegrations.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource scmIntegrations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update', async () => { const responsePromise = client.runners.configurations.scmIntegrations.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource scmIntegrations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.runners.configurations.scmIntegrations.list({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource scmIntegrations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.runners.configurations.scmIntegrations.delete({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/policies.test.ts b/tests/api-resources/runners/policies.test.ts index b0cfcda2..8a1fcd5a 100644 --- a/tests/api-resources/runners/policies.test.ts +++ b/tests/api-resources/runners/policies.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource policies', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.runners.policies.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update', async () => { const responsePromise = client.runners.policies.update({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.runners.policies.list({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.runners.policies.delete({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/runners.test.ts b/tests/api-resources/runners/runners.test.ts index 62caf162..8fae36b4 100644 --- a/tests/api-resources/runners/runners.test.ts +++ b/tests/api-resources/runners/runners.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource runners', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.runners.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('retrieve', async () => { const responsePromise = client.runners.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('update', async () => { const responsePromise = client.runners.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.runners.list({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.runners.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -68,7 +68,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('checkAuthenticationForHost', async () => { const responsePromise = client.runners.checkAuthenticationForHost({}); const rawResponse = await responsePromise.asResponse(); @@ -80,7 +80,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('checkRepositoryAccess', async () => { const responsePromise = client.runners.checkRepositoryAccess({}); const rawResponse = await responsePromise.asResponse(); @@ -92,7 +92,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('createLogsToken', async () => { const responsePromise = client.runners.createLogsToken({}); const rawResponse = await responsePromise.asResponse(); @@ -104,7 +104,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('createRunnerToken', async () => { const responsePromise = client.runners.createRunnerToken({}); const rawResponse = await responsePromise.asResponse(); @@ -116,7 +116,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('listScmOrganizations', async () => { const responsePromise = client.runners.listScmOrganizations({}); const rawResponse = await responsePromise.asResponse(); @@ -128,7 +128,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('parseContextURL', async () => { const responsePromise = client.runners.parseContextURL({}); const rawResponse = await responsePromise.asResponse(); @@ -140,7 +140,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('searchRepositories', async () => { const responsePromise = client.runners.searchRepositories({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/secrets.test.ts b/tests/api-resources/secrets.test.ts index 45ae5032..1d657a98 100644 --- a/tests/api-resources/secrets.test.ts +++ b/tests/api-resources/secrets.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource secrets', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('create', async () => { const responsePromise = client.secrets.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource secrets', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.secrets.list({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource secrets', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.secrets.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource secrets', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('getValue', async () => { const responsePromise = client.secrets.getValue({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource secrets', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('updateValue', async () => { const responsePromise = client.secrets.updateValue({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/usage.test.ts b/tests/api-resources/usage.test.ts index 36bec989..5fc407b3 100644 --- a/tests/api-resources/usage.test.ts +++ b/tests/api-resources/usage.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource usage', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('listEnvironmentRuntimeRecords', async () => { const responsePromise = client.usage.listEnvironmentRuntimeRecords({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/users/dotfiles.test.ts b/tests/api-resources/users/dotfiles.test.ts index e46faac9..55f4ed54 100644 --- a/tests/api-resources/users/dotfiles.test.ts +++ b/tests/api-resources/users/dotfiles.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource dotfiles', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('get', async () => { const responsePromise = client.users.dotfiles.get({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource dotfiles', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('set', async () => { const responsePromise = client.users.dotfiles.set({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/users/pats.test.ts b/tests/api-resources/users/pats.test.ts index 819b516a..2c4b2bbc 100644 --- a/tests/api-resources/users/pats.test.ts +++ b/tests/api-resources/users/pats.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource pats', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.users.pats.list({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource pats', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('delete', async () => { const responsePromise = client.users.pats.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource pats', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('get', async () => { const responsePromise = client.users.pats.get({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/users/users.test.ts b/tests/api-resources/users/users.test.ts index ca85341a..4d1f2e32 100644 --- a/tests/api-resources/users/users.test.ts +++ b/tests/api-resources/users/users.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource users', () => { - // Prism tests are disabled + // Mock server tests are disabled test.skip('deleteUser', async () => { const responsePromise = client.users.deleteUser({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource users', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('getAuthenticatedUser', async () => { const responsePromise = client.users.getAuthenticatedUser({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource users', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('getUser', async () => { const responsePromise = client.users.getUser({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource users', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism tests are disabled + // Mock server tests are disabled test.skip('setSuspended', async () => { const responsePromise = client.users.setSuspended({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index a5c8902d..e60a5e41 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,8 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { Gitpod } from '@gitpod/sdk'; - -const { stringifyQuery } = Gitpod.prototype as any; +import { stringifyQuery } from '@gitpod/sdk/internal/utils/query'; describe(stringifyQuery, () => { for (const [input, expected] of [ @@ -15,7 +13,7 @@ describe(stringifyQuery, () => { 'e=f', )}=${encodeURIComponent('g&h')}`, ], - ]) { + ] as const) { it(`${JSON.stringify(input)} -> ${expected}`, () => { expect(stringifyQuery(input)).toEqual(expected); }); diff --git a/yarn.lock b/yarn.lock index b1ef43e1..9d562436 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1267,18 +1267,10 @@ bcrypt-pbkdf@^1.0.0, bcrypt-pbkdf@^1.0.2: dependencies: tweetnacl "^0.14.3" -brace-expansion@^1.1.7: - version "1.1.12" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.12.tgz#ab9b454466e5a8cc3a187beaad580412a9c5b843" - integrity sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -brace-expansion@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.2.tgz#54fc53237a613d854c7bd37463aad17df87214e7" - integrity sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ== +brace-expansion@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.3.tgz#0493338bdd58e319b1039c67cf7ee439892c01d9" + integrity sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA== dependencies: balanced-match "^1.0.0" @@ -1448,11 +1440,6 @@ commander@^10.0.1: resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - convert-source-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" @@ -2688,26 +2675,12 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^5.0.1: - version "5.1.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" - integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== - dependencies: - brace-expansion "^2.0.1" - -minimatch@^9.0.4: - version "9.0.5" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" - integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== +minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2, minimatch@^5.0.1, minimatch@^9.0.4, minimatch@^9.0.5: + version "9.0.9" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.9.tgz#9b0cb9fcb78087f6fd7eababe2511c4d3d60574e" + integrity sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg== dependencies: - brace-expansion "^2.0.1" + brace-expansion "^2.0.2" minimist@^1.2.6: version "1.2.6" @@ -2739,9 +2712,9 @@ mz@^2.4.0: thenify-all "^1.0.0" nan@^2.19.0, nan@^2.23.0: - version "2.24.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.24.0.tgz#a8919b36e692aa5b260831910e4f81419fc0a283" - integrity sha512-Vpf9qnVW1RaDkoNKFUvfxqAbtI8ncb8OJlqZ9wwpXzWPEsvsB1nvdUi6oYrHIkQ1Y/tMDnr1h4nczS0VB9Xykg== + version "2.26.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.26.2.tgz#2e5e25764224c737b9897790b57c3294d4dcee9c" + integrity sha512-0tTvBTYkt3tdGw22nrAy50x7gpbGCCFH3AFcyS5WiUu7Eu4vWlri1woE6qHBSfy11vksDqkiwjOnlR7WV8G1Hw== natural-compare@^1.4.0: version "1.4.0"