lark-billing 0.1.3 → 0.1.5

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 (949) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +201 -0
  3. package/README.md +328 -110
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +204 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +204 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +485 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +481 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +6 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +6 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +30 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +7 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +35 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +32 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/request-options.d.mts +75 -0
  109. package/internal/request-options.d.mts.map +1 -0
  110. package/internal/request-options.d.ts +75 -0
  111. package/internal/request-options.d.ts.map +1 -0
  112. package/internal/request-options.js +14 -0
  113. package/internal/request-options.js.map +1 -0
  114. package/internal/request-options.mjs +10 -0
  115. package/internal/request-options.mjs.map +1 -0
  116. package/internal/shim-types.d.mts +17 -0
  117. package/internal/shim-types.d.mts.map +1 -0
  118. package/internal/shim-types.d.ts +17 -0
  119. package/internal/shim-types.d.ts.map +1 -0
  120. package/internal/shim-types.js +4 -0
  121. package/internal/shim-types.js.map +1 -0
  122. package/internal/shim-types.mjs +3 -0
  123. package/internal/shim-types.mjs.map +1 -0
  124. package/internal/shims.d.mts +20 -0
  125. package/internal/shims.d.mts.map +1 -0
  126. package/internal/shims.d.ts +20 -0
  127. package/internal/shims.d.ts.map +1 -0
  128. package/internal/shims.js +92 -0
  129. package/internal/shims.js.map +1 -0
  130. package/internal/shims.mjs +85 -0
  131. package/internal/shims.mjs.map +1 -0
  132. package/internal/to-file.d.mts +45 -0
  133. package/internal/to-file.d.mts.map +1 -0
  134. package/internal/to-file.d.ts +45 -0
  135. package/internal/to-file.d.ts.map +1 -0
  136. package/internal/to-file.js +91 -0
  137. package/internal/to-file.js.map +1 -0
  138. package/internal/to-file.mjs +88 -0
  139. package/internal/to-file.mjs.map +1 -0
  140. package/internal/tslib.js +81 -0
  141. package/internal/tslib.mjs +17 -0
  142. package/internal/types.d.mts +69 -0
  143. package/internal/types.d.mts.map +1 -0
  144. package/internal/types.d.ts +69 -0
  145. package/internal/types.d.ts.map +1 -0
  146. package/internal/types.js +4 -0
  147. package/internal/types.js.map +1 -0
  148. package/internal/types.mjs +3 -0
  149. package/internal/types.mjs.map +1 -0
  150. package/internal/uploads.d.mts +42 -0
  151. package/internal/uploads.d.mts.map +1 -0
  152. package/internal/uploads.d.ts +42 -0
  153. package/internal/uploads.d.ts.map +1 -0
  154. package/internal/uploads.js +141 -0
  155. package/internal/uploads.js.map +1 -0
  156. package/internal/uploads.mjs +131 -0
  157. package/internal/uploads.mjs.map +1 -0
  158. package/internal/utils/base64.d.mts +3 -0
  159. package/internal/utils/base64.d.mts.map +1 -0
  160. package/internal/utils/base64.d.ts +3 -0
  161. package/internal/utils/base64.d.ts.map +1 -0
  162. package/internal/utils/base64.js +38 -0
  163. package/internal/utils/base64.js.map +1 -0
  164. package/internal/utils/base64.mjs +33 -0
  165. package/internal/utils/base64.mjs.map +1 -0
  166. package/internal/utils/bytes.d.mts +4 -0
  167. package/internal/utils/bytes.d.mts.map +1 -0
  168. package/internal/utils/bytes.d.ts +4 -0
  169. package/internal/utils/bytes.d.ts.map +1 -0
  170. package/internal/utils/bytes.js +31 -0
  171. package/internal/utils/bytes.js.map +1 -0
  172. package/internal/utils/bytes.mjs +26 -0
  173. package/internal/utils/bytes.mjs.map +1 -0
  174. package/internal/utils/env.d.mts +9 -0
  175. package/internal/utils/env.d.mts.map +1 -0
  176. package/internal/utils/env.d.ts +9 -0
  177. package/internal/utils/env.d.ts.map +1 -0
  178. package/internal/utils/env.js +22 -0
  179. package/internal/utils/env.js.map +1 -0
  180. package/internal/utils/env.mjs +18 -0
  181. package/internal/utils/env.mjs.map +1 -0
  182. package/internal/utils/log.d.mts +37 -0
  183. package/internal/utils/log.d.mts.map +1 -0
  184. package/internal/utils/log.d.ts +37 -0
  185. package/internal/utils/log.d.ts.map +1 -0
  186. package/internal/utils/log.js +86 -0
  187. package/internal/utils/log.js.map +1 -0
  188. package/internal/utils/log.mjs +80 -0
  189. package/internal/utils/log.mjs.map +1 -0
  190. package/internal/utils/path.d.mts +15 -0
  191. package/internal/utils/path.d.mts.map +1 -0
  192. package/internal/utils/path.d.ts +15 -0
  193. package/internal/utils/path.d.ts.map +1 -0
  194. package/internal/utils/path.js +79 -0
  195. package/internal/utils/path.js.map +1 -0
  196. package/internal/utils/path.mjs +74 -0
  197. package/internal/utils/path.mjs.map +1 -0
  198. package/internal/utils/sleep.d.mts +2 -0
  199. package/internal/utils/sleep.d.mts.map +1 -0
  200. package/internal/utils/sleep.d.ts +2 -0
  201. package/internal/utils/sleep.d.ts.map +1 -0
  202. package/internal/utils/sleep.js +7 -0
  203. package/internal/utils/sleep.js.map +1 -0
  204. package/internal/utils/sleep.mjs +3 -0
  205. package/internal/utils/sleep.mjs.map +1 -0
  206. package/internal/utils/uuid.d.mts +5 -0
  207. package/internal/utils/uuid.d.mts.map +1 -0
  208. package/internal/utils/uuid.d.ts +5 -0
  209. package/internal/utils/uuid.d.ts.map +1 -0
  210. package/internal/utils/uuid.js +19 -0
  211. package/internal/utils/uuid.js.map +1 -0
  212. package/internal/utils/uuid.mjs +15 -0
  213. package/internal/utils/uuid.mjs.map +1 -0
  214. package/internal/utils/values.d.mts +18 -0
  215. package/internal/utils/values.d.mts.map +1 -0
  216. package/internal/utils/values.d.ts +18 -0
  217. package/internal/utils/values.d.ts.map +1 -0
  218. package/internal/utils/values.js +112 -0
  219. package/internal/utils/values.js.map +1 -0
  220. package/internal/utils/values.mjs +94 -0
  221. package/internal/utils/values.mjs.map +1 -0
  222. package/internal/utils.d.mts +7 -0
  223. package/internal/utils.d.mts.map +1 -0
  224. package/internal/utils.d.ts +7 -0
  225. package/internal/utils.d.ts.map +1 -0
  226. package/internal/utils.js +11 -0
  227. package/internal/utils.js.map +1 -0
  228. package/internal/utils.mjs +8 -0
  229. package/internal/utils.mjs.map +1 -0
  230. package/package.json +136 -64
  231. package/resource.d.mts +2 -0
  232. package/resource.d.mts.map +1 -0
  233. package/resource.d.ts +2 -0
  234. package/resource.d.ts.map +1 -0
  235. package/resource.js +6 -0
  236. package/resource.js.map +1 -0
  237. package/resource.mjs +2 -0
  238. package/resource.mjs.map +1 -0
  239. package/resources/checkout.d.mts +61 -0
  240. package/resources/checkout.d.mts.map +1 -0
  241. package/resources/checkout.d.ts +61 -0
  242. package/resources/checkout.d.ts.map +1 -0
  243. package/resources/checkout.js +15 -0
  244. package/resources/checkout.js.map +1 -0
  245. package/resources/checkout.mjs +11 -0
  246. package/resources/checkout.mjs.map +1 -0
  247. package/resources/customer-access.d.mts +44 -0
  248. package/resources/customer-access.d.mts.map +1 -0
  249. package/resources/customer-access.d.ts +44 -0
  250. package/resources/customer-access.d.ts.map +1 -0
  251. package/resources/customer-access.js +16 -0
  252. package/resources/customer-access.js.map +1 -0
  253. package/resources/customer-access.mjs +12 -0
  254. package/resources/customer-access.mjs.map +1 -0
  255. package/resources/customer-portal.d.mts +33 -0
  256. package/resources/customer-portal.d.mts.map +1 -0
  257. package/resources/customer-portal.d.ts +33 -0
  258. package/resources/customer-portal.d.ts.map +1 -0
  259. package/resources/customer-portal.js +15 -0
  260. package/resources/customer-portal.js.map +1 -0
  261. package/resources/customer-portal.mjs +11 -0
  262. package/resources/customer-portal.mjs.map +1 -0
  263. package/resources/index.d.mts +10 -0
  264. package/resources/index.d.mts.map +1 -0
  265. package/resources/index.d.ts +10 -0
  266. package/resources/index.d.ts.map +1 -0
  267. package/resources/index.js +23 -0
  268. package/resources/index.js.map +1 -0
  269. package/resources/index.mjs +11 -0
  270. package/resources/index.mjs.map +1 -0
  271. package/resources/invoices.d.mts +66 -0
  272. package/resources/invoices.d.mts.map +1 -0
  273. package/resources/invoices.d.ts +66 -0
  274. package/resources/invoices.d.ts.map +1 -0
  275. package/resources/invoices.js +15 -0
  276. package/resources/invoices.js.map +1 -0
  277. package/resources/invoices.mjs +11 -0
  278. package/resources/invoices.mjs.map +1 -0
  279. package/resources/pricing-metrics.d.mts +229 -0
  280. package/resources/pricing-metrics.d.mts.map +1 -0
  281. package/resources/pricing-metrics.d.ts +229 -0
  282. package/resources/pricing-metrics.d.ts.map +1 -0
  283. package/resources/pricing-metrics.js +73 -0
  284. package/resources/pricing-metrics.js.map +1 -0
  285. package/resources/pricing-metrics.mjs +69 -0
  286. package/resources/pricing-metrics.mjs.map +1 -0
  287. package/resources/rate-cards.d.mts +219 -0
  288. package/resources/rate-cards.d.mts.map +1 -0
  289. package/resources/rate-cards.d.ts +219 -0
  290. package/resources/rate-cards.d.ts.map +1 -0
  291. package/resources/rate-cards.js +48 -0
  292. package/resources/rate-cards.js.map +1 -0
  293. package/resources/rate-cards.mjs +44 -0
  294. package/resources/rate-cards.mjs.map +1 -0
  295. package/resources/subjects.d.mts +171 -0
  296. package/resources/subjects.d.mts.map +1 -0
  297. package/resources/subjects.d.ts +171 -0
  298. package/resources/subjects.d.ts.map +1 -0
  299. package/resources/subjects.js +74 -0
  300. package/resources/subjects.js.map +1 -0
  301. package/resources/subjects.mjs +70 -0
  302. package/resources/subjects.mjs.map +1 -0
  303. package/resources/subscriptions.d.mts +199 -0
  304. package/resources/subscriptions.d.mts.map +1 -0
  305. package/resources/subscriptions.d.ts +199 -0
  306. package/resources/subscriptions.d.ts.map +1 -0
  307. package/resources/subscriptions.js +80 -0
  308. package/resources/subscriptions.js.map +1 -0
  309. package/resources/subscriptions.mjs +76 -0
  310. package/resources/subscriptions.mjs.map +1 -0
  311. package/resources/usage-events.d.mts +56 -0
  312. package/resources/usage-events.d.mts.map +1 -0
  313. package/resources/usage-events.d.ts +56 -0
  314. package/resources/usage-events.d.ts.map +1 -0
  315. package/resources/usage-events.js +29 -0
  316. package/resources/usage-events.js.map +1 -0
  317. package/resources/usage-events.mjs +25 -0
  318. package/resources/usage-events.mjs.map +1 -0
  319. package/resources.d.mts +2 -0
  320. package/resources.d.mts.map +1 -0
  321. package/resources.d.ts +2 -0
  322. package/resources.d.ts.map +1 -0
  323. package/resources.js +5 -0
  324. package/resources.js.map +1 -0
  325. package/resources.mjs +2 -0
  326. package/resources.mjs.map +1 -0
  327. package/src/api-promise.ts +2 -0
  328. package/src/client.ts +873 -0
  329. package/src/core/README.md +3 -0
  330. package/src/core/api-promise.ts +92 -0
  331. package/src/core/error.ts +130 -0
  332. package/src/core/resource.ts +11 -0
  333. package/src/core/uploads.ts +2 -0
  334. package/src/error.ts +2 -0
  335. package/src/index.ts +22 -0
  336. package/src/internal/README.md +3 -0
  337. package/src/internal/builtin-types.ts +93 -0
  338. package/src/internal/detect-platform.ts +196 -0
  339. package/src/internal/errors.ts +33 -0
  340. package/src/internal/headers.ts +97 -0
  341. package/src/internal/parse.ts +50 -0
  342. package/src/internal/request-options.ts +91 -0
  343. package/src/internal/shim-types.ts +26 -0
  344. package/src/internal/shims.ts +107 -0
  345. package/src/internal/to-file.ts +154 -0
  346. package/src/internal/types.ts +95 -0
  347. package/src/internal/uploads.ts +187 -0
  348. package/src/internal/utils/base64.ts +40 -0
  349. package/src/internal/utils/bytes.ts +32 -0
  350. package/src/internal/utils/env.ts +18 -0
  351. package/src/internal/utils/log.ts +127 -0
  352. package/src/internal/utils/path.ts +88 -0
  353. package/src/internal/utils/sleep.ts +3 -0
  354. package/src/internal/utils/uuid.ts +17 -0
  355. package/src/internal/utils/values.ts +105 -0
  356. package/src/internal/utils.ts +8 -0
  357. package/src/lib/.keep +4 -0
  358. package/src/resource.ts +2 -0
  359. package/src/resources/checkout.ts +81 -0
  360. package/src/resources/customer-access.ts +63 -0
  361. package/src/resources/customer-portal.ts +48 -0
  362. package/src/resources/index.ts +59 -0
  363. package/src/resources/invoices.ts +87 -0
  364. package/src/resources/pricing-metrics.ts +307 -0
  365. package/src/resources/rate-cards.ts +292 -0
  366. package/src/resources/subjects.ts +220 -0
  367. package/src/resources/subscriptions.ts +267 -0
  368. package/src/resources/usage-events.ts +68 -0
  369. package/src/resources.ts +1 -0
  370. package/src/tsconfig.json +11 -0
  371. package/src/uploads.ts +2 -0
  372. package/src/version.ts +1 -0
  373. package/uploads.d.mts +2 -0
  374. package/uploads.d.mts.map +1 -0
  375. package/uploads.d.ts +2 -0
  376. package/uploads.d.ts.map +1 -0
  377. package/uploads.js +6 -0
  378. package/uploads.js.map +1 -0
  379. package/uploads.mjs +2 -0
  380. package/uploads.mjs.map +1 -0
  381. package/version.d.mts +2 -0
  382. package/version.d.mts.map +1 -0
  383. package/version.d.ts +2 -0
  384. package/version.d.ts.map +1 -0
  385. package/version.js +5 -0
  386. package/version.js.map +1 -0
  387. package/version.mjs +2 -0
  388. package/version.mjs.map +1 -0
  389. package/dist/cjs/Client.d.ts +0 -58
  390. package/dist/cjs/Client.js +0 -99
  391. package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +0 -9
  392. package/dist/cjs/api/errors/UnprocessableEntityError.js +0 -52
  393. package/dist/cjs/api/errors/index.d.ts +0 -1
  394. package/dist/cjs/api/errors/index.js +0 -17
  395. package/dist/cjs/api/index.d.ts +0 -3
  396. package/dist/cjs/api/index.js +0 -19
  397. package/dist/cjs/api/resources/checkout/client/Client.d.ts +0 -53
  398. package/dist/cjs/api/resources/checkout/client/Client.js +0 -135
  399. package/dist/cjs/api/resources/checkout/client/index.d.ts +0 -2
  400. package/dist/cjs/api/resources/checkout/client/index.js +0 -17
  401. package/dist/cjs/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.ts +0 -23
  402. package/dist/cjs/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.js +0 -5
  403. package/dist/cjs/api/resources/checkout/client/requests/index.d.ts +0 -1
  404. package/dist/cjs/api/resources/checkout/client/requests/index.js +0 -2
  405. package/dist/cjs/api/resources/checkout/index.d.ts +0 -1
  406. package/dist/cjs/api/resources/checkout/index.js +0 -17
  407. package/dist/cjs/api/resources/customerAccess/client/Client.d.ts +0 -46
  408. package/dist/cjs/api/resources/customerAccess/client/Client.js +0 -122
  409. package/dist/cjs/api/resources/customerAccess/client/index.d.ts +0 -1
  410. package/dist/cjs/api/resources/customerAccess/client/index.js +0 -2
  411. package/dist/cjs/api/resources/customerAccess/index.d.ts +0 -1
  412. package/dist/cjs/api/resources/customerAccess/index.js +0 -17
  413. package/dist/cjs/api/resources/customerPortal/client/Client.d.ts +0 -48
  414. package/dist/cjs/api/resources/customerPortal/client/Client.js +0 -130
  415. package/dist/cjs/api/resources/customerPortal/client/index.d.ts +0 -2
  416. package/dist/cjs/api/resources/customerPortal/client/index.js +0 -17
  417. package/dist/cjs/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.d.ts +0 -13
  418. package/dist/cjs/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.js +0 -5
  419. package/dist/cjs/api/resources/customerPortal/client/requests/index.d.ts +0 -1
  420. package/dist/cjs/api/resources/customerPortal/client/requests/index.js +0 -2
  421. package/dist/cjs/api/resources/customerPortal/index.d.ts +0 -1
  422. package/dist/cjs/api/resources/customerPortal/index.js +0 -17
  423. package/dist/cjs/api/resources/index.d.ts +0 -19
  424. package/dist/cjs/api/resources/index.js +0 -58
  425. package/dist/cjs/api/resources/invoices/client/Client.d.ts +0 -50
  426. package/dist/cjs/api/resources/invoices/client/Client.js +0 -135
  427. package/dist/cjs/api/resources/invoices/client/index.d.ts +0 -2
  428. package/dist/cjs/api/resources/invoices/client/index.js +0 -17
  429. package/dist/cjs/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.d.ts +0 -17
  430. package/dist/cjs/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.js +0 -5
  431. package/dist/cjs/api/resources/invoices/client/requests/index.d.ts +0 -1
  432. package/dist/cjs/api/resources/invoices/client/requests/index.js +0 -2
  433. package/dist/cjs/api/resources/invoices/index.d.ts +0 -1
  434. package/dist/cjs/api/resources/invoices/index.js +0 -17
  435. package/dist/cjs/api/resources/pricingMetrics/client/Client.d.ts +0 -96
  436. package/dist/cjs/api/resources/pricingMetrics/client/Client.js +0 -321
  437. package/dist/cjs/api/resources/pricingMetrics/client/index.d.ts +0 -2
  438. package/dist/cjs/api/resources/pricingMetrics/client/index.js +0 -17
  439. package/dist/cjs/api/resources/pricingMetrics/client/requests/CreatePricingMetricRequest.d.ts +0 -26
  440. package/dist/cjs/api/resources/pricingMetrics/client/requests/CreatePricingMetricRequest.js +0 -5
  441. package/dist/cjs/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.d.ts +0 -20
  442. package/dist/cjs/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.js +0 -5
  443. package/dist/cjs/api/resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.d.ts +0 -12
  444. package/dist/cjs/api/resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.js +0 -5
  445. package/dist/cjs/api/resources/pricingMetrics/client/requests/index.d.ts +0 -3
  446. package/dist/cjs/api/resources/pricingMetrics/client/requests/index.js +0 -2
  447. package/dist/cjs/api/resources/pricingMetrics/index.d.ts +0 -2
  448. package/dist/cjs/api/resources/pricingMetrics/index.js +0 -18
  449. package/dist/cjs/api/resources/pricingMetrics/types/PricingMetricAggregation.d.ts +0 -25
  450. package/dist/cjs/api/resources/pricingMetrics/types/PricingMetricAggregation.js +0 -5
  451. package/dist/cjs/api/resources/pricingMetrics/types/index.d.ts +0 -1
  452. package/dist/cjs/api/resources/pricingMetrics/types/index.js +0 -17
  453. package/dist/cjs/api/resources/rateCards/client/Client.d.ts +0 -99
  454. package/dist/cjs/api/resources/rateCards/client/Client.js +0 -275
  455. package/dist/cjs/api/resources/rateCards/client/index.d.ts +0 -2
  456. package/dist/cjs/api/resources/rateCards/client/index.js +0 -17
  457. package/dist/cjs/api/resources/rateCards/client/requests/CreateRateCardRequest.d.ts +0 -60
  458. package/dist/cjs/api/resources/rateCards/client/requests/CreateRateCardRequest.js +0 -13
  459. package/dist/cjs/api/resources/rateCards/client/requests/ListRateCardsRateCardsGetRequest.d.ts +0 -12
  460. package/dist/cjs/api/resources/rateCards/client/requests/ListRateCardsRateCardsGetRequest.js +0 -5
  461. package/dist/cjs/api/resources/rateCards/client/requests/index.d.ts +0 -2
  462. package/dist/cjs/api/resources/rateCards/client/requests/index.js +0 -2
  463. package/dist/cjs/api/resources/rateCards/index.d.ts +0 -2
  464. package/dist/cjs/api/resources/rateCards/index.js +0 -18
  465. package/dist/cjs/api/resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.d.ts +0 -10
  466. package/dist/cjs/api/resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.js +0 -5
  467. package/dist/cjs/api/resources/rateCards/types/index.d.ts +0 -1
  468. package/dist/cjs/api/resources/rateCards/types/index.js +0 -17
  469. package/dist/cjs/api/resources/subjects/client/Client.d.ts +0 -101
  470. package/dist/cjs/api/resources/subjects/client/Client.js +0 -375
  471. package/dist/cjs/api/resources/subjects/client/index.d.ts +0 -2
  472. package/dist/cjs/api/resources/subjects/client/index.js +0 -17
  473. package/dist/cjs/api/resources/subjects/client/requests/CreateSubjectRequest.d.ts +0 -24
  474. package/dist/cjs/api/resources/subjects/client/requests/CreateSubjectRequest.js +0 -5
  475. package/dist/cjs/api/resources/subjects/client/requests/ListSubjectsSubjectsGetRequest.d.ts +0 -14
  476. package/dist/cjs/api/resources/subjects/client/requests/ListSubjectsSubjectsGetRequest.js +0 -5
  477. package/dist/cjs/api/resources/subjects/client/requests/UpdateSubjectRequest.d.ts +0 -15
  478. package/dist/cjs/api/resources/subjects/client/requests/UpdateSubjectRequest.js +0 -5
  479. package/dist/cjs/api/resources/subjects/client/requests/index.d.ts +0 -3
  480. package/dist/cjs/api/resources/subjects/client/requests/index.js +0 -2
  481. package/dist/cjs/api/resources/subjects/index.d.ts +0 -1
  482. package/dist/cjs/api/resources/subjects/index.js +0 -17
  483. package/dist/cjs/api/resources/subscriptions/client/Client.d.ts +0 -105
  484. package/dist/cjs/api/resources/subscriptions/client/Client.js +0 -388
  485. package/dist/cjs/api/resources/subscriptions/client/index.d.ts +0 -2
  486. package/dist/cjs/api/resources/subscriptions/client/index.js +0 -17
  487. package/dist/cjs/api/resources/subscriptions/client/requests/CancelSubscriptionRequest.d.ts +0 -13
  488. package/dist/cjs/api/resources/subscriptions/client/requests/CancelSubscriptionRequest.js +0 -5
  489. package/dist/cjs/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.ts +0 -32
  490. package/dist/cjs/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.js +0 -13
  491. package/dist/cjs/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.ts +0 -18
  492. package/dist/cjs/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.js +0 -5
  493. package/dist/cjs/api/resources/subscriptions/client/requests/ListSubscriptionsSubscriptionsGetRequest.d.ts +0 -18
  494. package/dist/cjs/api/resources/subscriptions/client/requests/ListSubscriptionsSubscriptionsGetRequest.js +0 -5
  495. package/dist/cjs/api/resources/subscriptions/client/requests/index.d.ts +0 -4
  496. package/dist/cjs/api/resources/subscriptions/client/requests/index.js +0 -2
  497. package/dist/cjs/api/resources/subscriptions/index.d.ts +0 -1
  498. package/dist/cjs/api/resources/subscriptions/index.js +0 -17
  499. package/dist/cjs/api/resources/usageEvents/client/Client.d.ts +0 -56
  500. package/dist/cjs/api/resources/usageEvents/client/Client.js +0 -135
  501. package/dist/cjs/api/resources/usageEvents/client/index.d.ts +0 -2
  502. package/dist/cjs/api/resources/usageEvents/client/index.js +0 -17
  503. package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.ts +0 -34
  504. package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventRequest.js +0 -5
  505. package/dist/cjs/api/resources/usageEvents/client/requests/index.d.ts +0 -1
  506. package/dist/cjs/api/resources/usageEvents/client/requests/index.js +0 -2
  507. package/dist/cjs/api/resources/usageEvents/index.d.ts +0 -1
  508. package/dist/cjs/api/resources/usageEvents/index.js +0 -17
  509. package/dist/cjs/api/types/ActiveSubscription.d.ts +0 -7
  510. package/dist/cjs/api/types/ActiveSubscription.js +0 -5
  511. package/dist/cjs/api/types/Aggregation.d.ts +0 -22
  512. package/dist/cjs/api/types/Aggregation.js +0 -5
  513. package/dist/cjs/api/types/Amount.d.ts +0 -9
  514. package/dist/cjs/api/types/Amount.js +0 -5
  515. package/dist/cjs/api/types/BillingStateResponse.d.ts +0 -14
  516. package/dist/cjs/api/types/BillingStateResponse.js +0 -5
  517. package/dist/cjs/api/types/ChangeSubscriptionRateCardResponse.d.ts +0 -7
  518. package/dist/cjs/api/types/ChangeSubscriptionRateCardResponse.js +0 -5
  519. package/dist/cjs/api/types/CheckoutAction.d.ts +0 -7
  520. package/dist/cjs/api/types/CheckoutAction.js +0 -5
  521. package/dist/cjs/api/types/CheckoutCallback.d.ts +0 -9
  522. package/dist/cjs/api/types/CheckoutCallback.js +0 -5
  523. package/dist/cjs/api/types/CountAggregationPricingMetricInterface.d.ts +0 -8
  524. package/dist/cjs/api/types/CountAggregationPricingMetricInterface.js +0 -5
  525. package/dist/cjs/api/types/CountAggregationPricingMetricResource.d.ts +0 -5
  526. package/dist/cjs/api/types/CountAggregationPricingMetricResource.js +0 -5
  527. package/dist/cjs/api/types/CreateCustomerPortalSessionResponse.d.ts +0 -11
  528. package/dist/cjs/api/types/CreateCustomerPortalSessionResponse.js +0 -5
  529. package/dist/cjs/api/types/CreateFixedRateRequest.d.ts +0 -11
  530. package/dist/cjs/api/types/CreateFixedRateRequest.js +0 -5
  531. package/dist/cjs/api/types/CreateSimpleUsageBasedRateRequest.d.ts +0 -15
  532. package/dist/cjs/api/types/CreateSimpleUsageBasedRateRequest.js +0 -5
  533. package/dist/cjs/api/types/CreateSubjectResponse.d.ts +0 -17
  534. package/dist/cjs/api/types/CreateSubjectResponse.js +0 -5
  535. package/dist/cjs/api/types/CreateSubscriptionCheckoutSessionResponse.d.ts +0 -12
  536. package/dist/cjs/api/types/CreateSubscriptionCheckoutSessionResponse.js +0 -5
  537. package/dist/cjs/api/types/CustomAggregationPricingMetricInterface.d.ts +0 -10
  538. package/dist/cjs/api/types/CustomAggregationPricingMetricInterface.js +0 -5
  539. package/dist/cjs/api/types/FixedRateInterface.d.ts +0 -10
  540. package/dist/cjs/api/types/FixedRateInterface.js +0 -5
  541. package/dist/cjs/api/types/FlatPrice.d.ts +0 -10
  542. package/dist/cjs/api/types/FlatPrice.js +0 -5
  543. package/dist/cjs/api/types/HttpValidationError.d.ts +0 -7
  544. package/dist/cjs/api/types/HttpValidationError.js +0 -5
  545. package/dist/cjs/api/types/InvoiceLineItemResource.d.ts +0 -10
  546. package/dist/cjs/api/types/InvoiceLineItemResource.js +0 -5
  547. package/dist/cjs/api/types/InvoiceResource.d.ts +0 -33
  548. package/dist/cjs/api/types/InvoiceResource.js +0 -16
  549. package/dist/cjs/api/types/LastAggregationPricingMetricInterface.d.ts +0 -10
  550. package/dist/cjs/api/types/LastAggregationPricingMetricInterface.js +0 -5
  551. package/dist/cjs/api/types/LastAggregationPricingMetricResource.d.ts +0 -7
  552. package/dist/cjs/api/types/LastAggregationPricingMetricResource.js +0 -5
  553. package/dist/cjs/api/types/ListInvoicesResponse.d.ts +0 -8
  554. package/dist/cjs/api/types/ListInvoicesResponse.js +0 -5
  555. package/dist/cjs/api/types/ListPricingMetricsResponse.d.ts +0 -8
  556. package/dist/cjs/api/types/ListPricingMetricsResponse.js +0 -5
  557. package/dist/cjs/api/types/ListRateCardsResponse.d.ts +0 -8
  558. package/dist/cjs/api/types/ListRateCardsResponse.js +0 -5
  559. package/dist/cjs/api/types/ListSubjectsResponse.d.ts +0 -8
  560. package/dist/cjs/api/types/ListSubjectsResponse.js +0 -5
  561. package/dist/cjs/api/types/ListSubscriptionsResponse.d.ts +0 -8
  562. package/dist/cjs/api/types/ListSubscriptionsResponse.js +0 -5
  563. package/dist/cjs/api/types/MaxAggregationPricingMetricInterface.d.ts +0 -10
  564. package/dist/cjs/api/types/MaxAggregationPricingMetricInterface.js +0 -5
  565. package/dist/cjs/api/types/MaxAggregationPricingMetricResource.d.ts +0 -7
  566. package/dist/cjs/api/types/MaxAggregationPricingMetricResource.js +0 -5
  567. package/dist/cjs/api/types/PackagePrice.d.ts +0 -19
  568. package/dist/cjs/api/types/PackagePrice.js +0 -13
  569. package/dist/cjs/api/types/Period.d.ts +0 -9
  570. package/dist/cjs/api/types/Period.js +0 -5
  571. package/dist/cjs/api/types/PeriodResource.d.ts +0 -9
  572. package/dist/cjs/api/types/PeriodResource.js +0 -5
  573. package/dist/cjs/api/types/Price.d.ts +0 -13
  574. package/dist/cjs/api/types/Price.js +0 -5
  575. package/dist/cjs/api/types/PricingMetricResource.d.ts +0 -16
  576. package/dist/cjs/api/types/PricingMetricResource.js +0 -5
  577. package/dist/cjs/api/types/PricingMetricSummaryResource.d.ts +0 -16
  578. package/dist/cjs/api/types/PricingMetricSummaryResource.js +0 -5
  579. package/dist/cjs/api/types/RateCardResource.d.ts +0 -29
  580. package/dist/cjs/api/types/RateCardResource.js +0 -13
  581. package/dist/cjs/api/types/RateCardResourceUsageBasedRatesItem.d.ts +0 -10
  582. package/dist/cjs/api/types/RateCardResourceUsageBasedRatesItem.js +0 -5
  583. package/dist/cjs/api/types/RequiresActionResponse.d.ts +0 -7
  584. package/dist/cjs/api/types/RequiresActionResponse.js +0 -5
  585. package/dist/cjs/api/types/Result.d.ts +0 -13
  586. package/dist/cjs/api/types/Result.js +0 -5
  587. package/dist/cjs/api/types/SimpleUsageBasedRateInterface.d.ts +0 -12
  588. package/dist/cjs/api/types/SimpleUsageBasedRateInterface.js +0 -5
  589. package/dist/cjs/api/types/SubjectResource.d.ts +0 -17
  590. package/dist/cjs/api/types/SubjectResource.js +0 -5
  591. package/dist/cjs/api/types/SubscriptionResource.d.ts +0 -34
  592. package/dist/cjs/api/types/SubscriptionResource.js +0 -14
  593. package/dist/cjs/api/types/SuccessResponse.d.ts +0 -7
  594. package/dist/cjs/api/types/SuccessResponse.js +0 -5
  595. package/dist/cjs/api/types/SumAggregationPricingMetricInterface.d.ts +0 -10
  596. package/dist/cjs/api/types/SumAggregationPricingMetricInterface.js +0 -5
  597. package/dist/cjs/api/types/SumAggregationPricingMetricResource.d.ts +0 -7
  598. package/dist/cjs/api/types/SumAggregationPricingMetricResource.js +0 -5
  599. package/dist/cjs/api/types/UsageDataForRate.d.ts +0 -9
  600. package/dist/cjs/api/types/UsageDataForRate.js +0 -5
  601. package/dist/cjs/api/types/ValidationError.d.ts +0 -14
  602. package/dist/cjs/api/types/ValidationError.js +0 -5
  603. package/dist/cjs/api/types/index.d.ts +0 -47
  604. package/dist/cjs/api/types/index.js +0 -63
  605. package/dist/cjs/core/fetcher/APIResponse.d.ts +0 -20
  606. package/dist/cjs/core/fetcher/APIResponse.js +0 -2
  607. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +0 -20
  608. package/dist/cjs/core/fetcher/BinaryResponse.js +0 -17
  609. package/dist/cjs/core/fetcher/Fetcher.d.ts +0 -40
  610. package/dist/cjs/core/fetcher/Fetcher.js +0 -120
  611. package/dist/cjs/core/fetcher/Headers.d.ts +0 -2
  612. package/dist/cjs/core/fetcher/Headers.js +0 -84
  613. package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +0 -58
  614. package/dist/cjs/core/fetcher/HttpResponsePromise.js +0 -103
  615. package/dist/cjs/core/fetcher/RawResponse.d.ts +0 -29
  616. package/dist/cjs/core/fetcher/RawResponse.js +0 -44
  617. package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
  618. package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
  619. package/dist/cjs/core/fetcher/Supplier.d.ts +0 -4
  620. package/dist/cjs/core/fetcher/Supplier.js +0 -22
  621. package/dist/cjs/core/fetcher/createRequestUrl.d.ts +0 -1
  622. package/dist/cjs/core/fetcher/createRequestUrl.js +0 -8
  623. package/dist/cjs/core/fetcher/getErrorResponseBody.d.ts +0 -1
  624. package/dist/cjs/core/fetcher/getErrorResponseBody.js +0 -44
  625. package/dist/cjs/core/fetcher/getFetchFn.d.ts +0 -1
  626. package/dist/cjs/core/fetcher/getFetchFn.js +0 -17
  627. package/dist/cjs/core/fetcher/getHeader.d.ts +0 -1
  628. package/dist/cjs/core/fetcher/getHeader.js +0 -11
  629. package/dist/cjs/core/fetcher/getRequestBody.d.ts +0 -7
  630. package/dist/cjs/core/fetcher/getRequestBody.js +0 -23
  631. package/dist/cjs/core/fetcher/getResponseBody.d.ts +0 -1
  632. package/dist/cjs/core/fetcher/getResponseBody.js +0 -55
  633. package/dist/cjs/core/fetcher/index.d.ts +0 -9
  634. package/dist/cjs/core/fetcher/index.js +0 -15
  635. package/dist/cjs/core/fetcher/makeRequest.d.ts +0 -1
  636. package/dist/cjs/core/fetcher/makeRequest.js +0 -42
  637. package/dist/cjs/core/fetcher/requestWithRetries.d.ts +0 -1
  638. package/dist/cjs/core/fetcher/requestWithRetries.js +0 -76
  639. package/dist/cjs/core/fetcher/signals.d.ts +0 -11
  640. package/dist/cjs/core/fetcher/signals.js +0 -36
  641. package/dist/cjs/core/headers.d.ts +0 -3
  642. package/dist/cjs/core/headers.js +0 -29
  643. package/dist/cjs/core/index.d.ts +0 -3
  644. package/dist/cjs/core/index.js +0 -42
  645. package/dist/cjs/core/json.d.ts +0 -15
  646. package/dist/cjs/core/json.js +0 -24
  647. package/dist/cjs/core/runtime/index.d.ts +0 -1
  648. package/dist/cjs/core/runtime/index.js +0 -5
  649. package/dist/cjs/core/runtime/runtime.d.ts +0 -9
  650. package/dist/cjs/core/runtime/runtime.js +0 -102
  651. package/dist/cjs/core/url/index.d.ts +0 -2
  652. package/dist/cjs/core/url/index.js +0 -7
  653. package/dist/cjs/core/url/join.d.ts +0 -1
  654. package/dist/cjs/core/url/join.js +0 -69
  655. package/dist/cjs/core/url/qs.d.ts +0 -6
  656. package/dist/cjs/core/url/qs.js +0 -64
  657. package/dist/cjs/environments.d.ts +0 -7
  658. package/dist/cjs/environments.js +0 -9
  659. package/dist/cjs/errors/LarkError.d.ts +0 -15
  660. package/dist/cjs/errors/LarkError.js +0 -30
  661. package/dist/cjs/errors/LarkTimeoutError.d.ts +0 -6
  662. package/dist/cjs/errors/LarkTimeoutError.js +0 -13
  663. package/dist/cjs/errors/index.d.ts +0 -2
  664. package/dist/cjs/errors/index.js +0 -7
  665. package/dist/cjs/index.d.ts +0 -4
  666. package/dist/cjs/index.js +0 -44
  667. package/dist/cjs/version.d.ts +0 -1
  668. package/dist/cjs/version.js +0 -4
  669. package/dist/esm/Client.d.mts +0 -58
  670. package/dist/esm/Client.mjs +0 -62
  671. package/dist/esm/api/errors/UnprocessableEntityError.d.mts +0 -9
  672. package/dist/esm/api/errors/UnprocessableEntityError.mjs +0 -15
  673. package/dist/esm/api/errors/index.d.mts +0 -1
  674. package/dist/esm/api/errors/index.mjs +0 -1
  675. package/dist/esm/api/index.d.mts +0 -3
  676. package/dist/esm/api/index.mjs +0 -3
  677. package/dist/esm/api/resources/checkout/client/Client.d.mts +0 -53
  678. package/dist/esm/api/resources/checkout/client/Client.mjs +0 -98
  679. package/dist/esm/api/resources/checkout/client/index.d.mts +0 -2
  680. package/dist/esm/api/resources/checkout/client/index.mjs +0 -1
  681. package/dist/esm/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.mts +0 -23
  682. package/dist/esm/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.mjs +0 -4
  683. package/dist/esm/api/resources/checkout/client/requests/index.d.mts +0 -1
  684. package/dist/esm/api/resources/checkout/client/requests/index.mjs +0 -1
  685. package/dist/esm/api/resources/checkout/index.d.mts +0 -1
  686. package/dist/esm/api/resources/checkout/index.mjs +0 -1
  687. package/dist/esm/api/resources/customerAccess/client/Client.d.mts +0 -46
  688. package/dist/esm/api/resources/customerAccess/client/Client.mjs +0 -85
  689. package/dist/esm/api/resources/customerAccess/client/index.d.mts +0 -1
  690. package/dist/esm/api/resources/customerAccess/client/index.mjs +0 -1
  691. package/dist/esm/api/resources/customerAccess/index.d.mts +0 -1
  692. package/dist/esm/api/resources/customerAccess/index.mjs +0 -1
  693. package/dist/esm/api/resources/customerPortal/client/Client.d.mts +0 -48
  694. package/dist/esm/api/resources/customerPortal/client/Client.mjs +0 -93
  695. package/dist/esm/api/resources/customerPortal/client/index.d.mts +0 -2
  696. package/dist/esm/api/resources/customerPortal/client/index.mjs +0 -1
  697. package/dist/esm/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.d.mts +0 -13
  698. package/dist/esm/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.mjs +0 -4
  699. package/dist/esm/api/resources/customerPortal/client/requests/index.d.mts +0 -1
  700. package/dist/esm/api/resources/customerPortal/client/requests/index.mjs +0 -1
  701. package/dist/esm/api/resources/customerPortal/index.d.mts +0 -1
  702. package/dist/esm/api/resources/customerPortal/index.mjs +0 -1
  703. package/dist/esm/api/resources/index.d.mts +0 -19
  704. package/dist/esm/api/resources/index.mjs +0 -19
  705. package/dist/esm/api/resources/invoices/client/Client.d.mts +0 -50
  706. package/dist/esm/api/resources/invoices/client/Client.mjs +0 -98
  707. package/dist/esm/api/resources/invoices/client/index.d.mts +0 -2
  708. package/dist/esm/api/resources/invoices/client/index.mjs +0 -1
  709. package/dist/esm/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.d.mts +0 -17
  710. package/dist/esm/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.mjs +0 -4
  711. package/dist/esm/api/resources/invoices/client/requests/index.d.mts +0 -1
  712. package/dist/esm/api/resources/invoices/client/requests/index.mjs +0 -1
  713. package/dist/esm/api/resources/invoices/index.d.mts +0 -1
  714. package/dist/esm/api/resources/invoices/index.mjs +0 -1
  715. package/dist/esm/api/resources/pricingMetrics/client/Client.d.mts +0 -96
  716. package/dist/esm/api/resources/pricingMetrics/client/Client.mjs +0 -284
  717. package/dist/esm/api/resources/pricingMetrics/client/index.d.mts +0 -2
  718. package/dist/esm/api/resources/pricingMetrics/client/index.mjs +0 -1
  719. package/dist/esm/api/resources/pricingMetrics/client/requests/CreatePricingMetricRequest.d.mts +0 -26
  720. package/dist/esm/api/resources/pricingMetrics/client/requests/CreatePricingMetricRequest.mjs +0 -4
  721. package/dist/esm/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.d.mts +0 -20
  722. package/dist/esm/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.mjs +0 -4
  723. package/dist/esm/api/resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.d.mts +0 -12
  724. package/dist/esm/api/resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.mjs +0 -4
  725. package/dist/esm/api/resources/pricingMetrics/client/requests/index.d.mts +0 -3
  726. package/dist/esm/api/resources/pricingMetrics/client/requests/index.mjs +0 -1
  727. package/dist/esm/api/resources/pricingMetrics/index.d.mts +0 -2
  728. package/dist/esm/api/resources/pricingMetrics/index.mjs +0 -2
  729. package/dist/esm/api/resources/pricingMetrics/types/PricingMetricAggregation.d.mts +0 -25
  730. package/dist/esm/api/resources/pricingMetrics/types/PricingMetricAggregation.mjs +0 -4
  731. package/dist/esm/api/resources/pricingMetrics/types/index.d.mts +0 -1
  732. package/dist/esm/api/resources/pricingMetrics/types/index.mjs +0 -1
  733. package/dist/esm/api/resources/rateCards/client/Client.d.mts +0 -99
  734. package/dist/esm/api/resources/rateCards/client/Client.mjs +0 -238
  735. package/dist/esm/api/resources/rateCards/client/index.d.mts +0 -2
  736. package/dist/esm/api/resources/rateCards/client/index.mjs +0 -1
  737. package/dist/esm/api/resources/rateCards/client/requests/CreateRateCardRequest.d.mts +0 -60
  738. package/dist/esm/api/resources/rateCards/client/requests/CreateRateCardRequest.mjs +0 -10
  739. package/dist/esm/api/resources/rateCards/client/requests/ListRateCardsRateCardsGetRequest.d.mts +0 -12
  740. package/dist/esm/api/resources/rateCards/client/requests/ListRateCardsRateCardsGetRequest.mjs +0 -4
  741. package/dist/esm/api/resources/rateCards/client/requests/index.d.mts +0 -2
  742. package/dist/esm/api/resources/rateCards/client/requests/index.mjs +0 -1
  743. package/dist/esm/api/resources/rateCards/index.d.mts +0 -2
  744. package/dist/esm/api/resources/rateCards/index.mjs +0 -2
  745. package/dist/esm/api/resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.d.mts +0 -10
  746. package/dist/esm/api/resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.mjs +0 -4
  747. package/dist/esm/api/resources/rateCards/types/index.d.mts +0 -1
  748. package/dist/esm/api/resources/rateCards/types/index.mjs +0 -1
  749. package/dist/esm/api/resources/subjects/client/Client.d.mts +0 -101
  750. package/dist/esm/api/resources/subjects/client/Client.mjs +0 -338
  751. package/dist/esm/api/resources/subjects/client/index.d.mts +0 -2
  752. package/dist/esm/api/resources/subjects/client/index.mjs +0 -1
  753. package/dist/esm/api/resources/subjects/client/requests/CreateSubjectRequest.d.mts +0 -24
  754. package/dist/esm/api/resources/subjects/client/requests/CreateSubjectRequest.mjs +0 -4
  755. package/dist/esm/api/resources/subjects/client/requests/ListSubjectsSubjectsGetRequest.d.mts +0 -14
  756. package/dist/esm/api/resources/subjects/client/requests/ListSubjectsSubjectsGetRequest.mjs +0 -4
  757. package/dist/esm/api/resources/subjects/client/requests/UpdateSubjectRequest.d.mts +0 -15
  758. package/dist/esm/api/resources/subjects/client/requests/UpdateSubjectRequest.mjs +0 -4
  759. package/dist/esm/api/resources/subjects/client/requests/index.d.mts +0 -3
  760. package/dist/esm/api/resources/subjects/client/requests/index.mjs +0 -1
  761. package/dist/esm/api/resources/subjects/index.d.mts +0 -1
  762. package/dist/esm/api/resources/subjects/index.mjs +0 -1
  763. package/dist/esm/api/resources/subscriptions/client/Client.d.mts +0 -105
  764. package/dist/esm/api/resources/subscriptions/client/Client.mjs +0 -351
  765. package/dist/esm/api/resources/subscriptions/client/index.d.mts +0 -2
  766. package/dist/esm/api/resources/subscriptions/client/index.mjs +0 -1
  767. package/dist/esm/api/resources/subscriptions/client/requests/CancelSubscriptionRequest.d.mts +0 -13
  768. package/dist/esm/api/resources/subscriptions/client/requests/CancelSubscriptionRequest.mjs +0 -4
  769. package/dist/esm/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.mts +0 -32
  770. package/dist/esm/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.mjs +0 -10
  771. package/dist/esm/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.mts +0 -18
  772. package/dist/esm/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.mjs +0 -4
  773. package/dist/esm/api/resources/subscriptions/client/requests/ListSubscriptionsSubscriptionsGetRequest.d.mts +0 -18
  774. package/dist/esm/api/resources/subscriptions/client/requests/ListSubscriptionsSubscriptionsGetRequest.mjs +0 -4
  775. package/dist/esm/api/resources/subscriptions/client/requests/index.d.mts +0 -4
  776. package/dist/esm/api/resources/subscriptions/client/requests/index.mjs +0 -1
  777. package/dist/esm/api/resources/subscriptions/index.d.mts +0 -1
  778. package/dist/esm/api/resources/subscriptions/index.mjs +0 -1
  779. package/dist/esm/api/resources/usageEvents/client/Client.d.mts +0 -56
  780. package/dist/esm/api/resources/usageEvents/client/Client.mjs +0 -98
  781. package/dist/esm/api/resources/usageEvents/client/index.d.mts +0 -2
  782. package/dist/esm/api/resources/usageEvents/client/index.mjs +0 -1
  783. package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.mts +0 -34
  784. package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventRequest.mjs +0 -4
  785. package/dist/esm/api/resources/usageEvents/client/requests/index.d.mts +0 -1
  786. package/dist/esm/api/resources/usageEvents/client/requests/index.mjs +0 -1
  787. package/dist/esm/api/resources/usageEvents/index.d.mts +0 -1
  788. package/dist/esm/api/resources/usageEvents/index.mjs +0 -1
  789. package/dist/esm/api/types/ActiveSubscription.d.mts +0 -7
  790. package/dist/esm/api/types/ActiveSubscription.mjs +0 -4
  791. package/dist/esm/api/types/Aggregation.d.mts +0 -22
  792. package/dist/esm/api/types/Aggregation.mjs +0 -4
  793. package/dist/esm/api/types/Amount.d.mts +0 -9
  794. package/dist/esm/api/types/Amount.mjs +0 -4
  795. package/dist/esm/api/types/BillingStateResponse.d.mts +0 -14
  796. package/dist/esm/api/types/BillingStateResponse.mjs +0 -4
  797. package/dist/esm/api/types/ChangeSubscriptionRateCardResponse.d.mts +0 -7
  798. package/dist/esm/api/types/ChangeSubscriptionRateCardResponse.mjs +0 -4
  799. package/dist/esm/api/types/CheckoutAction.d.mts +0 -7
  800. package/dist/esm/api/types/CheckoutAction.mjs +0 -4
  801. package/dist/esm/api/types/CheckoutCallback.d.mts +0 -9
  802. package/dist/esm/api/types/CheckoutCallback.mjs +0 -4
  803. package/dist/esm/api/types/CountAggregationPricingMetricInterface.d.mts +0 -8
  804. package/dist/esm/api/types/CountAggregationPricingMetricInterface.mjs +0 -4
  805. package/dist/esm/api/types/CountAggregationPricingMetricResource.d.mts +0 -5
  806. package/dist/esm/api/types/CountAggregationPricingMetricResource.mjs +0 -4
  807. package/dist/esm/api/types/CreateCustomerPortalSessionResponse.d.mts +0 -11
  808. package/dist/esm/api/types/CreateCustomerPortalSessionResponse.mjs +0 -4
  809. package/dist/esm/api/types/CreateFixedRateRequest.d.mts +0 -11
  810. package/dist/esm/api/types/CreateFixedRateRequest.mjs +0 -4
  811. package/dist/esm/api/types/CreateSimpleUsageBasedRateRequest.d.mts +0 -15
  812. package/dist/esm/api/types/CreateSimpleUsageBasedRateRequest.mjs +0 -4
  813. package/dist/esm/api/types/CreateSubjectResponse.d.mts +0 -17
  814. package/dist/esm/api/types/CreateSubjectResponse.mjs +0 -4
  815. package/dist/esm/api/types/CreateSubscriptionCheckoutSessionResponse.d.mts +0 -12
  816. package/dist/esm/api/types/CreateSubscriptionCheckoutSessionResponse.mjs +0 -4
  817. package/dist/esm/api/types/CustomAggregationPricingMetricInterface.d.mts +0 -10
  818. package/dist/esm/api/types/CustomAggregationPricingMetricInterface.mjs +0 -4
  819. package/dist/esm/api/types/FixedRateInterface.d.mts +0 -10
  820. package/dist/esm/api/types/FixedRateInterface.mjs +0 -4
  821. package/dist/esm/api/types/FlatPrice.d.mts +0 -10
  822. package/dist/esm/api/types/FlatPrice.mjs +0 -4
  823. package/dist/esm/api/types/HttpValidationError.d.mts +0 -7
  824. package/dist/esm/api/types/HttpValidationError.mjs +0 -4
  825. package/dist/esm/api/types/InvoiceLineItemResource.d.mts +0 -10
  826. package/dist/esm/api/types/InvoiceLineItemResource.mjs +0 -4
  827. package/dist/esm/api/types/InvoiceResource.d.mts +0 -33
  828. package/dist/esm/api/types/InvoiceResource.mjs +0 -13
  829. package/dist/esm/api/types/LastAggregationPricingMetricInterface.d.mts +0 -10
  830. package/dist/esm/api/types/LastAggregationPricingMetricInterface.mjs +0 -4
  831. package/dist/esm/api/types/LastAggregationPricingMetricResource.d.mts +0 -7
  832. package/dist/esm/api/types/LastAggregationPricingMetricResource.mjs +0 -4
  833. package/dist/esm/api/types/ListInvoicesResponse.d.mts +0 -8
  834. package/dist/esm/api/types/ListInvoicesResponse.mjs +0 -4
  835. package/dist/esm/api/types/ListPricingMetricsResponse.d.mts +0 -8
  836. package/dist/esm/api/types/ListPricingMetricsResponse.mjs +0 -4
  837. package/dist/esm/api/types/ListRateCardsResponse.d.mts +0 -8
  838. package/dist/esm/api/types/ListRateCardsResponse.mjs +0 -4
  839. package/dist/esm/api/types/ListSubjectsResponse.d.mts +0 -8
  840. package/dist/esm/api/types/ListSubjectsResponse.mjs +0 -4
  841. package/dist/esm/api/types/ListSubscriptionsResponse.d.mts +0 -8
  842. package/dist/esm/api/types/ListSubscriptionsResponse.mjs +0 -4
  843. package/dist/esm/api/types/MaxAggregationPricingMetricInterface.d.mts +0 -10
  844. package/dist/esm/api/types/MaxAggregationPricingMetricInterface.mjs +0 -4
  845. package/dist/esm/api/types/MaxAggregationPricingMetricResource.d.mts +0 -7
  846. package/dist/esm/api/types/MaxAggregationPricingMetricResource.mjs +0 -4
  847. package/dist/esm/api/types/PackagePrice.d.mts +0 -19
  848. package/dist/esm/api/types/PackagePrice.mjs +0 -10
  849. package/dist/esm/api/types/Period.d.mts +0 -9
  850. package/dist/esm/api/types/Period.mjs +0 -4
  851. package/dist/esm/api/types/PeriodResource.d.mts +0 -9
  852. package/dist/esm/api/types/PeriodResource.mjs +0 -4
  853. package/dist/esm/api/types/Price.d.mts +0 -13
  854. package/dist/esm/api/types/Price.mjs +0 -4
  855. package/dist/esm/api/types/PricingMetricResource.d.mts +0 -16
  856. package/dist/esm/api/types/PricingMetricResource.mjs +0 -4
  857. package/dist/esm/api/types/PricingMetricSummaryResource.d.mts +0 -16
  858. package/dist/esm/api/types/PricingMetricSummaryResource.mjs +0 -4
  859. package/dist/esm/api/types/RateCardResource.d.mts +0 -29
  860. package/dist/esm/api/types/RateCardResource.mjs +0 -10
  861. package/dist/esm/api/types/RateCardResourceUsageBasedRatesItem.d.mts +0 -10
  862. package/dist/esm/api/types/RateCardResourceUsageBasedRatesItem.mjs +0 -4
  863. package/dist/esm/api/types/RequiresActionResponse.d.mts +0 -7
  864. package/dist/esm/api/types/RequiresActionResponse.mjs +0 -4
  865. package/dist/esm/api/types/Result.d.mts +0 -13
  866. package/dist/esm/api/types/Result.mjs +0 -4
  867. package/dist/esm/api/types/SimpleUsageBasedRateInterface.d.mts +0 -12
  868. package/dist/esm/api/types/SimpleUsageBasedRateInterface.mjs +0 -4
  869. package/dist/esm/api/types/SubjectResource.d.mts +0 -17
  870. package/dist/esm/api/types/SubjectResource.mjs +0 -4
  871. package/dist/esm/api/types/SubscriptionResource.d.mts +0 -34
  872. package/dist/esm/api/types/SubscriptionResource.mjs +0 -11
  873. package/dist/esm/api/types/SuccessResponse.d.mts +0 -7
  874. package/dist/esm/api/types/SuccessResponse.mjs +0 -4
  875. package/dist/esm/api/types/SumAggregationPricingMetricInterface.d.mts +0 -10
  876. package/dist/esm/api/types/SumAggregationPricingMetricInterface.mjs +0 -4
  877. package/dist/esm/api/types/SumAggregationPricingMetricResource.d.mts +0 -7
  878. package/dist/esm/api/types/SumAggregationPricingMetricResource.mjs +0 -4
  879. package/dist/esm/api/types/UsageDataForRate.d.mts +0 -9
  880. package/dist/esm/api/types/UsageDataForRate.mjs +0 -4
  881. package/dist/esm/api/types/ValidationError.d.mts +0 -14
  882. package/dist/esm/api/types/ValidationError.mjs +0 -4
  883. package/dist/esm/api/types/index.d.mts +0 -47
  884. package/dist/esm/api/types/index.mjs +0 -47
  885. package/dist/esm/core/fetcher/APIResponse.d.mts +0 -20
  886. package/dist/esm/core/fetcher/APIResponse.mjs +0 -1
  887. package/dist/esm/core/fetcher/BinaryResponse.d.mts +0 -20
  888. package/dist/esm/core/fetcher/BinaryResponse.mjs +0 -14
  889. package/dist/esm/core/fetcher/Fetcher.d.mts +0 -40
  890. package/dist/esm/core/fetcher/Fetcher.mjs +0 -116
  891. package/dist/esm/core/fetcher/Headers.d.mts +0 -2
  892. package/dist/esm/core/fetcher/Headers.mjs +0 -82
  893. package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +0 -58
  894. package/dist/esm/core/fetcher/HttpResponsePromise.mjs +0 -99
  895. package/dist/esm/core/fetcher/RawResponse.d.mts +0 -29
  896. package/dist/esm/core/fetcher/RawResponse.mjs +0 -40
  897. package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
  898. package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
  899. package/dist/esm/core/fetcher/Supplier.d.mts +0 -4
  900. package/dist/esm/core/fetcher/Supplier.mjs +0 -19
  901. package/dist/esm/core/fetcher/createRequestUrl.d.mts +0 -1
  902. package/dist/esm/core/fetcher/createRequestUrl.mjs +0 -5
  903. package/dist/esm/core/fetcher/getErrorResponseBody.d.mts +0 -1
  904. package/dist/esm/core/fetcher/getErrorResponseBody.mjs +0 -41
  905. package/dist/esm/core/fetcher/getFetchFn.d.mts +0 -1
  906. package/dist/esm/core/fetcher/getFetchFn.mjs +0 -14
  907. package/dist/esm/core/fetcher/getHeader.d.mts +0 -1
  908. package/dist/esm/core/fetcher/getHeader.mjs +0 -8
  909. package/dist/esm/core/fetcher/getRequestBody.d.mts +0 -7
  910. package/dist/esm/core/fetcher/getRequestBody.mjs +0 -20
  911. package/dist/esm/core/fetcher/getResponseBody.d.mts +0 -1
  912. package/dist/esm/core/fetcher/getResponseBody.mjs +0 -52
  913. package/dist/esm/core/fetcher/index.d.mts +0 -9
  914. package/dist/esm/core/fetcher/index.mjs +0 -5
  915. package/dist/esm/core/fetcher/makeRequest.d.mts +0 -1
  916. package/dist/esm/core/fetcher/makeRequest.mjs +0 -38
  917. package/dist/esm/core/fetcher/requestWithRetries.d.mts +0 -1
  918. package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -73
  919. package/dist/esm/core/fetcher/signals.d.mts +0 -11
  920. package/dist/esm/core/fetcher/signals.mjs +0 -32
  921. package/dist/esm/core/headers.d.mts +0 -3
  922. package/dist/esm/core/headers.mjs +0 -25
  923. package/dist/esm/core/index.d.mts +0 -3
  924. package/dist/esm/core/index.mjs +0 -3
  925. package/dist/esm/core/json.d.mts +0 -15
  926. package/dist/esm/core/json.mjs +0 -19
  927. package/dist/esm/core/runtime/index.d.mts +0 -1
  928. package/dist/esm/core/runtime/index.mjs +0 -1
  929. package/dist/esm/core/runtime/runtime.d.mts +0 -9
  930. package/dist/esm/core/runtime/runtime.mjs +0 -99
  931. package/dist/esm/core/url/index.d.mts +0 -2
  932. package/dist/esm/core/url/index.mjs +0 -2
  933. package/dist/esm/core/url/join.d.mts +0 -1
  934. package/dist/esm/core/url/join.mjs +0 -66
  935. package/dist/esm/core/url/qs.d.mts +0 -6
  936. package/dist/esm/core/url/qs.mjs +0 -61
  937. package/dist/esm/environments.d.mts +0 -7
  938. package/dist/esm/environments.mjs +0 -6
  939. package/dist/esm/errors/LarkError.d.mts +0 -15
  940. package/dist/esm/errors/LarkError.mjs +0 -26
  941. package/dist/esm/errors/LarkTimeoutError.d.mts +0 -6
  942. package/dist/esm/errors/LarkTimeoutError.mjs +0 -9
  943. package/dist/esm/errors/index.d.mts +0 -2
  944. package/dist/esm/errors/index.mjs +0 -2
  945. package/dist/esm/index.d.mts +0 -4
  946. package/dist/esm/index.mjs +0 -4
  947. package/dist/esm/version.d.mts +0 -1
  948. package/dist/esm/version.mjs +0 -1
  949. package/reference.md +0 -1204
