@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.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var zod = require('zod');
4
+ var apps = require('@zapier/zapier-sdk-core/v0/schemas/apps');
4
5
  var authentications = require('@zapier/zapier-sdk-core/v0/schemas/authentications');
5
6
  var promises = require('timers/promises');
6
7
  var os = require('os');
@@ -57,6 +58,14 @@ function isPositional(schema) {
57
58
  // src/constants.ts
58
59
  var ZAPIER_BASE_URL = process.env.ZAPIER_BASE_URL || "https://zapier.com";
59
60
  var MAX_PAGE_LIMIT = 1e4;
61
+ var ZAPIER_CREDENTIALS = process.env.ZAPIER_CREDENTIALS;
62
+ var ZAPIER_CREDENTIALS_CLIENT_ID = process.env.ZAPIER_CREDENTIALS_CLIENT_ID;
63
+ var ZAPIER_CREDENTIALS_CLIENT_SECRET = process.env.ZAPIER_CREDENTIALS_CLIENT_SECRET;
64
+ var ZAPIER_CREDENTIALS_BASE_URL = process.env.ZAPIER_CREDENTIALS_BASE_URL;
65
+ var ZAPIER_CREDENTIALS_SCOPE = process.env.ZAPIER_CREDENTIALS_SCOPE;
66
+ var ZAPIER_TOKEN = process.env.ZAPIER_TOKEN;
67
+ var ZAPIER_AUTH_BASE_URL = process.env.ZAPIER_AUTH_BASE_URL;
68
+ var ZAPIER_AUTH_CLIENT_ID = process.env.ZAPIER_AUTH_CLIENT_ID;
60
69
 
61
70
  // src/types/properties.ts
62
71
  var AppKeyPropertySchema = withPositional(
@@ -817,105 +826,230 @@ function createPaginatedFunction(coreFn, schema, telemetry, explicitFunctionName
817
826
  };
818
827
  return namedFunctions[functionName];
819
828
  }
820
- var ImplementationMetaSchema = zod.z.object({
821
- id: zod.z.string(),
822
- name: zod.z.string(),
823
- slug: zod.z.string(),
824
- age_in_days: zod.z.number().optional(),
825
- auth_type: zod.z.string().optional(),
826
- banner: zod.z.string().optional(),
827
- categories: zod.z.array(
828
- zod.z.object({
829
- id: zod.z.number(),
830
- name: zod.z.string(),
831
- slug: zod.z.string()
832
- })
833
- ).optional(),
834
- images: zod.z.object({
835
- url_16x16: zod.z.string().optional(),
836
- url_32x32: zod.z.string().optional(),
837
- url_64x64: zod.z.string().optional(),
838
- url_128x128: zod.z.string().optional()
839
- }).optional(),
840
- popularity: zod.z.number().optional(),
841
- has_filters: zod.z.boolean().optional(),
842
- has_reads: zod.z.boolean().optional(),
843
- has_searches: zod.z.boolean().optional(),
844
- has_searches_or_writes: zod.z.boolean().optional(),
845
- has_upfront_fields: zod.z.boolean().optional(),
846
- has_writes: zod.z.boolean().optional(),
847
- is_beta: zod.z.boolean().optional(),
848
- is_built_in: zod.z.boolean().optional(),
849
- is_deprecated: zod.z.boolean().optional(),
850
- is_featured: zod.z.boolean().optional(),
851
- is_hidden: zod.z.boolean().optional(),
852
- is_invite: zod.z.boolean().optional(),
853
- is_premium: zod.z.boolean().optional(),
854
- is_public: zod.z.boolean().optional(),
855
- is_upcoming: zod.z.boolean().optional(),
856
- version: zod.z.string().optional(),
857
- visibility: zod.z.string().optional(),
858
- actions: zod.z.object({
859
- read: zod.z.number().optional(),
860
- read_bulk: zod.z.number().optional(),
861
- write: zod.z.number().optional(),
862
- search: zod.z.number().optional(),
863
- search_or_write: zod.z.number().optional(),
864
- search_and_write: zod.z.number().optional(),
865
- filter: zod.z.number().optional()
866
- }).optional(),
867
- description: zod.z.string().optional(),
868
- primary_color: zod.z.string().optional(),
869
- secondary_color: zod.z.string().optional(),
870
- classification: zod.z.string().optional(),
871
- api_docs_url: zod.z.string().optional(),
872
- image: zod.z.string().optional()
873
- });
874
- zod.z.object({
875
- count: zod.z.number(),
876
- next: zod.z.string().nullable().optional(),
877
- previous: zod.z.string().nullable().optional(),
878
- results: zod.z.array(ImplementationMetaSchema)
879
- });
880
-
881
- // src/temporary-internal-core/schemas/apps/index.ts
882
- var ListAppsOptionsSchema = zod.z.object({
829
+ var ListAppsSchema = apps.ListAppsQuerySchema.omit({
830
+ offset: true
831
+ }).extend({
832
+ // Override appKeys to be an array instead of comma-separated string
883
833
  appKeys: zod.z.array(zod.z.string()).optional().describe(
884
834
  "Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github')"
885
835
  ),
886
- search: zod.z.string().optional().describe("Search for apps by name"),
836
+ // Override pageSize to make optional (base has default value)
887
837
  pageSize: zod.z.number().min(1).optional().describe("Number of apps per page"),
838
+ // SDK specific property for pagination/iterator helpers
888
839
  maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
840
+ // SDK specific property for pagination/iterator helpers
889
841
  cursor: zod.z.string().optional().describe("Cursor to start from")
890
842
  }).merge(TelemetryMarkerSchema).describe("List all available apps with optional filtering");
891
- var AppItemSchema = ImplementationMetaSchema.omit({
892
- name: true,
893
- id: true
894
- }).extend({
895
- title: zod.z.string(),
896
- key: zod.z.string(),
897
- implementation_id: zod.z.string(),
898
- version: zod.z.string().optional()
899
- });
900
- zod.z.object({
901
- data: zod.z.array(AppItemSchema),
902
- nextCursor: zod.z.string().optional()
843
+
844
+ // src/utils/string-utils.ts
845
+ function toTitleCase(input) {
846
+ return input.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-]+/g, " ").replace(/\s+/g, " ").trim().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
847
+ }
848
+ function toSnakeCase(input) {
849
+ let result = input.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s\-]+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").toLowerCase();
850
+ if (/^[0-9]/.test(result)) {
851
+ result = "_" + result;
852
+ }
853
+ return result;
854
+ }
855
+ function stripPageSuffix(functionName) {
856
+ return functionName.replace(/Page$/, "");
857
+ }
858
+
859
+ // src/schemas/App.ts
860
+ var AppItemSchema = withFormatter(apps.AppItemSchema, {
861
+ format: (item) => {
862
+ const additionalKeys = [];
863
+ if (item.slug && item.slug !== item.key) {
864
+ additionalKeys.push(item.slug);
865
+ const snakeCaseSlug = toSnakeCase(item.slug);
866
+ if (snakeCaseSlug !== item.slug && snakeCaseSlug !== item.key) {
867
+ additionalKeys.push(snakeCaseSlug);
868
+ }
869
+ }
870
+ return {
871
+ title: item.title,
872
+ key: item.key,
873
+ keys: [item.key, ...additionalKeys],
874
+ description: item.description,
875
+ details: []
876
+ };
877
+ }
903
878
  });
904
- var ListAppsHandlerRequestSchema = zod.z.object({
905
- implementationIds: zod.z.union([zod.z.string(), zod.z.array(zod.z.string())]).optional().describe(
906
- "Pre-resolved implementation IDs - array or comma-separated string"
879
+
880
+ // src/utils/telemetry-utils.ts
881
+ function createTelemetryCallback(emitMethodCalled, methodName) {
882
+ return {
883
+ onMethodCalled: (data) => {
884
+ emitMethodCalled({
885
+ method_name: methodName,
886
+ execution_duration_ms: data.durationMs,
887
+ success_flag: data.success,
888
+ error_message: data.error?.message ?? null,
889
+ error_type: data.error?.constructor.name ?? null,
890
+ argument_count: data.argumentCount,
891
+ is_paginated: data.isPaginated
892
+ });
893
+ }
894
+ };
895
+ }
896
+
897
+ // src/plugins/listApps/index.ts
898
+ var listAppsPlugin = ({ context }) => {
899
+ async function listAppsPage(options) {
900
+ const { api, resolveAppKeys: resolveAppKeys2 } = context;
901
+ const appKeys = options.appKeys ?? [];
902
+ const appLocators = await resolveAppKeys2({
903
+ appKeys: [...appKeys]
904
+ });
905
+ const implementationNameToLocator = {};
906
+ for (const locator of appLocators) {
907
+ implementationNameToLocator[locator.implementationName] = [
908
+ ...implementationNameToLocator[locator.implementationName] ?? [],
909
+ locator
910
+ ];
911
+ }
912
+ const duplicatedLookupAppKeys = Object.keys(implementationNameToLocator).filter((key) => implementationNameToLocator[key].length > 1).map((key) => implementationNameToLocator[key]).flat().map((locator) => locator.lookupAppKey);
913
+ if (duplicatedLookupAppKeys.length > 0) {
914
+ throw new Error(
915
+ `Duplicate lookup app keys found: ${duplicatedLookupAppKeys.join(", ")}`
916
+ );
917
+ }
918
+ if (appKeys.length > 0 && appLocators.length === 0 && !options.search) {
919
+ return {
920
+ data: [],
921
+ links: { next: null },
922
+ meta: { count: 0, limit: 0, offset: 0 }
923
+ };
924
+ }
925
+ const implementationIds = appLocators.map((locator) => {
926
+ const version = locator.version || "latest";
927
+ return `${locator.implementationName}@${version}`;
928
+ });
929
+ return await api.get("/api/v0/apps", {
930
+ searchParams: {
931
+ appKeys: implementationIds.join(","),
932
+ ...options.search && { search: options.search },
933
+ pageSize: options.pageSize.toString(),
934
+ ...options.cursor && { offset: options.cursor }
935
+ }
936
+ });
937
+ }
938
+ const methodName = stripPageSuffix(listAppsPage.name);
939
+ const listAppsDefinition = createPaginatedFunction(
940
+ listAppsPage,
941
+ ListAppsSchema,
942
+ createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
943
+ methodName
944
+ );
945
+ return {
946
+ listApps: listAppsDefinition,
947
+ context: {
948
+ meta: {
949
+ listApps: {
950
+ categories: ["app"],
951
+ type: "list",
952
+ itemType: "App",
953
+ inputSchema: ListAppsSchema,
954
+ outputSchema: AppItemSchema
955
+ }
956
+ }
957
+ }
958
+ };
959
+ };
960
+
961
+ // src/utils/domain-utils.ts
962
+ function splitVersionedKey(versionedKey) {
963
+ const parts = versionedKey.split("@");
964
+ if (parts.length >= 2) {
965
+ const baseKey = parts[0];
966
+ const version = parts.slice(1).join("@");
967
+ return [baseKey, version];
968
+ }
969
+ return [versionedKey, void 0];
970
+ }
971
+ function normalizeImplementationMetaToAppItem(implementationMeta) {
972
+ const [selectedApi, appVersion] = splitVersionedKey(implementationMeta.id);
973
+ const { id, name, ...restOfImplementationMeta } = implementationMeta;
974
+ return {
975
+ ...restOfImplementationMeta,
976
+ title: name,
977
+ key: selectedApi,
978
+ implementation_id: id,
979
+ version: appVersion
980
+ };
981
+ }
982
+ function normalizeActionItem(action) {
983
+ const { name, type, selected_api: selectedApi } = action;
984
+ const [appKey, appVersion] = selectedApi ? splitVersionedKey(selectedApi) : ["", void 0];
985
+ return {
986
+ // Only include the fields we want - explicitly list them
987
+ id: action.id,
988
+ key: action.key,
989
+ description: action.description,
990
+ is_important: action.is_important,
991
+ is_hidden: action.is_hidden,
992
+ // Transformed fields
993
+ app_key: appKey,
994
+ app_version: appVersion,
995
+ action_type: type,
996
+ title: name,
997
+ // Map name to title
998
+ type: "action"
999
+ };
1000
+ }
1001
+ function isSlug(slug) {
1002
+ return !!slug.match(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
1003
+ }
1004
+ function isSnakeCasedSlug(slug) {
1005
+ if (slug.match(/^_[0-9]/)) {
1006
+ slug = slug.slice(1);
1007
+ }
1008
+ return !!slug.match(/^[a-z0-9]+(?:_[a-z0-9]+)*$/);
1009
+ }
1010
+ function dashifySnakeCasedSlug(slug) {
1011
+ if (!isSnakeCasedSlug(slug)) {
1012
+ return slug;
1013
+ }
1014
+ if (slug.startsWith("_")) {
1015
+ slug = slug.slice(1);
1016
+ }
1017
+ return slug.replace(/_/g, "-");
1018
+ }
1019
+ function isUuid(appKey) {
1020
+ return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
1021
+ appKey
1022
+ );
1023
+ }
1024
+ function toAppLocator(appKey) {
1025
+ const [appKeyWithoutVersion, version] = splitVersionedKey(appKey);
1026
+ if (isUuid(appKeyWithoutVersion)) {
1027
+ throw new Error(
1028
+ `UUID app keys are not supported. Use app slug or implementation ID instead of: ${appKey}`
1029
+ );
1030
+ }
1031
+ const slug = isSlug(appKeyWithoutVersion) ? appKeyWithoutVersion : isSnakeCasedSlug(appKeyWithoutVersion) ? dashifySnakeCasedSlug(appKeyWithoutVersion) : void 0;
1032
+ return {
1033
+ lookupAppKey: appKeyWithoutVersion,
1034
+ slug,
1035
+ implementationName: slug ? void 0 : appKeyWithoutVersion,
1036
+ version
1037
+ };
1038
+ }
1039
+ function isResolvedAppLocator(appLocator) {
1040
+ return !!appLocator.implementationName;
1041
+ }
1042
+ var ListActionsSchema = zod.z.object({
1043
+ appKey: AppKeyPropertySchema.describe(
1044
+ "App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"
1045
+ ),
1046
+ actionType: ActionTypePropertySchema.optional().describe(
1047
+ "Filter actions by type"
907
1048
  ),
908
- search: zod.z.string().optional().describe("Optional search term to augment results"),
909
- pageSize: zod.z.union([zod.z.string(), zod.z.number()]).optional().describe("Number of apps per page"),
910
- cursor: zod.z.string().optional().describe("Pagination cursor")
911
- }).transform((data) => ({
912
- // Normalize implementationIds to array
913
- implementationIds: typeof data.implementationIds === "string" ? data.implementationIds === "" ? [] : data.implementationIds.split(",") : data.implementationIds ?? [],
914
- search: data.search,
915
- // Normalize pageSize to number
916
- pageSize: typeof data.pageSize === "string" ? parseInt(data.pageSize, 10) : data.pageSize,
917
- cursor: data.cursor
918
- }));
1049
+ pageSize: zod.z.number().min(1).optional().describe("Number of actions per page"),
1050
+ maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
1051
+ cursor: zod.z.string().optional().describe("Cursor to start from")
1052
+ }).merge(TelemetryMarkerSchema).describe("List all actions for a specific app");
919
1053
  var NeedChoicesSchema = zod.z.object({
920
1054
  key: zod.z.string().optional(),
921
1055
  label: zod.z.string().optional(),
@@ -1114,384 +1248,106 @@ zod.z.object({
1114
1248
  popularity: zod.z.number(),
1115
1249
  primary_color: zod.z.string(),
1116
1250
  request_count: zod.z.string().optional(),
1117
- slug: zod.z.string(),
1118
- zap_usage_count: zod.z.number().nullable().optional()
1119
- });
1120
- var ServiceSchema = zod.z.object({
1121
- id: zod.z.number().optional(),
1122
- canonical_id: zod.z.string().optional(),
1123
- current_implementation_id: zod.z.string(),
1124
- name: zod.z.string(),
1125
- slug: zod.z.string(),
1126
- app_url: zod.z.string().optional(),
1127
- learn_more_url: zod.z.string().optional(),
1128
- description: zod.z.string(),
1129
- primary_color: zod.z.string(),
1130
- popularity: zod.z.number(),
1131
- image: zod.z.string().optional(),
1132
- images: zod.z.string().optional()
1133
- });
1134
- zod.z.object({
1135
- results: zod.z.array(ServiceSchema),
1136
- next: zod.z.string().nullable().optional(),
1137
- previous: zod.z.string().nullable().optional()
1138
- });
1139
- zod.z.object({
1140
- selected_api: zod.z.string(),
1141
- action: zod.z.string(),
1142
- type_of: zod.z.string(),
1143
- authentication_id: zod.z.number().optional(),
1144
- params: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
1145
- });
1146
- zod.z.object({
1147
- success: zod.z.boolean(),
1148
- needs: zod.z.array(NeedSchema).optional(),
1149
- errors: zod.z.array(zod.z.string()).optional(),
1150
- last_fetched_at: zod.z.string().optional(),
1151
- schema: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
1152
- });
1153
- var ImplementationSchema = zod.z.object({
1154
- selected_api: zod.z.string(),
1155
- app_id: zod.z.number().optional(),
1156
- auth_type: zod.z.string().optional(),
1157
- auth_fields: zod.z.string().optional(),
1158
- actions: zod.z.array(ActionSchema).optional(),
1159
- is_deprecated: zod.z.boolean().optional(),
1160
- is_private_only: zod.z.boolean().optional(),
1161
- is_invite_only: zod.z.boolean().optional(),
1162
- is_beta: zod.z.boolean().optional().default(false),
1163
- is_premium: zod.z.boolean().optional().default(false),
1164
- is_hidden: zod.z.string().optional(),
1165
- name: zod.z.string().optional(),
1166
- slug: zod.z.string().optional(),
1167
- images: zod.z.record(zod.z.string(), zod.z.string().nullable()).optional(),
1168
- primary_color: zod.z.string().optional(),
1169
- secondary_color: zod.z.string().optional(),
1170
- current_implementation: zod.z.string().optional(),
1171
- other_implementations: zod.z.string().optional()
1172
- });
1173
- zod.z.object({
1174
- count: zod.z.number(),
1175
- next: zod.z.string().nullable().optional(),
1176
- previous: zod.z.string().nullable().optional(),
1177
- results: zod.z.array(ImplementationSchema)
1178
- });
1179
- var ImplementationMetaSchema2 = zod.z.object({
1180
- id: zod.z.string(),
1181
- // e.g. "100HiresCLIAPI@1.2.1"
1182
- name: zod.z.string(),
1183
- slug: zod.z.string(),
1184
- age_in_days: zod.z.number().optional(),
1185
- auth_type: zod.z.string().optional(),
1186
- banner: zod.z.string().optional(),
1187
- categories: zod.z.array(
1188
- zod.z.object({
1189
- id: zod.z.number(),
1190
- name: zod.z.string(),
1191
- slug: zod.z.string()
1192
- })
1193
- ).optional(),
1194
- images: zod.z.object({
1195
- url_16x16: zod.z.string().optional(),
1196
- url_32x32: zod.z.string().optional(),
1197
- url_64x64: zod.z.string().optional(),
1198
- url_128x128: zod.z.string().optional()
1199
- }).optional(),
1200
- popularity: zod.z.number().optional(),
1201
- has_filters: zod.z.boolean().optional(),
1202
- has_reads: zod.z.boolean().optional(),
1203
- has_searches: zod.z.boolean().optional(),
1204
- has_searches_or_writes: zod.z.boolean().optional(),
1205
- has_upfront_fields: zod.z.boolean().optional(),
1206
- has_writes: zod.z.boolean().optional(),
1207
- is_beta: zod.z.boolean().optional(),
1208
- is_built_in: zod.z.boolean().optional(),
1209
- is_deprecated: zod.z.boolean().optional(),
1210
- is_featured: zod.z.boolean().optional(),
1211
- is_hidden: zod.z.boolean().optional(),
1212
- is_invite: zod.z.boolean().optional(),
1213
- is_premium: zod.z.boolean().optional(),
1214
- is_public: zod.z.boolean().optional(),
1215
- is_upcoming: zod.z.boolean().optional(),
1216
- version: zod.z.string().optional(),
1217
- visibility: zod.z.string().optional(),
1218
- actions: zod.z.object({
1219
- read: zod.z.number().optional(),
1220
- read_bulk: zod.z.number().optional(),
1221
- write: zod.z.number().optional(),
1222
- search: zod.z.number().optional(),
1223
- search_or_write: zod.z.number().optional(),
1224
- search_and_write: zod.z.number().optional(),
1225
- filter: zod.z.number().optional()
1226
- }).optional(),
1227
- description: zod.z.string().optional(),
1228
- primary_color: zod.z.string().optional(),
1229
- secondary_color: zod.z.string().optional(),
1230
- classification: zod.z.string().optional(),
1231
- api_docs_url: zod.z.string().optional(),
1232
- image: zod.z.string().optional()
1233
- });
1234
- zod.z.object({
1235
- count: zod.z.number(),
1236
- next: zod.z.string().nullable().optional(),
1237
- previous: zod.z.string().nullable().optional(),
1238
- results: zod.z.array(ImplementationMetaSchema2)
1239
- });
1240
- var NeedChoicesResponseMetaSchema = zod.z.object({
1241
- page: zod.z.string().nullable().optional()
1242
- });
1243
- var NeedChoicesResponseLinksSchema = zod.z.object({
1244
- next: zod.z.string().nullable().optional(),
1245
- prev: zod.z.string().nullable().optional()
1246
- });
1247
- zod.z.object({
1248
- selected_api: zod.z.string().optional().describe(
1249
- "Something like `SlackAPI` (for Python apps) or `SplitwiseCLIAPI@1.0.0` (for CLI apps). Non-public apps are fine as long as the authed user can access them."
1250
- ),
1251
- authentication_id: zod.z.coerce.number().optional().describe(
1252
- "If the app needs auth, provide an `authentication_id` that has the `selected_api` of the app you want to run. Can be any auth visible to the user (including shared)."
1253
- ),
1254
- params: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe(
1255
- "Object that matches the input the node would normally get. Has all the same keys/types as the `needs` of the action."
1256
- ),
1257
- page: zod.z.number().optional().default(0),
1258
- prefill: zod.z.string().optional().describe(
1259
- "The prefill string to indicate what we're fetching choices for. Likely something like `spreadsheet.id.title`. Must be provided alongside `selected_api` if both `action_id` and `input_field_id` are not."
1260
- ),
1261
- action_id: zod.z.string().optional().describe(
1262
- "The id that will be used to lookup the Action for prefill lookup. If provided, `input_field_id` is required, else `prefill` must be provided."
1263
- ),
1264
- input_field_id: zod.z.string().optional().describe(
1265
- "The id (key) of the input field (Need) that dynamic choices are being retrieved for. If provided, `action_id` is required, else `prefill` must be provided."
1266
- )
1267
- });
1268
- zod.z.object({
1269
- success: zod.z.boolean(),
1270
- choices: zod.z.array(NeedChoicesSchema).optional(),
1271
- next_page: zod.z.number().optional(),
1272
- errors: zod.z.array(zod.z.string()).optional(),
1273
- meta: NeedChoicesResponseMetaSchema.optional(),
1274
- links: NeedChoicesResponseLinksSchema.optional()
1275
- });
1276
-
1277
- // src/utils/string-utils.ts
1278
- function toTitleCase(input) {
1279
- return input.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-]+/g, " ").replace(/\s+/g, " ").trim().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
1280
- }
1281
- function toSnakeCase(input) {
1282
- let result = input.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s\-]+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").toLowerCase();
1283
- if (/^[0-9]/.test(result)) {
1284
- result = "_" + result;
1285
- }
1286
- return result;
1287
- }
1288
- function stripPageSuffix(functionName) {
1289
- return functionName.replace(/Page$/, "");
1290
- }
1291
-
1292
- // src/schemas/App.ts
1293
- var AppItemSchema2 = withFormatter(
1294
- ImplementationMetaSchema2.omit({ name: true, id: true }).extend({
1295
- title: zod.z.string(),
1296
- // Mapped from name
1297
- key: zod.z.string(),
1298
- // Extracted from id (base part without version)
1299
- implementation_id: zod.z.string()
1300
- // Mapped from id (full versioned ID)
1301
- }),
1302
- {
1303
- format: (item) => {
1304
- const additionalKeys = [];
1305
- if (item.slug && item.slug !== item.key) {
1306
- additionalKeys.push(item.slug);
1307
- const snakeCaseSlug = toSnakeCase(item.slug);
1308
- if (snakeCaseSlug !== item.slug && snakeCaseSlug !== item.key) {
1309
- additionalKeys.push(snakeCaseSlug);
1310
- }
1311
- }
1312
- return {
1313
- title: item.title,
1314
- key: item.key,
1315
- keys: [item.key, ...additionalKeys],
1316
- description: item.description,
1317
- details: []
1318
- };
1319
- }
1320
- }
1321
- );
1322
-
1323
- // src/utils/telemetry-utils.ts
1324
- function createTelemetryCallback(emitMethodCalled, methodName) {
1325
- return {
1326
- onMethodCalled: (data) => {
1327
- emitMethodCalled({
1328
- method_name: methodName,
1329
- execution_duration_ms: data.durationMs,
1330
- success_flag: data.success,
1331
- error_message: data.error?.message ?? null,
1332
- error_type: data.error?.constructor.name ?? null,
1333
- argument_count: data.argumentCount,
1334
- is_paginated: data.isPaginated
1335
- });
1336
- }
1337
- };
1338
- }
1339
-
1340
- // src/plugins/listApps/index.ts
1341
- var listAppsPlugin = ({ context }) => {
1342
- async function listAppsPage(options) {
1343
- const { api, resolveAppKeys: resolveAppKeys2 } = context;
1344
- const appKeys = options.appKeys ?? [];
1345
- const appLocators = await resolveAppKeys2({
1346
- appKeys: [...appKeys]
1347
- });
1348
- const implementationNameToLocator = {};
1349
- for (const locator of appLocators) {
1350
- implementationNameToLocator[locator.implementationName] = [
1351
- ...implementationNameToLocator[locator.implementationName] ?? [],
1352
- locator
1353
- ];
1354
- }
1355
- const duplicatedLookupAppKeys = Object.keys(implementationNameToLocator).filter((key) => implementationNameToLocator[key].length > 1).map((key) => implementationNameToLocator[key]).flat().map((locator) => locator.lookupAppKey);
1356
- if (duplicatedLookupAppKeys.length > 0) {
1357
- throw new Error(
1358
- `Duplicate lookup app keys found: ${duplicatedLookupAppKeys.join(", ")}`
1359
- );
1360
- }
1361
- if (appKeys.length > 0 && appLocators.length === 0 && !options.search) {
1362
- return {
1363
- data: [],
1364
- nextCursor: void 0
1365
- };
1366
- }
1367
- const implementationIds = appLocators.map((locator) => {
1368
- const version = locator.version || "latest";
1369
- return `${locator.implementationName}@${version}`;
1370
- });
1371
- return await api.get("/api/v0/apps", {
1372
- searchParams: {
1373
- implementationIds: implementationIds.join(","),
1374
- ...options.search && { search: options.search },
1375
- pageSize: options.pageSize.toString(),
1376
- ...options.cursor && { cursor: options.cursor }
1377
- }
1378
- });
1379
- }
1380
- const methodName = stripPageSuffix(listAppsPage.name);
1381
- const listAppsDefinition = createPaginatedFunction(
1382
- listAppsPage,
1383
- ListAppsOptionsSchema,
1384
- createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
1385
- methodName
1386
- );
1387
- return {
1388
- listApps: listAppsDefinition,
1389
- context: {
1390
- meta: {
1391
- listApps: {
1392
- categories: ["app"],
1393
- type: "list",
1394
- itemType: "App",
1395
- inputSchema: ListAppsOptionsSchema,
1396
- outputSchema: AppItemSchema2
1397
- }
1398
- }
1399
- }
1400
- };
1401
- };
1402
-
1403
- // src/utils/domain-utils.ts
1404
- function splitVersionedKey(versionedKey) {
1405
- const parts = versionedKey.split("@");
1406
- if (parts.length >= 2) {
1407
- const baseKey = parts[0];
1408
- const version = parts.slice(1).join("@");
1409
- return [baseKey, version];
1410
- }
1411
- return [versionedKey, void 0];
1412
- }
1413
- function normalizeImplementationMetaToAppItem(implementationMeta) {
1414
- const [selectedApi, appVersion] = splitVersionedKey(implementationMeta.id);
1415
- const { id, name, ...restOfImplementationMeta } = implementationMeta;
1416
- return {
1417
- ...restOfImplementationMeta,
1418
- title: name,
1419
- key: selectedApi,
1420
- implementation_id: id,
1421
- version: appVersion
1422
- };
1423
- }
1424
- function normalizeActionItem(action) {
1425
- const { name, type, selected_api: selectedApi } = action;
1426
- const [appKey, appVersion] = selectedApi ? splitVersionedKey(selectedApi) : ["", void 0];
1427
- return {
1428
- // Only include the fields we want - explicitly list them
1429
- id: action.id,
1430
- key: action.key,
1431
- description: action.description,
1432
- is_important: action.is_important,
1433
- is_hidden: action.is_hidden,
1434
- // Transformed fields
1435
- app_key: appKey,
1436
- app_version: appVersion,
1437
- action_type: type,
1438
- title: name,
1439
- // Map name to title
1440
- type: "action"
1441
- };
1442
- }
1443
- function isSlug(slug) {
1444
- return !!slug.match(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
1445
- }
1446
- function isSnakeCasedSlug(slug) {
1447
- if (slug.match(/^_[0-9]/)) {
1448
- slug = slug.slice(1);
1449
- }
1450
- return !!slug.match(/^[a-z0-9]+(?:_[a-z0-9]+)*$/);
1451
- }
1452
- function dashifySnakeCasedSlug(slug) {
1453
- if (!isSnakeCasedSlug(slug)) {
1454
- return slug;
1455
- }
1456
- if (slug.startsWith("_")) {
1457
- slug = slug.slice(1);
1458
- }
1459
- return slug.replace(/_/g, "-");
1460
- }
1461
- function isUuid(appKey) {
1462
- return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
1463
- appKey
1464
- );
1465
- }
1466
- function toAppLocator(appKey) {
1467
- const [appKeyWithoutVersion, version] = splitVersionedKey(appKey);
1468
- if (isUuid(appKeyWithoutVersion)) {
1469
- throw new Error(
1470
- `UUID app keys are not supported. Use app slug or implementation ID instead of: ${appKey}`
1471
- );
1472
- }
1473
- const slug = isSlug(appKeyWithoutVersion) ? appKeyWithoutVersion : isSnakeCasedSlug(appKeyWithoutVersion) ? dashifySnakeCasedSlug(appKeyWithoutVersion) : void 0;
1474
- return {
1475
- lookupAppKey: appKeyWithoutVersion,
1476
- slug,
1477
- implementationName: slug ? void 0 : appKeyWithoutVersion,
1478
- version
1479
- };
1480
- }
1481
- function isResolvedAppLocator(appLocator) {
1482
- return !!appLocator.implementationName;
1483
- }
1484
- var ListActionsSchema = zod.z.object({
1485
- appKey: AppKeyPropertySchema.describe(
1486
- "App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"
1251
+ slug: zod.z.string(),
1252
+ zap_usage_count: zod.z.number().nullable().optional()
1253
+ });
1254
+ var ServiceSchema = zod.z.object({
1255
+ id: zod.z.number().optional(),
1256
+ canonical_id: zod.z.string().optional(),
1257
+ current_implementation_id: zod.z.string(),
1258
+ name: zod.z.string(),
1259
+ slug: zod.z.string(),
1260
+ app_url: zod.z.string().optional(),
1261
+ learn_more_url: zod.z.string().optional(),
1262
+ description: zod.z.string(),
1263
+ primary_color: zod.z.string(),
1264
+ popularity: zod.z.number(),
1265
+ image: zod.z.string().optional(),
1266
+ images: zod.z.string().optional()
1267
+ });
1268
+ zod.z.object({
1269
+ results: zod.z.array(ServiceSchema),
1270
+ next: zod.z.string().nullable().optional(),
1271
+ previous: zod.z.string().nullable().optional()
1272
+ });
1273
+ zod.z.object({
1274
+ selected_api: zod.z.string(),
1275
+ action: zod.z.string(),
1276
+ type_of: zod.z.string(),
1277
+ authentication_id: zod.z.number().optional(),
1278
+ params: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
1279
+ });
1280
+ zod.z.object({
1281
+ success: zod.z.boolean(),
1282
+ needs: zod.z.array(NeedSchema).optional(),
1283
+ errors: zod.z.array(zod.z.string()).optional(),
1284
+ last_fetched_at: zod.z.string().optional(),
1285
+ schema: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
1286
+ });
1287
+ var ImplementationSchema = zod.z.object({
1288
+ selected_api: zod.z.string(),
1289
+ app_id: zod.z.number().optional(),
1290
+ auth_type: zod.z.string().optional(),
1291
+ auth_fields: zod.z.string().optional(),
1292
+ actions: zod.z.array(ActionSchema).optional(),
1293
+ is_deprecated: zod.z.boolean().optional(),
1294
+ is_private_only: zod.z.boolean().optional(),
1295
+ is_invite_only: zod.z.boolean().optional(),
1296
+ is_beta: zod.z.boolean().optional().default(false),
1297
+ is_premium: zod.z.boolean().optional().default(false),
1298
+ is_hidden: zod.z.string().optional(),
1299
+ name: zod.z.string().optional(),
1300
+ slug: zod.z.string().optional(),
1301
+ images: zod.z.record(zod.z.string(), zod.z.string().nullable()).optional(),
1302
+ primary_color: zod.z.string().optional(),
1303
+ secondary_color: zod.z.string().optional(),
1304
+ current_implementation: zod.z.string().optional(),
1305
+ other_implementations: zod.z.string().optional()
1306
+ });
1307
+ zod.z.object({
1308
+ count: zod.z.number(),
1309
+ next: zod.z.string().nullable().optional(),
1310
+ previous: zod.z.string().nullable().optional(),
1311
+ results: zod.z.array(ImplementationSchema)
1312
+ });
1313
+ var NeedChoicesResponseMetaSchema = zod.z.object({
1314
+ page: zod.z.string().nullable().optional()
1315
+ });
1316
+ var NeedChoicesResponseLinksSchema = zod.z.object({
1317
+ next: zod.z.string().nullable().optional(),
1318
+ prev: zod.z.string().nullable().optional()
1319
+ });
1320
+ zod.z.object({
1321
+ selected_api: zod.z.string().optional().describe(
1322
+ "Something like `SlackAPI` (for Python apps) or `SplitwiseCLIAPI@1.0.0` (for CLI apps). Non-public apps are fine as long as the authed user can access them."
1487
1323
  ),
1488
- actionType: ActionTypePropertySchema.optional().describe(
1489
- "Filter actions by type"
1324
+ authentication_id: zod.z.coerce.number().optional().describe(
1325
+ "If the app needs auth, provide an `authentication_id` that has the `selected_api` of the app you want to run. Can be any auth visible to the user (including shared)."
1490
1326
  ),
1491
- pageSize: zod.z.number().min(1).optional().describe("Number of actions per page"),
1492
- maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
1493
- cursor: zod.z.string().optional().describe("Cursor to start from")
1494
- }).merge(TelemetryMarkerSchema).describe("List all actions for a specific app");
1327
+ params: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe(
1328
+ "Object that matches the input the node would normally get. Has all the same keys/types as the `needs` of the action."
1329
+ ),
1330
+ page: zod.z.number().optional().default(0),
1331
+ prefill: zod.z.string().optional().describe(
1332
+ "The prefill string to indicate what we're fetching choices for. Likely something like `spreadsheet.id.title`. Must be provided alongside `selected_api` if both `action_id` and `input_field_id` are not."
1333
+ ),
1334
+ action_id: zod.z.string().optional().describe(
1335
+ "The id that will be used to lookup the Action for prefill lookup. If provided, `input_field_id` is required, else `prefill` must be provided."
1336
+ ),
1337
+ input_field_id: zod.z.string().optional().describe(
1338
+ "The id (key) of the input field (Need) that dynamic choices are being retrieved for. If provided, `action_id` is required, else `prefill` must be provided."
1339
+ )
1340
+ });
1341
+ zod.z.object({
1342
+ success: zod.z.boolean(),
1343
+ choices: zod.z.array(NeedChoicesSchema).optional(),
1344
+ next_page: zod.z.number().optional(),
1345
+ errors: zod.z.array(zod.z.string()).optional(),
1346
+ meta: NeedChoicesResponseMetaSchema.optional(),
1347
+ links: NeedChoicesResponseLinksSchema.optional()
1348
+ });
1349
+
1350
+ // src/schemas/Action.ts
1495
1351
  var ActionItemSchema = withFormatter(
1496
1352
  ActionSchema.omit({ type: true, name: true, selected_api: true }).extend({
1497
1353
  app_key: zod.z.string(),
@@ -2261,6 +2117,9 @@ var listAuthenticationsPlugin = ({ context }) => {
2261
2117
  if (options.owner) {
2262
2118
  searchParams.owner = options.owner;
2263
2119
  }
2120
+ if (options.isExpired !== void 0) {
2121
+ searchParams.isExpired = options.isExpired.toString();
2122
+ }
2264
2123
  if (options.cursor) {
2265
2124
  searchParams.offset = options.cursor;
2266
2125
  }
@@ -2352,7 +2211,7 @@ var getAppPlugin = ({ sdk, context }) => {
2352
2211
  type: "item",
2353
2212
  itemType: "App",
2354
2213
  inputSchema: GetAppSchema,
2355
- outputSchema: AppItemSchema2,
2214
+ outputSchema: AppItemSchema,
2356
2215
  resolvers: {
2357
2216
  appKey: appKeyResolver
2358
2217
  }
@@ -2442,14 +2301,14 @@ var getAuthenticationPlugin = ({ context }) => {
2442
2301
  }
2443
2302
  };
2444
2303
  };
2445
- var FindFirstAuthenticationSchema = zod.z.object({
2446
- appKey: AppKeyPropertySchema.optional().describe(
2447
- "App key of authentication to find (e.g., 'SlackCLIAPI' or slug like 'github')"
2448
- ),
2449
- search: zod.z.string().optional().describe("Search term to filter authentications by title"),
2450
- title: zod.z.string().optional().describe("Filter authentications by exact title match"),
2451
- accountId: zod.z.string().optional().describe("Filter by account ID"),
2452
- owner: zod.z.string().optional().describe("Filter by owner")
2304
+
2305
+ // src/plugins/findFirstAuthentication/schemas.ts
2306
+ var FindFirstAuthenticationSchema = ListAuthenticationsQuerySchema.omit({
2307
+ authenticationIds: true,
2308
+ pageSize: true,
2309
+ maxItems: true,
2310
+ cursor: true,
2311
+ _telemetry: true
2453
2312
  }).describe("Find the first authentication matching the criteria");
2454
2313
 
2455
2314
  // src/plugins/findFirstAuthentication/index.ts
@@ -2493,14 +2352,14 @@ var findFirstAuthenticationPlugin = ({ sdk, context }) => {
2493
2352
  }
2494
2353
  };
2495
2354
  };
2496
- var FindUniqueAuthenticationSchema = zod.z.object({
2497
- appKey: AppKeyPropertySchema.optional().describe(
2498
- "App key of authentication to find (e.g., 'SlackCLIAPI' or slug like 'github')"
2499
- ),
2500
- search: zod.z.string().optional().describe("Search term to filter authentications by title"),
2501
- title: zod.z.string().optional().describe("Filter authentications by exact title match"),
2502
- accountId: zod.z.string().optional().describe("Filter by account ID"),
2503
- owner: zod.z.string().optional().describe("Filter by owner")
2355
+
2356
+ // src/plugins/findUniqueAuthentication/schemas.ts
2357
+ var FindUniqueAuthenticationSchema = ListAuthenticationsQuerySchema.omit({
2358
+ authenticationIds: true,
2359
+ pageSize: true,
2360
+ maxItems: true,
2361
+ cursor: true,
2362
+ _telemetry: true
2504
2363
  }).describe("Find a unique authentication matching the criteria");
2505
2364
 
2506
2365
  // src/plugins/findUniqueAuthentication/index.ts
@@ -2903,8 +2762,11 @@ async function readManifestFromFile(filePath) {
2903
2762
  const resolvedPath = await resolve(filePath);
2904
2763
  const content = await readFile(resolvedPath);
2905
2764
  return parseManifestContent(content, resolvedPath);
2906
- } catch {
2907
- console.warn(`\u26A0\uFE0F Failed to read manifest from ${filePath}`);
2765
+ } catch (error) {
2766
+ const isFileNotFound = error && typeof error === "object" && "code" in error && error.code === "ENOENT" || error instanceof Error && error.message.includes("File not found");
2767
+ if (!isFileNotFound) {
2768
+ console.warn(`\u26A0\uFE0F Failed to read manifest from ${filePath}`);
2769
+ }
2908
2770
  return null;
2909
2771
  }
2910
2772
  }
@@ -3617,36 +3479,29 @@ async function pollUntilComplete(options) {
3617
3479
  }
3618
3480
  }
3619
3481
 
3620
- // src/auth.ts
3621
- function getTokenFromEnv() {
3622
- return process.env.ZAPIER_TOKEN;
3482
+ // src/types/credentials.ts
3483
+ function isClientCredentials(credentials) {
3484
+ return typeof credentials === "object" && credentials !== null && "clientId" in credentials && "clientSecret" in credentials;
3623
3485
  }
3624
- async function getTokenFromCliLogin(options = {}) {
3625
- try {
3626
- const { getToken } = await import('@zapier/zapier-sdk-cli-login');
3627
- return await getToken(options);
3628
- } catch {
3629
- return void 0;
3630
- }
3486
+ function isPkceCredentials(credentials) {
3487
+ return typeof credentials === "object" && credentials !== null && "clientId" in credentials && !("clientSecret" in credentials);
3631
3488
  }
3632
- async function getTokenFromEnvOrConfig(options = {}) {
3633
- const envToken = getTokenFromEnv();
3634
- if (envToken) {
3635
- return envToken;
3636
- }
3637
- return getTokenFromCliLogin(options);
3489
+ function isCredentialsObject(credentials) {
3490
+ return typeof credentials === "object" && credentials !== null && "clientId" in credentials;
3638
3491
  }
3639
- async function resolveAuthToken(options = {}) {
3640
- if (options.token) {
3641
- return options.token;
3642
- }
3643
- if (options.getToken) {
3644
- const token = await options.getToken();
3645
- if (token) {
3646
- return token;
3647
- }
3648
- }
3649
- return getTokenFromEnvOrConfig(options);
3492
+ function isCredentialsFunction(credentials) {
3493
+ return typeof credentials === "function";
3494
+ }
3495
+
3496
+ // src/utils/logging.ts
3497
+ var loggedDeprecations = /* @__PURE__ */ new Set();
3498
+ function logDeprecation(message) {
3499
+ if (loggedDeprecations.has(message)) return;
3500
+ loggedDeprecations.add(message);
3501
+ console.warn(`[zapier-sdk] Deprecation: ${message}`);
3502
+ }
3503
+ function resetDeprecationWarnings() {
3504
+ loggedDeprecations.clear();
3650
3505
  }
3651
3506
 
3652
3507
  // src/utils/url-utils.ts
@@ -3695,174 +3550,276 @@ function getTrackingBaseUrl({
3695
3550
  return ZAPIER_BASE_URL;
3696
3551
  }
3697
3552
 
3698
- // src/temporary-internal-core/utils/string-utils.ts
3699
- function splitVersionedKey2(versionedKey) {
3700
- const parts = versionedKey.split("@");
3701
- if (parts.length >= 2) {
3702
- const baseKey = parts[0];
3703
- const version = parts.slice(1).join("@");
3704
- return [baseKey, version];
3705
- }
3706
- return [versionedKey, void 0];
3553
+ // src/credentials.ts
3554
+ function deriveAuthBaseUrl(sdkBaseUrl) {
3555
+ if (!sdkBaseUrl) return void 0;
3556
+ return getZapierBaseUrl(sdkBaseUrl);
3707
3557
  }
3708
-
3709
- // src/temporary-internal-core/utils/transformations.ts
3710
- function transformImplementationMetaToAppItem(implementationMeta) {
3711
- const [selectedApi, appVersion] = splitVersionedKey2(implementationMeta.id);
3712
- const { id, name, ...restOfImplementationMeta } = implementationMeta;
3558
+ function normalizeCredentialsObject(obj, sdkBaseUrl) {
3559
+ const resolvedBaseUrl = obj.baseUrl || deriveAuthBaseUrl(sdkBaseUrl);
3560
+ if (obj.type === "client_credentials" || "clientSecret" in obj && obj.clientSecret) {
3561
+ return {
3562
+ type: "client_credentials",
3563
+ clientId: obj.clientId,
3564
+ clientSecret: obj.clientSecret,
3565
+ baseUrl: resolvedBaseUrl,
3566
+ scope: obj.scope
3567
+ };
3568
+ }
3713
3569
  return {
3714
- ...restOfImplementationMeta,
3715
- title: name,
3716
- key: selectedApi,
3717
- implementation_id: id,
3718
- version: appVersion
3570
+ type: "pkce",
3571
+ clientId: obj.clientId,
3572
+ baseUrl: resolvedBaseUrl,
3573
+ scope: obj.scope
3719
3574
  };
3720
3575
  }
3721
- function extractPaginationCursor(response) {
3722
- if (!response.next) {
3723
- return void 0;
3724
- }
3725
- try {
3726
- const url = new URL(response.next);
3727
- const offset = url.searchParams.get("offset");
3728
- return offset || void 0;
3729
- } catch {
3730
- return void 0;
3576
+ function resolveCredentialsFromEnv(sdkBaseUrl) {
3577
+ if (ZAPIER_CREDENTIALS) {
3578
+ return ZAPIER_CREDENTIALS;
3731
3579
  }
3732
- }
3733
-
3734
- // src/temporary-internal-core/handlers/listApps.ts
3735
- var DEFAULT_PAGE_SIZE = 20;
3736
- async function augmentWithSearchResults({
3737
- searchTerm,
3738
- implementationIds,
3739
- httpClient
3740
- }) {
3741
- const searchResponse = await httpClient.get(
3742
- "/zapier/api/v4/implementations-meta/search/",
3743
- {
3744
- searchParams: { term: searchTerm }
3745
- }
3746
- );
3747
- const byImplementationName = /* @__PURE__ */ new Map();
3748
- for (const result of searchResponse.results) {
3749
- const [implementationName] = splitVersionedKey2(result.id);
3750
- const isPublic = result.visibility === "public";
3751
- const existing = byImplementationName.get(implementationName);
3752
- if (!existing || isPublic && !existing.isPublic) {
3753
- byImplementationName.set(implementationName, { result, isPublic });
3580
+ if (ZAPIER_CREDENTIALS_CLIENT_ID) {
3581
+ const resolvedBaseUrl = ZAPIER_CREDENTIALS_BASE_URL || deriveAuthBaseUrl(sdkBaseUrl);
3582
+ if (ZAPIER_CREDENTIALS_CLIENT_SECRET) {
3583
+ return {
3584
+ type: "client_credentials",
3585
+ clientId: ZAPIER_CREDENTIALS_CLIENT_ID,
3586
+ clientSecret: ZAPIER_CREDENTIALS_CLIENT_SECRET,
3587
+ baseUrl: resolvedBaseUrl,
3588
+ scope: ZAPIER_CREDENTIALS_SCOPE
3589
+ };
3590
+ } else {
3591
+ return {
3592
+ type: "pkce",
3593
+ clientId: ZAPIER_CREDENTIALS_CLIENT_ID,
3594
+ baseUrl: resolvedBaseUrl,
3595
+ scope: ZAPIER_CREDENTIALS_SCOPE
3596
+ };
3754
3597
  }
3755
3598
  }
3756
- const searchResults = Array.from(byImplementationName.values()).map(
3757
- (entry) => transformImplementationMetaToAppItem(entry.result)
3758
- );
3759
- const implementationNameSet = new Set(
3760
- implementationIds.map((id) => {
3761
- const [name] = splitVersionedKey2(id);
3762
- return name;
3763
- })
3764
- );
3765
- const additionalIds = [];
3766
- for (const result of searchResults) {
3767
- const [implementationName] = splitVersionedKey2(result.key);
3768
- if (!implementationNameSet.has(implementationName)) {
3769
- implementationNameSet.add(implementationName);
3770
- additionalIds.push(result.implementation_id);
3599
+ if (ZAPIER_TOKEN) {
3600
+ logDeprecation(
3601
+ "ZAPIER_TOKEN is deprecated. Use ZAPIER_CREDENTIALS instead."
3602
+ );
3603
+ return ZAPIER_TOKEN;
3604
+ }
3605
+ if (ZAPIER_AUTH_CLIENT_ID) {
3606
+ logDeprecation(
3607
+ "ZAPIER_AUTH_CLIENT_ID is deprecated. Use ZAPIER_CREDENTIALS_CLIENT_ID instead."
3608
+ );
3609
+ if (ZAPIER_AUTH_BASE_URL) {
3610
+ logDeprecation(
3611
+ "ZAPIER_AUTH_BASE_URL is deprecated. Use ZAPIER_CREDENTIALS_BASE_URL instead."
3612
+ );
3771
3613
  }
3614
+ const resolvedBaseUrl = ZAPIER_AUTH_BASE_URL || deriveAuthBaseUrl(sdkBaseUrl);
3615
+ return {
3616
+ type: "pkce",
3617
+ clientId: ZAPIER_AUTH_CLIENT_ID,
3618
+ baseUrl: resolvedBaseUrl
3619
+ };
3772
3620
  }
3773
- return [...implementationIds, ...additionalIds];
3621
+ return void 0;
3774
3622
  }
3775
- var handleListApps = async ({ request, deps }) => {
3776
- const validatedRequest = ListAppsHandlerRequestSchema.parse(request);
3777
- const { httpClient } = deps;
3778
- let { implementationIds } = validatedRequest;
3779
- const pageSize = validatedRequest.pageSize ?? DEFAULT_PAGE_SIZE;
3780
- if (validatedRequest.search) {
3781
- implementationIds = await augmentWithSearchResults({
3782
- searchTerm: validatedRequest.search,
3783
- implementationIds,
3784
- httpClient
3785
- });
3786
- }
3787
- if (implementationIds.length === 0) {
3788
- if (validatedRequest.search) {
3789
- return {
3790
- data: [],
3791
- nextCursor: void 0
3792
- };
3623
+ async function resolveCredentials(options = {}) {
3624
+ const { baseUrl } = options;
3625
+ if (options.credentials !== void 0) {
3626
+ if (isCredentialsFunction(options.credentials)) {
3627
+ const resolved = await options.credentials();
3628
+ if (typeof resolved === "function") {
3629
+ throw new Error(
3630
+ "Credentials function returned another function. Credentials functions must return a string or credentials object."
3631
+ );
3632
+ }
3633
+ if (isCredentialsObject(resolved)) {
3634
+ return normalizeCredentialsObject(resolved, baseUrl);
3635
+ }
3636
+ return resolved;
3793
3637
  }
3794
- const searchParams2 = {
3795
- latest_only: "true",
3796
- selected_apis: "",
3797
- limit: pageSize.toString()
3798
- };
3799
- if (validatedRequest.cursor) {
3800
- searchParams2.offset = validatedRequest.cursor;
3638
+ if (isCredentialsObject(options.credentials)) {
3639
+ return normalizeCredentialsObject(options.credentials, baseUrl);
3801
3640
  }
3802
- const implementationsResponse2 = await httpClient.get(
3803
- "/zapier/api/v4/implementations-meta/lookup/",
3804
- {
3805
- searchParams: searchParams2
3806
- }
3641
+ return options.credentials;
3642
+ }
3643
+ if (options.token !== void 0) {
3644
+ logDeprecation(
3645
+ "The `token` option is deprecated. Use `credentials` instead."
3807
3646
  );
3808
- return {
3809
- data: implementationsResponse2.results.map(
3810
- transformImplementationMetaToAppItem
3811
- ),
3812
- nextCursor: extractPaginationCursor(implementationsResponse2)
3813
- };
3647
+ return options.token;
3814
3648
  }
3815
- const searchParams = {
3816
- selected_apis: implementationIds.join(","),
3817
- limit: pageSize.toString()
3818
- };
3819
- if (validatedRequest.cursor) {
3820
- searchParams.offset = validatedRequest.cursor;
3649
+ const envCredentials = resolveCredentialsFromEnv(baseUrl);
3650
+ if (envCredentials !== void 0) {
3651
+ return envCredentials;
3821
3652
  }
3822
- const implementationsResponse = await httpClient.get(
3823
- "/zapier/api/v4/implementations-meta/lookup/",
3824
- {
3825
- searchParams
3826
- }
3827
- );
3828
- return {
3829
- data: implementationsResponse.results.map(
3830
- transformImplementationMetaToAppItem
3831
- ),
3832
- nextCursor: extractPaginationCursor(implementationsResponse)
3833
- };
3834
- };
3653
+ return void 0;
3654
+ }
3655
+ function getBaseUrlFromCredentials(credentials) {
3656
+ if (credentials && isCredentialsObject(credentials)) {
3657
+ return credentials.baseUrl;
3658
+ }
3659
+ return void 0;
3660
+ }
3661
+ function getClientIdFromCredentials(credentials) {
3662
+ if (credentials && isCredentialsObject(credentials)) {
3663
+ return credentials.clientId;
3664
+ }
3665
+ return void 0;
3666
+ }
3835
3667
 
3836
- // src/api/router.ts
3837
- var routes = [
3838
- {
3839
- method: "GET",
3840
- pattern: /^\/api\/v0\/apps$/,
3841
- handler: handleListApps,
3842
- paramMap: []
3668
+ // src/auth.ts
3669
+ var tokenCache = /* @__PURE__ */ new Map();
3670
+ var pendingExchanges = /* @__PURE__ */ new Map();
3671
+ function clearTokenCache() {
3672
+ tokenCache.clear();
3673
+ pendingExchanges.clear();
3674
+ }
3675
+ var TOKEN_EXPIRATION_BUFFER = 5 * 60 * 1e3;
3676
+ function getCachedToken(clientId) {
3677
+ const cached = tokenCache.get(clientId);
3678
+ if (!cached) return void 0;
3679
+ if (cached.expiresAt > Date.now() + TOKEN_EXPIRATION_BUFFER) {
3680
+ return cached.accessToken;
3681
+ }
3682
+ tokenCache.delete(clientId);
3683
+ return void 0;
3684
+ }
3685
+ function cacheToken(clientId, accessToken, expiresIn) {
3686
+ tokenCache.set(clientId, {
3687
+ accessToken,
3688
+ expiresAt: Date.now() + expiresIn * 1e3
3689
+ });
3690
+ }
3691
+ function invalidateCachedToken(clientId) {
3692
+ tokenCache.delete(clientId);
3693
+ }
3694
+ function getTokenEndpointUrl(baseUrl) {
3695
+ const base = baseUrl || ZAPIER_BASE_URL;
3696
+ return `${base}/oauth/token/`;
3697
+ }
3698
+ async function exchangeClientCredentials(options) {
3699
+ const { clientId, clientSecret, baseUrl, scope, onEvent } = options;
3700
+ const fetchFn = options.fetch || globalThis.fetch;
3701
+ const tokenUrl = getTokenEndpointUrl(baseUrl);
3702
+ onEvent?.({
3703
+ type: "auth_exchanging",
3704
+ payload: {
3705
+ message: "Exchanging client credentials for token...",
3706
+ operation: "client_credentials"
3707
+ },
3708
+ timestamp: Date.now()
3709
+ });
3710
+ const response = await fetchFn(tokenUrl, {
3711
+ method: "POST",
3712
+ headers: {
3713
+ "Content-Type": "application/x-www-form-urlencoded"
3714
+ },
3715
+ body: new URLSearchParams({
3716
+ grant_type: "client_credentials",
3717
+ client_id: clientId,
3718
+ client_secret: clientSecret,
3719
+ scope: scope || "external",
3720
+ audience: "zapier.com"
3721
+ })
3722
+ });
3723
+ if (!response.ok) {
3724
+ const errorText = await response.text();
3725
+ onEvent?.({
3726
+ type: "auth_error",
3727
+ payload: {
3728
+ message: `Client credentials exchange failed: ${response.status}`,
3729
+ error: errorText,
3730
+ operation: "client_credentials"
3731
+ },
3732
+ timestamp: Date.now()
3733
+ });
3734
+ throw new Error(
3735
+ `Client credentials exchange failed: ${response.status} ${response.statusText}`
3736
+ );
3843
3737
  }
3844
- ];
3845
- function findMatchingRoute(routeList, method, path) {
3846
- for (const route of routeList) {
3847
- if (route.method !== method) {
3848
- continue;
3849
- }
3850
- const match = path.match(route.pattern);
3851
- if (match) {
3852
- const params = {};
3853
- route.paramMap.forEach((name, index) => {
3854
- params[name] = match[index + 1];
3855
- });
3856
- return {
3857
- handler: route.handler,
3858
- params
3859
- };
3738
+ const data = await response.json();
3739
+ if (!data.access_token) {
3740
+ throw new Error("Client credentials response missing access_token");
3741
+ }
3742
+ const expiresIn = data.expires_in || 3600;
3743
+ cacheToken(clientId, data.access_token, expiresIn);
3744
+ onEvent?.({
3745
+ type: "auth_success",
3746
+ payload: {
3747
+ message: "Client credentials exchange successful",
3748
+ operation: "client_credentials"
3749
+ },
3750
+ timestamp: Date.now()
3751
+ });
3752
+ return data.access_token;
3753
+ }
3754
+ async function getTokenFromCliLogin(options) {
3755
+ try {
3756
+ const cliLogin = await import('@zapier/zapier-sdk-cli-login');
3757
+ return await cliLogin.getToken(options);
3758
+ } catch {
3759
+ return void 0;
3760
+ }
3761
+ }
3762
+ async function resolveAuthToken(options = {}) {
3763
+ const credentials = await resolveCredentials({
3764
+ credentials: options.credentials,
3765
+ token: options.token
3766
+ });
3767
+ if (credentials !== void 0) {
3768
+ return resolveAuthTokenFromCredentials(credentials, options);
3769
+ }
3770
+ return getTokenFromCliLogin({
3771
+ onEvent: options.onEvent,
3772
+ fetch: options.fetch
3773
+ });
3774
+ }
3775
+ async function resolveAuthTokenFromCredentials(credentials, options) {
3776
+ if (typeof credentials === "string") {
3777
+ return credentials;
3778
+ }
3779
+ if (isClientCredentials(credentials)) {
3780
+ const { clientId } = credentials;
3781
+ const cached = getCachedToken(clientId);
3782
+ if (cached) {
3783
+ return cached;
3784
+ }
3785
+ const pending = pendingExchanges.get(clientId);
3786
+ if (pending) {
3787
+ return pending;
3788
+ }
3789
+ const exchangePromise = exchangeClientCredentials({
3790
+ clientId: credentials.clientId,
3791
+ clientSecret: credentials.clientSecret,
3792
+ baseUrl: credentials.baseUrl || options.baseUrl,
3793
+ scope: credentials.scope,
3794
+ fetch: options.fetch,
3795
+ onEvent: options.onEvent
3796
+ }).finally(() => {
3797
+ pendingExchanges.delete(clientId);
3798
+ });
3799
+ pendingExchanges.set(clientId, exchangePromise);
3800
+ return exchangePromise;
3801
+ }
3802
+ if (isPkceCredentials(credentials)) {
3803
+ const storedToken = await getTokenFromCliLogin({
3804
+ onEvent: options.onEvent,
3805
+ fetch: options.fetch,
3806
+ credentials
3807
+ });
3808
+ if (storedToken) {
3809
+ return storedToken;
3860
3810
  }
3811
+ throw new Error(
3812
+ "PKCE credentials require interactive login. Please run the 'login' command with the CLI first, or use client_credentials flow."
3813
+ );
3861
3814
  }
3862
- return null;
3815
+ throw new Error("Unknown credentials type");
3863
3816
  }
3864
- function matchRoute(method, path) {
3865
- return findMatchingRoute(routes, method, path);
3817
+ async function invalidateCredentialsToken(options) {
3818
+ const resolved = await resolveCredentials(options);
3819
+ const clientId = getClientIdFromCredentials(resolved);
3820
+ if (clientId) {
3821
+ invalidateCachedToken(clientId);
3822
+ }
3866
3823
  }
3867
3824
 
3868
3825
  // src/api/client.ts
@@ -3922,13 +3879,11 @@ var ZapierApiClient = class {
3922
3879
  // Helper to get a token from the different places it could be gotten
3923
3880
  async getAuthToken() {
3924
3881
  return resolveAuthToken({
3882
+ credentials: this.options.credentials,
3925
3883
  token: this.options.token,
3926
- getToken: this.options.getToken,
3927
3884
  onEvent: this.options.onEvent,
3928
3885
  fetch: this.options.fetch,
3929
- baseUrl: this.options.baseUrl,
3930
- authBaseUrl: this.options.authBaseUrl,
3931
- authClientId: this.options.authClientId
3886
+ baseUrl: this.options.baseUrl
3932
3887
  });
3933
3888
  }
3934
3889
  // Helper to handle responses
@@ -3966,10 +3921,16 @@ var ZapierApiClient = class {
3966
3921
  if (response.status === 401 || response.status === 403) {
3967
3922
  if (wasMissingAuthToken) {
3968
3923
  throw new ZapierAuthenticationError(
3969
- `Authentication required (HTTP ${response.status}). Please provide a token in options or set ZAPIER_TOKEN environment variable.`,
3924
+ `Authentication required (HTTP ${response.status}). Please provide credentials in options or set ZAPIER_CREDENTIALS environment variable.`,
3970
3925
  errorOptions
3971
3926
  );
3972
3927
  }
3928
+ if (response.status === 401) {
3929
+ await invalidateCredentialsToken({
3930
+ credentials: this.options.credentials,
3931
+ token: this.options.token
3932
+ });
3933
+ }
3973
3934
  throw new ZapierAuthenticationError(message, errorOptions);
3974
3935
  }
3975
3936
  if (response.status === 400) {
@@ -4105,7 +4066,7 @@ var ZapierApiClient = class {
4105
4066
  if (options.authRequired) {
4106
4067
  if (headers.get("Authorization") == null && authToken == null) {
4107
4068
  throw new ZapierAuthenticationError(
4108
- `Authentication required but no token available. Please set ZAPIER_TOKEN, or run the 'login' command with the CLI.`
4069
+ `Authentication required but no credentials available. Please set ZAPIER_CREDENTIALS, or run the 'login' command with the CLI.`
4109
4070
  );
4110
4071
  }
4111
4072
  }
@@ -4113,20 +4074,6 @@ var ZapierApiClient = class {
4113
4074
  }
4114
4075
  // Helper to perform HTTP requests with JSON handling
4115
4076
  async fetchJson(method, path, data, options = {}) {
4116
- const routeMatch = matchRoute(method, path);
4117
- if (routeMatch) {
4118
- const handlerRequest = {
4119
- ...typeof data === "object" ? data : {},
4120
- ...options.searchParams,
4121
- ...routeMatch.params
4122
- };
4123
- return routeMatch.handler({
4124
- request: handlerRequest,
4125
- deps: {
4126
- httpClient: this
4127
- }
4128
- });
4129
- }
4130
4077
  const headers = { ...options.headers };
4131
4078
  if (data && typeof data === "object") {
4132
4079
  headers["Content-Type"] = "application/json";
@@ -4195,27 +4142,28 @@ var apiPlugin = (params) => {
4195
4142
  const {
4196
4143
  fetch: customFetch = globalThis.fetch,
4197
4144
  baseUrl = ZAPIER_BASE_URL,
4198
- authBaseUrl,
4199
- authClientId,
4145
+ credentials,
4200
4146
  token,
4201
- getToken,
4202
4147
  onEvent,
4203
4148
  debug = false
4204
4149
  } = params.context.options;
4205
4150
  const api = createZapierApi({
4206
4151
  baseUrl,
4207
- authBaseUrl,
4208
- authClientId,
4152
+ credentials,
4209
4153
  token,
4210
- getToken,
4211
4154
  debug,
4212
4155
  fetch: customFetch,
4213
4156
  onEvent
4214
4157
  });
4215
4158
  return {
4216
4159
  context: {
4217
- api
4160
+ api,
4218
4161
  // Provide API client in context for other plugins to use
4162
+ resolveCredentials: () => resolveCredentials({
4163
+ credentials,
4164
+ token,
4165
+ baseUrl
4166
+ })
4219
4167
  }
4220
4168
  };
4221
4169
  };
@@ -4809,7 +4757,7 @@ function getCpuTime() {
4809
4757
 
4810
4758
  // package.json
4811
4759
  var package_default = {
4812
- version: "0.18.3"};
4760
+ version: "0.19.0"};
4813
4761
 
4814
4762
  // src/plugins/eventEmission/builders.ts
4815
4763
  function createBaseEvent(context = {}) {
@@ -4982,11 +4930,9 @@ var eventEmissionPlugin = ({ context }) => {
4982
4930
  const getUserContext = (async () => {
4983
4931
  try {
4984
4932
  const token = await resolveAuthToken({
4933
+ credentials: context.options.credentials,
4985
4934
  token: context.options.token,
4986
- getToken: context.options.getToken,
4987
4935
  baseUrl: context.options.baseUrl,
4988
- authBaseUrl: context.options.authBaseUrl,
4989
- authClientId: context.options.authClientId,
4990
4936
  onEvent: context.options.onEvent,
4991
4937
  fetch: context.options.fetch
4992
4938
  });
@@ -5265,7 +5211,15 @@ exports.OutputPropertySchema = OutputPropertySchema;
5265
5211
  exports.ParamsPropertySchema = ParamsPropertySchema;
5266
5212
  exports.RelayFetchSchema = RelayFetchSchema;
5267
5213
  exports.RelayRequestSchema = RelayRequestSchema;
5214
+ exports.ZAPIER_AUTH_BASE_URL = ZAPIER_AUTH_BASE_URL;
5215
+ exports.ZAPIER_AUTH_CLIENT_ID = ZAPIER_AUTH_CLIENT_ID;
5268
5216
  exports.ZAPIER_BASE_URL = ZAPIER_BASE_URL;
5217
+ exports.ZAPIER_CREDENTIALS = ZAPIER_CREDENTIALS;
5218
+ exports.ZAPIER_CREDENTIALS_BASE_URL = ZAPIER_CREDENTIALS_BASE_URL;
5219
+ exports.ZAPIER_CREDENTIALS_CLIENT_ID = ZAPIER_CREDENTIALS_CLIENT_ID;
5220
+ exports.ZAPIER_CREDENTIALS_CLIENT_SECRET = ZAPIER_CREDENTIALS_CLIENT_SECRET;
5221
+ exports.ZAPIER_CREDENTIALS_SCOPE = ZAPIER_CREDENTIALS_SCOPE;
5222
+ exports.ZAPIER_TOKEN = ZAPIER_TOKEN;
5269
5223
  exports.ZapierActionError = ZapierActionError;
5270
5224
  exports.ZapierApiError = ZapierApiError;
5271
5225
  exports.ZapierAppNotFoundError = ZapierAppNotFoundError;
@@ -5290,6 +5244,7 @@ exports.buildApplicationLifecycleEvent = buildApplicationLifecycleEvent;
5290
5244
  exports.buildErrorEvent = buildErrorEvent;
5291
5245
  exports.buildErrorEventWithContext = buildErrorEventWithContext;
5292
5246
  exports.buildMethodCalledEvent = buildMethodCalledEvent;
5247
+ exports.clearTokenCache = clearTokenCache;
5293
5248
  exports.createBaseEvent = createBaseEvent;
5294
5249
  exports.createFunction = createFunction;
5295
5250
  exports.createSdk = createSdk;
@@ -5304,7 +5259,9 @@ exports.generateEventId = generateEventId;
5304
5259
  exports.getActionPlugin = getActionPlugin;
5305
5260
  exports.getAppPlugin = getAppPlugin;
5306
5261
  exports.getAuthenticationPlugin = getAuthenticationPlugin;
5262
+ exports.getBaseUrlFromCredentials = getBaseUrlFromCredentials;
5307
5263
  exports.getCiPlatform = getCiPlatform;
5264
+ exports.getClientIdFromCredentials = getClientIdFromCredentials;
5308
5265
  exports.getCpuTime = getCpuTime;
5309
5266
  exports.getCurrentTimestamp = getCurrentTimestamp;
5310
5267
  exports.getMemoryUsage = getMemoryUsage;
@@ -5314,22 +5271,30 @@ exports.getPreferredManifestEntryKey = getPreferredManifestEntryKey;
5314
5271
  exports.getProfilePlugin = getProfilePlugin;
5315
5272
  exports.getReleaseId = getReleaseId;
5316
5273
  exports.getTokenFromCliLogin = getTokenFromCliLogin;
5317
- exports.getTokenFromEnv = getTokenFromEnv;
5318
- exports.getTokenFromEnvOrConfig = getTokenFromEnvOrConfig;
5319
5274
  exports.inputFieldKeyResolver = inputFieldKeyResolver;
5320
5275
  exports.inputsAllOptionalResolver = inputsAllOptionalResolver;
5321
5276
  exports.inputsResolver = inputsResolver;
5277
+ exports.invalidateCachedToken = invalidateCachedToken;
5278
+ exports.invalidateCredentialsToken = invalidateCredentialsToken;
5322
5279
  exports.isCi = isCi;
5280
+ exports.isClientCredentials = isClientCredentials;
5281
+ exports.isCredentialsFunction = isCredentialsFunction;
5282
+ exports.isCredentialsObject = isCredentialsObject;
5283
+ exports.isPkceCredentials = isPkceCredentials;
5323
5284
  exports.isPositional = isPositional;
5324
5285
  exports.listActionsPlugin = listActionsPlugin;
5325
5286
  exports.listAppsPlugin = listAppsPlugin;
5326
5287
  exports.listAuthenticationsPlugin = listAuthenticationsPlugin;
5327
5288
  exports.listInputFieldsPlugin = listInputFieldsPlugin;
5289
+ exports.logDeprecation = logDeprecation;
5328
5290
  exports.manifestPlugin = manifestPlugin;
5329
5291
  exports.readManifestFromFile = readManifestFromFile;
5330
5292
  exports.registryPlugin = registryPlugin;
5331
5293
  exports.requestPlugin = requestPlugin;
5294
+ exports.resetDeprecationWarnings = resetDeprecationWarnings;
5332
5295
  exports.resolveAuthToken = resolveAuthToken;
5296
+ exports.resolveCredentials = resolveCredentials;
5297
+ exports.resolveCredentialsFromEnv = resolveCredentialsFromEnv;
5333
5298
  exports.runActionPlugin = runActionPlugin;
5334
5299
  exports.toSnakeCase = toSnakeCase;
5335
5300
  exports.toTitleCase = toTitleCase;