pulse-ts-sdk 0.0.51 → 0.0.52

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 (338) hide show
  1. package/dist/cjs/BaseClient.d.ts +39 -0
  2. package/dist/cjs/BaseClient.js +62 -0
  3. package/dist/cjs/Client.d.ts +57 -0
  4. package/dist/cjs/Client.js +189 -0
  5. package/dist/cjs/api/errors/BadRequestError.d.ts +5 -0
  6. package/dist/cjs/api/errors/BadRequestError.js +54 -0
  7. package/dist/cjs/api/errors/ForbiddenError.d.ts +5 -0
  8. package/dist/cjs/api/errors/ForbiddenError.js +54 -0
  9. package/dist/cjs/api/errors/InternalServerError.d.ts +5 -0
  10. package/dist/cjs/api/errors/InternalServerError.js +54 -0
  11. package/dist/cjs/api/errors/NotFoundError.d.ts +5 -0
  12. package/dist/cjs/api/errors/NotFoundError.js +54 -0
  13. package/dist/cjs/api/errors/TooManyRequestsError.d.ts +5 -0
  14. package/dist/cjs/api/errors/TooManyRequestsError.js +54 -0
  15. package/dist/cjs/api/errors/UnauthorizedError.d.ts +5 -0
  16. package/dist/cjs/api/errors/UnauthorizedError.js +54 -0
  17. package/dist/cjs/api/errors/index.d.ts +6 -0
  18. package/dist/cjs/api/errors/index.js +22 -0
  19. package/dist/cjs/api/index.d.ts +3 -0
  20. package/dist/cjs/api/index.js +19 -0
  21. package/dist/cjs/api/resources/index.d.ts +4 -0
  22. package/dist/cjs/api/resources/index.js +43 -0
  23. package/dist/cjs/api/resources/jobs/client/Client.d.ts +53 -0
  24. package/dist/cjs/api/resources/jobs/client/Client.js +185 -0
  25. package/dist/cjs/api/resources/jobs/client/index.d.ts +1 -0
  26. package/dist/cjs/api/resources/jobs/client/index.js +17 -0
  27. package/dist/cjs/api/resources/jobs/client/requests/CancelJobRequest.d.ts +10 -0
  28. package/dist/cjs/api/resources/jobs/client/requests/CancelJobRequest.js +3 -0
  29. package/dist/cjs/api/resources/jobs/client/requests/GetJobRequest.d.ts +10 -0
  30. package/dist/cjs/api/resources/jobs/client/requests/GetJobRequest.js +3 -0
  31. package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +2 -0
  32. package/dist/cjs/api/resources/jobs/client/requests/index.js +2 -0
  33. package/dist/cjs/api/resources/jobs/index.d.ts +1 -0
  34. package/dist/cjs/api/resources/jobs/index.js +17 -0
  35. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +26 -0
  36. package/dist/cjs/api/resources/webhooks/client/Client.js +108 -0
  37. package/dist/cjs/api/resources/webhooks/client/index.d.ts +1 -0
  38. package/dist/cjs/api/resources/webhooks/client/index.js +2 -0
  39. package/dist/cjs/api/resources/webhooks/index.d.ts +2 -0
  40. package/dist/cjs/api/resources/webhooks/index.js +18 -0
  41. package/dist/cjs/api/resources/webhooks/types/CreateWebhookLinkResponse.d.ts +4 -0
  42. package/dist/cjs/api/resources/webhooks/types/CreateWebhookLinkResponse.js +3 -0
  43. package/dist/cjs/api/resources/webhooks/types/index.d.ts +1 -0
  44. package/dist/cjs/api/resources/webhooks/types/index.js +17 -0
  45. package/dist/cjs/api/types/ExtractAsyncInput.d.ts +1 -0
  46. package/dist/cjs/api/types/ExtractAsyncInput.js +3 -0
  47. package/dist/cjs/api/types/ExtractAsyncResponse.d.ts +22 -0
  48. package/dist/cjs/api/types/ExtractAsyncResponse.js +15 -0
  49. package/dist/cjs/api/types/ExtractInput.d.ts +1 -0
  50. package/dist/cjs/api/types/ExtractInput.js +3 -0
  51. package/dist/cjs/api/types/ExtractJsonInput.d.ts +61 -0
  52. package/dist/cjs/api/types/ExtractJsonInput.js +3 -0
  53. package/dist/cjs/api/types/ExtractMultipartInput.d.ts +59 -0
  54. package/dist/cjs/api/types/ExtractMultipartInput.js +3 -0
  55. package/dist/cjs/api/types/ExtractOptions.d.ts +59 -0
  56. package/dist/cjs/api/types/ExtractOptions.js +3 -0
  57. package/dist/cjs/api/types/ExtractResponse.d.ts +17 -0
  58. package/dist/cjs/api/types/ExtractResponse.js +3 -0
  59. package/dist/cjs/api/types/JobCancellationResponse.d.ts +9 -0
  60. package/dist/cjs/api/types/JobCancellationResponse.js +3 -0
  61. package/dist/cjs/api/types/JobStatus.d.ts +9 -0
  62. package/dist/cjs/api/types/JobStatus.js +12 -0
  63. package/dist/cjs/api/types/JobStatusResponse.d.ts +17 -0
  64. package/dist/cjs/api/types/JobStatusResponse.js +3 -0
  65. package/dist/cjs/api/types/JsonSource.d.ts +7 -0
  66. package/dist/cjs/api/types/JsonSource.js +3 -0
  67. package/dist/cjs/api/types/MultipartSource.d.ts +10 -0
  68. package/dist/cjs/api/types/MultipartSource.js +3 -0
  69. package/dist/cjs/api/types/index.d.ts +12 -0
  70. package/dist/cjs/api/types/index.js +28 -0
  71. package/dist/cjs/auth/HeaderAuthProvider.d.ts +16 -0
  72. package/dist/cjs/auth/HeaderAuthProvider.js +71 -0
  73. package/dist/cjs/auth/index.d.ts +1 -0
  74. package/dist/cjs/auth/index.js +5 -0
  75. package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
  76. package/dist/cjs/core/auth/AuthProvider.js +2 -0
  77. package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
  78. package/dist/cjs/core/auth/AuthRequest.js +2 -0
  79. package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
  80. package/dist/cjs/core/auth/BasicAuth.js +27 -0
  81. package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
  82. package/dist/cjs/core/auth/BearerToken.js +16 -0
  83. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
  84. package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
  85. package/dist/cjs/core/auth/index.d.ts +5 -0
  86. package/dist/cjs/core/auth/index.js +9 -0
  87. package/dist/cjs/core/base64.d.ts +2 -0
  88. package/dist/cjs/core/base64.js +26 -0
  89. package/dist/cjs/core/exports.d.ts +1 -0
  90. package/dist/cjs/core/exports.js +17 -0
  91. package/dist/cjs/core/fetcher/APIResponse.d.ts +20 -0
  92. package/dist/cjs/core/fetcher/APIResponse.js +2 -0
  93. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +19 -0
  94. package/dist/cjs/core/fetcher/BinaryResponse.js +17 -0
  95. package/dist/cjs/core/fetcher/EndpointMetadata.d.ts +13 -0
  96. package/dist/cjs/core/fetcher/EndpointMetadata.js +2 -0
  97. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +12 -0
  98. package/dist/cjs/core/fetcher/EndpointSupplier.js +22 -0
  99. package/dist/cjs/core/fetcher/Fetcher.d.ts +49 -0
  100. package/dist/cjs/core/fetcher/Fetcher.js +316 -0
  101. package/dist/cjs/core/fetcher/Headers.d.ts +2 -0
  102. package/dist/cjs/core/fetcher/Headers.js +84 -0
  103. package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +58 -0
  104. package/dist/cjs/core/fetcher/HttpResponsePromise.js +103 -0
  105. package/dist/cjs/core/fetcher/RawResponse.d.ts +29 -0
  106. package/dist/cjs/core/fetcher/RawResponse.js +44 -0
  107. package/dist/cjs/core/fetcher/Supplier.d.ts +4 -0
  108. package/dist/cjs/core/fetcher/Supplier.js +22 -0
  109. package/dist/cjs/core/fetcher/createRequestUrl.d.ts +1 -0
  110. package/dist/cjs/core/fetcher/createRequestUrl.js +8 -0
  111. package/dist/cjs/core/fetcher/getErrorResponseBody.d.ts +1 -0
  112. package/dist/cjs/core/fetcher/getErrorResponseBody.js +45 -0
  113. package/dist/cjs/core/fetcher/getFetchFn.d.ts +1 -0
  114. package/dist/cjs/core/fetcher/getFetchFn.js +17 -0
  115. package/dist/cjs/core/fetcher/getHeader.d.ts +1 -0
  116. package/dist/cjs/core/fetcher/getHeader.js +11 -0
  117. package/dist/cjs/core/fetcher/getRequestBody.d.ts +7 -0
  118. package/dist/cjs/core/fetcher/getRequestBody.js +27 -0
  119. package/dist/cjs/core/fetcher/getResponseBody.d.ts +1 -0
  120. package/dist/cjs/core/fetcher/getResponseBody.js +69 -0
  121. package/dist/cjs/core/fetcher/index.d.ts +11 -0
  122. package/dist/cjs/core/fetcher/index.js +17 -0
  123. package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -0
  124. package/dist/cjs/core/fetcher/makeRequest.js +40 -0
  125. package/dist/cjs/core/fetcher/requestWithRetries.d.ts +1 -0
  126. package/dist/cjs/core/fetcher/requestWithRetries.js +67 -0
  127. package/dist/cjs/core/fetcher/signals.d.ts +5 -0
  128. package/dist/cjs/core/fetcher/signals.js +24 -0
  129. package/dist/cjs/core/headers.d.ts +2 -0
  130. package/dist/cjs/core/headers.js +31 -0
  131. package/dist/cjs/core/index.d.ts +6 -0
  132. package/dist/cjs/core/index.js +45 -0
  133. package/dist/cjs/core/json.d.ts +15 -0
  134. package/dist/cjs/core/json.js +24 -0
  135. package/dist/cjs/core/logging/exports.d.ts +18 -0
  136. package/dist/cjs/core/logging/exports.js +45 -0
  137. package/dist/cjs/core/logging/index.d.ts +1 -0
  138. package/dist/cjs/core/logging/index.js +17 -0
  139. package/dist/cjs/core/logging/logger.d.ts +126 -0
  140. package/dist/cjs/core/logging/logger.js +144 -0
  141. package/dist/cjs/core/runtime/index.d.ts +1 -0
  142. package/dist/cjs/core/runtime/index.js +5 -0
  143. package/dist/cjs/core/runtime/runtime.d.ts +9 -0
  144. package/dist/cjs/core/runtime/runtime.js +103 -0
  145. package/dist/cjs/core/url/encodePathParam.d.ts +1 -0
  146. package/dist/cjs/core/url/encodePathParam.js +21 -0
  147. package/dist/cjs/core/url/index.d.ts +3 -0
  148. package/dist/cjs/core/url/index.js +9 -0
  149. package/dist/cjs/core/url/join.d.ts +1 -0
  150. package/dist/cjs/core/url/join.js +68 -0
  151. package/dist/cjs/core/url/qs.d.ts +6 -0
  152. package/dist/cjs/core/url/qs.js +64 -0
  153. package/dist/cjs/environments.d.ts +4 -0
  154. package/dist/cjs/environments.js +7 -0
  155. package/dist/cjs/errors/PulseError.d.ts +12 -0
  156. package/dist/cjs/errors/PulseError.js +32 -0
  157. package/dist/cjs/errors/PulseTimeoutError.d.ts +3 -0
  158. package/dist/cjs/errors/PulseTimeoutError.js +15 -0
  159. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
  160. package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
  161. package/dist/cjs/errors/index.d.ts +2 -0
  162. package/dist/cjs/errors/index.js +7 -0
  163. package/dist/cjs/exports.d.ts +1 -0
  164. package/dist/cjs/exports.js +17 -0
  165. package/dist/cjs/index.d.ts +6 -0
  166. package/dist/cjs/index.js +48 -0
  167. package/dist/cjs/version.d.ts +1 -0
  168. package/dist/cjs/version.js +4 -0
  169. package/dist/esm/BaseClient.d.mts +39 -0
  170. package/dist/esm/BaseClient.mjs +25 -0
  171. package/dist/esm/Client.d.mts +57 -0
  172. package/dist/esm/Client.mjs +152 -0
  173. package/dist/esm/api/errors/BadRequestError.d.mts +5 -0
  174. package/dist/esm/api/errors/BadRequestError.mjs +17 -0
  175. package/dist/esm/api/errors/ForbiddenError.d.mts +5 -0
  176. package/dist/esm/api/errors/ForbiddenError.mjs +17 -0
  177. package/dist/esm/api/errors/InternalServerError.d.mts +5 -0
  178. package/dist/esm/api/errors/InternalServerError.mjs +17 -0
  179. package/dist/esm/api/errors/NotFoundError.d.mts +5 -0
  180. package/dist/esm/api/errors/NotFoundError.mjs +17 -0
  181. package/dist/esm/api/errors/TooManyRequestsError.d.mts +5 -0
  182. package/dist/esm/api/errors/TooManyRequestsError.mjs +17 -0
  183. package/dist/esm/api/errors/UnauthorizedError.d.mts +5 -0
  184. package/dist/esm/api/errors/UnauthorizedError.mjs +17 -0
  185. package/dist/esm/api/errors/index.d.mts +6 -0
  186. package/dist/esm/api/errors/index.mjs +6 -0
  187. package/dist/esm/api/index.d.mts +3 -0
  188. package/dist/esm/api/index.mjs +3 -0
  189. package/dist/esm/api/resources/index.d.mts +4 -0
  190. package/dist/esm/api/resources/index.mjs +4 -0
  191. package/dist/esm/api/resources/jobs/client/Client.d.mts +53 -0
  192. package/dist/esm/api/resources/jobs/client/Client.mjs +148 -0
  193. package/dist/esm/api/resources/jobs/client/index.d.mts +1 -0
  194. package/dist/esm/api/resources/jobs/client/index.mjs +1 -0
  195. package/dist/esm/api/resources/jobs/client/requests/CancelJobRequest.d.mts +10 -0
  196. package/dist/esm/api/resources/jobs/client/requests/CancelJobRequest.mjs +2 -0
  197. package/dist/esm/api/resources/jobs/client/requests/GetJobRequest.d.mts +10 -0
  198. package/dist/esm/api/resources/jobs/client/requests/GetJobRequest.mjs +2 -0
  199. package/dist/esm/api/resources/jobs/client/requests/index.d.mts +2 -0
  200. package/dist/esm/api/resources/jobs/client/requests/index.mjs +1 -0
  201. package/dist/esm/api/resources/jobs/index.d.mts +1 -0
  202. package/dist/esm/api/resources/jobs/index.mjs +1 -0
  203. package/dist/esm/api/resources/webhooks/client/Client.d.mts +26 -0
  204. package/dist/esm/api/resources/webhooks/client/Client.mjs +71 -0
  205. package/dist/esm/api/resources/webhooks/client/index.d.mts +1 -0
  206. package/dist/esm/api/resources/webhooks/client/index.mjs +1 -0
  207. package/dist/esm/api/resources/webhooks/index.d.mts +2 -0
  208. package/dist/esm/api/resources/webhooks/index.mjs +2 -0
  209. package/dist/esm/api/resources/webhooks/types/CreateWebhookLinkResponse.d.mts +4 -0
  210. package/dist/esm/api/resources/webhooks/types/CreateWebhookLinkResponse.mjs +2 -0
  211. package/dist/esm/api/resources/webhooks/types/index.d.mts +1 -0
  212. package/dist/esm/api/resources/webhooks/types/index.mjs +1 -0
  213. package/dist/esm/api/types/ExtractAsyncInput.d.mts +1 -0
  214. package/dist/esm/api/types/ExtractAsyncInput.mjs +2 -0
  215. package/dist/esm/api/types/ExtractAsyncResponse.d.mts +22 -0
  216. package/dist/esm/api/types/ExtractAsyncResponse.mjs +12 -0
  217. package/dist/esm/api/types/ExtractInput.d.mts +1 -0
  218. package/dist/esm/api/types/ExtractInput.mjs +2 -0
  219. package/dist/esm/api/types/ExtractJsonInput.d.mts +61 -0
  220. package/dist/esm/api/types/ExtractJsonInput.mjs +2 -0
  221. package/dist/esm/api/types/ExtractMultipartInput.d.mts +59 -0
  222. package/dist/esm/api/types/ExtractMultipartInput.mjs +2 -0
  223. package/dist/esm/api/types/ExtractOptions.d.mts +59 -0
  224. package/dist/esm/api/types/ExtractOptions.mjs +2 -0
  225. package/dist/esm/api/types/ExtractResponse.d.mts +17 -0
  226. package/dist/esm/api/types/ExtractResponse.mjs +2 -0
  227. package/dist/esm/api/types/JobCancellationResponse.d.mts +9 -0
  228. package/dist/esm/api/types/JobCancellationResponse.mjs +2 -0
  229. package/dist/esm/api/types/JobStatus.d.mts +9 -0
  230. package/dist/esm/api/types/JobStatus.mjs +9 -0
  231. package/dist/esm/api/types/JobStatusResponse.d.mts +17 -0
  232. package/dist/esm/api/types/JobStatusResponse.mjs +2 -0
  233. package/dist/esm/api/types/JsonSource.d.mts +7 -0
  234. package/dist/esm/api/types/JsonSource.mjs +2 -0
  235. package/dist/esm/api/types/MultipartSource.d.mts +10 -0
  236. package/dist/esm/api/types/MultipartSource.mjs +2 -0
  237. package/dist/esm/api/types/index.d.mts +12 -0
  238. package/dist/esm/api/types/index.mjs +12 -0
  239. package/dist/esm/auth/HeaderAuthProvider.d.mts +16 -0
  240. package/dist/esm/auth/HeaderAuthProvider.mjs +34 -0
  241. package/dist/esm/auth/index.d.mts +1 -0
  242. package/dist/esm/auth/index.mjs +1 -0
  243. package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
  244. package/dist/esm/core/auth/AuthProvider.mjs +1 -0
  245. package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
  246. package/dist/esm/core/auth/AuthRequest.mjs +1 -0
  247. package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
  248. package/dist/esm/core/auth/BasicAuth.mjs +24 -0
  249. package/dist/esm/core/auth/BearerToken.d.mts +7 -0
  250. package/dist/esm/core/auth/BearerToken.mjs +13 -0
  251. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
  252. package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
  253. package/dist/esm/core/auth/index.d.mts +5 -0
  254. package/dist/esm/core/auth/index.mjs +3 -0
  255. package/dist/esm/core/base64.d.mts +2 -0
  256. package/dist/esm/core/base64.mjs +22 -0
  257. package/dist/esm/core/exports.d.mts +1 -0
  258. package/dist/esm/core/exports.mjs +1 -0
  259. package/dist/esm/core/fetcher/APIResponse.d.mts +20 -0
  260. package/dist/esm/core/fetcher/APIResponse.mjs +1 -0
  261. package/dist/esm/core/fetcher/BinaryResponse.d.mts +19 -0
  262. package/dist/esm/core/fetcher/BinaryResponse.mjs +14 -0
  263. package/dist/esm/core/fetcher/EndpointMetadata.d.mts +13 -0
  264. package/dist/esm/core/fetcher/EndpointMetadata.mjs +1 -0
  265. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +12 -0
  266. package/dist/esm/core/fetcher/EndpointSupplier.mjs +19 -0
  267. package/dist/esm/core/fetcher/Fetcher.d.mts +49 -0
  268. package/dist/esm/core/fetcher/Fetcher.mjs +312 -0
  269. package/dist/esm/core/fetcher/Headers.d.mts +2 -0
  270. package/dist/esm/core/fetcher/Headers.mjs +82 -0
  271. package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +58 -0
  272. package/dist/esm/core/fetcher/HttpResponsePromise.mjs +99 -0
  273. package/dist/esm/core/fetcher/RawResponse.d.mts +29 -0
  274. package/dist/esm/core/fetcher/RawResponse.mjs +40 -0
  275. package/dist/esm/core/fetcher/Supplier.d.mts +4 -0
  276. package/dist/esm/core/fetcher/Supplier.mjs +19 -0
  277. package/dist/esm/core/fetcher/createRequestUrl.d.mts +1 -0
  278. package/dist/esm/core/fetcher/createRequestUrl.mjs +5 -0
  279. package/dist/esm/core/fetcher/getErrorResponseBody.d.mts +1 -0
  280. package/dist/esm/core/fetcher/getErrorResponseBody.mjs +42 -0
  281. package/dist/esm/core/fetcher/getFetchFn.d.mts +1 -0
  282. package/dist/esm/core/fetcher/getFetchFn.mjs +14 -0
  283. package/dist/esm/core/fetcher/getHeader.d.mts +1 -0
  284. package/dist/esm/core/fetcher/getHeader.mjs +8 -0
  285. package/dist/esm/core/fetcher/getRequestBody.d.mts +7 -0
  286. package/dist/esm/core/fetcher/getRequestBody.mjs +24 -0
  287. package/dist/esm/core/fetcher/getResponseBody.d.mts +1 -0
  288. package/dist/esm/core/fetcher/getResponseBody.mjs +66 -0
  289. package/dist/esm/core/fetcher/index.d.mts +11 -0
  290. package/dist/esm/core/fetcher/index.mjs +6 -0
  291. package/dist/esm/core/fetcher/makeRequest.d.mts +1 -0
  292. package/dist/esm/core/fetcher/makeRequest.mjs +36 -0
  293. package/dist/esm/core/fetcher/requestWithRetries.d.mts +1 -0
  294. package/dist/esm/core/fetcher/requestWithRetries.mjs +64 -0
  295. package/dist/esm/core/fetcher/signals.d.mts +5 -0
  296. package/dist/esm/core/fetcher/signals.mjs +20 -0
  297. package/dist/esm/core/headers.d.mts +2 -0
  298. package/dist/esm/core/headers.mjs +27 -0
  299. package/dist/esm/core/index.d.mts +6 -0
  300. package/dist/esm/core/index.mjs +6 -0
  301. package/dist/esm/core/json.d.mts +15 -0
  302. package/dist/esm/core/json.mjs +19 -0
  303. package/dist/esm/core/logging/exports.d.mts +18 -0
  304. package/dist/esm/core/logging/exports.mjs +9 -0
  305. package/dist/esm/core/logging/index.d.mts +1 -0
  306. package/dist/esm/core/logging/index.mjs +1 -0
  307. package/dist/esm/core/logging/logger.d.mts +126 -0
  308. package/dist/esm/core/logging/logger.mjs +138 -0
  309. package/dist/esm/core/runtime/index.d.mts +1 -0
  310. package/dist/esm/core/runtime/index.mjs +1 -0
  311. package/dist/esm/core/runtime/runtime.d.mts +9 -0
  312. package/dist/esm/core/runtime/runtime.mjs +100 -0
  313. package/dist/esm/core/url/encodePathParam.d.mts +1 -0
  314. package/dist/esm/core/url/encodePathParam.mjs +18 -0
  315. package/dist/esm/core/url/index.d.mts +3 -0
  316. package/dist/esm/core/url/index.mjs +3 -0
  317. package/dist/esm/core/url/join.d.mts +1 -0
  318. package/dist/esm/core/url/join.mjs +65 -0
  319. package/dist/esm/core/url/qs.d.mts +6 -0
  320. package/dist/esm/core/url/qs.mjs +61 -0
  321. package/dist/esm/environments.d.mts +4 -0
  322. package/dist/esm/environments.mjs +4 -0
  323. package/dist/esm/errors/PulseError.d.mts +12 -0
  324. package/dist/esm/errors/PulseError.mjs +28 -0
  325. package/dist/esm/errors/PulseTimeoutError.d.mts +3 -0
  326. package/dist/esm/errors/PulseTimeoutError.mjs +11 -0
  327. package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
  328. package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
  329. package/dist/esm/errors/index.d.mts +2 -0
  330. package/dist/esm/errors/index.mjs +2 -0
  331. package/dist/esm/exports.d.mts +1 -0
  332. package/dist/esm/exports.mjs +1 -0
  333. package/dist/esm/index.d.mts +6 -0
  334. package/dist/esm/index.mjs +5 -0
  335. package/dist/esm/version.d.mts +1 -0
  336. package/dist/esm/version.mjs +1 -0
  337. package/package.json +1 -1
  338. package/reference.md +6 -6
