@zapier/zapier-sdk 0.18.3 → 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 (417) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +44 -32
  3. package/dist/index.cjs +658 -693
  4. package/dist/index.d.mts +272 -138
  5. package/dist/index.d.ts +2541 -40
  6. package/dist/index.mjs +638 -692
  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.integration.test.d.ts +0 -5
  17. package/dist/api/client.integration.test.d.ts.map +0 -1
  18. package/dist/api/client.integration.test.js +0 -318
  19. package/dist/api/client.js +0 -374
  20. package/dist/api/client.methods.test.d.ts +0 -2
  21. package/dist/api/client.methods.test.d.ts.map +0 -1
  22. package/dist/api/client.methods.test.js +0 -158
  23. package/dist/api/client.test.d.ts +0 -2
  24. package/dist/api/client.test.d.ts.map +0 -1
  25. package/dist/api/client.test.js +0 -96
  26. package/dist/api/debug.d.ts +0 -14
  27. package/dist/api/debug.d.ts.map +0 -1
  28. package/dist/api/debug.js +0 -131
  29. package/dist/api/debug.test.d.ts +0 -2
  30. package/dist/api/debug.test.d.ts.map +0 -1
  31. package/dist/api/debug.test.js +0 -59
  32. package/dist/api/index.d.ts +0 -30
  33. package/dist/api/index.d.ts.map +0 -1
  34. package/dist/api/index.js +0 -43
  35. package/dist/api/polling.d.ts +0 -46
  36. package/dist/api/polling.d.ts.map +0 -1
  37. package/dist/api/polling.js +0 -139
  38. package/dist/api/polling.test.d.ts +0 -2
  39. package/dist/api/polling.test.d.ts.map +0 -1
  40. package/dist/api/polling.test.js +0 -318
  41. package/dist/api/router.d.ts +0 -16
  42. package/dist/api/router.d.ts.map +0 -1
  43. package/dist/api/router.js +0 -31
  44. package/dist/api/router.test.d.ts +0 -2
  45. package/dist/api/router.test.d.ts.map +0 -1
  46. package/dist/api/router.test.js +0 -103
  47. package/dist/api/schemas.d.ts +0 -531
  48. package/dist/api/schemas.d.ts.map +0 -1
  49. package/dist/api/schemas.js +0 -389
  50. package/dist/api/types.d.ts +0 -82
  51. package/dist/api/types.d.ts.map +0 -1
  52. package/dist/api/types.js +0 -1
  53. package/dist/auth.d.ts +0 -52
  54. package/dist/auth.d.ts.map +0 -1
  55. package/dist/auth.js +0 -72
  56. package/dist/auth.test.d.ts +0 -2
  57. package/dist/auth.test.d.ts.map +0 -1
  58. package/dist/auth.test.js +0 -102
  59. package/dist/constants.d.ts +0 -14
  60. package/dist/constants.d.ts.map +0 -1
  61. package/dist/constants.js +0 -13
  62. package/dist/index.d.ts.map +0 -1
  63. package/dist/index.js +0 -42
  64. package/dist/plugins/api/index.d.ts +0 -12
  65. package/dist/plugins/api/index.d.ts.map +0 -1
  66. package/dist/plugins/api/index.js +0 -24
  67. package/dist/plugins/apps/index.d.ts +0 -15
  68. package/dist/plugins/apps/index.d.ts.map +0 -1
  69. package/dist/plugins/apps/index.js +0 -112
  70. package/dist/plugins/apps/schemas.d.ts +0 -42
  71. package/dist/plugins/apps/schemas.d.ts.map +0 -1
  72. package/dist/plugins/apps/schemas.js +0 -14
  73. package/dist/plugins/eventEmission/builders.d.ts +0 -14
  74. package/dist/plugins/eventEmission/builders.d.ts.map +0 -1
  75. package/dist/plugins/eventEmission/builders.js +0 -109
  76. package/dist/plugins/eventEmission/index.d.ts +0 -38
  77. package/dist/plugins/eventEmission/index.d.ts.map +0 -1
  78. package/dist/plugins/eventEmission/index.js +0 -336
  79. package/dist/plugins/eventEmission/index.test.d.ts +0 -5
  80. package/dist/plugins/eventEmission/index.test.d.ts.map +0 -1
  81. package/dist/plugins/eventEmission/index.test.js +0 -581
  82. package/dist/plugins/eventEmission/transport.d.ts +0 -27
  83. package/dist/plugins/eventEmission/transport.d.ts.map +0 -1
  84. package/dist/plugins/eventEmission/transport.js +0 -104
  85. package/dist/plugins/eventEmission/transport.test.d.ts +0 -5
  86. package/dist/plugins/eventEmission/transport.test.d.ts.map +0 -1
  87. package/dist/plugins/eventEmission/transport.test.js +0 -164
  88. package/dist/plugins/eventEmission/types.d.ts +0 -63
  89. package/dist/plugins/eventEmission/types.d.ts.map +0 -1
  90. package/dist/plugins/eventEmission/types.js +0 -1
  91. package/dist/plugins/eventEmission/utils.d.ts +0 -45
  92. package/dist/plugins/eventEmission/utils.d.ts.map +0 -1
  93. package/dist/plugins/eventEmission/utils.js +0 -114
  94. package/dist/plugins/fetch/index.d.ts +0 -36
  95. package/dist/plugins/fetch/index.d.ts.map +0 -1
  96. package/dist/plugins/fetch/index.js +0 -62
  97. package/dist/plugins/fetch/schemas.d.ts +0 -19
  98. package/dist/plugins/fetch/schemas.d.ts.map +0 -1
  99. package/dist/plugins/fetch/schemas.js +0 -31
  100. package/dist/plugins/findFirstAuthentication/index.d.ts +0 -21
  101. package/dist/plugins/findFirstAuthentication/index.d.ts.map +0 -1
  102. package/dist/plugins/findFirstAuthentication/index.js +0 -36
  103. package/dist/plugins/findFirstAuthentication/index.test.d.ts +0 -2
  104. package/dist/plugins/findFirstAuthentication/index.test.d.ts.map +0 -1
  105. package/dist/plugins/findFirstAuthentication/index.test.js +0 -177
  106. package/dist/plugins/findFirstAuthentication/schemas.d.ts +0 -20
  107. package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +0 -1
  108. package/dist/plugins/findFirstAuthentication/schemas.js +0 -18
  109. package/dist/plugins/findUniqueAuthentication/index.d.ts +0 -21
  110. package/dist/plugins/findUniqueAuthentication/index.d.ts.map +0 -1
  111. package/dist/plugins/findUniqueAuthentication/index.js +0 -39
  112. package/dist/plugins/findUniqueAuthentication/index.test.d.ts +0 -2
  113. package/dist/plugins/findUniqueAuthentication/index.test.d.ts.map +0 -1
  114. package/dist/plugins/findUniqueAuthentication/index.test.js +0 -159
  115. package/dist/plugins/findUniqueAuthentication/schemas.d.ts +0 -20
  116. package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +0 -1
  117. package/dist/plugins/findUniqueAuthentication/schemas.js +0 -18
  118. package/dist/plugins/getAction/index.d.ts +0 -25
  119. package/dist/plugins/getAction/index.d.ts.map +0 -1
  120. package/dist/plugins/getAction/index.js +0 -42
  121. package/dist/plugins/getAction/index.test.d.ts +0 -2
  122. package/dist/plugins/getAction/index.test.d.ts.map +0 -1
  123. package/dist/plugins/getAction/index.test.js +0 -211
  124. package/dist/plugins/getAction/schemas.d.ts +0 -30
  125. package/dist/plugins/getAction/schemas.d.ts.map +0 -1
  126. package/dist/plugins/getAction/schemas.js +0 -12
  127. package/dist/plugins/getApp/index.d.ts +0 -21
  128. package/dist/plugins/getApp/index.d.ts.map +0 -1
  129. package/dist/plugins/getApp/index.js +0 -44
  130. package/dist/plugins/getApp/index.test.d.ts +0 -2
  131. package/dist/plugins/getApp/index.test.d.ts.map +0 -1
  132. package/dist/plugins/getApp/index.test.js +0 -157
  133. package/dist/plugins/getApp/schemas.d.ts +0 -16
  134. package/dist/plugins/getApp/schemas.d.ts.map +0 -1
  135. package/dist/plugins/getApp/schemas.js +0 -8
  136. package/dist/plugins/getAuthentication/index.d.ts +0 -21
  137. package/dist/plugins/getAuthentication/index.d.ts.map +0 -1
  138. package/dist/plugins/getAuthentication/index.js +0 -29
  139. package/dist/plugins/getAuthentication/index.test.d.ts +0 -2
  140. package/dist/plugins/getAuthentication/index.test.d.ts.map +0 -1
  141. package/dist/plugins/getAuthentication/index.test.js +0 -106
  142. package/dist/plugins/getAuthentication/schemas.d.ts +0 -7
  143. package/dist/plugins/getAuthentication/schemas.d.ts.map +0 -1
  144. package/dist/plugins/getAuthentication/schemas.js +0 -1
  145. package/dist/plugins/getInputFieldsSchema/index.d.ts +0 -23
  146. package/dist/plugins/getInputFieldsSchema/index.d.ts.map +0 -1
  147. package/dist/plugins/getInputFieldsSchema/index.js +0 -53
  148. package/dist/plugins/getInputFieldsSchema/index.test.d.ts +0 -2
  149. package/dist/plugins/getInputFieldsSchema/index.test.d.ts.map +0 -1
  150. package/dist/plugins/getInputFieldsSchema/index.test.js +0 -291
  151. package/dist/plugins/getInputFieldsSchema/schemas.d.ts +0 -28
  152. package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +0 -1
  153. package/dist/plugins/getInputFieldsSchema/schemas.js +0 -13
  154. package/dist/plugins/getProfile/index.d.ts +0 -25
  155. package/dist/plugins/getProfile/index.d.ts.map +0 -1
  156. package/dist/plugins/getProfile/index.js +0 -39
  157. package/dist/plugins/getProfile/schemas.d.ts +0 -13
  158. package/dist/plugins/getProfile/schemas.d.ts.map +0 -1
  159. package/dist/plugins/getProfile/schemas.js +0 -6
  160. package/dist/plugins/listActions/index.d.ts +0 -30
  161. package/dist/plugins/listActions/index.d.ts.map +0 -1
  162. package/dist/plugins/listActions/index.js +0 -75
  163. package/dist/plugins/listActions/index.test.d.ts +0 -2
  164. package/dist/plugins/listActions/index.test.d.ts.map +0 -1
  165. package/dist/plugins/listActions/index.test.js +0 -453
  166. package/dist/plugins/listActions/schemas.d.ts +0 -35
  167. package/dist/plugins/listActions/schemas.d.ts.map +0 -1
  168. package/dist/plugins/listActions/schemas.js +0 -22
  169. package/dist/plugins/listApps/index.d.ts +0 -25
  170. package/dist/plugins/listApps/index.d.ts.map +0 -1
  171. package/dist/plugins/listApps/index.js +0 -69
  172. package/dist/plugins/listApps/index.test.d.ts +0 -2
  173. package/dist/plugins/listApps/index.test.d.ts.map +0 -1
  174. package/dist/plugins/listApps/index.test.js +0 -141
  175. package/dist/plugins/listApps/schemas.d.ts +0 -26
  176. package/dist/plugins/listApps/schemas.d.ts.map +0 -1
  177. package/dist/plugins/listApps/schemas.js +0 -19
  178. package/dist/plugins/listAuthentications/index.d.ts +0 -24
  179. package/dist/plugins/listAuthentications/index.d.ts.map +0 -1
  180. package/dist/plugins/listAuthentications/index.js +0 -77
  181. package/dist/plugins/listAuthentications/index.test.d.ts +0 -2
  182. package/dist/plugins/listAuthentications/index.test.d.ts.map +0 -1
  183. package/dist/plugins/listAuthentications/index.test.js +0 -832
  184. package/dist/plugins/listAuthentications/schemas.d.ts +0 -30
  185. package/dist/plugins/listAuthentications/schemas.d.ts.map +0 -1
  186. package/dist/plugins/listAuthentications/schemas.js +0 -32
  187. package/dist/plugins/listInputFieldChoices/index.d.ts +0 -33
  188. package/dist/plugins/listInputFieldChoices/index.d.ts.map +0 -1
  189. package/dist/plugins/listInputFieldChoices/index.js +0 -115
  190. package/dist/plugins/listInputFieldChoices/index.test.d.ts +0 -2
  191. package/dist/plugins/listInputFieldChoices/index.test.d.ts.map +0 -1
  192. package/dist/plugins/listInputFieldChoices/index.test.js +0 -717
  193. package/dist/plugins/listInputFieldChoices/schemas.d.ts +0 -43
  194. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +0 -1
  195. package/dist/plugins/listInputFieldChoices/schemas.js +0 -65
  196. package/dist/plugins/listInputFields/index.d.ts +0 -34
  197. package/dist/plugins/listInputFields/index.d.ts.map +0 -1
  198. package/dist/plugins/listInputFields/index.js +0 -204
  199. package/dist/plugins/listInputFields/index.test.d.ts +0 -2
  200. package/dist/plugins/listInputFields/index.test.d.ts.map +0 -1
  201. package/dist/plugins/listInputFields/index.test.js +0 -359
  202. package/dist/plugins/listInputFields/schemas.d.ts +0 -35
  203. package/dist/plugins/listInputFields/schemas.d.ts.map +0 -1
  204. package/dist/plugins/listInputFields/schemas.js +0 -23
  205. package/dist/plugins/manifest/index.d.ts +0 -85
  206. package/dist/plugins/manifest/index.d.ts.map +0 -1
  207. package/dist/plugins/manifest/index.js +0 -376
  208. package/dist/plugins/manifest/index.test.d.ts +0 -2
  209. package/dist/plugins/manifest/index.test.d.ts.map +0 -1
  210. package/dist/plugins/manifest/index.test.js +0 -1139
  211. package/dist/plugins/manifest/schemas.d.ts +0 -57
  212. package/dist/plugins/manifest/schemas.d.ts.map +0 -1
  213. package/dist/plugins/manifest/schemas.js +0 -50
  214. package/dist/plugins/registry/index.d.ts +0 -21
  215. package/dist/plugins/registry/index.d.ts.map +0 -1
  216. package/dist/plugins/registry/index.js +0 -117
  217. package/dist/plugins/request/index.d.ts +0 -21
  218. package/dist/plugins/request/index.d.ts.map +0 -1
  219. package/dist/plugins/request/index.js +0 -76
  220. package/dist/plugins/request/index.test.d.ts +0 -2
  221. package/dist/plugins/request/index.test.d.ts.map +0 -1
  222. package/dist/plugins/request/index.test.js +0 -337
  223. package/dist/plugins/request/schemas.d.ts +0 -54
  224. package/dist/plugins/request/schemas.d.ts.map +0 -1
  225. package/dist/plugins/request/schemas.js +0 -41
  226. package/dist/plugins/runAction/index.d.ts +0 -33
  227. package/dist/plugins/runAction/index.d.ts.map +0 -1
  228. package/dist/plugins/runAction/index.js +0 -108
  229. package/dist/plugins/runAction/index.test.d.ts +0 -2
  230. package/dist/plugins/runAction/index.test.d.ts.map +0 -1
  231. package/dist/plugins/runAction/index.test.js +0 -333
  232. package/dist/plugins/runAction/schemas.d.ts +0 -34
  233. package/dist/plugins/runAction/schemas.d.ts.map +0 -1
  234. package/dist/plugins/runAction/schemas.js +0 -23
  235. package/dist/resolvers/actionKey.d.ts +0 -15
  236. package/dist/resolvers/actionKey.d.ts.map +0 -1
  237. package/dist/resolvers/actionKey.js +0 -19
  238. package/dist/resolvers/actionType.d.ts +0 -10
  239. package/dist/resolvers/actionType.d.ts.map +0 -1
  240. package/dist/resolvers/actionType.js +0 -21
  241. package/dist/resolvers/appKey.d.ts +0 -3
  242. package/dist/resolvers/appKey.d.ts.map +0 -1
  243. package/dist/resolvers/appKey.js +0 -5
  244. package/dist/resolvers/authenticationId.d.ts +0 -9
  245. package/dist/resolvers/authenticationId.d.ts.map +0 -1
  246. package/dist/resolvers/authenticationId.js +0 -42
  247. package/dist/resolvers/index.d.ts +0 -8
  248. package/dist/resolvers/index.d.ts.map +0 -1
  249. package/dist/resolvers/index.js +0 -8
  250. package/dist/resolvers/inputFieldKey.d.ts +0 -11
  251. package/dist/resolvers/inputFieldKey.d.ts.map +0 -1
  252. package/dist/resolvers/inputFieldKey.js +0 -47
  253. package/dist/resolvers/inputs.d.ts +0 -17
  254. package/dist/resolvers/inputs.d.ts.map +0 -1
  255. package/dist/resolvers/inputs.js +0 -50
  256. package/dist/schemas/Action.d.ts +0 -24
  257. package/dist/schemas/Action.d.ts.map +0 -1
  258. package/dist/schemas/Action.js +0 -40
  259. package/dist/schemas/App.d.ts +0 -57
  260. package/dist/schemas/App.d.ts.map +0 -1
  261. package/dist/schemas/App.js +0 -31
  262. package/dist/schemas/Auth.d.ts +0 -55
  263. package/dist/schemas/Auth.d.ts.map +0 -1
  264. package/dist/schemas/Auth.js +0 -33
  265. package/dist/schemas/Field.d.ts +0 -61
  266. package/dist/schemas/Field.d.ts.map +0 -1
  267. package/dist/schemas/Field.js +0 -116
  268. package/dist/schemas/Run.d.ts +0 -3
  269. package/dist/schemas/Run.d.ts.map +0 -1
  270. package/dist/schemas/Run.js +0 -31
  271. package/dist/schemas/UserProfile.d.ts +0 -13
  272. package/dist/schemas/UserProfile.d.ts.map +0 -1
  273. package/dist/schemas/UserProfile.js +0 -32
  274. package/dist/sdk.d.ts +0 -146
  275. package/dist/sdk.d.ts.map +0 -1
  276. package/dist/sdk.js +0 -112
  277. package/dist/sdk.test.d.ts +0 -2
  278. package/dist/sdk.test.d.ts.map +0 -1
  279. package/dist/sdk.test.js +0 -255
  280. package/dist/services/implementations.d.ts +0 -63
  281. package/dist/services/implementations.d.ts.map +0 -1
  282. package/dist/services/implementations.js +0 -80
  283. package/dist/temporary-internal-core/handlers/listApps.d.ts +0 -67
  284. package/dist/temporary-internal-core/handlers/listApps.d.ts.map +0 -1
  285. package/dist/temporary-internal-core/handlers/listApps.js +0 -134
  286. package/dist/temporary-internal-core/handlers/listApps.test.d.ts +0 -2
  287. package/dist/temporary-internal-core/handlers/listApps.test.d.ts.map +0 -1
  288. package/dist/temporary-internal-core/handlers/listApps.test.js +0 -367
  289. package/dist/temporary-internal-core/index.d.ts +0 -18
  290. package/dist/temporary-internal-core/index.d.ts.map +0 -1
  291. package/dist/temporary-internal-core/index.js +0 -18
  292. package/dist/temporary-internal-core/schemas/apps/index.d.ts +0 -175
  293. package/dist/temporary-internal-core/schemas/apps/index.d.ts.map +0 -1
  294. package/dist/temporary-internal-core/schemas/apps/index.js +0 -97
  295. package/dist/temporary-internal-core/schemas/errors/index.d.ts +0 -139
  296. package/dist/temporary-internal-core/schemas/errors/index.d.ts.map +0 -1
  297. package/dist/temporary-internal-core/schemas/errors/index.js +0 -129
  298. package/dist/temporary-internal-core/schemas/implementations/index.d.ts +0 -127
  299. package/dist/temporary-internal-core/schemas/implementations/index.d.ts.map +0 -1
  300. package/dist/temporary-internal-core/schemas/implementations/index.js +0 -79
  301. package/dist/temporary-internal-core/types/handler.d.ts +0 -51
  302. package/dist/temporary-internal-core/types/handler.d.ts.map +0 -1
  303. package/dist/temporary-internal-core/types/handler.js +0 -8
  304. package/dist/temporary-internal-core/types/index.d.ts +0 -5
  305. package/dist/temporary-internal-core/types/index.d.ts.map +0 -1
  306. package/dist/temporary-internal-core/types/index.js +0 -4
  307. package/dist/temporary-internal-core/utils/app-locators.d.ts +0 -34
  308. package/dist/temporary-internal-core/utils/app-locators.d.ts.map +0 -1
  309. package/dist/temporary-internal-core/utils/app-locators.js +0 -39
  310. package/dist/temporary-internal-core/utils/string-utils.d.ts +0 -28
  311. package/dist/temporary-internal-core/utils/string-utils.d.ts.map +0 -1
  312. package/dist/temporary-internal-core/utils/string-utils.js +0 -52
  313. package/dist/temporary-internal-core/utils/transformations.d.ts +0 -18
  314. package/dist/temporary-internal-core/utils/transformations.d.ts.map +0 -1
  315. package/dist/temporary-internal-core/utils/transformations.js +0 -36
  316. package/dist/types/domain.d.ts +0 -52
  317. package/dist/types/domain.d.ts.map +0 -1
  318. package/dist/types/domain.js +0 -1
  319. package/dist/types/domain.test.d.ts +0 -2
  320. package/dist/types/domain.test.d.ts.map +0 -1
  321. package/dist/types/domain.test.js +0 -39
  322. package/dist/types/errors.d.ts +0 -143
  323. package/dist/types/errors.d.ts.map +0 -1
  324. package/dist/types/errors.js +0 -187
  325. package/dist/types/events.d.ts +0 -38
  326. package/dist/types/events.d.ts.map +0 -1
  327. package/dist/types/events.js +0 -7
  328. package/dist/types/functions.d.ts +0 -27
  329. package/dist/types/functions.d.ts.map +0 -1
  330. package/dist/types/functions.js +0 -1
  331. package/dist/types/plugin.d.ts +0 -75
  332. package/dist/types/plugin.d.ts.map +0 -1
  333. package/dist/types/plugin.js +0 -9
  334. package/dist/types/properties.d.ts +0 -33
  335. package/dist/types/properties.d.ts.map +0 -1
  336. package/dist/types/properties.js +0 -52
  337. package/dist/types/sdk.d.ts +0 -69
  338. package/dist/types/sdk.d.ts.map +0 -1
  339. package/dist/types/sdk.js +0 -4
  340. package/dist/types/telemetry-events.d.ts +0 -105
  341. package/dist/types/telemetry-events.d.ts.map +0 -1
  342. package/dist/types/telemetry-events.js +0 -8
  343. package/dist/utils/array-utils.d.ts +0 -31
  344. package/dist/utils/array-utils.d.ts.map +0 -1
  345. package/dist/utils/array-utils.js +0 -36
  346. package/dist/utils/array-utils.test.d.ts +0 -2
  347. package/dist/utils/array-utils.test.d.ts.map +0 -1
  348. package/dist/utils/array-utils.test.js +0 -107
  349. package/dist/utils/batch-utils.d.ts +0 -72
  350. package/dist/utils/batch-utils.d.ts.map +0 -1
  351. package/dist/utils/batch-utils.js +0 -162
  352. package/dist/utils/batch-utils.test.d.ts +0 -2
  353. package/dist/utils/batch-utils.test.d.ts.map +0 -1
  354. package/dist/utils/batch-utils.test.js +0 -476
  355. package/dist/utils/domain-utils.d.ts +0 -66
  356. package/dist/utils/domain-utils.d.ts.map +0 -1
  357. package/dist/utils/domain-utils.js +0 -164
  358. package/dist/utils/domain-utils.test.d.ts +0 -2
  359. package/dist/utils/domain-utils.test.d.ts.map +0 -1
  360. package/dist/utils/domain-utils.test.js +0 -346
  361. package/dist/utils/file-utils.d.ts +0 -4
  362. package/dist/utils/file-utils.d.ts.map +0 -1
  363. package/dist/utils/file-utils.js +0 -74
  364. package/dist/utils/file-utils.test.d.ts +0 -2
  365. package/dist/utils/file-utils.test.d.ts.map +0 -1
  366. package/dist/utils/file-utils.test.js +0 -51
  367. package/dist/utils/function-utils.d.ts +0 -73
  368. package/dist/utils/function-utils.d.ts.map +0 -1
  369. package/dist/utils/function-utils.js +0 -245
  370. package/dist/utils/function-utils.test.d.ts +0 -2
  371. package/dist/utils/function-utils.test.d.ts.map +0 -1
  372. package/dist/utils/function-utils.test.js +0 -110
  373. package/dist/utils/id-utils.d.ts +0 -13
  374. package/dist/utils/id-utils.d.ts.map +0 -1
  375. package/dist/utils/id-utils.js +0 -22
  376. package/dist/utils/id-utils.test.d.ts +0 -2
  377. package/dist/utils/id-utils.test.d.ts.map +0 -1
  378. package/dist/utils/id-utils.test.js +0 -22
  379. package/dist/utils/pagination-utils.d.ts +0 -37
  380. package/dist/utils/pagination-utils.d.ts.map +0 -1
  381. package/dist/utils/pagination-utils.js +0 -165
  382. package/dist/utils/pagination-utils.test.d.ts +0 -17
  383. package/dist/utils/pagination-utils.test.d.ts.map +0 -1
  384. package/dist/utils/pagination-utils.test.js +0 -461
  385. package/dist/utils/retry-utils.d.ts +0 -45
  386. package/dist/utils/retry-utils.d.ts.map +0 -1
  387. package/dist/utils/retry-utils.js +0 -51
  388. package/dist/utils/retry-utils.test.d.ts +0 -2
  389. package/dist/utils/retry-utils.test.d.ts.map +0 -1
  390. package/dist/utils/retry-utils.test.js +0 -90
  391. package/dist/utils/schema-utils.d.ts +0 -69
  392. package/dist/utils/schema-utils.d.ts.map +0 -1
  393. package/dist/utils/schema-utils.js +0 -72
  394. package/dist/utils/string-utils.d.ts +0 -40
  395. package/dist/utils/string-utils.d.ts.map +0 -1
  396. package/dist/utils/string-utils.js +0 -69
  397. package/dist/utils/string-utils.test.d.ts +0 -2
  398. package/dist/utils/string-utils.test.d.ts.map +0 -1
  399. package/dist/utils/string-utils.test.js +0 -59
  400. package/dist/utils/telemetry-utils.d.ts +0 -44
  401. package/dist/utils/telemetry-utils.d.ts.map +0 -1
  402. package/dist/utils/telemetry-utils.js +0 -55
  403. package/dist/utils/telemetry-utils.test.d.ts +0 -2
  404. package/dist/utils/telemetry-utils.test.d.ts.map +0 -1
  405. package/dist/utils/telemetry-utils.test.js +0 -94
  406. package/dist/utils/url-utils.d.ts +0 -19
  407. package/dist/utils/url-utils.d.ts.map +0 -1
  408. package/dist/utils/url-utils.js +0 -62
  409. package/dist/utils/url-utils.test.d.ts +0 -2
  410. package/dist/utils/url-utils.test.d.ts.map +0 -1
  411. package/dist/utils/url-utils.test.js +0 -103
  412. package/dist/utils/validation.d.ts +0 -4
  413. package/dist/utils/validation.d.ts.map +0 -1
  414. package/dist/utils/validation.js +0 -30
  415. package/dist/utils/validation.test.d.ts +0 -2
  416. package/dist/utils/validation.test.d.ts.map +0 -1
  417. package/dist/utils/validation.test.js +0 -44
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as zod from 'zod';
2
2
  import { z } from 'zod';
