@zapier/zapier-sdk 0.59.0 → 0.61.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 +24 -0
- package/README.md +239 -1
- package/dist/experimental.cjs +329 -10
- package/dist/experimental.d.mts +142 -2
- package/dist/experimental.d.ts +140 -0
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +15 -0
- package/dist/experimental.mjs +329 -11
- package/dist/{index-eliz1Uq3.d.mts → index-iKbnOz6r.d.mts} +15 -1
- package/dist/{index-eliz1Uq3.d.ts → index-iKbnOz6r.d.ts} +15 -1
- package/dist/index.cjs +23 -9
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +23 -10
- package/dist/plugins/codeSubstrate/createWorkflow/index.d.ts +45 -0
- package/dist/plugins/codeSubstrate/createWorkflow/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/createWorkflow/index.js +19 -0
- package/dist/plugins/codeSubstrate/createWorkflow/schemas.d.ts +16 -0
- package/dist/plugins/codeSubstrate/createWorkflow/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/createWorkflow/schemas.js +25 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.d.ts +39 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.js +27 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/schemas.d.ts +6 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/schemas.js +6 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/index.d.ts +40 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/index.js +20 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/schemas.d.ts +11 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/schemas.js +12 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/index.d.ts +40 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/index.js +20 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/schemas.d.ts +11 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/schemas.js +12 -0
- package/dist/plugins/codeSubstrate/getWorkflow/index.d.ts +54 -0
- package/dist/plugins/codeSubstrate/getWorkflow/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getWorkflow/index.js +21 -0
- package/dist/plugins/codeSubstrate/getWorkflow/schemas.d.ts +35 -0
- package/dist/plugins/codeSubstrate/getWorkflow/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getWorkflow/schemas.js +45 -0
- package/dist/plugins/codeSubstrate/listWorkflows/index.d.ts +50 -0
- package/dist/plugins/codeSubstrate/listWorkflows/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/listWorkflows/index.js +29 -0
- package/dist/plugins/codeSubstrate/listWorkflows/schemas.d.ts +40 -0
- package/dist/plugins/codeSubstrate/listWorkflows/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/listWorkflows/schemas.js +54 -0
- package/dist/plugins/codeSubstrate/shared.d.ts +16 -0
- package/dist/plugins/codeSubstrate/shared.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/shared.js +15 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/index.d.ts +47 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/index.js +27 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/schemas.d.ts +18 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/schemas.js +30 -0
- package/dist/plugins/deleteClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/deleteClientCredentials/index.js +1 -4
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +4 -0
- package/dist/resolvers/clientId.d.ts.map +1 -1
- package/dist/resolvers/clientId.js +2 -4
- package/dist/resolvers/index.d.ts +1 -0
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +1 -0
- package/dist/resolvers/workflowId.d.ts +4 -0
- package/dist/resolvers/workflowId.d.ts.map +1 -0
- package/dist/resolvers/workflowId.js +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
|
|
2
|
+
import { workflowIdResolver } from "../../../resolvers/workflowId";
|
|
3
|
+
import { codeSubstrateDefaults } from "../shared";
|
|
4
|
+
import { EnableWorkflowOptionsSchema, EnableWorkflowResponseSchema, } from "./schemas";
|
|
5
|
+
export const enableWorkflowPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
6
|
+
...codeSubstrateDefaults,
|
|
7
|
+
name: "enableWorkflow",
|
|
8
|
+
type: "update",
|
|
9
|
+
itemType: "Workflow",
|
|
10
|
+
inputSchema: EnableWorkflowOptionsSchema,
|
|
11
|
+
outputSchema: EnableWorkflowResponseSchema,
|
|
12
|
+
resolvers: { workflow: workflowIdResolver },
|
|
13
|
+
handler: async ({ sdk, options }) => {
|
|
14
|
+
const data = await sdk.context.api.post(`/durableworkflowzaps/api/v0/workflows/${encodeURIComponent(options.workflow)}/enable`, undefined, {
|
|
15
|
+
authRequired: true,
|
|
16
|
+
resource: { type: "workflow", id: options.workflow },
|
|
17
|
+
});
|
|
18
|
+
return { data };
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const EnableWorkflowOptionsSchema: z.ZodObject<{
|
|
3
|
+
workflow: z.ZodString;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export type EnableWorkflowOptions = z.infer<typeof EnableWorkflowOptionsSchema>;
|
|
6
|
+
export declare const EnableWorkflowResponseSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
enabled: z.ZodBoolean;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type EnableWorkflowResponse = z.infer<typeof EnableWorkflowResponseSchema>;
|
|
11
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/enableWorkflow/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,2BAA2B;;iBAIuB,CAAC;AAEhE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,4BAA4B;;;iBAKvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const EnableWorkflowOptionsSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
workflow: z.string().uuid().describe("Durable workflow ID"),
|
|
5
|
+
})
|
|
6
|
+
.describe("Enable a durable workflow so it accepts triggers");
|
|
7
|
+
export const EnableWorkflowResponseSchema = z.object({
|
|
8
|
+
id: z.string().describe("Workflow ID (UUID)"),
|
|
9
|
+
enabled: z
|
|
10
|
+
.boolean()
|
|
11
|
+
.describe("Workflow's enabled state after the operation (always true)"),
|
|
12
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const getWorkflowPlugin: (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
|
+
getWorkflow: (options?: {
|
|
25
|
+
workflow: string;
|
|
26
|
+
} | undefined) => Promise<{
|
|
27
|
+
data: {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
description: string | null;
|
|
31
|
+
trigger_url: string;
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
created_at: string;
|
|
34
|
+
updated_at: string;
|
|
35
|
+
current_version?: {
|
|
36
|
+
id: string;
|
|
37
|
+
workflow_id: string;
|
|
38
|
+
source_files: Record<string, string>;
|
|
39
|
+
zapier_durable_version: string;
|
|
40
|
+
dependencies: Record<string, string> | null;
|
|
41
|
+
created_by_user_id: string;
|
|
42
|
+
created_at: string;
|
|
43
|
+
} | undefined;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
} & {
|
|
47
|
+
context: {
|
|
48
|
+
meta: {
|
|
49
|
+
getWorkflow: import("../../..").PluginMeta;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export type GetWorkflowPluginProvides = ReturnType<typeof getWorkflowPlugin>;
|
|
54
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/getWorkflow/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsB7B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const updateWorkflowPlugin: (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
|
+
updateWorkflow: (options?: {
|
|
25
|
+
workflow: string;
|
|
26
|
+
name?: string | undefined;
|
|
27
|
+
description?: string | null | undefined;
|
|
28
|
+
} | undefined) => Promise<{
|
|
29
|
+
data: {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
description: string | null;
|
|
33
|
+
trigger_url: string;
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
created_at: string;
|
|
36
|
+
updated_at: string;
|
|
37
|
+
};
|
|
38
|
+
}>;
|
|
39
|
+
} & {
|
|
40
|
+
context: {
|
|
41
|
+
meta: {
|
|
42
|
+
updateWorkflow: import("../../..").PluginMeta;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export type UpdateWorkflowPluginProvides = ReturnType<typeof updateWorkflowPlugin>;
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/updateWorkflow/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BhC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,UAAU,CACnD,OAAO,oBAAoB,CAC5B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
|
|
2
|
+
import { workflowIdResolver } from "../../../resolvers/workflowId";
|
|
3
|
+
import { codeSubstrateDefaults } from "../shared";
|
|
4
|
+
import { UpdateWorkflowOptionsSchema, UpdateWorkflowResponseSchema, } from "./schemas";
|
|
5
|
+
export const updateWorkflowPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
6
|
+
...codeSubstrateDefaults,
|
|
7
|
+
name: "updateWorkflow",
|
|
8
|
+
type: "update",
|
|
9
|
+
itemType: "Workflow",
|
|
10
|
+
inputSchema: UpdateWorkflowOptionsSchema,
|
|
11
|
+
outputSchema: UpdateWorkflowResponseSchema,
|
|
12
|
+
resolvers: { workflow: workflowIdResolver },
|
|
13
|
+
handler: async ({ sdk, options }) => {
|
|
14
|
+
const body = {};
|
|
15
|
+
if (options.name !== undefined) {
|
|
16
|
+
body.name = options.name;
|
|
17
|
+
}
|
|
18
|
+
if (options.description !== undefined) {
|
|
19
|
+
body.description = options.description;
|
|
20
|
+
}
|
|
21
|
+
const data = await sdk.context.api.patch(`/durableworkflowzaps/api/v0/workflows/${encodeURIComponent(options.workflow)}`, body, {
|
|
22
|
+
authRequired: true,
|
|
23
|
+
resource: { type: "workflow", id: options.workflow },
|
|
24
|
+
});
|
|
25
|
+
return { data };
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const UpdateWorkflowOptionsSchema: z.ZodObject<{
|
|
3
|
+
workflow: z.ZodString;
|
|
4
|
+
name: z.ZodOptional<z.ZodString>;
|
|
5
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type UpdateWorkflowOptions = z.infer<typeof UpdateWorkflowOptionsSchema>;
|
|
8
|
+
export declare const UpdateWorkflowResponseSchema: z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
description: z.ZodNullable<z.ZodString>;
|
|
12
|
+
trigger_url: z.ZodString;
|
|
13
|
+
enabled: z.ZodBoolean;
|
|
14
|
+
created_at: z.ZodString;
|
|
15
|
+
updated_at: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type UpdateWorkflowResponse = z.infer<typeof UpdateWorkflowResponseSchema>;
|
|
18
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/updateWorkflow/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,2BAA2B;;;;iBAY0B,CAAC;AAEnE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,4BAA4B;;;;;;;;iBAiBvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const UpdateWorkflowOptionsSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
workflow: z.string().uuid().describe("Durable workflow ID"),
|
|
5
|
+
name: z.string().min(1).optional().describe("New name for the workflow"),
|
|
6
|
+
description: z
|
|
7
|
+
.string()
|
|
8
|
+
.nullish()
|
|
9
|
+
.describe("New description for the workflow (pass null to clear)"),
|
|
10
|
+
})
|
|
11
|
+
.refine((data) => data.name !== undefined || data.description !== undefined, {
|
|
12
|
+
message: "Provide name or description (at least one is required)",
|
|
13
|
+
})
|
|
14
|
+
.describe("Update a durable workflow's name and/or description");
|
|
15
|
+
export const UpdateWorkflowResponseSchema = z.object({
|
|
16
|
+
id: z.string().describe("Workflow ID (UUID)"),
|
|
17
|
+
name: z.string().describe("Workflow name (post-update)"),
|
|
18
|
+
description: z
|
|
19
|
+
.string()
|
|
20
|
+
.nullable()
|
|
21
|
+
.describe("Workflow description, post-update (null if unset)"),
|
|
22
|
+
trigger_url: z
|
|
23
|
+
.string()
|
|
24
|
+
.describe("Public webhook URL that fires this workflow when POSTed to. Embeds a secret trigger token in the path — treat as sensitive."),
|
|
25
|
+
enabled: z
|
|
26
|
+
.boolean()
|
|
27
|
+
.describe("Whether the workflow currently accepts triggers"),
|
|
28
|
+
created_at: z.string().describe("When the workflow was created (ISO-8601)"),
|
|
29
|
+
updated_at: z.string().describe("When this update was applied (ISO-8601)"),
|
|
30
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/deleteClientCredentials/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAK3C,eAAO,MAAM,6BAA6B;aACvB;QAAE,GAAG,EAAE,SAAS,CAAA;KAAE;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/deleteClientCredentials/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAK3C,eAAO,MAAM,6BAA6B;aACvB;QAAE,GAAG,EAAE,SAAS,CAAA;KAAE;;;;;;;;;;;;;;;;;;;CAsBpC,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG,UAAU,CAC5D,OAAO,6BAA6B,CACrC,CAAC"}
|
|
@@ -14,10 +14,7 @@ export const deleteClientCredentialsPlugin = definePlugin((sdk) => createPluginM
|
|
|
14
14
|
await api.delete(`/api/v0/client-credentials/${options.clientId}`, undefined, {
|
|
15
15
|
authRequired: true,
|
|
16
16
|
requiredScopes: ["credentials"],
|
|
17
|
-
resource: {
|
|
18
|
-
type: "client-credential",
|
|
19
|
-
id: options.clientId,
|
|
20
|
-
},
|
|
17
|
+
resource: { type: "client-credential", id: options.clientId },
|
|
21
18
|
});
|
|
22
19
|
return { success: true };
|
|
23
20
|
},
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -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;
|
|
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" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientId.d.ts","sourceRoot":"","sources":["../../src/resolvers/clientId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"clientId.d.ts","sourceRoot":"","sources":["../../src/resolvers/clientId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAG1E,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,qBAAqB,EAAE,EAAE,CAYvE,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { toIterable } from "../utils/pagination-utils";
|
|
1
2
|
export const clientIdResolver = {
|
|
2
3
|
type: "dynamic",
|
|
3
|
-
fetch: async (sdk) => {
|
|
4
|
-
const result = await sdk.listClientCredentials({ maxItems: 100 });
|
|
5
|
-
return result.data;
|
|
6
|
-
},
|
|
4
|
+
fetch: async (sdk) => toIterable(sdk.listClientCredentials({})),
|
|
7
5
|
prompt: (credentials) => ({
|
|
8
6
|
type: "list",
|
|
9
7
|
name: "clientId",
|
|
@@ -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"}
|