@zapier/zapier-sdk 0.4.1 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +343 -0
  3. package/dist/api/auth.d.ts +9 -0
  4. package/dist/api/auth.d.ts.map +1 -0
  5. package/dist/api/auth.js +25 -0
  6. package/dist/api/client.d.ts +9 -0
  7. package/dist/api/client.d.ts.map +1 -0
  8. package/dist/api/client.js +322 -0
  9. package/dist/api/debug.d.ts +13 -0
  10. package/dist/api/debug.d.ts.map +1 -0
  11. package/dist/api/debug.js +55 -0
  12. package/dist/api/index.d.ts +29 -0
  13. package/dist/api/index.d.ts.map +1 -0
  14. package/dist/api/index.js +41 -0
  15. package/dist/api/polling.d.ts +16 -0
  16. package/dist/api/polling.d.ts.map +1 -0
  17. package/dist/api/polling.js +45 -0
  18. package/dist/api/schemas.d.ts +2473 -0
  19. package/dist/api/schemas.d.ts.map +1 -0
  20. package/dist/api/schemas.js +355 -0
  21. package/dist/api/types.d.ts +75 -0
  22. package/dist/api/types.d.ts.map +1 -0
  23. package/dist/api/types.js +11 -0
  24. package/dist/auth.d.ts +34 -0
  25. package/dist/auth.d.ts.map +1 -0
  26. package/dist/auth.js +47 -0
  27. package/dist/constants.d.ts +10 -0
  28. package/dist/constants.d.ts.map +1 -0
  29. package/dist/constants.js +9 -0
  30. package/dist/index.cjs +2108 -1379
  31. package/dist/index.d.mts +2440 -620
  32. package/dist/index.d.ts +17 -892
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +20 -0
  35. package/dist/index.mjs +2093 -1362
  36. package/dist/plugins/api/index.d.ts +14 -0
  37. package/dist/plugins/api/index.d.ts.map +1 -0
  38. package/dist/plugins/api/index.js +21 -0
  39. package/dist/plugins/apps/index.d.ts +11 -0
  40. package/dist/plugins/apps/index.d.ts.map +1 -0
  41. package/dist/plugins/apps/index.js +91 -0
  42. package/dist/plugins/apps/types.d.ts +30 -0
  43. package/dist/plugins/apps/types.d.ts.map +1 -0
  44. package/dist/plugins/apps/types.js +2 -0
  45. package/dist/plugins/fetch/index.d.ts +21 -0
  46. package/dist/plugins/fetch/index.d.ts.map +1 -0
  47. package/dist/plugins/fetch/index.js +20 -0
  48. package/dist/plugins/findFirstAuthentication/index.d.ts +20 -0
  49. package/dist/plugins/findFirstAuthentication/index.d.ts.map +1 -0
  50. package/dist/plugins/findFirstAuthentication/index.js +24 -0
  51. package/dist/plugins/findFirstAuthentication/index.test.d.ts +2 -0
  52. package/dist/plugins/findFirstAuthentication/index.test.d.ts.map +1 -0
  53. package/dist/plugins/findFirstAuthentication/index.test.js +171 -0
  54. package/dist/plugins/findFirstAuthentication/schemas.d.ts +29 -0
  55. package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +1 -0
  56. package/dist/plugins/findFirstAuthentication/schemas.js +18 -0
  57. package/dist/plugins/findUniqueAuthentication/index.d.ts +20 -0
  58. package/dist/plugins/findUniqueAuthentication/index.d.ts.map +1 -0
  59. package/dist/plugins/findUniqueAuthentication/index.js +31 -0
  60. package/dist/plugins/findUniqueAuthentication/index.test.d.ts +2 -0
  61. package/dist/plugins/findUniqueAuthentication/index.test.d.ts.map +1 -0
  62. package/dist/plugins/findUniqueAuthentication/index.test.js +152 -0
  63. package/dist/plugins/findUniqueAuthentication/schemas.d.ts +29 -0
  64. package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +1 -0
  65. package/dist/plugins/findUniqueAuthentication/schemas.js +18 -0
  66. package/dist/plugins/getAction/index.d.ts +23 -0
  67. package/dist/plugins/getAction/index.d.ts.map +1 -0
  68. package/dist/plugins/getAction/index.js +28 -0
  69. package/dist/plugins/getAction/index.test.d.ts +2 -0
  70. package/dist/plugins/getAction/index.test.d.ts.map +1 -0
  71. package/dist/plugins/getAction/index.test.js +186 -0
  72. package/dist/plugins/getAction/schemas.d.ts +23 -0
  73. package/dist/plugins/getAction/schemas.d.ts.map +1 -0
  74. package/dist/plugins/getAction/schemas.js +10 -0
  75. package/dist/plugins/getApp/index.d.ts +22 -0
  76. package/dist/plugins/getApp/index.d.ts.map +1 -0
  77. package/dist/plugins/getApp/index.js +39 -0
  78. package/dist/plugins/getApp/index.test.d.ts +2 -0
  79. package/dist/plugins/getApp/index.test.d.ts.map +1 -0
  80. package/dist/plugins/getApp/index.test.js +100 -0
  81. package/dist/plugins/getApp/schemas.d.ts +18 -0
  82. package/dist/plugins/getApp/schemas.d.ts.map +1 -0
  83. package/dist/plugins/getApp/schemas.js +10 -0
  84. package/dist/plugins/getAuthentication/index.d.ts +22 -0
  85. package/dist/plugins/getAuthentication/index.d.ts.map +1 -0
  86. package/dist/plugins/getAuthentication/index.js +41 -0
  87. package/dist/plugins/getAuthentication/index.test.d.ts +2 -0
  88. package/dist/plugins/getAuthentication/index.test.d.ts.map +1 -0
  89. package/dist/plugins/getAuthentication/index.test.js +205 -0
  90. package/dist/plugins/getAuthentication/schemas.d.ts +17 -0
  91. package/dist/plugins/getAuthentication/schemas.d.ts.map +1 -0
  92. package/dist/plugins/getAuthentication/schemas.js +11 -0
  93. package/dist/plugins/getProfile/index.d.ts +23 -0
  94. package/dist/plugins/getProfile/index.d.ts.map +1 -0
  95. package/dist/plugins/getProfile/index.js +29 -0
  96. package/dist/plugins/getProfile/schemas.d.ts +13 -0
  97. package/dist/plugins/getProfile/schemas.d.ts.map +1 -0
  98. package/dist/plugins/getProfile/schemas.js +5 -0
  99. package/dist/plugins/listActions/index.d.ts +28 -0
  100. package/dist/plugins/listActions/index.d.ts.map +1 -0
  101. package/dist/plugins/listActions/index.js +61 -0
  102. package/dist/plugins/listActions/index.test.d.ts +2 -0
  103. package/dist/plugins/listActions/index.test.d.ts.map +1 -0
  104. package/dist/plugins/listActions/index.test.js +467 -0
  105. package/dist/plugins/listActions/schemas.d.ts +29 -0
  106. package/dist/plugins/listActions/schemas.d.ts.map +1 -0
  107. package/dist/plugins/listActions/schemas.js +21 -0
  108. package/dist/plugins/listApps/index.d.ts +28 -0
  109. package/dist/plugins/listApps/index.d.ts.map +1 -0
  110. package/dist/plugins/listApps/index.js +62 -0
  111. package/dist/plugins/listApps/index.test.d.ts +2 -0
  112. package/dist/plugins/listApps/index.test.d.ts.map +1 -0
  113. package/dist/plugins/listApps/index.test.js +313 -0
  114. package/dist/plugins/listApps/schemas.d.ts +30 -0
  115. package/dist/plugins/listApps/schemas.d.ts.map +1 -0
  116. package/dist/plugins/listApps/schemas.js +23 -0
  117. package/dist/plugins/listAuthentications/index.d.ts +28 -0
  118. package/dist/plugins/listAuthentications/index.d.ts.map +1 -0
  119. package/dist/plugins/listAuthentications/index.js +77 -0
  120. package/dist/plugins/listAuthentications/index.test.d.ts +2 -0
  121. package/dist/plugins/listAuthentications/index.test.d.ts.map +1 -0
  122. package/dist/plugins/listAuthentications/index.test.js +564 -0
  123. package/dist/plugins/listAuthentications/schemas.d.ts +38 -0
  124. package/dist/plugins/listAuthentications/schemas.d.ts.map +1 -0
  125. package/dist/plugins/listAuthentications/schemas.js +28 -0
  126. package/dist/plugins/listInputFields/index.d.ts +28 -0
  127. package/dist/plugins/listInputFields/index.d.ts.map +1 -0
  128. package/dist/plugins/listInputFields/index.js +133 -0
  129. package/dist/plugins/listInputFields/index.test.d.ts +2 -0
  130. package/dist/plugins/listInputFields/index.test.d.ts.map +1 -0
  131. package/dist/plugins/listInputFields/index.test.js +325 -0
  132. package/dist/plugins/listInputFields/schemas.d.ts +38 -0
  133. package/dist/plugins/listInputFields/schemas.d.ts.map +1 -0
  134. package/dist/plugins/listInputFields/schemas.js +22 -0
  135. package/dist/plugins/registry/index.d.ts +11 -0
  136. package/dist/plugins/registry/index.d.ts.map +1 -0
  137. package/dist/plugins/registry/index.js +14 -0
  138. package/dist/plugins/request/index.d.ts +19 -0
  139. package/dist/plugins/request/index.d.ts.map +1 -0
  140. package/dist/plugins/request/index.js +62 -0
  141. package/dist/plugins/request/index.test.d.ts +2 -0
  142. package/dist/plugins/request/index.test.d.ts.map +1 -0
  143. package/dist/plugins/request/index.test.js +256 -0
  144. package/dist/plugins/request/schemas.d.ts +69 -0
  145. package/dist/plugins/request/schemas.d.ts.map +1 -0
  146. package/dist/plugins/request/schemas.js +42 -0
  147. package/dist/plugins/runAction/index.d.ts +28 -0
  148. package/dist/plugins/runAction/index.d.ts.map +1 -0
  149. package/dist/plugins/runAction/index.js +86 -0
  150. package/dist/plugins/runAction/index.test.d.ts +2 -0
  151. package/dist/plugins/runAction/index.test.d.ts.map +1 -0
  152. package/dist/plugins/runAction/index.test.js +320 -0
  153. package/dist/plugins/runAction/schemas.d.ts +37 -0
  154. package/dist/plugins/runAction/schemas.d.ts.map +1 -0
  155. package/dist/plugins/runAction/schemas.js +22 -0
  156. package/dist/resolvers/actionKey.d.ts +9 -0
  157. package/dist/resolvers/actionKey.d.ts.map +1 -0
  158. package/dist/resolvers/actionKey.js +19 -0
  159. package/dist/resolvers/actionType.d.ts +9 -0
  160. package/dist/resolvers/actionType.d.ts.map +1 -0
  161. package/dist/resolvers/actionType.js +22 -0
  162. package/dist/resolvers/appKey.d.ts +7 -0
  163. package/dist/resolvers/appKey.d.ts.map +1 -0
  164. package/dist/resolvers/appKey.js +5 -0
  165. package/dist/resolvers/authenticationId.d.ts +9 -0
  166. package/dist/resolvers/authenticationId.d.ts.map +1 -0
  167. package/dist/resolvers/authenticationId.js +33 -0
  168. package/dist/resolvers/index.d.ts +40 -0
  169. package/dist/resolvers/index.d.ts.map +1 -0
  170. package/dist/resolvers/index.js +91 -0
  171. package/dist/resolvers/inputs.d.ts +8 -0
  172. package/dist/resolvers/inputs.d.ts.map +1 -0
  173. package/dist/resolvers/inputs.js +14 -0
  174. package/dist/schemas/Action.d.ts +243 -0
  175. package/dist/schemas/Action.d.ts.map +1 -0
  176. package/dist/schemas/Action.js +34 -0
  177. package/dist/schemas/App.d.ts +26 -0
  178. package/dist/schemas/App.d.ts.map +1 -0
  179. package/dist/schemas/App.js +22 -0
  180. package/dist/schemas/Auth.d.ts +161 -0
  181. package/dist/schemas/Auth.d.ts.map +1 -0
  182. package/dist/schemas/Auth.js +41 -0
  183. package/dist/schemas/Field.d.ts +144 -0
  184. package/dist/schemas/Field.d.ts.map +1 -0
  185. package/dist/schemas/Field.js +105 -0
  186. package/dist/schemas/UserProfile.d.ts +163 -0
  187. package/dist/schemas/UserProfile.d.ts.map +1 -0
  188. package/dist/schemas/UserProfile.js +29 -0
  189. package/dist/sdk.d.ts +10 -0
  190. package/dist/sdk.d.ts.map +1 -0
  191. package/dist/sdk.js +94 -0
  192. package/dist/sdk.test.d.ts +2 -0
  193. package/dist/sdk.test.d.ts.map +1 -0
  194. package/dist/sdk.test.js +135 -0
  195. package/dist/types/domain.d.ts +36 -0
  196. package/dist/types/domain.d.ts.map +1 -0
  197. package/dist/types/domain.js +1 -0
  198. package/dist/types/domain.test.d.ts +2 -0
  199. package/dist/types/domain.test.d.ts.map +1 -0
  200. package/dist/types/domain.test.js +39 -0
  201. package/dist/types/errors.d.ts +143 -0
  202. package/dist/types/errors.d.ts.map +1 -0
  203. package/dist/types/errors.js +187 -0
  204. package/dist/types/events.d.ts +38 -0
  205. package/dist/types/events.d.ts.map +1 -0
  206. package/dist/types/events.js +7 -0
  207. package/dist/types/functions.d.ts +26 -0
  208. package/dist/types/functions.d.ts.map +1 -0
  209. package/dist/types/functions.js +4 -0
  210. package/dist/types/plugin.d.ts +61 -0
  211. package/dist/types/plugin.d.ts.map +1 -0
  212. package/dist/types/plugin.js +9 -0
  213. package/dist/types/properties.d.ts +22 -0
  214. package/dist/types/properties.d.ts.map +1 -0
  215. package/dist/types/properties.js +50 -0
  216. package/dist/types/sdk.d.ts +43 -0
  217. package/dist/types/sdk.d.ts.map +1 -0
  218. package/dist/types/sdk.js +4 -0
  219. package/dist/utils/array-utils.d.ts +31 -0
  220. package/dist/utils/array-utils.d.ts.map +1 -0
  221. package/dist/utils/array-utils.js +36 -0
  222. package/dist/utils/array-utils.test.d.ts +2 -0
  223. package/dist/utils/array-utils.test.d.ts.map +1 -0
  224. package/dist/utils/array-utils.test.js +107 -0
  225. package/dist/utils/domain-utils.d.ts +78 -0
  226. package/dist/utils/domain-utils.d.ts.map +1 -0
  227. package/dist/utils/domain-utils.js +218 -0
  228. package/dist/utils/domain-utils.test.d.ts +2 -0
  229. package/dist/utils/domain-utils.test.d.ts.map +1 -0
  230. package/dist/utils/domain-utils.test.js +192 -0
  231. package/dist/utils/function-utils.d.ts +45 -0
  232. package/dist/utils/function-utils.d.ts.map +1 -0
  233. package/dist/utils/function-utils.js +158 -0
  234. package/dist/utils/function-utils.test.d.ts +2 -0
  235. package/dist/utils/function-utils.test.d.ts.map +1 -0
  236. package/dist/utils/function-utils.test.js +110 -0
  237. package/dist/utils/pagination-utils.d.ts +37 -0
  238. package/dist/utils/pagination-utils.d.ts.map +1 -0
  239. package/dist/utils/pagination-utils.js +165 -0
  240. package/dist/utils/pagination-utils.test.d.ts +17 -0
  241. package/dist/utils/pagination-utils.test.d.ts.map +1 -0
  242. package/dist/utils/pagination-utils.test.js +461 -0
  243. package/dist/utils/schema-utils.d.ts +45 -0
  244. package/dist/utils/schema-utils.d.ts.map +1 -0
  245. package/dist/utils/schema-utils.js +65 -0
  246. package/dist/utils/validation.d.ts +4 -0
  247. package/dist/utils/validation.d.ts.map +1 -0
  248. package/dist/utils/validation.js +30 -0
  249. package/dist/utils/validation.test.d.ts +2 -0
  250. package/dist/utils/validation.test.d.ts.map +1 -0
  251. package/dist/utils/validation.test.js +43 -0
  252. package/package.json +12 -3
  253. package/src/api/client.ts +394 -171
  254. package/src/api/debug.ts +10 -1
  255. package/src/api/index.ts +0 -2
  256. package/src/api/polling.ts +28 -7
  257. package/src/api/schemas.ts +387 -0
  258. package/src/api/types.ts +72 -136
  259. package/src/constants.ts +10 -0
  260. package/src/index.ts +40 -19
  261. package/src/plugins/api/index.ts +47 -0
  262. package/src/plugins/apps/index.ts +25 -19
  263. package/src/plugins/apps/types.ts +7 -11
  264. package/src/plugins/fetch/index.ts +48 -40
  265. package/src/plugins/findFirstAuthentication/index.test.ts +206 -0
  266. package/src/plugins/findFirstAuthentication/index.ts +55 -0
  267. package/src/plugins/findFirstAuthentication/schemas.ts +41 -0
  268. package/src/plugins/findUniqueAuthentication/index.test.ts +197 -0
  269. package/src/plugins/findUniqueAuthentication/index.ts +72 -0
  270. package/src/plugins/findUniqueAuthentication/schemas.ts +42 -0
  271. package/src/plugins/getAction/index.test.ts +239 -0
  272. package/src/plugins/getAction/index.ts +57 -0
  273. package/src/plugins/getAction/schemas.ts +33 -0
  274. package/src/plugins/getApp/index.test.ts +127 -0
  275. package/src/plugins/getApp/index.ts +66 -0
  276. package/src/plugins/getApp/schemas.ts +38 -0
  277. package/src/plugins/getAuthentication/index.test.ts +284 -0
  278. package/src/plugins/getAuthentication/index.ts +86 -0
  279. package/src/plugins/getAuthentication/schemas.ts +31 -0
  280. package/src/plugins/getProfile/index.ts +55 -0
  281. package/src/plugins/getProfile/schemas.ts +26 -0
  282. package/src/plugins/listActions/index.test.ts +582 -0
  283. package/src/plugins/listActions/index.ts +115 -0
  284. package/src/plugins/listActions/schemas.ts +54 -0
  285. package/src/plugins/listApps/index.test.ts +357 -0
  286. package/src/plugins/listApps/index.ts +121 -0
  287. package/src/plugins/listApps/schemas.ts +49 -0
  288. package/src/plugins/listAuthentications/index.test.ts +709 -0
  289. package/src/plugins/listAuthentications/index.ts +136 -0
  290. package/src/plugins/listAuthentications/schemas.ts +60 -0
  291. package/src/plugins/listInputFields/index.test.ts +408 -0
  292. package/src/plugins/listInputFields/index.ts +204 -0
  293. package/src/plugins/listInputFields/schemas.ts +56 -0
  294. package/src/plugins/registry/index.ts +30 -0
  295. package/src/plugins/request/index.test.ts +329 -0
  296. package/src/plugins/request/index.ts +103 -0
  297. package/src/{functions → plugins}/request/schemas.ts +20 -9
  298. package/src/plugins/runAction/index.test.ts +387 -0
  299. package/src/plugins/runAction/index.ts +176 -0
  300. package/src/plugins/runAction/schemas.ts +53 -0
  301. package/src/resolvers/actionKey.ts +6 -4
  302. package/src/resolvers/actionType.ts +7 -2
  303. package/src/resolvers/appKey.ts +1 -1
  304. package/src/resolvers/authenticationId.ts +12 -3
  305. package/src/resolvers/inputs.ts +3 -1
  306. package/src/schemas/Action.ts +18 -12
  307. package/src/schemas/App.ts +11 -19
  308. package/src/schemas/Auth.ts +18 -13
  309. package/src/schemas/Field.ts +106 -11
  310. package/src/schemas/UserProfile.ts +43 -0
  311. package/src/sdk.test.ts +212 -0
  312. package/src/sdk.ts +132 -102
  313. package/src/types/domain.test.ts +50 -0
  314. package/src/types/domain.ts +43 -75
  315. package/src/types/errors.ts +275 -0
  316. package/src/types/functions.ts +27 -0
  317. package/src/types/optional-zapier-sdk-cli-login.d.ts +37 -0
  318. package/src/types/plugin.ts +105 -0
  319. package/src/types/properties.ts +4 -3
  320. package/src/types/sdk.ts +70 -48
  321. package/src/utils/array-utils.test.ts +131 -0
  322. package/src/utils/array-utils.ts +41 -0
  323. package/src/utils/domain-utils.test.ts +239 -0
  324. package/src/utils/domain-utils.ts +283 -0
  325. package/src/utils/function-utils.test.ts +141 -0
  326. package/src/utils/function-utils.ts +245 -0
  327. package/src/utils/pagination-utils.test.ts +620 -0
  328. package/src/utils/pagination-utils.ts +242 -0
  329. package/src/utils/validation.test.ts +50 -0
  330. package/src/utils/validation.ts +44 -0
  331. package/tsconfig.build.json +16 -2
  332. package/tsconfig.json +3 -1
  333. package/tsconfig.tsbuildinfo +1 -0
  334. package/tsup.config.ts +2 -0
  335. package/src/functions/bundleCode/index.ts +0 -78
  336. package/src/functions/bundleCode/info.ts +0 -9
  337. package/src/functions/bundleCode/schemas.ts +0 -30
  338. package/src/functions/findFirstAuthentication/index.ts +0 -24
  339. package/src/functions/findFirstAuthentication/info.ts +0 -9
  340. package/src/functions/findFirstAuthentication/schemas.ts +0 -50
  341. package/src/functions/findUniqueAuthentication/index.ts +0 -35
  342. package/src/functions/findUniqueAuthentication/info.ts +0 -9
  343. package/src/functions/findUniqueAuthentication/schemas.ts +0 -50
  344. package/src/functions/generateTypes/index.ts +0 -363
  345. package/src/functions/generateTypes/info.ts +0 -9
  346. package/src/functions/generateTypes/schemas.ts +0 -31
  347. package/src/functions/getAction/index.ts +0 -33
  348. package/src/functions/getAction/info.ts +0 -9
  349. package/src/functions/getAction/schemas.ts +0 -25
  350. package/src/functions/getApp/index.ts +0 -41
  351. package/src/functions/getApp/info.ts +0 -9
  352. package/src/functions/getApp/schemas.ts +0 -20
  353. package/src/functions/getAuthentication/index.ts +0 -50
  354. package/src/functions/getAuthentication/info.ts +0 -9
  355. package/src/functions/getAuthentication/schemas.ts +0 -29
  356. package/src/functions/listActions/index.ts +0 -149
  357. package/src/functions/listActions/info.ts +0 -9
  358. package/src/functions/listActions/schemas.ts +0 -30
  359. package/src/functions/listApps/index.ts +0 -60
  360. package/src/functions/listApps/info.ts +0 -9
  361. package/src/functions/listApps/schemas.ts +0 -32
  362. package/src/functions/listAuthentications/index.ts +0 -162
  363. package/src/functions/listAuthentications/info.ts +0 -9
  364. package/src/functions/listAuthentications/schemas.ts +0 -50
  365. package/src/functions/listFields/index.ts +0 -86
  366. package/src/functions/listFields/info.ts +0 -9
  367. package/src/functions/listFields/schemas.ts +0 -36
  368. package/src/functions/request/index.ts +0 -150
  369. package/src/functions/request/info.ts +0 -11
  370. package/src/functions/runAction/index.ts +0 -127
  371. package/src/functions/runAction/info.ts +0 -9
  372. package/src/functions/runAction/schemas.ts +0 -34
  373. package/src/plugins/apps/info.ts +0 -12
  374. package/src/plugins/fetch/types.ts +0 -2
  375. /package/src/{schema-utils.ts → utils/schema-utils.ts} +0 -0
