@snail-js/api 0.1.27 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +125 -605
  3. package/dist/adapter/plain.d.ts +12 -0
  4. package/dist/adapter/plain.d.ts.map +1 -0
  5. package/dist/adapter/react.d.ts +14 -0
  6. package/dist/adapter/react.d.ts.map +1 -0
  7. package/dist/adapter/registry.d.ts +16 -0
  8. package/dist/adapter/registry.d.ts.map +1 -0
  9. package/dist/adapter/vue.d.ts +15 -0
  10. package/dist/adapter/vue.d.ts.map +1 -0
  11. package/dist/chunks/custom-UchOSg_s.js +466 -0
  12. package/dist/chunks/custom-UchOSg_s.js.map +1 -0
  13. package/dist/chunks/download-lBC7oOTT.js +160 -0
  14. package/dist/chunks/download-lBC7oOTT.js.map +1 -0
  15. package/dist/chunks/object-Ct0w-h4i.js +74 -0
  16. package/dist/chunks/object-Ct0w-h4i.js.map +1 -0
  17. package/dist/chunks/plugin-D3RDffDG.js +742 -0
  18. package/dist/chunks/plugin-D3RDffDG.js.map +1 -0
  19. package/dist/chunks/react-C1em-gxy.js +62 -0
  20. package/dist/chunks/react-C1em-gxy.js.map +1 -0
  21. package/dist/chunks/request-qeRhihEF.js +40 -0
  22. package/dist/chunks/request-qeRhihEF.js.map +1 -0
  23. package/dist/chunks/response-D-ubkAFl.js +127 -0
  24. package/dist/chunks/response-D-ubkAFl.js.map +1 -0
  25. package/dist/chunks/use-download-FAjtdJ58.js +1816 -0
  26. package/dist/chunks/use-download-FAjtdJ58.js.map +1 -0
  27. package/dist/chunks/vue-Dd9EhkQ3.js +34 -0
  28. package/dist/chunks/vue-Dd9EhkQ3.js.map +1 -0
  29. package/dist/core/args.d.ts +54 -0
  30. package/dist/core/args.d.ts.map +1 -0
  31. package/dist/core/connection.d.ts +15 -0
  32. package/dist/core/connection.d.ts.map +1 -0
  33. package/dist/core/context.d.ts +124 -0
  34. package/dist/core/context.d.ts.map +1 -0
  35. package/dist/core/http-stream.d.ts +28 -0
  36. package/dist/core/http-stream.d.ts.map +1 -0
  37. package/dist/core/logger.d.ts +22 -0
  38. package/dist/core/logger.d.ts.map +1 -0
  39. package/dist/core/metadata.d.ts +92 -0
  40. package/dist/core/metadata.d.ts.map +1 -0
  41. package/dist/core/metadata.keys.d.ts +41 -0
  42. package/dist/core/metadata.keys.d.ts.map +1 -0
  43. package/dist/core/method.d.ts +177 -0
  44. package/dist/core/method.d.ts.map +1 -0
  45. package/dist/core/plugin-manager.d.ts +106 -0
  46. package/dist/core/plugin-manager.d.ts.map +1 -0
  47. package/dist/core/plugin.d.ts +113 -0
  48. package/dist/core/plugin.d.ts.map +1 -0
  49. package/dist/core/reconnect.d.ts +22 -0
  50. package/dist/core/reconnect.d.ts.map +1 -0
  51. package/dist/core/resolve-stream.d.ts +45 -0
  52. package/dist/core/resolve-stream.d.ts.map +1 -0
  53. package/dist/core/resolve.d.ts +50 -0
  54. package/dist/core/resolve.d.ts.map +1 -0
  55. package/dist/core/response.d.ts +60 -0
  56. package/dist/core/response.d.ts.map +1 -0
  57. package/dist/core/server.d.ts +132 -0
  58. package/dist/core/server.d.ts.map +1 -0
  59. package/dist/core/sse.d.ts +27 -0
  60. package/dist/core/sse.d.ts.map +1 -0
  61. package/dist/core/state-bag.d.ts +36 -0
  62. package/dist/core/state-bag.d.ts.map +1 -0
  63. package/dist/core/websocket.d.ts +29 -0
  64. package/dist/core/websocket.d.ts.map +1 -0
  65. package/dist/decorators/api.d.ts +24 -4
  66. package/dist/decorators/api.d.ts.map +1 -0
  67. package/dist/decorators/args.d.ts +77 -14
  68. package/dist/decorators/args.d.ts.map +1 -0
  69. package/dist/decorators/custom.d.ts +81 -0
  70. package/dist/decorators/custom.d.ts.map +1 -0
  71. package/dist/decorators/header.d.ts +22 -0
  72. package/dist/decorators/header.d.ts.map +1 -0
  73. package/dist/decorators/index.d.ts +17 -0
  74. package/dist/decorators/index.d.ts.map +1 -0
  75. package/dist/decorators/methods.d.ts +33 -0
  76. package/dist/decorators/methods.d.ts.map +1 -0
  77. package/dist/decorators/progress.d.ts +24 -6
  78. package/dist/decorators/progress.d.ts.map +1 -0
  79. package/dist/decorators/server.d.ts +28 -7
  80. package/dist/decorators/server.d.ts.map +1 -0
  81. package/dist/decorators/stream.d.ts +113 -0
  82. package/dist/decorators/stream.d.ts.map +1 -0
  83. package/dist/default/options.d.ts +19 -0
  84. package/dist/default/options.d.ts.map +1 -0
  85. package/dist/error/base.d.ts +20 -0
  86. package/dist/error/base.d.ts.map +1 -0
  87. package/dist/error/decorator.d.ts +14 -0
  88. package/dist/error/decorator.d.ts.map +1 -0
  89. package/dist/error/hook.d.ts +14 -0
  90. package/dist/error/hook.d.ts.map +1 -0
  91. package/dist/error/index.d.ts +8 -0
  92. package/dist/error/index.d.ts.map +1 -0
  93. package/dist/error/options.d.ts +12 -0
  94. package/dist/error/options.d.ts.map +1 -0
  95. package/dist/error/plugin.d.ts +11 -0
  96. package/dist/error/plugin.d.ts.map +1 -0
  97. package/dist/error/request.d.ts +29 -0
  98. package/dist/error/request.d.ts.map +1 -0
  99. package/dist/error/response.d.ts +36 -0
  100. package/dist/error/response.d.ts.map +1 -0
  101. package/dist/index.d.ts +56 -11
  102. package/dist/index.d.ts.map +1 -0
  103. package/dist/index.js +2034 -0
  104. package/dist/index.js.map +1 -0
  105. package/dist/locale/en.d.ts +5 -0
  106. package/dist/locale/en.d.ts.map +1 -0
  107. package/dist/locale/index.d.ts +57 -0
  108. package/dist/locale/index.d.ts.map +1 -0
  109. package/dist/locale/types.d.ts +11 -0
  110. package/dist/locale/types.d.ts.map +1 -0
  111. package/dist/locale/zh.d.ts +5 -0
  112. package/dist/locale/zh.d.ts.map +1 -0
  113. package/dist/plugins/cache/adapters/indexeddb.d.ts +52 -0
  114. package/dist/plugins/cache/adapters/indexeddb.d.ts.map +1 -0
  115. package/dist/plugins/cache/adapters/memory.d.ts +60 -0
  116. package/dist/plugins/cache/adapters/memory.d.ts.map +1 -0
  117. package/dist/plugins/cache/adapters/web-storage.d.ts +43 -0
  118. package/dist/plugins/cache/adapters/web-storage.d.ts.map +1 -0
  119. package/dist/plugins/cache/decorators.d.ts +62 -0
  120. package/dist/plugins/cache/decorators.d.ts.map +1 -0
  121. package/dist/plugins/cache/index.d.ts +41 -0
  122. package/dist/plugins/cache/index.d.ts.map +1 -0
  123. package/dist/plugins/cache/key.d.ts +48 -0
  124. package/dist/plugins/cache/key.d.ts.map +1 -0
  125. package/dist/plugins/cache/manager.d.ts +124 -0
  126. package/dist/plugins/cache/manager.d.ts.map +1 -0
  127. package/dist/plugins/cache/plugin.d.ts +64 -0
  128. package/dist/plugins/cache/plugin.d.ts.map +1 -0
  129. package/dist/plugins/cache/type.d.ts +116 -0
  130. package/dist/plugins/cache/type.d.ts.map +1 -0
  131. package/dist/plugins/index.d.ts +75 -0
  132. package/dist/plugins/index.d.ts.map +1 -0
  133. package/dist/plugins/index.js +2265 -0
  134. package/dist/plugins/index.js.map +1 -0
  135. package/dist/plugins/interceptor/decorators.d.ts +44 -0
  136. package/dist/plugins/interceptor/decorators.d.ts.map +1 -0
  137. package/dist/plugins/interceptor/index.d.ts +31 -0
  138. package/dist/plugins/interceptor/index.d.ts.map +1 -0
  139. package/dist/plugins/interceptor/manager.d.ts +27 -0
  140. package/dist/plugins/interceptor/manager.d.ts.map +1 -0
  141. package/dist/plugins/interceptor/plugin.d.ts +65 -0
  142. package/dist/plugins/interceptor/plugin.d.ts.map +1 -0
  143. package/dist/plugins/interceptor/type.d.ts +45 -0
  144. package/dist/plugins/interceptor/type.d.ts.map +1 -0
  145. package/dist/plugins/pool/index.d.ts +26 -0
  146. package/dist/plugins/pool/index.d.ts.map +1 -0
  147. package/dist/plugins/pool/plugin.d.ts +83 -0
  148. package/dist/plugins/pool/plugin.d.ts.map +1 -0
  149. package/dist/plugins/pool/scheduler.d.ts +153 -0
  150. package/dist/plugins/pool/scheduler.d.ts.map +1 -0
  151. package/dist/plugins/pool/type.d.ts +38 -0
  152. package/dist/plugins/pool/type.d.ts.map +1 -0
  153. package/dist/plugins/react/index.d.ts +20 -0
  154. package/dist/plugins/react/index.d.ts.map +1 -0
  155. package/dist/plugins/react/index.js +145 -0
  156. package/dist/plugins/react/index.js.map +1 -0
  157. package/dist/plugins/react/plugin.d.ts +33 -0
  158. package/dist/plugins/react/plugin.d.ts.map +1 -0
  159. package/dist/plugins/react/type.d.ts +32 -0
  160. package/dist/plugins/react/type.d.ts.map +1 -0
  161. package/dist/plugins/transform/decorators.d.ts +54 -0
  162. package/dist/plugins/transform/decorators.d.ts.map +1 -0
  163. package/dist/plugins/transform/hydrate.d.ts +47 -0
  164. package/dist/plugins/transform/hydrate.d.ts.map +1 -0
  165. package/dist/plugins/transform/index.d.ts +41 -0
  166. package/dist/plugins/transform/index.d.ts.map +1 -0
  167. package/dist/plugins/transform/plugin.d.ts +20 -0
  168. package/dist/plugins/transform/plugin.d.ts.map +1 -0
  169. package/dist/plugins/transform/type.d.ts +67 -0
  170. package/dist/plugins/transform/type.d.ts.map +1 -0
  171. package/dist/plugins/validate/decorators.d.ts +24 -0
  172. package/dist/plugins/validate/decorators.d.ts.map +1 -0
  173. package/dist/plugins/validate/index.d.ts +40 -0
  174. package/dist/plugins/validate/index.d.ts.map +1 -0
  175. package/dist/plugins/validate/plugin.d.ts +13 -0
  176. package/dist/plugins/validate/plugin.d.ts.map +1 -0
  177. package/dist/plugins/validate/type.d.ts +54 -0
  178. package/dist/plugins/validate/type.d.ts.map +1 -0
  179. package/dist/plugins/version/decorators.d.ts +22 -0
  180. package/dist/plugins/version/decorators.d.ts.map +1 -0
  181. package/dist/plugins/version/index.d.ts +23 -0
  182. package/dist/plugins/version/index.d.ts.map +1 -0
  183. package/dist/plugins/version/plugin.d.ts +13 -0
  184. package/dist/plugins/version/plugin.d.ts.map +1 -0
  185. package/dist/plugins/version/type.d.ts +47 -0
  186. package/dist/plugins/version/type.d.ts.map +1 -0
  187. package/dist/plugins/vue/index.d.ts +21 -0
  188. package/dist/plugins/vue/index.d.ts.map +1 -0
  189. package/dist/plugins/vue/index.js +114 -0
  190. package/dist/plugins/vue/index.js.map +1 -0
  191. package/dist/plugins/vue/plugin.d.ts +15 -0
  192. package/dist/plugins/vue/plugin.d.ts.map +1 -0
  193. package/dist/plugins/vue/type.d.ts +34 -0
  194. package/dist/plugins/vue/type.d.ts.map +1 -0
  195. package/dist/strategies/index.d.ts +2 -0
  196. package/dist/strategies/index.d.ts.map +1 -0
  197. package/dist/strategies/index.js +29 -0
  198. package/dist/strategies/index.js.map +1 -0
  199. package/dist/strategies/plain.d.ts +2 -0
  200. package/dist/strategies/plain.d.ts.map +1 -0
  201. package/dist/strategies/plain.js +23 -0
  202. package/dist/strategies/plain.js.map +1 -0
  203. package/dist/strategies/react.d.ts +2 -0
  204. package/dist/strategies/react.d.ts.map +1 -0
  205. package/dist/strategies/react.js +30 -0
  206. package/dist/strategies/react.js.map +1 -0
  207. package/dist/strategies/shared/adapter.d.ts +23 -0
  208. package/dist/strategies/shared/adapter.d.ts.map +1 -0
  209. package/dist/strategies/shared/dom.d.ts +53 -0
  210. package/dist/strategies/shared/dom.d.ts.map +1 -0
  211. package/dist/strategies/shared/error.d.ts +30 -0
  212. package/dist/strategies/shared/error.d.ts.map +1 -0
  213. package/dist/strategies/shared/method.d.ts +51 -0
  214. package/dist/strategies/shared/method.d.ts.map +1 -0
  215. package/dist/strategies/shared/public.d.ts +33 -0
  216. package/dist/strategies/shared/public.d.ts.map +1 -0
  217. package/dist/strategies/shared/queue.d.ts +30 -0
  218. package/dist/strategies/shared/queue.d.ts.map +1 -0
  219. package/dist/strategies/shared/retry.d.ts +51 -0
  220. package/dist/strategies/shared/retry.d.ts.map +1 -0
  221. package/dist/strategies/shared/state.d.ts +117 -0
  222. package/dist/strategies/shared/state.d.ts.map +1 -0
  223. package/dist/strategies/shared/timing.d.ts +53 -0
  224. package/dist/strategies/shared/timing.d.ts.map +1 -0
  225. package/dist/strategies/shared/watcher.d.ts +37 -0
  226. package/dist/strategies/shared/watcher.d.ts.map +1 -0
  227. package/dist/strategies/use-auto-request.d.ts +77 -0
  228. package/dist/strategies/use-auto-request.d.ts.map +1 -0
  229. package/dist/strategies/use-download.d.ts +103 -0
  230. package/dist/strategies/use-download.d.ts.map +1 -0
  231. package/dist/strategies/use-fetcher.d.ts +52 -0
  232. package/dist/strategies/use-fetcher.d.ts.map +1 -0
  233. package/dist/strategies/use-pagination.d.ts +101 -0
  234. package/dist/strategies/use-pagination.d.ts.map +1 -0
  235. package/dist/strategies/use-request.d.ts +50 -0
  236. package/dist/strategies/use-request.d.ts.map +1 -0
  237. package/dist/strategies/use-retriable-request.d.ts +46 -0
  238. package/dist/strategies/use-retriable-request.d.ts.map +1 -0
  239. package/dist/strategies/use-sse.d.ts +103 -0
  240. package/dist/strategies/use-sse.d.ts.map +1 -0
  241. package/dist/strategies/use-token-auth.d.ts +88 -0
  242. package/dist/strategies/use-token-auth.d.ts.map +1 -0
  243. package/dist/strategies/use-uploader.d.ts +88 -0
  244. package/dist/strategies/use-uploader.d.ts.map +1 -0
  245. package/dist/strategies/use-watcher.d.ts +69 -0
  246. package/dist/strategies/use-watcher.d.ts.map +1 -0
  247. package/dist/typings/adapter.d.ts +61 -0
  248. package/dist/typings/adapter.d.ts.map +1 -0
  249. package/dist/typings/api.d.ts +122 -0
  250. package/dist/typings/api.d.ts.map +1 -0
  251. package/dist/typings/args.d.ts +51 -0
  252. package/dist/typings/args.d.ts.map +1 -0
  253. package/dist/typings/index.d.ts +8 -12
  254. package/dist/typings/index.d.ts.map +1 -0
  255. package/dist/typings/meta.d.ts +44 -0
  256. package/dist/typings/meta.d.ts.map +1 -0
  257. package/dist/typings/plugin.d.ts +114 -0
  258. package/dist/typings/plugin.d.ts.map +1 -0
  259. package/dist/typings/response.d.ts +118 -0
  260. package/dist/typings/response.d.ts.map +1 -0
  261. package/dist/typings/server.d.ts +83 -0
  262. package/dist/typings/server.d.ts.map +1 -0
  263. package/dist/typings/stream.d.ts +150 -0
  264. package/dist/typings/stream.d.ts.map +1 -0
  265. package/dist/utils/download.d.ts +97 -0
  266. package/dist/utils/download.d.ts.map +1 -0
  267. package/dist/utils/emitter.d.ts +36 -0
  268. package/dist/utils/emitter.d.ts.map +1 -0
  269. package/dist/utils/index.d.ts +6 -1
  270. package/dist/utils/index.d.ts.map +1 -0
  271. package/dist/utils/is.d.ts +22 -0
  272. package/dist/utils/is.d.ts.map +1 -0
  273. package/dist/utils/object.d.ts +44 -0
  274. package/dist/utils/object.d.ts.map +1 -0
  275. package/dist/utils/url.d.ts +44 -0
  276. package/dist/utils/url.d.ts.map +1 -0
  277. package/package.json +90 -27
  278. package/README_EN.md +0 -607
  279. package/dist/cache/index.d.ts +0 -9
  280. package/dist/cache/indexDBCache.d.ts +0 -13
  281. package/dist/cache/localstorageCache.d.ts +0 -10
  282. package/dist/cache/memoryCache.d.ts +0 -11
  283. package/dist/core/index.d.ts +0 -4
  284. package/dist/core/snailApi.d.ts +0 -22
  285. package/dist/core/snailMethod.d.ts +0 -49
  286. package/dist/core/snailServer.d.ts +0 -35
  287. package/dist/core/snailSse.d.ts +0 -20
  288. package/dist/decorators/cache.d.ts +0 -15
  289. package/dist/decorators/method.d.ts +0 -38
  290. package/dist/decorators/sse.d.ts +0 -30
  291. package/dist/decorators/strategy.d.ts +0 -10
  292. package/dist/decorators/versioning.d.ts +0 -16
  293. package/dist/eventEmmit/index.d.ts +0 -1
  294. package/dist/eventEmmit/snail.event.d.ts +0 -10
  295. package/dist/snail-api.js +0 -4868
  296. package/dist/snail-api.umd.cjs +0 -4872
  297. package/dist/strategies/jwtStrategy.d.ts +0 -4
  298. package/dist/typings/api.option.d.ts +0 -10
  299. package/dist/typings/apiProxy.d.ts +0 -8
  300. package/dist/typings/cache.management.option.d.ts +0 -25
  301. package/dist/typings/cache.type.d.ts +0 -23
  302. package/dist/typings/content.type.d.ts +0 -5
  303. package/dist/typings/request.body.d.ts +0 -3
  304. package/dist/typings/response.data.d.ts +0 -13
  305. package/dist/typings/snail.event.d.ts +0 -6
  306. package/dist/typings/snail.method.d.ts +0 -14
  307. package/dist/typings/snail.option.d.ts +0 -16
  308. package/dist/typings/sse.d.ts +0 -15
  309. package/dist/typings/strategy.d.ts +0 -5
  310. package/dist/typings/versioning.option.d.ts +0 -30
  311. package/dist/utils/function.d.ts +0 -31
  312. package/dist/versioning/index.d.ts +0 -1
  313. package/dist/versioning/versioning.d.ts +0 -12
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Trigger a browser download from a URL, without ever holding the bytes.
3
+ *
4
+ * ## Why the library does not download for you
5
+ *
6
+ * The obvious design — `responseType: "blob"`, `await`, then an object URL — is
7
+ * wrong for anything but a small file. It forces the whole payload through
8
+ * JavaScript memory, so a 200 MB export becomes a 200 MB `Blob` plus a second copy
9
+ * when the object URL is created, with no progress reporting and no way to resume.
10
+ * On a slow connection the tab simply runs out of memory, and the user has no idea
11
+ * whether anything is happening.
12
+ *
13
+ * The design that scales is the one every large site already uses: the server
14
+ * mints a short-lived download URL, and the browser fetches it natively. That gives
15
+ * you a real progress bar in the browser's own download manager, resume support,
16
+ * streaming to disk instead of RAM, and a download that survives navigation. All
17
+ * this library does is ask for the URL and then click a link.
18
+ *
19
+ * ```ts
20
+ * @Api("/report")
21
+ * class ReportApi {
22
+ * /** Ask the server to prepare the export; it answers with a temp URL. *\/
23
+ * @Post("/export")
24
+ * create(@Data() query: ReportQuery): Promise<{ url: string; filename: string }> {
25
+ * return null!;
26
+ * }
27
+ * }
28
+ *
29
+ * const { url, filename } = (await reportApi.create(query).send()).data;
30
+ * triggerDownload(url, { filename });
31
+ * ```
32
+ *
33
+ * ## When you genuinely need the blob
34
+ *
35
+ * If the response must be transformed, or the backend cannot issue a URL, request
36
+ * `responseType: "blob"` and use {@link triggerBlobDownload} instead — it accepts
37
+ * an already-materialised `Blob` and takes care of revoking the object URL.
38
+ */
39
+ /** Options accepted by {@link triggerDownload}. */
40
+ export interface TriggerDownloadOptions {
41
+ /**
42
+ * Filename to suggest to the browser.
43
+ *
44
+ * A cross-origin `href` ignores this — the browser honours the server's
45
+ * `Content-Disposition` instead, because letting a page rename a cross-origin
46
+ * download would be a security problem. For a cross-origin file, make the server
47
+ * send the name in that header.
48
+ */
49
+ filename?: string;
50
+ /** Open in a new tab instead of downloading. Defaults to `false`. */
51
+ openInNewTab?: boolean;
52
+ /**
53
+ * Where to attach the temporary anchor.
54
+ *
55
+ * Needed only for the old Firefox behaviour where an anchor that was never in the
56
+ * document ignores `click()`. Defaults to `document.body`.
57
+ */
58
+ container?: HTMLElement;
59
+ /** `referrerpolicy` for the navigation. */
60
+ referrerPolicy?: string;
61
+ }
62
+ /** Result of a successful {@link triggerDownload}. */
63
+ export interface TriggerDownloadResult {
64
+ /** The URL that was navigated to. */
65
+ url: string;
66
+ /** The filename the browser was asked to use, when one was supplied. */
67
+ filename: string | undefined;
68
+ }
69
+ /**
70
+ * Navigate the browser to `url` as a download.
71
+ *
72
+ * Works for a same-origin path, a cross-origin absolute URL and a `blob:` object
73
+ * URL alike. Throws when there is no DOM, because silently doing nothing is the
74
+ * worst possible outcome for a function whose entire job is a side effect.
75
+ */
76
+ export declare function triggerDownload(url: string, options?: TriggerDownloadOptions): TriggerDownloadResult;
77
+ /**
78
+ * Download an in-memory `Blob` by handing the browser an object URL.
79
+ *
80
+ * Use this only when the bytes are already in hand. The object URL is revoked on
81
+ * the next macrotask rather than immediately: revoking it in the same tick races
82
+ * the navigation in Safari and Firefox, and the download silently never starts.
83
+ * The cost is a short-lived duplicate in memory, which is why {@link triggerDownload}
84
+ * remains the recommended path.
85
+ */
86
+ export declare function triggerBlobDownload(blob: Blob, options?: TriggerDownloadOptions): TriggerDownloadResult;
87
+ /**
88
+ * Build a filename from a `Content-Disposition` header.
89
+ *
90
+ * Servers send the header, not a JSON field, and parsing it is fiddlier than it
91
+ * looks: `filename*` (RFC 5987, percent-encoded UTF-8) wins over `filename`, which
92
+ * may itself be quoted. Returns `undefined` when the header is absent or names
93
+ * nothing, so a caller can fall back to its own default instead of writing a
94
+ * literal `"undefined"` to disk.
95
+ */
96
+ export declare function filenameFromDisposition(header: string | undefined): string | undefined;
97
+ //# sourceMappingURL=download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/utils/download.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,mDAAmD;AACnD,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,qEAAqE;IACrE,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,sDAAsD;AACtD,MAAM,WAAW,qBAAqB;IACpC,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IAEZ,wEAAwE;IACxE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,sBAA2B,GACnC,qBAAqB,CAuCvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,sBAA2B,GACnC,qBAAqB,CAcvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAqBtF"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Minimal typed event emitter.
3
+ *
4
+ * Used for the `SnailMethod` event surface (`onSuccess`, `onError`, …). It is
5
+ * deliberately tiny: no wildcard events, no `once`, no async scheduling.
6
+ */
7
+ export declare class Emitter<Events extends Record<string, unknown>> {
8
+ private readonly listeners;
9
+ /**
10
+ * Register a listener.
11
+ *
12
+ * @returns an unsubscribe function — the ergonomic alternative to keeping a
13
+ * reference around just to call {@link off}.
14
+ */
15
+ on<K extends keyof Events>(type: K, listener: (payload: Events[K]) => void): () => void;
16
+ /** Remove a previously registered listener. */
17
+ off<K extends keyof Events>(type: K, listener: (payload: Events[K]) => void): void;
18
+ /** Number of listeners registered for `type`. */
19
+ count<K extends keyof Events>(type: K): number;
20
+ /**
21
+ * Invoke every listener for `type`.
22
+ *
23
+ * A throwing listener must not derail the request lifecycle: the promise from
24
+ * `send()` has already settled correctly, and one broken UI callback has no
25
+ * business turning a successful request into a failure. The other listeners for
26
+ * the same event still run.
27
+ *
28
+ * The error is therefore *reported*, not rethrown. Rethrowing from a microtask
29
+ * was the obvious alternative and is wrong: in Node it becomes an uncaught
30
+ * exception, so a throwing toast handler could take the process down.
31
+ */
32
+ emit<K extends keyof Events>(type: K, payload: Events[K]): void;
33
+ /** Drop every listener, optionally only for one event type. */
34
+ clear<K extends keyof Events>(type?: K): void;
35
+ }
36
+ //# sourceMappingURL=emitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/utils/emitter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,OAAO,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAwD;IAElF;;;;;OAKG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,MAAM,EACvB,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,GACrC,MAAM,IAAI,CAQZ;IAED,+CAA+C;IAC/C,GAAG,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAEjF;IAED,iDAAiD;IACjD,KAAK,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CAE7C;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAW9D;IAED,+DAA+D;IAC/D,KAAK,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAM5C;CACF"}
@@ -1 +1,6 @@
1
- export * from './function';
1
+ export { Emitter } from "./emitter.js";
2
+ export { filenameFromDisposition, triggerBlobDownload, triggerDownload, type TriggerDownloadOptions, type TriggerDownloadResult } from "./download.js";
3
+ export { isBinaryBody, isBrowser, isDefined, isFunction, isObject, isPlainObject, isPromise } from "./is.js";
4
+ export { deepMerge, deferred, noop, omit, omitUndefined, pick, resolveValue, tryCatch, type DeepPartial } from "./object.js";
5
+ export { buildRequestURL, capitalize, isAbsoluteURL, joinURL, pathParamNames, replacePathParams, shortHash, stableStringify, stripQuery } from "./url.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACV,MAAM,MAAM,CAAC;AACd,OAAO,EACL,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,eAAe,EACf,UAAU,EACV,aAAa,EACb,OAAO,EACP,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,UAAU,EACX,MAAM,OAAO,CAAC"}
@@ -0,0 +1,22 @@
1
+ /** Runtime type predicates shared across the library. */
2
+ /** `true` for a non-null object (including arrays, dates, class instances). */
3
+ export declare function isObject(value: unknown): value is Record<string, unknown>;
4
+ /**
5
+ * `true` for a plain object literal — not an array, `Date`, `Map`, `FormData`,
6
+ * `Blob`, class instance, and so on.
7
+ *
8
+ * Used to decide whether a `@Query()` / `@Data()` argument should be spread
9
+ * into the outgoing payload.
10
+ */
11
+ export declare function isPlainObject(value: unknown): value is Record<string, any>;
12
+ /** `true` for a callable value. */
13
+ export declare function isFunction(value: unknown): value is (...args: any[]) => any;
14
+ /** `true` for a thenable. */
15
+ export declare function isPromise<T = unknown>(value: unknown): value is Promise<T>;
16
+ /** `true` when `value` is neither `null` nor `undefined`. */
17
+ export declare function isDefined<T>(value: T | null | undefined): value is T;
18
+ /** `true` when a `Response`-like body should be passed through untouched. */
19
+ export declare function isBinaryBody(value: unknown): boolean;
20
+ /** `true` when the code is executing in a DOM-capable browser. */
21
+ export declare function isBrowser(): boolean;
22
+ //# sourceMappingURL=is.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../src/utils/is.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,+EAA+E;AAC/E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAI1E;AAED,mCAAmC;AACnC,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAE3E;AAED,6BAA6B;AAC7B,wBAAgB,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,CAI1E;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,IAAI,CAAC,CAEpE;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOpD;AAED,kEAAkE;AAClE,wBAAgB,SAAS,IAAI,OAAO,CAEnC"}
@@ -0,0 +1,44 @@
1
+ /** Return a copy of `source` without the listed keys. */
2
+ export declare function omit<T extends Record<string, any>, K extends keyof T>(source: T, keys: readonly K[]): Omit<T, K>;
3
+ /** Return a copy of `source` containing only the listed keys. */
4
+ export declare function pick<T extends Record<string, any>, K extends keyof T>(source: T, keys: readonly K[]): Pick<T, K>;
5
+ /** Drop keys whose value is `undefined`. `null` is preserved deliberately. */
6
+ export declare function omitUndefined<T extends Record<string, any>>(source: T): T;
7
+ /** A deeply optional version of `T`, for merge inputs. */
8
+ export type DeepPartial<T> = {
9
+ [K in keyof T]?: T[K] extends readonly unknown[] ? T[K] : T[K] extends object ? DeepPartial<T[K]> : T[K];
10
+ };
11
+ /**
12
+ * Recursively merge plain objects.
13
+ *
14
+ * Accepts **deeply partial** sources, so
15
+ * `deepMerge({ a: { b: 1, c: 2 } }, { a: { c: 3 } })` type-checks without a cast —
16
+ * which is the whole point of overriding one nested default.
17
+ *
18
+ * Arrays are replaced, not concatenated: concatenating them would make it
19
+ * impossible for a method-level option to override a server-level list.
20
+ */
21
+ export declare function deepMerge<T extends Record<string, any>>(...sources: Array<DeepPartial<T> | undefined | null>): T;
22
+ /**
23
+ * Resolve a possibly-functional option value.
24
+ *
25
+ * Options such as `@Header(...)` often need values computed per request, so most
26
+ * option fields accept `T | ((ctx) => T)`.
27
+ */
28
+ export declare function resolveValue<T, A>(value: T | ((arg: A) => T), arg: A): T;
29
+ /** Run `fn`, returning `fallback` if it throws. */
30
+ export declare function tryCatch<T>(fn: () => T, fallback: T): T;
31
+ /**
32
+ * Create a promise together with its resolve/reject handles.
33
+ *
34
+ * Used by strategies to hand a "ready" promise out before the underlying
35
+ * request is actually started.
36
+ */
37
+ export declare function deferred<T = void>(): {
38
+ promise: Promise<T>;
39
+ resolve: (value: T | PromiseLike<T>) => void;
40
+ reject: (reason?: unknown) => void;
41
+ };
42
+ /** A function that does nothing — used as a default callback. */
43
+ export declare function noop(): void;
44
+ //# sourceMappingURL=object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"AAEA,yDAAyD;AACzD,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EACnE,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,SAAS,CAAC,EAAE,GACjB,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAIZ;AAED,iEAAiE;AACjE,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EACnE,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,SAAS,CAAC,EAAE,GACjB,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAMZ;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAMzE;AAED,0DAA0D;AAC1D,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,GAC5C,CAAC,CAAC,CAAC,CAAC,GACJ,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GACjB,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACjB,CAAC,CAAC,CAAC,CAAC;CACX,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACrD,GAAG,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,GACnD,CAAC,CAgBH;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAExE;AAED,mDAAmD;AACnD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAMvD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,GAAG,IAAI,KAAK;IACpC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC7C,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,CAQA;AAED,iEAAiE;AACjE,wBAAgB,IAAI,IAAI,IAAI,CAE3B"}
@@ -0,0 +1,44 @@
1
+ /** Uppercase the first character, leaving the rest untouched. */
2
+ export declare function capitalize(value: string): string;
3
+ /** `true` when the url carries its own scheme or protocol-relative prefix. */
4
+ export declare function isAbsoluteURL(url: string): boolean;
5
+ /**
6
+ * Join url segments into one path, normalising the slashes between them.
7
+ *
8
+ * An absolute `segment` wins outright, matching axios' `baseURL` semantics.
9
+ *
10
+ * ```ts
11
+ * joinURL("/api/", "/user/", "/list") // "/api/user/list"
12
+ * joinURL("/api", "https://cdn.x/y") // "https://cdn.x/y"
13
+ * ```
14
+ */
15
+ export declare function joinURL(...segments: Array<string | undefined | null>): string;
16
+ /** Names of every `:placeholder` present in a route template. */
17
+ export declare function pathParamNames(route: string): string[];
18
+ /**
19
+ * Substitute `:placeholder` segments with values.
20
+ *
21
+ * Values are URL-encoded. A placeholder with no value throws, because silently
22
+ * leaving `:id` in a request path produces a confusing 404 far from the cause —
23
+ * the pre-rewrite code logged to `console.error` and then threw anyway.
24
+ */
25
+ export declare function replacePathParams(route: string, values: Record<string, unknown>, onMissing?: (name: string) => never): string;
26
+ /** Build a full url, appending absolute urls verbatim. */
27
+ export declare function buildRequestURL(baseURL: string, url: string): string;
28
+ /** Strip the query string and hash, for logging. */
29
+ export declare function stripQuery(url: string): string;
30
+ /**
31
+ * Deterministic, recursively stable JSON serialisation.
32
+ *
33
+ * Object keys are sorted so two logically identical payloads always produce the
34
+ * same string — essential for cache keys and for request de-duplication.
35
+ */
36
+ export declare function stableStringify(value: unknown): string;
37
+ /**
38
+ * 32-bit FNV-1a hash rendered as base36.
39
+ *
40
+ * Cheap, allocation-light and stable across runs — used to turn a long request
41
+ * signature into a compact in-memory cache key. It is *not* a security hash.
42
+ */
43
+ export declare function shortHash(input: string): string;
44
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElD;AAYD;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,MAAM,CAqB7E;AAKD,iEAAiE;AACjE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAMtD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,GAClC,MAAM,CASR;AAED,0DAA0D;AAC1D,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED,oDAAoD;AACpD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAqCtD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO/C"}
package/package.json CHANGED
@@ -1,39 +1,102 @@
1
1
  {
2
2
  "name": "@snail-js/api",
3
- "version": "0.1.27",
4
- "description": "Http Request with Decorators Api, build on axios",
5
- "type": "module",
6
- "main": "./src/index.ts",
7
- "exports": {
8
- ".": {
9
- "import": "./dist/snail-api.js",
10
- "require": "./dist/snail-api.umd.cjs",
11
- "types": "./dist/index.d.ts"
12
- }
13
- },
14
- "scripts": {
15
- "clean:dist": "rimraf ./dist",
16
- "build": "pnpm run clean:dist && vite build && pnpm run build:type",
17
- "build:type": "vue-tsc -p tsconfig.build.json --composite false --declaration --emitDeclarationOnly",
18
- "test": "echo \"Error: no test specified\" && exit 1"
19
- },
3
+ "version": "1.0.0",
4
+ "description": "Decorator-driven, plugin-first HTTP client built on axios. Nest.js-style decorators, an everything-is-a-plugin core and alova-style request strategies.",
20
5
  "keywords": [
21
- "Decorators",
6
+ "axios",
7
+ "decorators",
8
+ "request",
22
9
  "api",
23
- "Request",
24
- "axios"
10
+ "http",
11
+ "sse",
12
+ "websocket",
13
+ "typescript",
14
+ "vue",
15
+ "react"
25
16
  ],
26
- "author": "",
27
17
  "license": "MIT",
28
- "peerDependencies": {
29
- "axios": "^1.8.3"
18
+ "type": "module",
19
+ "sideEffects": [
20
+ "./dist/strategies/index.js",
21
+ "./dist/strategies/plain.js",
22
+ "./dist/strategies/react.js"
23
+ ],
24
+ "main": "./dist/index.js",
25
+ "module": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js"
31
+ },
32
+ "./plugins": {
33
+ "types": "./dist/plugins/index.d.ts",
34
+ "import": "./dist/plugins/index.js"
35
+ },
36
+ "./plugins/vue": {
37
+ "types": "./dist/plugins/vue/index.d.ts",
38
+ "import": "./dist/plugins/vue/index.js"
39
+ },
40
+ "./plugins/react": {
41
+ "types": "./dist/plugins/react/index.d.ts",
42
+ "import": "./dist/plugins/react/index.js"
43
+ },
44
+ "./strategies": {
45
+ "types": "./dist/strategies/index.d.ts",
46
+ "import": "./dist/strategies/index.js"
47
+ },
48
+ "./strategies/plain": {
49
+ "types": "./dist/strategies/plain.d.ts",
50
+ "import": "./dist/strategies/plain.js"
51
+ },
52
+ "./strategies/react": {
53
+ "types": "./dist/strategies/react.d.ts",
54
+ "import": "./dist/strategies/react.js"
55
+ },
56
+ "./package.json": "./package.json"
30
57
  },
