@arcadeai/design-system 3.5.5 → 3.6.0
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/dist/lib/arcade/arcade.d.ts +1 -2
- package/dist/lib/arcade/arcade.js +1466 -5
- package/dist/lib/arcade/arcade.test.js +33 -23
- package/package.json +1 -1
- package/dist/arcade-BiJpW9jb.js +0 -1470
|
@@ -1,27 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { allTools as
|
|
3
|
-
import { v as l, d as
|
|
4
|
-
const d = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let t = m;
|
|
8
|
-
return o?.toolkit && (t = m.filter(
|
|
9
|
-
(a) => a.toolkit.name.toLowerCase() === o.toolkit.toLowerCase()
|
|
10
|
-
)), Promise.resolve({
|
|
11
|
-
items: t
|
|
12
|
-
});
|
|
13
|
-
})
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
l.mock("@arcadeai/arcadejs", () => ({
|
|
17
|
-
Arcade: l.fn().mockImplementation(() => d)
|
|
1
|
+
import { ArcadeClient as i } from "./arcade.js";
|
|
2
|
+
import { allTools as u } from "./mocks.js";
|
|
3
|
+
import { v as l, d as m, b as p, i as s, g as e } from "../../vi.bdSIJ99Y-DBnM2VfT.js";
|
|
4
|
+
const { mockToolsList: d, mockConstructorSpy: c } = l.hoisted(() => ({
|
|
5
|
+
mockToolsList: l.fn(),
|
|
6
|
+
mockConstructorSpy: l.fn()
|
|
18
7
|
}));
|
|
8
|
+
d.mockImplementation((o) => {
|
|
9
|
+
let t = u;
|
|
10
|
+
return o?.toolkit && (t = u.filter(
|
|
11
|
+
(a) => a.toolkit.name.toLowerCase() === o.toolkit.toLowerCase()
|
|
12
|
+
)), Promise.resolve({
|
|
13
|
+
items: t
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
l.mock("@arcadeai/arcadejs", () => {
|
|
17
|
+
class o {
|
|
18
|
+
constructor(a) {
|
|
19
|
+
c(a), this.tools = {
|
|
20
|
+
list: d
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
tools;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
Arcade: o
|
|
27
|
+
};
|
|
28
|
+
});
|
|
19
29
|
l.mock("../utils", () => ({
|
|
20
30
|
// biome-ignore lint/suspicious/noEmptyBlockStatements: This is a mock
|
|
21
31
|
resolveEnv: l.fn(() => {
|
|
22
32
|
})
|
|
23
33
|
}));
|
|
24
|
-
|
|
34
|
+
m("Arcade Tests", () => {
|
|
25
35
|
p(() => {
|
|
26
36
|
l.clearAllMocks();
|
|
27
37
|
}), s("should create an arcade instance", () => {
|
|
@@ -86,8 +96,8 @@ u("Arcade Tests", () => {
|
|
|
86
96
|
await new i({
|
|
87
97
|
arcadeClientId: "test-client-id",
|
|
88
98
|
apiKey: "test-api-key"
|
|
89
|
-
}).getAllTools(), e(d
|
|
90
|
-
e.objectContaining({ limit:
|
|
99
|
+
}).getAllTools(), e(d).toHaveBeenCalledWith(
|
|
100
|
+
e.objectContaining({ limit: 2e3, offset: 0 })
|
|
91
101
|
);
|
|
92
102
|
}), s("should filter tools by toolkit", async () => {
|
|
93
103
|
const t = await new i({
|
|
@@ -99,7 +109,7 @@ u("Arcade Tests", () => {
|
|
|
99
109
|
await new i({
|
|
100
110
|
arcadeClientId: "test-client-id",
|
|
101
111
|
apiKey: "test-api-key"
|
|
102
|
-
}).getAllTools({ toolkit: "Gmail", limit: 5, offset: 10 }), e(d
|
|
112
|
+
}).getAllTools({ toolkit: "Gmail", limit: 5, offset: 10 }), e(d).toHaveBeenCalledWith(
|
|
103
113
|
e.objectContaining({ toolkit: "Gmail", limit: 5, offset: 10 })
|
|
104
114
|
);
|
|
105
115
|
}), s("should filter tools by toolkit case insensitive", async () => {
|
|
@@ -247,8 +257,8 @@ u("Arcade Tests", () => {
|
|
|
247
257
|
await new i({
|
|
248
258
|
arcadeClientId: "test-client-id",
|
|
249
259
|
apiKey: "test-api-key"
|
|
250
|
-
}).getToolsForToolkit("Gmail"), e(d
|
|
251
|
-
e.objectContaining({ toolkit: "Gmail", limit:
|
|
260
|
+
}).getToolsForToolkit("Gmail"), e(d).toHaveBeenCalledWith(
|
|
261
|
+
e.objectContaining({ toolkit: "Gmail", limit: 2e3 })
|
|
252
262
|
);
|
|
253
263
|
}), s("should group tools by a string key", async () => {
|
|
254
264
|
const t = await new i({
|