Skip to content

Commit ec476cb

Browse files
release: 0.2.0 (#19)
* 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>
1 parent 63334d0 commit ec476cb

32 files changed

+1591
-143
lines changed

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.2"
2+
".": "0.2.0"
33
}

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 111
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-27f7bd641de1e4657ad8ce84a456fe0c5e8f1e14779bf1f567a4bc8667eba4da.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f6598ab5d6827f66b642201769e92590ea32af84ebbf24b18cc32b33dee5107e.yml

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## 0.2.0 (2025-02-18)
4+
5+
Full Changelog: [v0.1.2...v0.2.0](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.1.2...v0.2.0)
6+
7+
### Features
8+
9+
* **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))
10+
* **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))
11+
* **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))
12+
13+
14+
### Chores
15+
16+
* **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))
17+
318
## 0.1.2 (2025-02-14)
419

520
Full Changelog: [v0.1.1...v0.1.2](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.1.1...v0.1.2)

api.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
Types:
44

5+
- <code><a href="./src/resources/shared.ts">ArbitraryData</a></code>
56
- <code><a href="./src/resources/shared.ts">AutomationTrigger</a></code>
67
- <code><a href="./src/resources/shared.ts">EnvironmentClass</a></code>
8+
- <code><a href="./src/resources/shared.ts">ErrorCode</a></code>
79
- <code><a href="./src/resources/shared.ts">FieldValue</a></code>
810
- <code><a href="./src/resources/shared.ts">OrganizationRole</a></code>
911
- <code><a href="./src/resources/shared.ts">Principal</a></code>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitpod/sdk",
3-
"version": "0.1.2",
3+
"version": "0.2.0",
44
"description": "The official TypeScript library for the Gitpod API",
55
"author": "Gitpod <[email protected]>",
66
"types": "dist/index.d.ts",

scripts/lint

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ echo "==> Running eslint"
88
./node_modules/.bin/eslint .
99

1010
echo "==> Building"
11-
./scripts/build # also checks types
11+
./scripts/build
12+
13+
echo "==> Checking types"
14+
./node_modules/typescript/bin/tsc
1215

1316
echo "==> Running Are The Types Wrong?"
1417
./node_modules/.bin/attw --pack dist -f json >.attw.json || true

src/client.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1145,8 +1145,10 @@ export declare namespace Gitpod {
11451145
type UserSetSuspendedParams as UserSetSuspendedParams,
11461146
};
11471147

1148+
export type ArbitraryData = API.ArbitraryData;
11481149
export type AutomationTrigger = API.AutomationTrigger;
11491150
export type EnvironmentClass = API.EnvironmentClass;
1151+
export type ErrorCode = API.ErrorCode;
11501152
export type FieldValue = API.FieldValue;
11511153
export type OrganizationRole = API.OrganizationRole;
11521154
export type Principal = API.Principal;

src/error.ts

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { castToError } from './internal/errors';
4+
import * as Shared from './resources/shared';
45

56
export class GitpodError extends Error {}
67

@@ -16,11 +17,26 @@ export class APIError<
1617
/** JSON body of the response that caused the error */
1718
readonly error: TError;
1819

20+
/**
21+
* The status code, which should be an enum value of
22+
* [google.rpc.Code][google.rpc.Code].
23+
*/
24+
readonly code?: Shared.ErrorCode | undefined;
25+
/**
26+
* Contains an arbitrary serialized message along with a @type that describes the
27+
* type of the serialized message.
28+
*/
29+
readonly detail?: Shared.ArbitraryData | undefined;
30+
1931
constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) {
2032
super(`${APIError.makeMessage(status, error, message)}`);
2133
this.status = status;
2234
this.headers = headers;
2335
this.error = error;
36+
37+
const data = error as Record<string, any>;
38+
this.code = data?.['code'];
39+
this.detail = data?.['detail'];
2440
}
2541