3
3
  import { AuthenticationSchema, AuthenticationsResponseSchema, AuthenticationItem as AuthenticationItem$1, GetAuthenticationParam, GetAuthenticationResponse, GetAuthenticationParamSchema } from '@zapier/zapier-sdk-core/v0/schemas/authentications';
4
+ import { AppItem as AppItem$1 } from '@zapier/zapier-sdk-core/v0/schemas/apps';
4
5
  import * as zod_v4_core from 'zod/v4/core';
5
6
 
6
7
  /**
@@ -380,6 +381,71 @@ interface EventEmissionProvides {
380
381
  context: EventEmissionContext;
381
382
  }
382
383
 
384
+ /**
385
+ * Credentials type definitions
386
+ *
387
+ * The credentials system provides a unified way to authenticate with Zapier APIs.
388
+ * It supports multiple credential types:
389
+ * - String: A token (JWT or API key) used directly
390
+ * - Client credentials: OAuth client ID + secret exchanged for a token
391
+ * - PKCE: OAuth client ID for interactive login (CLI only)
392
+ * - Function: Lazy/dynamic credential resolution
393
+ */
394
+ /**
395
+ * Client credentials for OAuth client_credentials flow.
396
+ * The SDK will exchange these for an access token.
397
+ */
398
+ interface ClientCredentialsObject {
399
+ type?: "client_credentials";
400
+ clientId: string;
401
+ clientSecret: string;
402
+ baseUrl?: string;
403
+ scope?: string;
404
+ }
405
+ /**
406
+ * PKCE credentials for interactive OAuth flow.
407
+ * Only works when @zapier/zapier-sdk-cli-login is available.
408
+ */
409
+ interface PkceCredentialsObject {
410
+ type?: "pkce";
411
+ clientId: string;
412
+ baseUrl?: string;
413
+ scope?: string;
414
+ }
415
+ /**
416
+ * Union of all credential object types.
417
+ */
418
+ type CredentialsObject = ClientCredentialsObject | PkceCredentialsObject;
419
+ /**
420
+ * Resolved credentials - what a credentials function must return.
421
+ * Either a string (token) or a credentials object.
422
+ * Functions are not allowed to return other functions.
423
+ */
424
+ type ResolvedCredentials = string | CredentialsObject;
425
+ /**
426
+ * Credentials can be:
427
+ * - A string (token or API key)
428
+ * - A credentials object (client_credentials or pkce)
429
+ * - A function that returns credentials (sync or async)
430
+ */
431
+ type Credentials = ResolvedCredentials | (() => ResolvedCredentials | Promise<ResolvedCredentials>);
432
+ /**
433
+ * Type guard for client credentials objects.
434
+ */
435
+ declare function isClientCredentials(credentials: ResolvedCredentials): credentials is ClientCredentialsObject;
436
+ /**
437
+ * Type guard for PKCE credentials objects.
438
+ */
439
+ declare function isPkceCredentials(credentials: ResolvedCredentials): credentials is PkceCredentialsObject;
440
+ /**
441
+ * Type guard for credentials objects (either type).
442
+ */
443
+ declare function isCredentialsObject(credentials: ResolvedCredentials): credentials is CredentialsObject;
444
+ /**
445
+ * Type guard for credentials functions.
446
+ */
447
+ declare function isCredentialsFunction(credentials: Credentials): credentials is () => ResolvedCredentials | Promise<ResolvedCredentials>;
448
+
383
449
  declare const NeedSchema: z.ZodObject<{
384
450
  key: z.ZodString;
385
451
  alters_custom_fields: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
@@ -1012,24 +1078,26 @@ declare const ListInputFieldsSchema: z.ZodObject<{
1012
1078
  type ListInputFieldsOptions = z.infer<typeof ListInputFieldsSchema>;
1013
1079
 
1014
1080
  declare const FindFirstAuthenticationSchema: z.ZodObject<{
1081
+ search: z.ZodOptional<z.ZodString>;
1082
+ title: z.ZodOptional<z.ZodString>;
1015
1083
  appKey: z.ZodOptional<z.ZodString & {
1016
1084
  _def: z.core.$ZodStringDef & PositionalMetadata;
1017
1085
  }>;
1018
- search: z.ZodOptional<z.ZodString>;
1019
- title: z.ZodOptional<z.ZodString>;
1020
1086
  accountId: z.ZodOptional<z.ZodString>;
1021
1087
  owner: z.ZodOptional<z.ZodString>;
1088
+ isExpired: z.ZodOptional<z.ZodBoolean>;
1022
1089
  }, z.core.$strip>;
1023
1090
  type FindFirstAuthenticationOptions = z.infer<typeof FindFirstAuthenticationSchema>;
1024
1091
 
1025
1092
  declare const FindUniqueAuthenticationSchema: z.ZodObject<{
1093
+ search: z.ZodOptional<z.ZodString>;
1094
+ title: z.ZodOptional<z.ZodString>;
1026
1095
  appKey: z.ZodOptional<z.ZodString & {
1027
1096
  _def: z.core.$ZodStringDef & PositionalMetadata;
1028
1097
  }>;
1029
- search: z.ZodOptional<z.ZodString>;
1030
- title: z.ZodOptional<z.ZodString>;
1031
1098
  accountId: z.ZodOptional<z.ZodString>;
1032
1099
  owner: z.ZodOptional<z.ZodString>;
1100
+ isExpired: z.ZodOptional<z.ZodBoolean>;
1033
1101
  }, z.core.$strip>;
1034
1102
  type FindUniqueAuthenticationOptions = z.infer<typeof FindUniqueAuthenticationSchema>;
1035
1103
 
@@ -1121,6 +1189,7 @@ interface ApiPluginOptions extends BaseSdkOptions {
1121
1189
  interface ApiPluginProvides {
1122
1190
  context: {
1123
1191
  api: ApiClient;
1192
+ resolveCredentials: () => Promise<ResolvedCredentials | undefined>;
1124
1193
  };
1125
1194
  }
1126
1195
  declare const apiPlugin: Plugin<{}, {}, ApiPluginProvides>;
@@ -1362,23 +1431,29 @@ declare const GetAppSchema: z.ZodObject<{
1362
1431
  type GetAppOptions = z.infer<typeof GetAppSchema>;
1363
1432
 
1364
1433
  /**
1365
- * App and Service schemas
1434
+ * Plugin schemas for listApps
1366
1435
  *
1367
- * Covers:
1368
- * - App metadata
1369
- * - Service definitions
1370
- * - App listings and searches
1436
+ * Imports base query schema from @zapier/zapier-sdk-core (sdkapi) and extends
1437
+ * with SDK-specific options.
1438
+ *
1439
+ * Note: The sdkapi endpoint uses ListAppsQuerySchema (HTTP query params),
1440
+ * but the SDK exposes ListAppsSchema (user-friendly options):
1441
+ * - ListAppsOptions accepts `appKeys` as array, `cursor`, `maxItems`
1442
+ * - ListAppsQuery accepts `appKeys` as comma-separated string, `offset`
1443
+ * - The plugin transforms between these formats
1371
1444
  */
1372
1445
 
1373
1446
  /**
1374
- * Public API schema for listApps operation
1447
+ * SDK user-facing options for listApps
1375
1448
  *
1376
- * This is the user-facing schema that accepts app keys (slugs, implementation names, etc.)
1377
- * The plugin resolves these to implementation IDs before calling the handler.
1449
+ * Extends ListAppsQuerySchema from zapier-sdk-core with SDK-specific options:
1450
+ * - appKeys: array (not comma-separated string)
1451
+ * - cursor: pagination cursor (not offset)
1452
+ * - maxItems: SDK-specific pagination limit
1378
1453
  */
1379
- declare const ListAppsOptionsSchema: z.ZodObject<{
1380
- appKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
1454
+ declare const ListAppsSchema: z.ZodObject<{
1381
1455
  search: z.ZodOptional<z.ZodString>;
1456
+ appKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
1382
1457
  pageSize: z.ZodOptional<z.ZodNumber>;
1383
1458
  maxItems: z.ZodOptional<z.ZodNumber>;
1384
1459
  cursor: z.ZodOptional<z.ZodString>;
@@ -1386,80 +1461,20 @@ declare const ListAppsOptionsSchema: z.ZodObject<{
1386
1461
  isNested: z.ZodOptional<z.ZodBoolean>;
1387
1462
  }, z.core.$strip>>;
1388
1463
  }, z.core.$strip>;
1389
- type ListAppsOptions = z.infer<typeof ListAppsOptionsSchema>;
1390
- /**
1391
- * Normalized app item returned by listApps
1392
- * This extends ImplementationMetaSchema with transformed fields (title, key, implementation_id)
1393
- */
1394
- declare const AppItemSchema$1: z.ZodObject<{
1395
- categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
1396
- id: z.ZodNumber;
1397
- name: z.ZodString;
1398
- slug: z.ZodString;
1399
- }, z.core.$strip>>>;
1400
- actions: z.ZodOptional<z.ZodObject<{
1401
- read: z.ZodOptional<z.ZodNumber>;
1402
- read_bulk: z.ZodOptional<z.ZodNumber>;
1403
- write: z.ZodOptional<z.ZodNumber>;
1404
- search: z.ZodOptional<z.ZodNumber>;
1405
- search_or_write: z.ZodOptional<z.ZodNumber>;
1406
- search_and_write: z.ZodOptional<z.ZodNumber>;
1407
- filter: z.ZodOptional<z.ZodNumber>;
1408
- }, z.core.$strip>>;
1409
- description: z.ZodOptional<z.ZodString>;
1410
- is_hidden: z.ZodOptional<z.ZodBoolean>;
1411
- age_in_days: z.ZodOptional<z.ZodNumber>;
1412
- api_docs_url: z.ZodOptional<z.ZodString>;
1413
- banner: z.ZodOptional<z.ZodString>;
1414
- image: z.ZodOptional<z.ZodString>;
1415
- images: z.ZodOptional<z.ZodObject<{
1416
- url_16x16: z.ZodOptional<z.ZodString>;
1417
- url_32x32: z.ZodOptional<z.ZodString>;
1418
- url_64x64: z.ZodOptional<z.ZodString>;
1419
- url_128x128: z.ZodOptional<z.ZodString>;
1420
- }, z.core.$strip>>;
1421
- is_beta: z.ZodOptional<z.ZodBoolean>;
1422
- is_built_in: z.ZodOptional<z.ZodBoolean>;
1423
- is_featured: z.ZodOptional<z.ZodBoolean>;
1424
- is_premium: z.ZodOptional<z.ZodBoolean>;
1425
- is_public: z.ZodOptional<z.ZodBoolean>;
1426
- is_upcoming: z.ZodOptional<z.ZodBoolean>;
1427
- popularity: z.ZodOptional<z.ZodNumber>;
1428
- primary_color: z.ZodOptional<z.ZodString>;
1429
- slug: z.ZodString;
1430
- auth_type: z.ZodOptional<z.ZodString>;
1431
- is_deprecated: z.ZodOptional<z.ZodBoolean>;
1432
- secondary_color: z.ZodOptional<z.ZodString>;
1433
- has_filters: z.ZodOptional<z.ZodBoolean>;
1434
- has_reads: z.ZodOptional<z.ZodBoolean>;
1435
- has_searches: z.ZodOptional<z.ZodBoolean>;
1436
- has_searches_or_writes: z.ZodOptional<z.ZodBoolean>;
1437
- has_upfront_fields: z.ZodOptional<z.ZodBoolean>;
1438
- has_writes: z.ZodOptional<z.ZodBoolean>;
1439
- is_invite: z.ZodOptional<z.ZodBoolean>;
1440
- visibility: z.ZodOptional<z.ZodString>;
1441
- classification: z.ZodOptional<z.ZodString>;
1442
- title: z.ZodString;
1443
- key: z.ZodString;
1444
- implementation_id: z.ZodString;
1445
- version: z.ZodOptional<z.ZodString>;
1446
- }, z.core.$strip>;
1447
- type AppItem$1 = z.infer<typeof AppItemSchema$1>;
1464
+ type ListAppsOptions = z.infer<typeof ListAppsSchema>;
1465
+ interface ListAppsPage {
1466
+ data: AppItem$1[];
1467
+ nextCursor?: string;
1468
+ }
1448
1469
 
1449
1470
  interface ListAppsPluginProvides {
1450
- listApps: (options?: ListAppsOptions) => Promise<{
1451
- data: AppItem$1[];
1452
- nextCursor?: string;
1453
- }> & AsyncIterable<{
1454
- data: AppItem$1[];
1455
- nextCursor?: string;
1456
- }> & {
1471
+ listApps: (options?: ListAppsOptions) => Promise<ListAppsPage> & AsyncIterable<ListAppsPage> & {
1457
1472
  items(): AsyncIterable<AppItem$1>;
1458
1473
  };
1459
1474
  context: {
1460
1475
  meta: {
1461
1476
  listApps: {
1462
- inputSchema: typeof ListAppsOptionsSchema;
1477
+ inputSchema: typeof ListAppsSchema;
1463
1478
  };
1464
1479
  };
1465
1480
  };
@@ -1521,6 +1536,7 @@ declare const ListAuthenticationsQuerySchema: z.ZodObject<{
1521
1536
  title: z.ZodOptional<z.ZodString>;
1522
1537
  accountId: z.ZodOptional<z.ZodString>;
1523
1538
  owner: z.ZodOptional<z.ZodString>;
1539
+ isExpired: z.ZodOptional<z.ZodBoolean>;
1524
1540
  appKey: z.ZodOptional<z.ZodString & {
1525
1541
  _def: z.core.$ZodStringDef & PositionalMetadata;
1526
1542
  }>;
@@ -1719,13 +1735,21 @@ interface ListInputFieldChoicesPluginProvides {
1719
1735
  */
1720
1736
 
1721
1737
  interface BaseSdkOptions {
1738
+ /**
1739
+ * Authentication credentials. Can be:
1740
+ * - A string (token or API key)
1741
+ * - An object with clientId/clientSecret for client_credentials flow
1742
+ * - An object with clientId (no secret) for PKCE flow
1743
+ * - A function returning any of the above
1744
+ */
1745
+ credentials?: Credentials;
1746
+ /**
1747
+ * @deprecated Use `credentials` instead.
1748
+ */
1722
1749
  token?: string;
1723
- getToken?: () => Promise<string | undefined>;
1724
1750
  onEvent?: EventCallback;
1725
1751
  fetch?: typeof fetch;
1726
1752
  baseUrl?: string;
1727
- authBaseUrl?: string;
1728
- authClientId?: string;
1729
1753
  trackingBaseUrl?: string;
1730
1754
  debug?: boolean;
1731
1755
  manifestPath?: string;
@@ -1850,57 +1874,57 @@ interface PositionalMetadata {
1850
1874
  declare function isPositional(schema: z.ZodType): boolean;
1851
1875
 
1852
1876
  declare const AppItemSchema: z.ZodObject<{
1877
+ slug: z.ZodString;
1878
+ age_in_days: z.ZodOptional<z.ZodNumber>;
1879
+ auth_type: z.ZodOptional<z.ZodString>;
1880
+ banner: z.ZodOptional<z.ZodString>;
1853
1881
  categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
1854
1882
  id: z.ZodNumber;
1855
1883
  name: z.ZodString;
1856
1884
  slug: z.ZodString;
1857
1885
  }, z.core.$strip>>>;
1858
- actions: z.ZodOptional<z.ZodObject<{
1859
- read: z.ZodOptional<z.ZodNumber>;
1860
- read_bulk: z.ZodOptional<z.ZodNumber>;
1861
- write: z.ZodOptional<z.ZodNumber>;
1862
- search: z.ZodOptional<z.ZodNumber>;
1863
- search_or_write: z.ZodOptional<z.ZodNumber>;
1864
- search_and_write: z.ZodOptional<z.ZodNumber>;
1865
- filter: z.ZodOptional<z.ZodNumber>;
1866
- }, z.core.$strip>>;
1867
- description: z.ZodOptional<z.ZodString>;
1868
- is_hidden: z.ZodOptional<z.ZodBoolean>;
1869
- age_in_days: z.ZodOptional<z.ZodNumber>;
1870
- api_docs_url: z.ZodOptional<z.ZodString>;
1871
- banner: z.ZodOptional<z.ZodString>;
1872
- image: z.ZodOptional<z.ZodString>;
1873
1886
  images: z.ZodOptional<z.ZodObject<{
1874
1887
  url_16x16: z.ZodOptional<z.ZodString>;
1875
1888
  url_32x32: z.ZodOptional<z.ZodString>;
1876
1889
  url_64x64: z.ZodOptional<z.ZodString>;
1877
1890
  url_128x128: z.ZodOptional<z.ZodString>;
1878
1891
  }, z.core.$strip>>;
1879
- is_beta: z.ZodOptional<z.ZodBoolean>;
1880
- is_built_in: z.ZodOptional<z.ZodBoolean>;
1881
- is_featured: z.ZodOptional<z.ZodBoolean>;
1882
- is_premium: z.ZodOptional<z.ZodBoolean>;
1883
- is_public: z.ZodOptional<z.ZodBoolean>;
1884
- is_upcoming: z.ZodOptional<z.ZodBoolean>;
1885
1892
  popularity: z.ZodOptional<z.ZodNumber>;
1886
- primary_color: z.ZodOptional<z.ZodString>;
1887
- slug: z.ZodString;
1888
- auth_type: z.ZodOptional<z.ZodString>;
1889
- is_deprecated: z.ZodOptional<z.ZodBoolean>;
1890
- secondary_color: z.ZodOptional<z.ZodString>;
1891
1893
  has_filters: z.ZodOptional<z.ZodBoolean>;
1892
1894
  has_reads: z.ZodOptional<z.ZodBoolean>;
1893
1895
  has_searches: z.ZodOptional<z.ZodBoolean>;
1894
1896
  has_searches_or_writes: z.ZodOptional<z.ZodBoolean>;
1895
1897
  has_upfront_fields: z.ZodOptional<z.ZodBoolean>;
1896
1898
  has_writes: z.ZodOptional<z.ZodBoolean>;
1899
+ is_beta: z.ZodOptional<z.ZodBoolean>;
1900
+ is_built_in: z.ZodOptional<z.ZodBoolean>;
1901
+ is_deprecated: z.ZodOptional<z.ZodBoolean>;
1902
+ is_featured: z.ZodOptional<z.ZodBoolean>;
1903
+ is_hidden: z.ZodOptional<z.ZodBoolean>;
1897
1904
  is_invite: z.ZodOptional<z.ZodBoolean>;
1898
- version: z.ZodOptional<z.ZodString>;
1905
+ is_premium: z.ZodOptional<z.ZodBoolean>;
1906
+ is_public: z.ZodOptional<z.ZodBoolean>;
1907
+ is_upcoming: z.ZodOptional<z.ZodBoolean>;
1899
1908
  visibility: z.ZodOptional<z.ZodString>;
1909
+ actions: z.ZodOptional<z.ZodObject<{
1910
+ read: z.ZodOptional<z.ZodNumber>;
1911
+ read_bulk: z.ZodOptional<z.ZodNumber>;
1912
+ write: z.ZodOptional<z.ZodNumber>;
1913
+ search: z.ZodOptional<z.ZodNumber>;
1914
+ search_or_write: z.ZodOptional<z.ZodNumber>;
1915
+ search_and_write: z.ZodOptional<z.ZodNumber>;
1916
+ filter: z.ZodOptional<z.ZodNumber>;
1917
+ }, z.core.$strip>>;
1918
+ description: z.ZodOptional<z.ZodString>;
1919
+ primary_color: z.ZodOptional<z.ZodString>;
1920
+ secondary_color: z.ZodOptional<z.ZodString>;
1900
1921
  classification: z.ZodOptional<z.ZodString>;
1922
+ api_docs_url: z.ZodOptional<z.ZodString>;
1923
+ image: z.ZodOptional<z.ZodString>;
1901
1924
  title: z.ZodString;
1902
1925
  key: z.ZodString;
1903
1926
  implementation_id: z.ZodString;
1927
+ version: z.ZodOptional<z.ZodString>;
1904
1928
  }, z.core.$strip>;
1905
1929
 
1906
1930
  declare const AuthenticationItemSchema: z.ZodObject<{
@@ -2200,52 +2224,147 @@ declare const inputFieldKeyResolver: DynamicResolver<InputFieldItem$1, {
2200
2224
  * SDK Authentication Utilities
2201
2225
  *
2202
2226
  * This module provides SDK-level authentication utilities focused
2203
- * solely on token acquisition. CLI-specific functionality like login/logout
2204
- * is handled by the @zapier/zapier-sdk-cli-login package.
2227
+ * on token acquisition. It uses the credentials system for resolution
2228
+ * and handles different credential types appropriately.
2229
+ *
2230
+ * CLI-specific functionality like login/logout is handled by the
2231
+ * @zapier/zapier-sdk-cli-login package.
2205
2232
  */
2206
2233
 
2207
- interface AuthOptions {
2234
+ /**
2235
+ * Options for resolving auth tokens.
2236
+ */
2237
+ interface ResolveAuthTokenOptions {
2238
+ credentials?: Credentials;
2239
+ /** @deprecated Use `credentials` instead */
2240
+ token?: string;
2208
2241
  onEvent?: EventCallback;
2209
2242
  fetch?: typeof globalThis.fetch;
2210
2243
  baseUrl?: string;
2211
- authBaseUrl?: string;
2212
- authClientId?: string;
2213
- }
2214
- interface ResolveAuthTokenOptions extends AuthOptions {
2215
- token?: string;
2216
- getToken?: () => Promise<string | undefined> | string | undefined;
2217
2244
  }
2218
2245
  /**
2219
- * Gets the ZAPIER_TOKEN from environment variables.
2220
- * Returns undefined if not set.
2246
+ * Clear the token cache. Useful for testing or forcing re-authentication.
2247
+ */
2248
+ declare function clearTokenCache(): void;
2249
+ /**
2250
+ * Invalidate a cached token. Called when we get a 401 response.
2221
2251
  */
2222
- declare function getTokenFromEnv(): string | undefined;
2252
+ declare function invalidateCachedToken(clientId: string): void;
2253
+ /**
2254
+ * Options for getTokenFromCliLogin.
2255
+ */
2256
+ interface CliLoginOptions {
2257
+ onEvent?: EventCallback;
2258
+ fetch?: typeof globalThis.fetch;
2259
+ credentials?: {
2260
+ type?: "pkce";
2261
+ clientId: string;
2262
+ baseUrl?: string;
2263
+ scope?: string;
2264
+ };
2265
+ }
2223
2266
  /**
2224
2267
  * Attempts to get a token by optionally importing from CLI login package.
2225
2268
  * This provides a graceful fallback when the CLI login package is not available.
2226
2269
  *
2227
2270
  * Returns undefined if no valid token is found or CLI package is not available.
2228
2271
  */
2229
- declare function getTokenFromCliLogin(options?: AuthOptions): Promise<string | undefined>;
2272
+ declare function getTokenFromCliLogin(options: CliLoginOptions): Promise<string | undefined>;
2230
2273
  /**
2231
- * Attempts to get a token with the following precedence:
2232
- * 1. ZAPIER_TOKEN environment variable
2233
- * 2. CLI login package (if available) with auto-refresh
2274
+ * Resolves an auth token from wherever it can be found.
2275
+ *
2276
+ * Resolution order:
2277
+ * 1. Explicit credentials option (or deprecated token option)
2278
+ * 2. Environment variables
2279
+ * 3. CLI login package (if available)
2280
+ *
2281
+ * For different credential types:
2282
+ * - String: Used directly as the token
2283
+ * - Client credentials: Exchanged for an access token (with caching)
2284
+ * - PKCE: Delegates to CLI login (throws if not available)
2234
2285
  *
2235
2286
  * Returns undefined if no valid token is found.
2236
2287
  */
2237
- declare function getTokenFromEnvOrConfig(options?: AuthOptions): Promise<string | undefined>;
2288
+ declare function resolveAuthToken(options?: ResolveAuthTokenOptions): Promise<string | undefined>;
2289
+ /**
2290
+ * Invalidate the cached token for the given credentials, if applicable.
2291
+ * This is called when we receive a 401 response, indicating the token
2292
+ * is no longer valid. Only affects client_credentials flow tokens.
2293
+ */
2294
+ declare function invalidateCredentialsToken(options: {
2295
+ credentials?: Credentials;
2296
+ token?: string;
2297
+ }): Promise<void>;
2298
+
2238
2299
  /**
2239
- * Resolves an auth token from all possible sources with the following precedence:
2240
- * 1. Explicitly provided token in options
2241
- * 2. Token from getToken callback in options
2242
- * 3. ZAPIER_TOKEN environment variable
2243
- * 4. CLI login package (if available)
2300
+ * Credentials Resolution
2244
2301
  *
2245
- * This is the canonical token resolution logic used throughout the SDK.
2246
- * Returns undefined if no valid token is found.
2302
+ * This module provides the core logic for resolving credentials from various sources:
2303
+ * - Explicit credentials option
2304
+ * - Deprecated token option
2305
+ * - Environment variables (new and deprecated)
2306
+ * - CLI login stored tokens
2247
2307
  */
2248
- declare function resolveAuthToken(options?: ResolveAuthTokenOptions): Promise<string | undefined>;
2308
+
2309
+ /**
2310
+ * Options for resolving credentials.
2311
+ */
2312
+ interface ResolveCredentialsOptions {
2313
+ credentials?: Credentials;
2314
+ /** @deprecated Use `credentials` instead */
2315
+ token?: string;
2316
+ /** SDK base URL - used to derive auth base URL if not specified in credentials */
2317
+ baseUrl?: string;
2318
+ }
2319
+ /**
2320
+ * Resolve credentials from environment variables.
2321
+ *
2322
+ * Precedence:
2323
+ * 1. ZAPIER_CREDENTIALS (string token)
2324
+ * 2. ZAPIER_CREDENTIALS_CLIENT_ID + ZAPIER_CREDENTIALS_CLIENT_SECRET (client credentials)
2325
+ * 3. ZAPIER_CREDENTIALS_CLIENT_ID alone (PKCE)
2326
+ * 4. Deprecated ZAPIER_TOKEN, ZAPIER_AUTH_* vars (with warnings)
2327
+ *
2328
+ * @param sdkBaseUrl - SDK base URL used to derive auth base URL if not specified
2329
+ */
2330
+ declare function resolveCredentialsFromEnv(sdkBaseUrl?: string): ResolvedCredentials | undefined;
2331
+ /**
2332
+ * Resolve credentials from all possible sources.
2333
+ *
2334
+ * Precedence:
2335
+ * 1. Explicit credentials option
2336
+ * 2. Deprecated token option (with warning)
2337
+ * 3. Environment variables
2338
+ * 4. CLI login stored token (handled separately in auth.ts)
2339
+ *
2340
+ * If credentials is a function, it is called and must return
2341
+ * a string or credentials object (not another function).
2342
+ *
2343
+ * The baseUrl option is used to derive the auth base URL if not
2344
+ * specified in credentials.
2345
+ */
2346
+ declare function resolveCredentials(options?: ResolveCredentialsOptions): Promise<ResolvedCredentials | undefined>;
2347
+ /**
2348
+ * Extract the base URL from credentials for use in auth flows.
2349
+ */
2350
+ declare function getBaseUrlFromCredentials(credentials: ResolvedCredentials | undefined): string | undefined;
2351
+ /**
2352
+ * Extract the client ID from credentials for use in auth flows.
2353
+ */
2354
+ declare function getClientIdFromCredentials(credentials: ResolvedCredentials | undefined): string | undefined;
2355
+
2356
+ /**
2357
+ * Logging utilities for the SDK
2358
+ */
2359
+ /**
2360
+ * Log a deprecation warning. Each unique message is only logged once per process.
2361
+ */
2362
+ declare function logDeprecation(message: string): void;
2363
+ /**
2364
+ * Reset the set of logged deprecation warnings.
2365
+ * Useful for testing.
2366
+ */
2367
+ declare function resetDeprecationWarnings(): void;
2249
2368
 
2250
2369
  /**
2251
2370
  * SDK Constants
@@ -2260,6 +2379,20 @@ declare const ZAPIER_BASE_URL: string;
2260
2379
  * Maximum number of items that can be requested per page across all paginated functions
2261
2380
  */
2262
2381
  declare const MAX_PAGE_LIMIT = 10000;
2382
+ /**
2383
+ * Credentials from environment variables
2384
+ */
2385
+ declare const ZAPIER_CREDENTIALS: string | undefined;
2386
+ declare const ZAPIER_CREDENTIALS_CLIENT_ID: string | undefined;
2387
+ declare const ZAPIER_CREDENTIALS_CLIENT_SECRET: string | undefined;
2388
+ declare const ZAPIER_CREDENTIALS_BASE_URL: string | undefined;
2389
+ declare const ZAPIER_CREDENTIALS_SCOPE: string | undefined;
2390
+ /**
2391
+ * Deprecated environment variables (kept for backwards compatibility)
2392
+ */
2393
+ declare const ZAPIER_TOKEN: string | undefined;
2394
+ declare const ZAPIER_AUTH_BASE_URL: string | undefined;
2395
+ declare const ZAPIER_AUTH_CLIENT_ID: string | undefined;
2263
2396
 
2264
2397
  interface ZapierSdkOptions extends BaseSdkOptions {
2265
2398
  }
@@ -2277,6 +2410,7 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
2277
2410
  meta: Record<string, PluginMeta>;
2278
2411
  } & EventEmissionContext & {
2279
2412
  api: ApiClient;
2413
+ resolveCredentials: () => Promise<ResolvedCredentials | undefined>;
2280
2414
  } & {
2281
2415
  getVersionedImplementationId: GetVersionedImplementationId;
2282
2416
  resolveAppKeys: ResolveAppKeys;
@@ -2306,7 +2440,7 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
2306
2440
  } & {
2307
2441
  meta: {
2308
2442
  listApps: {
2309
- inputSchema: typeof ListAppsOptionsSchema;
2443
+ inputSchema: typeof ListAppsSchema;
2310
2444
  };
2311
2445
  };
2312
2446
  } & {
@@ -2404,4 +2538,4 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
2404
2538
  }>;
2405
2539
  declare function createZapierSdk(options?: ZapierSdkOptions): ZapierSdk;
2406
2540
 
2407
- export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTypeProperty, ActionTypePropertySchema, type AddActionEntryOptions, type AddActionEntryResult, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type ApplicationLifecycleEventData, type AppsPluginProvides, type AuthEvent, type AuthOptions, type Authentication, type AuthenticationIdProperty, AuthenticationIdPropertySchema, type AuthenticationItem, type AuthenticationsResponse, type BaseEvent, type BatchOptions, type Choice, DEFAULT_CONFIG_PATH, type DebugProperty, DebugPropertySchema, type EnhancedErrorEventData, type ErrorOptions, type EventCallback, type EventContext, type EventEmissionContext, type FetchPluginProvides, type Field, type FieldsetItem, type FindFirstAuthenticationPluginProvides, type FindUniqueAuthenticationPluginProvides, type FormatMetadata, type FormattedItem, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetContextType, type GetProfilePluginProvides, type GetSdkType, type InfoFieldItem, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListInputFieldsPluginProvides, type LoadingEvent, MAX_PAGE_LIMIT, type Manifest, type ManifestEntry, type ManifestPluginOptions, type ManifestPluginProvides, type MethodCalledEvent, type MethodCalledEventData, type Need, type NeedsRequest, type NeedsResponse, type OffsetProperty, OffsetPropertySchema, type OutputProperty, OutputPropertySchema, type PaginatedSdkFunction, type ParamsProperty, ParamsPropertySchema, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, type PositionalMetadata, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolveAuthTokenOptions, type RootFieldItem, type RunActionPluginProvides, type Sdk, type SdkEvent, type UpdateManifestEntryOptions, type UpdateManifestEntryResult, type UserProfile, type UserProfileItem, ZAPIER_BASE_URL, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, authenticationIdGenericResolver, authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, createBaseEvent, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, fetchPlugin, findFirstAuthenticationPlugin, findManifestEntry, findUniqueAuthenticationPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getAuthenticationPlugin, getCiPlatform, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTokenFromCliLogin, getTokenFromEnv, getTokenFromEnvOrConfig, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, isCi, isPositional, listActionsPlugin, listAppsPlugin, listAuthenticationsPlugin, listInputFieldsPlugin, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resolveAuthToken, runActionPlugin, toSnakeCase, toTitleCase };
2541
+ export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTypeProperty, ActionTypePropertySchema, type AddActionEntryOptions, type AddActionEntryResult, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type ApplicationLifecycleEventData, type AppsPluginProvides, type AuthEvent, type Authentication, type AuthenticationIdProperty, AuthenticationIdPropertySchema, type AuthenticationItem, type AuthenticationsResponse, type BaseEvent, type BatchOptions, type Choice, type ClientCredentialsObject, type Credentials, type CredentialsObject, DEFAULT_CONFIG_PATH, type DebugProperty, DebugPropertySchema, type EnhancedErrorEventData, type ErrorOptions, type EventCallback, type EventContext, type EventEmissionContext, type FetchPluginProvides, type Field, type FieldsetItem, type FindFirstAuthenticationPluginProvides, type FindUniqueAuthenticationPluginProvides, type FormatMetadata, type FormattedItem, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetContextType, type GetProfilePluginProvides, type GetSdkType, type InfoFieldItem, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListInputFieldsPluginProvides, type LoadingEvent, MAX_PAGE_LIMIT, type Manifest, type ManifestEntry, type ManifestPluginOptions, type ManifestPluginProvides, type MethodCalledEvent, type MethodCalledEventData, type Need, type NeedsRequest, type NeedsResponse, type OffsetProperty, OffsetPropertySchema, type OutputProperty, OutputPropertySchema, type PaginatedSdkFunction, type ParamsProperty, ParamsPropertySchema, type PkceCredentialsObject, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, type PositionalMetadata, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolveAuthTokenOptions, type ResolveCredentialsOptions, type ResolvedCredentials, type RootFieldItem, type RunActionPluginProvides, type Sdk, type SdkEvent, type UpdateManifestEntryOptions, type UpdateManifestEntryResult, type UserProfile, type UserProfileItem, ZAPIER_AUTH_BASE_URL, ZAPIER_AUTH_CLIENT_ID, ZAPIER_BASE_URL, ZAPIER_CREDENTIALS, ZAPIER_CREDENTIALS_BASE_URL, ZAPIER_CREDENTIALS_CLIENT_ID, ZAPIER_CREDENTIALS_CLIENT_SECRET, ZAPIER_CREDENTIALS_SCOPE, ZAPIER_TOKEN, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, authenticationIdGenericResolver, authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, createBaseEvent, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, fetchPlugin, findFirstAuthenticationPlugin, findManifestEntry, findUniqueAuthenticationPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getAuthenticationPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTokenFromCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listAuthenticationsPlugin, listInputFieldsPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, toSnakeCase, toTitleCase };