@zapier/zapier-sdk 0.18.4 → 0.19.0

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 (372) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +43 -31
  3. package/dist/index.cjs +365 -64
  4. package/dist/index.d.mts +220 -33
  5. package/dist/index.d.ts +2541 -40
  6. package/dist/index.mjs +345 -63
  7. package/package.json +14 -13
  8. package/dist/api/auth.d.ts +0 -19
  9. package/dist/api/auth.d.ts.map +0 -1
  10. package/dist/api/auth.js +0 -70
  11. package/dist/api/auth.test.d.ts +0 -2
  12. package/dist/api/auth.test.d.ts.map +0 -1
  13. package/dist/api/auth.test.js +0 -220
  14. package/dist/api/client.d.ts +0 -9
  15. package/dist/api/client.d.ts.map +0 -1
  16. package/dist/api/client.js +0 -356
  17. package/dist/api/client.test.d.ts +0 -2
  18. package/dist/api/client.test.d.ts.map +0 -1
  19. package/dist/api/client.test.js +0 -96
  20. package/dist/api/debug.d.ts +0 -14
  21. package/dist/api/debug.d.ts.map +0 -1
  22. package/dist/api/debug.js +0 -131
  23. package/dist/api/debug.test.d.ts +0 -2
  24. package/dist/api/debug.test.d.ts.map +0 -1
  25. package/dist/api/debug.test.js +0 -59
  26. package/dist/api/index.d.ts +0 -30
  27. package/dist/api/index.d.ts.map +0 -1
  28. package/dist/api/index.js +0 -43
  29. package/dist/api/polling.d.ts +0 -46
  30. package/dist/api/polling.d.ts.map +0 -1
  31. package/dist/api/polling.js +0 -139
  32. package/dist/api/polling.test.d.ts +0 -2
  33. package/dist/api/polling.test.d.ts.map +0 -1
  34. package/dist/api/polling.test.js +0 -318
  35. package/dist/api/schemas.d.ts +0 -422
  36. package/dist/api/schemas.d.ts.map +0 -1
  37. package/dist/api/schemas.js +0 -322
  38. package/dist/api/types.d.ts +0 -83
  39. package/dist/api/types.d.ts.map +0 -1
  40. package/dist/api/types.js +0 -1
  41. package/dist/auth.d.ts +0 -52
  42. package/dist/auth.d.ts.map +0 -1
  43. package/dist/auth.js +0 -72
  44. package/dist/auth.test.d.ts +0 -2
  45. package/dist/auth.test.d.ts.map +0 -1
  46. package/dist/auth.test.js +0 -102
  47. package/dist/constants.d.ts +0 -14
  48. package/dist/constants.d.ts.map +0 -1
  49. package/dist/constants.js +0 -13
  50. package/dist/index.d.ts.map +0 -1
  51. package/dist/index.js +0 -42
  52. package/dist/plugins/api/index.d.ts +0 -12
  53. package/dist/plugins/api/index.d.ts.map +0 -1
  54. package/dist/plugins/api/index.js +0 -24
  55. package/dist/plugins/apps/index.d.ts +0 -15
  56. package/dist/plugins/apps/index.d.ts.map +0 -1
  57. package/dist/plugins/apps/index.js +0 -112
  58. package/dist/plugins/apps/schemas.d.ts +0 -42
  59. package/dist/plugins/apps/schemas.d.ts.map +0 -1
  60. package/dist/plugins/apps/schemas.js +0 -14
  61. package/dist/plugins/eventEmission/builders.d.ts +0 -14
  62. package/dist/plugins/eventEmission/builders.d.ts.map +0 -1
  63. package/dist/plugins/eventEmission/builders.js +0 -109
  64. package/dist/plugins/eventEmission/index.d.ts +0 -38
  65. package/dist/plugins/eventEmission/index.d.ts.map +0 -1
  66. package/dist/plugins/eventEmission/index.js +0 -336
  67. package/dist/plugins/eventEmission/index.test.d.ts +0 -5
  68. package/dist/plugins/eventEmission/index.test.d.ts.map +0 -1
  69. package/dist/plugins/eventEmission/index.test.js +0 -581
  70. package/dist/plugins/eventEmission/transport.d.ts +0 -27
  71. package/dist/plugins/eventEmission/transport.d.ts.map +0 -1
  72. package/dist/plugins/eventEmission/transport.js +0 -104
  73. package/dist/plugins/eventEmission/transport.test.d.ts +0 -5
  74. package/dist/plugins/eventEmission/transport.test.d.ts.map +0 -1
  75. package/dist/plugins/eventEmission/transport.test.js +0 -164
  76. package/dist/plugins/eventEmission/types.d.ts +0 -63
  77. package/dist/plugins/eventEmission/types.d.ts.map +0 -1
  78. package/dist/plugins/eventEmission/types.js +0 -1
  79. package/dist/plugins/eventEmission/utils.d.ts +0 -45
  80. package/dist/plugins/eventEmission/utils.d.ts.map +0 -1
  81. package/dist/plugins/eventEmission/utils.js +0 -114
  82. package/dist/plugins/fetch/index.d.ts +0 -36
  83. package/dist/plugins/fetch/index.d.ts.map +0 -1
  84. package/dist/plugins/fetch/index.js +0 -62
  85. package/dist/plugins/fetch/schemas.d.ts +0 -19
  86. package/dist/plugins/fetch/schemas.d.ts.map +0 -1
  87. package/dist/plugins/fetch/schemas.js +0 -31
  88. package/dist/plugins/findFirstAuthentication/index.d.ts +0 -21
  89. package/dist/plugins/findFirstAuthentication/index.d.ts.map +0 -1
  90. package/dist/plugins/findFirstAuthentication/index.js +0 -36
  91. package/dist/plugins/findFirstAuthentication/index.test.d.ts +0 -2
  92. package/dist/plugins/findFirstAuthentication/index.test.d.ts.map +0 -1
  93. package/dist/plugins/findFirstAuthentication/index.test.js +0 -177
  94. package/dist/plugins/findFirstAuthentication/schemas.d.ts +0 -20
  95. package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +0 -1
  96. package/dist/plugins/findFirstAuthentication/schemas.js +0 -18
  97. package/dist/plugins/findUniqueAuthentication/index.d.ts +0 -21
  98. package/dist/plugins/findUniqueAuthentication/index.d.ts.map +0 -1
  99. package/dist/plugins/findUniqueAuthentication/index.js +0 -39
  100. package/dist/plugins/findUniqueAuthentication/index.test.d.ts +0 -2
  101. package/dist/plugins/findUniqueAuthentication/index.test.d.ts.map +0 -1
  102. package/dist/plugins/findUniqueAuthentication/index.test.js +0 -159
  103. package/dist/plugins/findUniqueAuthentication/schemas.d.ts +0 -20
  104. package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +0 -1
  105. package/dist/plugins/findUniqueAuthentication/schemas.js +0 -18
  106. package/dist/plugins/getAction/index.d.ts +0 -25
  107. package/dist/plugins/getAction/index.d.ts.map +0 -1
  108. package/dist/plugins/getAction/index.js +0 -42
  109. package/dist/plugins/getAction/index.test.d.ts +0 -2
  110. package/dist/plugins/getAction/index.test.d.ts.map +0 -1
  111. package/dist/plugins/getAction/index.test.js +0 -211
  112. package/dist/plugins/getAction/schemas.d.ts +0 -30
  113. package/dist/plugins/getAction/schemas.d.ts.map +0 -1
  114. package/dist/plugins/getAction/schemas.js +0 -12
  115. package/dist/plugins/getApp/index.d.ts +0 -21
  116. package/dist/plugins/getApp/index.d.ts.map +0 -1
  117. package/dist/plugins/getApp/index.js +0 -44
  118. package/dist/plugins/getApp/index.test.d.ts +0 -2
  119. package/dist/plugins/getApp/index.test.d.ts.map +0 -1
  120. package/dist/plugins/getApp/index.test.js +0 -157
  121. package/dist/plugins/getApp/schemas.d.ts +0 -16
  122. package/dist/plugins/getApp/schemas.d.ts.map +0 -1
  123. package/dist/plugins/getApp/schemas.js +0 -8
  124. package/dist/plugins/getAuthentication/index.d.ts +0 -21
  125. package/dist/plugins/getAuthentication/index.d.ts.map +0 -1
  126. package/dist/plugins/getAuthentication/index.js +0 -29
  127. package/dist/plugins/getAuthentication/index.test.d.ts +0 -2
  128. package/dist/plugins/getAuthentication/index.test.d.ts.map +0 -1
  129. package/dist/plugins/getAuthentication/index.test.js +0 -106
  130. package/dist/plugins/getAuthentication/schemas.d.ts +0 -7
  131. package/dist/plugins/getAuthentication/schemas.d.ts.map +0 -1
  132. package/dist/plugins/getAuthentication/schemas.js +0 -1
  133. package/dist/plugins/getInputFieldsSchema/index.d.ts +0 -23
  134. package/dist/plugins/getInputFieldsSchema/index.d.ts.map +0 -1
  135. package/dist/plugins/getInputFieldsSchema/index.js +0 -53
  136. package/dist/plugins/getInputFieldsSchema/index.test.d.ts +0 -2
  137. package/dist/plugins/getInputFieldsSchema/index.test.d.ts.map +0 -1
  138. package/dist/plugins/getInputFieldsSchema/index.test.js +0 -291
  139. package/dist/plugins/getInputFieldsSchema/schemas.d.ts +0 -28
  140. package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +0 -1
  141. package/dist/plugins/getInputFieldsSchema/schemas.js +0 -13
  142. package/dist/plugins/getProfile/index.d.ts +0 -25
  143. package/dist/plugins/getProfile/index.d.ts.map +0 -1
  144. package/dist/plugins/getProfile/index.js +0 -39
  145. package/dist/plugins/getProfile/schemas.d.ts +0 -13
  146. package/dist/plugins/getProfile/schemas.d.ts.map +0 -1
  147. package/dist/plugins/getProfile/schemas.js +0 -6
  148. package/dist/plugins/listActions/index.d.ts +0 -30
  149. package/dist/plugins/listActions/index.d.ts.map +0 -1
  150. package/dist/plugins/listActions/index.js +0 -75
  151. package/dist/plugins/listActions/index.test.d.ts +0 -2
  152. package/dist/plugins/listActions/index.test.d.ts.map +0 -1
  153. package/dist/plugins/listActions/index.test.js +0 -453
  154. package/dist/plugins/listActions/schemas.d.ts +0 -35
  155. package/dist/plugins/listActions/schemas.d.ts.map +0 -1
  156. package/dist/plugins/listActions/schemas.js +0 -22
  157. package/dist/plugins/listApps/index.d.ts +0 -19
  158. package/dist/plugins/listApps/index.d.ts.map +0 -1
  159. package/dist/plugins/listApps/index.js +0 -67
  160. package/dist/plugins/listApps/index.test.d.ts +0 -2
  161. package/dist/plugins/listApps/index.test.d.ts.map +0 -1
  162. package/dist/plugins/listApps/index.test.js +0 -121
  163. package/dist/plugins/listApps/schemas.d.ts +0 -47
  164. package/dist/plugins/listApps/schemas.d.ts.map +0 -1
  165. package/dist/plugins/listApps/schemas.js +0 -49
  166. package/dist/plugins/listAuthentications/index.d.ts +0 -24
  167. package/dist/plugins/listAuthentications/index.d.ts.map +0 -1
  168. package/dist/plugins/listAuthentications/index.js +0 -77
  169. package/dist/plugins/listAuthentications/index.test.d.ts +0 -2
  170. package/dist/plugins/listAuthentications/index.test.d.ts.map +0 -1
  171. package/dist/plugins/listAuthentications/index.test.js +0 -848
  172. package/dist/plugins/listAuthentications/schemas.d.ts +0 -30
  173. package/dist/plugins/listAuthentications/schemas.d.ts.map +0 -1
  174. package/dist/plugins/listAuthentications/schemas.js +0 -32
  175. package/dist/plugins/listInputFieldChoices/index.d.ts +0 -33
  176. package/dist/plugins/listInputFieldChoices/index.d.ts.map +0 -1
  177. package/dist/plugins/listInputFieldChoices/index.js +0 -115
  178. package/dist/plugins/listInputFieldChoices/index.test.d.ts +0 -2
  179. package/dist/plugins/listInputFieldChoices/index.test.d.ts.map +0 -1
  180. package/dist/plugins/listInputFieldChoices/index.test.js +0 -717
  181. package/dist/plugins/listInputFieldChoices/schemas.d.ts +0 -43
  182. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +0 -1
  183. package/dist/plugins/listInputFieldChoices/schemas.js +0 -65
  184. package/dist/plugins/listInputFields/index.d.ts +0 -34
  185. package/dist/plugins/listInputFields/index.d.ts.map +0 -1
  186. package/dist/plugins/listInputFields/index.js +0 -204
  187. package/dist/plugins/listInputFields/index.test.d.ts +0 -2
  188. package/dist/plugins/listInputFields/index.test.d.ts.map +0 -1
  189. package/dist/plugins/listInputFields/index.test.js +0 -359
  190. package/dist/plugins/listInputFields/schemas.d.ts +0 -35
  191. package/dist/plugins/listInputFields/schemas.d.ts.map +0 -1
  192. package/dist/plugins/listInputFields/schemas.js +0 -23
  193. package/dist/plugins/manifest/index.d.ts +0 -85
  194. package/dist/plugins/manifest/index.d.ts.map +0 -1
  195. package/dist/plugins/manifest/index.js +0 -376
  196. package/dist/plugins/manifest/index.test.d.ts +0 -2
  197. package/dist/plugins/manifest/index.test.d.ts.map +0 -1
  198. package/dist/plugins/manifest/index.test.js +0 -1139
  199. package/dist/plugins/manifest/schemas.d.ts +0 -57
  200. package/dist/plugins/manifest/schemas.d.ts.map +0 -1
  201. package/dist/plugins/manifest/schemas.js +0 -50
  202. package/dist/plugins/registry/index.d.ts +0 -21
  203. package/dist/plugins/registry/index.d.ts.map +0 -1
  204. package/dist/plugins/registry/index.js +0 -117
  205. package/dist/plugins/request/index.d.ts +0 -21
  206. package/dist/plugins/request/index.d.ts.map +0 -1
  207. package/dist/plugins/request/index.js +0 -76
  208. package/dist/plugins/request/index.test.d.ts +0 -2
  209. package/dist/plugins/request/index.test.d.ts.map +0 -1
  210. package/dist/plugins/request/index.test.js +0 -337
  211. package/dist/plugins/request/schemas.d.ts +0 -54
  212. package/dist/plugins/request/schemas.d.ts.map +0 -1
  213. package/dist/plugins/request/schemas.js +0 -41
  214. package/dist/plugins/runAction/index.d.ts +0 -33
  215. package/dist/plugins/runAction/index.d.ts.map +0 -1
  216. package/dist/plugins/runAction/index.js +0 -108
  217. package/dist/plugins/runAction/index.test.d.ts +0 -2
  218. package/dist/plugins/runAction/index.test.d.ts.map +0 -1
  219. package/dist/plugins/runAction/index.test.js +0 -333
  220. package/dist/plugins/runAction/schemas.d.ts +0 -34
  221. package/dist/plugins/runAction/schemas.d.ts.map +0 -1
  222. package/dist/plugins/runAction/schemas.js +0 -23
  223. package/dist/resolvers/actionKey.d.ts +0 -15
  224. package/dist/resolvers/actionKey.d.ts.map +0 -1
  225. package/dist/resolvers/actionKey.js +0 -19
  226. package/dist/resolvers/actionType.d.ts +0 -10
  227. package/dist/resolvers/actionType.d.ts.map +0 -1
  228. package/dist/resolvers/actionType.js +0 -21
  229. package/dist/resolvers/appKey.d.ts +0 -3
  230. package/dist/resolvers/appKey.d.ts.map +0 -1
  231. package/dist/resolvers/appKey.js +0 -5
  232. package/dist/resolvers/authenticationId.d.ts +0 -9
  233. package/dist/resolvers/authenticationId.d.ts.map +0 -1
  234. package/dist/resolvers/authenticationId.js +0 -42
  235. package/dist/resolvers/index.d.ts +0 -8
  236. package/dist/resolvers/index.d.ts.map +0 -1
  237. package/dist/resolvers/index.js +0 -8
  238. package/dist/resolvers/inputFieldKey.d.ts +0 -11
  239. package/dist/resolvers/inputFieldKey.d.ts.map +0 -1
  240. package/dist/resolvers/inputFieldKey.js +0 -47
  241. package/dist/resolvers/inputs.d.ts +0 -17
  242. package/dist/resolvers/inputs.d.ts.map +0 -1
  243. package/dist/resolvers/inputs.js +0 -50
  244. package/dist/schemas/Action.d.ts +0 -24
  245. package/dist/schemas/Action.d.ts.map +0 -1
  246. package/dist/schemas/Action.js +0 -40
  247. package/dist/schemas/App.d.ts +0 -57
  248. package/dist/schemas/App.d.ts.map +0 -1
  249. package/dist/schemas/App.js +0 -26
  250. package/dist/schemas/Auth.d.ts +0 -55
  251. package/dist/schemas/Auth.d.ts.map +0 -1
  252. package/dist/schemas/Auth.js +0 -33
  253. package/dist/schemas/Field.d.ts +0 -61
  254. package/dist/schemas/Field.d.ts.map +0 -1
  255. package/dist/schemas/Field.js +0 -116
  256. package/dist/schemas/Run.d.ts +0 -3
  257. package/dist/schemas/Run.d.ts.map +0 -1
  258. package/dist/schemas/Run.js +0 -31
  259. package/dist/schemas/UserProfile.d.ts +0 -13
  260. package/dist/schemas/UserProfile.d.ts.map +0 -1
  261. package/dist/schemas/UserProfile.js +0 -32
  262. package/dist/sdk.d.ts +0 -146
  263. package/dist/sdk.d.ts.map +0 -1
  264. package/dist/sdk.js +0 -112
  265. package/dist/sdk.test.d.ts +0 -2
  266. package/dist/sdk.test.d.ts.map +0 -1
  267. package/dist/sdk.test.js +0 -258
  268. package/dist/services/implementations.d.ts +0 -63
  269. package/dist/services/implementations.d.ts.map +0 -1
  270. package/dist/services/implementations.js +0 -80
  271. package/dist/types/domain.d.ts +0 -52
  272. package/dist/types/domain.d.ts.map +0 -1
  273. package/dist/types/domain.js +0 -1
  274. package/dist/types/domain.test.d.ts +0 -2
  275. package/dist/types/domain.test.d.ts.map +0 -1
  276. package/dist/types/domain.test.js +0 -39
  277. package/dist/types/errors.d.ts +0 -143
  278. package/dist/types/errors.d.ts.map +0 -1
  279. package/dist/types/errors.js +0 -187
  280. package/dist/types/events.d.ts +0 -38
  281. package/dist/types/events.d.ts.map +0 -1
  282. package/dist/types/events.js +0 -7
  283. package/dist/types/functions.d.ts +0 -27
  284. package/dist/types/functions.d.ts.map +0 -1
  285. package/dist/types/functions.js +0 -1
  286. package/dist/types/plugin.d.ts +0 -75
  287. package/dist/types/plugin.d.ts.map +0 -1
  288. package/dist/types/plugin.js +0 -9
  289. package/dist/types/properties.d.ts +0 -33
  290. package/dist/types/properties.d.ts.map +0 -1
  291. package/dist/types/properties.js +0 -52
  292. package/dist/types/sdk.d.ts +0 -69
  293. package/dist/types/sdk.d.ts.map +0 -1
  294. package/dist/types/sdk.js +0 -4
  295. package/dist/types/telemetry-events.d.ts +0 -105
  296. package/dist/types/telemetry-events.d.ts.map +0 -1
  297. package/dist/types/telemetry-events.js +0 -8
  298. package/dist/utils/array-utils.d.ts +0 -31
  299. package/dist/utils/array-utils.d.ts.map +0 -1
  300. package/dist/utils/array-utils.js +0 -36
  301. package/dist/utils/array-utils.test.d.ts +0 -2
  302. package/dist/utils/array-utils.test.d.ts.map +0 -1
  303. package/dist/utils/array-utils.test.js +0 -107
  304. package/dist/utils/batch-utils.d.ts +0 -72
  305. package/dist/utils/batch-utils.d.ts.map +0 -1
  306. package/dist/utils/batch-utils.js +0 -162
  307. package/dist/utils/batch-utils.test.d.ts +0 -2
  308. package/dist/utils/batch-utils.test.d.ts.map +0 -1
  309. package/dist/utils/batch-utils.test.js +0 -476
  310. package/dist/utils/domain-utils.d.ts +0 -66
  311. package/dist/utils/domain-utils.d.ts.map +0 -1
  312. package/dist/utils/domain-utils.js +0 -164
  313. package/dist/utils/domain-utils.test.d.ts +0 -2
  314. package/dist/utils/domain-utils.test.d.ts.map +0 -1
  315. package/dist/utils/domain-utils.test.js +0 -346
  316. package/dist/utils/file-utils.d.ts +0 -4
  317. package/dist/utils/file-utils.d.ts.map +0 -1
  318. package/dist/utils/file-utils.js +0 -74
  319. package/dist/utils/file-utils.test.d.ts +0 -2
  320. package/dist/utils/file-utils.test.d.ts.map +0 -1
  321. package/dist/utils/file-utils.test.js +0 -51
  322. package/dist/utils/function-utils.d.ts +0 -73
  323. package/dist/utils/function-utils.d.ts.map +0 -1
  324. package/dist/utils/function-utils.js +0 -245
  325. package/dist/utils/function-utils.test.d.ts +0 -2
  326. package/dist/utils/function-utils.test.d.ts.map +0 -1
  327. package/dist/utils/function-utils.test.js +0 -110
  328. package/dist/utils/id-utils.d.ts +0 -13
  329. package/dist/utils/id-utils.d.ts.map +0 -1
  330. package/dist/utils/id-utils.js +0 -22
  331. package/dist/utils/id-utils.test.d.ts +0 -2
  332. package/dist/utils/id-utils.test.d.ts.map +0 -1
  333. package/dist/utils/id-utils.test.js +0 -22
  334. package/dist/utils/pagination-utils.d.ts +0 -37
  335. package/dist/utils/pagination-utils.d.ts.map +0 -1
  336. package/dist/utils/pagination-utils.js +0 -165
  337. package/dist/utils/pagination-utils.test.d.ts +0 -17
  338. package/dist/utils/pagination-utils.test.d.ts.map +0 -1
  339. package/dist/utils/pagination-utils.test.js +0 -461
  340. package/dist/utils/retry-utils.d.ts +0 -45
  341. package/dist/utils/retry-utils.d.ts.map +0 -1
  342. package/dist/utils/retry-utils.js +0 -51
  343. package/dist/utils/retry-utils.test.d.ts +0 -2
  344. package/dist/utils/retry-utils.test.d.ts.map +0 -1
  345. package/dist/utils/retry-utils.test.js +0 -90
  346. package/dist/utils/schema-utils.d.ts +0 -69
  347. package/dist/utils/schema-utils.d.ts.map +0 -1
  348. package/dist/utils/schema-utils.js +0 -72
  349. package/dist/utils/string-utils.d.ts +0 -40
  350. package/dist/utils/string-utils.d.ts.map +0 -1
  351. package/dist/utils/string-utils.js +0 -69
  352. package/dist/utils/string-utils.test.d.ts +0 -2
  353. package/dist/utils/string-utils.test.d.ts.map +0 -1
  354. package/dist/utils/string-utils.test.js +0 -59
  355. package/dist/utils/telemetry-utils.d.ts +0 -44
  356. package/dist/utils/telemetry-utils.d.ts.map +0 -1
  357. package/dist/utils/telemetry-utils.js +0 -55
  358. package/dist/utils/telemetry-utils.test.d.ts +0 -2
  359. package/dist/utils/telemetry-utils.test.d.ts.map +0 -1
  360. package/dist/utils/telemetry-utils.test.js +0 -94
  361. package/dist/utils/url-utils.d.ts +0 -19
  362. package/dist/utils/url-utils.d.ts.map +0 -1
  363. package/dist/utils/url-utils.js +0 -62
  364. package/dist/utils/url-utils.test.d.ts +0 -2
  365. package/dist/utils/url-utils.test.d.ts.map +0 -1
  366. package/dist/utils/url-utils.test.js +0 -103
  367. package/dist/utils/validation.d.ts +0 -4
  368. package/dist/utils/validation.d.ts.map +0 -1
  369. package/dist/utils/validation.js +0 -30
  370. package/dist/utils/validation.test.d.ts +0 -2
  371. package/dist/utils/validation.test.d.ts.map +0 -1
  372. package/dist/utils/validation.test.js +0 -44
