@robot-admin/request-core 0.2.0 → 0.4.1

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 (59) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/LICENSE +21 -0
  3. package/README.md +248 -357
  4. package/SECURITY.md +14 -0
  5. package/dist/axios.cjs +134 -809
  6. package/dist/axios.cjs.map +1 -1
  7. package/dist/axios.d.cts +55 -220
  8. package/dist/axios.d.ts +55 -220
  9. package/dist/axios.js +2 -790
  10. package/dist/axios.js.map +1 -1
  11. package/dist/chunk-2JXH7SIL.js +711 -0
  12. package/dist/chunk-2JXH7SIL.js.map +1 -0
  13. package/dist/chunk-56QOEWUS.js +8 -0
  14. package/dist/chunk-56QOEWUS.js.map +1 -0
  15. package/dist/chunk-DUP3Y4DN.js +320 -0
  16. package/dist/chunk-DUP3Y4DN.js.map +1 -0
  17. package/dist/chunk-JGFRUAZT.cjs +1007 -0
  18. package/dist/chunk-JGFRUAZT.cjs.map +1 -0
  19. package/dist/chunk-KHI6XQRN.cjs +717 -0
  20. package/dist/chunk-KHI6XQRN.cjs.map +1 -0
  21. package/dist/chunk-OAZ5BUBU.js +969 -0
  22. package/dist/chunk-OAZ5BUBU.js.map +1 -0
  23. package/dist/chunk-QSDNDTOZ.js +28 -0
  24. package/dist/chunk-QSDNDTOZ.js.map +1 -0
  25. package/dist/chunk-UHXBAFY6.cjs +323 -0
  26. package/dist/chunk-UHXBAFY6.cjs.map +1 -0
  27. package/dist/chunk-WUZ43MLM.cjs +30 -0
  28. package/dist/chunk-WUZ43MLM.cjs.map +1 -0
  29. package/dist/chunk-WXHQXPS4.cjs +10 -0
  30. package/dist/chunk-WXHQXPS4.cjs.map +1 -0
  31. package/dist/crud.cjs +12 -484
  32. package/dist/crud.cjs.map +1 -1
  33. package/dist/crud.d.cts +8 -269
  34. package/dist/crud.d.ts +8 -269
  35. package/dist/crud.js +4 -487
  36. package/dist/crud.js.map +1 -1
  37. package/dist/index.cjs +136 -1302
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +7 -165
  40. package/dist/index.d.ts +7 -165
  41. package/dist/index.js +5 -1283
  42. package/dist/index.js.map +1 -1
  43. package/dist/naive.cjs +14 -0
  44. package/dist/naive.cjs.map +1 -0
  45. package/dist/naive.d.cts +9 -0
  46. package/dist/naive.d.ts +9 -0
  47. package/dist/naive.js +5 -0
  48. package/dist/naive.js.map +1 -0
  49. package/dist/types-BRDRqYFs.d.cts +197 -0
  50. package/dist/types-BVJhlSuh.d.cts +310 -0
  51. package/dist/types-BVJhlSuh.d.ts +310 -0
  52. package/dist/types-CUyibJZX.d.ts +197 -0
  53. package/dist/vue.cjs +93 -0
  54. package/dist/vue.cjs.map +1 -0
  55. package/dist/vue.d.cts +38 -0
  56. package/dist/vue.d.ts +38 -0
  57. package/dist/vue.js +71 -0
  58. package/dist/vue.js.map +1 -0
  59. package/package.json +60 -16
