@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
@@ -1,389 +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
- // Lightweight Implementation Meta Schema
280
- // ============================================================================
281
- export const ImplementationMetaSchema = z.object({
282
- id: z.string(), // e.g. "100HiresCLIAPI@1.2.1"
283
- name: z.string(),
284
- slug: z.string(),
285
- age_in_days: z.number().optional(),
286
- auth_type: z.string().optional(),
287
- banner: z.string().optional(),
288
- categories: z
289
- .array(z.object({
290
- id: z.number(),
291
- name: z.string(),
292
- slug: z.string(),
293
- }))
294
- .optional(),
295
- images: z
296
- .object({
297
- url_16x16: z.string().optional(),
298
- url_32x32: z.string().optional(),
299
- url_64x64: z.string().optional(),
300
- url_128x128: z.string().optional(),
301
- })
302
- .optional(),
303
- popularity: z.number().optional(),
304
- has_filters: z.boolean().optional(),
305
- has_reads: z.boolean().optional(),
306
- has_searches: z.boolean().optional(),
307
- has_searches_or_writes: z.boolean().optional(),
308
- has_upfront_fields: z.boolean().optional(),
309
- has_writes: z.boolean().optional(),
310
- is_beta: z.boolean().optional(),
311
- is_built_in: z.boolean().optional(),
312
- is_deprecated: z.boolean().optional(),
313
- is_featured: z.boolean().optional(),
314
- is_hidden: z.boolean().optional(),
315
- is_invite: z.boolean().optional(),
316
- is_premium: z.boolean().optional(),
317
- is_public: z.boolean().optional(),
318
- is_upcoming: z.boolean().optional(),
319
- version: z.string().optional(),
320
- visibility: z.string().optional(),
321
- actions: z
322
- .object({
323
- read: z.number().optional(),
324
- read_bulk: z.number().optional(),
325
- write: z.number().optional(),
326
- search: z.number().optional(),
327
- search_or_write: z.number().optional(),
328
- search_and_write: z.number().optional(),
329
- filter: z.number().optional(),
330
- })
331
- .optional(),
332
- description: z.string().optional(),
333
- primary_color: z.string().optional(),
334
- secondary_color: z.string().optional(),
335
- classification: z.string().optional(),
336
- api_docs_url: z.string().optional(),
337
- image: z.string().optional(),
338
- });
339
- export const ImplementationsMetaResponseSchema = z.object({
340
- count: z.number(),
341
- next: z.string().nullable().optional(),
342
- previous: z.string().nullable().optional(),
343
- results: z.array(ImplementationMetaSchema),
344
- });
345
- // ============================================================================
346
- // Need Choices Schemas (for listInputFieldChoices functionality)
347
- // ============================================================================
348
- export const NeedChoicesResponseMetaSchema = z.object({
349
- page: z.string().nullable().optional(),
350
- });
351
- export const NeedChoicesResponseLinksSchema = z.object({
352
- next: z.string().nullable().optional(),
353
- prev: z.string().nullable().optional(),
354
- });
355
- export const NeedChoicesRequestSchema = z.object({
356
- selected_api: z
357
- .string()
358
- .optional()
359
- .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."),
360
- authentication_id: z.coerce
361
- .number()
362
- .optional()
363
- .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)."),
364
- params: z
365
- .record(z.string(), z.unknown())
366
- .optional()
367
- .describe("Object that matches the input the node would normally get. Has all the same keys/types as the `needs` of the action."),
368
- page: z.number().optional().default(0),
369
- prefill: z
370
- .string()
371
- .optional()
372
- .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."),
373
- action_id: z
374
- .string()
375
- .optional()
376
- .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."),
377
- input_field_id: z
378
- .string()
379
- .optional()
380
- .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."),
381
- });
382
- export const NeedChoicesResponseSchema = z.object({
383
- success: z.boolean(),
384
- choices: z.array(NeedChoicesSchema).optional(),
385
- next_page: z.number().optional(),
386
- errors: z.array(z.string()).optional(),
387
- meta: NeedChoicesResponseMetaSchema.optional(),
388
- links: NeedChoicesResponseLinksSchema.optional(),
389
- });
@@ -1,82 +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 { SdkEvent } from "../types/events";
13
- import type { z } from "zod";
14
- import type { NeedChoicesSchema, NeedSchema, ActionLinksSchema, ActionPermissionsSchema, ActionSchema, ChoiceSchema, FieldSchema, ActionExecutionResultSchema, ActionFieldChoiceSchema, ActionFieldSchema, UserProfileSchema, AppSchema, NeedsRequestSchema, NeedsResponseSchema, ImplementationSchema, ImplementationsResponseSchema, ImplementationMetaSchema, ImplementationsMetaResponseSchema, ServiceSchema, ServicesResponseSchema, NeedChoicesRequestSchema, NeedChoicesResponseSchema, NeedChoicesResponseMetaSchema, NeedChoicesResponseLinksSchema } from "./schemas";
15
- export interface ApiClientOptions {
16
- baseUrl: string;
17
- authBaseUrl?: string;
18
- authClientId?: string;
19
- token?: string;
20
- getToken?: () => Promise<string | undefined>;
21
- debug?: boolean;
22
- fetch?: typeof globalThis.fetch;
23
- onEvent?: (event: SdkEvent) => void;
24
- }
25
- export interface ApiClient {
26
- get: <T = unknown>(path: string, options?: RequestOptions) => Promise<T>;
27
- post: <T = unknown>(path: string, data?: unknown, options?: RequestOptions) => Promise<T>;
28
- put: <T = unknown>(path: string, data?: unknown, options?: RequestOptions) => Promise<T>;
29
- delete: <T = unknown>(path: string, options?: RequestOptions) => Promise<T>;
30
- poll: <T = unknown>(path: string, options?: PollOptions) => Promise<T>;
31
- fetch: (path: string, init?: RequestInit & {
32
- searchParams?: Record<string, string>;
33
- authRequired?: boolean;
34
- }) => Promise<Response>;
35
- }
36
- export interface RequestOptions {
37
- headers?: Record<string, string>;
38
- searchParams?: Record<string, string>;
39
- authRequired?: boolean;
40
- customErrorHandler?: (errorInfo: {
41
- status: number;
42
- statusText: string;
43
- data: unknown;
44
- }) => Error | undefined;
45
- }
46
- export interface PollOptions extends RequestOptions {
47
- initialDelay?: number;
48
- timeoutMs?: number;
49
- successStatus?: number;
50
- pendingStatus?: number;
51
- resultExtractor?: (response: unknown) => unknown;
52
- }
53
- export interface DebugLogger {
54
- (message: string, data?: unknown): void;
55
- }
56
- export type NeedChoices = z.infer<typeof NeedChoicesSchema>;
57
- export type Need = z.infer<typeof NeedSchema>;
58
- export type ActionLinks = z.infer<typeof ActionLinksSchema>;
59
- export type ActionPermissions = z.infer<typeof ActionPermissionsSchema>;
60
- export type Action = z.infer<typeof ActionSchema>;
61
- export type Choice = z.infer<typeof ChoiceSchema>;
62
- export type Field = z.infer<typeof FieldSchema>;
63
- export type ActionExecutionResult = z.infer<typeof ActionExecutionResultSchema>;
64
- export type ActionFieldChoice = z.infer<typeof ActionFieldChoiceSchema>;
65
- export type ActionField = z.infer<typeof ActionFieldSchema>;
66
- export type Authentication = z.infer<typeof AuthenticationSchema>;
67
- export type AuthenticationsResponse = z.infer<typeof AuthenticationsResponseSchema>;
68
- export type UserProfile = z.infer<typeof UserProfileSchema>;
69
- export type App = z.infer<typeof AppSchema>;
70
- export type Service = z.infer<typeof ServiceSchema>;
71
- export type ServicesResponse = z.infer<typeof ServicesResponseSchema>;
72
- export type NeedsRequest = z.infer<typeof NeedsRequestSchema>;
73
- export type NeedsResponse = z.infer<typeof NeedsResponseSchema>;
74
- export type Implementation = z.infer<typeof ImplementationSchema>;
75
- export type ImplementationsResponse = z.infer<typeof ImplementationsResponseSchema>;
76
- export type ImplementationMeta = z.infer<typeof ImplementationMetaSchema>;
77
- export type ImplementationsMetaResponse = z.infer<typeof ImplementationsMetaResponseSchema>;
78
- export type NeedChoicesRequest = z.infer<typeof NeedChoicesRequestSchema>;
79
- export type NeedChoicesResponse = z.infer<typeof NeedChoicesResponseSchema>;
80
- export type NeedChoicesResponseMeta = z.infer<typeof NeedChoicesResponseMetaSchema>;
81
- export type NeedChoicesResponseLinks = z.infer<typeof NeedChoicesResponseLinksSchema>;
82
- //# 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,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,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C,OAAO,mBAAmB,CAAC,CAAC;AAGhE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAC;AAGF,MAAM,MAAM,kBAAkB,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":""}