Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
f9c394a
feat(types): add Report and related schema types to automations
stainless-app[bot] Apr 2, 2026
18f934f
codegen metadata
stainless-app[bot] Apr 3, 2026
259af94
codegen metadata
stainless-app[bot] Apr 3, 2026
ff1dd19
codegen metadata
stainless-app[bot] Apr 6, 2026
9a542d3
codegen metadata
stainless-app[bot] Apr 7, 2026
1cfefef
codegen metadata
stainless-app[bot] Apr 8, 2026
cfd1e9a
chore(internal): codegen related update
stainless-app[bot] Apr 8, 2026
f5c29a1
codegen metadata
stainless-app[bot] Apr 8, 2026
85d6ef2
feat(api): remove terminal field from RunsOn
stainless-app[bot] Apr 8, 2026
3d28075
codegen metadata
stainless-app[bot] Apr 9, 2026
78e1779
codegen metadata
stainless-app[bot] Apr 9, 2026
f11a378
codegen metadata
stainless-app[bot] Apr 9, 2026
4ba14a1
codegen metadata
stainless-app[bot] Apr 10, 2026
3a33f2b
codegen metadata
stainless-app[bot] Apr 10, 2026
e179ba6
feat(api): add oldPath field to EnvironmentStatus file changes
stainless-app[bot] Apr 10, 2026
fadafca
docs(types): clarify trigger restrictions in AutomationTrigger
stainless-app[bot] Apr 10, 2026
afd15ee
chore(internal): codegen related update
stainless-app[bot] Apr 12, 2026
452d5e0
feat(api): add prebuild trigger value to automations
stainless-app[bot] Apr 13, 2026
f238e42
codegen metadata
stainless-app[bot] Apr 13, 2026
02571d1
codegen metadata
stainless-app[bot] Apr 14, 2026
e1591e6
feat(api): add integration_id, update webhook_id in WorkflowTrigger
stainless-app[bot] Apr 14, 2026
cf79b4f
codegen metadata
stainless-app[bot] Apr 15, 2026
2c9ad93
codegen metadata
stainless-app[bot] Apr 15, 2026
1701b43
codegen metadata
stainless-app[bot] Apr 15, 2026
c8eb1d6
feat(api): add port_authentication capability to RunnerCapability
stainless-app[bot] Apr 16, 2026
1a35fcb
codegen metadata
stainless-app[bot] Apr 16, 2026
3918662
codegen metadata
stainless-app[bot] Apr 16, 2026
e64a9e9
codegen metadata
stainless-app[bot] Apr 16, 2026
a7fe947
feat(api): add PULL_REQUEST_EVENT_REVIEW_REQUESTED event type to Work…
stainless-app[bot] Apr 17, 2026
27772ea
feat(api): add opus 4.7 model support to agent execution
stainless-app[bot] Apr 17, 2026
6c834b9
feat(api): add UserInputMetadata type to agents
stainless-app[bot] Apr 21, 2026
1302112
codegen metadata
stainless-app[bot] Apr 21, 2026
1a290b3
codegen metadata
stainless-app[bot] Apr 21, 2026
ae690a1
feat(api): add OPENAI_AUTO model option to agents
stainless-app[bot] Apr 22, 2026
306e1fa
chore(internal): more robust bootstrap script
stainless-app[bot] Apr 22, 2026
c420a68
codegen metadata
stainless-app[bot] Apr 22, 2026
aa5ca6e
codegen metadata
stainless-app[bot] Apr 23, 2026
7aa6263
docs(types): deprecate isAdmin in runners organization response
stainless-app[bot] Apr 23, 2026
dad37ce
codegen metadata
stainless-app[bot] Apr 23, 2026
9ce4009
codegen metadata
stainless-app[bot] Apr 23, 2026
7d8db42
codegen metadata
stainless-app[bot] Apr 24, 2026
1170d35
codegen metadata
stainless-app[bot] Apr 24, 2026
6a6e0a8
feat(api): add pagination and search to runners listScmOrganizations …
stainless-app[bot] Apr 24, 2026
e0c9b5b
codegen metadata
stainless-app[bot] Apr 24, 2026
b037a31
codegen metadata
stainless-app[bot] Apr 24, 2026
e354bf8
chore(formatter): run prettier and eslint separately
stainless-app[bot] Apr 24, 2026
1bf5acf
codegen metadata
stainless-app[bot] Apr 27, 2026
a6b0e65
codegen metadata
stainless-app[bot] Apr 27, 2026
3e90e74
feat(api): add readinessTimeout to automations and services
stainless-app[bot] Apr 27, 2026
48f2a33
codegen metadata
stainless-app[bot] Apr 27, 2026
f0055f7
chore(internal): codegen related update
stainless-app[bot] Apr 27, 2026
6e1e4ba
codegen metadata
stainless-app[bot] Apr 27, 2026
bed4904
feat: support setting headers via env
stainless-app[bot] Apr 27, 2026
9fc32dc
feat(api): add maxPortAdmissionLevel to organization policies
stainless-app[bot] Apr 28, 2026
399376e
codegen metadata
stainless-app[bot] Apr 28, 2026
0782de2
chore(format): run eslint and prettier separately
stainless-app[bot] Apr 28, 2026
9f9f219
feat(api): add RESOURCE_ROLE_ORG_ENVIRONMENTS_READER to ResourceRole
stainless-app[bot] Apr 29, 2026
9cd99a0
codegen metadata
stainless-app[bot] Apr 29, 2026
49b46c7
codegen metadata
stainless-app[bot] Apr 29, 2026
7230cc8
codegen metadata
stainless-app[bot] Apr 29, 2026
1fe804b
codegen metadata
stainless-app[bot] Apr 29, 2026
b8c19df
codegen metadata
stainless-app[bot] Apr 30, 2026
f71e7e6
codegen metadata
stainless-app[bot] May 4, 2026
c521a3e
chore(types): remove deprecated accessToken from runners response types
stainless-app[bot] May 4, 2026
3135e19
codegen metadata
stainless-app[bot] May 4, 2026
aeabc1a
codegen metadata
stainless-app[bot] May 4, 2026
78797af
codegen metadata
stainless-app[bot] May 4, 2026
e16a73a
codegen metadata
stainless-app[bot] May 5, 2026
eb856ef
feat(api): add incident trigger to WorkflowTrigger and WorkflowExecution
stainless-app[bot] May 5, 2026
dd096dc
codegen metadata
stainless-app[bot] May 5, 2026
90fa2a8
feat(api): add accessToken field to runners response types
stainless-app[bot] May 5, 2026
2ac9166
codegen metadata
stainless-app[bot] May 6, 2026
71628f5
codegen metadata
stainless-app[bot] May 6, 2026
bf7aae1
codegen metadata
stainless-app[bot] May 6, 2026
d3f780c
codegen metadata
stainless-app[bot] May 6, 2026
dc2e7cc
codegen metadata
stainless-app[bot] May 7, 2026
c67a192
chore(internal): regenerate SDK with no functional changes
stainless-app[bot] May 7, 2026
2598350
chore: redact api-key headers in debug logs
stainless-app[bot] May 7, 2026
1e6190f
feat(api): add credential_proxy to secrets, remove format from enviro…
stainless-app[bot] May 8, 2026
6982788
codegen metadata
stainless-app[bot] May 8, 2026
55ada8b
codegen metadata
stainless-app[bot] May 8, 2026
dd9d5ee
codegen metadata
stainless-app[bot] May 11, 2026
92ee2b0
codegen metadata
stainless-app[bot] May 11, 2026
e89f1e4
codegen metadata
stainless-app[bot] May 11, 2026
0c94086
feat(api): add allowUnverifiedEmailScimFallbackMatch to scim_configur…
stainless-app[bot] May 11, 2026
e96ca1a
feat(api): add agent_execution_cnf capability to runners
stainless-app[bot] May 12, 2026
7d70a05
feat(api): add project_creation_defaults field to organization policies
stainless-app[bot] May 12, 2026
af7aefc
feat(api): add goal field to agent execution status
stainless-app[bot] May 12, 2026
cd97df6
codegen metadata
stainless-app[bot] May 12, 2026
682d6c7
release: 0.15.0
stainless-app[bot] May 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.14.0"
".": "0.15.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 193
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-dabc0ff98cd7b9d91850b3c0dbada4e487e698333cd0b7257959e4819d9a29d6.yml
openapi_spec_hash: b974bdc6025a26cfa62857bf74ec379b
config_hash: 13514c5eb422e4eb01767e718798de1e
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod/gitpod-5c5e706fd0877a91f01455f03ef01c45106b1fad3b4aef5967807bce81bcdd53.yml
openapi_spec_hash: 9d64ab76ba1843ae85b5c719c2a90a3c
config_hash: 9052d3b03d620cf6871184b15487e020
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# Changelog

