@oiyo/framework 0.3.11 → 0.4.0-beta.2

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
@@ -0,0 +1,234 @@
1
+ /**
2
+ * @oiyo/framework v0.4.0-beta.2
3
+ * Copyright (c) 2026 skiyee. All rights reserved.
4
+ * Commercial software. See LICENSE for terms.
5
+ * Official site: https://oiyo.js.org
6
+ */
7
+ //#region src/oiyo/http/abort.d.ts
8
+ interface HttpAborter {
9
+ readonly signal: HttpAbortSignal;
10
+ abort: (reason?: any) => void;
11
+ }
12
+ /**
13
+ * 创建一个中断信标。
14
+ *
15
+ * @example
16
+ * const aborter = createHttpAborter()
17
+ * http.request('/pet/1', { signal: aborter.signal })
18
+ * aborter.abort()
19
+ */
20
+ declare function createHttpAborter(): HttpAborter;
21
+ type AbortListener = (this: HttpAbortSignal, event: {
22
+ type: 'abort';
23
+ }) => void;
24
+ declare class AbortEmitter {
25
+ private listeners;
26
+ addEventListener(type: 'abort', listener: AbortListener): void;
27
+ removeEventListener(type: 'abort', listener: AbortListener): void;
28
+ protected emit(event: {
29
+ type: 'abort';
30
+ }): void;
31
+ }
32
+ declare class HttpAbortSignal extends AbortEmitter {
33
+ aborted: boolean;
34
+ reason: any;
35
+ onabort: AbortListener | null;
36
+ /**
37
+ * 内部使用:标记中断并派发 `abort` 事件(幂等)。
38
+ */
39
+ _abort(reason?: any): void;
40
+ /**
41
+ * 已中断则抛出 `reason`,否则什么都不做。
42
+ */
43
+ throwIfAborted(): void;
44
+ }
45
+ //#endregion
46
+ //#region src/oiyo/http/types/utils.d.ts
47
+ type Prettify<T> = { [K in keyof T]: T[K] } & {};
48
+ type MaybePromise<T> = T | Promise<T>;
49
+ //#endregion
50
+ //#region src/oiyo/http/types/body.d.ts
51
+ interface ResponseBodyTypeMap {
52
+ text: string;
53
+ arrayBuffer: ArrayBuffer;
54
+ }
55
+ type ResponseBodyType = Prettify<keyof ResponseBodyTypeMap | 'json'>;
56
+ type MappedResponseBodyType<TRBType extends ResponseBodyType, TRBJsonType = any> = TRBType extends keyof ResponseBodyTypeMap ? ResponseBodyTypeMap[TRBType] : TRBJsonType;
57
+ //#endregion
58
+ //#region src/oiyo/http/types/uni.d.ts
59
+ type UniAppRequestOptions = Omit<UniNamespace.RequestOptions, 'url' | 'data' | 'header' | 'method' | 'timeout' | 'responseType' | 'success' | 'fail' | 'complete'>;
60
+ type UniAppRequestResponse<TRBody = any> = Prettify<Omit<UniNamespace.RequestSuccessCallbackResult, 'data'> & {
61
+ data: TRBody;
62
+ }>;
63
+ type UniAppUploadOptions = Omit<UniNamespace.UploadFileOption, 'url' | 'name' | 'header' | 'formData' | 'timeout' | 'success' | 'fail' | 'complete'>;
64
+ interface UniAppOnUploadProgress extends UniNamespace.OnProgressUpdateResult {}
65
+ type UniAppUploadResponse<TRBody = any> = Prettify<Omit<UniNamespace.UploadFileSuccessCallbackResult, 'data'> & {
66
+ data: TRBody;
67
+ }>;
68
+ type UniAppDownloadBodyType = 'json';
69
+ type UniAppDownloadBody = Prettify<Pick<UniNamespace.DownloadSuccessData, 'tempFilePath'>>;
70
+ type UniAppDownloadOptions = Omit<UniNamespace.DownloadFileOption, 'url' | 'header' | 'timeout' | 'success' | 'fail' | 'complete'>;
71
+ interface UniAppDownloadProgress extends UniNamespace.OnProgressDownloadResult {
72
+ progress: number;
73
+ totalBytesWritten: number;
74
+ totalBytesExpectedToWrite: number;
75
+ }
76
+ type UniAppDownloadResponse<TRBody = any> = Prettify<Omit<UniNamespace.DownloadSuccessData, keyof UniAppDownloadBody> & {
77
+ data: TRBody;
78
+ }>;
79
+ //#endregion
80
+ //#region src/oiyo/http/types/options.d.ts
81
+ /**
82
+ * 响应头监听回调入参。
83
+ */
84
+ interface HeadersReceived {
85
+ header: Record<string, string>;
86
+ }
87
+ /**
88
+ * 所有请求共享的基础选项。
89
+ */
90
+ interface HttpBaseOptions<TRBType extends ResponseBodyType = ResponseBodyType> {
91
+ baseURL?: string;
92
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT';
93
+ headers?: Record<string, string>;
94
+ query?: Record<string, any>;
95
+ body?: any;
96
+ timeout?: number;
97
+ /**
98
+ * 为 true 时返回完整响应对象(statusCode / header / data ...),
99
+ * 否则只返回精炼后的 data。
100
+ */
101
+ raw?: boolean;
102
+ responseType?: TRBType;
103
+ parseResponse?: (responseText: string) => any;
104
+ retry?: number | false;
105
+ retryDelay?: number;
106
+ /**
107
+ * 重试的响应状态码
108
+ * @default [408, 409, 425, 429, 500, 502, 503, 504]
109
+ */
110
+ retryStatusCodes?: number[];
111
+ ignoreResponseError?: boolean;
112
+ /**
113
+ * 中断信号,由 `createHttpAborter()` 创建。
114
+ * 信号触发后请求会被中断;已中断的信号会让请求立即中断。
115
+ */
116
+ signal?: HttpAbortSignal;
117
+ /**
118
+ * 监听响应头(对应 task.onHeadersReceived)。
119
+ */
120
+ onHeadersReceived?: (result: HeadersReceived) => void;
121
+ }
122
+ interface HttpRequestOptions<TRBType extends ResponseBodyType = ResponseBodyType> extends HttpBaseOptions<TRBType>, UniAppRequestOptions {
123
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT';
124
+ }
125
+ interface HttpUploadOptions<TRBType extends ResponseBodyType = ResponseBodyType> extends HttpBaseOptions<TRBType>, UniAppUploadOptions {
126
+ /**
127
+ * 文件对应的 key
128
+ * @default - 'file'
129
+ */
130
+ name?: string;
131
+ /**
132
+ * 上传请求方法
133
+ * @default - 'POST'
134
+ */
135
+ method?: 'POST';
136
+ /**
137
+ * 监听上传进度(对应 task.onProgressUpdate)。
138
+ */
139
+ onProgress?: (result: UniAppOnUploadProgress) => void;
140
+ }
141
+ interface HttpDownloadOptions<TRBType extends UniAppDownloadBodyType = 'json'> extends HttpBaseOptions<TRBType>, UniAppDownloadOptions {
142
+ /**
143
+ * 下载请求方法
144
+ * @default - 'GET'
145
+ */
146
+ method?: 'GET';
147
+ /**
148
+ * 监听下载进度(对应 task.onProgressUpdate)。
149
+ */
150
+ onProgress?: (result: UniAppDownloadProgress) => void;
151
+ }
152
+ type HttpURL = string;
153
+ type HttpOptions = HttpRequestOptions | HttpUploadOptions | HttpDownloadOptions;
154
+ //#endregion
155
+ //#region src/oiyo/http/types/response.d.ts
156
+ type HttpRequestResponse<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = MappedResponseBodyType<TRBType, TRBody>;
157
+ type HttpUploadResponse<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = MappedResponseBodyType<TRBType, TRBody>;
158
+ type HttpDownloadResponse<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = 'json'> = MappedResponseBodyType<TRBType, TRBody>;
159
+ type HttpRequestRawResponse<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = UniAppRequestResponse<MappedResponseBodyType<TRBType, TRBody>>;
160
+ type HttpUploadRawResponse<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = UniAppUploadResponse<MappedResponseBodyType<TRBType, TRBody>>;
161
+ type HttpDownloadRawResponse<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = 'json'> = UniAppDownloadResponse<MappedResponseBodyType<TRBType, TRBody>>;
162
+ type HttpRawResponse<T = any> = HttpRequestRawResponse<T> | HttpUploadRawResponse<T> | HttpDownloadRawResponse;
163
+ //#endregion
164
+ //#region src/oiyo/http/types/core.d.ts
165
+ interface HttpRequestMethod {
166
+ <TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options: HttpRequestOptions<TRBType> & {
167
+ raw: true;
168
+ }): Promise<HttpRequestRawResponse<TRBody, TRBType>>;
169
+ <TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options?: HttpRequestOptions<TRBType>): Promise<HttpRequestResponse<TRBody, TRBType>>;
170
+ }
171
+ interface HttpUploadMethod {
172
+ <TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options: HttpUploadOptions<TRBType> & {
173
+ raw: true;
174
+ }): Promise<HttpUploadRawResponse<TRBody, TRBType>>;
175
+ <TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options?: HttpUploadOptions<TRBType>): Promise<HttpUploadResponse<TRBody, TRBType>>;
176
+ }
177
+ interface HttpDownloadMethod {
178
+ <TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = UniAppDownloadBodyType>(resource: HttpURL, options: HttpDownloadOptions<TRBType> & {
179
+ raw: true;
180
+ }): Promise<HttpDownloadRawResponse<TRBody, TRBType>>;
181
+ <TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = UniAppDownloadBodyType>(resource: HttpURL, options?: HttpDownloadOptions<TRBType>): Promise<HttpDownloadResponse<TRBody, TRBType>>;
182
+ }
183
+ interface HttpHooks<TContextOptions, TResponse> {
184
+ onRequest?: (context: {
185
+ resource: HttpURL;
186
+ options: TContextOptions;
187
+ }) => MaybePromise<void>;
188
+ onRequestError?: (context: {
189
+ resource: HttpURL;
190
+ options: TContextOptions;
191
+ error: Error;
192
+ }) => MaybePromise<void>;
193
+ onResponse?: (context: {
194
+ resource: HttpURL;
195
+ options: TContextOptions;
196
+ response: TResponse;
197
+ }) => MaybePromise<void>;
198
+ onResponseError?: (context: {
199
+ resource: HttpURL;
200
+ options: TContextOptions;
201
+ response: TResponse;
202
+ }) => MaybePromise<void>;
203
+ }
204
+ interface HttpConfig extends HttpBaseOptions<ResponseBodyType>, HttpHooks<HttpConfig, HttpRawResponse> {}
205
+ interface HttpError<T = any> extends Error {
206
+ resource?: HttpURL;
207
+ options?: HttpOptions;
208
+ response?: HttpRawResponse<T>;
209
+ data: T;
210
+ }
211
+ //#endregion
212
+ //#region src/oiyo/http/core.d.ts
213
+ interface Http {
214
+ /**
215
+ * 普通请求
216
+ */
217
+ request: HttpRequestMethod;
218
+ /**
219
+ * 文件上传
220
+ */
221
+ upload: HttpUploadMethod;
222
+ /**
223
+ * 文件下载
224
+ */
225
+ download: HttpDownloadMethod;
226
+ /**
227
+ * 基于当前配置派生一个新实例。
228
+ */
229
+ create: (config: HttpConfig) => Http;
230
+ }
231
+ declare function createHttp(globalConfig?: HttpConfig): Http;
232
+ declare const http: Http;
233
+ //#endregion
234
+ export { HttpDownloadResponse as a, HttpDownloadOptions as c, ResponseBodyType as d, createHttpAborter as f, HttpError as i, HttpRequestOptions as l, http as n, HttpRequestResponse as o, HttpConfig as r, HttpUploadResponse as s, createHttp as t, HttpUploadOptions as u };
@@ -0,0 +1,234 @@
1
+ /**
2
+ * @oiyo/framework v0.4.0-beta.2
3
+ * Copyright (c) 2026 skiyee. All rights reserved.
4
+ * Commercial software. See LICENSE for terms.
5
+ * Official site: https://oiyo.js.org
6
+ */
7
+ //#region src/oiyo/http/abort.d.ts
8
+ interface HttpAborter {
9
+ readonly signal: HttpAbortSignal;
10
+ abort: (reason?: any) => void;
11
+ }
12
+ /**
13
+ * 创建一个中断信标。
14
+ *
15
+ * @example
16
+ * const aborter = createHttpAborter()
17
+ * http.request('/pet/1', { signal: aborter.signal })
18
+ * aborter.abort()
19
+ */
20
+ declare function createHttpAborter(): HttpAborter;
21
+ type AbortListener = (this: HttpAbortSignal, event: {
22
+ type: 'abort';
23
+ }) => void;
24
+ declare class AbortEmitter {
25
+ private listeners;
26
+ addEventListener(type: 'abort', listener: AbortListener): void;
27
+ removeEventListener(type: 'abort', listener: AbortListener): void;
28
+ protected emit(event: {
29
+ type: 'abort';
30
+ }): void;
31
+ }
32
+ declare class HttpAbortSignal extends AbortEmitter {
33
+ aborted: boolean;
34
+ reason: any;
35
+ onabort: AbortListener | null;
36
+ /**
37
+ * 内部使用:标记中断并派发 `abort` 事件(幂等)。
38
+ */
39
+ _abort(reason?: any): void;
40
+ /**
41
+ * 已中断则抛出 `reason`,否则什么都不做。
42
+ */
43
+ throwIfAborted(): void;
44
+ }
45
+ //#endregion
46
+ //#region src/oiyo/http/types/utils.d.ts
47
+ type Prettify<T> = { [K in keyof T]: T[K] } & {};
48
+ type MaybePromise<T> = T | Promise<T>;
49
+ //#endregion
50
+ //#region src/oiyo/http/types/body.d.ts
51
+ interface ResponseBodyTypeMap {
52
+ text: string;
53
+ arrayBuffer: ArrayBuffer;
54
+ }
55
+ type ResponseBodyType = Prettify<keyof ResponseBodyTypeMap | 'json'>;
56
+ type MappedResponseBodyType<TRBType extends ResponseBodyType, TRBJsonType = any> = TRBType extends keyof ResponseBodyTypeMap ? ResponseBodyTypeMap[TRBType] : TRBJsonType;
57
+ //#endregion
58
+ //#region src/oiyo/http/types/uni.d.ts
59
+ type UniAppRequestOptions = Omit<UniNamespace.RequestOptions, 'url' | 'data' | 'header' | 'method' | 'timeout' | 'responseType' | 'success' | 'fail' | 'complete'>;
60
+ type UniAppRequestResponse<TRBody = any> = Prettify<Omit<UniNamespace.RequestSuccessCallbackResult, 'data'> & {
61
+ data: TRBody;
62
+ }>;
63
+ type UniAppUploadOptions = Omit<UniNamespace.UploadFileOption, 'url' | 'name' | 'header' | 'formData' | 'timeout' | 'success' | 'fail' | 'complete'>;
64
+ interface UniAppOnUploadProgress extends UniNamespace.OnProgressUpdateResult {}
65
+ type UniAppUploadResponse<TRBody = any> = Prettify<Omit<UniNamespace.UploadFileSuccessCallbackResult, 'data'> & {
66
+ data: TRBody;
67
+ }>;
68
+ type UniAppDownloadBodyType = 'json';
69
+ type UniAppDownloadBody = Prettify<Pick<UniNamespace.DownloadSuccessData, 'tempFilePath'>>;
70
+ type UniAppDownloadOptions = Omit<UniNamespace.DownloadFileOption, 'url' | 'header' | 'timeout' | 'success' | 'fail' | 'complete'>;
71
+ interface UniAppDownloadProgress extends UniNamespace.OnProgressDownloadResult {
72
+ progress: number;
73
+ totalBytesWritten: number;
74
+ totalBytesExpectedToWrite: number;
75
+ }
76
+ type UniAppDownloadResponse<TRBody = any> = Prettify<Omit<UniNamespace.DownloadSuccessData, keyof UniAppDownloadBody> & {
77
+ data: TRBody;
78
+ }>;
79
+ //#endregion
80
+ //#region src/oiyo/http/types/options.d.ts
81
+ /**
82
+ * 响应头监听回调入参。
83
+ */
84
+ interface HeadersReceived {
85
+ header: Record<string, string>;
86
+ }
87
+ /**
88
+ * 所有请求共享的基础选项。
89
+ */
90
+ interface HttpBaseOptions<TRBType extends ResponseBodyType = ResponseBodyType> {
91
+ baseURL?: string;
92
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT';
93
+ headers?: Record<string, string>;
94
+ query?: Record<string, any>;
95
+ body?: any;
96
+ timeout?: number;
97
+ /**
98
+ * 为 true 时返回完整响应对象(statusCode / header / data ...),
99
+ * 否则只返回精炼后的 data。
100
+ */
101
+ raw?: boolean;
102
+ responseType?: TRBType;
103
+ parseResponse?: (responseText: string) => any;
104
+ retry?: number | false;
105
+ retryDelay?: number;
106
+ /**
107
+ * 重试的响应状态码
108
+ * @default [408, 409, 425, 429, 500, 502, 503, 504]
109
+ */
110
+ retryStatusCodes?: number[];
111
+ ignoreResponseError?: boolean;
112
+ /**
113
+ * 中断信号,由 `createHttpAborter()` 创建。
114
+ * 信号触发后请求会被中断;已中断的信号会让请求立即中断。
115
+ */
116
+ signal?: HttpAbortSignal;
117
+ /**
118
+ * 监听响应头(对应 task.onHeadersReceived)。
119
+ */
120
+ onHeadersReceived?: (result: HeadersReceived) => void;
121
+ }
122
+ interface HttpRequestOptions<TRBType extends ResponseBodyType = ResponseBodyType> extends HttpBaseOptions<TRBType>, UniAppRequestOptions {
123
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT';
124
+ }
125
+ interface HttpUploadOptions<TRBType extends ResponseBodyType = ResponseBodyType> extends HttpBaseOptions<TRBType>, UniAppUploadOptions {
126
+ /**
127
+ * 文件对应的 key
128
+ * @default - 'file'
129
+ */
130
+ name?: string;
131
+ /**
132
+ * 上传请求方法
133
+ * @default - 'POST'
134
+ */
135
+ method?: 'POST';
136
+ /**
137
+ * 监听上传进度(对应 task.onProgressUpdate)。
138
+ */
139
+ onProgress?: (result: UniAppOnUploadProgress) => void;
140
+ }
141
+ interface HttpDownloadOptions<TRBType extends UniAppDownloadBodyType = 'json'> extends HttpBaseOptions<TRBType>, UniAppDownloadOptions {
142
+ /**
143
+ * 下载请求方法
144
+ * @default - 'GET'
145
+ */
146
+ method?: 'GET';
147
+ /**
148
+ * 监听下载进度(对应 task.onProgressUpdate)。
149
+ */
150
+ onProgress?: (result: UniAppDownloadProgress) => void;
151
+ }
152
+ type HttpURL = string;
153
+ type HttpOptions = HttpRequestOptions | HttpUploadOptions | HttpDownloadOptions;
154
+ //#endregion
155
+ //#region src/oiyo/http/types/response.d.ts
156
+ type HttpRequestResponse<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = MappedResponseBodyType<TRBType, TRBody>;
157
+ type HttpUploadResponse<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = MappedResponseBodyType<TRBType, TRBody>;
158
+ type HttpDownloadResponse<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = 'json'> = MappedResponseBodyType<TRBType, TRBody>;
159
+ type HttpRequestRawResponse<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = UniAppRequestResponse<MappedResponseBodyType<TRBType, TRBody>>;
160
+ type HttpUploadRawResponse<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = UniAppUploadResponse<MappedResponseBodyType<TRBType, TRBody>>;
161
+ type HttpDownloadRawResponse<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = 'json'> = UniAppDownloadResponse<MappedResponseBodyType<TRBType, TRBody>>;
162
+ type HttpRawResponse<T = any> = HttpRequestRawResponse<T> | HttpUploadRawResponse<T> | HttpDownloadRawResponse;
163
+ //#endregion
164
+ //#region src/oiyo/http/types/core.d.ts
165
+ interface HttpRequestMethod {
166
+ <TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options: HttpRequestOptions<TRBType> & {
167
+ raw: true;
168
+ }): Promise<HttpRequestRawResponse<TRBody, TRBType>>;
169
+ <TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options?: HttpRequestOptions<TRBType>): Promise<HttpRequestResponse<TRBody, TRBType>>;
170
+ }
171
+ interface HttpUploadMethod {
172
+ <TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options: HttpUploadOptions<TRBType> & {
173
+ raw: true;
174
+ }): Promise<HttpUploadRawResponse<TRBody, TRBType>>;
175
+ <TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options?: HttpUploadOptions<TRBType>): Promise<HttpUploadResponse<TRBody, TRBType>>;
176
+ }
177
+ interface HttpDownloadMethod {
178
+ <TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = UniAppDownloadBodyType>(resource: HttpURL, options: HttpDownloadOptions<TRBType> & {
179
+ raw: true;
180
+ }): Promise<HttpDownloadRawResponse<TRBody, TRBType>>;
181
+ <TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = UniAppDownloadBodyType>(resource: HttpURL, options?: HttpDownloadOptions<TRBType>): Promise<HttpDownloadResponse<TRBody, TRBType>>;
182
+ }
183
+ interface HttpHooks<TContextOptions, TResponse> {
184
+ onRequest?: (context: {
185
+ resource: HttpURL;
186
+ options: TContextOptions;
187
+ }) => MaybePromise<void>;
188
+ onRequestError?: (context: {
189
+ resource: HttpURL;
190
+ options: TContextOptions;
191
+ error: Error;
192
+ }) => MaybePromise<void>;
193
+ onResponse?: (context: {
194
+ resource: HttpURL;
195
+ options: TContextOptions;
196
+ response: TResponse;
197
+ }) => MaybePromise<void>;
198
+ onResponseError?: (context: {
199
+ resource: HttpURL;
200
+ options: TContextOptions;
201
+ response: TResponse;
202
+ }) => MaybePromise<void>;
203
+ }
204
+ interface HttpConfig extends HttpBaseOptions<ResponseBodyType>, HttpHooks<HttpConfig, HttpRawResponse> {}
205
+ interface HttpError<T = any> extends Error {
206
+ resource?: HttpURL;
207
+ options?: HttpOptions;
208
+ response?: HttpRawResponse<T>;
209
+ data: T;
210
+ }
211
+ //#endregion
212
+ //#region src/oiyo/http/core.d.ts
213
+ interface Http {
214
+ /**
215
+ * 普通请求
216
+ */
217
+ request: HttpRequestMethod;
218
+ /**
219
+ * 文件上传
220
+ */
221
+ upload: HttpUploadMethod;
222
+ /**
223
+ * 文件下载
224
+ */
225
+ download: HttpDownloadMethod;
226
+ /**
227
+ * 基于当前配置派生一个新实例。
228
+ */
229
+ create: (config: HttpConfig) => Http;
230
+ }
231
+ declare function createHttp(globalConfig?: HttpConfig): Http;
232
+ declare const http: Http;
233
+ //#endregion
234
+ export { HttpDownloadResponse as a, HttpDownloadOptions as c, ResponseBodyType as d, createHttpAborter as f, HttpError as i, HttpRequestOptions as l, http as n, HttpRequestResponse as o, HttpConfig as r, HttpUploadResponse as s, createHttp as t, HttpUploadOptions as u };
package/dist/index.cjs CHANGED
@@ -1,14 +1,18 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
6
6
  */
