@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,212 @@
1
+ // Test the flat plugin system
2
+ import { describe, it, expect } from "vitest";
3
+ import { createZapierSdk, createSdk } from "./sdk";
4
+ import type { Plugin } from "./types/plugin";
5
+
6
+ describe("Flat Plugin System", () => {
7
+ it("should create SDK with all expected methods", () => {
8
+ const sdk = createZapierSdk();
9
+
10
+ // Test that all core methods are available
11
+ expect(sdk.listApps).toBeDefined();
12
+ expect(sdk.listAuthentications).toBeDefined();
13
+ expect(sdk.getAuthentication).toBeDefined();
14
+ expect(sdk.runAction).toBeDefined();
15
+ expect(sdk.request).toBeDefined();
16
+
17
+ // Test that plugin methods are available
18
+ expect(sdk.fetch).toBeDefined();
19
+ expect(sdk.apps).toBeDefined();
20
+ expect(sdk.getProfile).toBeDefined();
21
+
22
+ // Test that getContext method is available
23
+ expect(sdk.getContext).toBeDefined();
24
+ expect(typeof sdk.getContext).toBe("function");
25
+ });
26
+
27
+ it("should have getContext method that returns context", () => {
28
+ const sdk = createZapierSdk();
29
+ const context = sdk.getContext() as any; // Type assertion to work around complex context inference
30
+
31
+ // Context should be an object
32
+ expect(typeof context).toBe("object");
33
+ expect(context).not.toBeNull();
34
+
35
+ // Context should have some properties (specific properties depend on plugin composition)
36
+ expect(Object.keys(context).length).toBeGreaterThan(0);
37
+
38
+ // Should have meta object
39
+ expect(context.meta).toBeDefined();
40
+ expect(typeof context.meta).toBe("object");
41
+
42
+ // Should have getProfile metadata from the plugin (verify it exists in meta)
43
+ expect("getProfile" in context.meta).toBe(true);
44
+ expect(context.meta.getProfile).toBeDefined();
45
+ expect(context.meta.getProfile.inputSchema).toBeDefined();
46
+ });
47
+
48
+ it("should have plugins return flat structure", () => {
49
+ const sdk = createZapierSdk();
50
+
51
+ // fetch should be directly available (not sdk.plugins.fetch or sdk.fetch.fetch)
52
+ expect(typeof sdk.fetch).toBe("function");
53
+
54
+ // apps should be directly available
55
+ expect(typeof sdk.apps).toBe("object");
56
+
57
+ // getProfile should be directly available
58
+ expect(typeof sdk.getProfile).toBe("function");
59
+ });
60
+
61
+ it("should support fluent plugin chaining with createSdk", () => {
62
+ // Test that createSdk().addPlugin().addPlugin() works and returns properly typed SDK
63
+ const testPlugin: Plugin<
64
+ {}, // no SDK dependencies
65
+ {}, // no context requirements
66
+ { testMethod: () => string }
67
+ > = () => ({
68
+ testMethod: () => "test result",
69
+ });
70
+
71
+ const sdk = createSdk().addPlugin(testPlugin);
72
+
73
+ // Should have getContext method
74
+ expect(typeof sdk.getContext).toBe("function");
75
+
76
+ // Should have addPlugin method for further chaining
77
+ expect(typeof sdk.addPlugin).toBe("function");
78
+
79
+ // Should have the plugin method
80
+ expect(typeof sdk.testMethod).toBe("function");
81
+ expect(sdk.testMethod()).toBe("test result");
82
+ });
83
+
84
+ it("should support fluent plugin chaining without .getSdk()", () => {
85
+ // This demonstrates the simplified API - no .getSdk() needed!
86
+ const plugin1: Plugin<
87
+ {}, // no SDK dependencies
88
+ {}, // no context requirements
89
+ { method1: () => string }
90
+ > = () => ({ method1: () => "method1" });
91
+
92
+ const plugin2: Plugin<
93
+ { method1: () => string }, // depends on method1 in SDK
94
+ {}, // no context requirements
95
+ { method2: () => string }
96
+ > = () => ({ method2: () => "method2" });
97
+
98
+ // Fluent chaining - each addPlugin returns a new SDK
99
+ const sdk = createSdk().addPlugin(plugin1).addPlugin(plugin2);
100
+
101
+ expect(sdk.method1()).toBe("method1");
102
+ expect(sdk.method2()).toBe("method2");
103
+ expect(typeof sdk.getContext).toBe("function");
104
+ expect(typeof sdk.addPlugin).toBe("function"); // Can still add more plugins!
105
+ });
106
+
107
+ it("should support plugins with options", () => {
108
+ // Test that addPlugin(pluginFn, options) works correctly
109
+ const pluginWithOptions: Plugin<
110
+ {}, // no SDK dependencies
111
+ {}, // no context requirements
112
+ { getMessage: () => string }
113
+ > = (params) => ({
114
+ getMessage: () => (params as any).message,
115
+ });
116
+
117
+ const sdk = createSdk().addPlugin(pluginWithOptions, {
118
+ message: "Hello from options!",
119
+ });
120
+
121
+ expect(typeof sdk.getMessage).toBe("function");
122
+ expect(sdk.getMessage()).toBe("Hello from options!");
123
+ });
124
+
125
+ it("should merge context.meta from multiple plugins", () => {
126
+ // Test that multiple plugins can provide meta without overwriting each other
127
+ const plugin1: Plugin<
128
+ {}, // no SDK dependencies
129
+ {}, // no context requirements
130
+ {
131
+ method1: () => string;
132
+ context: { meta: { plugin1: { info: string } } };
133
+ }
134
+ > = () => ({
135
+ method1: () => "method1",
136
+ context: {
137
+ meta: {
138
+ plugin1: { info: "Plugin 1 metadata" },
139
+ },
140
+ },
141
+ });
142
+
143
+ const plugin2: Plugin<
144
+ { method1: () => string }, // depends on method1 in SDK
145
+ {}, // no context requirements
146
+ {
147
+ method2: () => string;
148
+ context: { meta: { plugin2: { info: string } } };
149
+ }
150
+ > = () => ({
151
+ method2: () => "method2",
152
+ context: {
153
+ meta: {
154
+ plugin2: { info: "Plugin 2 metadata" },
155
+ },
156
+ },
157
+ });
158
+
159
+ const sdk = createSdk().addPlugin(plugin1).addPlugin(plugin2);
160
+ const context = sdk.getContext();
161
+
162
+ // Both plugins should have their meta preserved
163
+ expect(context.meta.plugin1.info).toBe("Plugin 1 metadata");
164
+ expect(context.meta.plugin2.info).toBe("Plugin 2 metadata");
165
+
166
+ // Both methods should work
167
+ expect(sdk.method1()).toBe("method1");
168
+ expect(sdk.method2()).toBe("method2");
169
+ });
170
+
171
+ it("should support context requirements for cleaner plugin definitions", () => {
172
+ // Test context requirements work correctly
173
+ const pluginWithHelper: Plugin<
174
+ { existingMethod: () => string }, // requires existingMethod in SDK
175
+ { customContext: string }, // requires customContext in context
176
+ { helperMethod: () => string }
177
+ > = ({ sdk, context }) => ({
178
+ helperMethod: () =>
179
+ `Helper: ${sdk.existingMethod()} + ${context.customContext}`,
180
+ });
181
+
182
+ const baseSdk = { existingMethod: () => "base" };
183
+ const baseContext = { customContext: "custom", meta: {} };
184
+ const sdk = createSdk(baseSdk, baseContext).addPlugin(pluginWithHelper);
185
+
186
+ expect(sdk.helperMethod()).toBe("Helper: base + custom");
187
+ expect(sdk.existingMethod()).toBe("base"); // Original method still works
188
+ });
189
+
190
+ it("should ensure context.meta is always available", () => {
191
+ // Test that context.meta is always at least an empty object, even without explicit initialization
192
+ const plugin: Plugin<
193
+ {}, // no SDK dependencies
194
+ {}, // no context requirements (meta is always guaranteed)
195
+ { testMethod: () => string }
196
+ > = ({ context }) => ({
197
+ testMethod: () => `Meta keys: ${Object.keys(context.meta).length}`,
198
+ });
199
+
200
+ // Create SDK without explicitly providing meta
201
+ const sdk = createSdk({}).addPlugin(plugin);
202
+
203
+ // Should work without error - meta should be at least an empty object
204
+ expect(sdk.testMethod()).toBe("Meta keys: 0");
205
+
206
+ // getContext() should also provide meta
207
+ const context = sdk.getContext();
208
+ expect(context.meta).toBeDefined();
209
+ expect(typeof context.meta).toBe("object");
210
+ expect(context.meta).not.toBeNull();
211
+ });
212
+ });
package/src/sdk.ts CHANGED
@@ -1,116 +1,146 @@
1
- import { createZapierApi } from "./api";
2
- import { BaseSdkOptions } from "./types/domain";
3
- // Import function implementations
4
- import { listApps } from "./functions/listApps";
5
- import { getApp } from "./functions/getApp";
6
- import { listActions } from "./functions/listActions";
7
- import { getAction } from "./functions/getAction";
8
- import { runAction } from "./functions/runAction";
9
- import { listAuthentications } from "./functions/listAuthentications";
10
- import { getAuthentication } from "./functions/getAuthentication";
11
- import { findFirstAuthentication } from "./functions/findFirstAuthentication";
12
- import { findUniqueAuthentication } from "./functions/findUniqueAuthentication";
13
- import { listFields } from "./functions/listFields";
14
- import { generateTypes } from "./functions/generateTypes";
15
- import { bundleCode } from "./functions/bundleCode";
16
- import { request } from "./functions/request";
17
-
18
- // Import function registry info objects (only for CLI registry)
19
- import { listAppsInfo } from "./functions/listApps/info";
20
- import { getAppInfo } from "./functions/getApp/info";
21
- import { listActionsInfo } from "./functions/listActions/info";
22
- import { getActionInfo } from "./functions/getAction/info";
23
- import { runActionInfo } from "./functions/runAction/info";
24
- import { listAuthenticationsInfo } from "./functions/listAuthentications/info";
25
- import { getAuthenticationInfo } from "./functions/getAuthentication/info";
26
- import { findFirstAuthenticationInfo } from "./functions/findFirstAuthentication/info";
27
- import { findUniqueAuthenticationInfo } from "./functions/findUniqueAuthentication/info";
28
- import { listFieldsInfo } from "./functions/listFields/info";
29
- import { generateTypesInfo } from "./functions/generateTypes/info";
30
- import { bundleCodeInfo } from "./functions/bundleCode/info";
31
- import { requestInfo } from "./functions/request/info";
32
-
33
- // Function registry as array - uses names from function info objects
34
- const functionRegistry = [
35
- listAppsInfo,
36
- getAppInfo,
37
- listActionsInfo,
38
- getActionInfo,
39
- runActionInfo,
40
- listAuthenticationsInfo,
41
- getAuthenticationInfo,
42
- findFirstAuthenticationInfo,
43
- findUniqueAuthenticationInfo,
44
- listFieldsInfo,
45
- generateTypesInfo,
46
- bundleCodeInfo,
47
- requestInfo,
48
- ];
1
+ import { BaseSdkOptions } from "./types/sdk";
2
+ // All function implementations now provided by plugins
3
+
4
+ // All CLI registry info now provided by plugins
49
5
 