## 0.15.0 (2026-05-12)

Full Changelog: [v0.14.0...v0.15.0](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.14.0...v0.15.0)

### Features

* **api:** add accessToken field to runners response types ([90fa2a8](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/90fa2a8c112f3717cd08c0cc25a64cfe0d880534))
* **api:** add agent_execution_cnf capability to runners ([e96ca1a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e96ca1a49605a2ddfccd4288862f5721d1d91ceb))
* **api:** add allowUnverifiedEmailScimFallbackMatch to scim_configurations ([0c94086](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/0c940860f8be53265078463c9ef17a3a2d70b234))
* **api:** add credential_proxy to secrets, remove format from environments ([1e6190f](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/1e6190f898a3bfd82c6431734bea4adad3c1ae37))
* **api:** add goal field to agent execution status ([af7aefc](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/af7aefc796d2bebbcac50136ea1cafd9c21a85c5))
* **api:** add incident trigger to WorkflowTrigger and WorkflowExecution ([eb856ef](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/eb856efd3fbac51d1c8556faef976e9a6f8dd09b))
* **api:** add integration_id, update webhook_id in WorkflowTrigger ([e1591e6](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e1591e617c7e29729f6ada19f03fa53a4161a1c3))
* **api:** add maxPortAdmissionLevel to organization policies ([9fc32dc](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/9fc32dcfbf9aab465f71b2d84227318826e589ee))
* **api:** add oldPath field to EnvironmentStatus file changes ([e179ba6](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e179ba6bb9bc0ca5a37262a15235e5f9185a98f6))
* **api:** add OPENAI_AUTO model option to agents ([ae690a1](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/ae690a1a744c174030a9679206f02372fd06af90))
* **api:** add opus 4.7 model support to agent execution ([27772ea](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/27772ea9c32c3336e654df4675500ec83ab01f6a))
* **api:** add pagination and search to runners listScmOrganizations method ([6a6e0a8](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/6a6e0a84e2a9daf23db95877e0b0c015fb51a9c4))
* **api:** add port_authentication capability to RunnerCapability ([c8eb1d6](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/c8eb1d63e97c6570e5156f90c58e29141ed1e68c))
* **api:** add prebuild trigger value to automations ([452d5e0](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/452d5e08209708511f3505402a1b9bd883f59721))
* **api:** add project_creation_defaults field to organization policies ([7d70a05](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/7d70a050bf8bd1a320c67df55d4c0816a71fbe8d))
* **api:** add PULL_REQUEST_EVENT_REVIEW_REQUESTED event type to WorkflowTrigger ([a7fe947](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a7fe947b77f988afdc6e93d77e7629991b6709f3))
* **api:** add readinessTimeout to automations and services ([3e90e74](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/3e90e745e1a3929292bef99678be2b6e18363b4b))
* **api:** add RESOURCE_ROLE_ORG_ENVIRONMENTS_READER to ResourceRole ([9f9f219](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/9f9f21920fe179fcce2d9166f777449d011f1b74))
* **api:** add UserInputMetadata type to agents ([6c834b9](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/6c834b99652dd3da17781e08d5449480cd835fcd))
* **api:** remove terminal field from RunsOn ([85d6ef2](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/85d6ef2d704eb140512d7edf3c1e6495f1da12d5))
* support setting headers via env ([bed4904](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/bed49045e5f23a7f683a8b8603cf1b50a2f7a433))
* **types:** add Report and related schema types to automations ([f9c394a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/f9c394ab4ed90dcea009c21471bbeeec3871bdd6))


