zorihq 0.0.3

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 (343) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +201 -0
  3. package/README.md +368 -0
  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 +180 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +180 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +461 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +457 -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 +85 -0
  187. package/internal/utils/log.js.map +1 -0
  188. package/internal/utils/log.mjs +79 -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 +138 -0
  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/index.d.mts +2 -0
  240. package/resources/index.d.mts.map +1 -0
  241. package/resources/index.d.ts +2 -0
  242. package/resources/index.d.ts.map +1 -0
  243. package/resources/index.js +7 -0
  244. package/resources/index.js.map +1 -0
  245. package/resources/index.mjs +3 -0
  246. package/resources/index.mjs.map +1 -0
  247. package/resources/v1/auth.d.mts +141 -0
  248. package/resources/v1/auth.d.mts.map +1 -0
  249. package/resources/v1/auth.d.ts +141 -0
  250. package/resources/v1/auth.d.ts.map +1 -0
  251. package/resources/v1/auth.js +95 -0
  252. package/resources/v1/auth.js.map +1 -0
  253. package/resources/v1/auth.mjs +91 -0
  254. package/resources/v1/auth.mjs.map +1 -0
  255. package/resources/v1/index.d.mts +3 -0
  256. package/resources/v1/index.d.mts.map +1 -0
  257. package/resources/v1/index.d.ts +3 -0
  258. package/resources/v1/index.d.ts.map +1 -0
  259. package/resources/v1/index.js +9 -0
  260. package/resources/v1/index.js.map +1 -0
  261. package/resources/v1/index.mjs +4 -0
  262. package/resources/v1/index.mjs.map +1 -0
  263. package/resources/v1/v1.d.mts +10 -0
  264. package/resources/v1/v1.d.mts.map +1 -0
  265. package/resources/v1/v1.d.ts +10 -0
  266. package/resources/v1/v1.d.ts.map +1 -0
  267. package/resources/v1/v1.js +17 -0
  268. package/resources/v1/v1.js.map +1 -0
  269. package/resources/v1/v1.mjs +12 -0
  270. package/resources/v1/v1.mjs.map +1 -0
  271. package/resources/v1.d.mts +2 -0
  272. package/resources/v1.d.mts.map +1 -0
  273. package/resources/v1.d.ts +2 -0
  274. package/resources/v1.d.ts.map +1 -0
  275. package/resources/v1.js +6 -0
  276. package/resources/v1.js.map +1 -0
  277. package/resources/v1.mjs +3 -0
  278. package/resources/v1.mjs.map +1 -0
  279. package/resources.d.mts +2 -0
  280. package/resources.d.mts.map +1 -0
  281. package/resources.d.ts +2 -0
  282. package/resources.d.ts.map +1 -0
  283. package/resources.js +5 -0
  284. package/resources.js.map +1 -0
  285. package/resources.mjs +2 -0
  286. package/resources.mjs.map +1 -0
  287. package/src/api-promise.ts +2 -0
  288. package/src/client.ts +726 -0
  289. package/src/core/README.md +3 -0
  290. package/src/core/api-promise.ts +92 -0
  291. package/src/core/error.ts +130 -0
  292. package/src/core/resource.ts +11 -0
  293. package/src/core/uploads.ts +2 -0
  294. package/src/error.ts +2 -0
  295. package/src/index.ts +22 -0
  296. package/src/internal/README.md +3 -0
  297. package/src/internal/builtin-types.ts +93 -0
  298. package/src/internal/detect-platform.ts +196 -0
  299. package/src/internal/errors.ts +33 -0
  300. package/src/internal/headers.ts +97 -0
  301. package/src/internal/parse.ts +50 -0
  302. package/src/internal/request-options.ts +91 -0
  303. package/src/internal/shim-types.ts +26 -0
  304. package/src/internal/shims.ts +107 -0
  305. package/src/internal/to-file.ts +154 -0
  306. package/src/internal/types.ts +95 -0
  307. package/src/internal/uploads.ts +187 -0
  308. package/src/internal/utils/base64.ts +40 -0
  309. package/src/internal/utils/bytes.ts +32 -0
  310. package/src/internal/utils/env.ts +18 -0
  311. package/src/internal/utils/log.ts +126 -0
  312. package/src/internal/utils/path.ts +88 -0
  313. package/src/internal/utils/sleep.ts +3 -0
  314. package/src/internal/utils/uuid.ts +17 -0
  315. package/src/internal/utils/values.ts +105 -0
  316. package/src/internal/utils.ts +8 -0
  317. package/src/lib/.keep +4 -0
  318. package/src/resource.ts +2 -0
  319. package/src/resources/index.ts +3 -0
  320. package/src/resources/v1/auth.ts +210 -0
  321. package/src/resources/v1/index.ts +16 -0
  322. package/src/resources/v1/v1.ts +39 -0
  323. package/src/resources/v1.ts +3 -0
  324. package/src/resources.ts +1 -0
  325. package/src/tsconfig.json +11 -0
  326. package/src/uploads.ts +2 -0
  327. package/src/version.ts +1 -0
  328. package/uploads.d.mts +2 -0
  329. package/uploads.d.mts.map +1 -0
  330. package/uploads.d.ts +2 -0
  331. package/uploads.d.ts.map +1 -0
  332. package/uploads.js +6 -0
  333. package/uploads.js.map +1 -0
  334. package/uploads.mjs +2 -0
  335. package/uploads.mjs.map +1 -0
  336. package/version.d.mts +2 -0
  337. package/version.d.mts.map +1 -0
  338. package/version.d.ts +2 -0
  339. package/version.d.ts.map +1 -0
  340. package/version.js +5 -0
  341. package/version.js.map +1 -0
  342. package/version.mjs +2 -0
  343. package/version.mjs.map +1 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ ## 0.0.3 (2025-10-05)
