Skip to content

Commit d4fa080

Browse files
authored
Merge pull request #62 from ArcadeAI/release-please--branches--main--changes--next--components--arcadejs
release: 1.0.0
2 parents bfc68b7 + e9bab95 commit d4fa080

27 files changed

+636
-391
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.2.2"
2+
".": "1.0.0"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-ccf89dc56f0b7fa4fef0fc4bb486fe3f2563a93a457cb38b3cf5cffb86649ddb.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-b51c646e673aa07b32ac0ee1c8eebe4be70e67681ad9eccb9d7a651bc42a6e04.yml

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
# Changelog
22

3+
## 1.0.0 (2025-01-24)
4+
5+
Full Changelog: [v0.2.2...v1.0.0](https://github.com/ArcadeAI/arcade-js/compare/v0.2.2...v1.0.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#75](https://github.com/ArcadeAI/arcade-js/issues/75)) ([36eb88d](https://github.com/ArcadeAI/arcade-js/commit/36eb88ddefc2abfb9d8f550efa20cdacdaf8f283))
10+
* **api:** api update ([#76](https://github.com/ArcadeAI/arcade-js/issues/76)) ([2f699c1](https://github.com/ArcadeAI/arcade-js/commit/2f699c1ea33aac5bd168a9bafd8924f0185de3d3))
11+
* **api:** api update ([#78](https://github.com/ArcadeAI/arcade-js/issues/78)) ([1fae253](https://github.com/ArcadeAI/arcade-js/commit/1fae253828f24462b3b327d03b71df0ef157efc5))
12+
* **api:** api update ([#79](https://github.com/ArcadeAI/arcade-js/issues/79)) ([168b1f5](https://github.com/ArcadeAI/arcade-js/commit/168b1f550f966e6dd6d9d0870f1df32bb4d0eb9a))
13+
* **api:** api update ([#83](https://github.com/ArcadeAI/arcade-js/issues/83)) ([8b701be](https://github.com/ArcadeAI/arcade-js/commit/8b701be8dc3a2ff9e623b83a601e0c3beb35889e))
14+
* **api:** api update ([#84](https://github.com/ArcadeAI/arcade-js/issues/84)) ([801c58d](https://github.com/ArcadeAI/arcade-js/commit/801c58da6b947ecd5995740d8bf8afb74c527dd9))
15+
16+
17+
### Bug Fixes
18+
19+
* **client:** normalize method ([#61](https://github.com/ArcadeAI/arcade-js/issues/61)) ([7f729f2](https://github.com/ArcadeAI/arcade-js/commit/7f729f27460aa59a4cc3b19c893062fcc4ca7198))
20+
* **client:** normalize method ([#70](https://github.com/ArcadeAI/arcade-js/issues/70)) ([346cc8a](https://github.com/ArcadeAI/arcade-js/commit/346cc8a5054e6120c1d8e320c98e72e9cd07ccb6))
21+
22+
23+
### Chores
24+
25+
* **internal:** codegen related update ([#63](https://github.com/ArcadeAI/arcade-js/issues/63)) ([0b6a70b](https://github.com/ArcadeAI/arcade-js/commit/0b6a70b4882c5b70ee0f1ee4cff5621263576e11))
26+
* **internal:** codegen related update ([#64](https://github.com/ArcadeAI/arcade-js/issues/64)) ([4e9b37b](https://github.com/ArcadeAI/arcade-js/commit/4e9b37bb9615b1ee869c4d7116978be04bf27650))
27+
* **internal:** codegen related update ([#65](https://github.com/ArcadeAI/arcade-js/issues/65)) ([ec268d8](https://github.com/ArcadeAI/arcade-js/commit/ec268d8b98c6a2dbf35a5ffc4006abbec2850fce))
28+
* **internal:** codegen related update ([#66](https://github.com/ArcadeAI/arcade-js/issues/66)) ([e2944f0](https://github.com/ArcadeAI/arcade-js/commit/e2944f04cff49300381faa8a06a53fd9be23a83d))
29+
* **internal:** codegen related update ([#67](https://github.com/ArcadeAI/arcade-js/issues/67)) ([0f7971e](https://github.com/ArcadeAI/arcade-js/commit/0f7971eff276dc2b564db624340908036fba9892))
30+
* **internal:** codegen related update ([#68](https://github.com/ArcadeAI/arcade-js/issues/68)) ([82e6e41](https://github.com/ArcadeAI/arcade-js/commit/82e6e41b778470ce34953905c6c6b669a4ba423e))
31+
* **internal:** codegen related update ([#69](https://github.com/ArcadeAI/arcade-js/issues/69)) ([1315d00](https://github.com/ArcadeAI/arcade-js/commit/1315d00b4573c6ba6fada3cf71df1d32b11b2ce2))
32+
* **internal:** codegen related update ([#72](https://github.com/ArcadeAI/arcade-js/issues/72)) ([46e5837](https://github.com/ArcadeAI/arcade-js/commit/46e58375269048cf1a58445b0fe1e266d3416402))
33+
* **internal:** codegen related update ([#74](https://github.com/ArcadeAI/arcade-js/issues/74)) ([fc4035d](https://github.com/ArcadeAI/arcade-js/commit/fc4035d1067bb9d47bcf3f018d24d1f7bb878a2e))
34+
* **internal:** codegen related update ([#80](https://github.com/ArcadeAI/arcade-js/issues/80)) ([42ea2ed](https://github.com/ArcadeAI/arcade-js/commit/42ea2ededb9302fba24e48f7787682a7883140f3))
35+
* **internal:** codegen related update ([#82](https://github.com/ArcadeAI/arcade-js/issues/82)) ([aa80c39](https://github.com/ArcadeAI/arcade-js/commit/aa80c39657c3cec4818f626a22a4266af1f54e94))
36+
37+
38+
### Documentation
39+
40+
* minor formatting changes ([#71](https://github.com/ArcadeAI/arcade-js/issues/71)) ([0801644](https://github.com/ArcadeAI/arcade-js/commit/0801644c04394818799450624e5afd4ae10feff6))
41+
342
## 0.2.2 (2024-12-19)
443

544
Full Changelog: [v0.2.1...v0.2.2](https://github.com/ArcadeAI/arcade-js/compare/v0.2.1...v0.2.2)

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Setting up the environment
22

3-
This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable).
3+
This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install).
44
Other package managers may work but are not officially supported for development.
55

66
To set up the repository, run:
@@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can
2929
3030
```
3131

32-
```
33-
chmod +x examples/<your-example>.ts
32+
```sh
33+
$ chmod +x examples/<your-example>.ts
3434
# run the example against your api
35-
yarn tsn -T examples/<your-example>.ts
35+
$ yarn tsn -T examples/<your-example>.ts
3636
```
3737

3838
## Using the repository from source

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
This library provides convenient access to the Arcade REST API from server-side TypeScript or JavaScript.
66

7-
The REST API documentation can be found on [docs.arcade-ai.com](https://docs.arcade-ai.com). The full API of this library can be found in [api.md](api.md).
7+
The REST API documentation can be found on [docs.arcade.dev](https://docs.arcade.dev). The full API of this library can be found in [api.md](api.md).
88

99
It is generated with [Stainless](https://www.stainlessapi.com/).
1010

@@ -29,8 +29,7 @@ const client = new Arcade({
2929
async function main() {
3030
const executeToolResponse = await client.tools.execute({
3131
tool_name: 'Google.ListEmails',
32-
inputs: { n_emails: 10 },
33-
tool_version: '0.1.0',
32+
input: { n_emails: 10 },
3433
user_id: 'user@example.com',
3534
});
3635

@@ -283,7 +282,7 @@ await client.chat.completions.create(
283282
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
284283

285284
1. Changes that only affect static types, without breaking runtime behavior.
286-
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
285+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
287286
3. Changes that we do not expect to impact the vast majority of users in practice.
288287

289288
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

SECURITY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ or products provided by Arcade please follow the respective company's security r
2020

2121
### Arcade Terms and Policies
2222

23-
Please contact contact@arcade-ai.com for any questions or concerns regarding security of our services.
23+
24+
Please contact dev@arcade.dev for any questions or concerns regarding security of our services.
2425

2526
---
2627

api.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
Types:
44

5+
- <code><a href="./src/resources/shared.ts">AuthorizationContext</a></code>
56
- <code><a href="./src/resources/shared.ts">AuthorizationResponse</a></code>
67
- <code><a href="./src/resources/shared.ts">Error</a></code>
78

@@ -49,30 +50,28 @@ Types:
4950
- <code><a href="./src/resources/tools/tools.ts">AuthorizeToolRequest</a></code>
5051
- <code><a href="./src/resources/tools/tools.ts">ExecuteToolRequest</a></code>
5152
- <code><a href="./src/resources/tools/tools.ts">ExecuteToolResponse</a></code>
52-
- <code><a href="./src/resources/tools/tools.ts">ResponseOutput</a></code>
53+
- <code><a href="./src/resources/tools/tools.ts">ToolDefinition</a></code>
5354
- <code><a href="./src/resources/tools/tools.ts">ToolExecution</a></code>
5455
- <code><a href="./src/resources/tools/tools.ts">ToolExecutionAttempt</a></code>
55-
- <code><a href="./src/resources/tools/tools.ts">ToolListResponse</a></code>
56-
- <code><a href="./src/resources/tools/tools.ts">ToolGetResponse</a></code>
56+
- <code><a href="./src/resources/tools/tools.ts">ValueSchema</a></code>
5757

5858
Methods:
5959

60-
- <code title="get /v1/tools/list">client.tools.<a href="./src/resources/tools/tools.ts">list</a>({ ...params }) -> ToolListResponsesOffsetPage</code>
60+
- <code title="get /v1/tools">client.tools.<a href="./src/resources/tools/tools.ts">list</a>({ ...params }) -> ToolDefinitionsOffsetPage</code>
6161
- <code title="post /v1/tools/authorize">client.tools.<a href="./src/resources/tools/tools.ts">authorize</a>({ ...params }) -> AuthorizationResponse</code>
6262
- <code title="post /v1/tools/execute">client.tools.<a href="./src/resources/tools/tools.ts">execute</a>({ ...params }) -> ExecuteToolResponse</code>
63-
- <code title="get /v1/tools/definition">client.tools.<a href="./src/resources/tools/tools.ts">get</a>({ ...params }) -> ToolGetResponse</code>
63+
- <code title="get /v1/tools/{name}">client.tools.<a href="./src/resources/tools/tools.ts">get</a>(name) -> ToolDefinition</code>
6464

6565
## Scheduled
6666

6767
Types:
6868

69-
- <code><a href="./src/resources/tools/scheduled.ts">ScheduledListResponse</a></code>
70-
- <code><a href="./src/resources/tools/scheduled.ts">ScheduledDetailsResponse</a></code>
69+
- <code><a href="./src/resources/tools/scheduled.ts">ScheduledGetResponse</a></code>
7170

7271
Methods:
7372

74-
- <code title="get /v1/tools/scheduled">client.tools.scheduled.<a href="./src/resources/tools/scheduled.ts">list</a>() -> ScheduledListResponse</code>
75-
- <code title="get /v1/tools/scheduled/{id}">client.tools.scheduled.<a href="./src/resources/tools/scheduled.ts">details</a>(id) -> ScheduledDetailsResponse</code>
73+
- <code title="get /v1/scheduled_tools">client.tools.scheduled.<a href="./src/resources/tools/scheduled.ts">list</a>({ ...params }) -> ToolExecutionsOffsetPage</code>
74+
- <code title="get /v1/scheduled_tools/{id}">client.tools.scheduled.<a href="./src/resources/tools/scheduled.ts">get</a>(id) -> ScheduledGetResponse</code>
7675

7776
## Formatted
7877

@@ -83,5 +82,5 @@ Types:
8382

8483
Methods:
8584

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@arcadeai/arcadejs",
3-
"version": "0.2.2",
3+
"version": "1.0.0",
44
"description": "The official TypeScript library for the Arcade API",
5-
"author": "Arcade <contact@arcade-ai.com>",
5+
"author": "Arcade <dev@arcade.dev>",
66
"types": "dist/index.d.ts",
77
"main": "dist/index.js",
88
"type": "commonjs",

src/core.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,19 @@ export abstract class APIClient {
522522

523523
const timeout = setTimeout(() => controller.abort(), ms);
524524

525+
const fetchOptions = {
526+
signal: controller.signal as any,
527+
...options,
528+
};
529+
if (fetchOptions.method) {
530+
// Custom methods like 'patch' need to be uppercased
531+
// See https://github.com/nodejs/undici/issues/2294
532+
fetchOptions.method = fetchOptions.method.toUpperCase();
533+
}
534+
525535
return (
526536
// use undefined this binding; fetch errors if bound to something else in browser/cloudflare
527-
this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => {
537+
this.fetch.call(undefined, url, fetchOptions).finally(() => {
528538
clearTimeout(timeout);
529539
})
530540
);

src/index.ts

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@ import {
1414
AuthorizeToolRequest,
1515
ExecuteToolRequest,
1616
ExecuteToolResponse,
17-
ResponseOutput,
1817
ToolAuthorizeParams,
18+
ToolDefinition,
19+
ToolDefinitionsOffsetPage,
1920
ToolExecuteParams,
2021
ToolExecution,
2122
ToolExecutionAttempt,
22-
ToolGetParams,
23-
ToolGetResponse,
2423
ToolListParams,
25-
ToolListResponse,
26-
ToolListResponsesOffsetPage,
2724
Tools,
25+
ValueSchema,
2826
} from './resources/tools/tools';
2927

3028
export interface ClientOptions {
@@ -47,15 +45,15 @@ export interface ClientOptions {
4745
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
4846
* much longer than this timeout before the promise succeeds or fails.
4947
*/
50-
timeout?: number;
48+
timeout?: number | undefined;
5149

5250
/**
5351
* An HTTP agent used to manage HTTP(S) connections.
5452
*
5553
* If not provided, an agent will be constructed by default in the Node.js environment,
5654
* otherwise no agent is used.
5755
*/
58-
httpAgent?: Agent;
56+
httpAgent?: Agent | undefined;
5957

6058
/**
6159
* Specify a custom `fetch` function implementation.
@@ -71,23 +69,23 @@ export interface ClientOptions {
7169
*
7270
* @default 2
7371
*/
74-
maxRetries?: number;
72+
maxRetries?: number | undefined;
7573

7674
/**
7775
* Default headers to include with every request to the API.
7876
*
7977
* These can be removed in individual requests by explicitly setting the
8078
* header to `undefined` or `null` in request options.
8179
*/
82-
defaultHeaders?: Core.Headers;
80+
defaultHeaders?: Core.Headers | undefined;
8381

8482
/**
8583
* Default query parameters to include with every request to the API.
8684
*
8785
* These can be removed in individual requests by explicitly setting the
8886
* param to `undefined` in request options.
8987
*/
90-
defaultQuery?: Core.DefaultQuery;
88+
defaultQuery?: Core.DefaultQuery | undefined;
9189
}
9290

9391
/**
@@ -102,7 +100,7 @@ export class Arcade extends Core.APIClient {
102100
* API Client for interfacing with the Arcade API.
103101
*
104102
* @param {string | undefined} [opts.apiKey=process.env['ARCADE_API_KEY'] ?? undefined]
105-
* @param {string} [opts.baseURL=process.env['ARCADE_BASE_URL'] ?? https://api.arcade-ai.com] - Override the default base URL for the API.
103+
* @param {string} [opts.baseURL=process.env['ARCADE_BASE_URL'] ?? https://api.arcade.dev] - Override the default base URL for the API.
106104
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
107105
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
108106
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
@@ -124,7 +122,7 @@ export class Arcade extends Core.APIClient {
124122
const options: ClientOptions = {
125123
apiKey,
126124
...opts,
127-
baseURL: baseURL || `https://api.arcade-ai.com`,
125+
baseURL: baseURL || `https://api.arcade.dev`,
128126
};
129127

130128
super({
@@ -186,7 +184,7 @@ Arcade.Auth = Auth;
186184
Arcade.Health = Health;
187185
Arcade.Chat = Chat;
188186
Arcade.Tools = Tools;
189-
Arcade.ToolListResponsesOffsetPage = ToolListResponsesOffsetPage;
187+
Arcade.ToolDefinitionsOffsetPage = ToolDefinitionsOffsetPage;
190188
export declare namespace Arcade {
191189
export type RequestOptions = Core.RequestOptions;
192190

@@ -216,18 +214,17 @@ export declare namespace Arcade {
216214
type AuthorizeToolRequest as AuthorizeToolRequest,
217215
type ExecuteToolRequest as ExecuteToolRequest,
218216
type ExecuteToolResponse as ExecuteToolResponse,
219-
type ResponseOutput as ResponseOutput,
217+
type ToolDefinition as ToolDefinition,
220218
type ToolExecution as ToolExecution,
221219
type ToolExecutionAttempt as ToolExecutionAttempt,
222-
type ToolListResponse as ToolListResponse,
223-
type ToolGetResponse as ToolGetResponse,
224-
ToolListResponsesOffsetPage as ToolListResponsesOffsetPage,
220+
type ValueSchema as ValueSchema,
221+
ToolDefinitionsOffsetPage as ToolDefinitionsOffsetPage,
225222
type ToolListParams as ToolListParams,
226223
type ToolAuthorizeParams as ToolAuthorizeParams,
227224
type ToolExecuteParams as ToolExecuteParams,
228-
type ToolGetParams as ToolGetParams,
229225
};
230226

227+
export type AuthorizationContext = API.AuthorizationContext;
231228
export type AuthorizationResponse = API.AuthorizationResponse;
232229
export type Error = API.Error;
233230
}

0 commit comments

Comments
 (0)