@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,28 +1,106 @@
|
|
|
1
|
-
import type { Plugin } from "../../types/plugin";
|
|
2
1
|
import type { ApiClient } from "../../api";
|
|
3
|
-
import type { ConnectionItem } from "@zapier/zapier-sdk-core/v0/schemas/connections";
|
|
4
|
-
import { ListConnectionsQuerySchema, type ListConnectionsOptions, type ListConnectionsPage } from "./schemas";
|
|
5
2
|
import type { GetVersionedImplementationId } from "../manifest/schemas";
|
|
6
|
-
import type { ManifestPluginProvides } from "../manifest";
|
|
7
|
-
import type { EventEmissionProvides } from "../eventEmission";
|
|
8
3
|
import type { CapabilitiesContext } from "../capabilities";
|
|
9
4
|
import type { ConnectionsPluginProvides } from "../connections";
|
|
10
|
-
export
|
|
11
|
-
listConnections: (options?: ListConnectionsOptions) => Promise<ListConnectionsPage> & AsyncIterable<ListConnectionsPage> & {
|
|
12
|
-
items(): AsyncIterable<ConnectionItem>;
|
|
13
|
-
};
|
|
5
|
+
export declare const listConnectionsPlugin: (sdk: {
|
|
14
6
|
context: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
7
|
+
getResolvedManifest: () => Promise<import("../manifest").Manifest | null>;
|
|
8
|
+
getVersionedImplementationId: (appKey: string) => Promise<string | null>;
|
|
9
|
+
resolveAppKeys: ({ appKeys }: {
|
|
10
|
+
appKeys: string[];
|
|
11
|
+
}) => Promise<import("../..").ResolvedAppLocator[]>;
|
|
12
|
+
updateManifestEntry: (options: import("../manifest").UpdateManifestEntryOptions) => Promise<import("../manifest").UpdateManifestEntryResult>;
|
|
13
|
+
addActionEntry: (options: import("../manifest").AddActionEntryOptions) => Promise<import("../manifest").AddActionEntryResult>;
|
|
14
|
+
findActionEntry: ({ name, manifest, }: {
|
|
15
|
+
name: string;
|
|
16
|
+
manifest: import("../manifest").Manifest;
|
|
17
|
+
}) => import("../manifest").ActionEntry | null;
|
|
18
|
+
listActionEntries: ({ configPath, }?: {
|
|
19
|
+
configPath?: string;
|
|
20
|
+
}) => Promise<Array<[string, import("../manifest").ActionEntry]>>;
|
|
21
|
+
deleteActionEntry: ({ name, configPath, skipWrite, }: {
|
|
22
|
+
name: string;
|
|
23
|
+
configPath?: string;
|
|
24
|
+
skipWrite?: boolean;
|
|
25
|
+
}) => Promise<import("../manifest").Manifest>;
|
|
26
|
+
hasActionEntry: ({ name, manifest, }: {
|
|
27
|
+
name: string;
|
|
28
|
+
manifest: import("../manifest").Manifest;
|
|
29
|
+
}) => boolean;
|
|
30
|
+
findManifestEntry: typeof import("../manifest").findManifestEntry;
|
|
31
|
+
readManifestFromFile: typeof import("../manifest").readManifestFromFile;
|
|
32
|
+
getManifestConnections: () => Promise<Record<string, {
|
|
33
|
+
connectionId: string | number;
|
|
34
|
+
}> | null>;
|
|
20
35
|
};
|
|
21
|
-
}
|
|
22
|
-
export declare const listConnectionsPlugin: Plugin<ManifestPluginProvides & {
|
|
36
|
+
} & {
|
|
23
37
|
context: {
|
|
24
38
|
api: ApiClient;
|
|
25
39
|
getVersionedImplementationId: GetVersionedImplementationId;
|
|
26
40
|
} & CapabilitiesContext & ConnectionsPluginProvides["context"];
|
|
27
|
-
} &
|
|
41
|
+
} & {
|
|
42
|
+
context: import("../eventEmission").EventEmissionContext;
|
|
43
|
+
} & {
|
|
44
|
+
context: {
|
|
45
|
+
meta: Record<string, import("../..").PluginMeta>;
|
|
46
|
+
};
|
|
47
|
+
}) => {
|
|
48
|
+
listConnections: (options?: ({
|
|
49
|
+
title?: string | undefined;
|
|
50
|
+
search?: string | undefined;
|
|
51
|
+
owner?: string | undefined;
|
|
52
|
+
app?: string | undefined;
|
|
53
|
+
appKey?: string | undefined;
|
|
54
|
+
connections?: string[] | undefined;
|
|
55
|
+
connectionIds?: string[] | undefined;
|
|
56
|
+
authenticationIds?: string[] | undefined;
|
|
57
|
+
account?: string | undefined;
|
|
58
|
+
accountId?: string | undefined;
|
|
59
|
+
includeShared?: boolean | undefined;
|
|
60
|
+
isExpired?: boolean | undefined;
|
|
61
|
+
expired?: boolean | undefined;
|
|
62
|
+
pageSize?: number | undefined;
|
|
63
|
+
maxItems?: number | undefined;
|
|
64
|
+
cursor?: string | undefined;
|
|
65
|
+
} & {
|
|
66
|
+
cursor?: string;
|
|
67
|
+
pageSize?: number;
|
|
68
|
+
maxItems?: number;
|
|
69
|
+
}) | undefined) => import("../..").PaginatedSdkResult<{
|
|
70
|
+
date: string;
|
|
71
|
+
is_invite_only: boolean;
|
|
72
|
+
is_private: boolean;
|
|
73
|
+
shared_with_all: boolean;
|
|
74
|
+
id: string;
|
|
75
|
+
account_id: string;
|
|
76
|
+
title?: string | null | undefined;
|
|
77
|
+
lastchanged?: string | undefined;
|
|
78
|
+
destination_selected_api?: string | null | undefined;
|
|
79
|
+
is_stale?: string | undefined;
|
|
80
|
+
is_shared?: string | undefined;
|
|
81
|
+
marked_stale_at?: string | null | undefined;
|
|
82
|
+
label?: string | null | undefined;
|
|
83
|
+
identifier?: string | null | undefined;
|
|
84
|
+
url?: string | undefined;
|
|
85
|
+
groups?: Record<string, unknown>[] | undefined;
|
|
86
|
+
members?: string | undefined;
|
|
87
|
+
permissions?: Record<string, boolean> | undefined;
|
|
88
|
+
public_id?: string | undefined;
|
|
89
|
+
account_public_id?: string | undefined;
|
|
90
|
+
customuser_public_id?: string | undefined;
|
|
91
|
+
implementation_id?: string | undefined;
|
|
92
|
+
profile_id?: string | undefined;
|
|
93
|
+
is_expired?: string | undefined;
|
|
94
|
+
expired_at?: string | null | undefined;
|
|
95
|
+
app_key?: string | undefined;
|
|
96
|
+
app_version?: string | undefined;
|
|
97
|
+
}>;
|
|
98
|
+
} & {
|
|
99
|
+
context: {
|
|
100
|
+
meta: {
|
|
101
|
+
listConnections: import("../..").PluginMeta;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export type ListConnectionsPluginProvides = ReturnType<typeof listConnectionsPlugin>;
|
|
28
106
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listConnections/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listConnections/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAU3C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAOxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;sBAkHqpS,CAAC;;;;sBAAiX,CAAC;qBAAyB,CAAC;;;;;;;;;;;;;aA/GrjT;QACP,GAAG,EAAE,SAAS,CAAC;QACf,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,mBAAmB,GACrB,yBAAyB,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsG3C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,UAAU,CACpD,OAAO,qBAAqB,CAC7B,CAAC"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { definePlugin } from "../../utils/plugin-utils";
|
|
2
|
+
import { createPaginatedPluginMethod } from "../../utils/plugin-utils";
|
|
3
|
+
import { ListConnectionsQuerySchema } from "./schemas";
|
|
2
4
|
import { splitVersionedKey, resolveConnectionId, transformConnectionItem, } from "../../utils/domain-utils";
|
|
3
|
-
import {
|
|
5
|
+
import { extractCursor } from "../../utils/function-utils";
|
|
4
6
|
import { DEFAULT_PAGE_SIZE } from "../../constants";
|
|
5
7
|
import { appKeyResolver } from "../../resolvers";
|
|
6
8
|
import { ConnectionItemSchema } from "../../schemas/Connection";
|
|
7
|
-
import {
|
|
8
|
-
import { stripPageSuffix } from "../../utils/string-utils";
|
|
9
|
-
import { ZapierAuthenticationError, ZapierValidationError, } from "../../types/errors";
|
|
9
|
+
import { ZapierValidationError } from "../../types/errors";
|
|
10
10
|
import { setMethodMetadata } from "../../utils/telemetry-context";
|
|
11
|
-
export const listConnectionsPlugin = (sdk) => {
|
|
12
|
-
|
|
11
|
+
export const listConnectionsPlugin = definePlugin((sdk) => createPaginatedPluginMethod(sdk, {
|
|
12
|
+
name: "listConnections",
|
|
13
|
+
categories: ["connection"],
|
|
14
|
+
type: "list",
|
|
15
|
+
itemType: "Connection",
|
|
16
|
+
inputSchema: ListConnectionsQuerySchema,
|
|
17
|
+
outputSchema: ConnectionItemSchema,
|
|
18
|
+
defaultPageSize: DEFAULT_PAGE_SIZE,
|
|
19
|
+
resolvers: { app: appKeyResolver },
|
|
20
|
+
handler: async ({ sdk, options }) => {
|
|
13
21
|
if (options.includeShared) {
|
|
14
22
|
await sdk.context.checkCapability("canIncludeSharedConnections");
|
|
15
23
|
}
|
|
@@ -18,13 +26,11 @@ export const listConnectionsPlugin = (sdk) => {
|
|
|
18
26
|
if (options.pageSize !== undefined) {
|
|
19
27
|
searchParams.page_size = options.pageSize.toString();
|
|
20
28
|
}
|
|
21
|
-
// Resolve app/appKey to implementationId if provided
|
|
22
29
|
const appKey = options.app ?? options.appKey;
|
|
23
30
|
if (appKey) {
|
|
24
31
|
const implementationId = await getVersionedImplementationId(appKey);
|
|
25
32
|
if (implementationId) {
|
|
26
33
|
setMethodMetadata({ selectedApi: implementationId });
|
|
27
|
-
// Extract versionless app key to pass to handler
|
|
28
34
|
const [versionlessSelectedApi] = splitVersionedKey(implementationId);
|
|
29
35
|
searchParams.app_key = versionlessSelectedApi;
|
|
30
36
|
}
|
|
@@ -33,10 +39,9 @@ export const listConnectionsPlugin = (sdk) => {
|
|
|
33
39
|
searchParams.app_key = appKey;
|
|
34
40
|
}
|
|
35
41
|
}
|
|
36
|
-
// Resolve connection references (names from map, or direct IDs)
|
|
37
|
-
//
|
|
38
|
-
// -
|
|
39
|
-
// - connectionIds/authenticationIds: use directly (legacy behavior)
|
|
42
|
+
// Resolve connection references (names from map, or direct IDs).
|
|
43
|
+
// - connections: resolve names from map, fall back to direct IDs.
|
|
44
|
+
// - connectionIds/authenticationIds: use directly (legacy).
|
|
40
45
|
const connectionRefs = options.connections;
|
|
41
46
|
const legacyConnectionIds = options.connectionIds ?? options.authenticationIds;
|
|
42
47
|
if (connectionRefs && connectionRefs.length > 0) {
|
|
@@ -68,8 +73,9 @@ export const listConnectionsPlugin = (sdk) => {
|
|
|
68
73
|
if (owner) {
|
|
69
74
|
searchParams.owner = owner;
|
|
70
75
|
}
|
|
71
|
-
// isExpired takes priority when explicitly set. Otherwise expired
|
|
72
|
-
//
|
|
76
|
+
// isExpired takes priority when explicitly set. Otherwise expired
|
|
77
|
+
// defaults to false: only non-expired connections returned unless
|
|
78
|
+
// caller opts in.
|
|
73
79
|
if (options.isExpired !== undefined) {
|
|
74
80
|
searchParams.is_expired = options.isExpired.toString();
|
|
75
81
|
}
|
|
@@ -79,41 +85,11 @@ export const listConnectionsPlugin = (sdk) => {
|
|
|
79
85
|
if (options.cursor) {
|
|
80
86
|
searchParams.offset = options.cursor;
|
|
81
87
|
}
|
|
82
|
-
const response = await api.get("/api/v0/connections", {
|
|
83
|
-
searchParams,
|
|
84
|
-
customErrorHandler: ({ status }) => {
|
|
85
|
-
if (status === 401) {
|
|
86
|
-
return new ZapierAuthenticationError(`Authentication failed. Your token may not have permission to access connections or may be expired. (HTTP ${status})`, { statusCode: status });
|
|
87
|
-
}
|
|
88
|
-
if (status === 403) {
|
|
89
|
-
return new ZapierAuthenticationError(`Access forbidden. Your token may not have the required scopes to list connections. (HTTP ${status})`, { statusCode: status });
|
|
90
|
-
}
|
|
91
|
-
return undefined;
|
|
92
|
-
},
|
|
93
|
-
authRequired: true,
|
|
94
|
-
});
|
|
88
|
+
const response = await api.get("/api/v0/connections", { searchParams, authRequired: true });
|
|
95
89
|
return {
|
|
96
90
|
...response,
|
|
97
91
|
data: response.data.map(transformConnectionItem),
|
|
98
92
|
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return {
|
|
103
|
-
listConnections: listConnectionsDefinition,
|
|
104
|
-
context: {
|
|
105
|
-
meta: {
|
|
106
|
-
listConnections: {
|
|
107
|
-
categories: ["connection"],
|
|
108
|
-
type: "list",
|
|
109
|
-
itemType: "Connection",
|
|
110
|
-
inputSchema: ListConnectionsQuerySchema,
|
|
111
|
-
outputSchema: ConnectionItemSchema,
|
|
112
|
-
resolvers: {
|
|
113
|
-
app: appKeyResolver,
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
};
|
|
93
|
+
},
|
|
94
|
+
extractCursor: (response) => extractCursor(response.links),
|
|
95
|
+
}));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { PaginatedSdkFunction } from "../../types/functions";
|
|
3
3
|
import type { ConnectionItem } from "@zapier/zapier-sdk-core/v0/schemas/connections";
|
|
4
|
-
import type { ZapierAuthenticationError, ZapierApiError, ZapierAppNotFoundError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
|
|
5
4
|
export declare const ListConnectionsQuerySchema: z.ZodObject<{
|
|
6
5
|
title: z.ZodOptional<z.ZodString>;
|
|
7
6
|
search: z.ZodOptional<z.ZodString>;
|
|
@@ -29,7 +28,6 @@ export interface ListConnectionsPage {
|
|
|
29
28
|
data: ConnectionItem[];
|
|
30
29
|
nextCursor?: string;
|
|
31
30
|
}
|
|
32
|
-
export type ListConnectionsError = ZapierAuthenticationError | ZapierApiError | ZapierAppNotFoundError | ZapierValidationError | ZapierUnknownError;
|
|
33
31
|
export interface ListConnectionsSdkFunction {
|
|
34
32
|
listConnections: PaginatedSdkFunction<ListConnectionsOptions, ConnectionItem>;
|
|
35
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listConnections/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAErF,
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listConnections/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAErF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;iBAoF0B,CAAC;AAGlE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAGhF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,0BAA0B;IACzC,eAAe,EAAE,oBAAoB,CAAC,sBAAsB,EAAE,cAAc,CAAC,CAAC;CAC/E"}
|
|
@@ -1,34 +1,89 @@
|
|
|
1
|
-
import type { Plugin } from "../../types/plugin";
|
|
2
1
|
import type { ApiClient } from "../../api";
|
|
3
|
-
import type { InputFieldChoiceItem } from "./schemas";
|
|
4
|
-
import { ListInputFieldChoicesSchema, type ListInputFieldChoicesOptions } from "./schemas";
|
|
5
|
-
import type { GetActionPluginProvides } from "../getAction";
|
|
6
2
|
import type { GetVersionedImplementationId } from "../manifest/schemas";
|
|
7
|
-
import type { EventEmissionProvides } from "../eventEmission";
|
|
8
3
|
import type { ConnectionsPluginProvides } from "../connections";
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
4
|
+
export declare const listInputFieldChoicesPlugin: (sdk: {
|
|
5
|
+
getAction: (options?: {
|
|
6
|
+
app: string;
|
|
7
|
+
actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
|
|
8
|
+
action: string;
|
|
9
|
+
} | {
|
|
10
|
+
appKey: string;
|
|
11
|
+
actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
|
|
12
|
+
actionKey: string;
|
|
13
|
+
} | undefined) => Promise<{
|
|
14
|
+
data: {
|
|
15
|
+
description: string;
|
|
16
|
+
key: string;
|
|
17
|
+
app_key: string;
|
|
18
|
+
action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
|
|
19
|
+
title: string;
|
|
20
|
+
type: "action";
|
|
21
|
+
id?: string | undefined;
|
|
22
|
+
is_important?: boolean | undefined;
|
|
23
|
+
is_hidden?: boolean | undefined;
|
|
24
|
+
app_version?: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
}>;
|
|
27
|
+
} & {
|
|
19
28
|
context: {
|
|
20
29
|
meta: {
|
|
21
|
-
|
|
22
|
-
inputSchema: typeof ListInputFieldChoicesSchema;
|
|
23
|
-
};
|
|
30
|
+
getAction: import("../..").PluginMeta;
|
|
24
31
|
};
|
|
25
32
|
};
|
|
26
|
-
}
|
|
27
|
-
export declare const listInputFieldChoicesPlugin: Plugin<GetActionPluginProvides & {
|
|
33
|
+
} & {
|
|
28
34
|
context: {
|
|
29
35
|
api: ApiClient;
|
|
30
36
|
getVersionedImplementationId: GetVersionedImplementationId;
|
|
31
37
|
} & ConnectionsPluginProvides["context"];
|
|
32
|
-
} &
|
|
33
|
-
|
|
38
|
+
} & {
|
|
39
|
+
context: import("../eventEmission").EventEmissionContext;
|
|
40
|
+
} & {
|
|
41
|
+
context: {
|
|
42
|
+
meta: Record<string, import("../..").PluginMeta>;
|
|
43
|
+
};
|
|
44
|
+
}) => {
|
|
45
|
+
listInputFieldChoices: (options?: (({
|
|
46
|
+
app: string;
|
|
47
|
+
actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
|
|
48
|
+
action: string;
|
|
49
|
+
inputField: string;
|
|
50
|
+
connection?: string | number | undefined;
|
|
51
|
+
connectionId?: string | number | null | undefined;
|
|
52
|
+
authenticationId?: string | number | null | undefined;
|
|
53
|
+
inputs?: Record<string, unknown> | undefined;
|
|
54
|
+
page?: number | undefined;
|
|
55
|
+
pageSize?: number | undefined;
|
|
56
|
+
maxItems?: number | undefined;
|
|
57
|
+
cursor?: string | undefined;
|
|
58
|
+
} | {
|
|
59
|
+
appKey: string;
|
|
60
|
+
actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
|
|
61
|
+
actionKey: string;
|
|
62
|
+
inputFieldKey: string;
|
|
63
|
+
connection?: string | number | undefined;
|
|
64
|
+
connectionId?: string | number | null | undefined;
|
|
65
|
+
authenticationId?: string | number | null | undefined;
|
|
66
|
+
inputs?: Record<string, unknown> | undefined;
|
|
67
|
+
page?: number | undefined;
|
|
68
|
+
pageSize?: number | undefined;
|
|
69
|
+
maxItems?: number | undefined;
|
|
70
|
+
cursor?: string | undefined;
|
|
71
|
+
}) & {
|
|
72
|
+
cursor?: string;
|
|
73
|
+
pageSize?: number;
|
|
74
|
+
maxItems?: number;
|
|
75
|
+
}) | undefined) => import("../..").PaginatedSdkResult<{
|
|
76
|
+
key?: string | undefined;
|
|
77
|
+
label?: string | undefined;
|
|
78
|
+
sample?: string | undefined;
|
|
79
|
+
value?: string | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
} & {
|
|
82
|
+
context: {
|
|
83
|
+
meta: {
|
|
84
|
+
listInputFieldChoices: import("../..").PluginMeta;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export type ListInputFieldChoicesPluginProvides = ReturnType<typeof listInputFieldChoicesPlugin>;
|
|
34
89
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFieldChoices/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFieldChoices/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAU3C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAcxE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAehE,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAGzB;QACP,GAAG,EAAE,SAAS,CAAC;QACf,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8H7C,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,UAAU,CAC1D,OAAO,2BAA2B,CACnC,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { definePlugin } from "../../utils/plugin-utils";
|
|
2
|
+
import { createPaginatedPluginMethod } from "../../utils/plugin-utils";
|
|
3
|
+
import { ListInputFieldChoicesInputSchema, InputFieldChoiceItemSchema, } from "./schemas";
|
|
2
4
|
import { ZapierApiError, ZapierConfigurationError } from "../../types/errors";
|
|
3
|
-
import { createPaginatedFunction } from "../../utils/function-utils";
|
|
4
5
|
import { DEFAULT_PAGE_SIZE } from "../../constants";
|
|
5
6
|
import { appKeyResolver, actionTypeResolver, actionKeyResolver, connectionIdResolver, inputFieldKeyResolver, inputsAllOptionalResolver, } from "../../resolvers";
|
|
6
7
|
import { fetchImplementationNeeds, fetchImplementationChoices, } from "../../services/implementations";
|
|
7
|
-
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
8
8
|
import { resolveConnectionId } from "../../utils/domain-utils";
|
|
9
|
-
import { stripPageSuffix } from "../../utils/string-utils";
|
|
10
9
|
import { setMethodMetadata } from "../../utils/telemetry-context";
|
|
11
|
-
// Transform NeedChoices to InputFieldChoiceItem
|
|
12
10
|
function transformNeedChoicesToInputFieldChoiceItem(choice) {
|
|
13
11
|
return {
|
|
14
12
|
key: choice.key,
|
|
@@ -17,8 +15,23 @@ function transformNeedChoicesToInputFieldChoiceItem(choice) {
|
|
|
17
15
|
value: choice.value,
|
|
18
16
|
};
|
|
19
17
|
}
|
|
20
|
-
export const listInputFieldChoicesPlugin = (sdk) => {
|
|
21
|
-
|
|
18
|
+
export const listInputFieldChoicesPlugin = definePlugin((sdk) => createPaginatedPluginMethod(sdk, {
|
|
19
|
+
name: "listInputFieldChoices",
|
|
20
|
+
categories: ["action"],
|
|
21
|
+
type: "list",
|
|
22
|
+
itemType: "InputFieldChoice",
|
|
23
|
+
inputSchema: ListInputFieldChoicesInputSchema,
|
|
24
|
+
outputSchema: InputFieldChoiceItemSchema,
|
|
25
|
+
defaultPageSize: DEFAULT_PAGE_SIZE,
|
|
26
|
+
resolvers: {
|
|
27
|
+
app: appKeyResolver,
|
|
28
|
+
actionType: actionTypeResolver,
|
|
29
|
+
action: actionKeyResolver,
|
|
30
|
+
connection: connectionIdResolver,
|
|
31
|
+
inputField: inputFieldKeyResolver,
|
|
32
|
+
inputs: inputsAllOptionalResolver,
|
|
33
|
+
},
|
|
34
|
+
handler: async ({ sdk, options, }) => {
|
|
22
35
|
const { api, getVersionedImplementationId } = sdk.context;
|
|
23
36
|
const appKey = "app" in options ? options.app : options.appKey;
|
|
24
37
|
const actionKey = "action" in options ? options.action : options.actionKey;
|
|
@@ -30,7 +43,6 @@ export const listInputFieldChoicesPlugin = (sdk) => {
|
|
|
30
43
|
authenticationId,
|
|
31
44
|
resolveConnection: sdk.context.resolveConnection,
|
|
32
45
|
});
|
|
33
|
-
// Get versioned implementation ID for the app
|
|
34
46
|
const selectedApi = await getVersionedImplementationId(appKey);
|
|
35
47
|
if (!selectedApi) {
|
|
36
48
|
throw new ZapierConfigurationError("No current_implementation_id found for app", { configType: "current_implementation_id" });
|
|
@@ -40,13 +52,12 @@ export const listInputFieldChoicesPlugin = (sdk) => {
|
|
|
40
52
|
operationType: actionType,
|
|
41
53
|
operationKey: actionKey,
|
|
42
54
|
});
|
|
43
|
-
// Get action details
|
|
44
55
|
const { data: action } = await sdk.getAction({
|
|
45
56
|
app: appKey,
|
|
46
57
|
actionType,
|
|
47
58
|
action: actionKey,
|
|
48
59
|
});
|
|
49
|
-
//
|
|
60
|
+
// Static choices via implementation needs.
|
|
50
61
|
const needsData = await fetchImplementationNeeds({
|
|
51
62
|
api,
|
|
52
63
|
selectedApi,
|
|
@@ -55,21 +66,17 @@ export const listInputFieldChoicesPlugin = (sdk) => {
|
|
|
55
66
|
connectionId: resolvedConnectionId ?? null,
|
|
56
67
|
inputs,
|
|
57
68
|
});
|
|
58
|
-
// Find the specific Need by key - search through raw needs array
|
|
59
69
|
const targetNeed = needsData.needs?.find((need) => need.key === inputFieldKey);
|
|
60
|
-
// If the need has static choices, return them
|
|
61
70
|
if (targetNeed?.choices && targetNeed.choices.length > 0) {
|
|
62
71
|
return {
|
|
63
72
|
data: targetNeed.choices.map(transformNeedChoicesToInputFieldChoiceItem),
|
|
64
|
-
nextCursor: undefined,
|
|
65
73
|
};
|
|
66
74
|
}
|
|
67
75
|
if (!action.id) {
|
|
68
76
|
throw new ZapierApiError(`Action ${actionKey} does not have an ID - cannot retrieve input field choices`);
|
|
69
77
|
}
|
|
70
|
-
// Use cursor
|
|
78
|
+
// Use cursor as page number if available; else use explicit page; else 0.
|
|
71
79
|
const requestPage = cursor ? parseInt(cursor, 10) : (page ?? 0);
|
|
72
|
-
// Use service layer to fetch dynamic choices
|
|
73
80
|
const choicesData = await fetchImplementationChoices({
|
|
74
81
|
api,
|
|
75
82
|
actionId: action.id,
|
|
@@ -78,15 +85,13 @@ export const listInputFieldChoicesPlugin = (sdk) => {
|
|
|
78
85
|
inputs,
|
|
79
86
|
page: requestPage,
|
|
80
87
|
});
|
|
81
|
-
// Transform NeedChoices objects to InputFieldChoiceItem objects
|
|
82
88
|
const choices = (choicesData.choices || []).map(transformNeedChoicesToInputFieldChoiceItem);
|
|
83
|
-
// Handle pagination
|
|
84
89
|
let nextCursor;
|
|
85
90
|
if (choicesData.next_page != null) {
|
|
86
91
|
nextCursor = choicesData.next_page.toString();
|
|
87
92
|
}
|
|
88
93
|
else if (choicesData.links?.next) {
|
|
89
|
-
//
|
|
94
|
+
// External actions: extract `page` query param from links.next.
|
|
90
95
|
try {
|
|
91
96
|
const nextUrl = new URL(choicesData.links.next);
|
|
92
97
|
const nextPage = nextUrl.searchParams.get("page");
|
|
@@ -95,37 +100,9 @@ export const listInputFieldChoicesPlugin = (sdk) => {
|
|
|
95
100
|
}
|
|
96
101
|
}
|
|
97
102
|
catch {
|
|
98
|
-
//
|
|
99
|
-
nextCursor = undefined;
|
|
103
|
+
// Malformed URL; fall through to undefined.
|
|
100
104
|
}
|
|
101
105
|
}
|
|
102
|
-
return {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
const methodName = stripPageSuffix(listInputFieldChoicesPage.name);
|
|
108
|
-
const listInputFieldChoicesDefinition = createPaginatedFunction(listInputFieldChoicesPage, ListInputFieldChoicesInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
109
|
-
return {
|
|
110
|
-
listInputFieldChoices: listInputFieldChoicesDefinition,
|
|
111
|
-
context: {
|
|
112
|
-
meta: {
|
|
113
|
-
listInputFieldChoices: {
|
|
114
|
-
categories: ["action"],
|
|
115
|
-
type: "list",
|
|
116
|
-
itemType: "InputFieldChoice",
|
|
117
|
-
inputSchema: ListInputFieldChoicesSchema,
|
|
118
|
-
outputSchema: InputFieldChoiceItemSchema,
|
|
119
|
-
resolvers: {
|
|
120
|
-
app: appKeyResolver,
|
|
121
|
-
actionType: actionTypeResolver,
|
|
122
|
-
action: actionKeyResolver,
|
|
123
|
-
connection: connectionIdResolver,
|
|
124
|
-
inputField: inputFieldKeyResolver,
|
|
125
|
-
inputs: inputsAllOptionalResolver,
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
};
|
|
106
|
+
return { data: choices, nextCursor };
|
|
107
|
+
},
|
|
108
|
+
}));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { PaginatedSdkFunction } from "../../types/functions";
|
|
3
|
-
import type { ZapierConfigurationError, ZapierApiError, ZapierAuthenticationError, ZapierAppNotFoundError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
|
|
4
3
|
export declare const InputFieldChoiceItemSchema: z.ZodObject<{
|
|
5
4
|
key: z.ZodOptional<z.ZodString>;
|
|
6
5
|
label: z.ZodOptional<z.ZodString>;
|
|
@@ -13,11 +12,11 @@ export declare const ListInputFieldChoicesSchema: z.ZodObject<{
|
|
|
13
12
|
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
14
13
|
};
|
|
15
14
|
actionType: z.ZodEnum<{
|
|
16
|
-
search: "search";
|
|
17
15
|
filter: "filter";
|
|
18
16
|
read: "read";
|
|
19
17
|
read_bulk: "read_bulk";
|
|
20
18
|
run: "run";
|
|
19
|
+
search: "search";
|
|
21
20
|
search_and_write: "search_and_write";
|
|
22
21
|
search_or_write: "search_or_write";
|
|
23
22
|
write: "write";
|
|
@@ -42,11 +41,11 @@ declare const ListInputFieldChoicesSchemaDeprecated: z.ZodObject<{
|
|
|
42
41
|
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
43
42
|
};
|
|
44
43
|
actionType: z.ZodEnum<{
|
|
45
|
-
search: "search";
|
|
46
44
|
filter: "filter";
|
|
47
45
|
read: "read";
|
|
48
46
|
read_bulk: "read_bulk";
|
|
49
47
|
run: "run";
|
|
48
|
+
search: "search";
|
|
50
49
|
search_and_write: "search_and_write";
|
|
51
50
|
search_or_write: "search_or_write";
|
|
52
51
|
write: "write";
|
|
@@ -67,11 +66,11 @@ export declare const ListInputFieldChoicesInputSchema: z.ZodUnion<readonly [z.Zo
|
|
|
67
66
|
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
68
67
|
};
|
|
69
68
|
actionType: z.ZodEnum<{
|
|
70
|
-
search: "search";
|
|
71
69
|
filter: "filter";
|
|
72
70
|
read: "read";
|
|
73
71
|
read_bulk: "read_bulk";
|
|
74
72
|
run: "run";
|
|
73
|
+
search: "search";
|
|
75
74
|
search_and_write: "search_and_write";
|
|
76
75
|
search_or_write: "search_or_write";
|
|
77
76
|
write: "write";
|
|
@@ -95,11 +94,11 @@ export declare const ListInputFieldChoicesInputSchema: z.ZodUnion<readonly [z.Zo
|
|
|
95
94
|
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
96
95
|
};
|
|
97
96
|
actionType: z.ZodEnum<{
|
|
98
|
-
search: "search";
|
|
99
97
|
filter: "filter";
|
|
100
98
|
read: "read";
|
|
101
99
|
read_bulk: "read_bulk";
|
|
102
100
|
run: "run";
|
|
101
|
+
search: "search";
|
|
103
102
|
search_and_write: "search_and_write";
|
|
104
103
|
search_or_write: "search_or_write";
|
|
105
104
|
write: "write";
|
|
@@ -123,7 +122,6 @@ export type ListInputFieldChoicesOptions = z.infer<typeof ListInputFieldChoicesS
|
|
|
123
122
|
/** @deprecated Use `inputField` instead. */
|
|
124
123
|
inputFieldKey: z.infer<typeof ListInputFieldChoicesSchemaDeprecated>["inputFieldKey"];
|
|
125
124
|
});
|
|
126
|
-
export type ListInputFieldChoicesError = ZapierConfigurationError | ZapierApiError | ZapierAuthenticationError | ZapierAppNotFoundError | ZapierValidationError | ZapierUnknownError;
|
|
127
125
|
export interface ListInputFieldChoicesPage {
|
|
128
126
|
data: InputFieldChoiceItem[];
|
|
129
127
|
nextCursor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFieldChoices/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFieldChoices/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAMlE,eAAO,MAAM,0BAA0B;;;;;iBA0BrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AA2C9E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiBpC,CAAC;AAGL,QAAA,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;iBAUF,CAAC;AAG1C,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEA,CAAC;AAG9C,MAAM,MAAM,4BAA4B,GACpC,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,GAC3C,CAAC,IAAI,CACH,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,EACrD,QAAQ,GAAG,WAAW,GAAG,eAAe,CACzC,GAAG;IACF,qCAAqC;IACrC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACxE,wCAAwC;IACxC,SAAS,EAAE,CAAC,CAAC,KAAK,CAChB,OAAO,qCAAqC,CAC7C,CAAC,WAAW,CAAC,CAAC;IACf,4CAA4C;IAC5C,aAAa,EAAE,CAAC,CAAC,KAAK,CACpB,OAAO,qCAAqC,CAC7C,CAAC,eAAe,CAAC,CAAC;CACpB,CAAC,CAAC;AAGP,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,oBAAoB,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,gCAAgC;IAC/C,qBAAqB,EAAE,oBAAoB,CACzC,4BAA4B,EAC5B,oBAAoB,CACrB,CAAC;CACH"}
|