@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.
Files changed (227) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/client.d.ts.map +1 -1
  3. package/dist/api/client.js +24 -7
  4. package/dist/api/schemas.d.ts +5 -5
  5. package/dist/api/types.d.ts +17 -0
  6. package/dist/api/types.d.ts.map +1 -1
  7. package/dist/auth.d.ts +27 -6
  8. package/dist/auth.d.ts.map +1 -1
  9. package/dist/auth.js +130 -92
  10. package/dist/cache.d.ts +50 -0
  11. package/dist/cache.d.ts.map +1 -0
  12. package/dist/cache.js +47 -0
  13. package/dist/index.cjs +3108 -3695
  14. package/dist/index.d.mts +6735 -2188
  15. package/dist/index.d.ts +5 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +1 -0
  18. package/dist/index.mjs +3105 -3696
  19. package/dist/plugins/api/index.d.ts +22 -10
  20. package/dist/plugins/api/index.d.ts.map +1 -1
  21. package/dist/plugins/api/index.js +4 -4
  22. package/dist/plugins/apps/index.d.ts +108 -7
  23. package/dist/plugins/apps/index.d.ts.map +1 -1
  24. package/dist/plugins/apps/index.js +3 -4
  25. package/dist/plugins/capabilities/index.d.ts +9 -6
  26. package/dist/plugins/capabilities/index.d.ts.map +1 -1
  27. package/dist/plugins/capabilities/index.js +3 -2
  28. package/dist/plugins/connections/index.d.ts +15 -9
  29. package/dist/plugins/connections/index.d.ts.map +1 -1
  30. package/dist/plugins/connections/index.js +3 -2
  31. package/dist/plugins/createClientCredentials/index.d.ts +26 -14
  32. package/dist/plugins/createClientCredentials/index.d.ts.map +1 -1
  33. package/dist/plugins/createClientCredentials/index.js +16 -39
  34. package/dist/plugins/createClientCredentials/schemas.d.ts +0 -2
  35. package/dist/plugins/createClientCredentials/schemas.d.ts.map +1 -1
  36. package/dist/plugins/deleteClientCredentials/index.d.ts +20 -14
  37. package/dist/plugins/deleteClientCredentials/index.d.ts.map +1 -1
  38. package/dist/plugins/deleteClientCredentials/index.js +18 -37
  39. package/dist/plugins/deleteClientCredentials/schemas.d.ts +0 -2
  40. package/dist/plugins/deleteClientCredentials/schemas.d.ts.map +1 -1
  41. package/dist/plugins/deprecated/authentications.d.ts +597 -41
  42. package/dist/plugins/deprecated/authentications.d.ts.map +1 -1
  43. package/dist/plugins/deprecated/authentications.js +9 -8
  44. package/dist/plugins/eventEmission/index.d.ts +9 -6
  45. package/dist/plugins/eventEmission/index.d.ts.map +1 -1
  46. package/dist/plugins/eventEmission/index.js +3 -2
  47. package/dist/plugins/fetch/index.d.ts +40 -17
  48. package/dist/plugins/fetch/index.d.ts.map +1 -1
  49. package/dist/plugins/fetch/index.js +6 -4
  50. package/dist/plugins/findFirstConnection/index.d.ts +109 -14
  51. package/dist/plugins/findFirstConnection/index.d.ts.map +1 -1
  52. package/dist/plugins/findFirstConnection/index.js +14 -26
  53. package/dist/plugins/findFirstConnection/schemas.d.ts +0 -2
  54. package/dist/plugins/findFirstConnection/schemas.d.ts.map +1 -1
  55. package/dist/plugins/findUniqueConnection/index.d.ts +109 -14
  56. package/dist/plugins/findUniqueConnection/index.d.ts.map +1 -1
  57. package/dist/plugins/findUniqueConnection/index.js +14 -26
  58. package/dist/plugins/findUniqueConnection/schemas.d.ts +0 -2
  59. package/dist/plugins/findUniqueConnection/schemas.d.ts.map +1 -1
  60. package/dist/plugins/getAction/index.d.ts +68 -15
  61. package/dist/plugins/getAction/index.d.ts.map +1 -1
  62. package/dist/plugins/getAction/index.js +21 -31
  63. package/dist/plugins/getAction/schemas.d.ts +4 -6
  64. package/dist/plugins/getAction/schemas.d.ts.map +1 -1
  65. package/dist/plugins/getApp/index.d.ts +140 -14
  66. package/dist/plugins/getApp/index.d.ts.map +1 -1
  67. package/dist/plugins/getApp/index.js +16 -38
  68. package/dist/plugins/getApp/schemas.d.ts +0 -2
  69. package/dist/plugins/getApp/schemas.d.ts.map +1 -1
  70. package/dist/plugins/getConnection/index.d.ts +50 -16
  71. package/dist/plugins/getConnection/index.d.ts.map +1 -1
  72. package/dist/plugins/getConnection/index.js +22 -29
  73. package/dist/plugins/getConnection/schemas.d.ts +0 -2
  74. package/dist/plugins/getConnection/schemas.d.ts.map +1 -1
  75. package/dist/plugins/getInputFieldsSchema/index.d.ts +59 -13
  76. package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -1
  77. package/dist/plugins/getInputFieldsSchema/index.js +21 -32
  78. package/dist/plugins/getInputFieldsSchema/schemas.d.ts +4 -6
  79. package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +1 -1
  80. package/dist/plugins/getProfile/index.d.ts +25 -18
  81. package/dist/plugins/getProfile/index.d.ts.map +1 -1
  82. package/dist/plugins/getProfile/index.js +13 -26
  83. package/dist/plugins/getProfile/schemas.d.ts +0 -8
  84. package/dist/plugins/getProfile/schemas.d.ts.map +1 -1
  85. package/dist/plugins/getProfile/schemas.js +0 -1
  86. package/dist/plugins/listActions/index.d.ts +73 -23
  87. package/dist/plugins/listActions/index.d.ts.map +1 -1
  88. package/dist/plugins/listActions/index.js +25 -53
  89. package/dist/plugins/listActions/schemas.d.ts +4 -15
  90. package/dist/plugins/listActions/schemas.d.ts.map +1 -1
  91. package/dist/plugins/listApps/index.d.ts +121 -13
  92. package/dist/plugins/listApps/index.d.ts.map +1 -1
  93. package/dist/plugins/listApps/index.js +22 -31
  94. package/dist/plugins/listApps/schemas.d.ts +0 -2
  95. package/dist/plugins/listApps/schemas.d.ts.map +1 -1
  96. package/dist/plugins/listClientCredentials/index.d.ts +29 -16
  97. package/dist/plugins/listClientCredentials/index.d.ts.map +1 -1
  98. package/dist/plugins/listClientCredentials/index.js +17 -37
  99. package/dist/plugins/listClientCredentials/schemas.d.ts +0 -2
  100. package/dist/plugins/listClientCredentials/schemas.d.ts.map +1 -1
  101. package/dist/plugins/listConnections/index.d.ts +95 -17
  102. package/dist/plugins/listConnections/index.d.ts.map +1 -1
  103. package/dist/plugins/listConnections/index.js +25 -49
  104. package/dist/plugins/listConnections/schemas.d.ts +0 -2
  105. package/dist/plugins/listConnections/schemas.d.ts.map +1 -1
  106. package/dist/plugins/listInputFieldChoices/index.d.ts +77 -22
  107. package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
  108. package/dist/plugins/listInputFieldChoices/index.js +27 -50
  109. package/dist/plugins/listInputFieldChoices/schemas.d.ts +4 -6
  110. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
  111. package/dist/plugins/listInputFields/index.d.ts +154 -22
  112. package/dist/plugins/listInputFields/index.d.ts.map +1 -1
  113. package/dist/plugins/listInputFields/index.js +28 -41
  114. package/dist/plugins/listInputFields/schemas.d.ts +4 -6
  115. package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
  116. package/dist/plugins/manifest/index.d.ts +40 -36
  117. package/dist/plugins/manifest/index.d.ts.map +1 -1
  118. package/dist/plugins/manifest/index.js +3 -2
  119. package/dist/plugins/registry/index.d.ts +11 -9
  120. package/dist/plugins/registry/index.d.ts.map +1 -1
  121. package/dist/plugins/registry/index.js +3 -2
  122. package/dist/plugins/request/index.d.ts +61 -15
  123. package/dist/plugins/request/index.d.ts.map +1 -1
  124. package/dist/plugins/request/index.js +14 -22
  125. package/dist/plugins/request/schemas.d.ts +0 -2
  126. package/dist/plugins/request/schemas.d.ts.map +1 -1
  127. package/dist/plugins/runAction/index.d.ts +137 -23
  128. package/dist/plugins/runAction/index.d.ts.map +1 -1
  129. package/dist/plugins/runAction/index.js +65 -78
  130. package/dist/plugins/runAction/schemas.d.ts +4 -14
  131. package/dist/plugins/runAction/schemas.d.ts.map +1 -1
  132. package/dist/plugins/tables/createTable/index.d.ts +43 -11
  133. package/dist/plugins/tables/createTable/index.d.ts.map +1 -1
  134. package/dist/plugins/tables/createTable/index.js +16 -44
  135. package/dist/plugins/tables/createTable/schemas.d.ts +0 -2
  136. package/dist/plugins/tables/createTable/schemas.d.ts.map +1 -1
  137. package/dist/plugins/tables/createTableFields/index.d.ts +54 -11
  138. package/dist/plugins/tables/createTableFields/index.d.ts.map +1 -1
  139. package/dist/plugins/tables/createTableFields/index.js +17 -41
  140. package/dist/plugins/tables/createTableFields/schemas.d.ts +21 -23
  141. package/dist/plugins/tables/createTableFields/schemas.d.ts.map +1 -1
  142. package/dist/plugins/tables/createTableRecords/index.d.ts +47 -11
  143. package/dist/plugins/tables/createTableRecords/index.d.ts.map +1 -1
  144. package/dist/plugins/tables/createTableRecords/index.js +17 -43
  145. package/dist/plugins/tables/createTableRecords/schemas.d.ts +0 -2
  146. package/dist/plugins/tables/createTableRecords/schemas.d.ts.map +1 -1
  147. package/dist/plugins/tables/deleteTable/index.d.ts +36 -13
  148. package/dist/plugins/tables/deleteTable/index.d.ts.map +1 -1
  149. package/dist/plugins/tables/deleteTable/index.js +18 -40
  150. package/dist/plugins/tables/deleteTable/schemas.d.ts +0 -2
  151. package/dist/plugins/tables/deleteTable/schemas.d.ts.map +1 -1
  152. package/dist/plugins/tables/deleteTableFields/index.d.ts +36 -11
  153. package/dist/plugins/tables/deleteTableFields/index.d.ts.map +1 -1
  154. package/dist/plugins/tables/deleteTableFields/index.js +17 -39
  155. package/dist/plugins/tables/deleteTableFields/schemas.d.ts +0 -2
  156. package/dist/plugins/tables/deleteTableFields/schemas.d.ts.map +1 -1
  157. package/dist/plugins/tables/deleteTableRecords/index.d.ts +36 -11
  158. package/dist/plugins/tables/deleteTableRecords/index.d.ts.map +1 -1
  159. package/dist/plugins/tables/deleteTableRecords/index.js +18 -41
  160. package/dist/plugins/tables/deleteTableRecords/schemas.d.ts +0 -2
  161. package/dist/plugins/tables/deleteTableRecords/schemas.d.ts.map +1 -1
  162. package/dist/plugins/tables/getTable/index.d.ts +43 -12
  163. package/dist/plugins/tables/getTable/index.d.ts.map +1 -1
  164. package/dist/plugins/tables/getTable/index.js +18 -43
  165. package/dist/plugins/tables/getTable/schemas.d.ts +0 -2
  166. package/dist/plugins/tables/getTable/schemas.d.ts.map +1 -1
  167. package/dist/plugins/tables/getTableRecord/index.d.ts +43 -11
  168. package/dist/plugins/tables/getTableRecord/index.d.ts.map +1 -1
  169. package/dist/plugins/tables/getTableRecord/index.js +18 -42
  170. package/dist/plugins/tables/getTableRecord/schemas.d.ts +0 -2
  171. package/dist/plugins/tables/getTableRecord/schemas.d.ts.map +1 -1
  172. package/dist/plugins/tables/listTableFields/index.d.ts +46 -11
  173. package/dist/plugins/tables/listTableFields/index.d.ts.map +1 -1
  174. package/dist/plugins/tables/listTableFields/index.js +17 -41
  175. package/dist/plugins/tables/listTableFields/schemas.d.ts +12 -14
  176. package/dist/plugins/tables/listTableFields/schemas.d.ts.map +1 -1
  177. package/dist/plugins/tables/listTableRecords/index.d.ts +66 -18
  178. package/dist/plugins/tables/listTableRecords/index.d.ts.map +1 -1
  179. package/dist/plugins/tables/listTableRecords/index.js +27 -50
  180. package/dist/plugins/tables/listTableRecords/schemas.d.ts +6 -8
  181. package/dist/plugins/tables/listTableRecords/schemas.d.ts.map +1 -1
  182. package/dist/plugins/tables/listTables/index.d.ts +53 -20
  183. package/dist/plugins/tables/listTables/index.d.ts.map +1 -1
  184. package/dist/plugins/tables/listTables/index.js +24 -51
  185. package/dist/plugins/tables/listTables/schemas.d.ts +0 -2
  186. package/dist/plugins/tables/listTables/schemas.d.ts.map +1 -1
  187. package/dist/plugins/tables/shared.d.ts +10 -0
  188. package/dist/plugins/tables/shared.d.ts.map +1 -0
  189. package/dist/plugins/tables/shared.js +9 -0
  190. package/dist/plugins/tables/updateTableRecords/index.d.ts +49 -11
  191. package/dist/plugins/tables/updateTableRecords/index.d.ts.map +1 -1
  192. package/dist/plugins/tables/updateTableRecords/index.js +20 -43
  193. package/dist/plugins/tables/updateTableRecords/schemas.d.ts +0 -2
  194. package/dist/plugins/tables/updateTableRecords/schemas.d.ts.map +1 -1
  195. package/dist/plugins/tables/utils.d.ts.map +1 -1
  196. package/dist/plugins/tables/utils.js +1 -0
  197. package/dist/registry.d.ts.map +1 -1
  198. package/dist/registry.js +21 -1
  199. package/dist/resolvers/actionKey.d.ts +1 -2
  200. package/dist/resolvers/actionKey.d.ts.map +1 -1
  201. package/dist/resolvers/actionType.d.ts +1 -2
  202. package/dist/resolvers/actionType.d.ts.map +1 -1
  203. package/dist/schemas/Action.d.ts +1 -1
  204. package/dist/sdk.d.ts +2942 -2
  205. package/dist/sdk.d.ts.map +1 -1
  206. package/dist/types/credentials.d.ts +2 -1
  207. package/dist/types/credentials.d.ts.map +1 -1
  208. package/dist/types/credentials.js +2 -1
  209. package/dist/types/errors.d.ts +13 -10
  210. package/dist/types/errors.d.ts.map +1 -1
  211. package/dist/types/errors.js +15 -12
  212. package/dist/types/functions.d.ts +18 -2
  213. package/dist/types/functions.d.ts.map +1 -1
  214. package/dist/types/plugin.d.ts +1 -1
  215. package/dist/types/plugin.d.ts.map +1 -1
  216. package/dist/types/properties.d.ts +1 -1
  217. package/dist/types/registry.d.ts +1 -1
  218. package/dist/types/registry.d.ts.map +1 -1
  219. package/dist/types/sdk.d.ts +2 -0
  220. package/dist/types/sdk.d.ts.map +1 -1
  221. package/dist/types/sdk.js +1 -0
  222. package/dist/utils/function-utils.d.ts +11 -12
  223. package/dist/utils/function-utils.d.ts.map +1 -1
  224. package/dist/utils/plugin-utils.d.ts +168 -0
  225. package/dist/utils/plugin-utils.d.ts.map +1 -0
  226. package/dist/utils/plugin-utils.js +132 -0
  227. package/package.json +2 -4