package/CHANGELOG.md ADDED
@@ -0,0 +1,109 @@
1
+ # @robot-admin/request-core
2
+
3
+ > `0.4.0` is the cumulative feature release. The `0.2.1` and `0.3.0` sections
4
+ > below record the internal implementation milestones folded into it; they were
5
+ > not published as separate package versions.
6
+
7
+ ## 0.4.1
8
+
9
+ ### Patch Changes
10
+
11
+ - Clarify the cumulative release history after the formal `0.4.0` publication.
12
+ - Keep package and repository version references aligned; runtime behavior is unchanged.
13
+
14
+ ## 0.4.0
15
+
16
+ ### Minor Changes
17
+
18
+ - Add a UI-independent Vue entry with `useRequest`, Client injection and a headless
19
+ `useTableCrud` supporting typed function handlers, filters, sorting and lifecycle
20
+ cancellation.
21
+ - Add independent initial/loading/refreshing/create/update/remove state and latest-wins
22
+ protection so stale list responses cannot overwrite current data.
23
+ - Prevent canceled/reset `useRequest` executions from committing stale results and
24
+ isolate lifecycle callback failures from real request outcomes.
25
+ - Add bounded batch deletion, configurable refresh-after-mutation, `createDraft`,
26
+ search/reset/sort methods and consistent RequestError state.
27
+ - Keep local rows and totals consistent when delete refresh is disabled, and isolate
28
+ presentation adapter failures from mutation results.
29
+ - Add `/naive` as a thin Message/Dialog compatibility adapter while retaining the root
30
+ and `/crud` APIs for existing applications.
31
+ - Rewrite the package and CRUD documentation so every documented API matches the
32
+ implementation and add a migration guide from 0.2.x.
33
+
34
+ ## 0.3.0
35
+
36
+ ### Minor Changes
37
+
38
+ - Add `createRequestClient()` with an isolated Axios runtime, flat typed methods,
39
+ global policy defaults and explicit default-client opt-in.
40
+ - Add `join`, `takeLatest`, `takeFirst` and `allow` concurrency policies, request scopes,
41
+ cache controllers and lifecycle disposal.
42
+ - Add single-flight proactive refresh, concurrent 401 recovery and reauthentication
43
+ hooks with one-replay protection.
44
+ - Add `RequestError`, business response adapters, raw responses and observational
45
+ request hooks.
46
+ - Extend retry with `Retry-After`, maximum delay, elapsed-time budgets, lifecycle hooks
47
+ and unsafe-body protection.
48
+
49
+ ## 0.2.1
50
+
51
+ ### Patch Changes
52
+
53
+ - Scope cache, dedupe, cancellation and re-login state to each Axios instance, fixing
54
+ cross-backend and cross-tenant contamination.
55
+ - Share the selected default instance across root, ESM/CJS and subpath bundles and fix
56
+ the previously unusable standalone `/crud` path.
57
+ - Include baseURL and response type in request keys, fingerprint identity headers and
58
+ protect cached values from consumer mutation.
59
+ - Register error-only request/response interceptors, make global RegExp cancellation
60
+ whitelists deterministic and restrict implicit dedupe to safe methods.
61
+ - Correct direct-array CRUD extraction, null success checks and zero total parsing.
62
+ - Add package validation, LICENSE, SECURITY policy and regression coverage.
63
+
64
+ ## 0.2.0
65
+
66
+ ### Minor Changes
67
+
68
+ - Share one AbortController across caller signals, dedupe and route cancellation, and fix stale-request cleanup races.
69
+ - Retry only idempotent HTTP methods by default, add configurable method allowlists and ±25% jitter, and make backoff cancellation leak-free.
70
+ - Include authorization, tenant and user headers in default cache/dedupe keys to prevent cross-identity reuse.
71
+ - Implement shared re-login promises with explicit success/cancel settlement for concurrent 401 responses.
72
+ - Add `@robot-admin/request-core/axios` and `/crud` subpath exports, and make Axios a peer dependency to avoid duplicate-instance cancellation issues.
73
+ - Add regression tests for cancellation, concurrency, retry safety, cache identity and re-login coordination.
74
+
75
+ ## 0.1.3
76
+
77
+ ### Patch Changes
78
+
79
+ - 更新 README 文档:
80
+ - 优化文档结构,更清晰直观
81
+ - 添加 30 秒快速上手指南
82
+ - 使用表格展示所有 API 和配置
83
+ - 添加完整示例和最佳实践
84
+
85
+ ## 0.1.2
86
+
87
+ ### Patch Changes
88
+
89
+ - Initial release of @robot-admin/request-core
90
+
91
+ Features:
92
+
93
+ - Axios wrapper with 7 built-in plugins (cache, retry, dedupe, cancel, request, response, reLogin)
94
+ - useTableCrud composable for table CRUD operations
95
+ - Full TypeScript support
96
+ - Vue 3 and Naive UI integration
97
+
98
+ ## 0.1.1
99
+
100
+ ### Patch Changes
101
+
102
+ - Initial release of @robot-admin/request-core
103
+
104
+ Features:
105
+
106
+ - Axios wrapper with 7 built-in plugins (cache, retry, dedupe, cancel, request, response, reLogin)
107
+ - useTableCrud composable for table CRUD operations
108
+ - Full TypeScript support
109
+ - Vue 3 and Naive UI integration
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CHENY
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.