@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.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { ListAppsQuerySchema, AppItemSchema as AppItemSchema$1 } from '@zapier/zapier-sdk-core/v0/schemas/apps';
2
3
  import { ListAuthenticationsQuerySchema as ListAuthenticationsQuerySchema$1, AuthenticationItemSchema as AuthenticationItemSchema$1, GetAuthenticationParamSchema } from '@zapier/zapier-sdk-core/v0/schemas/authentications';
3
4
  import { setTimeout as setTimeout$1 } from 'timers/promises';
4
5
  import * as os from 'os';
@@ -35,6 +36,14 @@ function isPositional(schema) {
35
36
  // src/constants.ts
36
37
  var ZAPIER_BASE_URL = process.env.ZAPIER_BASE_URL || "https://zapier.com";
37
38
  var MAX_PAGE_LIMIT = 1e4;
39
+ var ZAPIER_CREDENTIALS = process.env.ZAPIER_CREDENTIALS;
40
+ var ZAPIER_CREDENTIALS_CLIENT_ID = process.env.ZAPIER_CREDENTIALS_CLIENT_ID;
41
+ var ZAPIER_CREDENTIALS_CLIENT_SECRET = process.env.ZAPIER_CREDENTIALS_CLIENT_SECRET;
42
+ var ZAPIER_CREDENTIALS_BASE_URL = process.env.ZAPIER_CREDENTIALS_BASE_URL;
43
+ var ZAPIER_CREDENTIALS_SCOPE = process.env.ZAPIER_CREDENTIALS_SCOPE;
44
+ var ZAPIER_TOKEN = process.env.ZAPIER_TOKEN;
45
+ var ZAPIER_AUTH_BASE_URL = process.env.ZAPIER_AUTH_BASE_URL;
46
+ var ZAPIER_AUTH_CLIENT_ID = process.env.ZAPIER_AUTH_CLIENT_ID;
38
47
 
39
48
  // src/types/properties.ts
40
49
  var AppKeyPropertySchema = withPositional(
@@ -795,105 +804,230 @@ function createPaginatedFunction(coreFn, schema, telemetry, explicitFunctionName
795
804
  };
796
805
  return namedFunctions[functionName];
797
806
  }
798
- var ImplementationMetaSchema = z.object({
799
- id: z.string(),
800
- name: z.string(),
801
- slug: z.string(),
802
- age_in_days: z.number().optional(),
803
- auth_type: z.string().optional(),
804
- banner: z.string().optional(),
805
- categories: z.array(
806
- z.object({
807
- id: z.number(),
808
- name: z.string(),
809
- slug: z.string()
810
- })
811
- ).optional(),
812
- images: z.object({
813
- url_16x16: z.string().optional(),
814
- url_32x32: z.string().optional(),
815
- url_64x64: z.string().optional(),
816
- url_128x128: z.string().optional()
817
- }).optional(),
818
- popularity: z.number().optional(),
819
- has_filters: z.boolean().optional(),
820
- has_reads: z.boolean().optional(),
821
- has_searches: z.boolean().optional(),
822
- has_searches_or_writes: z.boolean().optional(),
823
- has_upfront_fields: z.boolean().optional(),
824
- has_writes: z.boolean().optional(),
825
- is_beta: z.boolean().optional(),
826
- is_built_in: z.boolean().optional(),
827
- is_deprecated: z.boolean().optional(),
828
- is_featured: z.boolean().optional(),
829
- is_hidden: z.boolean().optional(),
830
- is_invite: z.boolean().optional(),
831
- is_premium: z.boolean().optional(),
832
- is_public: z.boolean().optional(),
833
- is_upcoming: z.boolean().optional(),
834
- version: z.string().optional(),
835
- visibility: z.string().optional(),
836
- actions: z.object({
837
- read: z.number().optional(),
838
- read_bulk: z.number().optional(),
839
- write: z.number().optional(),
840
- search: z.number().optional(),
841
- search_or_write: z.number().optional(),
842
- search_and_write: z.number().optional(),
843
- filter: z.number().optional()
844
- }).optional(),
845
- description: z.string().optional(),
846
- primary_color: z.string().optional(),
847
- secondary_color: z.string().optional(),
848
- classification: z.string().optional(),
849
- api_docs_url: z.string().optional(),
850
- image: z.string().optional()
851
- });
852
- z.object({
853
- count: z.number(),
854
- next: z.string().nullable().optional(),
855
- previous: z.string().nullable().optional(),
856
- results: z.array(ImplementationMetaSchema)
857
- });
858
-
859
- // src/temporary-internal-core/schemas/apps/index.ts
860
- var ListAppsOptionsSchema = z.object({
807
+ var ListAppsSchema = ListAppsQuerySchema.omit({
808
+ offset: true
809
+ }).extend({
810
+ // Override appKeys to be an array instead of comma-separated string
861
811
  appKeys: z.array(z.string()).optional().describe(
862
812
  "Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github')"
863
813
  ),
864
- search: z.string().optional().describe("Search for apps by name"),
814
+ // Override pageSize to make optional (base has default value)
865
815
  pageSize: z.number().min(1).optional().describe("Number of apps per page"),
816
+ // SDK specific property for pagination/iterator helpers
866
817
  maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
818
+ // SDK specific property for pagination/iterator helpers
867
819
  cursor: z.string().optional().describe("Cursor to start from")
868
820
  }).merge(TelemetryMarkerSchema).describe("List all available apps with optional filtering");
869
- var AppItemSchema = ImplementationMetaSchema.omit({
870
- name: true,
871
- id: true
872
- }).extend({
873
- title: z.string(),
874
- key: z.string(),
875
- implementation_id: z.string(),
876
- version: z.string().optional()
877
- });
878
- z.object({
879
- data: z.array(AppItemSchema),
880
- nextCursor: z.string().optional()
821
+
822
+ // src/utils/string-utils.ts
823
+ function toTitleCase(input) {
824
+ 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(" ");
825
+ }
826
+ function toSnakeCase(input) {
827
+ let result = input.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s\-]+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").toLowerCase();
828
+ if (/^[0-9]/.test(result)) {
829
+ result = "_" + result;
830
+ }
831
+ return result;
832
+ }
833
+ function stripPageSuffix(functionName) {
834
+ return functionName.replace(/Page$/, "");
835
+ }
836
+
837
+ // src/schemas/App.ts
838
+ var AppItemSchema = withFormatter(AppItemSchema$1, {
839
+ format: (item) => {
840
+ const additionalKeys = [];
841
+ if (item.slug && item.slug !== item.key) {
842
+ additionalKeys.push(item.slug);
843
+ const snakeCaseSlug = toSnakeCase(item.slug);
844
+ if (snakeCaseSlug !== item.slug && snakeCaseSlug !== item.key) {
845
+ additionalKeys.push(snakeCaseSlug);
846
+ }
847
+ }
848
+ return {
849
+ title: item.title,
850
+ key: item.key,
851
+ keys: [item.key, ...additionalKeys],
852
+ description: item.description,
853
+ details: []
854
+ };
855
+ }
881
856
  });
882
- var ListAppsHandlerRequestSchema = z.object({
883
- implementationIds: z.union([z.string(), z.array(z.string())]).optional().describe(
884
- "Pre-resolved implementation IDs - array or comma-separated string"
857
+
858
+ // src/utils/telemetry-utils.ts
859
+ function createTelemetryCallback(emitMethodCalled, methodName) {
860
+ return {
861
+ onMethodCalled: (data) => {
862
+ emitMethodCalled({
863
+ method_name: methodName,
864
+ execution_duration_ms: data.durationMs,
865
+ success_flag: data.success,
866
+ error_message: data.error?.message ?? null,
867
+ error_type: data.error?.constructor.name ?? null,
868
+ argument_count: data.argumentCount,
869
+ is_paginated: data.isPaginated
870
+ });
871
+ }
872
+ };
873
+ }
874
+
875
+ // src/plugins/listApps/index.ts
876
+ var listAppsPlugin = ({ context }) => {
877
+ async function listAppsPage(options) {
878
+ const { api, resolveAppKeys: resolveAppKeys2 } = context;
879
+ const appKeys = options.appKeys ?? [];
880
+ const appLocators = await resolveAppKeys2({
881
+ appKeys: [...appKeys]
882
+ });
883
+ const implementationNameToLocator = {};
884
+ for (const locator of appLocators) {
885
+ implementationNameToLocator[locator.implementationName] = [
886
+ ...implementationNameToLocator[locator.implementationName] ?? [],
887
+ locator
888
+ ];
889
+ }
890
+ const duplicatedLookupAppKeys = Object.keys(implementationNameToLocator).filter((key) => implementationNameToLocator[key].length > 1).map((key) => implementationNameToLocator[key]).flat().map((locator) => locator.lookupAppKey);
891
+ if (duplicatedLookupAppKeys.length > 0) {
892
+ throw new Error(
893
+ `Duplicate lookup app keys found: ${duplicatedLookupAppKeys.join(", ")}`
894
+ );
895
+ }
896
+ if (appKeys.length > 0 && appLocators.length === 0 && !options.search) {
897
+ return {
898
+ data: [],
899
+ links: { next: null },
900
+ meta: { count: 0, limit: 0, offset: 0 }
901
+ };
902
+ }
903
+ const implementationIds = appLocators.map((locator) => {
904
+ const version = locator.version || "latest";
905
+ return `${locator.implementationName}@${version}`;
906
+ });
907
+ return await api.get("/api/v0/apps", {
908
+ searchParams: {
909
+ appKeys: implementationIds.join(","),
910
+ ...options.search && { search: options.search },
911
+ pageSize: options.pageSize.toString(),
912
+ ...options.cursor && { offset: options.cursor }
913
+ }
914
+ });
915
+ }
916
+ const methodName = stripPageSuffix(listAppsPage.name);
917
+ const listAppsDefinition = createPaginatedFunction(
918
+ listAppsPage,
919
+ ListAppsSchema,
920
+ createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
921
+ methodName
922
+ );
923
+ return {
924
+ listApps: listAppsDefinition,
925
+ context: {
926
+ meta: {
927
+ listApps: {
928
+ categories: ["app"],
929
+ type: "list",
930
+ itemType: "App",
931
+ inputSchema: ListAppsSchema,
932
+ outputSchema: AppItemSchema
933
+ }
934
+ }
935
+ }
936
+ };
937
+ };
938
+
939
+ // src/utils/domain-utils.ts
940
+ function splitVersionedKey(versionedKey) {
941
+ const parts = versionedKey.split("@");
942
+ if (parts.length >= 2) {
943
+ const baseKey = parts[0];
944
+ const version = parts.slice(1).join("@");
945
+ return [baseKey, version];
946
+ }
947
+ return [versionedKey, void 0];
948
+ }
949
+ function normalizeImplementationMetaToAppItem(implementationMeta) {
950
+ const [selectedApi, appVersion] = splitVersionedKey(implementationMeta.id);
951
+ const { id, name, ...restOfImplementationMeta } = implementationMeta;
952
+ return {
953
+ ...restOfImplementationMeta,
954
+ title: name,
955
+ key: selectedApi,
956
+ implementation_id: id,
957
+ version: appVersion
958
+ };
959
+ }
960
+ function normalizeActionItem(action) {
961
+ const { name, type, selected_api: selectedApi } = action;
962
+ const [appKey, appVersion] = selectedApi ? splitVersionedKey(selectedApi) : ["", void 0];
963
+ return {
964
+ // Only include the fields we want - explicitly list them
965
+ id: action.id,
966
+ key: action.key,
967
+ description: action.description,
968
+ is_important: action.is_important,
969
+ is_hidden: action.is_hidden,
970
+ // Transformed fields
971
+ app_key: appKey,
972
+ app_version: appVersion,
973
+ action_type: type,
974
+ title: name,
975
+ // Map name to title
976
+ type: "action"
977
+ };
978
+ }
979
+ function isSlug(slug) {
980
+ return !!slug.match(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
981
+ }
982
+ function isSnakeCasedSlug(slug) {
983
+ if (slug.match(/^_[0-9]/)) {
984
+ slug = slug.slice(1);
985
+ }
986
+ return !!slug.match(/^[a-z0-9]+(?:_[a-z0-9]+)*$/);
987
+ }
988
+ function dashifySnakeCasedSlug(slug) {
989
+ if (!isSnakeCasedSlug(slug)) {
990
+ return slug;
991
+ }
992
+ if (slug.startsWith("_")) {
993
+ slug = slug.slice(1);
994
+ }
995
+ return slug.replace(/_/g, "-");
996
+ }
997
+ function isUuid(appKey) {
998
+ return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
999
+ appKey
1000
+ );
1001
+ }
1002
+ function toAppLocator(appKey) {
1003
+ const [appKeyWithoutVersion, version] = splitVersionedKey(appKey);
1004
+ if (isUuid(appKeyWithoutVersion)) {
1005
+ throw new Error(
1006
+ `UUID app keys are not supported. Use app slug or implementation ID instead of: ${appKey}`
1007
+ );
1008
+ }
1009
+ const slug = isSlug(appKeyWithoutVersion) ? appKeyWithoutVersion : isSnakeCasedSlug(appKeyWithoutVersion) ? dashifySnakeCasedSlug(appKeyWithoutVersion) : void 0;
1010
+ return {
1011
+ lookupAppKey: appKeyWithoutVersion,
1012
+ slug,
1013
+ implementationName: slug ? void 0 : appKeyWithoutVersion,
1014
+ version
1015
+ };
1016
+ }
1017
+ function isResolvedAppLocator(appLocator) {
1018
+ return !!appLocator.implementationName;
1019
+ }
1020
+ var ListActionsSchema = z.object({
1021
+ appKey: AppKeyPropertySchema.describe(
1022
+ "App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"
1023
+ ),
1024
+ actionType: ActionTypePropertySchema.optional().describe(
1025
+ "Filter actions by type"
885
1026
  ),
886
- search: z.string().optional().describe("Optional search term to augment results"),
887
- pageSize: z.union([z.string(), z.number()]).optional().describe("Number of apps per page"),
888
- cursor: z.string().optional().describe("Pagination cursor")
889
- }).transform((data) => ({
890
- // Normalize implementationIds to array
891
- implementationIds: typeof data.implementationIds === "string" ? data.implementationIds === "" ? [] : data.implementationIds.split(",") : data.implementationIds ?? [],
892
- search: data.search,
893
- // Normalize pageSize to number
894
- pageSize: typeof data.pageSize === "string" ? parseInt(data.pageSize, 10) : data.pageSize,
895
- cursor: data.cursor
896
- }));
1027
+ pageSize: z.number().min(1).optional().describe("Number of actions per page"),
1028
+ maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
1029
+ cursor: z.string().optional().describe("Cursor to start from")
1030
+ }).merge(TelemetryMarkerSchema).describe("List all actions for a specific app");
897
1031
  var NeedChoicesSchema = z.object({
898
1032
  key: z.string().optional(),
899
1033
  label: z.string().optional(),
@@ -1092,384 +1226,106 @@ z.object({
1092
1226
  popularity: z.number(),
1093
1227
  primary_color: z.string(),
1094
1228
  request_count: z.string().optional(),
1095
- slug: z.string(),
1096
- zap_usage_count: z.number().nullable().optional()
1097
- });
1098
- var ServiceSchema = z.object({
1099
- id: z.number().optional(),
1100
- canonical_id: z.string().optional(),
1101
- current_implementation_id: z.string(),
1102
- name: z.string(),
1103
- slug: z.string(),
1104
- app_url: z.string().optional(),
1105
- learn_more_url: z.string().optional(),
1106
- description: z.string(),
1107
- primary_color: z.string(),
1108
- popularity: z.number(),
1109
- image: z.string().optional(),
1110
- images: z.string().optional()
1111
- });
1112
- z.object({
1113
- results: z.array(ServiceSchema),
1114
- next: z.string().nullable().optional(),
1115
- previous: z.string().nullable().optional()
1116
- });
1117
- z.object({
1118
- selected_api: z.string(),
1119
- action: z.string(),
1120
- type_of: z.string(),
1121
- authentication_id: z.number().optional(),
1122
- params: z.record(z.string(), z.unknown()).optional()
1123
- });
1124
- z.object({
1125
- success: z.boolean(),
1126
- needs: z.array(NeedSchema).optional(),
1127
- errors: z.array(z.string()).optional(),
1128
- last_fetched_at: z.string().optional(),
1129
- schema: z.record(z.string(), z.unknown()).optional()
1130
- });
1131
- var ImplementationSchema = z.object({
1132
- selected_api: z.string(),
1133
- app_id: z.number().optional(),
1134
- auth_type: z.string().optional(),
1135
- auth_fields: z.string().optional(),
1136
- actions: z.array(ActionSchema).optional(),
1137
- is_deprecated: z.boolean().optional(),
1138
- is_private_only: z.boolean().optional(),
1139
- is_invite_only: z.boolean().optional(),
1140
- is_beta: z.boolean().optional().default(false),
1141
- is_premium: z.boolean().optional().default(false),
1142
- is_hidden: z.string().optional(),
1143
- name: z.string().optional(),
1144
- slug: z.string().optional(),
1145
- images: z.record(z.string(), z.string().nullable()).optional(),
1146
- primary_color: z.string().optional(),
1147
- secondary_color: z.string().optional(),
1148
- current_implementation: z.string().optional(),
1149
- other_implementations: z.string().optional()
1150
- });
1151
- z.object({
1152
- count: z.number(),
1153
- next: z.string().nullable().optional(),
1154
- previous: z.string().nullable().optional(),
1155
- results: z.array(ImplementationSchema)
1156
- });
1157
- var ImplementationMetaSchema2 = z.object({
1158
- id: z.string(),
1159
- // e.g. "100HiresCLIAPI@1.2.1"
1160
- name: z.string(),
1161
- slug: z.string(),
1162
- age_in_days: z.number().optional(),
1163
- auth_type: z.string().optional(),
1164
- banner: z.string().optional(),
1165
- categories: z.array(
1166
- z.object({
1167
- id: z.number(),
1168
- name: z.string(),
1169
- slug: z.string()
1170
- })
1171
- ).optional(),
1172
- images: z.object({
1173
- url_16x16: z.string().optional(),
1174
- url_32x32: z.string().optional(),
1175
- url_64x64: z.string().optional(),
1176
- url_128x128: z.string().optional()
1177
- }).optional(),
1178
- popularity: z.number().optional(),
1179
- has_filters: z.boolean().optional(),
1180
- has_reads: z.boolean().optional(),
1181
- has_searches: z.boolean().optional(),
1182
- has_searches_or_writes: z.boolean().optional(),
1183
- has_upfront_fields: z.boolean().optional(),
1184
- has_writes: z.boolean().optional(),
1185
- is_beta: z.boolean().optional(),
1186
- is_built_in: z.boolean().optional(),
1187
- is_deprecated: z.boolean().optional(),
1188
- is_featured: z.boolean().optional(),
1189
- is_hidden: z.boolean().optional(),
1190
- is_invite: z.boolean().optional(),
1191
- is_premium: z.boolean().optional(),
1192
- is_public: z.boolean().optional(),
1193
- is_upcoming: z.boolean().optional(),
1194
- version: z.string().optional(),
1195
- visibility: z.string().optional(),
1196
- actions: z.object({
1197
- read: z.number().optional(),
1198
- read_bulk: z.number().optional(),
1199
- write: z.number().optional(),
1200
- search: z.number().optional(),
1201
- search_or_write: z.number().optional(),
1202
- search_and_write: z.number().optional(),
1203
- filter: z.number().optional()
1204
- }).optional(),
1205
- description: z.string().optional(),
1206
- primary_color: z.string().optional(),
1207
- secondary_color: z.string().optional(),
1208
- classification: z.string().optional(),
1209
- api_docs_url: z.string().optional(),
1210
- image: z.string().optional()
1211
- });
1212
- z.object({
1213
- count: z.number(),
1214
- next: z.string().nullable().optional(),
1215
- previous: z.string().nullable().optional(),
1216
- results: z.array(ImplementationMetaSchema2)
1217
- });
1218
- var NeedChoicesResponseMetaSchema = z.object({
1219
- page: z.string().nullable().optional()
1220
- });
1221
- var NeedChoicesResponseLinksSchema = z.object({
1222
- next: z.string().nullable().optional(),
1223
- prev: z.string().nullable().optional()
1224
- });
1225
- z.object({
1226
- selected_api: z.string().optional().describe(
1227
- "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."
1228
- ),
1229
- authentication_id: z.coerce.number().optional().describe(
1230
- "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)."
1231
- ),
1232
- params: z.record(z.string(), z.unknown()).optional().describe(
1233
- "Object that matches the input the node would normally get. Has all the same keys/types as the `needs` of the action."
1234
- ),
1235
- page: z.number().optional().default(0),
1236
- prefill: z.string().optional().describe(
1237
- "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."
1238
- ),
1239
- action_id: z.string().optional().describe(
1240
- "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."
1241
- ),
1242
- input_field_id: z.string().optional().describe(
1243
- "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."
1244
- )
1245
- });
1246
- z.object({
1247
- success: z.boolean(),
1248
- choices: z.array(NeedChoicesSchema).optional(),
1249
- next_page: z.number().optional(),
1250
- errors: z.array(z.string()).optional(),
1251
- meta: NeedChoicesResponseMetaSchema.optional(),
1252
- links: NeedChoicesResponseLinksSchema.optional()
1253
- });
1254
-
1255
- // src/utils/string-utils.ts
1256
- function toTitleCase(input) {
1257
- 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(" ");
1258
- }
1259
- function toSnakeCase(input) {
1260
- let result = input.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s\-]+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").toLowerCase();
1261
- if (/^[0-9]/.test(result)) {
1262
- result = "_" + result;
1263
- }
1264
- return result;
1265
- }
1266
- function stripPageSuffix(functionName) {
1267
- return functionName.replace(/Page$/, "");
1268
- }
1269
-
1270
- // src/schemas/App.ts
1271
- var AppItemSchema2 = withFormatter(
1272
- ImplementationMetaSchema2.omit({ name: true, id: true }).extend({
1273
- title: z.string(),
1274
- // Mapped from name
1275
- key: z.string(),
1276
- // Extracted from id (base part without version)
1277
- implementation_id: z.string()
1278
- // Mapped from id (full versioned ID)
1279
- }),
1280
- {
1281
- format: (item) => {
1282
- const additionalKeys = [];
1283
- if (item.slug && item.slug !== item.key) {
1284
- additionalKeys.push(item.slug);
1285
- const snakeCaseSlug = toSnakeCase(item.slug);
1286
- if (snakeCaseSlug !== item.slug && snakeCaseSlug !== item.key) {
1287
- additionalKeys.push(snakeCaseSlug);
1288
- }
1289
- }
1290
- return {
1291
- title: item.title,
1292
- key: item.key,
1293
- keys: [item.key, ...additionalKeys],
1294
- description: item.description,
1295
- details: []
1296
- };
1297
- }
1298
- }
1299
- );
1300
-
1301
- // src/utils/telemetry-utils.ts
1302
- function createTelemetryCallback(emitMethodCalled, methodName) {
1303
- return {
1304
- onMethodCalled: (data) => {
1305
- emitMethodCalled({
1306
- method_name: methodName,
1307
- execution_duration_ms: data.durationMs,
1308
- success_flag: data.success,
1309
- error_message: data.error?.message ?? null,
1310
- error_type: data.error?.constructor.name ?? null,
1311
- argument_count: data.argumentCount,
1312
- is_paginated: data.isPaginated
1313
- });
1314
- }
1315
- };
1316
- }
1317
-
1318
- // src/plugins/listApps/index.ts
1319
- var listAppsPlugin = ({ context }) => {
1320
- async function listAppsPage(options) {
1321
- const { api, resolveAppKeys: resolveAppKeys2 } = context;
1322
- const appKeys = options.appKeys ?? [];
1323
- const appLocators = await resolveAppKeys2({
1324
- appKeys: [...appKeys]
1325
- });
1326
- const implementationNameToLocator = {};
1327
- for (const locator of appLocators) {
1328
- implementationNameToLocator[locator.implementationName] = [
1329
- ...implementationNameToLocator[locator.implementationName] ?? [],
1330
- locator
1331
- ];
1332
- }
1333
- const duplicatedLookupAppKeys = Object.keys(implementationNameToLocator).filter((key) => implementationNameToLocator[key].length > 1).map((key) => implementationNameToLocator[key]).flat().map((locator) => locator.lookupAppKey);
1334
- if (duplicatedLookupAppKeys.length > 0) {
1335
- throw new Error(
1336
- `Duplicate lookup app keys found: ${duplicatedLookupAppKeys.join(", ")}`
1337
- );
1338
- }
1339
- if (appKeys.length > 0 && appLocators.length === 0 && !options.search) {
1340
- return {
1341
- data: [],
1342
- nextCursor: void 0
1343
- };
1344
- }
1345
- const implementationIds = appLocators.map((locator) => {
1346
- const version = locator.version || "latest";
1347
- return `${locator.implementationName}@${version}`;
1348
- });
1349
- return await api.get("/api/v0/apps", {
1350
- searchParams: {
1351
- implementationIds: implementationIds.join(","),
1352
- ...options.search && { search: options.search },
1353
- pageSize: options.pageSize.toString(),
1354
- ...options.cursor && { cursor: options.cursor }
1355
- }
1356
- });
1357
- }
1358
- const methodName = stripPageSuffix(listAppsPage.name);
1359
- const listAppsDefinition = createPaginatedFunction(
1360
- listAppsPage,
1361
- ListAppsOptionsSchema,
1362
- createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
1363
- methodName
1364
- );
1365
- return {
1366
- listApps: listAppsDefinition,
1367
- context: {
1368
- meta: {
1369
- listApps: {
1370
- categories: ["app"],
1371
- type: "list",
1372
- itemType: "App",
1373
- inputSchema: ListAppsOptionsSchema,
1374
- outputSchema: AppItemSchema2
1375
- }
1376
- }
1377
- }
1378
- };
1379
- };
1380
-
1381
- // src/utils/domain-utils.ts
1382
- function splitVersionedKey(versionedKey) {
1383
- const parts = versionedKey.split("@");
1384
- if (parts.length >= 2) {
1385
- const baseKey = parts[0];
1386
- const version = parts.slice(1).join("@");
1387
- return [baseKey, version];
1388
- }
1389
- return [versionedKey, void 0];
1390
- }
1391
- function normalizeImplementationMetaToAppItem(implementationMeta) {
1392
- const [selectedApi, appVersion] = splitVersionedKey(implementationMeta.id);
1393
- const { id, name, ...restOfImplementationMeta } = implementationMeta;
1394
- return {
1395
- ...restOfImplementationMeta,
1396
- title: name,
1397
- key: selectedApi,
1398
- implementation_id: id,
1399
- version: appVersion
1400
- };
1401
- }
1402
- function normalizeActionItem(action) {
1403
- const { name, type, selected_api: selectedApi } = action;
1404
- const [appKey, appVersion] = selectedApi ? splitVersionedKey(selectedApi) : ["", void 0];
1405
- return {
1406
- // Only include the fields we want - explicitly list them
1407
- id: action.id,
1408
- key: action.key,
1409
- description: action.description,
1410
- is_important: action.is_important,
1411
- is_hidden: action.is_hidden,
1412
- // Transformed fields
1413
- app_key: appKey,
1414
- app_version: appVersion,
1415
- action_type: type,
1416
- title: name,
1417
- // Map name to title
1418
- type: "action"
1419
- };
1420
- }
1421
- function isSlug(slug) {
1422
- return !!slug.match(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
1423
- }
1424
- function isSnakeCasedSlug(slug) {
1425
- if (slug.match(/^_[0-9]/)) {
1426
- slug = slug.slice(1);
1427
- }
1428
- return !!slug.match(/^[a-z0-9]+(?:_[a-z0-9]+)*$/);
1429
- }
1430
- function dashifySnakeCasedSlug(slug) {
1431
- if (!isSnakeCasedSlug(slug)) {
1432
- return slug;
1433
- }
1434
- if (slug.startsWith("_")) {
1435
- slug = slug.slice(1);
1436
- }
1437
- return slug.replace(/_/g, "-");
1438
- }
1439
- function isUuid(appKey) {
1440
- return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
1441
- appKey
1442
- );
1443
- }
1444
- function toAppLocator(appKey) {
1445
- const [appKeyWithoutVersion, version] = splitVersionedKey(appKey);
1446
- if (isUuid(appKeyWithoutVersion)) {
1447
- throw new Error(
1448
- `UUID app keys are not supported. Use app slug or implementation ID instead of: ${appKey}`
1449
- );
1450
- }
1451
- const slug = isSlug(appKeyWithoutVersion) ? appKeyWithoutVersion : isSnakeCasedSlug(appKeyWithoutVersion) ? dashifySnakeCasedSlug(appKeyWithoutVersion) : void 0;
1452
- return {
1453
- lookupAppKey: appKeyWithoutVersion,
1454
- slug,
1455
- implementationName: slug ? void 0 : appKeyWithoutVersion,
1456
- version
1457
- };
1458
- }
1459
- function isResolvedAppLocator(appLocator) {
1460
- return !!appLocator.implementationName;
1461
- }
1462
- var ListActionsSchema = z.object({
1463
- appKey: AppKeyPropertySchema.describe(
1464
- "App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"
1229
+ slug: z.string(),
1230
+ zap_usage_count: z.number().nullable().optional()
1231
+ });
1232
+ var ServiceSchema = z.object({
1233
+ id: z.number().optional(),
1234
+ canonical_id: z.string().optional(),
1235
+ current_implementation_id: z.string(),
1236
+ name: z.string(),
1237
+ slug: z.string(),
1238
+ app_url: z.string().optional(),
1239
+ learn_more_url: z.string().optional(),
1240
+ description: z.string(),
1241
+ primary_color: z.string(),
1242
+ popularity: z.number(),
1243
+ image: z.string().optional(),
1244
+ images: z.string().optional()
1245
+ });
1246
+ z.object({
1247
+ results: z.array(ServiceSchema),
1248
+ next: z.string().nullable().optional(),
1249
+ previous: z.string().nullable().optional()
1250
+ });
1251
+ z.object({
1252
+ selected_api: z.string(),
1253
+ action: z.string(),
1254
+ type_of: z.string(),
1255
+ authentication_id: z.number().optional(),
1256
+ params: z.record(z.string(), z.unknown()).optional()
1257
+ });
1258
+ z.object({
1259
+ success: z.boolean(),
1260
+ needs: z.array(NeedSchema).optional(),
1261
+ errors: z.array(z.string()).optional(),
1262
+ last_fetched_at: z.string().optional(),
1263
+ schema: z.record(z.string(), z.unknown()).optional()
1264
+ });
1265
+ var ImplementationSchema = z.object({
1266
+ selected_api: z.string(),
1267
+ app_id: z.number().optional(),
1268
+ auth_type: z.string().optional(),
1269
+ auth_fields: z.string().optional(),
1270
+ actions: z.array(ActionSchema).optional(),
1271
+ is_deprecated: z.boolean().optional(),
1272
+ is_private_only: z.boolean().optional(),
1273
+ is_invite_only: z.boolean().optional(),
1274
+ is_beta: z.boolean().optional().default(false),
1275
+ is_premium: z.boolean().optional().default(false),
1276
+ is_hidden: z.string().optional(),
1277
+ name: z.string().optional(),
1278
+ slug: z.string().optional(),
1279
+ images: z.record(z.string(), z.string().nullable()).optional(),
1280
+ primary_color: z.string().optional(),
1281
+ secondary_color: z.string().optional(),
1282
+ current_implementation: z.string().optional(),
1283
+ other_implementations: z.string().optional()
1284
+ });
1285
+ z.object({
1286
+ count: z.number(),
1287
+ next: z.string().nullable().optional(),
1288
+ previous: z.string().nullable().optional(),
1289
+ results: z.array(ImplementationSchema)
1290
+ });
1291
+ var NeedChoicesResponseMetaSchema = z.object({
1292
+ page: z.string().nullable().optional()
1293
+ });
1294
+ var NeedChoicesResponseLinksSchema = z.object({
1295
+ next: z.string().nullable().optional(),
1296
+ prev: z.string().nullable().optional()
1297
+ });
1298
+ z.object({
1299
+ selected_api: z.string().optional().describe(
1300
+ "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."
1465
1301
  ),
1466
- actionType: ActionTypePropertySchema.optional().describe(
1467
- "Filter actions by type"
1302
+ authentication_id: z.coerce.number().optional().describe(
1303
+ "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)."
1468
1304
  ),
1469
- pageSize: z.number().min(1).optional().describe("Number of actions per page"),
1470
- maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
1471
- cursor: z.string().optional().describe("Cursor to start from")
1472
- }).merge(TelemetryMarkerSchema).describe("List all actions for a specific app");
1305
+ params: z.record(z.string(), z.unknown()).optional().describe(
1306
+ "Object that matches the input the node would normally get. Has all the same keys/types as the `needs` of the action."
1307
+ ),
1308
+ page: z.number().optional().default(0),
1309
+ prefill: z.string().optional().describe(
1310
+ "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."
1311
+ ),
1312
+ action_id: z.string().optional().describe(
1313
+ "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."
1314
+ ),
1315
+ input_field_id: z.string().optional().describe(
1316
+ "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."
1317
+ )
1318
+ });
1319
+ z.object({
1320
+ success: z.boolean(),
1321
+ choices: z.array(NeedChoicesSchema).optional(),
1322
+ next_page: z.number().optional(),
1323
+ errors: z.array(z.string()).optional(),
1324
+ meta: NeedChoicesResponseMetaSchema.optional(),
1325
+ links: NeedChoicesResponseLinksSchema.optional()
1326
+ });
1327
+
1328
+ // src/schemas/Action.ts
1473
1329
  var ActionItemSchema = withFormatter(
1474
1330
  ActionSchema.omit({ type: true, name: true, selected_api: true }).extend({
1475
1331
  app_key: z.string(),
@@ -2239,6 +2095,9 @@ var listAuthenticationsPlugin = ({ context }) => {
2239
2095
  if (options.owner) {
2240
2096
  searchParams.owner = options.owner;
2241
2097
  }
2098
+ if (options.isExpired !== void 0) {
2099
+ searchParams.isExpired = options.isExpired.toString();
2100
+ }
2242
2101
  if (options.cursor) {
2243
2102
  searchParams.offset = options.cursor;
2244
2103
  }
@@ -2330,7 +2189,7 @@ var getAppPlugin = ({ sdk, context }) => {
2330
2189
  type: "item",
2331
2190
  itemType: "App",
2332
2191
  inputSchema: GetAppSchema,
2333
- outputSchema: AppItemSchema2,
2192
+ outputSchema: AppItemSchema,
2334
2193
  resolvers: {
2335
2194
  appKey: appKeyResolver
2336
2195
  }
@@ -2420,14 +2279,14 @@ var getAuthenticationPlugin = ({ context }) => {
2420
2279
  }
2421
2280
  };
2422
2281
  };
2423
- var FindFirstAuthenticationSchema = z.object({
2424
- appKey: AppKeyPropertySchema.optional().describe(
2425
- "App key of authentication to find (e.g., 'SlackCLIAPI' or slug like 'github')"
2426
- ),
2427
- search: z.string().optional().describe("Search term to filter authentications by title"),
2428
- title: z.string().optional().describe("Filter authentications by exact title match"),
2429
- accountId: z.string().optional().describe("Filter by account ID"),
2430
- owner: z.string().optional().describe("Filter by owner")
2282
+
2283
+ // src/plugins/findFirstAuthentication/schemas.ts
2284
+ var FindFirstAuthenticationSchema = ListAuthenticationsQuerySchema.omit({
2285
+ authenticationIds: true,
2286
+ pageSize: true,
2287
+ maxItems: true,
2288
+ cursor: true,
2289
+ _telemetry: true
2431
2290
  }).describe("Find the first authentication matching the criteria");
2432
2291
 
2433
2292
  // src/plugins/findFirstAuthentication/index.ts
@@ -2471,14 +2330,14 @@ var findFirstAuthenticationPlugin = ({ sdk, context }) => {
2471
2330
  }
2472
2331
  };
2473
2332
  };
2474
- var FindUniqueAuthenticationSchema = z.object({
2475
- appKey: AppKeyPropertySchema.optional().describe(
2476
- "App key of authentication to find (e.g., 'SlackCLIAPI' or slug like 'github')"
2477
- ),
2478
- search: z.string().optional().describe("Search term to filter authentications by title"),
2479
- title: z.string().optional().describe("Filter authentications by exact title match"),
2480
- accountId: z.string().optional().describe("Filter by account ID"),
2481
- owner: z.string().optional().describe("Filter by owner")
2333
+
2334
+ // src/plugins/findUniqueAuthentication/schemas.ts
2335
+ var FindUniqueAuthenticationSchema = ListAuthenticationsQuerySchema.omit({
2336
+ authenticationIds: true,
2337
+ pageSize: true,
2338
+ maxItems: true,
2339
+ cursor: true,
2340
+ _telemetry: true
2482
2341
  }).describe("Find a unique authentication matching the criteria");
2483
2342
 
2484
2343
  // src/plugins/findUniqueAuthentication/index.ts
@@ -2881,8 +2740,11 @@ async function readManifestFromFile(filePath) {
2881
2740
  const resolvedPath = await resolve(filePath);
2882
2741
  const content = await readFile(resolvedPath);
2883
2742
  return parseManifestContent(content, resolvedPath);
2884
- } catch {
2885
- console.warn(`\u26A0\uFE0F Failed to read manifest from ${filePath}`);
2743
+ } catch (error) {
2744
+ const isFileNotFound = error && typeof error === "object" && "code" in error && error.code === "ENOENT" || error instanceof Error && error.message.includes("File not found");
2745
+ if (!isFileNotFound) {
2746
+ console.warn(`\u26A0\uFE0F Failed to read manifest from ${filePath}`);
2747
+ }
2886
2748
  return null;
2887
2749
  }
2888
2750
  }
@@ -3595,36 +3457,29 @@ async function pollUntilComplete(options) {
3595
3457
  }
3596
3458
  }
3597
3459
 
3598
- // src/auth.ts
3599
- function getTokenFromEnv() {
3600
- return process.env.ZAPIER_TOKEN;
3460
+ // src/types/credentials.ts
3461
+ function isClientCredentials(credentials) {
3462
+ return typeof credentials === "object" && credentials !== null && "clientId" in credentials && "clientSecret" in credentials;
3601
3463
  }
3602
- async function getTokenFromCliLogin(options = {}) {
3603
- try {
3604
- const { getToken } = await import('@zapier/zapier-sdk-cli-login');
3605
- return await getToken(options);
3606
- } catch {
3607
- return void 0;
3608
- }
3464
+ function isPkceCredentials(credentials) {
3465
+ return typeof credentials === "object" && credentials !== null && "clientId" in credentials && !("clientSecret" in credentials);
3609
3466
  }
3610
- async function getTokenFromEnvOrConfig(options = {}) {
3611
- const envToken = getTokenFromEnv();
3612
- if (envToken) {
3613
- return envToken;
3614
- }
3615
- return getTokenFromCliLogin(options);
3467
+ function isCredentialsObject(credentials) {
3468
+ return typeof credentials === "object" && credentials !== null && "clientId" in credentials;
3616
3469
  }
3617
- async function resolveAuthToken(options = {}) {
3618
- if (options.token) {
3619
- return options.token;
3620
- }
3621
- if (options.getToken) {
3622
- const token = await options.getToken();
3623
- if (token) {
3624
- return token;
3625
- }
3626
- }
3627
- return getTokenFromEnvOrConfig(options);
3470
+ function isCredentialsFunction(credentials) {
3471
+ return typeof credentials === "function";
3472
+ }
3473
+
3474
+ // src/utils/logging.ts
3475
+ var loggedDeprecations = /* @__PURE__ */ new Set();
3476
+ function logDeprecation(message) {
3477
+ if (loggedDeprecations.has(message)) return;
3478
+ loggedDeprecations.add(message);
3479
+ console.warn(`[zapier-sdk] Deprecation: ${message}`);
3480
+ }
3481
+ function resetDeprecationWarnings() {
3482
+ loggedDeprecations.clear();
3628
3483
  }
3629
3484
 
3630
3485
  // src/utils/url-utils.ts
@@ -3673,174 +3528,276 @@ function getTrackingBaseUrl({
3673
3528
  return ZAPIER_BASE_URL;
3674
3529
  }
3675
3530
 
3676
- // src/temporary-internal-core/utils/string-utils.ts
3677
- function splitVersionedKey2(versionedKey) {
3678
- const parts = versionedKey.split("@");
3679
- if (parts.length >= 2) {
3680
- const baseKey = parts[0];
3681
- const version = parts.slice(1).join("@");
3682
- return [baseKey, version];
3683
- }
3684
- return [versionedKey, void 0];
3531
+ // src/credentials.ts
3532
+ function deriveAuthBaseUrl(sdkBaseUrl) {
3533
+ if (!sdkBaseUrl) return void 0;
3534
+ return getZapierBaseUrl(sdkBaseUrl);
3685
3535
  }
3686
-
3687
- // src/temporary-internal-core/utils/transformations.ts
3688
- function transformImplementationMetaToAppItem(implementationMeta) {
3689
- const [selectedApi, appVersion] = splitVersionedKey2(implementationMeta.id);
3690
- const { id, name, ...restOfImplementationMeta } = implementationMeta;
3536
+ function normalizeCredentialsObject(obj, sdkBaseUrl) {
3537
+ const resolvedBaseUrl = obj.baseUrl || deriveAuthBaseUrl(sdkBaseUrl);
3538
+ if (obj.type === "client_credentials" || "clientSecret" in obj && obj.clientSecret) {
3539
+ return {
3540
+ type: "client_credentials",
3541
+ clientId: obj.clientId,
3542
+ clientSecret: obj.clientSecret,
3543
+ baseUrl: resolvedBaseUrl,
3544
+ scope: obj.scope
3545
+ };
3546
+ }
3691
3547
  return {
3692
- ...restOfImplementationMeta,
3693
- title: name,
3694
- key: selectedApi,
3695
- implementation_id: id,
3696
- version: appVersion
3548
+ type: "pkce",
3549
+ clientId: obj.clientId,
3550
+ baseUrl: resolvedBaseUrl,
3551
+ scope: obj.scope
3697
3552
  };
3698
3553
  }
3699
- function extractPaginationCursor(response) {
3700
- if (!response.next) {
3701
- return void 0;
3702
- }
3703
- try {
3704
- const url = new URL(response.next);
3705
- const offset = url.searchParams.get("offset");
3706
- return offset || void 0;
3707
- } catch {
3708
- return void 0;
3554
+ function resolveCredentialsFromEnv(sdkBaseUrl) {
3555
+ if (ZAPIER_CREDENTIALS) {
3556
+ return ZAPIER_CREDENTIALS;
3709
3557
  }
3710
- }
3711
-
3712
- // src/temporary-internal-core/handlers/listApps.ts
3713
- var DEFAULT_PAGE_SIZE = 20;
3714
- async function augmentWithSearchResults({
3715
- searchTerm,
3716
- implementationIds,
3717
- httpClient
3718
- }) {
3719
- const searchResponse = await httpClient.get(
3720
- "/zapier/api/v4/implementations-meta/search/",
3721
- {
3722
- searchParams: { term: searchTerm }
3723
- }
3724
- );
3725
- const byImplementationName = /* @__PURE__ */ new Map();
3726
- for (const result of searchResponse.results) {
3727
- const [implementationName] = splitVersionedKey2(result.id);
3728
- const isPublic = result.visibility === "public";
3729
- const existing = byImplementationName.get(implementationName);
3730
- if (!existing || isPublic && !existing.isPublic) {
3731
- byImplementationName.set(implementationName, { result, isPublic });
3558
+ if (ZAPIER_CREDENTIALS_CLIENT_ID) {
3559
+ const resolvedBaseUrl = ZAPIER_CREDENTIALS_BASE_URL || deriveAuthBaseUrl(sdkBaseUrl);
3560
+ if (ZAPIER_CREDENTIALS_CLIENT_SECRET) {
3561
+ return {
3562
+ type: "client_credentials",
3563
+ clientId: ZAPIER_CREDENTIALS_CLIENT_ID,
3564
+ clientSecret: ZAPIER_CREDENTIALS_CLIENT_SECRET,
3565
+ baseUrl: resolvedBaseUrl,
3566
+ scope: ZAPIER_CREDENTIALS_SCOPE
3567
+ };
3568
+ } else {
3569
+ return {
3570
+ type: "pkce",
3571
+ clientId: ZAPIER_CREDENTIALS_CLIENT_ID,
3572
+ baseUrl: resolvedBaseUrl,
3573
+ scope: ZAPIER_CREDENTIALS_SCOPE
3574
+ };
3732
3575
  }
3733
3576
  }
3734
- const searchResults = Array.from(byImplementationName.values()).map(
3735
- (entry) => transformImplementationMetaToAppItem(entry.result)
3736
- );
3737
- const implementationNameSet = new Set(
3738
- implementationIds.map((id) => {
3739
- const [name] = splitVersionedKey2(id);
3740
- return name;
3741
- })
3742
- );
3743
- const additionalIds = [];
3744
- for (const result of searchResults) {
3745
- const [implementationName] = splitVersionedKey2(result.key);
3746
- if (!implementationNameSet.has(implementationName)) {
3747
- implementationNameSet.add(implementationName);
3748
- additionalIds.push(result.implementation_id);
3577
+ if (ZAPIER_TOKEN) {
3578
+ logDeprecation(
3579
+ "ZAPIER_TOKEN is deprecated. Use ZAPIER_CREDENTIALS instead."
3580
+ );
3581
+ return ZAPIER_TOKEN;
3582
+ }
3583
+ if (ZAPIER_AUTH_CLIENT_ID) {
3584
+ logDeprecation(
3585
+ "ZAPIER_AUTH_CLIENT_ID is deprecated. Use ZAPIER_CREDENTIALS_CLIENT_ID instead."
3586
+ );
3587
+ if (ZAPIER_AUTH_BASE_URL) {
3588
+ logDeprecation(
3589
+ "ZAPIER_AUTH_BASE_URL is deprecated. Use ZAPIER_CREDENTIALS_BASE_URL instead."
3590
+ );
3749
3591
  }
3592
+ const resolvedBaseUrl = ZAPIER_AUTH_BASE_URL || deriveAuthBaseUrl(sdkBaseUrl);
3593
+ return {
3594
+ type: "pkce",
3595
+ clientId: ZAPIER_AUTH_CLIENT_ID,
3596
+ baseUrl: resolvedBaseUrl
3597
+ };
3750
3598
  }
3751
- return [...implementationIds, ...additionalIds];
3599
+ return void 0;
3752
3600
  }
3753
- var handleListApps = async ({ request, deps }) => {
3754
- const validatedRequest = ListAppsHandlerRequestSchema.parse(request);
3755
- const { httpClient } = deps;
3756
- let { implementationIds } = validatedRequest;
3757
- const pageSize = validatedRequest.pageSize ?? DEFAULT_PAGE_SIZE;
3758
- if (validatedRequest.search) {
3759
- implementationIds = await augmentWithSearchResults({
3760
- searchTerm: validatedRequest.search,
3761
- implementationIds,
3762
- httpClient
3763
- });
3764
- }
3765
- if (implementationIds.length === 0) {
3766
- if (validatedRequest.search) {
3767
- return {
3768
- data: [],
3769
- nextCursor: void 0
3770
- };
3601
+ async function resolveCredentials(options = {}) {
3602
+ const { baseUrl } = options;
3603
+ if (options.credentials !== void 0) {
3604
+ if (isCredentialsFunction(options.credentials)) {
3605
+ const resolved = await options.credentials();
3606
+ if (typeof resolved === "function") {
3607
+ throw new Error(
3608
+ "Credentials function returned another function. Credentials functions must return a string or credentials object."
3609
+ );
3610
+ }
3611
+ if (isCredentialsObject(resolved)) {
3612
+ return normalizeCredentialsObject(resolved, baseUrl);
3613
+ }
3614
+ return resolved;
3771
3615
  }
3772
- const searchParams2 = {
3773
- latest_only: "true",
3774
- selected_apis: "",
3775
- limit: pageSize.toString()
3776
- };
3777
- if (validatedRequest.cursor) {
3778
- searchParams2.offset = validatedRequest.cursor;
3616
+ if (isCredentialsObject(options.credentials)) {
3617
+ return normalizeCredentialsObject(options.credentials, baseUrl);
3779
3618
  }
3780
- const implementationsResponse2 = await httpClient.get(
3781
- "/zapier/api/v4/implementations-meta/lookup/",
3782
- {
3783
- searchParams: searchParams2
3784
- }
3619
+ return options.credentials;
3620
+ }
3621
+ if (options.token !== void 0) {
3622
+ logDeprecation(
3623
+ "The `token` option is deprecated. Use `credentials` instead."
3785
3624
  );
3786
- return {
3787
- data: implementationsResponse2.results.map(
3788
- transformImplementationMetaToAppItem
3789
- ),
3790
- nextCursor: extractPaginationCursor(implementationsResponse2)
3791
- };
3625
+ return options.token;
3792
3626
  }
3793
- const searchParams = {
3794
- selected_apis: implementationIds.join(","),
3795
- limit: pageSize.toString()
3796
- };
3797
- if (validatedRequest.cursor) {
3798
- searchParams.offset = validatedRequest.cursor;
3627
+ const envCredentials = resolveCredentialsFromEnv(baseUrl);
3628
+ if (envCredentials !== void 0) {
3629
+ return envCredentials;
3799
3630
  }
3800
- const implementationsResponse = await httpClient.get(
3801
- "/zapier/api/v4/implementations-meta/lookup/",
3802
- {
3803
- searchParams
3804
- }
3805
- );
3806
- return {
3807
- data: implementationsResponse.results.map(
3808
- transformImplementationMetaToAppItem
3809
- ),
3810
- nextCursor: extractPaginationCursor(implementationsResponse)
3811
- };
3812
- };
3631
+ return void 0;
3632
+ }
3633
+ function getBaseUrlFromCredentials(credentials) {
3634
+ if (credentials && isCredentialsObject(credentials)) {
3635
+ return credentials.baseUrl;
3636
+ }
3637
+ return void 0;
3638
+ }
3639
+ function getClientIdFromCredentials(credentials) {
3640
+ if (credentials && isCredentialsObject(credentials)) {
3641
+ return credentials.clientId;
3642
+ }
3643
+ return void 0;
3644
+ }
3813
3645
 
3814
- // src/api/router.ts
3815
- var routes = [
3816
- {
3817
- method: "GET",
3818
- pattern: /^\/api\/v0\/apps$/,
3819
- handler: handleListApps,
3820
- paramMap: []
3646
+ // src/auth.ts
3647
+ var tokenCache = /* @__PURE__ */ new Map();
3648
+ var pendingExchanges = /* @__PURE__ */ new Map();
3649
+ function clearTokenCache() {
3650
+ tokenCache.clear();
3651
+ pendingExchanges.clear();
3652
+ }
3653
+ var TOKEN_EXPIRATION_BUFFER = 5 * 60 * 1e3;
3654
+ function getCachedToken(clientId) {
3655
+ const cached = tokenCache.get(clientId);
3656
+ if (!cached) return void 0;
3657
+ if (cached.expiresAt > Date.now() + TOKEN_EXPIRATION_BUFFER) {
3658
+ return cached.accessToken;
3659
+ }
3660
+ tokenCache.delete(clientId);
3661
+ return void 0;
3662
+ }
3663
+ function cacheToken(clientId, accessToken, expiresIn) {
3664
+ tokenCache.set(clientId, {
3665
+ accessToken,
3666
+ expiresAt: Date.now() + expiresIn * 1e3
3667
+ });
3668
+ }
3669
+ function invalidateCachedToken(clientId) {
3670
+ tokenCache.delete(clientId);
3671
+ }
3672
+ function getTokenEndpointUrl(baseUrl) {
3673
+ const base = baseUrl || ZAPIER_BASE_URL;
3674
+ return `${base}/oauth/token/`;
3675
+ }
3676
+ async function exchangeClientCredentials(options) {
3677
+ const { clientId, clientSecret, baseUrl, scope, onEvent } = options;
3678
+ const fetchFn = options.fetch || globalThis.fetch;
3679
+ const tokenUrl = getTokenEndpointUrl(baseUrl);
3680
+ onEvent?.({
3681
+ type: "auth_exchanging",
3682
+ payload: {
3683
+ message: "Exchanging client credentials for token...",
3684
+ operation: "client_credentials"
3685
+ },
3686
+ timestamp: Date.now()
3687
+ });
3688
+ const response = await fetchFn(tokenUrl, {
3689
+ method: "POST",
3690
+ headers: {
3691
+ "Content-Type": "application/x-www-form-urlencoded"
3692
+ },
3693
+ body: new URLSearchParams({
3694
+ grant_type: "client_credentials",
3695
+ client_id: clientId,
3696
+ client_secret: clientSecret,
3697
+ scope: scope || "external",
3698
+ audience: "zapier.com"
3699
+ })
3700
+ });
3701
+ if (!response.ok) {
3702
+ const errorText = await response.text();
3703
+ onEvent?.({
3704
+ type: "auth_error",
3705
+ payload: {
3706
+ message: `Client credentials exchange failed: ${response.status}`,
3707
+ error: errorText,
3708
+ operation: "client_credentials"
3709
+ },
3710
+ timestamp: Date.now()
3711
+ });
3712
+ throw new Error(
3713
+ `Client credentials exchange failed: ${response.status} ${response.statusText}`
3714
+ );
3821
3715
  }
3822
- ];
3823
- function findMatchingRoute(routeList, method, path) {
3824
- for (const route of routeList) {
3825
- if (route.method !== method) {
3826
- continue;
3827
- }
3828
- const match = path.match(route.pattern);
3829
- if (match) {
3830
- const params = {};
3831
- route.paramMap.forEach((name, index) => {
3832
- params[name] = match[index + 1];
3833
- });
3834
- return {
3835
- handler: route.handler,
3836
- params
3837
- };
3716
+ const data = await response.json();
3717
+ if (!data.access_token) {
3718
+ throw new Error("Client credentials response missing access_token");
3719
+ }
3720
+ const expiresIn = data.expires_in || 3600;
3721
+ cacheToken(clientId, data.access_token, expiresIn);
3722
+ onEvent?.({
3723
+ type: "auth_success",
3724
+ payload: {
3725
+ message: "Client credentials exchange successful",
3726
+ operation: "client_credentials"
3727
+ },
3728
+ timestamp: Date.now()
3729
+ });
3730
+ return data.access_token;
3731
+ }
3732
+ async function getTokenFromCliLogin(options) {
3733
+ try {
3734
+ const cliLogin = await import('@zapier/zapier-sdk-cli-login');
3735
+ return await cliLogin.getToken(options);
3736
+ } catch {
3737
+ return void 0;
3738
+ }
3739
+ }
3740
+ async function resolveAuthToken(options = {}) {
3741
+ const credentials = await resolveCredentials({
3742
+ credentials: options.credentials,
3743
+ token: options.token
3744
+ });
3745
+ if (credentials !== void 0) {
3746
+ return resolveAuthTokenFromCredentials(credentials, options);
3747
+ }
3748
+ return getTokenFromCliLogin({
3749
+ onEvent: options.onEvent,
3750
+ fetch: options.fetch
3751
+ });
3752
+ }
3753
+ async function resolveAuthTokenFromCredentials(credentials, options) {
3754
+ if (typeof credentials === "string") {
3755
+ return credentials;
3756
+ }
3757
+ if (isClientCredentials(credentials)) {
3758
+ const { clientId } = credentials;
3759
+ const cached = getCachedToken(clientId);
3760
+ if (cached) {
3761
+ return cached;
3762
+ }
3763
+ const pending = pendingExchanges.get(clientId);
3764
+ if (pending) {
3765
+ return pending;
3766
+ }
3767
+ const exchangePromise = exchangeClientCredentials({
3768
+ clientId: credentials.clientId,
3769
+ clientSecret: credentials.clientSecret,
3770
+ baseUrl: credentials.baseUrl || options.baseUrl,
3771
+ scope: credentials.scope,
3772
+ fetch: options.fetch,
3773
+ onEvent: options.onEvent
3774
+ }).finally(() => {
3775
+ pendingExchanges.delete(clientId);
3776
+ });
3777
+ pendingExchanges.set(clientId, exchangePromise);
3778
+ return exchangePromise;
3779
+ }
3780
+ if (isPkceCredentials(credentials)) {
3781
+ const storedToken = await getTokenFromCliLogin({
3782
+ onEvent: options.onEvent,
3783
+ fetch: options.fetch,
3784
+ credentials
3785
+ });
3786
+ if (storedToken) {
3787
+ return storedToken;
3838
3788
  }
3789
+ throw new Error(
3790
+ "PKCE credentials require interactive login. Please run the 'login' command with the CLI first, or use client_credentials flow."
3791
+ );
3839
3792
  }
3840
- return null;
3793
+ throw new Error("Unknown credentials type");
3841
3794
  }
3842
- function matchRoute(method, path) {
3843
- return findMatchingRoute(routes, method, path);
3795
+ async function invalidateCredentialsToken(options) {
3796
+ const resolved = await resolveCredentials(options);
3797
+ const clientId = getClientIdFromCredentials(resolved);
3798
+ if (clientId) {
3799
+ invalidateCachedToken(clientId);
3800
+ }
3844
3801
  }
3845
3802
 
3846
3803
  // src/api/client.ts
@@ -3900,13 +3857,11 @@ var ZapierApiClient = class {
3900
3857
  // Helper to get a token from the different places it could be gotten
3901
3858
  async getAuthToken() {
3902
3859
  return resolveAuthToken({
3860
+ credentials: this.options.credentials,
3903
3861
  token: this.options.token,
3904
- getToken: this.options.getToken,
3905
3862
  onEvent: this.options.onEvent,
3906
3863
  fetch: this.options.fetch,
3907
- baseUrl: this.options.baseUrl,
3908
- authBaseUrl: this.options.authBaseUrl,
3909
- authClientId: this.options.authClientId
3864
+ baseUrl: this.options.baseUrl
3910
3865
  });
3911
3866
  }
3912
3867
  // Helper to handle responses
@@ -3944,10 +3899,16 @@ var ZapierApiClient = class {
3944
3899
  if (response.status === 401 || response.status === 403) {
3945
3900
  if (wasMissingAuthToken) {
3946
3901
  throw new ZapierAuthenticationError(
3947
- `Authentication required (HTTP ${response.status}). Please provide a token in options or set ZAPIER_TOKEN environment variable.`,
3902
+ `Authentication required (HTTP ${response.status}). Please provide credentials in options or set ZAPIER_CREDENTIALS environment variable.`,
3948
3903
  errorOptions
3949
3904
  );
3950
3905
  }
3906
+ if (response.status === 401) {
3907
+ await invalidateCredentialsToken({
3908
+ credentials: this.options.credentials,
3909
+ token: this.options.token
3910
+ });
3911
+ }
3951
3912
  throw new ZapierAuthenticationError(message, errorOptions);
3952
3913
  }
3953
3914
  if (response.status === 400) {
@@ -4083,7 +4044,7 @@ var ZapierApiClient = class {
4083
4044
  if (options.authRequired) {
4084
4045
  if (headers.get("Authorization") == null && authToken == null) {
4085
4046
  throw new ZapierAuthenticationError(
4086
- `Authentication required but no token available. Please set ZAPIER_TOKEN, or run the 'login' command with the CLI.`
4047
+ `Authentication required but no credentials available. Please set ZAPIER_CREDENTIALS, or run the 'login' command with the CLI.`
4087
4048
  );
4088
4049
  }
4089
4050
  }
@@ -4091,20 +4052,6 @@ var ZapierApiClient = class {
4091
4052
  }
4092
4053
  // Helper to perform HTTP requests with JSON handling
4093
4054
  async fetchJson(method, path, data, options = {}) {
4094
- const routeMatch = matchRoute(method, path);
4095
- if (routeMatch) {
4096
- const handlerRequest = {
4097
- ...typeof data === "object" ? data : {},
4098
- ...options.searchParams,
4099
- ...routeMatch.params
4100
- };
4101
- return routeMatch.handler({
4102
- request: handlerRequest,
4103
- deps: {
4104
- httpClient: this
4105
- }
4106
- });
4107
- }
4108
4055
  const headers = { ...options.headers };
4109
4056
  if (data && typeof data === "object") {
4110
4057
  headers["Content-Type"] = "application/json";
@@ -4173,27 +4120,28 @@ var apiPlugin = (params) => {
4173
4120
  const {
4174
4121
  fetch: customFetch = globalThis.fetch,
4175
4122
  baseUrl = ZAPIER_BASE_URL,
4176
- authBaseUrl,
4177
- authClientId,
4123
+ credentials,
4178
4124
  token,
4179
- getToken,
4180
4125
  onEvent,
4181
4126
  debug = false
4182
4127
  } = params.context.options;
4183
4128
  const api = createZapierApi({
4184
4129
  baseUrl,
4185
- authBaseUrl,
4186
- authClientId,
4130
+ credentials,
4187
4131
  token,
4188
- getToken,
4189
4132
  debug,
4190
4133
  fetch: customFetch,
4191
4134
  onEvent
4192
4135
  });
4193
4136
  return {
4194
4137
  context: {
4195
- api
4138
+ api,
4196
4139
  // Provide API client in context for other plugins to use
4140
+ resolveCredentials: () => resolveCredentials({
4141
+ credentials,
4142
+ token,
4143
+ baseUrl
4144
+ })
4197
4145
  }
4198
4146
  };
4199
4147
  };
@@ -4787,7 +4735,7 @@ function getCpuTime() {
4787
4735
 
4788
4736
  // package.json
4789
4737
  var package_default = {
4790
- version: "0.18.3"};
4738
+ version: "0.19.0"};
4791
4739
 
4792
4740
  // src/plugins/eventEmission/builders.ts
4793
4741
  function createBaseEvent(context = {}) {
@@ -4960,11 +4908,9 @@ var eventEmissionPlugin = ({ context }) => {
4960
4908
  const getUserContext = (async () => {
4961
4909
  try {
4962
4910
  const token = await resolveAuthToken({
4911
+ credentials: context.options.credentials,
4963
4912
  token: context.options.token,
4964
- getToken: context.options.getToken,
4965
4913
  baseUrl: context.options.baseUrl,
4966
- authBaseUrl: context.options.authBaseUrl,
4967
- authClientId: context.options.authClientId,
4968
4914
  onEvent: context.options.onEvent,
4969
4915
  fetch: context.options.fetch
4970
4916
  });
@@ -5229,4 +5175,4 @@ function createZapierSdk(options = {}) {
5229
5175
  return createZapierSdkWithoutRegistry(options).addPlugin(registryPlugin);
5230
5176
  }
5231
5177
 
5232
- export { ActionKeyPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AuthenticationIdPropertySchema, DEFAULT_CONFIG_PATH, DebugPropertySchema, InputsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, RelayFetchSchema, RelayRequestSchema, ZAPIER_BASE_URL, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, ZapierNotFoundError, ZapierResourceNotFoundError, 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 };
5178
+ export { ActionKeyPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AuthenticationIdPropertySchema, DEFAULT_CONFIG_PATH, DebugPropertySchema, InputsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, RelayFetchSchema, RelayRequestSchema, 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, ZapierNotFoundError, ZapierResourceNotFoundError, 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 };