@zapier/zapier-sdk 0.63.0 → 0.64.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +127 -0
  3. package/dist/experimental.cjs +191 -2
  4. package/dist/experimental.d.mts +71 -2
  5. package/dist/experimental.d.ts +69 -0
  6. package/dist/experimental.d.ts.map +1 -1
  7. package/dist/experimental.js +6 -0
  8. package/dist/experimental.mjs +191 -3
  9. package/dist/{index-3fBEDEsp.d.mts → index-Bfvj0KLi.d.mts} +15 -1
  10. package/dist/{index-3fBEDEsp.d.ts → index-Bfvj0KLi.d.ts} +15 -1
  11. package/dist/index.cjs +22 -1
  12. package/dist/index.d.mts +1 -1
  13. package/dist/index.mjs +22 -2
  14. package/dist/plugins/codeSubstrate/getWorkflowVersion/index.d.ts +46 -0
  15. package/dist/plugins/codeSubstrate/getWorkflowVersion/index.d.ts.map +1 -0
  16. package/dist/plugins/codeSubstrate/getWorkflowVersion/index.js +25 -0
  17. package/dist/plugins/codeSubstrate/getWorkflowVersion/schemas.d.ts +17 -0
  18. package/dist/plugins/codeSubstrate/getWorkflowVersion/schemas.d.ts.map +1 -0
  19. package/dist/plugins/codeSubstrate/getWorkflowVersion/schemas.js +25 -0
  20. package/dist/plugins/codeSubstrate/listWorkflowVersions/index.d.ts +49 -0
  21. package/dist/plugins/codeSubstrate/listWorkflowVersions/index.d.ts.map +1 -0
  22. package/dist/plugins/codeSubstrate/listWorkflowVersions/index.js +34 -0
  23. package/dist/plugins/codeSubstrate/listWorkflowVersions/schemas.d.ts +37 -0
  24. package/dist/plugins/codeSubstrate/listWorkflowVersions/schemas.d.ts.map +1 -0
  25. package/dist/plugins/codeSubstrate/listWorkflowVersions/schemas.js +48 -0
  26. package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts +49 -0
  27. package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts.map +1 -0
  28. package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.js +33 -0
  29. package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.d.ts +20 -0
  30. package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.d.ts.map +1 -0
  31. package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.js +42 -0
  32. package/dist/resolvers/index.d.ts +1 -0
  33. package/dist/resolvers/index.d.ts.map +1 -1
  34. package/dist/resolvers/index.js +1 -0
  35. package/dist/resolvers/workflowVersionId.d.ts +6 -0
  36. package/dist/resolvers/workflowVersionId.d.ts.map +1 -0
  37. package/dist/resolvers/workflowVersionId.js +20 -0
  38. package/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ export declare const GetWorkflowVersionOptionsSchema: z.ZodObject<{
3
+ workflow: z.ZodString;
4
+ version: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type GetWorkflowVersionOptions = z.infer<typeof GetWorkflowVersionOptionsSchema>;
7
+ export declare const GetWorkflowVersionResponseSchema: z.ZodObject<{
8
+ id: z.ZodString;
9
+ workflow_id: z.ZodString;
10
+ source_files: z.ZodRecord<z.ZodString, z.ZodString>;
11
+ zapier_durable_version: z.ZodString;
12
+ dependencies: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
13
+ created_by_user_id: z.ZodString;
14
+ created_at: z.ZodString;
15
+ }, z.core.$strip>;
16
+ export type GetWorkflowVersionResponse = z.infer<typeof GetWorkflowVersionResponseSchema>;
17
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getWorkflowVersion/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,+BAA+B;;;iBAKgC,CAAC;AAE7E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;iBAmB3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ export const GetWorkflowVersionOptionsSchema = z
3
+ .object({
4
+ workflow: z.string().uuid().describe("Durable workflow ID"),
5
+ version: z.string().uuid().describe("Workflow version ID"),
6
+ })
7
+ .describe("Get full details of a workflow version including source files");
8
+ export const GetWorkflowVersionResponseSchema = z.object({
9
+ id: z.string().describe("Workflow version ID (UUID)"),
10
+ workflow_id: z.string().describe("Parent workflow ID (UUID)"),
11
+ source_files: z
12
+ .record(z.string(), z.string())
13
+ .describe("Source files keyed by filename → contents"),
14
+ zapier_durable_version: z
15
+ .string()
16
+ .describe("Pinned semver of @zapier/zapier-durable used by this version's runs"),
17
+ dependencies: z
18
+ .record(z.string(), z.string())
19
+ .nullable()
20
+ .describe("Additional npm dependencies pinned for this version (or null)"),
21
+ created_by_user_id: z
22
+ .string()
23
+ .describe("ID of the user who published this version"),
24
+ created_at: z.string().describe("When the version was published (ISO-8601)"),
25
+ });
@@ -0,0 +1,49 @@
1
+ export declare const listWorkflowVersionsPlugin: (sdk: {
2
+ context: {
3
+ api: import("../../..").ApiClient;
4
+ resolveCredentials: () => Promise<string | {
5
+ clientId: string;
6
+ clientSecret: string;
7
+ type?: "client_credentials" | undefined;
8
+ baseUrl?: string | undefined;
9
+ scope?: string | undefined;
10
+ } | {
11
+ clientId: string;
12
+ type?: "pkce" | undefined;
13
+ baseUrl?: string | undefined;
14
+ scope?: string | undefined;
15
+ } | undefined>;
16
+ };
17
+ } & {
18
+ context: import("../../eventEmission").EventEmissionContext;
19
+ } & {
20
+ context: {
21
+ meta: Record<string, import("../../..").PluginMeta>;
22
+ };
23
+ }) => {
24
+ listWorkflowVersions: (options?: ({
25
+ workflow: string;
26
+ pageSize?: number | undefined;
27
+ cursor?: string | undefined;
28
+ maxItems?: number | undefined;
29
+ } & {
30
+ cursor?: string;
31
+ pageSize?: number;
32
+ maxItems?: number;
33
+ }) | undefined) => import("../../..").PaginatedSdkResult<{
34
+ id: string;
35
+ workflow_id: string;
36
+ zapier_durable_version: string;
37
+ dependencies: Record<string, string> | null;
38
+ created_by_user_id: string;
39
+ created_at: string;
40
+ }>;
41
+ } & {
42
+ context: {
43
+ meta: {
44
+ listWorkflowVersions: import("../../..").PluginMeta;
45
+ };
46
+ };
47
+ };
48
+ export type ListWorkflowVersionsPluginProvides = ReturnType<typeof listWorkflowVersionsPlugin>;
49
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflowVersions/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCtC,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,UAAU,CACzD,OAAO,0BAA0B,CAClC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { definePlugin, createPaginatedPluginMethod, } from "../../../utils/plugin-utils";
2
+ import { workflowIdResolver } from "../../../resolvers/workflowId";
3
+ import { DEFAULT_PAGE_SIZE } from "../../../constants";
4
+ import { codeSubstrateDefaults } from "../shared";
5
+ import { ListWorkflowVersionsApiResponseSchema, ListWorkflowVersionsOptionsSchema, WorkflowVersionListItemSchema, } from "./schemas";
6
+ export const listWorkflowVersionsPlugin = definePlugin((sdk) => createPaginatedPluginMethod(sdk, {
7
+ ...codeSubstrateDefaults,
8
+ name: "listWorkflowVersions",
9
+ type: "list",
10
+ itemType: "WorkflowVersion",
11
+ inputSchema: ListWorkflowVersionsOptionsSchema,
12
+ outputSchema: WorkflowVersionListItemSchema,
13
+ defaultPageSize: DEFAULT_PAGE_SIZE,
14
+ resolvers: { workflow: workflowIdResolver },
15
+ handler: async ({ sdk, options }) => {
16
+ const searchParams = {};
17
+ if (options.pageSize !== undefined) {
18
+ searchParams.limit = options.pageSize.toString();
19
+ }
20
+ if (options.cursor) {
21
+ searchParams.cursor = options.cursor;
22
+ }
23
+ const raw = await sdk.context.api.get(`/durableworkflowzaps/api/v0/workflows/${encodeURIComponent(options.workflow)}/versions`, {
24
+ searchParams,
25
+ authRequired: true,
26
+ resource: { type: "workflow", id: options.workflow },
27
+ });
28
+ const response = ListWorkflowVersionsApiResponseSchema.parse(raw);
29
+ return {
30
+ data: response.results,
31
+ nextCursor: response.meta.next_cursor ?? undefined,
32
+ };
33
+ },
34
+ }));
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+ export declare const WorkflowVersionListItemSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ workflow_id: z.ZodString;
5
+ zapier_durable_version: z.ZodString;
6
+ dependencies: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
7
+ created_by_user_id: z.ZodString;
8
+ created_at: z.ZodString;
9
+ }, z.core.$strip>;
10
+ export type WorkflowVersionListItem = z.infer<typeof WorkflowVersionListItemSchema>;
11
+ export declare const ListWorkflowVersionsOptionsSchema: z.ZodObject<{
12
+ workflow: z.ZodString;
13
+ pageSize: z.ZodOptional<z.ZodNumber>;
14
+ cursor: z.ZodOptional<z.ZodString>;
15
+ maxItems: z.ZodOptional<z.ZodNumber>;
16
+ }, z.core.$strip>;
17
+ export type ListWorkflowVersionsOptions = z.infer<typeof ListWorkflowVersionsOptionsSchema>;
18
+ export declare const ListWorkflowVersionsApiResponseSchema: z.ZodObject<{
19
+ results: z.ZodArray<z.ZodObject<{
20
+ id: z.ZodString;
21
+ workflow_id: z.ZodString;
22
+ zapier_durable_version: z.ZodString;
23
+ dependencies: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
24
+ created_by_user_id: z.ZodString;
25
+ created_at: z.ZodString;
26
+ }, z.core.$strip>>;
27
+ meta: z.ZodObject<{
28
+ limit: z.ZodNumber;
29
+ cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
+ next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
31
+ }, z.core.$strip>;
32
+ links: z.ZodOptional<z.ZodObject<{
33
+ next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
34
+ }, z.core.$strip>>;
35
+ }, z.core.$strip>;
36
+ export type ListWorkflowVersionsApiResponse = z.infer<typeof ListWorkflowVersionsApiResponseSchema>;
37
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflowVersions/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,6BAA6B;;;;;;;iBAgBxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;iBAkBqB,CAAC;AAEpE,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAC;AAEF,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;iBAYhD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,qCAAqC,CAC7C,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { z } from "zod";
2
+ export const WorkflowVersionListItemSchema = z.object({
3
+ id: z.string().describe("Workflow version ID (UUID)"),
4
+ workflow_id: z.string().describe("Parent workflow ID (UUID)"),
5
+ zapier_durable_version: z
6
+ .string()
7
+ .describe("Pinned semver of @zapier/zapier-durable used by this version's runs"),
8
+ dependencies: z
9
+ .record(z.string(), z.string())
10
+ .nullable()
11
+ .describe("Additional npm dependencies pinned for this version (or null)"),
12
+ created_by_user_id: z
13
+ .string()
14
+ .describe("ID of the user who published this version"),
15
+ created_at: z.string().describe("When the version was published (ISO-8601)"),
16
+ });
17
+ export const ListWorkflowVersionsOptionsSchema = z
18
+ .object({
19
+ workflow: z.string().uuid().describe("Durable workflow ID"),
20
+ pageSize: z
21
+ .number()
22
+ .int()
23
+ .min(1)
24
+ .max(100)
25
+ .optional()
26
+ .describe("Number of versions per page (max 100)"),
27
+ cursor: z.string().optional().describe("Pagination cursor"),
28
+ maxItems: z
29
+ .number()
30
+ .int()
31
+ .min(1)
32
+ .optional()
33
+ .describe("Maximum total versions to return across all pages"),
34
+ })
35
+ .describe("List published versions for a workflow, newest first");
36
+ export const ListWorkflowVersionsApiResponseSchema = z.object({
37
+ results: z.array(WorkflowVersionListItemSchema),
38
+ meta: z.object({
39
+ limit: z.number(),
40
+ cursor: z.string().nullable().optional(),
41
+ next_cursor: z.string().nullable().optional(),
42
+ }),
43
+ links: z
44
+ .object({
45
+ next: z.string().nullable().optional(),
46
+ })
47
+ .optional(),
48
+ });
@@ -0,0 +1,49 @@
1
+ export declare const publishWorkflowVersionPlugin: (sdk: {
2
+ context: {
3
+ api: import("../../..").ApiClient;
4
+ resolveCredentials: () => Promise<string | {
5
+ clientId: string;
6
+ clientSecret: string;
7
+ type?: "client_credentials" | undefined;
8
+ baseUrl?: string | undefined;
9
+ scope?: string | undefined;
10
+ } | {
11
+ clientId: string;
12
+ type?: "pkce" | undefined;
13
+ baseUrl?: string | undefined;
14
+ scope?: string | undefined;
15
+ } | undefined>;
16
+ };
17
+ } & {
18
+ context: import("../../eventEmission").EventEmissionContext;
19
+ } & {
20
+ context: {
21
+ meta: Record<string, import("../../..").PluginMeta>;
22
+ };
23
+ }) => {
24
+ publishWorkflowVersion: (options?: {
25
+ workflow: string;
26
+ source_files: Record<string, string>;
27
+ dependencies?: Record<string, string> | undefined;
28
+ zapier_durable_version?: string | undefined;
29
+ enabled?: boolean | undefined;
30
+ } | undefined) => Promise<{
31
+ data: {
32
+ id: string;
33
+ workflow_id: string;
34
+ source_files: Record<string, string>;
35
+ zapier_durable_version: string;
36
+ dependencies: Record<string, string> | null;
37
+ created_by_user_id: string;
38
+ created_at: string;
39
+ };
40
+ }>;
41
+ } & {
42
+ context: {
43
+ meta: {
44
+ publishWorkflowVersion: import("../../..").PluginMeta;
45
+ };
46
+ };
47
+ };
48
+ export type PublishWorkflowVersionPluginProvides = ReturnType<typeof publishWorkflowVersionPlugin>;
49
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/publishWorkflowVersion/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCxC,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG,UAAU,CAC3D,OAAO,4BAA4B,CACpC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
2
+ import { workflowIdResolver } from "../../../resolvers/workflowId";
3
+ import { codeSubstrateDefaults } from "../shared";
4
+ import { PublishWorkflowVersionOptionsSchema, PublishWorkflowVersionResponseSchema, } from "./schemas";
5
+ export const publishWorkflowVersionPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
6
+ ...codeSubstrateDefaults,
7
+ name: "publishWorkflowVersion",
8
+ type: "create",
9
+ itemType: "WorkflowVersion",
10
+ inputSchema: PublishWorkflowVersionOptionsSchema,
11
+ outputSchema: PublishWorkflowVersionResponseSchema,
12
+ resolvers: { workflow: workflowIdResolver },
13
+ handler: async ({ sdk, options }) => {
14
+ const body = {
15
+ source_files: options.source_files,
16
+ };
17
+ if (options.dependencies !== undefined) {
18
+ body.dependencies = options.dependencies;
19
+ }
20
+ if (options.zapier_durable_version !== undefined) {
21
+ body.zapier_durable_version = options.zapier_durable_version;
22
+ }
23
+ if (options.enabled !== undefined) {
24
+ body.enabled = options.enabled;
25
+ }
26
+ const raw = await sdk.context.api.post(`/durableworkflowzaps/api/v0/workflows/${encodeURIComponent(options.workflow)}/versions`, body, {
27
+ authRequired: true,
28
+ resource: { type: "workflow", id: options.workflow },
29
+ });
30
+ const data = PublishWorkflowVersionResponseSchema.parse(raw);
31
+ return { data };
32
+ },
33
+ }));
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ export declare const PublishWorkflowVersionOptionsSchema: z.ZodObject<{
3
+ workflow: z.ZodString;
4
+ source_files: z.ZodRecord<z.ZodString, z.ZodString>;
5
+ dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
6
+ zapier_durable_version: z.ZodOptional<z.ZodString>;
7
+ enabled: z.ZodOptional<z.ZodBoolean>;
8
+ }, z.core.$strip>;
9
+ export type PublishWorkflowVersionOptions = z.infer<typeof PublishWorkflowVersionOptionsSchema>;
10
+ export declare const PublishWorkflowVersionResponseSchema: z.ZodObject<{
11
+ id: z.ZodString;
12
+ workflow_id: z.ZodString;
13
+ source_files: z.ZodRecord<z.ZodString, z.ZodString>;
14
+ zapier_durable_version: z.ZodString;
15
+ dependencies: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
16
+ created_by_user_id: z.ZodString;
17
+ created_at: z.ZodString;
18
+ }, z.core.$strip>;
19
+ export type PublishWorkflowVersionResponse = z.infer<typeof PublishWorkflowVersionResponseSchema>;
20
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/publishWorkflowVersion/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mCAAmC;;;;;;iBA4B7C,CAAC;AAEJ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,eAAO,MAAM,oCAAoC;;;;;;;;iBAmB/C,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { z } from "zod";
2
+ export const PublishWorkflowVersionOptionsSchema = z
3
+ .object({
4
+ workflow: z.string().uuid().describe("Durable workflow ID"),
5
+ source_files: z
6
+ .record(z.string(), z.string())
7
+ .refine((files) => Object.keys(files).length > 0, {
8
+ message: "source_files must contain at least one file",
9
+ })
10
+ .describe("Source files keyed by filename → contents"),
11
+ dependencies: z
12
+ .record(z.string(), z.string())
13
+ .optional()
14
+ .describe("Optional npm package dependencies"),
15
+ zapier_durable_version: z
16
+ .string()
17
+ .optional()
18
+ .describe('Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted.'),
19
+ enabled: z
20
+ .boolean()
21
+ .optional()
22
+ .describe("Enable the workflow after publishing. Defaults to true; pass false to publish without enabling."),
23
+ })
24
+ .describe("Publish a new version of a durable workflow. Enables the workflow by default.");
25
+ export const PublishWorkflowVersionResponseSchema = z.object({
26
+ id: z.string().describe("Workflow version ID (UUID)"),
27
+ workflow_id: z.string().describe("Parent workflow ID (UUID)"),
28
+ source_files: z
29
+ .record(z.string(), z.string())
30
+ .describe("Source files keyed by filename → contents"),
31
+ zapier_durable_version: z
32
+ .string()
33
+ .describe("Pinned semver of @zapier/zapier-durable used by this version's runs"),
34
+ dependencies: z
35
+ .record(z.string(), z.string())
36
+ .nullable()
37
+ .describe("Additional npm dependencies pinned for this version (or null)"),
38
+ created_by_user_id: z
39
+ .string()
40
+ .describe("ID of the user who published this version"),
41
+ created_at: z.string().describe("When the version was published (ISO-8601)"),
42
+ });
@@ -14,6 +14,7 @@ export { tableIdResolver } from "./tableId";
14
14
  export { triggerInboxResolver } from "./triggerInbox";