### Chores

* **format:** run eslint and prettier separately ([0782de2](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/0782de2e4cc157507a34c43a5db1a8f1700db98c))
* **formatter:** run prettier and eslint separately ([e354bf8](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e354bf849b97e421b9694b55a1d7b0f41e7ba4fe))
* **internal:** codegen related update ([f0055f7](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/f0055f7c6bb9420bc0ae3c6267651393832213f3))
* **internal:** codegen related update ([afd15ee](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/afd15eebed86ae40238ac2e8a34c448e48097aed))
* **internal:** codegen related update ([cfd1e9a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/cfd1e9a15f844e398d089cfc9189b604628b9c33))
* **internal:** more robust bootstrap script ([306e1fa](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/306e1fa51525f0ba764898ed4ee57a4ccb002d8c))
* **internal:** regenerate SDK with no functional changes ([c67a192](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/c67a192f31447d27e1a5b077ea123cf9f18b402f))
* redact api-key headers in debug logs ([2598350](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/2598350538c8203fdb338f4fa41b1e81addd485b))
* **types:** remove deprecated accessToken from runners response types ([c521a3e](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/c521a3efa0f39ccea79c239fa8ffe208c901309a))


### Documentation

* **types:** clarify trigger restrictions in AutomationTrigger ([fadafca](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/fadafca48ec3301694befe6e3d71f14321642500))
* **types:** deprecate isAdmin in runners organization response ([7aa6263](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/7aa6263936e7a45c43801dc818e384d43e1249c5))