31
58
  "files": [
59
+ "dist",
32
60
  "README.md",
33
- "README_EN.md",
34
- "dist"
61
+ "LICENSE"
35
62
  ],
36
- "dependencies": {
37
- "reflect-metadata": "^0.2.2"
63
+ "scripts": {
64
+ "build": "node ./scripts/build.mjs",
65
+ "build:types": "tsc -p tsconfig.build.json",
66
+ "typecheck": "tsc -p tsconfig.json --noEmit",
67
+ "test": "node ./scripts/vitest-runner.mjs run",
68
+ "test:watch": "node ./scripts/vitest-runner.mjs",
69
+ "test:cov": "node ./scripts/vitest-runner.mjs run --coverage",
70
+ "verify": "node ./scripts/verify-dist.mjs"
71
+ },
72
+ "peerDependencies": {
73
+ "axios": "^1.20.0",
74
+ "react": ">=18.0.0",
75
+ "vue": ">=3.4.0",
76
+ "zod": ">=3.23.0"
77
+ },
78
+ "peerDependenciesMeta": {
79
+ "react": {
80
+ "optional": true
81
+ },
82
+ "vue": {
83
+ "optional": true
84
+ },
85
+ "zod": {
86
+ "optional": true
87
+ }
88
+ },
89
+ "devDependencies": {
90
+ "@types/node": "24.10.1",
91
+ "@types/react": "19.2.6",
92
+ "@vitest/coverage-v8": "5.0.1",
93
+ "axios": "1.20.0",
94
+ "axios-mock-adapter": "2.1.0",
95
+ "react": "19.2.0",
96
+ "typescript": "7.0.2",
97
+ "vite": "8.3.0",
98
+ "vitest": "5.0.1",
99
+ "vue": "3.5.24",
100
+ "zod": "4.6.5"
38
101
  }
39
102
  }