@zapier/zapier-sdk 0.18.4 → 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 (372) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +43 -31
  3. package/dist/index.cjs +365 -64
  4. package/dist/index.d.mts +220 -33
  5. package/dist/index.d.ts +2541 -40
  6. package/dist/index.mjs +345 -63
  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.js +0 -356
  17. package/dist/api/client.test.d.ts +0 -2
  18. package/dist/api/client.test.d.ts.map +0 -1
  19. package/dist/api/client.test.js +0 -96
  20. package/dist/api/debug.d.ts +0 -14
  21. package/dist/api/debug.d.ts.map +0 -1
  22. package/dist/api/debug.js +0 -131
  23. package/dist/api/debug.test.d.ts +0 -2
  24. package/dist/api/debug.test.d.ts.map +0 -1
  25. package/dist/api/debug.test.js +0 -59
  26. package/dist/api/index.d.ts +0 -30
  27. package/dist/api/index.d.ts.map +0 -1
  28. package/dist/api/index.js +0 -43
  29. package/dist/api/polling.d.ts +0 -46
  30. package/dist/api/polling.d.ts.map +0 -1
  31. package/dist/api/polling.js +0 -139
  32. package/dist/api/polling.test.d.ts +0 -2
  33. package/dist/api/polling.test.d.ts.map +0 -1
  34. package/dist/api/polling.test.js +0 -318
  35. package/dist/api/schemas.d.ts +0 -422
  36. package/dist/api/schemas.d.ts.map +0 -1
  37. package/dist/api/schemas.js +0 -322
  38. package/dist/api/types.d.ts +0 -83
  39. package/dist/api/types.d.ts.map +0 -1
  40. package/dist/api/types.js +0 -1
  41. package/dist/auth.d.ts +0 -52
  42. package/dist/auth.d.ts.map +0 -1
  43. package/dist/auth.js +0 -72
  44. package/dist/auth.test.d.ts +0 -2
  45. package/dist/auth.test.d.ts.map +0 -1
  46. package/dist/auth.test.js +0 -102
  47. package/dist/constants.d.ts +0 -14
  48. package/dist/constants.d.ts.map +0 -1
  49. package/dist/constants.js +0 -13
  50. package/dist/index.d.ts.map +0 -1
  51. package/dist/index.js +0 -42
  52. package/dist/plugins/api/index.d.ts +0 -12
  53. package/dist/plugins/api/index.d.ts.map +0 -1
  54. package/dist/plugins/api/index.js +0 -24
  55. package/dist/plugins/apps/index.d.ts +0 -15
  56. package/dist/plugins/apps/index.d.ts.map +0 -1
  57. package/dist/plugins/apps/index.js +0 -112
  58. package/dist/plugins/apps/schemas.d.ts +0 -42
  59. package/dist/plugins/apps/schemas.d.ts.map +0 -1
  60. package/dist/plugins/apps/schemas.js +0 -14
  61. package/dist/plugins/eventEmission/builders.d.ts +0 -14
  62. package/dist/plugins/eventEmission/builders.d.ts.map +0 -1
  63. package/dist/plugins/eventEmission/builders.js +0 -109
  64. package/dist/plugins/eventEmission/index.d.ts +0 -38
  65. package/dist/plugins/eventEmission/index.d.ts.map +0 -1
  66. package/dist/plugins/eventEmission/index.js +0 -336
  67. package/dist/plugins/eventEmission/index.test.d.ts +0 -5
  68. package/dist/plugins/eventEmission/index.test.d.ts.map +0 -1
  69. package/dist/plugins/eventEmission/index.test.js +0 -581
  70. package/dist/plugins/eventEmission/transport.d.ts +0 -27
  71. package/dist/plugins/eventEmission/transport.d.ts.map +0 -1
  72. package/dist/plugins/eventEmission/transport.js +0 -104
  73. package/dist/plugins/eventEmission/transport.test.d.ts +0 -5
  74. package/dist/plugins/eventEmission/transport.test.d.ts.map +0 -1
  75. package/dist/plugins/eventEmission/transport.test.js +0 -164
  76. package/dist/plugins/eventEmission/types.d.ts +0 -63
  77. package/dist/plugins/eventEmission/types.d.ts.map +0 -1
  78. package/dist/plugins/eventEmission/types.js +0 -1
  79. package/dist/plugins/eventEmission/utils.d.ts +0 -45
  80. package/dist/plugins/eventEmission/utils.d.ts.map +0 -1
  81. package/dist/plugins/eventEmission/utils.js +0 -114
  82. package/dist/plugins/fetch/index.d.ts +0 -36
  83. package/dist/plugins/fetch/index.d.ts.map +0 -1
  84. package/dist/plugins/fetch/index.js +0 -62
  85. package/dist/plugins/fetch/schemas.d.ts +0 -19
  86. package/dist/plugins/fetch/schemas.d.ts.map +0 -1
  87. package/dist/plugins/fetch/schemas.js +0 -31
  88. package/dist/plugins/findFirstAuthentication/index.d.ts +0 -21
  89. package/dist/plugins/findFirstAuthentication/index.d.ts.map +0 -1
  90. package/dist/plugins/findFirstAuthentication/index.js +0 -36
  91. package/dist/plugins/findFirstAuthentication/index.test.d.ts +0 -2
  92. package/dist/plugins/findFirstAuthentication/index.test.d.ts.map +0 -1
  93. package/dist/plugins/findFirstAuthentication/index.test.js +0 -177
  94. package/dist/plugins/findFirstAuthentication/schemas.d.ts +0 -20
  95. package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +0 -1
  96. package/dist/plugins/findFirstAuthentication/schemas.js +0 -18
  97. package/dist/plugins/findUniqueAuthentication/index.d.ts +0 -21
  98. package/dist/plugins/findUniqueAuthentication/index.d.ts.map +0 -1
  99. package/dist/plugins/findUniqueAuthentication/index.js +0 -39
  100. package/dist/plugins/findUniqueAuthentication/index.test.d.ts +0 -2
  101. package/dist/plugins/findUniqueAuthentication/index.test.d.ts.map +0 -1
  102. package/dist/plugins/findUniqueAuthentication/index.test.js +0 -159
  103. package/dist/plugins/findUniqueAuthentication/schemas.d.ts +0 -20
  104. package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +0 -1
  105. package/dist/plugins/findUniqueAuthentication/schemas.js +0 -18
  106. package/dist/plugins/getAction/index.d.ts +0 -25
  107. package/dist/plugins/getAction/index.d.ts.map +0 -1
  108. package/dist/plugins/getAction/index.js +0 -42
  109. package/dist/plugins/getAction/index.test.d.ts +0 -2
  110. package/dist/plugins/getAction/index.test.d.ts.map +0 -1
  111. package/dist/plugins/getAction/index.test.js +0 -211
  112. package/dist/plugins/getAction/schemas.d.ts +0 -30
  113. package/dist/plugins/getAction/schemas.d.ts.map +0 -1
  114. package/dist/plugins/getAction/schemas.js +0 -12
  115. package/dist/plugins/getApp/index.d.ts +0 -21
  116. package/dist/plugins/getApp/index.d.ts.map +0 -1
  117. package/dist/plugins/getApp/index.js +0 -44
  118. package/dist/plugins/getApp/index.test.d.ts +0 -2
  119. package/dist/plugins/getApp/index.test.d.ts.map +0 -1
  120. package/dist/plugins/getApp/index.test.js +0 -157
  121. package/dist/plugins/getApp/schemas.d.ts +0 -16
  122. package/dist/plugins/getApp/schemas.d.ts.map +0 -1
  123. package/dist/plugins/getApp/schemas.js +0 -8
  124. package/dist/plugins/getAuthentication/index.d.ts +0 -21
  125. package/dist/plugins/getAuthentication/index.d.ts.map +0 -1
  126. package/dist/plugins/getAuthentication/index.js +0 -29
  127. package/dist/plugins/getAuthentication/index.test.d.ts +0 -2
  128. package/dist/plugins/getAuthentication/index.test.d.ts.map +0 -1
  129. package/dist/plugins/getAuthentication/index.test.js +0 -106
  130. package/dist/plugins/getAuthentication/schemas.d.ts +0 -7
  131. package/dist/plugins/getAuthentication/schemas.d.ts.map +0 -1
  132. package/dist/plugins/getAuthentication/schemas.js +0 -1
  133. package/dist/plugins/getInputFieldsSchema/index.d.ts +0 -23
  134. package/dist/plugins/getInputFieldsSchema/index.d.ts.map +0 -1
  135. package/dist/plugins/getInputFieldsSchema/index.js +0 -53
  136. package/dist/plugins/getInputFieldsSchema/index.test.d.ts +0 -2
  137. package/dist/plugins/getInputFieldsSchema/index.test.d.ts.map +0 -1
  138. package/dist/plugins/getInputFieldsSchema/index.test.js +0 -291
  139. package/dist/plugins/getInputFieldsSchema/schemas.d.ts +0 -28
  140. package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +0 -1
  141. package/dist/plugins/getInputFieldsSchema/schemas.js +0 -13
  142. package/dist/plugins/getProfile/index.d.ts +0 -25
  143. package/dist/plugins/getProfile/index.d.ts.map +0 -1
  144. package/dist/plugins/getProfile/index.js +0 -39
  145. package/dist/plugins/getProfile/schemas.d.ts +0 -13
  146. package/dist/plugins/getProfile/schemas.d.ts.map +0 -1
  147. package/dist/plugins/getProfile/schemas.js +0 -6
  148. package/dist/plugins/listActions/index.d.ts +0 -30
  149. package/dist/plugins/listActions/index.d.ts.map +0 -1
  150. package/dist/plugins/listActions/index.js +0 -75
  151. package/dist/plugins/listActions/index.test.d.ts +0 -2
  152. package/dist/plugins/listActions/index.test.d.ts.map +0 -1
  153. package/dist/plugins/listActions/index.test.js +0 -453
  154. package/dist/plugins/listActions/schemas.d.ts +0 -35
  155. package/dist/plugins/listActions/schemas.d.ts.map +0 -1
  156. package/dist/plugins/listActions/schemas.js +0 -22
  157. package/dist/plugins/listApps/index.d.ts +0 -19
  158. package/dist/plugins/listApps/index.d.ts.map +0 -1
  159. package/dist/plugins/listApps/index.js +0 -67
  160. package/dist/plugins/listApps/index.test.d.ts +0 -2
  161. package/dist/plugins/listApps/index.test.d.ts.map +0 -1
  162. package/dist/plugins/listApps/index.test.js +0 -121
  163. package/dist/plugins/listApps/schemas.d.ts +0 -47
  164. package/dist/plugins/listApps/schemas.d.ts.map +0 -1
  165. package/dist/plugins/listApps/schemas.js +0 -49
  166. package/dist/plugins/listAuthentications/index.d.ts +0 -24
  167. package/dist/plugins/listAuthentications/index.d.ts.map +0 -1
  168. package/dist/plugins/listAuthentications/index.js +0 -77
  169. package/dist/plugins/listAuthentications/index.test.d.ts +0 -2
  170. package/dist/plugins/listAuthentications/index.test.d.ts.map +0 -1
  171. package/dist/plugins/listAuthentications/index.test.js +0 -848
  172. package/dist/plugins/listAuthentications/schemas.d.ts +0 -30
  173. package/dist/plugins/listAuthentications/schemas.d.ts.map +0 -1
  174. package/dist/plugins/listAuthentications/schemas.js +0 -32
  175. package/dist/plugins/listInputFieldChoices/index.d.ts +0 -33
  176. package/dist/plugins/listInputFieldChoices/index.d.ts.map +0 -1
  177. package/dist/plugins/listInputFieldChoices/index.js +0 -115
  178. package/dist/plugins/listInputFieldChoices/index.test.d.ts +0 -2
  179. package/dist/plugins/listInputFieldChoices/index.test.d.ts.map +0 -1
  180. package/dist/plugins/listInputFieldChoices/index.test.js +0 -717
  181. package/dist/plugins/listInputFieldChoices/schemas.d.ts +0 -43
  182. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +0 -1
  183. package/dist/plugins/listInputFieldChoices/schemas.js +0 -65
  184. package/dist/plugins/listInputFields/index.d.ts +0 -34
  185. package/dist/plugins/listInputFields/index.d.ts.map +0 -1
  186. package/dist/plugins/listInputFields/index.js +0 -204
  187. package/dist/plugins/listInputFields/index.test.d.ts +0 -2
  188. package/dist/plugins/listInputFields/index.test.d.ts.map +0 -1
  189. package/dist/plugins/listInputFields/index.test.js +0 -359
  190. package/dist/plugins/listInputFields/schemas.d.ts +0 -35
  191. package/dist/plugins/listInputFields/schemas.d.ts.map +0 -1
  192. package/dist/plugins/listInputFields/schemas.js +0 -23
  193. package/dist/plugins/manifest/index.d.ts +0 -85
  194. package/dist/plugins/manifest/index.d.ts.map +0 -1
  195. package/dist/plugins/manifest/index.js +0 -376
  196. package/dist/plugins/manifest/index.test.d.ts +0 -2
  197. package/dist/plugins/manifest/index.test.d.ts.map +0 -1
  198. package/dist/plugins/manifest/index.test.js +0 -1139
  199. package/dist/plugins/manifest/schemas.d.ts +0 -57
  200. package/dist/plugins/manifest/schemas.d.ts.map +0 -1
  201. package/dist/plugins/manifest/schemas.js +0 -50
  202. package/dist/plugins/registry/index.d.ts +0 -21
  203. package/dist/plugins/registry/index.d.ts.map +0 -1
  204. package/dist/plugins/registry/index.js +0 -117
  205. package/dist/plugins/request/index.d.ts +0 -21
  206. package/dist/plugins/request/index.d.ts.map +0 -1
  207. package/dist/plugins/request/index.js +0 -76
  208. package/dist/plugins/request/index.test.d.ts +0 -2
  209. package/dist/plugins/request/index.test.d.ts.map +0 -1
  210. package/dist/plugins/request/index.test.js +0 -337
  211. package/dist/plugins/request/schemas.d.ts +0 -54
  212. package/dist/plugins/request/schemas.d.ts.map +0 -1
  213. package/dist/plugins/request/schemas.js +0 -41
  214. package/dist/plugins/runAction/index.d.ts +0 -33
  215. package/dist/plugins/runAction/index.d.ts.map +0 -1
  216. package/dist/plugins/runAction/index.js +0 -108
  217. package/dist/plugins/runAction/index.test.d.ts +0 -2
  218. package/dist/plugins/runAction/index.test.d.ts.map +0 -1
  219. package/dist/plugins/runAction/index.test.js +0 -333
  220. package/dist/plugins/runAction/schemas.d.ts +0 -34
  221. package/dist/plugins/runAction/schemas.d.ts.map +0 -1
  222. package/dist/plugins/runAction/schemas.js +0 -23
  223. package/dist/resolvers/actionKey.d.ts +0 -15
  224. package/dist/resolvers/actionKey.d.ts.map +0 -1
  225. package/dist/resolvers/actionKey.js +0 -19
  226. package/dist/resolvers/actionType.d.ts +0 -10
  227. package/dist/resolvers/actionType.d.ts.map +0 -1
  228. package/dist/resolvers/actionType.js +0 -21
  229. package/dist/resolvers/appKey.d.ts +0 -3
  230. package/dist/resolvers/appKey.d.ts.map +0 -1
  231. package/dist/resolvers/appKey.js +0 -5
  232. package/dist/resolvers/authenticationId.d.ts +0 -9
  233. package/dist/resolvers/authenticationId.d.ts.map +0 -1
  234. package/dist/resolvers/authenticationId.js +0 -42
  235. package/dist/resolvers/index.d.ts +0 -8
  236. package/dist/resolvers/index.d.ts.map +0 -1
  237. package/dist/resolvers/index.js +0 -8
  238. package/dist/resolvers/inputFieldKey.d.ts +0 -11
  239. package/dist/resolvers/inputFieldKey.d.ts.map +0 -1
  240. package/dist/resolvers/inputFieldKey.js +0 -47
  241. package/dist/resolvers/inputs.d.ts +0 -17
  242. package/dist/resolvers/inputs.d.ts.map +0 -1
  243. package/dist/resolvers/inputs.js +0 -50
  244. package/dist/schemas/Action.d.ts +0 -24
  245. package/dist/schemas/Action.d.ts.map +0 -1
  246. package/dist/schemas/Action.js +0 -40
  247. package/dist/schemas/App.d.ts +0 -57
  248. package/dist/schemas/App.d.ts.map +0 -1
  249. package/dist/schemas/App.js +0 -26
  250. package/dist/schemas/Auth.d.ts +0 -55
  251. package/dist/schemas/Auth.d.ts.map +0 -1
  252. package/dist/schemas/Auth.js +0 -33
  253. package/dist/schemas/Field.d.ts +0 -61
  254. package/dist/schemas/Field.d.ts.map +0 -1
  255. package/dist/schemas/Field.js +0 -116
  256. package/dist/schemas/Run.d.ts +0 -3
  257. package/dist/schemas/Run.d.ts.map +0 -1
  258. package/dist/schemas/Run.js +0 -31
  259. package/dist/schemas/UserProfile.d.ts +0 -13
  260. package/dist/schemas/UserProfile.d.ts.map +0 -1
  261. package/dist/schemas/UserProfile.js +0 -32
  262. package/dist/sdk.d.ts +0 -146
  263. package/dist/sdk.d.ts.map +0 -1
  264. package/dist/sdk.js +0 -112
  265. package/dist/sdk.test.d.ts +0 -2
  266. package/dist/sdk.test.d.ts.map +0 -1
  267. package/dist/sdk.test.js +0 -258
  268. package/dist/services/implementations.d.ts +0 -63
  269. package/dist/services/implementations.d.ts.map +0 -1
  270. package/dist/services/implementations.js +0 -80
  271. package/dist/types/domain.d.ts +0 -52
  272. package/dist/types/domain.d.ts.map +0 -1
  273. package/dist/types/domain.js +0 -1
  274. package/dist/types/domain.test.d.ts +0 -2
  275. package/dist/types/domain.test.d.ts.map +0 -1
  276. package/dist/types/domain.test.js +0 -39
  277. package/dist/types/errors.d.ts +0 -143
  278. package/dist/types/errors.d.ts.map +0 -1
  279. package/dist/types/errors.js +0 -187
  280. package/dist/types/events.d.ts +0 -38
  281. package/dist/types/events.d.ts.map +0 -1
  282. package/dist/types/events.js +0 -7
  283. package/dist/types/functions.d.ts +0 -27
  284. package/dist/types/functions.d.ts.map +0 -1
  285. package/dist/types/functions.js +0 -1
  286. package/dist/types/plugin.d.ts +0 -75
  287. package/dist/types/plugin.d.ts.map +0 -1
  288. package/dist/types/plugin.js +0 -9
  289. package/dist/types/properties.d.ts +0 -33
  290. package/dist/types/properties.d.ts.map +0 -1
  291. package/dist/types/properties.js +0 -52
  292. package/dist/types/sdk.d.ts +0 -69
  293. package/dist/types/sdk.d.ts.map +0 -1
  294. package/dist/types/sdk.js +0 -4
  295. package/dist/types/telemetry-events.d.ts +0 -105
  296. package/dist/types/telemetry-events.d.ts.map +0 -1
  297. package/dist/types/telemetry-events.js +0 -8
  298. package/dist/utils/array-utils.d.ts +0 -31
  299. package/dist/utils/array-utils.d.ts.map +0 -1
  300. package/dist/utils/array-utils.js +0 -36
  301. package/dist/utils/array-utils.test.d.ts +0 -2
  302. package/dist/utils/array-utils.test.d.ts.map +0 -1
  303. package/dist/utils/array-utils.test.js +0 -107
  304. package/dist/utils/batch-utils.d.ts +0 -72
  305. package/dist/utils/batch-utils.d.ts.map +0 -1
  306. package/dist/utils/batch-utils.js +0 -162
  307. package/dist/utils/batch-utils.test.d.ts +0 -2
  308. package/dist/utils/batch-utils.test.d.ts.map +0 -1
  309. package/dist/utils/batch-utils.test.js +0 -476
  310. package/dist/utils/domain-utils.d.ts +0 -66
  311. package/dist/utils/domain-utils.d.ts.map +0 -1
  312. package/dist/utils/domain-utils.js +0 -164
  313. package/dist/utils/domain-utils.test.d.ts +0 -2
  314. package/dist/utils/domain-utils.test.d.ts.map +0 -1
  315. package/dist/utils/domain-utils.test.js +0 -346
  316. package/dist/utils/file-utils.d.ts +0 -4
  317. package/dist/utils/file-utils.d.ts.map +0 -1
  318. package/dist/utils/file-utils.js +0 -74
  319. package/dist/utils/file-utils.test.d.ts +0 -2
  320. package/dist/utils/file-utils.test.d.ts.map +0 -1
  321. package/dist/utils/file-utils.test.js +0 -51
  322. package/dist/utils/function-utils.d.ts +0 -73
  323. package/dist/utils/function-utils.d.ts.map +0 -1
  324. package/dist/utils/function-utils.js +0 -245
  325. package/dist/utils/function-utils.test.d.ts +0 -2
  326. package/dist/utils/function-utils.test.d.ts.map +0 -1
  327. package/dist/utils/function-utils.test.js +0 -110
  328. package/dist/utils/id-utils.d.ts +0 -13
  329. package/dist/utils/id-utils.d.ts.map +0 -1
  330. package/dist/utils/id-utils.js +0 -22
  331. package/dist/utils/id-utils.test.d.ts +0 -2
  332. package/dist/utils/id-utils.test.d.ts.map +0 -1
  333. package/dist/utils/id-utils.test.js +0 -22
  334. package/dist/utils/pagination-utils.d.ts +0 -37
  335. package/dist/utils/pagination-utils.d.ts.map +0 -1
  336. package/dist/utils/pagination-utils.js +0 -165
  337. package/dist/utils/pagination-utils.test.d.ts +0 -17
  338. package/dist/utils/pagination-utils.test.d.ts.map +0 -1
  339. package/dist/utils/pagination-utils.test.js +0 -461
  340. package/dist/utils/retry-utils.d.ts +0 -45
  341. package/dist/utils/retry-utils.d.ts.map +0 -1
  342. package/dist/utils/retry-utils.js +0 -51
  343. package/dist/utils/retry-utils.test.d.ts +0 -2
  344. package/dist/utils/retry-utils.test.d.ts.map +0 -1
  345. package/dist/utils/retry-utils.test.js +0 -90
  346. package/dist/utils/schema-utils.d.ts +0 -69
  347. package/dist/utils/schema-utils.d.ts.map +0 -1
  348. package/dist/utils/schema-utils.js +0 -72
  349. package/dist/utils/string-utils.d.ts +0 -40
  350. package/dist/utils/string-utils.d.ts.map +0 -1
  351. package/dist/utils/string-utils.js +0 -69
  352. package/dist/utils/string-utils.test.d.ts +0 -2
  353. package/dist/utils/string-utils.test.d.ts.map +0 -1
  354. package/dist/utils/string-utils.test.js +0 -59
  355. package/dist/utils/telemetry-utils.d.ts +0 -44
  356. package/dist/utils/telemetry-utils.d.ts.map +0 -1
  357. package/dist/utils/telemetry-utils.js +0 -55
  358. package/dist/utils/telemetry-utils.test.d.ts +0 -2
  359. package/dist/utils/telemetry-utils.test.d.ts.map +0 -1
  360. package/dist/utils/telemetry-utils.test.js +0 -94
  361. package/dist/utils/url-utils.d.ts +0 -19
  362. package/dist/utils/url-utils.d.ts.map +0 -1
  363. package/dist/utils/url-utils.js +0 -62
  364. package/dist/utils/url-utils.test.d.ts +0 -2
  365. package/dist/utils/url-utils.test.d.ts.map +0 -1
  366. package/dist/utils/url-utils.test.js +0 -103
  367. package/dist/utils/validation.d.ts +0 -4
  368. package/dist/utils/validation.d.ts.map +0 -1
  369. package/dist/utils/validation.js +0 -30
  370. package/dist/utils/validation.test.d.ts +0 -2
  371. package/dist/utils/validation.test.d.ts.map +0 -1
  372. package/dist/utils/validation.test.js +0 -44
