@zapier/zapier-sdk 0.15.0 → 0.15.2

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +28 -0
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/client.integration.test.d.ts +5 -0
  5. package/dist/api/client.integration.test.d.ts.map +1 -0
  6. package/dist/api/client.integration.test.js +318 -0
  7. package/dist/api/client.js +31 -1
  8. package/dist/api/schemas.d.ts +3 -0
  9. package/dist/api/schemas.d.ts.map +1 -1
  10. package/dist/api/schemas.js +1 -0
  11. package/dist/index.cjs +386 -106
  12. package/dist/index.d.mts +290 -33
  13. package/dist/index.mjs +386 -106
  14. package/dist/plugins/getApp/index.test.js +17 -21
  15. package/dist/plugins/getInputFieldsSchema/index.d.ts +22 -0
  16. package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -0
  17. package/dist/plugins/getInputFieldsSchema/index.js +51 -0
  18. package/dist/plugins/getInputFieldsSchema/index.test.d.ts +2 -0
  19. package/dist/plugins/getInputFieldsSchema/index.test.d.ts.map +1 -0
  20. package/dist/plugins/getInputFieldsSchema/index.test.js +288 -0
  21. package/dist/plugins/getInputFieldsSchema/schemas.d.ts +31 -0
  22. package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +1 -0
  23. package/dist/plugins/getInputFieldsSchema/schemas.js +13 -0
  24. package/dist/plugins/listActions/schemas.d.ts +4 -4
  25. package/dist/plugins/listApps/index.d.ts +1 -3
  26. package/dist/plugins/listApps/index.d.ts.map +1 -1
  27. package/dist/plugins/listApps/index.js +18 -44
  28. package/dist/plugins/listApps/index.test.js +89 -288
  29. package/dist/plugins/listApps/schemas.d.ts +19 -26
  30. package/dist/plugins/listApps/schemas.d.ts.map +1 -1
  31. package/dist/plugins/listApps/schemas.js +19 -18
  32. package/dist/plugins/listAuthentications/schemas.d.ts +4 -4
  33. package/dist/plugins/listInputFieldChoices/schemas.d.ts +4 -4
  34. package/dist/plugins/listInputFields/index.d.ts.map +1 -1
  35. package/dist/plugins/listInputFields/index.js +2 -0
  36. package/dist/plugins/listInputFields/schemas.d.ts +4 -4
  37. package/dist/plugins/runAction/schemas.d.ts +4 -4
  38. package/dist/sdk.d.ts +8 -2
  39. package/dist/sdk.d.ts.map +1 -1
  40. package/dist/sdk.js +2 -0
  41. package/dist/temporary-internal-core/handlers/listApps.d.ts +67 -0
  42. package/dist/temporary-internal-core/handlers/listApps.d.ts.map +1 -0
  43. package/dist/temporary-internal-core/handlers/listApps.js +121 -0
  44. package/dist/temporary-internal-core/handlers/listApps.test.d.ts +2 -0
  45. package/dist/temporary-internal-core/handlers/listApps.test.d.ts.map +1 -0
  46. package/dist/temporary-internal-core/handlers/listApps.test.js +328 -0
  47. package/dist/temporary-internal-core/index.d.ts +18 -0
  48. package/dist/temporary-internal-core/index.d.ts.map +1 -0
  49. package/dist/temporary-internal-core/index.js +18 -0
  50. package/dist/temporary-internal-core/schemas/apps/index.d.ts +582 -0
  51. package/dist/temporary-internal-core/schemas/apps/index.d.ts.map +1 -0
  52. package/dist/temporary-internal-core/schemas/apps/index.js +95 -0
  53. package/dist/temporary-internal-core/schemas/implementations/index.d.ts +511 -0
  54. package/dist/temporary-internal-core/schemas/implementations/index.d.ts.map +1 -0
  55. package/dist/temporary-internal-core/schemas/implementations/index.js +79 -0
  56. package/dist/temporary-internal-core/types/handler.d.ts +51 -0
  57. package/dist/temporary-internal-core/types/handler.d.ts.map +1 -0
  58. package/dist/temporary-internal-core/types/handler.js +8 -0
  59. package/dist/temporary-internal-core/types/index.d.ts +5 -0
  60. package/dist/temporary-internal-core/types/index.d.ts.map +1 -0
  61. package/dist/temporary-internal-core/types/index.js +4 -0
  62. package/dist/temporary-internal-core/utils/app-locators.d.ts +54 -0
  63. package/dist/temporary-internal-core/utils/app-locators.d.ts.map +1 -0
  64. package/dist/temporary-internal-core/utils/app-locators.js +83 -0
  65. package/dist/temporary-internal-core/utils/transformations.d.ts +18 -0
  66. package/dist/temporary-internal-core/utils/transformations.d.ts.map +1 -0
  67. package/dist/temporary-internal-core/utils/transformations.js +36 -0
  68. package/dist/types/sdk.d.ts +2 -1
  69. package/dist/types/sdk.d.ts.map +1 -1
  70. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.15.2
