From 8875d65b89f6a1d8d79bf8b1463b0900247e89b3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 12:51:14 +0000 Subject: [PATCH 1/2] feat(api): /browsers no longer requires invocation id --- .stats.yml | 4 ++-- src/resources/browsers.ts | 11 ++++++----- tests/api-resources/browsers.test.ts | 22 ++++++++++++++-------- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.stats.yml b/.stats.yml index b296d07..60f163b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-2aec229ccf91f7c1ac95aa675ea2a59bd61af9e363a22c3b49677992f1eeb16a.yml -openapi_spec_hash: c80cd5d52a79cd5366a76d4a825bd27a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-ff8ccba8b5409eaa1128df9027582cb63f66e8accd75e511f70b7c27ef26c9ae.yml +openapi_spec_hash: 1dbacc339695a7c78718f90f791d3f01 config_hash: b8e1fff080fbaa22656ab0a57b591777 diff --git a/src/resources/browsers.ts b/src/resources/browsers.ts index adc075f..ac3ffac 100644 --- a/src/resources/browsers.ts +++ b/src/resources/browsers.ts @@ -13,12 +13,13 @@ export class Browsers extends APIResource { * * @example * ```ts - * const browser = await client.browsers.create({ - * invocation_id: 'rr33xuugxj9h0bkf1rdt2bet', - * }); + * const browser = await client.browsers.create(); * ``` */ - create(body: BrowserCreateParams, options?: RequestOptions): APIPromise { + create( + body: BrowserCreateParams | null | undefined = {}, + options?: RequestOptions, + ): APIPromise { return this._client.post('/browsers', { body, ...options }); } @@ -169,7 +170,7 @@ export interface BrowserCreateParams { /** * action invocation ID */ - invocation_id: string; + invocation_id?: string; /** * Optional persistence configuration for the browser session. diff --git a/tests/api-resources/browsers.test.ts b/tests/api-resources/browsers.test.ts index c6f0967..24863a9 100644 --- a/tests/api-resources/browsers.test.ts +++ b/tests/api-resources/browsers.test.ts @@ -9,8 +9,8 @@ const client = new Kernel({ describe('resource browsers', () => { // skipped: tests are disabled for the time being - test.skip('create: only required params', async () => { - const responsePromise = client.browsers.create({ invocation_id: 'rr33xuugxj9h0bkf1rdt2bet' }); + test.skip('create', async () => { + const responsePromise = client.browsers.create(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -21,12 +21,18 @@ describe('resource browsers', () => { }); // skipped: tests are disabled for the time being - test.skip('create: required and optional params', async () => { - const response = await client.browsers.create({ - invocation_id: 'rr33xuugxj9h0bkf1rdt2bet', - persistence: { id: 'my-awesome-browser-for-user-1234' }, - stealth: true, - }); + test.skip('create: 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.browsers.create( + { + invocation_id: 'rr33xuugxj9h0bkf1rdt2bet', + persistence: { id: 'my-awesome-browser-for-user-1234' }, + stealth: true, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Kernel.NotFoundError); }); // skipped: tests are disabled for the time being From 95df2ae326f907f57b332dd5e2b3a06d0856d4b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 12:53:05 +0000 Subject: [PATCH 2/2] release: 0.6.3 --- .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 bf5f1fb..7e23a4f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.6.2" + ".": "0.6.3" } diff --git a/CHANGELOG.md b/CHANGELOG.md index dcfc8af..724f56d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.6.3 (2025-06-25) + +Full Changelog: [v0.6.2...v0.6.3](https://github.com/onkernel/kernel-node-sdk/compare/v0.6.2...v0.6.3) + +### Features + +* **api:** /browsers no longer requires invocation id ([8875d65](https://github.com/onkernel/kernel-node-sdk/commit/8875d65b89f6a1d8d79bf8b1463b0900247e89b3)) + ## 0.6.2 (2025-06-24) Full Changelog: [v0.6.1...v0.6.2](https://github.com/onkernel/kernel-node-sdk/compare/v0.6.1...v0.6.2) diff --git a/package.json b/package.json index 22484c9..2b07af9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onkernel/sdk", - "version": "0.6.2", + "version": "0.6.3", "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 0d52c9a..ae4dccc 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.6.2'; // x-release-please-version +export const VERSION = '0.6.3'; // x-release-please-version