@@ -0,0 +1,80 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { hasOwn } from "./values.mjs";
3
+ const levelNumbers = {
4
+ off: 0,
5
+ error: 200,
6
+ warn: 300,
7
+ info: 400,
8
+ debug: 500,
9
+ };
10
+ export const parseLogLevel = (maybeLevel, sourceName, client) => {
11
+ if (!maybeLevel) {
12
+ return undefined;
13
+ }
14
+ if (hasOwn(levelNumbers, maybeLevel)) {
15
+ return maybeLevel;
16
+ }
17
+ loggerFor(client).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers))}`);
18
+ return undefined;
19
+ };
20
+ function noop() { }
21
+ function makeLogFn(fnLevel, logger, logLevel) {
22
+ if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) {
23
+ return noop;
24
+ }
25
+ else {
26
+ // Don't wrap logger functions, we want the stacktrace intact!
27
+ return logger[fnLevel].bind(logger);
28
+ }
29
+ }
30
+ const noopLogger = {
31
+ error: noop,
32
+ warn: noop,
33
+ info: noop,
34
+ debug: noop,
35
+ };
36
+ let cachedLoggers = /* @__PURE__ */ new WeakMap();
37
+ export function loggerFor(client) {
38
+ const logger = client.logger;
39
+ const logLevel = client.logLevel ?? 'off';
40
+ if (!logger) {
41
+ return noopLogger;
42
+ }
43
+ const cachedLogger = cachedLoggers.get(logger);
44
+ if (cachedLogger && cachedLogger[0] === logLevel) {
45
+ return cachedLogger[1];
46
+ }
47
+ const levelLogger = {
48
+ error: makeLogFn('error', logger, logLevel),
49
+ warn: makeLogFn('warn', logger, logLevel),
50
+ info: makeLogFn('info', logger, logLevel),
51
+ debug: makeLogFn('debug', logger, logLevel),
52
+ };
53
+ cachedLoggers.set(logger, [logLevel, levelLogger]);
54
+ return levelLogger;
55
+ }
56
+ export const formatRequestDetails = (details) => {
57
+ if (details.options) {
58
+ details.options = { ...details.options };
59
+ delete details.options['headers']; // redundant + leaks internals
60
+ }
61
+ if (details.headers) {
62
+ details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value]) => [
63
+ name,
64
+ (name.toLowerCase() === 'x-api-key' ||
65
+ name.toLowerCase() === 'authorization' ||
66
+ name.toLowerCase() === 'cookie' ||
67
+ name.toLowerCase() === 'set-cookie') ?
68
+ '***'
69
+ : value,
70
+ ]));
71
+ }
72
+ if ('retryOfRequestLogID' in details) {
73
+ if (details.retryOfRequestLogID) {
74
+ details.retryOf = details.retryOfRequestLogID;
75
+ }
76
+ delete details.retryOfRequestLogID;
77
+ }
78
+ return details;
79
+ };
80
+ //# sourceMappingURL=log.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.mjs","sourceRoot":"","sources":["../../src/internal/utils/log.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,MAAM,EAAE;AAajB,MAAM,YAAY,GAAG;IACnB,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,GAAG;CACX,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,UAA8B,EAC9B,UAAkB,EAClB,MAAY,EACU,EAAE;IACxB,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,CAAC;QACrC,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CACpB,GAAG,UAAU,eAAe,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,qBAAqB,IAAI,CAAC,SAAS,CACvF,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAC1B,EAAE,CACJ,CAAC;IACF,OAA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AAC;IACrC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Percent-encode everything that isn't safe to have in a path without encoding safe chars.
3
+ *
4
+ * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
5
+ * > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
6
+ * > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
7
+ * > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
8
+ */
9
+ export declare function encodeURIPath(str: string): string;
10
+ export declare const createPathTagFunction: (pathEncoder?: typeof encodeURIPath) => (statics: readonly string[], ...params: readonly unknown[]) => string;
11
+ /**
12
+ * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
13
+ */
14
+ export declare const path: (statics: readonly string[], ...params: readonly unknown[]) => string;
15
+ //# sourceMappingURL=path.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.d.mts","sourceRoot":"","sources":["../../src/internal/utils/path.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,UAExC;AAID,eAAO,MAAM,qBAAqB,GAAI,kCAA2B,MACjD,SAAS,SAAS,MAAM,EAAE,EAAE,GAAG,QAAQ,SAAS,OAAO,EAAE,KAAG,MAiEzE,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,IAAI,YAtEQ,SAAS,MAAM,EAAE,aAAa,SAAS,OAAO,EAAE,KAAG,MAsEJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Percent-encode everything that isn't safe to have in a path without encoding safe chars.
3
+ *
4
+ * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
5
+ * > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
6
+ * > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
7
+ * > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
8
+ */
9
+ export declare function encodeURIPath(str: string): string;
10
+ export declare const createPathTagFunction: (pathEncoder?: typeof encodeURIPath) => (statics: readonly string[], ...params: readonly unknown[]) => string;
11
+ /**
12
+ * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
13
+ */
14
+ export declare const path: (statics: readonly string[], ...params: readonly unknown[]) => string;
15
+ //# sourceMappingURL=path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/internal/utils/path.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,UAExC;AAID,eAAO,MAAM,qBAAqB,GAAI,kCAA2B,MACjD,SAAS,SAAS,MAAM,EAAE,EAAE,GAAG,QAAQ,SAAS,OAAO,EAAE,KAAG,MAiEzE,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,IAAI,YAtEQ,SAAS,MAAM,EAAE,aAAa,SAAS,OAAO,EAAE,KAAG,MAsEJ,CAAC"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.path = exports.createPathTagFunction = void 0;
4
+ exports.encodeURIPath = encodeURIPath;
5
+ const error_1 = require("../../core/error.js");
6
+ /**
7
+ * Percent-encode everything that isn't safe to have in a path without encoding safe chars.
8
+ *
9
+ * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
10
+ * > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
11
+ * > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
12
+ * > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
13
+ */
14
+ function encodeURIPath(str) {
15
+ return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
16
+ }
17
+ const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
18
+ const createPathTagFunction = (pathEncoder = encodeURIPath) => function path(statics, ...params) {
19
+ // If there are no params, no processing is needed.
20
+ if (statics.length === 1)
21
+ return statics[0];
22
+ let postPath = false;
23
+ const invalidSegments = [];
24
+ const path = statics.reduce((previousValue, currentValue, index) => {
25
+ if (/[?#]/.test(currentValue)) {
26
+ postPath = true;
27
+ }
28
+ const value = params[index];
29
+ let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);
30
+ if (index !== params.length &&
31
+ (value == null ||
32
+ (typeof value === 'object' &&
33
+ // handle values from other realms
34
+ value.toString ===
35
+ Object.getPrototypeOf(Object.getPrototypeOf(value.hasOwnProperty ?? EMPTY) ?? EMPTY)
36
+ ?.toString))) {
37
+ encoded = value + '';
38
+ invalidSegments.push({
39
+ start: previousValue.length + currentValue.length,
40
+ length: encoded.length,
41
+ error: `Value of type ${Object.prototype.toString
42
+ .call(value)
43
+ .slice(8, -1)} is not a valid path parameter`,
44
+ });
45
+ }
46
+ return previousValue + currentValue + (index === params.length ? '' : encoded);
47
+ }, '');
48
+ const pathOnly = path.split(/[?#]/, 1)[0];
49
+ const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
50
+ let match;
51
+ // Find all invalid segments
52
+ while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
53
+ invalidSegments.push({
54
+ start: match.index,
55
+ length: match[0].length,
56
+ error: `Value "${match[0]}" can\'t be safely passed as a path parameter`,
57
+ });
58
+ }
59
+ invalidSegments.sort((a, b) => a.start - b.start);
60
+ if (invalidSegments.length > 0) {
61
+ let lastEnd = 0;
62
+ const underline = invalidSegments.reduce((acc, segment) => {
63
+ const spaces = ' '.repeat(segment.start - lastEnd);
64
+ const arrows = '^'.repeat(segment.length);
65
+ lastEnd = segment.start + segment.length;
66
+ return acc + spaces + arrows;
67
+ }, '');
68
+ throw new error_1.LarkError(`Path parameters result in path with invalid segments:\n${invalidSegments
69
+ .map((e) => e.error)
70
+ .join('\n')}\n${path}\n${underline}`);
71
+ }
72
+ return path;
73
+ };
74
+ exports.createPathTagFunction = createPathTagFunction;
75
+ /**
76
+ * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
77
+ */
78
+ exports.path = (0, exports.createPathTagFunction)(encodeURIPath);
79
+ //# sourceMappingURL=path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.js","sourceRoot":"","sources":["../../src/internal/utils/path.ts"],"names":[],"mappings":";;;AAUA,sCAEC;AAZD,+CAA6C;AAE7C;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAC,GAAW;IACvC,OAAO,GAAG,CAAC,OAAO,CAAC,kCAAkC,EAAE,kBAAkB,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAE1E,MAAM,qBAAqB,GAAG,CAAC,WAAW,GAAG,aAAa,EAAE,EAAE,CACnE,SAAS,IAAI,CAAC,OAA0B,EAAE,GAAG,MAA0B;IACrE,mDAAmD;IACnD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC,CAAC,CAAE,CAAC;IAE7C,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,MAAM,eAAe,GAAG,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE;QACjE,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YAC9B,QAAQ,GAAG,IAAI,CAAC;QAClB,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,GAA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AC,MAAM;YACvB,KAAK,EAAE,UAAU,KAAK,CAAC,CAAC,CAAC,+CAA+C;SACzE,CAAC,CAAC;IACL,CAAC;IAED,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAElD,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,MAAM,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;YACxD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC;YACnD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAC1C,OAAO,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;YACzC,OAAO,GAAG,GAAG,MAAM,GAAG,MAAM,CAAC;QAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,MAAM,IAAI,iBAAS,CACjB,0DAA0D,eAAe;aACtE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;aACnB,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,SAAS,EAAE,CACvC,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAlES,QAAA,qBAAqB,yBAkE9B;AAEJ;;GAEG;AACU,QAAA,IAAI,GAAmB,IAAA,6BAAqB,EAAC,aAAa,CAAC,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { LarkError } from "../../core/error.mjs";
2
+ /**
3
+ * Percent-encode everything that isn't safe to have in a path without encoding safe chars.
4
+ *
5
+ * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
6
+ * > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
7
+ * > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
8
+ * > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
9
+ */
10
+ export function encodeURIPath(str) {
11
+ return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
12
+ }
13
+ const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
14
+ export const createPathTagFunction = (pathEncoder = encodeURIPath) => function path(statics, ...params) {
15
+ // If there are no params, no processing is needed.
16
+ if (statics.length === 1)
17
+ return statics[0];
18
+ let postPath = false;
19
+ const invalidSegments = [];
20
+ const path = statics.reduce((previousValue, currentValue, index) => {
21
+ if (/[?#]/.test(currentValue)) {
22
+ postPath = true;
23
+ }
24
+ const value = params[index];
25
+ let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);
26
+ if (index !== params.length &&
27
+ (value == null ||
28
+ (typeof value === 'object' &&
29
+ // handle values from other realms
30
+ value.toString ===
31
+ Object.getPrototypeOf(Object.getPrototypeOf(value.hasOwnProperty ?? EMPTY) ?? EMPTY)
32
+ ?.toString))) {
33
+ encoded = value + '';
34
+ invalidSegments.push({
35
+ start: previousValue.length + currentValue.length,
36
+ length: encoded.length,
37
+ error: `Value of type ${Object.prototype.toString
38
+ .call(value)
39
+ .slice(8, -1)} is not a valid path parameter`,
40
+ });
41
+ }
42
+ return previousValue + currentValue + (index === params.length ? '' : encoded);
43
+ }, '');
44
+ const pathOnly = path.split(/[?#]/, 1)[0];
45
+ const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
46
+ let match;
47
+ // Find all invalid segments
48
+ while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
49
+ invalidSegments.push({
50
+ start: match.index,
51
+ length: match[0].length,
52
+ error: `Value "${match[0]}" can\'t be safely passed as a path parameter`,
53
+ });
54
+ }
55
+ invalidSegments.sort((a, b) => a.start - b.start);
56
+ if (invalidSegments.length > 0) {
57
+ let lastEnd = 0;
58
+ const underline = invalidSegments.reduce((acc, segment) => {
59
+ const spaces = ' '.repeat(segment.start - lastEnd);
60
+ const arrows = '^'.repeat(segment.length);
61
+ lastEnd = segment.start + segment.length;
62
+ return acc + spaces + arrows;
63
+ }, '');
64
+ throw new LarkError(`Path parameters result in path with invalid segments:\n${invalidSegments
65
+ .map((e) => e.error)
66
+ .join('\n')}\n${path}\n${underline}`);
67
+ }
68
+ return path;
69
+ };
70
+ /**
71
+ * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
72
+ */
73
+ export const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
74
+ //# sourceMappingURL=path.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.mjs","sourceRoot":"","sources":["../../src/internal/utils/path.ts"],"names":[],"mappings":"OAAO,EAAE,SAAS,EAAE;AAEpB;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,GAAG,CAAC,OAAO,CAAC,kCAAkC,EAAE,kBAAkB,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAEjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,WAAW,GAAG,aAAa,EAAE,EAAE,CACnE,SAAS,IAAI,CAAC,OAA0B,EAAE,GAAG,MAA0B;IACrE,mDAAmD;IACnD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC,CAAC,CAAE,CAAC;IAE7C,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,MAAM,eAAe,GAAG,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,YAAY,EAAE,KAAK,EA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AC;AAEJ;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const sleep: (ms: number) => Promise<void>;
2
+ //# sourceMappingURL=sleep.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sleep.d.mts","sourceRoot":"","sources":["../../src/internal/utils/sleep.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,GAAI,IAAI,MAAM,kBAA4D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const sleep: (ms: number) => Promise<void>;
2
+ //# sourceMappingURL=sleep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../src/internal/utils/sleep.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,GAAI,IAAI,MAAM,kBAA4D,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.sleep = void 0;
5
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
6
+ exports.sleep = sleep;
7
+ //# sourceMappingURL=sleep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../src/internal/utils/sleep.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAE/E,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAAhF,QAAA,KAAK,SAA2E"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
3
+ //# sourceMappingURL=sleep.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sleep.mjs","sourceRoot":"","sources":["../../src/internal/utils/sleep.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * https://stackoverflow.com/a/2117523
3
+ */
4
+ export declare let uuid4: () => any;
5
+ //# sourceMappingURL=uuid.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.d.mts","sourceRoot":"","sources":["../../src/internal/utils/uuid.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,IAAI,KAAK,WAWf,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * https://stackoverflow.com/a/2117523
3
+ */
4
+ export declare let uuid4: () => any;
5
+ //# sourceMappingURL=uuid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/internal/utils/uuid.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,IAAI,KAAK,WAWf,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.uuid4 = void 0;
5
+ /**
6
+ * https://stackoverflow.com/a/2117523
7
+ */
8
+ let uuid4 = function () {
9
+ const { crypto } = globalThis;
10
+ if (crypto?.randomUUID) {
11
+ exports.uuid4 = crypto.randomUUID.bind(crypto);
12
+ return crypto.randomUUID();
13
+ }
14
+ const u8 = new Uint8Array(1);
15
+ const randomByte = crypto ? () => crypto.getRandomValues(u8)[0] : () => (Math.random() * 0xff) & 0xff;
16
+ return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) => (+c ^ (randomByte() & (15 >> (+c / 4)))).toString(16));
17
+ };
18
+ exports.uuid4 = uuid4;
19
+ //# sourceMappingURL=uuid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src/internal/utils/uuid.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF;;GAEG;AACI,IAAI,KAAK,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,GAAG,UAAiB,CAAC;IACrC,IAAI,MAAM,EAAE,UAAU,EAAE,CAAC;QACvB,aAAK,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvC,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;IAC7B,CAAC;IACD,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACvG,OAAO,sCAAsC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACpE,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CACtD,CAAC;AACJ,CAAC,CAAC;AAXS,QAAA,KAAK,SAWd"}
@@ -0,0 +1,15 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ /**
3
+ * https://stackoverflow.com/a/2117523
4
+ */
5
+ export let uuid4 = function () {
6
+ const { crypto } = globalThis;
7
+ if (crypto?.randomUUID) {
8
+ uuid4 = crypto.randomUUID.bind(crypto);
9
+ return crypto.randomUUID();
10
+ }
11
+ const u8 = new Uint8Array(1);
12
+ const randomByte = crypto ? () => crypto.getRandomValues(u8)[0] : () => (Math.random() * 0xff) & 0xff;
13
+ return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) => (+c ^ (randomByte() & (15 >> (+c / 4)))).toString(16));
14
+ };
15
+ //# sourceMappingURL=uuid.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.mjs","sourceRoot":"","sources":["../../src/internal/utils/uuid.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF;;GAEG;AACH,MAAM,CAAC,IAAI,KAAK,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,GAAG,UAAiB,CAAC;IACrC,IAAI,MAAM,EAAE,UAAU,EAAE,CAAC;QACvB,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvC,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;IAC7B,CAAC;IACD,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACvG,OAAO,sCAAsC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACpE,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CACtD,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const isAbsoluteURL: (url: string) => boolean;
2
+ export declare let isArray: (val: unknown) => val is unknown[];
3
+ export declare let isReadonlyArray: (val: unknown) => val is readonly unknown[];
4
+ /** Returns an object if the given value isn't an object, otherwise returns as-is */
5
+ export declare function maybeObj(x: unknown): object;
6
+ export declare function isEmptyObj(obj: Object | null | undefined): boolean;
7
+ export declare function hasOwn<T extends object = object>(obj: T, key: PropertyKey): key is keyof T;
8
+ export declare function isObj(obj: unknown): obj is Record<string, unknown>;
9
+ export declare const ensurePresent: <T>(value: T | null | undefined) => T;
10
+ export declare const validatePositiveInteger: (name: string, n: unknown) => number;
11
+ export declare const coerceInteger: (value: unknown) => number;
12
+ export declare const coerceFloat: (value: unknown) => number;
13
+ export declare const coerceBoolean: (value: unknown) => boolean;
14
+ export declare const maybeCoerceInteger: (value: unknown) => number | undefined;
15
+ export declare const maybeCoerceFloat: (value: unknown) => number | undefined;
16
+ export declare const maybeCoerceBoolean: (value: unknown) => boolean | undefined;
17
+ export declare const safeJSON: (text: string) => any;
18
+ //# sourceMappingURL=values.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values.d.mts","sourceRoot":"","sources":["../../src/internal/utils/values.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,KAAG,OAE3C,CAAC;AAEF,eAAO,IAAI,OAAO,GAAI,KAAK,OAAO,KAAG,GAAG,IAAI,OAAO,EAA+C,CAAC;AACnG,eAAO,IAAI,eAAe,EAAc,CAAC,GAAG,EAAE,OAAO,KAAK,GAAG,IAAI,SAAS,OAAO,EAAE,CAAC;AAEpF,oFAAoF;AACpF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAM3C;AAGD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAIlE;AAGD,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,GAAG,GAAG,IAAI,MAAM,CAAC,CAE1F;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAElE;AAED,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KAAG,CAM9D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,EAAE,GAAG,OAAO,KAAG,MAQlE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,MAK9C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,MAK5C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,OAI9C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAK5D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAK1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,OAAO,GAAG,SAK7D,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,QAMpC,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const isAbsoluteURL: (url: string) => boolean;
2
+ export declare let isArray: (val: unknown) => val is unknown[];
3
+ export declare let isReadonlyArray: (val: unknown) => val is readonly unknown[];
4
+ /** Returns an object if the given value isn't an object, otherwise returns as-is */
5
+ export declare function maybeObj(x: unknown): object;
6
+ export declare function isEmptyObj(obj: Object | null | undefined): boolean;
7
+ export declare function hasOwn<T extends object = object>(obj: T, key: PropertyKey): key is keyof T;
8
+ export declare function isObj(obj: unknown): obj is Record<string, unknown>;
9
+ export declare const ensurePresent: <T>(value: T | null | undefined) => T;
10
+ export declare const validatePositiveInteger: (name: string, n: unknown) => number;
11
+ export declare const coerceInteger: (value: unknown) => number;
12
+ export declare const coerceFloat: (value: unknown) => number;
13
+ export declare const coerceBoolean: (value: unknown) => boolean;
14
+ export declare const maybeCoerceInteger: (value: unknown) => number | undefined;
15
+ export declare const maybeCoerceFloat: (value: unknown) => number | undefined;
16
+ export declare const maybeCoerceBoolean: (value: unknown) => boolean | undefined;
17
+ export declare const safeJSON: (text: string) => any;
18
+ //# sourceMappingURL=values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/internal/utils/values.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,KAAG,OAE3C,CAAC;AAEF,eAAO,IAAI,OAAO,GAAI,KAAK,OAAO,KAAG,GAAG,IAAI,OAAO,EAA+C,CAAC;AACnG,eAAO,IAAI,eAAe,EAAc,CAAC,GAAG,EAAE,OAAO,KAAK,GAAG,IAAI,SAAS,OAAO,EAAE,CAAC;AAEpF,oFAAoF;AACpF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAM3C;AAGD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAIlE;AAGD,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,GAAG,GAAG,IAAI,MAAM,CAAC,CAE1F;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAElE;AAED,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KAAG,CAM9D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,EAAE,GAAG,OAAO,KAAG,MAQlE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,MAK9C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,MAK5C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,OAI9C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAK5D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAK1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,OAAO,GAAG,SAK7D,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,QAMpC,CAAC"}
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.safeJSON = exports.maybeCoerceBoolean = exports.maybeCoerceFloat = exports.maybeCoerceInteger = exports.coerceBoolean = exports.coerceFloat = exports.coerceInteger = exports.validatePositiveInteger = exports.ensurePresent = exports.isReadonlyArray = exports.isArray = exports.isAbsoluteURL = void 0;
5
+ exports.maybeObj = maybeObj;
6
+ exports.isEmptyObj = isEmptyObj;
7
+ exports.hasOwn = hasOwn;
8
+ exports.isObj = isObj;
9
+ const error_1 = require("../../core/error.js");
10
+ // https://url.spec.whatwg.org/#url-scheme-string
11
+ const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
12
+ const isAbsoluteURL = (url) => {
13
+ return startsWithSchemeRegexp.test(url);
14
+ };
15
+ exports.isAbsoluteURL = isAbsoluteURL;
16
+ let isArray = (val) => ((exports.isArray = Array.isArray), (0, exports.isArray)(val));
17
+ exports.isArray = isArray;
18
+ exports.isReadonlyArray = exports.isArray;
19
+ /** Returns an object if the given value isn't an object, otherwise returns as-is */
20
+ function maybeObj(x) {
21
+ if (typeof x !== 'object') {
22
+ return {};
23
+ }
24
+ return x ?? {};
25
+ }
26
+ // https://stackoverflow.com/a/34491287
27
+ function isEmptyObj(obj) {
28
+ if (!obj)
29
+ return true;
30
+ for (const _k in obj)
31
+ return false;
32
+ return true;
33
+ }
34
+ // https://eslint.org/docs/latest/rules/no-prototype-builtins
35
+ function hasOwn(obj, key) {
36
+ return Object.prototype.hasOwnProperty.call(obj, key);
37
+ }
38
+ function isObj(obj) {
39
+ return obj != null && typeof obj === 'object' && !Array.isArray(obj);
40
+ }
41
+ const ensurePresent = (value) => {
42
+ if (value == null) {
43
+ throw new error_1.LarkError(`Expected a value to be given but received ${value} instead.`);
44
+ }
45
+ return value;
46
+ };
47
+ exports.ensurePresent = ensurePresent;
48
+ const validatePositiveInteger = (name, n) => {
49
+ if (typeof n !== 'number' || !Number.isInteger(n)) {
50
+ throw new error_1.LarkError(`${name} must be an integer`);
51
+ }
52
+ if (n < 0) {
53
+ throw new error_1.LarkError(`${name} must be a positive integer`);
54
+ }
55
+ return n;
56
+ };
57
+ exports.validatePositiveInteger = validatePositiveInteger;
58
+ const coerceInteger = (value) => {
59
+ if (typeof value === 'number')
60
+ return Math.round(value);
61
+ if (typeof value === 'string')
62
+ return parseInt(value, 10);
63
+ throw new error_1.LarkError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
64
+ };
65
+ exports.coerceInteger = coerceInteger;
66
+ const coerceFloat = (value) => {
67
+ if (typeof value === 'number')
68
+ return value;
69
+ if (typeof value === 'string')
70
+ return parseFloat(value);
71
+ throw new error_1.LarkError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
72
+ };
73
+ exports.coerceFloat = coerceFloat;
74
+ const coerceBoolean = (value) => {
75
+ if (typeof value === 'boolean')
76
+ return value;
77
+ if (typeof value === 'string')
78
+ return value === 'true';
79
+ return Boolean(value);
80
+ };
81
+ exports.coerceBoolean = coerceBoolean;
82
+ const maybeCoerceInteger = (value) => {
83
+ if (value == null) {
84
+ return undefined;
85
+ }
86
+ return (0, exports.coerceInteger)(value);
87
+ };
88
+ exports.maybeCoerceInteger = maybeCoerceInteger;
89
+ const maybeCoerceFloat = (value) => {
90
+ if (value == null) {
91
+ return undefined;
92
+ }
93
+ return (0, exports.coerceFloat)(value);
94
+ };
95
+ exports.maybeCoerceFloat = maybeCoerceFloat;
96
+ const maybeCoerceBoolean = (value) => {
97
+ if (value == null) {
98
+ return undefined;
99
+ }
100
+ return (0, exports.coerceBoolean)(value);
101
+ };
102
+ exports.maybeCoerceBoolean = maybeCoerceBoolean;
103
+ const safeJSON = (text) => {
104
+ try {
105
+ return JSON.parse(text);
106
+ }
107
+ catch (err) {
108
+ return undefined;
109
+ }
110
+ };
111
+ exports.safeJSON = safeJSON;
112
+ //# sourceMappingURL=values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/internal/utils/values.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAetF,4BAMC;AAGD,gCAIC;AAGD,wBAEC;AAED,sBAEC;AAnCD,+CAA6C;AAE7C,iDAAiD;AACjD,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AAE/C,MAAM,aAAa,GAAG,CAAC,GAAW,EAAW,EAAE;IACpD,OAAO,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAEK,IAAI,OAAO,GAAG,CAAC,GAAY,EAAoB,EAAE,CAAC,CAAC,CAAC,eAAO,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,IAAA,eAAO,EAAC,GAAG,CAAC,CAAC,CAAC;AAAxF,QAAA,OAAO,WAAiF;AACxF,QAAA,eAAe,GAAG,eAAsD,CAAC;AAEpF,oFAAoF;AACpF,SAAgB,QAAQ,CAAC,CAAU;IACjC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,CAAC,IAAI,EAAE,CAAC;AACjB,CAAC;AAED,uCAAuC;AACvC,SAAgB,UAAU,CAAC,GAA8B;IACv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