@@ -1,38 +1,31 @@
1
- import { createFunction } from "../../utils/function-utils";
1
+ import { definePlugin } from "../../utils/plugin-utils";
2
+ import { createPluginMethod } from "../../utils/plugin-utils";
2
3
  import { connectionIdGenericResolver } from "../../resolvers";
3
4
  import { transformConnectionItem } from "../../utils/domain-utils";
4
5
  import { ConnectionItemSchema } from "../../schemas/Connection";
5
- import { createTelemetryCallback } from "../../utils/telemetry-utils";
6
6
  import { GetConnectionParamSchema } from "./schemas";
7
- export const getConnectionPlugin = (sdk) => {
8
- async function getConnection(options) {
7
+ export const getConnectionPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
8
+ name: "getConnection",
9
+ categories: ["connection"],
10
+ type: "item",
11
+ itemType: "Connection",
12
+ inputSchema: GetConnectionParamSchema,
13
+ outputSchema: ConnectionItemSchema,
14
+ resolvers: { connection: connectionIdGenericResolver },
15
+ handler: async ({ sdk, options }) => {
9
16
  const { api } = sdk.context;
10
- const resolvedConnectionId = options.connection ?? options.connectionId ?? options.authenticationId;
17
+ const resolvedConnectionId = options.connection ??
18
+ options.connectionId ??
19
+ options.authenticationId;
11
20
  if (!resolvedConnectionId) {
12
21
  throw new Error("connection is required");
13
22
  }
14
- const response = await api.get(`/api/v0/connections/${encodeURIComponent(String(resolvedConnectionId))}`);
15
- return {
16
- ...response,
17
- data: transformConnectionItem(response.data),
18
- };
19
- }
20
- const getConnectionDefinition = createFunction(getConnection, GetConnectionParamSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, getConnection.name));
21
- return {
22
- getConnection: getConnectionDefinition,
23
- context: {
24
- meta: {
25
- getConnection: {
26
- categories: ["connection"],
27
- type: "item",
28
- itemType: "Connection",
29
- inputSchema: GetConnectionParamSchema,
30
- outputSchema: ConnectionItemSchema,
31
- resolvers: {
32
- connection: connectionIdGenericResolver,
33
- },
34
- },
23
+ const response = await api.get(`/api/v0/connections/${encodeURIComponent(String(resolvedConnectionId))}`, {
24
+ resource: {
25
+ type: "connection",
26
+ id: String(resolvedConnectionId),
35
27
  },
36
- },
37
- };
38
- };
28
+ });
29
+ return { ...response, data: transformConnectionItem(response.data) };
30
+ },
31
+ }));
@@ -1,13 +1,11 @@
1
1
  import type { GetConnectionResponse } from "@zapier/zapier-sdk-core/v0/schemas/connections";