@@ -0,0 +1,564 @@
1
+ import { describe, it, expect, vi, beforeEach } from "vitest";
2
+ import { ZapierValidationError, ZapierAuthenticationError, } from "../../types/errors";
3
+ import { listAuthenticationsPlugin } from "./index";
4
+ import { createSdk } from "../../sdk";
5
+ const mockAuthenticationsResponse = {
6
+ results: [
7
+ {
8
+ id: 123,
9
+ date: "2021-01-01",
10
+ account_id: 456,
11
+ selected_api: "SlackCLIAPI@1.21.1",
12
+ is_invite_only: false,
13
+ is_private: false,
14
+ shared_with_all: false,
15
+ is_stale: "false",
16
+ marked_stale_at: null,
17
+ label: "My Slack Workspace",
18
+ title: "My Slack Workspace",
19
+ },
20
+ {
21
+ id: 789,
22
+ date: "2021-02-01",
23
+ account_id: 456,
24
+ selected_api: "GitHubAPI@2.1.0",
25
+ is_invite_only: false,
26
+ is_private: false,
27
+ shared_with_all: true,
28
+ is_stale: "true",
29
+ marked_stale_at: "2021-06-01",
30
+ label: "GitHub Integration",
31
+ title: "GitHub Integration",
32
+ },
33
+ ],
34
+ count: 2,
35
+ next: null,
36
+ previous: null,
37
+ };
38
+ const mockSlackApp = {
39
+ data: {
40
+ id: 1,
41
+ key: "slack",
42
+ title: "Slack",
43
+ hex_color: "#000000",
44
+ age_in_days: "100",
45
+ api_docs_url: "https://slack.com/api-docs",
46
+ app_profile_url: "https://slack.com",
47
+ banner: "https://slack.com/banner.png",
48
+ categories: [],
49
+ canonical_id: "slack",
50
+ zap_usage_count: 100,
51
+ zap_usage_count_last_updated: "2021-01-01",
52
+ zap_usage_count_last_updated_by: "user1",
53
+ zap_usage_count_last_updated_by_id: 123,
54
+ current_implementation_id: "SlackCLIAPI@1.21.1",
55
+ },
56
+ };
57
+ describe("listAuthentications plugin", () => {
58
+ let mockApiClient;
59
+ let mockGetApp;
60
+ beforeEach(() => {
61
+ vi.clearAllMocks();
62
+ mockApiClient = {
63
+ get: vi.fn().mockResolvedValue(mockAuthenticationsResponse),
64
+ };
65
+ mockGetApp = vi.fn().mockResolvedValue(mockSlackApp);
66
+ });
67
+ function createTestSdk() {
68
+ return createSdk({ getApp: mockGetApp }, // Provide getApp in SDK
69
+ { api: mockApiClient, meta: {} }).addPlugin(listAuthenticationsPlugin);
70
+ }
71
+ describe("schema validation", () => {
72
+ it("should pass validation with empty options", async () => {
73
+ const sdk = createTestSdk();
74
+ const result = await sdk.listAuthentications({});
75
+ expect(result.data).toHaveLength(2);
76
+ });
77
+ it("should handle undefined options", async () => {
78
+ const sdk = createTestSdk();
79
+ const result = await sdk.listAuthentications();
80
+ expect(result.data).toHaveLength(2);
81
+ expect(result.data[0]).toMatchObject({
82
+ id: 123,
83
+ });
84
+ });
85
+ it("should throw validation error for invalid appKey type", () => {
86
+ const sdk = createTestSdk();
87
+ expect(() => {
88
+ sdk.listAuthentications({
89
+ appKey: 123,
90
+ });
91
+ }).toThrow(ZapierValidationError);
92
+ });
93
+ it("should throw validation error for invalid search type", () => {
94
+ const sdk = createTestSdk();
95
+ expect(() => {
96
+ sdk.listAuthentications({
97
+ search: 123,
98
+ });
99
+ }).toThrow(ZapierValidationError);
100
+ });
101
+ it("should throw validation error for invalid title type", () => {
102
+ const sdk = createTestSdk();
103
+ expect(() => {
104
+ sdk.listAuthentications({
105
+ title: 123,
106
+ });
107
+ }).toThrow(ZapierValidationError);
108
+ });
109
+ it("should throw validation error for invalid account_id type", () => {
110
+ const sdk = createTestSdk();
111
+ expect(() => {
112
+ sdk.listAuthentications({
113
+ account_id: 123,
114
+ });
115
+ }).toThrow(ZapierValidationError);
116
+ });
117
+ it("should throw validation error for invalid owner type", () => {
118
+ const sdk = createTestSdk();
119
+ expect(() => {
120
+ sdk.listAuthentications({
121
+ owner: 123,
122
+ });
123
+ }).toThrow(ZapierValidationError);
124
+ });
125
+ it("should throw validation error for invalid pageSize", () => {
126
+ const sdk = createTestSdk();
127
+ expect(() => {
128
+ sdk.listAuthentications({
129
+ pageSize: 0, // Should be >= 1
130
+ });
131
+ }).toThrow(ZapierValidationError);
132
+ expect(() => {
133
+ sdk.listAuthentications({
134
+ pageSize: -5, // Should be >= 1
135
+ });
136
+ }).toThrow(ZapierValidationError);
137
+ });
138
+ it("should throw validation error for invalid maxItems", () => {
139
+ const sdk = createTestSdk();
140
+ expect(() => {
141
+ sdk.listAuthentications({
142
+ maxItems: 0, // Should be >= 1
143
+ });
144
+ }).toThrow(ZapierValidationError);
145
+ expect(() => {
146
+ sdk.listAuthentications({
147
+ maxItems: -10, // Should be >= 1
148
+ });
149
+ }).toThrow(ZapierValidationError);
150
+ });
151
+ it("should pass validation with all valid fields", async () => {
152
+ const sdk = createTestSdk();
153
+ const result = await sdk.listAuthentications({
154
+ appKey: "slack",
155
+ search: "workspace",
156
+ title: "My Slack Workspace",
157
+ account_id: "acc_123",
158
+ owner: "me",
159
+ pageSize: 10,
160
+ maxItems: 50,
161
+ });
162
+ expect(result.data).toBeDefined();
163
+ });
164
+ });
165
+ describe("data mapping", () => {
166
+ it("should map is_stale to is_expired and marked_stale_at to expired_at", async () => {
167
+ const sdk = createTestSdk();
168
+ const result = await sdk.listAuthentications({});
169
+ expect(result.data[0].is_expired).toBe("false");
170
+ expect(result.data[0].expired_at).toBe(null);
171
+ expect(result.data[1].is_expired).toBe("true");
172
+ expect(result.data[1].expired_at).toBe("2021-06-01");
173
+ });
174
+ it("should coerce title from label when title is missing", async () => {
175
+ const responseWithoutTitle = {
176
+ ...mockAuthenticationsResponse,
177
+ results: [
178
+ {
179
+ ...mockAuthenticationsResponse.results[0],
180
+ title: undefined,
181
+ label: "Label Only Auth",
182
+ },
183
+ ],
184
+ };
185
+ mockApiClient.get = vi.fn().mockResolvedValue(responseWithoutTitle);
186
+ const sdk = createTestSdk();
187
+ const result = await sdk.listAuthentications({});
188
+ expect(result.data[0].title).toBe("Label Only Auth");
189
+ });
190
+ it("should handle authentications with neither title nor label", async () => {
191
+ const responseWithoutTitleOrLabel = {
192
+ ...mockAuthenticationsResponse,
193
+ results: [
194
+ {
195
+ ...mockAuthenticationsResponse.results[0],
196
+ title: undefined,
197
+ label: undefined,
198
+ },
199
+ ],
200
+ };
201
+ mockApiClient.get = vi
202
+ .fn()
203
+ .mockResolvedValue(responseWithoutTitleOrLabel);
204
+ const sdk = createTestSdk();
205
+ const result = await sdk.listAuthentications({});
206
+ expect(result.data[0].title).toBeUndefined();
207
+ });
208
+ });
209
+ describe("filtering", () => {
210
+ it("should filter by exact title match", async () => {
211
+ const sdk = createTestSdk();
212
+ const result = await sdk.listAuthentications({
213
+ title: "My Slack Workspace",
214
+ });
215
+ // Should filter to exact match
216
+ expect(result.data).toHaveLength(1);
217
+ expect(result.data[0].title).toBe("My Slack Workspace");
218
+ });
219
+ it("should use search parameter when provided", async () => {
220
+ const sdk = createTestSdk();
221
+ await sdk.listAuthentications({ search: "workspace" });
222
+ expect(mockApiClient.get).toHaveBeenCalledWith("/api/v4/authentications/", expect.objectContaining({
223
+ searchParams: expect.objectContaining({
224
+ search: "workspace",
225
+ }),
226
+ }));
227
+ });
228
+ it("should use title as search when search not provided", async () => {
229
+ const sdk = createTestSdk();
230
+ await sdk.listAuthentications({ title: "My Slack Workspace" });
231
+ expect(mockApiClient.get).toHaveBeenCalledWith("/api/v4/authentications/", expect.objectContaining({
232
+ searchParams: expect.objectContaining({
233
+ search: "My Slack Workspace",
234
+ }),
235
+ }));
236
+ });
237
+ it("should prefer search over title when both provided", async () => {
238
+ const sdk = createTestSdk();
239
+ await sdk.listAuthentications({
240
+ search: "explicit search",
241
+ title: "My Title",
242
+ });
243
+ expect(mockApiClient.get).toHaveBeenCalledWith("/api/v4/authentications/", expect.objectContaining({
244
+ searchParams: expect.objectContaining({
245
+ search: "explicit search",
246
+ }),
247
+ }));
248
+ });
249
+ it("should pass account_id filter to API", async () => {
250
+ const sdk = createTestSdk();
251
+ await sdk.listAuthentications({ account_id: "acc_123" });
252
+ expect(mockApiClient.get).toHaveBeenCalledWith("/api/v4/authentications/", expect.objectContaining({
253
+ searchParams: expect.objectContaining({
254
+ account_id: "acc_123",
255
+ }),
256
+ }));
257
+ });
258
+ it("should pass owner filter to API", async () => {
259
+ const sdk = createTestSdk();
260
+ await sdk.listAuthentications({ owner: "me" });
261
+ expect(mockApiClient.get).toHaveBeenCalledWith("/api/v4/authentications/", expect.objectContaining({
262
+ searchParams: expect.objectContaining({
263
+ owner: "me",
264
+ }),
265
+ }));
266
+ });
267
+ });
268
+ describe("pagination", () => {
269
+ it("should handle pagination with maxItems by collecting all items", async () => {
270
+ // Mock multiple pages - first page has 2 items, second page has 1 item
271
+ mockApiClient.get = vi
272
+ .fn()
273
+ .mockResolvedValueOnce({
274
+ results: mockAuthenticationsResponse.results,
275
+ count: 3,
276
+ next: "http://example.com/api/v4/authentications/?offset=2",
277
+ })
278
+ .mockResolvedValueOnce({
279
+ results: [
280
+ {
281
+ id: 999,
282
+ date: "2021-03-01",
283
+ account_id: 456,
284
+ selected_api: "DropboxAPI@3.0.0",
285
+ is_invite_only: false,
286
+ is_private: false,
287
+ shared_with_all: false,
288
+ is_stale: "false",
289
+ marked_stale_at: null,
290
+ title: "Dropbox Integration",
291
+ },
292
+ ],
293
+ count: 3,
294
+ next: null,
295
+ });
296
+ const sdk = createTestSdk();
297
+ // Collect all items using the items() iterator
298
+ const items = [];
299
+ for await (const item of sdk
300
+ .listAuthentications({ maxItems: 3 })
301
+ .items()) {
302
+ items.push(item);
303
+ }
304
+ expect(items).toHaveLength(3); // Should stop at maxItems
305
+ expect(mockApiClient.get).toHaveBeenCalledTimes(2); // Should fetch both pages
306
+ });
307
+ it("should return first page when awaited", async () => {
308
+ mockApiClient.get = vi.fn().mockResolvedValue({
309
+ results: mockAuthenticationsResponse.results,
310
+ count: 2,
311
+ next: null, // No more pages to prevent automatic fetching
312
+ });
313
+ const sdk = createTestSdk();
314
+ const result = await sdk.listAuthentications({});
315
+ // Await returns first page only
316
+ expect(result.data).toHaveLength(2);
317
+ expect(mockApiClient.get).toHaveBeenCalledTimes(1);
318
+ });
319
+ it("should support async iteration over pages", async () => {
320
+ mockApiClient.get = vi
321
+ .fn()
322
+ .mockResolvedValueOnce({
323
+ results: mockAuthenticationsResponse.results.slice(0, 1),
324
+ count: 2,
325
+ next: "http://example.com/api/v4/authentications/?offset=1",
326
+ })
327
+ .mockResolvedValueOnce({
328
+ results: mockAuthenticationsResponse.results.slice(1, 2),
329
+ count: 2,
330
+ next: null,
331
+ });
332
+ const sdk = createTestSdk();
333
+ const pages = [];
334
+ for await (const page of sdk.listAuthentications({ pageSize: 1 })) {
335
+ pages.push(page);
336
+ if (pages.length >= 2)
337
+ break;
338
+ }
339
+ expect(pages).toHaveLength(2);
340
+ expect(pages[0].data).toHaveLength(1);
341
+ expect(pages[1].data).toHaveLength(1);
342
+ expect(pages[0].data[0].id).toBe(123);
343
+ expect(pages[1].data[0].id).toBe(789);
344
+ });
345
+ it("should support async iteration over individual items", async () => {
346
+ const sdk = createTestSdk();
347
+ const items = [];
348
+ for await (const item of sdk
349
+ .listAuthentications({ maxItems: 2 })
350
+ .items()) {
351
+ items.push(item);
352
+ }
353
+ expect(items).toHaveLength(2);
354
+ expect(items[0].id).toBe(123);
355
+ expect(items[1].id).toBe(789);
356
+ });
357
+ it("should set appropriate pageSize for API calls", async () => {
358
+ const sdk = createTestSdk();
359
+ await sdk.listAuthentications({ pageSize: 1 });
360
+ expect(mockApiClient.get).toHaveBeenCalledWith("/api/v4/authentications/", expect.objectContaining({
361
+ searchParams: expect.objectContaining({
362
+ limit: "1",
363
+ }),
364
+ }));
365
+ });
366
+ });
367
+ describe("API integration", () => {
368
+ it("should call the correct API endpoint", async () => {
369
+ const sdk = createTestSdk();
370
+ await sdk.listAuthentications({});
371
+ expect(mockApiClient.get).toHaveBeenCalledWith("/api/v4/authentications/", expect.any(Object));
372
+ });
373
+ it("should pass pageSize as limit parameter", async () => {
374
+ const sdk = createTestSdk();
375
+ await sdk.listAuthentications({ pageSize: 25 });
376
+ expect(mockApiClient.get).toHaveBeenCalledWith("/api/v4/authentications/", expect.objectContaining({
377
+ searchParams: expect.objectContaining({
378
+ limit: "25",
379
+ }),
380
+ }));
381
+ });
382
+ it("should handle cursor-based pagination internally", async () => {
383
+ mockApiClient.get = vi
384
+ .fn()
385
+ .mockResolvedValueOnce({
386
+ results: mockAuthenticationsResponse.results.slice(0, 1),
387
+ count: 2,
388
+ next: "http://example.com/api/v4/authentications/?offset=1",
389
+ })
390
+ .mockResolvedValueOnce({
391
+ results: mockAuthenticationsResponse.results.slice(1, 2),
392
+ count: 2,
393
+ next: null,
394
+ });
395
+ const sdk = createTestSdk();
396
+ // Test that the function can handle multiple pages
397
+ let pageCount = 0;
398
+ for await (const _page of sdk.listAuthentications({ pageSize: 1 })) {
399
+ pageCount++;
400
+ if (pageCount >= 2)
401
+ break;
402
+ }
403
+ expect(pageCount).toBe(2);
404
+ expect(mockApiClient.get).toHaveBeenCalledTimes(2);
405
+ // The second call should include the offset from the cursor
406
+ expect(mockApiClient.get).toHaveBeenNthCalledWith(2, "/api/v4/authentications/", expect.objectContaining({
407
+ searchParams: expect.objectContaining({
408
+ offset: "1",
409
+ }),
410
+ }));
411
+ });
412
+ });
413
+ describe("error handling", () => {
414
+ it("should throw ZapierAuthenticationError for 401 responses", async () => {
415
+ const customErrorHandler = vi
416
+ .fn()
417
+ .mockReturnValue(new ZapierAuthenticationError("Authentication failed. Your token may not have permission to access authentications or may be expired. (HTTP 401)", { statusCode: 401 }));
418
+ mockApiClient.get = vi.fn().mockImplementation(() => {
419
+ const error = customErrorHandler({ status: 401 });
420
+ throw error;
421
+ });
422
+ const sdk = createTestSdk();
423
+ await expect(sdk.listAuthentications({})).rejects.toThrow(ZapierAuthenticationError);
424
+ });
425
+ it("should throw ZapierAuthenticationError for 403 responses", async () => {
426
+ const customErrorHandler = vi
427
+ .fn()
428
+ .mockReturnValue(new ZapierAuthenticationError("Access forbidden. Your token may not have the required scopes to list authentications. (HTTP 403)", { statusCode: 403 }));
429
+ mockApiClient.get = vi.fn().mockImplementation(() => {
430
+ const error = customErrorHandler({ status: 403 });
431
+ throw error;
432
+ });
433
+ const sdk = createTestSdk();
434
+ await expect(sdk.listAuthentications({})).rejects.toThrow(ZapierAuthenticationError);
435
+ });
436
+ it("should handle empty results", async () => {
437
+ const emptyResponse = {
438
+ results: [],
439
+ count: 0,
440
+ next: null,
441
+ };
442
+ mockApiClient.get = vi.fn().mockResolvedValue(emptyResponse);
443
+ const sdk = createTestSdk();
444
+ const result = await sdk.listAuthentications({});
445
+ expect(result.data).toHaveLength(0);
446
+ expect(Array.isArray(result.data)).toBe(true);
447
+ });
448
+ it("should handle missing results field", async () => {
449
+ const responseWithoutResults = {
450
+ count: 0,
451
+ next: null,
452
+ };
453
+ mockApiClient.get = vi.fn().mockResolvedValue(responseWithoutResults);
454
+ const sdk = createTestSdk();
455
+ const result = await sdk.listAuthentications({});
456
+ expect(result.data).toHaveLength(0);
457
+ expect(Array.isArray(result.data)).toBe(true);
458
+ });
459
+ });
460
+ describe("app key integration", () => {
461
+ it("should handle app without current_implementation_id", async () => {
462
+ const appWithoutImplementation = {
463
+ data: {
464
+ id: 123,
465
+ key: "slack",
466
+ title: "Slack",
467
+ current_implementation_id: undefined,
468
+ },
469
+ };
470
+ mockGetApp.mockResolvedValue(appWithoutImplementation);
471
+ const sdk = createTestSdk();
472
+ await sdk.listAuthentications({ appKey: "slack" });
473
+ // Should not add versionless_selected_api parameter
474
+ expect(mockApiClient.get).toHaveBeenCalledWith("/api/v4/authentications/", expect.objectContaining({
475
+ searchParams: expect.not.objectContaining({
476
+ versionless_selected_api: expect.any(String),
477
+ }),
478
+ }));
479
+ });
480
+ it("should extract versionless API from versioned implementation ID", async () => {
481
+ const appWithVersionedApi = {
482
+ data: {
483
+ id: 123,
484
+ key: "slack",
485
+ title: "Slack",
486
+ current_implementation_id: "SlackCLIAPI@2.1.3",
487
+ },
488
+ };
489
+ mockGetApp.mockResolvedValue(appWithVersionedApi);
490
+ const sdk = createTestSdk();
491
+ await sdk.listAuthentications({ appKey: "slack" });
492
+ expect(mockApiClient.get).toHaveBeenCalledWith("/api/v4/authentications/", expect.objectContaining({
493
+ searchParams: expect.objectContaining({
494
+ versionless_selected_api: "SlackCLIAPI",
495
+ }),
496
+ }));
497
+ });
498
+ });
499
+ describe("response transformation", () => {
500
+ it("should preserve all original authentication fields", async () => {
501
+ const authWithAllFields = {
502
+ results: [
503
+ {
504
+ id: 123,
505
+ date: "2021-01-01",
506
+ lastchanged: "2021-01-02",
507
+ account_id: 456,
508
+ customuser_id: 789,
509
+ selected_api: "SlackCLIAPI@1.21.1",
510
+ destination_selected_api: "SlackDestAPI@1.0.0",
511
+ is_invite_only: true,
512
+ is_private: true,
513
+ shared_with_all: false,
514
+ is_stale: "true",
515
+ is_shared: "false",
516
+ marked_stale_at: "2021-06-01",
517
+ label: "Auth Label",
518
+ title: "Auth Title",
519
+ identifier: "auth-identifier",
520
+ url: "https://example.com",
521
+ groups: "group1,group2",
522
+ members: "user1,user2",
523
+ permissions: { read: true, write: false },
524
+ },
525
+ ],
526
+ count: 1,
527
+ };
528
+ mockApiClient.get = vi.fn().mockResolvedValue(authWithAllFields);
529
+ const sdk = createTestSdk();
530
+ const result = await sdk.listAuthentications({});
531
+ const auth = result.data[0];
532
+ // Verify original fields are preserved
533
+ expect(auth.id).toBe(123);
534
+ expect(auth.date).toBe("2021-01-01");
535
+ expect(auth.lastchanged).toBe("2021-01-02");
536
+ expect(auth.account_id).toBe(456);
537
+ expect(auth.user_id).toBe(789);
538
+ expect(auth.implementation_id).toBe("SlackCLIAPI@1.21.1");
539
+ expect(auth.destination_selected_api).toBe("SlackDestAPI@1.0.0");
540
+ expect(auth.is_invite_only).toBe(true);
541
+ expect(auth.is_private).toBe(true);
542
+ expect(auth.shared_with_all).toBe(false);
543
+ expect(auth.is_shared).toBe("false");
544
+ expect(auth.label).toBe("Auth Label");
545
+ expect(auth.title).toBe("Auth Title");
546
+ expect(auth.identifier).toBe("auth-identifier");
547
+ expect(auth.url).toBe("https://example.com");
548
+ expect(auth.groups).toBe("group1,group2");
549
+ expect(auth.members).toBe("user1,user2");
550
+ expect(auth.permissions).toEqual({ read: true, write: false });
551
+ // Verify mapped fields
552
+ expect(auth.is_expired).toBe("true");
553
+ expect(auth.expired_at).toBe("2021-06-01");
554
+ });
555
+ });
556
+ describe("context and metadata", () => {
557
+ it("should provide context with meta information", () => {
558
+ const sdk = createTestSdk();
559
+ const context = sdk.getContext();
560
+ expect(context.meta.listAuthentications).toBeDefined();
561
+ expect(context.meta.listAuthentications.inputSchema).toBeDefined();
562
+ });
563
+ });
564
+ });
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ import type { PaginatedSdkFunction } from "../../types/functions";
3
+ import type { AuthenticationItem } from "../../types/domain";
4
+ export declare const ListAuthenticationsSchema: z.ZodObject<{
5
+ appKey: z.ZodOptional<z.ZodString>;
6
+ search: z.ZodOptional<z.ZodString>;
7
+ title: z.ZodOptional<z.ZodString>;
8
+ account_id: z.ZodOptional<z.ZodString>;
9
+ owner: z.ZodOptional<z.ZodString>;
10
+ pageSize: z.ZodOptional<z.ZodNumber>;
11
+ maxItems: z.ZodOptional<z.ZodNumber>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ title?: string | undefined;
14
+ search?: string | undefined;
15
+ account_id?: string | undefined;
16
+ maxItems?: number | undefined;
17
+ pageSize?: number | undefined;
18
+ appKey?: string | undefined;
19
+ owner?: string | undefined;
20
+ }, {
21
+ title?: string | undefined;
22
+ search?: string | undefined;
23
+ account_id?: string | undefined;
24
+ maxItems?: number | undefined;
25
+ pageSize?: number | undefined;
26
+ appKey?: string | undefined;
27
+ owner?: string | undefined;
28
+ }>;
29
+ export type ListAuthenticationsOptions = z.infer<typeof ListAuthenticationsSchema>;
30
+ export interface ListAuthenticationsPage {
31
+ data: AuthenticationItem[];
32
+ nextCursor?: string;
33
+ }
34
+ export type ListAuthenticationsError = import("../../types/errors").ZapierAuthenticationError | import("../../types/errors").ZapierApiError | import("../../types/errors").ZapierAppNotFoundError | import("../../types/errors").ZapierValidationError | import("../../types/errors").ZapierUnknownError;
35
+ export interface ListAuthenticationsSdkFunction {
36
+ listAuthentications: PaginatedSdkFunction<ListAuthenticationsOptions, AuthenticationItem>;
37
+ }
38
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listAuthentications/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;EA0B+B,CAAC;AAGtE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,yBAAyB,CACjC,CAAC;AAGF,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,wBAAwB,GAChC,OAAO,oBAAoB,EAAE,yBAAyB,GACtD,OAAO,oBAAoB,EAAE,cAAc,GAC3C,OAAO,oBAAoB,EAAE,sBAAsB,GACnD,OAAO,oBAAoB,EAAE,qBAAqB,GAClD,OAAO,oBAAoB,EAAE,kBAAkB,CAAC;AAGpD,MAAM,WAAW,8BAA8B;IAC7C,mBAAmB,EAAE,oBAAoB,CACvC,0BAA0B,EAC1B,kBAAkB,CACnB,CAAC;CACH"}
@@ -0,0 +1,28 @@
1
+ import { z } from "zod";
2
+ import { AppKeyPropertySchema } from "../../types/properties";
3
+ // Pure Zod schema - no resolver metadata!
4
+ export const ListAuthenticationsSchema = z
5
+ .object({
6
+ appKey: AppKeyPropertySchema.optional().describe("App key of authentications to list (e.g., 'SlackCLIAPI')"),
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
+ account_id: z.string().optional().describe("Filter by account ID"),
16
+ owner: z.string().optional().describe("Filter by owner"),
17
+ pageSize: z
18
+ .number()
19
+ .min(1)
20
+ .optional()
21
+ .describe("Number of authentications per page"),
22
+ maxItems: z
23
+ .number()
24
+ .min(1)
25
+ .optional()
26
+ .describe("Maximum total items to return across all pages"),
27
+ })
28
+ .describe("List available authentications with optional filtering");
@@ -0,0 +1,28 @@
1
+ import type { Plugin, GetSdkType } from "../../types/plugin";
2
+ import type { ApiClient } from "../../api";
3
+ import type { InputFieldItem } from "../../types/domain";
4
+ import { ListInputFieldsSchema, type ListInputFieldsOptions } from "./schemas";
5
+ import type { GetAppPluginProvides } from "../getApp";
6
+ export interface ListInputFieldsPluginProvides {
7
+ listInputFields: (options?: ListInputFieldsOptions) => Promise<{
8
+ data: InputFieldItem[];
9
+ }> & AsyncIterable<{
10
+ data: InputFieldItem[];
11
+ nextCursor?: string;
12
+ }> & {
13
+ items(): AsyncIterable<InputFieldItem>;
14
+ };
15
+ context: {
16
+ meta: {
17
+ listInputFields: {
18
+ inputSchema: typeof ListInputFieldsSchema;
19
+ };
20
+ };
21
+ };
22
+ }
23
+ export declare const listInputFieldsPlugin: Plugin<GetSdkType<GetAppPluginProvides>, // requires getApp in SDK
24
+ {
25
+ api: ApiClient;
26
+ }, // requires api in context
27
+ ListInputFieldsPluginProvides>;
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFields/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,qBAAqB,EACrB,KAAK,sBAAsB,EAE5B,MAAM,WAAW,CAAC;AAGnB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAkGtD,MAAM,WAAW,6BAA6B;IAC5C,eAAe,EAAE,CAAC,OAAO,CAAC,EAAE,sBAAsB,KAAK,OAAO,CAAC;QAC7D,IAAI,EAAE,cAAc,EAAE,CAAC;KACxB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,cAAc,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAC/D,KAAK,IAAI,aAAa,CAAC,cAAc,CAAC,CAAC;KACxC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,eAAe,EAAE;gBACf,WAAW,EAAE,OAAO,qBAAqB,CAAC;aAC3C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,qBAAqB,EAAE,MAAM,CACxC,UAAU,CAAC,oBAAoB,CAAC,EAAE,yBAAyB;AAC3D;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,EAAE,0BAA0B;AAC9C,6BAA6B,CA2E9B,CAAC"}