4
+
5
+ ### Patch Changes
6
+
7
+ - e4a3457: Extract listApps API and schemas
8
+
9
+ ## 0.15.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 4c78fb0: Added `getInputFieldsSchema` plugin to retrieve JSON Schema for action inputs
14
+
3
15
  ## 0.15.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -9,6 +9,7 @@
9
9
  - [`getProfile`](#getprofile)
10
10
  - [Actions](#actions)
11
11
  - [`getAction`](#getaction)
12
+ - [`getInputFieldsSchema`](#getinputfieldsschema)
12
13
  - [`listActions`](#listactions)
13
14
  - [`listInputFieldChoices`](#listinputfieldchoices)
14
15
  - [`listInputFields`](#listinputfields)
@@ -256,6 +257,33 @@ const { data: action } = await sdk.getAction({
256
257
  });
257
258
  ```
258
259
 
260
+ #### `getInputFieldsSchema`
261
+
262
+ Get the JSON Schema representation of input fields for an action. Returns a JSON Schema object describing the structure, types, and validation rules for the action's input parameters.
263
+
264
+ **Parameters:**
265
+
266
+ | Name | Type | Required | Default | Possible Values | Description |
267
+ | -------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
268
+ | `options` | `object` | ✅ | — | — | |
269
+ | ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for |
270
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
271
+ | ↳ `actionKey` | `string` | ✅ | — | — | Action key to get the input schema for |
272
+ | ↳ `authenticationId` | `string` | ❌ | — | — | Authentication ID to use when fetching the schema. Required if the action needs authentication to determine available fields. |
273
+ | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect the schema (e.g., when fields depend on other field values) |
274
+
275
+ **Returns:** `Promise<InputSchemaItem>`
276
+
277
+ **Example:**
278
+
279
+ ```typescript
280
+ const { data: inputSchema } = await sdk.getInputFieldsSchema({
281
+ appKey: "example-key",
282
+ actionType: "read",
283
+ actionKey: "example-key",
284
+ });
285
+ ```
286
+
259
287
  #### `listActions`
260
288
 
261
289
  List all actions for a specific app
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAGjB,MAAM,SAAS,CAAC;AAwejB,eAAO,MAAM,eAAe,GAAI,SAAS,gBAAgB,KAAG,SAW3D,CAAC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAGjB,MAAM,SAAS,CAAC;AA2hBjB,eAAO,MAAM,eAAe,GAAI,SAAS,gBAAgB,KAAG,SAW3D,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Integration tests for API client handler override mechanism
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=client.integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.integration.test.d.ts","sourceRoot":"","sources":["../../src/api/client.integration.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,318 @@
1
+ /**
2
+ * Integration tests for API client handler override mechanism
3
+ */
4
+ import { describe, it, expect, vi, beforeEach } from "vitest";
5
+ import { createZapierApi } from "./client";
6
+ describe("Handler Override Mechanism Integration", () => {
7
+ let mockFetch;
8
+ beforeEach(() => {
9
+ mockFetch = vi.fn();
10
+ });
11
+ describe("listApps handler override", () => {
12
+ it("should invoke handler instead of making HTTP request to /api/v0/apps", async () => {
13
+ // Mock the nested API call that the handler makes
14
+ mockFetch.mockResolvedValueOnce({
15
+ ok: true,
16
+ status: 200,
17
+ json: async () => ({
18
+ results: [
19
+ {
20
+ api: "slack",
21
+ name: "Slack",
22
+ id: "SlackAPI@1.0.0",
23
+ logo_url: "https://example.com/slack.png",
24
+ categories: ["communication"],
25
+ },
26
+ ],
27
+ next: null,
28
+ }),
29
+ });
30
+ const api = createZapierApi({
31
+ fetch: mockFetch,
32
+ token: "test-token",
33
+ baseUrl: "https://api.zapier.com",
34
+ });
35
+ // Call the path with handler override
36
+ const result = await api.get("/api/v0/apps", {
37
+ searchParams: { implementationIds: "SlackAPI@1.0.0" },
38
+ });
39
+ // Assert: No direct call to /api/v0/apps (handler intercepted it)
40
+ const fetchCalls = mockFetch.mock.calls;
41
+ const appsEndpointCalls = fetchCalls.filter((call) => typeof call[0] === "string" && call[0].includes("/api/v0/apps"));
42
+ expect(appsEndpointCalls).toHaveLength(0);
43
+ // Assert: Handler made nested call to lookup endpoint
44
+ const lookupCalls = fetchCalls.filter((call) => typeof call[0] === "string" &&
45
+ call[0].includes("/zapier/api/v4/implementations-meta/lookup/"));
46
+ expect(lookupCalls.length).toBeGreaterThan(0);
47
+ // Assert: Result has correct structure from handler
48
+ expect(result).toHaveProperty("data");
49
+ expect(result).toHaveProperty("nextCursor");
50
+ expect(Array.isArray(result.data)).toBe(true);
51
+ expect(result.data).toHaveLength(1);
52
+ expect(result.data[0]).toMatchObject({
53
+ key: "SlackAPI",
54
+ title: "Slack",
55
+ implementation_id: "SlackAPI@1.0.0",
56
+ });
57
+ });
58
+ it("should pass httpClient to handler for nested API calls", async () => {
59
+ // Mock response for the nested lookup call
60
+ mockFetch.mockResolvedValueOnce({
61
+ ok: true,
62
+ status: 200,
63
+ json: async () => ({
64
+ results: [
65
+ {
66
+ api: "github",
67
+ name: "GitHub",
68
+ id: "GitHubAPI@2.1.0",
69
+ logo_url: "https://example.com/github.png",
70
+ categories: ["developer-tools"],
71
+ },
72
+ ],
73
+ next: null,
74
+ }),
75
+ });
76
+ const api = createZapierApi({
77
+ fetch: mockFetch,
78
+ token: "test-token",
79
+ baseUrl: "https://api.zapier.com",
80
+ });
81
+ // Request with multiple implementation IDs
82
+ await api.get("/api/v0/apps", {
83
+ searchParams: {
84
+ implementationIds: "GitHubAPI@2.1.0,SlackAPI@1.0.0",
85
+ },
86
+ });
87
+ // Verify that nested API call was made
88
+ expect(mockFetch).toHaveBeenCalledWith(expect.stringContaining("/zapier/api/v4/implementations-meta/lookup/"), expect.any(Object));
89
+ // Verify the request includes proper configuration
90
+ const fetchCall = mockFetch.mock.calls[0];
91
+ expect(fetchCall[0]).toContain("selected_apis=GitHubAPI%402.1.0%2CSlackAPI%401.0.0");
92
+ expect(fetchCall[1]).toHaveProperty("method", "GET");
93
+ });
94
+ it("should handle search augmentation through handler", async () => {
95
+ // Mock search endpoint response
96
+ mockFetch
97
+ .mockResolvedValueOnce({
98
+ ok: true,
99
+ status: 200,
100
+ json: async () => ({
101
+ results: [
102
+ {
103
+ api: "gmail",
104
+ name: "Gmail",
105
+ id: "GmailAPI@1.5.0",
106
+ logo_url: "https://example.com/gmail.png",
107
+ categories: ["email"],
108
+ },
109
+ ],
110
+ next: null,
111
+ }),
112
+ })
113
+ // Mock lookup endpoint response
114
+ .mockResolvedValueOnce({
115
+ ok: true,
116
+ status: 200,
117
+ json: async () => ({
118
+ results: [
119
+ {
120
+ api: "slack",
121
+ name: "Slack",
122
+ id: "SlackAPI@1.0.0",
123
+ logo_url: "https://example.com/slack.png",
124
+ categories: ["communication"],
125
+ },
126
+ {
127
+ api: "gmail",
128
+ name: "Gmail",
129
+ id: "GmailAPI@1.5.0",
130
+ logo_url: "https://example.com/gmail.png",
131
+ categories: ["email"],
132
+ },
133
+ ],
134
+ next: null,
135
+ }),
136
+ });
137
+ const api = createZapierApi({
138
+ fetch: mockFetch,
139
+ token: "test-token",
140
+ baseUrl: "https://api.zapier.com",
141
+ });
142
+ // Request with search term and specific implementation
143
+ const result = await api.get("/api/v0/apps", {
144
+ searchParams: {
145
+ implementationIds: "SlackAPI@1.0.0",
146
+ search: "email",
147
+ },
148
+ });
149
+ // Verify search endpoint was called
150
+ const searchCalls = mockFetch.mock.calls.filter((call) => typeof call[0] === "string" &&
151
+ call[0].includes("/zapier/api/v4/implementations-meta/search/"));
152
+ expect(searchCalls.length).toBeGreaterThan(0);
153
+ // Verify lookup endpoint was called with augmented IDs
154
+ const lookupCalls = mockFetch.mock.calls.filter((call) => typeof call[0] === "string" &&
155
+ call[0].includes("/zapier/api/v4/implementations-meta/lookup/"));
156
+ expect(lookupCalls.length).toBeGreaterThan(0);
157
+ // Verify result contains both original and search results
158
+ expect(result.data).toHaveLength(2);
159
+ });
160
+ it("should handle pagination through handler", async () => {
161
+ // Mock first page response
162
+ mockFetch.mockResolvedValueOnce({
163
+ ok: true,
164
+ status: 200,
165
+ json: async () => ({
166
+ results: [
167
+ {
168
+ api: "app1",
169
+ name: "App 1",
170
+ id: "App1API@1.0.0",
171
+ logo_url: "https://example.com/app1.png",
172
+ categories: ["productivity"],
173
+ },
174
+ ],
175
+ next: "https://example.com/api?offset=20",
176
+ }),
177
+ });
178
+ const api = createZapierApi({
179
+ fetch: mockFetch,
180
+ token: "test-token",
181
+ baseUrl: "https://api.zapier.com",
182
+ });
183
+ const result = await api.get("/api/v0/apps", {
184
+ searchParams: { pageSize: "10" },
185
+ });
186
+ // Verify pagination cursor is extracted
187
+ expect(result.nextCursor).toBe("20");
188
+ // Mock second page response
189
+ mockFetch.mockResolvedValueOnce({
190
+ ok: true,
191
+ status: 200,
192
+ json: async () => ({
193
+ results: [
194
+ {
195
+ api: "app2",
196
+ name: "App 2",
197
+ id: "App2API@1.0.0",
198
+ logo_url: "https://example.com/app2.png",
199
+ categories: ["productivity"],
200
+ },
201
+ ],
202
+ next: null,
203
+ }),
204
+ });
205
+ // Request second page
206
+ const secondPageResult = await api.get("/api/v0/apps", {
207
+ searchParams: { cursor: "20" },
208
+ });
209
+ expect(secondPageResult.nextCursor).toBeUndefined();
210
+ });
211
+ it("should handle errors from handler correctly", async () => {
212
+ // Mock an error response from nested API call
213
+ mockFetch.mockResolvedValueOnce({
214
+ ok: false,
215
+ status: 404,
216
+ statusText: "Not Found",
217
+ json: async () => ({
218
+ errors: [
219
+ {
220
+ message: "Implementation not found",
221
+ },
222
+ ],
223
+ }),
224
+ });
225
+ const api = createZapierApi({
226
+ fetch: mockFetch,
227
+ token: "test-token",
228
+ baseUrl: "https://api.zapier.com",
229
+ });
230
+ // Request should propagate the error from handler
231
+ await expect(api.get("/api/v0/apps", {
232
+ searchParams: { implementationIds: "NonExistentAPI" },
233
+ })).rejects.toThrow();
234
+ });
235
+ it("should handle empty search results correctly", async () => {
236
+ // Mock empty search response
237
+ mockFetch.mockResolvedValueOnce({
238
+ ok: true,
239
+ status: 200,
240
+ json: async () => ({
241
+ results: [],
242
+ next: null,
243
+ }),
244
+ });
245
+ const api = createZapierApi({
246
+ fetch: mockFetch,
247
+ token: "test-token",
248
+ baseUrl: "https://api.zapier.com",
249
+ });
250
+ const result = await api.get("/api/v0/apps", {
251
+ searchParams: {
252
+ implementationIds: "",
253
+ search: "nonexistentapp",
254
+ },
255
+ });
256
+ // Should return empty results without calling lookup endpoint
257
+ expect(result.data).toEqual([]);
258
+ expect(result.nextCursor).toBeUndefined();
259
+ // Verify only search endpoint was called, not lookup
260
+ const lookupCalls = mockFetch.mock.calls.filter((call) => typeof call[0] === "string" &&
261
+ call[0].includes("/zapier/api/v4/implementations-meta/lookup/"));
262
+ expect(lookupCalls).toHaveLength(0);
263
+ });
264
+ });
265
+ describe("standard path handling (non-override)", () => {
266
+ it("should make normal HTTP requests for paths without handler override", async () => {
267
+ mockFetch.mockResolvedValueOnce({
268
+ ok: true,
269
+ status: 200,
270
+ json: async () => ({ result: "direct HTTP response" }),
271
+ });
272
+ const api = createZapierApi({
273
+ fetch: mockFetch,
274
+ token: "test-token",
275
+ baseUrl: "https://api.zapier.com",
276
+ });
277
+ // Request to a path without handler override
278
+ await api.get("/zapier/some-other-endpoint");
279
+ // Verify HTTP request was made directly
280
+ expect(mockFetch).toHaveBeenCalledWith(expect.stringContaining("/zapier/some-other-endpoint"), expect.any(Object));
281
+ });
282
+ });
283
+ describe("handler override type safety", () => {
284
+ it("should handle handler request transformation correctly", async () => {
285
+ // Mock response for lookup
286
+ mockFetch.mockResolvedValueOnce({
287
+ ok: true,
288
+ status: 200,
289
+ json: async () => ({
290
+ results: [],
291
+ next: null,
292
+ }),
293
+ });
294
+ const api = createZapierApi({
295
+ fetch: mockFetch,
296
+ token: "test-token",
297
+ baseUrl: "https://api.zapier.com",
298
+ });
299
+ // Test that string implementationIds are properly handled
300
+ const result = await api.get("/api/v0/apps", {
301
+ searchParams: {
302
+ implementationIds: "App1,App2,App3",
303
+ pageSize: "15",
304
+ },
305
+ });
306
+ // Verify the handler received and processed the request
307
+ expect(result).toHaveProperty("data");
308
+ expect(Array.isArray(result.data)).toBe(true);
309
+ // Check that lookup endpoint was called with proper params
310
+ const lookupCall = mockFetch.mock.calls.find((call) => typeof call[0] === "string" &&
311
+ call[0].includes("/zapier/api/v4/implementations-meta/lookup/"));
312
+ expect(lookupCall).toBeDefined();
313
+ // Commas are URL-encoded as %2C
314
+ expect(lookupCall[0]).toContain("selected_apis=App1%2CApp2%2CApp3");
315
+ expect(lookupCall[0]).toContain("limit=15");
316
+ });
317
+ });
318
+ });
@@ -10,6 +10,8 @@ import { pollUntilComplete } from "./polling";
10
10
  import { getTokenFromEnvOrConfig } from "../auth";
11
11
  import { getZapierBaseUrl } from "../utils/url-utils";
12
12
  import { ZapierApiError, ZapierAuthenticationError, ZapierValidationError, ZapierNotFoundError, } from "../types/errors";
13
+ import { handleListApps } from "../temporary-internal-core";
14
+ // Configuration for paths
13
15
  const pathConfig = {
14
16
  // e.g. /relay -> https://sdkapi.zapier.com/api/v0/sdk/relay/...
15
17
  "/relay": {
@@ -21,6 +23,9 @@ const pathConfig = {
21
23
  authHeader: "Authorization",
22
24
  pathPrefix: "/api/v0/sdk/zapier",
23
25
  },
26
+ "/api/v0/apps": {
27
+ handlerOverride: handleListApps,
28
+ },
24
29
  };
25
30
  class ZapierApiClient {
26
31
  constructor(options) {
@@ -195,6 +200,16 @@ class ZapierApiClient {
195
200
  }
196
201
  return undefined;
197
202
  }
203
+ // Helper to check if a path config has a handler override
204
+ hasHandlerOverride(pathConfig) {
205
+ return (pathConfig !== undefined &&
206
+ "handlerOverride" in pathConfig &&
207
+ typeof pathConfig.handlerOverride === "function");
208
+ }
209
+ // Helper to check if a path config is a standard path config
210
+ isStandardPathConfig(pathConfig) {
211
+ return pathConfig !== undefined && !this.hasHandlerOverride(pathConfig);
212
+ }
198
213
  // Helper to parse API error response
199
214
  parseErrorResponse(errorInfo) {
200
215
  // If we can't parse data, use status text
@@ -284,7 +299,9 @@ class ZapierApiClient {
284
299
  // session!
285
300
  const authToken = await this.getAuthToken();
286
301
  if (authToken) {
287
- const authHeaderName = pathConfig?.authHeader || "Authorization";
302
+ const authHeaderName = this.isStandardPathConfig(pathConfig) && pathConfig.authHeader
303
+ ? pathConfig.authHeader
304
+ : "Authorization";
288
305
  headers.set(authHeaderName, getAuthorizationHeader(authToken));
289
306
  }
290
307
  // If we know auth is required, and we don't have a token, throw an error
@@ -298,6 +315,19 @@ class ZapierApiClient {
298
315
  }
299
316
  // Helper to perform HTTP requests with JSON handling
300
317
  async fetchJson(method, path, data, options = {}) {
318
+ // Check if this path has a handler override
319
+ const { pathConfig } = this.buildUrl(path, options.searchParams);
320
+ if (this.hasHandlerOverride(pathConfig)) {
321
+ // Invoke the handler instead of making an HTTP request
322
+ // Pass searchParams for GET requests, data for other methods
323
+ const handlerRequest = method === "GET" ? options.searchParams : data;
324
+ return pathConfig.handlerOverride({
325
+ request: handlerRequest,
326
+ deps: {
327
+ httpClient: this,
328
+ },
329
+ });
330
+ }
301
331
  const headers = { ...options.headers };
302
332
  // Add Content-Type for JSON requests with body data
303
333
  if (data && typeof data === "object") {
@@ -972,6 +972,7 @@ export declare const NeedsResponseSchema: z.ZodObject<{
972
972
  }>, "many">>;
973
973
  errors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
974
974
  last_fetched_at: z.ZodOptional<z.ZodString>;
975
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
975
976
  }, "strip", z.ZodTypeAny, {
976
977
  success: boolean;
977
978
  needs?: {
@@ -1008,6 +1009,7 @@ export declare const NeedsResponseSchema: z.ZodObject<{
1008
1009
  }[] | undefined;
1009
1010
  errors?: string[] | undefined;
1010
1011
  last_fetched_at?: string | undefined;
1012
+ schema?: Record<string, unknown> | undefined;
1011
1013
  }, {
1012
1014
  success: boolean;
1013
1015
  needs?: {
@@ -1044,6 +1046,7 @@ export declare const NeedsResponseSchema: z.ZodObject<{
1044
1046
  }[] | undefined;
1045
1047
  errors?: string[] | undefined;
1046
1048
  last_fetched_at?: string | undefined;
1049
+ schema?: Record<string, unknown> | undefined;
1047
1050
  }>;
1048
1051
  export declare const ImplementationSchema: z.ZodObject<{
1049
1052
  selected_api: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/api/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAMH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CrB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;EAE5B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;EAElC,C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AAO,MAAM,8BAA8B;;;;;;;;;EAGzC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;EAsCnC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOpC,CAAC"}
@@ -272,6 +272,7 @@ export const NeedsResponseSchema = z.object({
272
272
  needs: z.array(NeedSchema).optional(),
273
273
  errors: z.array(z.string()).optional(),
274
274
  last_fetched_at: z.string().optional(),
275
+ schema: z.record(z.unknown()).optional(),
275
276
  });
276
277
  // ============================================================================
277
278
  // Implementation Schema