@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,21 +0,0 @@
1
- import type { Plugin, GetSdkType } from "../../types/plugin";
2
- import type { AuthenticationItem } from "../../types/domain";
3
- import { FindFirstAuthenticationSchema, type FindFirstAuthenticationOptions } from "./schemas";
4
- import type { ListAuthenticationsPluginProvides } from "../listAuthentications";
5
- import type { EventEmissionContext } from "../eventEmission";
6
- export interface FindFirstAuthenticationPluginProvides {
7
- findFirstAuthentication: (options?: FindFirstAuthenticationOptions) => Promise<{
8
- data: AuthenticationItem;
9
- }>;
10
- context: {
11
- meta: {
12
- findFirstAuthentication: {
13
- inputSchema: typeof FindFirstAuthenticationSchema;
14
- };
15
- };
16
- };
17
- }
18
- export declare const findFirstAuthenticationPlugin: Plugin<GetSdkType<ListAuthenticationsPluginProvides>, // requires listAuthentications in SDK
19
- EventEmissionContext, // requires eventEmission in context
20
- FindFirstAuthenticationPluginProvides>;
21
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,6BAA6B,EAC7B,KAAK,8BAA8B,EACpC,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAGhF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,MAAM,WAAW,qCAAqC;IACpD,uBAAuB,EAAE,CACvB,OAAO,CAAC,EAAE,8BAA8B,KACrC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;IAC3C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,uBAAuB,EAAE;gBACvB,WAAW,EAAE,OAAO,6BAA6B,CAAC;aACnD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAChD,UAAU,CAAC,iCAAiC,CAAC,EAAE,sCAAsC;AACrF,oBAAoB,EAAE,oCAAoC;AAC1D,qCAAqC,CA+CtC,CAAC"}
@@ -1,36 +0,0 @@
1
- import { FindFirstAuthenticationSchema, } from "./schemas";
2
- import { createFunction } from "../../utils/function-utils";
3
- import { AuthenticationItemSchema } from "../../schemas/Auth";
4
- import { ZapierResourceNotFoundError } from "../../types/errors";
5
- import { createTelemetryCallback } from "../../utils/telemetry-utils";
6
- export const findFirstAuthenticationPlugin = ({ sdk, context }) => {
7
- async function findFirstAuthentication(options = {}) {
8
- // Use listAuthentications with maxItems 1 to get the first result
9
- const authsResponse = await sdk.listAuthentications({
10
- ...options,
11
- maxItems: 1,
12
- _telemetry: { isNested: true },
13
- });
14
- if (authsResponse.data.length === 0) {
15
- throw new ZapierResourceNotFoundError("No authentication found matching the specified criteria", { resourceType: "Authentication" });
16
- }
17
- return {
18
- data: authsResponse.data[0],
19
- };
20
- }
21
- const findFirstAuthenticationDefinition = createFunction(findFirstAuthentication, FindFirstAuthenticationSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, findFirstAuthentication.name));
22
- return {
23
- findFirstAuthentication: findFirstAuthenticationDefinition,
24
- context: {
25
- meta: {
26
- findFirstAuthentication: {
27
- categories: ["authentication"],
28
- type: "item",
29
- itemType: "Authentication",
30
- inputSchema: FindFirstAuthenticationSchema,
31
- outputSchema: AuthenticationItemSchema,
32
- },
33
- },
34
- },
35
- };
36
- };
@@ -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/findFirstAuthentication/index.test.ts"],"names":[],"mappings":""}
@@ -1,177 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from "vitest";
2
- import { ZapierValidationError } from "../../types/errors";
3
- import { findFirstAuthenticationPlugin } from "./index";
4
- import { createSdk } from "../../sdk";
5
- import { ListAuthenticationsQuerySchema } from "../listAuthentications/schemas";
6
- import { eventEmissionPlugin } from "../eventEmission";
7
- const mockAuthentications = [
8
- {
9
- id: "123",
10
- title: "My Slack",
11
- date: "2021-01-01",
12
- account_id: "123",
13
- implementation_id: "api_123",
14
- is_expired: "false",
15
- expired_at: null,
16
- is_invite_only: false,
17
- is_private: false,
18
- shared_with_all: false,
19
- },
20
- {
21
- id: "456",
22
- title: "Slack Workspace 2",
23
- is_expired: "false",
24
- expired_at: null,
25
- date: "2021-01-01",
26
- account_id: "123",
27
- implementation_id: "api_123",
28
- is_invite_only: false,
29
- is_private: false,
30
- shared_with_all: false,
31
- },
32
- ];
33
- describe("findFirstAuthentication plugin", () => {
34
- let mockListAuthentications;
35
- beforeEach(() => {
36
- vi.clearAllMocks();
37
- mockListAuthentications = vi.fn().mockResolvedValue({
38
- data: mockAuthentications,
39
- });
40
- });
41
- function createTestSdk() {
42
- // Create a proper plugin chain: first add a mock listAuthentications plugin, then add findFirstAuthentication
43
- const mockListAuthenticationsPlugin = () => ({
44
- listAuthentications: mockListAuthentications,
45
- context: {
46
- meta: {
47
- listAuthentications: {
48
- inputSchema: ListAuthenticationsQuerySchema,
49
- },
50
- },
51
- },
52
- });
53
- // Build SDK with proper plugin composition
54
- return createSdk()
55
- .addPlugin(() => ({
56
- context: {
57
- options: {},
58
- },
59
- }))
60
- .addPlugin(eventEmissionPlugin)
61
- .addPlugin(mockListAuthenticationsPlugin)
62
- .addPlugin(findFirstAuthenticationPlugin);
63
- }
64
- describe("schema validation", () => {
65
- it("should pass validation with empty options", async () => {
66
- const sdk = createTestSdk();
67
- const result = await sdk.findFirstAuthentication({});
68
- expect(result.data).toBeDefined();
69
- });
70
- it("should pass validation with undefined options", async () => {
71
- const sdk = createTestSdk();
72
- const result = await sdk.findFirstAuthentication();
73
- expect(result.data).toBeDefined();
74
- });
75
- it("should throw validation error for invalid appKey type", async () => {
76
- const sdk = createTestSdk();
77
- await expect(sdk.findFirstAuthentication({
78
- appKey: 123, // intentionally wrong type for testing
79
- })).rejects.toThrow(ZapierValidationError);
80
- });
81
- it("should throw validation error for invalid search type", async () => {
82
- const sdk = createTestSdk();
83
- await expect(sdk.findFirstAuthentication({
84
- search: 123,
85
- })).rejects.toThrow(ZapierValidationError);
86
- });
87
- it("should throw validation error for invalid parameter types", async () => {
88
- const sdk = createTestSdk();
89
- await expect(sdk.findFirstAuthentication({
90
- title: 123,
91
- accountId: 456,
92
- owner: true,
93
- })).rejects.toThrow(ZapierValidationError);
94
- });
95
- it("should pass validation with all valid fields", async () => {
96
- const sdk = createTestSdk();
97
- const result = await sdk.findFirstAuthentication({
98
- appKey: "slack",
99
- search: "workspace",
100
- title: "My Slack Workspace",
101
- accountId: "acc_123",
102
- owner: "me",
103
- });
104
- expect(result.data).toBeDefined();
105
- });
106
- });
107
- describe("business logic", () => {
108
- it("should return first authentication when found", async () => {
109
- const mockAuth = mockAuthentications[0];
110
- mockListAuthentications.mockResolvedValue({
111
- data: [mockAuth],
112
- });
113
- const sdk = createTestSdk();
114
- const result = await sdk.findFirstAuthentication({
115
- appKey: "slack",
116
- });
117
- expect(result.data).toEqual(mockAuth);
118
- });
119
- it("should throw error when no authentications found", async () => {
120
- mockListAuthentications.mockResolvedValue({
121
- data: [],
122
- });
123
- const sdk = createTestSdk();
124
- await expect(sdk.findFirstAuthentication({
125
- appKey: "nonexistent",
126
- })).rejects.toThrow("No authentication found matching the specified criteria");
127
- });
128
- it("should return first authentication when multiple found", async () => {
129
- const mockAuth = mockAuthentications[0];
130
- mockListAuthentications.mockResolvedValue({
131
- data: [mockAuth, mockAuthentications[1]],
132
- });
133
- const sdk = createTestSdk();
134
- const result = await sdk.findFirstAuthentication({
135
- search: "Slack",
136
- });
137
- expect(result.data).toEqual(mockAuth);
138
- });
139
- });
140
- describe("options forwarding", () => {
141
- it("should forward all options to listAuthentications", async () => {
142
- const sdk = createTestSdk();
143
- const options = {
144
- appKey: "slack",
145
- search: "workspace",
146
- title: "My Slack Workspace",
147
- accountId: "acc_123",
148
- owner: "me",
149
- };
150
- await sdk.findFirstAuthentication(options);
151
- expect(mockListAuthentications).toHaveBeenCalledWith(expect.objectContaining({
152
- ...options,
153
- maxItems: 1,
154
- }));
155
- });
156
- });
157
- describe("limit enforcement", () => {
158
- it("should automatically set maxItems to 1", async () => {
159
- const sdk = createTestSdk();
160
- await sdk.findFirstAuthentication({
161
- appKey: "slack",
162
- });
163
- expect(mockListAuthentications).toHaveBeenCalledWith(expect.objectContaining({
164
- appKey: "slack",
165
- maxItems: 1,
166
- }));
167
- });
168
- });
169
- describe("context and metadata", () => {
170
- it("should provide context with meta information", () => {
171
- const sdk = createTestSdk();
172
- const context = sdk.getContext();
173
- expect(context.meta.findFirstAuthentication).toBeDefined();
174
- expect(context.meta.findFirstAuthentication.inputSchema).toBeDefined();
175
- });
176
- });
177
- });
@@ -1,20 +0,0 @@
1
- import { z } from "zod";
2
- import type { AuthenticationItem } from "../../types/domain";
3
- import type { ZapierAuthenticationError, ZapierApiError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
4
- export declare const FindFirstAuthenticationSchema: z.ZodObject<{
5
- appKey: z.ZodOptional<z.ZodString & {
6
- _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
7
- }>;
8
- search: z.ZodOptional<z.ZodString>;
9
- title: z.ZodOptional<z.ZodString>;
10
- accountId: z.ZodOptional<z.ZodString>;
11
- owner: z.ZodOptional<z.ZodString>;
12
- }, z.core.$strip>;
13
- export type FindFirstAuthenticationOptions = z.infer<typeof FindFirstAuthenticationSchema>;
14
- export type FindFirstAuthenticationError = ZapierAuthenticationError | ZapierApiError | ZapierValidationError | ZapierUnknownError;
15
- export interface FindFirstAuthenticationSdkFunction {
16
- findFirstAuthentication: (options?: FindFirstAuthenticationOptions) => Promise<{
17
- data: AuthenticationItem | null;
18
- }>;
19
- }
20
- //# sourceMappingURL=schemas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstAuthentication/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,6BAA6B;;;;;;;;iBAgBwB,CAAC;AAGnE,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,6BAA6B,CACrC,CAAC;AAGF,MAAM,MAAM,4BAA4B,GACpC,yBAAyB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,kCAAkC;IACjD,uBAAuB,EAAE,CACvB,OAAO,CAAC,EAAE,8BAA8B,KACrC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CACnD"}
@@ -1,18 +0,0 @@
1
- import { z } from "zod";
2
- import { AppKeyPropertySchema } from "../../types/properties";
3
- // Pure Zod schema - no resolver metadata!
4
- export const FindFirstAuthenticationSchema = z
5
- .object({
6
- appKey: AppKeyPropertySchema.optional().describe("App key of authentication to find (e.g., 'SlackCLIAPI' or slug like 'github')"),
7
- search: z
8
- .string()
9
- .optional()
10
- .describe("Search term to filter authentications by title"),
11
- title: z
12
- .string()
13
- .optional()
14
- .describe("Filter authentications by exact title match"),
15
- accountId: z.string().optional().describe("Filter by account ID"),
16
- owner: z.string().optional().describe("Filter by owner"),
17
- })
18
- .describe("Find the first authentication matching the criteria");
@@ -1,21 +0,0 @@
1
- import type { Plugin, GetSdkType } from "../../types/plugin";
2
- import type { AuthenticationItem } from "../../types/domain";
3
- import { FindUniqueAuthenticationSchema, type FindUniqueAuthenticationOptions } from "./schemas";
4
- import type { ListAuthenticationsPluginProvides } from "../listAuthentications";
5
- import type { EventEmissionContext } from "../eventEmission";
6
- export interface FindUniqueAuthenticationPluginProvides {
7
- findUniqueAuthentication: (options?: FindUniqueAuthenticationOptions) => Promise<{
8
- data: AuthenticationItem;
9
- }>;
10
- context: {
11
- meta: {
12
- findUniqueAuthentication: {
13
- inputSchema: typeof FindUniqueAuthenticationSchema;
14
- };
15
- };
16
- };
17
- }
18
- export declare const findUniqueAuthenticationPlugin: Plugin<GetSdkType<ListAuthenticationsPluginProvides>, // requires listAuthentications in SDK
19
- EventEmissionContext, // requires eventEmission in context
20
- FindUniqueAuthenticationPluginProvides>;
21
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,8BAA8B,EAC9B,KAAK,+BAA+B,EACrC,MAAM,WAAW,CAAC;AAMnB,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAEhF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,MAAM,WAAW,sCAAsC;IACrD,wBAAwB,EAAE,CACxB,OAAO,CAAC,EAAE,+BAA+B,KACtC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;IAC3C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,wBAAwB,EAAE;gBACxB,WAAW,EAAE,OAAO,8BAA8B,CAAC;aACpD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,8BAA8B,EAAE,MAAM,CACjD,UAAU,CAAC,iCAAiC,CAAC,EAAE,sCAAsC;AACrF,oBAAoB,EAAE,oCAAoC;AAC1D,sCAAsC,CAqDvC,CAAC"}
@@ -1,39 +0,0 @@
1
- import { FindUniqueAuthenticationSchema, } from "./schemas";
2
- import { ZapierResourceNotFoundError, ZapierValidationError, } from "../../types/errors";
3
- import { createFunction } from "../../utils/function-utils";
4
- import { AuthenticationItemSchema } from "../../schemas/Auth";
5
- import { createTelemetryCallback } from "../../utils/telemetry-utils";
6
- export const findUniqueAuthenticationPlugin = ({ sdk, context }) => {
7
- async function findUniqueAuthentication(options = {}) {
8
- // Use listAuthentications with maxItems 2 to check for uniqueness
9
- const authsResponse = await sdk.listAuthentications({
10
- ...options,
11
- maxItems: 2, // Get up to 2 to check for uniqueness
12
- _telemetry: { isNested: true },
13
- });
14
- if (authsResponse.data.length === 0) {
15
- throw new ZapierResourceNotFoundError("No authentication found matching the specified criteria", { resourceType: "Authentication" });
16
- }
17
- if (authsResponse.data.length > 1) {
18
- throw new ZapierValidationError("Multiple authentications found matching the specified criteria. Expected exactly one.");
19
- }
20
- return {
21
- data: authsResponse.data[0],
22
- };
23
- }
24
- const findUniqueAuthenticationDefinition = createFunction(findUniqueAuthentication, FindUniqueAuthenticationSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, findUniqueAuthentication.name));
25
- return {
26
- findUniqueAuthentication: findUniqueAuthenticationDefinition,
27
- context: {
28
- meta: {
29
- findUniqueAuthentication: {
30
- categories: ["authentication"],
31
- type: "item",
32
- itemType: "Authentication",
33
- inputSchema: FindUniqueAuthenticationSchema,
34
- outputSchema: AuthenticationItemSchema,
35
- },
36
- },
37
- },
38
- };
39
- };
@@ -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/findUniqueAuthentication/index.test.ts"],"names":[],"mappings":""}
@@ -1,159 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from "vitest";
2
- import { ZapierValidationError, ZapierResourceNotFoundError, } from "../../types/errors";
3
- import { findUniqueAuthenticationPlugin } from "./index";
4
- import { createSdk } from "../../sdk";
5
- import { ListAuthenticationsQuerySchema } from "../listAuthentications/schemas";
6
- import { eventEmissionPlugin } from "../eventEmission";
7
- const mockAuthentication = {
8
- id: "123",
9
- title: "My Slack",
10
- date: "2021-01-01",
11
- account_id: "123",
12
- implementation_id: "api_123",
13
- is_expired: "false",
14
- expired_at: null,
15
- is_invite_only: false,
16
- is_private: false,
17
- shared_with_all: false,
18
- };
19
- const mockAuthentications = [
20
- mockAuthentication,
21
- {
22
- id: "456",
23
- title: "Slack Workspace 2",
24
- is_expired: "false",
25
- expired_at: null,
26
- date: "2021-01-01",
27
- account_id: "123",
28
- implementation_id: "api_123",
29
- is_invite_only: false,
30
- is_private: false,
31
- shared_with_all: false,
32
- },
33
- ];
34
- describe("findUniqueAuthentication plugin", () => {
35
- let mockListAuthentications;
36
- beforeEach(() => {
37
- vi.clearAllMocks();
38
- mockListAuthentications = vi.fn().mockResolvedValue({
39
- data: [mockAuthentication],
40
- });
41
- });
42
- function createTestSdk() {
43
- // Create a proper plugin chain: first add a mock listAuthentications plugin, then add findUniqueAuthentication
44
- const mockListAuthenticationsPlugin = () => ({
45
- listAuthentications: mockListAuthentications,
46
- context: {
47
- meta: {
48
- listAuthentications: {
49
- inputSchema: ListAuthenticationsQuerySchema,
50
- },
51
- },
52
- },
53
- });
54
- // Build SDK with proper plugin composition
55
- return createSdk()
56
- .addPlugin(() => ({
57
- context: {
58
- options: {},
59
- },
60
- }))
61
- .addPlugin(eventEmissionPlugin)
62
- .addPlugin(mockListAuthenticationsPlugin)
63
- .addPlugin(findUniqueAuthenticationPlugin);
64
- }
65
- describe("schema validation", () => {
66
- it("should pass validation with empty options", async () => {
67
- const sdk = createTestSdk();
68
- const result = await sdk.findUniqueAuthentication({});
69
- expect(result.data).toBeDefined();
70
- });
71
- it("should throw validation error for invalid appKey type", async () => {
72
- const sdk = createTestSdk();
73
- await expect(sdk.findUniqueAuthentication({
74
- appKey: 123,
75
- })).rejects.toThrow(ZapierValidationError);
76
- });
77
- it("should throw validation error for invalid parameter types", async () => {
78
- const sdk = createTestSdk();
79
- await expect(sdk.findUniqueAuthentication({
80
- search: 123,
81
- title: 456,
82
- accountId: 789,
83
- owner: false,
84
- })).rejects.toThrow(ZapierValidationError);
85
- });
86
- it("should pass validation with all valid fields", async () => {
87
- const sdk = createTestSdk();
88
- const result = await sdk.findUniqueAuthentication({
89
- appKey: "slack",
90
- search: "Workspace",
91
- title: "My Slack",
92
- accountId: "acc_123",
93
- owner: "me",
94
- });
95
- expect(result.data).toBeDefined();
96
- });
97
- });
98
- describe("business logic", () => {
99
- it("should return the first authentication when exactly one is found", async () => {
100
- mockListAuthentications.mockResolvedValue({
101
- data: [mockAuthentication],
102
- });
103
- const sdk = createTestSdk();
104
- const result = await sdk.findUniqueAuthentication({
105
- appKey: "slack",
106
- });
107
- expect(result.data).toEqual(mockAuthentication);
108
- });
109
- it("should throw ZapierResourceNotFoundError when no authentications found", async () => {
110
- mockListAuthentications.mockResolvedValue({
111
- data: [],
112
- });
113
- const sdk = createTestSdk();
114
- await expect(sdk.findUniqueAuthentication({
115
- appKey: "nonexistent",
116
- })).rejects.toThrow(ZapierResourceNotFoundError);
117
- await expect(sdk.findUniqueAuthentication({
118
- appKey: "nonexistent",
119
- })).rejects.toThrow("No authentication found matching the specified criteria");
120
- });
121
- it("should throw ZapierValidationError when multiple authentications found", async () => {
122
- mockListAuthentications.mockResolvedValue({
123
- data: mockAuthentications, // Two authentications
124
- });
125
- const sdk = createTestSdk();
126
- await expect(sdk.findUniqueAuthentication({
127
- search: "Workspace",
128
- })).rejects.toThrow(ZapierValidationError);
129
- await expect(sdk.findUniqueAuthentication({
130
- search: "Workspace",
131
- })).rejects.toThrow("Multiple authentications found matching the specified criteria. Expected exactly one.");
132
- });
133
- });
134
- describe("options forwarding", () => {
135
- it("should forward all options to listAuthentications with maxItems=2", async () => {
136
- const sdk = createTestSdk();
137
- const options = {
138
- appKey: "slack",
139
- search: "workspace",
140
- title: "My Slack Workspace",
141
- accountId: "acc_123",
142
- owner: "me",
143
- };
144
- await sdk.findUniqueAuthentication(options);
145
- expect(mockListAuthentications).toHaveBeenCalledWith(expect.objectContaining({
146
- ...options,
147
- maxItems: 2,
148
- }));
149
- });
150
- });
151
- describe("context and metadata", () => {
152
- it("should provide context with meta information", () => {
153
- const sdk = createTestSdk();
154
- const context = sdk.getContext();
155
- expect(context.meta.findUniqueAuthentication).toBeDefined();
156
- expect(context.meta.findUniqueAuthentication.inputSchema).toBeDefined();
157
- });
158
- });
159
- });
@@ -1,20 +0,0 @@
1
- import { z } from "zod";
2
- import type { AuthenticationItem } from "../../types/domain";
3
- import type { ZapierAuthenticationError, ZapierApiError, ZapierResourceNotFoundError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
4
- export declare const FindUniqueAuthenticationSchema: z.ZodObject<{
5
- appKey: z.ZodOptional<z.ZodString & {
6
- _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
7
- }>;
8
- search: z.ZodOptional<z.ZodString>;
9
- title: z.ZodOptional<z.ZodString>;
10
- accountId: z.ZodOptional<z.ZodString>;
11
- owner: z.ZodOptional<z.ZodString>;
12
- }, z.core.$strip>;
13
- export type FindUniqueAuthenticationOptions = z.infer<typeof FindUniqueAuthenticationSchema>;
14
- export type FindUniqueAuthenticationError = ZapierAuthenticationError | ZapierApiError | ZapierResourceNotFoundError | ZapierValidationError | ZapierUnknownError;
15
- export interface FindUniqueAuthenticationSdkFunction {
16
- findUniqueAuthentication: (options?: FindUniqueAuthenticationOptions) => Promise<{
17
- data: AuthenticationItem;
18
- }>;
19
- }
20
- //# sourceMappingURL=schemas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueAuthentication/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,8BAA8B;;;;;;;;iBAgBsB,CAAC;AAGlE,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,8BAA8B,CACtC,CAAC;AAGF,MAAM,MAAM,6BAA6B,GACrC,yBAAyB,GACzB,cAAc,GACd,2BAA2B,GAC3B,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,mCAAmC;IAClD,wBAAwB,EAAE,CACxB,OAAO,CAAC,EAAE,+BAA+B,KACtC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;CAC5C"}
@@ -1,18 +0,0 @@
1
- import { z } from "zod";
2
- import { AppKeyPropertySchema } from "../../types/properties";
3
- // Pure Zod schema - no resolver metadata!
4
- export const FindUniqueAuthenticationSchema = z
5
- .object({
6
- appKey: AppKeyPropertySchema.optional().describe("App key of authentication to find (e.g., 'SlackCLIAPI' or slug like 'github')"),
7
- search: z
8
- .string()
9
- .optional()
10
- .describe("Search term to filter authentications by title"),
11
- title: z
12
- .string()
13
- .optional()
14
- .describe("Filter authentications by exact title match"),
15
- accountId: z.string().optional().describe("Filter by account ID"),
16
- owner: z.string().optional().describe("Filter by owner"),
17
- })
18
- .describe("Find a unique authentication matching the criteria");
@@ -1,25 +0,0 @@
1
- import type { Plugin, GetSdkType } from "../../types/plugin";
2
- import type { ApiClient } from "../../api";
3
- import type { ActionItem } from "../../types/domain";
4
- import { GetActionSchema, type GetActionOptions } from "./schemas";
5
- import type { ListActionsPluginProvides } from "../listActions";
6
- import type { EventEmissionContext } from "../eventEmission";
7
- export interface GetActionPluginProvides {
8
- getAction: (options: GetActionOptions) => Promise<{
9
- data: ActionItem;
10
- }>;
11
- context: {
12
- meta: {
13
- getAction: {
14
- inputSchema: typeof GetActionSchema;
15
- };
16
- };
17
- };
18
- }
19
- export declare const getActionPlugin: Plugin<GetSdkType<ListActionsPluginProvides>, // requires listActions in SDK
20
- // requires listActions in SDK
21
- {
22
- api: ApiClient;
23
- } & EventEmissionContext, // requires api in context
24
- GetActionPluginProvides>;
25
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAOhE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IACxE,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,SAAS,EAAE;gBACT,WAAW,EAAE,OAAO,eAAe,CAAC;aACrC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,UAAU,CAAC,yBAAyB,CAAC,EAAE,8BAA8B;AACrE,AADuC,8BAA8B;AACrE;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,GAAG,oBAAoB,EAAE,0BAA0B;AACrE,uBAAuB,CAoDxB,CAAC"}
@@ -1,42 +0,0 @@
1
- import { GetActionSchema } from "./schemas";
2
- import { ZapierResourceNotFoundError } from "../../types/errors";
3
- import { createFunction } from "../../utils/function-utils";
4
- import { appKeyResolver, actionTypeResolver, actionKeyResolver, } from "../../resolvers";
5
- import { ActionItemSchema } from "../../schemas/Action";
6
- import { createTelemetryCallback } from "../../utils/telemetry-utils";
7
- export const getActionPlugin = ({ sdk, context }) => {
8
- async function getAction(options) {
9
- const { actionKey, actionType, appKey } = options;
10
- // Use the listActions function from the SDK to search for the specific action across all pages
11
- for await (const action of sdk
12
- .listActions({ appKey, _telemetry: { isNested: true } })
13
- .items()) {
14
- if ((action.key === actionKey || action.id === actionKey) &&
15
- action.action_type === actionType) {
16
- return { data: action };
17
- }
18
- }
19
- // If we get here, action was not found
20
- throw new ZapierResourceNotFoundError(`Action not found: ${actionKey} with type ${actionType}`, { resourceType: "Action", resourceId: `${actionKey} (${actionType})` });
21
- }
22
- const getActionDefinition = createFunction(getAction, GetActionSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getAction.name));
23
- return {
24
- getAction: getActionDefinition,
25
- context: {
26
- meta: {
27
- getAction: {
28
- categories: ["action"],
29
- type: "item",
30
- itemType: "Action",
31
- inputSchema: GetActionSchema,
32
- outputSchema: ActionItemSchema,
33
- resolvers: {
34
- appKey: appKeyResolver,
35
- actionType: actionTypeResolver,
36
- actionKey: actionKeyResolver,
37
- },
38
- },
39
- },
40
- },
41
- };
42
- };
@@ -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/getAction/index.test.ts"],"names":[],"mappings":""}