@zapier/zapier-sdk 0.46.0 → 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.
Files changed (212) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/api/client.d.ts.map +1 -1
  3. package/dist/api/client.js +17 -6
  4. package/dist/api/types.d.ts +11 -0
  5. package/dist/api/types.d.ts.map +1 -1
  6. package/dist/index.cjs +2994 -3633
  7. package/dist/index.d.mts +6532 -2055
  8. package/dist/index.d.ts +5 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +1 -0
  11. package/dist/index.mjs +2992 -3634
  12. package/dist/plugins/api/index.d.ts +22 -10
  13. package/dist/plugins/api/index.d.ts.map +1 -1
  14. package/dist/plugins/api/index.js +4 -4
  15. package/dist/plugins/apps/index.d.ts +108 -7
  16. package/dist/plugins/apps/index.d.ts.map +1 -1
  17. package/dist/plugins/apps/index.js +3 -4
  18. package/dist/plugins/capabilities/index.d.ts +9 -6
  19. package/dist/plugins/capabilities/index.d.ts.map +1 -1
  20. package/dist/plugins/capabilities/index.js +3 -2
  21. package/dist/plugins/connections/index.d.ts +15 -9
  22. package/dist/plugins/connections/index.d.ts.map +1 -1
  23. package/dist/plugins/connections/index.js +3 -2
  24. package/dist/plugins/createClientCredentials/index.d.ts +26 -14
  25. package/dist/plugins/createClientCredentials/index.d.ts.map +1 -1
  26. package/dist/plugins/createClientCredentials/index.js +16 -39
  27. package/dist/plugins/createClientCredentials/schemas.d.ts +0 -2
  28. package/dist/plugins/createClientCredentials/schemas.d.ts.map +1 -1
  29. package/dist/plugins/deleteClientCredentials/index.d.ts +20 -14
  30. package/dist/plugins/deleteClientCredentials/index.d.ts.map +1 -1
  31. package/dist/plugins/deleteClientCredentials/index.js +18 -37
  32. package/dist/plugins/deleteClientCredentials/schemas.d.ts +0 -2
  33. package/dist/plugins/deleteClientCredentials/schemas.d.ts.map +1 -1
  34. package/dist/plugins/deprecated/authentications.d.ts +597 -41
  35. package/dist/plugins/deprecated/authentications.d.ts.map +1 -1
  36. package/dist/plugins/deprecated/authentications.js +9 -8
  37. package/dist/plugins/eventEmission/index.d.ts +9 -6
  38. package/dist/plugins/eventEmission/index.d.ts.map +1 -1
  39. package/dist/plugins/eventEmission/index.js +3 -2
  40. package/dist/plugins/fetch/index.d.ts +40 -17
  41. package/dist/plugins/fetch/index.d.ts.map +1 -1
  42. package/dist/plugins/fetch/index.js +6 -4
  43. package/dist/plugins/findFirstConnection/index.d.ts +109 -14
  44. package/dist/plugins/findFirstConnection/index.d.ts.map +1 -1
  45. package/dist/plugins/findFirstConnection/index.js +14 -26
  46. package/dist/plugins/findFirstConnection/schemas.d.ts +0 -2
  47. package/dist/plugins/findFirstConnection/schemas.d.ts.map +1 -1
  48. package/dist/plugins/findUniqueConnection/index.d.ts +109 -14
  49. package/dist/plugins/findUniqueConnection/index.d.ts.map +1 -1
  50. package/dist/plugins/findUniqueConnection/index.js +14 -26
  51. package/dist/plugins/findUniqueConnection/schemas.d.ts +0 -2
  52. package/dist/plugins/findUniqueConnection/schemas.d.ts.map +1 -1
  53. package/dist/plugins/getAction/index.d.ts +68 -15
  54. package/dist/plugins/getAction/index.d.ts.map +1 -1
  55. package/dist/plugins/getAction/index.js +21 -31
  56. package/dist/plugins/getAction/schemas.d.ts +0 -2
  57. package/dist/plugins/getAction/schemas.d.ts.map +1 -1
  58. package/dist/plugins/getApp/index.d.ts +140 -14
  59. package/dist/plugins/getApp/index.d.ts.map +1 -1
  60. package/dist/plugins/getApp/index.js +16 -38
  61. package/dist/plugins/getApp/schemas.d.ts +0 -2
  62. package/dist/plugins/getApp/schemas.d.ts.map +1 -1
  63. package/dist/plugins/getConnection/index.d.ts +50 -16
  64. package/dist/plugins/getConnection/index.d.ts.map +1 -1
  65. package/dist/plugins/getConnection/index.js +22 -29
  66. package/dist/plugins/getConnection/schemas.d.ts +0 -2
  67. package/dist/plugins/getConnection/schemas.d.ts.map +1 -1
  68. package/dist/plugins/getInputFieldsSchema/index.d.ts +59 -13
  69. package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -1
  70. package/dist/plugins/getInputFieldsSchema/index.js +21 -32
  71. package/dist/plugins/getInputFieldsSchema/schemas.d.ts +0 -2
  72. package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +1 -1
  73. package/dist/plugins/getProfile/index.d.ts +25 -18
  74. package/dist/plugins/getProfile/index.d.ts.map +1 -1
  75. package/dist/plugins/getProfile/index.js +13 -26
  76. package/dist/plugins/getProfile/schemas.d.ts +0 -8
  77. package/dist/plugins/getProfile/schemas.d.ts.map +1 -1
  78. package/dist/plugins/getProfile/schemas.js +0 -1
  79. package/dist/plugins/listActions/index.d.ts +73 -23
  80. package/dist/plugins/listActions/index.d.ts.map +1 -1
  81. package/dist/plugins/listActions/index.js +25 -53
  82. package/dist/plugins/listActions/schemas.d.ts +0 -11
  83. package/dist/plugins/listActions/schemas.d.ts.map +1 -1
  84. package/dist/plugins/listApps/index.d.ts +121 -13
  85. package/dist/plugins/listApps/index.d.ts.map +1 -1
  86. package/dist/plugins/listApps/index.js +22 -31
  87. package/dist/plugins/listApps/schemas.d.ts +0 -2
  88. package/dist/plugins/listApps/schemas.d.ts.map +1 -1
  89. package/dist/plugins/listClientCredentials/index.d.ts +29 -16
  90. package/dist/plugins/listClientCredentials/index.d.ts.map +1 -1
  91. package/dist/plugins/listClientCredentials/index.js +17 -37
  92. package/dist/plugins/listClientCredentials/schemas.d.ts +0 -2
  93. package/dist/plugins/listClientCredentials/schemas.d.ts.map +1 -1
  94. package/dist/plugins/listConnections/index.d.ts +95 -17
  95. package/dist/plugins/listConnections/index.d.ts.map +1 -1
  96. package/dist/plugins/listConnections/index.js +25 -49
  97. package/dist/plugins/listConnections/schemas.d.ts +0 -2
  98. package/dist/plugins/listConnections/schemas.d.ts.map +1 -1
  99. package/dist/plugins/listInputFieldChoices/index.d.ts +77 -22
  100. package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
  101. package/dist/plugins/listInputFieldChoices/index.js +27 -50
  102. package/dist/plugins/listInputFieldChoices/schemas.d.ts +0 -2
  103. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
  104. package/dist/plugins/listInputFields/index.d.ts +154 -22
  105. package/dist/plugins/listInputFields/index.d.ts.map +1 -1
  106. package/dist/plugins/listInputFields/index.js +28 -41
  107. package/dist/plugins/listInputFields/schemas.d.ts +0 -2
  108. package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
  109. package/dist/plugins/manifest/index.d.ts +40 -36
  110. package/dist/plugins/manifest/index.d.ts.map +1 -1
  111. package/dist/plugins/manifest/index.js +3 -2
  112. package/dist/plugins/registry/index.d.ts +11 -9
  113. package/dist/plugins/registry/index.d.ts.map +1 -1
  114. package/dist/plugins/registry/index.js +3 -2
  115. package/dist/plugins/request/index.d.ts +61 -15
  116. package/dist/plugins/request/index.d.ts.map +1 -1
  117. package/dist/plugins/request/index.js +14 -22
  118. package/dist/plugins/request/schemas.d.ts +0 -2
  119. package/dist/plugins/request/schemas.d.ts.map +1 -1
  120. package/dist/plugins/runAction/index.d.ts +137 -23
  121. package/dist/plugins/runAction/index.d.ts.map +1 -1
  122. package/dist/plugins/runAction/index.js +65 -78
  123. package/dist/plugins/runAction/schemas.d.ts +0 -10
  124. package/dist/plugins/runAction/schemas.d.ts.map +1 -1
  125. package/dist/plugins/tables/createTable/index.d.ts +43 -11
  126. package/dist/plugins/tables/createTable/index.d.ts.map +1 -1
  127. package/dist/plugins/tables/createTable/index.js +16 -44
  128. package/dist/plugins/tables/createTable/schemas.d.ts +0 -2
  129. package/dist/plugins/tables/createTable/schemas.d.ts.map +1 -1
  130. package/dist/plugins/tables/createTableFields/index.d.ts +54 -11
  131. package/dist/plugins/tables/createTableFields/index.d.ts.map +1 -1
  132. package/dist/plugins/tables/createTableFields/index.js +17 -41
  133. package/dist/plugins/tables/createTableFields/schemas.d.ts +0 -2
  134. package/dist/plugins/tables/createTableFields/schemas.d.ts.map +1 -1
  135. package/dist/plugins/tables/createTableRecords/index.d.ts +47 -11
  136. package/dist/plugins/tables/createTableRecords/index.d.ts.map +1 -1
  137. package/dist/plugins/tables/createTableRecords/index.js +17 -43
  138. package/dist/plugins/tables/createTableRecords/schemas.d.ts +0 -2
  139. package/dist/plugins/tables/createTableRecords/schemas.d.ts.map +1 -1
  140. package/dist/plugins/tables/deleteTable/index.d.ts +36 -13
  141. package/dist/plugins/tables/deleteTable/index.d.ts.map +1 -1
  142. package/dist/plugins/tables/deleteTable/index.js +18 -40
  143. package/dist/plugins/tables/deleteTable/schemas.d.ts +0 -2
  144. package/dist/plugins/tables/deleteTable/schemas.d.ts.map +1 -1
  145. package/dist/plugins/tables/deleteTableFields/index.d.ts +36 -11
  146. package/dist/plugins/tables/deleteTableFields/index.d.ts.map +1 -1
  147. package/dist/plugins/tables/deleteTableFields/index.js +17 -39
  148. package/dist/plugins/tables/deleteTableFields/schemas.d.ts +0 -2
  149. package/dist/plugins/tables/deleteTableFields/schemas.d.ts.map +1 -1
  150. package/dist/plugins/tables/deleteTableRecords/index.d.ts +36 -11
  151. package/dist/plugins/tables/deleteTableRecords/index.d.ts.map +1 -1
  152. package/dist/plugins/tables/deleteTableRecords/index.js +18 -41
  153. package/dist/plugins/tables/deleteTableRecords/schemas.d.ts +0 -2
  154. package/dist/plugins/tables/deleteTableRecords/schemas.d.ts.map +1 -1
  155. package/dist/plugins/tables/getTable/index.d.ts +43 -12
  156. package/dist/plugins/tables/getTable/index.d.ts.map +1 -1
  157. package/dist/plugins/tables/getTable/index.js +18 -43
  158. package/dist/plugins/tables/getTable/schemas.d.ts +0 -2
  159. package/dist/plugins/tables/getTable/schemas.d.ts.map +1 -1
  160. package/dist/plugins/tables/getTableRecord/index.d.ts +43 -11
  161. package/dist/plugins/tables/getTableRecord/index.d.ts.map +1 -1
  162. package/dist/plugins/tables/getTableRecord/index.js +18 -42
  163. package/dist/plugins/tables/getTableRecord/schemas.d.ts +0 -2
  164. package/dist/plugins/tables/getTableRecord/schemas.d.ts.map +1 -1
  165. package/dist/plugins/tables/listTableFields/index.d.ts +46 -11
  166. package/dist/plugins/tables/listTableFields/index.d.ts.map +1 -1
  167. package/dist/plugins/tables/listTableFields/index.js +17 -41
  168. package/dist/plugins/tables/listTableFields/schemas.d.ts +0 -2
  169. package/dist/plugins/tables/listTableFields/schemas.d.ts.map +1 -1
  170. package/dist/plugins/tables/listTableRecords/index.d.ts +66 -18
  171. package/dist/plugins/tables/listTableRecords/index.d.ts.map +1 -1
  172. package/dist/plugins/tables/listTableRecords/index.js +27 -50
  173. package/dist/plugins/tables/listTableRecords/schemas.d.ts +0 -2
  174. package/dist/plugins/tables/listTableRecords/schemas.d.ts.map +1 -1
  175. package/dist/plugins/tables/listTables/index.d.ts +53 -20
  176. package/dist/plugins/tables/listTables/index.d.ts.map +1 -1
  177. package/dist/plugins/tables/listTables/index.js +24 -51
  178. package/dist/plugins/tables/listTables/schemas.d.ts +0 -2
  179. package/dist/plugins/tables/listTables/schemas.d.ts.map +1 -1
  180. package/dist/plugins/tables/shared.d.ts +10 -0
  181. package/dist/plugins/tables/shared.d.ts.map +1 -0
  182. package/dist/plugins/tables/shared.js +9 -0
  183. package/dist/plugins/tables/updateTableRecords/index.d.ts +49 -11
  184. package/dist/plugins/tables/updateTableRecords/index.d.ts.map +1 -1
  185. package/dist/plugins/tables/updateTableRecords/index.js +20 -43
  186. package/dist/plugins/tables/updateTableRecords/schemas.d.ts +0 -2
  187. package/dist/plugins/tables/updateTableRecords/schemas.d.ts.map +1 -1
  188. package/dist/plugins/tables/utils.d.ts.map +1 -1
  189. package/dist/plugins/tables/utils.js +1 -0
  190. package/dist/registry.d.ts.map +1 -1
  191. package/dist/registry.js +21 -1
  192. package/dist/resolvers/actionKey.d.ts +1 -2
  193. package/dist/resolvers/actionKey.d.ts.map +1 -1
  194. package/dist/resolvers/actionType.d.ts +1 -2
  195. package/dist/resolvers/actionType.d.ts.map +1 -1
  196. package/dist/sdk.d.ts +2942 -2
  197. package/dist/sdk.d.ts.map +1 -1
  198. package/dist/types/errors.d.ts +13 -10
  199. package/dist/types/errors.d.ts.map +1 -1
  200. package/dist/types/errors.js +15 -12
  201. package/dist/types/functions.d.ts +18 -2
  202. package/dist/types/functions.d.ts.map +1 -1
  203. package/dist/types/plugin.d.ts +1 -1
  204. package/dist/types/plugin.d.ts.map +1 -1
  205. package/dist/types/registry.d.ts +1 -1
  206. package/dist/types/registry.d.ts.map +1 -1
  207. package/dist/utils/function-utils.d.ts +11 -12
  208. package/dist/utils/function-utils.d.ts.map +1 -1
  209. package/dist/utils/plugin-utils.d.ts +168 -0
  210. package/dist/utils/plugin-utils.d.ts.map +1 -0
  211. package/dist/utils/plugin-utils.js +132 -0
  212. package/package.json +1 -1