2642
private static makeMessage(status: number | undefined, error: any, message: string | undefined) {

src/resources/accounts.ts

+92-6
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,81 @@ import { RequestOptions } from '../internal/request-options';
88

99
export class Accounts extends APIResource {
1010
/**
11-
* GetAccount retrieves a single Account.
11+
* Gets information about the currently authenticated account.
12+
*
13+
* Use this method to:
14+
*
15+
* - Retrieve account profile information
16+
* - Check organization memberships
17+
* - View account settings
18+
* - Get joinable organizations
19+
*
20+
* ### Examples
21+
*
22+
* - Get account details:
23+
*
24+
* Retrieves information about the authenticated account.
25+
*
26+
* ```yaml
27+
* {}
28+
* ```
1229
*/
1330
retrieve(body: AccountRetrieveParams, options?: RequestOptions): APIPromise<AccountRetrieveResponse> {
1431
return this._client.post('/gitpod.v1.AccountService/GetAccount', { body, ...options });
1532
}
1633

1734
/**
18-
* DeleteAccount deletes an Account. To Delete an Account, the Account must not be
19-
* an active member of any Organization.
35+
* Deletes an account permanently.
36+
*
37+
* Use this method to:
38+
*
39+
* - Remove unused accounts
40+
* - Clean up test accounts
41+
* - Complete account deletion requests
42+
*
43+
* The account must not be an active member of any organization.
44+
*
45+
* ### Examples
46+
*
47+
* - Delete account:
48+
*
49+
* Permanently removes an account.
50+
*
51+
* ```yaml
52+
* accountId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
53+
* ```
2054
*/
2155
delete(body: AccountDeleteParams, options?: RequestOptions): APIPromise<unknown> {
2256
return this._client.post('/gitpod.v1.AccountService/DeleteAccount', { body, ...options });
2357
}
2458

2559
/**
26-
* GetSSOLoginURL returns the URL to redirect the user to for SSO login.
60+
* Gets the SSO login URL for a specific email domain.
61+
*
62+
* Use this method to:
63+
*
64+
* - Initiate SSO authentication
65+
* - Get organization-specific login URLs
66+
* - Handle SSO redirects
67+
*
68+
* ### Examples
69+
*
70+
* - Get login URL:
71+
*
72+
* Retrieves SSO URL for email domain.
73+
*
74+
* ```yaml
75+
* email: "[email protected]"
76+
* ```
77+
*
78+
* - Get URL with return path:
79+
*
80+
* Gets SSO URL with specific return location.
81+
*
82+
* ```yaml
83+
* email: "[email protected]"
84+
* returnTo: "https://gitpod.io/workspaces"
85+
* ```
2786
*/
2887
getSSOLoginURL(
2988
body: AccountGetSSOLoginURLParams,
@@ -33,8 +92,35 @@ export class Accounts extends APIResource {
3392
}
3493

3594
/**
36-
* ListLoginProviders returns the list of login providers matching the provided
37-
* filters.
95+
* Lists available login providers with optional filtering.
96+
*
97+
* Use this method to:
98+
*
99+
* - View supported authentication methods
100+
* - Get provider-specific login URLs
101+
* - Filter providers by invite
102+
*
103+
* ### Examples
104+
*
105+
* - List all providers:
106+
*
107+
* Shows all available login providers.
108+
*
109+
* ```yaml
110+
* pagination:
111+
* pageSize: 20
112+
* ```
113+
*
114+
* - List for specific invite:
115+
*
116+
* Shows providers available for an invite.
117+
*
118+
* ```yaml
119+
* filter:
120+
* inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
121+
* pagination:
122+
* pageSize: 20
123+
* ```
38124
*/
39125
listLoginProviders(
40126
params: AccountListLoginProvidersParams,

src/resources/editors.ts

+55-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,47 @@ import { RequestOptions } from '../internal/request-options';
77

88
export class Editors extends APIResource {
99
/**
10-
* GetEditor returns the editor with the given ID
10+
* Gets details about a specific editor.
11+
*
12+
* Use this method to:
13+
*
14+
* - View editor information
15+
* - Get editor configuration
16+
*
17+
* ### Examples
18+
*
19+
* - Get editor details:
20+
*
21+
* Retrieves information about a specific editor.
22+
*
23+
* ```yaml
24+
* id: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
25+
* ```
1126
*/
1227
retrieve(body: EditorRetrieveParams, options?: RequestOptions): APIPromise<EditorRetrieveResponse> {
1328
return this._client.post('/gitpod.v1.EditorService/GetEditor', { body, ...options });
1429
}
1530

1631
/**
17-
* ListEditors lists all editors available to the caller
32+
* Lists all available code editors.
33+
*
34+
* Use this method to:
35+
*
36+
* - View supported editors
37+
* - Get editor capabilities
38+
* - Browse editor options
39+
* - Check editor availability
40+
*
41+
* ### Examples
42+
*
43+
* - List editors:
44+
*
45+
* Shows all available editors with pagination.
46+
*
47+
* ```yaml
48+
* pagination:
49+
* pageSize: 20
50+
* ```
1851
*/
1952
list(params: EditorListParams, options?: RequestOptions): PagePromise<EditorsEditorsPage, Editor> {
2053
const { token, pageSize, ...body } = params;
@@ -27,7 +60,26 @@ export class Editors extends APIResource {
2760
}
2861

2962
/**
30-
* ResolveEditorURL resolves the editor's URL for an environment
63+
* Resolves the URL for accessing an editor in a specific environment.
64+
*
65+
* Use this method to:
66+
*
67+
* - Get editor access URLs
68+
* - Launch editors for environments
69+
* - Set up editor connections
70+
* - Configure editor access
71+
*
72+
* ### Examples
73+
*
74+
* - Resolve editor URL:
75+
*
76+
* Gets the URL for accessing an editor in an environment.
77+
*
78+
* ```yaml
79+
* editorId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
80+
* environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
81+
* organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
82+
* ```
3183
*/
3284
resolveURL(body: EditorResolveURLParams, options?: RequestOptions): APIPromise<EditorResolveURLResponse> {
3385
return this._client.post('/gitpod.v1.EditorService/ResolveEditorURL', { body, ...options });

src/resources/environments/automations/automations.ts

+34-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,40 @@ export class Automations extends APIResource {
4848
tasks: TasksAPI.Tasks = new TasksAPI.Tasks(this._client);
4949

5050
/**
51-
* UpsertAutomationsFile upserts the automations file for the given environment.
51+
* Upserts the automations file for the given environment.
52+
*
53+
* Use this method to:
54+
*
55+
* - Configure environment automations
56+
* - Update automation settings
57+
* - Manage automation files
58+
*
59+
* ### Examples
60+
*
61+
* - Update automations file:
62+
*
63+
* Updates or creates the automations configuration.
64+
*
65+
* ```yaml
66+
* environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
67+
* automationsFile:
68+
* services:
69+
* web-server:
70+
* name: "Web Server"
71+
* description: "Development web server"
72+
* commands:
73+
* start: "npm run dev"
74+
* ready: "curl -s http://localhost:3000"
75+
* triggeredBy:
76+
* - postDevcontainerStart
77+
* tasks:
78+
* build:
79+
* name: "Build Project"
80+
* description: "Builds the project artifacts"
81+
* command: "npm run build"
82+
* triggeredBy:
83+
* - postEnvironmentStart
84+
* ```
5285
*/
5386
upsert(body: AutomationUpsertParams, options?: RequestOptions): APIPromise<AutomationUpsertResponse> {
5487
return this._client.post('/gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile', {

0 commit comments

Comments
 (0)