@zapier/zapier-sdk 0.58.0 → 0.60.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 (39) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +92 -0
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/client.js +12 -0
  5. package/dist/experimental.cjs +155 -2
  6. package/dist/experimental.d.mts +56 -2
  7. package/dist/experimental.d.ts +54 -0
  8. package/dist/experimental.d.ts.map +1 -1
  9. package/dist/experimental.js +5 -0
  10. package/dist/experimental.mjs +155 -3
  11. package/dist/{index-eliz1Uq3.d.mts → index-iKbnOz6r.d.mts} +15 -1
  12. package/dist/{index-eliz1Uq3.d.ts → index-iKbnOz6r.d.ts} +15 -1
  13. package/dist/index.cjs +33 -1
  14. package/dist/index.d.mts +1 -1
  15. package/dist/index.mjs +33 -2
  16. package/dist/plugins/codeSubstrate/getWorkflow/index.d.ts +54 -0
  17. package/dist/plugins/codeSubstrate/getWorkflow/index.d.ts.map +1 -0
  18. package/dist/plugins/codeSubstrate/getWorkflow/index.js +21 -0
  19. package/dist/plugins/codeSubstrate/getWorkflow/schemas.d.ts +35 -0
  20. package/dist/plugins/codeSubstrate/getWorkflow/schemas.d.ts.map +1 -0
  21. package/dist/plugins/codeSubstrate/getWorkflow/schemas.js +45 -0
  22. package/dist/plugins/codeSubstrate/listWorkflows/index.d.ts +50 -0
  23. package/dist/plugins/codeSubstrate/listWorkflows/index.d.ts.map +1 -0
  24. package/dist/plugins/codeSubstrate/listWorkflows/index.js +29 -0
  25. package/dist/plugins/codeSubstrate/listWorkflows/schemas.d.ts +40 -0
  26. package/dist/plugins/codeSubstrate/listWorkflows/schemas.d.ts.map +1 -0
  27. package/dist/plugins/codeSubstrate/listWorkflows/schemas.js +54 -0
  28. package/dist/plugins/codeSubstrate/shared.d.ts +16 -0
  29. package/dist/plugins/codeSubstrate/shared.d.ts.map +1 -0
  30. package/dist/plugins/codeSubstrate/shared.js +15 -0
  31. package/dist/registry.d.ts.map +1 -1
  32. package/dist/registry.js +4 -0
  33. package/dist/resolvers/index.d.ts +1 -0
  34. package/dist/resolvers/index.d.ts.map +1 -1
  35. package/dist/resolvers/index.js +1 -0
  36. package/dist/resolvers/workflowId.d.ts +4 -0
  37. package/dist/resolvers/workflowId.d.ts.map +1 -0
  38. package/dist/resolvers/workflowId.js +14 -0
  39. package/package.json +1 -1