@@ -1,15 +1,23 @@
1
- import { ListConnectionsQuerySchema, } from "./schemas";
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 { createPaginatedFunction } from "../../utils/function-utils";
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 { createTelemetryCallback } from "../../utils/telemetry-utils";
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
- async function listConnectionsPage(options) {
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
- // Which parameter the values came from determines the resolution behavior:
38
- // - connections: resolve names from map, fall back to direct IDs
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 defaults to false,
72
- // meaning only non-expired connections are returned unless the caller opts in.
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
- const methodName = stripPageSuffix(listConnectionsPage.name);
101
- const listConnectionsDefinition = createPaginatedFunction(listConnectionsPage, ListConnectionsQuerySchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
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,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,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,MAAM,oBAAoB,GAC5B,yBAAyB,GACzB,cAAc,GACd,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,0BAA0B;IACzC,eAAe,EAAE,oBAAoB,CAAC,sBAAsB,EAAE,cAAc,CAAC,CAAC;CAC/E"}
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 interface ListInputFieldChoicesPluginProvides {
10
- listInputFieldChoices: (options: ListInputFieldChoicesOptions) => Promise<{
11
- data: InputFieldChoiceItem[];
12
- nextCursor?: string;
13
- }> & AsyncIterable<{
14
- data: InputFieldChoiceItem[];
15
- nextCursor?: string;
16
- }> & {
17
- items(): AsyncIterable<InputFieldChoiceItem>;
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
- listInputFieldChoices: {
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
- } & EventEmissionProvides, // requires getAction in SDK
33
- ListInputFieldChoicesPluginProvides>;
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":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,2BAA2B,EAE3B,KAAK,4BAA4B,EAGlC,MAAM,WAAW,CAAC;AAInB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAcxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAiBhE,MAAM,WAAW,mCAAmC;IAClD,qBAAqB,EAAE,CAAC,OAAO,EAAE,4BAA4B,KAAK,OAAO,CAAC;QACxE,IAAI,EAAE,oBAAoB,EAAE,CAAC;QAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QACrE,KAAK,IAAI,aAAa,CAAC,oBAAoB,CAAC,CAAC;KAC9C,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,qBAAqB,EAAE;gBACrB,WAAW,EAAE,OAAO,2BAA2B,CAAC;aACjD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAC9C,uBAAuB,GAAG;IACxB,OAAO,EAAE;QACP,GAAG,EAAE,SAAS,CAAC;QACf,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;CAC1C,GAAG,qBAAqB,EAAE,4BAA4B;AACvD,mCAAmC,CAqKpC,CAAC"}
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 { ListInputFieldChoicesSchema, ListInputFieldChoicesInputSchema, InputFieldChoiceItemSchema, } from "./schemas";
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
- async function listInputFieldChoicesPage(options) {
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
- // First, check for static choices by fetching implementation needs directly
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 (from pagination) as page number if available, otherwise use explicit page or default to 0
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
- // Extract page from next URL for external actions
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
- // Handle malformed URLs gracefully by not setting nextCursor
99
- nextCursor = undefined;
103
+ // Malformed URL; fall through to undefined.
100
104
  }
101
105
  }
102
- return {
103
- data: choices,
104
- nextCursor,
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>;
@@ -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;AAClE,OAAO,KAAK,EACV,wBAAwB,EACxB,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAM5B,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,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;;;;;;;;;;;;;;;;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"}
@@ -1,35 +1,167 @@
1
- import type { Plugin } from "../../types/plugin";
2
1
  import type { ApiClient } from "../../api";
3
- import type { InputFieldItem, InfoFieldItem, FieldsetItem, RootFieldItem } from "../../types/domain";
4
- import { ListInputFieldsSchema, type ListInputFieldsOptions } from "./schemas";
5
- import type { GetAppPluginProvides } from "../getApp";
6
- import type { GetActionPluginProvides } from "../getAction";
2
+ import type { FieldsetItem } from "../../types/domain";
7
3
  import type { GetVersionedImplementationId } from "../manifest/schemas";
8
- import type { EventEmissionProvides } from "../eventEmission";
9
4
  import type { ConnectionsPluginProvides } from "../connections";
10
- export interface ListInputFieldsPluginProvides {
11
- listInputFields: (options?: ListInputFieldsOptions) => Promise<{
12
- data: RootFieldItem[];
13
- nextCursor?: string;
14
- }> & AsyncIterable<{
15
- data: RootFieldItem[];
16
- nextCursor?: string;
17
- }> & {
18
- items(): AsyncIterable<InputFieldItem | InfoFieldItem | FieldsetItem>;
5
+ export declare const listInputFieldsPlugin: (sdk: {
6
+ getApp: (options?: {
7
+ app: string;
8
+ } | {
9
+ appKey: string;
10
+ } | undefined) => Promise<{
11
+ data: {
12
+ slug: string;
13
+ title: string;
14
+ key: string;
15
+ implementation_id: string;
16
+ description?: string | undefined;
17
+ is_hidden?: boolean | undefined;
18
+ auth_type?: string | undefined;
19
+ actions?: {
20
+ read?: number | undefined;
21
+ read_bulk?: number | undefined;
22
+ write?: number | undefined;
23
+ search?: number | undefined;
24
+ search_or_write?: number | undefined;
25
+ search_and_write?: number | undefined;
26
+ filter?: number | undefined;
27
+ } | undefined;
28
+ is_deprecated?: boolean | undefined;
29
+ is_beta?: boolean | undefined;
30
+ is_premium?: boolean | undefined;
31
+ age_in_days?: number | undefined;
32
+ banner?: string | undefined;
33
+ categories?: {
34
+ id: number;
35
+ name: string;
36
+ slug: string;
37
+ }[] | undefined;
38
+ images?: {
39
+ url_16x16?: string | undefined;
40
+ url_32x32?: string | undefined;
41
+ url_64x64?: string | undefined;
42
+ url_128x128?: string | undefined;
43
+ } | undefined;
44
+ popularity?: number | undefined;
45
+ has_filters?: boolean | undefined;
46
+ has_reads?: boolean | undefined;
47
+ has_searches?: boolean | undefined;
48
+ has_searches_or_writes?: boolean | undefined;
49
+ has_upfront_fields?: boolean | undefined;
50
+ has_writes?: boolean | undefined;
51
+ is_built_in?: boolean | undefined;
52
+ is_featured?: boolean | undefined;
53
+ is_invite?: boolean | undefined;
54
+ is_public?: boolean | undefined;
55
+ is_upcoming?: boolean | undefined;
56
+ visibility?: string | undefined;
57
+ primary_color?: string | undefined;
58
+ secondary_color?: string | undefined;
59
+ classification?: string | undefined;
60
+ api_docs_url?: string | undefined;
61
+ image?: string | undefined;
62
+ version?: string | undefined;
63
+ };
64
+ }>;
65
+ } & {
66
+ context: {
67
+ meta: {
68
+ getApp: import("../..").PluginMeta;
69
+ };
19
70
  };
71
+ } & {
72
+ getAction: (options?: {
73
+ app: string;
74
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
75
+ action: string;
76
+ } | {
77
+ appKey: string;
78
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
79
+ actionKey: string;
80
+ } | undefined) => Promise<{
81
+ data: {
82
+ description: string;
83
+ key: string;
84
+ app_key: string;
85
+ action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
86
+ title: string;
87
+ type: "action";
88
+ id?: string | undefined;
89
+ is_important?: boolean | undefined;
90
+ is_hidden?: boolean | undefined;
91
+ app_version?: string | undefined;
92
+ };
93
+ }>;
94
+ } & {
20
95
  context: {
21
96
  meta: {
22
- listInputFields: {
23
- inputSchema: typeof ListInputFieldsSchema;
24
- };
97
+ getAction: import("../..").PluginMeta;
25
98
  };
26
99
  };
27
- }
28
- export declare const listInputFieldsPlugin: Plugin<GetAppPluginProvides & GetActionPluginProvides & {
100
+ } & {
29
101
  context: {
30
102
  api: ApiClient;
31
103
  getVersionedImplementationId: GetVersionedImplementationId;
32
104
  } & ConnectionsPluginProvides["context"];
33
- } & EventEmissionProvides, // requires getApp and getAction in SDK, api, getVersionedImplementationId, eventEmission, and resolveConnection in context
34
- ListInputFieldsPluginProvides>;
105
+ } & {
106
+ context: import("../eventEmission").EventEmissionContext;
107
+ } & {
108
+ context: {
109
+ meta: Record<string, import("../..").PluginMeta>;
110
+ };
111
+ }) => {
112
+ listInputFields: (options?: (({
113
+ app: string;
114
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
115
+ action: string;
116
+ connection?: string | number | undefined;
117
+ connectionId?: string | number | null | undefined;
118
+ authenticationId?: string | number | null | undefined;
119
+ inputs?: Record<string, unknown> | undefined;
120
+ pageSize?: number | undefined;
121
+ maxItems?: number | undefined;
122
+ cursor?: string | undefined;
123
+ } | {
124
+ appKey: string;
125
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
126
+ actionKey: string;
127
+ connection?: string | number | undefined;
128
+ connectionId?: string | number | null | undefined;
129
+ authenticationId?: string | number | null | undefined;
130
+ inputs?: Record<string, unknown> | undefined;
131
+ pageSize?: number | undefined;
132
+ maxItems?: number | undefined;
133
+ cursor?: string | undefined;
134
+ }) & {
135
+ cursor?: string;
136
+ pageSize?: number;
137
+ maxItems?: number;
138
+ }) | undefined) => import("../..").PaginatedSdkResult<{
139
+ key: string;
140
+ type: "input_field";
141
+ default_value: string;
142
+ depends_on: string[];
143
+ description: string;
144
+ invalidates_input_fields: boolean;
145
+ is_required: boolean;
146
+ placeholder: string;
147
+ title: string;
148
+ value_type: string;
149
+ format?: string | undefined;
150
+ items?: {
151
+ type: string;
152
+ } | undefined;
153
+ } | {
154
+ key: string;
155
+ type: "info_field";
156
+ description: string;
157
+ title?: string | undefined;
158
+ } | FieldsetItem>;
159
+ } & {
160
+ context: {
161
+ meta: {
162
+ listInputFields: import("../..").PluginMeta;
163
+ };
164
+ };
165
+ };
166
+ export type ListInputFieldsPluginProvides = ReturnType<typeof listInputFieldsPlugin>;
35
167
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFields/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACd,MAAM,oBAAoB,CAAC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