@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 +1 @@
1
- {"version":3,"file":"authentications.d.ts","sourceRoot":"","sources":["../../../src/plugins/deprecated/authentications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wBAAw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EF,MAAM,MAAM,qCAAqC,GAAG,UAAU,CAC5D,OAAO,6BAA6B,CACrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB1C,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG,UAAU,CAC7D,OAAO,8BAA8B,CACtC,CAAC"}
@@ -11,6 +11,7 @@
11
11
  * - findFirstAuthentication -> findFirstConnection
12
12
  * - findUniqueAuthentication -> findUniqueConnection
13
13
  */
14
+ import { definePlugin } from "../../utils/plugin-utils";
14
15
  import { ListConnectionsQuerySchema } from "../listConnections/schemas";
15
16
  import { GetConnectionParamSchema } from "../getConnection/schemas";
16
17
  import { FindFirstConnectionSchema } from "../findFirstConnection/schemas";
@@ -19,7 +20,7 @@ import { ConnectionItemSchema } from "../../schemas/Connection";
19
20
  /**
20
21
  * @deprecated Use listConnections instead
21
22
  */
22
- export const listAuthenticationsPlugin = (sdk) => ({
23
+ export const listAuthenticationsPlugin = definePlugin((sdk) => ({
23
24
  listAuthentications: sdk.listConnections,
24
25
  context: {
25
26
  meta: {
@@ -33,11 +34,11 @@ export const listAuthenticationsPlugin = (sdk) => ({
33
34
  },
34
35
  },
35
36
  },
36
- });
37
+ }));
37
38
  /**
38
39
  * @deprecated Use getConnection instead
39
40
  */
40
- export const getAuthenticationPlugin = (sdk) => ({
41
+ export const getAuthenticationPlugin = definePlugin((sdk) => ({
41
42
  getAuthentication: sdk.getConnection,
42
43
  context: {
43
44
  meta: {
@@ -51,11 +52,11 @@ export const getAuthenticationPlugin = (sdk) => ({
51
52
  },
52
53
  },
53
54
  },
54
- });
55
+ }));
55
56
  /**
56
57
  * @deprecated Use findFirstConnection instead
57
58
  */
58
- export const findFirstAuthenticationPlugin = (sdk) => ({
59
+ export const findFirstAuthenticationPlugin = definePlugin((sdk) => ({
59
60
  findFirstAuthentication: sdk.findFirstConnection,
60
61
  context: {
61
62
  meta: {
@@ -69,11 +70,11 @@ export const findFirstAuthenticationPlugin = (sdk) => ({
69
70
  },
70
71
  },
71
72
  },
72
- });
73
+ }));
73
74
  /**
74
75
  * @deprecated Use findUniqueConnection instead
75
76
  */
76
- export const findUniqueAuthenticationPlugin = (sdk) => ({
77
+ export const findUniqueAuthenticationPlugin = definePlugin((sdk) => ({
77
78
  findUniqueAuthentication: sdk.findUniqueConnection,
78
79
  context: {
79
80
  meta: {
@@ -87,4 +88,4 @@ export const findUniqueAuthenticationPlugin = (sdk) => ({
87
88
  },
88
89
  },
89
90
  },
90
- });
91
+ }));
@@ -4,7 +4,6 @@
4
4
  * Provides silent telemetry event emission capability to the SDK.
5
5
  * All events are emitted asynchronously and failures are silently handled.
6
6
  */
7
- import type { Plugin } from "../../types/plugin";
8
7
  import type { BaseSdkOptions } from "../../types/sdk";
9
8
  import type { BaseEvent } from "../../types/telemetry-events";
10
9
  import type { EventTransport, TransportConfig } from "./transport";
@@ -30,14 +29,18 @@ export interface EventEmissionContext {
30
29
  close(exitCode?: number): Promise<void>;
31
30
  };
32
31
  }
33
- export interface EventEmissionProvides {
34
- context: EventEmissionContext;
35
- }
36
- export declare const eventEmissionPlugin: Plugin<{
32
+ export declare const eventEmissionPlugin: (sdk: {
37
33
  context: {
38
34
  options?: BaseSdkOptions;
39
35
  };
40
- }, EventEmissionProvides>;
36
+ } & {
37
+ context: {
38
+ meta: Record<string, import("../..").PluginMeta>;
39
+ };
40
+ }) => {
41
+ context: EventEmissionContext;
42
+ };
43
+ export type EventEmissionProvides = ReturnType<typeof eventEmissionPlugin>;
41
44
  export type { EventContext, ApplicationLifecycleEventData, EnhancedErrorEventData, MethodCalledEventData, } from "./types";
42
45
  export { buildApplicationLifecycleEvent, buildErrorEventWithContext, buildErrorEvent, createBaseEvent, buildMethodCalledEvent, } from "./builders";
43
46
  export type { BaseEvent } from "../../types/telemetry-events";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAWnE,OAAO,KAAK,EAAgB,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAyCnE;;;GAGG;AACH,wBAAgB,qBAAqB,SAEpC;AAGD,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,WAAW,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;CACrC;AAGD,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE;QACb,SAAS,EAAE,cAAc,CAAC;QAC1B,MAAM,EAAE,mBAAmB,CAAC;QAE5B,IAAI,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;QAErD,eAAe,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;QAEtC,gBAAgB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAC;QAEpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QAIvB,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACzC,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,oBAAoB,CAAC;CAC/B;AAyFD,eAAO,MAAM,mBAAmB,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BAAqB,GAAG,IAAI,CAAC;QAEpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QAIvB,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACzC,CAAC;CACH;AAyFD,eAAO,MAAM,mBAAmB;aAEnB;QAAE,OAAO,CAAC,EAAE,cAAc,CAAA;KAAE;;;;;;aACxB,oBAAoB;CAsVpC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAG3E,YAAY,EACV,YAAY,EACZ,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,8BAA8B,EAC9B,0BAA0B,EAC1B,eAAe,EACf,eAAe,EACf,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,cAAc,SAAS,CAAC"}
@@ -4,6 +4,7 @@
4
4
  * Provides silent telemetry event emission capability to the SDK.
5
5
  * All events are emitted asynchronously and failures are silently handled.
6
6
  */
7
+ import { definePlugin } from "../../utils/plugin-utils";
7
8
  import { createTransport } from "./transport";
8
9
  import { generateEventId, getCurrentTimestamp, getReleaseId } from "./utils";
9
10
  import { extractUserIdsFromJwt } from "../../api/auth";
@@ -102,7 +103,7 @@ function getTransportConfig(options) {
102
103
  endpoint,
103
104
  };
104
105
  }
105
- export const eventEmissionPlugin = (sdk) => {
106
+ export const eventEmissionPlugin = definePlugin((sdk) => {
106
107
  const options = sdk.context.options ?? {};
107
108
  const defaultTransport = getTransportConfig({
108
109
  trackingBaseUrl: options.trackingBaseUrl,
@@ -370,6 +371,6 @@ export const eventEmissionPlugin = (sdk) => {
370
371
  },
371
372
  },
372
373
  };
373
- };
374
+ });
374
375
  export { buildApplicationLifecycleEvent, buildErrorEventWithContext, buildErrorEvent, createBaseEvent, buildMethodCalledEvent, } from "./builders";
375
376
  export * from "./utils";
@@ -1,8 +1,6 @@
1
- import type { Plugin } from "../../types/plugin";
2
1
  import type { ApiClient } from "../../api";
3
2
  import type { ConnectionsPluginProvides } from "../connections";
4
3
  import { z } from "zod";
5
- import type { EventEmissionProvides } from "../eventEmission";
6
4
  export interface ZapierFetchInitOptions extends RequestInit {
7
5
  /** @deprecated Use `connection` instead. */
8
6
  connectionId?: string | number;
@@ -13,7 +11,21 @@ export interface ZapierFetchInitOptions extends RequestInit {
13
11
  /** Maximum seconds to wait for a response, subject to a server-side limit. */
14
12
  maxTime?: number;
15
13
  }
16
- export interface FetchPluginProvides {
14
+ /**
15
+ * Fetch plugin, the primary way to make authenticated HTTP requests through Zapier's Relay service.
16
+ * Mirrors the native fetch(url, init?) signature with additional Zapier-specific options.
17
+ */
18
+ export declare const fetchPlugin: (sdk: {
19
+ context: {
20
+ api: ApiClient;
21
+ } & ConnectionsPluginProvides["context"];
22
+ } & {
23
+ context: import("../eventEmission").EventEmissionContext;
24
+ } & {
25
+ context: {
26
+ meta: Record<string, import("../..").PluginMeta>;
27
+ };
28
+ }) => {
17
29
  fetch: (url: string | URL, init?: ZapierFetchInitOptions) => Promise<Response>;
18
30
  context: {
19
31
  meta: {
@@ -22,22 +34,33 @@ export interface FetchPluginProvides {
22
34
  packages: string[];
23
35
  categories: string[];
24
36
  returnType: string;
25
- inputParameters: Array<{
37
+ inputParameters: ({
26
38
  name: string;
27
- schema: z.ZodSchema;
28
- }>;
39
+ schema: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>;
40
+ } | {
41
+ name: string;
42
+ schema: z.ZodOptional<z.ZodObject<{
43
+ method: z.ZodOptional<z.ZodEnum<{
44
+ POST: "POST";
45
+ GET: "GET";
46
+ DELETE: "DELETE";
47
+ PUT: "PUT";
48
+ PATCH: "PATCH";
49
+ HEAD: "HEAD";
50
+ OPTIONS: "OPTIONS";
51
+ }>>;
52
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
53
+ body: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<FormData, FormData>, z.ZodCustom<URLSearchParams, URLSearchParams>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
54
+ connectionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
55
+ connection: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
56
+ authenticationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
57
+ callbackUrl: z.ZodOptional<z.ZodString>;
58
+ maxTime: z.ZodOptional<z.ZodNumber>;
59
+ }, z.core.$strip>>;
60
+ })[];
29
61
  };
30
62
  };
31
63
  };
32
- }
33
- /**
34
- * Fetch plugin — the primary way to make authenticated HTTP requests through Zapier's Relay service.
35
- * Mirrors the native fetch(url, init?) signature with additional Zapier-specific options.
36
- */
37
- export declare const fetchPlugin: Plugin<{
38
- context: {
39
- api: ApiClient;
40
- } & ConnectionsPluginProvides["context"];
41
- } & EventEmissionProvides, // no SDK dependencies, requires api, connections, and eventEmission in context
42
- FetchPluginProvides>;
64
+ };
65
+ export type FetchPluginProvides = ReturnType<typeof fetchPlugin>;
43
66
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch/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,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAMhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAiB9D,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,4CAA4C;IAC5C,YAAY,CAAC,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AAQ,WAAW;IACzD,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAkHD;;;GAGG;AACH,eAAO,MAAM,WAAW;aAGT;QAAE,GAAG,EAAE,SAAS,CAAA;KAAE,GAAG,yBAAyB,CAAC,SAAS,CAAC;;;;;;;;iBAK3D,MAAM,GAAG,GAAG,SACV,sBAAsB,KAC5B,OAAO,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6JzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { definePlugin } from "../../utils/plugin-utils";
1
2
  import { ZapierRelayError, ZapierTimeoutError } from "../../types/errors";
2
3
  import { FetchUrlSchema, FetchInitSchema, FetchInitZapierFieldsSchema, } from "./schemas";
3
4
  import { z } from "zod";
@@ -93,10 +94,10 @@ const FetchInitSdkValidationSchema = z
93
94
  .optional();
94
95
  const validateFetchInit = createValidator(FetchInitSdkValidationSchema);
95
96
  /**
96
- * Fetch plugin the primary way to make authenticated HTTP requests through Zapier's Relay service.
97
+ * Fetch plugin, the primary way to make authenticated HTTP requests through Zapier's Relay service.
97
98
  * Mirrors the native fetch(url, init?) signature with additional Zapier-specific options.
98
99
  */
99
- export const fetchPlugin = (sdk) => {
100
+ export const fetchPlugin = definePlugin((sdk) => {
100
101
  return {
101
102
  fetch: async function fetch(url, init) {
102
103
  return runWithTelemetryContext(async () => {
@@ -125,7 +126,8 @@ export const fetchPlugin = (sdk) => {
125
126
  }
126
127
  }
127
128
  if (resolvedConnectionId) {
128
- headers["X-Relay-Authentication-Id"] = String(resolvedConnectionId);
129
+ headers["X-Relay-Authentication-Id"] =
130
+ String(resolvedConnectionId);
129
131
  }
130
132
  if (callbackUrl) {
131
133
  headers["X-Relay-Callback-Url"] = callbackUrl;
@@ -223,4 +225,4 @@ export const fetchPlugin = (sdk) => {
223
225
  },
224
226
  },
225
227
  };
226
- };
228
+ });
@@ -1,20 +1,115 @@
1
- import type { Plugin } from "../../types/plugin";
2
- import type { ConnectionItem } from "../../types/domain";
3
- import { FindFirstConnectionSchema, type FindFirstConnectionOptions } from "./schemas";
4
- import type { ListConnectionsPluginProvides } from "../listConnections";
5
- import type { EventEmissionProvides } from "../eventEmission";
6
- export interface FindFirstConnectionPluginProvides {
7
- findFirstConnection: (options?: FindFirstConnectionOptions) => Promise<{
8
- data: ConnectionItem;
1
+ export declare const findFirstConnectionPlugin: (sdk: {
2
+ listConnections: (options?: ({
3
+ title?: string | undefined;
4
+ search?: string | undefined;
5
+ owner?: string | undefined;
6
+ app?: string | undefined;
7
+ appKey?: string | undefined;
8
+ connections?: string[] | undefined;
9
+ connectionIds?: string[] | undefined;
10
+ authenticationIds?: string[] | undefined;
11
+ account?: string | undefined;
12
+ accountId?: string | undefined;
13
+ includeShared?: boolean | undefined;
14
+ isExpired?: boolean | undefined;
15
+ expired?: boolean | undefined;
16
+ pageSize?: number | undefined;
17
+ maxItems?: number | undefined;
18
+ cursor?: string | undefined;
19
+ } & {
20
+ cursor?: string;
21
+ pageSize?: number;
22
+ maxItems?: number;
23
+ }) | undefined) => import("../..").PaginatedSdkResult<{
24
+ date: string;
25
+ is_invite_only: boolean;
26
+ is_private: boolean;
27
+ shared_with_all: boolean;
28
+ id: string;
29
+ account_id: string;
30
+ title?: string | null | undefined;
31
+ lastchanged?: string | undefined;
32
+ destination_selected_api?: string | null | undefined;
33
+ is_stale?: string | undefined;
34
+ is_shared?: string | undefined;
35
+ marked_stale_at?: string | null | undefined;
36
+ label?: string | null | undefined;
37
+ identifier?: string | null | undefined;
38
+ url?: string | undefined;
39
+ groups?: Record<string, unknown>[] | undefined;
40
+ members?: string | undefined;
41
+ permissions?: Record<string, boolean> | undefined;
42
+ public_id?: string | undefined;
43
+ account_public_id?: string | undefined;
44
+ customuser_public_id?: string | undefined;
45
+ implementation_id?: string | undefined;
46
+ profile_id?: string | undefined;
47
+ is_expired?: string | undefined;
48
+ expired_at?: string | null | undefined;
49
+ app_key?: string | undefined;
50
+ app_version?: string | undefined;
9
51
  }>;
52
+ } & {
10
53
  context: {
11
54
  meta: {
12
- findFirstConnection: {
13
- inputSchema: typeof FindFirstConnectionSchema;
14
- };
55
+ listConnections: import("../..").PluginMeta;
15
56
  };
16
57
  };
17
- }
18
- export declare const findFirstConnectionPlugin: Plugin<ListConnectionsPluginProvides & EventEmissionProvides, // requires listConnections in SDK, eventEmission in context
19
- FindFirstConnectionPluginProvides>;
58
+ } & {
59
+ context: import("../eventEmission").EventEmissionContext;
60
+ } & {
61
+ context: {
62
+ meta: Record<string, import("../..").PluginMeta>;
63
+ };
64
+ }) => {
65
+ findFirstConnection: (options?: {
66
+ title?: string | undefined;
67
+ search?: string | undefined;
68
+ appKey?: string | undefined;
69
+ app?: string | undefined;
70
+ owner?: string | undefined;
71
+ account?: string | undefined;
72
+ accountId?: string | undefined;
73
+ includeShared?: boolean | undefined;
74
+ isExpired?: boolean | undefined;
75
+ expired?: boolean | undefined;
76
+ } | undefined) => Promise<{
77
+ data: {
78
+ date: string;
79
+ is_invite_only: boolean;
80
+ is_private: boolean;
81
+ shared_with_all: boolean;
82
+ id: string;
83
+ account_id: string;
84
+ title?: string | null | undefined;
85
+ lastchanged?: string | undefined;
86
+ destination_selected_api?: string | null | undefined;
87
+ is_stale?: string | undefined;
88
+ is_shared?: string | undefined;
89
+ marked_stale_at?: string | null | undefined;
90
+ label?: string | null | undefined;
91
+ identifier?: string | null | undefined;
92
+ url?: string | undefined;
93
+ groups?: Record<string, unknown>[] | undefined;
94
+ members?: string | undefined;
95
+ permissions?: Record<string, boolean> | undefined;
96
+ public_id?: string | undefined;
97
+ account_public_id?: string | undefined;
98
+ customuser_public_id?: string | undefined;
99
+ implementation_id?: string | undefined;
100
+ profile_id?: string | undefined;
101
+ is_expired?: string | undefined;
102
+ expired_at?: string | null | undefined;
103
+ app_key?: string | undefined;
104
+ app_version?: string | undefined;
105
+ };
106
+ }>;
107
+ } & {
108
+ context: {
109
+ meta: {
110
+ findFirstConnection: import("../..").PluginMeta;
111
+ };
112
+ };
113
+ };
114
+ export type FindFirstConnectionPluginProvides = ReturnType<typeof findFirstConnectionPlugin>;
20
115
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstConnection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,yBAAyB,EACzB,KAAK,0BAA0B,EAChC,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAGxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAG9D,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,EAAE,CACnB,OAAO,CAAC,EAAE,0BAA0B,KACjC,OAAO,CAAC;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,CAAC,CAAC;IACvC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,mBAAmB,EAAE;gBACnB,WAAW,EAAE,OAAO,yBAAyB,CAAC;aAC/C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAC5C,6BAA6B,GAAG,qBAAqB,EAAE,4DAA4D;AACnH,iCAAiC,CA4ClC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstConnection/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBrC,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,UAAU,CACxD,OAAO,yBAAyB,CACjC,CAAC"}
@@ -1,11 +1,16 @@
1
- import { FindFirstConnectionSchema, } from "./schemas";
2
- import { createFunction } from "../../utils/function-utils";
1
+ import { definePlugin } from "../../utils/plugin-utils";
2
+ import { createPluginMethod } from "../../utils/plugin-utils";
3
+ import { FindFirstConnectionSchema } from "./schemas";
3
4
  import { ConnectionItemSchema } from "../../schemas/Connection";
4
5
  import { ZapierResourceNotFoundError } from "../../types/errors";
5
- import { createTelemetryCallback } from "../../utils/telemetry-utils";
6
- export const findFirstConnectionPlugin = (sdk) => {
7
- async function findFirstConnection(options = {}) {
8
- // Use listConnections with maxItems 1 to get the first result
6
+ export const findFirstConnectionPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
7
+ name: "findFirstConnection",
8
+ categories: ["connection"],
9
+ type: "item",
10
+ itemType: "Connection",
11
+ inputSchema: FindFirstConnectionSchema,
12
+ outputSchema: ConnectionItemSchema,
13
+ handler: async ({ sdk, options = {} }) => {
9
14
  const connectionsResponse = await sdk.listConnections({
10
15
  ...options,
11
16
  maxItems: 1,
@@ -13,23 +18,6 @@ export const findFirstConnectionPlugin = (sdk) => {
13
18
  if (connectionsResponse.data.length === 0) {
14
19
  throw new ZapierResourceNotFoundError("No connection found matching the specified criteria", { resourceType: "Connection" });
15
20
  }
16
- return {
17
- data: connectionsResponse.data[0],
18
- };
19
- }
20
- const findFirstConnectionDefinition = createFunction(findFirstConnection, FindFirstConnectionSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, findFirstConnection.name));
21
- return {
22
- findFirstConnection: findFirstConnectionDefinition,
23
- context: {
24
- meta: {
25
- findFirstConnection: {
26
- categories: ["connection"],
27
- type: "item",
28
- itemType: "Connection",
29
- inputSchema: FindFirstConnectionSchema,
30
- outputSchema: ConnectionItemSchema,
31
- },
32
- },
33
- },
34
- };
35
- };
21
+ return { data: connectionsResponse.data[0] };
22
+ },
23
+ }));
@@ -1,6 +1,5 @@
1
1
  import type { z } from "zod";
2
2
  import type { ConnectionItem } from "../../types/domain";
3
- import type { ZapierAuthenticationError, ZapierApiError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
4
3
  export declare const FindFirstConnectionSchema: z.ZodObject<{
5
4
  title: z.ZodOptional<z.ZodString>;
6
5
  search: z.ZodOptional<z.ZodString>;
@@ -18,7 +17,6 @@ export declare const FindFirstConnectionSchema: z.ZodObject<{
18
17
  expired: z.ZodOptional<z.ZodBoolean>;
19
18
  }, z.core.$strip>;
20
19
  export type FindFirstConnectionOptions = z.infer<typeof FindFirstConnectionSchema>;
21
- export type FindFirstConnectionError = ZapierAuthenticationError | ZapierApiError | ZapierValidationError | ZapierUnknownError;
22
20
  export interface FindFirstConnectionSdkFunction {
23
21
  findFirstConnection: (options?: FindFirstConnectionOptions) => Promise<{
24
22
  data: ConnectionItem | null;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstConnection/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;iBAOwB,CAAC;AAG/D,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,yBAAyB,CACjC,CAAC;AAGF,MAAM,MAAM,wBAAwB,GAChC,yBAAyB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,8BAA8B;IAC7C,mBAAmB,EAAE,CACnB,OAAO,CAAC,EAAE,0BAA0B,KACjC,OAAO,CAAC;QAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CAC/C"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstConnection/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;iBAOwB,CAAC;AAG/D,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,yBAAyB,CACjC,CAAC;AAGF,MAAM,WAAW,8BAA8B;IAC7C,mBAAmB,EAAE,CACnB,OAAO,CAAC,EAAE,0BAA0B,KACjC,OAAO,CAAC;QAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CAC/C"}
@@ -1,20 +1,115 @@
1
- import type { Plugin } from "../../types/plugin";
2
- import type { ConnectionItem } from "../../types/domain";
3
- import { FindUniqueConnectionSchema, type FindUniqueConnectionOptions } from "./schemas";
4
- import type { ListConnectionsPluginProvides } from "../listConnections";
5
- import type { EventEmissionProvides } from "../eventEmission";
6
- export interface FindUniqueConnectionPluginProvides {
7
- findUniqueConnection: (options?: FindUniqueConnectionOptions) => Promise<{
8
- data: ConnectionItem;
1
+ export declare const findUniqueConnectionPlugin: (sdk: {
2
+ listConnections: (options?: ({
3
+ title?: string | undefined;
4
+ search?: string | undefined;
5
+ owner?: string | undefined;
6
+ app?: string | undefined;
7
+ appKey?: string | undefined;
8
+ connections?: string[] | undefined;
9
+ connectionIds?: string[] | undefined;
10
+ authenticationIds?: string[] | undefined;
11
+ account?: string | undefined;
12
+ accountId?: string | undefined;
13
+ includeShared?: boolean | undefined;
14
+ isExpired?: boolean | undefined;
15
+ expired?: boolean | undefined;
16
+ pageSize?: number | undefined;
17
+ maxItems?: number | undefined;
18
+ cursor?: string | undefined;
19
+ } & {
20
+ cursor?: string;
21
+ pageSize?: number;
22
+ maxItems?: number;
23
+ }) | undefined) => import("../..").PaginatedSdkResult<{
24
+ date: string;
25
+ is_invite_only: boolean;
26
+ is_private: boolean;
27
+ shared_with_all: boolean;
28
+ id: string;
29
+ account_id: string;
30
+ title?: string | null | undefined;
31
+ lastchanged?: string | undefined;
32
+ destination_selected_api?: string | null | undefined;
33
+ is_stale?: string | undefined;
34
+ is_shared?: string | undefined;
35
+ marked_stale_at?: string | null | undefined;
36
+ label?: string | null | undefined;
37
+ identifier?: string | null | undefined;
38
+ url?: string | undefined;
39
+ groups?: Record<string, unknown>[] | undefined;
40
+ members?: string | undefined;
41
+ permissions?: Record<string, boolean> | undefined;
42
+ public_id?: string | undefined;
43
+ account_public_id?: string | undefined;
44
+ customuser_public_id?: string | undefined;
45
+ implementation_id?: string | undefined;
46
+ profile_id?: string | undefined;
47
+ is_expired?: string | undefined;
48
+ expired_at?: string | null | undefined;
49
+ app_key?: string | undefined;
50
+ app_version?: string | undefined;
9
51
  }>;
52
+ } & {
10
53
  context: {
11
54
  meta: {
12
- findUniqueConnection: {
13
- inputSchema: typeof FindUniqueConnectionSchema;
14
- };
55
+ listConnections: import("../..").PluginMeta;
15
56
  };
16
57
  };
17
- }
18
- export declare const findUniqueConnectionPlugin: Plugin<ListConnectionsPluginProvides & EventEmissionProvides, // requires listConnections in SDK, eventEmission in context
19
- FindUniqueConnectionPluginProvides>;
58
+ } & {
59
+ context: import("../eventEmission").EventEmissionContext;
60
+ } & {
61
+ context: {
62
+ meta: Record<string, import("../..").PluginMeta>;
63
+ };
64
+ }) => {
65
+ findUniqueConnection: (options?: {
66
+ title?: string | undefined;
67
+ search?: string | undefined;
68
+ appKey?: string | undefined;
69
+ app?: string | undefined;
70
+ owner?: string | undefined;
71
+ account?: string | undefined;
72
+ accountId?: string | undefined;
73
+ includeShared?: boolean | undefined;
74
+ isExpired?: boolean | undefined;
75
+ expired?: boolean | undefined;
76
+ } | undefined) => Promise<{
77
+ data: {
78
+ date: string;
79
+ is_invite_only: boolean;
80
+ is_private: boolean;
81
+ shared_with_all: boolean;
82
+ id: string;
83
+ account_id: string;
84
+ title?: string | null | undefined;
85
+ lastchanged?: string | undefined;
86
+ destination_selected_api?: string | null | undefined;
87
+ is_stale?: string | undefined;
88
+ is_shared?: string | undefined;
89
+ marked_stale_at?: string | null | undefined;
90
+ label?: string | null | undefined;
91
+ identifier?: string | null | undefined;
92
+ url?: string | undefined;
93
+ groups?: Record<string, unknown>[] | undefined;
94
+ members?: string | undefined;
95
+ permissions?: Record<string, boolean> | undefined;
96
+ public_id?: string | undefined;
97
+ account_public_id?: string | undefined;
98
+ customuser_public_id?: string | undefined;
99
+ implementation_id?: string | undefined;
100
+ profile_id?: string | undefined;
101
+ is_expired?: string | undefined;
102
+ expired_at?: string | null | undefined;
103
+ app_key?: string | undefined;
104
+ app_version?: string | undefined;
105
+ };
106
+ }>;
107
+ } & {
108
+ context: {
109
+ meta: {
110
+ findUniqueConnection: import("../..").PluginMeta;
111
+ };
112
+ };
113
+ };
114
+ export type FindUniqueConnectionPluginProvides = ReturnType<typeof findUniqueConnectionPlugin>;
20
115
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueConnection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,0BAA0B,EAC1B,KAAK,2BAA2B,EACjC,MAAM,WAAW,CAAC;AAMnB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAG9D,MAAM,WAAW,kCAAkC;IACjD,oBAAoB,EAAE,CACpB,OAAO,CAAC,EAAE,2BAA2B,KAClC,OAAO,CAAC;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,CAAC,CAAC;IACvC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,oBAAoB,EAAE;gBACpB,WAAW,EAAE,OAAO,0BAA0B,CAAC;aAChD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAC7C,6BAA6B,GAAG,qBAAqB,EAAE,4DAA4D;AACnH,kCAAkC,CAoDnC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueConnection/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BtC,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,UAAU,CACzD,OAAO,0BAA0B,CAClC,CAAC"}