@roarkanalytics/sdk 0.1.0-alpha.1 → 0.1.0-alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (347) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +1 -1
  3. package/README.md +48 -85
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/{internal/utils.js → _shims/auto/runtime-bun.js} +5 -8
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +89 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +241 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +908 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +876 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +3 -3
  81. package/error.d.ts.map +1 -1
  82. package/error.js +6 -6
  83. package/error.js.map +1 -1
  84. package/error.mjs +3 -3
  85. package/error.mjs.map +1 -1
  86. package/index.d.mts +109 -5
  87. package/index.d.ts +109 -5
  88. package/index.d.ts.map +1 -1
  89. package/index.js +103 -11
  90. package/index.js.map +1 -1
  91. package/index.mjs +77 -5
  92. package/index.mjs.map +1 -1
  93. package/package.json +66 -82
  94. package/resource.d.ts +3 -3
  95. package/resource.d.ts.map +1 -1
  96. package/resource.js.map +1 -1
  97. package/resource.mjs.map +1 -1
  98. package/resources/calls.d.ts +2 -3
  99. package/resources/calls.d.ts.map +1 -1
  100. package/resources/calls.js.map +1 -1
  101. package/resources/calls.mjs.map +1 -1
  102. package/resources/index.d.ts.map +1 -1
  103. package/shims/node.d.ts +30 -0
  104. package/shims/node.d.ts.map +1 -0
  105. package/shims/node.js +31 -0
  106. package/shims/node.js.map +1 -0
  107. package/shims/node.mjs +5 -0
  108. package/shims/node.mjs.map +1 -0
  109. package/shims/web.d.ts +26 -0
  110. package/shims/web.d.ts.map +1 -0
  111. package/shims/web.js +31 -0
  112. package/shims/web.js.map +1 -0
  113. package/shims/web.mjs +5 -0
  114. package/shims/web.mjs.map +1 -0
  115. package/src/_shims/MultipartBody.ts +9 -0
  116. package/src/_shims/README.md +46 -0
  117. package/src/_shims/auto/runtime-bun.ts +4 -0
  118. package/src/_shims/auto/runtime-node.ts +4 -0
  119. package/src/_shims/auto/runtime.ts +4 -0
  120. package/src/_shims/auto/types-node.ts +4 -0
  121. package/src/_shims/auto/types.d.ts +101 -0
  122. package/src/_shims/auto/types.js +3 -0
  123. package/src/_shims/auto/types.mjs +3 -0
  124. package/src/_shims/bun-runtime.ts +14 -0
  125. package/src/_shims/index.d.ts +81 -0
  126. package/src/_shims/index.js +13 -0
  127. package/src/_shims/index.mjs +7 -0
  128. package/src/_shims/manual-types.d.ts +12 -0
  129. package/src/_shims/manual-types.js +3 -0
  130. package/src/_shims/manual-types.mjs +3 -0
  131. package/src/_shims/node-runtime.ts +81 -0
  132. package/src/_shims/node-types.d.ts +42 -0
  133. package/src/_shims/node-types.js +3 -0
  134. package/src/_shims/node-types.mjs +3 -0
  135. package/src/_shims/registry.ts +67 -0
  136. package/src/_shims/web-runtime.ts +103 -0
  137. package/src/_shims/web-types.d.ts +83 -0
  138. package/src/_shims/web-types.js +3 -0
  139. package/src/_shims/web-types.mjs +3 -0
  140. package/src/core.ts +1200 -0
  141. package/src/error.ts +3 -3
  142. package/src/index.ts +172 -5
  143. package/src/resource.ts +3 -3
  144. package/src/resources/calls.ts +2 -3
  145. package/src/shims/node.ts +50 -0
  146. package/src/shims/web.ts +50 -0
  147. package/src/tsconfig.json +2 -2
  148. package/src/uploads.ts +255 -1
  149. package/src/version.ts +1 -1
  150. package/uploads.d.ts +74 -1
  151. package/uploads.d.ts.map +1 -1
  152. package/uploads.js +168 -3
  153. package/uploads.js.map +1 -1
  154. package/uploads.mjs +157 -1
  155. package/uploads.mjs.map +1 -1
  156. package/version.d.ts +1 -1
  157. package/version.js +1 -1
  158. package/version.mjs +1 -1
  159. package/api-promise.d.mts +0 -47
  160. package/api-promise.d.mts.map +0 -1
  161. package/api-promise.d.ts +0 -47
  162. package/api-promise.d.ts.map +0 -1
  163. package/api-promise.js +0 -84
  164. package/api-promise.js.map +0 -1
  165. package/api-promise.mjs +0 -80
  166. package/api-promise.mjs.map +0 -1
  167. package/client.d.mts +0 -186
  168. package/client.d.mts.map +0 -1
  169. package/client.d.ts +0 -186
  170. package/client.d.ts.map +0 -1
  171. package/client.js +0 -449
  172. package/client.js.map +0 -1
  173. package/client.mjs +0 -422
  174. package/client.mjs.map +0 -1
  175. package/error.d.mts +0 -47
  176. package/error.d.mts.map +0 -1
  177. package/index.d.mts.map +0 -1
  178. package/internal/builtin-types.d.mts +0 -65
  179. package/internal/builtin-types.d.mts.map +0 -1
  180. package/internal/builtin-types.d.ts +0 -65
  181. package/internal/builtin-types.d.ts.map +0 -1
  182. package/internal/builtin-types.js +0 -4
  183. package/internal/builtin-types.js.map +0 -1
  184. package/internal/builtin-types.mjs +0 -3
  185. package/internal/builtin-types.mjs.map +0 -1
  186. package/internal/detect-platform.d.mts +0 -15
  187. package/internal/detect-platform.d.mts.map +0 -1
  188. package/internal/detect-platform.d.ts +0 -15
  189. package/internal/detect-platform.d.ts.map +0 -1
  190. package/internal/detect-platform.js +0 -162
  191. package/internal/detect-platform.js.map +0 -1
  192. package/internal/detect-platform.mjs +0 -157
  193. package/internal/detect-platform.mjs.map +0 -1
  194. package/internal/errors.d.mts +0 -3
  195. package/internal/errors.d.mts.map +0 -1
  196. package/internal/errors.d.ts +0 -3
  197. package/internal/errors.d.ts.map +0 -1
  198. package/internal/errors.js +0 -26
  199. package/internal/errors.js.map +0 -1
  200. package/internal/errors.mjs +0 -21
  201. package/internal/errors.mjs.map +0 -1
  202. package/internal/headers.d.mts +0 -21
  203. package/internal/headers.d.mts.map +0 -1
  204. package/internal/headers.d.ts +0 -21
  205. package/internal/headers.d.ts.map +0 -1
  206. package/internal/headers.js +0 -77
  207. package/internal/headers.js.map +0 -1
  208. package/internal/headers.mjs +0 -72
  209. package/internal/headers.mjs.map +0 -1
  210. package/internal/parse.d.mts +0 -10
  211. package/internal/parse.d.mts.map +0 -1
  212. package/internal/parse.d.ts +0 -10
  213. package/internal/parse.d.ts.map +0 -1
  214. package/internal/parse.js +0 -28
  215. package/internal/parse.js.map +0 -1
  216. package/internal/parse.mjs +0 -24
  217. package/internal/parse.mjs.map +0 -1
  218. package/internal/polyfill/crypto.node.d.ts +0 -10
  219. package/internal/polyfill/crypto.node.js +0 -11
  220. package/internal/polyfill/crypto.node.mjs +0 -2
  221. package/internal/polyfill/file.node.d.ts +0 -9
  222. package/internal/polyfill/file.node.js +0 -17
  223. package/internal/polyfill/file.node.mjs +0 -9
  224. package/internal/request-options.d.mts +0 -34
  225. package/internal/request-options.d.mts.map +0 -1
  226. package/internal/request-options.d.ts +0 -34
  227. package/internal/request-options.d.ts.map +0 -1
  228. package/internal/request-options.js +0 -39
  229. package/internal/request-options.js.map +0 -1
  230. package/internal/request-options.mjs +0 -34
  231. package/internal/request-options.mjs.map +0 -1
  232. package/internal/shim-types.d.mts +0 -28
  233. package/internal/shim-types.d.ts +0 -28
  234. package/internal/shims.d.mts +0 -61
  235. package/internal/shims.d.mts.map +0 -1
  236. package/internal/shims.d.ts +0 -61
  237. package/internal/shims.d.ts.map +0 -1
  238. package/internal/shims.js +0 -101
  239. package/internal/shims.js.map +0 -1
  240. package/internal/shims.mjs +0 -92
  241. package/internal/shims.mjs.map +0 -1
  242. package/internal/types.d.mts +0 -68
  243. package/internal/types.d.mts.map +0 -1
  244. package/internal/types.d.ts +0 -68
  245. package/internal/types.d.ts.map +0 -1
  246. package/internal/types.js +0 -4
  247. package/internal/types.js.map +0 -1
  248. package/internal/types.mjs +0 -3
  249. package/internal/types.mjs.map +0 -1
  250. package/internal/uploads.d.mts +0 -73
  251. package/internal/uploads.d.mts.map +0 -1
  252. package/internal/uploads.d.ts +0 -73
  253. package/internal/uploads.d.ts.map +0 -1
  254. package/internal/uploads.js +0 -208
  255. package/internal/uploads.js.map +0 -1
  256. package/internal/uploads.mjs +0 -200
  257. package/internal/uploads.mjs.map +0 -1
  258. package/internal/utils/base64.d.mts +0 -3
  259. package/internal/utils/base64.d.mts.map +0 -1
  260. package/internal/utils/base64.d.ts +0 -3
  261. package/internal/utils/base64.d.ts.map +0 -1
  262. package/internal/utils/base64.js +0 -33
  263. package/internal/utils/base64.js.map +0 -1
  264. package/internal/utils/base64.mjs +0 -28
  265. package/internal/utils/base64.mjs.map +0 -1
  266. package/internal/utils/env.d.mts +0 -9
  267. package/internal/utils/env.d.mts.map +0 -1
  268. package/internal/utils/env.d.ts +0 -9
  269. package/internal/utils/env.d.ts.map +0 -1
  270. package/internal/utils/env.js +0 -22
  271. package/internal/utils/env.js.map +0 -1
  272. package/internal/utils/env.mjs +0 -18
  273. package/internal/utils/env.mjs.map +0 -1
  274. package/internal/utils/log.d.mts +0 -4
  275. package/internal/utils/log.d.mts.map +0 -1
  276. package/internal/utils/log.d.ts +0 -4
  277. package/internal/utils/log.d.ts.map +0 -1
  278. package/internal/utils/log.js +0 -47
  279. package/internal/utils/log.js.map +0 -1
  280. package/internal/utils/log.mjs +0 -43
  281. package/internal/utils/log.mjs.map +0 -1
  282. package/internal/utils/sleep.d.mts +0 -2
  283. package/internal/utils/sleep.d.mts.map +0 -1
  284. package/internal/utils/sleep.d.ts +0 -2
  285. package/internal/utils/sleep.d.ts.map +0 -1
  286. package/internal/utils/sleep.js +0 -7
  287. package/internal/utils/sleep.js.map +0 -1
  288. package/internal/utils/sleep.mjs +0 -3
  289. package/internal/utils/sleep.mjs.map +0 -1
  290. package/internal/utils/uuid.d.mts +0 -5
  291. package/internal/utils/uuid.d.mts.map +0 -1
  292. package/internal/utils/uuid.d.ts +0 -5
  293. package/internal/utils/uuid.d.ts.map +0 -1
  294. package/internal/utils/uuid.js +0 -15
  295. package/internal/utils/uuid.js.map +0 -1
  296. package/internal/utils/uuid.mjs +0 -11
  297. package/internal/utils/uuid.mjs.map +0 -1
  298. package/internal/utils/values.d.mts +0 -15
  299. package/internal/utils/values.d.mts.map +0 -1
  300. package/internal/utils/values.d.ts +0 -15
  301. package/internal/utils/values.d.ts.map +0 -1
  302. package/internal/utils/values.js +0 -100
  303. package/internal/utils/values.js.map +0 -1
  304. package/internal/utils/values.mjs +0 -84
  305. package/internal/utils/values.mjs.map +0 -1
  306. package/internal/utils.d.mts +0 -7
  307. package/internal/utils.d.mts.map +0 -1
  308. package/internal/utils.d.ts +0 -7
  309. package/internal/utils.d.ts.map +0 -1
  310. package/internal/utils.js.map +0 -1
  311. package/internal/utils.mjs +0 -8
  312. package/internal/utils.mjs.map +0 -1
  313. package/resource.d.mts +0 -6
  314. package/resource.d.mts.map +0 -1
  315. package/resources/calls.d.mts +0 -85
  316. package/resources/calls.d.mts.map +0 -1
  317. package/resources/index.d.mts +0 -2
  318. package/resources/index.d.mts.map +0 -1
  319. package/src/api-promise.ts +0 -92
  320. package/src/client.ts +0 -646
  321. package/src/internal/builtin-types.ts +0 -79
  322. package/src/internal/detect-platform.ts +0 -196
  323. package/src/internal/errors.ts +0 -22
  324. package/src/internal/headers.ts +0 -96
  325. package/src/internal/parse.ts +0 -41
  326. package/src/internal/polyfill/crypto.node.d.ts +0 -10
  327. package/src/internal/polyfill/crypto.node.js +0 -11
  328. package/src/internal/polyfill/crypto.node.mjs +0 -2
  329. package/src/internal/polyfill/file.node.d.ts +0 -9
  330. package/src/internal/polyfill/file.node.js +0 -17
  331. package/src/internal/polyfill/file.node.mjs +0 -9
  332. package/src/internal/request-options.ts +0 -67
  333. package/src/internal/shim-types.d.ts +0 -28
  334. package/src/internal/shims.ts +0 -145
  335. package/src/internal/types.ts +0 -98
  336. package/src/internal/uploads.ts +0 -307
  337. package/src/internal/utils/base64.ts +0 -37
  338. package/src/internal/utils/env.ts +0 -18
  339. package/src/internal/utils/log.ts +0 -49
  340. package/src/internal/utils/sleep.ts +0 -3
  341. package/src/internal/utils/uuid.ts +0 -13
  342. package/src/internal/utils/values.ts +0 -94
  343. package/src/internal/utils.ts +0 -8
  344. package/uploads.d.mts +0 -2
  345. package/uploads.d.mts.map +0 -1
  346. package/version.d.mts +0 -2
  347. package/version.d.mts.map +0 -1