2
2
  import { z } from "zod";
3
- import type { ZapierAuthenticationError, ZapierResourceNotFoundError, ZapierApiError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
4
3
  export declare const GetConnectionParamSchema: z.ZodObject<{
5
4
  connection: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
6
5
  connectionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
7
6
  authenticationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
8
7
  }, z.core.$strip>;
9
8
  export type GetConnectionParam = z.infer<typeof GetConnectionParamSchema>;
10
- export type GetConnectionError = ZapierAuthenticationError | ZapierResourceNotFoundError | ZapierApiError | ZapierValidationError | ZapierUnknownError;
11
9
  export interface GetConnectionSdkFunction {
12
10
  getConnection: (options: GetConnectionParam) => Promise<GetConnectionResponse>;
13
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getConnection/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,KAAK,EACV,yBAAyB,EACzB,2BAA2B,EAC3B,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,wBAAwB;;;;iBAUnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAG1E,MAAM,MAAM,kBAAkB,GAC1B,yBAAyB,GACzB,2BAA2B,GAC3B,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,wBAAwB;IACvC,aAAa,EAAE,CACb,OAAO,EAAE,kBAAkB,KACxB,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrC"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getConnection/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,wBAAwB;;;;iBAUnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAG1E,MAAM,WAAW,wBAAwB;IACvC,aAAa,EAAE,CACb,OAAO,EAAE,kBAAkB,KACxB,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrC"}
@@ -1,26 +1,72 @@
1
- import type { Plugin } from "../../types/plugin";
2
1
  import type { ApiClient } from "../../api";
3
- import { GetInputFieldsSchemaSchema, type GetInputFieldsSchemaOptions as GetInputFieldsSchemaOptions } from "./schemas";
4
- import type { GetActionPluginProvides } from "../getAction";
5
2
  import type { GetVersionedImplementationId } from "../manifest/schemas";
6
- import type { EventEmissionProvides } from "../eventEmission";
7
3
  import type { ConnectionsPluginProvides } from "../connections";
8
- export interface GetInputFieldsSchemaPluginProvides {
9
- getInputFieldsSchema: (options: GetInputFieldsSchemaOptions) => Promise<{
10
- data: Record<string, unknown>;
4
+ export declare const getInputFieldsSchemaPlugin: (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
+ };
11
26
  }>;
27
+ } & {
12
28
  context: {
13
29
  meta: {
14
- getInputFieldsSchema: {
15
- inputSchema: typeof GetInputFieldsSchemaSchema;
16
- };
30
+ getAction: import("../..").PluginMeta;
17
31
  };
18
32
  };
19
- }
20
- export declare const getInputFieldsSchemaPlugin: Plugin<GetActionPluginProvides & {
33
+ } & {
21
34
  context: {
22
35
  api: ApiClient;
23
36
  getVersionedImplementationId: GetVersionedImplementationId;
24
37
  } & ConnectionsPluginProvides["context"];
25
- } & EventEmissionProvides, GetInputFieldsSchemaPluginProvides>;
38
+ } & {
39
+ context: import("../eventEmission").EventEmissionContext;
40
+ } & {
41
+ context: {
42
+ meta: Record<string, import("../..").PluginMeta>;
43
+ };
44
+ }) => {
45
+ getInputFieldsSchema: (options?: {
46
+ app: string;
47
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
48
+ action: string;
49
+ connection?: string | number | undefined;
50
+ connectionId?: string | number | null | undefined;
51
+ authenticationId?: string | number | null | undefined;
52
+ inputs?: Record<string, unknown> | undefined;
53
+ } | {
54
+ appKey: string;
55
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
56
+ actionKey: string;
57
+ connection?: string | number | undefined;
58
+ connectionId?: string | number | null | undefined;
59
+ authenticationId?: string | number | null | undefined;
60
+ inputs?: Record<string, unknown> | undefined;
61
+ } | undefined) => Promise<{
62
+ data: Record<string, unknown>;
63
+ }>;
64
+ } & {
65
+ context: {
66
+ meta: {
67
+ getInputFieldsSchema: import("../..").PluginMeta;
68
+ };
69
+ };
70
+ };
71
+ export type GetInputFieldsSchemaPluginProvides = ReturnType<typeof getInputFieldsSchemaPlugin>;
26
72
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getInputFieldsSchema/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,0BAA0B,EAE1B,KAAK,2BAA2B,IA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AAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;cAmBpB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;CAoDhD,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,UAAU,CACzD,OAAO,0BAA0B,CAClC,CAAC"}
@@ -1,17 +1,29 @@
1
- import { GetInputFieldsSchemaSchema, GetInputFieldsSchemaInputSchema, } from "./schemas";
1
+ import { definePlugin } from "../../utils/plugin-utils";
2
+ import { createPluginMethod } from "../../utils/plugin-utils";
3
+ import { GetInputFieldsSchemaInputSchema } from "./schemas";
2
4
  import { ZapierConfigurationError } from "../../types/errors";