@@ -1,322 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Base Zod schemas for API response models.
4
- * These schemas represent the raw data structures returned by Zapier API endpoints.
5
- * All TypeScript types in api/types.ts are inferred from these schemas.
6
- */
7
- // ============================================================================
8
- // Basic Building Block Schemas
9
- // ============================================================================
10
- export const NeedChoicesSchema = z.object({
11
- key: z.string().optional(),
12
- label: z.string().optional(),
13
- sample: z.string().optional(),
14
- value: z.string().optional(),
15
- });
16
- export const NeedSchema = z.object({
17
- key: z.string(),
18
- alters_custom_fields: z.boolean().nullable().optional(),
19
- capabilities: z.array(z.string()).optional(),
20
- choices: z.array(NeedChoicesSchema).optional(),
21
- computed: z.boolean().nullable().optional(),
22
- custom_field: z.boolean().optional(),
23
- default: z.string().optional(),
24
- depends_on: z.array(z.string()).optional(),
25
- format: z.literal("SELECT").optional(),
26
- from_search: z.boolean().optional(),
27
- from_write: z.boolean().optional(),
28
- help_text: z.string().optional(),
29
- help_text_html: z.string().optional(),
30
- input_format: z.array(z.string()).optional(),
31
- label: z.string().optional(),
32
- language: z.string().optional(),
33
- parent_key: z.string().optional(),
34
- placeholder: z.string().optional(),
35
- prefill: z.string().optional(),
36
- required: z.boolean().optional(),
37
- searchfill: z.string().optional(),
38
- send_in_json: z.boolean().optional(),
39
- regex: z.string().optional(),
40
- type: z
41
- .enum([
42
- "integer",
43
- "string",
44
- "text",
45
- "datetime",
46
- "boolean",
47
- "file",
48
- "decimal",
49
- "copy",
50
- "password",
51
- "dict",
52
- "code",
53
- "filter",
54
- "json",
55
- ])
56
- .optional(),
57
- list: z.boolean().optional(),
58
- });
59
- export const ActionLinksSchema = z.object({
60
- action_url: z.string().optional(),
61
- });
62
- export const ActionPermissionsSchema = z.object({
63
- can_use: z.boolean().optional(),
64
- });
65
- export const ActionSchema = z.object({
66
- id: z.string().optional(),
67
- type: z.enum([
68
- "filter",
69
- "read",
70
- "read_bulk",
71
- "run",
72
- "search",
73
- "search_and_write",
74
- "search_or_write",
75
- "write",
76
- ]),
77
- key: z.string(),
78
- name: z.string(),
79
- description: z.string(),
80
- is_important: z.boolean().optional(),
81
- is_hidden: z.boolean().optional(),
82
- selected_api: z.string().optional(),
83
- });
84
- export const ChoiceSchema = z.object({
85
- value: z.union([z.string(), z.number()]),
86
- label: z.string(),
87
- });
88
- export const FieldSchema = z.object({
89
- key: z.string(),
90
- label: z.string(),
91
- type: z.enum([
92
- "string",
93
- "number",
94
- "boolean",
95
- "datetime",
96
- "file",
97
- "object",
98
- "array",
99
- ]),
100
- required: z.boolean(),
101
- description: z.string().optional(),
102
- choices: z.array(ChoiceSchema).optional(),
103
- });
104
- export const ActionExecutionResultSchema = z.object({
105
- data: z.array(z.unknown()),
106
- });
107
- export const ActionFieldChoiceSchema = z.object({
108
- value: z.union([z.string(), z.number()]),
109
- label: z.string(),
110
- });
111
- export const ActionFieldSchema = z.object({
112
- key: z.string(),
113
- label: z.string().optional(),
114
- required: z.boolean(),
115
- type: z.string().optional(),
116
- helpText: z.string().optional(),
117
- helpTextHtml: z.string().optional(),
118
- choices: z.array(ActionFieldChoiceSchema).optional(),
119
- default: z.string().optional(),
120
- placeholder: z.string().optional(),
121
- computed: z.boolean().optional(),
122
- customField: z.boolean().optional(),
123
- dependsOn: z.array(z.string()).optional(),
124
- format: z.string().optional(),
125
- inputFormat: z.array(z.string()).optional(),
126
- });
127
- // ============================================================================
128
- // Main API Entity Schemas
129
- // ============================================================================
130
- export const UserProfileSchema = z.object({
131
- id: z.number(),
132
- code: z.string(),
133
- user_id: z.number(),
134
- auto_provisioned: z.boolean(),
135
- first_name: z.string(),
136
- last_name: z.string(),
137
- username: z.string(),
138
- personas: z.string(),
139
- user_generated_personas: z.string(),
140
- last_login: z.string(),
141
- email: z.string(),
142
- email_hash: z.string(),
143
- email_confirmed: z.boolean(),
144
- timezone: z.string(),
145
- photo_url: z.string(),
146
- has_seen_notifications: z.record(z.string(), z.boolean().nullable()),
147
- signup: z.string(),
148
- since_signup: z.string(),
149
- has_activated: z.boolean(),
150
- enable_gz_creator: z.boolean(),
151
- should_see_nps_survey: z.boolean(),
152
- is_developer: z.boolean(),
153
- is_expert: z.boolean(),
154
- tos_agreement: z.boolean(),
155
- should_renew_tos: z.boolean(),
156
- is_gdpr_consented: z.boolean(),
157
- disable_ssl_check: z.boolean(),
158
- identity: z.number(),
159
- summary_schedule: z.string(),
160
- alert_triggers: z.string(),
161
- alert_actions: z.string(),
162
- is_staff: z.boolean(),
163
- is_zt_reviewer: z.boolean(),
164
- is_high_value: z.boolean(),
165
- is_temporary: z.boolean(),
166
- banner_message: z.string(),
167
- enable_totp_2fa: z.boolean(),
168
- viewed_help: z.record(z.string(), z.boolean()),
169
- show_editor_migration_mesaging: z.boolean(),
170
- switches: z.record(z.string(), z.unknown()),
171
- organizations: z.array(z.record(z.string(), z.unknown()).nullable()),
172
- primary_organization: z.record(z.string(), z.unknown()).nullable(),
173
- has_active_zaps: z.boolean(),
174
- has_google_sso: z.boolean(),
175
- auth_realm: z.string(),
176
- roles: z.array(z.object({
177
- account_id: z.number(),
178
- role: z.string(),
179
- })),
180
- });
181
- export const AppSchema = z.object({
182
- age_in_days: z.string().optional(),
183
- api_docs_url: z.string().nullable().optional(),
184
- app_profile_url: z.string(),
185
- banner: z.string().optional(),
186
- categories: z.array(z.string()).optional(), // Service category names
187
- canonical_id: z.string().optional(),
188
- current_implementation_id: z.string(),
189
- days_since_last_update: z.string().optional(),
190
- description: z.string(),
191
- external_url: z.string(),
192
- hashtag: z.string().optional(),
193
- id: z.number().optional(),
194
- image: z.string().optional(),
195
- images: z.string().optional(),
196
- integration_overview_html: z.string().nullable().optional(),
197
- internal_id: z.string(),
198
- invite_url: z.string().nullable().optional(),
199
- is_beta: z.string().optional(),
200
- is_built_in: z.string().optional(),
201
- is_featured: z.string().optional(),
202
- is_premium: z.boolean().optional(),
203
- is_public: z.string().optional(),
204
- is_upcoming: z.string().optional(),
205
- learn_more_url: z.string(),
206
- name: z.string(),
207
- popularity: z.number(),
208
- primary_color: z.string(),
209
- request_count: z.string().optional(),
210
- slug: z.string(),
211
- zap_usage_count: z.number().nullable().optional(),
212
- });
213
- export const ServiceSchema = z.object({
214
- id: z.number().optional(),
215
- canonical_id: z.string().optional(),
216
- current_implementation_id: z.string(),
217
- name: z.string(),
218
- slug: z.string(),
219
- app_url: z.string().optional(),
220
- learn_more_url: z.string().optional(),
221
- description: z.string(),
222
- primary_color: z.string(),
223
- popularity: z.number(),
224
- image: z.string().optional(),
225
- images: z.string().optional(),
226
- });
227
- export const ServicesResponseSchema = z.object({
228
- results: z.array(ServiceSchema),
229
- next: z.string().nullable().optional(),
230
- previous: z.string().nullable().optional(),
231
- });
232
- // ============================================================================
233
- // Request/Response Schemas
234
- // ============================================================================
235
- export const NeedsRequestSchema = z.object({
236
- selected_api: z.string(),
237
- action: z.string(),
238
- type_of: z.string(),
239
- authentication_id: z.number().optional(),
240
- params: z.record(z.string(), z.unknown()).optional(),
241
- });
242
- export const NeedsResponseSchema = z.object({
243
- success: z.boolean(),
244
- needs: z.array(NeedSchema).optional(),
245
- errors: z.array(z.string()).optional(),
246
- last_fetched_at: z.string().optional(),
247
- schema: z.record(z.string(), z.unknown()).optional(),
248
- });
249
- // ============================================================================
250
- // Implementation Schema
251
- // ============================================================================
252
- export const ImplementationSchema = z.object({
253
- selected_api: z.string(),
254
- app_id: z.number().optional(),
255
- auth_type: z.string().optional(),
256
- auth_fields: z.string().optional(),
257
- actions: z.array(ActionSchema).optional(),
258
- is_deprecated: z.boolean().optional(),
259
- is_private_only: z.boolean().optional(),
260
- is_invite_only: z.boolean().optional(),
261
- is_beta: z.boolean().optional().default(false),
262
- is_premium: z.boolean().optional().default(false),
263
- is_hidden: z.string().optional(),
264
- name: z.string().optional(),
265
- slug: z.string().optional(),
266
- images: z.record(z.string(), z.string().nullable()).optional(),
267
- primary_color: z.string().optional(),
268
- secondary_color: z.string().optional(),
269
- current_implementation: z.string().optional(),
270
- other_implementations: z.string().optional(),
271
- });
272
- export const ImplementationsResponseSchema = z.object({
273
- count: z.number(),
274
- next: z.string().nullable().optional(),
275
- previous: z.string().nullable().optional(),
276
- results: z.array(ImplementationSchema),
277
- });
278
- // ============================================================================
279
- // Need Choices Schemas (for listInputFieldChoices functionality)
280
- // ============================================================================
281
- export const NeedChoicesResponseMetaSchema = z.object({
282
- page: z.string().nullable().optional(),
283
- });
284
- export const NeedChoicesResponseLinksSchema = z.object({
285
- next: z.string().nullable().optional(),
286
- prev: z.string().nullable().optional(),
287
- });
288
- export const NeedChoicesRequestSchema = z.object({
289
- selected_api: z
290
- .string()
291
- .optional()
292
- .describe("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."),
293
- authentication_id: z.coerce
294
- .number()
295
- .optional()
296
- .describe("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)."),
297
- params: z
298
- .record(z.string(), z.unknown())
299
- .optional()
300
- .describe("Object that matches the input the node would normally get. Has all the same keys/types as the `needs` of the action."),
301
- page: z.number().optional().default(0),
302
- prefill: z
303
- .string()
304
- .optional()
305
- .describe("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."),
306
- action_id: z
307
- .string()
308
- .optional()
309
- .describe("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."),
310
- input_field_id: z
311
- .string()
312
- .optional()
313
- .describe("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."),
314
- });
315
- export const NeedChoicesResponseSchema = z.object({
316
- success: z.boolean(),
317
- choices: z.array(NeedChoicesSchema).optional(),
318
- next_page: z.number().optional(),
319
- errors: z.array(z.string()).optional(),
320
- meta: NeedChoicesResponseMetaSchema.optional(),
321
- links: NeedChoicesResponseLinksSchema.optional(),
322
- });
@@ -1,83 +0,0 @@
1
- /**
2
- * API Client Type Definitions
3
- *
4
- * This module contains all type definitions related to the Zapier API client,
5
- * including configuration options, client interfaces, request/response types,
6
- * and API response models.
7
- *
8
- * API response model types are inferred from Zod schemas defined in api/schemas.ts
9
- * to ensure a single source of truth and eliminate duplication.
10
- */
11
- import type { AuthenticationSchema, AuthenticationsResponseSchema } from "@zapier/zapier-sdk-core/v0/schemas/authentications";
12
- import type { ImplementationMetaSchema, ImplementationsMetaResponseSchema } from "@zapier/zapier-sdk-core/v0/schemas/implementations";
13
- import type { SdkEvent } from "../types/events";
14
- import type { z } from "zod";
15
- import type { NeedChoicesSchema, NeedSchema, ActionLinksSchema, ActionPermissionsSchema, ActionSchema, ChoiceSchema, FieldSchema, ActionExecutionResultSchema, ActionFieldChoiceSchema, ActionFieldSchema, UserProfileSchema, AppSchema, NeedsRequestSchema, NeedsResponseSchema, ImplementationSchema, ImplementationsResponseSchema, ServiceSchema, ServicesResponseSchema, NeedChoicesRequestSchema, NeedChoicesResponseSchema, NeedChoicesResponseMetaSchema, NeedChoicesResponseLinksSchema } from "./schemas";
16
- export interface ApiClientOptions {
17
- baseUrl: string;
18
- authBaseUrl?: string;
19
- authClientId?: string;
20
- token?: string;
21
- getToken?: () => Promise<string | undefined>;
22
- debug?: boolean;
23
- fetch?: typeof globalThis.fetch;
24
- onEvent?: (event: SdkEvent) => void;
25
- }
26
- export interface ApiClient {
27
- get: <T = unknown>(path: string, options?: RequestOptions) => Promise<T>;
28
- post: <T = unknown>(path: string, data?: unknown, options?: RequestOptions) => Promise<T>;
29
- put: <T = unknown>(path: string, data?: unknown, options?: RequestOptions) => Promise<T>;
30
- delete: <T = unknown>(path: string, options?: RequestOptions) => Promise<T>;
31
- poll: <T = unknown>(path: string, options?: PollOptions) => Promise<T>;
32
- fetch: (path: string, init?: RequestInit & {
33
- searchParams?: Record<string, string>;
34
- authRequired?: boolean;
35
- }) => Promise<Response>;
36
- }
37
- export interface RequestOptions {
38
- headers?: Record<string, string>;
39
- searchParams?: Record<string, string>;
40
- authRequired?: boolean;
41
- customErrorHandler?: (errorInfo: {
42
- status: number;
43
- statusText: string;
44
- data: unknown;
45
- }) => Error | undefined;
46
- }
47
- export interface PollOptions extends RequestOptions {
48
- initialDelay?: number;
49
- timeoutMs?: number;
50
- successStatus?: number;
51
- pendingStatus?: number;
52
- resultExtractor?: (response: unknown) => unknown;
53
- }
54
- export interface DebugLogger {
55
- (message: string, data?: unknown): void;
56
- }
57
- export type NeedChoices = z.infer<typeof NeedChoicesSchema>;
58
- export type Need = z.infer<typeof NeedSchema>;
59
- export type ActionLinks = z.infer<typeof ActionLinksSchema>;
60
- export type ActionPermissions = z.infer<typeof ActionPermissionsSchema>;
61
- export type Action = z.infer<typeof ActionSchema>;
62
- export type Choice = z.infer<typeof ChoiceSchema>;
63
- export type Field = z.infer<typeof FieldSchema>;
64
- export type ActionExecutionResult = z.infer<typeof ActionExecutionResultSchema>;
65
- export type ActionFieldChoice = z.infer<typeof ActionFieldChoiceSchema>;
66
- export type ActionField = z.infer<typeof ActionFieldSchema>;
67
- export type Authentication = z.infer<typeof AuthenticationSchema>;
68
- export type AuthenticationsResponse = z.infer<typeof AuthenticationsResponseSchema>;
69
- export type UserProfile = z.infer<typeof UserProfileSchema>;
70
- export type App = z.infer<typeof AppSchema>;
71
- export type Service = z.infer<typeof ServiceSchema>;
72
- export type ServicesResponse = z.infer<typeof ServicesResponseSchema>;
73
- export type NeedsRequest = z.infer<typeof NeedsRequestSchema>;
74
- export type NeedsResponse = z.infer<typeof NeedsResponseSchema>;
75
- export type Implementation = z.infer<typeof ImplementationSchema>;
76
- export type ImplementationsResponse = z.infer<typeof ImplementationsResponseSchema>;
77
- export type ImplementationMeta = z.infer<typeof ImplementationMetaSchema>;
78
- export type ImplementationsMetaResponse = z.infer<typeof ImplementationsMetaResponseSchema>;
79
- export type NeedChoicesRequest = z.infer<typeof NeedChoicesRequestSchema>;
80
- export type NeedChoicesResponse = z.infer<typeof NeedChoicesResponseSchema>;
81
- export type NeedChoicesResponseMeta = z.infer<typeof NeedChoicesResponseMetaSchema>;
82
- export type NeedChoicesResponseLinks = z.infer<typeof NeedChoicesResponseLinksSchema>;
83
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EACV,oBAAoB,EACpB,6BAA6B,EAC9B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,KAAK,EACV,wBAAwB,EACxB,iCAAiC,EAClC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,2BAA2B,EAC3B,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,6BAA6B,EAC7B,aAAa,EACb,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC/B,MAAM,WAAW,CAAC;AAMnB,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS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,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC"}
package/dist/api/types.js DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/auth.d.ts DELETED
@@ -1,52 +0,0 @@
1
- /**
2
- * SDK Authentication Utilities
3
- *
4
- * This module provides SDK-level authentication utilities focused
5
- * solely on token acquisition. CLI-specific functionality like login/logout
6
- * is handled by the @zapier/zapier-sdk-cli-login package.
7
- */
8
- import type { EventCallback } from "./types/events";
9
- export type { SdkEvent, AuthEvent, ApiEvent, LoadingEvent, EventCallback, } from "./types/events";
10
- export interface AuthOptions {
11
- onEvent?: EventCallback;
12
- fetch?: typeof globalThis.fetch;
13
- baseUrl?: string;
14
- authBaseUrl?: string;
15
- authClientId?: string;
16
- }
17
- export interface ResolveAuthTokenOptions extends AuthOptions {
18
- token?: string;
19
- getToken?: () => Promise<string | undefined> | string | undefined;
20
- }
21
- /**
22
- * Gets the ZAPIER_TOKEN from environment variables.
23
- * Returns undefined if not set.
24
- */
25
- export declare function getTokenFromEnv(): string | undefined;
26
- /**
27
- * Attempts to get a token by optionally importing from CLI login package.
28
- * This provides a graceful fallback when the CLI login package is not available.
29
- *
30
- * Returns undefined if no valid token is found or CLI package is not available.
31
- */
32
- export declare function getTokenFromCliLogin(options?: AuthOptions): Promise<string | undefined>;
33
- /**
34
- * Attempts to get a token with the following precedence:
35
- * 1. ZAPIER_TOKEN environment variable
36
- * 2. CLI login package (if available) with auto-refresh
37
- *
38
- * Returns undefined if no valid token is found.
39
- */
40
- export declare function getTokenFromEnvOrConfig(options?: AuthOptions): Promise<string | undefined>;
41
- /**
42
- * Resolves an auth token from all possible sources with the following precedence:
43
- * 1. Explicitly provided token in options
44
- * 2. Token from getToken callback in options
45
- * 3. ZAPIER_TOKEN environment variable
46
- * 4. CLI login package (if available)
47
- *
48
- * This is the canonical token resolution logic used throughout the SDK.
49
- * Returns undefined if no valid token is found.
50
- */
51
- export declare function resolveAuthToken(options?: ResolveAuthTokenOptions): Promise<string | undefined>;
52
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD,YAAY,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;CACnE;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,SAAS,CAEpD;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAS7B;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAS7B;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAgB7B"}
package/dist/auth.js DELETED
@@ -1,72 +0,0 @@
1
- /**
2
- * SDK Authentication Utilities
3
- *
4
- * This module provides SDK-level authentication utilities focused
5
- * solely on token acquisition. CLI-specific functionality like login/logout
6
- * is handled by the @zapier/zapier-sdk-cli-login package.
7
- */
8
- /**
9
- * Gets the ZAPIER_TOKEN from environment variables.
10
- * Returns undefined if not set.
11
- */
12
- export function getTokenFromEnv() {
13
- return process.env.ZAPIER_TOKEN;
14
- }
15
- /**
16
- * Attempts to get a token by optionally importing from CLI login package.
17
- * This provides a graceful fallback when the CLI login package is not available.
18
- *
19
- * Returns undefined if no valid token is found or CLI package is not available.
20
- */
21
- export async function getTokenFromCliLogin(options = {}) {
22
- try {
23
- // Dynamically import the CLI login package if available
24
- const { getToken } = await import("@zapier/zapier-sdk-cli-login");
25
- return await getToken(options);
26
- }
27
- catch {
28
- // CLI login package is not available, return undefined
29
- return undefined;
30
- }
31
- }
32
- /**
33
- * Attempts to get a token with the following precedence:
34
- * 1. ZAPIER_TOKEN environment variable
35
- * 2. CLI login package (if available) with auto-refresh
36
- *
37
- * Returns undefined if no valid token is found.
38
- */
39
- export async function getTokenFromEnvOrConfig(options = {}) {
40
- // First priority: environment variable
41
- const envToken = getTokenFromEnv();
42
- if (envToken) {
43
- return envToken;
44
- }
45
- // Second priority: CLI login package (if available)
46
- return getTokenFromCliLogin(options);
47
- }
48
- /**
49
- * Resolves an auth token from all possible sources with the following precedence:
50
- * 1. Explicitly provided token in options
51
- * 2. Token from getToken callback in options
52
- * 3. ZAPIER_TOKEN environment variable
53
- * 4. CLI login package (if available)
54
- *
55
- * This is the canonical token resolution logic used throughout the SDK.
56
- * Returns undefined if no valid token is found.
57
- */
58
- export async function resolveAuthToken(options = {}) {
59
- // First priority: explicitly provided token
60
- if (options.token) {
61
- return options.token;
62
- }
63
- // Second priority: getToken callback
64
- if (options.getToken) {
65
- const token = await options.getToken();
66
- if (token) {
67
- return token;
68
- }
69
- }
70
- // Third and fourth priorities: environment variable or CLI login
71
- return getTokenFromEnvOrConfig(options);
72
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=auth.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.test.d.ts","sourceRoot":"","sources":["../src/auth.test.ts"],"names":[],"mappings":""}
package/dist/auth.test.js DELETED
@@ -1,102 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from "vitest";
2
- import * as auth from "./auth";
3
- // Mock the CLI login package
4
- const mockGetToken = vi.fn();
5
- vi.mock("@zapier/zapier-sdk-cli-login", () => ({
6
- getToken: mockGetToken,
7
- }));
8
- describe("auth", () => {
9
- beforeEach(() => {
10
- vi.clearAllMocks();
11
- delete process.env.ZAPIER_TOKEN;
12
- });
13
- describe("getTokenFromEnv", () => {
14
- it("should return ZAPIER_TOKEN when set", () => {
15
- process.env.ZAPIER_TOKEN = "test-token";
16
- expect(auth.getTokenFromEnv()).toBe("test-token");
17
- });
18
- it("should return undefined when ZAPIER_TOKEN is not set", () => {
19
- delete process.env.ZAPIER_TOKEN;
20
- expect(auth.getTokenFromEnv()).toBeUndefined();
21
- });
22
- });
23
- describe("getTokenFromCliLogin", () => {
24
- it("should pass all options to CLI login package getToken", async () => {
25
- mockGetToken.mockResolvedValue("cli-token");
26
- const options = {
27
- baseUrl: "https://api.custom.zapier.com",
28
- authBaseUrl: "https://auth.custom.zapier.com",
29
- onEvent: vi.fn(),
30
- fetch: vi.fn(),
31
- };
32
- const result = await auth.getTokenFromCliLogin(options);
33
- expect(result).toBe("cli-token");
34
- expect(mockGetToken).toHaveBeenCalledWith(options);
35
- });
36
- it("should pass empty options when none provided", async () => {
37
- mockGetToken.mockResolvedValue("cli-token");
38
- const result = await auth.getTokenFromCliLogin();
39
- expect(result).toBe("cli-token");
40
- expect(mockGetToken).toHaveBeenCalledWith({});
41
- });
42
- it("should return undefined when CLI login package throws error", async () => {
43
- mockGetToken.mockRejectedValue(new Error("CLI not available"));
44
- const result = await auth.getTokenFromCliLogin();
45
- expect(result).toBeUndefined();
46
- });
47
- });
48
- describe("getTokenFromEnvOrConfig", () => {
49
- it("should prioritize ZAPIER_TOKEN environment variable", async () => {
50
- process.env.ZAPIER_TOKEN = "env-token";
51
- mockGetToken.mockResolvedValue("cli-token");
52
- const result = await auth.getTokenFromEnvOrConfig();
53
- expect(result).toBe("env-token");
54
- expect(mockGetToken).not.toHaveBeenCalled();
55
- });
56
- it("should fall back to CLI login with options when env token not available", async () => {
57
- delete process.env.ZAPIER_TOKEN;
58
- mockGetToken.mockResolvedValue("cli-token");
59
- const options = {
60
- baseUrl: "https://api.custom.zapier.com",
61
- authBaseUrl: "https://auth.custom.zapier.com",
62
- onEvent: vi.fn(),
63
- fetch: vi.fn(),
64
- };
65
- const result = await auth.getTokenFromEnvOrConfig(options);
66
- expect(result).toBe("cli-token");
67
- expect(mockGetToken).toHaveBeenCalledWith(options);
68
- });
69
- it("should return undefined when both env token and CLI login fail", async () => {
70
- delete process.env.ZAPIER_TOKEN;
71
- mockGetToken.mockRejectedValue(new Error("CLI not available"));
72
- const result = await auth.getTokenFromEnvOrConfig();
73
- expect(result).toBeUndefined();
74
- });
75
- it("should pass authBaseUrl through the authentication chain", async () => {
76
- delete process.env.ZAPIER_TOKEN;
77
- mockGetToken.mockResolvedValue("cli-token");
78
- const options = {
79
- authBaseUrl: "https://custom-auth.zapier.dev",
80
- baseUrl: "https://api.zapier.dev",
81
- };
82
- await auth.getTokenFromEnvOrConfig(options);
83
- expect(mockGetToken).toHaveBeenCalledWith({
84
- authBaseUrl: "https://custom-auth.zapier.dev",
85
- baseUrl: "https://api.zapier.dev",
86
- });
87
- });
88
- it("should pass undefined authBaseUrl when not provided", async () => {
89
- delete process.env.ZAPIER_TOKEN;
90
- mockGetToken.mockResolvedValue("cli-token");
91
- const options = {
92
- baseUrl: "https://api.zapier.dev",
93
- // authBaseUrl intentionally omitted
94
- };
95
- await auth.getTokenFromEnvOrConfig(options);
96
- expect(mockGetToken).toHaveBeenCalledWith({
97
- baseUrl: "https://api.zapier.dev",
98
- authBaseUrl: undefined,
99
- });
100
- });
101
- });
102
- });
@@ -1,14 +0,0 @@
1
- /**
2
- * SDK Constants
3
- *
4
- * This module contains shared constants used throughout the SDK.
5
- */
6
- /**
7
- * Base URL for Zapier API endpoints
8
- */
9
- export declare const ZAPIER_BASE_URL: string;
10
- /**
11
- * Maximum number of items that can be requested per page across all paginated functions
12
- */
13
- export declare const MAX_PAGE_LIMIT = 10000;
14
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe,QACyB,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,cAAc,QAAQ,CAAC"}