Skip to content

Commit

Permalink
release: 0.2.0 (#19)
Browse files Browse the repository at this point in the history
* feat(api): Organizations Open API docs (#18)

* feat(api): manual updates (#20)

* chore(internal): fix tests not always being type checked (#21)

* feat(api): manual updates (#22)

* release: 0.2.0

---------

Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
  • Loading branch information
stainless-app[bot] authored Feb 18, 2025
1 parent 63334d0 commit ec476cb
Showing 32 changed files with 1,591 additions and 143 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.2"
".": "0.2.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
@@ -2,8 +2,10 @@

Types:

- <code><a href="./src/resources/shared.ts">ArbitraryData</a></code>
- <code><a href="./src/resources/shared.ts">AutomationTrigger</a></code>
- <code><a href="./src/resources/shared.ts">EnvironmentClass</a></code>
- <code><a href="./src/resources/shared.ts">ErrorCode</a></code>
- <code><a href="./src/resources/shared.ts">FieldValue</a></code>
- <code><a href="./src/resources/shared.ts">OrganizationRole</a></code>
- <code><a href="./src/resources/shared.ts">Principal</a></code>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <dev-feedback@gitpod.com>",
"types": "dist/index.d.ts",
5 changes: 4 additions & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -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;
16 changes: 16 additions & 0 deletions src/error.ts
Original file line number Diff line number Diff line change
@@ -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<string, any>;
this.code = data?.['code'];
this.detail = data?.['detail'];
}

private static makeMessage(status: number | undefined, error: any, message: string | undefined) {
98 changes: 92 additions & 6 deletions src/resources/accounts.ts
Original file line number Diff line number Diff line change
@@ -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<AccountRetrieveResponse> {
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<unknown> {
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,
58 changes: 55 additions & 3 deletions src/resources/editors.ts
Original file line number Diff line number Diff line change
@@ -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<EditorRetrieveResponse> {
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<EditorsEditorsPage, Editor> {
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<EditorResolveURLResponse> {
return this._client.post('/gitpod.v1.EditorService/ResolveEditorURL', { body, ...options });
35 changes: 34 additions & 1 deletion src/resources/environments/automations/automations.ts
Original file line number Diff line number Diff line change
@@ -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<AutomationUpsertResponse> {
return this._client.post('/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile', {
Loading
Oops, something went wrong.

0 comments on commit ec476cb

Please sign in to comment.