@@ -1,211 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from "vitest";
2
- import { ZapierValidationError, ZapierResourceNotFoundError, } from "../../types/errors";
3
- import { getActionPlugin } from "./index";
4
- import { createSdk } from "../../sdk";
5
- import { ListActionsSchema } from "../listActions/schemas";
6
- import { eventEmissionPlugin } from "../eventEmission";
7
- const mockActions = [
8
- {
9
- type: "action",
10
- key: "user_by_email",
11
- title: "Search User by Email",
12
- description: "Find a user by email address",
13
- app_key: "slack",
14
- action_type: "search",
15
- },
16
- {
17
- type: "action",
18
- key: "search_messages",
19
- title: "Search Messages",
20
- description: "Search for messages in channels",
21
- app_key: "slack",
22
- action_type: "search",
23
- },
24
- {
25
- type: "action",
26
- key: "user_by_email",
27
- title: "Search User by Email",
28
- description: "Find a user by email address",
29
- app_key: "slack",
30
- action_type: "write", // Different action type for testing mismatch
31
- },
32
- ];
33
- describe("getAction plugin", () => {
34
- let mockListActions;
35
- let mockApiClient;
36
- beforeEach(() => {
37
- vi.clearAllMocks();
38
- // Mock listActions to return a promise with .items() method
39
- mockListActions = vi.fn().mockImplementation(() => {
40
- const promise = Promise.resolve({
41
- data: mockActions,
42
- });
43
- // Add .items() method that returns an async iterable
44
- return Object.assign(promise, {
45
- items: () => ({
46
- async *[Symbol.asyncIterator]() {
47
- for (const action of mockActions) {
48
- yield action;
49
- }
50
- },
51
- }),
52
- });
53
- });
54
- mockApiClient = {};
55
- });
56
- function createTestSdk() {
57
- // Create a proper plugin chain with context dependencies
58
- const mockListActionsPlugin = () => ({
59
- listActions: mockListActions,
60
- context: {
61
- meta: {
62
- listActions: {
63
- inputSchema: ListActionsSchema,
64
- },
65
- },
66
- },
67
- });
68
- // Build SDK with proper plugin composition, providing API in initial context
69
- return createSdk({}, {}, { api: mockApiClient, meta: {}, options: {} })
70
- .addPlugin(eventEmissionPlugin)
71
- .addPlugin(mockListActionsPlugin)
72
- .addPlugin(getActionPlugin);
73
- }
74
- describe("schema validation", () => {
75
- it("should throw validation error for missing appKey", async () => {
76
- const sdk = createTestSdk();
77
- await expect(sdk.getAction({
78
- actionType: "search",
79
- actionKey: "user_by_email",
80
- })).rejects.toThrow(ZapierValidationError);
81
- });
82
- it("should throw validation error for missing actionType", async () => {
83
- const sdk = createTestSdk();
84
- await expect(sdk.getAction({
85
- appKey: "slack",
86
- actionKey: "user_by_email",
87
- })).rejects.toThrow(ZapierValidationError);
88
- });
89
- it("should throw validation error for missing actionKey", async () => {
90
- const sdk = createTestSdk();
91
- await expect(sdk.getAction({
92
- appKey: "slack",
93
- actionType: "search",
94
- })).rejects.toThrow(ZapierValidationError);
95
- });
96
- it("should throw validation error for invalid appKey type", async () => {
97
- const sdk = createTestSdk();
98
- await expect(sdk.getAction({
99
- appKey: 123,
100
- actionType: "search",
101
- actionKey: "user_by_email",
102
- })).rejects.toThrow(ZapierValidationError);
103
- });
104
- it("should throw validation error for invalid actionType", async () => {
105
- const sdk = createTestSdk();
106
- await expect(sdk.getAction({
107
- appKey: "slack",
108
- actionType: "invalid-type",
109
- actionKey: "user_by_email",
110
- })).rejects.toThrow(ZapierValidationError);
111
- });
112
- it("should throw validation error for invalid actionKey type", async () => {
113
- const sdk = createTestSdk();
114
- await expect(sdk.getAction({
115
- appKey: "slack",
116
- actionType: "search",
117
- actionKey: 123,
118
- })).rejects.toThrow(ZapierValidationError);
119
- });
120
- it("should throw validation error for empty appKey", async () => {
121
- const sdk = createTestSdk();
122
- await expect(sdk.getAction({
123
- appKey: "",
124
- actionType: "search",
125
- actionKey: "user_by_email",
126
- })).rejects.toThrow(ZapierValidationError);
127
- });
128
- it("should throw validation error for empty actionKey", async () => {
129
- const sdk = createTestSdk();
130
- await expect(sdk.getAction({
131
- appKey: "slack",
132
- actionType: "search",
133
- actionKey: "",
134
- })).rejects.toThrow(ZapierValidationError);
135
- });
136
- it("should pass validation with all required fields", async () => {
137
- const sdk = createTestSdk();
138
- const result = await sdk.getAction({
139
- appKey: "slack",
140
- actionType: "search",
141
- actionKey: "user_by_email",
142
- });
143
- expect(result.data).toEqual(mockActions[0]);
144
- });
145
- });
146
- describe("action lookup", () => {
147
- it("should call listActions with correct parameters", async () => {
148
- const sdk = createTestSdk();
149
- await sdk.getAction({
150
- appKey: "slack",
151
- actionType: "search",
152
- actionKey: "user_by_email",
153
- });
154
- expect(mockListActions).toHaveBeenCalledWith(expect.objectContaining({
155
- appKey: "slack",
156
- }));
157
- });
158
- it("should return the correct action when found", async () => {
159
- const sdk = createTestSdk();
160
- const result = await sdk.getAction({
161
- appKey: "slack",
162
- actionType: "search",
163
- actionKey: "user_by_email",
164
- });
165
- expect(result.data).toEqual(mockActions[0]);
166
- });
167
- it("should throw error when action key not found", async () => {
168
- const sdk = createTestSdk();
169
- await expect(sdk.getAction({
170
- appKey: "slack",
171
- actionType: "search",
172
- actionKey: "nonexistent_action",
173
- })).rejects.toThrow(ZapierResourceNotFoundError);
174
- });
175
- it("should throw error when action type doesn't match", async () => {
176
- const sdk = createTestSdk();
177
- await expect(sdk.getAction({
178
- appKey: "slack",
179
- actionType: "write",
180
- actionKey: "search_messages", // This action is type "search" in mock
181
- })).rejects.toThrow(ZapierResourceNotFoundError);
182
- });
183
- it("should handle listActions errors", async () => {
184
- mockListActions.mockImplementation(() => {
185
- const promise = Promise.reject(new Error("API Error"));
186
- // Add .items() method that also rejects
187
- return Object.assign(promise, {
188
- items: () => ({
189
- async *[Symbol.asyncIterator]() {
190
- throw new Error("API Error");
191
- },
192
- }),
193
- });
194
- });
195
- const sdk = createTestSdk();
196
- await expect(sdk.getAction({
197
- appKey: "slack",
198
- actionType: "search",
199
- actionKey: "user_by_email",
200
- })).rejects.toThrow("API Error");
201
- });
202
- });
203
- describe("plugin integration", () => {
204
- it("should provide metadata in context", () => {
205
- const sdk = createTestSdk();
206
- const context = sdk.getContext();
207
- expect(context.meta.getAction).toBeDefined();
208
- expect(context.meta.getAction.inputSchema).toBeDefined();
209
- });
210
- });
211
- });
@@ -1,30 +0,0 @@
1
- import { z } from "zod";
2
- import type { ActionItem } from "../../types/domain";
3
- import type { ZapierAuthenticationError, ZapierApiError, ZapierAppNotFoundError, ZapierValidationError, ZapierResourceNotFoundError, ZapierUnknownError } from "../../types/errors";
4
- export declare const GetActionSchema: z.ZodObject<{
5
- appKey: z.ZodString & {
6
- _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
7
- };
8
- actionType: z.ZodEnum<{
9
- search: "search";
10
- filter: "filter";
11
- read: "read";
12
- read_bulk: "read_bulk";
13
- run: "run";
14
- search_and_write: "search_and_write";
15
- search_or_write: "search_or_write";
16
- write: "write";
17
- }>;
18
- actionKey: z.ZodString;
19
- _telemetry: z.ZodOptional<z.ZodObject<{
20
- isNested: z.ZodOptional<z.ZodBoolean>;
21
- }, z.core.$strip>>;
22
- }, z.core.$strip>;
23
- export type GetActionOptions = z.infer<typeof GetActionSchema>;
24
- export type GetActionError = ZapierAuthenticationError | ZapierApiError | ZapierAppNotFoundError | ZapierValidationError | ZapierResourceNotFoundError | ZapierUnknownError;
25
- export interface GetActionSdkFunction {
26
- getAction: (options: GetActionOptions) => Promise<{
27
- data: ActionItem;
28
- }>;
29
- }
30
- //# sourceMappingURL=schemas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAI5B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;iBAOmC,CAAC;AAGhE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAG/D,MAAM,MAAM,cAAc,GACtB,yBAAyB,GACzB,cAAc,GACd,sBAAsB,GACtB,qBAAqB,GACrB,2BAA2B,GAC3B,kBAAkB,CAAC;AAGvB,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;CACzE"}
@@ -1,12 +0,0 @@
1
- import { z } from "zod";
2
- import { AppKeyPropertySchema, ActionTypePropertySchema, ActionKeyPropertySchema, } from "../../types/properties";
3
- import { TelemetryMarkerSchema } from "../../utils/function-utils";
4
- // Pure Zod schema - no resolver metadata!
5
- export const GetActionSchema = z
6
- .object({
7
- appKey: AppKeyPropertySchema,
8
- actionType: ActionTypePropertySchema,
9
- actionKey: ActionKeyPropertySchema,
10
- })
11
- .merge(TelemetryMarkerSchema)
12
- .describe("Get detailed information about a specific action");
@@ -1,21 +0,0 @@
1
- import type { Plugin } from "../../types/plugin";
2
- import { GetAppSchema } from "./schemas";
3
- import type { GetAppOptions } from "./schemas";
4
- import type { AppItem } from "../../types/domain";
5
- import type { GetSdkType } from "../../types/plugin";
6
- import type { ListAppsPluginProvides } from "../listApps";
7
- import type { EventEmissionContext } from "../eventEmission";
8
- export interface GetAppPluginProvides {
9
- getApp: (options: GetAppOptions) => Promise<{
10
- data: AppItem;
11
- }>;
12
- context: {
13
- meta: {
14
- getApp: {
15
- inputSchema: typeof GetAppSchema;
16
- };
17
- };
18
- };
19
- }
20
- export declare const getAppPlugin: Plugin<GetSdkType<ListAppsPluginProvides>, EventEmissionContext, GetAppPluginProvides>;
21
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI7D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC/D,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,WAAW,EAAE,OAAO,YAAY,CAAC;aAClC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,YAAY,EAAE,MAAM,CAC/B,UAAU,CAAC,sBAAsB,CAAC,EAClC,oBAAoB,EACpB,oBAAoB,CA8CrB,CAAC"}
@@ -1,44 +0,0 @@
1
- import { createFunction } from "../../utils/function-utils";
2
- import { GetAppSchema } from "./schemas";
3
- import { AppItemSchema } from "../../schemas/App";
4
- import { ZapierAppNotFoundError } from "../../types/errors";
5
- import { appKeyResolver } from "../../resolvers";
6
- import { createTelemetryCallback } from "../../utils/telemetry-utils";
7
- // GetApp plugin depends on listApps SDK function
8
- export const getAppPlugin = ({ sdk, context }) => {
9
- async function getApp(options) {
10
- const appsIterator = sdk
11
- .listApps({
12
- appKeys: [options.appKey],
13
- _telemetry: { isNested: true },
14
- })
15
- .items();
16
- for await (const app of appsIterator) {
17
- return {
18
- data: app,
19
- };
20
- }
21
- throw new ZapierAppNotFoundError("App not found", {
22
- appKey: options.appKey,
23
- });
24
- }
25
- const getAppDefinition = createFunction(getApp, GetAppSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getApp.name));
26
- // Return flat structure - getApp goes directly to SDK
27
- return {
28
- getApp: getAppDefinition,
29
- context: {
30
- meta: {
31
- getApp: {
32
- categories: ["app"],
33
- type: "item",
34
- itemType: "App",
35
- inputSchema: GetAppSchema,
36
- outputSchema: AppItemSchema,
37
- resolvers: {
38
- appKey: appKeyResolver,
39
- },
40
- },
41
- },
42
- },
43
- };
44
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/index.test.ts"],"names":[],"mappings":""}
@@ -1,157 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from "vitest";
2
- import { ZapierValidationError, ZapierAppNotFoundError, } from "../../types/errors";
3
- import { getAppPlugin } from "./index";
4
- import { createSdk } from "../../sdk";
5
- import { apiPlugin } from "../api/index";
6
- import { listAppsPlugin } from "../listApps";
7
- import { manifestPlugin } from "../manifest";
8
- import { eventEmissionPlugin } from "../eventEmission";
9
- function createTestSdk() {
10
- return createSdk()
11
- .addPlugin(() => ({
12
- context: {
13
- options: {},
14
- },
15
- }))
16
- .addPlugin(apiPlugin, { fetch: global.fetch })
17
- .addPlugin(eventEmissionPlugin)
18
- .addPlugin(manifestPlugin)
19
- .addPlugin(listAppsPlugin)
20
- .addPlugin(getAppPlugin);
21
- }
22
- describe("getApp plugin", () => {
23
- beforeEach(() => {
24
- vi.clearAllMocks();
25
- });
26
- describe("schema validation", () => {
27
- it("should throw validation error for missing appKey", async () => {
28
- const sdk = createTestSdk();
29
- await expect(sdk.getApp({})).rejects.toThrow(ZapierValidationError);
30
- });
31
- it("should throw validation error for invalid appKey type", async () => {
32
- const sdk = createTestSdk();
33
- await expect(sdk.getApp({
34
- appKey: 123,
35
- })).rejects.toThrow(ZapierValidationError);
36
- });
37
- it("should throw validation error for empty string appKey", async () => {
38
- const sdk = createTestSdk();
39
- await expect(sdk.getApp({
40
- appKey: "",
41
- })).rejects.toThrow(ZapierValidationError);
42
- });
43
- it("should pass validation with valid appKey", async () => {
44
- const sdk = createTestSdk();
45
- const context = sdk.getContext();
46
- // Mock the API client to handle both resolveAppKeys and listApps calls
47
- context.api.get = vi
48
- .fn()
49
- // First call: resolveAppKeys calls listAppsForSlugsPage which expects raw API format
50
- .mockResolvedValueOnce({
51
- results: [
52
- {
53
- id: "SlackCLIAPI@1.0.0",
54
- name: "Slack",
55
- description: "Team communication",
56
- primary_color: "#4A154B",
57
- categories: ["communication"],
58
- slug: "slack",
59
- },
60
- ],
61
- next: null,
62
- })
63
- // Second call: listApps goes through handler which returns transformed format
64
- .mockResolvedValueOnce({
65
- data: [
66
- {
67
- title: "Slack",
68
- key: "SlackCLIAPI",
69
- implementation_id: "SlackCLIAPI@1.0.0",
70
- description: "Team communication",
71
- primary_color: "#4A154B",
72
- categories: ["communication"],
73
- slug: "slack",
74
- version: "1.0.0",
75
- },
76
- ],
77
- nextCursor: undefined,
78
- });
79
- const result = await sdk.getApp({
80
- appKey: "slack",
81
- });
82
- expect(result.data.title).toBe("Slack");
83
- expect(result.data.key).toBe("SlackCLIAPI");
84
- expect(result.data.implementation_id).toBe("SlackCLIAPI@1.0.0");
85
- expect(result.data.version).toBe("1.0.0");
86
- });
87
- });
88
- describe("error handling", () => {
89
- it("should throw ZapierAppNotFoundError when app does not exist", async () => {
90
- const sdk = createTestSdk();
91
- const context = sdk.getContext();
92
- // Mock API to return empty results for both potential calls
93
- context.api.get = vi
94
- .fn()
95
- // First call: resolveAppKeys may call to resolve slug
96
- .mockResolvedValueOnce({
97
- results: [],
98
- next: null,
99
- })
100
- // Second call: listApps main API call (returns transformed format)
101
- .mockResolvedValueOnce({
102
- data: [],
103
- nextCursor: undefined,
104
- });
105
- await expect(sdk.getApp({
106
- appKey: "nonexistent-app",
107
- })).rejects.toThrow(ZapierAppNotFoundError);
108
- });
109
- });
110
- describe("data mapping", () => {
111
- it("should return essential app properties", async () => {
112
- const sdk = createTestSdk();
113
- const context = sdk.getContext();
114
- // Mock the API client to handle both resolveAppKeys and listApps calls
115
- context.api.get = vi
116
- .fn()
117
- // First call: resolveAppKeys calls listAppsForSlugsPage which expects raw API format
118
- .mockResolvedValueOnce({
119
- results: [
120
- {
121
- id: "TestCLIAPI@1.0.0",
122
- name: "Test App",
123
- description: "Test description",
124
- primary_color: "#FF0000",
125
- categories: ["testing"],
126
- slug: "test",
127
- },
128
- ],
129
- next: null,
130
- })
131
- // Second call: listApps goes through handler which returns transformed format
132
- .mockResolvedValueOnce({
133
- data: [
134
- {
135
- title: "Test App",
136
- key: "TestCLIAPI",
137
- implementation_id: "TestCLIAPI@1.0.0",
138
- description: "Test description",
139
- primary_color: "#FF0000",
140
- categories: ["testing"],
141
- slug: "test",
142
- version: "1.0.0",
143
- },
144
- ],
145
- nextCursor: undefined,
146
- });
147
- const result = await sdk.getApp({
148
- appKey: "test",
149
- });
150
- expect(result.data.title).toBeDefined();
151
- expect(result.data.key).toBeDefined();
152
- expect(result.data.implementation_id).toBeDefined();
153
- expect(result.data.title).toBe("Test App");
154
- expect(result.data.key).toBe("TestCLIAPI");
155
- });
156
- });
157
- });
@@ -1,16 +0,0 @@
1
- import { z } from "zod";
2
- import type { AppItem } from "../../types/domain";
3
- import type { ZapierApiError, ZapierAppNotFoundError, ZapierValidationError } from "../../types/errors";
4
- export type GetAppError = ZapierAppNotFoundError | ZapierApiError | ZapierValidationError;
5
- export declare const GetAppSchema: z.ZodObject<{
6
- appKey: z.ZodString & {
7
- _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
8
- };
9
- }, z.core.$strip>;
10
- export type GetAppOptions = z.infer<typeof GetAppSchema>;
11
- export interface GetAppSdkFunction {
12
- getApp: (options: GetAppOptions) => Promise<{
13
- data: AppItem;
14
- }>;
15
- }
16
- //# sourceMappingURL=schemas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAK5B,MAAM,MAAM,WAAW,GACnB,sBAAsB,GACtB,cAAc,GACd,qBAAqB,CAAC;AAG1B,eAAO,MAAM,YAAY;;;;iBAMmC,CAAC;AAG7D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAGzD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAChE"}
@@ -1,8 +0,0 @@
1
- import { z } from "zod";
2
- import { AppKeyPropertySchema } from "../../types/properties";
3
- // Pure Zod schema - no resolver metadata!
4
- export const GetAppSchema = z
5
- .object({
6
- appKey: AppKeyPropertySchema.describe("App key of app to fetch (e.g., 'SlackCLIAPI' or slug like 'github')"),
7
- })
8
- .describe("Get detailed information about a specific app");
@@ -1,21 +0,0 @@
1
- import type { Plugin } from "../../types/plugin";
2
- import type { ApiClient } from "../../api";
3
- import type { EventEmissionContext } from "../eventEmission";
4
- import { GetAuthenticationParamSchema, type GetAuthenticationParam, type GetAuthenticationResponse } from "@zapier/zapier-sdk-core/v0/schemas/authentications";
5
- export interface GetAuthenticationPluginProvides {
6
- getAuthentication: (options: GetAuthenticationParam) => Promise<GetAuthenticationResponse>;
7
- context: {
8
- meta: {
9
- getAuthentication: {
10
- inputSchema: typeof GetAuthenticationParamSchema;
11
- };
12
- };
13
- };
14
- }
15
- export declare const getAuthenticationPlugin: Plugin<{}, // no SDK dependencies
16
- // no SDK dependencies
17
- {
18
- api: ApiClient;
19
- } & EventEmissionContext, // requires api in context
20
- GetAuthenticationPluginProvides>;
21
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAI3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EACL,4BAA4B,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,oDAAoD,CAAC;AAE5D,MAAM,WAAW,+BAA+B;IAC9C,iBAAiB,EAAE,CACjB,OAAO,EAAE,sBAAsB,KAC5B,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACxC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,iBAAiB,EAAE;gBACjB,WAAW,EAAE,OAAO,4BAA4B,CAAC;aAClD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,EAAE,EAAE,sBAAsB;AAC1B,AADI,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,GAAG,oBAAoB,EAAE,0BAA0B;AACrE,+BAA+B,CAoChC,CAAC"}
@@ -1,29 +0,0 @@
1
- import { createFunction } from "../../utils/function-utils";
2
- import { authenticationIdGenericResolver } from "../../resolvers";
3
- import { AuthenticationItemSchema } from "../../schemas/Auth";
4
- import { createTelemetryCallback } from "../../utils/telemetry-utils";
5
- import { GetAuthenticationParamSchema, } from "@zapier/zapier-sdk-core/v0/schemas/authentications";
6
- export const getAuthenticationPlugin = ({ context }) => {
7
- async function getAuthentication(options) {
8
- const { api } = context;
9
- return await api.get(`/api/v0/authentications/${encodeURIComponent(options.authenticationId)}`);
10
- }
11
- const getAuthenticationDefinition = createFunction(getAuthentication, GetAuthenticationParamSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getAuthentication.name));
12
- return {
13
- getAuthentication: getAuthenticationDefinition,
14
- context: {
15
- meta: {
16
- getAuthentication: {
17
- categories: ["authentication"],
18
- type: "item",
19
- itemType: "Authentication",
20
- inputSchema: GetAuthenticationParamSchema,
21
- outputSchema: AuthenticationItemSchema,
22
- resolvers: {
23
- authenticationId: authenticationIdGenericResolver,
24
- },
25
- },
26
- },
27
- },
28
- };
29
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAuthentication/index.test.ts"],"names":[],"mappings":""}