15
15
  export { workflowIdResolver } from "./workflowId";
16
16
  export { durableRunIdResolver } from "./durableRunId";
17
+ export { workflowVersionIdResolver } from "./workflowVersionId";
17
18
  export { triggerMessagesResolver } from "./triggerMessages";
18
19
  export { tableRecordIdResolver, tableRecordIdsResolver } from "./tableRecordId";
19
20
  export { tableFieldIdsResolver } from "./tableFieldIds";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolvers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAGxB,mDAAmD;AACnD,OAAO,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAClF,0DAA0D;AAC1D,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolvers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAGxB,mDAAmD;AACnD,OAAO,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAClF,0DAA0D;AAC1D,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
@@ -16,6 +16,7 @@ export { tableIdResolver } from "./tableId";
16
16
  export { triggerInboxResolver } from "./triggerInbox";
17
17
  export { workflowIdResolver } from "./workflowId";
18
18
  export { durableRunIdResolver } from "./durableRunId";
19
+ export { workflowVersionIdResolver } from "./workflowVersionId";
19
20
  export { triggerMessagesResolver } from "./triggerMessages";
20
21
  export { tableRecordIdResolver, tableRecordIdsResolver } from "./tableRecordId";
21
22
  export { tableFieldIdsResolver } from "./tableFieldIds";