@@ -0,0 +1,21 @@
1
+ import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
2
+ import { workflowIdResolver } from "../../../resolvers/workflowId";
3
+ import { codeSubstrateDefaults } from "../shared";
4
+ import { GetWorkflowOptionsSchema, GetWorkflowResponseSchema } from "./schemas";
5
+ export const getWorkflowPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
6
+ ...codeSubstrateDefaults,
7
+ name: "getWorkflow",
8
+ type: "item",
9
+ itemType: "Workflow",
10
+ inputSchema: GetWorkflowOptionsSchema,
11
+ outputSchema: GetWorkflowResponseSchema,
12
+ resolvers: { workflow: workflowIdResolver },
13
+ handler: async ({ sdk, options }) => {
14
+ const raw = await sdk.context.api.get(`/durableworkflowzaps/api/v0/workflows/${encodeURIComponent(options.workflow)}`, {
15
+ authRequired: true,
16
+ resource: { type: "workflow", id: options.workflow },
17
+ });
18
+ const data = GetWorkflowResponseSchema.parse(raw);
19
+ return { data };
20
+ },
21
+ }));
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ export declare const WorkflowVersionSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ workflow_id: z.ZodString;
5
+ source_files: z.ZodRecord<z.ZodString, z.ZodString>;
6
+ zapier_durable_version: z.ZodString;
7
+ dependencies: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
8
+ created_by_user_id: z.ZodString;
9
+ created_at: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export type WorkflowVersion = z.infer<typeof WorkflowVersionSchema>;
12
+ export declare const GetWorkflowOptionsSchema: z.ZodObject<{
13
+ workflow: z.ZodString;
14
+ }, z.core.$strip>;
15
+ export type GetWorkflowOptions = z.infer<typeof GetWorkflowOptionsSchema>;
16
+ export declare const GetWorkflowResponseSchema: z.ZodObject<{
17
+ id: z.ZodString;
18
+ name: z.ZodString;
19
+ description: z.ZodNullable<z.ZodString>;
20
+ trigger_url: z.ZodString;
21
+ enabled: z.ZodBoolean;
22
+ current_version: z.ZodOptional<z.ZodObject<{
23
+ id: z.ZodString;
24
+ workflow_id: z.ZodString;
25
+ source_files: z.ZodRecord<z.ZodString, z.ZodString>;
26
+ zapier_durable_version: z.ZodString;
27
+ dependencies: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
28
+ created_by_user_id: z.ZodString;
29
+ created_at: z.ZodString;
30
+ }, z.core.$strip>>;
31
+ created_at: z.ZodString;
32
+ updated_at: z.ZodString;
33
+ }, z.core.$strip>;
34
+ export type GetWorkflowResponse = z.infer<typeof GetWorkflowResponseSchema>;
35
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getWorkflow/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,qBAAqB;;;;;;;;iBAqBhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,wBAAwB;;iBAMlC,CAAC;AAEJ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;iBAsBpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { z } from "zod";
2
+ export const WorkflowVersionSchema = z.object({
3
+ id: z.string().describe("Workflow version ID (UUID)"),
4
+ workflow_id: z.string().describe("Parent workflow ID"),
5
+ source_files: z
6
+ .record(z.string(), z.string())
7
+ .describe("Source files keyed by filename → contents"),
8
+ zapier_durable_version: z
9
+ .string()
10
+ .describe("Pinned semver of @zapier/zapier-durable used by this version's runs"),
11
+ dependencies: z
12
+ .record(z.string(), z.string())
13
+ .nullable()
14
+ .describe("Additional npm dependencies pinned for this version (or null)"),
15
+ // Backend column is NOT NULL (see durableworkflowzaps prisma schema:
16
+ // workflow_versions.created_by_user_id), so this is always emitted.
17
+ created_by_user_id: z
18
+ .string()
19
+ .describe("ID of the user who published this version"),
20
+ created_at: z.string().describe("When the version was published (ISO-8601)"),
21
+ });
22
+ export const GetWorkflowOptionsSchema = z
23
+ .object({
24
+ workflow: z.string().uuid().describe("Durable workflow ID"),
25
+ })
26
+ .describe("Get a durable workflow with its current version details and trigger claim status");
27
+ export const GetWorkflowResponseSchema = z.object({
28
+ id: z.string().describe("Workflow ID (UUID)"),
29
+ name: z.string().describe("Workflow name"),
30
+ description: z
31
+ .string()
32
+ .nullable()
33
+ .describe("Optional workflow description (null if unset)"),
34
+ trigger_url: z
35
+ .string()
36
+ .describe("Public webhook URL that fires this workflow when POSTed to. Embeds a secret trigger token in the path — treat as sensitive."),
37
+ enabled: z
38
+ .boolean()
39
+ .describe("Whether the workflow currently accepts triggers"),
40
+ current_version: WorkflowVersionSchema.optional().describe("The currently published version, if any. Absent for workflows with no version published yet."),
41
+ created_at: z.string().describe("When the workflow was created (ISO-8601)"),
42
+ updated_at: z
43
+ .string()
44
+ .describe("When the workflow was last modified (ISO-8601)"),
45
+ });
@@ -0,0 +1,50 @@
1
+ export declare const listWorkflowsPlugin: (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
+ listWorkflows: (options?: ({
25
+ pageSize?: number | undefined;
26
+ maxItems?: number | undefined;
27
+ cursor?: string | undefined;
28
+ } & {
29
+ cursor?: string;
30
+ pageSize?: number;
31
+ maxItems?: number;
32
+ }) | undefined) => import("../../..").PaginatedSdkResult<{
33
+ id: string;
34
+ name: string;
35
+ description: string | null;
36
+ trigger_url: string;
37
+ enabled: boolean;
38
+ current_version_id: string | null;
39
+ created_at: string;
40
+ updated_at: string;
41
+ }>;
42
+ } & {
43
+ context: {
44
+ meta: {
45
+ listWorkflows: import("../../..").PluginMeta;
46
+ };
47
+ };
48
+ };
49
+ export type ListWorkflowsPluginProvides = ReturnType<typeof listWorkflowsPlugin>;
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/listWorkflows/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B/B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,UAAU,CAClD,OAAO,mBAAmB,CAC3B,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { definePlugin, createPaginatedPluginMethod, } from "../../../utils/plugin-utils";
2
+ import { DEFAULT_PAGE_SIZE } from "../../../constants";
3
+ import { codeSubstrateDefaults } from "../shared";
4
+ import { ListWorkflowsApiResponseSchema, ListWorkflowsOptionsSchema, WorkflowItemSchema, } from "./schemas";
5
+ export const listWorkflowsPlugin = definePlugin((sdk) => createPaginatedPluginMethod(sdk, {
6
+ ...codeSubstrateDefaults,
7
+ name: "listWorkflows",
8
+ type: "list",
9
+ itemType: "Workflow",
10
+ inputSchema: ListWorkflowsOptionsSchema,
11
+ outputSchema: WorkflowItemSchema,
12
+ defaultPageSize: DEFAULT_PAGE_SIZE,
13
+ handler: async ({ sdk, options }) => {
14
+ const searchParams = {};
15
+ if (options.pageSize !== undefined) {
16
+ searchParams.limit = options.pageSize.toString();
17
+ }
18
+ if (options.cursor) {
19
+ searchParams.cursor = options.cursor;
20
+ }
21
+ const raw = await sdk.context.api.get("/durableworkflowzaps/api/v0/workflows", { searchParams, authRequired: true });
22
+ const response = ListWorkflowsApiResponseSchema.parse(raw);
23
+ return {
24
+ data: response.workflows,
25
+ next: response.next_cursor ?? null,
26
+ };
27
+ },
28
+ extractCursor: (response) => response.next ?? undefined,
29
+ }));
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+ export declare const WorkflowItemSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ name: z.ZodString;
5
+ description: z.ZodNullable<z.ZodString>;
6
+ trigger_url: z.ZodString;
7
+ enabled: z.ZodBoolean;
8
+ current_version_id: z.ZodNullable<z.ZodString>;
9
+ created_at: z.ZodString;
10
+ updated_at: z.ZodString;
11
+ }, z.core.$strip>;
12
+ export type WorkflowItem = z.infer<typeof WorkflowItemSchema>;
13
+ export declare const ListWorkflowsOptionsSchema: z.ZodObject<{
14
+ pageSize: z.ZodOptional<z.ZodNumber>;
15
+ maxItems: z.ZodOptional<z.ZodNumber>;
16
+ cursor: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>;
18
+ export type ListWorkflowsOptions = z.infer<typeof ListWorkflowsOptionsSchema>;
19
+ /**
20
+ * Wire shape returned by `/durableworkflowzaps/api/v0/workflows`. The
21
+ * backend does not paginate today — `next_cursor` is reserved for when
22
+ * server-side pagination lands and is currently never returned. The SDK
23
+ * exposes `listWorkflows` as paginated so the future change is
24
+ * transparent to callers.
25
+ */
26
+ export declare const ListWorkflowsApiResponseSchema: z.ZodObject<{
27
+ workflows: z.ZodArray<z.ZodObject<{
28
+ id: z.ZodString;
29
+ name: z.ZodString;
30
+ description: z.ZodNullable<z.ZodString>;
31
+ trigger_url: z.ZodString;
32
+ enabled: z.ZodBoolean;
33
+ current_version_id: z.ZodNullable<z.ZodString>;
34
+ created_at: z.ZodString;
35
+ updated_at: z.ZodString;
36
+ }, z.core.$strip>>;
37
+ next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
+ }, z.core.$strip>;
39
+ export type ListWorkflowsApiResponse = z.infer<typeof ListWorkflowsApiResponseSchema>;
40
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +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;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;iBAyB7B,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"}
@@ -0,0 +1,54 @@
1
+ import { z } from "zod";
2
+ export const WorkflowItemSchema = z.object({
3
+ id: z.string().describe("Workflow ID (UUID)"),
4
+ name: z.string().describe("Workflow name"),
5
+ description: z
6
+ .string()
7
+ .nullable()
8
+ .describe("Optional workflow description (null if unset)"),
9
+ trigger_url: z
10
+ .string()
11
+ .describe("Public webhook URL that fires this workflow when POSTed to. Embeds a secret trigger token in the path — treat as sensitive."),
12
+ enabled: z
13
+ .boolean()
14
+ .describe("Whether the workflow currently accepts triggers"),
15
+ current_version_id: z
16
+ .string()
17
+ .nullable()
18
+ .describe("ID of the workflow version that runs handle. Null until a version is published."),
19
+ created_at: z.string().describe("When the workflow was created (ISO-8601)"),
20
+ updated_at: z
21
+ .string()
22
+ .describe("When the workflow was last modified (ISO-8601)"),
23
+ });
24
+ export const ListWorkflowsOptionsSchema = z
25
+ .object({
26
+ pageSize: z
27
+ .number()
28
+ .int()
29
+ .min(1)
30
+ .optional()
31
+ .describe("Number of workflows per page (server-side pagination forthcoming; ignored until then)"),
32
+ maxItems: z
33
+ .number()
34
+ .int()
35
+ .min(1)
36
+ .optional()
37
+ .describe("Maximum total workflows to return across all pages"),
38
+ cursor: z
39
+ .string()
40
+ .optional()
41
+ .describe("Cursor to start from for pagination (server-side pagination forthcoming; ignored until then)"),
42
+ })
43
+ .describe("List all active durable workflows for the authenticated account");
44
+ /**
45
+ * Wire shape returned by `/durableworkflowzaps/api/v0/workflows`. The
46
+ * backend does not paginate today — `next_cursor` is reserved for when
47
+ * server-side pagination lands and is currently never returned. The SDK
48
+ * exposes `listWorkflows` as paginated so the future change is
49
+ * transparent to callers.
50
+ */
51
+ export const ListWorkflowsApiResponseSchema = z.object({
52
+ workflows: z.array(WorkflowItemSchema),
53
+ next_cursor: z.string().nullable().optional(),
54
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Method-meta defaults shared across every workflow plugin. Each plugin
3
+ * spreads `...codeSubstrateDefaults` into its `createPluginMethod` /
4
+ * `createPaginatedPluginMethod` config so we declare these once instead
5
+ * of per plugin.
6
+ *
7
+ * `experimental: true` keeps every workflow method out of the stable SDK
8
+ * factory — they're registered only by the experimental subpath
9
+ * (`@zapier/zapier-sdk/experimental`) — and badges them in generated docs
10
+ * and CLI help.
11
+ */
12
+ export declare const codeSubstrateDefaults: {
13
+ categories: string[];
14
+ experimental: true;
15
+ };
16
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/plugins/codeSubstrate/shared.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB;;;CAGH,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Method-meta defaults shared across every workflow plugin. Each plugin
3
+ * spreads `...codeSubstrateDefaults` into its `createPluginMethod` /
4
+ * `createPaginatedPluginMethod` config so we declare these once instead
5
+ * of per plugin.
6
+ *
7
+ * `experimental: true` keeps every workflow method out of the stable SDK
8
+ * factory — they're registered only by the experimental subpath
9
+ * (`@zapier/zapier-sdk/experimental`) — and badges them in generated docs
10
+ * and CLI help.
11
+ */
12
+ export const codeSubstrateDefaults = {
13
+ categories: ["code-workflow"],
14
+ experimental: true,
15
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA6CvD,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,IAAI,EACJ,aAAa,GACd,EAAE;IACD,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,cAAc,CAoEjB"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAiDvD,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,IAAI,EACJ,aAAa,GACd,EAAE;IACD,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,cAAc,CAoEjB"}
package/dist/registry.js CHANGED
@@ -29,6 +29,10 @@ const categoryDefinitions = {
29
29
  },
30
30
  table: { title: "Table" },
31
31
  trigger: { title: "Trigger" },
32
+ "code-workflow": {
33
+ title: "Code Workflow",
34
+ titlePlural: "Code Workflows",
35
+ },
32
36
  http: { title: "HTTP Request" },
33
37
  utility: { title: "Utility", titlePlural: "Utilities" },
34
38
  other: { title: "Other" },
@@ -12,6 +12,7 @@ export { clientCredentialsNameResolver } from "./clientCredentialsName";
12
12
  export { clientIdResolver } from "./clientId";
13
13
  export { tableIdResolver } from "./tableId";
14
14
  export { triggerInboxResolver } from "./triggerInbox";
15
+ export { workflowIdResolver } from "./workflowId";
15
16
  export { triggerMessagesResolver } from "./triggerMessages";
16
17
  export { tableRecordIdResolver, tableRecordIdsResolver } from "./tableRecordId";
17
18
  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,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,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"}
@@ -14,6 +14,7 @@ export { clientCredentialsNameResolver } from "./clientCredentialsName";
14
14
  export { clientIdResolver } from "./clientId";
15
15
  export { tableIdResolver } from "./tableId";
16
16
  export { triggerInboxResolver } from "./triggerInbox";
17
+ export { workflowIdResolver } from "./workflowId";
17
18
  export { triggerMessagesResolver } from "./triggerMessages";
18
19
  export { tableRecordIdResolver, tableRecordIdsResolver } from "./tableRecordId";
19
20
  export { tableFieldIdsResolver } from "./tableFieldIds";
@@ -0,0 +1,4 @@
1
+ import type { DynamicResolver } from "../utils/schema-utils";
2
+ import type { WorkflowItem } from "../plugins/codeSubstrate/listWorkflows/schemas";
3
+ export declare const workflowIdResolver: DynamicResolver<WorkflowItem, {}>;
4
+ //# sourceMappingURL=workflowId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflowId.d.ts","sourceRoot":"","sources":["../../src/resolvers/workflowId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AASnF,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,YAAY,EAAE,EAAE,CAahE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { toIterable } from "../utils/pagination-utils";
2
+ export const workflowIdResolver = {
3
+ type: "dynamic",
4
+ fetch: async (sdk) => toIterable(sdk.listWorkflows()),
5
+ prompt: (workflows) => ({
6
+ type: "list",
7
+ name: "workflow",
8
+ message: "Select a workflow:",
9
+ choices: workflows.map((workflow) => ({
10
+ name: workflow.enabled ? workflow.name : `${workflow.name} (disabled)`,
11
+ value: workflow.id,
12
+ })),
13
+ }),
14
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk",
3
- "version": "0.58.0",
3
+ "version": "0.60.0",
4
4
  "description": "Complete Zapier SDK - combines all Zapier SDK packages",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",