package/api-promise.js DELETED
@@ -1,84 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
4
- if (kind === "m") throw new TypeError("Private method is not writable");
5
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
6
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
7
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8
- };
9
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
10
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
11
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
12
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
13
- };
14
- var _APIPromise_client;
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.APIPromise = void 0;
17
- const parse_1 = require("./internal/parse.js");
18
- /**
19
- * A subclass of `Promise` providing additional helper methods
20
- * for interacting with the SDK.
21
- */
22
- class APIPromise extends Promise {
23
- constructor(client, responsePromise, parseResponse = parse_1.defaultParseResponse) {
24
- super((resolve) => {
25
- // this is maybe a bit weird but this has to be a no-op to not implicitly
26
- // parse the response body; instead .then, .catch, .finally are overridden
27
- // to parse the response
28
- resolve(null);
29
- });
30
- this.responsePromise = responsePromise;
31
- this.parseResponse = parseResponse;
32
- _APIPromise_client.set(this, void 0);
33
- __classPrivateFieldSet(this, _APIPromise_client, client, "f");
34
- }
35
- _thenUnwrap(transform) {
36
- return new APIPromise(__classPrivateFieldGet(this, _APIPromise_client, "f"), this.responsePromise, async (client, props) => transform(await this.parseResponse(client, props), props));
37
- }
38
- /**
39
- * Gets the raw `Response` instance instead of parsing the response
40
- * data.
41
- *
42
- * If you want to parse the response body but still get the `Response`
43
- * instance, you can use {@link withResponse()}.
44
- *
45
- * 👋 Getting the wrong TypeScript type for `Response`?
46
- * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
47
- * to your `tsconfig.json`.
48
- */
49
- asResponse() {
50
- return this.responsePromise.then((p) => p.response);
51
- }
52
- /**
53
- * Gets the parsed response data and the raw `Response` instance.
54
- *
55
- * If you just want to get the raw `Response` instance without parsing it,
56
- * you can use {@link asResponse()}.
57
- *
58
- * 👋 Getting the wrong TypeScript type for `Response`?
59
- * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
60
- * to your `tsconfig.json`.
61
- */
62
- async withResponse() {
63
- const [data, response] = await Promise.all([this.parse(), this.asResponse()]);
64
- return { data, response };
65
- }
66
- parse() {
67
- if (!this.parsedPromise) {
68
- this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet(this, _APIPromise_client, "f"), data));
69
- }
70
- return this.parsedPromise;
71
- }
72
- then(onfulfilled, onrejected) {
73
- return this.parse().then(onfulfilled, onrejected);
74
- }
75
- catch(onrejected) {
76
- return this.parse().catch(onrejected);
77
- }
78
- finally(onfinally) {
79
- return this.parse().finally(onfinally);
80
- }
81
- }
82
- exports.APIPromise = APIPromise;
83
- _APIPromise_client = new WeakMap();
84
- //# sourceMappingURL=api-promise.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-promise.js","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;AAKtF,+CAA0E;AAE1E;;;GAGG;AACH,MAAa,UAAc,SAAQ,OAAU;IAI3C,YACE,MAAgB,EACR,eAA0C,EAC1C,gBAGiB,4BAAoB;QAE7C,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE;YAChB,yEAAyE;YACzE,0EAA0E;YAC1E,wBAAwB;YACxB,OAAO,CAAC,IAAW,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QAXK,oBAAe,GAAf,eAAe,CAA2B;QAC1C,kBAAa,GAAb,aAAa,CAGwB;QAR/C,qCAAkB;QAgBhB,uBAAA,IAAI,sBAAW,MAAM,MAAA,CAAC;IACxB,CAAC;IAED,WAAW,CAAI,SAAkD;QAC/D,OAAO,IAAI,UAAU,CAAC,uBAAA,IAAI,0BAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAChF,SAAS,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAC1D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,YAAY;QAChB,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QAC9E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC5B,CAAC;IAEO,KAAK;QACX,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACvB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,uBAAA,IAAI,0BAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;SAClG;QACD,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAEQ,IAAI,CACX,WAAiF,EACjF,UAAmF;QAEnF,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC;IAEQ,KAAK,CACZ,UAAiF;QAEjF,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAEQ,OAAO,CAAC,SAA2C;QAC1D,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;AAhFD,gCAgFC"}
package/api-promise.mjs DELETED
@@ -1,80 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
- if (kind === "m") throw new TypeError("Private method is not writable");
4
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
- };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
- var _APIPromise_client;
14
- import { defaultParseResponse } from "./internal/parse.mjs";
15
- /**
16
- * A subclass of `Promise` providing additional helper methods
17
- * for interacting with the SDK.
18
- */
19
- export class APIPromise extends Promise {
20
- constructor(client, responsePromise, parseResponse = defaultParseResponse) {
21
- super((resolve) => {
22
- // this is maybe a bit weird but this has to be a no-op to not implicitly
23
- // parse the response body; instead .then, .catch, .finally are overridden
24
- // to parse the response
25
- resolve(null);
26
- });
27
- this.responsePromise = responsePromise;
28
- this.parseResponse = parseResponse;
29
- _APIPromise_client.set(this, void 0);
30
- __classPrivateFieldSet(this, _APIPromise_client, client, "f");
31
- }
32
- _thenUnwrap(transform) {
33
- return new APIPromise(__classPrivateFieldGet(this, _APIPromise_client, "f"), this.responsePromise, async (client, props) => transform(await this.parseResponse(client, props), props));
34
- }
35
- /**
36
- * Gets the raw `Response` instance instead of parsing the response
37
- * data.
38
- *
39
- * If you want to parse the response body but still get the `Response`
40
- * instance, you can use {@link withResponse()}.
41
- *
42
- * 👋 Getting the wrong TypeScript type for `Response`?
43
- * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
44
- * to your `tsconfig.json`.
45
- */
46
- asResponse() {
47
- return this.responsePromise.then((p) => p.response);
48
- }
49
- /**
50
- * Gets the parsed response data and the raw `Response` instance.
51
- *
52
- * If you just want to get the raw `Response` instance without parsing it,
53
- * you can use {@link asResponse()}.
54
- *
55
- * 👋 Getting the wrong TypeScript type for `Response`?
56
- * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
57
- * to your `tsconfig.json`.
58
- */
59
- async withResponse() {
60
- const [data, response] = await Promise.all([this.parse(), this.asResponse()]);
61
- return { data, response };
62
- }
63
- parse() {
64
- if (!this.parsedPromise) {
65
- this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet(this, _APIPromise_client, "f"), data));
66
- }
67
- return this.parsedPromise;
68
- }
69
- then(onfulfilled, onrejected) {
70
- return this.parse().then(onfulfilled, onrejected);
71
- }
72
- catch(onrejected) {
73
- return this.parse().catch(onrejected);
74
- }
75
- finally(onfinally) {
76
- return this.parse().finally(onfinally);
77
- }
78
- }
79
- _APIPromise_client = new WeakMap();
80
- //# sourceMappingURL=api-promise.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-promise.mjs","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":"AAAA,sFAAsF;;;;;;;;;;;;;OAK/E,EAAoB,oBAAoB,EAAE;AAEjD;;;GAGG;AACH,MAAM,OAAO,UAAc,SAAQ,OAAU;IAI3C,YACE,MAAgB,EACR,eAA0C,EAC1C,gBAGiB,oBAAoB;QAE7C,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE;YAChB,yEAAyE;YACzE,0EAA0E;YAC1E,wBAAwB;YACxB,OAAO,CAAC,IAAW,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QAXK,oBAAe,GAAf,eAAe,CAA2B;QAC1C,kBAAa,GAAb,aAAa,CAGwB;QAR/C,qCAAkB;QAgBhB,uBAAA,IAAI,sBAAW,MAAM,MAAA,CAAC;IACxB,CAAC;IAED,WAAW,CAAI,SAAkD;QAC/D,OAAO,IAAI,UAAU,CAAC,uBAAA,IAAI,0BAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAChF,SAAS,CAAC,MAAM,IAAI,CAAC,aAAa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OrValue, MergedRequestInit } from "./internal/types.mjs";
4
- import * as Opts from "./internal/request-options.mjs";
5
- import * as Errors from "./error.mjs";
6
- import * as Uploads from "./uploads.mjs";
7
- import * as API from "./resources/index.mjs";
8
- import { APIPromise } from "./api-promise.mjs";
9
- import { type Fetch } from "./internal/builtin-types.mjs";
10
- import { HeadersLike, NullableHeaders } from "./internal/headers.mjs";
11
- import { FinalRequestOptions, RequestOptions } from "./internal/request-options.mjs";
12
- import { CallCreateParams, CallCreateResponse, Calls } from "./resources/calls.mjs";
13
- type LogFn = (message: string, ...rest: unknown[]) => void;
14
- export type Logger = {
15
- error: LogFn;
16
- warn: LogFn;
17
- info: LogFn;
18
- debug: LogFn;
19
- };
20
- export type LogLevel = 'off' | 'error' | 'warn' | 'info' | 'debug';
21
- export interface ClientOptions {
22
- /**
23
- * JWT token for authentication
24
- */
25
- bearerToken?: string | undefined;
26
- /**
27
- * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
28
- *
29
- * Defaults to process.env['PETSTORE_BASE_URL'].
30
- */
31
- baseURL?: string | null | undefined;
32
- /**
33
- * The maximum amount of time (in milliseconds) that the client should wait for a response
34
- * from the server before timing out a single request.
35
- *
36
- * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
37
- * much longer than this timeout before the promise succeeds or fails.
38
- */
39
- timeout?: number | undefined;
40
- /**
41
- * Additional `RequestInit` options to be passed to `fetch` calls.
42
- * Properties will be overridden by per-request `fetchOptions`.
43
- */
44
- fetchOptions?: MergedRequestInit | undefined;
45
- /**
46
- * Specify a custom `fetch` function implementation.
47
- *
48
- * If not provided, we expect that `fetch` is defined globally.
49
- */
50
- fetch?: Fetch | undefined;
51
- /**
52
- * The maximum number of times that the client will retry a request in case of a
53
- * temporary failure, like a network error or a 5XX error from the server.
54
- *
55
- * @default 2
56
- */
57
- maxRetries?: number | undefined;
58
- /**
59
- * Default headers to include with every request to the API.
60
- *
61
- * These can be removed in individual requests by explicitly setting the
62
- * header to `null` in request options.
63
- */
64
- defaultHeaders?: HeadersLike | undefined;
65
- /**
66
- * Default query parameters to include with every request to the API.
67
- *
68
- * These can be removed in individual requests by explicitly setting the
69
- * param to `undefined` in request options.
70
- */
71
- defaultQuery?: Record<string, string | undefined> | undefined;
72
- /**
73
- * Set the log level.
74
- *
75
- * Defaults to process.env['PETSTORE_LOG'].
76
- */
77
- logLevel?: LogLevel | undefined | null;
78
- /**
79
- * Set the logger.
80
- *
81
- * Defaults to globalThis.console.
82
- */
83
- logger?: Logger | undefined | null;
84
- }
85
- type FinalizedRequestInit = RequestInit & {
86
- headers: Headers;
87
- };
88
- /**
89
- * API Client for interfacing with the Petstore API.
90
- */
91
- export declare class Petstore {
92
- #private;
93
- bearerToken: string;
94
- baseURL: string;
95
- maxRetries: number;
96
- timeout: number;
97
- logger: Logger | undefined;
98
- logLevel: LogLevel | undefined;
99
- fetchOptions: MergedRequestInit | undefined;
100
- private fetch;
101
- protected idempotencyHeader?: string;
102
- private _options;
103
- /**
104
- * API Client for interfacing with the Petstore API.
105
- *
106
- * @param {string | undefined} [opts.bearerToken=process.env['ROARK_API_BEARER_TOKEN'] ?? undefined]
107
- * @param {string} [opts.baseURL=process.env['PETSTORE_BASE_URL'] ?? https://petstore3.swagger.io/api/v3] - Override the default base URL for the API.
108
- * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
109
- * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
110
- * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
111
- * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
112
- * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
113
- * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
114
- */
115
- constructor({ baseURL, bearerToken, ...opts }?: ClientOptions);
116
- protected defaultQuery(): Record<string, string | undefined> | undefined;
117
- protected validateHeaders({ values, nulls }: NullableHeaders): void;
118
- protected authHeaders(opts: FinalRequestOptions): Headers | undefined;
119
- /**
120
- * Basic re-implementation of `qs.stringify` for primitive types.
121
- */
122
- protected stringifyQuery(query: Record<string, unknown>): string;
123
- private getUserAgent;
124
- protected defaultIdempotencyKey(): string;
125
- protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
126
- buildURL(path: string, query: Record<string, unknown> | null | undefined): string;
127
- private calculateContentLength;
128
- /**
129
- * Used as a callback for mutating the given `FinalRequestOptions` object.
130
- */
131
- protected prepareOptions(options: FinalRequestOptions): Promise<void>;
132
- /**
133
- * Used as a callback for mutating the given `RequestInit` object.
134
- *
135
- * This is useful for cases where you want to add certain headers based off of
136
- * the request properties, e.g. `method` or `url`.
137
- */
138
- protected prepareRequest(request: RequestInit, { url, options }: {
139
- url: string;
140
- options: FinalRequestOptions;
141
- }): Promise<void>;
142
- get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
143
- post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
144
- patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
145
- put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
146
- delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
147
- private methodRequest;
148
- request<Rsp>(options: PromiseOrValue<FinalRequestOptions>, remainingRetries?: number | null): APIPromise<Rsp>;
149
- private makeRequest;
150
- fetchWithTimeout(url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController): Promise<Response>;
151
- private shouldRetry;
152
- private retryRequest;
153
- private calculateDefaultRetryTimeoutMillis;
154
- buildRequest(options: FinalRequestOptions, { retryCount }?: {
155
- retryCount?: number;
156
- }): {
157
- req: FinalizedRequestInit;
158
- url: string;
159
- timeout: number;
160
- };
161
- private buildHeaders;
162
- private buildBody;
163
- static Petstore: typeof Petstore;
164
- static DEFAULT_TIMEOUT: number;
165
- static PetstoreError: typeof Errors.PetstoreError;
166
- static APIError: typeof Errors.APIError;
167
- static APIConnectionError: typeof Errors.APIConnectionError;
168
- static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
169
- static APIUserAbortError: typeof Errors.APIUserAbortError;
170
- static NotFoundError: typeof Errors.NotFoundError;
171
- static ConflictError: typeof Errors.ConflictError;
172
- static RateLimitError: typeof Errors.RateLimitError;
173
- static BadRequestError: typeof Errors.BadRequestError;
174
- static AuthenticationError: typeof Errors.AuthenticationError;
175
- static InternalServerError: typeof Errors.InternalServerError;
176
- static PermissionDeniedError: typeof Errors.PermissionDeniedError;
177
- static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
178
- static toFile: typeof Uploads.toFile;
179
- calls: API.Calls;
180
- }
181
- export declare namespace Petstore {
182
- export type RequestOptions = Opts.RequestOptions;
183
- export { Calls as Calls, type CallCreateResponse as CallCreateResponse, type CallCreateParams as CallCreateParams, };
184
- }
185
- export {};
186
- //# sourceMappingURL=client.d.mts.map
package/client.d.mts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":";OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE;OAQtD,KAAK,IAAI;OAET,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,KAAK,EAAE;OACd,EAAE,WAAW,EAAE,eAAe,EAAgB;OAC9C,EAAE,mBAAmB,EAAE,cAAc,EAAE;OACvC,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,KAAK,EAAE;AAatD,KAAK,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;AAC3D,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,KA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;QAAE,GAAG,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAuB9D,OAAO,CAAC,YAAY;IAoCpB,OAAO,CAAC,SAAS;IAqCjB,MAAM,CAAC,QAAQ,kBAAQ;IACvB,MAAM,CAAC,eAAe,SAAS;IAE/B,MAAM,CAAC,aAAa,8BAAwB;IAC5C,MAAM,CAAC,QAAQ,yBAAmB;IAClC,MAAM,CAAC,kBAAkB,mCAA6B;IACtD,MAAM,CAAC,yBAAyB,0CAAoC;IACpE,MAAM,CAAC,iBAAiB,kCAA4B;IACpD,MAAM,CAAC,aAAa,8BAAwB;IAC5C,MAAM,CAAC,aAAa,8BAAwB;IAC5C,MAAM,CAAC,cAAc,+BAAyB;IAC9C,MAAM,CAAC,eAAe,gCAA0B;IAChD,MAAM,CAAC,mBAAmB,oCAA8B;IACxD,MAAM,CAAC,mBAAmB,oCAA8B;IACxD,MAAM,CAAC,qBAAqB,sCAAgC;IAC5D,MAAM,CAAC,wBAAwB,yCAAmC;IAElE,MAAM,CAAC,MAAM,wBAAkB;IAE/B,KAAK,EAAE,GAAG,CAAC,KAAK,CAAuB;CACxC;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAEjD,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
package/client.d.ts DELETED
@@ -1,186 +0,0 @@
1
-
2
- import type { RequestInit, RequestInfo } from "./internal/builtin-types.js";
3
- import type { PromiseOrValue, MergedRequestInit } from "./internal/types.js";
4
- import * as Opts from "./internal/request-options.js";
5
- import * as Errors from "./error.js";
6
- import * as Uploads from "./uploads.js";
7
- import * as API from "./resources/index.js";
8
- import { APIPromise } from "./api-promise.js";
9
- import { type Fetch } from "./internal/builtin-types.js";
10
- import { HeadersLike, NullableHeaders } from "./internal/headers.js";
11
- import { FinalRequestOptions, RequestOptions } from "./internal/request-options.js";
12
- import { CallCreateParams, CallCreateResponse, Calls } from "./resources/calls.js";
13
- type LogFn = (message: string, ...rest: unknown[]) => void;
14
- export type Logger = {
15
- error: LogFn;
16
- warn: LogFn;
17
- info: LogFn;
18
- debug: LogFn;
19
- };
20
- export type LogLevel = 'off' | 'error' | 'warn' | 'info' | 'debug';
21
- export interface ClientOptions {
22
- /**
23
- * JWT token for authentication
24
- */
25
- bearerToken?: string | undefined;
26
- /**
27
- * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
28
- *
29
- * Defaults to process.env['PETSTORE_BASE_URL'].
30
- */
31
- baseURL?: string | null | undefined;
32
- /**
33
- * The maximum amount of time (in milliseconds) that the client should wait for a response
34
- * from the server before timing out a single request.
35
- *
36
- * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
37
- * much longer than this timeout before the promise succeeds or fails.
38
- */
39
- timeout?: number | undefined;
40
- /**
41
- * Additional `RequestInit` options to be passed to `fetch` calls.
42
- * Properties will be overridden by per-request `fetchOptions`.
43
- */
44
- fetchOptions?: MergedRequestInit | undefined;
45
- /**
46
- * Specify a custom `fetch` function implementation.
47
- *
48
- * If not provided, we expect that `fetch` is defined globally.
49
- */
50
- fetch?: Fetch | undefined;
51
- /**
52
- * The maximum number of times that the client will retry a request in case of a
53
- * temporary failure, like a network error or a 5XX error from the server.
54
- *
55
- * @default 2
56
- */
57
- maxRetries?: number | undefined;
58
- /**
59
- * Default headers to include with every request to the API.
60
- *
61
- * These can be removed in individual requests by explicitly setting the
62
- * header to `null` in request options.
63
- */
64
- defaultHeaders?: HeadersLike | undefined;
65
- /**
66
- * Default query parameters to include with every request to the API.
67
- *
68
- * These can be removed in individual requests by explicitly setting the
69
- * param to `undefined` in request options.
70
- */
71
- defaultQuery?: Record<string, string | undefined> | undefined;
72
- /**
73
- * Set the log level.
74
- *
75
- * Defaults to process.env['PETSTORE_LOG'].
76
- */
77
- logLevel?: LogLevel | undefined | null;
78
- /**
79
- * Set the logger.
80
- *
81
- * Defaults to globalThis.console.
82
- */
83
- logger?: Logger | undefined | null;
84
- }
85
- type FinalizedRequestInit = RequestInit & {
86
- headers: Headers;
87
- };
88
- /**
89
- * API Client for interfacing with the Petstore API.
90
- */
91
- export declare class Petstore {
92
- #private;
93
- bearerToken: string;
94
- baseURL: string;
95
- maxRetries: number;
96
- timeout: number;
97
- logger: Logger | undefined;
98
- logLevel: LogLevel | undefined;
99
- fetchOptions: MergedRequestInit | undefined;
100
- private fetch;
101
- protected idempotencyHeader?: string;
102
- private _options;
103
- /**
104
- * API Client for interfacing with the Petstore API.
105
- *
106
- * @param {string | undefined} [opts.bearerToken=process.env['ROARK_API_BEARER_TOKEN'] ?? undefined]
107
- * @param {string} [opts.baseURL=process.env['PETSTORE_BASE_URL'] ?? https://petstore3.swagger.io/api/v3] - Override the default base URL for the API.
108
- * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
109
- * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
110
- * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
111
- * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
112
- * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
113
- * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
114
- */
115
- constructor({ baseURL, bearerToken, ...opts }?: ClientOptions);
116
- protected defaultQuery(): Record<string, string | undefined> | undefined;
117
- protected validateHeaders({ values, nulls }: NullableHeaders): void;
118
- protected authHeaders(opts: FinalRequestOptions): Headers | undefined;
119
- /**
120
- * Basic re-implementation of `qs.stringify` for primitive types.
121
- */
122
- protected stringifyQuery(query: Record<string, unknown>): string;
123
- private getUserAgent;
124
- protected defaultIdempotencyKey(): string;
125
- protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
126
- buildURL(path: string, query: Record<string, unknown> | null | undefined): string;
127
- private calculateContentLength;
128
- /**
129
- * Used as a callback for mutating the given `FinalRequestOptions` object.
130
- */
131
- protected prepareOptions(options: FinalRequestOptions): Promise<void>;
132
- /**
133
- * Used as a callback for mutating the given `RequestInit` object.
134
- *
135
- * This is useful for cases where you want to add certain headers based off of
136
- * the request properties, e.g. `method` or `url`.
137
- */
138
- protected prepareRequest(request: RequestInit, { url, options }: {
139
- url: string;
140
- options: FinalRequestOptions;
141
- }): Promise<void>;
142
- get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
143
- post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
144
- patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
145
- put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
146
- delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
147
- private methodRequest;
148
- request<Rsp>(options: PromiseOrValue<FinalRequestOptions>, remainingRetries?: number | null): APIPromise<Rsp>;
149
- private makeRequest;
150
- fetchWithTimeout(url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController): Promise<Response>;
151
- private shouldRetry;
152
- private retryRequest;
153
- private calculateDefaultRetryTimeoutMillis;
154
- buildRequest(options: FinalRequestOptions, { retryCount }?: {
155
- retryCount?: number;
156
- }): {
157
- req: FinalizedRequestInit;
158
- url: string;
159
- timeout: number;
160
- };
161
- private buildHeaders;
162
- private buildBody;
163
- static Petstore: typeof Petstore;
164
- static DEFAULT_TIMEOUT: number;
165
- static PetstoreError: typeof Errors.PetstoreError;
166
- static APIError: typeof Errors.APIError;
167
- static APIConnectionError: typeof Errors.APIConnectionError;
168
- static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
169
- static APIUserAbortError: typeof Errors.APIUserAbortError;
170
- static NotFoundError: typeof Errors.NotFoundError;
171
- static ConflictError: typeof Errors.ConflictError;
172
- static RateLimitError: typeof Errors.RateLimitError;
173
- static BadRequestError: typeof Errors.BadRequestError;
174
- static AuthenticationError: typeof Errors.AuthenticationError;
175
- static InternalServerError: typeof Errors.InternalServerError;
176
- static PermissionDeniedError: typeof Errors.PermissionDeniedError;
177
- static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
178
- static toFile: typeof Uploads.toFile;
179
- calls: API.Calls;
180
- }
181
- export declare namespace Petstore {
182
- export type RequestOptions = Opts.RequestOptions;
183
- export { Calls as Calls, type CallCreateResponse as CallCreateResponse, type CallCreateParams as CallCreateParams, };
184
- }
185
- export {};
186
- //# sourceMappingURL=client.d.ts.map
package/client.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":";OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE;OAQtD,KAAK,IAAI;OAET,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,KAAK,EAAE;OACd,EAAE,WAAW,EAAE,eAAe,EAAgB;OAC9C,EAAE,mBAAmB,EAAE,cAAc,EAAE;OACvC,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,KAAK,EAAE;AAatD,KAAK,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;AAC3D,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAA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