@robot-admin/request-core 0.1.3 → 0.4.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 (59) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/LICENSE +21 -0
  3. package/README.md +346 -412
  4. package/SECURITY.md +14 -0
  5. package/dist/axios.cjs +141 -0
  6. package/dist/axios.cjs.map +1 -0
  7. package/dist/axios.d.cts +67 -0
  8. package/dist/axios.d.ts +67 -0
  9. package/dist/axios.js +4 -0
  10. package/dist/axios.js.map +1 -0
  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 +19 -0
  32. package/dist/crud.cjs.map +1 -0
  33. package/dist/crud.d.cts +10 -0
  34. package/dist/crud.d.ts +10 -0
  35. package/dist/crud.js +6 -0
  36. package/dist/crud.js.map +1 -0
  37. package/dist/index.cjs +136 -1122
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +7 -644
  40. package/dist/index.d.ts +7 -644
  41. package/dist/index.js +5 -1105
  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 +77 -14
package/SECURITY.md ADDED
@@ -0,0 +1,14 @@
1
+ # Security policy
2
+
3
+ Only the latest published minor version receives security fixes while the
4
+ package remains below 1.0. Please reproduce a suspected issue against that
5
+ version before reporting it.
6
+
7
+ Do not open a public issue for vulnerabilities or include production tokens,
8
+ cookies, request payloads, or customer data in a report. Use GitHub's private
9
+ security advisory flow for this repository and provide a minimal sanitized
10
+ reproduction, affected version, expected impact, and suggested mitigation.
11
+
12
+ Request caches are process-local by default. Applications must clear the
13
+ active client's cache and cancel pending requests when the authenticated
14
+ identity or tenant changes.
package/dist/axios.cjs ADDED
@@ -0,0 +1,141 @@
1
+ 'use strict';
2
+
3
+ var chunkUHXBAFY6_cjs = require('./chunk-UHXBAFY6.cjs');
4
+ var chunkJGFRUAZT_cjs = require('./chunk-JGFRUAZT.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "createRequestClient", {
9
+ enumerable: true,
10
+ get: function () { return chunkUHXBAFY6_cjs.createRequestClient; }
11
+ });
12
+ Object.defineProperty(exports, "setDefaultRequestClient", {
13
+ enumerable: true,
14
+ get: function () { return chunkUHXBAFY6_cjs.setDefaultRequestClient; }
15
+ });
16
+ Object.defineProperty(exports, "MemoryCache", {
17
+ enumerable: true,
18
+ get: function () { return chunkJGFRUAZT_cjs.MemoryCache; }
19
+ });
20
+ Object.defineProperty(exports, "RequestError", {
21
+ enumerable: true,
22
+ get: function () { return chunkJGFRUAZT_cjs.RequestError; }
23
+ });
24
+ Object.defineProperty(exports, "cancelAllPendingRequests", {
25
+ enumerable: true,
26
+ get: function () { return chunkJGFRUAZT_cjs.cancelAllPendingRequests; }
27
+ });
28
+ Object.defineProperty(exports, "cancelAllRequests", {
29
+ enumerable: true,
30
+ get: function () { return chunkJGFRUAZT_cjs.cancelAllRequests; }
31
+ });
32
+ Object.defineProperty(exports, "cancelRequestScope", {
33
+ enumerable: true,
34
+ get: function () { return chunkJGFRUAZT_cjs.cancelRequestScope; }
35
+ });
36
+ Object.defineProperty(exports, "cleanupExpiredCache", {
37
+ enumerable: true,
38
+ get: function () { return chunkJGFRUAZT_cjs.cleanupExpiredCache; }
39
+ });
40
+ Object.defineProperty(exports, "clearAllCache", {
41
+ enumerable: true,
42
+ get: function () { return chunkJGFRUAZT_cjs.clearAllCache; }
43
+ });
44
+ Object.defineProperty(exports, "clearCache", {
45
+ enumerable: true,
46
+ get: function () { return chunkJGFRUAZT_cjs.clearCache; }
47
+ });
48
+ Object.defineProperty(exports, "clearCacheByPrefix", {
49
+ enumerable: true,
50
+ get: function () { return chunkJGFRUAZT_cjs.clearCacheByPrefix; }
51
+ });
52
+ Object.defineProperty(exports, "clearCacheByTag", {
53
+ enumerable: true,
54
+ get: function () { return chunkJGFRUAZT_cjs.clearCacheByTag; }
55
+ });
56
+ Object.defineProperty(exports, "createAxiosInstance", {
57
+ enumerable: true,
58
+ get: function () { return chunkJGFRUAZT_cjs.createAxiosInstance; }
59
+ });
60
+ Object.defineProperty(exports, "createRequestCore", {
61
+ enumerable: true,
62
+ get: function () { return chunkJGFRUAZT_cjs.createRequestCore; }
63
+ });
64
+ Object.defineProperty(exports, "deleteData", {
65
+ enumerable: true,
66
+ get: function () { return chunkJGFRUAZT_cjs.deleteData; }
67
+ });
68
+ Object.defineProperty(exports, "generateRequestKey", {
69
+ enumerable: true,
70
+ get: function () { return chunkJGFRUAZT_cjs.generateRequestKey; }
71
+ });
72
+ Object.defineProperty(exports, "getCacheSize", {
73
+ enumerable: true,
74
+ get: function () { return chunkJGFRUAZT_cjs.getCacheSize; }
75
+ });
76
+ Object.defineProperty(exports, "getCancelableRequestCount", {
77
+ enumerable: true,
78
+ get: function () { return chunkJGFRUAZT_cjs.getCancelableRequestCount; }
79
+ });
80
+ Object.defineProperty(exports, "getData", {
81
+ enumerable: true,
82
+ get: function () { return chunkJGFRUAZT_cjs.getData; }
83
+ });
84
+ Object.defineProperty(exports, "getGlobalAxiosInstance", {
85
+ enumerable: true,
86
+ get: function () { return chunkJGFRUAZT_cjs.getGlobalAxiosInstance; }
87
+ });
88
+ Object.defineProperty(exports, "getGlobalConfig", {
89
+ enumerable: true,
90
+ get: function () { return chunkJGFRUAZT_cjs.getGlobalConfig; }
91
+ });
92
+ Object.defineProperty(exports, "getPendingRequestCount", {
93
+ enumerable: true,
94
+ get: function () { return chunkJGFRUAZT_cjs.getPendingRequestCount; }
95
+ });
96
+ Object.defineProperty(exports, "getReLoginPromise", {
97
+ enumerable: true,
98
+ get: function () { return chunkJGFRUAZT_cjs.getReLoginPromise; }
99
+ });
100
+ Object.defineProperty(exports, "isCanceledError", {
101
+ enumerable: true,
102
+ get: function () { return chunkJGFRUAZT_cjs.isCanceledError; }
103
+ });
104
+ Object.defineProperty(exports, "isRequestError", {
105
+ enumerable: true,
106
+ get: function () { return chunkJGFRUAZT_cjs.isRequestError; }
107
+ });
108
+ Object.defineProperty(exports, "normalizeRequestError", {
109
+ enumerable: true,
110
+ get: function () { return chunkJGFRUAZT_cjs.normalizeRequestError; }
111
+ });
112
+ Object.defineProperty(exports, "onReLoginCancel", {
113
+ enumerable: true,
114
+ get: function () { return chunkJGFRUAZT_cjs.onReLoginCancel; }
115
+ });
116
+ Object.defineProperty(exports, "onReLoginSuccess", {
117
+ enumerable: true,
118
+ get: function () { return chunkJGFRUAZT_cjs.onReLoginSuccess; }
119
+ });
120
+ Object.defineProperty(exports, "patchData", {
121
+ enumerable: true,
122
+ get: function () { return chunkJGFRUAZT_cjs.patchData; }
123
+ });
124
+ Object.defineProperty(exports, "postData", {
125
+ enumerable: true,
126
+ get: function () { return chunkJGFRUAZT_cjs.postData; }
127
+ });
128
+ Object.defineProperty(exports, "putData", {
129
+ enumerable: true,
130
+ get: function () { return chunkJGFRUAZT_cjs.putData; }
131
+ });
132
+ Object.defineProperty(exports, "setGlobalAxiosInstance", {
133
+ enumerable: true,
134
+ get: function () { return chunkJGFRUAZT_cjs.setGlobalAxiosInstance; }
135
+ });
136
+ Object.defineProperty(exports, "waitForReLogin", {
137
+ enumerable: true,
138
+ get: function () { return chunkJGFRUAZT_cjs.waitForReLogin; }
139
+ });
140
+ //# sourceMappingURL=axios.cjs.map
141
+ //# sourceMappingURL=axios.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"axios.cjs"}
@@ -0,0 +1,67 @@
1
+ import { AxiosInstance, AxiosRequestConfig } from 'axios';
2
+ import { b as CacheStore, o as RequestPolicyDefaults, e as EnhancedAxiosRequestConfig, p as RequestScope, E as EnhancedAxiosInstance, g as RequestClientConfig, f as RequestClient, M as MemoryCacheOptions, m as RequestKeyOptions } from './types-BVJhlSuh.cjs';
3
+ export { B as BusinessErrorDescriptor, C as CacheConfig, a as CacheItem, c as CancelConfig, d as ConcurrencyPolicy, D as DedupeConfig, F as FieldAliases, I as InterceptorConfig, R as RequestAuthConfig, h as RequestConfig, i as RequestCoreConfig, j as RequestError, k as RequestHooks, l as RequestInterceptors, n as RequestKeyParams, q as ResponseAdapter, r as RetryConfig, s as RetryContext, t as createRequestCore, u as getGlobalConfig, v as isCanceledError, w as isRequestError, x as normalizeRequestError } from './types-BVJhlSuh.cjs';
4
+ import 'vue';
5
+
6
+ interface CreateRequestRuntimeOptions {
7
+ cache?: CacheStore;
8
+ defaults?: RequestPolicyDefaults;
9
+ }
10
+
11
+ declare function setGlobalAxiosInstance(instance: AxiosInstance): void;
12
+ declare function getGlobalAxiosInstance(): AxiosInstance;
13
+ declare function getData<T = unknown>(url: string, config?: EnhancedAxiosRequestConfig): Promise<T>;
14
+ declare function postData<T = unknown, D = unknown>(url: string, data?: D, config?: EnhancedAxiosRequestConfig<D>): Promise<T>;
15
+ declare function putData<T = unknown, D = unknown>(url: string, data?: D, config?: EnhancedAxiosRequestConfig<D>): Promise<T>;
16
+ declare function patchData<T = unknown, D = unknown>(url: string, data?: D, config?: EnhancedAxiosRequestConfig<D>): Promise<T>;
17
+ declare function deleteData<T = unknown>(url: string, config?: EnhancedAxiosRequestConfig): Promise<T>;
18
+
19
+ declare function waitForReLogin(instance?: AxiosInstance): Promise<void>;
20
+ declare function getReLoginPromise(instance?: AxiosInstance): Promise<void> | null;
21
+
22
+ declare function cancelAllPendingRequests(instance?: AxiosInstance): void;
23
+ declare function getPendingRequestCount(instance?: AxiosInstance): number;
24
+
25
+ declare function clearAllCache(instance?: AxiosInstance): void;
26
+ declare function clearCache(config: AxiosRequestConfig, instance?: AxiosInstance): boolean;
27
+ declare function clearCacheByPrefix(prefix: string, instance?: AxiosInstance): number;
28
+ declare function clearCacheByTag(tag: string, instance?: AxiosInstance): number;
29
+ declare function cleanupExpiredCache(instance?: AxiosInstance): void;
30
+ declare function getCacheSize(instance?: AxiosInstance): number;
31
+
32
+ declare function cancelAllRequests(instance?: AxiosInstance): void;
33
+ declare function cancelRequestScope(scope: RequestScope, instance?: AxiosInstance): number;
34
+ declare function getCancelableRequestCount(instance?: AxiosInstance): number;
35
+
36
+ /** Creates an isolated Axios instance with request-core lifecycle policies. */
37
+ declare function createAxiosInstance(config?: AxiosRequestConfig, runtimeOptions?: CreateRequestRuntimeOptions): EnhancedAxiosInstance;
38
+
39
+ declare const onReLoginSuccess: (instance?: AxiosInstance) => void;
40
+ declare const onReLoginCancel: (instance?: AxiosInstance) => void;
41
+
42
+ declare function createRequestClient(config?: RequestClientConfig): RequestClient;
43
+ declare function setDefaultRequestClient(client: RequestClient): void;
44
+
45
+ declare function generateRequestKey(config: AxiosRequestConfig, options?: RequestKeyOptions): string;
46
+ declare class MemoryCache implements CacheStore {
47
+ private readonly cache;
48
+ private readonly accessOrder;
49
+ private maxSize;
50
+ private readonly cloneValue;
51
+ constructor(options?: MemoryCacheOptions);
52
+ get<T = unknown>(key: string): T | null;
53
+ set<T = unknown>(key: string, data: T, ttl: number, options?: {
54
+ tags?: readonly string[];
55
+ }): void;
56
+ delete(key: string): boolean;
57
+ clear(): void;
58
+ cleanup(): void;
59
+ deleteByPrefix(prefix: string): number;
60
+ deleteByTag(tag: string): number;
61
+ get size(): number;
62
+ setMaxSize(size: number): void;
63
+ private assertMaxSize;
64
+ private evictOldest;
65
+ }
66
+
67
+ export { CacheStore, EnhancedAxiosInstance, EnhancedAxiosRequestConfig, MemoryCache, MemoryCacheOptions, RequestClient, RequestClientConfig, RequestKeyOptions, RequestPolicyDefaults, RequestScope, cancelAllPendingRequests, cancelAllRequests, cancelRequestScope, cleanupExpiredCache, clearAllCache, clearCache, clearCacheByPrefix, clearCacheByTag, createAxiosInstance, createRequestClient, deleteData, generateRequestKey, getCacheSize, getCancelableRequestCount, getData, getGlobalAxiosInstance, getPendingRequestCount, getReLoginPromise, onReLoginCancel, onReLoginSuccess, patchData, postData, putData, setDefaultRequestClient, setGlobalAxiosInstance, waitForReLogin };
@@ -0,0 +1,67 @@
1
+ import { AxiosInstance, AxiosRequestConfig } from 'axios';
2
+ import { b as CacheStore, o as RequestPolicyDefaults, e as EnhancedAxiosRequestConfig, p as RequestScope, E as EnhancedAxiosInstance, g as RequestClientConfig, f as RequestClient, M as MemoryCacheOptions, m as RequestKeyOptions } from './types-BVJhlSuh.js';
3
+ export { B as BusinessErrorDescriptor, C as CacheConfig, a as CacheItem, c as CancelConfig, d as ConcurrencyPolicy, D as DedupeConfig, F as FieldAliases, I as InterceptorConfig, R as RequestAuthConfig, h as RequestConfig, i as RequestCoreConfig, j as RequestError, k as RequestHooks, l as RequestInterceptors, n as RequestKeyParams, q as ResponseAdapter, r as RetryConfig, s as RetryContext, t as createRequestCore, u as getGlobalConfig, v as isCanceledError, w as isRequestError, x as normalizeRequestError } from './types-BVJhlSuh.js';
4
+ import 'vue';
5
+
6
+ interface CreateRequestRuntimeOptions {
7
+ cache?: CacheStore;
8
+ defaults?: RequestPolicyDefaults;
9
+ }
10
+
11
+ declare function setGlobalAxiosInstance(instance: AxiosInstance): void;
12
+ declare function getGlobalAxiosInstance(): AxiosInstance;
13
+ declare function getData<T = unknown>(url: string, config?: EnhancedAxiosRequestConfig): Promise<T>;
14
+ declare function postData<T = unknown, D = unknown>(url: string, data?: D, config?: EnhancedAxiosRequestConfig<D>): Promise<T>;
15
+ declare function putData<T = unknown, D = unknown>(url: string, data?: D, config?: EnhancedAxiosRequestConfig<D>): Promise<T>;
16
+ declare function patchData<T = unknown, D = unknown>(url: string, data?: D, config?: EnhancedAxiosRequestConfig<D>): Promise<T>;
17
+ declare function deleteData<T = unknown>(url: string, config?: EnhancedAxiosRequestConfig): Promise<T>;
18
+
19
+ declare function waitForReLogin(instance?: AxiosInstance): Promise<void>;
20
+ declare function getReLoginPromise(instance?: AxiosInstance): Promise<void> | null;
21
+
22
+ declare function cancelAllPendingRequests(instance?: AxiosInstance): void;
23
+ declare function getPendingRequestCount(instance?: AxiosInstance): number;
24
+
25
+ declare function clearAllCache(instance?: AxiosInstance): void;
26
+ declare function clearCache(config: AxiosRequestConfig, instance?: AxiosInstance): boolean;
27
+ declare function clearCacheByPrefix(prefix: string, instance?: AxiosInstance): number;
28
+ declare function clearCacheByTag(tag: string, instance?: AxiosInstance): number;
29
+ declare function cleanupExpiredCache(instance?: AxiosInstance): void;
30
+ declare function getCacheSize(instance?: AxiosInstance): number;
31
+
32
+ declare function cancelAllRequests(instance?: AxiosInstance): void;
33
+ declare function cancelRequestScope(scope: RequestScope, instance?: AxiosInstance): number;
34
+ declare function getCancelableRequestCount(instance?: AxiosInstance): number;
35
+
36
+ /** Creates an isolated Axios instance with request-core lifecycle policies. */
37
+ declare function createAxiosInstance(config?: AxiosRequestConfig, runtimeOptions?: CreateRequestRuntimeOptions): EnhancedAxiosInstance;
38
+
39
+ declare const onReLoginSuccess: (instance?: AxiosInstance) => void;
40
+ declare const onReLoginCancel: (instance?: AxiosInstance) => void;
41
+
42
+ declare function createRequestClient(config?: RequestClientConfig): RequestClient;
43
+ declare function setDefaultRequestClient(client: RequestClient): void;
44
+
45
+ declare function generateRequestKey(config: AxiosRequestConfig, options?: RequestKeyOptions): string;
46
+ declare class MemoryCache implements CacheStore {
47
+ private readonly cache;
48
+ private readonly accessOrder;
49
+ private maxSize;
50
+ private readonly cloneValue;
51
+ constructor(options?: MemoryCacheOptions);
52
+ get<T = unknown>(key: string): T | null;
53
+ set<T = unknown>(key: string, data: T, ttl: number, options?: {
54
+ tags?: readonly string[];
55
+ }): void;
56
+ delete(key: string): boolean;
57
+ clear(): void;
58
+ cleanup(): void;
59
+ deleteByPrefix(prefix: string): number;
60
+ deleteByTag(tag: string): number;
61
+ get size(): number;
62
+ setMaxSize(size: number): void;
63
+ private assertMaxSize;
64
+ private evictOldest;
65
+ }
66
+
67
+ export { CacheStore, EnhancedAxiosInstance, EnhancedAxiosRequestConfig, MemoryCache, MemoryCacheOptions, RequestClient, RequestClientConfig, RequestKeyOptions, RequestPolicyDefaults, RequestScope, cancelAllPendingRequests, cancelAllRequests, cancelRequestScope, cleanupExpiredCache, clearAllCache, clearCache, clearCacheByPrefix, clearCacheByTag, createAxiosInstance, createRequestClient, deleteData, generateRequestKey, getCacheSize, getCancelableRequestCount, getData, getGlobalAxiosInstance, getPendingRequestCount, getReLoginPromise, onReLoginCancel, onReLoginSuccess, patchData, postData, putData, setDefaultRequestClient, setGlobalAxiosInstance, waitForReLogin };
package/dist/axios.js ADDED
@@ -0,0 +1,4 @@
1
+ export { createRequestClient, setDefaultRequestClient } from './chunk-DUP3Y4DN.js';
2
+ export { MemoryCache, RequestError, cancelAllPendingRequests, cancelAllRequests, cancelRequestScope, cleanupExpiredCache, clearAllCache, clearCache, clearCacheByPrefix, clearCacheByTag, createAxiosInstance, createRequestCore, deleteData, generateRequestKey, getCacheSize, getCancelableRequestCount, getData, getGlobalAxiosInstance, getGlobalConfig, getPendingRequestCount, getReLoginPromise, isCanceledError, isRequestError, normalizeRequestError, onReLoginCancel, onReLoginSuccess, patchData, postData, putData, setGlobalAxiosInstance, waitForReLogin } from './chunk-OAZ5BUBU.js';
3
+ //# sourceMappingURL=axios.js.map
4
+ //# sourceMappingURL=axios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"axios.js"}