3
- import { createFunction } from "../../utils/function-utils";
4
5
  import { appKeyResolver, actionTypeResolver, actionKeyResolver, connectionIdResolver, inputsAllOptionalResolver, } from "../../resolvers";
5
6
  import { fetchImplementationNeeds } from "../../services/implementations";
6
- import { createTelemetryCallback } from "../../utils/telemetry-utils";
7
7
  import { resolveConnectionId } from "../../utils/domain-utils";
8
8
  import { setMethodMetadata } from "../../utils/telemetry-context";
9
- export const getInputFieldsSchemaPlugin = (sdk) => {
10
- async function getInputFieldsSchema(options) {
9
+ export const getInputFieldsSchemaPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
10
+ name: "getInputFieldsSchema",
11
+ categories: ["action"],
12
+ type: "item",
13
+ itemType: "InputSchema",
14
+ inputSchema: GetInputFieldsSchemaInputSchema,
15
+ resolvers: {
16
+ app: appKeyResolver,
17
+ actionType: actionTypeResolver,
18
+ action: actionKeyResolver,
19
+ connection: connectionIdResolver,
20
+ inputs: inputsAllOptionalResolver,
21
+ },
22
+ handler: async ({ sdk, options, }) => {
11
23
  const { api, getVersionedImplementationId } = sdk.context;
12
24
  const appKey = "app" in options ? options.app : options.appKey;
13
25
  const actionKey = "action" in options ? options.action : options.actionKey;
14
- const { actionType, connection, connectionId, authenticationId, inputs } = options;
26
+ const { actionType, connection, connectionId, authenticationId, inputs, } = options;
15
27
  const resolvedConnectionId = await resolveConnectionId({
16
28
  connection,
17
29
  connectionId,
@@ -40,29 +52,6 @@ export const getInputFieldsSchemaPlugin = (sdk) => {
40
52
  connectionId: resolvedConnectionId ?? null,
41
53
  inputs,
42
54
  });
43
- return {
44
- data: needsData.schema || {},
45
- };
46
- }
47
- const getInputFieldsSchemaDefinition = createFunction(getInputFieldsSchema, GetInputFieldsSchemaInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, getInputFieldsSchema.name));
48
- return {
49
- getInputFieldsSchema: getInputFieldsSchemaDefinition,
50
- context: {
51
- meta: {
52
- getInputFieldsSchema: {
53
- categories: ["action"],
54
- type: "item",
55
- itemType: "InputSchema",
56
- inputSchema: GetInputFieldsSchemaSchema,
57
- resolvers: {
58
- app: appKeyResolver,
59
- actionType: actionTypeResolver,
60
- action: actionKeyResolver,
61
- connection: connectionIdResolver,
62
- inputs: inputsAllOptionalResolver,
63
- },
64
- },
65
- },
66
- },
67
- };
68
- };
55
+ return { data: needsData.schema || {} };
56
+ },
57
+ }));
@@ -1,15 +1,14 @@
1
1
  import { z } from "zod";