4
+
5
+ Full Changelog: [v0.0.2...v0.0.3](https://github.com/ZoriHQ/typescript-api-sdk/compare/v0.0.2...v0.0.3)
6
+
7
+ ### Chores
8
+
9
+ * update SDK settings ([2883221](https://github.com/ZoriHQ/typescript-api-sdk/commit/2883221b67a8a506fa310a25e237b2ec0833ea10))
10
+
11
+ ## 0.0.2 (2025-10-05)
12
+
13
+ Full Changelog: [v0.0.1...v0.0.2](https://github.com/ZoriHQ/typescript-api-sdk/compare/v0.0.1...v0.0.2)
14
+
15
+ ### Chores
16
+
17
+ * update SDK settings ([4be31d3](https://github.com/ZoriHQ/typescript-api-sdk/commit/4be31d38fb0a6cea432b86a7d126f9c4325d8fea))
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 Zoriapi
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,368 @@
1
+ # Zoriapi TypeScript API Library
2
+
3
+ [![NPM version](<https://img.shields.io/npm/v/zorihq.svg?label=npm%20(stable)>)](https://npmjs.org/package/zorihq) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/zorihq)
4
+
5
+ This library provides convenient access to the Zoriapi REST API from server-side TypeScript or JavaScript.
6
+
7
+ The REST API documentation can be found on [www.zorihq.com](https://www.zorihq.com/support). The full API of this library can be found in [api.md](api.md).
8
+
9
+ It is generated with [Stainless](https://www.stainless.com/).
10
+
11
+ ## Installation
12
+
13
+ ```sh
14
+ npm install zorihq
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ The full API of this library can be found in [api.md](api.md).
20
+
21
+ <!-- prettier-ignore -->
22
+ ```js
23
+ import Zoriapi from 'zorihq';
24
+
25
+ const client = new Zoriapi({
26
+ apiKey: process.env['ZORIAPI_API_KEY'], // This is the default and can be omitted
27
+ });
28
+
29
+ const authResponse = await client.v1.auth.login({
30
+ email: 'user@example.com',
31
+ password: 'SecurePassword123!',
32
+ });
33
+
34
+ console.log(authResponse.access_token);
35
+ ```
36
+
37
+ ### Request & Response types
38
+
39
+ This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
40
+
41
+ <!-- prettier-ignore -->
42
+ ```ts
43
+ import Zoriapi from 'zorihq';
44
+
45
+ const client = new Zoriapi({
46
+ apiKey: process.env['ZORIAPI_API_KEY'], // This is the default and can be omitted
47
+ });
48
+
49
+ const params: Zoriapi.V1.AuthLoginParams = { email: 'user@example.com', password: 'SecurePassword123!' };
50
+ const authResponse: Zoriapi.V1.AuthResponse = await client.v1.auth.login(params);
51
+ ```
52
+
53
+ Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
54
+
55
+ ## Handling errors
56
+
57
+ When the library is unable to connect to the API,
58
+ or if the API returns a non-success status code (i.e., 4xx or 5xx response),
59
+ a subclass of `APIError` will be thrown:
60
+
61
+ <!-- prettier-ignore -->
62
+ ```ts
63
+ const authResponse = await client.v1.auth
64
+ .login({ email: 'user@example.com', password: 'SecurePassword123!' })
65
+ .catch(async (err) => {
66
+ if (err instanceof Zoriapi.APIError) {
67
+ console.log(err.status); // 400
68
+ console.log(err.name); // BadRequestError
69
+ console.log(err.headers); // {server: 'nginx', ...}
70
+ } else {
71
+ throw err;
72
+ }
73
+ });
74
+ ```
75
+
76
+ Error codes are as follows:
77
+
78
+ | Status Code | Error Type |
79
+ | ----------- | -------------------------- |
80
+ | 400 | `BadRequestError` |
81
+ | 401 | `AuthenticationError` |
82
+ | 403 | `PermissionDeniedError` |
83
+ | 404 | `NotFoundError` |
84
+ | 422 | `UnprocessableEntityError` |
85
+ | 429 | `RateLimitError` |
86
+ | >=500 | `InternalServerError` |
87
+ | N/A | `APIConnectionError` |
88
+
89
+ ### Retries
90
+
91
+ Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
92
+ Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
93
+ 429 Rate Limit, and >=500 Internal errors will all be retried by default.
94
+
95
+ You can use the `maxRetries` option to configure or disable this:
96
+
97
+ <!-- prettier-ignore -->
98
+ ```js
99
+ // Configure the default for all requests:
100
+ const client = new Zoriapi({
101
+ maxRetries: 0, // default is 2
102
+ });
103
+
104
+ // Or, configure per-request:
105
+ await client.v1.auth.login({ email: 'user@example.com', password: 'SecurePassword123!' }, {
106
+ maxRetries: 5,
107
+ });
108
+ ```
109
+
110
+ ### Timeouts
111
+
112
+ Requests time out after 1 minute by default. You can configure this with a `timeout` option:
113
+
114
+ <!-- prettier-ignore -->
115
+ ```ts
116
+ // Configure the default for all requests:
117
+ const client = new Zoriapi({
118
+ timeout: 20 * 1000, // 20 seconds (default is 1 minute)
119
+ });
120
+
121
+ // Override per-request:
122
+ await client.v1.auth.login({ email: 'user@example.com', password: 'SecurePassword123!' }, {
123
+ timeout: 5 * 1000,
124
+ });
125
+ ```
126
+
127
+ On timeout, an `APIConnectionTimeoutError` is thrown.
128
+
129
+ Note that requests which time out will be [retried twice by default](#retries).
130
+
131
+ ## Advanced Usage
132
+
133
+ ### Accessing raw Response data (e.g., headers)
134
+
135
+ The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
136
+ This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
137
+
138
+ You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
139
+ Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
140
+
141
+ <!-- prettier-ignore -->
142
+ ```ts
143
+ const client = new Zoriapi();
144
+
145
+ const response = await client.v1.auth
146
+ .login({ email: 'user@example.com', password: 'SecurePassword123!' })
147
+ .asResponse();
148
+ console.log(response.headers.get('X-My-Header'));
149
+ console.log(response.statusText); // access the underlying Response object
150
+
151
+ const { data: authResponse, response: raw } = await client.v1.auth
152
+ .login({ email: 'user@example.com', password: 'SecurePassword123!' })
153
+ .withResponse();
154
+ console.log(raw.headers.get('X-My-Header'));
155
+ console.log(authResponse.access_token);
156
+ ```
157
+
158
+ ### Logging
159
+
160
+ > [!IMPORTANT]
161
+ > All log messages are intended for debugging only. The format and content of log messages
162
+ > may change between releases.
163
+
164
+ #### Log levels
165
+
166
+ The log level can be configured in two ways:
167
+
168
+ 1. Via the `ZORIAPI_LOG` environment variable
169
+ 2. Using the `logLevel` client option (overrides the environment variable if set)
170
+
171
+ ```ts
172
+ import Zoriapi from 'zorihq';
173
+
174
+ const client = new Zoriapi({
175
+ logLevel: 'debug', // Show all log messages
176
+ });
177
+ ```
178
+
179
+ Available log levels, from most to least verbose:
180
+
181
+ - `'debug'` - Show debug messages, info, warnings, and errors
182
+ - `'info'` - Show info messages, warnings, and errors
183
+ - `'warn'` - Show warnings and errors (default)
184
+ - `'error'` - Show only errors
185
+ - `'off'` - Disable all logging
186
+
187
+ At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.
188
+ Some authentication-related headers are redacted, but sensitive data in request and response bodies
189
+ may still be visible.
190
+
191
+ #### Custom logger
192
+
193
+ By default, this library logs to `globalThis.console`. You can also provide a custom logger.
194
+ Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
195
+
196
+ When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages
197
+ below the configured level will not be sent to your logger.
198
+
199
+ ```ts
200
+ import Zoriapi from 'zorihq';
201
+ import pino from 'pino';
202
+
203
+ const logger = pino();
204
+
205
+ const client = new Zoriapi({
206
+ logger: logger.child({ name: 'Zoriapi' }),
207
+ logLevel: 'debug', // Send all messages to pino, allowing it to filter
208
+ });
209
+ ```
210
+
211
+ ### Making custom/undocumented requests
212
+
213
+ This library is typed for convenient access to the documented API. If you need to access undocumented
214
+ endpoints, params, or response properties, the library can still be used.
215
+
216
+ #### Undocumented endpoints
217
+
218
+ To make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.
219
+ Options on the client, such as retries, will be respected when making these requests.
220
+
221
+ ```ts
222
+ await client.post('/some/path', {
223
+ body: { some_prop: 'foo' },
224
+ query: { some_query_arg: 'bar' },
225
+ });
226
+ ```
227
+
228
+ #### Undocumented request params
229
+
230
+ To make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented
231
+ parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you
232
+ send will be sent as-is.
233
+
234
+ ```ts
235
+ client.v1.auth.login({
236
+ // ...
237
+ // @ts-expect-error baz is not yet public
238
+ baz: 'undocumented option',
239
+ });
240
+ ```
241
+
242
+ For requests with the `GET` verb, any extra params will be in the query, all other requests will send the
243
+ extra param in the body.
244
+
245
+ If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request
246
+ options.
247
+
248
+ #### Undocumented response properties
249
+
250
+ To access undocumented response properties, you may access the response object with `// @ts-expect-error` on
251
+ the response object, or cast the response object to the requisite type. Like the request params, we do not
252
+ validate or strip extra properties from the response from the API.
253
+
254
+ ### Customizing the fetch client
255
+
256
+ By default, this library expects a global `fetch` function is defined.
257
+
258
+ If you want to use a different `fetch` function, you can either polyfill the global:
259
+
260
+ ```ts
261
+ import fetch from 'my-fetch';
262
+
263
+ globalThis.fetch = fetch;
264
+ ```
265
+
266
+ Or pass it to the client:
267
+
268
+ ```ts
269
+ import Zoriapi from 'zorihq';
270
+ import fetch from 'my-fetch';
271
+
272
+ const client = new Zoriapi({ fetch });
273
+ ```
274
+
275
+ ### Fetch options
276
+
277
+ If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
278
+
279
+ ```ts
280
+ import Zoriapi from 'zorihq';
281
+
282
+ const client = new Zoriapi({
283
+ fetchOptions: {
284
+ // `RequestInit` options
285
+ },
286
+ });
287
+ ```
288
+
289
+ #### Configuring proxies
290
+
291
+ To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy
292
+ options to requests:
293
+
294
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
295
+
296
+ ```ts
297
+ import Zoriapi from 'zorihq';
298
+ import * as undici from 'undici';
299
+
300
+ const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
301
+ const client = new Zoriapi({
302
+ fetchOptions: {
303
+ dispatcher: proxyAgent,
304
+ },
305
+ });
306
+ ```
307
+
308
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
309
+
310
+ ```ts
311
+ import Zoriapi from 'zorihq';
312
+
313
+ const client = new Zoriapi({
314
+ fetchOptions: {
315
+ proxy: 'http://localhost:8888',
316
+ },
317
+ });
318
+ ```
319
+
320
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
321
+
322
+ ```ts
323
+ import Zoriapi from 'npm:zorihq';
324
+
325
+ const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
326
+ const client = new Zoriapi({
327
+ fetchOptions: {
328
+ client: httpClient,
329
+ },
330
+ });
331
+ ```
332
+
333
+ ## Frequently Asked Questions
334
+
335
+ ## Semantic versioning
336
+
337
+ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
338
+
339
+ 1. Changes that only affect static types, without breaking runtime behavior.
340
+ 2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
341
+ 3. Changes that we do not expect to impact the vast majority of users in practice.
342
+
343
+ We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
344
+
345
+ We are keen for your feedback; please open an [issue](https://www.github.com/ZoriHQ/typescript-api-sdk/issues) with questions, bugs, or suggestions.
346
+
347
+ ## Requirements
348
+
349
+ TypeScript >= 4.9 is supported.
350
+
351
+ The following runtimes are supported:
352
+
353
+ - Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
354
+ - Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
355
+ - Deno v1.28.0 or higher.
356
+ - Bun 1.0 or later.
357
+ - Cloudflare Workers.
358
+ - Vercel Edge Runtime.
359
+ - Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
360
+ - Nitro v2.6 or greater.
361
+
362
+ Note that React Native is not supported at this time.
363
+
364
+ If you are interested in other runtime environments, please open or upvote an issue on GitHub.
365
+
366
+ ## Contributing
367
+
368
+ See [the contributing documentation](./CONTRIBUTING.md).
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.mjs";
2
+ //# sourceMappingURL=api-promise.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.d.mts","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.js";
2
+ //# sourceMappingURL=api-promise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.d.ts","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
package/api-promise.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("./internal/tslib.js");
4
+ /** @deprecated Import from ./core/api-promise instead */
5
+ tslib_1.__exportStar(require("./core/api-promise.js"), exports);
6
+ //# sourceMappingURL=api-promise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.js","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,gEAAmC"}
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.mjs";
2
+ //# sourceMappingURL=api-promise.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.mjs","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}