diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5fc5df9..bbf65ad6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/gitpod-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -26,7 +26,7 @@ jobs: - name: Set up Node uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: - node-version: '20' + node-version: '24' - name: Bootstrap run: ./scripts/bootstrap @@ -37,7 +37,7 @@ jobs: build: timeout-minutes: 5 name: build - runs-on: ${{ github.repository == 'stainless-sdks/gitpod-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} 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 @@ -48,7 +48,7 @@ jobs: - name: Set up Node uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: - node-version: '20' + node-version: '24' - name: Bootstrap run: ./scripts/bootstrap @@ -77,7 +77,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ${{ github.repository == 'stainless-sdks/gitpod-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -85,7 +85,7 @@ jobs: - name: Set up Node uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: - node-version: '20' + node-version: '24' - name: Bootstrap run: ./scripts/bootstrap diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 727e2bea..f87262aa 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.14.0" + ".": "0.15.0" } diff --git a/.stats.yml b/.stats.yml index 82c3873e..83150193 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -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 +configured_endpoints: 213 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod/gitpod-f8271fd3c90de2edf4e8e63bce296f295fb8e54c0522b4d159d1d1f33a902474.yml +openapi_spec_hash: fb7b7d87dc232de2b141c5cc57d16fd1 +config_hash: 3d1af35edc400f59127c3b02ca3ab0ec diff --git a/CHANGELOG.md b/CHANGELOG.md index c4a175c6..edb31043 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,109 @@ # Changelog +## 0.15.0 (2026-07-30) + +Full Changelog: [v0.14.0...v0.15.0](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.14.0...v0.15.0) + +### ⚠ BREAKING CHANGES + +* **api:** narrow public SDK surface +* **agent:** remove loop condition mechanism + +### Features + +* add base snapshot resource types ([d0a4934](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/d0a4934b242a2c2c386422ec199716c615aba496)) +* **agent:** add devcontainer rebuild wait schema ([066ffb9](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/066ffb92c77c42e6c5d0dc623067818e72da4308)) +* **agents:** add native goal set control ([2815518](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/281551871b8e3715aaa18530718e5201ccad5706)) +* **api:** add accessToken field to runners response types ([90fa2a8](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/90fa2a8c112f3717cd08c0cc25a64cfe0d880534)) +* **api:** add agent turn controls ([609765a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/609765accf046ca934fc7532d55f7b2dff52abc0)) +* **api:** add agent_execution_cnf capability to runners ([e96ca1a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e96ca1a49605a2ddfccd4288862f5721d1d91ceb)) +* **api:** add agentExecutionIds filter to agents list executions ([ffdedcb](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/ffdedcbcbb2d505e195f18ea1f9c3e26fb654cc8)) +* **api:** add allowUnverifiedEmailScimFallbackMatch to scim_configurations ([0c94086](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/0c940860f8be53265078463c9ef17a3a2d70b234)) +* **api:** add base snapshot build environment role ([af79956](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/af7995656b6e9a9757dfe2e026f8938b8f4478bf)) +* **api:** add base snapshot runner capability ([6ac2747](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/6ac2747beb4c1631370bd9636244f45aca6544ec)) +* **api:** add Claude Sonnet 5 model enum ([d6b48d0](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/d6b48d0e0008b69338e9c706bcfe5f1f62d0ed91)) +* **api:** add Codex agent settings shape ([dd159ea](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/dd159ea0bf200eee8b14194ddd68ebde631a1461)) +* **api:** add Codex fast mode setting ([c994c17](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/c994c1712b19d34287dc691426e22d1d76da47f4)) +* **api:** add codex model policy states ([34dcdba](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/34dcdba3dcc47d30366d0ac578d904d80df0cc96)) +* **api:** add Codex policy allowlists ([5024cc9](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/5024cc955226c2b8fc01f6e7c2e13037a54c509a)) +* **api:** add credential_proxy to secrets, remove format from environments ([1e6190f](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/1e6190f898a3bfd82c6431734bea4adad3c1ae37)) +* **api:** add default environment class IDs to project creation defaults ([b13d13c](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/b13d13c8779c7ecc6feff816a6d3e7518c5f1c48)) +* **api:** add disableFromScratch field to organization policies ([e46e4a6](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e46e4a69e1dfb9ae210187ac062906700b4cf42d)) +* **api:** add dynamic LLM header contracts ([a7def94](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a7def948b098bceb2b70baba34c5ae285359469e)) +* **api:** add goal field to agent execution status ([af7aefc](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/af7aefc796d2bebbcac50136ea1cafd9c21a85c5)) +* **api:** add incident trigger to WorkflowTrigger and WorkflowExecution ([eb856ef](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/eb856efd3fbac51d1c8556faef976e9a6f8dd09b)) +* **api:** add integration_id, update webhook_id in WorkflowTrigger ([e1591e6](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e1591e617c7e29729f6ada19f03fa53a4161a1c3)) +* **api:** add maxPortAdmissionLevel to organization policies ([9fc32dc](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/9fc32dcfbf9aab465f71b2d84227318826e589ee)) +* **api:** add oldPath field to EnvironmentStatus file changes ([e179ba6](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e179ba6bb9bc0ca5a37262a15235e5f9185a98f6)) +* **api:** add OPENAI_AUTO model option to agents ([ae690a1](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/ae690a1a744c174030a9679206f02372fd06af90)) +* **api:** add opus 4.7 model support to agent execution ([27772ea](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/27772ea9c32c3336e654df4675500ec83ab01f6a)) +* **api:** add Opus 4.8 supported model ([d790282](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/d79028234621972d25619575f3b6f776a532c2c1)) +* **api:** add pagination and search to runners listScmOrganizations method ([6a6e0a8](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/6a6e0a84e2a9daf23db95877e0b0c015fb51a9c4)) +* **api:** add port_authentication capability to RunnerCapability ([c8eb1d6](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/c8eb1d63e97c6570e5156f90c58e29141ed1e68c)) +* **api:** add prebuild trigger value to automations ([452d5e0](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/452d5e08209708511f3505402a1b9bd883f59721)) +* **api:** add prebuild_requires_success field to TaskSpec ([e7c0df3](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e7c0df38a2ae7e22676dd674cb1ecb0d133c185c)) +* **api:** add project_creation_defaults field to organization policies ([7d70a05](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/7d70a050bf8bd1a320c67df55d4c0816a71fbe8d)) +* **api:** add PULL_REQUEST_EVENT_REVIEW_REQUESTED event type to WorkflowTrigger ([a7fe947](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a7fe947b77f988afdc6e93d77e7629991b6709f3)) +* **api:** add readinessTimeout to automations and services ([3e90e74](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/3e90e745e1a3929292bef99678be2b6e18363b4b)) +* **api:** add REDIS_STREAM to RunnerCapability enum in runners ([8d9be56](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/8d9be566a38463088be5e43ead0e5c6b566efec0)) +* **api:** add RESOURCE_ROLE_ORG_ENVIRONMENTS_READER to ResourceRole ([9f9f219](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/9f9f21920fe179fcce2d9166f777449d011f1b74)) +* **api:** add security policy CRUD ([494ff81](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/494ff81d98636b3d2760c4cefd2d55084faaa834)) +* **api:** add UserInputMetadata type to agents ([6c834b9](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/6c834b99652dd3da17781e08d5449480cd835fcd)) +* **api:** add webBrowserDisabled field to organizations policies ([1a8ae44](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/1a8ae4474aa07bc54f258733c768068dbdb022de)) +* **api:** expose audit log entry kind ([b0d348a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/b0d348a92d8222855a630d1a7648cc625e734548)) +* **api:** expose default security policy assignment ([438a4fe](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/438a4fe4996d8e4fd7c90dc38df7d0ed7055ca9b)) +* **api:** expose usage insights API ([fa80ce9](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/fa80ce9e9ffc891932e0dbc2fd47f02bfeb0bdf8)) +* **api:** expose Veto Exec security policies ([0044e8a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/0044e8ab1c6029e7fab6e7b967fa7523dd0a2e70)) +* **api:** remove terminal field from RunsOn ([85d6ef2](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/85d6ef2d704eb140512d7edf3c1e6495f1da12d5)) +* **audit:** curate audit events at their producers ([13532de](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/13532de2fac6af62633fe4d35ef778b6284ac413)) +* **audit:** store and retrieve Veto Exec details ([0120ae7](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/0120ae7829b82b840fbbe5ba8d763fa3570ef7e9)) +* **automations:** pin agent and Codex model per automation ([83d82a3](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/83d82a37eaae42c2e2298d58187ba492dec8070e)) +* **billing:** add Enterprise AI user budget APIs ([66e7496](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/66e749662e88bd5c3e3899bc07421e17a029e584)) +* **codex:** add GPT-5.6 model selection ([3138ce8](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/3138ce83141c309bedfbaa7a86a114d870002267)) +* **rbac:** add billing viewer role ([9370c07](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/9370c0774f8b3717d0524e97ef82da56ab236664)) +* **rbac:** add insights viewer role ([a1eb0d9](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a1eb0d9242f7ad81dd7613395286bbbbf4868209)) +* **secrets:** support JFrog OIDC secret sources ([2cbf05b](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/2cbf05b577b3d73bc5122582255561c032928392)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([4bbecf5](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/4bbecf52a1cbcbc8b354d060cf856416f9fdc2e6)) +* support setting headers via env ([bed4904](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/bed49045e5f23a7f683a8b8603cf1b50a2f7a433)) +* **types:** add Report and related schema types to automations ([f9c394a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/f9c394ab4ed90dcea009c21471bbeeec3871bdd6)) + + +### Bug Fixes + +* **api:** narrow public SDK surface ([94558de](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/94558de6ea076bba9115b589393ccade2dd2f496)) +* **api:** wrap prebuild default updates ([5eed720](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/5eed7206580b4c1900a7728372f32a5dcafcd2b8)) +* **ci:** bump @arethetypeswrong/cli to ^0.18.0 and run CI workflows on Node 24 ([1396c15](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/1396c15bd264e9eee7152ea2e9217557cb78d8fe)) +* **client:** send content-type header for requests with an omitted optional body ([14526e5](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/14526e53fb6c4b755634c4ed5ab598195f844872)) +* **typescript:** upgrade tsc-multi so that it works with Node 26 ([44ea48e](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/44ea48e8129ec5e7af0a643d35378e1b8536c8f4)) + + +### Chores + +* **format:** run eslint and prettier separately ([0782de2](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/0782de2e4cc157507a34c43a5db1a8f1700db98c)) +* **formatter:** run prettier and eslint separately ([e354bf8](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e354bf849b97e421b9694b55a1d7b0f41e7ba4fe)) +* **internal:** codegen related update ([f0055f7](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/f0055f7c6bb9420bc0ae3c6267651393832213f3)) +* **internal:** codegen related update ([afd15ee](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/afd15eebed86ae40238ac2e8a34c448e48097aed)) +* **internal:** codegen related update ([cfd1e9a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/cfd1e9a15f844e398d089cfc9189b604628b9c33)) +* **internal:** more robust bootstrap script ([306e1fa](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/306e1fa51525f0ba764898ed4ee57a4ccb002d8c)) +* **internal:** regenerate SDK with no functional changes ([c67a192](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/c67a192f31447d27e1a5b077ea123cf9f18b402f)) +* redact api-key headers in debug logs ([2598350](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/2598350538c8203fdb338f4fa41b1e81addd485b)) +* **tests:** remove redundant File import ([253359f](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/253359feedb1230ed9c7c34cb98e393473220f0c)) +* **types:** remove deprecated accessToken from runners response types ([c521a3e](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/c521a3efa0f39ccea79c239fa8ffe208c901309a)) + + +### Documentation + +* **api:** add customer-facing descriptions to runner enums and fix CreateRunner examples ([9d1ff23](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/9d1ff23c474adb238e5b9dac965cd6dfaf136c29)) +* **types:** clarify trigger restrictions in AutomationTrigger ([fadafca](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/fadafca48ec3301694befe6e3d71f14321642500)) +* **types:** deprecate isAdmin in runners organization response ([7aa6263](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/7aa6263936e7a45c43801dc818e384d43e1249c5)) + + +### Refactors + +* **agent:** remove loop condition mechanism ([a22d444](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a22d444d5f1c13d2ac6243aa740729415094b7ad)) +* **api:** default StartAgent agent ID ([7155c62](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/7155c62889ece19a8f3367f8d5cc1b3ee0394536)) +* **api:** remove project defaults API surface ([2a335c3](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/2a335c36b73fc0449e0403333130d63a5c3776a2)) + ## 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) diff --git a/api.md b/api.md index 96536d55..ea1ba85e 100644 --- a/api.md +++ b/api.md @@ -3,13 +3,19 @@ Types: - AutomationTrigger +- CodexOpenAIModel +- CodexReasoningEffort +- CodexServiceTier +- CodexSettings - CountResponseRelation +- DateRange - EnvironmentClass - EnvironmentVariableItem - EnvironmentVariableSource - ErrorCode - FieldValue - Gateway +- KernelControlsAction - OrganizationRole - OrganizationTier - Principal @@ -62,12 +68,14 @@ Types: - AgentExecution - AgentMessage - AgentMode +- GoalStatus - Prompt - PromptMetadata - PromptSpec - Role - Type - UserInputBlock +- UserInputMetadata - WakeEvent - AgentCreateExecutionConversationTokenResponse - AgentCreatePromptResponse @@ -133,6 +141,53 @@ Methods: - client.automations.retrieveExecutionAction({ ...params }) -> AutomationRetrieveExecutionActionResponse - client.automations.startExecution({ ...params }) -> AutomationStartExecutionResponse +# Billing + +Types: + +- AgentExecutionCreditUsage +- BillingCurrency +- ByokRateCardTokenType +- CreditUsageExportGroupBy +- CreditUsageReportFilter +- CreditsByType +- CumulativeCreditUsage +- DailyCreditUsage +- DailyEnterpriseAIUsage +- EnterpriseAITokenUsage +- EnterpriseAIUsage +- EnterpriseAIUsageBudget +- EnterpriseAIUsageBudgetSource +- EnterpriseAIUsageByModel +- EnterpriseAIUsageByTokenType +- EnterpriseAIUsageTimeSeriesFilter +- EnterpriseAIUserBudgetPolicySource +- EnvironmentCreditUsage +- TeamCreditUsage +- TeamCumulativeCreditUsage +- TeamEnterpriseAIUsage +- UsageType +- UserCostBudgetUsage +- UserCreditBudgetUsage +- UserCreditUsage +- UserEnterpriseAIUsage +- BillingGetCreditUsageExportResponse +- BillingGetCreditUsageReportResponse +- BillingGetCumulativeCreditUsageResponse +- BillingGetEnterpriseAIUsageSummaryResponse +- BillingGetEnterpriseAIUsageTimeSeriesResponse + +Methods: + +- client.billing.getCreditUsageExport({ ...params }) -> BillingGetCreditUsageExportResponse +- client.billing.getCreditUsageReport({ ...params }) -> BillingGetCreditUsageReportResponse +- client.billing.getCumulativeCreditUsage({ ...params }) -> BillingGetCumulativeCreditUsageResponse +- client.billing.getEnterpriseAIUsageSummary({ ...params }) -> BillingGetEnterpriseAIUsageSummaryResponse +- client.billing.getEnterpriseAIUsageTimeSeries({ ...params }) -> BillingGetEnterpriseAIUsageTimeSeriesResponse +- client.billing.listEnterpriseAITeamUsage({ ...params }) -> TeamEnterpriseAIUsagesTeamUsagePage +- client.billing.listEnterpriseAIUserUsage({ ...params }) -> UserCostBudgetUsagesUserUsagePage +- client.billing.listEnterpriseUserCreditUsage({ ...params }) -> UserCreditBudgetUsagesUserUsagePage + # Editors Types: @@ -266,33 +321,20 @@ Methods: - client.environments.classes.list({ ...params }) -> EnvironmentClassesEnvironmentClassesPage -# Errors - -Types: - -- Breadcrumb -- ErrorEvent -- ErrorLevel -- ExceptionInfo -- ExceptionMechanism -- RequestInfo -- StackFrame -- ErrorReportErrorsResponse - -Methods: - -- client.errors.reportErrors({ ...params }) -> unknown - # Events Types: +- AuditLogEntryDetails +- Process - ResourceOperation +- EventRetrieveResponse - EventListResponse - EventWatchResponse Methods: +- client.events.retrieve({ ...params }) -> EventRetrieveResponse - client.events.list({ ...params }) -> EventListResponsesEntriesPage - client.events.watch({ ...params }) -> EventWatchResponse @@ -473,11 +515,11 @@ Methods: Types: - AgentPolicy +- CodexModelPolicy - ConversationSharingPolicy - CrowdStrikeConfig - CustomAgentEnvMapping - CustomSecurityAgent -- KernelControlsAction - OrganizationPolicies - SecurityAgentPolicy - VetoExecPolicy @@ -670,7 +712,7 @@ Methods: - client.runners.checkRepositoryAccess({ ...params }) -> RunnerCheckRepositoryAccessResponse - client.runners.createLogsToken({ ...params }) -> RunnerCreateLogsTokenResponse - client.runners.createRunnerToken({ ...params }) -> RunnerCreateRunnerTokenResponse -- client.runners.listScmOrganizations({ ...params }) -> RunnerListScmOrganizationsResponse +- client.runners.listScmOrganizations({ ...params }) -> RunnerListScmOrganizationsResponsesOrganizationsPage - client.runners.parseContextURL({ ...params }) -> RunnerParseContextURLResponse - client.runners.searchRepositories({ ...params }) -> RunnerSearchRepositoriesResponse @@ -787,14 +829,58 @@ Methods: - client.secrets.getValue({ ...params }) -> SecretGetValueResponse - client.secrets.updateValue({ ...params }) -> unknown -# Usage +# SecurityPolicies Types: -- EnvironmentUsageRecord +- SecurityPolicy +- SecurityPolicyCreateResponse +- SecurityPolicyRetrieveResponse +- SecurityPolicyUpdateResponse +- SecurityPolicyDeleteResponse Methods: +- client.securityPolicies.create({ ...params }) -> SecurityPolicyCreateResponse +- client.securityPolicies.retrieve({ ...params }) -> SecurityPolicyRetrieveResponse +- client.securityPolicies.update({ ...params }) -> SecurityPolicyUpdateResponse +- client.securityPolicies.list({ ...params }) -> SecurityPoliciesSecurityPoliciesPage +- client.securityPolicies.delete({ ...params }) -> unknown + +# Usage + +Types: + +- AgentTraceModelBreakdown +- AgentTraceSummary +- AgentTraceTimeBucket +- CoAuthorSummary +- CoAuthorTimeBucket +- CoAuthorTool +- EnvironmentUsageRecord +- PrSummary +- PrTimeBucket +- Resolution +- SupportedModel +- TimeSeriesPoint +- ToolBreakdown +- UsageGetAdoptionUsageSummaryResponse +- UsageGetAgentTraceSummaryResponse +- UsageGetAgentTraceTimeSeriesResponse +- UsageGetCoAuthorSummaryResponse +- UsageGetCoAuthorTimeSeriesResponse +- UsageGetPrSummaryResponse +- UsageGetPrTimeSeriesResponse + +Methods: + +- client.usage.getAdoptionUsageSummary({ ...params }) -> UsageGetAdoptionUsageSummaryResponse +- client.usage.getAgentTraceSummary({ ...params }) -> UsageGetAgentTraceSummaryResponse +- client.usage.getAgentTraceTimeSeries({ ...params }) -> UsageGetAgentTraceTimeSeriesResponse +- client.usage.getCoAuthorSummary({ ...params }) -> UsageGetCoAuthorSummaryResponse +- client.usage.getCoAuthorTimeSeries({ ...params }) -> UsageGetCoAuthorTimeSeriesResponse +- client.usage.getPrSummary({ ...params }) -> UsageGetPrSummaryResponse +- client.usage.getPrTimeSeries({ ...params }) -> UsageGetPrTimeSeriesResponse - client.usage.listEnvironmentRuntimeRecords({ ...params }) -> EnvironmentUsageRecordsRecordsPage # Users diff --git a/eslint.config.mjs b/eslint.config.mjs index a73ce380..0fd72164 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,7 +1,6 @@ // @ts-check import tseslint from 'typescript-eslint'; import unusedImports from 'eslint-plugin-unused-imports'; -import prettier from 'eslint-plugin-prettier'; export default tseslint.config( { @@ -14,11 +13,9 @@ export default tseslint.config( plugins: { '@typescript-eslint': tseslint.plugin, 'unused-imports': unusedImports, - prettier, }, rules: { 'no-unused-vars': 'off', - 'prettier/prettier': 'error', 'unused-imports/no-unused-imports': 'error', 'no-restricted-imports': [ 'error', diff --git a/package.json b/package.json index 7364c376..c2306d69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gitpod/sdk", - "version": "0.14.0", + "version": "0.15.0", "description": "The official TypeScript library for the Gitpod API", "author": "Gitpod ", "types": "dist/index.d.ts", @@ -28,7 +28,7 @@ }, "dependencies": {}, "devDependencies": { - "@arethetypeswrong/cli": "^0.17.0", + "@arethetypeswrong/cli": "^0.18.0", "@swc/core": "^1.3.102", "@swc/jest": "^0.2.29", "@types/jest": "^29.4.0", @@ -38,7 +38,6 @@ "@typescript-eslint/eslint-plugin": "8.31.1", "@typescript-eslint/parser": "8.31.1", "eslint": "^9.39.1", - "eslint-plugin-prettier": "^5.4.1", "eslint-plugin-unused-imports": "^4.1.4", "iconv-lite": "^0.6.3", "jest": "^29.4.0", @@ -48,7 +47,7 @@ "sshpk": "^1.18.0", "ts-jest": "^29.1.0", "ts-node": "^10.5.0", - "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz", + "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz", "tsconfig-paths": "^4.0.0", "tslib": "^2.8.1", "typescript": "5.8.3", diff --git a/scripts/bootstrap b/scripts/bootstrap index 3417182b..7db27b1b 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { echo -n "==> Install Homebrew dependencies? (y/N): " read -r response diff --git a/scripts/fast-format b/scripts/fast-format index 53721ac0..f1873aef 100755 --- a/scripts/fast-format +++ b/scripts/fast-format @@ -31,10 +31,7 @@ if ! [ -z "$ESLINT_FILES" ]; then fi echo "==> Running prettier --write" -# format things eslint didn't -PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)" -if ! [ -z "$PRETTIER_FILES" ]; then - echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \ - --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \ - '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs' +if ! [ -z "$FILE_LIST" ]; then + cat "$FILE_LIST" | xargs ./node_modules/.bin/prettier \ + --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern --ignore-unknown fi diff --git a/scripts/format b/scripts/format index 7a756401..b1b2c17a 100755 --- a/scripts/format +++ b/scripts/format @@ -8,5 +8,4 @@ echo "==> Running eslint --fix" ./node_modules/.bin/eslint --fix . echo "==> Running prettier --write" -# format things eslint didn't -./node_modules/.bin/prettier --write --cache --cache-strategy metadata . '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs' +./node_modules/.bin/prettier --write --cache --cache-strategy metadata . diff --git a/scripts/lint b/scripts/lint index 3ffb78a6..1f532548 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,6 +4,9 @@ set -e cd "$(dirname "$0")/.." +echo "==> Running prettier --check" +./node_modules/.bin/prettier --check . + echo "==> Running eslint" ./node_modules/.bin/eslint . diff --git a/scripts/utils/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs index deae575e..a8cdeb7c 100644 --- a/scripts/utils/postprocess-files.cjs +++ b/scripts/utils/postprocess-files.cjs @@ -23,12 +23,19 @@ async function postprocess() { // strip out lib="dom", types="node", and types="react" references; these // are needed at build time, but would pollute the user's TS environment - const transformed = code.replace( + let transformed = code.replace( /^ *\/\/\/ * ' '.repeat(match.length - 1) + '\n', ); + // TypeScript's declaration emitter collapses /** @ts-ignore */ onto the same + // line as the type declaration, which doesn't work. So we convert to // @ts-ignore + // on its own line to properly suppresses errors. + if (file.endsWith('.d.ts') || file.endsWith('.d.mts') || file.endsWith('.d.cts')) { + transformed = transformed.replace(/\/\*\* @ts-ignore\b[^*]*\*\/ /gm, '// @ts-ignore\n'); + } + if (transformed !== code) { console.error(`wrote ${path.relative(process.cwd(), file)}`); await fs.promises.writeFile(file, transformed, 'utf8'); diff --git a/src/client.ts b/src/client.ts index ad0dd92c..b2ed03c4 100644 --- a/src/client.ts +++ b/src/client.ts @@ -7,10 +7,10 @@ import { validatePositiveInteger, isAbsoluteURL, safeJSON } from './internal/uti import { sleep } from './internal/utils/sleep'; import { type Logger, - type LogLevel as LogLevelClient, - parseLogLevel, - loggerFor, - formatRequestDetails, +type LogLevel as LogLevelClient, +parseLogLevel, +loggerFor, +formatRequestDetails, } from './internal/utils/log'; export type { Logger, LogLevel as LogLevelClient } from './internal/utils/log'; import { castToError, isAbortError } from './internal/errors'; @@ -52,6 +52,8 @@ import { LoginsPageResponse, type MembersPageParams, MembersPageResponse, + type OrganizationsPageParams, + OrganizationsPageResponse, type OutputsPageParams, OutputsPageResponse, type PersonalAccessTokensPageParams, @@ -78,14 +80,20 @@ import { ScimConfigurationsPageResponse, type SecretsPageParams, SecretsPageResponse, + type SecurityPoliciesPageParams, + SecurityPoliciesPageResponse, type ServicesPageParams, ServicesPageResponse, type TaskExecutionsPageParams, TaskExecutionsPageResponse, type TasksPageParams, TasksPageResponse, + type TeamUsagePageParams, + TeamUsagePageResponse, type TokensPageParams, TokensPageResponse, + type UserUsagePageParams, + UserUsagePageResponse, type WarmPoolsPageParams, WarmPoolsPageResponse, type WorkflowExecutionActionsPageParams, @@ -147,6 +155,7 @@ import { AgentUpdatePromptParams, AgentUpdatePromptResponse, Agents, + GoalStatus, Prompt, PromptMetadata, PromptSpec, @@ -154,6 +163,7 @@ import { Role, Type, UserInputBlock, + UserInputMetadata, WakeEvent, } from './resources/agents'; import { @@ -193,6 +203,51 @@ import { WorkflowTriggerContext, WorkflowsWorkflowsPage, } from './resources/automations'; +import { + AgentExecutionCreditUsage, + Billing, + BillingCurrency, + BillingGetCreditUsageExportParams, + BillingGetCreditUsageExportResponse, + BillingGetCreditUsageReportParams, + BillingGetCreditUsageReportResponse, + BillingGetCumulativeCreditUsageParams, + BillingGetCumulativeCreditUsageResponse, + BillingGetEnterpriseAIUsageSummaryParams, + BillingGetEnterpriseAIUsageSummaryResponse, + BillingGetEnterpriseAIUsageTimeSeriesParams, + BillingGetEnterpriseAIUsageTimeSeriesResponse, + BillingListEnterpriseAITeamUsageParams, + BillingListEnterpriseAIUserUsageParams, + BillingListEnterpriseUserCreditUsageParams, + ByokRateCardTokenType, + CreditUsageExportGroupBy, + CreditUsageReportFilter, + CreditsByType, + CumulativeCreditUsage, + DailyCreditUsage, + DailyEnterpriseAIUsage, + EnterpriseAITokenUsage, + EnterpriseAIUsage, + EnterpriseAIUsageBudget, + EnterpriseAIUsageBudgetSource, + EnterpriseAIUsageByModel, + EnterpriseAIUsageByTokenType, + EnterpriseAIUsageTimeSeriesFilter, + EnterpriseAIUserBudgetPolicySource, + EnvironmentCreditUsage, + TeamCreditUsage, + TeamCumulativeCreditUsage, + TeamEnterpriseAIUsage, + TeamEnterpriseAIUsagesTeamUsagePage, + UsageType, + UserCostBudgetUsage, + UserCostBudgetUsagesUserUsagePage, + UserCreditBudgetUsage, + UserCreditBudgetUsagesUserUsagePage, + UserCreditUsage, + UserEnterpriseAIUsage, +} from './resources/billing'; import { Editor, EditorListParams, @@ -205,24 +260,16 @@ import { EditorsEditorsPage, } from './resources/editors'; import { - Breadcrumb, - ErrorEvent, - ErrorLevel, - ErrorReportErrorsParams, - ErrorReportErrorsResponse, - Errors as ErrorsAPIErrors, - ExceptionInfo, - ExceptionMechanism, - RequestInfo as ErrorRequestInfo, - StackFrame, -} from './resources/errors'; -import { + AuditLogEntryDetails, EventListParams, EventListResponse, EventListResponsesEntriesPage, + EventRetrieveParams, + EventRetrieveResponse, EventWatchParams, EventWatchResponse, Events, + Process, ResourceOperation, } from './resources/events'; import { GatewayListParams, Gateways } from './resources/gateways'; @@ -288,9 +335,49 @@ import { SecretsSecretsPage, } from './resources/secrets'; import { + SecurityPolicies, + SecurityPoliciesSecurityPoliciesPage, + SecurityPolicy, + SecurityPolicyCreateParams, + SecurityPolicyCreateResponse, + SecurityPolicyDeleteParams, + SecurityPolicyDeleteResponse, + SecurityPolicyListParams, + SecurityPolicyRetrieveParams, + SecurityPolicyRetrieveResponse, + SecurityPolicyUpdateParams, + SecurityPolicyUpdateResponse, +} from './resources/security-policies'; +import { + AgentTraceModelBreakdown, + AgentTraceSummary, + AgentTraceTimeBucket, + CoAuthorSummary, + CoAuthorTimeBucket, + CoAuthorTool, EnvironmentUsageRecord, EnvironmentUsageRecordsRecordsPage, + PrSummary, + PrTimeBucket, + Resolution, + SupportedModel, + TimeSeriesPoint, + ToolBreakdown, Usage, + UsageGetAdoptionUsageSummaryParams, + UsageGetAdoptionUsageSummaryResponse, + UsageGetAgentTraceSummaryParams, + UsageGetAgentTraceSummaryResponse, + UsageGetAgentTraceTimeSeriesParams, + UsageGetAgentTraceTimeSeriesResponse, + UsageGetCoAuthorSummaryParams, + UsageGetCoAuthorSummaryResponse, + UsageGetCoAuthorTimeSeriesParams, + UsageGetCoAuthorTimeSeriesResponse, + UsageGetPrSummaryParams, + UsageGetPrSummaryResponse, + UsageGetPrTimeSeriesParams, + UsageGetPrTimeSeriesResponse, UsageListEnvironmentRuntimeRecordsParams, } from './resources/usage'; import { @@ -417,6 +504,7 @@ import { RunnerListParams, RunnerListScmOrganizationsParams, RunnerListScmOrganizationsResponse, + RunnerListScmOrganizationsResponsesOrganizationsPage, RunnerParseContextURLParams, RunnerParseContextURLResponse, RunnerPhase, @@ -591,6 +679,18 @@ export class Gitpod { this.fetch = options.fetch ?? Shims.getDefaultFetch(); this.#encoder = Opts.FallbackEncoder; + const customHeadersEnv = readEnv('GITPOD_CUSTOM_HEADERS'); + if (customHeadersEnv) { + const parsed: Record = {}; + for (const line of customHeadersEnv.split('\n')) { + const colon = line.indexOf(':'); + if (colon >= 0) { + parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim(); + } + } + options.defaultHeaders = { ...parsed, ...options.defaultHeaders }; + } + this._options = options; this.bearerToken = bearerToken; @@ -1101,11 +1201,19 @@ export class Gitpod { return () => controller.abort(); } - private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): { + private buildBody({ options }: { options: FinalRequestOptions }): { bodyHeaders: HeadersLike; body: BodyInit | undefined; } { + const { body, headers: rawHeaders } = options; if (!body) { + // A resource method always passes a `body` key when its operation defines a + // request body, even if the caller omitted an optional body param. Keep the + // content-type for those, and only elide it for operations with no body at + // all (e.g. GET/DELETE). + if (body == null && 'body' in options) { + return this.#encoder({ body, headers: buildHeaders([rawHeaders]) }); + } return { bodyHeaders: undefined, body: undefined }; } const headers = buildHeaders([rawHeaders]); @@ -1168,13 +1276,12 @@ 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. + * BillingService provides billing and subscription management functionality. */ - errors: API.Errors = new API.Errors(this); + billing: API.Billing = new API.Billing(this); + editors: API.Editors = new API.Editors(this); + environments: API.Environments = new API.Environments(this); events: API.Events = new API.Events(this); gateways: API.Gateways = new API.Gateways(this); groups: API.Groups = new API.Groups(this); @@ -1188,6 +1295,7 @@ export class Gitpod { projects: API.Projects = new API.Projects(this); runners: API.Runners = new API.Runners(this); secrets: API.Secrets = new API.Secrets(this); + securityPolicies: API.SecurityPolicies = new API.SecurityPolicies(this); /** * UsageService provides usage information about environments, users, and projects. */ @@ -1198,9 +1306,9 @@ export class Gitpod { Gitpod.Accounts = Accounts; Gitpod.Agents = Agents; Gitpod.Automations = Automations; +Gitpod.Billing = Billing; Gitpod.Editors = Editors; Gitpod.Environments = Environments; -Gitpod.Errors = ErrorsAPIErrors; Gitpod.Events = Events; Gitpod.Gateways = Gateways; Gitpod.Groups = Groups; @@ -1210,6 +1318,7 @@ Gitpod.Prebuilds = Prebuilds; Gitpod.Projects = Projects; Gitpod.Runners = Runners; Gitpod.Secrets = Secrets; +Gitpod.SecurityPolicies = SecurityPolicies; Gitpod.Usage = Usage; Gitpod.Users = Users; @@ -1282,6 +1391,12 @@ export declare namespace Gitpod { export import MembersPage = Pagination.MembersPage; export { type MembersPageParams as MembersPageParams, type MembersPageResponse as MembersPageResponse }; + export import OrganizationsPage = Pagination.OrganizationsPage; + export { + type OrganizationsPageParams as OrganizationsPageParams, + type OrganizationsPageResponse as OrganizationsPageResponse, + }; + export import OutputsPage = Pagination.OutputsPage; export { type OutputsPageParams as OutputsPageParams, type OutputsPageResponse as OutputsPageResponse }; @@ -1333,6 +1448,12 @@ export declare namespace Gitpod { export import SecretsPage = Pagination.SecretsPage; export { type SecretsPageParams as SecretsPageParams, type SecretsPageResponse as SecretsPageResponse }; + export import SecurityPoliciesPage = Pagination.SecurityPoliciesPage; + export { + type SecurityPoliciesPageParams as SecurityPoliciesPageParams, + type SecurityPoliciesPageResponse as SecurityPoliciesPageResponse, + }; + export import ServicesPage = Pagination.ServicesPage; export { type ServicesPageParams as ServicesPageParams, type ServicesPageResponse as ServicesPageResponse }; @@ -1351,9 +1472,21 @@ export declare namespace Gitpod { export import TasksPage = Pagination.TasksPage; export { type TasksPageParams as TasksPageParams, type TasksPageResponse as TasksPageResponse }; + export import TeamUsagePage = Pagination.TeamUsagePage; + export { + type TeamUsagePageParams as TeamUsagePageParams, + type TeamUsagePageResponse as TeamUsagePageResponse, + }; + export import TokensPage = Pagination.TokensPage; export { type TokensPageParams as TokensPageParams, type TokensPageResponse as TokensPageResponse }; + export import UserUsagePage = Pagination.UserUsagePage; + export { + type UserUsagePageParams as UserUsagePageParams, + type UserUsagePageResponse as UserUsagePageResponse, + }; + export import WarmPoolsPage = Pagination.WarmPoolsPage; export { type WarmPoolsPageParams as WarmPoolsPageParams, @@ -1405,12 +1538,14 @@ export declare namespace Gitpod { type AgentExecution as AgentExecution, type AgentMessage as AgentMessage, type AgentMode as AgentMode, + type GoalStatus as GoalStatus, 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 UserInputMetadata as UserInputMetadata, type WakeEvent as WakeEvent, type AgentCreateExecutionConversationTokenResponse as AgentCreateExecutionConversationTokenResponse, type AgentCreatePromptResponse as AgentCreatePromptResponse, @@ -1476,6 +1611,52 @@ export declare namespace Gitpod { type AutomationStartExecutionParams as AutomationStartExecutionParams, }; + export { + Billing as Billing, + type AgentExecutionCreditUsage as AgentExecutionCreditUsage, + type BillingCurrency as BillingCurrency, + type ByokRateCardTokenType as ByokRateCardTokenType, + type CreditUsageExportGroupBy as CreditUsageExportGroupBy, + type CreditUsageReportFilter as CreditUsageReportFilter, + type CreditsByType as CreditsByType, + type CumulativeCreditUsage as CumulativeCreditUsage, + type DailyCreditUsage as DailyCreditUsage, + type DailyEnterpriseAIUsage as DailyEnterpriseAIUsage, + type EnterpriseAITokenUsage as EnterpriseAITokenUsage, + type EnterpriseAIUsage as EnterpriseAIUsage, + type EnterpriseAIUsageBudget as EnterpriseAIUsageBudget, + type EnterpriseAIUsageBudgetSource as EnterpriseAIUsageBudgetSource, + type EnterpriseAIUsageByModel as EnterpriseAIUsageByModel, + type EnterpriseAIUsageByTokenType as EnterpriseAIUsageByTokenType, + type EnterpriseAIUsageTimeSeriesFilter as EnterpriseAIUsageTimeSeriesFilter, + type EnterpriseAIUserBudgetPolicySource as EnterpriseAIUserBudgetPolicySource, + type EnvironmentCreditUsage as EnvironmentCreditUsage, + type TeamCreditUsage as TeamCreditUsage, + type TeamCumulativeCreditUsage as TeamCumulativeCreditUsage, + type TeamEnterpriseAIUsage as TeamEnterpriseAIUsage, + type UsageType as UsageType, + type UserCostBudgetUsage as UserCostBudgetUsage, + type UserCreditBudgetUsage as UserCreditBudgetUsage, + type UserCreditUsage as UserCreditUsage, + type UserEnterpriseAIUsage as UserEnterpriseAIUsage, + type BillingGetCreditUsageExportResponse as BillingGetCreditUsageExportResponse, + type BillingGetCreditUsageReportResponse as BillingGetCreditUsageReportResponse, + type BillingGetCumulativeCreditUsageResponse as BillingGetCumulativeCreditUsageResponse, + type BillingGetEnterpriseAIUsageSummaryResponse as BillingGetEnterpriseAIUsageSummaryResponse, + type BillingGetEnterpriseAIUsageTimeSeriesResponse as BillingGetEnterpriseAIUsageTimeSeriesResponse, + type TeamEnterpriseAIUsagesTeamUsagePage as TeamEnterpriseAIUsagesTeamUsagePage, + type UserCostBudgetUsagesUserUsagePage as UserCostBudgetUsagesUserUsagePage, + type UserCreditBudgetUsagesUserUsagePage as UserCreditBudgetUsagesUserUsagePage, + type BillingGetCreditUsageExportParams as BillingGetCreditUsageExportParams, + type BillingGetCreditUsageReportParams as BillingGetCreditUsageReportParams, + type BillingGetCumulativeCreditUsageParams as BillingGetCumulativeCreditUsageParams, + type BillingGetEnterpriseAIUsageSummaryParams as BillingGetEnterpriseAIUsageSummaryParams, + type BillingGetEnterpriseAIUsageTimeSeriesParams as BillingGetEnterpriseAIUsageTimeSeriesParams, + type BillingListEnterpriseAITeamUsageParams as BillingListEnterpriseAITeamUsageParams, + type BillingListEnterpriseAIUserUsageParams as BillingListEnterpriseAIUserUsageParams, + type BillingListEnterpriseUserCreditUsageParams as BillingListEnterpriseUserCreditUsageParams, + }; + export { Editors as Editors, type Editor as Editor, @@ -1527,25 +1708,16 @@ export declare namespace Gitpod { type EnvironmentUnarchiveParams as EnvironmentUnarchiveParams, }; - export { - ErrorsAPIErrors as Errors, - type Breadcrumb as Breadcrumb, - type ErrorEvent as ErrorEvent, - type ErrorLevel as ErrorLevel, - type ExceptionInfo as ExceptionInfo, - type ExceptionMechanism as ExceptionMechanism, - type ErrorRequestInfo as RequestInfo, - type StackFrame as StackFrame, - type ErrorReportErrorsResponse as ErrorReportErrorsResponse, - type ErrorReportErrorsParams as ErrorReportErrorsParams, - }; - export { Events as Events, + type AuditLogEntryDetails as AuditLogEntryDetails, + type Process as Process, type ResourceOperation as ResourceOperation, + type EventRetrieveResponse as EventRetrieveResponse, type EventListResponse as EventListResponse, type EventWatchResponse as EventWatchResponse, type EventListResponsesEntriesPage as EventListResponsesEntriesPage, + type EventRetrieveParams as EventRetrieveParams, type EventListParams as EventListParams, type EventWatchParams as EventWatchParams, }; @@ -1695,6 +1867,7 @@ export declare namespace Gitpod { type RunnerParseContextURLResponse as RunnerParseContextURLResponse, type RunnerSearchRepositoriesResponse as RunnerSearchRepositoriesResponse, type RunnersRunnersPage as RunnersRunnersPage, + type RunnerListScmOrganizationsResponsesOrganizationsPage as RunnerListScmOrganizationsResponsesOrganizationsPage, type RunnerCreateParams as RunnerCreateParams, type RunnerRetrieveParams as RunnerRetrieveParams, type RunnerUpdateParams as RunnerUpdateParams, @@ -1725,10 +1898,51 @@ export declare namespace Gitpod { type SecretUpdateValueParams as SecretUpdateValueParams, }; + export { + SecurityPolicies as SecurityPolicies, + type SecurityPolicy as SecurityPolicy, + type SecurityPolicyCreateResponse as SecurityPolicyCreateResponse, + type SecurityPolicyRetrieveResponse as SecurityPolicyRetrieveResponse, + type SecurityPolicyUpdateResponse as SecurityPolicyUpdateResponse, + type SecurityPolicyDeleteResponse as SecurityPolicyDeleteResponse, + type SecurityPoliciesSecurityPoliciesPage as SecurityPoliciesSecurityPoliciesPage, + type SecurityPolicyCreateParams as SecurityPolicyCreateParams, + type SecurityPolicyRetrieveParams as SecurityPolicyRetrieveParams, + type SecurityPolicyUpdateParams as SecurityPolicyUpdateParams, + type SecurityPolicyListParams as SecurityPolicyListParams, + type SecurityPolicyDeleteParams as SecurityPolicyDeleteParams, + }; + export { Usage as Usage, + type AgentTraceModelBreakdown as AgentTraceModelBreakdown, + type AgentTraceSummary as AgentTraceSummary, + type AgentTraceTimeBucket as AgentTraceTimeBucket, + type CoAuthorSummary as CoAuthorSummary, + type CoAuthorTimeBucket as CoAuthorTimeBucket, + type CoAuthorTool as CoAuthorTool, type EnvironmentUsageRecord as EnvironmentUsageRecord, + type PrSummary as PrSummary, + type PrTimeBucket as PrTimeBucket, + type Resolution as Resolution, + type SupportedModel as SupportedModel, + type TimeSeriesPoint as TimeSeriesPoint, + type ToolBreakdown as ToolBreakdown, + type UsageGetAdoptionUsageSummaryResponse as UsageGetAdoptionUsageSummaryResponse, + type UsageGetAgentTraceSummaryResponse as UsageGetAgentTraceSummaryResponse, + type UsageGetAgentTraceTimeSeriesResponse as UsageGetAgentTraceTimeSeriesResponse, + type UsageGetCoAuthorSummaryResponse as UsageGetCoAuthorSummaryResponse, + type UsageGetCoAuthorTimeSeriesResponse as UsageGetCoAuthorTimeSeriesResponse, + type UsageGetPrSummaryResponse as UsageGetPrSummaryResponse, + type UsageGetPrTimeSeriesResponse as UsageGetPrTimeSeriesResponse, type EnvironmentUsageRecordsRecordsPage as EnvironmentUsageRecordsRecordsPage, + type UsageGetAdoptionUsageSummaryParams as UsageGetAdoptionUsageSummaryParams, + type UsageGetAgentTraceSummaryParams as UsageGetAgentTraceSummaryParams, + type UsageGetAgentTraceTimeSeriesParams as UsageGetAgentTraceTimeSeriesParams, + type UsageGetCoAuthorSummaryParams as UsageGetCoAuthorSummaryParams, + type UsageGetCoAuthorTimeSeriesParams as UsageGetCoAuthorTimeSeriesParams, + type UsageGetPrSummaryParams as UsageGetPrSummaryParams, + type UsageGetPrTimeSeriesParams as UsageGetPrTimeSeriesParams, type UsageListEnvironmentRuntimeRecordsParams as UsageListEnvironmentRuntimeRecordsParams, }; @@ -1746,13 +1960,19 @@ export declare namespace Gitpod { }; export type AutomationTrigger = API.AutomationTrigger; + export type CodexOpenAIModel = API.CodexOpenAIModel; + export type CodexReasoningEffort = API.CodexReasoningEffort; + export type CodexServiceTier = API.CodexServiceTier; + export type CodexSettings = API.CodexSettings; export type CountResponseRelation = API.CountResponseRelation; + export type DateRange = API.DateRange; export type EnvironmentClass = API.EnvironmentClass; export type EnvironmentVariableItem = API.EnvironmentVariableItem; export type EnvironmentVariableSource = API.EnvironmentVariableSource; export type ErrorCode = API.ErrorCode; export type FieldValue = API.FieldValue; export type Gateway = API.Gateway; + export type KernelControlsAction = API.KernelControlsAction; export type OrganizationRole = API.OrganizationRole; export type OrganizationTier = API.OrganizationTier; export type Principal = API.Principal; diff --git a/src/core/pagination.ts b/src/core/pagination.ts index d3e0bc6f..80410c7b 100644 --- a/src/core/pagination.ts +++ b/src/core/pagination.ts @@ -889,6 +889,61 @@ export class MembersPage extends AbstractPage implements MembersPage } } +export interface OrganizationsPageResponse { + organizations: Array; + + pagination: OrganizationsPageResponse.Pagination; +} + +export namespace OrganizationsPageResponse { + export interface Pagination { + nextToken?: string; + } +} + +export interface OrganizationsPageParams { + pageSize?: number; + + token?: string; +} + +export class OrganizationsPage extends AbstractPage implements OrganizationsPageResponse { + organizations: Array; + + pagination: OrganizationsPageResponse.Pagination; + + constructor( + client: Gitpod, + response: Response, + body: OrganizationsPageResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.organizations = body.organizations || []; + this.pagination = body.pagination || {}; + } + + getPaginatedItems(): Item[] { + return this.organizations ?? []; + } + + nextPageRequestOptions(): PageRequestOptions | null { + const cursor = this.pagination?.nextToken; + if (!cursor) { + return null; + } + + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + token: cursor, + }, + }; + } +} + export interface OutputsPageResponse { outputs: Array; @@ -1558,6 +1613,64 @@ export class SecretsPage extends AbstractPage implements SecretsPage } } +export interface SecurityPoliciesPageResponse { + pagination: SecurityPoliciesPageResponse.Pagination; + + securityPolicies: Array; +} + +export namespace SecurityPoliciesPageResponse { + export interface Pagination { + nextToken?: string; + } +} + +export interface SecurityPoliciesPageParams { + pageSize?: number; + + token?: string; +} + +export class SecurityPoliciesPage + extends AbstractPage + implements SecurityPoliciesPageResponse +{ + pagination: SecurityPoliciesPageResponse.Pagination; + + securityPolicies: Array; + + constructor( + client: Gitpod, + response: Response, + body: SecurityPoliciesPageResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.pagination = body.pagination || {}; + this.securityPolicies = body.securityPolicies || []; + } + + getPaginatedItems(): Item[] { + return this.securityPolicies ?? []; + } + + nextPageRequestOptions(): PageRequestOptions | null { + const cursor = this.pagination?.nextToken; + if (!cursor) { + return null; + } + + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + token: cursor, + }, + }; + } +} + export interface ServicesPageResponse { pagination: ServicesPageResponse.Pagination; @@ -1781,6 +1894,61 @@ export class TasksPage extends AbstractPage implements TasksPageResp } } +export interface TeamUsagePageResponse { + pagination: TeamUsagePageResponse.Pagination; + + teamUsage: Array; +} + +export namespace TeamUsagePageResponse { + export interface Pagination { + nextToken?: string; + } +} + +export interface TeamUsagePageParams { + pageSize?: number; + + token?: string; +} + +export class TeamUsagePage extends AbstractPage implements TeamUsagePageResponse { + pagination: TeamUsagePageResponse.Pagination; + + teamUsage: Array; + + constructor( + client: Gitpod, + response: Response, + body: TeamUsagePageResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.pagination = body.pagination || {}; + this.teamUsage = body.teamUsage || []; + } + + getPaginatedItems(): Item[] { + return this.teamUsage ?? []; + } + + nextPageRequestOptions(): PageRequestOptions | null { + const cursor = this.pagination?.nextToken; + if (!cursor) { + return null; + } + + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + token: cursor, + }, + }; + } +} + export interface TokensPageResponse { pagination: TokensPageResponse.Pagination; @@ -1836,6 +2004,61 @@ export class TokensPage extends AbstractPage implements TokensPageRe } } +export interface UserUsagePageResponse { + pagination: UserUsagePageResponse.Pagination; + + userUsage: Array; +} + +export namespace UserUsagePageResponse { + export interface Pagination { + nextToken?: string; + } +} + +export interface UserUsagePageParams { + pageSize?: number; + + token?: string; +} + +export class UserUsagePage extends AbstractPage implements UserUsagePageResponse { + pagination: UserUsagePageResponse.Pagination; + + userUsage: Array; + + constructor( + client: Gitpod, + response: Response, + body: UserUsagePageResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.pagination = body.pagination || {}; + this.userUsage = body.userUsage || []; + } + + getPaginatedItems(): Item[] { + return this.userUsage ?? []; + } + + nextPageRequestOptions(): PageRequestOptions | null { + const cursor = this.pagination?.nextToken; + if (!cursor) { + return null; + } + + return { + ...this.options, + query: { + ...maybeObj(this.options.query), + token: cursor, + }, + }; + } +} + export interface WarmPoolsPageResponse { pagination: WarmPoolsPageResponse.Pagination; diff --git a/src/internal/types.ts b/src/internal/types.ts index b668dfc0..a050513a 100644 --- a/src/internal/types.ts +++ b/src/internal/types.ts @@ -40,7 +40,6 @@ type OverloadedParameters = : T extends (...args: infer A) => unknown ? A : never; -/* eslint-disable */ /** * These imports attempt to get types from a parent package's dependencies. * Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which @@ -63,19 +62,18 @@ type OverloadedParameters = * * [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition */ -/** @ts-ignore For users with \@types/node */ +/** @ts-ignore For users with \@types/node */ /* prettier-ignore */ type UndiciTypesRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; -/** @ts-ignore For users with undici */ +/** @ts-ignore For users with undici */ /* prettier-ignore */ type UndiciRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; -/** @ts-ignore For users with \@types/bun */ +/** @ts-ignore For users with \@types/bun */ /* prettier-ignore */ type BunRequestInit = globalThis.FetchRequestInit; -/** @ts-ignore For users with node-fetch@2 */ +/** @ts-ignore For users with node-fetch@2 */ /* prettier-ignore */ type NodeFetch2RequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; -/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ +/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ /* prettier-ignore */ type NodeFetch3RequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; -/** @ts-ignore For users who use Deno */ +/** @ts-ignore For users who use Deno */ /* prettier-ignore */ type FetchRequestInit = NonNullable[1]>; -/* eslint-enable */ type RequestInits = | NotAny diff --git a/src/internal/utils/env.ts b/src/internal/utils/env.ts index 2d848007..cc5fa0fa 100644 --- a/src/internal/utils/env.ts +++ b/src/internal/utils/env.ts @@ -9,10 +9,10 @@ */ export const readEnv = (env: string): string | undefined => { if (typeof (globalThis as any).process !== 'undefined') { - return (globalThis as any).process.env?.[env]?.trim() ?? undefined; + return (globalThis as any).process.env?.[env]?.trim() || undefined; } if (typeof (globalThis as any).Deno !== 'undefined') { - return (globalThis as any).Deno.env?.get?.(env)?.trim(); + return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined; } return undefined; }; diff --git a/src/internal/utils/log.ts b/src/internal/utils/log.ts index ce9d0523..21ff220a 100644 --- a/src/internal/utils/log.ts +++ b/src/internal/utils/log.ts @@ -107,6 +107,8 @@ export const formatRequestDetails = (details: { name, ( name.toLowerCase() === 'authorization' || + name.toLowerCase() === 'api-key' || + name.toLowerCase() === 'x-api-key' || name.toLowerCase() === 'cookie' || name.toLowerCase() === 'set-cookie' ) ? diff --git a/src/resources/agents.ts b/src/resources/agents.ts index 27755f1c..688c3120 100644 --- a/src/resources/agents.ts +++ b/src/resources/agents.ts @@ -3,6 +3,7 @@ import { APIResource } from '../core/resource'; import * as AgentsAPI from './agents'; import * as Shared from './shared'; +import * as UsageAPI from './usage'; import { APIPromise } from '../core/api-promise'; import { AgentExecutionsPage, @@ -730,8 +731,6 @@ export namespace AgentExecution { limits?: Spec.Limits; - loopConditions?: Array; - session?: string; /** @@ -750,14 +749,6 @@ export namespace AgentExecution { maxOutputTokens?: string; } - - export interface LoopCondition { - id?: string; - - description?: string; - - expression?: string; - } } /** @@ -802,6 +793,11 @@ export namespace AgentExecution { | 'AGENT_EXECUTION_FAILURE_REASON_INTERNAL' | 'AGENT_EXECUTION_FAILURE_REASON_AGENT_EXECUTION'; + /** + * goal projects the current agent goal, if any. + */ + goal?: Status.Goal; + inputTokensUsed?: string; iterations?: string; @@ -851,28 +847,7 @@ export namespace AgentExecution { /** * supported_model is the LLM model being used by the agent execution. */ - supportedModel?: - | 'SUPPORTED_MODEL_UNSPECIFIED' - | 'SUPPORTED_MODEL_SONNET_3_5' - | 'SUPPORTED_MODEL_SONNET_3_7' - | 'SUPPORTED_MODEL_SONNET_3_7_EXTENDED' - | 'SUPPORTED_MODEL_SONNET_4' - | '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' - | 'SUPPORTED_MODEL_OPENAI_O1_MINI'; + supportedModel?: UsageAPI.SupportedModel; /** * transcript_url is the URL to the LLM transcript (all messages exchanged between @@ -921,6 +896,47 @@ export namespace AgentExecution { } } + /** + * goal projects the current agent goal, if any. + */ + export interface Goal { + /** + * created_at is when the current goal was created, when available. + */ + createdAt?: string; + + /** + * objective is the current goal text tracked by the agent. + */ + objective?: string; + + /** + * status is the lifecycle state of the current goal. + */ + status?: AgentsAPI.GoalStatus; + + /** + * time_used is the elapsed wall-clock time reported by the agent for this goal. + */ + timeUsed?: string; + + /** + * token_budget is the token budget reported by the agent for this goal, when one + * exists. + */ + tokenBudget?: string | null; + + /** + * tokens_used is the token usage reported by the agent for this goal. + */ + tokensUsed?: string; + + /** + * updated_at is the most recent goal update timestamp, when available. + */ + updatedAt?: string; + } + /** * MCPIntegrationStatus represents the status of a single MCP integration within an * agent execution context @@ -997,7 +1013,17 @@ export type AgentMode = | 'AGENT_MODE_EXECUTION' | 'AGENT_MODE_PLANNING' | 'AGENT_MODE_RALPH' - | 'AGENT_MODE_SPEC'; + | 'AGENT_MODE_SPEC' + | 'AGENT_MODE_GOAL'; + +export type GoalStatus = + | 'GOAL_STATUS_UNSPECIFIED' + | 'GOAL_STATUS_ACTIVE' + | 'GOAL_STATUS_PAUSED' + | 'GOAL_STATUS_COMPLETED' + | 'GOAL_STATUS_BUDGET_EXHAUSTED' + | 'GOAL_STATUS_BLOCKED' + | 'GOAL_STATUS_USAGE_LIMITED'; export interface Prompt { id?: string; @@ -1320,11 +1346,29 @@ export namespace UserInputBlock { } } +/** + * UserInputMetadata carries integration-specific context for a user input. + * Internal only — not exposed in public SDKs. External API consumers should not + * set these fields; they are populated by integration handlers. + */ +export interface UserInputMetadata { + /** + * Origin of this input — set by integration handlers to their host (e.g. + * "github.com", "slack.com"). Empty for non-integration callers. This field drives + * emission gating: when set, agent responses are only emitted to the matching + * integration. Treated as trusted input from integration handlers; not validated + * against registered hosts. + */ + source?: string; +} + /** * 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 { + devcontainerRebuild?: WakeEvent.DevcontainerRebuild; + environment?: WakeEvent.Environment; /** @@ -1338,6 +1382,19 @@ export interface WakeEvent { } export namespace WakeEvent { + export interface DevcontainerRebuild { + environmentId?: string; + + failureMessage?: Array; + + /** + * The devcontainer phase reached by the target session. + */ + phase?: string; + + sessionId?: string; + } + export interface Environment { environmentId?: string; @@ -1453,6 +1510,12 @@ export interface AgentListExecutionsParams extends AgentExecutionsPageParams { export namespace AgentListExecutionsParams { export interface Filter { + /** + * agent_execution_ids filters the response to only the specified executions. + * Useful for checking existence of a known set of execution IDs. + */ + agentExecutionIds?: Array; + agentIds?: Array; /** @@ -1567,6 +1630,12 @@ export interface AgentSendToExecutionParams { */ agentMessage?: AgentMessage; + /** + * codex_settings contains per-turn desired settings for Codex app user_input + * sends. + */ + codexSettings?: Shared.CodexSettings; + userInput?: UserInputBlock; /** @@ -1577,6 +1646,11 @@ export interface AgentSendToExecutionParams { } export interface AgentStartExecutionParams { + /** + * agent_id identifies the agent to start. If omitted, the backend uses the + * configured default agent ID, or the Ona in-environment agent when no default is + * configured. + */ agentId?: string; /** @@ -1588,6 +1662,11 @@ export interface AgentStartExecutionParams { codeContext?: AgentCodeContext; + /** + * codex_settings contains desired manual settings for the Codex app agent. + */ + codexSettings?: Shared.CodexSettings; + /** * mode specifies the operational mode for this agent execution If not specified, * defaults to AGENT_MODE_EXECUTION @@ -1690,12 +1769,14 @@ export declare namespace Agents { type AgentExecution as AgentExecution, type AgentMessage as AgentMessage, type AgentMode as AgentMode, + type GoalStatus as GoalStatus, 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 UserInputMetadata as UserInputMetadata, type WakeEvent as WakeEvent, type AgentCreateExecutionConversationTokenResponse as AgentCreateExecutionConversationTokenResponse, type AgentCreatePromptResponse as AgentCreatePromptResponse, diff --git a/src/resources/automations.ts b/src/resources/automations.ts index 9646efdb..bb3a7535 100644 --- a/src/resources/automations.ts +++ b/src/resources/automations.ts @@ -2144,8 +2144,6 @@ export interface WorkflowStep { */ pullRequest?: WorkflowStep.PullRequest; - report?: WorkflowStep.Report; - /** * WorkflowTaskStep represents a task step that executes a command. */ @@ -2201,21 +2199,6 @@ export namespace WorkflowStep { 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. */ @@ -2264,6 +2247,8 @@ export interface WorkflowTrigger { * - Manual: Can use any context type * - Time: Typically uses Projects or Repositories context * - PullRequest: Can use any context, FromTrigger uses PR repository context + * - Incident: Typically uses Projects or Repositories context (no inherent repo + * context) */ context: WorkflowTriggerContext; @@ -2300,8 +2285,16 @@ export namespace WorkflowTrigger { | 'PULL_REQUEST_EVENT_MERGED' | 'PULL_REQUEST_EVENT_CLOSED' | 'PULL_REQUEST_EVENT_READY_FOR_REVIEW' + | 'PULL_REQUEST_EVENT_REVIEW_REQUESTED' >; + /** + * integration_id is the optional ID of an integration that acts as the source of + * webhook events. When set, the trigger will be activated when the webhook + * receives events. + */ + integrationId?: string | null; + /** * 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 @@ -2341,6 +2334,8 @@ export namespace WorkflowTrigger { * - Manual: Can use any context type * - Time: Typically uses Projects or Repositories context * - PullRequest: Can use any context, FromTrigger uses PR repository context + * - Incident: Typically uses Projects or Repositories context (no inherent repo + * context) */ export interface WorkflowTriggerContext { /** @@ -2514,6 +2509,12 @@ export interface AutomationCreateParams { */ action: WorkflowAction; + /** + * Codex app agent settings. Only meaningful when agent_id refers to the Codex app + * agent. + */ + codexSettings?: Shared.CodexSettings; + /** * Description must be at most 500 characters: * @@ -2563,6 +2564,12 @@ export interface AutomationUpdateParams { */ action?: WorkflowAction | null; + /** + * Codex app agent settings. Only meaningful when agent_id refers to the Codex app + * agent. + */ + codexSettings?: Shared.CodexSettings | null; + /** * Description must be at most 500 characters: * diff --git a/src/resources/billing.ts b/src/resources/billing.ts new file mode 100644 index 00000000..a38f6043 --- /dev/null +++ b/src/resources/billing.ts @@ -0,0 +1,1349 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../core/resource'; +import * as Shared from './shared'; +import { APIPromise } from '../core/api-promise'; +import { + PagePromise, + TeamUsagePage, + type TeamUsagePageParams, + UserUsagePage, + type UserUsagePageParams, +} from '../core/pagination'; +import { RequestOptions } from '../internal/request-options'; + +/** + * BillingService provides billing and subscription management functionality. + */ +export class Billing extends APIResource { + /** + * Returns a signed download URL for a CSV export of credit usage. + * + * The URL points to an HTTP endpoint that streams gzip-compressed CSV and is valid + * for five minutes. The download must be made by the same principal that requested + * it, carrying its own bearer token. The export range may cover up to a year. + * + * For organizations without enterprise credit usage enabled (no billing contract + * start date), the export instead contains BYOK cost usage with a different column + * set, and groupBy=RESOURCE is rejected. + * + * Use this method to: + * + * - Export per-user daily credit usage for external reporting + * - Export a per-environment and per-conversation resource breakdown + * + * ### Examples + * + * - Export January's daily summary: + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-01-31T00:00:00Z" + * groupBy: CREDIT_USAGE_EXPORT_GROUP_BY_DAILY_SUMMARY + * ``` + * + * ### Authorization + * + * Requires `billing:read_usage` permission on the organization. + * + * @example + * ```ts + * const response = await client.billing.getCreditUsageExport({ + * dateRange: { + * endTime: '2024-01-31T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * groupBy: 'CREDIT_USAGE_EXPORT_GROUP_BY_DAILY_SUMMARY', + * }); + * ``` + */ + getCreditUsageExport( + body: BillingGetCreditUsageExportParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.BillingService/GetCreditUsageExport', { body, ...options }); + } + + /** + * Returns a daily credit usage report for an enterprise organization. + * + * Each day reports org-wide credits by usage type, plus per-user, per-team, + * per-environment, and per-conversation breakdowns (top consumers with the + * remainder aggregated into an "Others" bucket) and a per-model breakdown of + * intelligence usage. + * + * Use this method to: + * + * - Chart daily credit consumption over a date range + * - Attribute credit usage to users, teams, environments, and conversations + * - Restrict the report to a single user or service account + * + * ### Examples + * + * - Get the report for January: + * + * Both dates are inclusive and the range must not exceed 31 days. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-01-31T00:00:00Z" + * ``` + * + * ### Authorization + * + * Requires `billing:read_usage` permission on the organization. A user without it + * can read their own usage by setting filter.subject to their own user identity; + * this self-access path is not available to service accounts. + * + * @example + * ```ts + * const response = await client.billing.getCreditUsageReport({ + * dateRange: { + * endTime: '2024-01-31T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * }); + * ``` + */ + getCreditUsageReport( + body: BillingGetCreditUsageReportParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.BillingService/GetCreditUsageReport', { body, ...options }); + } + + /** + * Returns cumulative credit usage for an organization and its teams. + * + * Use this method to: + * + * - Get the total cumulative credit consumption as of a point in time + * - Get per-team cumulative usage with credit allocation (budget) comparison + * - Display team credit summaries on the usage page and team detail page + * - Display user budget utilization when user budgets are enabled + * + * ### Examples + * + * - Get current cumulative usage: + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * ``` + * + * - Get cumulative usage as of a specific date: + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * asOf: "2026-03-31T23:59:59Z" + * ``` + * + * ### Authorization + * + * Requires `billing:read_usage` permission on the organization. + * + * @example + * ```ts + * const response = + * await client.billing.getCumulativeCreditUsage({ + * organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * asOf: '2026-03-31T23:59:59Z', + * }); + * ``` + */ + getCumulativeCreditUsage( + body: BillingGetCumulativeCreditUsageParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.BillingService/GetCumulativeCreditUsage', { body, ...options }); + } + + /** + * Returns organization-level enterprise AI usage totals for reporting. + * + * Reports BYOK (bring-your-own-key) token spend: cost in the organization's + * billing currency plus token counts, with a per-model breakdown. Credit-based + * usage from managed models is not included and the credits field is not populated + * by this endpoint. + * + * Use this method to: + * + * - Report total BYOK AI spend (cost and tokens) for a date range + * - Break down organization usage by model + * + * Only available for enterprise organizations. + * + * ### Examples + * + * - Get usage totals for January: + * + * Returns organization-wide BYOK spend for the month. Both dates are inclusive + * and the range must not exceed 31 days. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-01-31T00:00:00Z" + * ``` + * + * ### Authorization + * + * Requires `billing:read_usage` permission on the organization. + * + * @example + * ```ts + * const response = + * await client.billing.getEnterpriseAIUsageSummary({ + * dateRange: { + * endTime: '2024-01-31T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * }); + * ``` + */ + getEnterpriseAIUsageSummary( + body: BillingGetEnterpriseAIUsageSummaryParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.BillingService/GetEnterpriseAIUsageSummary', { body, ...options }); + } + + /** + * Returns daily enterprise AI usage totals for the organization. + * + * Each day reports BYOK token spend (cost and tokens) with per-user, per-team, and + * per-model breakdowns. Per-user entries cover the top spenders with the remainder + * aggregated into an "Others" bucket; usage not attributed to a user or service + * account appears only in the daily totals. The credits field is not populated by + * this endpoint. + * + * When filter.subject is set the response contains only that subject's usage: + * daily totals and the team breakdown are omitted, and the model breakdown covers + * the subject only. + * + * Use this method to: + * + * - Chart daily BYOK AI spend over a date range + * - Feed daily per-user usage into external dashboards + * - Restrict the response to a single user or service account + * + * Only available for enterprise organizations. + * + * ### Examples + * + * - Get daily usage for January: + * + * Returns one entry per day with per-user, per-team, and per-model breakdowns. + * Both dates are inclusive and the range must not exceed 31 days. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-01-31T00:00:00Z" + * ``` + * + * ### Authorization + * + * Requires `billing:read_usage` permission on the organization. + * + * @example + * ```ts + * const response = + * await client.billing.getEnterpriseAIUsageTimeSeries({ + * dateRange: { + * endTime: '2024-01-31T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * }); + * ``` + */ + getEnterpriseAIUsageTimeSeries( + body: BillingGetEnterpriseAIUsageTimeSeriesParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.BillingService/GetEnterpriseAIUsageTimeSeries', { + body, + ...options, + }); + } + + /** + * Lists enterprise AI usage grouped by team. + * + * Reports BYOK token spend per team (cost and tokens) with each team's monthly + * budget when one applies. The credits field is not populated by this endpoint. + * + * Use this method to: + * + * - Compare BYOK AI spend across teams + * - Track team budget utilization + * - Filter usage to specific teams + * + * Only available for enterprise organizations. + * + * ### Examples + * + * - List team usage for January: + * + * Returns BYOK spend per team with monthly budgets. Both dates are inclusive and + * the range must not exceed 31 days. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-01-31T00:00:00Z" + * ``` + * + * ### Authorization + * + * Requires `billing:read_usage` permission on the organization. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const teamEnterpriseAIUsage of client.billing.listEnterpriseAITeamUsage( + * { + * dateRange: { + * endTime: '2024-01-31T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * }, + * )) { + * // ... + * } + * ``` + */ + listEnterpriseAITeamUsage( + params: BillingListEnterpriseAITeamUsageParams, + options?: RequestOptions, + ): PagePromise { + const { token, pageSize, ...body } = params; + return this._client.getAPIList( + '/gitpod.v1.BillingService/ListEnterpriseAITeamUsage', + TeamUsagePage, + { query: { token, pageSize }, body, method: 'post', ...options }, + ); + } + + /** + * Lists enterprise AI usage grouped by user with effective monthly budget data. + * + * Reports BYOK token spend (cost and tokens) for each user and service account + * with attributed usage in the date range, including each subject's effective + * monthly budget. Usage not attributed to a user or service account is excluded, + * so the sum across subjects can be less than the organization totals from + * GetEnterpriseAIUsageSummary. The credits field is not populated by this + * endpoint. + * + * Budget fields (month_to_date_usage, utilization_percent, over_budget) are + * computed from usage inside the requested date range measured against the monthly + * limit. Send a range that starts on the first day of the month for true + * month-to-date figures. + * + * Use this method to: + * + * - Export per-user BYOK AI spend to external reporting + * - Identify the highest spenders in the organization + * - Track per-user budget utilization and over-budget users + * + * Only available for enterprise organizations. + * + * ### Examples + * + * - List user usage for January: + * + * Returns per-user BYOK spend with effective budgets, highest spend first. Both + * dates are inclusive and the range must not exceed 31 days. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-01-31T00:00:00Z" + * ``` + * + * ### Authorization + * + * Requires `billing:read_usage` permission on the organization. Callers without it + * can read their own usage by setting filter.subject to themselves. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const userCostBudgetUsage of client.billing.listEnterpriseAIUserUsage( + * { + * dateRange: { + * endTime: '2024-01-31T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * }, + * )) { + * // ... + * } + * ``` + */ + listEnterpriseAIUserUsage( + params: BillingListEnterpriseAIUserUsageParams, + options?: RequestOptions, + ): PagePromise { + const { token, pageSize, ...body } = params; + return this._client.getAPIList( + '/gitpod.v1.BillingService/ListEnterpriseAIUserUsage', + UserUsagePage, + { query: { token, pageSize }, body, method: 'post', ...options }, + ); + } + + /** + * Lists per-user month-to-date credit usage with effective monthly budgets. + * + * Results are ordered by total credits descending so the highest spenders appear + * first, with user_id as a stable tiebreaker. Use cursor pagination to walk the + * full set for large organizations. + * + * The default SORT_FIELD_USAGE ordering supports cursor pagination over any number + * of users. Sorting by display name, budget, or budget utilization computes the + * order in memory and is limited to organizations with at most 10,000 users; + * beyond that, use SORT_FIELD_USAGE. Because month-to-date figures are recomputed + * per request, hold a date range stable across a paginated walk to keep page + * tokens valid. + * + * Use this method to: + * + * - Export per-user credit usage to external reporting + * - Identify the highest spenders in the organization + * - Track per-user budget utilization and over-budget users + * + * ### Examples + * + * - List user usage for the current month: + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * pagination: + * pageSize: 50 + * ``` + * + * ### Authorization + * + * Requires `billing:read_usage` permission on the organization. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const userCreditBudgetUsage of client.billing.listEnterpriseUserCreditUsage( + * { + * organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * pagination: { pageSize: 50 }, + * }, + * )) { + * // ... + * } + * ``` + */ + listEnterpriseUserCreditUsage( + params: BillingListEnterpriseUserCreditUsageParams, + options?: RequestOptions, + ): PagePromise { + const { token, pageSize, ...body } = params; + return this._client.getAPIList( + '/gitpod.v1.BillingService/ListEnterpriseUserCreditUsage', + UserUsagePage, + { query: { token, pageSize }, body, method: 'post', ...options }, + ); + } +} + +export type TeamEnterpriseAIUsagesTeamUsagePage = TeamUsagePage; + +export type UserCostBudgetUsagesUserUsagePage = UserUsagePage; + +export type UserCreditBudgetUsagesUserUsagePage = UserUsagePage; + +/** + * AgentExecutionCreditUsage contains a single agent execution's credit usage for a + * day, broken down by type. + */ +export interface AgentExecutionCreditUsage { + /** + * Empty when representing the "Others" aggregation bucket. + */ + agentExecutionId?: string; + + displayName?: string; + + usage?: Array; +} + +export type BillingCurrency = + | 'BILLING_CURRENCY_UNSPECIFIED' + | 'BILLING_CURRENCY_USD' + | 'BILLING_CURRENCY_EUR' + | 'BILLING_CURRENCY_GBP'; + +export type ByokRateCardTokenType = + | 'BYOK_RATE_CARD_TOKEN_TYPE_UNSPECIFIED' + | 'BYOK_RATE_CARD_TOKEN_TYPE_INPUT' + | 'BYOK_RATE_CARD_TOKEN_TYPE_OUTPUT' + | 'BYOK_RATE_CARD_TOKEN_TYPE_CACHE_READ' + | 'BYOK_RATE_CARD_TOKEN_TYPE_CACHE_WRITE'; + +/** + * How to group the credit usage export data. + */ +export type CreditUsageExportGroupBy = + | 'CREDIT_USAGE_EXPORT_GROUP_BY_UNSPECIFIED' + | 'CREDIT_USAGE_EXPORT_GROUP_BY_DAILY_SUMMARY' + | 'CREDIT_USAGE_EXPORT_GROUP_BY_RESOURCE'; + +/** + * CreditUsageReportFilter narrows the data returned by GetCreditUsageReport. + * Wrapping filters in a message (rather than adding bare fields) lets future + * filters (team, environment, resource kind) be added without further breaking + * changes. + */ +export interface CreditUsageReportFilter { + /** + * Restrict the per-user breakdown to a single subject. The subject must be + * PRINCIPAL_USER or PRINCIPAL_SERVICE_ACCOUNT and belong to the request's + * organization. When unset, the report returns the default top-N users + "Others" + * breakdown. + * + * When this field is set: + * + * - daily_usage[*].user_usage contains rows only for the requested subject; no + * "Others" aggregation bucket is produced. + * - daily_usage[*].org_usage, team_usage, environment_usage, and + * conversation_usage are omitted (empty). Callers that need those sections + * should issue an unfiltered call. + * - period_start and updated_at remain populated. + */ + subject?: Shared.Subject | null; +} + +/** + * CreditsByType contains credits consumed for a single usage type. + */ +export interface CreditsByType { + credits?: number; + + /** + * UsageType identifies the category of usage. + */ + usageType?: UsageType; +} + +/** + * CumulativeCreditUsage contains cumulative credit consumption totals. + */ +export interface CumulativeCreditUsage { + /** + * Total credits consumed. + */ + totalCredits?: number; + + /** + * Credits consumed broken down by usage type. + */ + usageByType?: Array; +} + +/** + * DailyCreditUsage contains credit usage for a single day. + */ +export interface DailyCreditUsage { + /** + * Per-agent-execution usage for this day (top conversations + "Others"). Empty + * agent_execution_id represents the "Others" aggregation bucket. + */ + conversationUsage?: Array; + + /** + * Start of the day (midnight in the requested timezone). + */ + date?: string; + + /** + * Per-environment usage for this day (top environments + "Others"). Empty + * environment_id represents the "Others" aggregation bucket. + */ + environmentUsage?: Array; + + /** + * Org-wide usage broken down by type. + */ + orgUsage?: Array; + + /** + * Per-team usage for this day (top teams + "Others"). Empty team_id represents the + * "Others" aggregation bucket. + */ + teamUsage?: Array; + + /** + * Org-wide intelligence usage broken down by model. + */ + usageByModel?: Array; + + /** + * Per-user usage for this day (top users + "Others"). + */ + userUsage?: Array; +} + +export interface DailyEnterpriseAIUsage { + /** + * 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. + */ + date: string; + + /** + * budget is unset when no monthly budget applies to the organization. + */ + budget?: EnterpriseAIUsageBudget; + + teamUsage?: Array; + + usage?: EnterpriseAIUsage; + + /** + * Usage for this day broken down by model. When the request filters by subject, + * contains only that subject's model usage. + */ + usageByModel?: Array; + + userUsage?: Array; +} + +export interface EnterpriseAITokenUsage { + cacheTokens?: string; + + inputTokens?: string; + + outputTokens?: string; + + totalTokens?: string; +} + +export interface EnterpriseAIUsage { + costMicrounits?: string; + + credits?: number; + + currency?: BillingCurrency; + + tokens?: EnterpriseAITokenUsage; +} + +export interface EnterpriseAIUsageBudget { + currency?: BillingCurrency; + + monthlyCostLimitMicrounits?: string | null; + + monthlyCreditLimit?: string | null; + + monthToDateUsage?: EnterpriseAIUsage; + + source?: EnterpriseAIUsageBudgetSource; + + utilizationPercent?: number; +} + +export type EnterpriseAIUsageBudgetSource = + | 'ENTERPRISE_AI_USAGE_BUDGET_SOURCE_UNSPECIFIED' + | 'ENTERPRISE_AI_USAGE_BUDGET_SOURCE_ORGANIZATION' + | 'ENTERPRISE_AI_USAGE_BUDGET_SOURCE_TEAM'; + +export interface EnterpriseAIUsageByModel { + model?: string; + + /** + * Usage excluded from spend because no matching BYOK rate was configured. + */ + unpricedUsage?: EnterpriseAIUsage; + + unpricedUsageByTokenType?: Array; + + usage?: EnterpriseAIUsage; + + usageByTokenType?: Array; +} + +export interface EnterpriseAIUsageByTokenType { + tokenType?: ByokRateCardTokenType; + + usage?: EnterpriseAIUsage; +} + +export interface EnterpriseAIUsageTimeSeriesFilter { + /** + * Restrict the per-user breakdown to a single subject. + */ + subject?: Shared.Subject | null; +} + +export type EnterpriseAIUserBudgetPolicySource = + | 'ENTERPRISE_AI_USER_BUDGET_POLICY_SOURCE_UNSPECIFIED' + | 'ENTERPRISE_AI_USER_BUDGET_POLICY_SOURCE_NONE' + | 'ENTERPRISE_AI_USER_BUDGET_POLICY_SOURCE_ORGANIZATION' + | 'ENTERPRISE_AI_USER_BUDGET_POLICY_SOURCE_USER'; + +/** + * EnvironmentCreditUsage contains a single environment's credit usage for a day, + * broken down by type. + */ +export interface EnvironmentCreditUsage { + displayName?: string; + + /** + * Empty when representing the "Others" aggregation bucket. + */ + environmentId?: string; + + usage?: Array; +} + +/** + * TeamCreditUsage contains a single team's credit usage for a day, broken down by + * type. + */ +export interface TeamCreditUsage { + displayName?: string; + + /** + * Empty when representing the "Others" aggregation bucket. + */ + teamId?: string; + + usage?: Array; +} + +/** + * TeamCumulativeCreditUsage contains a team's cumulative credit usage and + * allocation. + */ +export interface TeamCumulativeCreditUsage { + /** + * The team's credit allocation (budget) in whole credits, if set. Not set means no + * allocation has been configured for this team. + */ + creditBudget?: string | null; + + displayName?: string; + + teamId?: string; + + /** + * Cumulative credit usage for this team. + */ + usage?: CumulativeCreditUsage; +} + +export interface TeamEnterpriseAIUsage { + /** + * budget is unset when no monthly budget applies to this team. + */ + budget?: EnterpriseAIUsageBudget; + + displayName?: string; + + teamId?: string; + + usage?: EnterpriseAIUsage; + + usageByTokenType?: Array; +} + +/** + * UsageType identifies the category of usage. + */ +export type UsageType = 'USAGE_TYPE_UNSPECIFIED' | 'USAGE_TYPE_ENVIRONMENT' | 'USAGE_TYPE_AGENTIC'; + +export interface UserCostBudgetUsage { + budgetSource?: EnterpriseAIUserBudgetPolicySource; + + currency?: BillingCurrency; + + displayName?: string; + + isServiceAccount?: boolean; + + monthlyCostLimitMicrounits?: string | null; + + /** + * Usage within the requested date range. Reflects true month-to-date usage when + * the range starts on the first day of the month. + */ + monthToDateUsage?: EnterpriseAIUsage; + + noCap?: boolean; + + overBudget?: boolean; + + userId?: string; + + utilizationPercent?: number; +} + +export interface UserCreditBudgetUsage { + budgetSource?: EnterpriseAIUserBudgetPolicySource; + + creditBudget?: string | null; + + displayName?: string; + + /** + * True when user_id refers to a service account rather than a human user. The + * dashboard uses this to mark non-human accounts in admin tables. + */ + isServiceAccount?: boolean; + + /** + * CumulativeCreditUsage contains cumulative credit consumption totals. + */ + monthToDateUsage?: CumulativeCreditUsage; + + noCap?: boolean; + + overBudget?: boolean; + + /** + * Month-to-date intelligence usage broken down by model. + */ + usageByModel?: Array; + + userId?: string; + + utilizationPercent?: number; +} + +/** + * UserCreditUsage contains a single user's credit usage, broken down by type. + */ +export interface UserCreditUsage { + displayName?: string; + + usage?: Array; + + /** + * Intelligence usage broken down by model. + */ + usageByModel?: Array; + + /** + * Empty when representing the "Others" aggregation bucket. + */ + userId?: string; +} + +export interface UserEnterpriseAIUsage { + displayName?: string; + + usage?: EnterpriseAIUsage; + + /** + * Empty when representing the "Others" aggregation bucket. + */ + userId?: string; +} + +export interface BillingGetCreditUsageExportResponse { + /** + * Signed download URL for the CSV export. Valid for five minutes, and only for the + * principal that requested it. + */ + downloadUrl?: string; +} + +export interface BillingGetCreditUsageReportResponse { + /** + * One entry per day in the requested date range. + */ + dailyUsage?: Array; + + /** + * Start of the billing period for this organization. Used by the frontend to + * filter out months before usage tracking began. + */ + periodStart?: string | null; + + /** + * When the report data was last computed. + */ + updatedAt?: string; +} + +export interface BillingGetCumulativeCreditUsageResponse { + /** + * Org-wide cumulative usage, broken down by type and total. + */ + orgUsage?: CumulativeCreditUsage; + + /** + * Start of the cumulative calculation period. Cumulative totals are computed from + * this date forward. + */ + periodStart?: string; + + /** + * Per-team cumulative usage with credit allocation comparison. Returns all teams + * (no top-N limit). + */ + teamUsage?: Array; + + /** + * Usage by members not assigned to any team. + */ + unteamedUsage?: CumulativeCreditUsage; + + /** + * Per-user month-to-date usage for every user with usage in the period. The budget + * fields on each entry are populated only when a monthly budget applies to that + * user. This list is not paginated or capped; for large organizations prefer + * ListEnterpriseUserCreditUsage. + */ + userUsage?: Array; +} + +export interface BillingGetEnterpriseAIUsageSummaryResponse { + /** + * budget is unset when no monthly budget applies to the organization. + */ + budget?: EnterpriseAIUsageBudget; + + /** + * calculated_at is the time through which usage has been calculated. Usage after + * this timestamp may still be processing. + */ + calculatedAt?: string; + + usage?: EnterpriseAIUsage; + + usageByModel?: Array; +} + +export interface BillingGetEnterpriseAIUsageTimeSeriesResponse { + /** + * calculated_at is the time through which usage has been calculated. Usage after + * this timestamp may still be processing. + */ + calculatedAt?: string; + + dailyUsage?: Array; +} + +export interface BillingGetCreditUsageExportParams { + /** + * Date range to export. Both start and end dates are inclusive; time-of-day is + * ignored. Unlike GetCreditUsageReport, the range may cover up to a year. + */ + dateRange: Shared.DateRange; + + organizationId: string; + + /** + * How to group the export data. Defaults to DAILY_SUMMARY. + */ + groupBy?: CreditUsageExportGroupBy; +} + +export interface BillingGetCreditUsageReportParams { + /** + * Date range for the report. Both start and end dates are inclusive. Time-of-day + * is ignored; dates are truncated to midnight in the specified timezone. The range + * must not exceed 31 days. + */ + dateRange: Shared.DateRange; + + organizationId: string; + + /** + * Optional filter narrowing the returned data. When unset or empty, the response + * preserves the default behavior (top-N users + "Others"). See + * CreditUsageReportFilter for per-field response-scoping semantics. + */ + filter?: CreditUsageReportFilter; + + /** + * IANA timezone name (e.g. "America/New_York", "Europe/Berlin") used to bucket + * daily usage. When empty, defaults to "UTC". + */ + timezone?: string; +} + +export interface BillingGetCumulativeCreditUsageParams { + /** + * organization_id is the ID of the organization to get cumulative usage for. + */ + organizationId: string; + + /** + * as_of is the point in time to compute cumulative usage up to. Defaults to now if + * not set. + */ + asOf?: string | null; +} + +export interface BillingGetEnterpriseAIUsageSummaryParams { + /** + * Date range for the summary. Both start and end dates are inclusive. Time-of-day + * is ignored; dates are truncated to midnight in the specified timezone. + */ + dateRange: Shared.DateRange; + + organizationId: string; + + /** + * IANA timezone name used to bucket usage. When empty, defaults to "UTC". + */ + timezone?: string; +} + +export interface BillingGetEnterpriseAIUsageTimeSeriesParams { + /** + * Date range for the daily usage series. Both start and end dates are inclusive. + * Time-of-day is ignored; dates are truncated to midnight in the specified + * timezone. + */ + dateRange: Shared.DateRange; + + organizationId: string; + + filter?: EnterpriseAIUsageTimeSeriesFilter; + + /** + * IANA timezone name used to bucket daily usage. When empty, defaults to "UTC". + */ + timezone?: string; +} + +export interface BillingListEnterpriseAITeamUsageParams extends TeamUsagePageParams { + /** + * Body param: Date range for the team usage list. Both start and end dates are + * inclusive. Time-of-day is ignored; dates are truncated to midnight in the + * specified timezone. + */ + dateRange: Shared.DateRange; + + /** + * Body param + */ + organizationId: string; + + /** + * Body param + */ + filter?: BillingListEnterpriseAITeamUsageParams.Filter; + + /** + * Body param + */ + pagination?: BillingListEnterpriseAITeamUsageParams.Pagination; + + /** + * Body param: IANA timezone name used to bucket usage. When empty, defaults to + * "UTC". + */ + timezone?: string; +} + +export namespace BillingListEnterpriseAITeamUsageParams { + export interface Filter { + teamIds?: 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 BillingListEnterpriseAIUserUsageParams extends UserUsagePageParams { + /** + * Body param: Date range for the user usage list. Both start and end dates are + * inclusive. Time-of-day is ignored; dates are truncated to midnight in the + * specified timezone. + */ + dateRange: Shared.DateRange; + + /** + * Body param + */ + organizationId: string; + + /** + * Body param: Optional filter narrowing the returned user usage. When set to a + * subject, the response contains only usage for that user or service account. + */ + filter?: BillingListEnterpriseAIUserUsageParams.Filter; + + /** + * Body param + */ + pagination?: BillingListEnterpriseAIUserUsageParams.Pagination; + + /** + * Body param: sort controls the ordering of results. Defaults to total spend + * descending. + */ + sort?: BillingListEnterpriseAIUserUsageParams.Sort; + + /** + * Body param: IANA timezone name used to bucket usage. When empty, defaults to + * "UTC". + */ + timezone?: string; +} + +export namespace BillingListEnterpriseAIUserUsageParams { + /** + * Optional filter narrowing the returned user usage. When set to a subject, the + * response contains only usage for that user or service account. + */ + export interface Filter { + /** + * Restrict the user usage list to a single subject. The subject must be + * PRINCIPAL_USER or PRINCIPAL_SERVICE_ACCOUNT and belong to the request's + * organization. + */ + subject?: Shared.Subject | null; + } + + 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 controls the ordering of results. Defaults to total spend descending. + */ + export interface Sort { + field?: + | 'SORT_FIELD_UNSPECIFIED' + | 'SORT_FIELD_USAGE' + | 'SORT_FIELD_DISPLAY_NAME' + | 'SORT_FIELD_BUDGET' + | 'SORT_FIELD_BUDGET_USED'; + + order?: Shared.SortOrder; + } +} + +export interface BillingListEnterpriseUserCreditUsageParams extends UserUsagePageParams { + /** + * Body param: organization_id is the ID of the organization to list user credit + * usage for. + */ + organizationId: string; + + /** + * Body param: as_of is the point in time to compute month-to-date usage up to. + * Defaults to now if not set. + */ + asOf?: string | null; + + /** + * Body param + */ + pagination?: BillingListEnterpriseUserCreditUsageParams.Pagination; + + /** + * Body param: sort controls the ordering of results. Defaults to total credits + * descending. + */ + sort?: BillingListEnterpriseUserCreditUsageParams.Sort; +} + +export namespace BillingListEnterpriseUserCreditUsageParams { + 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 controls the ordering of results. Defaults to total credits descending. + */ + export interface Sort { + field?: + | 'SORT_FIELD_UNSPECIFIED' + | 'SORT_FIELD_USAGE' + | 'SORT_FIELD_DISPLAY_NAME' + | 'SORT_FIELD_BUDGET' + | 'SORT_FIELD_BUDGET_USED'; + + order?: Shared.SortOrder; + } +} + +export declare namespace Billing { + export { + type AgentExecutionCreditUsage as AgentExecutionCreditUsage, + type BillingCurrency as BillingCurrency, + type ByokRateCardTokenType as ByokRateCardTokenType, + type CreditUsageExportGroupBy as CreditUsageExportGroupBy, + type CreditUsageReportFilter as CreditUsageReportFilter, + type CreditsByType as CreditsByType, + type CumulativeCreditUsage as CumulativeCreditUsage, + type DailyCreditUsage as DailyCreditUsage, + type DailyEnterpriseAIUsage as DailyEnterpriseAIUsage, + type EnterpriseAITokenUsage as EnterpriseAITokenUsage, + type EnterpriseAIUsage as EnterpriseAIUsage, + type EnterpriseAIUsageBudget as EnterpriseAIUsageBudget, + type EnterpriseAIUsageBudgetSource as EnterpriseAIUsageBudgetSource, + type EnterpriseAIUsageByModel as EnterpriseAIUsageByModel, + type EnterpriseAIUsageByTokenType as EnterpriseAIUsageByTokenType, + type EnterpriseAIUsageTimeSeriesFilter as EnterpriseAIUsageTimeSeriesFilter, + type EnterpriseAIUserBudgetPolicySource as EnterpriseAIUserBudgetPolicySource, + type EnvironmentCreditUsage as EnvironmentCreditUsage, + type TeamCreditUsage as TeamCreditUsage, + type TeamCumulativeCreditUsage as TeamCumulativeCreditUsage, + type TeamEnterpriseAIUsage as TeamEnterpriseAIUsage, + type UsageType as UsageType, + type UserCostBudgetUsage as UserCostBudgetUsage, + type UserCreditBudgetUsage as UserCreditBudgetUsage, + type UserCreditUsage as UserCreditUsage, + type UserEnterpriseAIUsage as UserEnterpriseAIUsage, + type BillingGetCreditUsageExportResponse as BillingGetCreditUsageExportResponse, + type BillingGetCreditUsageReportResponse as BillingGetCreditUsageReportResponse, + type BillingGetCumulativeCreditUsageResponse as BillingGetCumulativeCreditUsageResponse, + type BillingGetEnterpriseAIUsageSummaryResponse as BillingGetEnterpriseAIUsageSummaryResponse, + type BillingGetEnterpriseAIUsageTimeSeriesResponse as BillingGetEnterpriseAIUsageTimeSeriesResponse, + type TeamEnterpriseAIUsagesTeamUsagePage as TeamEnterpriseAIUsagesTeamUsagePage, + type UserCostBudgetUsagesUserUsagePage as UserCostBudgetUsagesUserUsagePage, + type UserCreditBudgetUsagesUserUsagePage as UserCreditBudgetUsagesUserUsagePage, + type BillingGetCreditUsageExportParams as BillingGetCreditUsageExportParams, + type BillingGetCreditUsageReportParams as BillingGetCreditUsageReportParams, + type BillingGetCumulativeCreditUsageParams as BillingGetCumulativeCreditUsageParams, + type BillingGetEnterpriseAIUsageSummaryParams as BillingGetEnterpriseAIUsageSummaryParams, + type BillingGetEnterpriseAIUsageTimeSeriesParams as BillingGetEnterpriseAIUsageTimeSeriesParams, + type BillingListEnterpriseAITeamUsageParams as BillingListEnterpriseAITeamUsageParams, + type BillingListEnterpriseAIUserUsageParams as BillingListEnterpriseAIUserUsageParams, + type BillingListEnterpriseUserCreditUsageParams as BillingListEnterpriseUserCreditUsageParams, + }; +} diff --git a/src/resources/environments/automations/automations.ts b/src/resources/environments/automations/automations.ts index 88608942..2ef56e21 100644 --- a/src/resources/environments/automations/automations.ts +++ b/src/resources/environments/automations/automations.ts @@ -141,11 +141,72 @@ export namespace AutomationsFile { name?: string; + /** + * A Duration represents a signed, fixed-length span of time represented as a count + * of seconds and fractions of seconds at nanosecond resolution. It is independent + * of any calendar and concepts like "day" or "month". It is related to Timestamp + * in that the difference between two Timestamp values is a Duration and it can be + * added or subtracted from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an object, + * where the string ends in the suffix "s" (indicating seconds) and is preceded by + * the number of seconds, with nanoseconds expressed as fractional seconds. For + * example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + * while 3 seconds and 1 nanosecond should be expressed in JSON format as + * "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + * format as "3.000001s". + */ + readinessTimeout?: string; + role?: '' | 'default' | 'editor' | 'ai-agent'; runsOn?: Shared.RunsOn; - triggeredBy?: Array<'manual' | 'postEnvironmentStart' | 'postDevcontainerStart'>; + triggeredBy?: Array<'manual' | 'postEnvironmentStart' | 'postDevcontainerStart' | 'prebuild'>; } export namespace Services { @@ -189,6 +250,14 @@ export namespace AutomationsFile { name?: string; + /** + * prebuild_requires_success controls whether a non-successful outcome of this task + * should fail the prebuild. When true and the task is triggered by a prebuild + * trigger, any terminal phase other than SUCCEEDED will cause the prebuild to + * fail. Defaults to false. + */ + prebuildRequiresSuccess?: boolean; + runsOn?: Shared.RunsOn; triggeredBy?: Array<'manual' | 'postEnvironmentStart' | 'postDevcontainerStart' | 'prebuild'>; diff --git a/src/resources/environments/automations/services.ts b/src/resources/environments/automations/services.ts index b10dd0ce..375334cf 100644 --- a/src/resources/environments/automations/services.ts +++ b/src/resources/environments/automations/services.ts @@ -421,6 +421,12 @@ export interface ServiceSpec { */ env?: Array; + /** + * readiness_timeout is the maximum duration a service may remain in the Starting + * phase while readiness checks run. 0s disables the timeout. + */ + readinessTimeout?: string; + /** * runs_on specifies the environment the service should run on. */ @@ -590,6 +596,67 @@ export namespace ServiceUpdateParams { env?: Array; + /** + * A Duration represents a signed, fixed-length span of time represented as a count + * of seconds and fractions of seconds at nanosecond resolution. It is independent + * of any calendar and concepts like "day" or "month". It is related to Timestamp + * in that the difference between two Timestamp values is a Duration and it can be + * added or subtracted from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an object, + * where the string ends in the suffix "s" (indicating seconds) and is preceded by + * the number of seconds, with nanoseconds expressed as fractional seconds. For + * example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", + * while 3 seconds and 1 nanosecond should be expressed in JSON format as + * "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON + * format as "3.000001s". + */ + readinessTimeout?: string; + runsOn?: Shared.RunsOn | null; } diff --git a/src/resources/environments/automations/tasks/tasks.ts b/src/resources/environments/automations/tasks/tasks.ts index 16d9bf75..b68e80e2 100644 --- a/src/resources/environments/automations/tasks/tasks.ts +++ b/src/resources/environments/automations/tasks/tasks.ts @@ -341,6 +341,8 @@ export namespace TaskUpdateParams { env?: Array; + prebuildRequiresSuccess?: boolean | null; + runsOn?: Shared.RunsOn | null; } } diff --git a/src/resources/environments/environments.ts b/src/resources/environments/environments.ts index eb9d7214..7e50b130 100644 --- a/src/resources/environments/environments.ts +++ b/src/resources/environments/environments.ts @@ -5,7 +5,6 @@ import * as EnvironmentsAPI from './environments'; import * as Shared from '../shared'; import * as ClassesAPI from './classes'; import { ClassListParams, Classes } from './classes'; -import * as PoliciesAPI from '../organizations/policies'; import * as ProjectsAPI from '../projects/projects'; import * as RunnersAPI from '../runners/runners'; import * as AutomationsAPI from './automations/automations'; @@ -721,7 +720,8 @@ export type EnvironmentRole = | 'ENVIRONMENT_ROLE_UNSPECIFIED' | 'ENVIRONMENT_ROLE_DEFAULT' | 'ENVIRONMENT_ROLE_PREBUILD' - | 'ENVIRONMENT_ROLE_WORKFLOW'; + | 'ENVIRONMENT_ROLE_WORKFLOW' + | 'ENVIRONMENT_ROLE_BASE_SNAPSHOT_BUILD'; /** * EnvironmentSpec specifies the configuration of an environment for an environment @@ -1008,12 +1008,6 @@ export namespace EnvironmentSpec { * 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"). */ @@ -1291,6 +1285,12 @@ export namespace EnvironmentStatus { | 'CHANGE_TYPE_UPDATED_BUT_UNMERGED' | 'CHANGE_TYPE_UNTRACKED'; + /** + * old_path is the previous path of the file before a rename or copy. Only set when + * change_type is RENAMED or COPIED. + */ + oldPath?: string; + /** * path is the path of the file */ @@ -1581,7 +1581,7 @@ export namespace Veto { /** * action specifies what action kernel-level controls take on policy violations */ - action?: PoliciesAPI.KernelControlsAction; + action?: Shared.KernelControlsAction; /** * denylist is the list of executable paths or names to block diff --git a/src/resources/errors.ts b/src/resources/errors.ts deleted file mode 100644 index 921bcfdd..00000000 --- a/src/resources/errors.ts +++ /dev/null @@ -1,346 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -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 - * error reporting systems. The structure is fully compatible with Sentry's event - * payload format. - * - * Use this method to: - * - * - Report client-side errors and exceptions - * - Track application crashes and panics - * - Send error context and metadata for debugging - * - * ### Examples - * - * - Report a JavaScript error with Sentry-compatible structure: The service - * accepts events with comprehensive error information including stack traces, - * identity context, breadcrumbs, and metadata that align with Sentry's event - * payload format. - */ - reportErrors(body: ErrorReportErrorsParams, options?: RequestOptions): APIPromise { - return this._client.post('/gitpod.v1.ErrorsService/ReportErrors', { body, ...options }); - } -} - -/** - * Breadcrumb information (Sentry-compatible) - */ -export interface Breadcrumb { - /** - * Breadcrumb category - */ - category?: string; - - /** - * Additional breadcrumb data - */ - data?: { [key: string]: string }; - - /** - * Breadcrumb level - */ - level?: ErrorLevel; - - /** - * Breadcrumb message - */ - message?: string; - - /** - * When the breadcrumb occurred - */ - timestamp?: string; - - /** - * Breadcrumb type (e.g., "navigation", "http", "user", "error") - */ - type?: string; -} - -/** - * ErrorEvent contains comprehensive error information (Sentry-compatible) - */ -export interface ErrorEvent { - /** - * Breadcrumbs leading up to the error - */ - breadcrumbs?: Array; - - /** - * Environment (e.g., "production", "staging", "development") - */ - environment?: string; - - /** - * Unique event identifier (required by Sentry) - */ - eventId?: string; - - /** - * Exception information (primary error data) - */ - exceptions?: Array; - - /** - * Additional arbitrary metadata - */ - extra?: { [key: string]: string }; - - /** - * Custom fingerprint for grouping - */ - fingerprint?: Array; - - /** - * Identity ID of the user (UUID) - */ - identityId?: string; - - /** - * Error severity level - */ - level?: ErrorLevel; - - /** - * Logger name - */ - logger?: string; - - /** - * Modules/dependencies information - */ - modules?: { [key: string]: string }; - - /** - * Platform identifier (required by Sentry) - */ - platform?: string; - - /** - * Release version - */ - release?: string; - - /** - * Request information - */ - request?: RequestInfo; - - /** - * SDK information - */ - sdk?: { [key: string]: string }; - - /** - * Server/host name - */ - serverName?: string; - - /** - * Tags for filtering and grouping - */ - tags?: { [key: string]: string }; - - /** - * When the event occurred (required by Sentry) - */ - timestamp?: string; - - /** - * Transaction name (e.g., route name, function name) - */ - transaction?: string; -} - -/** - * Error severity levels (aligned with Sentry levels) - */ -export type ErrorLevel = - | 'ERROR_LEVEL_UNSPECIFIED' - | 'ERROR_LEVEL_DEBUG' - | 'ERROR_LEVEL_INFO' - | 'ERROR_LEVEL_WARNING' - | 'ERROR_LEVEL_ERROR' - | 'ERROR_LEVEL_FATAL'; - -/** - * Exception information (Sentry-compatible) - */ -export interface ExceptionInfo { - /** - * Exception mechanism - */ - mechanism?: ExceptionMechanism; - - /** - * Module or package where the exception type is defined - */ - module?: string; - - /** - * Stack trace frames - */ - stacktrace?: Array; - - /** - * Thread ID if applicable - */ - threadId?: string; - - /** - * Exception type/class name - */ - type?: string; - - /** - * Exception message/value - */ - value?: string; -} - -/** - * Exception mechanism information (Sentry-compatible) - */ -export interface ExceptionMechanism { - /** - * Additional mechanism-specific data - */ - data?: { [key: string]: string }; - - /** - * Human-readable description of the mechanism - */ - description?: string; - - /** - * Whether the exception was handled by user code - */ - handled?: boolean; - - /** - * Whether this is a synthetic exception (created by SDK) - */ - synthetic?: boolean; - - /** - * Type of mechanism (e.g., "generic", "promise", "onerror") - */ - type?: string; -} - -/** - * Request information (Sentry-compatible) - */ -export interface RequestInfo { - /** - * Request body (truncated if large) - */ - data?: string; - - /** - * Request headers - */ - headers?: { [key: string]: string }; - - /** - * HTTP method - */ - method?: string; - - /** - * Query parameters - */ - queryString?: { [key: string]: string }; - - /** - * Request URL - */ - url?: string; -} - -/** - * Stack trace frame information (Sentry-compatible) - */ -export interface StackFrame { - /** - * Column number in the line - */ - colno?: number; - - contextLine?: string; - - /** - * File name or path - */ - filename?: string; - - /** - * Function name - */ - function?: string; - - /** - * Whether this frame is in application code (vs library/framework code) - */ - inApp?: boolean; - - /** - * Line number in the file - */ - lineno?: number; - - /** - * Module or package name - */ - module?: string; - - postContext?: Array; - - /** - * Source code context around the error line - */ - preContext?: Array; - - /** - * Additional frame-specific variables/locals - */ - vars?: { [key: string]: string }; -} - -/** - * ReportErrorsResponse confirms that the errors were successfully received Success - * is indicated by HTTP 200 status code, failures by other status codes Empty - * response - success indicated by HTTP status code - */ -export type ErrorReportErrorsResponse = unknown; - -export interface ErrorReportErrorsParams { - /** - * Error events to be reported (batch) - now using Sentry-compatible structure - */ - events?: Array; -} - -export declare namespace Errors { - export { - type Breadcrumb as Breadcrumb, - type ErrorEvent as ErrorEvent, - type ErrorLevel as ErrorLevel, - type ExceptionInfo as ExceptionInfo, - type ExceptionMechanism as ExceptionMechanism, - type RequestInfo as RequestInfo, - type StackFrame as StackFrame, - type ErrorReportErrorsResponse as ErrorReportErrorsResponse, - type ErrorReportErrorsParams as ErrorReportErrorsParams, - }; -} diff --git a/src/resources/events.ts b/src/resources/events.ts index 70e2d30b..b1d33c66 100644 --- a/src/resources/events.ts +++ b/src/resources/events.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 EventsAPI from './events'; import * as Shared from './shared'; import { APIPromise } from '../core/api-promise'; import { EntriesPage, type EntriesPageParams, PagePromise } from '../core/pagination'; @@ -9,6 +10,33 @@ import { RequestOptions } from '../internal/request-options'; import { JSONLDecoder } from '../internal/decoders/jsonl'; export class Events extends APIResource { + /** + * Gets one audit-log entry, including any typed details stored for it. + * + * Use this method to: + * + * - Inspect the details of a specific audit-log entry + * - Retrieve the evidence associated with a Veto Exec audit event + * + * ### Examples + * + * - Get an audit-log entry: + * + * ```yaml + * auditLogEntryId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` + * + * @example + * ```ts + * const event = await client.events.retrieve({ + * auditLogEntryId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * }); + * ``` + */ + retrieve(body: EventRetrieveParams, options?: RequestOptions): APIPromise { + return this._client.post('/gitpod.v1.EventService/GetAuditLog', { body, ...options }); + } + /** * Lists audit logs with filtering and pagination options. * @@ -118,6 +146,102 @@ export class Events extends APIResource { export type EventListResponsesEntriesPage = EntriesPage; +/** + * AuditLogEntryDetails contains the typed evidence stored with an audit-log entry. + */ +export interface AuditLogEntryDetails { + /** + * veto_exec contains Veto Exec event details without process.cmdline. + */ + vetoExec: AuditLogEntryDetails.VetoExec; +} + +export namespace AuditLogEntryDetails { + /** + * veto_exec contains Veto Exec event details without process.cmdline. + */ + export interface VetoExec { + /** + * process contains metadata about the process that triggered the event. + */ + process: EventsAPI.Process; + + /** + * timestamp is when the event occurred in the environment. + */ + timestamp: string; + + /** + * action is the enforcement action taken (block or audit). + */ + action?: Shared.KernelControlsAction; + + /** + * environment_id is the environment where the event occurred. + */ + environmentId?: string; + + /** + * executable is the digest of the binary content (e.g., "sha256:a1b2c3d4..."). 256 + * allows for longer hash algorithms or prefixed identifiers. May be empty when the + * event source cannot compute the hash. + */ + executable?: string; + + /** + * filename is the kernel-resolved path of the binary. Kernel PATH_MAX = 4096 + * (include/uapi/linux/limits.h). May be empty if the event source could not + * resolve it. + */ + filename?: string; + } +} + +/** + * Process describes process metadata for a security event. + * + * PID fields use int32 to match the kernel's pid_t (signed int). Linux PID max is + * 4,194,304 (2^22), well within int32 range. Postgres has no unsigned integer + * type: Ent maps uint32 to bigint (8 bytes) while int32 maps to integer (4 bytes). + * Using int32 aligns proto, Go, and Postgres types without wasting storage. + */ +export interface Process { + /** + * name is the process name (comm). 2x kernel TASK_COMM_LEN=16 + */ + name?: string; + + /** + * pgid is the process group ID. + */ + pgid?: number; + + /** + * pid is the userspace process ID (kernel thread group ID, tgid). + */ + pid?: number; + + /** + * ppid is the parent process ID. + */ + ppid?: number; + + /** + * sid is the session ID. + */ + sid?: number; + + /** + * started_at is when the process started. + */ + startedAt?: string; + + /** + * tid is the userspace thread ID (kernel pid). + */ + tid?: number; +} + export type ResourceOperation = | 'RESOURCE_OPERATION_UNSPECIFIED' | 'RESOURCE_OPERATION_CREATE' @@ -125,6 +249,142 @@ export type ResourceOperation = | 'RESOURCE_OPERATION_DELETE' | 'RESOURCE_OPERATION_UPDATE_STATUS'; +export interface EventRetrieveResponse { + /** + * entry contains the common audit-log fields also returned by ListAuditLogs. + */ + entry: EventRetrieveResponse.Entry; + + /** + * details contains typed evidence captured with the audit entry. It is absent when + * the entry has no supported, valid details. + */ + details?: AuditLogEntryDetails; +} + +export namespace EventRetrieveResponse { + /** + * entry contains the common audit-log fields also returned by ListAuditLogs. + */ + export interface Entry { + id?: string; + + action?: string; + + actorId?: string; + + actorPrincipal?: Shared.Principal; + + /** + * 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; + + /** + * AuditLogEntryKind identifies the coarse query and rendering family of an + * audit-log entry. + */ + kind?: + | 'AUDIT_LOG_ENTRY_KIND_UNSPECIFIED' + | 'AUDIT_LOG_ENTRY_KIND_AGENT_SECURITY_EXEC_BLOCKED' + | 'AUDIT_LOG_ENTRY_KIND_AGENT_SECURITY_EXEC_AUDITED' + | 'AUDIT_LOG_ENTRY_KIND_RESOURCE_CHANGE' + | 'AUDIT_LOG_ENTRY_KIND_CREDENTIAL_ACCESS' + | 'AUDIT_LOG_ENTRY_KIND_ENVIRONMENT_VETO'; + + subjectId?: string; + + subjectType?: Shared.ResourceType; + } +} + export interface EventListResponse { id?: string; @@ -226,6 +486,18 @@ export interface EventListResponse { */ createdAt?: string; + /** + * AuditLogEntryKind identifies the coarse query and rendering family of an + * audit-log entry. + */ + kind?: + | 'AUDIT_LOG_ENTRY_KIND_UNSPECIFIED' + | 'AUDIT_LOG_ENTRY_KIND_AGENT_SECURITY_EXEC_BLOCKED' + | 'AUDIT_LOG_ENTRY_KIND_AGENT_SECURITY_EXEC_AUDITED' + | 'AUDIT_LOG_ENTRY_KIND_RESOURCE_CHANGE' + | 'AUDIT_LOG_ENTRY_KIND_CREDENTIAL_ACCESS' + | 'AUDIT_LOG_ENTRY_KIND_ENVIRONMENT_VETO'; + subjectId?: string; subjectType?: Shared.ResourceType; @@ -239,6 +511,13 @@ export interface EventWatchResponse { resourceType?: Shared.ResourceType; } +export interface EventRetrieveParams { + /** + * audit_log_entry_id is the ID of the audit-log entry to retrieve. + */ + auditLogEntryId: string; +} + export interface EventListParams extends EntriesPageParams { /** * Body param @@ -348,10 +627,14 @@ export namespace EventWatchParams { export declare namespace Events { export { + type AuditLogEntryDetails as AuditLogEntryDetails, + type Process as Process, type ResourceOperation as ResourceOperation, + type EventRetrieveResponse as EventRetrieveResponse, type EventListResponse as EventListResponse, type EventWatchResponse as EventWatchResponse, type EventListResponsesEntriesPage as EventListResponsesEntriesPage, + type EventRetrieveParams as EventRetrieveParams, type EventListParams as EventListParams, type EventWatchParams as EventWatchParams, }; diff --git a/src/resources/index.ts b/src/resources/index.ts index 17be5025..0e327f07 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -27,12 +27,14 @@ export { type AgentExecution, type AgentMessage, type AgentMode, + type GoalStatus, type Prompt, type PromptMetadata, type PromptSpec, type Role, type Type, type UserInputBlock, + type UserInputMetadata, type WakeEvent, type AgentCreateExecutionConversationTokenResponse, type AgentCreatePromptResponse, @@ -96,6 +98,51 @@ export { type AutomationListExecutionOutputsResponsesOutputsPage, type WorkflowExecutionsWorkflowExecutionsPage, } from './automations'; +export { + Billing, + type AgentExecutionCreditUsage, + type BillingCurrency, + type ByokRateCardTokenType, + type CreditUsageExportGroupBy, + type CreditUsageReportFilter, + type CreditsByType, + type CumulativeCreditUsage, + type DailyCreditUsage, + type DailyEnterpriseAIUsage, + type EnterpriseAITokenUsage, + type EnterpriseAIUsage, + type EnterpriseAIUsageBudget, + type EnterpriseAIUsageBudgetSource, + type EnterpriseAIUsageByModel, + type EnterpriseAIUsageByTokenType, + type EnterpriseAIUsageTimeSeriesFilter, + type EnterpriseAIUserBudgetPolicySource, + type EnvironmentCreditUsage, + type TeamCreditUsage, + type TeamCumulativeCreditUsage, + type TeamEnterpriseAIUsage, + type UsageType, + type UserCostBudgetUsage, + type UserCreditBudgetUsage, + type UserCreditUsage, + type UserEnterpriseAIUsage, + type BillingGetCreditUsageExportResponse, + type BillingGetCreditUsageReportResponse, + type BillingGetCumulativeCreditUsageResponse, + type BillingGetEnterpriseAIUsageSummaryResponse, + type BillingGetEnterpriseAIUsageTimeSeriesResponse, + type BillingGetCreditUsageExportParams, + type BillingGetCreditUsageReportParams, + type BillingGetCumulativeCreditUsageParams, + type BillingGetEnterpriseAIUsageSummaryParams, + type BillingGetEnterpriseAIUsageTimeSeriesParams, + type BillingListEnterpriseAITeamUsageParams, + type BillingListEnterpriseAIUserUsageParams, + type BillingListEnterpriseUserCreditUsageParams, + type TeamEnterpriseAIUsagesTeamUsagePage, + type UserCostBudgetUsagesUserUsagePage, + type UserCreditBudgetUsagesUserUsagePage, +} from './billing'; export { Editors, type Editor, @@ -145,23 +192,15 @@ export { type EnvironmentUnarchiveParams, type EnvironmentsEnvironmentsPage, } from './environments/environments'; -export { - Errors, - type Breadcrumb, - type ErrorEvent, - type ErrorLevel, - type ExceptionInfo, - type ExceptionMechanism, - type RequestInfo, - type StackFrame, - type ErrorReportErrorsResponse, - type ErrorReportErrorsParams, -} from './errors'; export { Events, + type AuditLogEntryDetails, + type Process, type ResourceOperation, + type EventRetrieveResponse, type EventListResponse, type EventWatchResponse, + type EventRetrieveParams, type EventListParams, type EventWatchParams, type EventListResponsesEntriesPage, @@ -317,6 +356,7 @@ export { type RunnerParseContextURLParams, type RunnerSearchRepositoriesParams, type RunnersRunnersPage, + type RunnerListScmOrganizationsResponsesOrganizationsPage, } from './runners/runners'; export { Secrets, @@ -333,9 +373,49 @@ export { type SecretUpdateValueParams, type SecretsSecretsPage, } from './secrets'; +export { + SecurityPolicies, + type SecurityPolicy, + type SecurityPolicyCreateResponse, + type SecurityPolicyRetrieveResponse, + type SecurityPolicyUpdateResponse, + type SecurityPolicyDeleteResponse, + type SecurityPolicyCreateParams, + type SecurityPolicyRetrieveParams, + type SecurityPolicyUpdateParams, + type SecurityPolicyListParams, + type SecurityPolicyDeleteParams, + type SecurityPoliciesSecurityPoliciesPage, +} from './security-policies'; export { Usage, + type AgentTraceModelBreakdown, + type AgentTraceSummary, + type AgentTraceTimeBucket, + type CoAuthorSummary, + type CoAuthorTimeBucket, + type CoAuthorTool, type EnvironmentUsageRecord, + type PrSummary, + type PrTimeBucket, + type Resolution, + type SupportedModel, + type TimeSeriesPoint, + type ToolBreakdown, + type UsageGetAdoptionUsageSummaryResponse, + type UsageGetAgentTraceSummaryResponse, + type UsageGetAgentTraceTimeSeriesResponse, + type UsageGetCoAuthorSummaryResponse, + type UsageGetCoAuthorTimeSeriesResponse, + type UsageGetPrSummaryResponse, + type UsageGetPrTimeSeriesResponse, + type UsageGetAdoptionUsageSummaryParams, + type UsageGetAgentTraceSummaryParams, + type UsageGetAgentTraceTimeSeriesParams, + type UsageGetCoAuthorSummaryParams, + type UsageGetCoAuthorTimeSeriesParams, + type UsageGetPrSummaryParams, + type UsageGetPrTimeSeriesParams, type UsageListEnvironmentRuntimeRecordsParams, type EnvironmentUsageRecordsRecordsPage, } from './usage'; diff --git a/src/resources/organizations/index.ts b/src/resources/organizations/index.ts index 29e04f78..04d46137 100644 --- a/src/resources/organizations/index.ts +++ b/src/resources/organizations/index.ts @@ -71,11 +71,11 @@ export { export { Policies, type AgentPolicy, + type CodexModelPolicy, type ConversationSharingPolicy, type CrowdStrikeConfig, type CustomAgentEnvMapping, type CustomSecurityAgent, - type KernelControlsAction, type OrganizationPolicies, type SecurityAgentPolicy, type VetoExecPolicy, diff --git a/src/resources/organizations/organizations.ts b/src/resources/organizations/organizations.ts index 3cdc46f4..17343971 100644 --- a/src/resources/organizations/organizations.ts +++ b/src/resources/organizations/organizations.ts @@ -55,11 +55,11 @@ import { import * as PoliciesAPI from './policies'; import { AgentPolicy, + CodexModelPolicy, ConversationSharingPolicy, CrowdStrikeConfig, CustomAgentEnvMapping, CustomSecurityAgent, - KernelControlsAction, OrganizationPolicies, Policies, PolicyRetrieveParams, @@ -1057,11 +1057,11 @@ export declare namespace Organizations { export { Policies as Policies, type AgentPolicy as AgentPolicy, + type CodexModelPolicy as CodexModelPolicy, 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, type VetoExecPolicy as VetoExecPolicy, diff --git a/src/resources/organizations/policies.ts b/src/resources/organizations/policies.ts index 604b29e0..2b4cacd6 100644 --- a/src/resources/organizations/policies.ts +++ b/src/resources/organizations/policies.ts @@ -2,6 +2,8 @@ import { APIResource } from '../../core/resource'; import * as PoliciesAPI from './policies'; +import * as Shared from '../shared'; +import * as EnvironmentsAPI from '../environments/environments'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; @@ -113,6 +115,39 @@ export interface AgentPolicy { */ scmToolsDisabled: boolean; + /** + * allowed_agent_ids contains the agent IDs users may select when the codex_rollout + * feature flag is enabled. Empty means all agents are allowed. + */ + allowedAgentIds?: Array; + + /** + * @deprecated Deprecated: use codex_model_policy. This legacy allowlist cannot + * distinguish omitted from intentionally empty on update requests. Empty means all + * Codex models are allowed. + */ + allowedCodexModels?: Array; + + /** + * allowed_codex_reasoning_efforts contains the Codex reasoning efforts users may + * select when the codex_rollout feature flag is enabled. Empty means all Codex + * reasoning efforts are allowed. + */ + allowedCodexReasoningEfforts?: Array; + + /** + * allowed_codex_service_tiers contains the Codex service tiers users may select + * when the codex_rollout feature flag is enabled. Empty means all Codex service + * tiers are allowed. + */ + allowedCodexServiceTiers?: Array; + + /** + * codex_model_policy contains explicit per-model Codex availability states. + * Missing policy or missing model entries mean allowed. + */ + codexModelPolicy?: CodexModelPolicy; + /** * conversation_sharing_policy controls whether agent conversations can be shared */ @@ -132,6 +167,22 @@ export interface AgentPolicy { scmToolsAllowedGroupId?: string; } +/** + * CodexModelPolicy controls per-model availability for Codex. + */ +export interface CodexModelPolicy { + /** + * model_states maps CodexOpenAIModel enum names to explicit policy states. Missing + * entries are treated as allowed. + */ + modelStates?: { + [key: string]: + | 'CODEX_MODEL_POLICY_STATE_UNSPECIFIED' + | 'CODEX_MODEL_POLICY_STATE_ALLOWED' + | 'CODEX_MODEL_POLICY_STATE_DISABLED'; + }; +} + /** * ConversationSharingPolicy controls how agent conversations can be shared. */ @@ -228,14 +279,6 @@ export interface CustomSecurityAgent { startCommand?: string; } -/** - * KernelControlsAction defines how a kernel-level policy violation is handled. - */ -export type KernelControlsAction = - | 'KERNEL_CONTROLS_ACTION_UNSPECIFIED' - | 'KERNEL_CONTROLS_ACTION_BLOCK' - | 'KERNEL_CONTROLS_ACTION_AUDIT'; - export interface OrganizationPolicies { /** * agent_policy contains agent-specific policy settings @@ -266,6 +309,12 @@ export interface OrganizationPolicies { */ defaultEnvironmentImage: string; + /** + * disable_from_scratch controls whether non-admin users can create blank + * environments without a Git or URL initializer. + */ + disableFromScratch: boolean; + /** * maximum_environments_per_user limits total environments (running or stopped) per * user @@ -314,6 +363,12 @@ export interface OrganizationPolicies { */ restrictAccountCreationToScim: boolean; + /** + * web_browser_disabled controls whether users can open the built-in web browser + * from environment pages. This does not affect VS Code Browser. + */ + webBrowserDisabled: boolean; + /** * delete_archived_environments_after controls how long archived environments are * kept before automatic deletion. 0 means no automatic deletion. Maximum duration @@ -355,6 +410,15 @@ export interface OrganizationPolicies { */ securityAgentPolicy?: SecurityAgentPolicy; + /** + * security_policy_id references the Veto Exec SecurityPolicy assigned to newly + * created environments. The public GA contract accepts policies that use only + * SecurityPolicy.Spec.executables. Assignment validates materializability and + * rejects unsupported executable selectors or effects. If empty, new environments + * have no SecurityPolicy by default. + */ + securityPolicyId?: string; + /** * veto_exec_policy contains the veto exec policy for environments. */ @@ -395,7 +459,7 @@ export interface VetoExecPolicy { /** * action specifies what action kernel-level controls take on policy violations */ - action?: KernelControlsAction; + action?: Shared.KernelControlsAction; /** * enabled controls whether executable blocking is active @@ -463,6 +527,12 @@ export interface PolicyUpdateParams { */ deleteArchivedEnvironmentsAfter?: string | null; + /** + * disable_from_scratch controls whether non-admin users can create blank + * environments without a Git or URL initializer. + */ + disableFromScratch?: boolean | null; + /** * editor_version_restrictions restricts which editor versions can be used. Maps * editor ID to version policy with allowed major versions. @@ -500,6 +570,14 @@ export interface PolicyUpdateParams { */ maximumRunningEnvironmentsPerUser?: string | null; + /** + * max_port_admission_level caps the maximum admission level a user-opened port may + * use. UNSPECIFIED means no cap (any AdmissionLevel value is allowed). System + * ports (VS Code Browser, agents) are exempt. The legacy port_sharing_disabled + * field, when true, takes precedence and blocks all user-initiated port sharing. + */ + maxPortAdmissionLevel?: EnvironmentsAPI.AdmissionLevel | null; + /** * members_create_projects controls whether members can create projects */ @@ -536,10 +614,25 @@ export interface PolicyUpdateParams { */ securityAgentPolicy?: PolicyUpdateParams.SecurityAgentPolicy | null; + /** + * security_policy_id assigns a Veto Exec SecurityPolicy to newly created + * environments. The public GA contract accepts policies that use only + * SecurityPolicy.Spec.executables. Assignment validates materializability and + * rejects unsupported executable selectors or effects. Set this field to an empty + * string to clear the default assignment. + */ + securityPolicyId?: string | null; + /** * veto_exec_policy contains the veto exec policy for environments. */ vetoExecPolicy?: VetoExecPolicy | null; + + /** + * web_browser_disabled controls whether users can open the built-in web browser + * from environment pages. This does not affect VS Code Browser. + */ + webBrowserDisabled?: boolean | null; } export namespace PolicyUpdateParams { @@ -547,6 +640,40 @@ export namespace PolicyUpdateParams { * agent_policy contains agent-specific policy settings */ export interface AgentPolicy { + /** + * allowed_agent_ids contains the agent IDs users may select when the codex_rollout + * feature flag is enabled. Empty means all agents are allowed. + */ + allowedAgentIds?: Array; + + /** + * @deprecated Deprecated: use codex_model_policy. This legacy allowlist cannot + * distinguish omitted from intentionally empty on update requests. Empty means all + * Codex models are allowed. + */ + allowedCodexModels?: Array; + + /** + * allowed_codex_reasoning_efforts contains the Codex reasoning efforts users may + * select when the codex_rollout feature flag is enabled. Empty means all Codex + * reasoning efforts are allowed. + */ + allowedCodexReasoningEfforts?: Array; + + /** + * allowed_codex_service_tiers contains the Codex service tiers users may select + * when the codex_rollout feature flag is enabled. Empty means all Codex service + * tiers are allowed. + */ + allowedCodexServiceTiers?: Array; + + /** + * codex_model_policy contains explicit per-model Codex availability states. Omit + * to leave the current model policy unchanged. Send an empty policy to clear + * explicit model states. + */ + codexModelPolicy?: PoliciesAPI.CodexModelPolicy; + /** * command_deny_list contains a list of commands that agents are not allowed to * execute @@ -644,11 +771,11 @@ export namespace PolicyUpdateParams { export declare namespace Policies { export { type AgentPolicy as AgentPolicy, + type CodexModelPolicy as CodexModelPolicy, 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, type VetoExecPolicy as VetoExecPolicy, diff --git a/src/resources/organizations/scim-configurations.ts b/src/resources/organizations/scim-configurations.ts index 33dc2f84..4c2e2778 100644 --- a/src/resources/organizations/scim-configurations.ts +++ b/src/resources/organizations/scim-configurations.ts @@ -291,6 +291,13 @@ export interface ScimConfiguration { */ updatedAt: string; + /** + * allow_unverified_email_account_linking allows SCIM to link provisioned users to + * existing accounts when the identity provider does not mark the email address as + * verified + */ + allowUnverifiedEmailAccountLinking?: boolean; + /** * enabled indicates if SCIM provisioning is active */ @@ -367,6 +374,13 @@ export interface ScimConfigurationCreateParams { */ ssoConfigurationId: string; + /** + * allow_unverified_email_account_linking allows SCIM to link provisioned users to + * existing accounts when the identity provider does not mark the email address as + * verified + */ + allowUnverifiedEmailAccountLinking?: boolean | null; + /** * name is a human-readable name for the SCIM configuration */ @@ -392,6 +406,13 @@ export interface ScimConfigurationUpdateParams { */ scimConfigurationId: string; + /** + * allow_unverified_email_account_linking allows SCIM to link provisioned users to + * existing accounts when the identity provider does not mark the email address as + * verified + */ + allowUnverifiedEmailAccountLinking?: boolean | null; + /** * enabled controls whether SCIM provisioning is active */ diff --git a/src/resources/runners/index.ts b/src/resources/runners/index.ts index fb790837..b11c33ee 100644 --- a/src/resources/runners/index.ts +++ b/src/resources/runners/index.ts @@ -62,4 +62,5 @@ export { type RunnerParseContextURLParams, type RunnerSearchRepositoriesParams, type RunnersRunnersPage, + type RunnerListScmOrganizationsResponsesOrganizationsPage, } from './runners'; diff --git a/src/resources/runners/runners.ts b/src/resources/runners/runners.ts index b3623212..3302fb95 100644 --- a/src/resources/runners/runners.ts +++ b/src/resources/runners/runners.ts @@ -27,7 +27,13 @@ import { ScmIntegrationValidationResult, } from './configurations/configurations'; import { APIPromise } from '../../core/api-promise'; -import { PagePromise, RunnersPage, type RunnersPageParams } from '../../core/pagination'; +import { + OrganizationsPage, + type OrganizationsPageParams, + PagePromise, + RunnersPage, + type RunnersPageParams, +} from '../../core/pagination'; import { RequestOptions } from '../../internal/request-options'; export class Runners extends APIResource { @@ -47,12 +53,12 @@ export class Runners extends APIResource { * * ### Examples * - * - Create cloud runner: + * - Create an AWS runner: * * Creates a new runner in AWS EC2. * * ```yaml - * name: "Production Runner" + * name: "AWS Runner" * provider: RUNNER_PROVIDER_AWS_EC2 * spec: * desiredPhase: RUNNER_PHASE_ACTIVE @@ -62,9 +68,25 @@ export class Runners extends APIResource { * autoUpdate: true * ``` * - * - Create local runner: + * - Create a GCP runner: * - * Creates a new local runner on Linux. + * Creates a new runner on Google Cloud Platform. + * + * ```yaml + * name: "GCP Runner" + * provider: RUNNER_PROVIDER_GCP + * spec: + * desiredPhase: RUNNER_PHASE_ACTIVE + * configuration: + * region: "us-central1" + * releaseChannel: RUNNER_RELEASE_CHANNEL_STABLE + * autoUpdate: true + * ``` + * + * - Create local runner (deprecated): + * + * Creates a new local runner on Linux. Local runners are deprecated; use + * RUNNER_PROVIDER_AWS_EC2 or RUNNER_PROVIDER_GCP instead. * * ```yaml * name: "Local Development Runner" @@ -79,12 +101,12 @@ export class Runners extends APIResource { * @example * ```ts * const runner = await client.runners.create({ - * name: 'Production Runner', - * provider: 'RUNNER_PROVIDER_AWS_EC2', + * name: 'GCP Runner', + * provider: 'RUNNER_PROVIDER_GCP', * spec: { * configuration: { * autoUpdate: true, - * region: 'us-west', + * region: 'us-central1', * releaseChannel: 'RUNNER_RELEASE_CHANNEL_STABLE', * }, * desiredPhase: 'RUNNER_PHASE_ACTIVE', @@ -412,24 +434,41 @@ export class Runners extends APIResource { * scmHost: "github.com" * ``` * + * - Search GitLab groups: + * + * Returns the first page of GitLab groups matching the substring. + * + * ```yaml + * runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * scmHost: "gitlab.com" + * query: "platform" + * pagination: + * pageSize: 25 + * ``` + * * @example * ```ts - * const response = await client.runners.listScmOrganizations({ - * runnerId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', - * scmHost: 'github.com', - * }); + * // Automatically fetches more pages as needed. + * for await (const runnerListScmOrganizationsResponse of client.runners.listScmOrganizations( + * { + * runnerId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * scmHost: 'github.com', + * }, + * )) { + * // ... + * } * ``` */ listScmOrganizations( params: RunnerListScmOrganizationsParams, options?: RequestOptions, - ): APIPromise { + ): PagePromise { const { token, pageSize, ...body } = params; - return this._client.post('/gitpod.v1.RunnerService/ListSCMOrganizations', { - query: { token, pageSize }, - body, - ...options, - }); + return this._client.getAPIList( + '/gitpod.v1.RunnerService/ListSCMOrganizations', + OrganizationsPage, + { query: { token, pageSize }, body, method: 'post', ...options }, + ); } /** @@ -521,6 +560,9 @@ export class Runners extends APIResource { export type RunnersRunnersPage = RunnersPage; +export type RunnerListScmOrganizationsResponsesOrganizationsPage = + OrganizationsPage; + export interface GatewayInfo { /** * Gateway represents a system gateway that provides access to services @@ -631,7 +673,13 @@ export type RunnerCapability = | 'RUNNER_CAPABILITY_CHECK_REPOSITORY_ACCESS' | 'RUNNER_CAPABILITY_RUNNER_SIDE_AGENT' | 'RUNNER_CAPABILITY_WARM_POOL' - | 'RUNNER_CAPABILITY_ASG_WARM_POOL'; + | 'RUNNER_CAPABILITY_ASG_WARM_POOL' + | 'RUNNER_CAPABILITY_PORT_AUTHENTICATION' + | 'RUNNER_CAPABILITY_HORIZONTAL_SCALING' + | 'RUNNER_CAPABILITY_AGENT_EXECUTION_CNF' + | 'RUNNER_CAPABILITY_REDIS_STREAM' + | 'RUNNER_CAPABILITY_BASE_SNAPSHOT' + | 'RUNNER_CAPABILITY_DYNAMIC_LLM_REQUEST_HEADERS'; export interface RunnerConfiguration { /** @@ -963,29 +1011,25 @@ export interface RunnerCreateRunnerTokenResponse { export interface RunnerListScmOrganizationsResponse { /** - * List of organizations the user belongs to + * @deprecated Deprecated: this field is unused by all known consumers and is + * scheduled for removal in a future release. Do not read it. + * + * Originally intended to gate organization-level webhook creation in the + * dashboard, but that gating was never implemented. Populating this field on the + * GitLab path requires a second fully-paginated ListGroups call, which is the main + * reason we are deprecating it. */ - organizations?: Array; -} + isAdmin?: boolean; -export namespace RunnerListScmOrganizationsResponse { - export interface Organization { - /** - * Whether the user has admin permissions in this organization. Admin permissions - * typically allow creating organization-level webhooks. - */ - isAdmin?: boolean; - - /** - * Organization name/slug (e.g., "gitpod-io") - */ - name?: string; + /** + * Organization name/slug (e.g., "gitpod-io") + */ + name?: string; - /** - * Organization URL (e.g., "https://github.com/gitpod-io") - */ - url?: string; - } + /** + * Organization URL (e.g., "https://github.com/gitpod-io") + */ + url?: string; } export interface RunnerParseContextURLResponse { @@ -1130,8 +1174,8 @@ export namespace RunnerParseContextURLResponse { export interface RunnerSearchRepositoriesResponse { /** - * Deprecated: Use pagination token instead. Total pages can be extracted from - * token. + * @deprecated Deprecated: Use pagination token instead. Total pages can be + * extracted from token. */ lastPage?: number; @@ -1405,16 +1449,23 @@ export interface RunnerCreateRunnerTokenParams { runnerId?: string; } -export interface RunnerListScmOrganizationsParams { +export interface RunnerListScmOrganizationsParams extends OrganizationsPageParams { /** - * Query param + * Body param: Pagination parameters. When unset, defaults to the standard + * PaginationRequest defaults (page_size 25, max 100). Tokens are opaque and + * provider-specific. */ - token?: string; + pagination?: RunnerListScmOrganizationsParams.Pagination; /** - * Query param + * Body param: Optional substring filter applied to the organization name. + * + * - GitLab: forwarded to the upstream `search` parameter (server-side, + * case-insensitive substring on name/path). + * - GitHub and Bitbucket: not implemented as they don't support searching Empty + * value means no filter. */ - pageSize?: number; + query?: string; /** * Body param @@ -1428,6 +1479,26 @@ export interface RunnerListScmOrganizationsParams { scmHost?: string; } +export namespace RunnerListScmOrganizationsParams { + /** + * Pagination parameters. When unset, defaults to the standard PaginationRequest + * defaults (page_size 25, max 100). Tokens are opaque and provider-specific. + */ + 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 RunnerParseContextURLParams { contextUrl?: string; @@ -1515,6 +1586,7 @@ export declare namespace Runners { type RunnerParseContextURLResponse as RunnerParseContextURLResponse, type RunnerSearchRepositoriesResponse as RunnerSearchRepositoriesResponse, type RunnersRunnersPage as RunnersRunnersPage, + type RunnerListScmOrganizationsResponsesOrganizationsPage as RunnerListScmOrganizationsResponsesOrganizationsPage, type RunnerCreateParams as RunnerCreateParams, type RunnerRetrieveParams as RunnerRetrieveParams, type RunnerUpdateParams as RunnerUpdateParams, diff --git a/src/resources/secrets.ts b/src/resources/secrets.ts index 86012223..19e4bd72 100644 --- a/src/resources/secrets.ts +++ b/src/resources/secrets.ts @@ -329,6 +329,16 @@ export interface Secret { */ creator?: Shared.Subject; + /** + * 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 mounted 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 and proxied at the + * same time. + */ + credentialProxy?: Secret.CredentialProxy; + /** * secret will be created as an Environment Variable with the same name as the * secret @@ -352,6 +362,11 @@ export interface Secret { scope?: SecretScope; + /** + * Source of the secret + */ + source?: Secret.Source; + /** * 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 @@ -445,6 +460,53 @@ export interface Secret { updatedAt?: 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 mounted 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 and proxied at the + * same time. + */ + export interface CredentialProxy { + /** + * 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; + } + + /** + * Source of the secret + */ + export interface Source { + oidcJfrog?: Source.OidcJfrog; + + verbatim?: boolean; + } + + export namespace Source { + export interface OidcJfrog { + /** + * host must be a hostname or IP address with optional port: + * + * ``` + * this.matches("^([A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?[.])*[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(:([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$") + * ``` + */ + host?: string; + + providerName?: string; + } + } +} + export interface SecretScope { /** * organization_id is the Organization ID this Secret belongs to @@ -493,6 +555,16 @@ export interface SecretCreateParams { */ containerRegistryBasicAuthHost?: string; + /** + * credential_proxy configures transparent credential injection when environments + * materialize this secret. When set, the credential proxy intercepts HTTPS traffic + * to the target hosts and replaces the dummy mounted 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 + * and proxied at the same time. + */ + credentialProxy?: SecretCreateParams.CredentialProxy; + /** * secret will be created as an Environment Variable with the same name as the * secret @@ -523,11 +595,64 @@ export interface SecretCreateParams { scope?: SecretScope; /** - * value is the plaintext value of the secret + * source is the source of the secret, possibly verbatim value + */ + source?: SecretCreateParams.Source; + + /** + * value is the plaintext value of the secret. When set, source must be unset or + * verbatim. */ value?: string; } +export namespace SecretCreateParams { + /** + * credential_proxy configures transparent credential injection when environments + * materialize this secret. When set, the credential proxy intercepts HTTPS traffic + * to the target hosts and replaces the dummy mounted 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 + * and proxied at the same time. + */ + export interface CredentialProxy { + /** + * 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; + } + + /** + * source is the source of the secret, possibly verbatim value + */ + export interface Source { + oidcJfrog?: Source.OidcJfrog; + + verbatim?: boolean; + } + + export namespace Source { + export interface OidcJfrog { + /** + * host must be a hostname or IP address with optional port: + * + * ``` + * this.matches("^([A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?[.])*[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(:([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$") + * ``` + */ + host?: string; + + providerName?: string; + } + } +} + export interface SecretListParams extends SecretsPageParams { /** * Body param diff --git a/src/resources/security-policies.ts b/src/resources/security-policies.ts new file mode 100644 index 00000000..b5ea7736 --- /dev/null +++ b/src/resources/security-policies.ts @@ -0,0 +1,701 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../core/resource'; +import { APIPromise } from '../core/api-promise'; +import { PagePromise, SecurityPoliciesPage, type SecurityPoliciesPageParams } from '../core/pagination'; +import { RequestOptions } from '../internal/request-options'; + +export class SecurityPolicies extends APIResource { + /** + * Creates a new security policy. + * + * Use this method to: + * + * - Define environment access controls + * - Configure audited or blocked operations + * - Manage organization security posture + * + * ### Examples + * + * - Create security policy: + * + * Creates an audit-first Veto Exec policy with one audited bare name and one + * blocked absolute path. Creation stores an inactive definition; assigning it as + * the organization default validates materializability. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * metadata: + * name: "Veto Exec audit-first" + * spec: + * executables: + * defaultEffect: EFFECT_ALLOW + * rules: + * - path: "npx" + * effect: EFFECT_AUDIT + * - path: "/usr/bin/curl" + * effect: EFFECT_BLOCK + * ``` + * + * @example + * ```ts + * const securityPolicy = await client.securityPolicies.create( + * { + * metadata: { name: 'Veto Exec audit-first' }, + * spec: { + * executables: { + * defaultEffect: 'EFFECT_ALLOW', + * rules: [ + * { effect: 'EFFECT_AUDIT', path: 'npx' }, + * { effect: 'EFFECT_BLOCK', path: '/usr/bin/curl' }, + * ], + * }, + * }, + * organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * }, + * ); + * ``` + */ + create( + body: SecurityPolicyCreateParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.SecurityService/CreateSecurityPolicy', { body, ...options }); + } + + /** + * Gets details about a specific security policy. + * + * Use this method to: + * + * - View security policy configuration + * - Inspect enforcement rules + * + * ### Examples + * + * - Get security policy: + * + * Retrieves a security policy by ID. + * + * ```yaml + * securityPolicyId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` + * + * @example + * ```ts + * const securityPolicy = + * await client.securityPolicies.retrieve({ + * securityPolicyId: + * 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * }); + * ``` + */ + retrieve( + body: SecurityPolicyRetrieveParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.SecurityService/GetSecurityPolicy', { body, ...options }); + } + + /** + * Updates a security policy. + * + * Use this method to: + * + * - Rename a security policy + * - Change enforcement rules + * - Update auditing behavior + * + * ### Examples + * + * - Update security policy: + * + * Promotes one executable rule from audit to block while leaving unmatched + * executables allowed. Updating an assigned policy validates materializability; + * updating an unassigned policy only stores its spec. + * + * ```yaml + * securityPolicyId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * spec: + * executables: + * defaultEffect: EFFECT_ALLOW + * rules: + * - path: "npx" + * effect: EFFECT_BLOCK + * - path: "/usr/bin/curl" + * effect: EFFECT_BLOCK + * ``` + * + * @example + * ```ts + * const securityPolicy = await client.securityPolicies.update( + * { + * securityPolicyId: + * 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * spec: { + * executables: { + * defaultEffect: 'EFFECT_ALLOW', + * rules: [ + * { effect: 'EFFECT_BLOCK', path: 'npx' }, + * { effect: 'EFFECT_BLOCK', path: '/usr/bin/curl' }, + * ], + * }, + * }, + * }, + * ); + * ``` + */ + update( + body: SecurityPolicyUpdateParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.SecurityService/UpdateSecurityPolicy', { body, ...options }); + } + + /** + * Lists security policies. + * + * Use this method to: + * + * - View all security policies in an organization + * - Audit configured security controls + * + * ### Examples + * + * - List organization policies: + * + * Shows security policies with pagination. + * + * ```yaml + * filter: + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * pagination: + * pageSize: 20 + * ``` + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const securityPolicy of client.securityPolicies.list( + * { + * filter: { + * organizationId: + * 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + * }, + * pagination: { pageSize: 20 }, + * }, + * )) { + * // ... + * } + * ``` + */ + list( + params: SecurityPolicyListParams, + options?: RequestOptions, + ): PagePromise { + const { token, pageSize, ...body } = params; + return this._client.getAPIList( + '/gitpod.v1.SecurityService/ListSecurityPolicies', + SecurityPoliciesPage, + { query: { token, pageSize }, body, method: 'post', ...options }, + ); + } + + /** + * Deletes a security policy. + * + * Use this method to: + * + * - Remove obsolete security policies + * - Clean up unused policy definitions + * + * ### Examples + * + * - Delete security policy: + * + * Permanently removes a security policy. + * + * ```yaml + * securityPolicyId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` + * + * @example + * ```ts + * const securityPolicy = await client.securityPolicies.delete( + * { + * securityPolicyId: + * 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * }, + * ); + * ``` + */ + delete(body: SecurityPolicyDeleteParams, options?: RequestOptions): APIPromise { + return this._client.post('/gitpod.v1.SecurityService/DeleteSecurityPolicy', { body, ...options }); + } +} + +export type SecurityPoliciesSecurityPoliciesPage = SecurityPoliciesPage; + +export interface SecurityPolicy { + metadata: SecurityPolicy.Metadata; + + /** + * Mandate/deploy security agents, e.g. CrowdStrike. Mandate credential + * security/proxy use. These can be modeled later as explicit fields if needed. + */ + spec: SecurityPolicy.Spec; + + id?: 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. + */ + createdAt?: string; + + organizationId?: 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 namespace SecurityPolicy { + export interface Metadata { + name?: string; + } + + /** + * Mandate/deploy security agents, e.g. CrowdStrike. Mandate credential + * security/proxy use. These can be modeled later as explicit fields if needed. + */ + export interface Spec { + /** + * executables is the public Veto Exec GA policy surface. + */ + executables?: Spec.Executables; + } + + export namespace Spec { + /** + * executables is the public Veto Exec GA policy surface. + */ + export interface Executables { + /** + * default_effect controls executables that do not match a rule. For Veto Exec, + * omit this field or set it to EFFECT_ALLOW. EFFECT_UNSPECIFIED is normalized to + * EFFECT_ALLOW. + */ + defaultEffect?: 'EFFECT_UNSPECIFIED' | 'EFFECT_ALLOW' | 'EFFECT_BLOCK' | 'EFFECT_AUDIT'; + + /** + * rules contains executable-specific audit or block decisions. + */ + rules?: Array; + } + + export namespace Executables { + export interface Rule { + /** + * effect must be EFFECT_AUDIT or EFFECT_BLOCK. EFFECT_ALLOW is not supported on an + * executable rule. + */ + effect?: 'EFFECT_UNSPECIFIED' | 'EFFECT_ALLOW' | 'EFFECT_BLOCK' | 'EFFECT_AUDIT'; + + /** + * path is either an absolute executable path, such as /usr/bin/curl, or a bare + * executable name, such as npx. Bare names are expanded by runtime discovery. + * Surrounding whitespace is ignored. Empty or whitespace-only selectors and + * relative paths with directory separators are invalid. Enforcement uses + * executable content hashes, so different paths with identical content share one + * runtime decision and block wins conflicts. + */ + path?: string; + } + } + } +} + +export interface SecurityPolicyCreateResponse { + securityPolicy: SecurityPolicy; +} + +export interface SecurityPolicyRetrieveResponse { + securityPolicy: SecurityPolicy; +} + +export interface SecurityPolicyUpdateResponse { + securityPolicy: SecurityPolicy; +} + +export type SecurityPolicyDeleteResponse = unknown; + +export interface SecurityPolicyCreateParams { + metadata: SecurityPolicyCreateParams.Metadata; + + /** + * Mandate/deploy security agents, e.g. CrowdStrike. Mandate credential + * security/proxy use. These can be modeled later as explicit fields if needed. + */ + spec: SecurityPolicyCreateParams.Spec; + + organizationId?: string; +} + +export namespace SecurityPolicyCreateParams { + export interface Metadata { + name?: string; + } + + /** + * Mandate/deploy security agents, e.g. CrowdStrike. Mandate credential + * security/proxy use. These can be modeled later as explicit fields if needed. + */ + export interface Spec { + /** + * executables is the public Veto Exec GA policy surface. + */ + executables?: Spec.Executables; + } + + export namespace Spec { + /** + * executables is the public Veto Exec GA policy surface. + */ + export interface Executables { + /** + * default_effect controls executables that do not match a rule. For Veto Exec, + * omit this field or set it to EFFECT_ALLOW. EFFECT_UNSPECIFIED is normalized to + * EFFECT_ALLOW. + */ + defaultEffect?: 'EFFECT_UNSPECIFIED' | 'EFFECT_ALLOW' | 'EFFECT_BLOCK' | 'EFFECT_AUDIT'; + + /** + * rules contains executable-specific audit or block decisions. + */ + rules?: Array; + } + + export namespace Executables { + export interface Rule { + /** + * effect must be EFFECT_AUDIT or EFFECT_BLOCK. EFFECT_ALLOW is not supported on an + * executable rule. + */ + effect?: 'EFFECT_UNSPECIFIED' | 'EFFECT_ALLOW' | 'EFFECT_BLOCK' | 'EFFECT_AUDIT'; + + /** + * path is either an absolute executable path, such as /usr/bin/curl, or a bare + * executable name, such as npx. Bare names are expanded by runtime discovery. + * Surrounding whitespace is ignored. Empty or whitespace-only selectors and + * relative paths with directory separators are invalid. Enforcement uses + * executable content hashes, so different paths with identical content share one + * runtime decision and block wins conflicts. + */ + path?: string; + } + } + } +} + +export interface SecurityPolicyRetrieveParams { + securityPolicyId?: string; +} + +export interface SecurityPolicyUpdateParams { + metadata?: SecurityPolicyUpdateParams.Metadata; + + securityPolicyId?: string; + + /** + * Mandate/deploy security agents, e.g. CrowdStrike. Mandate credential + * security/proxy use. These can be modeled later as explicit fields if needed. + */ + spec?: SecurityPolicyUpdateParams.Spec; +} + +export namespace SecurityPolicyUpdateParams { + export interface Metadata { + name?: string; + } + + /** + * Mandate/deploy security agents, e.g. CrowdStrike. Mandate credential + * security/proxy use. These can be modeled later as explicit fields if needed. + */ + export interface Spec { + /** + * executables is the public Veto Exec GA policy surface. + */ + executables?: Spec.Executables; + } + + export namespace Spec { + /** + * executables is the public Veto Exec GA policy surface. + */ + export interface Executables { + /** + * default_effect controls executables that do not match a rule. For Veto Exec, + * omit this field or set it to EFFECT_ALLOW. EFFECT_UNSPECIFIED is normalized to + * EFFECT_ALLOW. + */ + defaultEffect?: 'EFFECT_UNSPECIFIED' | 'EFFECT_ALLOW' | 'EFFECT_BLOCK' | 'EFFECT_AUDIT'; + + /** + * rules contains executable-specific audit or block decisions. + */ + rules?: Array; + } + + export namespace Executables { + export interface Rule { + /** + * effect must be EFFECT_AUDIT or EFFECT_BLOCK. EFFECT_ALLOW is not supported on an + * executable rule. + */ + effect?: 'EFFECT_UNSPECIFIED' | 'EFFECT_ALLOW' | 'EFFECT_BLOCK' | 'EFFECT_AUDIT'; + + /** + * path is either an absolute executable path, such as /usr/bin/curl, or a bare + * executable name, such as npx. Bare names are expanded by runtime discovery. + * Surrounding whitespace is ignored. Empty or whitespace-only selectors and + * relative paths with directory separators are invalid. Enforcement uses + * executable content hashes, so different paths with identical content share one + * runtime decision and block wins conflicts. + */ + path?: string; + } + } + } +} + +export interface SecurityPolicyListParams extends SecurityPoliciesPageParams { + /** + * Body param + */ + filter?: SecurityPolicyListParams.Filter; + + /** + * Body param + */ + pagination?: SecurityPolicyListParams.Pagination; +} + +export namespace SecurityPolicyListParams { + export interface Filter { + organizationId?: string; + + search?: string; + + securityPolicyIds?: 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 SecurityPolicyDeleteParams { + securityPolicyId?: string; +} + +export declare namespace SecurityPolicies { + export { + type SecurityPolicy as SecurityPolicy, + type SecurityPolicyCreateResponse as SecurityPolicyCreateResponse, + type SecurityPolicyRetrieveResponse as SecurityPolicyRetrieveResponse, + type SecurityPolicyUpdateResponse as SecurityPolicyUpdateResponse, + type SecurityPolicyDeleteResponse as SecurityPolicyDeleteResponse, + type SecurityPoliciesSecurityPoliciesPage as SecurityPoliciesSecurityPoliciesPage, + type SecurityPolicyCreateParams as SecurityPolicyCreateParams, + type SecurityPolicyRetrieveParams as SecurityPolicyRetrieveParams, + type SecurityPolicyUpdateParams as SecurityPolicyUpdateParams, + type SecurityPolicyListParams as SecurityPolicyListParams, + type SecurityPolicyDeleteParams as SecurityPolicyDeleteParams, + }; +} diff --git a/src/resources/shared.ts b/src/resources/shared.ts index efb056cb..90f27665 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -22,8 +22,8 @@ import { * automation during a prebuild of an environment. This phase does not have user * secrets available. The `before_snapshot` field triggers the automation after all * prebuild tasks complete but before the snapshot is taken. This is used for tasks - * that need to run last during prebuilds, such as IDE warmup. Note: The prebuild - * and before_snapshot triggers can only be used with tasks, not services. + * that need to run last during prebuilds, such as IDE warmup. Note: The + * before_snapshot trigger can only be used with tasks, not services. */ export interface AutomationTrigger { beforeSnapshot?: boolean; @@ -39,11 +39,82 @@ export interface AutomationTrigger { prebuild?: boolean; } +/** + * CodexOpenAIModel is the static allowlist of concrete OpenAI models that the + * Codex app runtime can select through Ona's Codex picker. + */ +export type CodexOpenAIModel = + | 'CODEX_OPEN_AI_MODEL_UNSPECIFIED' + | 'CODEX_OPEN_AI_MODEL_GPT_5_5' + | 'CODEX_OPEN_AI_MODEL_GPT_5_4' + | 'CODEX_OPEN_AI_MODEL_GPT_5_4_MINI' + | 'CODEX_OPEN_AI_MODEL_GPT_5_3_CODEX' + | 'CODEX_OPEN_AI_MODEL_GPT_5_3_CODEX_SPARK' + | 'CODEX_OPEN_AI_MODEL_GPT_5_2' + | 'CODEX_OPEN_AI_MODEL_GPT_5_6_SOL' + | 'CODEX_OPEN_AI_MODEL_GPT_5_6_TERRA' + | 'CODEX_OPEN_AI_MODEL_GPT_5_6_LUNA'; + +/** + * CodexReasoningEffort is the static allowlist of reasoning efforts supported by + * the Codex app runtime. + */ +export type CodexReasoningEffort = + | 'CODEX_REASONING_EFFORT_UNSPECIFIED' + | 'CODEX_REASONING_EFFORT_LOW' + | 'CODEX_REASONING_EFFORT_MEDIUM' + | 'CODEX_REASONING_EFFORT_HIGH' + | 'CODEX_REASONING_EFFORT_EXTRA_HIGH'; + +/** + * CodexServiceTier is the static allowlist of service tiers supported by the Codex + * app runtime. + */ +export type CodexServiceTier = 'CODEX_SERVICE_TIER_UNSPECIFIED' | 'CODEX_SERVICE_TIER_FAST'; + +/** + * CodexSettings contains settings consumed only by the Codex app agent. + */ +export interface CodexSettings { + /** + * CodexOpenAIModel is the static allowlist of concrete OpenAI models that the + * Codex app runtime can select through Ona's Codex picker. + */ + model?: CodexOpenAIModel; + + /** + * CodexReasoningEffort is the static allowlist of reasoning efforts supported by + * the Codex app runtime. + */ + reasoningEffort?: CodexReasoningEffort; + + /** + * CodexServiceTier is the static allowlist of service tiers supported by the Codex + * app runtime. + */ + serviceTier?: CodexServiceTier; +} + export type CountResponseRelation = | 'COUNT_RESPONSE_RELATION_UNSPECIFIED' | 'COUNT_RESPONSE_RELATION_EQ' | 'COUNT_RESPONSE_RELATION_GTE'; +/** + * DateRange specifies a time period for queries. + */ +export interface DateRange { + /** + * End time of the date range (exclusive). + */ + endTime: string; + + /** + * Start time of the date range (inclusive). + */ + startTime: string; +} + export interface EnvironmentClass { /** * id is the unique identifier of the environment class @@ -158,6 +229,14 @@ export interface Gateway { region?: string; } +/** + * KernelControlsAction defines how a kernel-level policy violation is handled. + */ +export type KernelControlsAction = + | 'KERNEL_CONTROLS_ACTION_UNSPECIFIED' + | 'KERNEL_CONTROLS_ACTION_BLOCK' + | 'KERNEL_CONTROLS_ACTION_AUDIT'; + export type OrganizationRole = | 'ORGANIZATION_ROLE_UNSPECIFIED' | 'ORGANIZATION_ROLE_ADMIN' @@ -209,7 +288,11 @@ export type ResourceRole = | 'RESOURCE_ROLE_ORG_PROJECTS_ADMIN' | 'RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN' | 'RESOURCE_ROLE_ORG_GROUPS_ADMIN' + | 'RESOURCE_ROLE_ORG_ENVIRONMENTS_READER' | 'RESOURCE_ROLE_ORG_AUDIT_LOG_READER' + | 'RESOURCE_ROLE_ORG_BILLING_VIEWER' + | 'RESOURCE_ROLE_ORG_INSIGHTS_VIEWER' + | 'RESOURCE_ROLE_ORG_SECURITY_ADMIN' | 'RESOURCE_ROLE_GROUP_ADMIN' | 'RESOURCE_ROLE_GROUP_VIEWER' | 'RESOURCE_ROLE_USER_IDENTITY' @@ -263,7 +346,9 @@ export type ResourceRole = | 'RESOURCE_ROLE_SESSION_ADMIN' | 'RESOURCE_ROLE_SESSION_USER' | 'RESOURCE_ROLE_TEAM_ADMIN' - | 'RESOURCE_ROLE_TEAM_VIEWER'; + | 'RESOURCE_ROLE_TEAM_VIEWER' + | 'RESOURCE_ROLE_SECURITY_POLICY_ADMIN' + | 'RESOURCE_ROLE_SECURITY_POLICY_VIEWER'; export type ResourceType = | 'RESOURCE_TYPE_UNSPECIFIED' @@ -315,7 +400,10 @@ export type ResourceType = | 'RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN' | 'RESOURCE_TYPE_ROLE_ASSIGNMENT' | 'RESOURCE_TYPE_WARM_POOL' - | 'RESOURCE_TYPE_NOTIFICATION'; + | 'RESOURCE_TYPE_NOTIFICATION' + | 'RESOURCE_TYPE_SECURITY_POLICY' + | 'RESOURCE_TYPE_BASE_SNAPSHOT' + | 'RESOURCE_TYPE_BASE_SNAPSHOT_CONFIG'; export interface RunsOn { docker?: RunsOn.Docker; @@ -324,12 +412,6 @@ 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 { @@ -603,6 +685,15 @@ export interface TaskSpec { */ env?: Array; + /** + * prebuild_requires_success controls whether a non-successful outcome of this task + * should fail the prebuild. When true and the task is triggered by a prebuild or + * before_snapshot trigger, any terminal phase other than SUCCEEDED (i.e. FAILED or + * STOPPED) will cause the prebuild to fail instead of just recording a warning. + * Defaults to false (existing behavior: task failures produce warnings only). + */ + prebuildRequiresSuccess?: boolean; + /** * runs_on specifies the environment the task should run on. */ diff --git a/src/resources/usage.ts b/src/resources/usage.ts index 0782706e..c5f3e9fb 100644 --- a/src/resources/usage.ts +++ b/src/resources/usage.ts @@ -1,6 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; +import * as Shared from './shared'; +import { APIPromise } from '../core/api-promise'; import { PagePromise, RecordsPage, type RecordsPageParams } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; @@ -8,6 +10,272 @@ import { RequestOptions } from '../internal/request-options'; * UsageService provides usage information about environments, users, and projects. */ export class Usage extends APIResource { + /** + * Gets a summary of adoption and usage metrics. + * + * Returns all scalar values, trends, and a sparkline for the Adoption & Usage + * insight category. For full-resolution time series, use the individual time + * series RPCs. + * + * Use this method to: + * + * - Build adoption and usage insight cards + * - Filter adoption metrics by project, user, or team + * - Compare the requested date range against the previous period + * + * ### Example + * + * ```yaml + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-02-01T00:00:00Z" + * projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` + * + * @example + * ```ts + * const response = await client.usage.getAdoptionUsageSummary( + * { + * dateRange: { + * endTime: '2024-02-01T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * }, + * ); + * ``` + */ + getAdoptionUsageSummary( + body: UsageGetAdoptionUsageSummaryParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.UsageService/GetAdoptionUsageSummary', { body, ...options }); + } + + /** + * Gets aggregated agent trace summary for the organization or a specific project. + * + * Use this method to: + * + * - Measure agent sessions and line changes + * - Break down agent activity by model + * - Scope agent trace insights to a project, user, or team + * + * ### Example + * + * ```yaml + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-02-01T00:00:00Z" + * projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` + * + * @example + * ```ts + * const response = await client.usage.getAgentTraceSummary({ + * dateRange: { + * endTime: '2024-02-01T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * }); + * ``` + */ + getAgentTraceSummary( + body: UsageGetAgentTraceSummaryParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.UsageService/GetAgentTraceSummary', { body, ...options }); + } + + /** + * Gets agent trace data as a time series. + * + * Use this method to: + * + * - Chart agent sessions and line changes over time + * - Select hourly, daily, weekly, or monthly buckets + * - Scope agent trace insights to a project, user, or team + * + * ### Example + * + * ```yaml + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-02-01T00:00:00Z" + * resolution: RESOLUTION_WEEKLY + * projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` + * + * @example + * ```ts + * const response = await client.usage.getAgentTraceTimeSeries( + * { + * dateRange: { + * endTime: '2024-02-01T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * resolution: 'RESOLUTION_WEEKLY', + * }, + * ); + * ``` + */ + getAgentTraceTimeSeries( + body: UsageGetAgentTraceTimeSeriesParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.UsageService/GetAgentTraceTimeSeries', { body, ...options }); + } + + /** + * Gets aggregated co-author summary for the organization or a specific project. + * + * Use this method to: + * + * - Measure AI-assisted commits and line changes + * - Scope co-author insights to a project, user, or team + * - Compare the requested date range against the previous period + * + * ### Example + * + * ```yaml + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-02-01T00:00:00Z" + * projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` + * + * @example + * ```ts + * const response = await client.usage.getCoAuthorSummary({ + * dateRange: { + * endTime: '2024-02-01T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * }); + * ``` + */ + getCoAuthorSummary( + body: UsageGetCoAuthorSummaryParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.UsageService/GetCoAuthorSummary', { body, ...options }); + } + + /** + * Gets co-author contribution data as a time series. + * + * Use this method to: + * + * - Chart AI-assisted commits and line changes over time + * - Select hourly, daily, weekly, or monthly buckets + * - Scope co-author insights to a project, user, or team + * + * ### Example + * + * ```yaml + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-02-01T00:00:00Z" + * resolution: RESOLUTION_WEEKLY + * projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` + * + * @example + * ```ts + * const response = await client.usage.getCoAuthorTimeSeries({ + * dateRange: { + * endTime: '2024-02-01T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * resolution: 'RESOLUTION_WEEKLY', + * }); + * ``` + */ + getCoAuthorTimeSeries( + body: UsageGetCoAuthorTimeSeriesParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.UsageService/GetCoAuthorTimeSeries', { body, ...options }); + } + + /** + * Gets aggregated PR speed summary for the organization or a specific project. + * + * Use this method to: + * + * - Measure pull request lead time and review latency + * - Calculate deployment frequency from merged pull requests + * - Scope PR speed insights to a project, user, or team + * + * ### Example + * + * ```yaml + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-02-01T00:00:00Z" + * projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` + * + * @example + * ```ts + * const response = await client.usage.getPrSummary({ + * dateRange: { + * endTime: '2024-02-01T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * }); + * ``` + */ + getPrSummary( + body: UsageGetPrSummaryParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.UsageService/GetPrSummary', { body, ...options }); + } + + /** + * Gets PR speed metrics as a time series. + * + * Use this method to: + * + * - Chart pull request lead time, review latency, and deploy counts + * - Select hourly, daily, weekly, or monthly buckets + * - Scope PR speed insights to a project, user, or team + * + * ### Example + * + * ```yaml + * dateRange: + * startTime: "2024-01-01T00:00:00Z" + * endTime: "2024-02-01T00:00:00Z" + * resolution: RESOLUTION_WEEKLY + * projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` + * + * @example + * ```ts + * const response = await client.usage.getPrTimeSeries({ + * dateRange: { + * endTime: '2024-02-01T00:00:00Z', + * startTime: '2024-01-01T00:00:00Z', + * }, + * projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + * resolution: 'RESOLUTION_WEEKLY', + * }); + * ``` + */ + getPrTimeSeries( + body: UsageGetPrTimeSeriesParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post('/gitpod.v1.UsageService/GetPrTimeSeries', { body, ...options }); + } + /** * Lists completed environment runtime records within a specified date range. * @@ -67,6 +335,211 @@ export class Usage extends APIResource { export type EnvironmentUsageRecordsRecordsPage = RecordsPage; +/** + * AgentTraceModelBreakdown contains stats for a single LLM model. + */ +export interface AgentTraceModelBreakdown { + /** + * Lines added by sessions using this model. + */ + linesAdded?: string; + + /** + * Lines removed by sessions using this model. + */ + linesRemoved?: string; + + /** + * The model these stats are for. + */ + model?: SupportedModel; + + /** + * Number of sessions that used this model. + */ + sessions?: string; +} + +/** + * AgentTraceSummary contains aggregate totals for a date range. + */ +export interface AgentTraceSummary { + /** + * Per-model breakdown of session stats. + */ + byModel?: Array; + + /** + * Total lines added across all sessions. + */ + totalLinesAdded?: string; + + /** + * Fractional change in total_lines_added compared to the previous period. + */ + totalLinesAddedTrend?: number; + + /** + * Total lines removed across all sessions. + */ + totalLinesRemoved?: string; + + /** + * Fractional change in total_lines_removed compared to the previous period. + */ + totalLinesRemovedTrend?: number; + + /** + * Total number of agent trace sessions in the date range. + */ + totalSessions?: string; + + /** + * Fractional change in total_sessions compared to the previous period of equal + * length. Computed as (current - previous) / previous. Zero when there is no + * previous data. + */ + totalSessionsTrend?: number; +} + +/** + * AgentTraceTimeBucket contains stats for a single time period. + */ +export interface AgentTraceTimeBucket { + /** + * Per-model breakdown for this bucket. + */ + byModel?: Array; + + /** + * Start of this time bucket. + */ + startTime?: string; + + /** + * Total lines added in this bucket. + */ + totalLinesAdded?: string; + + /** + * Total lines removed in this bucket. + */ + totalLinesRemoved?: string; + + /** + * Number of agent trace sessions in this bucket. + */ + totalSessions?: string; +} + +/** + * CoAuthorSummary contains aggregate totals for a date range. + */ +export interface CoAuthorSummary { + /** + * Per-tool breakdown of contribution stats. + */ + byTool?: Array; + + /** + * Number of distinct authors (by author_hash). + */ + distinctAuthors?: string; + + /** + * Fractional change in distinct_authors compared to the previous period. + */ + distinctAuthorsTrend?: number; + + /** + * Total number of commits in the date range. + */ + totalCommits?: string; + + /** + * Fractional change in total_commits compared to the previous period of equal + * length. Computed as (current - previous) / previous. Zero when there is no + * previous data. + */ + totalCommitsTrend?: number; + + /** + * Total lines added across all commits. + */ + totalLinesAdded?: string; + + /** + * Fractional change in total_lines_added compared to the previous period. + */ + totalLinesAddedTrend?: number; + + /** + * Total lines removed across all commits. + */ + totalLinesRemoved?: string; + + /** + * Fractional change in total_lines_removed compared to the previous period. + */ + totalLinesRemovedTrend?: number; +} + +/** + * CoAuthorTimeBucket contains stats for a single time period. + */ +export interface CoAuthorTimeBucket { + /** + * Ratio of AI-assisted lines added to total lines added (0.0–1.0). + */ + aiRatio?: number; + + /** + * Per-tool breakdown for this bucket. + */ + byTool?: Array; + + /** + * Number of distinct authors (by author_hash) in this bucket. + */ + distinctAuthors?: string; + + /** + * Start of this time bucket. + */ + startTime?: string; + + /** + * Total number of commits in this bucket (across all tools). + */ + totalCommits?: string; + + /** + * Total lines added in this bucket (across all tools). + */ + totalLinesAdded?: string; + + /** + * Total lines removed in this bucket (across all tools). + */ + totalLinesRemoved?: string; +} + +/** + * CoAuthorTool identifies the AI tool that co-authored a commit. UNSPECIFIED (0) + * is the proto default and must not appear in reported data. Use HUMAN for commits + * with no AI co-author. + */ +export type CoAuthorTool = + | 'CO_AUTHOR_TOOL_UNSPECIFIED' + | 'CO_AUTHOR_TOOL_NO_COAUTHOR' + | 'CO_AUTHOR_TOOL_HUMAN_COAUTHOR' + | 'CO_AUTHOR_TOOL_ONA' + | 'CO_AUTHOR_TOOL_GITHUB_COPILOT' + | 'CO_AUTHOR_TOOL_CURSOR' + | 'CO_AUTHOR_TOOL_OTHER' + | 'CO_AUTHOR_TOOL_CLAUDE' + | 'CO_AUTHOR_TOOL_CODEX'; + /** * EnvironmentUsageRecord represents a record of an environment from start to stop. */ @@ -113,6 +586,464 @@ export interface EnvironmentUsageRecord { userId?: string; } +/** + * PrSummary contains aggregate PR speed metrics for a date range. + */ +export interface PrSummary { + /** + * PRs merged to the default branch per week. + */ + deploymentFrequency?: number; + + /** + * Fractional change in deployment_frequency vs previous period. Computed as + * (current - previous) / previous. + */ + deploymentFrequencyTrend?: number; + + /** + * Median lead time for changes in seconds (first commit → merge). + */ + leadTimeSeconds?: number; + + /** + * Fractional change in lead_time_seconds vs previous period. Computed as + * (current - previous) / previous. + */ + leadTimeTrend?: number; + + /** + * Total PRs merged in the date range. + */ + prsMergedCount?: string; + + /** + * Fractional change in prs_merged_count vs previous period. Computed as (current - + * previous) / previous. + */ + prsMergedTrend?: number; + + /** + * Median time to first approval in seconds. Zero when no PRs in the range had + * approvals. + */ + timeToFirstApprovalSeconds?: number; + + /** + * Fractional change in time_to_first_approval_seconds vs previous period. Computed + * as (current - previous) / previous. + */ + timeToFirstApprovalTrend?: number; +} + +/** + * PrTimeBucket contains PR speed metrics for a single time period. + */ +export interface PrTimeBucket { + /** + * Total number of deploys (merged PRs) in this bucket. + */ + deploys?: string; + + /** + * Median lead time in seconds for PRs merged in this bucket. + */ + leadTimeSeconds?: number; + + /** + * Number of PRs merged in this bucket. + */ + prsMergedCount?: string; + + /** + * Start of this time bucket. + */ + startTime?: string; + + /** + * Median time to first approval in seconds for PRs in this bucket. Zero when no + * PRs in the bucket had approvals. + */ + timeToFirstApprovalSeconds?: number; +} + +/** + * Resolution specifies the time granularity for time series data. + */ +export type Resolution = + | 'RESOLUTION_UNSPECIFIED' + | 'RESOLUTION_HOURLY' + | 'RESOLUTION_DAILY' + | 'RESOLUTION_WEEKLY' + | 'RESOLUTION_MONTHLY'; + +/** + * SupportedModel enumerates the LLM models available for agent executions + */ +export type SupportedModel = + | 'SUPPORTED_MODEL_UNSPECIFIED' + | 'SUPPORTED_MODEL_SONNET_3_5' + | 'SUPPORTED_MODEL_SONNET_3_7' + | 'SUPPORTED_MODEL_SONNET_3_7_EXTENDED' + | 'SUPPORTED_MODEL_SONNET_4' + | '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_SONNET_5' + | '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_OPUS_4_7' + | 'SUPPORTED_MODEL_OPUS_4_8' + | 'SUPPORTED_MODEL_HAIKU_4_5' + | 'SUPPORTED_MODEL_OPENAI_4O' + | 'SUPPORTED_MODEL_OPENAI_4O_MINI' + | 'SUPPORTED_MODEL_OPENAI_O1' + | 'SUPPORTED_MODEL_OPENAI_O1_MINI' + | 'SUPPORTED_MODEL_OPENAI_AUTO'; + +export interface TimeSeriesPoint { + /** + * Timestamp for this data point. + */ + time?: string; + + /** + * The numerical value for this data point. + */ + value?: number; +} + +/** + * ToolBreakdown contains stats for a single AI tool (or human). + */ +export interface ToolBreakdown { + /** + * Number of commits attributed to this tool. + */ + commits?: string; + + /** + * Distinct authors who used this tool. + */ + distinctAuthors?: string; + + /** + * Lines added by this tool. + */ + linesAdded?: string; + + /** + * Lines removed by this tool. + */ + linesRemoved?: string; + + /** + * The tool these stats are for. + */ + tool?: CoAuthorTool; +} + +export interface UsageGetAdoptionUsageSummaryResponse { + /** + * Count of active users in the date range. + */ + activeUsersCount?: string; + + /** + * Fractional change in active_users_count vs previous period. Computed as + * (current - previous) / previous. + */ + activeUsersTrend?: number; + + /** + * Average environment runtime in seconds per active user. + */ + envRuntimePerUserSeconds?: number; + + /** + * Fractional change in env_runtime_per_user_seconds vs previous period. Computed + * as (current - previous) / previous. + */ + envRuntimePerUserTrend?: number; + + /** + * Count of power users in the date range. + */ + powerUsersCount?: string; + + /** + * Threshold in seconds used to determine power users. Displayed to users so they + * understand the definition. + */ + powerUsersThresholdSeconds?: string; + + /** + * Fractional change in power_users_count vs previous period. Computed as + * (current - previous) / previous. + */ + powerUsersTrend?: number; + + /** + * Count of environment sessions (total starts) in the date range. + */ + sessionsCount?: string; + + /** + * Fractional change in sessions_count vs previous period. Computed as (current - + * previous) / previous. + */ + sessionsTrend?: number; + + /** + * Sparkline data for the card's trend line (typically ~4 weekly points). + */ + sparkline?: Array; +} + +export interface UsageGetAgentTraceSummaryResponse { + /** + * Sparkline data for card rendering. + */ + sparkline?: Array; + + /** + * Summary totals and trends for the requested date range. + */ + summary?: AgentTraceSummary; +} + +export interface UsageGetAgentTraceTimeSeriesResponse { + /** + * Time series of agent trace stats, bucketed by the requested resolution. + */ + timeSeries?: Array; +} + +export interface UsageGetCoAuthorSummaryResponse { + /** + * Sparkline data for card rendering. + */ + sparkline?: Array; + + /** + * Summary totals and trends for the requested date range. + */ + summary?: CoAuthorSummary; +} + +export interface UsageGetCoAuthorTimeSeriesResponse { + /** + * Time series of contribution stats, bucketed by the requested resolution. + */ + timeSeries?: Array; +} + +export interface UsageGetPrSummaryResponse { + /** + * Sparkline data for card rendering. + */ + sparkline?: Array; + + /** + * Summary totals and trends for the requested date range. + */ + summary?: PrSummary; +} + +export interface UsageGetPrTimeSeriesResponse { + /** + * Time series of PR speed metrics, bucketed by the requested resolution. + */ + timeSeries?: Array; +} + +export interface UsageGetAdoptionUsageSummaryParams { + /** + * Date range to query metrics within. + */ + dateRange: Shared.DateRange; + + /** + * Optional project ID to filter metrics by. + */ + projectId?: string; + + /** + * Optional team ID to scope results to members of a specific team. + */ + teamId?: string; + + /** + * Optional user ID to filter metrics for a specific user (personal insights view). + */ + userId?: string; +} + +export interface UsageGetAgentTraceSummaryParams { + /** + * Date range to query within. + */ + dateRange: Shared.DateRange; + + /** + * Optional project ID to scope results. + */ + projectId?: string; + + /** + * Optional team ID to scope results to a specific team. Mutually exclusive with + * user_id. + */ + teamId?: string; + + /** + * Optional user ID to scope results to a specific user. Mutually exclusive with + * team_id. + */ + userId?: string; +} + +export interface UsageGetAgentTraceTimeSeriesParams { + /** + * Date range to query within. + */ + dateRange: Shared.DateRange; + + /** + * Optional project ID to scope results. + */ + projectId?: string; + + /** + * Time resolution for the series data. + */ + resolution?: Resolution; + + /** + * Optional team ID to scope results to a specific team. Mutually exclusive with + * user_id. + */ + teamId?: string; + + /** + * Optional user ID to scope results to a specific user. Mutually exclusive with + * team_id. + */ + userId?: string; +} + +export interface UsageGetCoAuthorSummaryParams { + /** + * Date range to query within. + */ + dateRange: Shared.DateRange; + + /** + * Optional project ID to scope results. + */ + projectId?: string; + + /** + * Optional team ID to scope results to a specific team. Mutually exclusive with + * user_id. + */ + teamId?: string; + + /** + * Optional user ID to scope results to a specific user. Mutually exclusive with + * team_id. + */ + userId?: string; +} + +export interface UsageGetCoAuthorTimeSeriesParams { + /** + * Date range to query within. + */ + dateRange: Shared.DateRange; + + /** + * Optional project ID to scope results. + */ + projectId?: string; + + /** + * Time resolution for the series data. + */ + resolution?: Resolution; + + /** + * Optional team ID to scope results to a specific team. Mutually exclusive with + * user_id. + */ + teamId?: string; + + /** + * Optional user ID to scope results to a specific user. Mutually exclusive with + * team_id. + */ + userId?: string; +} + +export interface UsageGetPrSummaryParams { + /** + * Date range to query within. + */ + dateRange: Shared.DateRange; + + /** + * Optional project ID to scope results. + */ + projectId?: string; + + /** + * Optional team ID to scope results to a specific team. Mutually exclusive with + * user_id. + */ + teamId?: string; + + /** + * Optional user ID to scope results to a specific user. Mutually exclusive with + * team_id. + */ + userId?: string; +} + +export interface UsageGetPrTimeSeriesParams { + /** + * Date range to query within. + */ + dateRange: Shared.DateRange; + + /** + * Optional project ID to scope results. + */ + projectId?: string; + + /** + * Time resolution for the series data. + */ + resolution?: Resolution; + + /** + * Optional team ID to scope results to a specific team. Mutually exclusive with + * user_id. + */ + teamId?: string; + + /** + * Optional user ID to scope results to a specific user. Mutually exclusive with + * team_id. + */ + userId?: string; +} + export interface UsageListEnvironmentRuntimeRecordsParams extends RecordsPageParams { /** * Body param: Filter options. @@ -133,7 +1064,7 @@ export namespace UsageListEnvironmentRuntimeRecordsParams { /** * Date range to query runtime records within. */ - dateRange: Filter.DateRange; + dateRange: Shared.DateRange; /** * Optional project ID to filter runtime records by. @@ -141,23 +1072,6 @@ export namespace UsageListEnvironmentRuntimeRecordsParams { projectId?: string; } - export namespace Filter { - /** - * Date range to query runtime records within. - */ - export interface DateRange { - /** - * End time of the date range (exclusive). - */ - endTime: string; - - /** - * Start time of the date range (inclusive). - */ - startTime: string; - } - } - /** * Pagination options. */ @@ -178,8 +1092,34 @@ export namespace UsageListEnvironmentRuntimeRecordsParams { export declare namespace Usage { export { + type AgentTraceModelBreakdown as AgentTraceModelBreakdown, + type AgentTraceSummary as AgentTraceSummary, + type AgentTraceTimeBucket as AgentTraceTimeBucket, + type CoAuthorSummary as CoAuthorSummary, + type CoAuthorTimeBucket as CoAuthorTimeBucket, + type CoAuthorTool as CoAuthorTool, type EnvironmentUsageRecord as EnvironmentUsageRecord, + type PrSummary as PrSummary, + type PrTimeBucket as PrTimeBucket, + type Resolution as Resolution, + type SupportedModel as SupportedModel, + type TimeSeriesPoint as TimeSeriesPoint, + type ToolBreakdown as ToolBreakdown, + type UsageGetAdoptionUsageSummaryResponse as UsageGetAdoptionUsageSummaryResponse, + type UsageGetAgentTraceSummaryResponse as UsageGetAgentTraceSummaryResponse, + type UsageGetAgentTraceTimeSeriesResponse as UsageGetAgentTraceTimeSeriesResponse, + type UsageGetCoAuthorSummaryResponse as UsageGetCoAuthorSummaryResponse, + type UsageGetCoAuthorTimeSeriesResponse as UsageGetCoAuthorTimeSeriesResponse, + type UsageGetPrSummaryResponse as UsageGetPrSummaryResponse, + type UsageGetPrTimeSeriesResponse as UsageGetPrTimeSeriesResponse, type EnvironmentUsageRecordsRecordsPage as EnvironmentUsageRecordsRecordsPage, + type UsageGetAdoptionUsageSummaryParams as UsageGetAdoptionUsageSummaryParams, + type UsageGetAgentTraceSummaryParams as UsageGetAgentTraceSummaryParams, + type UsageGetAgentTraceTimeSeriesParams as UsageGetAgentTraceTimeSeriesParams, + type UsageGetCoAuthorSummaryParams as UsageGetCoAuthorSummaryParams, + type UsageGetCoAuthorTimeSeriesParams as UsageGetCoAuthorTimeSeriesParams, + type UsageGetPrSummaryParams as UsageGetPrSummaryParams, + type UsageGetPrTimeSeriesParams as UsageGetPrTimeSeriesParams, type UsageListEnvironmentRuntimeRecordsParams as UsageListEnvironmentRuntimeRecordsParams, }; } diff --git a/src/version.ts b/src/version.ts index e2b0672c..b67001ee 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.14.0'; // x-release-please-version +export const VERSION = '0.15.0'; // x-release-please-version diff --git a/tests/api-resources/automations.test.ts b/tests/api-resources/automations.test.ts index 0da8a86f..4e284185 100644 --- a/tests/api-resources/automations.test.ts +++ b/tests/api-resources/automations.test.ts @@ -38,25 +38,15 @@ describe('resource automations', () => { 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' }, }, ], }, + codexSettings: { + model: 'CODEX_OPEN_AI_MODEL_UNSPECIFIED', + reasoningEffort: 'CODEX_REASONING_EFFORT_UNSPECIFIED', + serviceTier: 'CODEX_SERVICE_TIER_UNSPECIFIED', + }, description: 'description', executor: { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', principal: 'PRINCIPAL_UNSPECIFIED' }, name: 'name', @@ -75,21 +65,6 @@ describe('resource automations', () => { 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' }, }, ], @@ -109,6 +84,7 @@ describe('resource automations', () => { manual: {}, pullRequest: { events: ['PULL_REQUEST_EVENT_UNSPECIFIED'], + integrationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', webhookId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }, time: { cronExpression: 'cronExpression' }, diff --git a/tests/api-resources/billing.test.ts b/tests/api-resources/billing.test.ts new file mode 100644 index 00000000..03cce964 --- /dev/null +++ b/tests/api-resources/billing.test.ts @@ -0,0 +1,213 @@ +// 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 billing', () => { + // Mock server tests are disabled + test.skip('getCreditUsageExport: only required params', async () => { + const responsePromise = client.billing.getCreditUsageExport({ + dateRange: { endTime: '2024-01-31T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + organizationId: '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('getCreditUsageExport: required and optional params', async () => { + const response = await client.billing.getCreditUsageExport({ + dateRange: { endTime: '2024-01-31T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + groupBy: 'CREDIT_USAGE_EXPORT_GROUP_BY_DAILY_SUMMARY', + }); + }); + + // Mock server tests are disabled + test.skip('getCreditUsageReport: only required params', async () => { + const responsePromise = client.billing.getCreditUsageReport({ + dateRange: { endTime: '2024-01-31T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + organizationId: '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('getCreditUsageReport: required and optional params', async () => { + const response = await client.billing.getCreditUsageReport({ + dateRange: { endTime: '2024-01-31T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + filter: { subject: { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', principal: 'PRINCIPAL_UNSPECIFIED' } }, + timezone: 'timezone', + }); + }); + + // Mock server tests are disabled + test.skip('getCumulativeCreditUsage: only required params', async () => { + const responsePromise = client.billing.getCumulativeCreditUsage({ + organizationId: '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('getCumulativeCreditUsage: required and optional params', async () => { + const response = await client.billing.getCumulativeCreditUsage({ + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + asOf: '2026-03-31T23:59:59Z', + }); + }); + + // Mock server tests are disabled + test.skip('getEnterpriseAIUsageSummary: only required params', async () => { + const responsePromise = client.billing.getEnterpriseAIUsageSummary({ + dateRange: { endTime: '2024-01-31T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + organizationId: '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('getEnterpriseAIUsageSummary: required and optional params', async () => { + const response = await client.billing.getEnterpriseAIUsageSummary({ + dateRange: { endTime: '2024-01-31T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + timezone: 'timezone', + }); + }); + + // Mock server tests are disabled + test.skip('getEnterpriseAIUsageTimeSeries: only required params', async () => { + const responsePromise = client.billing.getEnterpriseAIUsageTimeSeries({ + dateRange: { endTime: '2024-01-31T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + organizationId: '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('getEnterpriseAIUsageTimeSeries: required and optional params', async () => { + const response = await client.billing.getEnterpriseAIUsageTimeSeries({ + dateRange: { endTime: '2024-01-31T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + filter: { subject: { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', principal: 'PRINCIPAL_UNSPECIFIED' } }, + timezone: 'timezone', + }); + }); + + // Mock server tests are disabled + test.skip('listEnterpriseAITeamUsage: only required params', async () => { + const responsePromise = client.billing.listEnterpriseAITeamUsage({ + dateRange: { endTime: '2024-01-31T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + organizationId: '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('listEnterpriseAITeamUsage: required and optional params', async () => { + const response = await client.billing.listEnterpriseAITeamUsage({ + dateRange: { endTime: '2024-01-31T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + token: 'token', + pageSize: 0, + filter: { teamIds: ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'] }, + pagination: { token: 'token', pageSize: 100 }, + timezone: 'timezone', + }); + }); + + // Mock server tests are disabled + test.skip('listEnterpriseAIUserUsage: only required params', async () => { + const responsePromise = client.billing.listEnterpriseAIUserUsage({ + dateRange: { endTime: '2024-01-31T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + organizationId: '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('listEnterpriseAIUserUsage: required and optional params', async () => { + const response = await client.billing.listEnterpriseAIUserUsage({ + dateRange: { endTime: '2024-01-31T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + token: 'token', + pageSize: 0, + filter: { subject: { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', principal: 'PRINCIPAL_UNSPECIFIED' } }, + pagination: { token: 'token', pageSize: 100 }, + sort: { field: 'SORT_FIELD_UNSPECIFIED', order: 'SORT_ORDER_UNSPECIFIED' }, + timezone: 'timezone', + }); + }); + + // Mock server tests are disabled + test.skip('listEnterpriseUserCreditUsage: only required params', async () => { + const responsePromise = client.billing.listEnterpriseUserCreditUsage({ + organizationId: '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('listEnterpriseUserCreditUsage: required and optional params', async () => { + const response = await client.billing.listEnterpriseUserCreditUsage({ + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + token: 'token', + pageSize: 0, + asOf: '2019-12-27T18:11:19.117Z', + pagination: { token: 'token', pageSize: 50 }, + sort: { field: 'SORT_FIELD_UNSPECIFIED', order: 'SORT_ORDER_UNSPECIFIED' }, + }); + }); +}); diff --git a/tests/api-resources/errors.test.ts b/tests/api-resources/errors.test.ts deleted file mode 100644 index ee413092..00000000 --- a/tests/api-resources/errors.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -// 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 errors', () => { - // Mock server tests are disabled - test.skip('reportErrors', async () => { - const responsePromise = client.errors.reportErrors({}); - 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/events.test.ts b/tests/api-resources/events.test.ts index 7cfdf0e8..838655bb 100644 --- a/tests/api-resources/events.test.ts +++ b/tests/api-resources/events.test.ts @@ -8,6 +8,27 @@ const client = new Gitpod({ }); describe('resource events', () => { + // Mock server tests are disabled + test.skip('retrieve: only required params', async () => { + const responsePromise = client.events.retrieve({ + auditLogEntryId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + }); + 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('retrieve: required and optional params', async () => { + const response = await client.events.retrieve({ + auditLogEntryId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + }); + }); + // Mock server tests are disabled test.skip('list', async () => { const responsePromise = client.events.list({}); diff --git a/tests/api-resources/organizations/policies.test.ts b/tests/api-resources/organizations/policies.test.ts index 7fd9de1a..ca502ead 100644 --- a/tests/api-resources/organizations/policies.test.ts +++ b/tests/api-resources/organizations/policies.test.ts @@ -48,6 +48,11 @@ describe('resource policies', () => { const response = await client.organizations.policies.update({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', agentPolicy: { + allowedAgentIds: ['string'], + allowedCodexModels: ['CODEX_OPEN_AI_MODEL_UNSPECIFIED'], + allowedCodexReasoningEfforts: ['CODEX_REASONING_EFFORT_UNSPECIFIED'], + allowedCodexServiceTiers: ['CODEX_SERVICE_TIER_UNSPECIFIED'], + codexModelPolicy: { modelStates: { foo: 'CODEX_MODEL_POLICY_STATE_UNSPECIFIED' } }, commandDenyList: ['string'], conversationSharingPolicy: 'CONVERSATION_SHARING_POLICY_UNSPECIFIED', maxSubagentsPerEnvironment: 10, @@ -60,11 +65,13 @@ describe('resource policies', () => { defaultEditorId: 'defaultEditorId', defaultEnvironmentImage: 'defaultEnvironmentImage', deleteArchivedEnvironmentsAfter: '+9125115.360s', + disableFromScratch: true, editorVersionRestrictions: { foo: { allowedVersions: ['string'] } }, maximumEnvironmentLifetime: '+9125115.360s', maximumEnvironmentsPerUser: '20', maximumEnvironmentTimeout: '3600s', maximumRunningEnvironmentsPerUser: '5', + maxPortAdmissionLevel: 'ADMISSION_LEVEL_UNSPECIFIED', membersCreateProjects: true, membersRequireProjects: true, portSharingDisabled: true, @@ -79,11 +86,13 @@ describe('resource policies', () => { tags: 'tags', }, }, + securityPolicyId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', vetoExecPolicy: { action: 'KERNEL_CONTROLS_ACTION_UNSPECIFIED', enabled: true, executables: ['string'], }, + webBrowserDisabled: true, }); }); }); diff --git a/tests/api-resources/organizations/scim-configurations.test.ts b/tests/api-resources/organizations/scim-configurations.test.ts index bf121156..0da9bb8e 100644 --- a/tests/api-resources/organizations/scim-configurations.test.ts +++ b/tests/api-resources/organizations/scim-configurations.test.ts @@ -28,6 +28,7 @@ describe('resource scimConfigurations', () => { const response = await client.organizations.scimConfigurations.create({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + allowUnverifiedEmailAccountLinking: true, name: 'name', tokenExpiresIn: '+9125115.360s', }); @@ -72,6 +73,7 @@ describe('resource scimConfigurations', () => { test.skip('update: required and optional params', async () => { const response = await client.organizations.scimConfigurations.update({ scimConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + allowUnverifiedEmailAccountLinking: true, enabled: false, name: 'name', ssoConfigurationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', diff --git a/tests/api-resources/security-policies.test.ts b/tests/api-resources/security-policies.test.ts new file mode 100644 index 00000000..3364d280 --- /dev/null +++ b/tests/api-resources/security-policies.test.ts @@ -0,0 +1,90 @@ +// 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 securityPolicies', () => { + // Mock server tests are disabled + test.skip('create: only required params', async () => { + const responsePromise = client.securityPolicies.create({ + metadata: {}, + spec: {}, + }); + 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.securityPolicies.create({ + metadata: { name: 'Veto Exec audit-first' }, + spec: { + executables: { + defaultEffect: 'EFFECT_ALLOW', + rules: [ + { effect: 'EFFECT_AUDIT', path: 'npx' }, + { effect: 'EFFECT_BLOCK', path: '/usr/bin/curl' }, + ], + }, + }, + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + }); + }); + + // Mock server tests are disabled + test.skip('retrieve', async () => { + const responsePromise = client.securityPolicies.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.securityPolicies.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.securityPolicies.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.securityPolicies.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); + }); +}); diff --git a/tests/api-resources/usage.test.ts b/tests/api-resources/usage.test.ts index 5fc407b3..62f6e5f0 100644 --- a/tests/api-resources/usage.test.ts +++ b/tests/api-resources/usage.test.ts @@ -8,6 +8,177 @@ const client = new Gitpod({ }); describe('resource usage', () => { + // Mock server tests are disabled + test.skip('getAdoptionUsageSummary: only required params', async () => { + const responsePromise = client.usage.getAdoptionUsageSummary({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + }); + 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('getAdoptionUsageSummary: required and optional params', async () => { + const response = await client.usage.getAdoptionUsageSummary({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + teamId: 'teamId', + userId: 'userId', + }); + }); + + // Mock server tests are disabled + test.skip('getAgentTraceSummary: only required params', async () => { + const responsePromise = client.usage.getAgentTraceSummary({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + }); + 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('getAgentTraceSummary: required and optional params', async () => { + const response = await client.usage.getAgentTraceSummary({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + teamId: 'teamId', + userId: 'userId', + }); + }); + + // Mock server tests are disabled + test.skip('getAgentTraceTimeSeries: only required params', async () => { + const responsePromise = client.usage.getAgentTraceTimeSeries({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + }); + 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('getAgentTraceTimeSeries: required and optional params', async () => { + const response = await client.usage.getAgentTraceTimeSeries({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + resolution: 'RESOLUTION_WEEKLY', + teamId: 'teamId', + userId: 'userId', + }); + }); + + // Mock server tests are disabled + test.skip('getCoAuthorSummary: only required params', async () => { + const responsePromise = client.usage.getCoAuthorSummary({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + }); + 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('getCoAuthorSummary: required and optional params', async () => { + const response = await client.usage.getCoAuthorSummary({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + teamId: 'teamId', + userId: 'userId', + }); + }); + + // Mock server tests are disabled + test.skip('getCoAuthorTimeSeries: only required params', async () => { + const responsePromise = client.usage.getCoAuthorTimeSeries({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + }); + 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('getCoAuthorTimeSeries: required and optional params', async () => { + const response = await client.usage.getCoAuthorTimeSeries({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + resolution: 'RESOLUTION_WEEKLY', + teamId: 'teamId', + userId: 'userId', + }); + }); + + // Mock server tests are disabled + test.skip('getPrSummary: only required params', async () => { + const responsePromise = client.usage.getPrSummary({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + }); + 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('getPrSummary: required and optional params', async () => { + const response = await client.usage.getPrSummary({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + teamId: 'teamId', + userId: 'userId', + }); + }); + + // Mock server tests are disabled + test.skip('getPrTimeSeries: only required params', async () => { + const responsePromise = client.usage.getPrTimeSeries({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + }); + 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('getPrTimeSeries: required and optional params', async () => { + const response = await client.usage.getPrTimeSeries({ + dateRange: { endTime: '2024-02-01T00:00:00Z', startTime: '2024-01-01T00:00:00Z' }, + projectId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + resolution: 'RESOLUTION_WEEKLY', + teamId: 'teamId', + userId: 'userId', + }); + }); + // Mock server tests are disabled test.skip('listEnvironmentRuntimeRecords', async () => { const responsePromise = client.usage.listEnvironmentRuntimeRecords({}); diff --git a/tests/uploads.test.ts b/tests/uploads.test.ts index 27bf8b32..a4e518e5 100644 --- a/tests/uploads.test.ts +++ b/tests/uploads.test.ts @@ -1,7 +1,6 @@ import fs from 'fs'; import type { ResponseLike } from '@gitpod/sdk/internal/to-file'; import { toFile } from '@gitpod/sdk/core/uploads'; -import { File } from 'node:buffer'; class MyClass { name: string = 'foo'; diff --git a/yarn.lock b/yarn.lock index 9d562436..289b05f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,12 +12,12 @@ resolved "https://registry.yarnpkg.com/@andrewbranch/untar.js/-/untar.js-1.0.3.tgz#ba9494f85eb83017c5c855763969caf1d0adea00" integrity sha512-Jh15/qVmrLGhkKJBdXlK1+9tY4lZruYjsgkDFj08ZmDiWVBLJcqkok7Z0/R0In+i1rScBpJlSvrTS2Lm41Pbnw== -"@arethetypeswrong/cli@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@arethetypeswrong/cli/-/cli-0.17.0.tgz#f97f10926b3f9f9eb5117550242d2e06c25cadac" - integrity sha512-xSMW7bfzVWpYw5JFgZqBXqr6PdR0/REmn3DkxCES5N0JTcB0CVgbIynJCvKBFmXaPc3hzmmTrb7+yPDRoOSZdA== +"@arethetypeswrong/cli@^0.18.0": + version "0.18.4" + resolved "https://registry.yarnpkg.com/@arethetypeswrong/cli/-/cli-0.18.4.tgz#c31f54f3b0d0e0f3256ab3edb6530beeb5e64b4b" + integrity sha512-kNWo6LTzGAuLYPpJ7Sgo63whSUeeSuKMlYx6IBgzs4ONEG807gW4hSSENvpeCHzO2H2wIzG5EFl0OKBbqGBAyA== dependencies: - "@arethetypeswrong/core" "0.17.0" + "@arethetypeswrong/core" "0.18.4" chalk "^4.1.2" cli-table3 "^0.6.3" commander "^10.0.1" @@ -25,15 +25,16 @@ marked-terminal "^7.1.0" semver "^7.5.4" -"@arethetypeswrong/core@0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@arethetypeswrong/core/-/core-0.17.0.tgz#abb3b5f425056d37193644c2a2de4aecf866b76b" - integrity sha512-FHyhFizXNetigTVsIhqXKGYLpazPS5YNojEPpZEUcBPt9wVvoEbNIvG+hybuBR+pjlRcbyuqhukHZm1fr+bDgA== +"@arethetypeswrong/core@0.18.4": + version "0.18.4" + resolved "https://registry.yarnpkg.com/@arethetypeswrong/core/-/core-0.18.4.tgz#24edea3d651dea7d32bf6f1cc9ee9a00db39de49" + integrity sha512-M5F0ePyN6h2Z6XxRiyIPqjGbltotXLjR0CKA0uKspsDu0QmgTNYvRb4RSQPMUs2ZXZHCCYpbaZbFbYOXLxCjUA== dependencies: "@andrewbranch/untar.js" "^1.0.3" + "@loaderkit/resolve" "^1.0.2" cjs-module-lexer "^1.2.3" - fflate "^0.8.2" - lru-cache "^10.4.3" + fflate "^0.8.3" + lru-cache "^11.0.1" semver "^7.5.4" typescript "5.6.1-rc" validate-npm-package-name "^5.0.0" @@ -306,6 +307,11 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@braidai/lang@^1.0.0": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@braidai/lang/-/lang-1.1.2.tgz#65bc2bc1db6d00e153b95ac7006f4573e289e9be" + integrity sha512-qBcknbBufNHlui137Hft8xauQMTZDKdophmLFv05r2eNmdIv/MlPuP4TdUknHG68UdWLgVZwgxVe735HzJNIwA== + "@colors/colors@1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" @@ -688,6 +694,13 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@loaderkit/resolve@^1.0.2": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@loaderkit/resolve/-/resolve-1.0.6.tgz#8d45341e688faecc25b3ae919c0f45d94c4e26c9" + integrity sha512-G8FdIoF5CypfwmD9rl8BXod5HDn8JqB0CCNBXDTaRZ+yRYhARrrSToX1zg1zy9jX3zLqigsELwhT4gNtkdQAUg== + dependencies: + "@braidai/lang" "^1.0.0" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -709,11 +722,6 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@pkgr/core@^0.2.4": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.4.tgz#d897170a2b0ba51f78a099edccd968f7b103387c" - integrity sha512-ROFF39F6ZrnzSUEmQQZUar0Jt4xVoP9WnDRdWwF4NNcXs3xBTLgBUDoOwW141y1jP+S8nahIbdxbFC7IShw9Iw== - "@sinclair/typebox@^0.27.8": version "0.27.8" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" @@ -1268,9 +1276,9 @@ bcrypt-pbkdf@^1.0.0, bcrypt-pbkdf@^1.0.2: tweetnacl "^0.14.3" 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== + version "2.1.4" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.4.tgz#589dab11c0018d0366be64cd8bf12c8dbecc8326" + integrity sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg== dependencies: balanced-match "^1.0.0" @@ -1591,14 +1599,6 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-plugin-prettier@^5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.4.1.tgz#99b55d7dd70047886b2222fdd853665f180b36af" - integrity sha512-9dF+KuU/Ilkq27A8idRP7N2DH8iUR6qXcjF3FR2wETY21PZdBrIjwCau8oboyGj9b7etWmTGEeM8e7oOed6ZWg== - dependencies: - prettier-linter-helpers "^1.0.0" - synckit "^0.11.7" - eslint-plugin-unused-imports@^4.1.4: version "4.1.4" resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.1.4.tgz#62ddc7446ccbf9aa7b6f1f0b00a980423cda2738" @@ -1750,11 +1750,6 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-diff@^1.1.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" - integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== - fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" @@ -1790,10 +1785,10 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fflate@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.2.tgz#fc8631f5347812ad6028bbe4a2308b2792aa1dea" - integrity sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A== +fflate@^0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.3.tgz#bc27d8eb30343d4d512abb03480202ce65d825fc" + integrity sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA== file-entry-cache@^8.0.0: version "8.0.0" @@ -2596,10 +2591,10 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lru-cache@^10.4.3: - version "10.4.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" - integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== +lru-cache@^11.0.1: + version "11.5.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.5.2.tgz#00e16665c90c620fba14a3c368732a976493f760" + integrity sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g== lru-cache@^5.1.1: version "5.1.1" @@ -2934,13 +2929,6 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - prettier@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848" @@ -3263,13 +3251,6 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -synckit@^0.11.7: - version "0.11.8" - resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.11.8.tgz#b2aaae998a4ef47ded60773ad06e7cb821f55457" - integrity sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A== - dependencies: - "@pkgr/core" "^0.2.4" - test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" @@ -3343,9 +3324,9 @@ ts-node@^10.5.0: v8-compile-cache-lib "^3.0.0" yn "3.1.1" -"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz": - version "1.1.9" - resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz#777f6f5d9e26bf0e94e5170990dd3a841d6707cd" +"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz": + version "1.1.11" + resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz#010247051be13b55abdc98f787c017285149f4f2" dependencies: debug "^4.3.7" fast-glob "^3.3.2"