2
- import type { ZapierConfigurationError, ZapierApiError, ZapierAuthenticationError, ZapierAppNotFoundError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
3
2
  export declare const GetInputFieldsSchemaSchema: z.ZodObject<{
4
3
  app: z.ZodString & {
5
4
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
6
5
  };
7
6
  actionType: z.ZodEnum<{
8
- search: "search";
9
7
  filter: "filter";
10
8
  read: "read";
11
9
  read_bulk: "read_bulk";
12
10
  run: "run";
11
+ search: "search";
13
12
  search_and_write: "search_and_write";
14
13
  search_or_write: "search_or_write";
15
14
  write: "write";
@@ -27,11 +26,11 @@ declare const GetInputFieldsSchemaSchemaDeprecated: z.ZodObject<{
27
26
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
28
27
  };
29
28
  actionType: z.ZodEnum<{
30
- search: "search";
31
29
  filter: "filter";
32
30
  read: "read";
33
31
  read_bulk: "read_bulk";
34
32
  run: "run";
33
+ search: "search";
35
34
  search_and_write: "search_and_write";
36
35
  search_or_write: "search_or_write";
37
36
  write: "write";
@@ -47,11 +46,11 @@ export declare const GetInputFieldsSchemaInputSchema: z.ZodUnion<readonly [z.Zod
47
46
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
48
47
  };
49
48
  actionType: z.ZodEnum<{
50
- search: "search";
51
49
  filter: "filter";
52
50
  read: "read";
53
51
  read_bulk: "read_bulk";
54
52
  run: "run";
53
+ search: "search";
55
54
  search_and_write: "search_and_write";
56
55
  search_or_write: "search_or_write";
57
56
  write: "write";
@@ -68,11 +67,11 @@ export declare const GetInputFieldsSchemaInputSchema: z.ZodUnion<readonly [z.Zod
68
67
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
69
68
  };
70
69
  actionType: z.ZodEnum<{
71
- search: "search";
72
70
  filter: "filter";
73
71
  read: "read";
74
72
  read_bulk: "read_bulk";
75
73
  run: "run";
74
+ search: "search";
76
75
  search_and_write: "search_and_write";
77
76
  search_or_write: "search_or_write";
78
77
  write: "write";
@@ -89,7 +88,6 @@ export type GetInputFieldsSchemaOptions = z.infer<typeof GetInputFieldsSchemaSch
89
88
  /** @deprecated Use `action` instead. */
90
89
  actionKey: z.infer<typeof GetInputFieldsSchemaSchemaDeprecated>["actionKey"];
91
90
  });
92
- export type GetInputFieldsSchemaError = ZapierConfigurationError | ZapierApiError | ZapierAuthenticationError | ZapierAppNotFoundError | ZapierValidationError | ZapierUnknownError;
93
91
  export interface GetInputFieldsSchemaSdkFunction {
94
92
  getInputFieldsSchema: (options: GetInputFieldsSchemaOptions) => Promise<{
95
93
  data: Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getInputFieldsSchema/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,OAAO,KAAK,EACV,wBA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QAAA,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;iBAYF,CAAC;AAGzC,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEA,CAAC;AAG7C,MAAM,MAAM,2BAA2B,GACnC,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,GAC1C,CAAC,IAAI,CACH,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,EACpD,QAAQ,GAAG,WAAW,CACvB,GAAG;IACF,qCAAqC;IACrC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACvE,wCAAwC;IACxC,SAAS,EAAE,CAAC,CAAC,KAAK,CAChB,OAAO,oCAAoC,CAC5C,CAAC,WAAW,CAAC,CAAC;CAChB,CAAC,CAAC;AAEP,MAAM,WAAW,+BAA+B;IAC9C,oBAAoB,EAAE,CACpB,OAAO,EAAE,2BAA2B,KACjC,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CACjD"}
@@ -1,25 +1,32 @@
1
- import type { GetProfileOptions } from "./schemas";
2
1
  import type { ApiClient } from "../../api/types";
3
- import type { Plugin } from "../../types/plugin";
4
- import type { UserProfileItem } from "../../types/domain";
5
- import { GetProfileSchema } from "./schemas";
6
- import type { EventEmissionProvides } from "../eventEmission";
7
- export interface GetProfilePluginProvides {
8
- getProfile: (options?: GetProfileOptions) => Promise<{
9
- data: UserProfileItem;
2
+ export declare const getProfilePlugin: (sdk: {
3
+ context: {
4
+ api: ApiClient;
5
+ };
6
+ } & {
7
+ context: import("../eventEmission").EventEmissionContext;
8
+ } & {
9
+ context: {
10
+ meta: Record<string, import("../..").PluginMeta>;
11
+ };
12
+ }) => {
13
+ getProfile: (options?: Record<string, never> | undefined) => Promise<{
14
+ data: {
15
+ id: string;
16
+ first_name: string;
17
+ last_name: string;
18
+ full_name: string;
19
+ email: string;
20
+ email_confirmed: boolean;
21
+ timezone: string;
22
+ };
10
23
  }>;
24
+ } & {
11
25
  context: {
12
26
  meta: {
13
- getProfile: {
14
- inputSchema: typeof GetProfileSchema;
15
- };
27
+ getProfile: import("../..").PluginMeta;
16
28
  };
17
29
  };
18
- }
19
- export declare const getProfilePlugin: Plugin<{
20
- context: {
21
- api: ApiClient;
22
- };
23
- } & EventEmissionProvides, // no SDK dependencies, requires api and eventEmission in context
24
- GetProfilePluginProvides>;
30
+ };
31
+ export type GetProfilePluginProvides = ReturnType<typeof getProfilePlugin>;
25
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAG9D,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,CACV,OAAO,CAAC,EAAE,iBAAiB,KACxB,OAAO,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;IACxC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,UAAU,EAAE;gBACV,WAAW,EAAE,OAAO,gBAAgB,CAAC;aACtC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC;IAAE,OAAO,EAAE;QAAE,GAAG,EAAE,SAAS,CAAA;KAAE,CAAA;CAAE,GAAG,qBAAqB,EAAE,iEAAiE;AAC1H,wBAAwB,CA+CzB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO9D,eAAO,MAAM,gBAAgB;aAGd;QAAE,GAAG,EAAE,SAAS,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;CA4BhC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -1,13 +1,16 @@
1
- import { createFunction } from "../../utils/function-utils";
1
+ import { definePlugin } from "../../utils/plugin-utils";
2
+ import { createPluginMethod } from "../../utils/plugin-utils";
2
3
  import { GetProfileSchema } from "./schemas";
3
4
  import { UserProfileItemSchema } from "../../schemas/UserProfile";
4
- import { createTelemetryCallback } from "../../utils/telemetry-utils";
5
- // Direct plugin function - takes options + sdk + context in one object
6
- export const getProfilePlugin = (sdk) => {
7
- async function getProfile() {
8
- const profile = await sdk.context.api.get("/zapier/api/v4/profile/", {
9
- authRequired: true,
10
- });
5
+ export const getProfilePlugin = definePlugin((sdk) => createPluginMethod(sdk, {
6
+ name: "getProfile",
7
+ categories: ["account"],
8
+ type: "item",
9
+ itemType: "Profile",
10
+ inputSchema: GetProfileSchema,
11
+ outputSchema: UserProfileItemSchema,
12
+ handler: async ({ sdk }) => {
13
+ const profile = await sdk.context.api.get("/zapier/api/v4/profile/", { authRequired: true });
11
14
  return {
12
15
  data: {
13
16
  id: String(profile.public_id ?? profile.id),
@@ -19,21 +22,5 @@ export const getProfilePlugin = (sdk) => {
19
22
  timezone: profile.timezone,
20
23
  },
21
24
  };
22
- }
23
- const getProfileDefinition = createFunction(getProfile, GetProfileSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, getProfile.name));
24
- // Return flat structure - getProfile goes directly to SDK
25
- return {
26
- getProfile: getProfileDefinition,
27
- context: {
28
- meta: {
29
- getProfile: {
30
- categories: ["account"],
31
- type: "item",
32
- itemType: "Profile",
33
- inputSchema: GetProfileSchema,
34
- outputSchema: UserProfileItemSchema,
35
- },
36
- },
37
- },
38
- };
39
- };
25
+ },
26
+ }));
@@ -1,13 +1,5 @@
1
1
  import { z } from "zod";
2
2
  import type { FunctionOptions } from "../../types/functions";
3
- import type { UserProfileItem } from "../../types/domain";
4
- import type { ZapierApiError, ZapierValidationError } from "../../types/errors";
5
- export type GetProfileError = ZapierApiError | ZapierValidationError;
6
3
  export declare const GetProfileSchema: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
7
4
  export type GetProfileOptions = z.infer<typeof GetProfileSchema> & FunctionOptions;
8
- export interface GetProfileSdkFunction {
9
- getProfile: (options?: GetProfileOptions) => Promise<{
10
- data: UserProfileItem;
11
- }>;
12
- }
13
5
  //# sourceMappingURL=schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGhF,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,qBAAqB,CAAC;AAGrE,eAAO,MAAM,gBAAgB,+CAGwB,CAAC;AAGtD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,GAC9D,eAAe,CAAC;AAGlB,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,CACV,OAAO,CAAC,EAAE,iBAAiB,KACxB,OAAO,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;CACzC"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,eAAO,MAAM,gBAAgB,+CAGwB,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,GAC9D,eAAe,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
- // Pure Zod schema - no resolver metadata!
3
2
  export const GetProfileSchema = z
4
3
  .object({})
5
4
  .optional()
@@ -1,32 +1,82 @@
1
- import type { Plugin } from "../../types/plugin";
2
1
  import type { ApiClient } from "../../api";
3
- import type { ActionItem } from "../../types/domain";
4
- import { ListActionsSchema, type ListActionsOptions } from "./schemas";
5
- import type { ManifestPluginProvides } from "../manifest";
6
2
  import type { GetVersionedImplementationId } from "../manifest/schemas";
7
- import type { EventEmissionProvides } from "../eventEmission";
8
- export interface ListActionsPluginProvides {
9
- listActions: (options?: ListActionsOptions) => Promise<{
10
- data: ActionItem[];
11
- nextCursor?: string;
12
- }> & AsyncIterable<{
13
- data: ActionItem[];
14
- nextCursor?: string;
15
- }> & {
16
- items(): AsyncIterable<ActionItem>;
17
- };
3
+ export declare const listActionsPlugin: (sdk: {
18
4
  context: {
19
- meta: {
20
- listActions: {
21
- inputSchema: typeof ListActionsSchema;
22
- };
23
- };
5
+ getResolvedManifest: () => Promise<import("../manifest").Manifest | null>;
6
+ getVersionedImplementationId: (appKey: string) => Promise<string | null>;
7
+ resolveAppKeys: ({ appKeys }: {
8
+ appKeys: string[];
9
+ }) => Promise<import("../..").ResolvedAppLocator[]>;
10
+ updateManifestEntry: (options: import("../manifest").UpdateManifestEntryOptions) => Promise<import("../manifest").UpdateManifestEntryResult>;
11
+ addActionEntry: (options: import("../manifest").AddActionEntryOptions) => Promise<import("../manifest").AddActionEntryResult>;
12
+ findActionEntry: ({ name, manifest, }: {
13
+ name: string;
14
+ manifest: import("../manifest").Manifest;
15
+ }) => import("../manifest").ActionEntry | null;
16
+ listActionEntries: ({ configPath, }?: {
17
+ configPath?: string;
18
+ }) => Promise<Array<[string, import("../manifest").ActionEntry]>>;
19
+ deleteActionEntry: ({ name, configPath, skipWrite, }: {
20
+ name: string;
21
+ configPath?: string;
22
+ skipWrite?: boolean;
23
+ }) => Promise<import("../manifest").Manifest>;
24
+ hasActionEntry: ({ name, manifest, }: {
25
+ name: string;
26
+ manifest: import("../manifest").Manifest;
27
+ }) => boolean;
28
+ findManifestEntry: typeof import("../manifest").findManifestEntry;
29
+ readManifestFromFile: typeof import("../manifest").readManifestFromFile;
30
+ getManifestConnections: () => Promise<Record<string, {
31
+ connectionId: string | number;
32
+ }> | null>;
24
33
  };
25
- }
26
- export declare const listActionsPlugin: Plugin<ManifestPluginProvides & {
34
+ } & {
27
35
  context: {
28
36
  api: ApiClient;
29
37
  getVersionedImplementationId: GetVersionedImplementationId;
30
38
  };
31
- } & EventEmissionProvides, ListActionsPluginProvides>;
39
+ } & {
40
+ context: import("../eventEmission").EventEmissionContext;
41
+ } & {
42
+ context: {
43
+ meta: Record<string, import("../..").PluginMeta>;
44
+ };
45
+ }) => {
46
+ listActions: (options?: (({
47
+ app: string;
48
+ actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined;
49
+ pageSize?: number | undefined;
50
+ maxItems?: number | undefined;
51
+ cursor?: string | undefined;
52
+ } | {
53
+ appKey: string;
54
+ actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined;
55
+ pageSize?: number | undefined;
56
+ maxItems?: number | undefined;
57
+ cursor?: string | undefined;
58
+ }) & {
59
+ cursor?: string;
60
+ pageSize?: number;
61
+ maxItems?: number;
62
+ }) | undefined) => import("../..").PaginatedSdkResult<{
63
+ description: string;
64
+ key: string;
65
+ app_key: string;
66
+ action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
67
+ title: string;
68
+ type: "action";
69
+ id?: string | undefined;
70
+ is_important?: boolean | undefined;
71
+ is_hidden?: boolean | undefined;
72
+ app_version?: string | undefined;
73
+ }>;
74
+ } & {
75
+ context: {
76
+ meta: {
77
+ listActions: import("../..").PluginMeta;
78
+ };
79
+ };
80
+ };
81
+ export type ListActionsPluginProvides = ReturnType<typeof listActionsPlugin>;
32
82
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,iBAAiB,EAEjB,KAAK,kBAAkB,EAExB,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAK9D,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC;QACrD,IAAI,EAAE,UAAU,EAAE,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAC3D,KAAK,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;K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