@arcadeai/arcadejs 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.6.1 (2025-06-04)
4
+
5
+ Full Changelog: [v1.6.0...v1.6.1](https://github.com/ArcadeAI/arcade-js/compare/v1.6.0...v1.6.1)
6
+
7
+ ### Chores
8
+
9
+ * **docs:** use top-level-await in example snippets ([e6314e7](https://github.com/ArcadeAI/arcade-js/commit/e6314e7c3515b8a689cc8521bcb511afe034911a))
10
+
3
11
  ## 1.6.0 (2025-06-02)
4
12
 
5
13
  Full Changelog: [v1.5.0...v1.6.0](https://github.com/ArcadeAI/arcade-js/compare/v1.5.0...v1.6.0)
package/README.md CHANGED
@@ -26,17 +26,13 @@ const client = new Arcade({
26
26
  apiKey: process.env['ARCADE_API_KEY'], // This is the default and can be omitted
27
27
  });
28
28
 
29
- async function main() {
30
- const executeToolResponse = await client.tools.execute({
31
- tool_name: 'Google.ListEmails',
32
- input: { n_emails: 10 },
33
- user_id: 'user@example.com',
34
- });
35
-
36
- console.log(executeToolResponse.id);
37
- }
29
+ const executeToolResponse = await client.tools.execute({
30
+ tool_name: 'Google.ListEmails',
31
+ input: { n_emails: 10 },
32
+ user_id: 'user@example.com',
33
+ });
38
34
 
39
- main();
35
+ console.log(executeToolResponse.id);
40
36
  ```
41
37
 
42
38
  ### Request & Response types
@@ -51,14 +47,10 @@ const client = new Arcade({
51
47
  apiKey: process.env['ARCADE_API_KEY'], // This is the default and can be omitted
52
48
  });
53
49
 
54
- async function main() {
55
- const params: Arcade.Chat.CompletionCreateParams = {
56
- messages: [{ role: 'user', content: 'Hello, how can I use Arcade?' }],
57
- };
58
- const chatResponse: Arcade.ChatResponse = await client.chat.completions.create(params);
59
- }
60
-
61
- main();
50
+ const params: Arcade.Chat.CompletionCreateParams = {
51
+ messages: [{ role: 'user', content: 'Hello, how can I use Arcade?' }],
52
+ };
53
+ const chatResponse: Arcade.ChatResponse = await client.chat.completions.create(params);
62
54
  ```
63
55
 
64
56
  Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
@@ -71,21 +63,17 @@ a subclass of `APIError` will be thrown:
71
63
 
72
64
  <!-- prettier-ignore -->
73
65
  ```ts
74
- async function main() {
75
- const chatResponse = await client.chat.completions
76
- .create({ messages: [{ role: 'user', content: 'Hello, how can I use Arcade?' }] })
77
- .catch(async (err) => {
78
- if (err instanceof Arcade.APIError) {
79
- console.log(err.status); // 400
80
- console.log(err.name); // BadRequestError
81
- console.log(err.headers); // {server: 'nginx', ...}
82
- } else {
83
- throw err;
84
- }
85
- });
86
- }
87
-
88
- main();
66
+ const chatResponse = await client.chat.completions
67
+ .create({ messages: [{ role: 'user', content: 'Hello, how can I use Arcade?' }] })
68
+ .catch(async (err) => {
69
+ if (err instanceof Arcade.APIError) {
70
+ console.log(err.status); // 400
71
+ console.log(err.name); // BadRequestError
72
+ console.log(err.headers); // {server: 'nginx', ...}
73
+ } else {
74
+ throw err;
75
+ }
76
+ });
89
77
  ```
90
78
 
91
79
  Error codes are as follows:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcadeai/arcadejs",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "The official TypeScript library for the Arcade API",
5
5
  "author": "Arcade <dev@arcade.dev>",
6
6
  "types": "./index.d.ts",
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.6.0'; // x-release-please-version
1
+ export const VERSION = '1.6.1'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.6.0";
1
+ export declare const VERSION = "1.6.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.6.0'; // x-release-please-version
4
+ exports.VERSION = '1.6.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.6.0'; // x-release-please-version
1
+ export const VERSION = '1.6.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map