diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 77566c0c3..a25d1bc0c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.14.1" + ".": "1.15.0" } diff --git a/.stats.yml b/.stats.yml index 8ef9a4f85..8eb4b3559 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 124 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c576eb67f119a7eb5815d4a3bf413c652cd7e4c257095e3b6b51967fe72fc00e.yml -openapi_spec_hash: 0a4d20adf725a121e39a3442afa34b32 -config_hash: a759c23a5a04ad26f8740acc7e094c01 +configured_endpoints: 116 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c33fa67077f6f9cc8cb6d82a71657693f7288e1eff48b7b94099f2f11966b67b.yml +openapi_spec_hash: 4329105152eb16bc5d2063038603ea61 +config_hash: 6649774d90af30c3559d6a242b6cb4b0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 27a5658a6..888fe8cda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,37 @@ # Changelog +## 1.15.0 (2026-04-01) + +Full Changelog: [v1.14.1...v1.15.0](https://github.com/runloopai/api-client-ts/compare/v1.14.1...v1.15.0) + +### Features + +* add archive / unarchive to benchmarks ([#8391](https://github.com/runloopai/api-client-ts/issues/8391)) ([834bc32](https://github.com/runloopai/api-client-ts/commit/834bc32babefa622451b31bb25a559806fe5a96a)) +* Add axon list filters by id and name ([#8384](https://github.com/runloopai/api-client-ts/issues/8384)) ([4325b97](https://github.com/runloopai/api-client-ts/commit/4325b974e446b5a85e01afbe6a0bd1c62d71e4cf)) +* Add pagination to list active axons ([#8359](https://github.com/runloopai/api-client-ts/issues/8359)) ([5bc0c7d](https://github.com/runloopai/api-client-ts/commit/5bc0c7d5569d3e521c9497686b447d8575e995d2)) +* **sdk:** add `AxonListParams` support and auto-pagination to `AxonOps.list()` ([#763](https://github.com/runloopai/api-client-ts/issues/763)) ([857ab06](https://github.com/runloopai/api-client-ts/commit/857ab06eb3055d5655e0abaa7f79c8a2a9101791)) +* **sdk:** add `ScenarioBuilder` class to OO-SDK ([#748](https://github.com/runloopai/api-client-ts/issues/748)) ([f80ed4c](https://github.com/runloopai/api-client-ts/commit/f80ed4c30c8e4c3998460a6f12bd862f7f9d96ac)) + + +### Bug Fixes + +* **api:** surface scenario setup failures instead of silently dropping them ([#8300](https://github.com/runloopai/api-client-ts/issues/8300)) ([ae6b11b](https://github.com/runloopai/api-client-ts/commit/ae6b11b8d45efcb6535407bb830605acc5d14da0)) + + +### Chores + +* **axon:** add axon auto-pagination to stainless sdks ([#8420](https://github.com/runloopai/api-client-ts/issues/8420)) ([28acb74](https://github.com/runloopai/api-client-ts/commit/28acb748e4e198e83d300952eeffe1b96d68c8c4)) +* Hide repository connection APIs from public OpenAPI spec ([#8462](https://github.com/runloopai/api-client-ts/issues/8462)) ([4f0b53f](https://github.com/runloopai/api-client-ts/commit/4f0b53f9d35b28ac8d5386bc05467d7dcfbb70c5)) +* **internal:** update multipart form array serialization ([56437dc](https://github.com/runloopai/api-client-ts/commit/56437dc1b0d8e44607412c96b9be81d4f9a9f1a8)) +* **smoketests:** migrate deprecated polling to longPoll for devbox await methods ([#764](https://github.com/runloopai/api-client-ts/issues/764)) ([e5d866c](https://github.com/runloopai/api-client-ts/commit/e5d866cfd615baccb513193bf14b383a5d16abe4)) +* **tests:** bump steady to v0.20.1 ([a001475](https://github.com/runloopai/api-client-ts/commit/a00147563782a9389b4b9c6b18cb747f7a10b5b9)) +* **tests:** bump steady to v0.20.2 ([c5abc92](https://github.com/runloopai/api-client-ts/commit/c5abc92b4c1de24347d3e91aaefdf4138e2afba8)) + + +### Documentation + +* **api:** document vCPU, RAM, and disk for resource_size_request ([#8368](https://github.com/runloopai/api-client-ts/issues/8368)) ([0ddaf44](https://github.com/runloopai/api-client-ts/commit/0ddaf443f8669830b9d33d2e1dd551e31a08050a)) + ## 1.14.1 (2026-03-25) Full Changelog: [v1.14.0...v1.14.1](https://github.com/runloopai/api-client-ts/compare/v1.14.0...v1.14.1) diff --git a/api.md b/api.md index 280d4187d..f9dadb929 100644 --- a/api.md +++ b/api.md @@ -92,7 +92,7 @@ Methods: - client.axons.create({ ...params }) -> AxonView - client.axons.retrieve(id) -> AxonView -- client.axons.list() -> AxonListView +- client.axons.list({ ...params }) -> AxonViewsAxonsCursorIDPage - client.axons.publish(id, { ...params }) -> PublishResultView - client.axons.subscribeSse(id) -> AxonEventView @@ -331,29 +331,6 @@ Methods: - client.objects.download(id, { ...params }) -> ObjectDownloadURLView - client.objects.listPublic({ ...params }) -> ObjectViewsObjectsCursorIDPage -# Repositories - -Types: - -- RepositoryConnectionListView -- RepositoryConnectionView -- RepositoryInspectionDetails -- RepositoryInspectionListView -- RepositoryManifestView -- RepositoryDeleteResponse -- RepositoryRefreshResponse - -Methods: - -- client.repositories.create({ ...params }) -> RepositoryConnectionView -- client.repositories.retrieve(id) -> RepositoryConnectionView -- client.repositories.list({ ...params }) -> RepositoryConnectionViewsRepositoriesCursorIDPage -- client.repositories.delete(id) -> unknown -- client.repositories.inspect(id, { ...params }) -> RepositoryInspectionDetails -- client.repositories.listInspections(id) -> RepositoryInspectionListView -- client.repositories.refresh(id, { ...params }) -> unknown -- client.repositories.retrieveInspection(id) -> RepositoryInspectionDetails - # Secrets Types: diff --git a/package.json b/package.json index 580a4c7ff..d9f5350e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@runloop/api-client", - "version": "1.14.1", + "version": "1.15.0", "description": "The official TypeScript library for the Runloop API", "author": "Runloop ", "types": "dist/sdk.d.ts", diff --git a/packages/mcp-server/manifest.json b/packages/mcp-server/manifest.json index 1808b245f..eecb190b8 100644 --- a/packages/mcp-server/manifest.json +++ b/packages/mcp-server/manifest.json @@ -1,7 +1,7 @@ { "dxt_version": "0.2", "name": "@runloop/api-client-mcp", - "version": "1.14.1", + "version": "1.15.0", "description": "The official MCP Server for the Runloop API", "author": { "name": "Runloop", diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index f9ae47a8a..cf25756c3 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -1,6 +1,6 @@ { "name": "@runloop/api-client-mcp", - "version": "1.14.1", + "version": "1.15.0", "description": "The official MCP Server for the Runloop API", "author": "Runloop ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index 049207f90..4f3cf23f9 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -16,7 +16,7 @@ export const newMcpServer = async (stainlessApiKey: string | undefined) => new McpServer( { name: 'runloop_api_client_api', - version: '1.14.1', + version: '1.15.0', }, { instructions: await getInstructions(stainlessApiKey), diff --git a/scripts/mock b/scripts/mock index 09eb49f65..5cd7c157b 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.7 -- steady --version + npm exec --package=@stdy/cli@0.20.2 -- steady --version - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 6daebbcd2..f4e158327 100755 --- a/scripts/test +++ b/scripts/test @@ -60,7 +60,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 diff --git a/src/index.ts b/src/index.ts index b7d99a66a..30a704fbc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,8 @@ import * as Pagination from './pagination'; import { type AgentsCursorIDPageParams, AgentsCursorIDPageResponse, + type AxonsCursorIDPageParams, + AxonsCursorIDPageResponse, type BenchmarkRunsCursorIDPageParams, BenchmarkRunsCursorIDPageResponse, type BenchmarksCursorIDPageParams, @@ -25,8 +27,6 @@ import { NetworkPoliciesCursorIDPageResponse, type ObjectsCursorIDPageParams, ObjectsCursorIDPageResponse, - type RepositoriesCursorIDPageParams, - RepositoriesCursorIDPageResponse, type ScenarioRunsCursorIDPageParams, ScenarioRunsCursorIDPageResponse, type ScenarioScorersCursorIDPageParams, @@ -146,22 +146,6 @@ import { ObjectViewsObjectsCursorIDPage, Objects, } from './resources/objects'; -import { - Repositories, - RepositoryConnectionListView, - RepositoryConnectionView, - RepositoryConnectionViewsRepositoriesCursorIDPage, - RepositoryCreateParams, - RepositoryDeleteParams, - RepositoryDeleteResponse, - RepositoryInspectParams, - RepositoryInspectionDetails, - RepositoryInspectionListView, - RepositoryListParams, - RepositoryManifestView, - RepositoryRefreshParams, - RepositoryRefreshResponse, -} from './resources/repositories'; import { SecretCreateParameters, SecretCreateParams, @@ -176,9 +160,11 @@ import { import { AxonCreateParams, AxonEventView, + AxonListParams, AxonListView, AxonPublishParams, AxonView, + AxonViewsAxonsCursorIDPage, Axons, PublishParams, PublishResultView, @@ -378,7 +364,6 @@ export class Runloop extends Core.APIClient { devboxes: API.Devboxes = new API.Devboxes(this); scenarios: API.Scenarios = new API.Scenarios(this); objects: API.Objects = new API.Objects(this); - repositories: API.Repositories = new API.Repositories(this); secrets: API.Secrets = new API.Secrets(this); networkPolicies: API.NetworkPolicies = new API.NetworkPolicies(this); gatewayConfigs: API.GatewayConfigs = new API.GatewayConfigs(this); @@ -435,6 +420,7 @@ Runloop.BenchmarkJobs = BenchmarkJobs; Runloop.Agents = Agents; Runloop.AgentViewsAgentsCursorIDPage = AgentViewsAgentsCursorIDPage; Runloop.Axons = Axons; +Runloop.AxonViewsAxonsCursorIDPage = AxonViewsAxonsCursorIDPage; Runloop.Blueprints = Blueprints; Runloop.BlueprintViewsBlueprintsCursorIDPage = BlueprintViewsBlueprintsCursorIDPage; Runloop.Devboxes = Devboxes; @@ -444,8 +430,6 @@ Runloop.Scenarios = Scenarios; Runloop.ScenarioViewsScenariosCursorIDPage = ScenarioViewsScenariosCursorIDPage; Runloop.Objects = Objects; Runloop.ObjectViewsObjectsCursorIDPage = ObjectViewsObjectsCursorIDPage; -Runloop.Repositories = Repositories; -Runloop.RepositoryConnectionViewsRepositoriesCursorIDPage = RepositoryConnectionViewsRepositoriesCursorIDPage; Runloop.Secrets = Secrets; Runloop.NetworkPolicies = NetworkPolicies; Runloop.NetworkPolicyViewsNetworkPoliciesCursorIDPage = NetworkPolicyViewsNetworkPoliciesCursorIDPage; @@ -469,12 +453,6 @@ export declare namespace Runloop { type DevboxesCursorIDPageResponse as DevboxesCursorIDPageResponse, }; - export import RepositoriesCursorIDPage = Pagination.RepositoriesCursorIDPage; - export { - type RepositoriesCursorIDPageParams as RepositoriesCursorIDPageParams, - type RepositoriesCursorIDPageResponse as RepositoriesCursorIDPageResponse, - }; - export import DiskSnapshotsCursorIDPage = Pagination.DiskSnapshotsCursorIDPage; export { type DiskSnapshotsCursorIDPageParams as DiskSnapshotsCursorIDPageParams, @@ -493,6 +471,12 @@ export declare namespace Runloop { type AgentsCursorIDPageResponse as AgentsCursorIDPageResponse, }; + export import AxonsCursorIDPage = Pagination.AxonsCursorIDPage; + export { + type AxonsCursorIDPageParams as AxonsCursorIDPageParams, + type AxonsCursorIDPageResponse as AxonsCursorIDPageResponse, + }; + export import BenchmarkRunsCursorIDPage = Pagination.BenchmarkRunsCursorIDPage; export { type BenchmarkRunsCursorIDPageParams as BenchmarkRunsCursorIDPageParams, @@ -595,6 +579,8 @@ export declare namespace Runloop { type AxonView as AxonView, type PublishParams as PublishParams, type PublishResultView as PublishResultView, + AxonViewsAxonsCursorIDPage as AxonViewsAxonsCursorIDPage, + type AxonListParams as AxonListParams, type AxonPublishParams as AxonPublishParams, }; @@ -695,23 +681,6 @@ export declare namespace Runloop { type ObjectListPublicParams as ObjectListPublicParams, }; - export { - Repositories as Repositories, - type RepositoryConnectionListView as RepositoryConnectionListView, - type RepositoryConnectionView as RepositoryConnectionView, - type RepositoryInspectionDetails as RepositoryInspectionDetails, - type RepositoryInspectionListView as RepositoryInspectionListView, - type RepositoryManifestView as RepositoryManifestView, - type RepositoryDeleteResponse as RepositoryDeleteResponse, - type RepositoryRefreshResponse as RepositoryRefreshResponse, - RepositoryConnectionViewsRepositoriesCursorIDPage as RepositoryConnectionViewsRepositoriesCursorIDPage, - type RepositoryCreateParams as RepositoryCreateParams, - type RepositoryListParams as RepositoryListParams, - type RepositoryDeleteParams as RepositoryDeleteParams, - type RepositoryInspectParams as RepositoryInspectParams, - type RepositoryRefreshParams as RepositoryRefreshParams, - }; - export { Secrets as Secrets, type SecretCreateParameters as SecretCreateParameters, diff --git a/src/pagination.ts b/src/pagination.ts index 1db21e1b7..b552aba78 100644 --- a/src/pagination.ts +++ b/src/pagination.ts @@ -150,25 +150,25 @@ export class DevboxesCursorIDPage } } -export interface RepositoriesCursorIDPageResponse { - repositories: Array; +export interface DiskSnapshotsCursorIDPageResponse { + snapshots: Array; has_more: boolean; total_count: number; } -export interface RepositoriesCursorIDPageParams { +export interface DiskSnapshotsCursorIDPageParams { starting_after?: string; limit?: number; } -export class RepositoriesCursorIDPage +export class DiskSnapshotsCursorIDPage extends AbstractPage - implements RepositoriesCursorIDPageResponse + implements DiskSnapshotsCursorIDPageResponse { - repositories: Array; + snapshots: Array; has_more: boolean; @@ -177,18 +177,18 @@ export class RepositoriesCursorIDPage constructor( client: APIClient, response: Response, - body: RepositoriesCursorIDPageResponse, + body: DiskSnapshotsCursorIDPageResponse, options: FinalRequestOptions, ) { super(client, response, body, options); - this.repositories = body.repositories || []; + this.snapshots = body.snapshots || []; this.has_more = body.has_more || false; this.total_count = body.total_count || 0; } getPaginatedItems(): Item[] { - return this.repositories ?? []; + return this.snapshots ?? []; } override hasNextPage(): boolean { @@ -200,7 +200,7 @@ export class RepositoriesCursorIDPage } // @deprecated Please use `nextPageInfo()` instead - nextPageParams(): Partial | null { + nextPageParams(): Partial | null { const info = this.nextPageInfo(); if (!info) return null; if ('params' in info) return info.params; @@ -210,12 +210,12 @@ export class RepositoriesCursorIDPage } nextPageInfo(): PageInfo | null { - const repositories = this.getPaginatedItems(); - if (!repositories.length) { + const snapshots = this.getPaginatedItems(); + if (!snapshots.length) { return null; } - const id = repositories[repositories.length - 1]?.id; + const id = snapshots[snapshots.length - 1]?.id; if (!id) { return null; } @@ -224,25 +224,25 @@ export class RepositoriesCursorIDPage } } -export interface DiskSnapshotsCursorIDPageResponse { - snapshots: Array; +export interface BenchmarksCursorIDPageResponse { + benchmarks: Array; has_more: boolean; total_count: number; } -export interface DiskSnapshotsCursorIDPageParams { +export interface BenchmarksCursorIDPageParams { starting_after?: string; limit?: number; } -export class DiskSnapshotsCursorIDPage +export class BenchmarksCursorIDPage extends AbstractPage - implements DiskSnapshotsCursorIDPageResponse + implements BenchmarksCursorIDPageResponse { - snapshots: Array; + benchmarks: Array; has_more: boolean; @@ -251,18 +251,18 @@ export class DiskSnapshotsCursorIDPage constructor( client: APIClient, response: Response, - body: DiskSnapshotsCursorIDPageResponse, + body: BenchmarksCursorIDPageResponse, options: FinalRequestOptions, ) { super(client, response, body, options); - this.snapshots = body.snapshots || []; + this.benchmarks = body.benchmarks || []; this.has_more = body.has_more || false; this.total_count = body.total_count || 0; } getPaginatedItems(): Item[] { - return this.snapshots ?? []; + return this.benchmarks ?? []; } override hasNextPage(): boolean { @@ -274,7 +274,7 @@ export class DiskSnapshotsCursorIDPage } // @deprecated Please use `nextPageInfo()` instead - nextPageParams(): Partial | null { + nextPageParams(): Partial | null { const info = this.nextPageInfo(); if (!info) return null; if ('params' in info) return info.params; @@ -284,12 +284,12 @@ export class DiskSnapshotsCursorIDPage } nextPageInfo(): PageInfo | null { - const snapshots = this.getPaginatedItems(); - if (!snapshots.length) { + const benchmarks = this.getPaginatedItems(); + if (!benchmarks.length) { return null; } - const id = snapshots[snapshots.length - 1]?.id; + const id = benchmarks[benchmarks.length - 1]?.id; if (!id) { return null; } @@ -298,25 +298,25 @@ export class DiskSnapshotsCursorIDPage } } -export interface BenchmarksCursorIDPageResponse { - benchmarks: Array; +export interface AgentsCursorIDPageResponse { + agents: Array; has_more: boolean; total_count: number; } -export interface BenchmarksCursorIDPageParams { +export interface AgentsCursorIDPageParams { starting_after?: string; limit?: number; } -export class BenchmarksCursorIDPage +export class AgentsCursorIDPage extends AbstractPage - implements BenchmarksCursorIDPageResponse + implements AgentsCursorIDPageResponse { - benchmarks: Array; + agents: Array; has_more: boolean; @@ -325,18 +325,18 @@ export class BenchmarksCursorIDPage constructor( client: APIClient, response: Response, - body: BenchmarksCursorIDPageResponse, + body: AgentsCursorIDPageResponse, options: FinalRequestOptions, ) { super(client, response, body, options); - this.benchmarks = body.benchmarks || []; + this.agents = body.agents || []; this.has_more = body.has_more || false; this.total_count = body.total_count || 0; } getPaginatedItems(): Item[] { - return this.benchmarks ?? []; + return this.agents ?? []; } override hasNextPage(): boolean { @@ -348,7 +348,7 @@ export class BenchmarksCursorIDPage } // @deprecated Please use `nextPageInfo()` instead - nextPageParams(): Partial | null { + nextPageParams(): Partial | null { const info = this.nextPageInfo(); if (!info) return null; if ('params' in info) return info.params; @@ -358,12 +358,12 @@ export class BenchmarksCursorIDPage } nextPageInfo(): PageInfo | null { - const benchmarks = this.getPaginatedItems(); - if (!benchmarks.length) { + const agents = this.getPaginatedItems(); + if (!agents.length) { return null; } - const id = benchmarks[benchmarks.length - 1]?.id; + const id = agents[agents.length - 1]?.id; if (!id) { return null; } @@ -372,25 +372,25 @@ export class BenchmarksCursorIDPage } } -export interface AgentsCursorIDPageResponse { - agents: Array; +export interface AxonsCursorIDPageResponse { + axons: Array; has_more: boolean; total_count: number; } -export interface AgentsCursorIDPageParams { +export interface AxonsCursorIDPageParams { starting_after?: string; limit?: number; } -export class AgentsCursorIDPage +export class AxonsCursorIDPage extends AbstractPage - implements AgentsCursorIDPageResponse + implements AxonsCursorIDPageResponse { - agents: Array; + axons: Array; has_more: boolean; @@ -399,18 +399,18 @@ export class AgentsCursorIDPage constructor( client: APIClient, response: Response, - body: AgentsCursorIDPageResponse, + body: AxonsCursorIDPageResponse, options: FinalRequestOptions, ) { super(client, response, body, options); - this.agents = body.agents || []; + this.axons = body.axons || []; this.has_more = body.has_more || false; this.total_count = body.total_count || 0; } getPaginatedItems(): Item[] { - return this.agents ?? []; + return this.axons ?? []; } override hasNextPage(): boolean { @@ -422,7 +422,7 @@ export class AgentsCursorIDPage } // @deprecated Please use `nextPageInfo()` instead - nextPageParams(): Partial | null { + nextPageParams(): Partial | null { const info = this.nextPageInfo(); if (!info) return null; if ('params' in info) return info.params; @@ -432,12 +432,12 @@ export class AgentsCursorIDPage } nextPageInfo(): PageInfo | null { - const agents = this.getPaginatedItems(); - if (!agents.length) { + const axons = this.getPaginatedItems(); + if (!axons.length) { return null; } - const id = agents[agents.length - 1]?.id; + const id = axons[axons.length - 1]?.id; if (!id) { return null; } diff --git a/src/resources/axons/axons.ts b/src/resources/axons/axons.ts index bec0cde03..10692d4c3 100644 --- a/src/resources/axons/axons.ts +++ b/src/resources/axons/axons.ts @@ -17,6 +17,7 @@ import { SqlStepErrorView, SqlStepResultView, } from './sql'; +import { AxonsCursorIDPage, type AxonsCursorIDPageParams } from '../../pagination'; import { Stream } from '../../streaming'; export class Axons extends APIResource { @@ -47,8 +48,19 @@ export class Axons extends APIResource { /** * [Beta] List all active axons. */ - list(options?: Core.RequestOptions): Core.APIPromise { - return this._client.get('/v1/axons', options); + list( + query?: AxonListParams, + options?: Core.RequestOptions, + ): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; + list( + query: AxonListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.PagePromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return this._client.getAPIList('/v1/axons', AxonViewsAxonsCursorIDPage, { query, ...options }); } /** @@ -80,6 +92,8 @@ export class Axons extends APIResource { } } +export class AxonViewsAxonsCursorIDPage extends AxonsCursorIDPage {} + export interface AxonCreateParams { /** * (Optional) Name for the axon. @@ -129,6 +143,10 @@ export interface AxonListView { * List of active axons. */ axons: Array; + + has_more: boolean; + + total_count?: number | null; } export interface AxonView { @@ -189,6 +207,24 @@ export interface AxonCreateParams { name?: string | null; } +export interface AxonListParams extends AxonsCursorIDPageParams { + /** + * Filter by axon ID. + */ + id?: string; + + /** + * If true (default), includes total_count in the response. Set to false to skip + * the count query for better performance on large datasets. + */ + include_total_count?: boolean; + + /** + * Filter by axon name (prefix match supported). + */ + name?: string; +} + export interface AxonPublishParams { /** * The event type (e.g. push, pull_request). @@ -211,6 +247,7 @@ export interface AxonPublishParams { source: string; } +Axons.AxonViewsAxonsCursorIDPage = AxonViewsAxonsCursorIDPage; Axons.Sql = Sql; export declare namespace Axons { @@ -221,6 +258,8 @@ export declare namespace Axons { type AxonView as AxonView, type PublishParams as PublishParams, type PublishResultView as PublishResultView, + AxonViewsAxonsCursorIDPage as AxonViewsAxonsCursorIDPage, + type AxonListParams as AxonListParams, type AxonPublishParams as AxonPublishParams, }; diff --git a/src/resources/axons/index.ts b/src/resources/axons/index.ts index 18d654809..d26e180d7 100644 --- a/src/resources/axons/index.ts +++ b/src/resources/axons/index.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { + AxonViewsAxonsCursorIDPage, Axons, type AxonCreateParams, type AxonEventView, @@ -8,6 +9,7 @@ export { type AxonView, type PublishParams, type PublishResultView, + type AxonListParams, type AxonPublishParams, } from './axons'; export { diff --git a/src/resources/benchmark-jobs.ts b/src/resources/benchmark-jobs.ts index 8d8f9d344..b67e5495b 100644 --- a/src/resources/benchmark-jobs.ts +++ b/src/resources/benchmark-jobs.ts @@ -438,11 +438,6 @@ export namespace BenchmarkJobView { */ scenario_name: string; - /** - * The ID of the scenario run. - */ - scenario_run_id: string; - /** * The final state of the scenario execution. */ @@ -459,6 +454,12 @@ export namespace BenchmarkJobView { */ failure_reason?: ScenarioOutcome.FailureReason | null; + /** + * The ID of the scenario run. May be absent if the scenario failed during setup + * before a run was created. + */ + scenario_run_id?: string | null; + /** * The score achieved for this scenario (0.0 to 1.0). Only present if state is * COMPLETED. diff --git a/src/resources/benchmarks.ts b/src/resources/benchmarks.ts index 57128638d..19b8f5caf 100644 --- a/src/resources/benchmarks.ts +++ b/src/resources/benchmarks.ts @@ -268,6 +268,12 @@ export interface BenchmarkView { */ scenarioIds: Array; + /** + * Whether the benchmark is active or archived. Archived benchmarks are excluded + * from listings and cannot be run. + */ + status: 'active' | 'archived'; + /** * Attribution information for the benchmark. */ diff --git a/src/resources/devboxes/devboxes.ts b/src/resources/devboxes/devboxes.ts index 94dd691e8..8b0a7e26d 100644 --- a/src/resources/devboxes/devboxes.ts +++ b/src/resources/devboxes/devboxes.ts @@ -1012,6 +1012,12 @@ export interface TunnelView { */ tunnel_key: string; + /** + * When true, HTTP traffic to a suspended devbox will automatically trigger a + * resume. + */ + wake_on_http: boolean; + /** * Bearer token for tunnel authentication. Only present when auth_mode is * 'authenticated'. @@ -1210,6 +1216,12 @@ export namespace DevboxCreateParams { * policies, resetting the idle timer. Defaults to true if not specified. */ http_keep_alive?: boolean | null; + + /** + * When true, HTTP traffic to a suspended devbox will automatically trigger a + * resume. Defaults to false if not specified. + */ + wake_on_http?: boolean | null; } } @@ -1265,6 +1277,12 @@ export interface DevboxEnableTunnelParams { * policies, resetting the idle timer. Defaults to true if not specified. */ http_keep_alive?: boolean | null; + + /** + * When true, HTTP traffic to a suspended devbox will automatically trigger a + * resume. Defaults to false if not specified. + */ + wake_on_http?: boolean | null; } /** diff --git a/src/resources/index.ts b/src/resources/index.ts index 0c303dafe..eb353b6da 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -11,6 +11,7 @@ export { type AgentListParams, } from './agents'; export { + AxonViewsAxonsCursorIDPage, Axons, type AxonCreateParams, type AxonEventView, @@ -18,6 +19,7 @@ export { type AxonView, type PublishParams, type PublishResultView, + type AxonListParams, type AxonPublishParams, } from './axons/axons'; export { @@ -159,22 +161,6 @@ export { type ObjectDownloadParams, type ObjectListPublicParams, } from './objects'; -export { - RepositoryConnectionViewsRepositoriesCursorIDPage, - Repositories, - type RepositoryConnectionListView, - type RepositoryConnectionView, - type RepositoryInspectionDetails, - type RepositoryInspectionListView, - type RepositoryManifestView, - type RepositoryDeleteResponse, - type RepositoryRefreshResponse, - type RepositoryCreateParams, - type RepositoryListParams, - type RepositoryDeleteParams, - type RepositoryInspectParams, - type RepositoryRefreshParams, -} from './repositories'; export { ScenarioRunViewsBenchmarkRunsCursorIDPage, ScenarioViewsScenariosCursorIDPage, diff --git a/src/resources/repositories.ts b/src/resources/repositories.ts deleted file mode 100644 index a7c4e2154..000000000 --- a/src/resources/repositories.ts +++ /dev/null @@ -1,549 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../resource'; -import { isRequestOptions } from '../core'; -import * as Core from '../core'; -import { RepositoriesCursorIDPage, type RepositoriesCursorIDPageParams } from '../pagination'; - -export class Repositories extends APIResource { - /** - * Create a connection to a Github Repository and trigger an initial inspection of - * the repo's technical stack and developer environment requirements. - */ - create( - body: RepositoryCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.post('/v1/repositories', { body, ...options }); - } - - /** - * Get Repository Connection details including latest inspection status and - * generated repository insights. - */ - retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.get(`/v1/repositories/${id}`, options); - } - - /** - * List all available repository connections. - */ - list( - query?: RepositoryListParams, - options?: Core.RequestOptions, - ): Core.PagePromise; - list( - options?: Core.RequestOptions, - ): Core.PagePromise; - list( - query: RepositoryListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.PagePromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return this._client.getAPIList('/v1/repositories', RepositoryConnectionViewsRepositoriesCursorIDPage, { - query, - ...options, - }); - } - - /** - * Permanently Delete a Repository Connection including any automatically generated - * inspection insights. - */ - delete( - id: string, - body?: RepositoryDeleteParams | null | undefined, - options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.post(`/v1/repositories/${id}/delete`, { body, ...options }); - } - - /** - * Inspect a repository connection by inspecting the specified version including - * repo's technical stack and developer environment requirements. - */ - inspect( - id: string, - body?: RepositoryInspectParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - inspect(id: string, options?: Core.RequestOptions): Core.APIPromise; - inspect( - id: string, - body: RepositoryInspectParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(body)) { - return this.inspect(id, {}, body); - } - return this._client.post(`/v1/repositories/${id}/inspect`, { body, ...options }); - } - - /** - * List all inspections of a repository connection including automatically - * generated insights for each inspection. - */ - listInspections(id: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.get(`/v1/repositories/${id}/inspections`, options); - } - - /** - * Refresh a repository connection by inspecting the latest version including - * repo's technical stack and developer environment requirements. - * - * @deprecated - */ - refresh( - id: string, - body?: RepositoryRefreshParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - refresh(id: string, options?: Core.RequestOptions): Core.APIPromise; - refresh( - id: string, - body: RepositoryRefreshParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(body)) { - return this.refresh(id, {}, body); - } - return this._client.post(`/v1/repositories/${id}/refresh`, { body, ...options }); - } - - /** - * Get a repository inspection by id. - */ - retrieveInspection( - id: string, - options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.get(`/v1/repositories/inspections/${id}`, options); - } -} - -export class RepositoryConnectionViewsRepositoriesCursorIDPage extends RepositoriesCursorIDPage {} - -export interface RepositoryConnectionListView { - has_more: boolean; - - /** - * List of repositories matching filter. - */ - repositories: Array; - - total_count?: number | null; -} - -/** - * The ID of the Repository. - */ -export interface RepositoryConnectionView { - /** - * The ID of the Repository. - */ - id: string; - - /** - * The name of the Repository. - */ - name: string; - - /** - * The account owner of the Repository. - */ - owner: string; -} - -export interface RepositoryInspectionDetails { - /** - * The ID of the inspection. - */ - id: string; - - /** - * The sha of the inspected version of the Repository. - */ - commit_sha: string; - - /** - * Inspection time of the Repository Version (Unix timestamp milliseconds). - */ - inspected_at: number; - - /** - * Repository manifest containing container config and workspace details. - */ - repository_manifest: RepositoryManifestView; - - /** - * The status of the repository inspection. - */ - status: - | 'invalid' - | 'repo_auth_pending' - | 'repo_authentication_failure' - | 'repo_access_failure' - | 'inspection_pending' - | 'inspection_failed' - | 'inspection_success' - | 'inspection_user_manifest_added'; - - /** - * The blueprint ID associated with this inspection if successful. - */ - blueprint_id?: string | null; - - /** - * The blueprint name associated with this inspection if successful. - */ - blueprint_name?: string | null; - - /** - * The status of the linked Blueprint build. - */ - build_status?: 'image_building' | 'image_build_success' | 'image_build_failure' | null; - - /** - * User uploaded repository manifest containing container config and workspace - * details. - */ - user_manifest?: RepositoryManifestView | null; - - /** - * Workflow contexts mapping workflow names to their processing details. - */ - workflow_contexts?: { [key: string]: RepositoryInspectionDetails.WorkflowContexts } | null; -} - -export namespace RepositoryInspectionDetails { - /** - * Workflow context containing file name and details about actions processing - * during inspection. - */ - export interface WorkflowContexts { - /** - * Details about actions processing for this workflow. - */ - actions_context: WorkflowContexts.ActionsContext; - - /** - * The file name of the workflow. - */ - file_name: string; - } - - export namespace WorkflowContexts { - /** - * Details about actions processing for this workflow. - */ - export interface ActionsContext { - /** - * Actions that were skipped because they were unnecessary (e.g., upload - * artifacts). - */ - actions_skipped_unnecessary: Array; - - /** - * Actions that were translated into commands and executed. - */ - actions_taken: Array; - - /** - * Actions that were not understood and skipped because we did not know what to do. - */ - actions_unknown: Array; - } - } -} - -export interface RepositoryInspectionListView { - /** - * List of inspections for this repository. - */ - inspections: Array; -} - -/** - * The repository manifest contains container configuration and workspace - * definitions for a repository. - */ -export interface RepositoryManifestView { - /** - * Container configuration specifying the base image and setup commands. - */ - container_config: RepositoryManifestView.ContainerConfig; - - /** - * List of required languages found in Repository. - */ - languages: Array; - - /** - * List of workspaces within the repository. Each workspace represents a buildable - * unit of code. - */ - workspaces: Array; - - /** - * List of discovered ContainerizedServices. Services can be explicitly started - * when creating a Devbox. - */ - containerized_services?: Array | null; - - /** - * Qualified environment variables and values that should be set for this - * repository to run correctly. - */ - env_vars?: { [key: string]: string } | null; - - /** - * Missing environment variables that (may) be required for this repository to run - * correctly. - */ - required_env_vars?: Array | null; -} - -export namespace RepositoryManifestView { - /** - * Container configuration specifying the base image and setup commands. - */ - export interface ContainerConfig { - /** - * The name of the base image. Should be one of the GitHub public images like - * ubuntu-latest, ubuntu-24.04, ubuntu-22.04, windows-latest, windows-2022, - * macos-latest etc. - */ - base_image_name: string; - - /** - * The target architecture for the Repository Container. - */ - architecture?: 'x86_64' | 'arm64'; - - /** - * Commands to run to setup the base container such as installing necessary - * toolchains (e.g. apt install). - */ - setup_commands?: Array | null; - } - - export interface Language { - language?: string; - - version?: string; - } - - /** - * A workspace is a buildable unit of code within a repository and often represents - * a deployable unit of code like a backend service or a frontend app. - */ - export interface Workspace { - /** - * Name of the build tool used (e.g. pip, npm). - */ - build_tool: Array; - - /** - * Extracted common commands important to the developer life cycle like linting, - * testing, building, etc. - */ - dev_commands?: Workspace.DevCommands | null; - - /** - * Name of the workspace. Can be empty if the workspace is the root of the - * repository. Only necessary for monorepo style repositories. - */ - name?: string | null; - - /** - * Path to the workspace from the root of the repository. Can be empty if the - * workspace is the root of the repository. Only necessary for monorepo style - * repositories. - */ - path?: string | null; - - /** - * Commands to run to refresh this workspace after pulling the latest changes to - * the repository via git (e.g. npm install). - */ - workspace_refresh_commands?: Array | null; - - /** - * Commands to run to setup this workspace after a fresh clone of the repository on - * a new container such as installing necessary toolchains and dependencies (e.g. - * npm install). - */ - workspace_setup_commands?: Array | null; - } - - export namespace Workspace { - /** - * Extracted common commands important to the developer life cycle like linting, - * testing, building, etc. - */ - export interface DevCommands { - /** - * Build command (e.g. npm run build). - */ - build?: Array | null; - - /** - * Installation command (e.g. pip install -r requirements.txt). - */ - install?: Array | null; - - /** - * Lint command (e.g. flake8). - */ - lint?: Array | null; - - /** - * Script commands. - */ - scripts?: Array | null; - - /** - * Test command (e.g. pytest). - */ - test?: Array | null; - } - } - - export interface ContainerizedService { - /** - * The image of the container service. - */ - image: string; - - /** - * The name of the container service. - */ - name: string; - - /** - * The credentials of the container service. - */ - credentials?: ContainerizedService.Credentials | null; - - /** - * The environment variables of the container service. - */ - env?: { [key: string]: string } | null; - - /** - * Additional Docker container create options. - */ - options?: string | null; - - /** - * The port mappings of the container service. Port mappings are in the format of - * :. - */ - port_mappings?: Array | null; - } - - export namespace ContainerizedService { - /** - * The credentials of the container service. - */ - export interface Credentials { - /** - * The password of the container service. - */ - password: string; - - /** - * The username of the container service. - */ - username: string; - } - } -} - -export type RepositoryDeleteResponse = unknown; - -export type RepositoryRefreshResponse = unknown; - -export interface RepositoryCreateParams { - /** - * Name of the repository. - */ - name: string; - - /** - * Account owner of the repository. - */ - owner: string; - - /** - * ID of blueprint to use as base for resulting RepositoryVersion blueprint. - */ - blueprint_id?: string | null; - - /** - * GitHub authentication token for accessing private repositories. - */ - github_auth_token?: string | null; -} - -export interface RepositoryListParams extends RepositoriesCursorIDPageParams { - /** - * If true (default), includes total_count in the response. Set to false to skip - * the count query for better performance on large datasets. - */ - include_total_count?: boolean; - - /** - * Filter by repository name - */ - name?: string; - - /** - * Filter by repository owner - */ - owner?: string; -} - -export interface RepositoryDeleteParams {} - -export interface RepositoryInspectParams { - /** - * GitHub authentication token for accessing private repositories. - */ - github_auth_token?: string | null; -} - -export interface RepositoryRefreshParams { - /** - * ID of blueprint to use as base for resulting RepositoryVersion blueprint. - */ - blueprint_id?: string | null; - - /** - * GitHub authentication token for accessing private repositories. - */ - github_auth_token?: string | null; -} - -Repositories.RepositoryConnectionViewsRepositoriesCursorIDPage = - RepositoryConnectionViewsRepositoriesCursorIDPage; - -export declare namespace Repositories { - export { - type RepositoryConnectionListView as RepositoryConnectionListView, - type RepositoryConnectionView as RepositoryConnectionView, - type RepositoryInspectionDetails as RepositoryInspectionDetails, - type RepositoryInspectionListView as RepositoryInspectionListView, - type RepositoryManifestView as RepositoryManifestView, - type RepositoryDeleteResponse as RepositoryDeleteResponse, - type RepositoryRefreshResponse as RepositoryRefreshResponse, - RepositoryConnectionViewsRepositoriesCursorIDPage as RepositoryConnectionViewsRepositoriesCursorIDPage, - type RepositoryCreateParams as RepositoryCreateParams, - type RepositoryListParams as RepositoryListParams, - type RepositoryDeleteParams as RepositoryDeleteParams, - type RepositoryInspectParams as RepositoryInspectParams, - type RepositoryRefreshParams as RepositoryRefreshParams, - }; -} diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 044e5ab50..8a4d11ccd 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -269,7 +269,12 @@ export interface LaunchParameters { required_services?: Array | null; /** - * Manual resource configuration for Devbox. If not set, defaults will be used. + * Preset Devbox resources (vCPU, RAM in GiB, ephemeral disk in GiB). If not set, + * SMALL is used. X_SMALL: 0.5 vCPU, 1 GiB RAM, 4 GiB disk. SMALL: 1 vCPU, 2 GiB + * RAM, 4 GiB disk. MEDIUM: 2 vCPU, 4 GiB RAM, 8 GiB disk. LARGE: 2 vCPU, 8 GiB + * RAM, 16 GiB disk. X_LARGE: 4 vCPU, 16 GiB RAM, 16 GiB disk. XX_LARGE: 8 vCPU, 32 + * GiB RAM, 16 GiB disk. CUSTOM_SIZE: set custom_cpu_cores, custom_gb_memory, and + * optionally custom_disk_size. */ resource_size_request?: | 'X_SMALL' diff --git a/src/sdk.ts b/src/sdk.ts index 9996076f2..bc9c93b2a 100644 --- a/src/sdk.ts +++ b/src/sdk.ts @@ -25,7 +25,7 @@ import type { import type { BlueprintListParams } from './resources/blueprints'; import type { ObjectCreateParams, ObjectListParams } from './resources/objects'; import type { AgentCreateParams, AgentListParams } from './resources/agents'; -import type { AxonCreateParams } from './resources/axons'; +import type { AxonCreateParams, AxonListParams } from './resources/axons/axons'; import type { ScorerCreateParams, ScorerListParams } from './resources/scenarios/scorers'; import type { NetworkPolicyCreateParams, NetworkPolicyListParams } from './resources/network-policies'; import type { GatewayConfigCreateParams, GatewayConfigListParams } from './resources/gateway-configs'; @@ -1565,12 +1565,24 @@ export class AxonOps { /** * [Beta] List all active axons. * + * @example + * ```typescript + * const runloop = new RunloopSDK(); + * const axons = await runloop.axon.list({ limit: 10 }); + * console.log(axons.map((a) => a.id)); + * ``` + * + * @param {AxonListParams} [params] - Optional filter/pagination parameters. * @param {Core.RequestOptions} [options] - Request options. * @returns {Promise} An array of {@link Axon} instances. */ - async list(options?: Core.RequestOptions): Promise { - const result = await this.client.axons.list(options); - return result.axons.map((axon) => Axon.fromId(this.client, axon.id)); + async list(params?: AxonListParams, options?: Core.RequestOptions): Promise { + const result = await this.client.axons.list(params, options); + const axons: Axon[] = []; + for await (const axon of result) { + axons.push(Axon.fromId(this.client, axon.id)); + } + return axons; } } diff --git a/src/types.ts b/src/types.ts index 5bafdd396..27128c753 100644 --- a/src/types.ts +++ b/src/types.ts @@ -75,12 +75,6 @@ export type * from './resources/objects'; export type * from './resources/shared'; -// ============================================================================= -// Repository Types -// ============================================================================= - -export type * from './resources/repositories'; - // ============================================================================= // Secret Types // ============================================================================= diff --git a/src/version.ts b/src/version.ts index a0ef42231..3bddfe002 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.14.1'; // x-release-please-version +export const VERSION = '1.15.0'; // x-release-please-version diff --git a/tests/api-resources/axons/axons.test.ts b/tests/api-resources/axons/axons.test.ts index 90955fb00..a7f07afa1 100644 --- a/tests/api-resources/axons/axons.test.ts +++ b/tests/api-resources/axons/axons.test.ts @@ -70,6 +70,22 @@ describe('resource axons', () => { ); }); + test('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.axons.list( + { + id: 'id', + include_total_count: true, + limit: 0, + name: 'name', + starting_after: 'starting_after', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Runloop.NotFoundError); + }); + test('publish: only required params', async () => { const responsePromise = client.axons.publish('id', { event_type: 'event_type', diff --git a/tests/api-resources/devboxes/devboxes.test.ts b/tests/api-resources/devboxes/devboxes.test.ts index 998157c3c..a56f6dd2f 100644 --- a/tests/api-resources/devboxes/devboxes.test.ts +++ b/tests/api-resources/devboxes/devboxes.test.ts @@ -74,7 +74,11 @@ describe('resource devboxes', () => { repo_connection_id: 'repo_connection_id', secrets: { foo: 'string' }, snapshot_id: 'snapshot_id', - tunnel: { auth_mode: 'open', http_keep_alive: true }, + tunnel: { + auth_mode: 'open', + http_keep_alive: true, + wake_on_http: true, + }, }, { path: '/_stainless_unknown_path' }, ), @@ -228,7 +232,11 @@ describe('resource devboxes', () => { await expect( client.devboxes.enableTunnel( 'id', - { auth_mode: 'open', http_keep_alive: true }, + { + auth_mode: 'open', + http_keep_alive: true, + wake_on_http: true, + }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Runloop.NotFoundError); diff --git a/tests/api-resources/repositories.test.ts b/tests/api-resources/repositories.test.ts deleted file mode 100644 index 3d14c9696..000000000 --- a/tests/api-resources/repositories.test.ts +++ /dev/null @@ -1,195 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { Runloop } from '@runloop/api-client'; -import { Response } from 'node-fetch'; - -const client = new Runloop({ - bearerToken: 'My Bearer Token', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource repositories', () => { - test('create: only required params', async () => { - const responsePromise = client.repositories.create({ name: 'name', owner: 'owner' }); - 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); - }); - - test('create: required and optional params', async () => { - const response = await client.repositories.create({ - name: 'name', - owner: 'owner', - blueprint_id: 'blueprint_id', - github_auth_token: 'github_auth_token', - }); - }); - - test('retrieve', async () => { - const responsePromise = client.repositories.retrieve('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); - }); - - test('retrieve: request options instead of 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.repositories.retrieve('id', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Runloop.NotFoundError, - ); - }); - - test('list', async () => { - const responsePromise = client.repositories.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); - }); - - test('list: request options instead of 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.repositories.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Runloop.NotFoundError, - ); - }); - - test('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.repositories.list( - { - include_total_count: true, - limit: 0, - name: 'name', - owner: 'owner', - starting_after: 'starting_after', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Runloop.NotFoundError); - }); - - test('delete', async () => { - const responsePromise = client.repositories.delete('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); - }); - - test('delete: 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.repositories.delete('id', {}, { path: '/_stainless_unknown_path' })).rejects.toThrow( - Runloop.NotFoundError, - ); - }); - - test('inspect', async () => { - const responsePromise = client.repositories.inspect('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); - }); - - test('inspect: request options instead of 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.repositories.inspect('id', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Runloop.NotFoundError, - ); - }); - - test('inspect: 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.repositories.inspect( - 'id', - { github_auth_token: 'github_auth_token' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Runloop.NotFoundError); - }); - - test('listInspections', async () => { - const responsePromise = client.repositories.listInspections('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); - }); - - test('listInspections: request options instead of 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.repositories.listInspections('id', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Runloop.NotFoundError); - }); - - test('refresh', async () => { - const responsePromise = client.repositories.refresh('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); - }); - - test('refresh: request options instead of 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.repositories.refresh('id', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Runloop.NotFoundError, - ); - }); - - test('refresh: 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.repositories.refresh( - 'id', - { blueprint_id: 'blueprint_id', github_auth_token: 'github_auth_token' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Runloop.NotFoundError); - }); - - test('retrieveInspection', async () => { - const responsePromise = client.repositories.retrieveInspection('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); - }); - - test('retrieveInspection: request options instead of 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.repositories.retrieveInspection('id', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Runloop.NotFoundError); - }); -}); diff --git a/tests/sdk/axon-ops.test.ts b/tests/sdk/axon-ops.test.ts index 04a268aff..592f448fc 100644 --- a/tests/sdk/axon-ops.test.ts +++ b/tests/sdk/axon-ops.test.ts @@ -1,6 +1,6 @@ import { AxonOps } from '../../src/sdk'; import { Axon } from '../../src/sdk/axon'; -import type { AxonView, AxonListView } from '../../src/resources/axons'; +import type { AxonView } from '../../src/resources/axons'; jest.mock('../../src/sdk/axon'); @@ -77,19 +77,25 @@ describe('AxonOps', () => { }); describe('list', () => { - it('should list axons and wrap as Axon instances', async () => { - const mockListView: AxonListView = { - axons: [ - { id: 'axn_1', created_at_ms: Date.now(), name: 'axon-1' }, - { id: 'axn_2', created_at_ms: Date.now(), name: 'axon-2' }, - { id: 'axn_3', created_at_ms: Date.now() }, - ], + function mockPageResult(items: AxonView[]) { + return { + [Symbol.asyncIterator]: async function* () { + yield* items; + }, }; - mockClient.axons.list.mockResolvedValue(mockListView); + } + + it('should list axons and wrap as Axon instances', async () => { + const mockAxons: AxonView[] = [ + { id: 'axn_1', created_at_ms: Date.now(), name: 'axon-1' }, + { id: 'axn_2', created_at_ms: Date.now(), name: 'axon-2' }, + { id: 'axn_3', created_at_ms: Date.now() }, + ]; + mockClient.axons.list.mockResolvedValue(mockPageResult(mockAxons)); const axons = await axonOps.list(); - expect(mockClient.axons.list).toHaveBeenCalledWith(undefined); + expect(mockClient.axons.list).toHaveBeenCalledWith(undefined, undefined); expect(Axon.fromId).toHaveBeenCalledTimes(3); expect(Axon.fromId).toHaveBeenCalledWith(mockClient, 'axn_1'); expect(Axon.fromId).toHaveBeenCalledWith(mockClient, 'axn_2'); @@ -98,19 +104,27 @@ describe('AxonOps', () => { }); it('should return empty array when no axons exist', async () => { - mockClient.axons.list.mockResolvedValue({ axons: [] }); + mockClient.axons.list.mockResolvedValue(mockPageResult([])); const axons = await axonOps.list(); expect(axons).toHaveLength(0); }); + it('should pass filter params', async () => { + mockClient.axons.list.mockResolvedValue(mockPageResult([])); + + await axonOps.list({ name: 'my-axon', limit: 10 }); + + expect(mockClient.axons.list).toHaveBeenCalledWith({ name: 'my-axon', limit: 10 }, undefined); + }); + it('should pass request options', async () => { - mockClient.axons.list.mockResolvedValue({ axons: [] }); + mockClient.axons.list.mockResolvedValue(mockPageResult([])); - await axonOps.list({ timeout: 3000 }); + await axonOps.list(undefined, { timeout: 3000 }); - expect(mockClient.axons.list).toHaveBeenCalledWith({ timeout: 3000 }); + expect(mockClient.axons.list).toHaveBeenCalledWith(undefined, { timeout: 3000 }); }); }); }); diff --git a/tests/smoketests/build-package.test.ts b/tests/smoketests/build-package.test.ts index ae5c5b9f0..65b6f8e58 100644 --- a/tests/smoketests/build-package.test.ts +++ b/tests/smoketests/build-package.test.ts @@ -111,7 +111,6 @@ describe('smoketest: built package import', () => { expect(RunloopAPI.Agents).toBeDefined(); expect(RunloopAPI.Benchmarks).toBeDefined(); expect(RunloopAPI.Scenarios).toBeDefined(); - expect(RunloopAPI.Repositories).toBeDefined(); }); test('should allow creating new types based on execution.result() return type', () => {