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.72.0"
".": "0.73.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 124
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-4c243ff089133bd49322d98a6943647589972f71ecadc993fe9e5029972b3995.yml
openapi_spec_hash: a2cb637a19a070d07a1a4343c75444ee
config_hash: fb167e754ebb3a14649463725891c9d0
configured_endpoints: 125
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-55409ab573762d8bc010fb34c885651ca858a97d4353b4776b7aafeaaa313257.yml
openapi_spec_hash: 0cf678d80f2a2b73fb9ec82d05c8cc0a
config_hash: 06186eb40e0058a2a87ac251fc07415d
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.73.0 (2026-07-01)

Full Changelog: [v0.72.0...v0.73.0](https://github.com/kernel/kernel-node-sdk/compare/v0.72.0...v0.73.0)

### Features

* Add hidden audit-logs export endpoint ([14db0ea](https://github.com/kernel/kernel-node-sdk/commit/14db0ea3dfa7c2f0bd2f8f50e8b0415866a3f512))

## 0.72.0 (2026-06-26)

Full Changelog: [v0.71.1...v0.72.0](https://github.com/kernel/kernel-node-sdk/compare/v0.71.1...v0.72.0)
Expand Down
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ Types:
Methods:

- <code title="get /audit-logs">client.auditLogs.<a href="./src/resources/audit-logs.ts">list</a>({ ...params }) -> AuditLogEntriesPageTokenPagination</code>
- <code title="get /audit-logs/export/chunk">client.auditLogs.<a href="./src/resources/audit-logs.ts">exportChunk</a>({ ...params }) -> Response</code>

# APIKeys

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.72.0",
"version": "0.73.0",
"description": "The official TypeScript library for the Kernel API",
"author": "Kernel <>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
import {
AuditLogEntriesPageTokenPagination,
AuditLogEntry,
AuditLogExportChunkParams,
AuditLogListParams,
AuditLogs,
} from './resources/audit-logs';
Expand Down Expand Up @@ -1192,6 +1193,7 @@ export declare namespace Kernel {
type AuditLogEntry as AuditLogEntry,
type AuditLogEntriesPageTokenPagination as AuditLogEntriesPageTokenPagination,
type AuditLogListParams as AuditLogListParams,
type AuditLogExportChunkParams as AuditLogExportChunkParams,
};

export {
Expand Down
74 changes: 74 additions & 0 deletions src/resources/audit-logs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { PagePromise, PageTokenPagination, type PageTokenPaginationParams } from '../core/pagination';
import { buildHeaders } from '../internal/headers';
import { RequestOptions } from '../internal/request-options';

/**
Expand All @@ -18,6 +20,20 @@ export class AuditLogs extends APIResource {
): PagePromise<AuditLogEntriesPageTokenPagination, AuditLogEntry> {
return this._client.getAPIList('/audit-logs', PageTokenPagination<AuditLogEntry>, { query, ...options });
}

/**
* Download an organization's audit log records for a time range as a file, for
* archival, compliance, or offline analysis. For interactive browsing, use GET
* /audit-logs.
*/
exportChunk(query: AuditLogExportChunkParams, options?: RequestOptions): APIPromise<Response> {
return this._client.get('/audit-logs/export/chunk', {
query,
...options,
headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
__binaryResponse: true,
});
}
}

export type AuditLogEntriesPageTokenPagination = PageTokenPagination<AuditLogEntry>;
Expand Down Expand Up @@ -126,10 +142,68 @@ export interface AuditLogListParams extends PageTokenPaginationParams {
service?: string;
}

export interface AuditLogExportChunkParams {
/**
* Upper bound (exclusive) for the audit record timestamp.
*/
end: string;

/**
* Lower bound (inclusive) for the audit record timestamp.
*/
start: string;

/**
* Filter by authentication strategy.
*/
auth_strategy?: string;

/**
* Opaque cursor from X-Next-Cursor for the next chunk of older records.
*/
cursor?: string;

/**
* Filter out results by HTTP method.
*/
exclude_method?: string;

/**
* Encoding for the returned chunk.
*/
format?: 'jsonl' | 'jsonl.gz';

/**
* Maximum number of records to return in this chunk.
*/
limit?: number;

/**
* Filter by HTTP method.
*/
method?: string;

/**
* Free-text search over path, user ID, email, client IP, and status.
*/
search?: string;

/**
* Additional user IDs to OR into free-text search.
*/
search_user_id?: Array<string>;

/**
* Filter by service name.
*/
service?: string;
}

export declare namespace AuditLogs {
export {
type AuditLogEntry as AuditLogEntry,
type AuditLogEntriesPageTokenPagination as AuditLogEntriesPageTokenPagination,
type AuditLogListParams as AuditLogListParams,
type AuditLogExportChunkParams as AuditLogExportChunkParams,
};
}
1 change: 1 addition & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export {
AuditLogs,
type AuditLogEntry,
type AuditLogListParams,
type AuditLogExportChunkParams,
type AuditLogEntriesPageTokenPagination,
} from './audit-logs';
export { Auth } from './auth/auth';
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.72.0'; // x-release-please-version
export const VERSION = '0.73.0'; // x-release-please-version
17 changes: 17 additions & 0 deletions tests/api-resources/audit-logs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,21 @@ describe('resource auditLogs', () => {
service: 'service',
});
});

// Mock server tests are disabled
test.skip('exportChunk: required and optional params', async () => {
const response = await client.auditLogs.exportChunk({
end: '2026-01-02T00:00:00Z',
start: '2026-01-01T00:00:00Z',
auth_strategy: 'auth_strategy',
cursor: 'cursor',
exclude_method: 'exclude_method',
format: 'jsonl',
limit: 1,
method: 'method',
search: 'search',
search_user_id: ['string'],
service: 'service',
});
});
});
Loading