@zapier/zapier-sdk 0.71.1 → 0.72.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.72.0
4
+
5
+ ### Minor Changes
6
+
7
+ - fcc758e: `listWorkflows` now paginates. `pageSize` (follows the SDK default page size; values above 100 are rejected) and `cursor` are honored in the SDK, and via the `list-workflows --page-size`/`--cursor` CLI flags that were previously no-ops. Iterating still returns all workflows; reading a single page now yields at most `pageSize` results rather than the full list.
8
+
3
9
  ## 0.71.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -1605,12 +1605,12 @@ List all active durable workflows for the authenticated account
1605
1605
 
1606
1606
  **Parameters:**
1607
1607
 
1608
- | Name | Type | Required | Default | Possible Values | Description |
1609
- | -------------- | -------- | -------- | ------- | --------------- | -------------------------------------------------------------------------------------------- |
1610
- | `options` | `object` | ✅ | — | — | |
1611
- | ​ ↳ `pageSize` | `number` | ❌ | — | — | Number of workflows per page (server-side pagination forthcoming; ignored until then) |
1612
- | ​ ↳ `maxItems` | `number` | ❌ | — | — | Maximum total workflows to return across all pages |
1613
- | ​ ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from for pagination (server-side pagination forthcoming; ignored until then) |
1608
+ | Name | Type | Required | Default | Possible Values | Description |
1609
+ | -------------- | -------- | -------- | ------- | --------------- | -------------------------------------------------- |
1610
+ | `options` | `object` | ✅ | — | — | |
1611
+ | ​ ↳ `pageSize` | `number` | ❌ | — | — | Number of workflows per page (max 100) |
1612
+ | ​ ↳ `maxItems` | `number` | ❌ | — | — | Maximum total workflows to return across all pages |
1613
+ | ​ ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from for pagination |
1614
1614
 
1615
1615
  **Returns:** `Promise<PaginatedResult<WorkflowItem>>`
1616
1616
 
@@ -3287,7 +3287,7 @@ function parseApprovalReviewStreamPayload(parsed, toolNames) {
3287
3287
  }
3288
3288
 
3289
3289
  // src/sdk-version.ts
3290
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.71.1" : void 0) || "unknown";
3290
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.72.0" : void 0) || "unknown";
3291
3291
 
3292
3292
  // src/utils/open-url.ts
3293
3293
  var nodePrefix = "node:";
@@ -11821,17 +11821,20 @@ var WorkflowItemSchema = zod.z.object({
11821
11821
  updated_at: zod.z.string().describe("When the workflow was last modified (ISO-8601)")
11822
11822
  });
11823
11823
  var ListWorkflowsOptionsSchema = zod.z.object({
11824
- pageSize: zod.z.number().int().min(1).optional().describe(
11825
- "Number of workflows per page (server-side pagination forthcoming; ignored until then)"
11826
- ),
11824
+ pageSize: zod.z.number().int().min(1).max(100).optional().describe("Number of workflows per page (max 100)"),
11827
11825
  maxItems: zod.z.number().int().min(1).optional().describe("Maximum total workflows to return across all pages"),
11828
- cursor: zod.z.string().optional().describe(
11829
- "Cursor to start from for pagination (server-side pagination forthcoming; ignored until then)"
11830
- )
11826
+ cursor: zod.z.string().optional().describe("Cursor to start from for pagination")
11831
11827
  }).describe("List all active durable workflows for the authenticated account");
11832
11828
  var ListWorkflowsApiResponseSchema = zod.z.object({
11833
- workflows: zod.z.array(WorkflowItemSchema),
11834
- next_cursor: zod.z.string().nullable().optional()
11829
+ results: zod.z.array(WorkflowItemSchema),
11830
+ meta: zod.z.object({
11831
+ limit: zod.z.number(),
11832
+ cursor: zod.z.string().nullable().optional(),
11833
+ next_cursor: zod.z.string().nullable().optional()
11834
+ }),
11835
+ links: zod.z.object({
11836
+ next: zod.z.string().nullable().optional()
11837
+ }).optional()
11835
11838
  });
11836
11839
 
11837
11840
  // src/plugins/codeSubstrate/listWorkflows/index.ts
@@ -11858,8 +11861,8 @@ var listWorkflowsPlugin = definePlugin(
11858
11861
  );
11859
11862
  const response = ListWorkflowsApiResponseSchema.parse(raw);