## 0.14.0 (2026-04-02)

Full Changelog: [v0.13.0...v0.14.0](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.13.0...v0.14.0)
Expand Down
4 changes: 3 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Types:
- <code><a href="./src/resources/agents.ts">Role</a></code>
- <code><a href="./src/resources/agents.ts">Type</a></code>
- <code><a href="./src/resources/agents.ts">UserInputBlock</a></code>
- <code><a href="./src/resources/agents.ts">UserInputMetadata</a></code>
- <code><a href="./src/resources/agents.ts">WakeEvent</a></code>
- <code><a href="./src/resources/agents.ts">AgentCreateExecutionConversationTokenResponse</a></code>
- <code><a href="./src/resources/agents.ts">AgentCreatePromptResponse</a></code>
Expand Down Expand Up @@ -479,6 +480,7 @@ Types:
- <code><a href="./src/resources/organizations/policies.ts">CustomSecurityAgent</a></code>
- <code><a href="./src/resources/organizations/policies.ts">KernelControlsAction</a></code>
- <code><a href="./src/resources/organizations/policies.ts">OrganizationPolicies</a></code>
- <code><a href="./src/resources/organizations/policies.ts">ProjectCreationDefaults</a></code>
- <code><a href="./src/resources/organizations/policies.ts">SecurityAgentPolicy</a></code>
- <code><a href="./src/resources/organizations/policies.ts">VetoExecPolicy</a></code>
- <code><a href="./src/resources/organizations/policies.ts">PolicyRetrieveResponse</a></code>
Expand Down Expand Up @@ -670,7 +672,7 @@ Methods:
- <code title="post /gitpod.v1.RunnerService/CheckRepositoryAccess">client.runners.<a href="./src/resources/runners/runners.ts">checkRepositoryAccess</a>({ ...params }) -> RunnerCheckRepositoryAccessResponse</code>
- <code title="post /gitpod.v1.RunnerService/CreateRunnerLogsToken">client.runners.<a href="./src/resources/runners/runners.ts">createLogsToken</a>({ ...params }) -> RunnerCreateLogsTokenResponse</code>
- <code title="post /gitpod.v1.RunnerService/CreateRunnerToken">client.runners.<a href="./src/resources/runners/runners.ts">createRunnerToken</a>({ ...params }) -> RunnerCreateRunnerTokenResponse</code>
- <code title="post /gitpod.v1.RunnerService/ListSCMOrganizations">client.runners.<a href="./src/resources/runners/runners.ts">listScmOrganizations</a>({ ...params }) -> RunnerListScmOrganizationsResponse</code>
- <code title="post /gitpod.v1.RunnerService/ListSCMOrganizations">client.runners.<a href="./src/resources/runners/runners.ts">listScmOrganizations</a>({ ...params }) -> RunnerListScmOrganizationsResponsesOrganizationsPage</code>
- <code title="post /gitpod.v1.RunnerService/ParseContextURL">client.runners.<a href="./src/resources/runners/runners.ts">parseContextURL</a>({ ...params }) -> RunnerParseContextURLResponse</code>
- <code title="post /gitpod.v1.RunnerService/SearchRepositories">client.runners.<a href="./src/resources/runners/runners.ts">searchRepositories</a>({ ...params }) -> RunnerSearchRepositoriesResponse</code>

