Skip to content
Open
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 @@
{
".": "2.4.1"
".": "2.5.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-a509111298b23d3851de5439560c96b7d7831556094a790ba838cf11e9277ee7.yml
openapi_spec_hash: 0ad3aecc9853e08130587d8e4b1bb468
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-26a717927e892f445524d54e015a9e6353e4c1d66d2a724a3d153f295ea71037.yml
openapi_spec_hash: 2923fbda6c2899ade719d00540c34ff6
config_hash: 2d4163acdeacd75903f978cd79c35d14
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 2.5.0 (2026-04-29)

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

### Features

* **api:** api update ([d0c1930](https://github.com/ArcadeAI/arcade-js/commit/d0c19301d5e7e787bad90d8eadb1455d58bfde8e))
* support setting headers via env ([6573f02](https://github.com/ArcadeAI/arcade-js/commit/6573f0293b9bcf7b42e196ef01332ff9f22a9c3d))


### Chores

* **format:** run eslint and prettier separately ([5973eaf](https://github.com/ArcadeAI/arcade-js/commit/5973eafc90d734122617142e9a2233d6a4c56fc3))
* **internal:** codegen related update ([c7c3f2f](https://github.com/ArcadeAI/arcade-js/commit/c7c3f2f01aea4e1260f328e73e1072528e158518))
* **internal:** more robust bootstrap script ([5a07859](https://github.com/ArcadeAI/arcade-js/commit/5a07859a965867dba9a68601b53c703c40c2b81d))

## 2.4.1 (2026-04-21)

Full Changelog: [v2.4.0...v2.4.1](https://github.com/ArcadeAI/arcade-js/compare/v2.4.0...v2.4.1)
Expand Down
3 changes: 0 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import tseslint from 'typescript-eslint';
import unusedImports from 'eslint-plugin-unused-imports';
import prettier from 'eslint-plugin-prettier';

export default tseslint.config(
{
Expand All @@ -14,11 +13,9 @@ export default tseslint.config(
plugins: {
'@typescript-eslint': tseslint.plugin,
'unused-imports': unusedImports,
prettier,
},
rules: {
'no-unused-vars': 'off',
'prettier/prettier': 'error',
'unused-imports/no-unused-imports': 'error',
'no-restricted-imports': [
'error',
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@arcadeai/arcadejs",
"version": "2.4.1",
"version": "2.5.0",
"description": "The official TypeScript library for the Arcade API",
"author": "Arcade <dev@arcade.dev>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -35,7 +35,6 @@
"@typescript-eslint/eslint-plugin": "8.31.1",
"@typescript-eslint/parser": "8.31.1",
"eslint": "^9.39.1",
"eslint-plugin-prettier": "^5.4.1",
"eslint-plugin-unused-imports": "^4.1.4",
"iconv-lite": "^0.6.3",
"jest": "^29.4.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

cd "$(dirname "$0")/.."

if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
echo -n "==> Install Homebrew dependencies? (y/N): "
read -r response
Expand Down
9 changes: 3 additions & 6 deletions scripts/fast-format
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ if ! [ -z "$ESLINT_FILES" ]; then
fi

echo "==> Running prettier --write"
# format things eslint didn't
PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)"
if ! [ -z "$PRETTIER_FILES" ]; then
echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \
--write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \
'!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs'
if ! [ -z "$FILE_LIST" ]; then
cat "$FILE_LIST" | xargs ./node_modules/.bin/prettier \
--write --cache --cache-strategy metadata --no-error-on-unmatched-pattern --ignore-unknown
fi
3 changes: 1 addition & 2 deletions scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ echo "==> Running eslint --fix"
./node_modules/.bin/eslint --fix .

echo "==> Running prettier --write"
# format things eslint didn't
./node_modules/.bin/prettier --write --cache --cache-strategy metadata . '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs'
./node_modules/.bin/prettier --write --cache --cache-strategy metadata .
3 changes: 3 additions & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -e

cd "$(dirname "$0")/.."

echo "==> Running prettier --check"
./node_modules/.bin/prettier --check .

echo "==> Running eslint"
./node_modules/.bin/eslint .

Expand Down
9 changes: 8 additions & 1 deletion scripts/utils/postprocess-files.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@ async function postprocess() {

// strip out lib="dom", types="node", and types="react" references; these
// are needed at build time, but would pollute the user's TS environment
const transformed = code.replace(
let transformed = code.replace(
/^ *\/\/\/ *<reference +(lib="dom"|types="(node|react)").*?\n/gm,
// replace with same number of characters to avoid breaking source maps
(match) => ' '.repeat(match.length - 1) + '\n',
);

// TypeScript's declaration emitter collapses /** @ts-ignore */ onto the same
// line as the type declaration, which doesn't work. So we convert to // @ts-ignore
// on its own line to properly suppresses errors.
if (file.endsWith('.d.ts') || file.endsWith('.d.mts') || file.endsWith('.d.cts')) {
transformed = transformed.replace(/\/\*\* @ts-ignore\b[^*]*\*\/ /gm, '// @ts-ignore\n');
}

if (transformed !== code) {
console.error(`wrote ${path.relative(process.cwd(), file)}`);
await fs.promises.writeFile(file, transformed, 'utf8');
Expand Down
12 changes: 12 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,18 @@ export class Arcade {
this.fetch = options.fetch ?? Shims.getDefaultFetch();
this.#encoder = Opts.FallbackEncoder;

const customHeadersEnv = readEnv('ARCADE_CUSTOM_HEADERS');
if (customHeadersEnv) {
const parsed: Record<string, string> = {};
for (const line of customHeadersEnv.split('\n')) {
const colon = line.indexOf(':');
if (colon >= 0) {
parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
}
}
options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
}

this._options = options;
this.idempotencyHeader = 'Idempotency-Key';

Expand Down
14 changes: 6 additions & 8 deletions src/internal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ type OverloadedParameters<T> =
: T extends (...args: infer A) => unknown ? A
: never;

/* eslint-disable */
/**
* These imports attempt to get types from a parent package's dependencies.
* Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which
Expand All @@ -63,19 +62,18 @@ type OverloadedParameters<T> =
*
* [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
*/
/** @ts-ignore For users with \@types/node */
/** @ts-ignore For users with \@types/node */ /* prettier-ignore */
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 */
/** @ts-ignore For users with undici */ /* prettier-ignore */
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 */
/** @ts-ignore For users with \@types/bun */ /* prettier-ignore */
type BunRequestInit = globalThis.FetchRequestInit;
/** @ts-ignore For users with node-fetch@2 */
/** @ts-ignore For users with node-fetch@2 */ /* prettier-ignore */
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 */
/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ /* prettier-ignore */
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 */
/** @ts-ignore For users who use Deno */ /* prettier-ignore */
type FetchRequestInit = NonNullable<OverloadedParameters<typeof fetch>[1]>;
/* eslint-enable */

type RequestInits =
| NotAny<UndiciTypesRequestInit>
Expand Down
60 changes: 60 additions & 0 deletions src/resources/admin/auth-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ export namespace AuthProviderUpdateRequest {

scope_delimiter?: ',' | ' ';

token_introspection_request?: Oauth2.TokenIntrospectionRequest;

token_request?: Oauth2.TokenRequest;

user_info_request?: Oauth2.UserInfoRequest;
Expand Down Expand Up @@ -474,6 +476,34 @@ export namespace AuthProviderUpdateRequest {
response_map?: { [key: string]: string };
}

export interface TokenIntrospectionRequest {
auth_header_value_format?: string;

auth_method?: string;

endpoint?: string;

method?: string;

params?: { [key: string]: string };

request_content_type?: 'application/x-www-form-urlencoded' | 'application/json';

response_content_type?: 'application/x-www-form-urlencoded' | 'application/json';

response_map?: { [key: string]: string };

triggers?: TokenIntrospectionRequest.Triggers;
}

export namespace TokenIntrospectionRequest {
export interface Triggers {
on_token_grant?: boolean;

on_token_refresh?: boolean;
}
}

export interface TokenRequest {
auth_header_value_format?: string;

Expand Down Expand Up @@ -721,6 +751,8 @@ export namespace AuthProviderPatchParams {

scope_delimiter?: ',' | ' ';

token_introspection_request?: Oauth2.TokenIntrospectionRequest;

token_request?: Oauth2.TokenRequest;

user_info_request?: Oauth2.UserInfoRequest;
Expand Down Expand Up @@ -769,6 +801,34 @@ export namespace AuthProviderPatchParams {
response_map?: { [key: string]: string };
}

export interface TokenIntrospectionRequest {
auth_header_value_format?: string;

auth_method?: string;

endpoint?: string;

method?: string;

params?: { [key: string]: string };

request_content_type?: 'application/x-www-form-urlencoded' | 'application/json';

response_content_type?: 'application/x-www-form-urlencoded' | 'application/json';

response_map?: { [key: string]: string };

triggers?: TokenIntrospectionRequest.Triggers;
}

export namespace TokenIntrospectionRequest {
export interface Triggers {
on_token_grant?: boolean;

on_token_refresh?: boolean;
}
}

export interface TokenRequest {
auth_header_value_format?: string;

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.4.1'; // x-release-please-version
export const VERSION = '2.5.0'; // x-release-please-version
Loading