11860
11863
  return {
11861
- data: response.workflows,
11862
- nextCursor: response.next_cursor ?? void 0
11864
+ data: response.results,
11865
+ nextCursor: response.meta.next_cursor ?? void 0
11863
11866
  };
11864
11867
  }
11865
11868
  })
@@ -3285,7 +3285,7 @@ function parseApprovalReviewStreamPayload(parsed, toolNames) {
3285
3285
  }
3286
3286
 
3287
3287
  // src/sdk-version.ts
3288
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.71.1" : void 0) || "unknown";
3288
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.72.0" : void 0) || "unknown";
3289
3289
 
3290
3290
  // src/utils/open-url.ts
3291
3291
  var nodePrefix = "node:";
@@ -11819,17 +11819,20 @@ var WorkflowItemSchema = z.object({
11819
11819
  updated_at: z.string().describe("When the workflow was last modified (ISO-8601)")
11820
11820
  });
11821
11821
  var ListWorkflowsOptionsSchema = z.object({
11822
- pageSize: z.number().int().min(1).optional().describe(
11823
- "Number of workflows per page (server-side pagination forthcoming; ignored until then)"
11824
- ),
11822
+ pageSize: z.number().int().min(1).max(100).optional().describe("Number of workflows per page (max 100)"),
11825
11823
  maxItems: z.number().int().min(1).optional().describe("Maximum total workflows to return across all pages"),
11826
- cursor: z.string().optional().describe(
11827
- "Cursor to start from for pagination (server-side pagination forthcoming; ignored until then)"
11828
- )
11824
+ cursor: z.string().optional().describe("Cursor to start from for pagination")
11829
11825
  }).describe("List all active durable workflows for the authenticated account");
11830
11826
  var ListWorkflowsApiResponseSchema = z.object({
11831
- workflows: z.array(WorkflowItemSchema),
11832
- next_cursor: z.string().nullable().optional()
11827
+ results: z.array(WorkflowItemSchema),
11828
+ meta: z.object({
11829
+ limit: z.number(),
11830
+ cursor: z.string().nullable().optional(),
11831
+ next_cursor: z.string().nullable().optional()
11832
+ }),
11833
+ links: z.object({
11834
+ next: z.string().nullable().optional()
11835
+ }).optional()
11833
11836
  });
11834
11837
 
11835
11838
  // src/plugins/codeSubstrate/listWorkflows/index.ts
@@ -11856,8 +11859,8 @@ var listWorkflowsPlugin = definePlugin(
11856
11859
  );
11857
11860
  const response = ListWorkflowsApiResponseSchema.parse(raw);
11858
11861
  return {
11859
- data: response.workflows,
11860
- nextCursor: response.next_cursor ?? void 0
11862
+ data: response.results,
11863
+ nextCursor: response.meta.next_cursor ?? void 0
11861
11864
  };
11862
11865
  }
11863
11866
  })
package/dist/index.cjs CHANGED
@@ -6880,7 +6880,7 @@ function parseApprovalReviewStreamPayload(parsed, toolNames) {
6880
6880
  }
6881
6881
 
6882
6882
  // src/sdk-version.ts
6883
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.71.1" : void 0) || "unknown";
6883
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.72.0" : void 0) || "unknown";
6884
6884
 
6885
6885
  // src/utils/open-url.ts
6886
6886
  var nodePrefix = "node:";
package/dist/index.mjs CHANGED
@@ -6878,7 +6878,7 @@ function parseApprovalReviewStreamPayload(parsed, toolNames) {
6878
6878
  }
6879
6879
 
6880
6880
  // src/sdk-version.ts
6881
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.71.1" : void 0) || "unknown";
6881
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.72.0" : void 0) || "unknown";
6882
6882
 
6883
6883
  // src/utils/open-url.ts
6884
6884
  var nodePrefix = "node:";
@@ -21,8 +21,8 @@ export const listWorkflowsPlugin = definePlugin((sdk) => createPaginatedPluginMe
21
21
  const raw = await sdk.context.api.get("/durableworkflowzaps/api/v0/workflows", { searchParams, authRequired: true });
22
22
  const response = ListWorkflowsApiResponseSchema.parse(raw);
23
23
  return {
24
- data: response.workflows,
25
- nextCursor: response.next_cursor ?? undefined,
24
+ data: response.results,
25
+ nextCursor: response.meta.next_cursor ?? undefined,
26
26
  };
27
27
  },
28
28
  }));
