diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 001eb2c..2be9c43 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.2" + ".": "0.2.0" } diff --git a/.stats.yml b/.stats.yml index 4f2abc7..296014e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-27f7bd641de1e4657ad8ce84a456fe0c5e8f1e14779bf1f567a4bc8667eba4da.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f6598ab5d6827f66b642201769e92590ea32af84ebbf24b18cc32b33dee5107e.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a9eb6b..0142833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.2.0 (2025-02-18) + +Full Changelog: [v0.1.2...v0.2.0](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.1.2...v0.2.0) + +### Features + +* **api:** manual updates ([#20](https://github.com/gitpod-io/gitpod-sdk-typescript/issues/20)) ([e935d2b](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e935d2b37a8710c5f8d002b1c6f32529706a4693)) +* **api:** manual updates ([#22](https://github.com/gitpod-io/gitpod-sdk-typescript/issues/22)) ([8eea1c9](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/8eea1c93c572b76e4317f58e8d5549c4b49387f3)) +* **api:** Organizations Open API docs ([#18](https://github.com/gitpod-io/gitpod-sdk-typescript/issues/18)) ([c6c8b20](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/c6c8b2098433a1246329f4dec7371e2ae2963b01)) + + +### Chores + +* **internal:** fix tests not always being type checked ([#21](https://github.com/gitpod-io/gitpod-sdk-typescript/issues/21)) ([5b68e63](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/5b68e634ad747b78ee55b4d30920f010953422be)) + ## 0.1.2 (2025-02-14) Full Changelog: [v0.1.1...v0.1.2](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.1.1...v0.1.2) diff --git a/api.md b/api.md index 9eb234c..ac4a55a 100644 --- a/api.md +++ b/api.md @@ -2,8 +2,10 @@ Types: +- ArbitraryData - AutomationTrigger - EnvironmentClass +- ErrorCode - FieldValue - OrganizationRole - Principal diff --git a/package.json b/package.json index bdcbe73..ba3b029 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gitpod/sdk", - "version": "0.1.2", + "version": "0.2.0", "description": "The official TypeScript library for the Gitpod API", "author": "Gitpod ", "types": "dist/index.d.ts", diff --git a/scripts/lint b/scripts/lint index 726708c..3ffb78a 100755 --- a/scripts/lint +++ b/scripts/lint @@ -8,7 +8,10 @@ echo "==> Running eslint" ./node_modules/.bin/eslint . echo "==> Building" -./scripts/build # also checks types +./scripts/build + +echo "==> Checking types" +./node_modules/typescript/bin/tsc echo "==> Running Are The Types Wrong?" ./node_modules/.bin/attw --pack dist -f json >.attw.json || true diff --git a/src/client.ts b/src/client.ts index b166c8a..c118587 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1145,8 +1145,10 @@ export declare namespace Gitpod { type UserSetSuspendedParams as UserSetSuspendedParams, }; + export type ArbitraryData = API.ArbitraryData; export type AutomationTrigger = API.AutomationTrigger; export type EnvironmentClass = API.EnvironmentClass; + export type ErrorCode = API.ErrorCode; export type FieldValue = API.FieldValue; export type OrganizationRole = API.OrganizationRole; export type Principal = API.Principal; diff --git a/src/error.ts b/src/error.ts index 0e55642..1169f9b 100644 --- a/src/error.ts +++ b/src/error.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { castToError } from './internal/errors'; +import * as Shared from './resources/shared'; export class GitpodError extends Error {} @@ -16,11 +17,26 @@ export class APIError< /** JSON body of the response that caused the error */ readonly error: TError; + /** + * The status code, which should be an enum value of + * [google.rpc.Code][google.rpc.Code]. + */ + readonly code?: Shared.ErrorCode | undefined; + /** + * Contains an arbitrary serialized message along with a @type that describes the + * type of the serialized message. + */ + readonly detail?: Shared.ArbitraryData | undefined; + constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) { super(`${APIError.makeMessage(status, error, message)}`); this.status = status; this.headers = headers; this.error = error; + + const data = error as Record; + this.code = data?.['code']; + this.detail = data?.['detail']; } private static makeMessage(status: number | undefined, error: any, message: string | undefined) { diff --git a/src/resources/accounts.ts b/src/resources/accounts.ts index 1b70feb..6704ddc 100644 --- a/src/resources/accounts.ts +++ b/src/resources/accounts.ts @@ -8,22 +8,81 @@ import { RequestOptions } from '../internal/request-options'; export class Accounts extends APIResource { /** - * GetAccount retrieves a single Account. + * Gets information about the currently authenticated account. + * + * Use this method to: + * + * - Retrieve account profile information + * - Check organization memberships + * - View account settings + * - Get joinable organizations + * + * ### Examples + * + * - Get account details: + * + * Retrieves information about the authenticated account. + * + * ```yaml + * {} + * ``` */ retrieve(body: AccountRetrieveParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.AccountService/GetAccount', { body, ...options }); } /** - * DeleteAccount deletes an Account. To Delete an Account, the Account must not be - * an active member of any Organization. + * Deletes an account permanently. + * + * Use this method to: + * + * - Remove unused accounts + * - Clean up test accounts + * - Complete account deletion requests + * + * The account must not be an active member of any organization. + * + * ### Examples + * + * - Delete account: + * + * Permanently removes an account. + * + * ```yaml + * accountId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + * ``` */ delete(body: AccountDeleteParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.AccountService/DeleteAccount', { body, ...options }); } /** - * GetSSOLoginURL returns the URL to redirect the user to for SSO login. + * Gets the SSO login URL for a specific email domain. + * + * Use this method to: + * + * - Initiate SSO authentication + * - Get organization-specific login URLs + * - Handle SSO redirects + * + * ### Examples + * + * - Get login URL: + * + * Retrieves SSO URL for email domain. + * + * ```yaml + * email: "user@company.com" + * ``` + * + * - Get URL with return path: + * + * Gets SSO URL with specific return location. + * + * ```yaml + * email: "user@company.com" + * returnTo: "https://gitpod.io/workspaces" + * ``` */ getSSOLoginURL( body: AccountGetSSOLoginURLParams, @@ -33,8 +92,35 @@ export class Accounts extends APIResource { } /** - * ListLoginProviders returns the list of login providers matching the provided - * filters. + * Lists available login providers with optional filtering. + * + * Use this method to: + * + * - View supported authentication methods + * - Get provider-specific login URLs + * - Filter providers by invite + * + * ### Examples + * + * - List all providers: + * + * Shows all available login providers. + * + * ```yaml + * pagination: + * pageSize: 20 + * ``` + * + * - List for specific invite: + * + * Shows providers available for an invite. + * + * ```yaml + * filter: + * inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * pagination: + * pageSize: 20 + * ``` */ listLoginProviders( params: AccountListLoginProvidersParams, diff --git a/src/resources/editors.ts b/src/resources/editors.ts index ac5e5de..11232fc 100644 --- a/src/resources/editors.ts +++ b/src/resources/editors.ts @@ -7,14 +7,47 @@ import { RequestOptions } from '../internal/request-options'; export class Editors extends APIResource { /** - * GetEditor returns the editor with the given ID + * Gets details about a specific editor. + * + * Use this method to: + * + * - View editor information + * - Get editor configuration + * + * ### Examples + * + * - Get editor details: + * + * Retrieves information about a specific editor. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ retrieve(body: EditorRetrieveParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EditorService/GetEditor', { body, ...options }); } /** - * ListEditors lists all editors available to the caller + * Lists all available code editors. + * + * Use this method to: + * + * - View supported editors + * - Get editor capabilities + * - Browse editor options + * - Check editor availability + * + * ### Examples + * + * - List editors: + * + * Shows all available editors with pagination. + * + * ```yaml + * pagination: + * pageSize: 20 + * ``` */ list(params: EditorListParams, options?: RequestOptions): PagePromise { const { token, pageSize, ...body } = params; @@ -27,7 +60,26 @@ export class Editors extends APIResource { } /** - * ResolveEditorURL resolves the editor's URL for an environment + * Resolves the URL for accessing an editor in a specific environment. + * + * Use this method to: + * + * - Get editor access URLs + * - Launch editors for environments + * - Set up editor connections + * - Configure editor access + * + * ### Examples + * + * - Resolve editor URL: + * + * Gets the URL for accessing an editor in an environment. + * + * ```yaml + * editorId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * ``` */ resolveURL(body: EditorResolveURLParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EditorService/ResolveEditorURL', { body, ...options }); diff --git a/src/resources/environments/automations/automations.ts b/src/resources/environments/automations/automations.ts index 61fe991..9659f33 100644 --- a/src/resources/environments/automations/automations.ts +++ b/src/resources/environments/automations/automations.ts @@ -48,7 +48,40 @@ export class Automations extends APIResource { tasks: TasksAPI.Tasks = new TasksAPI.Tasks(this._client); /** - * UpsertAutomationsFile upserts the automations file for the given environment. + * Upserts the automations file for the given environment. + * + * Use this method to: + * + * - Configure environment automations + * - Update automation settings + * - Manage automation files + * + * ### Examples + * + * - Update automations file: + * + * Updates or creates the automations configuration. + * + * ```yaml + * environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + * automationsFile: + * services: + * web-server: + * name: "Web Server" + * description: "Development web server" + * commands: + * start: "npm run dev" + * ready: "curl -s http://localhost:3000" + * triggeredBy: + * - postDevcontainerStart + * tasks: + * build: + * name: "Build Project" + * description: "Builds the project artifacts" + * command: "npm run build" + * triggeredBy: + * - postEnvironmentStart + * ``` */ upsert(body: AutomationUpsertParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile', { diff --git a/src/resources/environments/automations/services.ts b/src/resources/environments/automations/services.ts index f45dc06..d674974 100644 --- a/src/resources/environments/automations/services.ts +++ b/src/resources/environments/automations/services.ts @@ -9,28 +9,154 @@ import { RequestOptions } from '../../../internal/request-options'; export class Services extends APIResource { /** - * CreateService + * Creates a new automation service for an environment. + * + * Use this method to: + * + * - Set up long-running services + * - Configure service triggers + * - Define service dependencies + * - Specify runtime environments + * + * ### Examples + * + * - Create basic service: + * + * Creates a simple service with start command. + * + * ```yaml + * environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + * metadata: + * reference: "web-server" + * name: "Web Server" + * description: "Runs the development web server" + * triggeredBy: + * - postDevcontainerStart: true + * spec: + * commands: + * start: "npm run dev" + * ready: "curl -s http://localhost:3000" + * ``` + * + * - Create Docker-based service: + * + * Creates a service running in a specific container. + * + * ```yaml + * environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + * metadata: + * reference: "redis" + * name: "Redis Server" + * description: "Redis cache service" + * spec: + * commands: + * start: "redis-server" + * runsOn: + * docker: + * image: "redis:7" + * ``` */ create(body: ServiceCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/CreateService', { body, ...options }); } /** - * GetService + * Gets details about a specific automation service. + * + * Use this method to: + * + * - Check service status + * - View service configuration + * - Monitor service health + * - Retrieve service metadata + * + * ### Examples + * + * - Get service details: + * + * Retrieves information about a specific service. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ retrieve(body: ServiceRetrieveParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/GetService', { body, ...options }); } /** - * UpdateService + * Updates an automation service configuration. + * + * Use this method to: + * + * - Modify service commands + * - Update triggers + * - Change runtime settings + * - Adjust dependencies + * + * ### Examples + * + * - Update commands: + * + * Changes service start and ready commands. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * spec: + * commands: + * start: "npm run start:dev" + * ready: "curl -s http://localhost:8080" + * ``` + * + * - Update triggers: + * + * Modifies when the service starts. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * metadata: + * triggeredBy: + * trigger: + * - postDevcontainerStart: true + * - manual: true + * ``` */ update(body: ServiceUpdateParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/UpdateService', { body, ...options }); } /** - * ListServices + * Lists automation services with optional filtering. + * + * Use this method to: + * + * - View all services in an environment + * - Filter services by reference + * - Monitor service status + * + * ### Examples + * + * - List environment services: + * + * Shows all services for an environment. + * + * ```yaml + * filter: + * environmentIds: ["07e03a28-65a5-4d98-b532-8ea67b188048"] + * pagination: + * pageSize: 20 + * ``` + * + * - Filter by reference: + * + * Lists services matching specific references. + * + * ```yaml + * filter: + * references: ["web-server", "database"] + * pagination: + * pageSize: 20 + * ``` */ list(params: ServiceListParams, options?: RequestOptions): PagePromise { const { token, pageSize, ...body } = params; @@ -42,26 +168,84 @@ export class Services extends APIResource { } /** - * DeleteService deletes a service. This call does not block until the service is + * Deletes an automation service. This call does not block until the service is * deleted. If the service is not stopped it will be stopped before deletion. + * + * Use this method to: + * + * - Remove unused services + * - Clean up service configurations + * - Stop and delete services + * + * ### Examples + * + * - Delete service: + * + * Removes a service after stopping it. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * force: false + * ``` + * + * - Force delete: + * + * Immediately removes a service. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * force: true + * ``` */ delete(body: ServiceDeleteParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/DeleteService', { body, ...options }); } /** - * StartService starts a service. This call does not block until the service is + * Starts an automation service. This call does not block until the service is * started. This call will not error if the service is already running or has been * started. + * + * Use this method to: + * + * - Start stopped services + * - Resume service operations + * - Trigger service initialization + * + * ### Examples + * + * - Start service: + * + * Starts a previously stopped service. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ start(body: ServiceStartParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/StartService', { body, ...options }); } /** - * StopService stops a service. This call does not block until the service is + * Stops an automation service. This call does not block until the service is * stopped. This call will not error if the service is already stopped or has been * stopped. + * + * Use this method to: + * + * - Pause service operations + * - Gracefully stop services + * - Prepare for updates + * + * ### Examples + * + * - Stop service: + * + * Gracefully stops a running service. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ stop(body: ServiceStopParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/StopService', { body, ...options }); @@ -71,7 +255,7 @@ export class Services extends APIResource { export type ServicesServicesPage = ServicesPage; export interface Service { - id?: string; + id: string; environmentId?: string; diff --git a/src/resources/environments/automations/tasks/executions.ts b/src/resources/environments/automations/tasks/executions.ts index 964a3bd..c1de401 100644 --- a/src/resources/environments/automations/tasks/executions.ts +++ b/src/resources/environments/automations/tasks/executions.ts @@ -9,7 +9,24 @@ import { RequestOptions } from '../../../../internal/request-options'; export class Executions extends APIResource { /** - * GetTaskExecution + * Gets details about a specific task execution. + * + * Use this method to: + * + * - Monitor execution progress + * - View execution logs + * - Check execution status + * - Debug failed executions + * + * ### Examples + * + * - Get execution details: + * + * Retrieves information about a specific task execution. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ retrieve(body: ExecutionRetrieveParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/GetTaskExecution', { @@ -19,7 +36,37 @@ export class Executions extends APIResource { } /** - * ListTaskExecutions + * Lists executions of automation tasks. + * + * Use this method to: + * + * - View task execution history + * - Monitor running tasks + * - Track task completion status + * + * ### Examples + * + * - List all executions: + * + * Shows execution history for all tasks. + * + * ```yaml + * filter: + * environmentIds: ["07e03a28-65a5-4d98-b532-8ea67b188048"] + * pagination: + * pageSize: 20 + * ``` + * + * - Filter by phase: + * + * Lists executions in specific phases. + * + * ```yaml + * filter: + * phases: ["TASK_EXECUTION_PHASE_RUNNING", "TASK_EXECUTION_PHASE_FAILED"] + * pagination: + * pageSize: 20 + * ``` */ list( params: ExecutionListParams, @@ -34,7 +81,23 @@ export class Executions extends APIResource { } /** - * StopTaskExecution + * Stops a running task execution. + * + * Use this method to: + * + * - Cancel long-running tasks + * - Stop failed executions + * - Interrupt task processing + * + * ### Examples + * + * - Stop execution: + * + * Stops a running task execution. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ stop(body: ExecutionStopParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/StopTaskExecution', { diff --git a/src/resources/environments/automations/tasks/tasks.ts b/src/resources/environments/automations/tasks/tasks.ts index a258c34..d113e00 100644 --- a/src/resources/environments/automations/tasks/tasks.ts +++ b/src/resources/environments/automations/tasks/tasks.ts @@ -20,28 +20,145 @@ export class Tasks extends APIResource { executions: ExecutionsAPI.Executions = new ExecutionsAPI.Executions(this._client); /** - * CreateTask + * Creates a new automation task. + * + * Use this method to: + * + * - Define one-off or scheduled tasks + * - Set up build or test automation + * - Configure task dependencies + * - Specify execution environments + * + * ### Examples + * + * - Create basic task: + * + * Creates a simple build task. + * + * ```yaml + * environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + * metadata: + * reference: "build" + * name: "Build Project" + * description: "Builds the project artifacts" + * triggeredBy: + * - postEnvironmentStart: true + * spec: + * command: "npm run build" + * ``` + * + * - Create task with dependencies: + * + * Creates a task that depends on other services. + * + * ```yaml + * environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" + * metadata: + * reference: "test" + * name: "Run Tests" + * description: "Runs the test suite" + * spec: + * command: "npm test" + * dependsOn: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] + * ``` */ create(body: TaskCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/CreateTask', { body, ...options }); } /** - * GetTask + * Gets details about a specific automation task. + * + * Use this method to: + * + * - Check task configuration + * - View task dependencies + * - Monitor task status + * + * ### Examples + * + * - Get task details: + * + * Retrieves information about a specific task. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ retrieve(body: TaskRetrieveParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/GetTask', { body, ...options }); } /** - * UpdateTask + * Updates an automation task configuration. + * + * Use this method to: + * + * - Modify task commands + * - Update task triggers + * - Change dependencies + * - Adjust execution settings + * + * ### Examples + * + * - Update command: + * + * Changes the task's command. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * spec: + * command: "npm run test:coverage" + * ``` + * + * - Update triggers: + * + * Modifies when the task runs. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * metadata: + * triggeredBy: + * trigger: + * - postEnvironmentStart: true + * ``` */ update(body: TaskUpdateParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/UpdateTask', { body, ...options }); } /** - * ListTasks + * Lists automation tasks with optional filtering. + * + * Use this method to: + * + * - View all tasks in an environment + * - Filter tasks by reference + * - Monitor task status + * + * ### Examples + * + * - List environment tasks: + * + * Shows all tasks for an environment. + * + * ```yaml + * filter: + * environmentIds: ["07e03a28-65a5-4d98-b532-8ea67b188048"] + * pagination: + * pageSize: 20 + * ``` + * + * - Filter by reference: + * + * Lists tasks matching specific references. + * + * ```yaml + * filter: + * references: ["build", "test"] + * pagination: + * pageSize: 20 + * ``` */ list(params: TaskListParams, options?: RequestOptions): PagePromise { const { token, pageSize, ...body } = params; @@ -53,15 +170,47 @@ export class Tasks extends APIResource { } /** - * DeleteTask + * Deletes an automation task. + * + * Use this method to: + * + * - Remove unused tasks + * - Clean up task configurations + * - Delete obsolete automations + * + * ### Examples + * + * - Delete task: + * + * Removes a task and its configuration. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ delete(body: TaskDeleteParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/DeleteTask', { body, ...options }); } /** - * StartTask starts a task, i.e. creates a task execution. This call does not block - * until the task is started; the task will be started asynchronously. + * Starts a task by creating a new task execution. This call does not block until + * the task is started; the task will be started asynchronously. + * + * Use this method to: + * + * - Trigger task execution + * - Run one-off tasks + * - Start scheduled tasks immediately + * + * ### Examples + * + * - Start task: + * + * Creates a new execution of a task. + * + * ```yaml + * id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ start(body: TaskStartParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.EnvironmentAutomationService/StartTask', { body, ...options }); diff --git a/src/resources/environments/environments.ts b/src/resources/environments/environments.ts index 270f659..b783a6d 100644 --- a/src/resources/environments/environments.ts +++ b/src/resources/environments/environments.ts @@ -406,7 +406,7 @@ export interface Environment { * ID is a unique identifier of this environment. No other environment with the * same name must be managed by this environment manager */ - id?: string; + id: string; /** * EnvironmentMetadata is data associated with an environment that's required for diff --git a/src/resources/identity.ts b/src/resources/identity.ts index 4a30913..9bfb3fd 100644 --- a/src/resources/identity.ts +++ b/src/resources/identity.ts @@ -7,7 +7,23 @@ import { RequestOptions } from '../internal/request-options'; export class Identity extends APIResource { /** - * ExchangeToken trades an exchange token for a new access token. + * Exchanges an exchange token for a new access token. + * + * Use this method to: + * + * - Convert exchange tokens to access tokens + * - Obtain new access credentials + * - Complete token exchange flows + * + * ### Examples + * + * - Exchange token: + * + * Trades an exchange token for an access token. + * + * ```yaml + * exchangeToken: "exchange-token-value" + * ``` */ exchangeToken( body: IdentityExchangeTokenParams, @@ -17,7 +33,24 @@ export class Identity extends APIResource { } /** - * GetAuthenticatedIdentity allows to retrieve the current identity. + * Retrieves information about the currently authenticated identity. + * + * Use this method to: + * + * - Get current user information + * - Check authentication status + * - Retrieve organization context + * - Validate authentication principal + * + * ### Examples + * + * - Get current identity: + * + * Retrieves details about the authenticated user. + * + * ```yaml + * {} + * ``` */ getAuthenticatedIdentity( body: IdentityGetAuthenticatedIdentityParams, @@ -27,8 +60,34 @@ export class Identity extends APIResource { } /** - * GetIDToken returns a token that can be used to authenticate the user against the - * other services. + * Gets an ID token for authenticating with other services. + * + * Use this method to: + * + * - Obtain authentication tokens for service-to-service calls + * - Access protected resources + * - Generate scoped access tokens + * + * ### Examples + * + * - Get token for single service: + * + * Retrieves a token for authenticating with one service. + * + * ```yaml + * audience: + * - "https://api.gitpod.io" + * ``` + * + * - Get token for multiple services: + * + * Retrieves a token valid for multiple services. + * + * ```yaml + * audience: + * - "https://api.gitpod.io" + * - "https://ws.gitpod.io" + * ``` */ getIDToken( body: IdentityGetIDTokenParams, diff --git a/src/resources/organizations/domain-verifications.ts b/src/resources/organizations/domain-verifications.ts index 08c5798..3f6428a 100644 --- a/src/resources/organizations/domain-verifications.ts +++ b/src/resources/organizations/domain-verifications.ts @@ -7,7 +7,34 @@ import { RequestOptions } from '../../internal/request-options'; export class DomainVerifications extends APIResource { /** - * CreateDomainVerification creates a new domain verification request + * Initiates domain verification process to enable organization features. + * + * Use this method to: + * + * - Start domain ownership verification + * - Enable automatic team joining + * - Set up SSO restrictions + * - Configure email-based policies + * + * ### Examples + * + * - Verify primary domain: + * + * Starts verification for main company domain. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * domain: "acme-corp.com" + * ``` + * + * - Verify subsidiary domain: + * + * Adds verification for additional company domain. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * domain: "acme-subsidiary.com" + * ``` */ create( body: DomainVerificationCreateParams, @@ -17,7 +44,23 @@ export class DomainVerifications extends APIResource { } /** - * GetDomainVerification retrieves a domain verification request + * Retrieves the status of a domain verification request. + * + * Use this method to: + * + * - Check verification progress + * - View verification requirements + * - Monitor domain status + * + * ### Examples + * + * - Get verification status: + * + * Checks the current state of a domain verification. + * + * ```yaml + * domainVerificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ retrieve( body: DomainVerificationRetrieveParams, @@ -27,7 +70,37 @@ export class DomainVerifications extends APIResource { } /** - * ListDomainVerifications lists all domain verifications for an organization + * Lists and monitors domain verification status across an organization. + * + * Use this method to: + * + * - Track verification progress + * - View all verified domains + * - Monitor pending verifications + * - Audit domain settings + * + * ### Examples + * + * - List all verifications: + * + * Shows all domain verifications regardless of status. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * pagination: + * pageSize: 20 + * ``` + * + * - List with pagination: + * + * Retrieves next page of verifications. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * pagination: + * pageSize: 20 + * token: "next-page-token-from-previous-response" + * ``` */ list( params: DomainVerificationListParams, @@ -42,14 +115,46 @@ export class DomainVerifications extends APIResource { } /** - * DeleteDomainVerification deletes a domain verification request + * Removes a domain verification request. + * + * Use this method to: + * + * - Cancel pending verifications + * - Remove verified domains + * - Clean up unused domain records + * + * ### Examples + * + * - Delete verification: + * + * Removes a domain verification request. + * + * ```yaml + * domainVerificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ delete(body: DomainVerificationDeleteParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.OrganizationService/DeleteDomainVerification', { body, ...options }); } /** - * VerifyDomain verifies a domain ownership + * Verifies domain ownership for an organization. + * + * Use this method to: + * + * - Complete domain verification process + * - Enable domain-based features + * - Validate DNS configuration + * + * ### Examples + * + * - Verify domain ownership: + * + * Verifies ownership after DNS records are configured. + * + * ```yaml + * domainVerificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ verify( body: DomainVerificationVerifyParams, diff --git a/src/resources/organizations/invites.ts b/src/resources/organizations/invites.ts index 60f2d63..b8f3540 100644 --- a/src/resources/organizations/invites.ts +++ b/src/resources/organizations/invites.ts @@ -6,24 +6,55 @@ import { RequestOptions } from '../../internal/request-options'; export class Invites extends APIResource { /** - * CreateOrganizationInvite creates an invite for the organization. Any existing + * Creates an invite link for joining an organization. Any existing * OrganizationInvites are invalidated and can no longer be used. + * + * Use this method to: + * + * - Generate shareable invite links + * - Manage team growth + * - Control organization access + * + * ### Examples + * + * - Create organization invite: + * + * Generates a new invite link for the organization. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * ``` */ create(body: InviteCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.OrganizationService/CreateOrganizationInvite', { body, ...options }); } /** - * GetOrganizationInvite retrieves invite for the organization. If no invite - * exists, a new one is created. + * GetOrganizationInvite */ retrieve(body: InviteRetrieveParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.OrganizationService/GetOrganizationInvite', { body, ...options }); } /** - * GetOrganizationInviteSummary retrieves a summary of the organization based on an - * Invite ID. Used to discover which organization an invite is for. + * Retrieves organization details and membership info based on an invite link. + * + * Use this method to: + * + * - Preview organization details before joining + * - Validate invite link authenticity + * - Check organization size and activity + * - View team information before accepting + * + * ### Examples + * + * - Get invite summary: + * + * Retrieves organization information from an invite. + * + * ```yaml + * inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ getSummary(body: InviteGetSummaryParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.OrganizationService/GetOrganizationInviteSummary', { diff --git a/src/resources/organizations/organizations.ts b/src/resources/organizations/organizations.ts index ee9f2b5..bdba148 100644 --- a/src/resources/organizations/organizations.ts +++ b/src/resources/organizations/organizations.ts @@ -65,14 +65,58 @@ export class Organizations extends APIResource { ); /** - * CreateOrganization creates a new Organization. + * Creates a new organization with the specified name and settings. + * + * Use this method to: + * + * - Create a new organization for team collaboration + * - Set up automatic domain-based invites for team members + * - Join the organization immediately upon creation + * + * ### Examples + * + * - Create a basic organization: + * + * Creates an organization with just a name. + * + * ```yaml + * name: "Acme Corp Engineering" + * joinOrganization: true + * ``` + * + * - Create with domain-based invites: + * + * Creates an organization that automatically invites users with matching email + * domains. + * + * ```yaml + * name: "Acme Corp" + * joinOrganization: true + * inviteAccountsWithMatchingDomain: true + * ``` */ create(body: OrganizationCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.OrganizationService/CreateOrganization', { body, ...options }); } /** - * GetOrganization retrieves a single Organization. + * Gets details about a specific organization. + * + * Use this method to: + * + * - Retrieve organization settings and configuration + * - Check organization membership status + * - View domain verification settings + * + * ### Examples + * + * - Get organization details: + * + * Retrieves information about a specific organization. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * ``` */ retrieve( body: OrganizationRetrieveParams, @@ -82,14 +126,75 @@ export class Organizations extends APIResource { } /** - * UpdateOrganization updates the properties of an Organization. + * Updates an organization's settings including name, invite domains, and member + * policies. + * + * Use this method to: + * + * - Modify organization display name + * - Configure email domain restrictions + * - Update organization-wide settings + * - Manage member access policies + * + * ### Examples + * + * - Update basic settings: + * + * Changes organization name and invite domains. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * name: "New Company Name" + * inviteDomains: + * domains: + * - "company.com" + * - "subsidiary.com" + * ``` + * + * - Remove domain restrictions: + * + * Clears all domain-based invite restrictions. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * inviteDomains: + * domains: [] + * ``` */ update(body: OrganizationUpdateParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.OrganizationService/UpdateOrganization', { body, ...options }); } /** - * ListOrganizations lists all organization the caller has access to. + * Lists all organizations the caller has access to with optional filtering. + * + * Use this method to: + * + * - View organizations you're a member of + * - Browse all available organizations + * - Paginate through organization results + * + * ### Examples + * + * - List member organizations: + * + * Shows organizations where the caller is a member. + * + * ```yaml + * pagination: + * pageSize: 20 + * scope: SCOPE_MEMBER + * ``` + * + * - List all organizations: + * + * Shows all organizations visible to the caller. + * + * ```yaml + * pagination: + * pageSize: 50 + * scope: SCOPE_ALL + * ``` */ list( params: OrganizationListParams, @@ -104,28 +209,117 @@ export class Organizations extends APIResource { } /** - * DeleteOrganization deletes the specified organization. + * Permanently deletes an organization. + * + * Use this method to: + * + * - Remove unused organizations + * - Clean up test organizations + * - Complete organization migration + * + * ### Examples + * + * - Delete organization: + * + * Permanently removes an organization and all its data. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * ``` */ delete(body: OrganizationDeleteParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.OrganizationService/DeleteOrganization', { body, ...options }); } /** - * JoinOrganization lets accounts join an Organization. + * Allows users to join an organization through direct ID, invite link, or + * domain-based auto-join. + * + * Use this method to: + * + * - Join an organization via direct ID or invite + * - Join automatically based on email domain + * - Accept organization invitations + * + * ### Examples + * + * - Join via organization ID: + * + * Joins an organization directly when you have the ID. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * ``` + * + * - Join via invite: + * + * Accepts an organization invitation link. + * + * ```yaml + * inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ join(body: OrganizationJoinParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.OrganizationService/JoinOrganization', { body, ...options }); } /** - * LeaveOrganization lets the passed user leave an Organization. + * Removes a user from an organization while preserving organization data. + * + * Use this method to: + * + * - Remove yourself from an organization + * - Clean up inactive memberships + * - Transfer project ownership before leaving + * - Manage team transitions + * + * ### Examples + * + * - Leave organization: + * + * Removes user from organization membership. + * + * ```yaml + * userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + * ``` + * + * Note: Ensure all projects and resources are transferred before leaving. */ leave(body: OrganizationLeaveParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.OrganizationService/LeaveOrganization', { body, ...options }); } /** - * ListMembers lists all members of the specified organization. + * Lists and filters organization members with optional pagination. + * + * Use this method to: + * + * - View all organization members + * - Monitor member activity + * - Manage team membership + * + * ### Examples + * + * - List active members: + * + * Retrieves active members with pagination. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * pagination: + * pageSize: 20 + * ``` + * + * - List with pagination: + * + * Retrieves next page of members. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * pagination: + * pageSize: 50 + * token: "next-page-token-from-previous-response" + * ``` */ listMembers( params: OrganizationListMembersParams, @@ -140,7 +334,36 @@ export class Organizations extends APIResource { } /** - * SetRole + * Manages organization membership and roles by setting a user's role within the + * organization. + * + * Use this method to: + * + * - Promote members to admin role + * - Change member permissions + * - Demote admins to regular members + * + * ### Examples + * + * - Promote to admin: + * + * Makes a user an organization administrator. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + * role: ORGANIZATION_ROLE_ADMIN + * ``` + * + * - Change to member: + * + * Changes a user's role to regular member. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + * role: ORGANIZATION_ROLE_MEMBER + * ``` */ setRole(body: OrganizationSetRoleParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.OrganizationService/SetRole', { body, ...options }); diff --git a/src/resources/organizations/sso-configurations.ts b/src/resources/organizations/sso-configurations.ts index 588e09c..83e5205 100644 --- a/src/resources/organizations/sso-configurations.ts +++ b/src/resources/organizations/sso-configurations.ts @@ -7,7 +7,40 @@ import { RequestOptions } from '../../internal/request-options'; export class SSOConfigurations extends APIResource { /** - * CreateSSOConfiguration creates a new SSO configuration for the organization. + * Creates or updates SSO configuration for organizational authentication. + * + * Use this method to: + * + * - Configure OIDC-based SSO providers + * - Set up built-in providers (Google, GitHub, etc.) + * - Define custom identity providers + * - Manage authentication policies + * + * ### Examples + * + * - Configure built-in Google SSO: + * + * Sets up SSO using Google Workspace. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * clientId: "012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com" + * clientSecret: "GOCSPX-abcdefghijklmnopqrstuvwxyz123456" + * issuerUrl: "https://accounts.google.com" + * emailDomain: "acme-corp.com" + * ``` + * + * - Configure custom OIDC provider: + * + * Sets up SSO with a custom identity provider. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * clientId: "acme-corp-gitpod" + * clientSecret: "secret-token-value" + * issuerUrl: "https://sso.acme-corp.com" + * emailDomain: "acme-corp.com" + * ``` */ create( body: SSOConfigurationCreateParams, @@ -17,7 +50,23 @@ export class SSOConfigurations extends APIResource { } /** - * GetSSOConfiguration returns an SSO configuration. + * Retrieves a specific SSO configuration. + * + * Use this method to: + * + * - View SSO provider details + * - Check configuration status + * - Verify SSO settings + * + * ### Examples + * + * - Get SSO configuration: + * + * Retrieves details of a specific SSO configuration. + * + * ```yaml + * ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ retrieve( body: SSOConfigurationRetrieveParams, @@ -27,14 +76,73 @@ export class SSOConfigurations extends APIResource { } /** - * UpdateSSOConfiguration updates the SSO configuration for the organization. + * Updates SSO provider settings and authentication rules. + * + * Use this method to: + * + * - Rotate client credentials + * - Update provider endpoints + * - Modify claim mappings + * - Change authentication policies + * - Toggle SSO enforcement + * + * ### Examples + * + * - Update credentials: + * + * Rotates client ID and secret. + * + * ```yaml + * ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * clientId: "new-client-id" + * clientSecret: "new-client-secret" + * ``` + * + * - Update provider status: + * + * Activates or deactivates SSO provider. + * + * ```yaml + * ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * state: SSO_CONFIGURATION_STATE_ACTIVE + * ``` */ update(body: SSOConfigurationUpdateParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.OrganizationService/UpdateSSOConfiguration', { body, ...options }); } /** - * ListSSOConfigurations lists all SSO configurations matching provided filters. + * Lists and filters SSO configurations for an organization. + * + * Use this method to: + * + * - View all SSO providers + * - Monitor authentication status + * - Audit security settings + * - Manage provider configurations + * + * ### Examples + * + * - List active configurations: + * + * Shows all active SSO providers. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * pagination: + * pageSize: 20 + * ``` + * + * - List by provider type: + * + * Shows custom SSO configurations. + * + * ```yaml + * organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * pagination: + * pageSize: 20 + * token: "next-page-token-from-previous-response" + * ``` */ list( params: SSOConfigurationListParams, @@ -49,7 +157,23 @@ export class SSOConfigurations extends APIResource { } /** - * DeleteSSOConfiguration deletes an SSO configuration. + * Removes an SSO configuration from an organization. + * + * Use this method to: + * + * - Disable SSO authentication + * - Remove outdated providers + * - Clean up unused configurations + * + * ### Examples + * + * - Delete SSO configuration: + * + * Removes a specific SSO configuration. + * + * ```yaml + * ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ delete(body: SSOConfigurationDeleteParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.OrganizationService/DeleteSSOConfiguration', { body, ...options }); diff --git a/src/resources/runners/runners.ts b/src/resources/runners/runners.ts index b5b446f..fba3eb3 100644 --- a/src/resources/runners/runners.ts +++ b/src/resources/runners/runners.ts @@ -348,7 +348,8 @@ export interface Runner { export type RunnerCapability = | 'RUNNER_CAPABILITY_UNSPECIFIED' - | 'RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS'; + | 'RUNNER_CAPABILITY_FETCH_LOCAL_SCM_INTEGRATIONS' + | 'RUNNER_CAPABILITY_SECRET_CONTAINER_REGISTRY'; export interface RunnerConfiguration { /** @@ -579,7 +580,71 @@ export interface RunnerCheckAuthenticationForHostResponse { patSupported?: boolean; + /** + * scm_id is the unique identifier of the SCM provider + */ scmId?: string; + + /** + * scm_name is the human-readable name of the SCM provider (e.g., "GitHub", + * "GitLab") + */ + scmName?: string; + + /** + * supports_oauth2 indicates that the host supports OAuth2 authentication + */ + supportsOauth2?: RunnerCheckAuthenticationForHostResponse.SupportsOauth2; + + /** + * supports_pat indicates that the host supports Personal Access Token + * authentication + */ + supportsPat?: RunnerCheckAuthenticationForHostResponse.SupportsPat; +} + +export namespace RunnerCheckAuthenticationForHostResponse { + /** + * supports_oauth2 indicates that the host supports OAuth2 authentication + */ + export interface SupportsOauth2 { + /** + * auth_url is the URL where users can authenticate + */ + authUrl?: string; + + /** + * docs_url is the URL to the documentation explaining this authentication method + */ + docsUrl?: string; + } + + /** + * supports_pat indicates that the host supports Personal Access Token + * authentication + */ + export interface SupportsPat { + /** + * create_url is the URL where users can create a new Personal Access Token + */ + createUrl?: string; + + /** + * docs_url is the URL to the documentation explaining PAT usage for this host + */ + docsUrl?: string; + + /** + * example is an example of a Personal Access Token + */ + example?: string; + + /** + * required_scopes is the list of permissions required for the Personal Access + * Token + */ + requiredScopes?: Array; + } } export interface RunnerCreateRunnerTokenResponse { diff --git a/src/resources/secrets.ts b/src/resources/secrets.ts index 38d9729..f7473fe 100644 --- a/src/resources/secrets.ts +++ b/src/resources/secrets.ts @@ -8,14 +8,74 @@ import { RequestOptions } from '../internal/request-options'; export class Secrets extends APIResource { /** - * CreateSecret creates a new secret. + * Creates a new secret for a project. + * + * Use this method to: + * + * - Store sensitive configuration values + * - Set up environment variables + * - Configure registry authentication + * - Add file-based secrets + * + * ### Examples + * + * - Create environment variable: + * + * Creates a secret that will be available as an environment variable. + * + * ```yaml + * name: "DATABASE_URL" + * projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * value: "postgresql://user:pass@localhost:5432/db" + * environmentVariable: true + * ``` + * + * - Create file secret: + * + * Creates a secret that will be mounted as a file. + * + * ```yaml + * name: "SSH_KEY" + * projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * value: "-----BEGIN RSA PRIVATE KEY-----\n..." + * filePath: "/home/gitpod/.ssh/id_rsa" + * ``` + * + * - Create registry auth: + * + * Creates credentials for private container registry. + * + * ```yaml + * name: "DOCKER_AUTH" + * projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" + * value: "username:password" + * containerRegistryBasicAuthHost: "https://registry.example.com" + * ``` */ create(body: SecretCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.SecretService/CreateSecret', { body, ...options }); } /** - * ListSecrets lists secrets. + * Lists secrets with optional filtering. + * + * Use this method to: + * + * - View all project secrets + * - Filter secrets by project + * + * ### Examples + * + * - List project secrets: + * + * Shows all secrets for a project. + * + * ```yaml + * filter: + * projectIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] + * pagination: + * pageSize: 20 + * ``` */ list(params: SecretListParams, options?: RequestOptions): PagePromise { const { token, pageSize, ...body } = params; @@ -28,22 +88,68 @@ export class Secrets extends APIResource { } /** - * DeleteSecret deletes a secret. + * Deletes a secret permanently. + * + * Use this method to: + * + * - Remove unused secrets + * - Clean up old credentials + * + * ### Examples + * + * - Delete secret: + * + * Permanently removes a secret. + * + * ```yaml + * secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ delete(body: SecretDeleteParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.SecretService/DeleteSecret', { body, ...options }); } /** - * GetSecretValue retrieves the value of a secret Only Environments can perform - * this operation, and only for secrets specified on the EnvironmentSpec. + * Gets the value of a secret. Only available to environments that are authorized + * to access the secret. + * + * Use this method to: + * + * - Retrieve secret values + * - Access credentials + * + * ### Examples + * + * - Get secret value: + * + * Retrieves the value of a specific secret. + * + * ```yaml + * secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ getValue(body: SecretGetValueParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.SecretService/GetSecretValue', { body, ...options }); } /** - * UpdateSecretValue updates the value of a secret. + * Updates the value of an existing secret. + * + * Use this method to: + * + * - Rotate secret values + * - Update credentials + * + * ### Examples + * + * - Update secret value: + * + * Changes the value of an existing secret. + * + * ```yaml + * secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * value: "new-secret-value" + * ``` */ updateValue(body: SecretUpdateValueParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.SecretService/UpdateSecretValue', { body, ...options }); diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 8edf98a..c70d702 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -2,6 +2,20 @@ import * as Shared from './shared'; import { EnvironmentClassesPage, TaskExecutionsPage, TasksPage } from '../pagination'; +import { type Uploadable } from '../uploads'; + +/** + * Contains an arbitrary serialized message along with a @type that describes the + * type of the serialized message. + */ +export interface ArbitraryData { + debug?: Record; + + type?: string; + + value?: Uploadable; + [k: string]: unknown; +} /** * An AutomationTrigger represents a trigger for an automation action. The @@ -21,7 +35,7 @@ export interface EnvironmentClass { /** * id is the unique identifier of the environment class */ - id?: string; + id: string; /** * configuration describes the configuration of the environment class @@ -51,6 +65,28 @@ export interface EnvironmentClass { runnerId?: string; } +/** + * The status code, which should be an enum value of + * [google.rpc.Code][google.rpc.Code]. + */ +export type ErrorCode = + | 'canceled' + | 'unknown' + | 'invalid_argument' + | 'deadline_exceeded' + | 'not_found' + | 'already_exists' + | 'permission_denied' + | 'resource_exhausted' + | 'failed_precondition' + | 'aborted' + | 'out_of_range' + | 'unimplemented' + | 'internal' + | 'unavailable' + | 'data_loss' + | 'unauthenticated'; + export interface FieldValue { key?: string; @@ -95,7 +131,7 @@ export interface Subject { } export interface Task { - id?: string; + id: string; /** * dependencies specifies the IDs of the automations this task depends on. diff --git a/src/resources/users/pats.ts b/src/resources/users/pats.ts index dcb49b9..46dcda4 100644 --- a/src/resources/users/pats.ts +++ b/src/resources/users/pats.ts @@ -8,7 +8,26 @@ import { RequestOptions } from '../../internal/request-options'; export class Pats extends APIResource { /** - * ListPersonalAccessTokens + * Lists personal access tokens with optional filtering. + * + * Use this method to: + * + * - View all active tokens + * - Audit token usage + * - Manage token lifecycle + * + * ### Examples + * + * - List user tokens: + * + * Shows all tokens for specific users. + * + * ```yaml + * filter: + * userIds: ["f53d2330-3795-4c5d-a1f3-453121af9c60"] + * pagination: + * pageSize: 20 + * ``` */ list( params: PatListParams, @@ -23,14 +42,46 @@ export class Pats extends APIResource { } /** - * DeletePersonalAccessToken + * Deletes a personal access token. + * + * Use this method to: + * + * - Revoke token access + * - Remove unused tokens + * - Rotate credentials + * + * ### Examples + * + * - Delete token: + * + * Permanently revokes a token. + * + * ```yaml + * personalAccessTokenId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ delete(body: PatDeleteParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.UserService/DeletePersonalAccessToken', { body, ...options }); } /** - * GetPersonalAccessToken + * Gets details about a specific personal access token. + * + * Use this method to: + * + * - View token metadata + * - Check token expiration + * - Monitor token usage + * + * ### Examples + * + * - Get token details: + * + * Retrieves information about a specific token. + * + * ```yaml + * personalAccessTokenId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" + * ``` */ get(body: PatGetParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.UserService/GetPersonalAccessToken', { body, ...options }); diff --git a/src/resources/users/users.ts b/src/resources/users/users.ts index ede6988..842292e 100644 --- a/src/resources/users/users.ts +++ b/src/resources/users/users.ts @@ -20,7 +20,24 @@ export class Users extends APIResource { pats: PatsAPI.Pats = new PatsAPI.Pats(this._client); /** - * GetAuthenticatedUser allows to retrieve the current user. + * Gets information about the currently authenticated user. + * + * Use this method to: + * + * - Get user profile information + * - Check authentication status + * - Retrieve user settings + * - Verify account details + * + * ### Examples + * + * - Get current user: + * + * Retrieves details about the authenticated user. + * + * ```yaml + * {} + * ``` */ getAuthenticatedUser( body: UserGetAuthenticatedUserParams, @@ -30,7 +47,33 @@ export class Users extends APIResource { } /** - * SetSuspended sets the suspended state of the user. + * Sets whether a user account is suspended. + * + * Use this method to: + * + * - Suspend problematic users + * - Reactivate suspended accounts + * - Manage user access + * + * ### Examples + * + * - Suspend user: + * + * Suspends a user account. + * + * ```yaml + * userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + * suspended: true + * ``` + * + * - Reactivate user: + * + * Removes suspension from a user account. + * + * ```yaml + * userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" + * suspended: false + * ``` */ setSuspended(body: UserSetSuspendedParams, options?: RequestOptions): APIPromise { return this._client.post('/gitpod.v1.UserService/SetSuspended', { body, ...options }); diff --git a/src/version.ts b/src/version.ts index 5447861..bade2ff 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.1.2'; // x-release-please-version +export const VERSION = '0.2.0'; // x-release-please-version diff --git a/tests/api-resources/accounts.test.ts b/tests/api-resources/accounts.test.ts index 932d80d..85aed19 100644 --- a/tests/api-resources/accounts.test.ts +++ b/tests/api-resources/accounts.test.ts @@ -22,7 +22,7 @@ describe('resource accounts', () => { // skipped: tests are disabled for the time being test.skip('delete: only required params', async () => { - const responsePromise = client.accounts.delete({ accountId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }); + const responsePromise = client.accounts.delete({ accountId: 'f53d2330-3795-4c5d-a1f3-453121af9c60' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -34,12 +34,12 @@ describe('resource accounts', () => { // skipped: tests are disabled for the time being test.skip('delete: required and optional params', async () => { - const response = await client.accounts.delete({ accountId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }); + const response = await client.accounts.delete({ accountId: 'f53d2330-3795-4c5d-a1f3-453121af9c60' }); }); // skipped: tests are disabled for the time being test.skip('getSSOLoginURL: only required params', async () => { - const responsePromise = client.accounts.getSSOLoginURL({ email: 'dev@stainlessapi.com' }); + const responsePromise = client.accounts.getSSOLoginURL({ email: 'user@company.com' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -52,7 +52,7 @@ describe('resource accounts', () => { // skipped: tests are disabled for the time being test.skip('getSSOLoginURL: required and optional params', async () => { const response = await client.accounts.getSSOLoginURL({ - email: 'dev@stainlessapi.com', + email: 'user@company.com', returnTo: 'https://example.com', }); }); diff --git a/tests/api-resources/editors.test.ts b/tests/api-resources/editors.test.ts index a74c114..e3e3a7c 100644 --- a/tests/api-resources/editors.test.ts +++ b/tests/api-resources/editors.test.ts @@ -10,7 +10,7 @@ const client = new Gitpod({ describe('resource editors', () => { // skipped: tests are disabled for the time being test.skip('retrieve: only required params', async () => { - const responsePromise = client.editors.retrieve({ id: 'id' }); + const responsePromise = client.editors.retrieve({ id: 'd2c94c27-3b76-4a42-b88c-95a85e392c68' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -22,7 +22,7 @@ describe('resource editors', () => { // skipped: tests are disabled for the time being test.skip('retrieve: required and optional params', async () => { - const response = await client.editors.retrieve({ id: 'id' }); + const response = await client.editors.retrieve({ id: 'd2c94c27-3b76-4a42-b88c-95a85e392c68' }); }); // skipped: tests are disabled for the time being @@ -40,9 +40,9 @@ describe('resource editors', () => { // skipped: tests are disabled for the time being test.skip('resolveURL: only required params', async () => { const responsePromise = client.editors.resolveURL({ - editorId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - environmentId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + editorId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + environmentId: '07e03a28-65a5-4d98-b532-8ea67b188048', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -56,9 +56,9 @@ describe('resource editors', () => { // skipped: tests are disabled for the time being test.skip('resolveURL: required and optional params', async () => { const response = await client.editors.resolveURL({ - editorId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - environmentId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + editorId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', + environmentId: '07e03a28-65a5-4d98-b532-8ea67b188048', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); }); diff --git a/tests/api-resources/organizations/domain-verifications.test.ts b/tests/api-resources/organizations/domain-verifications.test.ts index 3c66d36..aa5b7e4 100644 --- a/tests/api-resources/organizations/domain-verifications.test.ts +++ b/tests/api-resources/organizations/domain-verifications.test.ts @@ -11,8 +11,8 @@ describe('resource domainVerifications', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { const responsePromise = client.organizations.domainVerifications.create({ - domain: 'xxxx', - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + domain: 'acme-corp.com', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -26,15 +26,15 @@ describe('resource domainVerifications', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { const response = await client.organizations.domainVerifications.create({ - domain: 'xxxx', - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + domain: 'acme-corp.com', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); // skipped: tests are disabled for the time being test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.domainVerifications.retrieve({ - domainVerificationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -48,14 +48,14 @@ describe('resource domainVerifications', () => { // skipped: tests are disabled for the time being test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.domainVerifications.retrieve({ - domainVerificationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); // skipped: tests are disabled for the time being test.skip('list: only required params', async () => { const responsePromise = client.organizations.domainVerifications.list({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -69,17 +69,17 @@ describe('resource domainVerifications', () => { // skipped: tests are disabled for the time being test.skip('list: required and optional params', async () => { const response = await client.organizations.domainVerifications.list({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', token: 'token', pageSize: 0, - pagination: { token: 'token', pageSize: 100 }, + pagination: { token: 'token', pageSize: 20 }, }); }); // skipped: tests are disabled for the time being test.skip('delete: only required params', async () => { const responsePromise = client.organizations.domainVerifications.delete({ - domainVerificationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -93,14 +93,14 @@ describe('resource domainVerifications', () => { // skipped: tests are disabled for the time being test.skip('delete: required and optional params', async () => { const response = await client.organizations.domainVerifications.delete({ - domainVerificationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); // skipped: tests are disabled for the time being test.skip('verify: only required params', async () => { const responsePromise = client.organizations.domainVerifications.verify({ - domainVerificationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -114,7 +114,7 @@ describe('resource domainVerifications', () => { // skipped: tests are disabled for the time being test.skip('verify: required and optional params', async () => { const response = await client.organizations.domainVerifications.verify({ - domainVerificationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); }); diff --git a/tests/api-resources/organizations/invites.test.ts b/tests/api-resources/organizations/invites.test.ts index 381656c..8d2dbb3 100644 --- a/tests/api-resources/organizations/invites.test.ts +++ b/tests/api-resources/organizations/invites.test.ts @@ -11,7 +11,7 @@ describe('resource invites', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { const responsePromise = client.organizations.invites.create({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -25,7 +25,7 @@ describe('resource invites', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { const response = await client.organizations.invites.create({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); @@ -53,7 +53,7 @@ describe('resource invites', () => { // skipped: tests are disabled for the time being test.skip('getSummary: only required params', async () => { const responsePromise = client.organizations.invites.getSummary({ - inviteId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + inviteId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -67,7 +67,7 @@ describe('resource invites', () => { // skipped: tests are disabled for the time being test.skip('getSummary: required and optional params', async () => { const response = await client.organizations.invites.getSummary({ - inviteId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + inviteId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); }); diff --git a/tests/api-resources/organizations/organizations.test.ts b/tests/api-resources/organizations/organizations.test.ts index db75850..f88e6bd 100644 --- a/tests/api-resources/organizations/organizations.test.ts +++ b/tests/api-resources/organizations/organizations.test.ts @@ -10,7 +10,7 @@ const client = new Gitpod({ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = client.organizations.create({ name: 'xxx' }); + const responsePromise = client.organizations.create({ name: 'Acme Corp Engineering' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,7 +23,7 @@ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { const response = await client.organizations.create({ - name: 'xxx', + name: 'Acme Corp Engineering', inviteAccountsWithMatchingDomain: true, joinOrganization: true, }); @@ -32,7 +32,7 @@ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.retrieve({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -46,14 +46,14 @@ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.retrieve({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { const responsePromise = client.organizations.update({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -67,7 +67,7 @@ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { const response = await client.organizations.update({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', inviteDomains: { domains: ['sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB'] }, name: 'name', }); @@ -88,7 +88,7 @@ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('delete: only required params', async () => { const responsePromise = client.organizations.delete({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -102,7 +102,7 @@ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('delete: required and optional params', async () => { const response = await client.organizations.delete({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); @@ -120,7 +120,7 @@ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('leave: only required params', async () => { - const responsePromise = client.organizations.leave({ userId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }); + const responsePromise = client.organizations.leave({ userId: 'f53d2330-3795-4c5d-a1f3-453121af9c60' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -132,13 +132,13 @@ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('leave: required and optional params', async () => { - const response = await client.organizations.leave({ userId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }); + const response = await client.organizations.leave({ userId: 'f53d2330-3795-4c5d-a1f3-453121af9c60' }); }); // skipped: tests are disabled for the time being test.skip('listMembers: only required params', async () => { const responsePromise = client.organizations.listMembers({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -152,18 +152,18 @@ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('listMembers: required and optional params', async () => { const response = await client.organizations.listMembers({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', token: 'token', pageSize: 0, - pagination: { token: 'token', pageSize: 100 }, + pagination: { token: 'token', pageSize: 20 }, }); }); // skipped: tests are disabled for the time being test.skip('setRole: only required params', async () => { const responsePromise = client.organizations.setRole({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - userId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + userId: 'f53d2330-3795-4c5d-a1f3-453121af9c60', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -177,8 +177,8 @@ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('setRole: required and optional params', async () => { const response = await client.organizations.setRole({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - userId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', + userId: 'f53d2330-3795-4c5d-a1f3-453121af9c60', role: 'ORGANIZATION_ROLE_UNSPECIFIED', }); }); diff --git a/tests/api-resources/organizations/sso-configurations.test.ts b/tests/api-resources/organizations/sso-configurations.test.ts index 661d6c1..06c24ee 100644 --- a/tests/api-resources/organizations/sso-configurations.test.ts +++ b/tests/api-resources/organizations/sso-configurations.test.ts @@ -11,11 +11,11 @@ describe('resource ssoConfigurations', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.create({ - clientId: 'x', - clientSecret: 'x', - emailDomain: 'xxxx', - issuerUrl: 'https://example.com', - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + clientId: '012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com', + clientSecret: 'GOCSPX-abcdefghijklmnopqrstuvwxyz123456', + emailDomain: 'acme-corp.com', + issuerUrl: 'https://accounts.google.com', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -29,18 +29,18 @@ describe('resource ssoConfigurations', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.create({ - clientId: 'x', - clientSecret: 'x', - emailDomain: 'xxxx', - issuerUrl: 'https://example.com', - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + clientId: '012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com', + clientSecret: 'GOCSPX-abcdefghijklmnopqrstuvwxyz123456', + emailDomain: 'acme-corp.com', + issuerUrl: 'https://accounts.google.com', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); // skipped: tests are disabled for the time being test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.retrieve({ - ssoConfigurationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -54,14 +54,14 @@ describe('resource ssoConfigurations', () => { // skipped: tests are disabled for the time being test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.retrieve({ - ssoConfigurationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.update({ - ssoConfigurationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -75,10 +75,10 @@ describe('resource ssoConfigurations', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.update({ - ssoConfigurationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', claims: { foo: 'string' }, - clientId: 'x', - clientSecret: 'x', + clientId: 'new-client-id', + clientSecret: 'new-client-secret', emailDomain: 'xxxx', issuerUrl: 'https://example.com', state: 'SSO_CONFIGURATION_STATE_UNSPECIFIED', @@ -88,7 +88,7 @@ describe('resource ssoConfigurations', () => { // skipped: tests are disabled for the time being test.skip('list: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.list({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -102,17 +102,17 @@ describe('resource ssoConfigurations', () => { // skipped: tests are disabled for the time being test.skip('list: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.list({ - organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', token: 'token', pageSize: 0, - pagination: { token: 'token', pageSize: 100 }, + pagination: { token: 'token', pageSize: 20 }, }); }); // skipped: tests are disabled for the time being test.skip('delete: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.delete({ - ssoConfigurationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -126,7 +126,7 @@ describe('resource ssoConfigurations', () => { // skipped: tests are disabled for the time being test.skip('delete: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.delete({ - ssoConfigurationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); });