Expand Down
3 changes: 0 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import tseslint from 'typescript-eslint';
import unusedImports from 'eslint-plugin-unused-imports';
import prettier from 'eslint-plugin-prettier';

export default tseslint.config(
{
Expand All @@ -14,11 +13,9 @@ export default tseslint.config(
plugins: {
'@typescript-eslint': tseslint.plugin,
'unused-imports': unusedImports,
prettier,
},
rules: {
'no-unused-vars': 'off',
'prettier/prettier': 'error',
'unused-imports/no-unused-imports': 'error',
'no-restricted-imports': [
'error',
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gitpod/sdk",
"version": "0.14.0",
"version": "0.15.0",
"description": "The official TypeScript library for the Gitpod API",
"author": "Gitpod <dev-feedback@gitpod.com>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -38,7 +38,6 @@
"@typescript-eslint/eslint-plugin": "8.31.1",
"@typescript-eslint/parser": "8.31.1",
"eslint": "^9.39.1",
"eslint-plugin-prettier": "^5.4.1",
"eslint-plugin-unused-imports": "^4.1.4",
"iconv-lite": "^0.6.3",
"jest": "^29.4.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

cd "$(dirname "$0")/.."

if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
echo -n "==> Install Homebrew dependencies? (y/N): "
read -r response
Expand Down
9 changes: 3 additions & 6 deletions scripts/fast-format
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ if ! [ -z "$ESLINT_FILES" ]; then
fi

echo "==> Running prettier --write"
# format things eslint didn't
PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)"
if ! [ -z "$PRETTIER_FILES" ]; then
echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \
--write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \
'!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs'
if ! [ -z "$FILE_LIST" ]; then
cat "$FILE_LIST" | xargs ./node_modules/.bin/prettier \
--write --cache --cache-strategy metadata --no-error-on-unmatched-pattern --ignore-unknown
fi
3 changes: 1 addition & 2 deletions scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ echo "==> Running eslint --fix"
./node_modules/.bin/eslint --fix .

echo "==> Running prettier --write"
# format things eslint didn't
./node_modules/.bin/prettier --write --cache --cache-strategy metadata . '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs'
./node_modules/.bin/prettier --write --cache --cache-strategy metadata .
3 changes: 3 additions & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -e

cd "$(dirname "$0")/.."

echo "==> Running prettier --check"
./node_modules/.bin/prettier --check .

echo "==> Running eslint"
./node_modules/.bin/eslint .

Expand Down
9 changes: 8 additions & 1 deletion scripts/utils/postprocess-files.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@ async function postprocess() {

// strip out lib="dom", types="node", and types="react" references; these
// are needed at build time, but would pollute the user's TS environment
const transformed = code.replace(
let transformed = code.replace(
/^ *\/\/\/ *<reference +(lib="dom"|types="(node|react)").*?\n/gm,
// replace with same number of characters to avoid breaking source maps
(match) => ' '.repeat(match.length - 1) + '\n',
);

// TypeScript's declaration emitter collapses /** @ts-ignore */ onto the same
// line as the type declaration, which doesn't work. So we convert to // @ts-ignore
// on its own line to properly suppresses errors.
if (file.endsWith('.d.ts') || file.endsWith('.d.mts') || file.endsWith('.d.cts')) {
transformed = transformed.replace(/\/\*\* @ts-ignore\b[^*]*\*\/ /gm, '// @ts-ignore\n');
}

if (transformed !== code) {
console.error(`wrote ${path.relative(process.cwd(), file)}`);
await fs.promises.writeFile(file, transformed, 'utf8');
Expand Down
32 changes: 28 additions & 4 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { validatePositiveInteger, isAbsoluteURL, safeJSON } from './internal/uti
import { sleep } from './internal/utils/sleep';
import {
type Logger,
type LogLevel as LogLevelClient,
parseLogLevel,
loggerFor,
formatRequestDetails,
type LogLevel as LogLevelClient,
parseLogLevel,
loggerFor,
formatRequestDetails,
} from './internal/utils/log';
export type { Logger, LogLevel as LogLevelClient } from './internal/utils/log';
import { castToError, isAbortError } from './internal/errors';
Expand Down Expand Up @@ -52,6 +52,8 @@ import {
LoginsPageResponse,
type MembersPageParams,
MembersPageResponse,
type OrganizationsPageParams,
OrganizationsPageResponse,
type OutputsPageParams,
OutputsPageResponse,
type PersonalAccessTokensPageParams,
Expand Down Expand Up @@ -154,6 +156,7 @@ import {
Role,
Type,
UserInputBlock,
UserInputMetadata,
WakeEvent,
} from './resources/agents';
import {
Expand Down Expand Up @@ -417,6 +420,7 @@ import {
RunnerListParams,
RunnerListScmOrganizationsParams,
RunnerListScmOrganizationsResponse,
RunnerListScmOrganizationsResponsesOrganizationsPage,
RunnerParseContextURLParams,
RunnerParseContextURLResponse,
RunnerPhase,
Expand Down Expand Up @@ -591,6 +595,18 @@ export class Gitpod {
this.fetch = options.fetch ?? Shims.getDefaultFetch();
this.#encoder = Opts.FallbackEncoder;

const customHeadersEnv = readEnv('GITPOD_CUSTOM_HEADERS');
if (customHeadersEnv) {
const parsed: Record<string, string> = {};
for (const line of customHeadersEnv.split('\n')) {
const colon = line.indexOf(':');
if (colon >= 0) {
parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
}
}
options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
}

this._options = options;

this.bearerToken = bearerToken;
Expand Down Expand Up @@ -1282,6 +1298,12 @@ export declare namespace Gitpod {
export import MembersPage = Pagination.MembersPage;
export { type MembersPageParams as MembersPageParams, type MembersPageResponse as MembersPageResponse };

export import OrganizationsPage = Pagination.OrganizationsPage;
export {
type OrganizationsPageParams as OrganizationsPageParams,
type OrganizationsPageResponse as OrganizationsPageResponse,
};

export import OutputsPage = Pagination.OutputsPage;
export { type OutputsPageParams as OutputsPageParams, type OutputsPageResponse as OutputsPageResponse };

Expand Down Expand Up @@ -1411,6 +1433,7 @@ export declare namespace Gitpod {
type Role as Role,
type Type as Type,
type UserInputBlock as UserInputBlock,
type UserInputMetadata as UserInputMetadata,
type WakeEvent as WakeEvent,
type AgentCreateExecutionConversationTokenResponse as AgentCreateExecutionConversationTokenResponse,
type AgentCreatePromptResponse as AgentCreatePromptResponse,
Expand Down Expand Up @@ -1695,6 +1718,7 @@ export declare namespace Gitpod {
type RunnerParseContextURLResponse as RunnerParseContextURLResponse,
type RunnerSearchRepositoriesResponse as RunnerSearchRepositoriesResponse,
type RunnersRunnersPage as RunnersRunnersPage,
type RunnerListScmOrganizationsResponsesOrganizationsPage as RunnerListScmOrganizationsResponsesOrganizationsPage,
type RunnerCreateParams as RunnerCreateParams,
type RunnerRetrieveParams as RunnerRetrieveParams,
type RunnerUpdateParams as RunnerUpdateParams,
Expand Down
55 changes: 55 additions & 0 deletions src/core/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,61 @@ export class MembersPage<Item> extends AbstractPage<Item> implements MembersPage
}
}

export interface OrganizationsPageResponse<Item> {
organizations: Array<Item>;

pagination: OrganizationsPageResponse.Pagination;
}

export namespace OrganizationsPageResponse {
export interface Pagination {
nextToken?: string;
}
}

export interface OrganizationsPageParams {
pageSize?: number;

token?: string;
}

export class OrganizationsPage<Item> extends AbstractPage<Item> implements OrganizationsPageResponse<Item> {
organizations: Array<Item>;

pagination: OrganizationsPageResponse.Pagination;

constructor(
client: Gitpod,
response: Response,
body: OrganizationsPageResponse<Item>,
options: FinalRequestOptions,
) {
super(client, response, body, options);

this.organizations = body.organizations || [];
this.pagination = body.pagination || {};
}

getPaginatedItems(): Item[] {
return this.organizations ?? [];
}

nextPageRequestOptions(): PageRequestOptions | null {
const cursor = this.pagination?.nextToken;
if (!cursor) {
return null;
}

return {
...this.options,
query: {
...maybeObj(this.options.query),
token: cursor,
},
};
}
}

export interface OutputsPageResponse<Item> {
outputs: Array<Item>;

Expand Down
Loading
Loading