uapi-browser-sdk 0.1.16 → 0.1.17
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/src/index.d.ts +9 -7
- package/dist/src/index.js +196 -110
- package/package.json +1 -1
- package/src/index.ts +266 -101
package/dist/src/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export interface UapiClientOptions {
|
|
|
8
8
|
type RequestOptions = {
|
|
9
9
|
disableCache?: boolean;
|
|
10
10
|
};
|
|
11
|
+
type RequestBodyPayload = Record<string, unknown> | FormData;
|
|
12
|
+
export type BrowserUpload = Blob | File;
|
|
11
13
|
export type GetClipzyGetResponse = Internal.GetClipzyGet200Response;
|
|
12
14
|
export interface GetClipzyGetArgs {
|
|
13
15
|
/** 为 true 时会自动附加 `_t` 时间戳,绕过服务端缓存。 */
|
|
@@ -238,7 +240,7 @@ export interface PostImageCompressArgs {
|
|
|
238
240
|
/** 输出图片格式,可以是 'png' 或 'jpeg'。 */
|
|
239
241
|
format?: string;
|
|
240
242
|
/** 支持PNG, JPG, JPEG等常见图片格式。文件大小不超过15MB。 */
|
|
241
|
-
file:
|
|
243
|
+
file: BrowserUpload;
|
|
242
244
|
}
|
|
243
245
|
export type PostImageDecodeResponse = ArrayBuffer;
|
|
244
246
|
export interface PostImageDecodeArgs {
|
|
@@ -271,7 +273,7 @@ export interface PostImageDecodeArgs {
|
|
|
271
273
|
/** 背景色。可以传 `black`、`white` 或 `#RRGGBB`,不传时默认是 `black`。 */
|
|
272
274
|
background?: string;
|
|
273
275
|
/** 要处理的图片文件。这个接口适合直接上传 JPG、JPEG、PNG、WebP、BMP 等常见格式。 */
|
|
274
|
-
file?:
|
|
276
|
+
file?: BrowserUpload;
|
|
275
277
|
/** 要处理的图片链接。适合不方便直接上传文件时使用。 */
|
|
276
278
|
url?: string;
|
|
277
279
|
}
|
|
@@ -299,7 +301,7 @@ export interface PostImageMotouArgs {
|
|
|
299
301
|
/** Same as `bgColor`. Kept for compatibility. */
|
|
300
302
|
"bg_color"?: string;
|
|
301
303
|
/** 上传的图片文件。支持JPG、PNG、GIF等常见格式。 */
|
|
302
|
-
file?:
|
|
304
|
+
file?: BrowserUpload;
|
|
303
305
|
/** 图片的URL地址。如果提供此项,将优先使用该URL的图片。 */
|
|
304
306
|
imageUrl?: string;
|
|
305
307
|
/** Same as `imageUrl`. Kept for compatibility. */
|
|
@@ -314,7 +316,7 @@ export interface PostImageNsfwArgs {
|
|
|
314
316
|
/** 手动指定缓存穿透时间戳。传入后会原样带到查询参数中。 */
|
|
315
317
|
_t?: string | number;
|
|
316
318
|
/** 要检测的图片文件。支持 JPG、JPEG、PNG、GIF、WebP 格式,最大 20MB。 */
|
|
317
|
-
file?:
|
|
319
|
+
file?: BrowserUpload;
|
|
318
320
|
/** 图片的 URL 地址。如果同时提供 file 和 url,将优先使用 file。 */
|
|
319
321
|
url?: string;
|
|
320
322
|
}
|
|
@@ -331,7 +333,7 @@ export interface PostImageOcrArgs {
|
|
|
331
333
|
/** Same as `enableCls`. Kept for compatibility. */
|
|
332
334
|
"enable_cls"?: string;
|
|
333
335
|
/** 待识别的图片文件。支持 JPG、JPEG、PNG、BMP、GIF、WebP 等常见格式,最大不超过 10MB。请勿与 url 或 image_base64 同时提交。 */
|
|
334
|
-
file?:
|
|
336
|
+
file?: BrowserUpload;
|
|
335
337
|
/** 图片的 Base64 字符串。可以传完整 Data URI,也可以只传纯 Base64 内容。请勿与 file 或 url 同时提交。 */
|
|
336
338
|
imageBase64?: string;
|
|
337
339
|
/** Same as `imageBase64`. Kept for compatibility. */
|
|
@@ -385,7 +387,7 @@ export interface PostImageSvgArgs {
|
|
|
385
387
|
/** JPEG 图像的压缩质量(1-100)。仅当 `format` 为 `jpeg` 或 `jpg` 时有效。 */
|
|
386
388
|
quality?: number;
|
|
387
389
|
/** 支持SVG文件 */
|
|
388
|
-
file?:
|
|
390
|
+
file?: BrowserUpload;
|
|
389
391
|
}
|
|
390
392
|
export type GetHistoryProgrammerResponse = Internal.GetHistoryProgrammer200Response;
|
|
391
393
|
export interface GetHistoryProgrammerArgs {
|
|
@@ -1364,7 +1366,7 @@ export declare class UapiClient {
|
|
|
1364
1366
|
readonly "智能搜索": ZhiNengSouSuoApi;
|
|
1365
1367
|
constructor(baseURL: string, tokenOrOptions?: string | UapiClientOptions, maybeOptions?: UapiClientOptions);
|
|
1366
1368
|
get lastResponseMeta(): ResponseMeta | undefined;
|
|
1367
|
-
_request(method: string, path: string, params?: Record<string, unknown>, body?:
|
|
1369
|
+
_request(method: string, path: string, params?: Record<string, unknown>, body?: RequestBodyPayload, headers?: Record<string, string>, responseKind?: 'json' | 'text' | 'arrayBuffer', requestOptions?: RequestOptions): Promise<any>;
|
|
1368
1370
|
}
|
|
1369
1371
|
export declare class ClipzyZaiXianJianTieBanApi {
|
|
1370
1372
|
private c;
|