Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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.6.3"
".": "0.6.4"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 16
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-ff8ccba8b5409eaa1128df9027582cb63f66e8accd75e511f70b7c27ef26c9ae.yml
openapi_spec_hash: 1dbacc339695a7c78718f90f791d3f01
config_hash: b8e1fff080fbaa22656ab0a57b591777
configured_endpoints: 17
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-2eeb61205775c5997abf8154cd6f6fe81a1e83870eff10050b17ed415aa7860b.yml
openapi_spec_hash: 63405add4a3f53718f8183cbb8c1a22f
config_hash: 00ec9df250b9dc077f8d3b93a442d252
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.6.4 (2025-06-27)

Full Changelog: [v0.6.3...v0.6.4](https://github.com/onkernel/kernel-node-sdk/compare/v0.6.3...v0.6.4)

### Features

* **api:** add GET deployments endpoint ([89b755a](https://github.com/onkernel/kernel-node-sdk/commit/89b755ab2e178f4b0dc5c62931a1fd45ff1021b7))
* **api:** deployments ([94db12e](https://github.com/onkernel/kernel-node-sdk/commit/94db12ed7156c1c1288f37d27d3e29318317ca77))
* **api:** manual updates ([042d683](https://github.com/onkernel/kernel-node-sdk/commit/042d6833991c6252b104d2a590ecc7d6c98dcf99))


### Bug Fixes

* **ci:** release-doctor — report correct token name ([c9e22fd](https://github.com/onkernel/kernel-node-sdk/commit/c9e22fdadb192a655859db322fd174321001040d))
* **client:** get fetchOptions type more reliably ([5f60c0f](https://github.com/onkernel/kernel-node-sdk/commit/5f60c0f4c555ae86fc5e6c43c09a465adca163f0))

## 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)
Expand Down
3 changes: 3 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Types:

- <code><a href="./src/resources/shared.ts">AppAction</a></code>
- <code><a href="./src/resources/shared.ts">ErrorDetail</a></code>
- <code><a href="./src/resources/shared.ts">ErrorEvent</a></code>
- <code><a href="./src/resources/shared.ts">ErrorModel</a></code>
Expand All @@ -15,12 +16,14 @@ Types:
- <code><a href="./src/resources/deployments.ts">DeploymentStateEvent</a></code>
- <code><a href="./src/resources/deployments.ts">DeploymentCreateResponse</a></code>
- <code><a href="./src/resources/deployments.ts">DeploymentRetrieveResponse</a></code>
- <code><a href="./src/resources/deployments.ts">DeploymentListResponse</a></code>
- <code><a href="./src/resources/deployments.ts">DeploymentFollowResponse</a></code>

Methods:

- <code title="post /deployments">client.deployments.<a href="./src/resources/deployments.ts">create</a>({ ...params }) -> DeploymentCreateResponse</code>
- <code title="get /deployments/{id}">client.deployments.<a href="./src/resources/deployments.ts">retrieve</a>(id) -> DeploymentRetrieveResponse</code>
- <code title="get /deployments">client.deployments.<a href="./src/resources/deployments.ts">list</a>({ ...params }) -> DeploymentListResponse</code>
- <code title="get /deployments/{id}/events">client.deployments.<a href="./src/resources/deployments.ts">follow</a>(id, { ...params }) -> DeploymentFollowResponse</code>

# Apps
Expand Down
2 changes: 1 addition & 1 deletion bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
errors=()

if [ -z "${NPM_TOKEN}" ]; then
errors+=("The KERNEL_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

lenErrors=${#errors[@]}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onkernel/sdk",
"version": "0.6.3",
"version": "0.6.4",
"description": "The official TypeScript library for the Kernel API",
"author": "Kernel <>",
"types": "dist/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import {
DeploymentCreateResponse,
DeploymentFollowParams,
DeploymentFollowResponse,
DeploymentListParams,
DeploymentListResponse,
DeploymentRetrieveResponse,
DeploymentStateEvent,
Deployments,
Expand Down Expand Up @@ -789,8 +791,10 @@ export declare namespace Kernel {
type DeploymentStateEvent as DeploymentStateEvent,
type DeploymentCreateResponse as DeploymentCreateResponse,
type DeploymentRetrieveResponse as DeploymentRetrieveResponse,
type DeploymentListResponse as DeploymentListResponse,
type DeploymentFollowResponse as DeploymentFollowResponse,
type DeploymentCreateParams as DeploymentCreateParams,
type DeploymentListParams as DeploymentListParams,
type DeploymentFollowParams as DeploymentFollowParams,
};

Expand All @@ -817,6 +821,7 @@ export declare namespace Kernel {
type BrowserDeleteParams as BrowserDeleteParams,
};

export type AppAction = API.AppAction;
export type ErrorDetail = API.ErrorDetail;
export type ErrorEvent = API.ErrorEvent;
export type ErrorModel = API.ErrorModel;
Expand Down
15 changes: 9 additions & 6 deletions src/internal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type KeysEnum<T> = { [P in keyof Required<T>]: true };

export type FinalizedRequestInit = RequestInit & { headers: Headers };

type NotAny<T> = [unknown] extends [T] ? never : T;
type NotAny<T> = [0] extends [1 & T] ? never : T;

/**
* Some environments overload the global fetch function, and Parameters<T> only gets the last signature.
Expand Down Expand Up @@ -64,13 +64,15 @@ type OverloadedParameters<T> =
* [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
*/
/** @ts-ignore For users with \@types/node */
type UndiciTypesRequestInit = NotAny<import('../node_modules/undici-types').RequestInit> | NotAny<import('../../node_modules/undici-types').RequestInit> | NotAny<import('../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici-types').RequestInit>;
type UndiciTypesRequestInit = NotAny<import('../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit>;
/** @ts-ignore For users with undici */
type UndiciRequestInit = NotAny<import('../node_modules/undici').RequestInit> | NotAny<import('../../node_modules/undici').RequestInit> | NotAny<import('../../../node_modules/undici').RequestInit> | NotAny<import('../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici').RequestInit>;
type UndiciRequestInit = NotAny<import('../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici/index.d.ts').RequestInit>;
/** @ts-ignore For users with \@types/bun */
type BunRequestInit = globalThis.FetchRequestInit;
/** @ts-ignore For users with node-fetch */
type NodeFetchRequestInit = NotAny<import('../node_modules/node-fetch').RequestInit> | NotAny<import('../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/node-fetch').RequestInit>;
/** @ts-ignore For users with node-fetch@2 */
type NodeFetch2RequestInit = NotAny<import('../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit>;
/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */
type NodeFetch3RequestInit = NotAny<import('../node_modules/node-fetch').RequestInit> | NotAny<import('../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/node-fetch').RequestInit>;
/** @ts-ignore For users who use Deno */
type FetchRequestInit = NonNullable<OverloadedParameters<typeof fetch>[1]>;
/* eslint-enable */
Expand All @@ -79,7 +81,8 @@ type RequestInits =
| NotAny<UndiciTypesRequestInit>
| NotAny<UndiciRequestInit>
| NotAny<BunRequestInit>
| NotAny<NodeFetchRequestInit>
| NotAny<NodeFetch2RequestInit>
| NotAny<NodeFetch3RequestInit>
| NotAny<RequestInit>
| NotAny<FetchRequestInit>;

Expand Down
16 changes: 11 additions & 5 deletions src/resources/apps/apps.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../core/resource';
import * as Shared from '../shared';
import * as DeploymentsAPI from './deployments';
import {
DeploymentCreateParams,
Expand Down Expand Up @@ -39,6 +40,11 @@ export namespace AppListResponse {
*/
id: string;

/**
* List of actions available on the app
*/
actions: Array<Shared.AppAction>;

/**
* Name of the application
*/
Expand All @@ -49,6 +55,11 @@ export namespace AppListResponse {
*/
deployment: string;

/**
* Environment variables configured for this app version
*/
env_vars: { [key: string]: string };

/**
* Deployment region code
*/
Expand All @@ -58,11 +69,6 @@ export namespace AppListResponse {
* Version label for the application
*/
version: string;

/**
* Environment variables configured for this app version
*/
env_vars?: { [key: string]: string };
}
}

Expand Down
11 changes: 1 addition & 10 deletions src/resources/apps/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,13 @@ export namespace DeploymentCreateResponse {
/**
* List of actions available on the app
*/
actions: Array<App.Action>;
actions: Array<Shared.AppAction>;

/**
* Name of the app
*/
name: string;
}

export namespace App {
export interface Action {
/**
* Name of the action
*/
name: string;
}
}
}

/**
Expand Down
87 changes: 74 additions & 13 deletions src/resources/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ export class Deployments extends APIResource {
return this._client.get(path`/deployments/${id}`, options);
}

/**
* List deployments. Optionally filter by application name.
*
* @example
* ```ts
* const deployments = await client.deployments.list();
* ```
*/
list(
query: DeploymentListParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<DeploymentListResponse> {
return this._client.get('/deployments', { query, ...options });
}

/**
* Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and
* status updates for a deployment. The stream terminates automatically once the
Expand Down Expand Up @@ -219,6 +234,55 @@ export interface DeploymentRetrieveResponse {
updated_at?: string | null;
}

export type DeploymentListResponse = Array<DeploymentListResponse.DeploymentListResponseItem>;

export namespace DeploymentListResponse {
/**
* Deployment record information.
*/
export interface DeploymentListResponseItem {
/**
* Unique identifier for the deployment
*/
id: string;

/**
* Timestamp when the deployment was created
*/
created_at: string;

/**
* Deployment region code
*/
region: 'aws.us-east-1a';

/**
* Current status of the deployment
*/
status: 'queued' | 'in_progress' | 'running' | 'failed' | 'stopped';

/**
* Relative path to the application entrypoint
*/
entrypoint_rel_path?: string;

/**
* Environment variables configured for this deployment
*/
env_vars?: { [key: string]: string };

/**
* Status reason
*/
status_reason?: string;

/**
* Timestamp when the deployment was last updated
*/
updated_at?: string | null;
}
}

/**
* Union type representing any deployment event.
*/
Expand All @@ -242,7 +306,7 @@ export namespace DeploymentFollowResponse {
/**
* List of actions available on the app
*/
actions: Array<AppVersionSummaryEvent.Action>;
actions: Array<Shared.AppAction>;

/**
* Name of the application
Expand Down Expand Up @@ -274,18 +338,6 @@ export namespace DeploymentFollowResponse {
*/
env_vars?: { [key: string]: string };
}

export namespace AppVersionSummaryEvent {
/**
* An action available on the app
*/
export interface Action {
/**
* Name of the action
*/
name: string;
}
}
}

export interface DeploymentCreateParams {
Expand Down Expand Up @@ -321,6 +373,13 @@ export interface DeploymentCreateParams {
version?: string;
}

export interface DeploymentListParams {
/**
* Filter results by application name.
*/
app_name?: string;
}

export interface DeploymentFollowParams {
/**
* Show logs since the given time (RFC timestamps or durations like 5m).
Expand All @@ -333,8 +392,10 @@ export declare namespace Deployments {
type DeploymentStateEvent as DeploymentStateEvent,
type DeploymentCreateResponse as DeploymentCreateResponse,
type DeploymentRetrieveResponse as DeploymentRetrieveResponse,
type DeploymentListResponse as DeploymentListResponse,
type DeploymentFollowResponse as DeploymentFollowResponse,
type DeploymentCreateParams as DeploymentCreateParams,
type DeploymentListParams as DeploymentListParams,
type DeploymentFollowParams as DeploymentFollowParams,
};
}
2 changes: 2 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ export {
type DeploymentStateEvent,
type DeploymentCreateResponse,
type DeploymentRetrieveResponse,
type DeploymentListResponse,
type DeploymentFollowResponse,
type DeploymentCreateParams,
type DeploymentListParams,
type DeploymentFollowParams,
} from './deployments';
export {
Expand Down
10 changes: 10 additions & 0 deletions src/resources/shared.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

/**
* An action available on the app
*/
export interface AppAction {
/**
* Name of the action
*/
name: string;
}

export interface ErrorDetail {
/**
* Lower-level error code providing more specific detail
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.6.3'; // x-release-please-version
export const VERSION = '0.6.4'; // x-release-please-version
20 changes: 20 additions & 0 deletions tests/api-resources/deployments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,26 @@ describe('resource deployments', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// skipped: tests are disabled for the time being
test.skip('list', async () => {
const responsePromise = client.deployments.list();
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: 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.deployments.list({ app_name: 'app_name' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Kernel.NotFoundError);
});

// 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.deployments.follow('id');
Expand Down