7
7
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
8
- require("./chunk-pi1SoIKQ.cjs");
8
+ require("./chunk-BnILMwZG.cjs");
9
+ const require_oiyo = require("./oiyo-CZ64L3f6.cjs");
9
10
  require("./uni.cjs");
10
11
  require("./vue.cjs");
11
12
  //#endregion
13
+ exports.createHttp = require_oiyo.createHttp;
14
+ exports.createHttpAborter = require_oiyo.createHttpAborter;
15
+ exports.http = require_oiyo.http;
12
16
  var _dcloudio_uni_app = require("@dcloudio/uni-app");
13
17
  Object.keys(_dcloudio_uni_app).forEach(function(k) {
14
18
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
package/dist/index.d.cts CHANGED
@@ -1,10 +1,16 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
6
6
  */
7
+ import { a as HttpDownloadResponse, c as HttpDownloadOptions, d as ResponseBodyType, f as createHttpAborter, i as HttpError, l as HttpRequestOptions, n as http, o as HttpRequestResponse, r as HttpConfig, s as HttpUploadResponse, t as createHttp, u as HttpUploadOptions } from "./index-DCAh9vr9.cjs";
7
8
  export * from "@dcloudio/uni-app";
8
9
  export * from "vue";
9
10
 
10
- //#region src/index.d.ts
11
+ //#region src/index.d.ts
12
+ declare namespace index_d_exports {
13
+ export { HttpConfig, HttpDownloadOptions, HttpDownloadResponse, HttpError, HttpRequestOptions, HttpRequestResponse, HttpUploadOptions, HttpUploadResponse, ResponseBodyType, createHttp, createHttpAborter, http };
14
+ }
15
+ //#endregion
16
+ export { type HttpConfig, type HttpDownloadOptions, type HttpDownloadResponse, type HttpError, type HttpRequestOptions, type HttpRequestResponse, type HttpUploadOptions, type HttpUploadResponse, type ResponseBodyType, createHttp, createHttpAborter, http };
package/dist/index.d.mts CHANGED
@@ -1,10 +1,16 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
6
6
  */
7
+ import { a as HttpDownloadResponse, c as HttpDownloadOptions, d as ResponseBodyType, f as createHttpAborter, i as HttpError, l as HttpRequestOptions, n as http, o as HttpRequestResponse, r as HttpConfig, s as HttpUploadResponse, t as createHttp, u as HttpUploadOptions } from "./index-DCAh9vr9.mjs";
7
8
  export * from "@dcloudio/uni-app";
8
9
  export * from "vue";
9
10
 
10
- //#region src/index.d.ts
11
+ //#region src/index.d.ts
12
+ declare namespace index_d_exports {
13
+ export { HttpConfig, HttpDownloadOptions, HttpDownloadResponse, HttpError, HttpRequestOptions, HttpRequestResponse, HttpUploadOptions, HttpUploadResponse, ResponseBodyType, createHttp, createHttpAborter, http };
14
+ }
15
+ //#endregion
16
+ export { type HttpConfig, type HttpDownloadOptions, type HttpDownloadResponse, type HttpError, type HttpRequestOptions, type HttpRequestResponse, type HttpUploadOptions, type HttpUploadResponse, type ResponseBodyType, createHttp, createHttpAborter, http };
package/dist/index.mjs CHANGED
@@ -1,13 +1,14 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
6
6
  */
7
- import "./chunk-BKnNvmwS.mjs";
7
+ import "./chunk-Bcqm9nz_.mjs";
8
+ import { n as http, r as createHttpAborter, t as createHttp } from "./oiyo-CUWG-Hhg.mjs";
8
9
  import "./uni.mjs";
9
10
  import "./vue.mjs";
10
11
  export * from "@dcloudio/uni-app";
11
12
  export * from "vue";
12
13
  //#endregion
13
- export {};
14
+ export { createHttp, createHttpAborter, http };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @oiyo/framework v0.4.0-beta.2
3
+ * Copyright (c) 2026 skiyee. All rights reserved.
4
+ * Commercial software. See LICENSE for terms.
5
+ * Official site: https://oiyo.js.org
6
+ */
7
+ const _0x2b5027=_0x167a;(function(_0x369913,_0x37e29a){const _0x481d05=_0x167a,_0x5c5bde=_0x369913();while(!![]){try{const _0x29de9c=-parseInt(_0x481d05(0x10e))/0x1*(parseInt(_0x481d05(0x119))/0x2)+parseInt(_0x481d05(0xfc))/0x3*(parseInt(_0x481d05(0x115))/0x4)+-parseInt(_0x481d05(0x107))/0x5*(-parseInt(_0x481d05(0xf4))/0x6)+-parseInt(_0x481d05(0xf7))/0x7+-parseInt(_0x481d05(0xd6))/0x8*(parseInt(_0x481d05(0x10b))/0x9)+parseInt(_0x481d05(0xd8))/0xa+parseInt(_0x481d05(0xe4))/0xb;if(_0x29de9c===_0x37e29a)break;else _0x5c5bde['push'](_0x5c5bde['shift']());}catch(_0x271def){_0x5c5bde['push'](_0x5c5bde['shift']());}}}(_0x1c3b,0x68e1c));function createHttpAborter(){const _0x5a8243=new HttpAbortSignal();return{'signal':_0x5a8243,'abort':_0x19de66=>_0x5a8243['_abort'](_0x19de66)};}const ABORT_ERROR_NAME='AbortError';var AbortEmitter=class{['listeners']=[];['addEventListener'](_0x1d14a1,_0x1e3382){const _0x3753ee=_0x167a;if(_0x1d14a1!=='abort')return;this[_0x3753ee(0xff)][_0x3753ee(0xd1)](_0x1e3382);}[_0x2b5027(0xd9)](_0x16eea4,_0x3c875d){const _0x2065c5=_0x2b5027;if(_0x16eea4!=='abort')return;const _0x228222=this[_0x2065c5(0xff)][_0x2065c5(0xdf)](_0x3c875d);if(_0x228222!==-0x1)this[_0x2065c5(0xff)]['splice'](_0x228222,0x1);}['emit'](_0x460a13){for(const _0x2fe4d6 of this['listeners']['slice']())_0x2fe4d6['call'](this,_0x460a13);}},HttpAbortSignal=class extends AbortEmitter{['aborted']=![];[_0x2b5027(0x106)]=void 0x0;['onabort']=null;[_0x2b5027(0xe2)](_0x50020c){const _0xc3e650=_0x2b5027;if(this['aborted'])return;this['aborted']=!![],this['reason']=_0x50020c===void 0x0?createAbortError():_0x50020c;const _0x2ee881={};_0x2ee881[_0xc3e650(0x11b)]=_0xc3e650(0xd4);const _0x46b8de=_0x2ee881;if(typeof this[_0xc3e650(0x10f)]==='function')this['onabort'](_0x46b8de);this['emit'](_0x46b8de);}['throwIfAborted'](){const _0x1e7d73=_0x2b5027;if(this[_0x1e7d73(0xdc)])throw this[_0x1e7d73(0x106)];}};function createAbortError(_0x3eefc0=_0x2b5027(0x101)){const _0xb82315=new Error(_0x3eefc0);return _0xb82315['name']=ABORT_ERROR_NAME,_0xb82315;}function isAbortError(_0x52a9aa){const _0x385137=_0x2b5027;return _0x52a9aa instanceof Error&&_0x52a9aa[_0x385137(0x108)]===ABORT_ERROR_NAME;}function onAbort(_0x38742e,_0x1714f4){const _0x7feeb8=_0x2b5027;if(!_0x38742e)return()=>{};if(_0x38742e[_0x7feeb8(0xdc)])return _0x1714f4(),()=>{};return _0x38742e[_0x7feeb8(0x114)](_0x7feeb8(0xd4),_0x1714f4),()=>_0x38742e['removeEventListener']('abort',_0x1714f4);}function _0x167a(_0x5661b0,_0x584ce0){_0x5661b0=_0x5661b0-0xc3;const _0x1c3b4d=_0x1c3b();let _0x167adf=_0x1c3b4d[_0x5661b0];return _0x167adf;}const HOOK_NAMES=['onRequest',_0x2b5027(0xe0),'onResponse','onResponseError'];function mergeOptions(..._0x3820dd){const _0x35614e=_0x2b5027,_0x4299c5={},_0x542a5c={};for(const _0x17c8c1 of _0x3820dd){if(!_0x17c8c1)continue;for(const _0x25d2f8 of HOOK_NAMES)collectHook(_0x542a5c,_0x25d2f8,_0x17c8c1);const _0x13ff84=_0x4299c5['headers'],_0x2cdfa5=_0x4299c5['query'];Object[_0x35614e(0xd7)](_0x4299c5,_0x17c8c1);const _0x267e82={..._0x13ff84,..._0x17c8c1['headers']};_0x4299c5['headers']=_0x267e82;const _0x215bff={..._0x2cdfa5,..._0x17c8c1[_0x35614e(0xea)]};_0x4299c5[_0x35614e(0xea)]=_0x215bff;}for(const [_0x449045,_0x20e1ef]of Object['entries'](_0x542a5c))Object['assign'](_0x4299c5,{[_0x449045]:async _0x17d19b=>{for(const _0x2afca4 of _0x20e1ef)await _0x2afca4(_0x17d19b);}});return _0x4299c5;}function collectHook(_0x29568b,_0x1207c8,_0x377d25){const _0x5212e6=_0x2b5027,_0x4b9611=_0x377d25[_0x1207c8];if(typeof _0x4b9611!==_0x5212e6(0xe1))return;_0x29568b[_0x1207c8]??=[],_0x29568b[_0x1207c8]['push'](_0x4b9611);}function dispatch(_0x44ea88,_0x2ac0e5,_0x13d576,_0x326236){const _0x1c7b88=_0x2b5027;let _0x69fbde;if(_0x44ea88===_0x1c7b88(0x116))_0x69fbde=dispatchUpload(_0x2ac0e5,_0x13d576,_0x326236);else{if(_0x44ea88==='download')_0x69fbde=dispatchDownload(_0x2ac0e5,_0x13d576,_0x326236);else _0x69fbde=dispatchRequest(_0x2ac0e5,_0x13d576,_0x326236);}bindTask(_0x69fbde,_0x13d576);}function bindTask(_0x51e77b,_0x3e9dc8){const _0x12f7b8=_0x2b5027;onAbort(_0x3e9dc8['signal'],()=>_0x51e77b[_0x12f7b8(0xd4)]());if(typeof _0x3e9dc8['onHeadersReceived']===_0x12f7b8(0xe1))_0x51e77b['onHeadersReceived'](_0x3e9dc8[_0x12f7b8(0xf5)]);const _0x310183=_0x3e9dc8[_0x12f7b8(0xcc)];if(typeof _0x310183==='function'&&_0x12f7b8(0xfa)in _0x51e77b)_0x51e77b[_0x12f7b8(0xfa)](_0x310183);}function _0x1c3b(){const _0x50c8b7=['enableHttpDNS','catch','onProgress','dataType','flatMap','create','onResponse','push','tempFilePath','includes','abort','data','8UTJXTA','assign','510640EBvjYt','removeEventListener','url','toUpperCase','aborted','HTTP\x20request\x20failed','json','indexOf','onRequestError','function','_abort','formData','13449623aHAgyf','timeout','method','filePath','arrayBuffer','fileType','query','ignoreResponseError','errMsg','retryStatusCodes','forceCellularNetwork','enableQuic','headers','number','request','enableChunked','335334ljHvWW','onHeadersReceived','files','3021270ODWxeO','defineProperty','signal','onProgressUpdate','message','3fRLyty','then','GET','listeners','replace','The\x20operation\x20was\x20aborted','has','response','test','onFail','reason','5UWEjWx','name','body','POST','3891996WFStVD','statusCode','isArray','4790BrpbMw','onabort','responseType','PATCH','onResponseError','enableCache','addEventListener','2710856ZUqEmW','upload','text','baseURL','298MPUcMC','join','type','download','<no\x20response>','resolve','arraybuffer','PUT','enableHttp2','startsWith'];_0x1c3b=function(){return _0x50c8b7;};return _0x1c3b();}function dispatchRequest(_0x1594c0,_0x421334,_0x2c7a59){const _0x41dc81=_0x2b5027,_0x3edf08={'url':_0x1594c0,'method':_0x421334[_0x41dc81(0xe6)],'header':_0x421334[_0x41dc81(0xf0)],'data':_0x421334[_0x41dc81(0x109)]??{},'timeout':_0x421334['timeout'],'dataType':_0x421334[_0x41dc81(0xcd)]||'json','responseType':mappedResponseBodyType(_0x421334['responseType']),'sslVerify':_0x421334['sslVerify'],'withCredentials':_0x421334['withCredentials'],'firstIpv4':_0x421334['firstIpv4'],'enableHttp2':_0x421334[_0x41dc81(0xc8)],'enableQuic':_0x421334[_0x41dc81(0xef)],'enableCache':_0x421334[_0x41dc81(0x113)],'enableHttpDNS':_0x421334[_0x41dc81(0xca)],'httpDNSServiceId':_0x421334['httpDNSServiceId'],'enableChunked':_0x421334[_0x41dc81(0xf3)],'forceCellularNetwork':_0x421334[_0x41dc81(0xee)],'success':_0x2c7a59['onSuccess'],'fail':_0x2c7a59[_0x41dc81(0x105)],'complete':()=>{}};return uni['request'](_0x3edf08);}function dispatchUpload(_0x255ff5,_0x34f365,_0x4c7282){const _0x422fda=_0x2b5027,_0x13b266={};_0x13b266[_0x422fda(0xda)]=_0x255ff5,_0x13b266[_0x422fda(0xe9)]=_0x34f365['fileType'],_0x13b266['file']=_0x34f365['file'],_0x13b266['filePath']=_0x34f365[_0x422fda(0xe7)],_0x13b266['name']=_0x34f365['name']??'file',_0x13b266[_0x422fda(0xf6)]=_0x34f365[_0x422fda(0xf6)],_0x13b266['header']=_0x34f365[_0x422fda(0xf0)],_0x13b266[_0x422fda(0xe3)]=_0x34f365[_0x422fda(0x109)]??{},_0x13b266['timeout']=_0x34f365[_0x422fda(0xe5)],_0x13b266['success']=_0x4c7282['onSuccess'],_0x13b266['fail']=_0x4c7282[_0x422fda(0x105)],_0x13b266['complete']=()=>{};const _0x140615=_0x13b266;return uni['uploadFile'](_0x140615);}function dispatchDownload(_0x597dd8,_0x29b619,_0x574c10){const _0x45c597=_0x2b5027,_0x461ac6={'url':_0x597dd8,'header':_0x29b619['headers'],'timeout':_0x29b619[_0x45c597(0xe5)],'success':_0x36bee4=>{const _0x3aa507=_0x45c597,_0x498ac2={..._0x36bee4};_0x498ac2[_0x3aa507(0xd5)]={},_0x498ac2[_0x3aa507(0xd5)][_0x3aa507(0xd2)]=_0x36bee4['tempFilePath'],_0x574c10['onSuccess'](_0x498ac2);},'fail':_0x574c10['onFail'],'complete':()=>{}};return uni['downloadFile'](_0x461ac6);}function mappedResponseBodyType(_0x1b4f4a){const _0x108aaa=_0x2b5027;if(!_0x1b4f4a||_0x1b4f4a==='json')return'text';if(_0x1b4f4a===_0x108aaa(0xe8))return _0x108aaa(0xc6);return _0x108aaa(0x117);}var HttpError=class extends Error{constructor(_0x149bb2){super(_0x149bb2),this['name']='HttpError';}};function createResponseError(_0x1aebad,_0x14b814,_0x749082){const _0x150b8a=_0x2b5027,_0x3887f3=_0x1aebad,_0x42b20d='['+(_0x14b814?.['method']||'GET')+']\x20'+_0x3887f3,_0x5beff7=_0x749082?_0x749082[_0x150b8a(0x10c)]+'\x20'+(_0x749082[_0x150b8a(0xec)]||''):_0x150b8a(0xc4),_0x5a661d=_0x749082?JSON['stringify'](_0x749082[_0x150b8a(0xd5)]):'<no\x20response\x20body>',_0x464136=new HttpError(_0x42b20d+':\x20'+_0x5beff7+(_0x749082['data']?'\x20'+_0x5a661d:''));for(const _0x577157 of['request','options',_0x150b8a(0x103),'data'])Object[_0x150b8a(0xf8)](_0x464136,_0x577157,{'get'(){const _0x40ee5f=_0x150b8a,_0x12032e={};return _0x12032e[_0x40ee5f(0xf2)]=_0x1aebad,_0x12032e['options']=_0x14b814,_0x12032e['response']=_0x749082,_0x12032e['data']=_0x749082[_0x40ee5f(0xd5)],_0x12032e[_0x577157];}});return _0x464136;}function normalizeError(_0x47dca7){const _0x2e551b=_0x2b5027;if(_0x47dca7 instanceof Error)return _0x47dca7;return Object[_0x2e551b(0xd7)](new Error(_0x47dca7?.[_0x2e551b(0xec)]||_0x47dca7?.[_0x2e551b(0xfb)]||_0x2e551b(0xdd)),{'cause':_0x47dca7});}async function callRequestHooks(_0x19ded4,_0x4768ae){await _0x4768ae['onRequest']?.({'options':_0x4768ae,'resource':_0x19ded4});}async function callRequestErrorHooks(_0x2b2afd,_0x21d50d,_0x46e6fd){await _0x21d50d['onRequestError']?.({'options':_0x21d50d,'resource':_0x2b2afd,'error':_0x46e6fd});}async function callResponseHooks(_0xd08b59,_0x1f164a,_0x994454){const _0x1e3fcd=_0x2b5027;await _0x1f164a[_0x1e3fcd(0xd0)]?.({'options':_0x1f164a,'resource':_0xd08b59,'response':_0x994454});}async function callResponseErrorHooks(_0x591c48,_0x4ea977,_0x4ac985){const _0x481cf4=_0x2b5027;await _0x4ea977[_0x481cf4(0x112)]?.({'options':_0x4ea977,'resource':_0x591c48,'response':_0x4ac985});}async function refineResponse(_0x4da2d7,_0x5708ac){const _0x2e97c0=_0x2b5027;if(_0x5708ac[_0x2e97c0(0x110)]==='json'||!_0x5708ac['responseType'])return{..._0x4da2d7,'data':await parseJSONResponse(_0x4da2d7['data'],_0x5708ac)};return _0x4da2d7;}function parseJSONResponse(_0x1c5bbd,_0xf954a5){if(typeof _0x1c5bbd!=='string')return _0x1c5bbd;if(_0xf954a5['parseResponse'])return _0xf954a5['parseResponse'](_0x1c5bbd);return _0x1c5bbd?JSON['parse'](_0x1c5bbd):null;}function isResponseError(_0x471b14){const _0x565c17=_0x2b5027,_0x19a6c5='statusCode'in _0x471b14?_0x471b14[_0x565c17(0x10c)]:void 0x0;return typeof _0x19a6c5===_0x565c17(0xf1)&&(_0x19a6c5<0xc8||_0x19a6c5>=0x12c);}const DEFAULT_RETRY_STATUS_CODES=[0x198,0x199,0x1a9,0x1ad,0x1f4,0x1f6,0x1f7,0x1f8],PAYLOAD_METHODS=new Set([_0x2b5027(0x10a),_0x2b5027(0xc7),'DELETE',_0x2b5027(0x111)]);async function withRetry(_0x272f73,_0x29fd77){const _0x1adf15=_0x2b5027,_0x341cbd=resolveRetryCount(_0x272f73);for(let _0x48fe33=0x0;;_0x48fe33++)try{return await _0x29fd77();}catch(_0x2fd81c){if(_0x48fe33>=_0x341cbd||!shouldRetry(_0x2fd81c,_0x272f73))throw _0x2fd81c;await sleep(_0x272f73['retryDelay']??0x0,_0x272f73[_0x1adf15(0xf9)]);}}function resolveRetryCount(_0x1e67f1){const {retry:_0x532595}=_0x1e67f1;if(_0x532595===![])return 0x0;if(typeof _0x532595==='number')return _0x532595>0x0?_0x532595:0x0;return isPayloadMethod(_0x1e67f1['method'])?0x0:0x1;}function shouldRetry(_0x296f7e,_0x30f08b){const _0x5f4932=_0x2b5027;if(_0x30f08b[_0x5f4932(0xf9)]?.['aborted']||isAbortError(_0x296f7e))return![];const _0x5cc7c9=_0x296f7e?.[_0x5f4932(0x103)]?.[_0x5f4932(0x10c)];if(typeof _0x5cc7c9!=='number')return!![];return(_0x30f08b[_0x5f4932(0xed)]??DEFAULT_RETRY_STATUS_CODES)['includes'](_0x5cc7c9);}function isPayloadMethod(_0xdaf9fc){const _0x18bd6f=_0x2b5027;return!!_0xdaf9fc&&PAYLOAD_METHODS[_0x18bd6f(0x102)](_0xdaf9fc[_0x18bd6f(0xdb)]());}function sleep(_0x222eb3,_0x1ef38c){return new Promise((_0x28ec9a,_0x4ccc73)=>{const _0x11f9e1=_0x167a;if(_0x1ef38c?.[_0x11f9e1(0xdc)]){_0x4ccc73(_0x1ef38c['reason']);return;}if(!(_0x222eb3>0x0)){_0x28ec9a();return;}let _0x7332ae=()=>{};const _0xf1f75d=setTimeout(()=>{_0x7332ae(),_0x28ec9a();},_0x222eb3);_0x7332ae=onAbort(_0x1ef38c,()=>{clearTimeout(_0xf1f75d),_0x4ccc73(_0x1ef38c['reason']);});});}function buildURL(_0x201eb2,_0x2a07a9){const _0x1cfcc2=_0x2b5027,_0x445420=joinURL(_0x2a07a9[_0x1cfcc2(0x118)],_0x201eb2),_0x4e843f=_0x2a07a9['query']??{},_0x3cc429=Object['keys'](_0x4e843f)['filter'](_0x25b573=>_0x4e843f[_0x25b573]!==void 0x0)[_0x1cfcc2(0xce)](_0x2756e9=>{const _0x1f5fb9=_0x1cfcc2,_0x52f1a9=_0x4e843f[_0x2756e9];return(Array[_0x1f5fb9(0x10d)](_0x52f1a9)?_0x52f1a9:[_0x52f1a9])['map'](_0xd5d5c5=>encodeURIComponent(_0x2756e9)+'='+encodeURIComponent(String(_0xd5d5c5)));})[_0x1cfcc2(0x11a)]('&');if(!_0x3cc429)return _0x445420;return''+_0x445420+(_0x445420[_0x1cfcc2(0xd3)]('?')?'&':'?')+_0x3cc429;}function joinURL(_0x392199,_0xd1268b){const _0x22cddb=_0x2b5027;if(!_0x392199||isAbsoluteURL(_0xd1268b))return _0xd1268b;return _0x392199['replace'](/\/+$/,'')+'/'+_0xd1268b[_0x22cddb(0x100)](/^\/+/,'');}function isAbsoluteURL(_0x19be06){const _0x121396=_0x2b5027;return/^[a-z][a-z\d+\-.]*:\/\//i[_0x121396(0x104)](_0x19be06)||_0x19be06[_0x121396(0xc9)]('//');}function dispatchHttp(_0x3cdeaa,_0x5d2330,_0x221b47){const _0x4b121e=buildURL(_0x5d2330,_0x221b47);return withRetry(_0x221b47,()=>attemptRequest(_0x3cdeaa,_0x5d2330,_0x4b121e,_0x221b47));}function attemptRequest(_0x21d6d0,_0x513be7,_0x44cc30,_0x3a717d){const _0x31abf4=!!_0x3a717d['raw'];return new Promise((_0x33a20d,_0xbe2fa9)=>{const _0x4a52b6=_0x167a;let _0x53994c=![];const _0x58382f=_0x1c3808=>{if(_0x53994c)return;_0x53994c=!![],_0x1c3808();},_0x3f6362=onAbort(_0x3a717d['signal'],()=>{const _0x52d034=_0x167a;_0x58382f(()=>_0xbe2fa9(_0x3a717d['signal'][_0x52d034(0x106)]));}),_0x94bf9b=_0x5b89fe=>{_0x3f6362(),_0x58382f(_0x5b89fe);};callRequestHooks(_0x513be7,_0x3a717d)[_0x4a52b6(0xfd)](()=>{if(_0x53994c)return;dispatch(_0x21d6d0,_0x44cc30,_0x3a717d,{'onSuccess':_0x3ab3cf=>{Promise['resolve']()['then'](()=>refineResponse(_0x3ab3cf,_0x3a717d))['then'](async _0x4ab5cd=>{const _0x19dde6=_0x167a;if(isResponseError(_0x3ab3cf)){await callResponseErrorHooks(_0x513be7,_0x3a717d,_0x4ab5cd);if(!_0x3a717d[_0x19dde6(0xeb)])throw createResponseError(_0x513be7,_0x3a717d,_0x4ab5cd);}else await callResponseHooks(_0x513be7,_0x3a717d,_0x4ab5cd);_0x94bf9b(()=>_0x33a20d(_0x31abf4?_0x4ab5cd:_0x4ab5cd['data']));})['catch'](_0x3cbbb7=>_0x94bf9b(()=>_0xbe2fa9(_0x3cbbb7)));},'onFail':_0x3234b2=>{const _0x4796f8=_0x167a;Promise[_0x4796f8(0xc5)]()[_0x4796f8(0xfd)](async()=>{const _0x184679=normalizeError(_0x3234b2);if(!isAbortError(_0x184679))await callRequestErrorHooks(_0x513be7,_0x3a717d,_0x184679);throw _0x184679;})[_0x4796f8(0xcb)](_0x36a984=>_0x94bf9b(()=>_0xbe2fa9(_0x36a984)));}});})[_0x4a52b6(0xcb)](async _0x12011b=>{const _0x432976=normalizeError(_0x12011b);await callRequestErrorHooks(_0x513be7,_0x3a717d,_0x432976),_0x94bf9b(()=>_0xbe2fa9(_0x432976));});});}const _0x15a9f7={};_0x15a9f7['method']=_0x2b5027(0xfe),_0x15a9f7['responseType']=_0x2b5027(0xde);const defaultConfig=_0x15a9f7;function createHttp(_0x54e2ce={}){const _0x3aadf4=_0x2b5027,_0x52a994=(_0x210d5f,_0x38c05c)=>{const _0x3207f8=_0x167a;return dispatchHttp(_0x3207f8(0xf2),_0x210d5f,mergeOptions(defaultConfig,_0x54e2ce,_0x38c05c));},_0x53a720=(_0x59770d,_0x52af02)=>{const _0x52b156=_0x167a,_0x44400c={};return _0x44400c['method']=_0x52b156(0x10a),dispatchHttp(_0x52b156(0x116),_0x59770d,mergeOptions(defaultConfig,_0x54e2ce,_0x52af02,_0x44400c));},_0x268a29=(_0x462177,_0x2f6f20)=>{const _0x47567a=_0x167a,_0x11bf67={};return _0x11bf67[_0x47567a(0xe6)]=_0x47567a(0xfe),dispatchHttp(_0x47567a(0xc3),_0x462177,mergeOptions(defaultConfig,_0x54e2ce,_0x2f6f20,_0x11bf67));},_0x343296=_0x5d0dab=>createHttp(mergeOptions(_0x54e2ce,_0x5d0dab)),_0x41cd82={};return _0x41cd82[_0x3aadf4(0xf2)]=_0x52a994,_0x41cd82[_0x3aadf4(0x116)]=_0x53a720,_0x41cd82['download']=_0x268a29,_0x41cd82[_0x3aadf4(0xcf)]=_0x343296,_0x41cd82;}const http=createHttp();export{http as n,createHttpAborter as r,createHttp as t};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @oiyo/framework v0.4.0-beta.2
3
+ * Copyright (c) 2026 skiyee. All rights reserved.
4
+ * Commercial software. See LICENSE for terms.
5
+ * Official site: https://oiyo.js.org
6
+ */
7
+ const _0x351574=_0x5285;(function(_0x3dda41,_0x134864){const _0x654f75=_0x5285,_0x3e58da=_0x3dda41();while(!![]){try{const _0x306b2d=parseInt(_0x654f75(0x1be))/0x1*(parseInt(_0x654f75(0x1c9))/0x2)+-parseInt(_0x654f75(0x1c8))/0x3+-parseInt(_0x654f75(0x1ec))/0x4*(parseInt(_0x654f75(0x1e9))/0x5)+parseInt(_0x654f75(0x1b9))/0x6*(parseInt(_0x654f75(0x1c2))/0x7)+parseInt(_0x654f75(0x1fc))/0x8*(parseInt(_0x654f75(0x1f0))/0x9)+parseInt(_0x654f75(0x1d0))/0xa*(parseInt(_0x654f75(0x1fb))/0xb)+-parseInt(_0x654f75(0x210))/0xc;if(_0x306b2d===_0x134864)break;else _0x3e58da['push'](_0x3e58da['shift']());}catch(_0x503577){_0x3e58da['push'](_0x3e58da['shift']());}}}(_0x3192,0xad737));function createHttpAborter(){const _0x97092a=_0x5285,_0xa00505=new HttpAbortSignal();return{'signal':_0xa00505,'abort':_0x22b86c=>_0xa00505[_0x97092a(0x1dc)](_0x22b86c)};}const ABORT_ERROR_NAME='AbortError';var AbortEmitter=class{['listeners']=[];['addEventListener'](_0x1780b4,_0x3da2ed){const _0x3e81ef=_0x5285;if(_0x1780b4!==_0x3e81ef(0x1d9))return;this['listeners']['push'](_0x3da2ed);}[_0x351574(0x1bc)](_0x326a39,_0x5de996){const _0x711962=_0x351574;if(_0x326a39!==_0x711962(0x1d9))return;const _0x5e0cd1=this[_0x711962(0x1ee)][_0x711962(0x1f2)](_0x5de996);if(_0x5e0cd1!==-0x1)this[_0x711962(0x1ee)]['splice'](_0x5e0cd1,0x1);}['emit'](_0x302124){for(const _0x14d9c3 of this['listeners']['slice']())_0x14d9c3['call'](this,_0x302124);}},HttpAbortSignal=class extends AbortEmitter{[_0x351574(0x1cb)]=![];['reason']=void 0x0;['onabort']=null;['_abort'](_0x59c7e7){const _0xfbf602=_0x351574;if(this[_0xfbf602(0x1cb)])return;this['aborted']=!![],this[_0xfbf602(0x1ff)]=_0x59c7e7===void 0x0?createAbortError():_0x59c7e7;const _0x31b093={};_0x31b093[_0xfbf602(0x1c1)]=_0xfbf602(0x1d9);const _0x5648ad=_0x31b093;if(typeof this['onabort']==='function')this['onabort'](_0x5648ad);this[_0xfbf602(0x204)](_0x5648ad);}['throwIfAborted'](){const _0x24588c=_0x351574;if(this[_0x24588c(0x1cb)])throw this['reason'];}};function createAbortError(_0x9abc1e='The\x20operation\x20was\x20aborted'){const _0x232a3b=_0x351574,_0x3c8361=new Error(_0x9abc1e);return _0x3c8361[_0x232a3b(0x209)]=ABORT_ERROR_NAME,_0x3c8361;}function isAbortError(_0x382d76){const _0x1096ff=_0x351574;return _0x382d76 instanceof Error&&_0x382d76[_0x1096ff(0x209)]===ABORT_ERROR_NAME;}function onAbort(_0x4a2ab3,_0x2d0a9d){const _0x3e81c8=_0x351574;if(!_0x4a2ab3)return()=>{};if(_0x4a2ab3['aborted'])return _0x2d0a9d(),()=>{};return _0x4a2ab3[_0x3e81c8(0x1da)](_0x3e81c8(0x1d9),_0x2d0a9d),()=>_0x4a2ab3[_0x3e81c8(0x1bc)]('abort',_0x2d0a9d);}const HOOK_NAMES=['onRequest',_0x351574(0x1df),'onResponse','onResponseError'];function mergeOptions(..._0x2cc5cd){const _0x3a4cdd=_0x351574,_0x2b672c={},_0xa58b46={};for(const _0x3f4b87 of _0x2cc5cd){if(!_0x3f4b87)continue;for(const _0x7f763c of HOOK_NAMES)collectHook(_0xa58b46,_0x7f763c,_0x3f4b87);const _0x1d67e0=_0x2b672c['headers'],_0x46474f=_0x2b672c[_0x3a4cdd(0x20f)];Object[_0x3a4cdd(0x1e7)](_0x2b672c,_0x3f4b87);const _0x5378ec={..._0x1d67e0,..._0x3f4b87['headers']};_0x2b672c['headers']=_0x5378ec;const _0x3cbc7d={..._0x46474f,..._0x3f4b87[_0x3a4cdd(0x20f)]};_0x2b672c['query']=_0x3cbc7d;}for(const [_0x3d89f3,_0x191ac0]of Object['entries'](_0xa58b46))Object['assign'](_0x2b672c,{[_0x3d89f3]:async _0x1105de=>{for(const _0x4b290c of _0x191ac0)await _0x4b290c(_0x1105de);}});return _0x2b672c;}function collectHook(_0x4e63d8,_0x1e80ec,_0x56fab2){const _0x46234d=_0x351574,_0x51ea2a=_0x56fab2[_0x1e80ec];if(typeof _0x51ea2a!==_0x46234d(0x1d3))return;_0x4e63d8[_0x1e80ec]??=[],_0x4e63d8[_0x1e80ec][_0x46234d(0x1f6)](_0x51ea2a);}function dispatch(_0x55bc4,_0x1d7822,_0x14ca55,_0x5928a9){let _0x55e044;if(_0x55bc4==='upload')_0x55e044=dispatchUpload(_0x1d7822,_0x14ca55,_0x5928a9);else{if(_0x55bc4==='download')_0x55e044=dispatchDownload(_0x1d7822,_0x14ca55,_0x5928a9);else _0x55e044=dispatchRequest(_0x1d7822,_0x14ca55,_0x5928a9);}bindTask(_0x55e044,_0x14ca55);}function bindTask(_0x22c745,_0x1d119b){const _0xeb36b2=_0x351574;onAbort(_0x1d119b['signal'],()=>_0x22c745['abort']());if(typeof _0x1d119b['onHeadersReceived']===_0xeb36b2(0x1d3))_0x22c745[_0xeb36b2(0x1e6)](_0x1d119b['onHeadersReceived']);const _0x5b1125=_0x1d119b[_0xeb36b2(0x1c5)];if(typeof _0x5b1125===_0xeb36b2(0x1d3)&&'onProgressUpdate'in _0x22c745)_0x22c745[_0xeb36b2(0x1d5)](_0x5b1125);}function dispatchRequest(_0x4b2309,_0x8e2a75,_0xf439ec){const _0x338e01=_0x351574,_0x2b5a99={'url':_0x4b2309,'method':_0x8e2a75[_0x338e01(0x202)],'header':_0x8e2a75[_0x338e01(0x1f4)],'data':_0x8e2a75['body']??{},'timeout':_0x8e2a75[_0x338e01(0x1f8)],'dataType':_0x8e2a75['dataType']||_0x338e01(0x1cd),'responseType':mappedResponseBodyType(_0x8e2a75['responseType']),'sslVerify':_0x8e2a75[_0x338e01(0x1e3)],'withCredentials':_0x8e2a75['withCredentials'],'firstIpv4':_0x8e2a75[_0x338e01(0x1bd)],'enableHttp2':_0x8e2a75['enableHttp2'],'enableQuic':_0x8e2a75[_0x338e01(0x1d2)],'enableCache':_0x8e2a75['enableCache'],'enableHttpDNS':_0x8e2a75[_0x338e01(0x1ea)],'httpDNSServiceId':_0x8e2a75['httpDNSServiceId'],'enableChunked':_0x8e2a75['enableChunked'],'forceCellularNetwork':_0x8e2a75[_0x338e01(0x1e8)],'success':_0xf439ec[_0x338e01(0x1ba)],'fail':_0xf439ec['onFail'],'complete':()=>{}};return uni['request'](_0x2b5a99);}function dispatchUpload(_0x53cc8d,_0x5e74b9,_0x2ac009){const _0xc9a1a2=_0x351574,_0x128c5c={};_0x128c5c[_0xc9a1a2(0x1d7)]=_0x53cc8d,_0x128c5c['fileType']=_0x5e74b9['fileType'],_0x128c5c['file']=_0x5e74b9['file'],_0x128c5c[_0xc9a1a2(0x1f3)]=_0x5e74b9['filePath'],_0x128c5c[_0xc9a1a2(0x209)]=_0x5e74b9['name']??'file',_0x128c5c[_0xc9a1a2(0x1db)]=_0x5e74b9[_0xc9a1a2(0x1db)],_0x128c5c[_0xc9a1a2(0x1e0)]=_0x5e74b9['headers'],_0x128c5c[_0xc9a1a2(0x1c0)]=_0x5e74b9['body']??{},_0x128c5c[_0xc9a1a2(0x1f8)]=_0x5e74b9[_0xc9a1a2(0x1f8)],_0x128c5c[_0xc9a1a2(0x1cf)]=_0x2ac009[_0xc9a1a2(0x1ba)],_0x128c5c[_0xc9a1a2(0x20e)]=_0x2ac009['onFail'],_0x128c5c[_0xc9a1a2(0x1f9)]=()=>{};const _0x5d9b1d=_0x128c5c;return uni[_0xc9a1a2(0x1ca)](_0x5d9b1d);}function dispatchDownload(_0x1bf236,_0x1a1f29,_0x199441){const _0x566d45=_0x351574,_0x48f6e5={'url':_0x1bf236,'header':_0x1a1f29['headers'],'timeout':_0x1a1f29[_0x566d45(0x1f8)],'success':_0xdae9b2=>{const _0x39711e=_0x566d45,_0x978b60={..._0xdae9b2};_0x978b60[_0x39711e(0x1cc)]={},_0x978b60[_0x39711e(0x1cc)][_0x39711e(0x203)]=_0xdae9b2['tempFilePath'],_0x199441['onSuccess'](_0x978b60);},'fail':_0x199441[_0x566d45(0x1c6)],'complete':()=>{}};return uni[_0x566d45(0x1e1)](_0x48f6e5);}function mappedResponseBodyType(_0x28d927){const _0x20de18=_0x351574;if(!_0x28d927||_0x28d927===_0x20de18(0x1cd))return _0x20de18(0x1d6);if(_0x28d927==='arrayBuffer')return'arraybuffer';return'text';}var HttpError=class extends Error{constructor(_0x70f2ed){const _0x4a601a=_0x351574;super(_0x70f2ed),this['name']=_0x4a601a(0x211);}};function createResponseError(_0x13895c,_0x45c0e0,_0x3968e9){const _0x5b79de=_0x351574,_0x332078=_0x13895c,_0x5d3d11='['+(_0x45c0e0?.[_0x5b79de(0x202)]||'GET')+']\x20'+_0x332078,_0x3b278a=_0x3968e9?_0x3968e9['statusCode']+'\x20'+(_0x3968e9[_0x5b79de(0x1e2)]||''):'<no\x20response>',_0x30484f=_0x3968e9?JSON['stringify'](_0x3968e9['data']):_0x5b79de(0x1f7),_0x4e8bdb=new HttpError(_0x5d3d11+':\x20'+_0x3b278a+(_0x3968e9['data']?'\x20'+_0x30484f:''));for(const _0x1cb020 of['request','options',_0x5b79de(0x206),_0x5b79de(0x1cc)])Object[_0x5b79de(0x1bb)](_0x4e8bdb,_0x1cb020,{'get'(){const _0x41dbcb=_0x5b79de,_0x3d3862={};return _0x3d3862[_0x41dbcb(0x1de)]=_0x13895c,_0x3d3862[_0x41dbcb(0x1c7)]=_0x45c0e0,_0x3d3862['response']=_0x3968e9,_0x3d3862['data']=_0x3968e9[_0x41dbcb(0x1cc)],_0x3d3862[_0x1cb020];}});return _0x4e8bdb;}function normalizeError(_0x2d12d0){if(_0x2d12d0 instanceof Error)return _0x2d12d0;return Object['assign'](new Error(_0x2d12d0?.['errMsg']||_0x2d12d0?.['message']||'HTTP\x20request\x20failed'),{'cause':_0x2d12d0});}async function callRequestHooks(_0x5adcaa,_0x59040b){await _0x59040b['onRequest']?.({'options':_0x59040b,'resource':_0x5adcaa});}async function callRequestErrorHooks(_0xb96117,_0x4e2277,_0x481625){await _0x4e2277['onRequestError']?.({'options':_0x4e2277,'resource':_0xb96117,'error':_0x481625});}async function callResponseHooks(_0x4a72e9,_0x43a748,_0xc72657){const _0x2fef8f=_0x351574;await _0x43a748[_0x2fef8f(0x1dd)]?.({'options':_0x43a748,'resource':_0x4a72e9,'response':_0xc72657});}async function callResponseErrorHooks(_0xfc7503,_0x103eb4,_0x2288d2){const _0x165a83=_0x351574;await _0x103eb4[_0x165a83(0x20d)]?.({'options':_0x103eb4,'resource':_0xfc7503,'response':_0x2288d2});}async function refineResponse(_0x38dd83,_0x4223c3){const _0x36464f=_0x351574;if(_0x4223c3[_0x36464f(0x1c4)]===_0x36464f(0x1cd)||!_0x4223c3[_0x36464f(0x1c4)])return{..._0x38dd83,'data':await parseJSONResponse(_0x38dd83[_0x36464f(0x1cc)],_0x4223c3)};return _0x38dd83;}function parseJSONResponse(_0x3cd3ef,_0x402e33){const _0x2429d9=_0x351574;if(typeof _0x3cd3ef!=='string')return _0x3cd3ef;if(_0x402e33['parseResponse'])return _0x402e33[_0x2429d9(0x205)](_0x3cd3ef);return _0x3cd3ef?JSON[_0x2429d9(0x212)](_0x3cd3ef):null;}function isResponseError(_0x4e6002){const _0x34df53=_0x351574,_0x1bdd85=_0x34df53(0x1fd)in _0x4e6002?_0x4e6002[_0x34df53(0x1fd)]:void 0x0;return typeof _0x1bdd85==='number'&&(_0x1bdd85<0xc8||_0x1bdd85>=0x12c);}const DEFAULT_RETRY_STATUS_CODES=[0x198,0x199,0x1a9,0x1ad,0x1f4,0x1f6,0x1f7,0x1f8],PAYLOAD_METHODS=new Set(['POST','PUT','DELETE',_0x351574(0x207)]);async function withRetry(_0x59edb3,_0x32970a){const _0x258cb4=_0x351574,_0x227341=resolveRetryCount(_0x59edb3);for(let _0x3ca263=0x0;;_0x3ca263++)try{return await _0x32970a();}catch(_0xb1b8f6){if(_0x3ca263>=_0x227341||!shouldRetry(_0xb1b8f6,_0x59edb3))throw _0xb1b8f6;await sleep(_0x59edb3[_0x258cb4(0x1c3)]??0x0,_0x59edb3['signal']);}}function resolveRetryCount(_0xfbd84f){const {retry:_0x24f350}=_0xfbd84f;if(_0x24f350===![])return 0x0;if(typeof _0x24f350==='number')return _0x24f350>0x0?_0x24f350:0x0;return isPayloadMethod(_0xfbd84f['method'])?0x0:0x1;}function shouldRetry(_0x351c59,_0x5a14d2){const _0x244442=_0x351574;if(_0x5a14d2['signal']?.['aborted']||isAbortError(_0x351c59))return![];const _0x34ac20=_0x351c59?.['response']?.[_0x244442(0x1fd)];if(typeof _0x34ac20!==_0x244442(0x1fe))return!![];return(_0x5a14d2['retryStatusCodes']??DEFAULT_RETRY_STATUS_CODES)['includes'](_0x34ac20);}function isPayloadMethod(_0x312403){return!!_0x312403&&PAYLOAD_METHODS['has'](_0x312403['toUpperCase']());}function sleep(_0x1cea43,_0x3aba64){return new Promise((_0x3544a1,_0x1a7273)=>{const _0x465650=_0x5285;if(_0x3aba64?.['aborted']){_0x1a7273(_0x3aba64[_0x465650(0x1ff)]);return;}if(!(_0x1cea43>0x0)){_0x3544a1();return;}let _0x35f8a8=()=>{};const _0x59a2d1=setTimeout(()=>{_0x35f8a8(),_0x3544a1();},_0x1cea43);_0x35f8a8=onAbort(_0x3aba64,()=>{const _0x3731df=_0x465650;clearTimeout(_0x59a2d1),_0x1a7273(_0x3aba64[_0x3731df(0x1ff)]);});});}function buildURL(_0x3a3101,_0x341a47){const _0x558409=_0x351574,_0xfbdddd=joinURL(_0x341a47[_0x558409(0x201)],_0x3a3101),_0x58d150=_0x341a47[_0x558409(0x20f)]??{},_0x2f5010=Object[_0x558409(0x1fa)](_0x58d150)[_0x558409(0x1d1)](_0x139ae8=>_0x58d150[_0x139ae8]!==void 0x0)[_0x558409(0x1eb)](_0x2992ce=>{const _0x1eeb56=_0x558409,_0x2fa4a9=_0x58d150[_0x2992ce];return(Array[_0x1eeb56(0x1ef)](_0x2fa4a9)?_0x2fa4a9:[_0x2fa4a9])['map'](_0x413df2=>encodeURIComponent(_0x2992ce)+'='+encodeURIComponent(String(_0x413df2)));})['join']('&');if(!_0x2f5010)return _0xfbdddd;return''+_0xfbdddd+(_0xfbdddd[_0x558409(0x208)]('?')?'&':'?')+_0x2f5010;}function joinURL(_0xc9c725,_0x5c5f4b){const _0x5416d7=_0x351574;if(!_0xc9c725||isAbsoluteURL(_0x5c5f4b))return _0x5c5f4b;return _0xc9c725[_0x5416d7(0x20c)](/\/+$/,'')+'/'+_0x5c5f4b['replace'](/^\/+/,'');}function _0x3192(){const _0x320e1a=['createHttpAborter','baseURL','method','tempFilePath','emit','parseResponse','response','PATCH','includes','name','http','test','replace','onResponseError','fail','query','15123144jlAnLe','HttpError','parse','6738048RErlwD','onSuccess','defineProperty','removeEventListener','firstIpv4','1zIaQRD','resolve','formData','type','7fMmGVE','retryDelay','responseType','onProgress','onFail','options','3458793dAXUyE','2109010zVdftr','uploadFile','aborted','data','json','GET','success','10RPeexx','filter','enableQuic','function','catch','onProgressUpdate','text','url','ignoreResponseError','abort','addEventListener','files','_abort','onResponse','request','onRequestError','header','downloadFile','errMsg','sslVerify','create','enumerable','onHeadersReceived','assign','forceCellularNetwork','5yCBSUn','enableHttpDNS','flatMap','2491400ToKVZZ','download','listeners','isArray','64791TCjgSo','createHttp','indexOf','filePath','headers','upload','push','<no\x20response\x20body>','timeout','complete','keys','15437488odBFLk','184cOvrfM','statusCode','number','reason'];_0x3192=function(){return _0x320e1a;};return _0x3192();}function isAbsoluteURL(_0x5ccea9){const _0xb1a615=_0x351574;return/^[a-z][a-z\d+\-.]*:\/\//i[_0xb1a615(0x20b)](_0x5ccea9)||_0x5ccea9['startsWith']('//');}function dispatchHttp(_0x461db6,_0x3b6e1e,_0x247ea3){const _0x68a1fd=buildURL(_0x3b6e1e,_0x247ea3);return withRetry(_0x247ea3,()=>attemptRequest(_0x461db6,_0x3b6e1e,_0x68a1fd,_0x247ea3));}function attemptRequest(_0x4e39c3,_0x1e5cc2,_0x2c368e,_0x3011b5){const _0x19cba3=!!_0x3011b5['raw'];return new Promise((_0x355fb3,_0x5353d4)=>{let _0x7773e5=![];const _0x37f1a5=_0x2e573a=>{if(_0x7773e5)return;_0x7773e5=!![],_0x2e573a();},_0x10ff81=onAbort(_0x3011b5['signal'],()=>{const _0x318cb3=_0x5285;_0x37f1a5(()=>_0x5353d4(_0x3011b5['signal'][_0x318cb3(0x1ff)]));}),_0x13ba6a=_0x242e84=>{_0x10ff81(),_0x37f1a5(_0x242e84);};callRequestHooks(_0x1e5cc2,_0x3011b5)['then'](()=>{if(_0x7773e5)return;dispatch(_0x4e39c3,_0x2c368e,_0x3011b5,{'onSuccess':_0xcdca6=>{const _0x4b0a19=_0x5285;Promise['resolve']()['then'](()=>refineResponse(_0xcdca6,_0x3011b5))['then'](async _0x584a5b=>{const _0x15b8f7=_0x5285;if(isResponseError(_0xcdca6)){await callResponseErrorHooks(_0x1e5cc2,_0x3011b5,_0x584a5b);if(!_0x3011b5[_0x15b8f7(0x1d8)])throw createResponseError(_0x1e5cc2,_0x3011b5,_0x584a5b);}else await callResponseHooks(_0x1e5cc2,_0x3011b5,_0x584a5b);_0x13ba6a(()=>_0x355fb3(_0x19cba3?_0x584a5b:_0x584a5b['data']));})[_0x4b0a19(0x1d4)](_0x1c1f3e=>_0x13ba6a(()=>_0x5353d4(_0x1c1f3e)));},'onFail':_0x73c10a=>{const _0x3416a4=_0x5285;Promise[_0x3416a4(0x1bf)]()['then'](async()=>{const _0x256138=normalizeError(_0x73c10a);if(!isAbortError(_0x256138))await callRequestErrorHooks(_0x1e5cc2,_0x3011b5,_0x256138);throw _0x256138;})[_0x3416a4(0x1d4)](_0x33ec24=>_0x13ba6a(()=>_0x5353d4(_0x33ec24)));}});})['catch'](async _0x2de28c=>{const _0x1806c5=normalizeError(_0x2de28c);await callRequestErrorHooks(_0x1e5cc2,_0x3011b5,_0x1806c5),_0x13ba6a(()=>_0x5353d4(_0x1806c5));});});}const _0x488ff8={};_0x488ff8['method']='GET',_0x488ff8[_0x351574(0x1c4)]=_0x351574(0x1cd);const defaultConfig=_0x488ff8;function _0x5285(_0x2e7584,_0x4bc5f2){_0x2e7584=_0x2e7584-0x1b9;const _0x319204=_0x3192();let _0x5285e0=_0x319204[_0x2e7584];return _0x5285e0;}function createHttp(_0x4fadc9={}){const _0x58b816=_0x351574,_0x5bf06c=(_0x273403,_0x14639a)=>{const _0x525d50=_0x5285;return dispatchHttp(_0x525d50(0x1de),_0x273403,mergeOptions(defaultConfig,_0x4fadc9,_0x14639a));},_0x4f4e25=(_0x3ae0c5,_0x3cbb5e)=>{const _0x2530bb=_0x5285,_0x4cc701={};return _0x4cc701[_0x2530bb(0x202)]='POST',dispatchHttp(_0x2530bb(0x1f5),_0x3ae0c5,mergeOptions(defaultConfig,_0x4fadc9,_0x3cbb5e,_0x4cc701));},_0xdb3334=(_0x173979,_0x482970)=>{const _0x233ab8=_0x5285,_0x4a26ea={};return _0x4a26ea[_0x233ab8(0x202)]=_0x233ab8(0x1ce),dispatchHttp(_0x233ab8(0x1ed),_0x173979,mergeOptions(defaultConfig,_0x4fadc9,_0x482970,_0x4a26ea));},_0x456954=_0x5f20c3=>createHttp(mergeOptions(_0x4fadc9,_0x5f20c3)),_0x32e13={};return _0x32e13[_0x58b816(0x1de)]=_0x5bf06c,_0x32e13['upload']=_0x4f4e25,_0x32e13['download']=_0xdb3334,_0x32e13[_0x58b816(0x1e4)]=_0x456954,_0x32e13;}const http=createHttp(),_0x25be38={};_0x25be38['enumerable']=!![],_0x25be38['get']=function(){return createHttp;},Object[_0x351574(0x1bb)](exports,_0x351574(0x1f1),_0x25be38);const _0xc1833f={};_0xc1833f[_0x351574(0x1e5)]=!![],_0xc1833f['get']=function(){return createHttpAborter;},Object[_0x351574(0x1bb)](exports,_0x351574(0x200),_0xc1833f);const _0xe345cf={};_0xe345cf[_0x351574(0x1e5)]=!![],_0xe345cf['get']=function(){return http;},Object['defineProperty'](exports,_0x351574(0x20a),_0xe345cf);
package/dist/oiyo.cjs ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @oiyo/framework v0.4.0-beta.2
3
+ * Copyright (c) 2026 skiyee. All rights reserved.
4
+ * Commercial software. See LICENSE for terms.
5
+ * Official site: https://oiyo.js.org
6
+ */
7
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
8
+ const require_oiyo = require("./oiyo-CZ64L3f6.cjs");
9
+ exports.createHttp = require_oiyo.createHttp;
10
+ exports.createHttpAborter = require_oiyo.createHttpAborter;
11
+ exports.http = require_oiyo.http;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @oiyo/framework v0.4.0-beta.2
3
+ * Copyright (c) 2026 skiyee. All rights reserved.
4
+ * Commercial software. See LICENSE for terms.
5
+ * Official site: https://oiyo.js.org
6
+ */
7
+ import { a as HttpDownloadResponse, c as HttpDownloadOptions, d as ResponseBodyType, f as createHttpAborter, i as HttpError, l as HttpRequestOptions, n as http, o as HttpRequestResponse, r as HttpConfig, s as HttpUploadResponse, t as createHttp, u as HttpUploadOptions } from "./index-DCAh9vr9.cjs";
8
+ export { type HttpConfig, type HttpDownloadOptions, type HttpDownloadResponse, type HttpError, type HttpRequestOptions, type HttpRequestResponse, type HttpUploadOptions, type HttpUploadResponse, type ResponseBodyType, createHttp, createHttpAborter, http };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @oiyo/framework v0.4.0-beta.2
3
+ * Copyright (c) 2026 skiyee. All rights reserved.
4
+ * Commercial software. See LICENSE for terms.
5
+ * Official site: https://oiyo.js.org
6
+ */
7
+ import { a as HttpDownloadResponse, c as HttpDownloadOptions, d as ResponseBodyType, f as createHttpAborter, i as HttpError, l as HttpRequestOptions, n as http, o as HttpRequestResponse, r as HttpConfig, s as HttpUploadResponse, t as createHttp, u as HttpUploadOptions } from "./index-DCAh9vr9.mjs";
8
+ export { type HttpConfig, type HttpDownloadOptions, type HttpDownloadResponse, type HttpError, type HttpRequestOptions, type HttpRequestResponse, type HttpUploadOptions, type HttpUploadResponse, type ResponseBodyType, createHttp, createHttpAborter, http };
package/dist/oiyo.mjs ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @oiyo/framework v0.4.0-beta.2
3
+ * Copyright (c) 2026 skiyee. All rights reserved.
4
+ * Commercial software. See LICENSE for terms.
5
+ * Official site: https://oiyo.js.org
6
+ */
7
+ import { n as http, r as createHttpAborter, t as createHttp } from "./oiyo-CUWG-Hhg.mjs";
8
+ export { createHttp, createHttpAborter, http };
package/dist/uni.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
6
6
  */
7
7
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
8
- require("./chunk-pi1SoIKQ.cjs");
8
+ require("./chunk-BnILMwZG.cjs");
9
9
  var _dcloudio_uni_app = require("@dcloudio/uni-app");
10
10
  Object.keys(_dcloudio_uni_app).forEach(function(k) {
11
11
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
package/dist/uni.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
package/dist/uni.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
package/dist/uni.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
6
6
  */
7
- import "./chunk-BKnNvmwS.mjs";
7
+ import "./chunk-Bcqm9nz_.mjs";
8
8
  export * from "@dcloudio/uni-app";
9
9
  export {};
package/dist/vue.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
6
6
  */
7
7
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
8
- require("./chunk-pi1SoIKQ.cjs");
8
+ require("./chunk-BnILMwZG.cjs");
9
9
  var vue = require("vue");
10
10
  Object.keys(vue).forEach(function(k) {
11
11
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
package/dist/vue.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
package/dist/vue.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
package/dist/vue.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @oiyo/framework v0.3.11
2
+ * @oiyo/framework v0.4.0-beta.2
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
6
6
  */
7
- import "./chunk-BKnNvmwS.mjs";
7
+ import "./chunk-Bcqm9nz_.mjs";
8
8
  export * from "vue";
9
9
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oiyo/framework",
3
3
  "type": "module",
4
- "version": "0.3.11",
4
+ "version": "0.4.0-beta.2",
5
5
  "author": {
6
6
  "name": "skiyee",
7
7
  "email": "319619193@qq.com",
@@ -26,6 +26,14 @@
26
26
  "import": "./dist/index.mjs",
27
27
  "require": "./dist/index.cjs"
28
28
  },
29
+ "./oiyo": {
30
+ "types": {
31
+ "import": "./dist/oiyo.d.mts",
32
+ "require": "./dist/oiyo.d.cts"
33
+ },
34
+ "import": "./dist/oiyo.mjs",
35
+ "require": "./dist/oiyo.cjs"
36
+ },
29
37
  "./vue": {
30
38
  "types": {
31
39
  "import": "./dist/vue.d.mts",