@@ -33,14 +33,13 @@ export declare const ListWorkflowsOptionsSchema: z.ZodObject<{
33
33
  }, z.core.$strip>;
34
34
  export type ListWorkflowsOptions = z.infer<typeof ListWorkflowsOptionsSchema>;
35
35
  /**
36
- * Wire shape returned by `/durableworkflowzaps/api/v0/workflows`. The
37
- * backend does not paginate today `next_cursor` is reserved for when
38
- * server-side pagination lands and is currently never returned. The SDK
39
- * exposes `listWorkflows` as paginated so the future change is
40
- * transparent to callers.
36
+ * Wire shape returned by `/durableworkflowzaps/api/v0/workflows` — the
37
+ * standard cursor-pagination envelope (`results` / `meta` / `links`) shared
38
+ * with the runs and versions list endpoints. The next page cursor lives at
39
+ * `meta.next_cursor` (null on the final page).
41
40
  */
42
41
  export declare const ListWorkflowsApiResponseSchema: z.ZodObject<{
43
- workflows: z.ZodArray<z.ZodObject<{
42
+ results: z.ZodArray<z.ZodObject<{
44
43
  id: z.ZodString;
45
44
  name: z.ZodString;
46
45
  description: z.ZodNullable<z.ZodString>;
@@ -66,7 +65,14 @@ export declare const ListWorkflowsApiResponseSchema: z.ZodObject<{
66
65
  created_at: z.ZodString;
67
66
  updated_at: z.ZodString;
68
67
  }, z.core.$strip>>;
69
- next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
+ meta: z.ZodObject<{
69
+ limit: z.ZodNumber;
70
+ cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
+ next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
+ }, z.core.$strip>;
73
+ links: z.ZodOptional<z.ZodObject<{
74
+ next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
75
+ }, z.core.$strip>>;
70
76
  }, z.core.$strip>;
71
77
  export type ListWorkflowsApiResponse = z.infer<typeof ListWorkflowsApiResponseSchema>;
72
78
  //# sourceMappingURL=schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflows/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;iBAuC7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,0BAA0B;;;;iBAuBuC,CAAC;AAE/E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflows/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;iBAuC7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,0BAA0B;;;;iBAoBuC,CAAC;AAE/E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC"}
@@ -38,8 +38,9 @@ export const ListWorkflowsOptionsSchema = z
38
38
  .number()
39
39
  .int()
40
40
  .min(1)
41
+ .max(100)
41
42
  .optional()
42
- .describe("Number of workflows per page (server-side pagination forthcoming; ignored until then)"),
43
+ .describe("Number of workflows per page (max 100)"),
43
44
  maxItems: z
44
45
  .number()
45
46
  .int()
@@ -49,17 +50,25 @@ export const ListWorkflowsOptionsSchema = z
49
50
  cursor: z
50
51
  .string()
51
52
  .optional()
52
- .describe("Cursor to start from for pagination (server-side pagination forthcoming; ignored until then)"),
53
+ .describe("Cursor to start from for pagination"),
53
54
  })
54
55
  .describe("List all active durable workflows for the authenticated account");
55
56
  /**
56
- * Wire shape returned by `/durableworkflowzaps/api/v0/workflows`. The
57
- * backend does not paginate today `next_cursor` is reserved for when
58
- * server-side pagination lands and is currently never returned. The SDK
59
- * exposes `listWorkflows` as paginated so the future change is
60
- * transparent to callers.
57
+ * Wire shape returned by `/durableworkflowzaps/api/v0/workflows` — the
58
+ * standard cursor-pagination envelope (`results` / `meta` / `links`) shared
59
+ * with the runs and versions list endpoints. The next page cursor lives at
60
+ * `meta.next_cursor` (null on the final page).
61
61
  */
62
62
  export const ListWorkflowsApiResponseSchema = z.object({
63
- workflows: z.array(WorkflowItemSchema),
64
- next_cursor: z.string().nullable().optional(),
63
+ results: z.array(WorkflowItemSchema),
64
+ meta: z.object({
65
+ limit: z.number(),
66
+ cursor: z.string().nullable().optional(),
67
+ next_cursor: z.string().nullable().optional(),
68
+ }),
69
+ links: z
70
+ .object({
71
+ next: z.string().nullable().optional(),
72
+ })
73
+ .optional(),
65
74
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk",
3
- "version": "0.71.1",
3
+ "version": "0.72.0",
4
4
  "description": "Complete Zapier SDK - combines all Zapier SDK packages",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",