From 01f734240c4602ab359e03abb899e1eb00e2d407 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 08:29:50 +0000 Subject: [PATCH 1/5] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c57d3dc..b1eddf2 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-988164042da1361feb3d28364c6f14fee775ceab496b9d79d048141c0fa6da19.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6860d955bb7b497681b9d1ae03c10c51a458c68f5011efc648ae9d049250d6c7.yml From 9729975380bd7890239e813c30df668b5a7ff63d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 08:31:40 +0000 Subject: [PATCH 2/5] chore(internal): update eslint config (#9) --- eslint.config.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index e0d3669..bd8e0cb 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -10,6 +10,7 @@ export default tseslint.config( parserOptions: { sourceType: 'module' }, }, files: ['**/*.ts', '**/*.mts', '**/*.cts', '**/*.js', '**/*.mjs', '**/*.cjs'], + ignores: ['dist/**'], plugins: { '@typescript-eslint': tseslint.plugin, 'unused-imports': unusedImports, @@ -24,7 +25,7 @@ export default tseslint.config( { patterns: [ { - group: ['@gitpod/sdk', '@gitpod/sdk/*'], + regex: '^@gitpod/sdk(/.*)?', message: 'Use a relative import, not a package import.', }, ], From 26ada5f30ba94e0fa0640b1e4645a7c37f30385a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 08:33:24 +0000 Subject: [PATCH 3/5] fix(client): fix export map for index exports, accept BunFile (#11) --- scripts/utils/postprocess-files.cjs | 8 ++++---- src/internal/uploads.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/utils/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs index deae575..d16c864 100644 --- a/scripts/utils/postprocess-files.cjs +++ b/scripts/utils/postprocess-files.cjs @@ -50,14 +50,14 @@ async function postprocess() { if (entry.isDirectory() && entry.name !== 'src' && entry.name !== 'internal' && entry.name !== 'bin') { const subpath = './' + entry.name; newExports[subpath + '/*.mjs'] = { - default: subpath + '/*.mjs', + default: [subpath + '/*.mjs', subpath + '/*/index.mjs'], }; newExports[subpath + '/*.js'] = { - default: subpath + '/*.js', + default: [subpath + '/*.js', subpath + '/*/index.js'], }; newExports[subpath + '/*'] = { - import: subpath + '/*.mjs', - require: subpath + '/*.js', + import: [subpath + '/*.mjs', subpath + '/*/index.mjs'], + require: [subpath + '/*.js', subpath + '/*/index.js'], }; } else if (entry.isFile() && /\.[cm]?js$/.test(entry.name)) { const { name, ext } = path.parse(entry.name); diff --git a/src/internal/uploads.ts b/src/internal/uploads.ts index 4f0fb82..ee2029c 100644 --- a/src/internal/uploads.ts +++ b/src/internal/uploads.ts @@ -52,7 +52,7 @@ interface FileLike extends BlobLike { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */ readonly lastModified: number; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */ - readonly name: string; + readonly name?: string | undefined; } declare var FileClass: { prototype: FileLike; @@ -126,7 +126,7 @@ export async function toFile( if (File && value instanceof File) { return value; } - return makeFile([await value.arrayBuffer()], value.name); + return makeFile([await value.arrayBuffer()], value.name ?? 'unknown_file'); } if (isResponseLike(value)) { From 394d36352fafe2331e4e554fdeaa4c002cf879ea Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 08:39:32 +0000 Subject: [PATCH 4/5] feat(api): dummy change to cause a version PR (#12) --- .stats.yml | 2 +- src/resources/users/pats.ts | 4 ++-- tests/api-resources/users/pats.test.ts | 18 +++++++++++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index b1eddf2..d569fcb 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-6860d955bb7b497681b9d1ae03c10c51a458c68f5011efc648ae9d049250d6c7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e3ac088751d52ff03184c39a009d093a7457f4e25dc489a938fe25ad5d83d98.yml diff --git a/src/resources/users/pats.ts b/src/resources/users/pats.ts index dcb49b9..8ea91af 100644 --- a/src/resources/users/pats.ts +++ b/src/resources/users/pats.ts @@ -11,10 +11,10 @@ export class Pats extends APIResource { * ListPersonalAccessTokens */ list( - params: PatListParams, + params: PatListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { - const { token, pageSize, ...body } = params; + const { token, pageSize, ...body } = params ?? {}; return this._client.getAPIList( '/gitpod.v1.UserService/ListPersonalAccessTokens', PersonalAccessTokensPage, diff --git a/tests/api-resources/users/pats.test.ts b/tests/api-resources/users/pats.test.ts index cb8544c..31f99a1 100644 --- a/tests/api-resources/users/pats.test.ts +++ b/tests/api-resources/users/pats.test.ts @@ -10,7 +10,7 @@ const client = new Gitpod({ describe('resource pats', () => { // skipped: tests are disabled for the time being test.skip('list', async () => { - const responsePromise = client.users.pats.list({}); + const responsePromise = client.users.pats.list(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -20,6 +20,22 @@ describe('resource pats', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.users.pats.list( + { + token: 'token', + pageSize: 0, + filter: { userIds: ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'] }, + pagination: { token: 'token', pageSize: 100 }, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Gitpod.NotFoundError); + }); + // skipped: tests are disabled for the time being test.skip('delete', async () => { const responsePromise = client.users.pats.delete({}); From 79c6757aad0a8413fb59503b5d82e92dba4babda Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 08:43:06 +0000 Subject: [PATCH 5/5] release: 0.1.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 18 ++++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b3b5e58..a915e8c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.4" + ".": "0.1.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 65941e6..58d1336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 0.1.1 (2025-02-14) + +Full Changelog: [v0.1.0-alpha.4...v0.1.1](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.1.0-alpha.4...v0.1.1) + +### Features + +* **api:** dummy change to cause a version PR ([#12](https://github.com/gitpod-io/gitpod-sdk-typescript/issues/12)) ([394d363](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/394d36352fafe2331e4e554fdeaa4c002cf879ea)) + + +### Bug Fixes + +* **client:** fix export map for index exports, accept BunFile ([#11](https://github.com/gitpod-io/gitpod-sdk-typescript/issues/11)) ([26ada5f](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/26ada5f30ba94e0fa0640b1e4645a7c37f30385a)) + + +### Chores + +* **internal:** update eslint config ([#9](https://github.com/gitpod-io/gitpod-sdk-typescript/issues/9)) ([9729975](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/9729975380bd7890239e813c30df668b5a7ff63d)) + ## 0.1.0-alpha.4 (2025-02-13) Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.4](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.0.1-alpha.0...v0.1.0-alpha.4) diff --git a/package.json b/package.json index 743986f..83aa954 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gitpod/sdk", - "version": "0.1.0-alpha.4", + "version": "0.1.1", "description": "The official TypeScript library for the Gitpod API", "author": "Gitpod ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index fe6d1df..b322647 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.1.0-alpha.4'; // x-release-please-version +export const VERSION = '0.1.1'; // x-release-please-version