@zapier/zapier-sdk 0.45.2 → 0.46.1
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 +12 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +24 -7
- package/dist/api/schemas.d.ts +5 -5
- package/dist/api/types.d.ts +17 -0
- package/dist/api/types.d.ts.map +1 -1
- package/dist/auth.d.ts +27 -6
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +130 -92
- package/dist/cache.d.ts +50 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +47 -0
- package/dist/index.cjs +3108 -3695
- package/dist/index.d.mts +6735 -2188
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.mjs +3105 -3696
- package/dist/plugins/api/index.d.ts +22 -10
- package/dist/plugins/api/index.d.ts.map +1 -1
- package/dist/plugins/api/index.js +4 -4
- package/dist/plugins/apps/index.d.ts +108 -7
- package/dist/plugins/apps/index.d.ts.map +1 -1
- package/dist/plugins/apps/index.js +3 -4
- package/dist/plugins/capabilities/index.d.ts +9 -6
- package/dist/plugins/capabilities/index.d.ts.map +1 -1
- package/dist/plugins/capabilities/index.js +3 -2
- package/dist/plugins/connections/index.d.ts +15 -9
- package/dist/plugins/connections/index.d.ts.map +1 -1
- package/dist/plugins/connections/index.js +3 -2
- package/dist/plugins/createClientCredentials/index.d.ts +26 -14
- package/dist/plugins/createClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/createClientCredentials/index.js +16 -39
- package/dist/plugins/createClientCredentials/schemas.d.ts +0 -2
- package/dist/plugins/createClientCredentials/schemas.d.ts.map +1 -1
- package/dist/plugins/deleteClientCredentials/index.d.ts +20 -14
- package/dist/plugins/deleteClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/deleteClientCredentials/index.js +18 -37
- package/dist/plugins/deleteClientCredentials/schemas.d.ts +0 -2
- package/dist/plugins/deleteClientCredentials/schemas.d.ts.map +1 -1
- package/dist/plugins/deprecated/authentications.d.ts +597 -41
- package/dist/plugins/deprecated/authentications.d.ts.map +1 -1
- package/dist/plugins/deprecated/authentications.js +9 -8
- package/dist/plugins/eventEmission/index.d.ts +9 -6
- package/dist/plugins/eventEmission/index.d.ts.map +1 -1
- package/dist/plugins/eventEmission/index.js +3 -2
- package/dist/plugins/fetch/index.d.ts +40 -17
- package/dist/plugins/fetch/index.d.ts.map +1 -1
- package/dist/plugins/fetch/index.js +6 -4
- package/dist/plugins/findFirstConnection/index.d.ts +109 -14
- package/dist/plugins/findFirstConnection/index.d.ts.map +1 -1
- package/dist/plugins/findFirstConnection/index.js +14 -26
- package/dist/plugins/findFirstConnection/schemas.d.ts +0 -2
- package/dist/plugins/findFirstConnection/schemas.d.ts.map +1 -1
- package/dist/plugins/findUniqueConnection/index.d.ts +109 -14
- package/dist/plugins/findUniqueConnection/index.d.ts.map +1 -1
- package/dist/plugins/findUniqueConnection/index.js +14 -26
- package/dist/plugins/findUniqueConnection/schemas.d.ts +0 -2
- package/dist/plugins/findUniqueConnection/schemas.d.ts.map +1 -1
- package/dist/plugins/getAction/index.d.ts +68 -15
- package/dist/plugins/getAction/index.d.ts.map +1 -1
- package/dist/plugins/getAction/index.js +21 -31
- package/dist/plugins/getAction/schemas.d.ts +4 -6
- package/dist/plugins/getAction/schemas.d.ts.map +1 -1
- package/dist/plugins/getApp/index.d.ts +140 -14
- package/dist/plugins/getApp/index.d.ts.map +1 -1
- package/dist/plugins/getApp/index.js +16 -38
- package/dist/plugins/getApp/schemas.d.ts +0 -2
- package/dist/plugins/getApp/schemas.d.ts.map +1 -1
- package/dist/plugins/getConnection/index.d.ts +50 -16
- package/dist/plugins/getConnection/index.d.ts.map +1 -1
- package/dist/plugins/getConnection/index.js +22 -29
- package/dist/plugins/getConnection/schemas.d.ts +0 -2
- package/dist/plugins/getConnection/schemas.d.ts.map +1 -1
- package/dist/plugins/getInputFieldsSchema/index.d.ts +59 -13
- package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -1
- package/dist/plugins/getInputFieldsSchema/index.js +21 -32
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts +4 -6
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.d.ts +25 -18
- package/dist/plugins/getProfile/index.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.js +13 -26
- package/dist/plugins/getProfile/schemas.d.ts +0 -8
- package/dist/plugins/getProfile/schemas.d.ts.map +1 -1
- package/dist/plugins/getProfile/schemas.js +0 -1
- package/dist/plugins/listActions/index.d.ts +73 -23
- package/dist/plugins/listActions/index.d.ts.map +1 -1
- package/dist/plugins/listActions/index.js +25 -53
- package/dist/plugins/listActions/schemas.d.ts +4 -15
- package/dist/plugins/listActions/schemas.d.ts.map +1 -1
- package/dist/plugins/listApps/index.d.ts +121 -13
- package/dist/plugins/listApps/index.d.ts.map +1 -1
- package/dist/plugins/listApps/index.js +22 -31
- package/dist/plugins/listApps/schemas.d.ts +0 -2
- package/dist/plugins/listApps/schemas.d.ts.map +1 -1
- package/dist/plugins/listClientCredentials/index.d.ts +29 -16
- package/dist/plugins/listClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/listClientCredentials/index.js +17 -37
- package/dist/plugins/listClientCredentials/schemas.d.ts +0 -2
- package/dist/plugins/listClientCredentials/schemas.d.ts.map +1 -1
- package/dist/plugins/listConnections/index.d.ts +95 -17
- package/dist/plugins/listConnections/index.d.ts.map +1 -1
- package/dist/plugins/listConnections/index.js +25 -49
- package/dist/plugins/listConnections/schemas.d.ts +0 -2
- package/dist/plugins/listConnections/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.d.ts +77 -22
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.js +27 -50
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +4 -6
- package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.d.ts +154 -22
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.js +28 -41
- package/dist/plugins/listInputFields/schemas.d.ts +4 -6
- package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
- package/dist/plugins/manifest/index.d.ts +40 -36
- package/dist/plugins/manifest/index.d.ts.map +1 -1
- package/dist/plugins/manifest/index.js +3 -2
- package/dist/plugins/registry/index.d.ts +11 -9
- package/dist/plugins/registry/index.d.ts.map +1 -1
- package/dist/plugins/registry/index.js +3 -2
- package/dist/plugins/request/index.d.ts +61 -15
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +14 -22
- package/dist/plugins/request/schemas.d.ts +0 -2
- package/dist/plugins/request/schemas.d.ts.map +1 -1
- package/dist/plugins/runAction/index.d.ts +137 -23
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/index.js +65 -78
- package/dist/plugins/runAction/schemas.d.ts +4 -14
- package/dist/plugins/runAction/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/createTable/index.d.ts +43 -11
- package/dist/plugins/tables/createTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTable/index.js +16 -44
- package/dist/plugins/tables/createTable/schemas.d.ts +0 -2
- package/dist/plugins/tables/createTable/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/createTableFields/index.d.ts +54 -11
- package/dist/plugins/tables/createTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTableFields/index.js +17 -41
- package/dist/plugins/tables/createTableFields/schemas.d.ts +21 -23
- package/dist/plugins/tables/createTableFields/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/createTableRecords/index.d.ts +47 -11
- package/dist/plugins/tables/createTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTableRecords/index.js +17 -43
- package/dist/plugins/tables/createTableRecords/schemas.d.ts +0 -2
- package/dist/plugins/tables/createTableRecords/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTable/index.d.ts +36 -13
- package/dist/plugins/tables/deleteTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTable/index.js +18 -40
- package/dist/plugins/tables/deleteTable/schemas.d.ts +0 -2
- package/dist/plugins/tables/deleteTable/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableFields/index.d.ts +36 -11
- package/dist/plugins/tables/deleteTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableFields/index.js +17 -39
- package/dist/plugins/tables/deleteTableFields/schemas.d.ts +0 -2
- package/dist/plugins/tables/deleteTableFields/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableRecords/index.d.ts +36 -11
- package/dist/plugins/tables/deleteTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableRecords/index.js +18 -41
- package/dist/plugins/tables/deleteTableRecords/schemas.d.ts +0 -2
- package/dist/plugins/tables/deleteTableRecords/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/getTable/index.d.ts +43 -12
- package/dist/plugins/tables/getTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/getTable/index.js +18 -43
- package/dist/plugins/tables/getTable/schemas.d.ts +0 -2
- package/dist/plugins/tables/getTable/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/getTableRecord/index.d.ts +43 -11
- package/dist/plugins/tables/getTableRecord/index.d.ts.map +1 -1
- package/dist/plugins/tables/getTableRecord/index.js +18 -42
- package/dist/plugins/tables/getTableRecord/schemas.d.ts +0 -2
- package/dist/plugins/tables/getTableRecord/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/listTableFields/index.d.ts +46 -11
- package/dist/plugins/tables/listTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTableFields/index.js +17 -41
- package/dist/plugins/tables/listTableFields/schemas.d.ts +12 -14
- package/dist/plugins/tables/listTableFields/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/listTableRecords/index.d.ts +66 -18
- package/dist/plugins/tables/listTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTableRecords/index.js +27 -50
- package/dist/plugins/tables/listTableRecords/schemas.d.ts +6 -8
- package/dist/plugins/tables/listTableRecords/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/listTables/index.d.ts +53 -20
- package/dist/plugins/tables/listTables/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTables/index.js +24 -51
- package/dist/plugins/tables/listTables/schemas.d.ts +0 -2
- package/dist/plugins/tables/listTables/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/shared.d.ts +10 -0
- package/dist/plugins/tables/shared.d.ts.map +1 -0
- package/dist/plugins/tables/shared.js +9 -0
- package/dist/plugins/tables/updateTableRecords/index.d.ts +49 -11
- package/dist/plugins/tables/updateTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/updateTableRecords/index.js +20 -43
- package/dist/plugins/tables/updateTableRecords/schemas.d.ts +0 -2
- package/dist/plugins/tables/updateTableRecords/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/utils.d.ts.map +1 -1
- package/dist/plugins/tables/utils.js +1 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +21 -1
- package/dist/resolvers/actionKey.d.ts +1 -2
- package/dist/resolvers/actionKey.d.ts.map +1 -1
- package/dist/resolvers/actionType.d.ts +1 -2
- package/dist/resolvers/actionType.d.ts.map +1 -1
- package/dist/schemas/Action.d.ts +1 -1
- package/dist/sdk.d.ts +2942 -2
- package/dist/sdk.d.ts.map +1 -1
- package/dist/types/credentials.d.ts +2 -1
- package/dist/types/credentials.d.ts.map +1 -1
- package/dist/types/credentials.js +2 -1
- package/dist/types/errors.d.ts +13 -10
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +15 -12
- package/dist/types/functions.d.ts +18 -2
- package/dist/types/functions.d.ts.map +1 -1
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/properties.d.ts +1 -1
- package/dist/types/registry.d.ts +1 -1
- package/dist/types/registry.d.ts.map +1 -1
- package/dist/types/sdk.d.ts +2 -0
- package/dist/types/sdk.d.ts.map +1 -1
- package/dist/types/sdk.js +1 -0
- package/dist/utils/function-utils.d.ts +11 -12
- package/dist/utils/function-utils.d.ts.map +1 -1
- package/dist/utils/plugin-utils.d.ts +168 -0
- package/dist/utils/plugin-utils.d.ts.map +1 -0
- package/dist/utils/plugin-utils.js +132 -0
- package/package.json +2 -4
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { definePlugin } from "../../utils/plugin-utils";
|
|
2
|
+
import { createPluginMethod } from "../../utils/plugin-utils";
|
|
3
|
+
import { FindUniqueConnectionSchema } from "./schemas";
|
|
2
4
|
import { ZapierResourceNotFoundError, ZapierValidationError, } from "../../types/errors";
|
|
3
|
-
import { createFunction } from "../../utils/function-utils";
|
|
4
5
|
import { ConnectionItemSchema } from "../../schemas/Connection";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export const findUniqueConnectionPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
7
|
+
name: "findUniqueConnection",
|
|
8
|
+
categories: ["connection"],
|
|
9
|
+
type: "item",
|
|
10
|
+
itemType: "Connection",
|
|
11
|
+
inputSchema: FindUniqueConnectionSchema,
|
|
12
|
+
outputSchema: ConnectionItemSchema,
|
|
13
|
+
handler: async ({ sdk, options = {} }) => {
|
|
9
14
|
const connectionsResponse = await sdk.listConnections({
|
|
10
15
|
...options,
|
|
11
16
|
maxItems: 2, // Get up to 2 to check for uniqueness
|
|
@@ -16,23 +21,6 @@ export const findUniqueConnectionPlugin = (sdk) => {
|
|
|
16
21
|
if (connectionsResponse.data.length > 1) {
|
|
17
22
|
throw new ZapierValidationError("Multiple connections found matching the specified criteria. Expected exactly one.");
|
|
18
23
|
}
|
|
19
|
-
return {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
const findUniqueConnectionDefinition = createFunction(findUniqueConnection, FindUniqueConnectionSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, findUniqueConnection.name));
|
|
24
|
-
return {
|
|
25
|
-
findUniqueConnection: findUniqueConnectionDefinition,
|
|
26
|
-
context: {
|
|
27
|
-
meta: {
|
|
28
|
-
findUniqueConnection: {
|
|
29
|
-
categories: ["connection"],
|
|
30
|
-
type: "item",
|
|
31
|
-
itemType: "Connection",
|
|
32
|
-
inputSchema: FindUniqueConnectionSchema,
|
|
33
|
-
outputSchema: ConnectionItemSchema,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
};
|
|
24
|
+
return { data: connectionsResponse.data[0] };
|
|
25
|
+
},
|
|
26
|
+
}));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
2
|
import type { ConnectionItem } from "../../types/domain";
|
|
3
|
-
import type { ZapierAuthenticationError, ZapierApiError, ZapierResourceNotFoundError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
|
|
4
3
|
export declare const FindUniqueConnectionSchema: z.ZodObject<{
|
|
5
4
|
title: z.ZodOptional<z.ZodString>;
|
|
6
5
|
search: z.ZodOptional<z.ZodString>;
|
|
@@ -18,7 +17,6 @@ export declare const FindUniqueConnectionSchema: z.ZodObject<{
|
|
|
18
17
|
expired: z.ZodOptional<z.ZodBoolean>;
|
|
19
18
|
}, z.core.$strip>;
|
|
20
19
|
export type FindUniqueConnectionOptions = z.infer<typeof FindUniqueConnectionSchema>;
|
|
21
|
-
export type FindUniqueConnectionError = ZapierAuthenticationError | ZapierApiError | ZapierResourceNotFoundError | ZapierValidationError | ZapierUnknownError;
|
|
22
20
|
export interface FindUniqueConnectionSdkFunction {
|
|
23
21
|
findUniqueConnection: (options?: FindUniqueConnectionOptions) => Promise<{
|
|
24
22
|
data: ConnectionItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueConnection/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueConnection/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;iBAOsB,CAAC;AAG9D,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,0BAA0B,CAClC,CAAC;AAGF,MAAM,WAAW,+BAA+B;IAC9C,oBAAoB,EAAE,CACpB,OAAO,CAAC,EAAE,2BAA2B,KAClC,OAAO,CAAC;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,CAAC,CAAC;CACxC"}
|
|
@@ -1,25 +1,78 @@
|
|
|
1
|
-
import type { Plugin } from "../../types/plugin";
|
|
2
1
|
import type { ApiClient } from "../../api";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
export declare const getActionPlugin: (sdk: {
|
|
3
|
+
listActions: (options?: (({
|
|
4
|
+
app: string;
|
|
5
|
+
actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined;
|
|
6
|
+
pageSize?: number | undefined;
|
|
7
|
+
maxItems?: number | undefined;
|
|
8
|
+
cursor?: string | undefined;
|
|
9
|
+
} | {
|
|
10
|
+
appKey: string;
|
|
11
|
+
actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined;
|
|
12
|
+
pageSize?: number | undefined;
|
|
13
|
+
maxItems?: number | undefined;
|
|
14
|
+
cursor?: string | undefined;
|
|
15
|
+
}) & {
|
|
16
|
+
cursor?: string;
|
|
17
|
+
pageSize?: number;
|
|
18
|
+
maxItems?: number;
|
|
19
|
+
}) | undefined) => import("../..").PaginatedSdkResult<{
|
|
20
|
+
description: string;
|
|
21
|
+
key: string;
|
|
22
|
+
app_key: string;
|
|
23
|
+
action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
|
|
24
|
+
title: string;
|
|
25
|
+
type: "action";
|
|
26
|
+
id?: string | undefined;
|
|
27
|
+
is_important?: boolean | undefined;
|
|
28
|
+
is_hidden?: boolean | undefined;
|
|
29
|
+
app_version?: string | undefined;
|
|
10
30
|
}>;
|
|
31
|
+
} & {
|
|
11
32
|
context: {
|
|
12
33
|
meta: {
|
|
13
|
-
|
|
14
|
-
inputSchema: typeof GetActionSchema;
|
|
15
|
-
};
|
|
34
|
+
listActions: import("../..").PluginMeta;
|
|
16
35
|
};
|
|
17
36
|
};
|
|
18
|
-
}
|
|
19
|
-
export declare const getActionPlugin: Plugin<ListActionsPluginProvides & {
|
|
37
|
+
} & {
|
|
20
38
|
context: {
|
|
21
39
|
api: ApiClient;
|
|
22
40
|
};
|
|
23
|
-
} &
|
|
24
|
-
|
|
41
|
+
} & {
|
|
42
|
+
context: import("../eventEmission").EventEmissionContext;
|
|
43
|
+
} & {
|
|
44
|
+
context: {
|
|
45
|
+
meta: Record<string, import("../..").PluginMeta>;
|
|
46
|
+
};
|
|
47
|
+
}) => {
|
|
48
|
+
getAction: (options?: {
|
|
49
|
+
app: string;
|
|
50
|
+
actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
|
|
51
|
+
action: string;
|
|
52
|
+
} | {
|
|
53
|
+
appKey: string;
|
|
54
|
+
actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
|
|
55
|
+
actionKey: string;
|
|
56
|
+
} | undefined) => Promise<{
|
|
57
|
+
data: {
|
|
58
|
+
description: string;
|
|
59
|
+
key: string;
|
|
60
|
+
app_key: string;
|
|
61
|
+
action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
|
|
62
|
+
title: string;
|
|
63
|
+
type: "action";
|
|
64
|
+
id?: string | undefined;
|
|
65
|
+
is_important?: boolean | undefined;
|
|
66
|
+
is_hidden?: boolean | undefined;
|
|
67
|
+
app_version?: string | undefined;
|
|
68
|
+
};
|
|
69
|
+
}>;
|
|
70
|
+
} & {
|
|
71
|
+
context: {
|
|
72
|
+
meta: {
|
|
73
|
+
getAction: import("../..").PluginMeta;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
export type GetActionPluginProvides = ReturnType<typeof getActionPlugin>;
|
|
25
78
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAiB3C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAHjB;QAAE,GAAG,EAAE,SAAS,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6C5B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -1,49 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { definePlugin } from "../../utils/plugin-utils";
|
|
2
|
+
import { createPluginMethod } from "../../utils/plugin-utils";
|
|
3
|
+
import { GetActionInputSchema } from "./schemas";
|
|
2
4
|
import { ZapierResourceNotFoundError } from "../../types/errors";
|
|
3
|
-
import { createFunction } from "../../utils/function-utils";
|
|
4
5
|
import { appKeyResolver, actionTypeResolver, actionKeyResolver, } from "../../resolvers";
|
|
5
6
|
import { ActionItemSchema } from "../../schemas/Action";
|
|
6
|
-
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
7
7
|
import { setMethodMetadata } from "../../utils/telemetry-context";
|
|
8
|
-
export const getActionPlugin = (sdk) => {
|
|
9
|
-
|
|
8
|
+
export const getActionPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
9
|
+
name: "getAction",
|
|
10
|
+
categories: ["action"],
|
|
11
|
+
type: "item",
|
|
12
|
+
itemType: "Action",
|
|
13
|
+
inputSchema: GetActionInputSchema,
|
|
14
|
+
outputSchema: ActionItemSchema,
|
|
15
|
+
resolvers: {
|
|
16
|
+
app: appKeyResolver,
|
|
17
|
+
actionType: actionTypeResolver,
|
|
18
|
+
action: actionKeyResolver,
|
|
19
|
+
},
|
|
20
|
+
handler: async ({ sdk, options }) => {
|
|
10
21
|
const appKey = "app" in options ? options.app : options.appKey;
|
|
11
22
|
const actionKey = "action" in options ? options.action : options.actionKey;
|
|
12
23
|
const { actionType } = options;
|
|
13
|
-
// selectedApi is intentionally omitted — getAction doesn't resolve a
|
|
14
|
-
// implementation ID; it delegates to sdk.listActions, which
|
|
24
|
+
// selectedApi is intentionally omitted — getAction doesn't resolve a
|
|
25
|
+
// versioned implementation ID; it delegates to sdk.listActions, which
|
|
26
|
+
// sets selectedApi in its own scope.
|
|
15
27
|
setMethodMetadata({
|
|
16
28
|
operationType: actionType,
|
|
17
29
|
operationKey: actionKey,
|
|
18
30
|
});
|
|
19
|
-
// Use the listActions function from the SDK to search for the specific action across all pages
|
|
20
31
|
for await (const action of sdk.listActions({ app: appKey }).items()) {
|
|
21
32
|
if ((action.key === actionKey || action.id === actionKey) &&
|
|
22
33
|
action.action_type === actionType) {
|
|
23
34
|
return { data: action };
|
|
24
35
|
}
|
|
25
36
|
}
|
|
26
|
-
// If we get here, action was not found
|
|
27
37
|
throw new ZapierResourceNotFoundError(`Action not found: ${actionKey} with type ${actionType}`, { resourceType: "Action", resourceId: `${actionKey} (${actionType})` });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
getAction: getActionDefinition,
|
|
32
|
-
context: {
|
|
33
|
-
meta: {
|
|
34
|
-
getAction: {
|
|
35
|
-
categories: ["action"],
|
|
36
|
-
type: "item",
|
|
37
|
-
itemType: "Action",
|
|
38
|
-
inputSchema: GetActionSchema,
|
|
39
|
-
outputSchema: ActionItemSchema,
|
|
40
|
-
resolvers: {
|
|
41
|
-
app: appKeyResolver,
|
|
42
|
-
actionType: actionTypeResolver,
|
|
43
|
-
action: actionKeyResolver,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
};
|
|
38
|
+
},
|
|
39
|
+
}));
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { ActionItem } from "../../types/domain";
|
|
3
|
-
import type { ZapierAuthenticationError, ZapierApiError, ZapierAppNotFoundError, ZapierValidationError, ZapierResourceNotFoundError, ZapierUnknownError } from "../../types/errors";
|
|
4
3
|
export declare const GetActionSchema: z.ZodObject<{
|
|
5
4
|
app: z.ZodString & {
|
|
6
5
|
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
7
6
|
};
|
|
8
7
|
actionType: z.ZodEnum<{
|
|
9
|
-
search: "search";
|
|
10
8
|
filter: "filter";
|
|
11
9
|
read: "read";
|
|
12
10
|
read_bulk: "read_bulk";
|
|
13
11
|
run: "run";
|
|
12
|
+
search: "search";
|
|
14
13
|
search_and_write: "search_and_write";
|
|
15
14
|
search_or_write: "search_or_write";
|
|
16
15
|
write: "write";
|
|
@@ -24,11 +23,11 @@ declare const GetActionSchemaDeprecated: z.ZodObject<{
|
|
|
24
23
|
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
25
24
|
};
|
|
26
25
|
actionType: z.ZodEnum<{
|
|
27
|
-
search: "search";
|
|
28
26
|
filter: "filter";
|
|
29
27
|
read: "read";
|
|
30
28
|
read_bulk: "read_bulk";
|
|
31
29
|
run: "run";
|
|
30
|
+
search: "search";
|
|
32
31
|
search_and_write: "search_and_write";
|
|
33
32
|
search_or_write: "search_or_write";
|
|
34
33
|
write: "write";
|
|
@@ -40,11 +39,11 @@ export declare const GetActionInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
40
39
|
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
41
40
|
};
|
|
42
41
|
actionType: z.ZodEnum<{
|
|
43
|
-
search: "search";
|
|
44
42
|
filter: "filter";
|
|
45
43
|
read: "read";
|
|
46
44
|
read_bulk: "read_bulk";
|
|
47
45
|
run: "run";
|
|
46
|
+
search: "search";
|
|
48
47
|
search_and_write: "search_and_write";
|
|
49
48
|
search_or_write: "search_or_write";
|
|
50
49
|
write: "write";
|
|
@@ -57,11 +56,11 @@ export declare const GetActionInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
57
56
|
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
58
57
|
};
|
|
59
58
|
actionType: z.ZodEnum<{
|
|
60
|
-
search: "search";
|
|
61
59
|
filter: "filter";
|
|
62
60
|
read: "read";
|
|
63
61
|
read_bulk: "read_bulk";
|
|
64
62
|
run: "run";
|
|
63
|
+
search: "search";
|
|
65
64
|
search_and_write: "search_and_write";
|
|
66
65
|
search_or_write: "search_or_write";
|
|
67
66
|
write: "write";
|
|
@@ -74,7 +73,6 @@ export type GetActionOptions = z.infer<typeof GetActionSchema> | (Omit<z.infer<t
|
|
|
74
73
|
/** @deprecated Use `action` instead. */
|
|
75
74
|
actionKey: z.infer<typeof GetActionSchemaDeprecated>["actionKey"];
|
|
76
75
|
});
|
|
77
|
-
export type GetActionError = ZapierAuthenticationError | ZapierApiError | ZapierAppNotFoundError | ZapierValidationError | ZapierResourceNotFoundError | ZapierUnknownError;
|
|
78
76
|
export interface GetActionSdkFunction {
|
|
79
77
|
getAction: (options: GetActionOptions) => Promise<{
|
|
80
78
|
data: ActionItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;iBAOgC,CAAC;AAG7D,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;iBAI7B,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEA,CAAC;AAGlC,MAAM,MAAM,gBAAgB,GACxB,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,GAC/B,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG;IACzE,qCAAqC;IACrC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC5D,wCAAwC;IACxC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC,WAAW,CAAC,CAAC;CACnE,CAAC,CAAC;AAGP,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;CACzE"}
|
|
@@ -1,20 +1,146 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
export declare const getAppPlugin: (sdk: {
|
|
2
|
+
listApps: (options?: ({
|
|
3
|
+
search?: string | undefined;
|
|
4
|
+
apps?: string[] | undefined;
|
|
5
|
+
appKeys?: string[] | undefined;
|
|
6
|
+
pageSize?: number | undefined;
|
|
7
|
+
maxItems?: number | undefined;
|
|
8
|
+
cursor?: string | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
cursor?: string;
|
|
11
|
+
pageSize?: number;
|
|
12
|
+
maxItems?: number;
|
|
13
|
+
}) | undefined) => import("../..").PaginatedSdkResult<{
|
|
14
|
+
slug: string;
|
|
15
|
+
title: string;
|
|
16
|
+
key: string;
|
|
17
|
+
implementation_id: string;
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
is_hidden?: boolean | undefined;
|
|
20
|
+
auth_type?: string | undefined;
|
|
21
|
+
actions?: {
|
|
22
|
+
read?: number | undefined;
|
|
23
|
+
read_bulk?: number | undefined;
|
|
24
|
+
write?: number | undefined;
|
|
25
|
+
search?: number | undefined;
|
|
26
|
+
search_or_write?: number | undefined;
|
|
27
|
+
search_and_write?: number | undefined;
|
|
28
|
+
filter?: number | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
is_deprecated?: boolean | undefined;
|
|
31
|
+
is_beta?: boolean | undefined;
|
|
32
|
+
is_premium?: boolean | undefined;
|
|
33
|
+
age_in_days?: number | undefined;
|
|
34
|
+
banner?: string | undefined;
|
|
35
|
+
categories?: {
|
|
36
|
+
id: number;
|
|
37
|
+
name: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
}[] | undefined;
|
|
40
|
+
images?: {
|
|
41
|
+
url_16x16?: string | undefined;
|
|
42
|
+
url_32x32?: string | undefined;
|
|
43
|
+
url_64x64?: string | undefined;
|
|
44
|
+
url_128x128?: string | undefined;
|
|
45
|
+
} | undefined;
|
|
46
|
+
popularity?: number | undefined;
|
|
47
|
+
has_filters?: boolean | undefined;
|
|
48
|
+
has_reads?: boolean | undefined;
|
|
49
|
+
has_searches?: boolean | undefined;
|
|
50
|
+
has_searches_or_writes?: boolean | undefined;
|
|
51
|
+
has_upfront_fields?: boolean | undefined;
|
|
52
|
+
has_writes?: boolean | undefined;
|
|
53
|
+
is_built_in?: boolean | undefined;
|
|
54
|
+
is_featured?: boolean | undefined;
|
|
55
|
+
is_invite?: boolean | undefined;
|
|
56
|
+
is_public?: boolean | undefined;
|
|
57
|
+
is_upcoming?: boolean | undefined;
|
|
58
|
+
visibility?: string | undefined;
|
|
59
|
+
primary_color?: string | undefined;
|
|
60
|
+
secondary_color?: string | undefined;
|
|
61
|
+
classification?: string | undefined;
|
|
62
|
+
api_docs_url?: string | undefined;
|
|
63
|
+
image?: string | undefined;
|
|
64
|
+
version?: string | undefined;
|
|
10
65
|
}>;
|
|
66
|
+
} & {
|
|
11
67
|
context: {
|
|
12
68
|
meta: {
|
|
13
|
-
|
|
14
|
-
inputSchema: typeof GetAppSchema;
|
|
15
|
-
};
|
|
69
|
+
listApps: import("../..").PluginMeta;
|
|
16
70
|
};
|
|
17
71
|
};
|
|
18
|
-
}
|
|
19
|
-
|
|
72
|
+
} & {
|
|
73
|
+
context: import("../eventEmission").EventEmissionContext;
|
|
74
|
+
} & {
|
|
75
|
+
context: {
|
|
76
|
+
meta: Record<string, import("../..").PluginMeta>;
|
|
77
|
+
};
|
|
78
|
+
}) => {
|
|
79
|
+
getApp: (options?: {
|
|
80
|
+
app: string;
|
|
81
|
+
} | {
|
|
82
|
+
appKey: string;
|
|
83
|
+
} | undefined) => Promise<{
|
|
84
|
+
data: {
|
|
85
|
+
slug: string;
|
|
86
|
+
title: string;
|
|
87
|
+
key: string;
|
|
88
|
+
implementation_id: string;
|
|
89
|
+
description?: string | undefined;
|
|
90
|
+
is_hidden?: boolean | undefined;
|
|
91
|
+
auth_type?: string | undefined;
|
|
92
|
+
actions?: {
|
|
93
|
+
read?: number | undefined;
|
|
94
|
+
read_bulk?: number | undefined;
|
|
95
|
+
write?: number | undefined;
|
|
96
|
+
search?: number | undefined;
|
|
97
|
+
search_or_write?: number | undefined;
|
|
98
|
+
search_and_write?: number | undefined;
|
|
99
|
+
filter?: number | undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
is_deprecated?: boolean | undefined;
|
|
102
|
+
is_beta?: boolean | undefined;
|
|
103
|
+
is_premium?: boolean | undefined;
|
|
104
|
+
age_in_days?: number | undefined;
|
|
105
|
+
banner?: string | undefined;
|
|
106
|
+
categories?: {
|
|
107
|
+
id: number;
|
|
108
|
+
name: string;
|
|
109
|
+
slug: string;
|
|
110
|
+
}[] | undefined;
|
|
111
|
+
images?: {
|
|
112
|
+
url_16x16?: string | undefined;
|
|
113
|
+
url_32x32?: string | undefined;
|
|
114
|
+
url_64x64?: string | undefined;
|
|
115
|
+
url_128x128?: string | undefined;
|
|
116
|
+
} | undefined;
|
|
117
|
+
popularity?: number | undefined;
|
|
118
|
+
has_filters?: boolean | undefined;
|
|
119
|
+
has_reads?: boolean | undefined;
|
|
120
|
+
has_searches?: boolean | undefined;
|
|
121
|
+
has_searches_or_writes?: boolean | undefined;
|
|
122
|
+
has_upfront_fields?: boolean | undefined;
|
|
123
|
+
has_writes?: boolean | undefined;
|
|
124
|
+
is_built_in?: boolean | undefined;
|
|
125
|
+
is_featured?: boolean | undefined;
|
|
126
|
+
is_invite?: boolean | undefined;
|
|
127
|
+
is_public?: boolean | undefined;
|
|
128
|
+
is_upcoming?: boolean | undefined;
|
|
129
|
+
visibility?: string | undefined;
|
|
130
|
+
primary_color?: string | undefined;
|
|
131
|
+
secondary_color?: string | undefined;
|
|
132
|
+
classification?: string | undefined;
|
|
133
|
+
api_docs_url?: string | undefined;
|
|
134
|
+
image?: string | undefined;
|
|
135
|
+
version?: string | undefined;
|
|
136
|
+
};
|
|
137
|
+
}>;
|
|
138
|
+
} & {
|
|
139
|
+
context: {
|
|
140
|
+
meta: {
|
|
141
|
+
getApp: import("../..").PluginMeta;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
export type GetAppPluginProvides = ReturnType<typeof getAppPlugin>;
|
|
20
146
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBxB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -1,44 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { definePlugin, createPluginMethod } from "../../utils/plugin-utils";
|
|
2
|
+
import { GetAppInputSchema } from "./schemas";
|
|
3
3
|
import { AppItemSchema } from "../../schemas/App";
|
|
4
4
|
import { ZapierAppNotFoundError } from "../../types/errors";
|
|
5
5
|
import { appKeyResolver } from "../../resolvers";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export const getAppPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
7
|
+
name: "getApp",
|
|
8
|
+
categories: ["app"],
|
|
9
|
+
type: "item",
|
|
10
|
+
itemType: "App",
|
|
11
|
+
inputSchema: GetAppInputSchema,
|
|
12
|
+
outputSchema: AppItemSchema,
|
|
13
|
+
resolvers: { app: appKeyResolver },
|
|
14
|
+
handler: async ({ sdk, options }) => {
|
|
10
15
|
const appKey = "app" in options ? options.app : options.appKey;
|
|
11
|
-
const appsIterable = sdk
|
|
12
|
-
.listApps({
|
|
13
|
-
apps: [appKey],
|
|
14
|
-
})
|
|
15
|
-
.items();
|
|
16
|
+
const appsIterable = sdk.listApps({ apps: [appKey] }).items();
|
|
16
17
|
for await (const app of appsIterable) {
|
|
17
|
-
return {
|
|
18
|
-
data: app,
|
|
19
|
-
};
|
|
18
|
+
return { data: app };
|
|
20
19
|
}
|
|
21
|
-
throw new ZapierAppNotFoundError("App not found", {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
const getAppDefinition = createFunction(getApp, GetAppInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, getApp.name));
|
|
26
|
-
// Return flat structure - getApp goes directly to SDK
|
|
27
|
-
return {
|
|
28
|
-
getApp: getAppDefinition,
|
|
29
|
-
context: {
|
|
30
|
-
meta: {
|
|
31
|
-
getApp: {
|
|
32
|
-
categories: ["app"],
|
|
33
|
-
type: "item",
|
|
34
|
-
itemType: "App",
|
|
35
|
-
inputSchema: GetAppSchema,
|
|
36
|
-
outputSchema: AppItemSchema,
|
|
37
|
-
resolvers: {
|
|
38
|
-
app: appKeyResolver,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
};
|
|
20
|
+
throw new ZapierAppNotFoundError("App not found", { appKey });
|
|
21
|
+
},
|
|
22
|
+
}));
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { AppItem } from "../../types/domain";
|
|
3
|
-
import type { ZapierApiError, ZapierAppNotFoundError, ZapierValidationError } from "../../types/errors";
|
|
4
|
-
export type GetAppError = ZapierAppNotFoundError | ZapierApiError | ZapierValidationError;
|
|
5
3
|
export declare const GetAppSchema: z.ZodObject<{
|
|
6
4
|
app: z.ZodString & {
|
|
7
5
|
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAKlD,eAAO,MAAM,YAAY;;;;iBAKc,CAAC;AAGxC,QAAA,MAAM,sBAAsB;;;;iBAE1B,CAAC;AAGH,eAAO,MAAM,iBAAiB;;;;;;;;mBAEA,CAAC;AAG/B,MAAM,MAAM,aAAa,GACrB,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,GAC5B,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,EAAE,QAAQ,CAAC,GAAG;IACxD,qCAAqC;IACrC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC1D,CAAC,CAAC;AAGP,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAChE"}
|
|
@@ -1,22 +1,56 @@
|
|
|
1
|
-
import type { Plugin } from "../../types/plugin";
|
|
2
1
|
import type { ApiClient } from "../../api";
|
|
3
|
-
|
|
4
|
-
import type { GetConnectionResponse } from "@zapier/zapier-sdk-core/v0/schemas/connections";
|
|
5
|
-
import { GetConnectionParamSchema, type GetConnectionParam } from "./schemas";
|
|
6
|
-
export interface GetConnectionPluginProvides {
|
|
7
|
-
getConnection: (options: GetConnectionParam) => Promise<GetConnectionResponse>;
|
|
2
|
+
export declare const getConnectionPlugin: (sdk: {
|
|
8
3
|
context: {
|
|
9
|
-
|
|
10
|
-
getConnection: {
|
|
11
|
-
inputSchema: typeof GetConnectionParamSchema;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
4
|
+
api: ApiClient;
|
|
14
5
|
};
|
|
15
|
-
}
|
|
16
|
-
|
|
6
|
+
} & {
|
|
7
|
+
context: import("../eventEmission").EventEmissionContext;
|
|
8
|
+
} & {
|
|
17
9
|
context: {
|
|
18
|
-
|
|
10
|
+
meta: Record<string, import("../..").PluginMeta>;
|
|
11
|
+
};
|
|
12
|
+
}) => {
|
|
13
|
+
getConnection: (options?: {
|
|
14
|
+
connection?: string | number | undefined;
|
|
15
|
+
connectionId?: string | number | undefined;
|
|
16
|
+
authenticationId?: string | number | undefined;
|
|
17
|
+
} | undefined) => Promise<{
|
|
18
|
+
data: {
|
|
19
|
+
date: string;
|
|
20
|
+
is_invite_only: boolean;
|
|
21
|
+
is_private: boolean;
|
|
22
|
+
shared_with_all: boolean;
|
|
23
|
+
id: string;
|
|
24
|
+
account_id: string;
|
|
25
|
+
title?: string | null | undefined;
|
|
26
|
+
lastchanged?: string | undefined;
|
|
27
|
+
destination_selected_api?: string | null | undefined;
|
|
28
|
+
is_stale?: string | undefined;
|
|
29
|
+
is_shared?: string | undefined;
|
|
30
|
+
marked_stale_at?: string | null | undefined;
|
|
31
|
+
label?: string | null | undefined;
|
|
32
|
+
identifier?: string | null | undefined;
|
|
33
|
+
url?: string | undefined;
|
|
34
|
+
groups?: Record<string, unknown>[] | undefined;
|
|
35
|
+
members?: string | undefined;
|
|
36
|
+
permissions?: Record<string, boolean> | undefined;
|
|
37
|
+
public_id?: string | undefined;
|
|
38
|
+
account_public_id?: string | undefined;
|
|
39
|
+
customuser_public_id?: string | undefined;
|
|
40
|
+
implementation_id?: string | undefined;
|
|
41
|
+
profile_id?: string | undefined;
|
|
42
|
+
is_expired?: string | undefined;
|
|
43
|
+
expired_at?: string | null | undefined;
|
|
44
|
+
app_key?: string | undefined;
|
|
45
|
+
app_version?: string | undefined;
|
|
46
|
+
};
|
|
47
|
+
}>;
|
|
48
|
+
} & {
|
|
49
|
+
context: {
|
|
50
|
+
meta: {
|
|
51
|
+
getConnection: import("../..").PluginMeta;
|
|
52
|
+
};
|
|
19
53
|
};
|
|
20
|
-
}
|
|
21
|
-
GetConnectionPluginProvides>;
|
|
54
|
+
};
|
|
55
|
+
export type GetConnectionPluginProvides = ReturnType<typeof getConnectionPlugin>;
|
|
22
56
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getConnection/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getConnection/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAQ3C,eAAO,MAAM,mBAAmB;aACb;QAAE,GAAG,EAAE,SAAS,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCpC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,UAAU,CAClD,OAAO,mBAAmB,CAC3B,CAAC"}
|