@@ -0,0 +1,6 @@
1
+ import type { DynamicResolver } from "../utils/schema-utils";
2
+ import type { WorkflowVersionListItem } from "../plugins/codeSubstrate/listWorkflowVersions/schemas";
3
+ export declare const workflowVersionIdResolver: DynamicResolver<WorkflowVersionListItem, {
4
+ workflow: string;
5
+ }>;
6
+ //# sourceMappingURL=workflowVersionId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflowVersionId.d.ts","sourceRoot":"","sources":["../../src/resolvers/workflowVersionId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAarG,eAAO,MAAM,yBAAyB,EAAE,eAAe,CACrD,uBAAuB,EACvB;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAmBrB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { toIterable } from "../utils/pagination-utils";
2
+ // Dependent resolver — needs the parent workflow id to fetch the
3
+ // version list. Picker shows versions newest-first per the backend
4
+ // ordering.
5
+ export const workflowVersionIdResolver = {
6
+ type: "dynamic",
7
+ depends: ["workflow"],
8
+ fetch: async (sdk, params) => toIterable(sdk.listWorkflowVersions({
9
+ workflow: params.workflow,
10
+ })),
11
+ prompt: (versions) => ({
12
+ type: "list",
13
+ name: "version",
14
+ message: "Select a workflow version:",
15
+ choices: versions.map((v) => ({
16
+ name: `${v.id} — ${v.zapier_durable_version}`,
17
+ value: v.id,
18
+ })),
19
+ }),
20
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk",
3
- "version": "0.63.0",
3
+ "version": "0.64.0",
4
4
  "description": "Complete Zapier SDK - combines all Zapier SDK packages",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",