50
6
  // Import the properly typed SDK interfaces
51
- import type { BaseZapierSdk, ZapierSdk } from "./types/sdk";
7
+ import type { ZapierSdk } from "./types/sdk";
8
+ import type {
9
+ Sdk,
10
+ Plugin,
11
+ ExtractContextProperties,
12
+ PluginProvides,
13
+ } from "./types/plugin";
52
14
 
53
15
  // Import plugin functions
54
- import { createAppsPlugin } from "./plugins/apps/index";
55
- import { createFetchPlugin } from "./plugins/fetch/index";
56
-
57
- // TODO: Add plugin registry back when needed for CLI compatibility
16
+ import { appsPlugin } from "./plugins/apps/index";
17
+ import { fetchPlugin } from "./plugins/fetch/index";
18
+ import { registryPlugin } from "./plugins/registry/index";
19
+ import { apiPlugin } from "./plugins/api/index";
20
+ import { getProfilePlugin } from "./plugins/getProfile";
21
+ import { listAppsPlugin } from "./plugins/listApps";
22
+ import { getAppPlugin } from "./plugins/getApp";
23
+ import { listActionsPlugin } from "./plugins/listActions";
24
+ import { getActionPlugin } from "./plugins/getAction";
25
+ import { runActionPlugin } from "./plugins/runAction";
26
+ import { listAuthenticationsPlugin } from "./plugins/listAuthentications";
27
+ import { getAuthenticationPlugin } from "./plugins/getAuthentication";
28
+ import { findFirstAuthenticationPlugin } from "./plugins/findFirstAuthentication";
29
+ import { findUniqueAuthenticationPlugin } from "./plugins/findUniqueAuthentication";
30
+ import { listInputFieldsPlugin } from "./plugins/listInputFields";
31
+ import { requestPlugin } from "./plugins/request";
58
32
 
