From 1f1c4d8e8dbe85048bfe91081603538ccc716417 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 17:59:04 +0000 Subject: [PATCH 1/2] feat(api): add delete_browsers endpoint --- .stats.yml | 8 ++++---- api.md | 1 + src/resources/invocations.ts | 15 +++++++++++++++ tests/api-resources/invocations.test.ts | 12 ++++++++++++ 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index ba1c7c9..4a84456 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 15 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-5d4e11bc46eeecee7363d56a9dfe946acee997d5b352c2b0a50c20e742c54d2d.yml -openapi_spec_hash: 333e53ad9c706296b9afdb8ff73bec8f -config_hash: 0fdf285ddd8dee229fd84ea57df9080f +configured_endpoints: 16 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-b019e469425a59061f37c5fdc7a131a5291c66134ef0627db4f06bb1f4af0b15.yml +openapi_spec_hash: f66a3c2efddb168db9539ba2507b10b8 +config_hash: aae6721b2be9ec8565dfc8f7eadfe105 diff --git a/api.md b/api.md index 2f61707..f81d636 100644 --- a/api.md +++ b/api.md @@ -59,6 +59,7 @@ Methods: - client.invocations.create({ ...params }) -> InvocationCreateResponse - client.invocations.retrieve(id) -> InvocationRetrieveResponse - client.invocations.update(id, { ...params }) -> InvocationUpdateResponse +- client.invocations.deleteBrowsers(id) -> void - client.invocations.follow(id) -> InvocationFollowResponse # Browsers diff --git a/src/resources/invocations.ts b/src/resources/invocations.ts index 40e16b6..6b585e4 100644 --- a/src/resources/invocations.ts +++ b/src/resources/invocations.ts @@ -57,6 +57,21 @@ export class Invocations extends APIResource { return this._client.patch(path`/invocations/${id}`, { body, ...options }); } + /** + * Delete all browser sessions created within the specified invocation. + * + * @example + * ```ts + * await client.invocations.deleteBrowsers('id'); + * ``` + */ + deleteBrowsers(id: string, options?: RequestOptions): APIPromise { + return this._client.delete(path`/invocations/${id}/browsers`, { + ...options, + headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), + }); + } + /** * Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and * status updates for an invocation. The stream terminates automatically once the diff --git a/tests/api-resources/invocations.test.ts b/tests/api-resources/invocations.test.ts index 2201a59..e481c15 100644 --- a/tests/api-resources/invocations.test.ts +++ b/tests/api-resources/invocations.test.ts @@ -64,6 +64,18 @@ describe('resource invocations', () => { const response = await client.invocations.update('id', { status: 'succeeded', output: 'output' }); }); + // skipped: tests are disabled for the time being + test.skip('deleteBrowsers', async () => { + const responsePromise = client.invocations.deleteBrowsers('id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail test.skip('follow', async () => { const responsePromise = client.invocations.follow('id'); From dd0d44c6143ef517a0c9b0f61ab534d039618260 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:00:26 +0000 Subject: [PATCH 2/2] release: 0.6.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bcd0522..5d02000 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.6.0" + ".": "0.6.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ba64d8..62f8ab8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.6.1 (2025-06-18) + +Full Changelog: [v0.6.0...v0.6.1](https://github.com/onkernel/kernel-node-sdk/compare/v0.6.0...v0.6.1) + +### Features + +* **api:** add delete_browsers endpoint ([1f1c4d8](https://github.com/onkernel/kernel-node-sdk/commit/1f1c4d8e8dbe85048bfe91081603538ccc716417)) + ## 0.6.0 (2025-06-18) Full Changelog: [v0.5.0...v0.6.0](https://github.com/onkernel/kernel-node-sdk/compare/v0.5.0...v0.6.0) diff --git a/package.json b/package.json index 05bd20a..5ff0a3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onkernel/sdk", - "version": "0.6.0", + "version": "0.6.1", "description": "The official TypeScript library for the Kernel API", "author": "Kernel <>", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 30c2817..3998d8e 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.6.0'; // x-release-please-version +export const VERSION = '0.6.1'; // x-release-please-version