@@ -0,0 +1,71 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptions } from "../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../core/headers.mjs";
13
+ import * as core from "../../../../core/index.mjs";
14
+ import * as environments from "../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../errors/index.mjs";
17
+ import * as Pulse from "../../../index.mjs";
18
+ export class WebhooksClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptions(options);
21
+ }
22
+ /**
23
+ * Generates a temporary link to the Svix webhook portal where users can manage their webhook endpoints and view message logs.
24
+ *
25
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
26
+ *
27
+ * @throws {@link Pulse.UnauthorizedError}
28
+ * @throws {@link Pulse.InternalServerError}
29
+ *
30
+ * @example
31
+ * await client.webhooks.createWebhookLink()
32
+ */
33
+ createWebhookLink(requestOptions) {
34
+ return core.HttpResponsePromise.fromPromise(this.__createWebhookLink(requestOptions));
35
+ }
36
+ __createWebhookLink(requestOptions) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
39
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
40
+ const _response = yield core.fetcher({
41
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PulseEnvironment.Default, "webhook"),
42
+ method: "POST",
43
+ headers: _headers,
44
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
45
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
46
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
47
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
48
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
49
+ logging: this._options.logging,
50
+ });
51
+ if (_response.ok) {
52
+ return { data: _response.body, rawResponse: _response.rawResponse };
53
+ }
54
+ if (_response.error.reason === "status-code") {
55
+ switch (_response.error.statusCode) {
56
+ case 401:
57
+ throw new Pulse.UnauthorizedError(_response.error.body, _response.rawResponse);
58
+ case 500:
59
+ throw new Pulse.InternalServerError(_response.error.body, _response.rawResponse);
60
+ default:
61
+ throw new errors.PulseError({
62
+ statusCode: _response.error.statusCode,
63
+ body: _response.error.body,
64
+ rawResponse: _response.rawResponse,
65
+ });
66
+ }
67
+ }
68
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/webhook");
69
+ });
70
+ }
71
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,4 @@
1
+ export interface CreateWebhookLinkResponse {
2
+ /** URL to the Svix webhook portal */
3
+ link: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./CreateWebhookLinkResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./CreateWebhookLinkResponse.mjs";
@@ -0,0 +1 @@
1
+ export type ExtractAsyncInput = unknown;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Metadata describing the enqueued asynchronous extraction job.
3
+ */
4
+ export interface ExtractAsyncResponse {
5
+ /** Identifier assigned to the asynchronous extraction job. */
6
+ job_id: string;
7
+ /** Initial status reported by the extractor. */
8
+ status: ExtractAsyncResponse.Status;
9
+ /** Timestamp indicating when the job was accepted. */
10
+ queuedAt?: string;
11
+ }
12
+ export declare namespace ExtractAsyncResponse {
13
+ /** Initial status reported by the extractor. */
14
+ const Status: {
15
+ readonly Pending: "pending";
16
+ readonly Processing: "processing";
17
+ readonly Completed: "completed";
18
+ readonly Failed: "failed";
19
+ readonly Canceled: "canceled";
20
+ };
21
+ type Status = (typeof Status)[keyof typeof Status];
22
+ }
@@ -0,0 +1,12 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var ExtractAsyncResponse;
3
+ (function (ExtractAsyncResponse) {
4
+ /** Initial status reported by the extractor. */
5
+ ExtractAsyncResponse.Status = {
6
+ Pending: "pending",
7
+ Processing: "processing",
8
+ Completed: "completed",
9
+ Failed: "failed",
10
+ Canceled: "canceled",
11
+ };
12
+ })(ExtractAsyncResponse || (ExtractAsyncResponse = {}));
@@ -0,0 +1 @@
1
+ export type ExtractInput = unknown;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Input schema for JSON requests (fileUrl only).
3
+ */
4
+ export interface ExtractJsonInput {
5
+ /** Public or pre-signed URL that Pulse will download and extract. */
6
+ fileUrl: string;
7
+ /** Recommended method for schema-guided extraction. Contains the schema and optional prompt in a single object. */
8
+ structuredOutput?: ExtractJsonInput.StructuredOutput;
9
+ /** (Deprecated) JSON schema describing structured data to extract. Use structuredOutput instead. Accepts either a JSON object or a stringified JSON representation. */
10
+ schema?: ExtractJsonInput.Schema;
11
+ /** (Deprecated) Experimental schema definition used for feature flagged behaviour. Accepts either a JSON object or a stringified JSON representation. */
12
+ experimentalSchema?: ExtractJsonInput.ExperimentalSchema;
13
+ /** (Deprecated) Natural language prompt for schema-guided extraction. Use structuredOutput.schemaPrompt instead. */
14
+ schemaPrompt?: string;
15
+ /** (Deprecated) Custom instructions that augment the default extraction behaviour. */
16
+ customPrompt?: string;
17
+ /** Comma-separated list of chunking strategies to apply (for example `semantic,header,page,recursive`). */
18
+ chunking?: string;
19
+ /** Override for maximum characters per chunk when chunking is enabled. */
20
+ chunkSize?: number;
21
+ /** Page range filter supporting segments such as `1-2` or mixed ranges like `1-2,5`. */
22
+ pages?: string;
23
+ /** Toggle to enable figure extraction in results. */
24
+ extractFigure?: boolean;
25
+ /** Toggle to generate descriptive captions for extracted figures. */
26
+ figureDescription?: boolean;
27
+ /** Whether to include HTML representation alongside markdown in the response. */
28
+ returnHtml?: boolean;
29
+ /** (Deprecated) Enables expanded rationale output for debugging. */
30
+ thinking?: boolean;
31
+ /** Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created. */
32
+ storage?: ExtractJsonInput.Storage;
33
+ }
34
+ export declare namespace ExtractJsonInput {
35
+ /**
36
+ * Recommended method for schema-guided extraction. Contains the schema and optional prompt in a single object.
37
+ */
38
+ interface StructuredOutput {
39
+ /** JSON schema describing the structured data to extract. */
40
+ schema?: Record<string, unknown>;
41
+ /** Natural language prompt with additional extraction instructions. */
42
+ schemaPrompt?: string;
43
+ }
44
+ /**
45
+ * (Deprecated) JSON schema describing structured data to extract. Use structuredOutput instead. Accepts either a JSON object or a stringified JSON representation.
46
+ */
47
+ type Schema = Record<string, unknown> | string;
48
+ /**
49
+ * (Deprecated) Experimental schema definition used for feature flagged behaviour. Accepts either a JSON object or a stringified JSON representation.
50
+ */
51
+ type ExperimentalSchema = Record<string, unknown> | string;
52
+ /**
53
+ * Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
54
+ */
55
+ interface Storage {
56
+ /** Whether to persist extraction artifacts. Set to false for temporary extractions with no storage or database record. */
57
+ enabled?: boolean;
58
+ /** Target folder name to save the extraction to. Creates the folder if it doesn't exist. */
59
+ folderName?: string;
60
+ }
61
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Input schema for multipart/form-data requests (file upload or fileUrl).
3
+ */
4
+ export interface ExtractMultipartInput {
5
+ /** Recommended method for schema-guided extraction. Contains the schema and optional prompt in a single object. */
6
+ structuredOutput?: ExtractMultipartInput.StructuredOutput;
7
+ /** (Deprecated) JSON schema describing structured data to extract. Use structuredOutput instead. Accepts either a JSON object or a stringified JSON representation. */
8
+ schema?: ExtractMultipartInput.Schema;
9
+ /** (Deprecated) Experimental schema definition used for feature flagged behaviour. Accepts either a JSON object or a stringified JSON representation. */
10
+ experimentalSchema?: ExtractMultipartInput.ExperimentalSchema;
11
+ /** (Deprecated) Natural language prompt for schema-guided extraction. Use structuredOutput.schemaPrompt instead. */
12
+ schemaPrompt?: string;
13
+ /** (Deprecated) Custom instructions that augment the default extraction behaviour. */
14
+ customPrompt?: string;
15
+ /** Comma-separated list of chunking strategies to apply (for example `semantic,header,page,recursive`). */
16
+ chunking?: string;
17
+ /** Override for maximum characters per chunk when chunking is enabled. */
18
+ chunkSize?: number;
19
+ /** Page range filter supporting segments such as `1-2` or mixed ranges like `1-2,5`. */
20
+ pages?: string;
21
+ /** Toggle to enable figure extraction in results. */
22
+ extractFigure?: boolean;
23
+ /** Toggle to generate descriptive captions for extracted figures. */
24
+ figureDescription?: boolean;
25
+ /** Whether to include HTML representation alongside markdown in the response. */
26
+ returnHtml?: boolean;
27
+ /** (Deprecated) Enables expanded rationale output for debugging. */
28
+ thinking?: boolean;
29
+ /** Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created. */
30
+ storage?: ExtractMultipartInput.Storage;
31
+ }
32
+ export declare namespace ExtractMultipartInput {
33
+ /**
34
+ * Recommended method for schema-guided extraction. Contains the schema and optional prompt in a single object.
35
+ */
36
+ interface StructuredOutput {
37
+ /** JSON schema describing the structured data to extract. */
38
+ schema?: Record<string, unknown>;
39
+ /** Natural language prompt with additional extraction instructions. */
40
+ schemaPrompt?: string;
41
+ }
42
+ /**
43
+ * (Deprecated) JSON schema describing structured data to extract. Use structuredOutput instead. Accepts either a JSON object or a stringified JSON representation.
44
+ */
45
+ type Schema = Record<string, unknown> | string;
46
+ /**
47
+ * (Deprecated) Experimental schema definition used for feature flagged behaviour. Accepts either a JSON object or a stringified JSON representation.
48
+ */
49
+ type ExperimentalSchema = Record<string, unknown> | string;
50
+ /**
51
+ * Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
52
+ */
53
+ interface Storage {
54
+ /** Whether to persist extraction artifacts. Set to false for temporary extractions with no storage or database record. */
55
+ enabled?: boolean;
56
+ /** Target folder name to save the extraction to. Creates the folder if it doesn't exist. */
57
+ folderName?: string;
58
+ }
59
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Common extraction options shared by synchronous and asynchronous endpoints.
3
+ */
4
+ export interface ExtractOptions {
5
+ /** Recommended method for schema-guided extraction. Contains the schema and optional prompt in a single object. */
6
+ structuredOutput?: ExtractOptions.StructuredOutput;
7
+ /** (Deprecated) JSON schema describing structured data to extract. Use structuredOutput instead. Accepts either a JSON object or a stringified JSON representation. */
8
+ schema?: ExtractOptions.Schema;
9
+ /** (Deprecated) Experimental schema definition used for feature flagged behaviour. Accepts either a JSON object or a stringified JSON representation. */
10
+ experimentalSchema?: ExtractOptions.ExperimentalSchema;
11
+ /** (Deprecated) Natural language prompt for schema-guided extraction. Use structuredOutput.schemaPrompt instead. */
12
+ schemaPrompt?: string;
13
+ /** (Deprecated) Custom instructions that augment the default extraction behaviour. */
14
+ customPrompt?: string;
15
+ /** Comma-separated list of chunking strategies to apply (for example `semantic,header,page,recursive`). */
16
+ chunking?: string;
17
+ /** Override for maximum characters per chunk when chunking is enabled. */
18
+ chunkSize?: number;
19
+ /** Page range filter supporting segments such as `1-2` or mixed ranges like `1-2,5`. */
20
+ pages?: string;
21
+ /** Toggle to enable figure extraction in results. */
22
+ extractFigure?: boolean;
23
+ /** Toggle to generate descriptive captions for extracted figures. */
24
+ figureDescription?: boolean;
25
+ /** Whether to include HTML representation alongside markdown in the response. */
26
+ returnHtml?: boolean;
27
+ /** (Deprecated) Enables expanded rationale output for debugging. */
28
+ thinking?: boolean;
29
+ /** Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created. */
30
+ storage?: ExtractOptions.Storage;
31
+ }
32
+ export declare namespace ExtractOptions {
33
+ /**
34
+ * Recommended method for schema-guided extraction. Contains the schema and optional prompt in a single object.
35
+ */
36
+ interface StructuredOutput {
37
+ /** JSON schema describing the structured data to extract. */
38
+ schema?: Record<string, unknown>;
39
+ /** Natural language prompt with additional extraction instructions. */
40
+ schemaPrompt?: string;
41
+ }
42
+ /**
43
+ * (Deprecated) JSON schema describing structured data to extract. Use structuredOutput instead. Accepts either a JSON object or a stringified JSON representation.
44
+ */
45
+ type Schema = Record<string, unknown> | string;
46
+ /**
47
+ * (Deprecated) Experimental schema definition used for feature flagged behaviour. Accepts either a JSON object or a stringified JSON representation.
48
+ */
49
+ type ExperimentalSchema = Record<string, unknown> | string;
50
+ /**
51
+ * Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
52
+ */
53
+ interface Storage {
54
+ /** Whether to persist extraction artifacts. Set to false for temporary extractions with no storage or database record. */
55
+ enabled?: boolean;
56
+ /** Target folder name to save the extraction to. Creates the folder if it doesn't exist. */
57
+ folderName?: string;
58
+ }
59
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * High-level structure returned by the synchronous extract API.
3
+ */
4
+ export interface ExtractResponse {
5
+ /** Primary markdown content extracted from the document. */
6
+ content?: string;
7
+ /** Optional HTML representation when returnHtml is true. */
8
+ html?: string;
9
+ /** Identifier assigned to the extraction job. */
10
+ job_id?: string;
11
+ /** Non-fatal warnings generated during extraction. */
12
+ warnings?: string[];
13
+ /** Additional metadata supplied by the backend. */
14
+ metadata?: Record<string, unknown>;
15
+ /** Accepts any additional properties */
16
+ [key: string]: any;
17
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Confirmation payload returned after successfully canceling a job.
3
+ */
4
+ export interface JobCancellationResponse {
5
+ /** Identifier of the job that was cancelled. */
6
+ job_id: string;
7
+ /** Human-readable confirmation message. */
8
+ message: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ /** Lifecycle status for an asynchronous extraction job. */
2
+ export declare const JobStatus: {
3
+ readonly Pending: "pending";
4
+ readonly Processing: "processing";
5
+ readonly Completed: "completed";
6
+ readonly Failed: "failed";
7
+ readonly Canceled: "canceled";
8
+ };
9
+ export type JobStatus = (typeof JobStatus)[keyof typeof JobStatus];
@@ -0,0 +1,9 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /** Lifecycle status for an asynchronous extraction job. */
3
+ export const JobStatus = {
4
+ Pending: "pending",
5
+ Processing: "processing",
6
+ Completed: "completed",
7
+ Failed: "failed",
8
+ Canceled: "canceled",
9
+ };
@@ -0,0 +1,17 @@
1
+ import type * as Pulse from "../index.mjs";
2
+ /**
3
+ * Current status and metadata for an asynchronous extraction job.
4
+ */
5
+ export interface JobStatusResponse {
6
+ /** Identifier assigned to the asynchronous extraction job. */
7
+ job_id: string;
8
+ status: Pulse.JobStatus;
9
+ /** Timestamp when the job was accepted. */
10
+ created_at: string;
11
+ /** Timestamp of the last status update, if available. */
12
+ updated_at?: string;
13
+ /** Structured payload that contains extraction output when the job is completed. */
14
+ result?: Record<string, unknown>;
15
+ /** Error message describing why the job failed, if applicable. */
16
+ error?: string;
17
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Document source definition for JSON requests.
3
+ */
4
+ export interface JsonSource {
5
+ /** Public or pre-signed URL that Pulse will download and extract. */
6
+ fileUrl: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Document source definition for multipart/form-data requests. Provide exactly one of `file` (direct upload) or `fileUrl` (remote URL).
3
+ */
4
+ export type MultipartSource = {
5
+ file: string;
6
+ fileUrl?: unknown | undefined;
7
+ } | {
8
+ fileUrl: string;
9
+ file?: unknown | undefined;
10
+ };
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,12 @@
1
+ export * from "./ExtractAsyncInput.mjs";
2
+ export * from "./ExtractAsyncResponse.mjs";
3
+ export * from "./ExtractInput.mjs";
4
+ export * from "./ExtractJsonInput.mjs";
5
+ export * from "./ExtractMultipartInput.mjs";
6
+ export * from "./ExtractOptions.mjs";
7
+ export * from "./ExtractResponse.mjs";
8
+ export * from "./JobCancellationResponse.mjs";
9
+ export * from "./JobStatus.mjs";
10
+ export * from "./JobStatusResponse.mjs";
11
+ export * from "./JsonSource.mjs";
12
+ export * from "./MultipartSource.mjs";
@@ -0,0 +1,12 @@
1
+ export * from "./ExtractAsyncInput.mjs";
2
+ export * from "./ExtractAsyncResponse.mjs";
3
+ export * from "./ExtractInput.mjs";
4
+ export * from "./ExtractJsonInput.mjs";
5
+ export * from "./ExtractMultipartInput.mjs";
6
+ export * from "./ExtractOptions.mjs";
7
+ export * from "./ExtractResponse.mjs";
8
+ export * from "./JobCancellationResponse.mjs";
9
+ export * from "./JobStatus.mjs";
10
+ export * from "./JobStatusResponse.mjs";
11
+ export * from "./JsonSource.mjs";
12
+ export * from "./MultipartSource.mjs";
@@ -0,0 +1,16 @@
1
+ import * as core from "../core/index.mjs";
2
+ export declare namespace HeaderAuthProvider {
3
+ interface AuthOptions {
4
+ apiKey?: core.Supplier<string>;
5
+ }
6
+ interface Options extends AuthOptions {
7
+ }
8
+ }
9
+ export declare class HeaderAuthProvider implements core.AuthProvider {
10
+ private readonly headerValue;
11
+ constructor(options: HeaderAuthProvider.Options);
12
+ static canCreate(options: HeaderAuthProvider.Options): boolean;
13
+ getAuthRequest(_arg?: {
14
+ endpointMetadata?: core.EndpointMetadata;
15
+ }): Promise<core.AuthRequest>;
16
+ }
@@ -0,0 +1,34 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import * as core from "../core/index.mjs";
12
+ import * as errors from "../errors/index.mjs";
13
+ export class HeaderAuthProvider {
14
+ constructor(options) {
15
+ this.headerValue = options.apiKey;
16
+ }
17
+ static canCreate(options) {
18
+ return options.apiKey != null;
19
+ }
20
+ getAuthRequest(_arg) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ const apiKey = yield core.Supplier.get(this.headerValue);
23
+ if (apiKey == null) {
24
+ throw new errors.PulseError({
25
+ message: "Please specify a apiKey by passing it in to the constructor",
26
+ });
27
+ }
28
+ const headerValue = apiKey;
29
+ return {
30
+ headers: { "x-api-key": headerValue },
31
+ };
32
+ });
33
+ }
34
+ }
@@ -0,0 +1 @@
1
+ export { HeaderAuthProvider } from "./HeaderAuthProvider.mjs";
@@ -0,0 +1 @@
1
+ export { HeaderAuthProvider } from "./HeaderAuthProvider.mjs";
@@ -0,0 +1,7 @@
1
+ import type { EndpointMetadata } from "../fetcher/EndpointMetadata.mjs";
2
+ import type { AuthRequest } from "./AuthRequest.mjs";
3
+ export interface AuthProvider {
4
+ getAuthRequest(arg?: {
5
+ endpointMetadata?: EndpointMetadata;
6
+ }): Promise<AuthRequest>;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Request parameters for authentication requests.
3
+ */
4
+ export interface AuthRequest {
5
+ /**
6
+ * The headers to be included in the request.
7
+ */
8
+ headers: Record<string, string>;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface BasicAuth {
2
+ username: string;
3
+ password: string;
4
+ }
5
+ export declare const BasicAuth: {
6
+ toAuthorizationHeader: (basicAuth: BasicAuth | undefined) => string | undefined;
7
+ fromAuthorizationHeader: (header: string) => BasicAuth;
8
+ };
@@ -0,0 +1,24 @@
1
+ import { base64Decode, base64Encode } from "../base64.mjs";
2
+ const BASIC_AUTH_HEADER_PREFIX = /^Basic /i;
3
+ export const BasicAuth = {
4
+ toAuthorizationHeader: (basicAuth) => {
5
+ if (basicAuth == null) {
6
+ return undefined;
7
+ }
8
+ const token = base64Encode(`${basicAuth.username}:${basicAuth.password}`);
9
+ return `Basic ${token}`;
10
+ },
11
+ fromAuthorizationHeader: (header) => {
12
+ const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, "");
13
+ const decoded = base64Decode(credentials);
14
+ const [username, ...passwordParts] = decoded.split(":");
15
+ const password = passwordParts.length > 0 ? passwordParts.join(":") : undefined;
16
+ if (username == null || password == null) {
17
+ throw new Error("Invalid basic auth");
18
+ }
19
+ return {
20
+ username,
21
+ password,
22
+ };
23
+ },
24
+ };
@@ -0,0 +1,7 @@
1
+ export type BearerToken = string;
2
+ declare function toAuthorizationHeader(token: string | undefined): string | undefined;
3
+ export declare const BearerToken: {
4
+ toAuthorizationHeader: typeof toAuthorizationHeader;
5
+ fromAuthorizationHeader: (header: string) => BearerToken;
6
+ };
7
+ export {};
@@ -0,0 +1,13 @@
1
+ const BEARER_AUTH_HEADER_PREFIX = /^Bearer /i;
2
+ function toAuthorizationHeader(token) {
3
+ if (token == null) {
4
+ return undefined;
5
+ }
6
+ return `Bearer ${token}`;
7
+ }
8
+ export const BearerToken = {
9
+ toAuthorizationHeader: toAuthorizationHeader,
10
+ fromAuthorizationHeader: (header) => {
11
+ return header.replace(BEARER_AUTH_HEADER_PREFIX, "").trim();
12
+ },
13
+ };