@oiyo/framework 0.4.6 → 0.4.8
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.
- package/dist/{index-DQmyoOzM.d.cts → index-CsfNc8p2.d.cts} +43 -33
- package/dist/{index-DQmyoOzM.d.mts → index-CsfNc8p2.d.mts} +43 -33
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/oiyo-CohaZv3I.mjs +7 -0
- package/dist/oiyo-CwQjYs6D.cjs +7 -0
- package/dist/oiyo.cjs +2 -2
- package/dist/oiyo.d.cts +3 -3
- package/dist/oiyo.d.mts +3 -3
- package/dist/oiyo.mjs +2 -2
- package/dist/uni.cjs +1 -1
- package/dist/uni.d.cts +1 -1
- package/dist/uni.d.mts +1 -1
- package/dist/uni.mjs +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.cts +1 -1
- package/dist/vue.d.mts +1 -1
- package/dist/vue.mjs +1 -1
- package/package.json +1 -1
- package/dist/oiyo-CASn7hkX.cjs +0 -7
- package/dist/oiyo-DxaznqPn.mjs +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/framework v0.4.
|
|
2
|
+
* @oiyo/framework v0.4.8
|
|
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
|
|
@@ -57,22 +57,21 @@ type MappedResponseBodyType<TRBType extends ResponseBodyType, TRBJsonType = any>
|
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/oiyo/http/types/uni.d.ts
|
|
59
59
|
type UniAppRequestOptions = Omit<UniNamespace.RequestOptions, 'url' | 'data' | 'header' | 'method' | 'timeout' | 'responseType' | 'success' | 'fail' | 'complete'>;
|
|
60
|
+
interface UniAppOnChunkData {
|
|
61
|
+
data: ArrayBuffer;
|
|
62
|
+
}
|
|
60
63
|
type UniAppRequestResponse<TRBody = any> = Prettify<Omit<UniNamespace.RequestSuccessCallbackResult, 'data'> & {
|
|
61
64
|
data: TRBody;
|
|
62
65
|
}>;
|
|
63
66
|
type UniAppUploadOptions = Omit<UniNamespace.UploadFileOption, 'url' | 'header' | 'formData' | 'timeout' | 'success' | 'fail' | 'complete'>;
|
|
64
|
-
interface
|
|
67
|
+
interface UniAppOnUploadProgressData extends UniNamespace.OnProgressUpdateResult {}
|
|
65
68
|
type UniAppUploadResponse<TRBody = any> = Prettify<Omit<UniNamespace.UploadFileSuccessCallbackResult, 'data'> & {
|
|
66
69
|
data: TRBody;
|
|
67
70
|
}>;
|
|
68
71
|
type UniAppDownloadBodyType = 'json';
|
|
69
72
|
type UniAppDownloadBody = Prettify<Pick<UniNamespace.DownloadSuccessData, 'tempFilePath'>>;
|
|
70
73
|
type UniAppDownloadOptions = Omit<UniNamespace.DownloadFileOption, 'url' | 'header' | 'timeout' | 'success' | 'fail' | 'complete'>;
|
|
71
|
-
interface
|
|
72
|
-
progress: number;
|
|
73
|
-
totalBytesWritten: number;
|
|
74
|
-
totalBytesExpectedToWrite: number;
|
|
75
|
-
}
|
|
74
|
+
interface UniAppDownloadProgressData extends UniNamespace.OnProgressDownloadResult {}
|
|
76
75
|
type UniAppDownloadResponse<TRBody = any> = Prettify<Omit<UniNamespace.DownloadSuccessData, keyof UniAppDownloadBody> & {
|
|
77
76
|
data: TRBody;
|
|
78
77
|
}>;
|
|
@@ -120,7 +119,16 @@ interface HttpCommonOptions<TRBType extends ResponseBodyType = ResponseBodyType>
|
|
|
120
119
|
onHeadersReceived?: (result: HeadersReceived) => void;
|
|
121
120
|
}
|
|
122
121
|
interface HttpRequestOptions<TRBType extends ResponseBodyType = ResponseBodyType> extends HttpCommonOptions<TRBType>, UniAppRequestOptions {
|
|
122
|
+
/**
|
|
123
|
+
* 普通请求方法,强制 POST
|
|
124
|
+
* @default - 'POST'
|
|
125
|
+
*/
|
|
123
126
|
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT';
|
|
127
|
+
/**
|
|
128
|
+
* 监听流式数据
|
|
129
|
+
* @description onChunkReceived
|
|
130
|
+
*/
|
|
131
|
+
onChunk?: (data: UniAppOnChunkData) => void;
|
|
124
132
|
}
|
|
125
133
|
interface HttpUploadOptions<TRBType extends ResponseBodyType = ResponseBodyType> extends HttpCommonOptions<TRBType>, UniAppUploadOptions {
|
|
126
134
|
/**
|
|
@@ -129,9 +137,10 @@ interface HttpUploadOptions<TRBType extends ResponseBodyType = ResponseBodyType>
|
|
|
129
137
|
*/
|
|
130
138
|
method?: 'POST';
|
|
131
139
|
/**
|
|
132
|
-
*
|
|
140
|
+
* 监听上传进度
|
|
141
|
+
* @description 对应 onProgressUpdate
|
|
133
142
|
*/
|
|
134
|
-
onProgress?: (
|
|
143
|
+
onProgress?: (data: UniAppOnUploadProgressData) => void;
|
|
135
144
|
}
|
|
136
145
|
interface HttpDownloadOptions<TRBType extends UniAppDownloadBodyType = 'json'> extends HttpCommonOptions<TRBType>, UniAppDownloadOptions {
|
|
137
146
|
/**
|
|
@@ -140,40 +149,41 @@ interface HttpDownloadOptions<TRBType extends UniAppDownloadBodyType = 'json'> e
|
|
|
140
149
|
*/
|
|
141
150
|
method?: 'GET';
|
|
142
151
|
/**
|
|
143
|
-
*
|
|
152
|
+
* 监听下载进度
|
|
153
|
+
* @description 对应 onProgressUpdate
|
|
144
154
|
*/
|
|
145
|
-
onProgress?: (
|
|
155
|
+
onProgress?: (data: UniAppDownloadProgressData) => void;
|
|
146
156
|
}
|
|
147
157
|
type HttpURL = string;
|
|
148
158
|
interface HttpOptions extends HttpCommonOptions, UniAppRequestOptions, UniAppUploadOptions, UniAppDownloadOptions {}
|
|
149
159
|
//#endregion
|
|
150
160
|
//#region src/oiyo/http/types/response.d.ts
|
|
151
|
-
type
|
|
152
|
-
type
|
|
153
|
-
type
|
|
154
|
-
type
|
|
155
|
-
type
|
|
156
|
-
type
|
|
157
|
-
type
|
|
161
|
+
type HttpRequestResult<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = MappedResponseBodyType<TRBType, TRBody>;
|
|
162
|
+
type HttpUploadResult<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = MappedResponseBodyType<TRBType, TRBody>;
|
|
163
|
+
type HttpDownloadResult<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = 'json'> = MappedResponseBodyType<TRBType, TRBody>;
|
|
164
|
+
type HttpRequestResponse<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = UniAppRequestResponse<MappedResponseBodyType<TRBType, TRBody>>;
|
|
165
|
+
type HttpUploadResponse<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = UniAppUploadResponse<MappedResponseBodyType<TRBType, TRBody>>;
|
|
166
|
+
type HttpDownloadResponse<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = 'json'> = UniAppDownloadResponse<MappedResponseBodyType<TRBType, TRBody>>;
|
|
167
|
+
type HttpResponse<T = any> = HttpRequestResponse<T> | HttpUploadResponse<T> | HttpDownloadResponse;
|
|
158
168
|
//#endregion
|
|
159
169
|
//#region src/oiyo/http/types/core.d.ts
|
|
160
|
-
interface
|
|
170
|
+
interface HttpRequest {
|
|
161
171
|
<TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options: HttpRequestOptions<TRBType> & {
|
|
162
172
|
raw: true;
|
|
163
|
-
}): Promise<
|
|
164
|
-
<TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options?: HttpRequestOptions<TRBType>): Promise<
|
|
173
|
+
}): Promise<HttpRequestResponse<TRBody, TRBType>>;
|
|
174
|
+
<TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options?: HttpRequestOptions<TRBType>): Promise<HttpRequestResult<TRBody, TRBType>>;
|
|
165
175
|
}
|
|
166
|
-
interface
|
|
176
|
+
interface HttpUpload {
|
|
167
177
|
<TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options: HttpUploadOptions<TRBType> & {
|
|
168
178
|
raw: true;
|
|
169
|
-
}): Promise<
|
|
170
|
-
<TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options?: HttpUploadOptions<TRBType>): Promise<
|
|
179
|
+
}): Promise<HttpUploadResponse<TRBody, TRBType>>;
|
|
180
|
+
<TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options?: HttpUploadOptions<TRBType>): Promise<HttpUploadResult<TRBody, TRBType>>;
|
|
171
181
|
}
|
|
172
|
-
interface
|
|
182
|
+
interface HttpDownload {
|
|
173
183
|
<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = UniAppDownloadBodyType>(resource: HttpURL, options: HttpDownloadOptions<TRBType> & {
|
|
174
184
|
raw: true;
|
|
175
|
-
}): Promise<
|
|
176
|
-
<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = UniAppDownloadBodyType>(resource: HttpURL, options?: HttpDownloadOptions<TRBType>): Promise<
|
|
185
|
+
}): Promise<HttpDownloadResponse<TRBody, TRBType>>;
|
|
186
|
+
<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = UniAppDownloadBodyType>(resource: HttpURL, options?: HttpDownloadOptions<TRBType>): Promise<HttpDownloadResult<TRBody, TRBType>>;
|
|
177
187
|
}
|
|
178
188
|
interface HttpHooks<TContextOptions, TResponse> {
|
|
179
189
|
onRequest?: (context: {
|
|
@@ -196,11 +206,11 @@ interface HttpHooks<TContextOptions, TResponse> {
|
|
|
196
206
|
response: TResponse;
|
|
197
207
|
}) => MaybePromise<void>;
|
|
198
208
|
}
|
|
199
|
-
interface HttpConfig extends HttpCommonOptions, HttpHooks<HttpOptions,
|
|
209
|
+
interface HttpConfig extends HttpCommonOptions, HttpHooks<HttpOptions, HttpResponse> {}
|
|
200
210
|
interface HttpError<T = any> extends Error {
|
|
201
211
|
resource?: HttpURL;
|
|
202
212
|
options?: HttpOptions;
|
|
203
|
-
response?:
|
|
213
|
+
response?: HttpResponse<T>;
|
|
204
214
|
data: T;
|
|
205
215
|
}
|
|
206
216
|
//#endregion
|
|
@@ -209,15 +219,15 @@ interface Http {
|
|
|
209
219
|
/**
|
|
210
220
|
* 普通请求
|
|
211
221
|
*/
|
|
212
|
-
request:
|
|
222
|
+
request: HttpRequest;
|
|
213
223
|
/**
|
|
214
224
|
* 文件上传
|
|
215
225
|
*/
|
|
216
|
-
upload:
|
|
226
|
+
upload: HttpUpload;
|
|
217
227
|
/**
|
|
218
228
|
* 文件下载
|
|
219
229
|
*/
|
|
220
|
-
download:
|
|
230
|
+
download: HttpDownload;
|
|
221
231
|
/**
|
|
222
232
|
* 基于当前配置派生一个新实例。
|
|
223
233
|
*/
|
|
@@ -226,4 +236,4 @@ interface Http {
|
|
|
226
236
|
declare function createHttp(globalConfig?: HttpConfig): Http;
|
|
227
237
|
declare const http: Http;
|
|
228
238
|
//#endregion
|
|
229
|
-
export { HttpDownloadResponse as a,
|
|
239
|
+
export { HttpDownloadResponse as a, HttpUploadResponse as c, HttpOptions as d, HttpRequestOptions as f, createHttpAborter as h, HttpError as i, HttpCommonOptions as l, ResponseBodyType as m, http as n, HttpRequestResponse as o, HttpUploadOptions as p, HttpConfig as r, HttpResponse as s, createHttp as t, HttpDownloadOptions as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/framework v0.4.
|
|
2
|
+
* @oiyo/framework v0.4.8
|
|
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
|
|
@@ -57,22 +57,21 @@ type MappedResponseBodyType<TRBType extends ResponseBodyType, TRBJsonType = any>
|
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/oiyo/http/types/uni.d.ts
|
|
59
59
|
type UniAppRequestOptions = Omit<UniNamespace.RequestOptions, 'url' | 'data' | 'header' | 'method' | 'timeout' | 'responseType' | 'success' | 'fail' | 'complete'>;
|
|
60
|
+
interface UniAppOnChunkData {
|
|
61
|
+
data: ArrayBuffer;
|
|
62
|
+
}
|
|
60
63
|
type UniAppRequestResponse<TRBody = any> = Prettify<Omit<UniNamespace.RequestSuccessCallbackResult, 'data'> & {
|
|
61
64
|
data: TRBody;
|
|
62
65
|
}>;
|
|
63
66
|
type UniAppUploadOptions = Omit<UniNamespace.UploadFileOption, 'url' | 'header' | 'formData' | 'timeout' | 'success' | 'fail' | 'complete'>;
|
|
64
|
-
interface
|
|
67
|
+
interface UniAppOnUploadProgressData extends UniNamespace.OnProgressUpdateResult {}
|
|
65
68
|
type UniAppUploadResponse<TRBody = any> = Prettify<Omit<UniNamespace.UploadFileSuccessCallbackResult, 'data'> & {
|
|
66
69
|
data: TRBody;
|
|
67
70
|
}>;
|
|
68
71
|
type UniAppDownloadBodyType = 'json';
|
|
69
72
|
type UniAppDownloadBody = Prettify<Pick<UniNamespace.DownloadSuccessData, 'tempFilePath'>>;
|
|
70
73
|
type UniAppDownloadOptions = Omit<UniNamespace.DownloadFileOption, 'url' | 'header' | 'timeout' | 'success' | 'fail' | 'complete'>;
|
|
71
|
-
interface
|
|
72
|
-
progress: number;
|
|
73
|
-
totalBytesWritten: number;
|
|
74
|
-
totalBytesExpectedToWrite: number;
|
|
75
|
-
}
|
|
74
|
+
interface UniAppDownloadProgressData extends UniNamespace.OnProgressDownloadResult {}
|
|
76
75
|
type UniAppDownloadResponse<TRBody = any> = Prettify<Omit<UniNamespace.DownloadSuccessData, keyof UniAppDownloadBody> & {
|
|
77
76
|
data: TRBody;
|
|
78
77
|
}>;
|
|
@@ -120,7 +119,16 @@ interface HttpCommonOptions<TRBType extends ResponseBodyType = ResponseBodyType>
|
|
|
120
119
|
onHeadersReceived?: (result: HeadersReceived) => void;
|
|
121
120
|
}
|
|
122
121
|
interface HttpRequestOptions<TRBType extends ResponseBodyType = ResponseBodyType> extends HttpCommonOptions<TRBType>, UniAppRequestOptions {
|
|
122
|
+
/**
|
|
123
|
+
* 普通请求方法,强制 POST
|
|
124
|
+
* @default - 'POST'
|
|
125
|
+
*/
|
|
123
126
|
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT';
|
|
127
|
+
/**
|
|
128
|
+
* 监听流式数据
|
|
129
|
+
* @description onChunkReceived
|
|
130
|
+
*/
|
|
131
|
+
onChunk?: (data: UniAppOnChunkData) => void;
|
|
124
132
|
}
|
|
125
133
|
interface HttpUploadOptions<TRBType extends ResponseBodyType = ResponseBodyType> extends HttpCommonOptions<TRBType>, UniAppUploadOptions {
|
|
126
134
|
/**
|
|
@@ -129,9 +137,10 @@ interface HttpUploadOptions<TRBType extends ResponseBodyType = ResponseBodyType>
|
|
|
129
137
|
*/
|
|
130
138
|
method?: 'POST';
|
|
131
139
|
/**
|
|
132
|
-
*
|
|
140
|
+
* 监听上传进度
|
|
141
|
+
* @description 对应 onProgressUpdate
|
|
133
142
|
*/
|
|
134
|
-
onProgress?: (
|
|
143
|
+
onProgress?: (data: UniAppOnUploadProgressData) => void;
|
|
135
144
|
}
|
|
136
145
|
interface HttpDownloadOptions<TRBType extends UniAppDownloadBodyType = 'json'> extends HttpCommonOptions<TRBType>, UniAppDownloadOptions {
|
|
137
146
|
/**
|
|
@@ -140,40 +149,41 @@ interface HttpDownloadOptions<TRBType extends UniAppDownloadBodyType = 'json'> e
|
|
|
140
149
|
*/
|
|
141
150
|
method?: 'GET';
|
|
142
151
|
/**
|
|
143
|
-
*
|
|
152
|
+
* 监听下载进度
|
|
153
|
+
* @description 对应 onProgressUpdate
|
|
144
154
|
*/
|
|
145
|
-
onProgress?: (
|
|
155
|
+
onProgress?: (data: UniAppDownloadProgressData) => void;
|
|
146
156
|
}
|
|
147
157
|
type HttpURL = string;
|
|
148
158
|
interface HttpOptions extends HttpCommonOptions, UniAppRequestOptions, UniAppUploadOptions, UniAppDownloadOptions {}
|
|
149
159
|
//#endregion
|
|
150
160
|
//#region src/oiyo/http/types/response.d.ts
|
|
151
|
-
type
|
|
152
|
-
type
|
|
153
|
-
type
|
|
154
|
-
type
|
|
155
|
-
type
|
|
156
|
-
type
|
|
157
|
-
type
|
|
161
|
+
type HttpRequestResult<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = MappedResponseBodyType<TRBType, TRBody>;
|
|
162
|
+
type HttpUploadResult<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = MappedResponseBodyType<TRBType, TRBody>;
|
|
163
|
+
type HttpDownloadResult<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = 'json'> = MappedResponseBodyType<TRBType, TRBody>;
|
|
164
|
+
type HttpRequestResponse<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = UniAppRequestResponse<MappedResponseBodyType<TRBType, TRBody>>;
|
|
165
|
+
type HttpUploadResponse<TRBody = any, TRBType extends ResponseBodyType = ResponseBodyType> = UniAppUploadResponse<MappedResponseBodyType<TRBType, TRBody>>;
|
|
166
|
+
type HttpDownloadResponse<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = 'json'> = UniAppDownloadResponse<MappedResponseBodyType<TRBType, TRBody>>;
|
|
167
|
+
type HttpResponse<T = any> = HttpRequestResponse<T> | HttpUploadResponse<T> | HttpDownloadResponse;
|
|
158
168
|
//#endregion
|
|
159
169
|
//#region src/oiyo/http/types/core.d.ts
|
|
160
|
-
interface
|
|
170
|
+
interface HttpRequest {
|
|
161
171
|
<TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options: HttpRequestOptions<TRBType> & {
|
|
162
172
|
raw: true;
|
|
163
|
-
}): Promise<
|
|
164
|
-
<TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options?: HttpRequestOptions<TRBType>): Promise<
|
|
173
|
+
}): Promise<HttpRequestResponse<TRBody, TRBType>>;
|
|
174
|
+
<TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options?: HttpRequestOptions<TRBType>): Promise<HttpRequestResult<TRBody, TRBType>>;
|
|
165
175
|
}
|
|
166
|
-
interface
|
|
176
|
+
interface HttpUpload {
|
|
167
177
|
<TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options: HttpUploadOptions<TRBType> & {
|
|
168
178
|
raw: true;
|
|
169
|
-
}): Promise<
|
|
170
|
-
<TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options?: HttpUploadOptions<TRBType>): Promise<
|
|
179
|
+
}): Promise<HttpUploadResponse<TRBody, TRBType>>;
|
|
180
|
+
<TRBody = any, TRBType extends ResponseBodyType = 'json'>(resource: HttpURL, options?: HttpUploadOptions<TRBType>): Promise<HttpUploadResult<TRBody, TRBType>>;
|
|
171
181
|
}
|
|
172
|
-
interface
|
|
182
|
+
interface HttpDownload {
|
|
173
183
|
<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = UniAppDownloadBodyType>(resource: HttpURL, options: HttpDownloadOptions<TRBType> & {
|
|
174
184
|
raw: true;
|
|
175
|
-
}): Promise<
|
|
176
|
-
<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = UniAppDownloadBodyType>(resource: HttpURL, options?: HttpDownloadOptions<TRBType>): Promise<
|
|
185
|
+
}): Promise<HttpDownloadResponse<TRBody, TRBType>>;
|
|
186
|
+
<TRBody extends UniAppDownloadBody = UniAppDownloadBody, TRBType extends UniAppDownloadBodyType = UniAppDownloadBodyType>(resource: HttpURL, options?: HttpDownloadOptions<TRBType>): Promise<HttpDownloadResult<TRBody, TRBType>>;
|
|
177
187
|
}
|
|
178
188
|
interface HttpHooks<TContextOptions, TResponse> {
|
|
179
189
|
onRequest?: (context: {
|
|
@@ -196,11 +206,11 @@ interface HttpHooks<TContextOptions, TResponse> {
|
|
|
196
206
|
response: TResponse;
|
|
197
207
|
}) => MaybePromise<void>;
|
|
198
208
|
}
|
|
199
|
-
interface HttpConfig extends HttpCommonOptions, HttpHooks<HttpOptions,
|
|
209
|
+
interface HttpConfig extends HttpCommonOptions, HttpHooks<HttpOptions, HttpResponse> {}
|
|
200
210
|
interface HttpError<T = any> extends Error {
|
|
201
211
|
resource?: HttpURL;
|
|
202
212
|
options?: HttpOptions;
|
|
203
|
-
response?:
|
|
213
|
+
response?: HttpResponse<T>;
|
|
204
214
|
data: T;
|
|
205
215
|
}
|
|
206
216
|
//#endregion
|
|
@@ -209,15 +219,15 @@ interface Http {
|
|
|
209
219
|
/**
|
|
210
220
|
* 普通请求
|
|
211
221
|
*/
|
|
212
|
-
request:
|
|
222
|
+
request: HttpRequest;
|
|
213
223
|
/**
|
|
214
224
|
* 文件上传
|
|
215
225
|
*/
|
|
216
|
-
upload:
|
|
226
|
+
upload: HttpUpload;
|
|
217
227
|
/**
|
|
218
228
|
* 文件下载
|
|
219
229
|
*/
|
|
220
|
-
download:
|
|
230
|
+
download: HttpDownload;
|
|
221
231
|
/**
|
|
222
232
|
* 基于当前配置派生一个新实例。
|
|
223
233
|
*/
|
|
@@ -226,4 +236,4 @@ interface Http {
|
|
|
226
236
|
declare function createHttp(globalConfig?: HttpConfig): Http;
|
|
227
237
|
declare const http: Http;
|
|
228
238
|
//#endregion
|
|
229
|
-
export { HttpDownloadResponse as a,
|
|
239
|
+
export { HttpDownloadResponse as a, HttpUploadResponse as c, HttpOptions as d, HttpRequestOptions as f, createHttpAborter as h, HttpError as i, HttpCommonOptions as l, ResponseBodyType as m, http as n, HttpRequestResponse as o, HttpUploadOptions as p, HttpConfig as r, HttpResponse as s, createHttp as t, HttpDownloadOptions as u };
|
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/framework v0.4.
|
|
2
|
+
* @oiyo/framework v0.4.8
|
|
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
|
-
const require_oiyo = require("./oiyo-
|
|
8
|
+
const require_oiyo = require("./oiyo-CwQjYs6D.cjs");
|
|
9
9
|
require("./uni.cjs");
|
|
10
10
|
require("./vue.cjs");
|
|
11
11
|
exports.createHttp = require_oiyo.createHttp;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/framework v0.4.
|
|
2
|
+
* @oiyo/framework v0.4.8
|
|
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
|
|
7
|
+
import { a as HttpDownloadResponse, c as HttpUploadResponse, d as HttpOptions, f as HttpRequestOptions, h as createHttpAborter, i as HttpError, l as HttpCommonOptions, m as ResponseBodyType, n as http, o as HttpRequestResponse, p as HttpUploadOptions, r as HttpConfig, s as HttpResponse, t as createHttp, u as HttpDownloadOptions } from "./index-CsfNc8p2.cjs";
|
|
8
8
|
import "./uni.cjs";
|
|
9
9
|
import "./vue.cjs";
|
|
10
10
|
export * from "@dcloudio/uni-app";
|
|
11
11
|
export * from "vue";
|
|
12
|
-
export { type HttpCommonOptions, type HttpConfig, type HttpDownloadOptions, type HttpDownloadResponse, type HttpError, type HttpOptions, type HttpRequestOptions, type HttpRequestResponse, type HttpUploadOptions, type HttpUploadResponse, type ResponseBodyType, createHttp, createHttpAborter, http };
|
|
12
|
+
export { type HttpCommonOptions, type HttpConfig, type HttpDownloadOptions, type HttpDownloadResponse, type HttpError, type HttpOptions, type HttpRequestOptions, type HttpRequestResponse, type HttpResponse, type HttpUploadOptions, type HttpUploadResponse, type ResponseBodyType, createHttp, createHttpAborter, http };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/framework v0.4.
|
|
2
|
+
* @oiyo/framework v0.4.8
|
|
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
|
|
7
|
+
import { a as HttpDownloadResponse, c as HttpUploadResponse, d as HttpOptions, f as HttpRequestOptions, h as createHttpAborter, i as HttpError, l as HttpCommonOptions, m as ResponseBodyType, n as http, o as HttpRequestResponse, p as HttpUploadOptions, r as HttpConfig, s as HttpResponse, t as createHttp, u as HttpDownloadOptions } from "./index-CsfNc8p2.mjs";
|
|
8
8
|
import "./uni.mjs";
|
|
9
9
|
import "./vue.mjs";
|
|
10
10
|
export * from "@dcloudio/uni-app";
|
|
11
11
|
export * from "vue";
|
|
12
|
-
export { type HttpCommonOptions, type HttpConfig, type HttpDownloadOptions, type HttpDownloadResponse, type HttpError, type HttpOptions, type HttpRequestOptions, type HttpRequestResponse, type HttpUploadOptions, type HttpUploadResponse, type ResponseBodyType, createHttp, createHttpAborter, http };
|
|
12
|
+
export { type HttpCommonOptions, type HttpConfig, type HttpDownloadOptions, type HttpDownloadResponse, type HttpError, type HttpOptions, type HttpRequestOptions, type HttpRequestResponse, type HttpResponse, type HttpUploadOptions, type HttpUploadResponse, type ResponseBodyType, createHttp, createHttpAborter, http };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/framework v0.4.
|
|
2
|
+
* @oiyo/framework v0.4.8
|
|
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 { n as http, r as createHttpAborter, t as createHttp } from "./oiyo-
|
|
7
|
+
import { n as http, r as createHttpAborter, t as createHttp } from "./oiyo-CohaZv3I.mjs";
|
|
8
8
|
import "./uni.mjs";
|
|
9
9
|
import "./vue.mjs";
|
|
10
10
|
export * from "@dcloudio/uni-app";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @oiyo/framework v0.4.8
|
|
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 _0x3cad74=_0x3807;(function(_0x554f03,_0x3cb322){const _0x1ec175=_0x3807,_0x2ebf31=_0x554f03();while(!![]){try{const _0x684047=-parseInt(_0x1ec175(0x129))/0x1+-parseInt(_0x1ec175(0x121))/0x2*(-parseInt(_0x1ec175(0x107))/0x3)+parseInt(_0x1ec175(0x111))/0x4+-parseInt(_0x1ec175(0x104))/0x5*(parseInt(_0x1ec175(0x147))/0x6)+parseInt(_0x1ec175(0x100))/0x7+-parseInt(_0x1ec175(0x109))/0x8*(parseInt(_0x1ec175(0x142))/0x9)+-parseInt(_0x1ec175(0x106))/0xa;if(_0x684047===_0x3cb322)break;else _0x2ebf31['push'](_0x2ebf31['shift']());}catch(_0x140980){_0x2ebf31['push'](_0x2ebf31['shift']());}}}(_0xa07e,0xe56d2));function createHttpAborter(){const _0x3fe44b=new HttpAbortSignal();return{'signal':_0x3fe44b,'abort':_0xb22c80=>_0x3fe44b['_abort'](_0xb22c80)};}const ABORT_ERROR_NAME='AbortError';var AbortEmitter=class{['listeners']=[];[_0x3cad74(0x13a)](_0x1db25e,_0xde404a){const _0x56261d=_0x3cad74;if(_0x1db25e!==_0x56261d(0x12d))return;this['listeners'][_0x56261d(0x138)](_0xde404a);}[_0x3cad74(0x127)](_0x53d232,_0x2bfe37){const _0x22f534=_0x3cad74;if(_0x53d232!=='abort')return;const _0x322014=this['listeners']['indexOf'](_0x2bfe37);if(_0x322014!==-0x1)this['listeners'][_0x22f534(0x124)](_0x322014,0x1);}[_0x3cad74(0x126)](_0x277d23){const _0x22f917=_0x3cad74;for(const _0x2d91e2 of this[_0x22f917(0x10e)][_0x22f917(0x13d)]())_0x2d91e2['call'](this,_0x277d23);}},HttpAbortSignal=class extends AbortEmitter{['aborted']=![];[_0x3cad74(0x116)]=void 0x0;[_0x3cad74(0x125)]=null;[_0x3cad74(0x12f)](_0x3acc36){const _0x3a2eea=_0x3cad74;if(this[_0x3a2eea(0x137)])return;this['aborted']=!![],this[_0x3a2eea(0x116)]=_0x3acc36===void 0x0?createAbortError():_0x3acc36;const _0x3f4f64={};_0x3f4f64[_0x3a2eea(0x11e)]='abort';const _0x33a95d=_0x3f4f64;if(typeof this['onabort']==='function')this[_0x3a2eea(0x125)](_0x33a95d);this[_0x3a2eea(0x126)](_0x33a95d);}[_0x3cad74(0x11d)](){const _0x4e3d27=_0x3cad74;if(this[_0x4e3d27(0x137)])throw this[_0x4e3d27(0x116)];}};function createAbortError(_0x1b32d9='The\x20operation\x20was\x20aborted'){const _0x5622bf=_0x3cad74,_0x452786=new Error(_0x1b32d9);return _0x452786[_0x5622bf(0x14b)]=ABORT_ERROR_NAME,_0x452786;}function isAbortError(_0x2fa569){const _0x10eb9e=_0x3cad74;return _0x2fa569 instanceof Error&&_0x2fa569[_0x10eb9e(0x14b)]===ABORT_ERROR_NAME;}function onAbort(_0x59090b,_0x542139){const _0x31bc9c=_0x3cad74;if(!_0x59090b)return()=>{};if(_0x59090b[_0x31bc9c(0x137)])return _0x542139(),()=>{};return _0x59090b[_0x31bc9c(0x13a)](_0x31bc9c(0x12d),_0x542139),()=>_0x59090b[_0x31bc9c(0x127)]('abort',_0x542139);}const HOOK_NAMES=['onRequest','onRequestError',_0x3cad74(0x123),_0x3cad74(0x105)];function mergeOptions(..._0x54b25e){const _0x472ac2=_0x3cad74,_0x9769b={},_0x2a149a={};for(const _0x2e8b07 of _0x54b25e){if(!_0x2e8b07)continue;for(const _0x45e486 of HOOK_NAMES)collectHook(_0x2a149a,_0x45e486,_0x2e8b07);const _0x30c863=_0x9769b[_0x472ac2(0x10a)],_0xb80d48=_0x9769b[_0x472ac2(0x131)];Object['assign'](_0x9769b,_0x2e8b07);const _0x21a12d={..._0x30c863,..._0x2e8b07['headers']};_0x9769b['headers']=_0x21a12d;const _0xff2502={..._0xb80d48,..._0x2e8b07[_0x472ac2(0x131)]};_0x9769b['query']=_0xff2502;}for(const [_0x13adff,_0x69af33]of Object[_0x472ac2(0x14f)](_0x2a149a))Object['assign'](_0x9769b,{[_0x13adff]:async _0x507e22=>{for(const _0x3f53cb of _0x69af33)await _0x3f53cb(_0x507e22);}});return _0x9769b;}function collectHook(_0x19011e,_0x1a3311,_0x42dbe1){const _0x2e9602=_0x42dbe1[_0x1a3311];if(typeof _0x2e9602!=='function')return;_0x19011e[_0x1a3311]??=[],_0x19011e[_0x1a3311]['push'](_0x2e9602);}function _0x3807(_0x3d144b,_0x4e1d37){_0x3d144b=_0x3d144b-0xfc;const _0xa07e74=_0xa07e();let _0x3807dc=_0xa07e74[_0x3d144b];return _0x3807dc;}function dispatch(_0x113d9f,_0x47724f,_0x5b8cc0,_0x1e296e){const _0x3079ca=_0x3cad74;let _0x1f18a3;if(_0x113d9f===_0x3079ca(0x144))_0x1f18a3=dispatchUpload(_0x47724f,_0x5b8cc0,_0x1e296e);else{if(_0x113d9f===_0x3079ca(0x101))_0x1f18a3=dispatchDownload(_0x47724f,_0x5b8cc0,_0x1e296e);else _0x1f18a3=dispatchRequest(_0x47724f,_0x5b8cc0,_0x1e296e);}bindTask(_0x1f18a3,_0x5b8cc0);}function bindTask(_0x547103,_0x27b43e){const _0x584d21=_0x3cad74;onAbort(_0x27b43e[_0x584d21(0x118)],()=>_0x547103['abort']());if(typeof _0x27b43e[_0x584d21(0x11a)]==='function')_0x547103[_0x584d21(0x11a)](_0x27b43e['onHeadersReceived']);const _0x2fc53=_0x27b43e[_0x584d21(0x10c)];if(typeof _0x2fc53===_0x584d21(0x140)&&'onChunkReceived'in _0x547103)_0x547103[_0x584d21(0x143)](_0x2fc53);const _0x50fa47=_0x27b43e[_0x584d21(0x12e)];if(typeof _0x50fa47===_0x584d21(0x140)&&_0x584d21(0x145)in _0x547103)_0x547103['onProgressUpdate'](_0x50fa47);}function dispatchRequest(_0x2c9d38,_0x4721ce,_0xac2afb){const _0x5ba1f7=_0x3cad74,_0x334abd={'url':_0x2c9d38,'method':_0x4721ce[_0x5ba1f7(0x13e)],'header':_0x4721ce['headers'],'data':_0x4721ce['body']??{},'timeout':_0x4721ce[_0x5ba1f7(0x13f)],'dataType':_0x4721ce[_0x5ba1f7(0x10f)]||_0x5ba1f7(0x102),'responseType':mappedResponseBodyType(_0x4721ce['responseType']),'sslVerify':_0x4721ce[_0x5ba1f7(0x11c)],'withCredentials':_0x4721ce[_0x5ba1f7(0x149)],'firstIpv4':_0x4721ce[_0x5ba1f7(0xfd)],'enableHttp2':_0x4721ce['enableHttp2'],'enableQuic':_0x4721ce['enableQuic'],'enableCache':_0x4721ce[_0x5ba1f7(0x12b)],'enableHttpDNS':_0x4721ce['enableHttpDNS'],'httpDNSServiceId':_0x4721ce[_0x5ba1f7(0x14e)],'enableChunked':_0x4721ce['enableChunked'],'forceCellularNetwork':_0x4721ce['forceCellularNetwork'],'success':_0xac2afb['onSuccess'],'fail':_0xac2afb[_0x5ba1f7(0x10d)],'complete':()=>{}};return uni['request'](_0x334abd);}function dispatchUpload(_0x30c1d9,_0x105f83,_0x1b3d2f){const _0x262c53=_0x3cad74,_0x182a0b={};_0x182a0b['url']=_0x30c1d9,_0x182a0b['fileType']=_0x105f83['fileType'],_0x182a0b['file']=_0x105f83['file'],_0x182a0b['filePath']=_0x105f83['filePath'],_0x182a0b['name']=_0x105f83[_0x262c53(0x14b)]??_0x262c53(0x103),_0x182a0b[_0x262c53(0x139)]=_0x105f83[_0x262c53(0x139)],_0x182a0b['header']=_0x105f83['headers'],_0x182a0b['formData']=_0x105f83[_0x262c53(0x117)]??{},_0x182a0b['timeout']=_0x105f83['timeout'],_0x182a0b['success']=_0x1b3d2f[_0x262c53(0x11b)],_0x182a0b['fail']=_0x1b3d2f[_0x262c53(0x10d)],_0x182a0b['complete']=()=>{};const _0x39088b=_0x182a0b;return uni['uploadFile'](_0x39088b);}function dispatchDownload(_0x5b86ad,_0x593331,_0x4b4e1e){const _0x145ced=_0x3cad74,_0x4d580e={'url':_0x5b86ad,'header':_0x593331[_0x145ced(0x10a)],'timeout':_0x593331[_0x145ced(0x13f)],'success':_0x3e82ac=>{const _0x2202d9=_0x145ced,_0x229fa8={..._0x3e82ac};_0x229fa8[_0x2202d9(0x13b)]={},_0x229fa8[_0x2202d9(0x13b)]['tempFilePath']=_0x3e82ac['tempFilePath'],_0x4b4e1e['onSuccess'](_0x229fa8);},'fail':_0x4b4e1e[_0x145ced(0x10d)],'complete':()=>{}};return uni[_0x145ced(0x14c)](_0x4d580e);}function mappedResponseBodyType(_0x57ace6){const _0x109fc1=_0x3cad74;if(!_0x57ace6||_0x57ace6==='json')return'text';if(_0x57ace6===_0x109fc1(0x119))return _0x109fc1(0x130);return'text';}var HttpError=class extends Error{constructor(_0x14c8f9){const _0x28e78f=_0x3cad74;super(_0x14c8f9),this[_0x28e78f(0x14b)]=_0x28e78f(0xfc);}};function createResponseError(_0x4596da,_0x57b347,_0x2c409f){const _0xbfc039=_0x3cad74,_0x32d0c4=_0x4596da,_0x4e5652='['+(_0x57b347?.['method']||_0xbfc039(0x122))+']\x20'+_0x32d0c4,_0x2a2653=_0x2c409f?_0x2c409f['statusCode']+'\x20'+(_0x2c409f['errMsg']||''):'<no\x20response>',_0x553486=_0x2c409f?JSON[_0xbfc039(0x128)](_0x2c409f[_0xbfc039(0x13b)]):_0xbfc039(0x114),_0x227f23=new HttpError(_0x4e5652+':\x20'+_0x2a2653+(_0x2c409f['data']?'\x20'+_0x553486:''));for(const _0x3139af of[_0xbfc039(0x146),_0xbfc039(0x13c),'response',_0xbfc039(0x13b)])Object['defineProperty'](_0x227f23,_0x3139af,{'get'(){const _0x58e489=_0xbfc039,_0x225e95={};return _0x225e95[_0x58e489(0x146)]=_0x4596da,_0x225e95[_0x58e489(0x13c)]=_0x57b347,_0x225e95['response']=_0x2c409f,_0x225e95['data']=_0x2c409f['data'],_0x225e95[_0x3139af];}});return _0x227f23;}function normalizeError(_0xb75589){const _0x3d6b11=_0x3cad74;if(_0xb75589 instanceof Error)return _0xb75589;return Object[_0x3d6b11(0x12c)](new Error(_0xb75589?.[_0x3d6b11(0x112)]||_0xb75589?.['message']||_0x3d6b11(0x135)),{'cause':_0xb75589});}async function callRequestHooks(_0x310ae3,_0xd4f360){await _0xd4f360['onRequest']?.({'options':_0xd4f360,'resource':_0x310ae3});}async function callRequestErrorHooks(_0x2f93de,_0x1ca8fd,_0x2ed06a){const _0x29441d=_0x3cad74;await _0x1ca8fd[_0x29441d(0x14a)]?.({'options':_0x1ca8fd,'resource':_0x2f93de,'error':_0x2ed06a});}async function callResponseHooks(_0x337878,_0x45395f,_0x28cf44){await _0x45395f['onResponse']?.({'options':_0x45395f,'resource':_0x337878,'response':_0x28cf44});}async function callResponseErrorHooks(_0x580d2c,_0x22442f,_0x1c3198){const _0x11623a=_0x3cad74;await _0x22442f[_0x11623a(0x105)]?.({'options':_0x22442f,'resource':_0x580d2c,'response':_0x1c3198});}function _0xa07e(){const _0x53330e=['HTTP\x20request\x20failed','filter','aborted','push','files','addEventListener','data','options','slice','method','timeout','function','replace','83997hvLbsB','onChunkReceived','upload','onProgressUpdate','request','174hCkfZr','startsWith','withCredentials','onRequestError','name','downloadFile','flatMap','httpDNSServiceId','entries','isArray','HttpError','firstIpv4','catch','has','8699159BpolVq','download','json','file','26010kvEGeh','onResponseError','6480040kAxela','763452zIoatQ','toUpperCase','712gNwuRp','headers','POST','onChunk','onFail','listeners','dataType','then','3335876IKdZFG','errMsg','resolve','<no\x20response\x20body>','DELETE','reason','body','signal','arrayBuffer','onHeadersReceived','onSuccess','sslVerify','throwIfAborted','type','ignoreResponseError','baseURL','10AVQxVN','GET','onResponse','splice','onabort','emit','removeEventListener','stringify','779897mcCMrr','includes','enableCache','assign','abort','onProgress','_abort','arraybuffer','query','number','parseResponse','response'];_0xa07e=function(){return _0x53330e;};return _0xa07e();}async function refineResponse(_0x31e5f9,_0x4ed373){const _0x893d8b=_0x3cad74;if(_0x4ed373['responseType']==='json'||!_0x4ed373['responseType'])return{..._0x31e5f9,'data':await parseJSONResponse(_0x31e5f9[_0x893d8b(0x13b)],_0x4ed373)};return _0x31e5f9;}function parseJSONResponse(_0x30d514,_0x4a176c){const _0x34fdce=_0x3cad74;if(typeof _0x30d514!=='string')return _0x30d514;if(_0x4a176c[_0x34fdce(0x133)])return _0x4a176c['parseResponse'](_0x30d514);return _0x30d514?JSON['parse'](_0x30d514):null;}function isResponseError(_0x5ce195){const _0x5aeed7=_0x3cad74,_0x187fe1='statusCode'in _0x5ce195?_0x5ce195['statusCode']:void 0x0;return typeof _0x187fe1===_0x5aeed7(0x132)&&(_0x187fe1<0xc8||_0x187fe1>=0x12c);}const DEFAULT_RETRY_STATUS_CODES=[0x198,0x199,0x1a9,0x1ad,0x1f4,0x1f6,0x1f7,0x1f8],PAYLOAD_METHODS=new Set([_0x3cad74(0x10b),'PUT',_0x3cad74(0x115),'PATCH']);async function withRetry(_0x19d863,_0x4097ec){const _0x2a209e=_0x3cad74,_0x515024=resolveRetryCount(_0x19d863);for(let _0x29aac5=0x0;;_0x29aac5++)try{return await _0x4097ec();}catch(_0x5cc07f){if(_0x29aac5>=_0x515024||!shouldRetry(_0x5cc07f,_0x19d863))throw _0x5cc07f;await sleep(_0x19d863['retryDelay']??0x0,_0x19d863[_0x2a209e(0x118)]);}}function resolveRetryCount(_0x5008e5){const _0xca33ce=_0x3cad74,{retry:_0x1b58b3}=_0x5008e5;if(_0x1b58b3===![])return 0x0;if(typeof _0x1b58b3==='number')return _0x1b58b3>0x0?_0x1b58b3:0x0;return isPayloadMethod(_0x5008e5[_0xca33ce(0x13e)])?0x0:0x1;}function shouldRetry(_0x18eae0,_0x51324b){const _0x582e1e=_0x3cad74;if(_0x51324b[_0x582e1e(0x118)]?.['aborted']||isAbortError(_0x18eae0))return![];const _0x25dc55=_0x18eae0?.[_0x582e1e(0x134)]?.['statusCode'];if(typeof _0x25dc55!=='number')return!![];return(_0x51324b['retryStatusCodes']??DEFAULT_RETRY_STATUS_CODES)[_0x582e1e(0x12a)](_0x25dc55);}function isPayloadMethod(_0x337958){const _0x5bd535=_0x3cad74;return!!_0x337958&&PAYLOAD_METHODS[_0x5bd535(0xff)](_0x337958[_0x5bd535(0x108)]());}function sleep(_0x2c6a35,_0x18ab4a){return new Promise((_0x3342cd,_0x8f7d40)=>{const _0x4ecb57=_0x3807;if(_0x18ab4a?.[_0x4ecb57(0x137)]){_0x8f7d40(_0x18ab4a['reason']);return;}if(!(_0x2c6a35>0x0)){_0x3342cd();return;}let _0x2005fe=()=>{};const _0x145919=setTimeout(()=>{_0x2005fe(),_0x3342cd();},_0x2c6a35);_0x2005fe=onAbort(_0x18ab4a,()=>{clearTimeout(_0x145919),_0x8f7d40(_0x18ab4a['reason']);});});}function buildURL(_0x4e292e,_0xd0f0b4){const _0x38c7a2=_0x3cad74,_0x1e4b11=joinURL(_0xd0f0b4[_0x38c7a2(0x120)],_0x4e292e),_0x324a4d=_0xd0f0b4['query']??{},_0x22c609=Object['keys'](_0x324a4d)[_0x38c7a2(0x136)](_0x52ff7a=>_0x324a4d[_0x52ff7a]!==void 0x0)[_0x38c7a2(0x14d)](_0x3c3e5f=>{const _0xbf2ed5=_0x38c7a2,_0x15ee28=_0x324a4d[_0x3c3e5f];return(Array[_0xbf2ed5(0x150)](_0x15ee28)?_0x15ee28:[_0x15ee28])['map'](_0x23d9c9=>encodeURIComponent(_0x3c3e5f)+'='+encodeURIComponent(String(_0x23d9c9)));})['join']('&');if(!_0x22c609)return _0x1e4b11;return''+_0x1e4b11+(_0x1e4b11['includes']('?')?'&':'?')+_0x22c609;}function joinURL(_0x38dad7,_0x3978d3){const _0x5e2112=_0x3cad74;if(!_0x38dad7||isAbsoluteURL(_0x3978d3))return _0x3978d3;return _0x38dad7[_0x5e2112(0x141)](/\/+$/,'')+'/'+_0x3978d3['replace'](/^\/+/,'');}function isAbsoluteURL(_0x575e38){const _0x1959b2=_0x3cad74;return/^[a-z][a-z\d+\-.]*:\/\//i['test'](_0x575e38)||_0x575e38[_0x1959b2(0x148)]('//');}function dispatchHttp(_0x267ab5,_0x340539,_0x1ce956){const _0x5911dd=buildURL(_0x340539,_0x1ce956);return withRetry(_0x1ce956,()=>attemptRequest(_0x267ab5,_0x340539,_0x5911dd,_0x1ce956));}function attemptRequest(_0x14b40f,_0x5ee5fa,_0x37b459,_0x432343){const _0xbe3ee4=!!_0x432343['raw'];return new Promise((_0x122c57,_0x3ae278)=>{const _0x5c675b=_0x3807;let _0x52990a=![];const _0x21403d=_0x58cf0e=>{if(_0x52990a)return;_0x52990a=!![],_0x58cf0e();},_0x2db451=onAbort(_0x432343[_0x5c675b(0x118)],()=>{const _0x112e26=_0x5c675b;_0x21403d(()=>_0x3ae278(_0x432343[_0x112e26(0x118)]['reason']));}),_0x5079e5=_0x17d347=>{_0x2db451(),_0x21403d(_0x17d347);};callRequestHooks(_0x5ee5fa,_0x432343)['then'](()=>{if(_0x52990a)return;dispatch(_0x14b40f,_0x37b459,_0x432343,{'onSuccess':_0x5dafbe=>{const _0x3663f3=_0x3807;Promise['resolve']()[_0x3663f3(0x110)](()=>refineResponse(_0x5dafbe,_0x432343))['then'](async _0x39b8f8=>{const _0x50619c=_0x3663f3;if(isResponseError(_0x5dafbe)){await callResponseErrorHooks(_0x5ee5fa,_0x432343,_0x39b8f8);if(!_0x432343[_0x50619c(0x11f)])throw createResponseError(_0x5ee5fa,_0x432343,_0x39b8f8);}else await callResponseHooks(_0x5ee5fa,_0x432343,_0x39b8f8);_0x5079e5(()=>_0x122c57(_0xbe3ee4?_0x39b8f8:_0x39b8f8['data']));})[_0x3663f3(0xfe)](_0x2f7be4=>_0x5079e5(()=>_0x3ae278(_0x2f7be4)));},'onFail':_0x12fb7b=>{const _0xbff2d4=_0x3807;Promise[_0xbff2d4(0x113)]()[_0xbff2d4(0x110)](async()=>{const _0x1f8ef5=normalizeError(_0x12fb7b);if(!isAbortError(_0x1f8ef5))await callRequestErrorHooks(_0x5ee5fa,_0x432343,_0x1f8ef5);throw _0x1f8ef5;})['catch'](_0x3bcbb2=>_0x5079e5(()=>_0x3ae278(_0x3bcbb2)));}});})['catch'](async _0x5a7dd7=>{const _0x27492b=normalizeError(_0x5a7dd7);await callRequestErrorHooks(_0x5ee5fa,_0x432343,_0x27492b),_0x5079e5(()=>_0x3ae278(_0x27492b));});});}const _0x5a5c1f={};_0x5a5c1f['method']=_0x3cad74(0x122),_0x5a5c1f['responseType']=_0x3cad74(0x102);const defaultConfig=_0x5a5c1f;function createHttp(_0x4d4fea={}){const _0x38780e=_0x3cad74,_0x483e73=(_0x515636,_0x57ee77)=>{return dispatchHttp('request',_0x515636,mergeOptions(defaultConfig,_0x4d4fea,_0x57ee77));},_0xc67cba=(_0x43c918,_0x4370e1)=>{const _0x96086=_0x3807,_0x253ea8={};return _0x253ea8[_0x96086(0x13e)]='POST',dispatchHttp('upload',_0x43c918,mergeOptions(defaultConfig,_0x4d4fea,_0x4370e1,_0x253ea8));},_0x1f090d=(_0x390562,_0x186447)=>{const _0x2a7a7a=_0x3807,_0x4fceed={};return _0x4fceed[_0x2a7a7a(0x13e)]=_0x2a7a7a(0x122),dispatchHttp(_0x2a7a7a(0x101),_0x390562,mergeOptions(defaultConfig,_0x4d4fea,_0x186447,_0x4fceed));},_0x2467ba=_0x2353fe=>createHttp(mergeOptions(_0x4d4fea,_0x2353fe)),_0x6ed4b1={};return _0x6ed4b1['request']=_0x483e73,_0x6ed4b1[_0x38780e(0x144)]=_0xc67cba,_0x6ed4b1[_0x38780e(0x101)]=_0x1f090d,_0x6ed4b1['create']=_0x2467ba,_0x6ed4b1;}const http=createHttp();export{http as n,createHttpAborter as r,createHttp as t};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @oiyo/framework v0.4.8
|
|
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 _0xf46285=_0x5943;(function(_0xe9e838,_0xd832ef){const _0xe0cd9c=_0x5943,_0x544cc5=_0xe9e838();while(!![]){try{const _0x3a95f3=-parseInt(_0xe0cd9c(0x12b))/0x1+-parseInt(_0xe0cd9c(0x158))/0x2*(-parseInt(_0xe0cd9c(0x112))/0x3)+-parseInt(_0xe0cd9c(0x15e))/0x4*(-parseInt(_0xe0cd9c(0x12a))/0x5)+-parseInt(_0xe0cd9c(0x10f))/0x6+-parseInt(_0xe0cd9c(0x14f))/0x7*(parseInt(_0xe0cd9c(0x123))/0x8)+-parseInt(_0xe0cd9c(0x136))/0x9*(-parseInt(_0xe0cd9c(0x150))/0xa)+-parseInt(_0xe0cd9c(0x156))/0xb*(-parseInt(_0xe0cd9c(0x11b))/0xc);if(_0x3a95f3===_0xd832ef)break;else _0x544cc5['push'](_0x544cc5['shift']());}catch(_0x144643){_0x544cc5['push'](_0x544cc5['shift']());}}}(_0x4756,0xd406c));function createHttpAborter(){const _0x37a0e5=_0x5943,_0x700448=new HttpAbortSignal();return{'signal':_0x700448,'abort':_0x35abb2=>_0x700448[_0x37a0e5(0x116)](_0x35abb2)};}const ABORT_ERROR_NAME=_0xf46285(0x15b);var AbortEmitter=class{[_0xf46285(0x12d)]=[];[_0xf46285(0x13a)](_0x819165,_0x2e2dd8){const _0x272bbf=_0xf46285;if(_0x819165!==_0x272bbf(0x132))return;this['listeners']['push'](_0x2e2dd8);}[_0xf46285(0x10a)](_0x2170eb,_0x185e17){const _0x10c40a=_0xf46285;if(_0x2170eb!=='abort')return;const _0x5f4087=this[_0x10c40a(0x12d)]['indexOf'](_0x185e17);if(_0x5f4087!==-0x1)this[_0x10c40a(0x12d)][_0x10c40a(0x11e)](_0x5f4087,0x1);}['emit'](_0x276198){const _0x3a72d4=_0xf46285;for(const _0x4a217f of this[_0x3a72d4(0x12d)]['slice']())_0x4a217f['call'](this,_0x276198);}},HttpAbortSignal=class extends AbortEmitter{[_0xf46285(0x139)]=![];['reason']=void 0x0;[_0xf46285(0x149)]=null;[_0xf46285(0x116)](_0x7a06d2){const _0xd7a847=_0xf46285;if(this['aborted'])return;this[_0xd7a847(0x139)]=!![],this[_0xd7a847(0x13b)]=_0x7a06d2===void 0x0?createAbortError():_0x7a06d2;const _0x199392={};_0x199392['type']='abort';const _0x4956f1=_0x199392;if(typeof this['onabort']==='function')this['onabort'](_0x4956f1);this[_0xd7a847(0x15a)](_0x4956f1);}['throwIfAborted'](){if(this['aborted'])throw this['reason'];}};function createAbortError(_0x56e488='The\x20operation\x20was\x20aborted'){const _0x1a8292=new Error(_0x56e488);return _0x1a8292['name']=ABORT_ERROR_NAME,_0x1a8292;}function isAbortError(_0x180efd){return _0x180efd instanceof Error&&_0x180efd['name']===ABORT_ERROR_NAME;}function onAbort(_0xf53d33,_0x127f5c){const _0xdc9b0f=_0xf46285;if(!_0xf53d33)return()=>{};if(_0xf53d33['aborted'])return _0x127f5c(),()=>{};return _0xf53d33[_0xdc9b0f(0x13a)](_0xdc9b0f(0x132),_0x127f5c),()=>_0xf53d33[_0xdc9b0f(0x10a)]('abort',_0x127f5c);}const HOOK_NAMES=[_0xf46285(0x14a),'onRequestError',_0xf46285(0x12c),'onResponseError'];function mergeOptions(..._0x3eac02){const _0x40660b=_0xf46285,_0x13cbc1={},_0x2a515e={};for(const _0x90549b of _0x3eac02){if(!_0x90549b)continue;for(const _0x260aac of HOOK_NAMES)collectHook(_0x2a515e,_0x260aac,_0x90549b);const _0x2d15a5=_0x13cbc1['headers'],_0x7f2928=_0x13cbc1[_0x40660b(0x129)];Object[_0x40660b(0x107)](_0x13cbc1,_0x90549b);const _0x3f3fc2={..._0x2d15a5,..._0x90549b['headers']};_0x13cbc1[_0x40660b(0x115)]=_0x3f3fc2;const _0x62061d={..._0x7f2928,..._0x90549b['query']};_0x13cbc1['query']=_0x62061d;}for(const [_0x95411a,_0x48ce91]of Object['entries'](_0x2a515e))Object[_0x40660b(0x107)](_0x13cbc1,{[_0x95411a]:async _0x13fa6a=>{for(const _0x3f8391 of _0x48ce91)await _0x3f8391(_0x13fa6a);}});return _0x13cbc1;}function collectHook(_0x4c5179,_0x3b99a6,_0x1460d5){const _0x252251=_0xf46285,_0x341f55=_0x1460d5[_0x3b99a6];if(typeof _0x341f55!==_0x252251(0x134))return;_0x4c5179[_0x3b99a6]??=[],_0x4c5179[_0x3b99a6]['push'](_0x341f55);}function dispatch(_0x23415c,_0x4768c0,_0x3110d8,_0x946909){const _0x27a05d=_0xf46285;let _0x38b9e0;if(_0x23415c===_0x27a05d(0x159))_0x38b9e0=dispatchUpload(_0x4768c0,_0x3110d8,_0x946909);else{if(_0x23415c===_0x27a05d(0x14c))_0x38b9e0=dispatchDownload(_0x4768c0,_0x3110d8,_0x946909);else _0x38b9e0=dispatchRequest(_0x4768c0,_0x3110d8,_0x946909);}bindTask(_0x38b9e0,_0x3110d8);}function bindTask(_0x1f6cc1,_0x5a4422){const _0x325c69=_0xf46285;onAbort(_0x5a4422[_0x325c69(0x127)],()=>_0x1f6cc1['abort']());if(typeof _0x5a4422['onHeadersReceived']===_0x325c69(0x134))_0x1f6cc1[_0x325c69(0x124)](_0x5a4422[_0x325c69(0x124)]);const _0x2ddcd4=_0x5a4422[_0x325c69(0x14d)];if(typeof _0x2ddcd4==='function'&&_0x325c69(0x111)in _0x1f6cc1)_0x1f6cc1['onChunkReceived'](_0x2ddcd4);const _0x260e7d=_0x5a4422[_0x325c69(0x110)];if(typeof _0x260e7d==='function'&&_0x325c69(0x11a)in _0x1f6cc1)_0x1f6cc1['onProgressUpdate'](_0x260e7d);}function dispatchRequest(_0x23d4a6,_0x1744b0,_0x4c0899){const _0x27f0ed=_0xf46285,_0x1d779d={'url':_0x23d4a6,'method':_0x1744b0['method'],'header':_0x1744b0['headers'],'data':_0x1744b0[_0x27f0ed(0x10b)]??{},'timeout':_0x1744b0[_0x27f0ed(0x11c)],'dataType':_0x1744b0['dataType']||_0x27f0ed(0x138),'responseType':mappedResponseBodyType(_0x1744b0['responseType']),'sslVerify':_0x1744b0[_0x27f0ed(0x128)],'withCredentials':_0x1744b0[_0x27f0ed(0x119)],'firstIpv4':_0x1744b0['firstIpv4'],'enableHttp2':_0x1744b0[_0x27f0ed(0x10d)],'enableQuic':_0x1744b0['enableQuic'],'enableCache':_0x1744b0['enableCache'],'enableHttpDNS':_0x1744b0[_0x27f0ed(0x140)],'httpDNSServiceId':_0x1744b0['httpDNSServiceId'],'enableChunked':_0x1744b0[_0x27f0ed(0x147)],'forceCellularNetwork':_0x1744b0['forceCellularNetwork'],'success':_0x4c0899[_0x27f0ed(0x126)],'fail':_0x4c0899['onFail'],'complete':()=>{}};return uni['request'](_0x1d779d);}function dispatchUpload(_0x486e2c,_0x493ccf,_0x42e787){const _0x370107=_0xf46285,_0xf78cf0={};_0xf78cf0['url']=_0x486e2c,_0xf78cf0[_0x370107(0x142)]=_0x493ccf[_0x370107(0x142)],_0xf78cf0[_0x370107(0x11f)]=_0x493ccf['file'],_0xf78cf0['filePath']=_0x493ccf['filePath'],_0xf78cf0['name']=_0x493ccf['name']??_0x370107(0x11f),_0xf78cf0['files']=_0x493ccf[_0x370107(0x122)],_0xf78cf0['header']=_0x493ccf['headers'],_0xf78cf0[_0x370107(0x12e)]=_0x493ccf[_0x370107(0x10b)]??{},_0xf78cf0[_0x370107(0x11c)]=_0x493ccf[_0x370107(0x11c)],_0xf78cf0[_0x370107(0x113)]=_0x42e787[_0x370107(0x126)],_0xf78cf0[_0x370107(0x157)]=_0x42e787[_0x370107(0x131)],_0xf78cf0['complete']=()=>{};const _0x36526f=_0xf78cf0;return uni['uploadFile'](_0x36526f);}function dispatchDownload(_0x35eec8,_0x37326e,_0x583eee){const _0x270a78=_0xf46285,_0x35fd56={'url':_0x35eec8,'header':_0x37326e[_0x270a78(0x115)],'timeout':_0x37326e['timeout'],'success':_0x1c23ee=>{const _0x5e0df0=_0x270a78,_0x33c535={..._0x1c23ee};_0x33c535['data']={},_0x33c535['data']['tempFilePath']=_0x1c23ee[_0x5e0df0(0x155)],_0x583eee['onSuccess'](_0x33c535);},'fail':_0x583eee[_0x270a78(0x131)],'complete':()=>{}};return uni[_0x270a78(0x145)](_0x35fd56);}function _0x5943(_0x3915a8,_0x1ff103){_0x3915a8=_0x3915a8-0x105;const _0x47563f=_0x4756();let _0x5943dc=_0x47563f[_0x3915a8];return _0x5943dc;}function mappedResponseBodyType(_0x459a00){const _0x410c1d=_0xf46285;if(!_0x459a00||_0x459a00==='json')return'text';if(_0x459a00===_0x410c1d(0x143))return _0x410c1d(0x148);return _0x410c1d(0x105);}var HttpError=class extends Error{constructor(_0x5bbcd7){const _0x16591d=_0xf46285;super(_0x5bbcd7),this[_0x16591d(0x141)]=_0x16591d(0x135);}};function createResponseError(_0x5588a1,_0x4e8f81,_0x30ea18){const _0x45d46b=_0xf46285,_0x106e88=_0x5588a1,_0x1a3659='['+(_0x4e8f81?.['method']||'GET')+']\x20'+_0x106e88,_0x28ea90=_0x30ea18?_0x30ea18[_0x45d46b(0x146)]+'\x20'+(_0x30ea18['errMsg']||''):'<no\x20response>',_0x2879c5=_0x30ea18?JSON['stringify'](_0x30ea18['data']):_0x45d46b(0x153),_0x1ddc6d=new HttpError(_0x1a3659+':\x20'+_0x28ea90+(_0x30ea18[_0x45d46b(0x14e)]?'\x20'+_0x2879c5:''));for(const _0x5713a1 of['request','options','response',_0x45d46b(0x14e)])Object['defineProperty'](_0x1ddc6d,_0x5713a1,{'get'(){const _0x2fc405=_0x45d46b,_0x11942b={};return _0x11942b[_0x2fc405(0x114)]=_0x5588a1,_0x11942b['options']=_0x4e8f81,_0x11942b[_0x2fc405(0x120)]=_0x30ea18,_0x11942b[_0x2fc405(0x14e)]=_0x30ea18[_0x2fc405(0x14e)],_0x11942b[_0x5713a1];}});return _0x1ddc6d;}function normalizeError(_0x2fb81c){const _0x1274e0=_0xf46285;if(_0x2fb81c instanceof Error)return _0x2fb81c;return Object[_0x1274e0(0x107)](new Error(_0x2fb81c?.[_0x1274e0(0x125)]||_0x2fb81c?.[_0x1274e0(0x109)]||'HTTP\x20request\x20failed'),{'cause':_0x2fb81c});}async function callRequestHooks(_0x346341,_0x578b66){await _0x578b66['onRequest']?.({'options':_0x578b66,'resource':_0x346341});}async function callRequestErrorHooks(_0x1eb41f,_0x2a08b8,_0x42d56c){const _0x1a1963=_0xf46285;await _0x2a08b8[_0x1a1963(0x13c)]?.({'options':_0x2a08b8,'resource':_0x1eb41f,'error':_0x42d56c});}async function callResponseHooks(_0x1b5f5a,_0x21ab85,_0x536e87){const _0x2c63e9=_0xf46285;await _0x21ab85[_0x2c63e9(0x12c)]?.({'options':_0x21ab85,'resource':_0x1b5f5a,'response':_0x536e87});}async function callResponseErrorHooks(_0x4f08f8,_0x40e84f,_0x27b20f){await _0x40e84f['onResponseError']?.({'options':_0x40e84f,'resource':_0x4f08f8,'response':_0x27b20f});}async function refineResponse(_0x3dcb7b,_0xed2fb4){const _0x3050e0=_0xf46285;if(_0xed2fb4['responseType']===_0x3050e0(0x138)||!_0xed2fb4[_0x3050e0(0x10c)])return{..._0x3dcb7b,'data':await parseJSONResponse(_0x3dcb7b['data'],_0xed2fb4)};return _0x3dcb7b;}function parseJSONResponse(_0x349171,_0x4b6226){const _0x34db9=_0xf46285;if(typeof _0x349171!=='string')return _0x349171;if(_0x4b6226[_0x34db9(0x13f)])return _0x4b6226['parseResponse'](_0x349171);return _0x349171?JSON['parse'](_0x349171):null;}function isResponseError(_0x421864){const _0xabed90='statusCode'in _0x421864?_0x421864['statusCode']:void 0x0;return typeof _0xabed90==='number'&&(_0xabed90<0xc8||_0xabed90>=0x12c);}const DEFAULT_RETRY_STATUS_CODES=[0x198,0x199,0x1a9,0x1ad,0x1f4,0x1f6,0x1f7,0x1f8],PAYLOAD_METHODS=new Set(['POST','PUT',_0xf46285(0x12f),'PATCH']);async function withRetry(_0x45a01a,_0x561f72){const _0x54e123=resolveRetryCount(_0x45a01a);for(let _0x8bd7d3=0x0;;_0x8bd7d3++)try{return await _0x561f72();}catch(_0x2db062){if(_0x8bd7d3>=_0x54e123||!shouldRetry(_0x2db062,_0x45a01a))throw _0x2db062;await sleep(_0x45a01a['retryDelay']??0x0,_0x45a01a['signal']);}}function resolveRetryCount(_0x1fcaed){const {retry:_0x2cb525}=_0x1fcaed;if(_0x2cb525===![])return 0x0;if(typeof _0x2cb525==='number')return _0x2cb525>0x0?_0x2cb525:0x0;return isPayloadMethod(_0x1fcaed['method'])?0x0:0x1;}function shouldRetry(_0x19c7e1,_0x100d90){const _0x18b7fa=_0xf46285;if(_0x100d90['signal']?.['aborted']||isAbortError(_0x19c7e1))return![];const _0x4e2612=_0x19c7e1?.['response']?.[_0x18b7fa(0x146)];if(typeof _0x4e2612!==_0x18b7fa(0x151))return!![];return(_0x100d90['retryStatusCodes']??DEFAULT_RETRY_STATUS_CODES)[_0x18b7fa(0x133)](_0x4e2612);}function isPayloadMethod(_0x4c0788){const _0x410b8f=_0xf46285;return!!_0x4c0788&&PAYLOAD_METHODS[_0x410b8f(0x13d)](_0x4c0788[_0x410b8f(0x14b)]());}function sleep(_0x5c83f9,_0x3d8dfe){return new Promise((_0x2ed680,_0x4eedbd)=>{const _0x27ac80=_0x5943;if(_0x3d8dfe?.[_0x27ac80(0x139)]){_0x4eedbd(_0x3d8dfe[_0x27ac80(0x13b)]);return;}if(!(_0x5c83f9>0x0)){_0x2ed680();return;}let _0x512dbd=()=>{};const _0x5ca443=setTimeout(()=>{_0x512dbd(),_0x2ed680();},_0x5c83f9);_0x512dbd=onAbort(_0x3d8dfe,()=>{const _0x54f96b=_0x27ac80;clearTimeout(_0x5ca443),_0x4eedbd(_0x3d8dfe[_0x54f96b(0x13b)]);});});}function buildURL(_0x31b621,_0x1cfdad){const _0x1f7dfb=_0xf46285,_0x3b8215=joinURL(_0x1cfdad[_0x1f7dfb(0x118)],_0x31b621),_0x2bce6a=_0x1cfdad['query']??{},_0x3f9432=Object['keys'](_0x2bce6a)[_0x1f7dfb(0x11d)](_0x53eda3=>_0x2bce6a[_0x53eda3]!==void 0x0)['flatMap'](_0x57e021=>{const _0x1b6a0f=_0x1f7dfb,_0x3bdaf8=_0x2bce6a[_0x57e021];return(Array['isArray'](_0x3bdaf8)?_0x3bdaf8:[_0x3bdaf8])[_0x1b6a0f(0x154)](_0x3575f8=>encodeURIComponent(_0x57e021)+'='+encodeURIComponent(String(_0x3575f8)));})[_0x1f7dfb(0x130)]('&');if(!_0x3f9432)return _0x3b8215;return''+_0x3b8215+(_0x3b8215['includes']('?')?'&':'?')+_0x3f9432;}function _0x4756(){const _0x412776=['enumerable','parseResponse','enableHttpDNS','name','fileType','arrayBuffer','create','downloadFile','statusCode','enableChunked','arraybuffer','onabort','onRequest','toUpperCase','download','onChunk','data','735721sNEMIp','20lAGvEL','number','get','<no\x20response\x20body>','map','tempFilePath','7205nTRJsK','fail','3294274nXwjUh','upload','emit','AbortError','startsWith','then','1637564VUTzYS','text','test','assign','replace','message','removeEventListener','body','responseType','enableHttp2','resolve','4503768DVykmi','onProgress','onChunkReceived','3YZOZoy','success','request','headers','_abort','defineProperty','baseURL','withCredentials','onProgressUpdate','120vwHljH','timeout','filter','splice','file','response','catch','files','128gpDRPt','onHeadersReceived','errMsg','onSuccess','signal','sslVerify','query','20oMOrzV','666857zTYBRh','onResponse','listeners','formData','DELETE','join','onFail','abort','includes','function','HttpError','3043539AiacYy','method','json','aborted','addEventListener','reason','onRequestError','has'];_0x4756=function(){return _0x412776;};return _0x4756();}function joinURL(_0x1f745e,_0x1b3d92){const _0x5d0678=_0xf46285;if(!_0x1f745e||isAbsoluteURL(_0x1b3d92))return _0x1b3d92;return _0x1f745e[_0x5d0678(0x108)](/\/+$/,'')+'/'+_0x1b3d92[_0x5d0678(0x108)](/^\/+/,'');}function isAbsoluteURL(_0x2064ff){const _0x3e6a95=_0xf46285;return/^[a-z][a-z\d+\-.]*:\/\//i[_0x3e6a95(0x106)](_0x2064ff)||_0x2064ff[_0x3e6a95(0x15c)]('//');}function dispatchHttp(_0x403ab2,_0x406b28,_0xde4809){const _0x37a6d2=buildURL(_0x406b28,_0xde4809);return withRetry(_0xde4809,()=>attemptRequest(_0x403ab2,_0x406b28,_0x37a6d2,_0xde4809));}function attemptRequest(_0xba14a3,_0xffe39e,_0x513855,_0xe48998){const _0x7fb5d0=!!_0xe48998['raw'];return new Promise((_0x5c1b2d,_0x345116)=>{const _0x2096db=_0x5943;let _0x9e8d29=![];const _0x1ea559=_0x3f011f=>{if(_0x9e8d29)return;_0x9e8d29=!![],_0x3f011f();},_0x5de442=onAbort(_0xe48998[_0x2096db(0x127)],()=>{const _0x34b806=_0x2096db;_0x1ea559(()=>_0x345116(_0xe48998['signal'][_0x34b806(0x13b)]));}),_0x2ffc28=_0x168e3f=>{_0x5de442(),_0x1ea559(_0x168e3f);};callRequestHooks(_0xffe39e,_0xe48998)[_0x2096db(0x15d)](()=>{if(_0x9e8d29)return;dispatch(_0xba14a3,_0x513855,_0xe48998,{'onSuccess':_0x1c87ae=>{const _0x3fed16=_0x5943;Promise[_0x3fed16(0x10e)]()['then'](()=>refineResponse(_0x1c87ae,_0xe48998))[_0x3fed16(0x15d)](async _0x3bf00d=>{const _0x69b4af=_0x3fed16;if(isResponseError(_0x1c87ae)){await callResponseErrorHooks(_0xffe39e,_0xe48998,_0x3bf00d);if(!_0xe48998['ignoreResponseError'])throw createResponseError(_0xffe39e,_0xe48998,_0x3bf00d);}else await callResponseHooks(_0xffe39e,_0xe48998,_0x3bf00d);_0x2ffc28(()=>_0x5c1b2d(_0x7fb5d0?_0x3bf00d:_0x3bf00d[_0x69b4af(0x14e)]));})[_0x3fed16(0x121)](_0x1411a4=>_0x2ffc28(()=>_0x345116(_0x1411a4)));},'onFail':_0x564862=>{const _0x23360b=_0x5943;Promise[_0x23360b(0x10e)]()[_0x23360b(0x15d)](async()=>{const _0xfa46a0=normalizeError(_0x564862);if(!isAbortError(_0xfa46a0))await callRequestErrorHooks(_0xffe39e,_0xe48998,_0xfa46a0);throw _0xfa46a0;})['catch'](_0x27da0a=>_0x2ffc28(()=>_0x345116(_0x27da0a)));}});})[_0x2096db(0x121)](async _0x392a63=>{const _0x3c59aa=normalizeError(_0x392a63);await callRequestErrorHooks(_0xffe39e,_0xe48998,_0x3c59aa),_0x2ffc28(()=>_0x345116(_0x3c59aa));});});}const _0x283253={};_0x283253['method']='GET',_0x283253['responseType']='json';const defaultConfig=_0x283253;function createHttp(_0x3e7359={}){const _0x25ca62=_0xf46285,_0x3e183c=(_0x372816,_0x57db9c)=>{return dispatchHttp('request',_0x372816,mergeOptions(defaultConfig,_0x3e7359,_0x57db9c));},_0x56f7fb=(_0x47cfe9,_0xeb77b9)=>{const _0x8b6ce2=_0x5943,_0x32058a={};return _0x32058a[_0x8b6ce2(0x137)]='POST',dispatchHttp(_0x8b6ce2(0x159),_0x47cfe9,mergeOptions(defaultConfig,_0x3e7359,_0xeb77b9,_0x32058a));},_0x3556fd=(_0x4abad7,_0x13deac)=>{const _0x76ce89=_0x5943,_0x5f3609={};return _0x5f3609[_0x76ce89(0x137)]='GET',dispatchHttp(_0x76ce89(0x14c),_0x4abad7,mergeOptions(defaultConfig,_0x3e7359,_0x13deac,_0x5f3609));},_0x23b94c=_0x4dbcb2=>createHttp(mergeOptions(_0x3e7359,_0x4dbcb2)),_0x5f0e60={};return _0x5f0e60[_0x25ca62(0x114)]=_0x3e183c,_0x5f0e60['upload']=_0x56f7fb,_0x5f0e60['download']=_0x3556fd,_0x5f0e60[_0x25ca62(0x144)]=_0x23b94c,_0x5f0e60;}const http=createHttp(),_0xddf3e8={};_0xddf3e8[_0xf46285(0x13e)]=!![],_0xddf3e8[_0xf46285(0x152)]=function(){return createHttp;},Object['defineProperty'](exports,'createHttp',_0xddf3e8);const _0x4b5d86={};_0x4b5d86[_0xf46285(0x13e)]=!![],_0x4b5d86['get']=function(){return createHttpAborter;},Object[_0xf46285(0x117)](exports,'createHttpAborter',_0x4b5d86);const _0x489846={};_0x489846['enumerable']=!![],_0x489846[_0xf46285(0x152)]=function(){return http;},Object['defineProperty'](exports,'http',_0x489846);
|
package/dist/oiyo.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/framework v0.4.
|
|
2
|
+
* @oiyo/framework v0.4.8
|
|
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
|
-
const require_oiyo = require("./oiyo-
|
|
8
|
+
const require_oiyo = require("./oiyo-CwQjYs6D.cjs");
|
|
9
9
|
exports.createHttp = require_oiyo.createHttp;
|
|
10
10
|
exports.createHttpAborter = require_oiyo.createHttpAborter;
|
|
11
11
|
exports.http = require_oiyo.http;
|
package/dist/oiyo.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/framework v0.4.
|
|
2
|
+
* @oiyo/framework v0.4.8
|
|
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
|
|
8
|
-
export { type HttpCommonOptions, type HttpConfig, type HttpDownloadOptions, type HttpDownloadResponse, type HttpError, type HttpOptions, type HttpRequestOptions, type HttpRequestResponse, type HttpUploadOptions, type HttpUploadResponse, type ResponseBodyType, createHttp, createHttpAborter, http };
|
|
7
|
+
import { a as HttpDownloadResponse, c as HttpUploadResponse, d as HttpOptions, f as HttpRequestOptions, h as createHttpAborter, i as HttpError, l as HttpCommonOptions, m as ResponseBodyType, n as http, o as HttpRequestResponse, p as HttpUploadOptions, r as HttpConfig, s as HttpResponse, t as createHttp, u as HttpDownloadOptions } from "./index-CsfNc8p2.cjs";
|
|
8
|
+
export { type HttpCommonOptions, type HttpConfig, type HttpDownloadOptions, type HttpDownloadResponse, type HttpError, type HttpOptions, type HttpRequestOptions, type HttpRequestResponse, type HttpResponse, type HttpUploadOptions, type HttpUploadResponse, type ResponseBodyType, createHttp, createHttpAborter, http };
|
package/dist/oiyo.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/framework v0.4.
|
|
2
|
+
* @oiyo/framework v0.4.8
|
|
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
|
|
8
|
-
export { type HttpCommonOptions, type HttpConfig, type HttpDownloadOptions, type HttpDownloadResponse, type HttpError, type HttpOptions, type HttpRequestOptions, type HttpRequestResponse, type HttpUploadOptions, type HttpUploadResponse, type ResponseBodyType, createHttp, createHttpAborter, http };
|
|
7
|
+
import { a as HttpDownloadResponse, c as HttpUploadResponse, d as HttpOptions, f as HttpRequestOptions, h as createHttpAborter, i as HttpError, l as HttpCommonOptions, m as ResponseBodyType, n as http, o as HttpRequestResponse, p as HttpUploadOptions, r as HttpConfig, s as HttpResponse, t as createHttp, u as HttpDownloadOptions } from "./index-CsfNc8p2.mjs";
|
|
8
|
+
export { type HttpCommonOptions, type HttpConfig, type HttpDownloadOptions, type HttpDownloadResponse, type HttpError, type HttpOptions, type HttpRequestOptions, type HttpRequestResponse, type HttpResponse, type HttpUploadOptions, type HttpUploadResponse, type ResponseBodyType, createHttp, createHttpAborter, http };
|
package/dist/oiyo.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/framework v0.4.
|
|
2
|
+
* @oiyo/framework v0.4.8
|
|
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 { n as http, r as createHttpAborter, t as createHttp } from "./oiyo-
|
|
7
|
+
import { n as http, r as createHttpAborter, t as createHttp } from "./oiyo-CohaZv3I.mjs";
|
|
8
8
|
export { createHttp, createHttpAborter, http };
|
package/dist/uni.cjs
CHANGED
package/dist/uni.d.cts
CHANGED
package/dist/uni.d.mts
CHANGED
package/dist/uni.mjs
CHANGED
package/dist/vue.cjs
CHANGED
package/dist/vue.d.cts
CHANGED
package/dist/vue.d.mts
CHANGED
package/dist/vue.mjs
CHANGED
package/package.json
CHANGED
package/dist/oiyo-CASn7hkX.cjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @oiyo/framework v0.4.6
|
|
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 _0x3fd42d=_0x386a;(function(_0x89df50,_0x1995dc){const _0x3e39c0=_0x386a,_0x54b9cb=_0x89df50();while(!![]){try{const _0x3428d1=parseInt(_0x3e39c0(0x17a))/0x1*(parseInt(_0x3e39c0(0x159))/0x2)+-parseInt(_0x3e39c0(0x160))/0x3*(parseInt(_0x3e39c0(0x16f))/0x4)+parseInt(_0x3e39c0(0x16c))/0x5+parseInt(_0x3e39c0(0x17e))/0x6*(parseInt(_0x3e39c0(0x17d))/0x7)+parseInt(_0x3e39c0(0x172))/0x8+-parseInt(_0x3e39c0(0x196))/0x9*(-parseInt(_0x3e39c0(0x14c))/0xa)+-parseInt(_0x3e39c0(0x1a2))/0xb;if(_0x3428d1===_0x1995dc)break;else _0x54b9cb['push'](_0x54b9cb['shift']());}catch(_0x5ac5ad){_0x54b9cb['push'](_0x54b9cb['shift']());}}}(_0x3a6e,0xc93a4));function createHttpAborter(){const _0x29acf6=new HttpAbortSignal();return{'signal':_0x29acf6,'abort':_0x4a6245=>_0x29acf6['_abort'](_0x4a6245)};}const ABORT_ERROR_NAME=_0x3fd42d(0x157);var AbortEmitter=class{[_0x3fd42d(0x156)]=[];['addEventListener'](_0x5af363,_0x286af0){const _0x3f31a2=_0x3fd42d;if(_0x5af363!=='abort')return;this['listeners'][_0x3f31a2(0x14b)](_0x286af0);}['removeEventListener'](_0x131f1b,_0x2da58e){const _0x430cc5=_0x3fd42d;if(_0x131f1b!==_0x430cc5(0x14e))return;const _0x3aa602=this['listeners'][_0x430cc5(0x15d)](_0x2da58e);if(_0x3aa602!==-0x1)this['listeners']['splice'](_0x3aa602,0x1);}[_0x3fd42d(0x170)](_0x1223af){const _0x497fcb=_0x3fd42d;for(const _0x2c9732 of this['listeners'][_0x497fcb(0x194)]())_0x2c9732[_0x497fcb(0x178)](this,_0x1223af);}},HttpAbortSignal=class extends AbortEmitter{[_0x3fd42d(0x174)]=![];[_0x3fd42d(0x193)]=void 0x0;[_0x3fd42d(0x18b)]=null;['_abort'](_0x346ae6){const _0x50eb84=_0x3fd42d;if(this[_0x50eb84(0x174)])return;this[_0x50eb84(0x174)]=!![],this['reason']=_0x346ae6===void 0x0?createAbortError():_0x346ae6;const _0x1efca1={};_0x1efca1[_0x50eb84(0x164)]=_0x50eb84(0x14e);const _0x151aa=_0x1efca1;if(typeof this['onabort']===_0x50eb84(0x198))this['onabort'](_0x151aa);this[_0x50eb84(0x170)](_0x151aa);}[_0x3fd42d(0x186)](){const _0x1b7155=_0x3fd42d;if(this['aborted'])throw this[_0x1b7155(0x193)];}};function createAbortError(_0x504433='The\x20operation\x20was\x20aborted'){const _0x1782a0=_0x3fd42d,_0xbbc35=new Error(_0x504433);return _0xbbc35[_0x1782a0(0x183)]=ABORT_ERROR_NAME,_0xbbc35;}function isAbortError(_0x68f4ea){const _0x4e18d1=_0x3fd42d;return _0x68f4ea instanceof Error&&_0x68f4ea[_0x4e18d1(0x183)]===ABORT_ERROR_NAME;}function onAbort(_0x494732,_0x59a8c6){const _0x2d4990=_0x3fd42d;if(!_0x494732)return()=>{};if(_0x494732['aborted'])return _0x59a8c6(),()=>{};return _0x494732[_0x2d4990(0x192)]('abort',_0x59a8c6),()=>_0x494732[_0x2d4990(0x187)]('abort',_0x59a8c6);}const HOOK_NAMES=[_0x3fd42d(0x17f),_0x3fd42d(0x190),'onResponse','onResponseError'];function mergeOptions(..._0x3be500){const _0xf3ae1=_0x3fd42d,_0x2c7dc4={},_0x752f3c={};for(const _0xa2d8eb of _0x3be500){if(!_0xa2d8eb)continue;for(const _0x14004c of HOOK_NAMES)collectHook(_0x752f3c,_0x14004c,_0xa2d8eb);const _0x2fc945=_0x2c7dc4[_0xf3ae1(0x179)],_0x5456ab=_0x2c7dc4['query'];Object['assign'](_0x2c7dc4,_0xa2d8eb);const _0x2f8538={..._0x2fc945,..._0xa2d8eb[_0xf3ae1(0x179)]};_0x2c7dc4['headers']=_0x2f8538;const _0x21e552={..._0x5456ab,..._0xa2d8eb['query']};_0x2c7dc4[_0xf3ae1(0x19d)]=_0x21e552;}for(const [_0x236215,_0x1ec9a0]of Object[_0xf3ae1(0x150)](_0x752f3c))Object[_0xf3ae1(0x158)](_0x2c7dc4,{[_0x236215]:async _0x17b00c=>{for(const _0x38e11c of _0x1ec9a0)await _0x38e11c(_0x17b00c);}});return _0x2c7dc4;}function collectHook(_0x536bb7,_0x2ddd65,_0x4031d8){const _0x1a0e60=_0x3fd42d,_0x37b34a=_0x4031d8[_0x2ddd65];if(typeof _0x37b34a!=='function')return;_0x536bb7[_0x2ddd65]??=[],_0x536bb7[_0x2ddd65][_0x1a0e60(0x14b)](_0x37b34a);}function dispatch(_0x40eaa7,_0x382706,_0xa20849,_0x20983d){const _0x1d48bb=_0x3fd42d;let _0x31353c;if(_0x40eaa7===_0x1d48bb(0x15b))_0x31353c=dispatchUpload(_0x382706,_0xa20849,_0x20983d);else{if(_0x40eaa7===_0x1d48bb(0x149))_0x31353c=dispatchDownload(_0x382706,_0xa20849,_0x20983d);else _0x31353c=dispatchRequest(_0x382706,_0xa20849,_0x20983d);}bindTask(_0x31353c,_0xa20849);}function bindTask(_0x31cb4c,_0x4acf04){const _0x5f3c4a=_0x3fd42d;onAbort(_0x4acf04[_0x5f3c4a(0x199)],()=>_0x31cb4c['abort']());if(typeof _0x4acf04['onHeadersReceived']==='function')_0x31cb4c['onHeadersReceived'](_0x4acf04[_0x5f3c4a(0x19b)]);const _0x11fc0c=_0x4acf04[_0x5f3c4a(0x188)];if(typeof _0x11fc0c==='function'&&_0x5f3c4a(0x166)in _0x31cb4c)_0x31cb4c[_0x5f3c4a(0x166)](_0x11fc0c);}function dispatchRequest(_0x39567f,_0x2a50a9,_0x58e7ab){const _0x32069e=_0x3fd42d,_0x548dbe={'url':_0x39567f,'method':_0x2a50a9[_0x32069e(0x1a0)],'header':_0x2a50a9[_0x32069e(0x179)],'data':_0x2a50a9[_0x32069e(0x155)]??{},'timeout':_0x2a50a9['timeout'],'dataType':_0x2a50a9[_0x32069e(0x19c)]||'json','responseType':mappedResponseBodyType(_0x2a50a9['responseType']),'sslVerify':_0x2a50a9['sslVerify'],'withCredentials':_0x2a50a9['withCredentials'],'firstIpv4':_0x2a50a9[_0x32069e(0x16d)],'enableHttp2':_0x2a50a9['enableHttp2'],'enableQuic':_0x2a50a9[_0x32069e(0x19a)],'enableCache':_0x2a50a9[_0x32069e(0x152)],'enableHttpDNS':_0x2a50a9[_0x32069e(0x14a)],'httpDNSServiceId':_0x2a50a9['httpDNSServiceId'],'enableChunked':_0x2a50a9['enableChunked'],'forceCellularNetwork':_0x2a50a9['forceCellularNetwork'],'success':_0x58e7ab['onSuccess'],'fail':_0x58e7ab[_0x32069e(0x15e)],'complete':()=>{}};return uni['request'](_0x548dbe);}function dispatchUpload(_0x28d0c7,_0x486d84,_0x1af9b9){const _0x5d5908=_0x3fd42d,_0xc66174={};_0xc66174['url']=_0x28d0c7,_0xc66174[_0x5d5908(0x15f)]=_0x486d84[_0x5d5908(0x15f)],_0xc66174['file']=_0x486d84['file'],_0xc66174['filePath']=_0x486d84[_0x5d5908(0x171)],_0xc66174['name']=_0x486d84[_0x5d5908(0x183)]??_0x5d5908(0x184),_0xc66174['files']=_0x486d84[_0x5d5908(0x18d)],_0xc66174[_0x5d5908(0x16e)]=_0x486d84[_0x5d5908(0x179)],_0xc66174[_0x5d5908(0x16a)]=_0x486d84[_0x5d5908(0x155)]??{},_0xc66174['timeout']=_0x486d84[_0x5d5908(0x180)],_0xc66174[_0x5d5908(0x191)]=_0x1af9b9['onSuccess'],_0xc66174[_0x5d5908(0x1a1)]=_0x1af9b9['onFail'],_0xc66174['complete']=()=>{};const _0x1793ae=_0xc66174;return uni[_0x5d5908(0x17c)](_0x1793ae);}function _0x386a(_0xf43ed0,_0x1655ff){_0xf43ed0=_0xf43ed0-0x149;const _0x3a6eff=_0x3a6e();let _0x386a2d=_0x3a6eff[_0xf43ed0];return _0x386a2d;}function dispatchDownload(_0x1b8c09,_0x14093e,_0x1d9483){const _0x58d1a3=_0x3fd42d,_0x14c747={'url':_0x1b8c09,'header':_0x14093e[_0x58d1a3(0x179)],'timeout':_0x14093e['timeout'],'success':_0x308838=>{const _0x3acb5f=_0x58d1a3,_0x349931={..._0x308838};_0x349931['data']={},_0x349931['data']['tempFilePath']=_0x308838['tempFilePath'],_0x1d9483[_0x3acb5f(0x181)](_0x349931);},'fail':_0x1d9483[_0x58d1a3(0x15e)],'complete':()=>{}};return uni[_0x58d1a3(0x16b)](_0x14c747);}function mappedResponseBodyType(_0x5e8181){const _0x2e77f3=_0x3fd42d;if(!_0x5e8181||_0x5e8181===_0x2e77f3(0x189))return'text';if(_0x5e8181===_0x2e77f3(0x161))return _0x2e77f3(0x18f);return _0x2e77f3(0x19e);}var HttpError=class extends Error{constructor(_0x530392){const _0x18799f=_0x3fd42d;super(_0x530392),this['name']=_0x18799f(0x163);}};function createResponseError(_0x5f2769,_0x353cea,_0x351c9e){const _0x2ea8e4=_0x3fd42d,_0x2af63c=_0x5f2769,_0x3a8cd8='['+(_0x353cea?.[_0x2ea8e4(0x1a0)]||_0x2ea8e4(0x14d))+']\x20'+_0x2af63c,_0x272983=_0x351c9e?_0x351c9e[_0x2ea8e4(0x17b)]+'\x20'+(_0x351c9e[_0x2ea8e4(0x18a)]||''):'<no\x20response>',_0x155dd5=_0x351c9e?JSON['stringify'](_0x351c9e[_0x2ea8e4(0x185)]):_0x2ea8e4(0x151),_0x3ae9cb=new HttpError(_0x3a8cd8+':\x20'+_0x272983+(_0x351c9e['data']?'\x20'+_0x155dd5:''));for(const _0x1f517f of['request','options','response',_0x2ea8e4(0x185)])Object[_0x2ea8e4(0x18e)](_0x3ae9cb,_0x1f517f,{'get'(){const _0x4c04fb=_0x2ea8e4,_0x304d1d={};return _0x304d1d['request']=_0x5f2769,_0x304d1d['options']=_0x353cea,_0x304d1d['response']=_0x351c9e,_0x304d1d[_0x4c04fb(0x185)]=_0x351c9e[_0x4c04fb(0x185)],_0x304d1d[_0x1f517f];}});return _0x3ae9cb;}function normalizeError(_0x2b65e7){const _0x28766e=_0x3fd42d;if(_0x2b65e7 instanceof Error)return _0x2b65e7;return Object[_0x28766e(0x158)](new Error(_0x2b65e7?.['errMsg']||_0x2b65e7?.[_0x28766e(0x169)]||_0x28766e(0x182)),{'cause':_0x2b65e7});}async function callRequestHooks(_0x3425be,_0x50f853){const _0xa8e70b=_0x3fd42d;await _0x50f853[_0xa8e70b(0x17f)]?.({'options':_0x50f853,'resource':_0x3425be});}async function callRequestErrorHooks(_0x56961c,_0x448d34,_0x31d2cd){const _0x210523=_0x3fd42d;await _0x448d34[_0x210523(0x190)]?.({'options':_0x448d34,'resource':_0x56961c,'error':_0x31d2cd});}async function callResponseHooks(_0x31f457,_0x3d0098,_0x2e8bcd){await _0x3d0098['onResponse']?.({'options':_0x3d0098,'resource':_0x31f457,'response':_0x2e8bcd});}async function callResponseErrorHooks(_0x3240cd,_0x48f94e,_0x4077b9){await _0x48f94e['onResponseError']?.({'options':_0x48f94e,'resource':_0x3240cd,'response':_0x4077b9});}async function refineResponse(_0x1bbce9,_0xbcc7e8){const _0x51c536=_0x3fd42d;if(_0xbcc7e8[_0x51c536(0x153)]==='json'||!_0xbcc7e8[_0x51c536(0x153)])return{..._0x1bbce9,'data':await parseJSONResponse(_0x1bbce9['data'],_0xbcc7e8)};return _0x1bbce9;}function parseJSONResponse(_0x1c06a3,_0x5311bb){const _0xd5b5e2=_0x3fd42d;if(typeof _0x1c06a3!=='string')return _0x1c06a3;if(_0x5311bb[_0xd5b5e2(0x195)])return _0x5311bb[_0xd5b5e2(0x195)](_0x1c06a3);return _0x1c06a3?JSON['parse'](_0x1c06a3):null;}function isResponseError(_0xbb10fa){const _0x27b9eb=_0x3fd42d,_0x452b20='statusCode'in _0xbb10fa?_0xbb10fa[_0x27b9eb(0x17b)]:void 0x0;return typeof _0x452b20===_0x27b9eb(0x197)&&(_0x452b20<0xc8||_0x452b20>=0x12c);}const DEFAULT_RETRY_STATUS_CODES=[0x198,0x199,0x1a9,0x1ad,0x1f4,0x1f6,0x1f7,0x1f8],PAYLOAD_METHODS=new Set([_0x3fd42d(0x14f),'PUT',_0x3fd42d(0x1a3),'PATCH']);async function withRetry(_0x50b9fd,_0x3fe590){const _0x3d3bf9=_0x3fd42d,_0x30bb75=resolveRetryCount(_0x50b9fd);for(let _0x2a7b0b=0x0;;_0x2a7b0b++)try{return await _0x3fe590();}catch(_0x3d0dfd){if(_0x2a7b0b>=_0x30bb75||!shouldRetry(_0x3d0dfd,_0x50b9fd))throw _0x3d0dfd;await sleep(_0x50b9fd['retryDelay']??0x0,_0x50b9fd[_0x3d3bf9(0x199)]);}}function resolveRetryCount(_0x944a09){const {retry:_0x24064a}=_0x944a09;if(_0x24064a===![])return 0x0;if(typeof _0x24064a==='number')return _0x24064a>0x0?_0x24064a:0x0;return isPayloadMethod(_0x944a09['method'])?0x0:0x1;}function shouldRetry(_0x1d2786,_0x766027){const _0x22ee31=_0x3fd42d;if(_0x766027['signal']?.['aborted']||isAbortError(_0x1d2786))return![];const _0x194538=_0x1d2786?.['response']?.['statusCode'];if(typeof _0x194538!==_0x22ee31(0x197))return!![];return(_0x766027[_0x22ee31(0x167)]??DEFAULT_RETRY_STATUS_CODES)[_0x22ee31(0x175)](_0x194538);}function isPayloadMethod(_0x33e420){const _0x395811=_0x3fd42d;return!!_0x33e420&&PAYLOAD_METHODS[_0x395811(0x165)](_0x33e420['toUpperCase']());}function sleep(_0xc599bf,_0xf837fe){return new Promise((_0x59af27,_0x27e86e)=>{const _0x3a0ecd=_0x386a;if(_0xf837fe?.['aborted']){_0x27e86e(_0xf837fe[_0x3a0ecd(0x193)]);return;}if(!(_0xc599bf>0x0)){_0x59af27();return;}let _0x28199c=()=>{};const _0x3f741c=setTimeout(()=>{_0x28199c(),_0x59af27();},_0xc599bf);_0x28199c=onAbort(_0xf837fe,()=>{const _0xe6635a=_0x3a0ecd;clearTimeout(_0x3f741c),_0x27e86e(_0xf837fe[_0xe6635a(0x193)]);});});}function buildURL(_0x2b5fa8,_0x3f5c12){const _0x99ccba=_0x3fd42d,_0x4aeeaa=joinURL(_0x3f5c12['baseURL'],_0x2b5fa8),_0x83dc3e=_0x3f5c12['query']??{},_0x3bcf55=Object[_0x99ccba(0x176)](_0x83dc3e)[_0x99ccba(0x168)](_0x5bd210=>_0x83dc3e[_0x5bd210]!==void 0x0)[_0x99ccba(0x19f)](_0x1f9b3d=>{const _0x4aee92=_0x83dc3e[_0x1f9b3d];return(Array['isArray'](_0x4aee92)?_0x4aee92:[_0x4aee92])['map'](_0x46279c=>encodeURIComponent(_0x1f9b3d)+'='+encodeURIComponent(String(_0x46279c)));})['join']('&');if(!_0x3bcf55)return _0x4aeeaa;return''+_0x4aeeaa+(_0x4aeeaa['includes']('?')?'&':'?')+_0x3bcf55;}function joinURL(_0x313ba4,_0x36cfac){if(!_0x313ba4||isAbsoluteURL(_0x36cfac))return _0x36cfac;return _0x313ba4['replace'](/\/+$/,'')+'/'+_0x36cfac['replace'](/^\/+/,'');}function _0x3a6e(){const _0x30e204=['DELETE','download','enableHttpDNS','push','1322450xRxeTV','GET','abort','POST','entries','<no\x20response\x20body>','enableCache','responseType','catch','body','listeners','AbortError','assign','550qBKxoS','enumerable','upload','createHttpAborter','indexOf','onFail','fileType','369RAGMNn','arrayBuffer','raw','HttpError','type','has','onProgressUpdate','retryStatusCodes','filter','message','formData','downloadFile','4714080jIiFLj','firstIpv4','header','42236SqxVtN','emit','filePath','9459824nMSHRo','then','aborted','includes','keys','createHttp','call','headers','5222Ayesgo','statusCode','uploadFile','5173qTMRSU','10758HSZHhV','onRequest','timeout','onSuccess','HTTP\x20request\x20failed','name','file','data','throwIfAborted','removeEventListener','onProgress','json','errMsg','onabort','get','files','defineProperty','arraybuffer','onRequestError','success','addEventListener','reason','slice','parseResponse','72waqDpQ','number','function','signal','enableQuic','onHeadersReceived','dataType','query','text','flatMap','method','fail','42034806dNpNTd'];_0x3a6e=function(){return _0x30e204;};return _0x3a6e();}function isAbsoluteURL(_0x4e4fa7){return/^[a-z][a-z\d+\-.]*:\/\//i['test'](_0x4e4fa7)||_0x4e4fa7['startsWith']('//');}function dispatchHttp(_0x45e105,_0x1aa8e0,_0x3f5f84){const _0x3f9ad7=buildURL(_0x1aa8e0,_0x3f5f84);return withRetry(_0x3f5f84,()=>attemptRequest(_0x45e105,_0x1aa8e0,_0x3f9ad7,_0x3f5f84));}function attemptRequest(_0x412c32,_0x22724b,_0x33ae07,_0x18a0f0){const _0x63f840=_0x3fd42d,_0x6dbecf=!!_0x18a0f0[_0x63f840(0x162)];return new Promise((_0x1d8d54,_0x12b7e0)=>{const _0x3f1326=_0x63f840;let _0x3f54fe=![];const _0x3da941=_0x49c6a7=>{if(_0x3f54fe)return;_0x3f54fe=!![],_0x49c6a7();},_0x230e37=onAbort(_0x18a0f0[_0x3f1326(0x199)],()=>{const _0x17b030=_0x3f1326;_0x3da941(()=>_0x12b7e0(_0x18a0f0['signal'][_0x17b030(0x193)]));}),_0x190e2c=_0x39c43a=>{_0x230e37(),_0x3da941(_0x39c43a);};callRequestHooks(_0x22724b,_0x18a0f0)[_0x3f1326(0x173)](()=>{if(_0x3f54fe)return;dispatch(_0x412c32,_0x33ae07,_0x18a0f0,{'onSuccess':_0x410f2f=>{const _0x11fbc1=_0x386a;Promise['resolve']()[_0x11fbc1(0x173)](()=>refineResponse(_0x410f2f,_0x18a0f0))['then'](async _0x2e84e0=>{if(isResponseError(_0x410f2f)){await callResponseErrorHooks(_0x22724b,_0x18a0f0,_0x2e84e0);if(!_0x18a0f0['ignoreResponseError'])throw createResponseError(_0x22724b,_0x18a0f0,_0x2e84e0);}else await callResponseHooks(_0x22724b,_0x18a0f0,_0x2e84e0);_0x190e2c(()=>_0x1d8d54(_0x6dbecf?_0x2e84e0:_0x2e84e0['data']));})['catch'](_0x2fd7b5=>_0x190e2c(()=>_0x12b7e0(_0x2fd7b5)));},'onFail':_0x9f5b97=>{const _0x5e8404=_0x386a;Promise['resolve']()['then'](async()=>{const _0x3520f7=normalizeError(_0x9f5b97);if(!isAbortError(_0x3520f7))await callRequestErrorHooks(_0x22724b,_0x18a0f0,_0x3520f7);throw _0x3520f7;})[_0x5e8404(0x154)](_0x11fc12=>_0x190e2c(()=>_0x12b7e0(_0x11fc12)));}});})['catch'](async _0x500d24=>{const _0x2acfc8=normalizeError(_0x500d24);await callRequestErrorHooks(_0x22724b,_0x18a0f0,_0x2acfc8),_0x190e2c(()=>_0x12b7e0(_0x2acfc8));});});}const _0x519aca={};_0x519aca['method']=_0x3fd42d(0x14d),_0x519aca['responseType']=_0x3fd42d(0x189);const defaultConfig=_0x519aca;function createHttp(_0x46dda6={}){const _0x434069=_0x3fd42d,_0x4c45db=(_0x4a93bf,_0x29c6ad)=>{return dispatchHttp('request',_0x4a93bf,mergeOptions(defaultConfig,_0x46dda6,_0x29c6ad));},_0x512f3f=(_0x31ad24,_0x59ed32)=>{const _0x1e8acf=_0x386a,_0x5c0f3d={};return _0x5c0f3d[_0x1e8acf(0x1a0)]=_0x1e8acf(0x14f),dispatchHttp('upload',_0x31ad24,mergeOptions(defaultConfig,_0x46dda6,_0x59ed32,_0x5c0f3d));},_0x1626a1=(_0x1038ac,_0x237a7b)=>{const _0x177580=_0x386a,_0xadcddb={};return _0xadcddb['method']='GET',dispatchHttp(_0x177580(0x149),_0x1038ac,mergeOptions(defaultConfig,_0x46dda6,_0x237a7b,_0xadcddb));},_0x276b4e=_0x5b9ffb=>createHttp(mergeOptions(_0x46dda6,_0x5b9ffb)),_0x259456={};return _0x259456['request']=_0x4c45db,_0x259456[_0x434069(0x15b)]=_0x512f3f,_0x259456[_0x434069(0x149)]=_0x1626a1,_0x259456['create']=_0x276b4e,_0x259456;}const http=createHttp(),_0x51fd02={};_0x51fd02['enumerable']=!![],_0x51fd02['get']=function(){return createHttp;},Object[_0x3fd42d(0x18e)](exports,_0x3fd42d(0x177),_0x51fd02);const _0xa8554={};_0xa8554['enumerable']=!![],_0xa8554[_0x3fd42d(0x18c)]=function(){return createHttpAborter;},Object['defineProperty'](exports,_0x3fd42d(0x15c),_0xa8554);const _0x4f38fb={};_0x4f38fb[_0x3fd42d(0x15a)]=!![],_0x4f38fb[_0x3fd42d(0x18c)]=function(){return http;},Object['defineProperty'](exports,'http',_0x4f38fb);
|
package/dist/oiyo-DxaznqPn.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @oiyo/framework v0.4.6
|
|
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 _0x37031b=_0x26f9;(function(_0x4762b0,_0x2cee80){const _0x18f4b5=_0x26f9,_0x40c540=_0x4762b0();while(!![]){try{const _0x51f19b=parseInt(_0x18f4b5(0x216))/0x1+parseInt(_0x18f4b5(0x235))/0x2+-parseInt(_0x18f4b5(0x232))/0x3*(parseInt(_0x18f4b5(0x21f))/0x4)+-parseInt(_0x18f4b5(0x20e))/0x5+-parseInt(_0x18f4b5(0x226))/0x6+parseInt(_0x18f4b5(0x21d))/0x7*(parseInt(_0x18f4b5(0x20c))/0x8)+-parseInt(_0x18f4b5(0x218))/0x9*(parseInt(_0x18f4b5(0x1f4))/0xa);if(_0x51f19b===_0x2cee80)break;else _0x40c540['push'](_0x40c540['shift']());}catch(_0x5569ba){_0x40c540['push'](_0x40c540['shift']());}}}(_0x517c,0x7825f));function createHttpAborter(){const _0x3812ed=_0x26f9,_0x45f3b2=new HttpAbortSignal();return{'signal':_0x45f3b2,'abort':_0xb69585=>_0x45f3b2[_0x3812ed(0x1fd)](_0xb69585)};}const ABORT_ERROR_NAME='AbortError';var AbortEmitter=class{[_0x37031b(0x230)]=[];[_0x37031b(0x21c)](_0x3cb7f9,_0x1c1888){const _0x3d8122=_0x37031b;if(_0x3cb7f9!==_0x3d8122(0x20d))return;this['listeners'][_0x3d8122(0x221)](_0x1c1888);}['removeEventListener'](_0x397fdf,_0x466368){const _0x413340=_0x37031b;if(_0x397fdf!==_0x413340(0x20d))return;const _0x1b0c5e=this[_0x413340(0x230)]['indexOf'](_0x466368);if(_0x1b0c5e!==-0x1)this['listeners'][_0x413340(0x217)](_0x1b0c5e,0x1);}['emit'](_0x5a9ab7){for(const _0x3688f5 of this['listeners']['slice']())_0x3688f5['call'](this,_0x5a9ab7);}},HttpAbortSignal=class extends AbortEmitter{['aborted']=![];['reason']=void 0x0;['onabort']=null;[_0x37031b(0x1fd)](_0x4ea208){const _0x5a11d8=_0x37031b;if(this['aborted'])return;this['aborted']=!![],this['reason']=_0x4ea208===void 0x0?createAbortError():_0x4ea208;const _0x3ea5b9={};_0x3ea5b9[_0x5a11d8(0x1fc)]=_0x5a11d8(0x20d);const _0x26cad8=_0x3ea5b9;if(typeof this['onabort']===_0x5a11d8(0x236))this[_0x5a11d8(0x22f)](_0x26cad8);this[_0x5a11d8(0x21e)](_0x26cad8);}[_0x37031b(0x211)](){const _0x4f9b0a=_0x37031b;if(this[_0x4f9b0a(0x229)])throw this[_0x4f9b0a(0x222)];}};function createAbortError(_0x8d8810='The\x20operation\x20was\x20aborted'){const _0x3ef4dc=_0x37031b,_0x57a48d=new Error(_0x8d8810);return _0x57a48d[_0x3ef4dc(0x224)]=ABORT_ERROR_NAME,_0x57a48d;}function isAbortError(_0x20ff7f){const _0x2cd303=_0x37031b;return _0x20ff7f instanceof Error&&_0x20ff7f[_0x2cd303(0x224)]===ABORT_ERROR_NAME;}function onAbort(_0x3a1b8f,_0x2197ff){const _0x92a12c=_0x37031b;if(!_0x3a1b8f)return()=>{};if(_0x3a1b8f[_0x92a12c(0x229)])return _0x2197ff(),()=>{};return _0x3a1b8f[_0x92a12c(0x21c)](_0x92a12c(0x20d),_0x2197ff),()=>_0x3a1b8f[_0x92a12c(0x23c)](_0x92a12c(0x20d),_0x2197ff);}const HOOK_NAMES=[_0x37031b(0x200),_0x37031b(0x20a),_0x37031b(0x231),'onResponseError'];function mergeOptions(..._0x878d2c){const _0x23b88b=_0x37031b,_0x5325ff={},_0x3ae565={};for(const _0x77b4c0 of _0x878d2c){if(!_0x77b4c0)continue;for(const _0xb404cc of HOOK_NAMES)collectHook(_0x3ae565,_0xb404cc,_0x77b4c0);const _0x12b8d4=_0x5325ff['headers'],_0x521831=_0x5325ff[_0x23b88b(0x219)];Object[_0x23b88b(0x213)](_0x5325ff,_0x77b4c0);const _0x54589b={..._0x12b8d4,..._0x77b4c0['headers']};_0x5325ff['headers']=_0x54589b;const _0x4a3bae={..._0x521831,..._0x77b4c0['query']};_0x5325ff['query']=_0x4a3bae;}for(const [_0x14844e,_0x8db956]of Object['entries'](_0x3ae565))Object['assign'](_0x5325ff,{[_0x14844e]:async _0x19ab44=>{for(const _0x42bda9 of _0x8db956)await _0x42bda9(_0x19ab44);}});return _0x5325ff;}function collectHook(_0x48970f,_0x6c569,_0x116932){const _0x412aab=_0x116932[_0x6c569];if(typeof _0x412aab!=='function')return;_0x48970f[_0x6c569]??=[],_0x48970f[_0x6c569]['push'](_0x412aab);}function dispatch(_0x2a0965,_0x1c0eea,_0x53c4d3,_0x232feb){const _0x28962a=_0x37031b;let _0x421d22;if(_0x2a0965==='upload')_0x421d22=dispatchUpload(_0x1c0eea,_0x53c4d3,_0x232feb);else{if(_0x2a0965===_0x28962a(0x225))_0x421d22=dispatchDownload(_0x1c0eea,_0x53c4d3,_0x232feb);else _0x421d22=dispatchRequest(_0x1c0eea,_0x53c4d3,_0x232feb);}bindTask(_0x421d22,_0x53c4d3);}function bindTask(_0x594a9a,_0x3158c0){const _0x4be0c7=_0x37031b;onAbort(_0x3158c0[_0x4be0c7(0x22e)],()=>_0x594a9a[_0x4be0c7(0x20d)]());if(typeof _0x3158c0[_0x4be0c7(0x1ff)]==='function')_0x594a9a[_0x4be0c7(0x1ff)](_0x3158c0[_0x4be0c7(0x1ff)]);const _0x443c6f=_0x3158c0[_0x4be0c7(0x241)];if(typeof _0x443c6f==='function'&&'onProgressUpdate'in _0x594a9a)_0x594a9a[_0x4be0c7(0x202)](_0x443c6f);}function dispatchRequest(_0x4657ed,_0x55e76d,_0x3c3942){const _0x335d34=_0x37031b,_0x2092e7={'url':_0x4657ed,'method':_0x55e76d['method'],'header':_0x55e76d['headers'],'data':_0x55e76d['body']??{},'timeout':_0x55e76d['timeout'],'dataType':_0x55e76d['dataType']||'json','responseType':mappedResponseBodyType(_0x55e76d['responseType']),'sslVerify':_0x55e76d['sslVerify'],'withCredentials':_0x55e76d['withCredentials'],'firstIpv4':_0x55e76d[_0x335d34(0x22b)],'enableHttp2':_0x55e76d['enableHttp2'],'enableQuic':_0x55e76d['enableQuic'],'enableCache':_0x55e76d['enableCache'],'enableHttpDNS':_0x55e76d['enableHttpDNS'],'httpDNSServiceId':_0x55e76d[_0x335d34(0x233)],'enableChunked':_0x55e76d['enableChunked'],'forceCellularNetwork':_0x55e76d[_0x335d34(0x1f5)],'success':_0x3c3942[_0x335d34(0x1f6)],'fail':_0x3c3942['onFail'],'complete':()=>{}};return uni['request'](_0x2092e7);}function dispatchUpload(_0x2b1fb0,_0x48ce3d,_0x590725){const _0x10de51=_0x37031b,_0x3eb994={};_0x3eb994[_0x10de51(0x234)]=_0x2b1fb0,_0x3eb994[_0x10de51(0x207)]=_0x48ce3d[_0x10de51(0x207)],_0x3eb994[_0x10de51(0x228)]=_0x48ce3d[_0x10de51(0x228)],_0x3eb994['filePath']=_0x48ce3d['filePath'],_0x3eb994['name']=_0x48ce3d[_0x10de51(0x224)]??_0x10de51(0x228),_0x3eb994['files']=_0x48ce3d[_0x10de51(0x214)],_0x3eb994['header']=_0x48ce3d['headers'],_0x3eb994['formData']=_0x48ce3d[_0x10de51(0x21b)]??{},_0x3eb994[_0x10de51(0x22c)]=_0x48ce3d[_0x10de51(0x22c)],_0x3eb994['success']=_0x590725['onSuccess'],_0x3eb994[_0x10de51(0x215)]=_0x590725[_0x10de51(0x1f3)],_0x3eb994['complete']=()=>{};const _0x2f7eb7=_0x3eb994;return uni['uploadFile'](_0x2f7eb7);}function dispatchDownload(_0x4bc1f7,_0x4fddf4,_0xcac4c3){const _0xde2afe=_0x37031b,_0x4ce9c4={'url':_0x4bc1f7,'header':_0x4fddf4[_0xde2afe(0x23b)],'timeout':_0x4fddf4[_0xde2afe(0x22c)],'success':_0x50a384=>{const _0x46968c=_0xde2afe,_0x2ad4b1={..._0x50a384};_0x2ad4b1[_0x46968c(0x204)]={},_0x2ad4b1[_0x46968c(0x204)][_0x46968c(0x227)]=_0x50a384[_0x46968c(0x227)],_0xcac4c3['onSuccess'](_0x2ad4b1);},'fail':_0xcac4c3[_0xde2afe(0x1f3)],'complete':()=>{}};return uni[_0xde2afe(0x23f)](_0x4ce9c4);}function mappedResponseBodyType(_0xf88057){const _0x5ba496=_0x37031b;if(!_0xf88057||_0xf88057==='json')return _0x5ba496(0x23d);if(_0xf88057===_0x5ba496(0x1fe))return _0x5ba496(0x220);return _0x5ba496(0x23d);}var HttpError=class extends Error{constructor(_0x53d988){const _0x385abf=_0x37031b;super(_0x53d988),this[_0x385abf(0x224)]='HttpError';}};function createResponseError(_0x2cb387,_0x288ead,_0x2d934e){const _0x1bad77=_0x37031b,_0x1075bf=_0x2cb387,_0x4ac5d8='['+(_0x288ead?.['method']||'GET')+']\x20'+_0x1075bf,_0x1942b3=_0x2d934e?_0x2d934e['statusCode']+'\x20'+(_0x2d934e[_0x1bad77(0x201)]||''):'<no\x20response>',_0x352e64=_0x2d934e?JSON['stringify'](_0x2d934e[_0x1bad77(0x204)]):_0x1bad77(0x223),_0x392f51=new HttpError(_0x4ac5d8+':\x20'+_0x1942b3+(_0x2d934e['data']?'\x20'+_0x352e64:''));for(const _0x251d98 of[_0x1bad77(0x22d),'options','response','data'])Object['defineProperty'](_0x392f51,_0x251d98,{'get'(){const _0x31cc22=_0x1bad77,_0x3d1a07={};return _0x3d1a07['request']=_0x2cb387,_0x3d1a07[_0x31cc22(0x208)]=_0x288ead,_0x3d1a07['response']=_0x2d934e,_0x3d1a07[_0x31cc22(0x204)]=_0x2d934e[_0x31cc22(0x204)],_0x3d1a07[_0x251d98];}});return _0x392f51;}function normalizeError(_0x4ee16c){const _0x1666ec=_0x37031b;if(_0x4ee16c instanceof Error)return _0x4ee16c;return Object[_0x1666ec(0x213)](new Error(_0x4ee16c?.['errMsg']||_0x4ee16c?.[_0x1666ec(0x237)]||'HTTP\x20request\x20failed'),{'cause':_0x4ee16c});}async function callRequestHooks(_0x1d2f3e,_0x1ef16c){await _0x1ef16c['onRequest']?.({'options':_0x1ef16c,'resource':_0x1d2f3e});}async function callRequestErrorHooks(_0x5c85a5,_0x254249,_0x3c13d9){const _0xf1a85d=_0x37031b;await _0x254249[_0xf1a85d(0x20a)]?.({'options':_0x254249,'resource':_0x5c85a5,'error':_0x3c13d9});}async function callResponseHooks(_0x57b05c,_0x571c08,_0x214357){await _0x571c08['onResponse']?.({'options':_0x571c08,'resource':_0x57b05c,'response':_0x214357});}async function callResponseErrorHooks(_0x363225,_0xffe494,_0x494913){const _0x8547ef=_0x37031b;await _0xffe494[_0x8547ef(0x239)]?.({'options':_0xffe494,'resource':_0x363225,'response':_0x494913});}async function refineResponse(_0x197f45,_0x5a0535){const _0x3791af=_0x37031b;if(_0x5a0535['responseType']===_0x3791af(0x203)||!_0x5a0535['responseType'])return{..._0x197f45,'data':await parseJSONResponse(_0x197f45[_0x3791af(0x204)],_0x5a0535)};return _0x197f45;}function parseJSONResponse(_0x49d96f,_0x1898b2){const _0x472922=_0x37031b;if(typeof _0x49d96f!=='string')return _0x49d96f;if(_0x1898b2[_0x472922(0x20b)])return _0x1898b2['parseResponse'](_0x49d96f);return _0x49d96f?JSON['parse'](_0x49d96f):null;}function isResponseError(_0x572148){const _0x38dc22=_0x37031b,_0x514f0b=_0x38dc22(0x23a)in _0x572148?_0x572148['statusCode']:void 0x0;return typeof _0x514f0b==='number'&&(_0x514f0b<0xc8||_0x514f0b>=0x12c);}function _0x517c(){const _0x2a3002=['GET','type','_abort','arrayBuffer','onHeadersReceived','onRequest','errMsg','onProgressUpdate','json','data','flatMap','keys','fileType','options','includes','onRequestError','parseResponse','21384WGPTzG','abort','1801250WuXZVY','PATCH','responseType','throwIfAborted','create','assign','files','fail','406868InffJN','splice','171rVMkSI','query','catch','body','addEventListener','2219SKMeCI','emit','20AOBXnE','arraybuffer','push','reason','<no\x20response\x20body>','name','download','5040786UZUXRK','tempFilePath','file','aborted','method','firstIpv4','timeout','request','signal','onabort','listeners','onResponse','30777AdUzpG','httpDNSServiceId','url','1710726pBzatS','function','message','retryDelay','onResponseError','statusCode','headers','removeEventListener','text','upload','downloadFile','then','onProgress','response','number','onFail','192510WpBygS','forceCellularNetwork','onSuccess','startsWith','filter','POST','toUpperCase'];_0x517c=function(){return _0x2a3002;};return _0x517c();}const DEFAULT_RETRY_STATUS_CODES=[0x198,0x199,0x1a9,0x1ad,0x1f4,0x1f6,0x1f7,0x1f8],PAYLOAD_METHODS=new Set(['POST','PUT','DELETE',_0x37031b(0x20f)]);async function withRetry(_0x3eb954,_0x5bf552){const _0x5ad370=_0x37031b,_0x1ad92c=resolveRetryCount(_0x3eb954);for(let _0x535da3=0x0;;_0x535da3++)try{return await _0x5bf552();}catch(_0x210c2c){if(_0x535da3>=_0x1ad92c||!shouldRetry(_0x210c2c,_0x3eb954))throw _0x210c2c;await sleep(_0x3eb954[_0x5ad370(0x238)]??0x0,_0x3eb954['signal']);}}function resolveRetryCount(_0x43abae){const _0x33b0fa=_0x37031b,{retry:_0x2b8815}=_0x43abae;if(_0x2b8815===![])return 0x0;if(typeof _0x2b8815==='number')return _0x2b8815>0x0?_0x2b8815:0x0;return isPayloadMethod(_0x43abae[_0x33b0fa(0x22a)])?0x0:0x1;}function shouldRetry(_0x259cc7,_0x1d3963){const _0x519e94=_0x37031b;if(_0x1d3963['signal']?.[_0x519e94(0x229)]||isAbortError(_0x259cc7))return![];const _0x520ebf=_0x259cc7?.[_0x519e94(0x242)]?.[_0x519e94(0x23a)];if(typeof _0x520ebf!==_0x519e94(0x243))return!![];return(_0x1d3963['retryStatusCodes']??DEFAULT_RETRY_STATUS_CODES)['includes'](_0x520ebf);}function isPayloadMethod(_0x509a14){const _0x331cc4=_0x37031b;return!!_0x509a14&&PAYLOAD_METHODS['has'](_0x509a14[_0x331cc4(0x1fa)]());}function sleep(_0x3257cd,_0x98f382){return new Promise((_0x3cdee1,_0x424827)=>{const _0x1080fc=_0x26f9;if(_0x98f382?.['aborted']){_0x424827(_0x98f382[_0x1080fc(0x222)]);return;}if(!(_0x3257cd>0x0)){_0x3cdee1();return;}let _0x18803e=()=>{};const _0x509757=setTimeout(()=>{_0x18803e(),_0x3cdee1();},_0x3257cd);_0x18803e=onAbort(_0x98f382,()=>{clearTimeout(_0x509757),_0x424827(_0x98f382['reason']);});});}function buildURL(_0xfd7f8a,_0x450d5c){const _0x5aaa4c=_0x37031b,_0xb43111=joinURL(_0x450d5c['baseURL'],_0xfd7f8a),_0x23b6a6=_0x450d5c[_0x5aaa4c(0x219)]??{},_0x272141=Object[_0x5aaa4c(0x206)](_0x23b6a6)[_0x5aaa4c(0x1f8)](_0x59ea97=>_0x23b6a6[_0x59ea97]!==void 0x0)[_0x5aaa4c(0x205)](_0xe516eb=>{const _0x579684=_0x23b6a6[_0xe516eb];return(Array['isArray'](_0x579684)?_0x579684:[_0x579684])['map'](_0x2b6a7c=>encodeURIComponent(_0xe516eb)+'='+encodeURIComponent(String(_0x2b6a7c)));})['join']('&');if(!_0x272141)return _0xb43111;return''+_0xb43111+(_0xb43111[_0x5aaa4c(0x209)]('?')?'&':'?')+_0x272141;}function joinURL(_0x41b68b,_0x2a77c5){if(!_0x41b68b||isAbsoluteURL(_0x2a77c5))return _0x2a77c5;return _0x41b68b['replace'](/\/+$/,'')+'/'+_0x2a77c5['replace'](/^\/+/,'');}function isAbsoluteURL(_0xb79fc2){const _0x32cfe8=_0x37031b;return/^[a-z][a-z\d+\-.]*:\/\//i['test'](_0xb79fc2)||_0xb79fc2[_0x32cfe8(0x1f7)]('//');}function _0x26f9(_0x220b2b,_0x37c518){_0x220b2b=_0x220b2b-0x1f3;const _0x517c41=_0x517c();let _0x26f9da=_0x517c41[_0x220b2b];return _0x26f9da;}function dispatchHttp(_0x545dff,_0x37fc16,_0x1b0574){const _0x2e17f2=buildURL(_0x37fc16,_0x1b0574);return withRetry(_0x1b0574,()=>attemptRequest(_0x545dff,_0x37fc16,_0x2e17f2,_0x1b0574));}function attemptRequest(_0x475089,_0x7a5be2,_0x1c6513,_0x20136c){const _0x23e3ee=!!_0x20136c['raw'];return new Promise((_0x37d8a1,_0x3e92bd)=>{const _0x489e49=_0x26f9;let _0x55879f=![];const _0xa05293=_0x48ca86=>{if(_0x55879f)return;_0x55879f=!![],_0x48ca86();},_0x2b8c96=onAbort(_0x20136c[_0x489e49(0x22e)],()=>{const _0x1cdc21=_0x489e49;_0xa05293(()=>_0x3e92bd(_0x20136c['signal'][_0x1cdc21(0x222)]));}),_0xc109df=_0xc80c54=>{_0x2b8c96(),_0xa05293(_0xc80c54);};callRequestHooks(_0x7a5be2,_0x20136c)['then'](()=>{if(_0x55879f)return;dispatch(_0x475089,_0x1c6513,_0x20136c,{'onSuccess':_0x34ed80=>{const _0x31ef24=_0x26f9;Promise['resolve']()['then'](()=>refineResponse(_0x34ed80,_0x20136c))[_0x31ef24(0x240)](async _0xa54fae=>{const _0x1376aa=_0x31ef24;if(isResponseError(_0x34ed80)){await callResponseErrorHooks(_0x7a5be2,_0x20136c,_0xa54fae);if(!_0x20136c['ignoreResponseError'])throw createResponseError(_0x7a5be2,_0x20136c,_0xa54fae);}else await callResponseHooks(_0x7a5be2,_0x20136c,_0xa54fae);_0xc109df(()=>_0x37d8a1(_0x23e3ee?_0xa54fae:_0xa54fae[_0x1376aa(0x204)]));})['catch'](_0x4a8985=>_0xc109df(()=>_0x3e92bd(_0x4a8985)));},'onFail':_0x5b0a6c=>{const _0x42197e=_0x26f9;Promise['resolve']()[_0x42197e(0x240)](async()=>{const _0x3f9a79=normalizeError(_0x5b0a6c);if(!isAbortError(_0x3f9a79))await callRequestErrorHooks(_0x7a5be2,_0x20136c,_0x3f9a79);throw _0x3f9a79;})[_0x42197e(0x21a)](_0x4b147b=>_0xc109df(()=>_0x3e92bd(_0x4b147b)));}});})['catch'](async _0x1592fb=>{const _0x948364=normalizeError(_0x1592fb);await callRequestErrorHooks(_0x7a5be2,_0x20136c,_0x948364),_0xc109df(()=>_0x3e92bd(_0x948364));});});}const _0x38e877={};_0x38e877['method']='GET',_0x38e877[_0x37031b(0x210)]='json';const defaultConfig=_0x38e877;function createHttp(_0x1012f5={}){const _0x5e5235=_0x37031b,_0x50d100=(_0x11beb4,_0x28e79c)=>{const _0x5de238=_0x26f9;return dispatchHttp(_0x5de238(0x22d),_0x11beb4,mergeOptions(defaultConfig,_0x1012f5,_0x28e79c));},_0x5d2052=(_0x41d5f7,_0x2962e8)=>{const _0x152117=_0x26f9,_0x589ca5={};return _0x589ca5[_0x152117(0x22a)]=_0x152117(0x1f9),dispatchHttp('upload',_0x41d5f7,mergeOptions(defaultConfig,_0x1012f5,_0x2962e8,_0x589ca5));},_0x46f1de=(_0x337e5e,_0x49cbe2)=>{const _0x2a7c33=_0x26f9,_0x3e7cdb={};return _0x3e7cdb['method']=_0x2a7c33(0x1fb),dispatchHttp(_0x2a7c33(0x225),_0x337e5e,mergeOptions(defaultConfig,_0x1012f5,_0x49cbe2,_0x3e7cdb));},_0x2680a2=_0x5d06b8=>createHttp(mergeOptions(_0x1012f5,_0x5d06b8)),_0x543164={};return _0x543164[_0x5e5235(0x22d)]=_0x50d100,_0x543164[_0x5e5235(0x23e)]=_0x5d2052,_0x543164[_0x5e5235(0x225)]=_0x46f1de,_0x543164[_0x5e5235(0x212)]=_0x2680a2,_0x543164;}const http=createHttp();export{http as n,createHttpAborter as r,createHttp as t};
|