59
33
  // Full SDK interface with plugins applied
60
- export type { ZapierSdk } from "./types/sdk";
34
+ // Note: ZapierSdk is now defined as ReturnType<typeof createZapierSdk> at the bottom of this file
61
35
 
62
36
  export interface ZapierSdkOptions extends BaseSdkOptions {}
63
37
 
64
- export function createZapierSdk(options: ZapierSdkOptions = {}): ZapierSdk {
65
- const {
66
- fetch: customFetch = globalThis.fetch,
67
- baseUrl = "https://zapier.com",
68
- token,
69
- getToken,
70
- onEvent,
71
- debug = false,
72
- } = options;
73
-
74
- // Create the API client - it will handle token resolution internally
75
- const api = createZapierApi({
76
- baseUrl,
77
- token,
78
- getToken,
79
- debug,
80
- fetch: customFetch,
81
- onEvent,
82
- });
83
-
84
- // Create base SDK with core functions only - TypeScript will enforce completeness
85
- const baseSdk: BaseZapierSdk = {
86
- // Registry for CLI
87
- __registry: functionRegistry,
88
-
89
- // Function implementations with API config injection
90
- listApps: (options = {}) => listApps({ ...options, api }),
91
- getApp: (options) => getApp({ ...options, api }),
92
- listActions: (options = {}) => listActions({ ...options, api }),
93
- getAction: (options) => getAction({ ...options, api }),
94
- runAction: (options) => runAction({ ...options, api }),
95
- listAuthentications: (options = {}) =>
96
- listAuthentications({ ...options, api }),
97
- getAuthentication: (options) => getAuthentication({ ...options, api }),
98
- findFirstAuthentication: (options = {}) =>
99
- findFirstAuthentication({ ...options, api }),
100
- findUniqueAuthentication: (options = {}) =>
101
- findUniqueAuthentication({ ...options, api }),
102
- listFields: (options) => listFields({ ...options, api }),
103
- generateTypes: (options) => generateTypes({ ...options, api }),
104
- bundleCode: (options) => bundleCode(options), // No API config needed
105
- request: (options) => request({ ...options, api }),
38
+ // Create SDK that supports flat plugins - returns an SDK, not a builder
39
+ export function createSdk<
40
+ TCurrentSdk = {},
41
+ TCurrentContext = { meta: Record<string, any> },
42
+ >(
43
+ initialSdk: TCurrentSdk = {} as TCurrentSdk,
44
+ initialContext: TCurrentContext = { meta: {} } as TCurrentContext,
45
+ ): Sdk<TCurrentSdk, TCurrentContext> {
46
+ return {
47
+ ...initialSdk,
48
+ getContext: () => initialContext,
49
+ addPlugin<TRequiresContext, TProvides extends PluginProvides>(
50
+ plugin: Plugin<
51
+ TCurrentSdk & { getContext(): TCurrentContext },
52
+ TRequiresContext,
53
+ TProvides
54
+ >,
55
+ options: any = {},
56
+ ) {
57
+ // Create SDK with getContext method for plugins to use
58
+ const currentSdkWithContext = {
59
+ ...initialSdk,
60
+ getContext: () => initialContext,
61
+ } as TCurrentSdk & { getContext(): TCurrentContext };
62
+
63
+ // Apply the plugin with options merged in
64
+ const pluginResult = plugin({
65
+ sdk: currentSdkWithContext,
66
+ context: initialContext,
67
+ ...options,
68
+ });
69
+
70
+ // Extract context from plugin result if present
71
+ const { context: pluginContext, ...sdkProperties } = pluginResult;
72
+
73
+ // Merge SDK properties directly (flat structure)
74
+ const newSdk = { ...initialSdk, ...sdkProperties };
75
+
76
+ // Merge context additions if plugin returned any
77
+ // Ensure meta is always present, starting with existing or empty object
78
+ let newContext = {
79
+ ...initialContext,
80
+ meta: (initialContext as any).meta || {},
81
+ } as TCurrentContext & NonNullable<ExtractContextProperties<TProvides>>;
82
+
83
+ if (pluginContext) {
84
+ // Extract meta from plugin context for special merging
85
+ const { meta: pluginMeta, ...otherPluginContext } = pluginContext;
86
+
87
+ newContext = {
88
+ ...newContext,
89
+ ...otherPluginContext,
90
+ } as TCurrentContext & NonNullable<ExtractContextProperties<TProvides>>;
91
+
92
+ // Merge meta separately to avoid overwriting
93
+ if (pluginMeta) {
94
+ newContext = {
95
+ ...newContext,
96
+ meta: {
97
+ ...newContext.meta, // Existing meta (now guaranteed to exist)
98
+ ...pluginMeta, // New meta from plugin
99
+ },
100
+ } as TCurrentContext &
101
+ NonNullable<ExtractContextProperties<TProvides>>;
102
+ }
103
+ }
104
+
105
+ // Recursively create new SDK with updated properties
106
+ return createSdk(newSdk, newContext) as any;
107
+ },
106
108
  };
109
+ }
110
+
111
+ export function createZapierSdk(options: ZapierSdkOptions = {}): ZapierSdk {
112
+ return (
113
+ createSdk()
114
+ // Provides the API client in context
115
+ .addPlugin(apiPlugin, options)
116
+
117
+ // Apps/actions/fields
118
+ .addPlugin(listAppsPlugin)
119
+ .addPlugin(getAppPlugin)
120
+ .addPlugin(listActionsPlugin)
121
+ .addPlugin(getActionPlugin)
122
+ .addPlugin(listInputFieldsPlugin)
123
+
124
+ // Run action
125
+ .addPlugin(runActionPlugin)
126
+
127
+ // Authentications
128
+ .addPlugin(listAuthenticationsPlugin)
129
+ .addPlugin(getAuthenticationPlugin)
130
+ .addPlugin(findFirstAuthenticationPlugin)
131
+ .addPlugin(findUniqueAuthenticationPlugin)
132
+
133
+ // Relay fetching
134
+ .addPlugin(requestPlugin)
135
+ .addPlugin(fetchPlugin)
107
136
 
108
- // Mutate baseSdk to add plugins so they can access each other
109
- const fullSdk = baseSdk as ZapierSdk;
137
+ // Magic apps plugin
138
+ .addPlugin(appsPlugin)
110
139
 
111
- // Add plugins to the SDK - they now have access to the full SDK including other plugins
112
- fullSdk.apps = createAppsPlugin({ sdk: fullSdk });
113
- fullSdk.fetch = createFetchPlugin({ sdk: fullSdk });
140
+ // Profile
141
+ .addPlugin(getProfilePlugin)
114
142
 
115
- return fullSdk;
143
+ // Register plugins for CLI/MCP metadata
144
+ .addPlugin(registryPlugin)
145
+ );
116
146
  }
@@ -0,0 +1,50 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { splitVersionedKey } from "../utils/domain-utils";
3
+
4
+ describe("splitVersionedKey", () => {
5
+ it("should split versioned key with version", () => {
6
+ const [baseKey, version] = splitVersionedKey("SlackCLIAPI@1.21.1");
7
+ expect(baseKey).toBe("SlackCLIAPI");
8
+ expect(version).toBe("1.21.1");
9
+ });
10
+
11
+ it("should split versioned key with complex version", () => {
12
+ const [baseKey, version] = splitVersionedKey(
13
+ "GoogleSheetsAPI@2.5.0-beta.1",
14
+ );
15
+ expect(baseKey).toBe("GoogleSheetsAPI");
16
+ expect(version).toBe("2.5.0-beta.1");
17
+ });
18
+
19
+ it("should handle versioned key without version", () => {
20
+ const [baseKey, version] = splitVersionedKey("SomeAPI");
21
+ expect(baseKey).toBe("SomeAPI");
22
+ expect(version).toBeUndefined();
23
+ });
24
+
25
+ it("should handle versioned key with multiple @ symbols", () => {
26
+ const [baseKey, version] = splitVersionedKey("ComplexAPI@1.0.0@beta");
27
+ expect(baseKey).toBe("ComplexAPI");
28
+ expect(version).toBe("1.0.0@beta");
29
+ });
30
+
31
+ it("should handle edge case with many @ symbols", () => {
32
+ const [baseKey, version] = splitVersionedKey(
33
+ "API@with@multiple@at@symbols@1.2.3",
34
+ );
35
+ expect(baseKey).toBe("API");
36
+ expect(version).toBe("with@multiple@at@symbols@1.2.3");
37
+ });
38
+
39
+ it("should handle empty string", () => {
40
+ const [baseKey, version] = splitVersionedKey("");
41
+ expect(baseKey).toBe("");
42
+ expect(version).toBeUndefined();
43
+ });
44
+
45
+ it("should handle string that starts with @", () => {
46
+ const [baseKey, version] = splitVersionedKey("@version");
47
+ expect(baseKey).toBe("");
48
+ expect(version).toBe("version");
49
+ });
50
+ });
@@ -1,75 +1,43 @@
1
- // Re-export API types from the API module
2
- export type {
3
- Integration,
4
- Action,
5
- Trigger,
6
- Field,
7
- Choice,
8
- ActionExecutionResult,
9
- ActionField,
10
- ActionFieldChoice,
11
- NeedsRequest,
12
- NeedsResponse,
13
- Authentication,
14
- AuthenticationsResponse,
15
- } from "../api/types";
16
-
17
- // Import event types
18
- import type { EventCallback } from "./events";
19
-
20
- // SDK Configuration Types
21
- export interface ActionExecutionOptions {
22
- inputs?: Record<string, any>;
23
- authenticationId?: number;
24
- }
25
-
26
- export interface AuthObject {
27
- id: number;
28
- }
29
-
30
- export interface BaseSdkOptions {
31
- token?: string;
32
- getToken?: () => Promise<string | undefined>;
33
- onEvent?: EventCallback;
34
- fetch?: typeof fetch;
35
- baseUrl?: string;
36
- debug?: boolean;
37
- }
38
-
39
- // Common options shared across all function types
40
- export interface FunctionOptions {
41
- /** Base URL for Zapier API */
42
- baseUrl?: string;
43
- /** Authentication token */
44
- token?: string;
45
- /** Function to dynamically resolve authentication token */
46
- getToken?: () => Promise<string | undefined>;
47
- /** Optional pre-instantiated API client */
48
- api?: any;
49
- /** Enable debug logging */
50
- debug?: boolean;
51
- /** Custom fetch implementation */
52
- fetch?: typeof globalThis.fetch;
53
- }
54
-
55
- // Error Classes
56
- export class ZapierSdkError extends Error {
57
- constructor(
58
- message: string,
59
- public code?: string,
60
- ) {
61
- super(message);
62
- this.name = "ZapierSdkError";
63
- }
64
- }
65
-
66
- export class AppNotFoundError extends ZapierSdkError {
67
- appKey: string;
68
-
69
- constructor(appKey: string) {
70
- super(`App "${appKey}" not found`);
71
- this.name = "AppNotFoundError";
72
- this.code = "APP_NOT_FOUND";
73
- this.appKey = appKey;
74
- }
75
- }
1
+ import type { z } from "zod";
2
+
3
+ /**
4
+ * Domain model types - representing business entities returned by SDK functions
5
+ * These types are inferred from Item schemas and represent transformed/formatted data.
6
+ */
7
+
8
+ // Import schemas to infer types from
9
+ import type { AppItemSchema } from "../schemas/App";
10
+ import type { AuthenticationItemSchema } from "../schemas/Auth";
11
+ import type { ActionItemSchema } from "../schemas/Action";
12
+ import type { InputFieldItemSchema } from "../schemas/Field";
13
+ import type { UserProfileItemSchema } from "../schemas/UserProfile";
14
+
15
+ /**
16
+ * Represents an app item returned by getApp and listApps functions
17
+ * Inferred from AppItemSchema which extends the base App API schema
18
+ */
19
+ export type AppItem = z.infer<typeof AppItemSchema>;
20
+
21
+ /**
22
+ * Represents an authentication item returned by listAuthentications functions
23
+ * Inferred from AuthenticationItemSchema which extends the base Authentication API schema
24
+ */
25
+ export type AuthenticationItem = z.infer<typeof AuthenticationItemSchema>;
26
+
27
+ /**
28
+ * Represents an action item returned by listActions functions
29
+ * Inferred from ActionItemSchema which extends the base Action API schema
30
+ */
31
+ export type ActionItem = z.infer<typeof ActionItemSchema>;
32
+
33
+ /**
34
+ * Represents an input field item returned by listInputFields functions
35
+ * Inferred from InputFieldItemSchema which extends the base Need API schema
36
+ */
37
+ export type InputFieldItem = z.infer<typeof InputFieldItemSchema>;
38
+
39
+ /**
40
+ * Represents a user profile item returned by getProfile function
41
+ * Inferred from UserProfileItemSchema which extends the base UserProfile API schema
42
+ */
43
+ export type UserProfileItem = z.infer<typeof UserProfileItemSchema>;