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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: '10.24.0'
version: '10.27.0'

- name: Bootstrap
run: ./scripts/bootstrap
Expand All @@ -56,7 +56,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: '10.24.0'
version: '10.27.0'

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: '10.24.0'
version: '10.27.0'

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.1.1"
".": "2.2.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 30
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-ba1aa76b54891af8c72220bd811d652cb2e743c4f86b8a589dd6cb2938b09f1c.yml
openapi_spec_hash: 10de3e6e4b87644087c976b62b571405
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-b0c6cc68de341e8d1e6f38b60aadfbffbeaf333804191a1e001f21b7524dcacb.yml
openapi_spec_hash: 772eb395f3ca214821653a6185ee0e4e
config_hash: bf64816643634a621cd0ffd93d9c4347
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 2.2.0 (2026-02-06)

Full Changelog: [v2.1.1...v2.2.0](https://github.com/ArcadeAI/arcade-js/compare/v2.1.1...v2.2.0)

### Features

* **api:** api update ([bf01d02](https://github.com/ArcadeAI/arcade-js/commit/bf01d02cfddbacf1270c1372461c08b38c322d6f))


### Bug Fixes

* **client:** avoid removing abort listener too early ([9c4802e](https://github.com/ArcadeAI/arcade-js/commit/9c4802e63244418cf2e04f58c2c2e34b8735ba78))


### Chores

* **client:** restructure abort controller binding ([1a83b30](https://github.com/ArcadeAI/arcade-js/commit/1a83b3057f9879f7eb0c7252d0baadbd479e51bf))
* **internal:** fix pagination internals not accepting option promises ([6f96352](https://github.com/ArcadeAI/arcade-js/commit/6f96352e7736a1c9c7776f6c5917ec6ce5356040))
* **internal:** upgrade pnpm ([332eae9](https://github.com/ArcadeAI/arcade-js/commit/332eae981cc04b4611cd47d354636bc66dd9d8f0))

## 2.1.1 (2026-02-03)

Full Changelog: [v2.1.0...v2.1.1](https://github.com/ArcadeAI/arcade-js/compare/v2.1.0...v2.1.1)
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Types:
Methods:

- <code title="get /v1/formatted_tools">client.tools.formatted.<a href="./src/resources/tools/formatted.ts">list</a>({ ...params }) -> FormattedListResponsesOffsetPage</code>
- <code title="get /v1/formatted_tools/{name}">client.tools.formatted.<a href="./src/resources/tools/formatted.ts">get</a>(name, { ...params }) -> unknown</code>
- <code title="get /v1/formatted_tools/{name}">client.tools.formatted.<a href="./src/resources/tools/formatted.ts">get</a>(name, { ...params }) -> FormattedGetResponse</code>

# Workers

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@arcadeai/arcadejs",
"version": "2.1.1",
"version": "2.2.0",
"description": "The official TypeScript library for the Arcade API",
"author": "Arcade <dev@arcade.dev>",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"type": "commonjs",
"repository": "github:ArcadeAI/arcade-js",
"license": "MIT",
"packageManager": "pnpm@10.24.0",
"packageManager": "pnpm@10.27.0",
"files": [
"**/*"
],
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,17 +511,22 @@ export class Arcade {
getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
path: string,
Page: new (...args: any[]) => PageClass,
opts?: RequestOptions,
opts?: PromiseOrValue<RequestOptions>,
): Pagination.PagePromise<PageClass, Item> {
return this.requestAPIList(Page, { method: 'get', path, ...opts });
return this.requestAPIList(
Page,
opts && 'then' in opts ?
opts.then((opts) => ({ method: 'get', path, ...opts }))
: { method: 'get', path, ...opts },
);
}

requestAPIList<
Item = unknown,
PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
>(
Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
options: FinalRequestOptions,
options: PromiseOrValue<FinalRequestOptions>,
): Pagination.PagePromise<PageClass, Item> {
const request = this.makeRequest(options, null, undefined);
return new Pagination.PagePromise<PageClass, Item>(this as any as Arcade, request, Page);
Expand All @@ -534,7 +539,7 @@ export class Arcade {
controller: AbortController,
): Promise<Response> {
const { signal, method, ...options } = init || {};
const abort = controller.abort.bind(controller);
const abort = this._makeAbort(controller);
if (signal) signal.addEventListener('abort', abort, { once: true });

const timeout = setTimeout(abort, ms);
Expand Down Expand Up @@ -704,6 +709,12 @@ export class Arcade {
return headers.values;
}

private _makeAbort(controller: AbortController) {
// note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
// would capture all request options, and cause a memory leak.
return () => controller.abort();
}

private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
bodyHeaders: HeadersLike;
body: BodyInit | undefined;
Expand Down
6 changes: 3 additions & 3 deletions src/resources/tools/formatted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ export class Formatted extends APIResource {
name: string,
query: FormattedGetParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<unknown> {
): APIPromise<FormattedGetResponse> {
return this._client.get(path`/v1/formatted_tools/${name}`, { query, ...options });
}
}

export type FormattedListResponsesOffsetPage = OffsetPage<FormattedListResponse>;

export type FormattedListResponse = unknown;
export type FormattedListResponse = { [key: string]: unknown };

export type FormattedGetResponse = unknown;
export type FormattedGetResponse = { [key: string]: unknown };

export interface FormattedListParams extends OffsetPageParams {
/**
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 = '2.1.1'; // x-release-please-version
export const VERSION = '2.2.0'; // x-release-please-version