@qxs-bns/utils 0.0.19 → 0.0.20
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/es/index.mjs +2 -0
- package/es/index.mjs.map +1 -0
- package/es/src/{argo-log.js → argo-log.mjs} +1 -1
- package/es/src/argo-log.mjs.map +1 -0
- package/es/src/{date-transfer.js → date-transfer.mjs} +1 -1
- package/es/src/date-transfer.mjs.map +1 -0
- package/es/src/{device.js → device.mjs} +1 -1
- package/es/src/device.mjs.map +1 -0
- package/es/src/{file-operations.js → file-operations.mjs} +1 -1
- package/es/src/file-operations.mjs.map +1 -0
- package/es/src/{json.js → json.mjs} +1 -1
- package/es/src/json.mjs.map +1 -0
- package/es/src/{oss-uploader.js → oss-uploader.mjs} +1 -1
- package/es/src/oss-uploader.mjs.map +1 -0
- package/es/src/{set-guid.js → set-guid.mjs} +1 -1
- package/es/src/set-guid.mjs.map +1 -0
- package/es/src/{storage.js → storage.mjs} +1 -1
- package/es/src/storage.mjs.map +1 -0
- package/es/src/{types.js → types.mjs} +1 -1
- package/es/src/types.mjs.map +1 -0
- package/es/src/use-api.mjs +2 -0
- package/es/src/use-api.mjs.map +1 -0
- package/es/src/{watermark.js → watermark.mjs} +1 -1
- package/es/src/watermark.mjs.map +1 -0
- package/lib/index.cjs +2 -0
- package/lib/index.cjs.map +1 -0
- package/lib/src/{argo-log.js → argo-log.cjs} +1 -1
- package/lib/src/argo-log.cjs.map +1 -0
- package/lib/src/{date-transfer.js → date-transfer.cjs} +1 -1
- package/lib/src/date-transfer.cjs.map +1 -0
- package/lib/src/{device.js → device.cjs} +1 -1
- package/lib/src/device.cjs.map +1 -0
- package/lib/src/{file-operations.js → file-operations.cjs} +1 -1
- package/lib/src/file-operations.cjs.map +1 -0
- package/lib/src/{json.js → json.cjs} +1 -1
- package/lib/src/json.cjs.map +1 -0
- package/lib/src/{oss-uploader.js → oss-uploader.cjs} +1 -1
- package/lib/src/oss-uploader.cjs.map +1 -0
- package/lib/src/{set-guid.js → set-guid.cjs} +1 -1
- package/lib/src/set-guid.cjs.map +1 -0
- package/lib/src/{storage.js → storage.cjs} +1 -1
- package/lib/src/storage.cjs.map +1 -0
- package/lib/src/{types.js → types.cjs} +1 -1
- package/lib/src/types.cjs.map +1 -0
- package/lib/src/use-api.cjs +2 -0
- package/lib/src/use-api.cjs.map +1 -0
- package/lib/src/{watermark.js → watermark.cjs} +1 -1
- package/lib/src/watermark.cjs.map +1 -0
- package/package.json +9 -11
- package/types/src/file-operations.d.ts.map +1 -1
- package/types/src/use-api.d.ts +73 -1
- package/types/src/use-api.d.ts.map +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
- package/es/index.js +0 -2
- package/es/index.js.map +0 -1
- package/es/src/argo-log.js.map +0 -1
- package/es/src/date-transfer.js.map +0 -1
- package/es/src/device.js.map +0 -1
- package/es/src/file-operations.js.map +0 -1
- package/es/src/json.js.map +0 -1
- package/es/src/oss-uploader.js.map +0 -1
- package/es/src/set-guid.js.map +0 -1
- package/es/src/storage.js.map +0 -1
- package/es/src/types.js.map +0 -1
- package/es/src/use-api.js +0 -2
- package/es/src/use-api.js.map +0 -1
- package/es/src/watermark.js.map +0 -1
- package/lib/index.js +0 -2
- package/lib/index.js.map +0 -1
- package/lib/src/argo-log.js.map +0 -1
- package/lib/src/date-transfer.js.map +0 -1
- package/lib/src/device.js.map +0 -1
- package/lib/src/file-operations.js.map +0 -1
- package/lib/src/json.js.map +0 -1
- package/lib/src/oss-uploader.js.map +0 -1
- package/lib/src/set-guid.js.map +0 -1
- package/lib/src/storage.js.map +0 -1
- package/lib/src/types.js.map +0 -1
- package/lib/src/use-api.js +0 -2
- package/lib/src/use-api.js.map +0 -1
- package/lib/src/watermark.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qxs-bns/utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.20",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"sideEffects": false,
|
|
8
|
-
"main": "./es/index.
|
|
8
|
+
"main": "./es/index.mjs",
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"axios": "^1.7.9"
|
|
11
11
|
},
|
|
@@ -14,30 +14,28 @@
|
|
|
14
14
|
"ans-javascript-sdk": "^4.5.5",
|
|
15
15
|
"xlsx": "^0.18.5"
|
|
16
16
|
},
|
|
17
|
-
"module": "./es/index.
|
|
17
|
+
"module": "./es/index.mjs",
|
|
18
18
|
"types": "./types/index.d.ts",
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
|
-
"import": "./es/index.
|
|
22
|
-
"require": "./lib/index.
|
|
21
|
+
"import": "./es/index.mjs",
|
|
22
|
+
"require": "./lib/index.cjs",
|
|
23
23
|
"types": "./types/index.d.ts"
|
|
24
24
|
},
|
|
25
25
|
"./es": {
|
|
26
|
-
"import": "./es/index.
|
|
27
|
-
"require": "./lib/index.js",
|
|
26
|
+
"import": "./es/index.mjs",
|
|
28
27
|
"types": "./types/index.d.ts"
|
|
29
28
|
},
|
|
30
29
|
"./lib": {
|
|
31
|
-
"
|
|
32
|
-
"require": "./lib/index.js",
|
|
30
|
+
"require": "./lib/index.cjs",
|
|
33
31
|
"types": "./types/index.d.ts"
|
|
34
32
|
},
|
|
35
33
|
"./es/*": {
|
|
36
|
-
"import": "./es/*.
|
|
34
|
+
"import": "./es/*.mjs",
|
|
37
35
|
"types": "./types/*.d.ts"
|
|
38
36
|
},
|
|
39
37
|
"./lib/*": {
|
|
40
|
-
"require": "./lib/*.
|
|
38
|
+
"require": "./lib/*.cjs",
|
|
41
39
|
"types": "./types/*.d.ts"
|
|
42
40
|
},
|
|
43
41
|
"./*": "./*"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-operations.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/file-operations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-operations.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/file-operations.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,EAAE,GAAG,CAAA;QACjB,GAAG,EAAE,GAAG,CAAA;KACT;CACF;AAoCD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,UAAU,kBAAkB;IAC1B,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACzE,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,IAAI,CAAA;IAC3C,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACvF,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAA;IAC9C,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACtH;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,GAAG,CAAA;CAChB;AACD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,GAAG,CAAA;IACb,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAA;CACnD;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,CA4E9F;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAQzD"}
|
package/types/src/use-api.d.ts
CHANGED
|
@@ -1,24 +1,43 @@
|
|
|
1
1
|
import type { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
2
|
+
/**
|
|
3
|
+
* 成功响应的数据结构
|
|
4
|
+
* @template T - 响应数据的类型
|
|
5
|
+
*/
|
|
2
6
|
export interface SuccessResponse<T> {
|
|
3
7
|
code: number;
|
|
4
8
|
count: number;
|
|
5
9
|
data: T;
|
|
6
10
|
message: string;
|
|
7
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* 错误响应的数据结构
|
|
14
|
+
*/
|
|
8
15
|
export interface ErrorResponse {
|
|
9
16
|
code: number;
|
|
10
17
|
data: null;
|
|
11
18
|
message: string;
|
|
12
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* API 响应的统一封装
|
|
22
|
+
* @template W - 是否返回完整响应,true 返回完整响应,false 只返回 data
|
|
23
|
+
* @template T - 响应数据的类型
|
|
24
|
+
*/
|
|
13
25
|
export interface UseApiResponse<W extends boolean = false, T = unknown> {
|
|
14
26
|
res: W extends true ? SuccessResponse<T> : T;
|
|
15
27
|
error: ErrorResponse | null;
|
|
16
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* API URL 配置对象类型
|
|
31
|
+
*/
|
|
17
32
|
export interface UrlObjectType {
|
|
18
33
|
url: string;
|
|
19
34
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
20
35
|
proxyPrefix?: string;
|
|
21
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* API 类型映射,用于定义每个接口的请求和响应类型
|
|
39
|
+
* @template U - URL 配置对象类型
|
|
40
|
+
*/
|
|
22
41
|
export type ApiTypeMap<U extends UrlObjectType> = {
|
|
23
42
|
[K in U['url']]: {
|
|
24
43
|
request: any;
|
|
@@ -31,13 +50,66 @@ type RequestPayload<T> = T extends {
|
|
|
31
50
|
type RequestParams<T> = T extends {
|
|
32
51
|
params: any;
|
|
33
52
|
} ? T['params'] : T;
|
|
53
|
+
/**
|
|
54
|
+
* API 服务类,提供统一的请求处理和错误处理
|
|
55
|
+
* @template T - API 类型映射
|
|
56
|
+
* @template U - URL 配置对象类型
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* // 定义 API 类型映射
|
|
61
|
+
* interface UserApi extends ApiTypeMap<UserUrlObject> {
|
|
62
|
+
* '/user/list': {
|
|
63
|
+
* request: { page: number; size: number }
|
|
64
|
+
* response: User[]
|
|
65
|
+
* }
|
|
66
|
+
* }
|
|
67
|
+
*
|
|
68
|
+
* // 创建 API 服务实例
|
|
69
|
+
* const api = new ApiService<UserApi, UserUrlObject>(axios.create(), false)
|
|
70
|
+
*
|
|
71
|
+
* // 发起请求
|
|
72
|
+
* const { res, error } = await api.useApi({
|
|
73
|
+
* url: '/user/list',
|
|
74
|
+
* method: 'GET',
|
|
75
|
+
* params: { page: 1, size: 10 }
|
|
76
|
+
* })
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
34
79
|
export declare class ApiService<T extends ApiTypeMap<U>, U extends UrlObjectType> {
|
|
35
80
|
private apiInstance;
|
|
81
|
+
private isWholeResponse;
|
|
36
82
|
private static instance;
|
|
37
|
-
|
|
83
|
+
/**
|
|
84
|
+
* 构造函数,实现单例模式
|
|
85
|
+
* @param apiInstance - Axios 实例
|
|
86
|
+
* @param isWholeResponse - 是否返回完整响应
|
|
87
|
+
*/
|
|
88
|
+
constructor(apiInstance: AxiosInstance, isWholeResponse: boolean);
|
|
89
|
+
/**
|
|
90
|
+
* 判断是否为业务错误
|
|
91
|
+
* @param obj - 待判断的对象
|
|
92
|
+
*/
|
|
38
93
|
private isBusinessError;
|
|
94
|
+
/**
|
|
95
|
+
* 判断是否为 Axios 响应对象
|
|
96
|
+
* @param value - 待判断的值
|
|
97
|
+
*/
|
|
39
98
|
private isAxiosResponse;
|
|
99
|
+
/**
|
|
100
|
+
* 判断是否为错误响应
|
|
101
|
+
* @param value - 待判断的值
|
|
102
|
+
*/
|
|
40
103
|
private isErrorResponse;
|
|
104
|
+
/**
|
|
105
|
+
* 发起 API 请求
|
|
106
|
+
* @template K - URL 配置对象类型
|
|
107
|
+
* @template W - 是否返回完整响应
|
|
108
|
+
* @param axiosConfig - Axios 请求配置
|
|
109
|
+
* @param params - 请求参数
|
|
110
|
+
* @param isWholeResponse - 是否返回完整响应,默认使用实例配置
|
|
111
|
+
* @returns Promise<UseApiResponse> - 统一的响应格式
|
|
112
|
+
*/
|
|
41
113
|
useApi: <K extends U, W extends boolean = false>(axiosConfig: Omit<AxiosRequestConfig<RequestPayload<T[K["url"]]["request"]>>, "params"> & K & {
|
|
42
114
|
params?: RequestParams<T[K["url"]]["request"]>;
|
|
43
115
|
}, params?: RequestParams<T[K["url"]]["request"]>, isWholeResponse?: W) => Promise<UseApiResponse<W, T[K["url"]]["response"]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-api.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/use-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAiB,MAAM,OAAO,CAAA;AAG7E,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,CAAC,CAAA;IACP,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,OAAO,GAAG,KAAK,EAAE,CAAC,GAAG,OAAO;IACpE,GAAG,EAAE,CAAC,SAAS,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAC5C,KAAK,EAAE,aAAa,GAAG,IAAI,CAAA;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,aAAa,IAAI;KAC/C,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG;QACf,OAAO,EAAE,GAAG,CAAA;QACZ,QAAQ,EAAE,GAAG,CAAA;KACd;CACF,CAAA;
|
|
1
|
+
{"version":3,"file":"use-api.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/use-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAiB,MAAM,OAAO,CAAA;AAG7E;;;GAGG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,CAAC,CAAA;IACP,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,OAAO,GAAG,KAAK,EAAE,CAAC,GAAG,OAAO;IACpE,GAAG,EAAE,CAAC,SAAS,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAC5C,KAAK,EAAE,aAAa,GAAG,IAAI,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,aAAa,IAAI;KAC/C,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG;QACf,OAAO,EAAE,GAAG,CAAA;QACZ,QAAQ,EAAE,GAAG,CAAA;KACd;CACF,CAAA;AAGD,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,IAAI,EAAE,GAAG,CAAA;CAAE,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AAChE,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,MAAM,EAAE,GAAG,CAAA;CAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,UAAU,CACrB,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EACvB,CAAC,SAAS,aAAa;IAUrB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,eAAe;IATzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAsB;IAE7C;;;;OAIG;gBAEO,WAAW,EAAE,aAAa,EAC1B,eAAe,EAAE,OAAO;IASlC;;;OAGG;IACH,OAAO,CAAC,eAAe;IAOvB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAWvB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAIvB;;;;;;;;OAQG;IACI,MAAM,GACX,CAAC,SAAS,CAAC,EACX,CAAC,SAAS,OAAO,GAAG,KAAK,EAEzB,aAAa,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG;QAC5F,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;KAC/C,EACD,SAAS,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAC9C,kBAAiB,CAA6B,KAC7C,OAAO,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAqCrD;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../packages/utils/src/argo-log.ts","../../../packages/utils/src/date-transfer.ts","../../../packages/utils/src/device.ts","../../../node_modules/.pnpm/vite@6.2.1_@types+node@22.13.10_jiti@2.4.2_sass-embedded@1.85.1_sass@1.85.1_terser@5.39.0_tsx@4.19.3_yaml@2.7.0/node_modules/vite/types/hmrpayload.d.ts","../../../node_modules/.pnpm/vite@6.2.1_@types+node@22.13.10_jiti@2.4.2_sass-embedded@1.85.1_sass@1.85.1_terser@5.39.0_tsx@4.19.3_yaml@2.7.0/node_modules/vite/types/customevent.d.ts","../../../node_modules/.pnpm/vite@6.2.1_@types+node@22.13.10_jiti@2.4.2_sass-embedded@1.85.1_sass@1.85.1_terser@5.39.0_tsx@4.19.3_yaml@2.7.0/node_modules/vite/types/hot.d.ts","../../../node_modules/.pnpm/vite@6.2.1_@types+node@22.13.10_jiti@2.4.2_sass-embedded@1.85.1_sass@1.85.1_terser@5.39.0_tsx@4.19.3_yaml@2.7.0/node_modules/vite/types/importglob.d.ts","../../../node_modules/.pnpm/vite@6.2.1_@types+node@22.13.10_jiti@2.4.2_sass-embedded@1.85.1_sass@1.85.1_terser@5.39.0_tsx@4.19.3_yaml@2.7.0/node_modules/vite/types/importmeta.d.ts","../../../node_modules/.pnpm/vite@6.2.1_@types+node@22.13.10_jiti@2.4.2_sass-embedded@1.85.1_sass@1.85.1_terser@5.39.0_tsx@4.19.3_yaml@2.7.0/node_modules/vite/client.d.ts","../../../packages/utils/src/file-operations.ts","../../../node_modules/.pnpm/xlsx@0.18.5/node_modules/xlsx/types/index.d.ts","../../../packages/utils/src/json.ts","../../../node_modules/.pnpm/@types+ali-oss@6.16.11/node_modules/@types/ali-oss/index.d.ts","../../../packages/utils/src/oss-uploader.ts","../../../packages/utils/src/set-guid.ts","../../../packages/utils/src/storage.ts","../../../packages/utils/src/types.ts","../../../node_modules/.pnpm/axios@1.8.2/node_modules/axios/index.d.ts","../../../packages/utils/src/use-api.ts","../../../packages/utils/src/watermark.ts","../../../packages/utils/index.ts","../../../packages/utils/shims.d.ts","../../../node_modules/.pnpm/@types+estree@1.0.6/node_modules/@types/estree/index.d.ts","../../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts","../../../node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/use-at-your-own-risk.d.ts","../../../node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/index.d.ts","../../../node_modules/.pnpm/@types+eslint-scope@3.7.7/node_modules/@types/eslint-scope/index.d.ts"],"fileIdsList":[[70,73],[70,71,72],[73],[55],[51],[52],[53,54],[48,49,50,57,59,61,62,63,64,66,67],[69],[56],[58],[60],[64,65]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"092c2bfe125ce69dbb1223c85d68d4d2397d7d8411867b5cc03cec902c233763","affectsGlobalScope":true,"impliedFormat":1},{"version":"07f073f19d67f74d732b1adea08e1dc66b1b58d77cb5b43931dee3d798a2fd53","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"9efe271422d844c9a36e0ea606704268e4c8ee34bd2a194e954a31381475ea55","signature":"a8f6c54b02a016b0a4c0cbe6a878df7f2656f9a3f43986ad257d45665e612e94"},{"version":"72af2f99ff91a9a6767e9374d5bcfdfa734f056e0ca4f99acfbdc0b6910cbe6a","signature":"642691020b5d2610d98d8dfa25df7e7c58a2e885d24bdec278f98842b02892f6"},{"version":"de9652b1bdad8aa2fa302b263a6a72265b276fec040394aa3b6c1adcff419ebc","signature":"6364be1269de7f1efc40324fb2cadc9a17d9bd2742d5bc1b95e309d848ca50f6"},{"version":"02b1133807234b1a7d9bf9b1419ee19444dd8c26b101bc268aa8181591241f1f","impliedFormat":1},{"version":"6222e987b58abfe92597e1273ad7233626285bc2d78409d4a7b113d81a83496b","impliedFormat":1},{"version":"cbe726263ae9a7bf32352380f7e8ab66ee25b3457137e316929269c19e18a2be","impliedFormat":1},{"version":"7f698624bbbb060ece7c0e51b7236520ebada74b747d7523c7df376453ed6fea","impliedFormat":1},{"version":"4025a454b1ca489b179ee8c684bdd70ff8c1967e382076ade53e7e4653e1daec","affectsGlobalScope":true,"impliedFormat":1},{"version":"1eef826bc4a19de22155487984e345a34c9cd511dd1170edc7a447cb8231dd4a","affectsGlobalScope":true,"impliedFormat":99},{"version":"e3c551500bab7aea1c3065871fa5689e723598adbc0e5854aceee8b0a7cdb51f","signature":"4f8d8bcaa7127e5ed2d649cd5fc16b4e46b6d6960d82982ede8429d8066f9b96","affectsGlobalScope":true},{"version":"593654eebe902db28ca173f021f74ea9f77e8b344aebb0a80fa4d10f29bb3a9d","impliedFormat":1},{"version":"19f50a093aa873de6321cd996913aa89e0ec5308a8ae49bf05f071cd9614d0c6","signature":"10ee1d72a1aeb7992ec2517f444db7d425261969e0476b94a1bef6e47fd5c4b6"},{"version":"07e3a9a4ac19e4b39c9403908e87cd24166f9392851d566e0e32b2271dedb4e8","impliedFormat":1},{"version":"42b4030b8dfde5376043f3dd2ce1296697d0e6905f21f2c93463b1d22c4862a0","signature":"28568c2a38ace4ec018e86ea1bdb429d563b3765af5d386b15c6b5a7055e348b"},{"version":"b661af9a80f1690400c4e230fc012525de39b87e9ed2d44b9501581eaf6f8102","signature":"3452b2a4e467983a2cebf29bed5e4810866b8b191972cb9ed23f8c3907dfb56e"},{"version":"7484cd645652e5de0e944021ff47e2794cd64e91ccba9e2ddfe2e5c4c7e62b89","signature":"b5ff6435fa9c6d61900a8764225558104fce909c6005109cb4ec42a6772052bd"},{"version":"7ad9aed3f5dc3de5049e8ba6912319dace213430b8babffad59e9b3cb8835760","signature":"a7b65e5fbd85d753c99c13a242176ec0f4f024108de502acbd52f82108f9386d"},{"version":"dc602ef9638db2163c461ec64133fe76f890f6e03b69b1c96f5c5e59592025e8","impliedFormat":99},{"version":"9b1a91ded1ee70a40efc83bcdb8b8d30d8d5c76ba242b212340e336db9cdaacc","signature":"8874c78b276f3814fbd836fe203e419eab5070a0475219239ffa5d1df9d27af8"},{"version":"808c2f0eb7b2f0649c958a8ec904dd0d536d25005206181724bfd8a81770cfca","signature":"d5558453f558b2d33d9ad6ca2de541eac57fadc92e45cf8872d934956a937152"},{"version":"c03fbd1cf61ca9df4c98bf961f830ab1c969125d52d08fcb735832f7ba5eab38","signature":"11ed0f688306271bcf71f6e820151ae9fa88709a6512ead1790970439ee8dd7d"},{"version":"c5b10ab86f8531b13e850a61020f9209e786ae6940fab1c4a12fc4c34267a3c4","affectsGlobalScope":true},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"a4a39b5714adfcadd3bbea6698ca2e942606d833bde62ad5fb6ec55f5e438ff8","impliedFormat":1},{"version":"bbc1d029093135d7d9bfa4b38cbf8761db505026cc458b5e9c8b74f4000e5e75","impliedFormat":1},{"version":"1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe","impliedFormat":1}],"root":[[48,50],57,59,[61,64],[66,69]],"options":{"allowJs":true,"composite":true,"declaration":true,"declarationDir":"./","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../../packages/utils","skipLibCheck":true,"strict":true,"target":7,"useDefineForClassFields":true},"referencedMap":[[74,1],[73,2],[72,3],[56,4],[52,5],[53,6],[55,7],[68,8],[48,9],[57,10],[59,11],[61,12],[66,13]],"latestChangedDtsFile":"./index.d.ts","version":"5.8.2"}
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/@vue+shared@3.5.13/node_modules/@vue/shared/dist/shared.d.ts","../../../node_modules/.pnpm/@vue+reactivity@3.5.13/node_modules/@vue/reactivity/dist/reactivity.d.ts","../../../node_modules/.pnpm/@vue+runtime-core@3.5.13/node_modules/@vue/runtime-core/dist/runtime-core.d.ts","../../../node_modules/.pnpm/csstype@3.1.3/node_modules/csstype/index.d.ts","../../../node_modules/.pnpm/@vue+runtime-dom@3.5.13/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts","../../../node_modules/.pnpm/vue@3.5.13_typescript@5.8.2/node_modules/vue/jsx-runtime/index.d.ts","../../../packages/utils/src/argo-log.ts","../../../packages/utils/src/date-transfer.ts","../../../packages/utils/src/device.ts","../../../packages/utils/src/file-operations.ts","../../../node_modules/.pnpm/xlsx@0.18.5/node_modules/xlsx/types/index.d.ts","../../../packages/utils/src/json.ts","../../../node_modules/.pnpm/@types+ali-oss@6.16.11/node_modules/@types/ali-oss/index.d.ts","../../../packages/utils/src/oss-uploader.ts","../../../packages/utils/src/set-guid.ts","../../../packages/utils/src/storage.ts","../../../packages/utils/src/types.ts","../../../node_modules/.pnpm/axios@1.8.4/node_modules/axios/index.d.ts","../../../packages/utils/src/use-api.ts","../../../packages/utils/src/watermark.ts","../../../packages/utils/index.ts","../../../packages/utils/shims.d.ts"],"fileIdsList":[[48],[48,49,50,52],[49,50,51,52],[52],[53,54,55,56,57,59,61,62,63,64,66,67],[53,69],[53],[53,58],[53,60],[53,64,65]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"092c2bfe125ce69dbb1223c85d68d4d2397d7d8411867b5cc03cec902c233763","affectsGlobalScope":true,"impliedFormat":1},{"version":"07f073f19d67f74d732b1adea08e1dc66b1b58d77cb5b43931dee3d798a2fd53","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a7e9e5bb507146e1c06aae94b548c9227d41f2c773da5fbb152388558710bae2","impliedFormat":1},{"version":"ae4b6f723332eb8a17ae180b46c94779969a8f4851607601137c2cc511799d1c","impliedFormat":1},{"version":"6d19d47905686f2c495288607a50d5167db44eb23bb71fbeffeba48aead5531b","affectsGlobalScope":true,"impliedFormat":1},{"version":"8a8eb4ebffd85e589a1cc7c178e291626c359543403d58c9cd22b81fab5b1fb9","impliedFormat":1},{"version":"a9b8b44f5fc33c3590dbd01e3523cc150e53fb4785e5523707c82fd745000cdb","impliedFormat":1},{"version":"9c077ba346f2891d1725d6cbf1ff8bc7ca075ccff10d1ea38eda571245df0eeb","impliedFormat":1},{"version":"9efe271422d844c9a36e0ea606704268e4c8ee34bd2a194e954a31381475ea55","signature":"a8f6c54b02a016b0a4c0cbe6a878df7f2656f9a3f43986ad257d45665e612e94"},{"version":"72af2f99ff91a9a6767e9374d5bcfdfa734f056e0ca4f99acfbdc0b6910cbe6a","signature":"642691020b5d2610d98d8dfa25df7e7c58a2e885d24bdec278f98842b02892f6"},{"version":"de9652b1bdad8aa2fa302b263a6a72265b276fec040394aa3b6c1adcff419ebc","signature":"6364be1269de7f1efc40324fb2cadc9a17d9bd2742d5bc1b95e309d848ca50f6"},{"version":"8f2a5590837d3f29a8d141931432d8b61e019382d1bdcb5d9990f2525242942b","signature":"4f8d8bcaa7127e5ed2d649cd5fc16b4e46b6d6960d82982ede8429d8066f9b96","affectsGlobalScope":true},{"version":"593654eebe902db28ca173f021f74ea9f77e8b344aebb0a80fa4d10f29bb3a9d","impliedFormat":1},{"version":"19f50a093aa873de6321cd996913aa89e0ec5308a8ae49bf05f071cd9614d0c6","signature":"10ee1d72a1aeb7992ec2517f444db7d425261969e0476b94a1bef6e47fd5c4b6"},{"version":"07e3a9a4ac19e4b39c9403908e87cd24166f9392851d566e0e32b2271dedb4e8","impliedFormat":1},{"version":"42b4030b8dfde5376043f3dd2ce1296697d0e6905f21f2c93463b1d22c4862a0","signature":"28568c2a38ace4ec018e86ea1bdb429d563b3765af5d386b15c6b5a7055e348b"},{"version":"b661af9a80f1690400c4e230fc012525de39b87e9ed2d44b9501581eaf6f8102","signature":"3452b2a4e467983a2cebf29bed5e4810866b8b191972cb9ed23f8c3907dfb56e"},{"version":"7484cd645652e5de0e944021ff47e2794cd64e91ccba9e2ddfe2e5c4c7e62b89","signature":"b5ff6435fa9c6d61900a8764225558104fce909c6005109cb4ec42a6772052bd"},{"version":"7ad9aed3f5dc3de5049e8ba6912319dace213430b8babffad59e9b3cb8835760","signature":"a7b65e5fbd85d753c99c13a242176ec0f4f024108de502acbd52f82108f9386d"},{"version":"331594cfe112a28054912754e428aeb2090200e06bb3477720c62eb9c4676242","impliedFormat":99},{"version":"2b9a6b1c66596f6416ae80c96cfa5419c811cf52308ad499d04ff8e2ca94a3c4","signature":"4c4a1d9afc8c2be98e5c10f4d2ef56861e7b0e00d9a51b10cdcc0e5262020e01"},{"version":"808c2f0eb7b2f0649c958a8ec904dd0d536d25005206181724bfd8a81770cfca","signature":"d5558453f558b2d33d9ad6ca2de541eac57fadc92e45cf8872d934956a937152"},{"version":"c03fbd1cf61ca9df4c98bf961f830ab1c969125d52d08fcb735832f7ba5eab38","signature":"11ed0f688306271bcf71f6e820151ae9fa88709a6512ead1790970439ee8dd7d"},{"version":"a911a3d8df881033bf7dddc7c2e68233d6121c2114826324eae73232d0d30b97","affectsGlobalScope":true}],"root":[[54,57],59,[61,64],[66,69]],"options":{"allowImportingTsExtensions":true,"allowJs":true,"composite":true,"declaration":true,"declarationDir":"./","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":1,"jsxImportSource":"vue","module":99,"noFallthroughCasesInSwitch":true,"noImplicitThis":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../../packages/utils","skipLibCheck":true,"strict":true,"target":99,"useDefineForClassFields":true,"verbatimModuleSyntax":true},"referencedMap":[[49,1],[50,2],[52,3],[53,4],[68,5],[54,6],[55,7],[56,7],[57,7],[59,8],[61,9],[62,7],[63,7],[64,7],[66,10],[67,7]],"latestChangedDtsFile":"./index.d.ts","version":"5.8.2"}
|
package/es/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export{ArgoLog}from"./src/argo-log.js";export{formatDuration}from"./src/date-transfer.js";export{getDeviceType,isAndroid,isIOS,isMobile}from"./src/device.js";export{createVideoUploader,downloadFile}from"./src/file-operations.js";export{JsonToExcel,excelToJson}from"./src/json.js";export{OssError,OssUploader,generateSignedUrl,uploadFile}from"./src/oss-uploader.js";export{setGuid}from"./src/set-guid.js";export{Storage}from"./src/storage.js";export{isBoolean,isElement,isImageByMimeType,isJSONString,isNumber,isPlainObject,isUndefined,isWindow}from"./src/types.js";export{ApiService}from"./src/use-api.js";export{watermark}from"./src/watermark.js";
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
package/es/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/es/src/argo-log.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"argo-log.js","sources":["../../../../packages/utils/src/argo-log.ts"],"sourcesContent":["// 定义配置项的类型别名\nexport interface EnvironmentConfig {\n encryptType?: number\n debugMode?: number\n appkey: string\n uploadURL: string\n autoProfile?: boolean\n autoTrack?: boolean\n}\n\n/**\n * ArgoLog 类 - 用于处理埋点统计的工具类\n *\n * @class ArgoLog\n * @description 基于 AnalysysAgent SDK 封装的埋点工具类,提供了埋点追踪、用户画像设置和用户别名设置等功能\n * @example\n * ```typescript\n * const argoLog = new ArgoLog({\n * appkey: 'your-app-key',\n * uploadURL: 'your-upload-url'\n * });\n *\n * // 追踪事件\n * argoLog.track('event_name', { key: 'value' });\n * ```\n */\nexport class ArgoLog<T = EnvironmentConfig> {\n private static instances = new Map<string, ArgoLog<any>>()\n private AnalysysAgent: any | null = null\n\n constructor(envConfig: T) {\n try {\n // 检查是否为浏览器环境\n if (typeof window === 'undefined') {\n console.warn('[ArgoLog] 仅支持浏览器环境')\n return this\n }\n\n const configKey = JSON.stringify(envConfig)\n const existingInstance = ArgoLog.instances.get(configKey)\n\n if (existingInstance) {\n return existingInstance\n }\n\n if (!envConfig) {\n console.error('envConfig is required')\n return this\n }\n\n // 动态导入 SDK\n import('ans-javascript-sdk').then((module) => {\n this.AnalysysAgent = module.default\n this.AnalysysAgent.init(envConfig)\n ArgoLog.instances.set(configKey, this)\n }).catch((error) => {\n console.warn('[ArgoLog] SDK 加载失败:', error)\n })\n }\n catch (error) {\n console.warn('[ArgoLog] Init failed:', error)\n }\n\n return this\n }\n\n track = (name: string, opt?: Record<string, any>): void => {\n try {\n if (!this.AnalysysAgent) {\n console.warn('[ArgoLog] SDK 未初始化')\n return\n }\n if (!name) {\n console.warn('[ArgoLog] track: name is required')\n return\n }\n this.AnalysysAgent.track(name, opt)\n }\n catch (error) {\n console.warn('[ArgoLog] track failed:', error)\n }\n }\n\n setProfile = (info: Record<string, any>): void => {\n try {\n if (!info) {\n console.warn('[ArgoLog] setProfile: info is required')\n return\n }\n this.AnalysysAgent.profileSet(info)\n }\n catch (error) {\n console.warn('[ArgoLog] setProfile failed:', error)\n }\n }\n\n setAlias = (code: string): void => {\n try {\n if (!code) {\n console.warn('[ArgoLog] setAlias: code is required')\n return\n }\n this.AnalysysAgent.alias(code)\n }\n catch (error) {\n console.warn('[ArgoLog] setAlias failed:', error)\n }\n }\n}\n"],"names":["_ArgoLog","constructor","envConfig","__publicField","this","name","opt","AnalysysAgent","console","warn","track","error","info","profileSet","code","alias","window","configKey","JSON","stringify","existingInstance","instances","get","import","then","module","default","init","set","catch","Map","ArgoLog"],"mappings":"0JA0BO,MAAMA,EAAN,MAAMA,EAIXC,WAAAA,CAAYC,GAFZC,EAAAC,KAAQ,gBAA4B,MAsC5BD,EAAAC,KAAA,SAAA,CAACC,EAAcC,KACjB,IACE,IAACF,KAAKG,cAER,YADAC,QAAQC,KAAK,sBAGf,IAAKJ,EAEH,YADAG,QAAQC,KAAK,qCAGVL,KAAAG,cAAcG,MAAML,EAAMC,SAE1BK,GACGH,QAAAC,KAAK,0BAA2BE,EAC1C,KAGFR,EAAAC,KAAA,cAAcQ,IACR,IACF,IAAKA,EAEH,YADAJ,QAAQC,KAAK,0CAGVL,KAAAG,cAAcM,WAAWD,SAEzBD,GACGH,QAAAC,KAAK,+BAAgCE,EAC/C,KAGFR,EAAAC,KAAA,YAAYU,IACN,IACF,IAAKA,EAEH,YADAN,QAAQC,KAAK,wCAGVL,KAAAG,cAAcQ,MAAMD,SAEpBH,GACGH,QAAAC,KAAK,6BAA8BE,EAC7C,KA3EI,IAEE,GAAkB,oBAAXK,OAEF,OADPR,QAAQC,KAAK,sBACNL,KAGH,MAAAa,EAAYC,KAAKC,UAAUjB,GAC3BkB,EAAmBpB,EAAQqB,UAAUC,IAAIL,GAE/C,GAAIG,EACK,OAAAA,EAGT,IAAKlB,EAEI,OADPM,QAAQG,MAAM,yBACPP,KAITmB,OAAO,sBAAsBC,MAAMC,IACjCrB,KAAKG,cAAgBkB,EAAOC,QACvBtB,KAAAG,cAAcoB,KAAKzB,GAChBF,EAAAqB,UAAUO,IAAIX,EAAWb,KAAI,IACpCyB,OAAOlB,IACAH,QAAAC,KAAK,sBAAuBE,EAAK,UAGtCA,GACGH,QAAAC,KAAK,yBAA0BE,EACzC,CAEO,OAAAP,IACT,GArCAD,EADWH,EACI,YAAY,IAAI8B,KAD1B,IAAMC,EAAN/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-transfer.js","sources":["../../../../packages/utils/src/date-transfer.ts"],"sourcesContent":["/**\n * 智能格式化毫秒时间\n * @param ms 毫秒数\n * @returns 格式化后的时间字符串\n *\n * 规则:\n * 1. 小于1小时:显示 MM:SS\n * 2. 小于24小时:显示 HH:MM:SS\n * 3. 大于等于24小时:显示 x天x小时x分钟\n */\nexport function formatDuration(ms: number): string {\n const seconds = Math.floor(ms / 1000)\n const minutes = Math.floor(seconds / 60)\n const hours = Math.floor(minutes / 60)\n const days = Math.floor(hours / 24)\n\n const pad = (num: number) => num.toString().padStart(2, '0')\n\n // 如果时间小于1小时,返回 MM:SS\n if (hours < 1) {\n const mm = pad(minutes % 60)\n const ss = pad(seconds % 60)\n return `${mm}:${ss}`\n }\n\n // 如果时间小于24小时,返回 HH:MM:SS\n if (days < 1) {\n const hh = pad(hours)\n const mm = pad(minutes % 60)\n const ss = pad(seconds % 60)\n return `${hh}:${mm}:${ss}`\n }\n\n // 如果时间大于等于24小时,返回 x天x小时x分钟\n const remainingHours = hours % 24\n const remainingMinutes = minutes % 60\n\n const parts: string[] = []\n if (days > 0) {\n parts.push(`${days}天`)\n }\n if (remainingHours > 0) {\n parts.push(`${remainingHours}小时`)\n }\n if (remainingMinutes > 0) {\n parts.push(`${remainingMinutes}分钟`)\n }\n\n return parts.join('')\n}\n"],"names":["formatDuration","ms","seconds","Math","floor","minutes","hours","days","pad","num","toString","padStart","remainingHours","remainingMinutes","parts","push","join"],"mappings":"AAUO,SAASA,EAAeC,GAC7B,MAAMC,EAAUC,KAAKC,MAAMH,EAAK,KAC1BI,EAAUF,KAAKC,MAAMF,EAAU,IAC/BI,EAAQH,KAAKC,MAAMC,EAAU,IAC7BE,EAAOJ,KAAKC,MAAME,EAAQ,IAE1BE,EAAOC,GAAgBA,EAAIC,WAAWC,SAAS,EAAG,KAGxD,GAAIL,EAAQ,EAAG,CAGN,MAAA,GAFIE,EAAIH,EAAU,OACdG,EAAIN,EAAU,KAE3B,CAGA,GAAIK,EAAO,EAAG,CAIZ,MAAO,GAHIC,EAAIF,MACJE,EAAIH,EAAU,OACdG,EAAIN,EAAU,KAE3B,CAGA,MAAMU,EAAiBN,EAAQ,GACzBO,EAAmBR,EAAU,GAE7BS,EAAkB,GAWjB,OAVHP,EAAO,GACHO,EAAAC,KAAK,GAAGR,MAEZK,EAAiB,GACbE,EAAAC,KAAK,GAAGH,OAEZC,EAAmB,GACfC,EAAAC,KAAK,GAAGF,OAGTC,EAAME,KAAK,GACpB"}
|
package/es/src/device.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sources":["../../../../packages/utils/src/device.ts"],"sourcesContent":["/**\n * 获取设备类型\n * @returns {string} 设备类型: \"iOS\", \"Android\" 或 \"desktop\"\n */\nexport function getDeviceType() {\n const userAgent = navigator.userAgent\n\n if (/iPhone|iPad|iPod|iOS/i.test(userAgent)) {\n return 'iOS'\n }\n else if (/Android/i.test(userAgent)) {\n return 'Android'\n }\n else {\n return 'desktop'\n }\n}\n\n/**\n * 判断是否是移动端\n */\nexport function isMobile() {\n const deviceType = getDeviceType()\n return deviceType === 'iOS' || deviceType === 'Android'\n}\n\n/**\n * 判断是否是ios\n */\nexport function isIOS() {\n return /iPhone|iPad|iPod|iOS/i.test(navigator.userAgent)\n}\n\n/**\n * 判断是否是安卓\n */\nexport function isAndroid() {\n return /Android/i.test(navigator.userAgent)\n}\n"],"names":["getDeviceType","userAgent","navigator","test","isMobile","deviceType","isIOS","isAndroid"],"mappings":"AAIO,SAASA,IACd,MAAMC,EAAYC,UAAUD,UAExB,MAAA,wBAAwBE,KAAKF,GACxB,MAEA,WAAWE,KAAKF,GAChB,UAGA,SAEX,CAKO,SAASG,IACd,MAAMC,EAAaL,IACZ,MAAe,QAAfK,GAAuC,YAAfA,CACjC,CAKO,SAASC,IACP,MAAA,wBAAwBH,KAAKD,UAAUD,UAChD,CAKO,SAASM,IACP,MAAA,WAAWJ,KAAKD,UAAUD,UACnC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-operations.js","sources":["../../../../packages/utils/src/file-operations.ts"],"sourcesContent":["/// <reference types=\"vite/client\" />\n\ndeclare global {\n interface Window {\n AliyunUpload: any\n OSS: any\n }\n}\n\nasync function loadScript(src: string): Promise<void> {\n return new Promise((resolve, reject) => {\n try {\n const script = document.createElement('script')\n script.src = src\n script.onload = () => {\n resolve()\n }\n script.onerror = () => {\n reject(new Error(`Failed to load script from ${src}`))\n }\n document.head.appendChild(script)\n }\n catch (error) {\n console.error('loadScript error:', error)\n reject(error)\n }\n })\n}\nasync function initAliyunSDK() {\n try {\n await loadScript('https://gosspublic.alicdn.com/aliyun-oss-sdk.min.js')\n await loadScript('https://cdnfile.yaomaitong.cn/cdn/js/aliyun-upload-sdk1.3.1.min.js')\n\n if (!window.AliyunUpload) {\n throw new Error('SDK 加载成功但未找到 AliyunUpload 对象')\n }\n }\n catch (error) {\n console.error('无法加载阿里云上传SDK:', error)\n throw error\n }\n}\n\nexport interface UploadInfo {\n file: File\n videoId?: string\n}\n\ninterface VideoUploadOptions {\n onUploadFailed?: (uploadInfo: any, code: string, message: string) => void\n onUploadSucceed?: (uploadInfo: any) => void\n onUploadProgress?: (uploadInfo: UploadInfo, totalSize: number, percent: number) => void\n onUploadTokenExpired?: (response: any) => void\n onUploadstarted?: (uploadInfo: UploadInfo) => Promise<{ uploadAuth: string, uploadAddress: string, videoId: string }>\n}\n\ninterface VideoUploadResult {\n videoId: string\n uploadInfo: any\n}\nexport interface IVideoUploader {\n uploader: any\n upload: (file: File) => Promise<VideoUploadResult>\n}\n\n/**\n * 创建阿里云视频上传器实例\n * @param options - 上传配置选项,包含各种回调函数\n * @returns 返回一个包含上传器实例和上传方法的对象\n */\nexport async function createVideoUploader(options: VideoUploadOptions): Promise<IVideoUploader> {\n // 检查是否在浏览器环境中运行\n if (typeof window === 'undefined') {\n throw new TypeError('VideoUploader 只能在浏览器环境中使用')\n }\n\n // 如果阿里云SDK未加载,则初始化SDK\n if (!window.AliyunUpload) {\n await initAliyunSDK()\n }\n\n // 声明Promise的resolve和reject函数,用于控制上传过程\n let currentResolve: ((value: VideoUploadResult) => void) | null = null\n let currentReject: ((reason: any) => void) | null = null\n\n // 创建阿里云上传实例\n const uploader = new window.AliyunUpload.Vod({\n // 上传进度回调\n onUploadProgress: options.onUploadProgress,\n // 上传凭证过期回调\n onUploadTokenExpired: options.onUploadTokenExpired || (() => {}),\n // 开始上传回调,用于设置上传凭证和地址\n onUploadstarted: async (uploadInfo: UploadInfo) => {\n try {\n const { uploadAuth, uploadAddress, videoId } = await options.onUploadstarted?.(uploadInfo) || {}\n if (uploadAuth && uploadAddress && videoId) {\n uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId)\n }\n }\n catch (error) {\n console.error('onUploadstarted error: ', error)\n throw error\n }\n },\n // 上传成功回调\n onUploadSucceed: (uploadInfo: any) => {\n currentResolve?.(uploadInfo)\n },\n // 上传失败回调\n onUploadFailed: (info: any, code: string, message: string) => {\n console.log('info: ', info)\n currentReject?.(new Error(`${message} ${code}`))\n },\n })\n\n /**\n * 上传文件方法\n * @param file - 要上传的文件对象\n * @returns Promise,解析为上传结果\n */\n const upload = async (file: File): Promise<VideoUploadResult> => {\n return new Promise((resolve, reject) => {\n currentResolve = resolve\n currentReject = reject\n\n // 设置上传的用户自定义数据\n const userData = JSON.stringify({\n Vod: {\n UserData: {\n IsShowWaterMark: 'false', // 不显示水印\n Priority: '7', // 上传优先级\n },\n },\n })\n\n // 添加文件到上传队列并开始上传\n uploader.addFile(file, null, null, null, userData)\n uploader.startUpload()\n })\n }\n\n // 返回上传器实例和上传方法\n return {\n uploader,\n upload,\n }\n}\n\n/**\n * 下载文件,创建一个隐藏的链接元素,设置下载属性并触发点击事件,然后移除该链接元素\n * @param url - 文件的URL\n * @param fileName - 文件的名称\n */\nexport function downloadFile(url: string, fileName: string) {\n const link = document.createElement('a')\n link.download = fileName\n link.style.display = 'none'\n link.href = url\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link)\n}\n"],"names":["async","loadScript","src","Promise","resolve","reject","script","document","createElement","onload","onerror","Error","head","appendChild","error","console","createVideoUploader","options","window","TypeError","AliyunUpload","initAliyunSDK","currentResolve","currentReject","uploader","Vod","onUploadProgress","onUploadTokenExpired","onUploadstarted","uploadAuth","uploadAddress","videoId","uploadInfo","setUploadAuthAndAddress","onUploadSucceed","onUploadFailed","info","code","message","log","upload","userData","JSON","stringify","UserData","IsShowWaterMark","Priority","addFile","file","startUpload","downloadFile","url","fileName","link","download","style","display","href","body","click","removeChild"],"mappings":"AASAA,eAAeC,EAAWC,GACxB,OAAO,IAAIC,SAAQ,CAACC,EAASC,KACvB,IACI,MAAAC,EAASC,SAASC,cAAc,UACtCF,EAAOJ,IAAMA,EACbI,EAAOG,OAAS,KACNL,GAAA,EAEVE,EAAOI,QAAU,KACfL,EAAO,IAAIM,MAAM,8BAA8BT,KAAM,EAE9CK,SAAAK,KAAKC,YAAYP,SAErBQ,GACGC,QAAAD,MAAM,oBAAqBA,GACnCT,EAAOS,EACT,IAEJ,CA2CAd,eAAsBgB,EAAoBC,GAEpC,GAAkB,oBAAXC,OACH,MAAA,IAAIC,UAAU,6BAIjBD,OAAOE,oBAjDdpB,iBACM,IAIE,SAHEC,EAAW,6DACXA,EAAW,uEAEZiB,OAAOE,aACJ,MAAA,IAAIT,MAAM,sCAGbG,GAEC,MADEC,QAAAD,MAAM,gBAAiBA,GACzBA,CACR,CACF,CAqCUO,GAIR,IAAIC,EAA8D,KAC9DC,EAAgD,KAGpD,MAAMC,EAAW,IAAIN,OAAOE,aAAaK,IAAI,CAE3CC,iBAAkBT,EAAQS,iBAE1BC,qBAAsBV,EAAQU,sBAAyB,MAAO,GAE9DC,gBAAiB5B,UACX,IACI,MAAA6B,WAAEA,EAAYC,cAAAA,EAAAC,QAAeA,SAAkBd,EAAQW,kBAAkBI,KAAe,CAAC,EAC3FH,GAAcC,GAAiBC,GACjCP,EAASS,wBAAwBD,EAAYH,EAAYC,EAAeC,SAGrEjB,GAEC,MADEC,QAAAD,MAAM,0BAA2BA,GACnCA,CACR,GAGFoB,gBAAkBF,IAChBV,IAAiBU,EAAU,EAG7BG,eAAgBA,CAACC,EAAWC,EAAcC,KAChCvB,QAAAwB,IAAI,SAAUH,GACtBb,IAAgB,IAAIZ,MAAM,GAAG2B,KAAWD,KAAO,IA+B5C,MAAA,CACLb,WACAgB,OAxBaxC,SACN,IAAIG,SAAQ,CAACC,EAASC,KACViB,EAAAlB,EACDmB,EAAAlB,EAGV,MAAAoC,EAAWC,KAAKC,UAAU,CAC9BlB,IAAK,CACHmB,SAAU,CACRC,gBAAiB,QACjBC,SAAU,QAMhBtB,EAASuB,QAAQC,EAAM,KAAM,KAAM,KAAMP,GACzCjB,EAASyB,aAAY,IAS3B,CAOgB,SAAAC,EAAaC,EAAaC,GAClC,MAAAC,EAAO9C,SAASC,cAAc,KACpC6C,EAAKC,SAAWF,EAChBC,EAAKE,MAAMC,QAAU,OACrBH,EAAKI,KAAON,EACH5C,SAAAmD,KAAK7C,YAAYwC,GAC1BA,EAAKM,QACIpD,SAAAmD,KAAKE,YAAYP,EAC5B"}
|
package/es/src/json.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sources":["../../../../packages/utils/src/json.ts"],"sourcesContent":["import { read, utils, writeFile } from 'xlsx'\n\n/**\n * 将JSON数据导出为Excel文件\n * @param title - Excel文件的标题\n * @param json - JSON数据\n * @param merge - 合并单元格的配置\n * @returns 如果JSON数据为空,则返回undefined,否则返回Excel文件的名称\n */\nexport function JsonToExcel(title = '', json: (string | number)[][] = [], merge?: any) {\n try {\n if (!json.length) {\n return\n }\n // 创建worksheet\n const worksheet = utils.aoa_to_sheet(json)\n if (merge) {\n worksheet['!merges'] = merge\n }\n // 新建空workbook,加入worksheet\n const workbook = utils.book_new()\n utils.book_append_sheet(workbook, worksheet, '')\n writeFile(workbook, `${title}.xlsx`)\n }\n catch (e) {\n console.log('e: ', e)\n return new Error('数据导出失败')\n }\n}\n\n/**\n * 将Excel数据转换为JSON\n * @param file - Excel文件\n * @param cb - 转换完成后的回调函数\n * @param start - 开始行号\n */\nexport function excelToJson(file: File, cb: (json: any[]) => void, start: number): Promise<any[]> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.readAsArrayBuffer(file)\n reader.onload = (e) => {\n const data = e.target?.result\n const workbook = read(data, { type: 'binary' })\n // 遍历每张表读取\n const json: any[] = []\n for (const sheet in workbook.Sheets) {\n if (Object.prototype.hasOwnProperty.call(workbook.Sheets, sheet)) {\n let arr: string[][] = []\n const fromTo = workbook.Sheets[sheet]['!ref'] || ''\n const end = fromTo.split(':')\n const space = start + end[1].toString()\n arr = arr.concat(utils.sheet_to_json(workbook.Sheets[sheet], { header: 1, range: start ? space : fromTo }))\n const titleArr = arr[0]\n arr.shift()\n const excelJsonArr = arr.map((item) => {\n const obj: {\n [key: string]: any\n } = {}\n titleArr.forEach((titleItem: string, index: number) => {\n obj[titleItem] = item[index]\n })\n return obj\n })\n json.push(...excelJsonArr)\n }\n }\n if (cb) {\n cb(json)\n }\n resolve(json)\n }\n reader.onerror = (e) => {\n reject(e)\n }\n })\n}\n"],"names":["JsonToExcel","title","arguments","length","undefined","json","merge","worksheet","utils","aoa_to_sheet","workbook","book_new","book_append_sheet","writeFile","e","console","log","Error","excelToJson","file","cb","start","Promise","resolve","reject","reader","FileReader","readAsArrayBuffer","onload","data","target","result","read","type","sheet","Sheets","Object","prototype","hasOwnProperty","call","arr","fromTo","end","split","space","toString","concat","sheet_to_json","header","range","titleArr","shift","excelJsonArr","map","item","obj","forEach","titleItem","index","push","onerror"],"mappings":"sDASO,SAASA,IAAuE,IAA3DC,EAAQC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAA,GAAIG,EAA8BH,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAA,GAAII,EAAaJ,UAAAC,OAAAD,EAAAA,kBAAAE,EACjF,IACE,IAACC,EAAKF,OACR,OAGI,MAAAI,EAAYC,EAAMC,aAAaJ,GACjCC,IACFC,EAAU,WAAaD,GAGnB,MAAAI,EAAWF,EAAMG,WACjBH,EAAAI,kBAAkBF,EAAUH,EAAW,IACnCM,EAAAH,EAAU,GAAGT,gBAElBa,GAEE,OADCC,QAAAC,IAAI,MAAOF,GACZ,IAAIG,MAAM,SACnB,CACF,CAQgB,SAAAC,EAAYC,EAAYC,EAA2BC,GACjE,OAAO,IAAIC,SAAQ,CAACC,EAASC,KACrB,MAAAC,EAAS,IAAIC,WACnBD,EAAOE,kBAAkBR,GAClBM,EAAAG,OAAUd,IACT,MAAAe,EAAOf,EAAEgB,QAAQC,OACjBrB,EAAWsB,EAAKH,EAAM,CAAEI,KAAM,WAE9B5B,EAAc,GACT,IAAA,MAAA6B,KAASxB,EAASyB,OAC3B,GAAIC,OAAOC,UAAUC,eAAeC,KAAK7B,EAASyB,OAAQD,GAAQ,CAChE,IAAIM,EAAkB,GACtB,MAAMC,EAAS/B,EAASyB,OAAOD,GAAO,SAAW,GAC3CQ,EAAMD,EAAOE,MAAM,KACnBC,EAAQvB,EAAQqB,EAAI,GAAGG,WAC7BL,EAAMA,EAAIM,OAAOtC,EAAMuC,cAAcrC,EAASyB,OAAOD,GAAQ,CAAEc,OAAQ,EAAGC,MAAO5B,EAAQuB,EAAQH,KAC3F,MAAAS,EAAWV,EAAI,GACrBA,EAAIW,QACJ,MAAMC,EAAeZ,EAAIa,KAAKC,IAC5B,MAAMC,EAEF,CAAC,EAIE,OAHEL,EAAAM,SAAQ,CAACC,EAAmBC,KAC/BH,EAAAE,GAAaH,EAAKI,EAAK,IAEtBH,CAAA,IAEJlD,EAAAsD,QAAQP,EACf,CAEEhC,GACFA,EAAGf,GAELkB,EAAQlB,EAAI,EAEPoB,EAAAmC,QAAW9C,IAChBU,EAAOV,EAAC,CACV,GAEJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oss-uploader.js","sources":["../../../../packages/utils/src/oss-uploader.ts"],"sourcesContent":["import OSS from 'ali-oss'\n\nexport interface OssCredentials {\n accessKeyId: string\n accessKeySecret: string\n securityToken: string\n}\n\nexport interface OssConfig extends Partial<Omit<OssClientConfig, 'accessKeyId' | 'accessKeySecret' | 'stsToken'>> {\n file: File\n onProgress?: (p: { percent: number }) => void\n path?: string\n getCredentials: () => Promise<OssCredentials | null>\n}\n\nexport interface OssClientConfig {\n accessKeyId: string\n accessKeySecret: string\n stsToken: string\n secure: boolean\n bucket: string\n region: string\n cors: boolean\n useFetch: boolean\n timeout: number\n headers: Record<string, string>\n}\n\n// 定义错误类型\nexport class OssError extends Error {\n constructor(message: string) {\n super(message)\n this.name = 'OssError'\n }\n}\n\nconst ossConfig: OssClientConfig = {\n accessKeyId: '',\n accessKeySecret: '',\n stsToken: '',\n secure: true,\n bucket: 'yao-file-daily',\n region: 'oss-cn-hangzhou',\n cors: true,\n useFetch: false,\n timeout: 60000,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE',\n 'Access-Control-Allow-Headers': '*',\n },\n}\n\nexport class OssUploader {\n private static client: OSS\n private static createTokenTime: number = 0\n private static readonly expireTime = 15 * 60 * 1000\n\n // 获取凭证\n private static async getOssCredentials(getCredentials: OssConfig['getCredentials']): Promise<Required<OssCredentials>> {\n const credentials = await getCredentials()\n if (!credentials) {\n throw new OssError('获取凭证失败')\n }\n return {\n accessKeyId: credentials.accessKeyId,\n accessKeySecret: credentials.accessKeySecret,\n securityToken: credentials.securityToken,\n }\n }\n\n // 修改初始化方法\n public static async initOssClient(getCredentials: OssConfig['getCredentials'], args?: Partial<OssConfig>): Promise<void> {\n const diff = Date.now() - this.createTokenTime\n if (!ossConfig.accessKeyId || diff > this.expireTime) {\n try {\n const { accessKeyId, accessKeySecret, securityToken: stsToken } = await this.getOssCredentials(getCredentials)\n Object.assign(ossConfig, {\n accessKeyId,\n accessKeySecret,\n stsToken,\n ...args,\n refreshSTSToken: async () => {\n return await this.getOssCredentials(getCredentials)\n },\n refreshSTSTokenInterval: 300000,\n })\n this.createTokenTime = Date.now()\n this.client = new OSS(ossConfig)\n }\n catch (error) {\n throw new OssError(error instanceof Error ? error.message : String(error))\n }\n }\n }\n\n // 修改上传方法\n public static async uploadFile(opts: OssConfig & { getCredentials: OssConfig['getCredentials'] }): Promise<OSS.MultipartUploadResult> {\n const { file, onProgress = () => {}, path = 'ksh/pdf', getCredentials, ...rest } = opts\n\n await this.initOssClient(getCredentials, rest)\n\n try {\n const result = await this.client.multipartUpload(`${path}/${file.name}`, file, {\n progress(p: number) {\n onProgress({ percent: Math.round(p * 100) })\n },\n })\n return result\n }\n catch (error) {\n throw new OssError(error instanceof Error ? error.message : String(error))\n }\n }\n\n // 修改生成签名URL方法\n public static async generateSignedUrl(\n objectKey: string,\n getCredentials: OssConfig['getCredentials'],\n args?: Partial<OssConfig>,\n ): Promise<string> {\n await this.initOssClient(getCredentials, args)\n try {\n return await this.client.signatureUrl(objectKey, { expires: 60 * 60 })\n }\n catch (error) {\n throw new OssError(error instanceof Error ? error.message : String(error))\n }\n }\n}\n\n// 导出便捷方法\nexport const uploadFile = OssUploader.uploadFile.bind(OssUploader)\nexport const generateSignedUrl = OssUploader.generateSignedUrl.bind(OssUploader)\n"],"names":["OssError","Error","constructor","message","super","this","name","ossConfig","accessKeyId","accessKeySecret","stsToken","secure","bucket","region","cors","useFetch","timeout","headers","OssUploader","getOssCredentials","getCredentials","credentials","securityToken","initOssClient","args","diff","Date","now","createTokenTime","expireTime","Object","assign","refreshSTSToken","async","refreshSTSTokenInterval","client","OSS","error","String","uploadFile","opts","file","onProgress","path","rest","multipartUpload","progress","p","percent","Math","round","generateSignedUrl","objectKey","signatureUrl","expires","__publicField","bind"],"mappings":"iLA6BO,MAAMA,UAAiBC,MAC5BC,WAAAA,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,UACd,EAGF,MAAMC,EAA6B,CACjCC,YAAa,GACbC,gBAAiB,GACjBC,SAAU,GACVC,QAAQ,EACRC,OAAQ,iBACRC,OAAQ,kBACRC,MAAM,EACNC,UAAU,EACVC,QAAS,IACTC,QAAS,CACP,8BAA+B,IAC/B,+BAAgC,yBAChC,+BAAgC,MAI7B,MAAMC,EAMX,8BAAqBC,CAAkBC,GAC/B,MAAAC,QAAoBD,IAC1B,IAAKC,EACG,MAAA,IAAIrB,EAAS,UAEd,MAAA,CACLQ,YAAaa,EAAYb,YACzBC,gBAAiBY,EAAYZ,gBAC7Ba,cAAeD,EAAYC,cAE/B,CAGA,0BAAoBC,CAAcH,EAA6CI,GAC7E,MAAMC,EAAOC,KAAKC,MAAQtB,KAAKuB,gBAC/B,IAAKrB,EAAUC,aAAeiB,EAAOpB,KAAKwB,WACpC,IACI,MAAArB,YAAEA,kBAAaC,EAAiBa,cAAeZ,SAAmBL,KAAKc,kBAAkBC,GAC/FU,OAAOC,OAAOxB,EAAW,CACvBC,cACAC,kBACAC,cACGc,EACHQ,gBAAiBC,eACF5B,KAAKc,kBAAkBC,GAEtCc,wBAAyB,MAEtB7B,KAAAuB,gBAAkBF,KAAKC,MACvBtB,KAAA8B,OAAS,IAAIC,EAAI7B,SAEjB8B,GACC,MAAA,IAAIrC,EAASqC,aAAiBpC,MAAQoC,EAAMlC,QAAUmC,OAAOD,GACrE,CAEJ,CAGA,uBAAoBE,CAAWC,GACvB,MAAAC,KAAEA,EAAMC,WAAAA,EAAaA,YAAUC,EAAO,UAAAvB,eAAWA,KAAmBwB,GAASJ,QAE7EnC,KAAKkB,cAAcH,EAAgBwB,GAErC,IAMK,aALcvC,KAAK8B,OAAOU,gBAAgB,GAAGF,KAAQF,EAAKnC,OAAQmC,EAAM,CAC7EK,QAAAA,CAASC,GACPL,EAAW,CAAEM,QAASC,KAAKC,MAAU,IAAJH,IACnC,UAIGV,GACC,MAAA,IAAIrC,EAASqC,aAAiBpC,MAAQoC,EAAMlC,QAAUmC,OAAOD,GACrE,CACF,CAGA,8BAAoBc,CAClBC,EACAhC,EACAI,SAEMnB,KAAKkB,cAAcH,EAAgBI,GACrC,IACK,aAAMnB,KAAK8B,OAAOkB,aAAaD,EAAW,CAAEE,QAAS,aAEvDjB,GACC,MAAA,IAAIrC,EAASqC,aAAiBpC,MAAQoC,EAAMlC,QAAUmC,OAAOD,GACrE,CACF,EA1EAkB,EADWrC,EACI,UACfqC,EAFWrC,EAEI,kBAA0B,GACzCqC,EAHWrC,EAGa,aAAa,KA4EhC,MAAMqB,EAAarB,EAAYqB,WAAWiB,KAAKtC,GACzCiC,EAAoBjC,EAAYiC,kBAAkBK,KAAKtC"}
|
package/es/src/set-guid.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-guid.js","sources":["../../../../packages/utils/src/set-guid.ts"],"sourcesContent":["/**\n * 随机id\n */\nexport function setGuid() {\n return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = Math.random() * 16 | 0\n const v = c === 'x' ? r : (r & 0x3 | 0x8)\n return v.toString(16)\n })\n}\n"],"names":["setGuid","replace","c","r","Math","random","toString"],"mappings":"AAGO,SAASA,IACd,MAAO,mCAAmCC,QAAQ,SAAUC,IAC1D,MAAMC,EAAoB,GAAhBC,KAAKC,SAAgB,EAExB,OADS,MAANH,EAAYC,EAAS,EAAJA,EAAU,GAC5BG,SAAS,GAAE,GAExB"}
|
package/es/src/storage.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sources":["../../../../packages/utils/src/storage.ts"],"sourcesContent":["// 使用单例模式\nclass Storage {\n private readonly prefix: string\n\n constructor(prefix = 'qxs_') {\n this.prefix = prefix\n }\n\n local = {\n has: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return Object.prototype.hasOwnProperty.call(localStorage, prefixedKey)\n },\n get: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return localStorage.getItem(prefixedKey)\n },\n set: (key: string, value: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n localStorage.setItem(prefixedKey, value)\n },\n remove: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n localStorage.removeItem(prefixedKey)\n },\n clear: () => {\n localStorage.clear()\n },\n }\n\n session = {\n has: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return Object.prototype.hasOwnProperty.call(sessionStorage, prefixedKey)\n },\n get: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return sessionStorage.getItem(prefixedKey)\n },\n set: (key: string, value: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n sessionStorage.setItem(prefixedKey, value)\n },\n remove: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n sessionStorage.removeItem(prefixedKey)\n },\n clear: () => {\n sessionStorage.clear()\n },\n }\n\n cookie = {\n has: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return new RegExp(`(^|;)\\\\s*${prefixedKey}=`).test(document.cookie)\n },\n get: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n const match = document.cookie.match(new RegExp(`(^|;)\\\\s*${prefixedKey}=([^;]*)`))\n return match ? decodeURIComponent(match[2]) : null\n },\n set: (key: string, value: string, expires = 1, path = '/', domain = window.location.hostname, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n const expiresDate = new Date()\n expiresDate.setTime(expiresDate.getTime() + expires * 24 * 60 * 60 * 1000)\n const expiresStr = `;expires=${expiresDate.toUTCString()}`\n const pathStr = `;path=${path}`\n const domainStr = domain ? `;domain=${domain}` : ''\n\n document.cookie = `${prefixedKey}=${encodeURIComponent(value)}${expiresStr}${pathStr}${domainStr}`\n },\n remove: (key: string, path = '/', domain = window.location.hostname, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n const expiresStr = `;expires=${new Date(0).toUTCString()}`\n const pathStr = `;path=${path}`\n const domainStr = domain ? `;domain=${domain}` : ''\n\n document.cookie = `${prefixedKey}=;${expiresStr}${pathStr}${domainStr}`\n },\n clear: () => {\n const keys = document.cookie.match(/[^ =;]+(?==)/g)\n if (keys) {\n keys.forEach((key) => {\n document.cookie = `${key}=;expires=${new Date(0).toUTCString()};path=/`\n })\n }\n },\n }\n}\n\n// 直接导出 Storage 类\nexport { Storage }\n"],"names":["Storage","constructor","_this","this","prefix","__publicField","has","key","prefixedKey","arguments","length","undefined","Object","prototype","hasOwnProperty","call","localStorage","get","getItem","set","value","setItem","remove","removeItem","clear","sessionStorage","RegExp","test","document","cookie","match","decodeURIComponent","expires","path","domain","window","location","hostname","expiresDate","Date","setTime","getTime","expiresStr","toUTCString","pathStr","domainStr","encodeURIComponent","keys","forEach"],"mappings":"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"}
|
package/es/src/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../packages/utils/src/types.ts"],"sourcesContent":["export const isUndefined = (val: any): val is undefined => val === undefined\nexport const isBoolean = (val: any): val is boolean => typeof val === 'boolean'\nexport const isNumber = (val: any): val is number => typeof val === 'number'\n\nexport function isElement(e: unknown): e is Element {\n if (typeof Element === 'undefined') {\n return false\n }\n return e instanceof Element\n}\n\nexport function isWindow(val: unknown): val is Window {\n return val === window\n}\n\n/**\n * 判断字符串是否为JSON字符串\n * @param str - 要判断的字符串\n * @returns 如果字符串是JSON字符串,则返回true,否则返回false\n */\nexport function isJSONString(str: string) {\n const jsonStringRegex = /^[\\],:{}\\s]*$/\n .test(str.replace(/\\\\[\"\\\\/bfnrtu]/g, '@')\n .replace(/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g, ']')\n .replace(/(?:^|:|,)(?:\\s*\\[)+/g, ''))\n\n return jsonStringRegex && isValidJSON(str)\n}\n\n/**\n * 判断字符串是否为有效的JSON字符串\n * @param str - 要判断的字符串\n * @returns 如果字符串是有效的JSON字符串,则返回true,否则返回false\n */\nfunction isValidJSON(str: string) {\n try {\n JSON.parse(str)\n return true\n }\n catch (e) {\n console.log('e: ', e)\n return false\n }\n}\n\n/**\n * 通过 MIME 类型判断文件是否为图片\n * @param file - 要检查的文件对象\n * @returns {boolean} 如果文件是图片类型返回 true,否则返回 false\n * @example\n * const file = new File([''], 'test.png', { type: 'image/png' });\n * isImageByMimeType(file); // true\n */\nexport function isImageByMimeType(file: File) {\n return file.type.startsWith('image/')\n}\n\n/**\n * 判断一个值是否为普通对象\n * @param value - 要判断的值\n * @returns 如果值是普通对象,则返回 true,否则返回 false\n */\nexport function isPlainObject(value: unknown): value is Record<string, any> {\n if (value === null || typeof value !== 'object') {\n return false\n }\n\n // 获取原型\n const proto = Object.getPrototypeOf(value)\n\n // 如果没有原型(proto === null),说明是通过 Object.create(null) 创建的\n // 或者原型就是 Object.prototype,说明是普通对象\n return proto === null || proto === Object.prototype\n}\n"],"names":["isUndefined","val","isBoolean","isNumber","isElement","e","Element","isWindow","window","isJSONString","str","test","replace","JSON","parse","console","log","isValidJSON","isImageByMimeType","file","type","startsWith","isPlainObject","value","proto","Object","getPrototypeOf","prototype"],"mappings":"AAAa,MAAAA,EAAeC,QAAuC,IAARA,EAC9CC,EAAaD,GAA4C,kBAARA,EACjDE,EAAYF,GAA2C,iBAARA,EAErD,SAASG,EAAUC,GACpB,MAAmB,oBAAZC,SAGJD,aAAaC,OACtB,CAEO,SAASC,EAASN,GACvB,OAAOA,IAAQO,MACjB,CAOO,SAASC,EAAaC,GAMpB,MALiB,gBACrBC,KAAKD,EAAIE,QAAQ,kBAAmB,KAClCA,QAAQ,mEAAoE,KAC5EA,QAAQ,uBAAwB,MAUvC,SAAqBF,GACf,IAEK,OADPG,KAAKC,MAAMJ,IACJ,QAEFL,GAEE,OADCU,QAAAC,IAAI,MAAOX,IACZ,CACT,CACF,CAjB4BY,CAAYP,EACxC,CA0BO,SAASQ,EAAkBC,GACzB,OAAAA,EAAKC,KAAKC,WAAW,SAC9B,CAOO,SAASC,EAAcC,GAC5B,GAAc,OAAVA,GAAmC,iBAAVA,EACpB,OAAA,EAIH,MAAAC,EAAQC,OAAOC,eAAeH,GAI7B,OAAU,OAAVC,GAAkBA,IAAUC,OAAOE,SAC5C"}
|
package/es/src/use-api.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{isPlainObject as e}from"./types.js";var s=Object.defineProperty,r=(e,r,t)=>((e,r,t)=>r in e?s(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t)(e,"symbol"!=typeof r?r+"":r,t);const t=class s{constructor(e){if(this.apiInstance=e,r(this,"useApi",(async(e,s,r)=>{let t=null,i=null;try{const i={...e,...["GET"].includes(e.method.toUpperCase())?{params:s}:{data:s}};i.url=(i.proxyPrefix||"")+e.url,delete i.proxyPrefix;const o=await this.apiInstance(i);t=r?o.data:o.data.data}catch(e){"AxiosError"!==e.name?this.isAxiosResponse(e)?i=e.data:this.isErrorResponse(e)&&(i=e):console.error(e)}return{res:t,error:i}})),s.instance)return s.instance;s.instance=this}isBusinessError(s){return e(s)&&"string"==typeof s.message&&"number"==typeof s.code&&0!==s.code}isAxiosResponse(s){return e(s)&&void 0!==s.data&&this.isBusinessError(s.data)&&void 0!==s.status&&void 0!==s.statusText&&void 0!==s.headers&&void 0!==s.config&&void 0!==s.request}isErrorResponse(e){return"code"in e&&"data"in e&&"message"in e&&0!==e.code}};r(t,"instance");let i=t;export{i as ApiService};
|
|
2
|
-
//# sourceMappingURL=use-api.js.map
|
package/es/src/use-api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-api.js","sources":["../../../../packages/utils/src/use-api.ts"],"sourcesContent":["import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'\nimport { isPlainObject } from './types'\n\nexport interface SuccessResponse<T> {\n code: number\n count: number\n data: T\n message: string\n}\n\nexport interface ErrorResponse {\n code: number\n data: null\n message: string\n}\n\nexport interface UseApiResponse<W extends boolean = false, T = unknown> {\n res: W extends true ? SuccessResponse<T> : T\n error: ErrorResponse | null\n}\n\nexport interface UrlObjectType {\n url: string\n method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'\n proxyPrefix?: string\n}\n\nexport type ApiTypeMap<U extends UrlObjectType> = {\n [K in U['url']]: {\n request: any\n response: any\n }\n}\n\ntype RequestPayload<T> = T extends { data: any } ? T['data'] : T\ntype RequestParams<T> = T extends { params: any } ? T['params'] : T\n\nexport class ApiService<\n T extends ApiTypeMap<U>,\n U extends UrlObjectType,\n> {\n private static instance: ApiService<any, any>\n\n constructor(\n private apiInstance: AxiosInstance,\n ) {\n if (ApiService.instance) {\n return ApiService.instance as ApiService<T, U>\n }\n ApiService.instance = this\n }\n\n private isBusinessError(obj: ErrorResponse): boolean {\n return isPlainObject(obj)\n && typeof obj.message === 'string'\n && typeof obj.code === 'number'\n && obj.code !== 0\n }\n\n private isAxiosResponse(value: any): value is AxiosResponse {\n return isPlainObject(value)\n && value.data !== undefined\n && this.isBusinessError(value.data)\n && value.status !== undefined\n && value.statusText !== undefined\n && value.headers !== undefined\n && value.config !== undefined\n && value.request !== undefined\n }\n\n private isErrorResponse(value: any): value is ErrorResponse {\n return 'code' in value && 'data' in value && 'message' in value && value.code !== 0\n }\n\n public useApi = async <\n K extends U,\n W extends boolean = false,\n >(\n axiosConfig: Omit<AxiosRequestConfig<RequestPayload<T[K['url']]['request']>>, 'params'> & K & {\n params?: RequestParams<T[K['url']]['request']>\n },\n params?: RequestParams<T[K['url']]['request']>,\n isWholeResponse?: W,\n ): Promise<UseApiResponse<W, T[K['url']]['response']>> => {\n let res: UseApiResponse<W, T[K['url']]['response']>['res'] | null = null\n let error: UseApiResponse['error'] = null\n\n try {\n const config = {\n ...axiosConfig,\n ...(['GET'].includes(axiosConfig.method.toUpperCase()) ? { params } : { data: params }),\n }\n\n config.url = (config.proxyPrefix || '') + axiosConfig.url\n delete config.proxyPrefix\n\n const response = await this.apiInstance<SuccessResponse<T[K['url']]['response']>>(config)\n res = isWholeResponse\n ? response.data\n : response.data.data\n }\n catch (err: any) {\n if (err.name !== 'AxiosError') {\n if (this.isAxiosResponse(err)) {\n error = err.data\n }\n else if (this.isErrorResponse(err)) {\n error = err\n }\n }\n else {\n console.error(err)\n }\n }\n\n return { res: res!, error }\n }\n}\n"],"names":["_ApiService","constructor","apiInstance","this","__publicField","async","axiosConfig","params","isWholeResponse","res","error","config","includes","method","toUpperCase","data","url","proxyPrefix","response","err","name","isAxiosResponse","isErrorResponse","console","instance","isBusinessError","obj","isPlainObject","message","code","value","status","statusText","headers","request","ApiService"],"mappings":"qMAqCO,MAAMA,EAAN,MAAMA,EAMXC,WAAAA,CACUC,GAER,GAFQC,KAAAD,YAAAA,EA8BVE,EAAAD,KAAO,UAASE,MAIdC,EAGAC,EACAC,KAEA,IAAIC,EAAgE,KAChEC,EAAiC,KAEjC,IACF,MAAMC,EAAS,IACVL,KACC,CAAC,OAAOM,SAASN,EAAYO,OAAOC,eAAiB,CAAEP,UAAW,CAAEQ,KAAMR,IAGhFI,EAAOK,KAAOL,EAAOM,aAAe,IAAMX,EAAYU,WAC/CL,EAAOM,YAEd,MAAMC,QAAiBf,KAAKD,YAAsDS,GAClFF,EAAMD,EACFU,EAASH,KACTG,EAASH,KAAKA,WAEbI,GACY,eAAbA,EAAIC,KACFjB,KAAKkB,gBAAgBF,GACvBT,EAAQS,EAAIJ,KAELZ,KAAKmB,gBAAgBH,KACpBT,EAAAS,GAIVI,QAAQb,MAAMS,EAElB,CAEO,MAAA,CAAEV,MAAWC,QAAM,IArEtBV,EAAWwB,SACb,OAAOxB,EAAWwB,SAEpBxB,EAAWwB,SAAWrB,IACxB,CAEQsB,eAAAA,CAAgBC,GACtB,OAAOC,EAAcD,IACO,iBAAhBA,EAAIE,SACS,iBAAbF,EAAIG,MACE,IAAbH,EAAIG,IACX,CAEQR,eAAAA,CAAgBS,GACf,OAAAH,EAAcG,SACD,IAAfA,EAAMf,MACNZ,KAAKsB,gBAAgBK,EAAMf,YACV,IAAjBe,EAAMC,aACe,IAArBD,EAAME,iBACY,IAAlBF,EAAMG,cACW,IAAjBH,EAAMnB,aACY,IAAlBmB,EAAMI,OACb,CAEQZ,eAAAA,CAAgBQ,GACtB,MAAO,SAAUA,GAAS,SAAUA,GAAS,YAAaA,GAAwB,IAAfA,EAAMD,IAC3E,GA/BAzB,EAJWJ,EAII,YAJV,IAAMmC,EAANnC"}
|
package/es/src/watermark.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"watermark.js","sources":["../../../../packages/utils/src/watermark.ts"],"sourcesContent":["interface SettingsType {\n /** 水印总体的id */\n id?: string\n /** 小水印的id前缀 */\n prefix?: string\n /** 水印文案 */\n text?: string\n /** 水印起始位置x轴坐标 */\n x?: number\n /** 水印起始位置Y轴坐标 */\n y?: number\n /** 水印行数 */\n rows?: number\n /** 水印列数 */\n cols?: number\n /** 水印x轴间隔 */\n x_space?: number\n /** 水印y轴间隔 */\n y_space?: number\n /** 水印字体 */\n font?: string\n /** 水印字体颜色 */\n color?: string\n /** 水印字体大小 */\n fontsize?: string\n /** 水印透明度,要求设置在大于等于0.005 */\n alpha?: number\n /** 水印宽度 */\n width?: number\n /** 水印长度 */\n height?: number\n /** 水印倾斜度数 */\n angle?: number\n /** 水印的总体宽度(默认值:body的scrollWidth和clientWidth的较大值) */\n parent_width?: number\n /** 水印的总体高度(默认值:body的scrollHeight和clientHeight的较大值) */\n parent_height?: number\n /** 水印插件挂载的父元素element,不输入则默认挂在body */\n parent_node?: HTMLElement | null\n /** 是否监控,true: 不可删除水印; false: 可删水印 */\n monitor?: boolean\n}\n\n// 默认配置\nconst initialSettings: Required<SettingsType> = {\n id: 'wm_div_id',\n prefix: 'mask_div_id',\n text: '测试水印',\n x: 0,\n y: 0,\n rows: 0,\n cols: 0,\n width: 0,\n height: 0,\n x_space: 100,\n y_space: 40,\n font: '微软雅黑',\n color: 'black',\n fontsize: '18px',\n alpha: 0.15,\n angle: 15,\n parent_width: 0,\n parent_height: 0,\n parent_node: null,\n monitor: true,\n}\n\nfunction calculateTextDimensions(text: string, font: string, fontSize: string): { width: number, height: number } {\n const canvas = document.createElement('canvas')\n const context = canvas.getContext('2d')\n if (!context) {\n return { width: 100, height: 100 }\n }\n\n context.font = `${fontSize} ${font}`\n const metrics = context.measureText(text.trim())\n const fontSizeNum = Number.parseFloat(fontSize)\n\n // 移除 DPI 缩放,直接使用原始值\n const height = (metrics.actualBoundingBoxAscent !== undefined && metrics.actualBoundingBoxDescent !== undefined)\n ? (metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent)\n : fontSizeNum\n\n return {\n width: Math.ceil(metrics.width),\n height: Math.ceil(height),\n }\n}\n\nexport function watermark() {\n const globalSetting: Required<SettingsType> = { ...initialSettings }\n let forceRemove = false\n const watermarkDom = new MutationObserver(domChangeCallback)\n const resizeObserver = new ResizeObserver(() => {\n if (!forceRemove) {\n loadMark(globalSetting)\n }\n })\n\n // 计算水印布局\n function calculateWatermarkLayout(pageWidth: number, pageHeight: number) {\n const availableWidth = pageWidth - globalSetting.x\n const availableHeight = pageHeight - globalSetting.y\n\n // 使用固定间距\n const x_space = globalSetting.x_space || 20 // 如果未设置则使用默认值\n const y_space = globalSetting.y_space || 20 // 如果未设置则使用默认值\n\n // 计算能容纳的行数和列数\n const cols = Math.ceil(availableWidth / (globalSetting.width + x_space))\n const rows = Math.ceil(availableHeight / (globalSetting.height + y_space))\n\n return {\n cols,\n rows,\n x_space,\n y_space,\n }\n }\n\n // 创建水印元素\n function createWatermarkElement(x: number, y: number, index: number): HTMLElement {\n const maskDiv = document.createElement('div')\n maskDiv.textContent = globalSetting.text\n maskDiv.id = `${globalSetting.prefix}${index}`\n\n maskDiv.style.cssText = `\n transform: rotate(-${globalSetting.angle}deg);\n position: absolute;\n left: ${x}px;\n top: ${y}px;\n overflow: hidden;\n z-index: 9999999;\n opacity: ${globalSetting.alpha};\n font-size: ${globalSetting.fontsize};\n font-family: ${globalSetting.font};\n color: ${globalSetting.color};\n text-align: center;\n width: ${globalSetting.width}px;\n height: ${globalSetting.height}px;\n line-height: ${globalSetting.height}px;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n visibility: visible;\n `.replace(/\\s+/g, ' ').trim()\n\n return maskDiv\n }\n\n // 加载水印\n function loadMark(settings: Partial<SettingsType>) {\n removeMark()\n Object.assign(globalSetting, settings)\n\n if ((globalSetting.width === 0 && globalSetting.height === 0) || globalSetting.width === 0 || globalSetting.height === 0) {\n // 计算文本尺寸\n const textDimensions = calculateTextDimensions(\n globalSetting.text,\n globalSetting.font,\n globalSetting.fontsize,\n )\n const padding = 10\n if (globalSetting.width === 0) {\n globalSetting.width = textDimensions.width + padding\n }\n if (globalSetting.height === 0) {\n globalSetting.height = textDimensions.height + padding\n }\n }\n\n const parentElement = globalSetting.parent_node || document.body\n const pageWidth = Math.max(parentElement.scrollWidth, parentElement.clientWidth)\n const pageHeight = Math.max(parentElement.scrollHeight, parentElement.clientHeight)\n\n const watermarkContainer = document.createElement('div')\n watermarkContainer.id = globalSetting.id\n\n // 处理父元素定位\n if (parentElement.closest('body') && getComputedStyle(parentElement).position === 'static') {\n parentElement.style.position = 'relative'\n }\n\n watermarkContainer.style.cssText = `\n pointer-events: none;\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 9999999;\n overflow: hidden;\n `.replace(/\\s+/g, ' ').trim()\n\n const shadowRoot = watermarkContainer.attachShadow ? watermarkContainer.attachShadow({ mode: 'open' }) : watermarkContainer\n\n parentElement.appendChild(watermarkContainer)\n\n const { cols, rows, x_space, y_space } = calculateWatermarkLayout(pageWidth, pageHeight)\n globalSetting.cols = cols\n globalSetting.rows = rows\n globalSetting.x_space = x_space\n globalSetting.y_space = y_space\n\n const fragment = document.createDocumentFragment()\n for (let i = 0; i < rows; i++) {\n const y = globalSetting.y + (globalSetting.height + y_space) * i\n for (let j = 0; j < cols; j++) {\n const x = globalSetting.x + (globalSetting.width + x_space) * j\n fragment.appendChild(createWatermarkElement(x, y, i * cols + j))\n }\n }\n shadowRoot.appendChild(fragment)\n\n if (globalSetting.monitor) {\n // 监听父元素大小变化\n resizeObserver.observe(parentElement)\n\n // 监听水印容器及其子元素\n const config: MutationObserverInit = {\n attributes: true, // 监听属性变化\n childList: true, // 监听子元素变化\n subtree: true, // 监听子树变化\n characterData: true, // 监听文本内容变化\n }\n\n // 监听水印容器\n watermarkDom.observe(watermarkContainer, config)\n\n // 如果使用了 Shadow DOM,还需要监听 shadowRoot 内的元素\n if (shadowRoot !== watermarkContainer) {\n watermarkDom.observe(shadowRoot, config)\n }\n }\n }\n\n // 移除水印\n function removeMark() {\n const watermarkElement = document.getElementById(globalSetting.id)\n watermarkDom.disconnect()\n if (watermarkElement) {\n watermarkElement.parentNode?.removeChild(watermarkElement)\n }\n }\n\n // 监听DOM变化\n function domChangeCallback(records: MutationRecord[]) {\n if (forceRemove) {\n forceRemove = false\n return\n }\n\n const watermarkElement = document.getElementById(globalSetting.id)\n if (!watermarkElement) {\n // 如果水印容器被删除,重新创建\n loadMark(globalSetting)\n return\n }\n\n // 检查是否有任何修改\n const hasChanges = records.some((record) => {\n // 检查元素是否被删除或添加\n if (record.type === 'childList') {\n return true\n }\n\n // 检查属性是否被修改\n if (record.type === 'attributes') {\n return true\n }\n\n // 检查文本内容是否被修改\n if (record.type === 'characterData') {\n return true\n }\n\n return false\n })\n\n if (hasChanges) {\n loadMark(globalSetting)\n }\n }\n\n return {\n addMark: loadMark,\n removeMark: () => {\n forceRemove = true\n // 删除这行,不重置全局配置\n // Object.assign(globalSetting, initialSettings)\n removeMark()\n },\n }\n}\n"],"names":["initialSettings","id","prefix","text","x","y","rows","cols","width","height","x_space","y_space","font","color","fontsize","alpha","angle","parent_width","parent_height","parent_node","monitor","watermark","globalSetting","forceRemove","watermarkDom","MutationObserver","records","document","getElementById","loadMark","some","record","type","resizeObserver","ResizeObserver","createWatermarkElement","index","maskDiv","createElement","textContent","style","cssText","replace","trim","settings","removeMark","Object","assign","textDimensions","fontSize","context","getContext","metrics","measureText","fontSizeNum","Number","parseFloat","actualBoundingBoxAscent","actualBoundingBoxDescent","Math","ceil","calculateTextDimensions","padding","parentElement","body","pageWidth","max","scrollWidth","clientWidth","pageHeight","scrollHeight","clientHeight","watermarkContainer","closest","getComputedStyle","position","shadowRoot","attachShadow","mode","appendChild","availableWidth","availableHeight","calculateWatermarkLayout","fragment","createDocumentFragment","i","j","observe","config","attributes","childList","subtree","characterData","watermarkElement","disconnect","parentNode","removeChild","addMark"],"mappings":"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"}
|
package/lib/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./src/argo-log.js"),r=require("./src/date-transfer.js"),s=require("./src/device.js"),o=require("./src/file-operations.js"),i=require("./src/json.js"),t=require("./src/oss-uploader.js"),p=require("./src/set-guid.js"),a=require("./src/storage.js"),n=require("./src/types.js"),d=require("./src/use-api.js"),x=require("./src/watermark.js");exports.ArgoLog=e.ArgoLog,exports.formatDuration=r.formatDuration,exports.getDeviceType=s.getDeviceType,exports.isAndroid=s.isAndroid,exports.isIOS=s.isIOS,exports.isMobile=s.isMobile,exports.createVideoUploader=o.createVideoUploader,exports.downloadFile=o.downloadFile,exports.JsonToExcel=i.JsonToExcel,exports.excelToJson=i.excelToJson,exports.OssError=t.OssError,exports.OssUploader=t.OssUploader,exports.generateSignedUrl=t.generateSignedUrl,exports.uploadFile=t.uploadFile,exports.setGuid=p.setGuid,exports.Storage=a.Storage,exports.isBoolean=n.isBoolean,exports.isElement=n.isElement,exports.isImageByMimeType=n.isImageByMimeType,exports.isJSONString=n.isJSONString,exports.isNumber=n.isNumber,exports.isPlainObject=n.isPlainObject,exports.isUndefined=n.isUndefined,exports.isWindow=n.isWindow,exports.ApiService=d.ApiService,exports.watermark=x.watermark;
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/lib/src/argo-log.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"argo-log.js","sources":["../../../../packages/utils/src/argo-log.ts"],"sourcesContent":["// 定义配置项的类型别名\nexport interface EnvironmentConfig {\n encryptType?: number\n debugMode?: number\n appkey: string\n uploadURL: string\n autoProfile?: boolean\n autoTrack?: boolean\n}\n\n/**\n * ArgoLog 类 - 用于处理埋点统计的工具类\n *\n * @class ArgoLog\n * @description 基于 AnalysysAgent SDK 封装的埋点工具类,提供了埋点追踪、用户画像设置和用户别名设置等功能\n * @example\n * ```typescript\n * const argoLog = new ArgoLog({\n * appkey: 'your-app-key',\n * uploadURL: 'your-upload-url'\n * });\n *\n * // 追踪事件\n * argoLog.track('event_name', { key: 'value' });\n * ```\n */\nexport class ArgoLog<T = EnvironmentConfig> {\n private static instances = new Map<string, ArgoLog<any>>()\n private AnalysysAgent: any | null = null\n\n constructor(envConfig: T) {\n try {\n // 检查是否为浏览器环境\n if (typeof window === 'undefined') {\n console.warn('[ArgoLog] 仅支持浏览器环境')\n return this\n }\n\n const configKey = JSON.stringify(envConfig)\n const existingInstance = ArgoLog.instances.get(configKey)\n\n if (existingInstance) {\n return existingInstance\n }\n\n if (!envConfig) {\n console.error('envConfig is required')\n return this\n }\n\n // 动态导入 SDK\n import('ans-javascript-sdk').then((module) => {\n this.AnalysysAgent = module.default\n this.AnalysysAgent.init(envConfig)\n ArgoLog.instances.set(configKey, this)\n }).catch((error) => {\n console.warn('[ArgoLog] SDK 加载失败:', error)\n })\n }\n catch (error) {\n console.warn('[ArgoLog] Init failed:', error)\n }\n\n return this\n }\n\n track = (name: string, opt?: Record<string, any>): void => {\n try {\n if (!this.AnalysysAgent) {\n console.warn('[ArgoLog] SDK 未初始化')\n return\n }\n if (!name) {\n console.warn('[ArgoLog] track: name is required')\n return\n }\n this.AnalysysAgent.track(name, opt)\n }\n catch (error) {\n console.warn('[ArgoLog] track failed:', error)\n }\n }\n\n setProfile = (info: Record<string, any>): void => {\n try {\n if (!info) {\n console.warn('[ArgoLog] setProfile: info is required')\n return\n }\n this.AnalysysAgent.profileSet(info)\n }\n catch (error) {\n console.warn('[ArgoLog] setProfile failed:', error)\n }\n }\n\n setAlias = (code: string): void => {\n try {\n if (!code) {\n console.warn('[ArgoLog] setAlias: code is required')\n return\n }\n this.AnalysysAgent.alias(code)\n }\n catch (error) {\n console.warn('[ArgoLog] setAlias failed:', error)\n }\n }\n}\n"],"names":["_ArgoLog","constructor","envConfig","__publicField","this","name","opt","AnalysysAgent","console","warn","track","error","info","profileSet","code","alias","window","configKey","JSON","stringify","existingInstance","instances","get","import","then","module","default","init","set","catch","Map","ArgoLog"],"mappings":"uKA0BO,MAAMA,EAAN,MAAMA,EAIXC,WAAAA,CAAYC,GAFZC,EAAAC,KAAQ,gBAA4B,MAsC5BD,EAAAC,KAAA,SAAA,CAACC,EAAcC,KACjB,IACE,IAACF,KAAKG,cAER,YADAC,QAAQC,KAAK,sBAGf,IAAKJ,EAEH,YADAG,QAAQC,KAAK,qCAGVL,KAAAG,cAAcG,MAAML,EAAMC,SAE1BK,GACGH,QAAAC,KAAK,0BAA2BE,EAC1C,KAGFR,EAAAC,KAAA,cAAcQ,IACR,IACF,IAAKA,EAEH,YADAJ,QAAQC,KAAK,0CAGVL,KAAAG,cAAcM,WAAWD,SAEzBD,GACGH,QAAAC,KAAK,+BAAgCE,EAC/C,KAGFR,EAAAC,KAAA,YAAYU,IACN,IACF,IAAKA,EAEH,YADAN,QAAQC,KAAK,wCAGVL,KAAAG,cAAcQ,MAAMD,SAEpBH,GACGH,QAAAC,KAAK,6BAA8BE,EAC7C,KA3EI,IAEE,GAAkB,oBAAXK,OAEF,OADPR,QAAQC,KAAK,sBACNL,KAGH,MAAAa,EAAYC,KAAKC,UAAUjB,GAC3BkB,EAAmBpB,EAAQqB,UAAUC,IAAIL,GAE/C,GAAIG,EACK,OAAAA,EAGT,IAAKlB,EAEI,OADPM,QAAQG,MAAM,yBACPP,KAITmB,OAAO,sBAAsBC,MAAMC,IACjCrB,KAAKG,cAAgBkB,EAAOC,QACvBtB,KAAAG,cAAcoB,KAAKzB,GAChBF,EAAAqB,UAAUO,IAAIX,EAAWb,KAAI,IACpCyB,OAAOlB,IACAH,QAAAC,KAAK,sBAAuBE,EAAK,UAGtCA,GACGH,QAAAC,KAAK,yBAA0BE,EACzC,CAEO,OAAAP,IACT,GArCAD,EADWH,EACI,YAAY,IAAI8B,KAD1B,IAAMC,EAAN/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-transfer.js","sources":["../../../../packages/utils/src/date-transfer.ts"],"sourcesContent":["/**\n * 智能格式化毫秒时间\n * @param ms 毫秒数\n * @returns 格式化后的时间字符串\n *\n * 规则:\n * 1. 小于1小时:显示 MM:SS\n * 2. 小于24小时:显示 HH:MM:SS\n * 3. 大于等于24小时:显示 x天x小时x分钟\n */\nexport function formatDuration(ms: number): string {\n const seconds = Math.floor(ms / 1000)\n const minutes = Math.floor(seconds / 60)\n const hours = Math.floor(minutes / 60)\n const days = Math.floor(hours / 24)\n\n const pad = (num: number) => num.toString().padStart(2, '0')\n\n // 如果时间小于1小时,返回 MM:SS\n if (hours < 1) {\n const mm = pad(minutes % 60)\n const ss = pad(seconds % 60)\n return `${mm}:${ss}`\n }\n\n // 如果时间小于24小时,返回 HH:MM:SS\n if (days < 1) {\n const hh = pad(hours)\n const mm = pad(minutes % 60)\n const ss = pad(seconds % 60)\n return `${hh}:${mm}:${ss}`\n }\n\n // 如果时间大于等于24小时,返回 x天x小时x分钟\n const remainingHours = hours % 24\n const remainingMinutes = minutes % 60\n\n const parts: string[] = []\n if (days > 0) {\n parts.push(`${days}天`)\n }\n if (remainingHours > 0) {\n parts.push(`${remainingHours}小时`)\n }\n if (remainingMinutes > 0) {\n parts.push(`${remainingMinutes}分钟`)\n }\n\n return parts.join('')\n}\n"],"names":["ms","seconds","Math","floor","minutes","hours","days","pad","num","toString","padStart","remainingHours","remainingMinutes","parts","push","join"],"mappings":"oCAUO,SAAwBA,GAC7B,MAAMC,EAAUC,KAAKC,MAAMH,EAAK,KAC1BI,EAAUF,KAAKC,MAAMF,EAAU,IAC/BI,EAAQH,KAAKC,MAAMC,EAAU,IAC7BE,EAAOJ,KAAKC,MAAME,EAAQ,IAE1BE,EAAOC,GAAgBA,EAAIC,WAAWC,SAAS,EAAG,KAGxD,GAAIL,EAAQ,EAAG,CAGN,MAAA,GAFIE,EAAIH,EAAU,OACdG,EAAIN,EAAU,KAE3B,CAGA,GAAIK,EAAO,EAAG,CAIZ,MAAO,GAHIC,EAAIF,MACJE,EAAIH,EAAU,OACdG,EAAIN,EAAU,KAE3B,CAGA,MAAMU,EAAiBN,EAAQ,GACzBO,EAAmBR,EAAU,GAE7BS,EAAkB,GAWjB,OAVHP,EAAO,GACHO,EAAAC,KAAK,GAAGR,MAEZK,EAAiB,GACbE,EAAAC,KAAK,GAAGH,OAEZC,EAAmB,GACfC,EAAAC,KAAK,GAAGF,OAGTC,EAAME,KAAK,GACpB"}
|
package/lib/src/device.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sources":["../../../../packages/utils/src/device.ts"],"sourcesContent":["/**\n * 获取设备类型\n * @returns {string} 设备类型: \"iOS\", \"Android\" 或 \"desktop\"\n */\nexport function getDeviceType() {\n const userAgent = navigator.userAgent\n\n if (/iPhone|iPad|iPod|iOS/i.test(userAgent)) {\n return 'iOS'\n }\n else if (/Android/i.test(userAgent)) {\n return 'Android'\n }\n else {\n return 'desktop'\n }\n}\n\n/**\n * 判断是否是移动端\n */\nexport function isMobile() {\n const deviceType = getDeviceType()\n return deviceType === 'iOS' || deviceType === 'Android'\n}\n\n/**\n * 判断是否是ios\n */\nexport function isIOS() {\n return /iPhone|iPad|iPod|iOS/i.test(navigator.userAgent)\n}\n\n/**\n * 判断是否是安卓\n */\nexport function isAndroid() {\n return /Android/i.test(navigator.userAgent)\n}\n"],"names":["getDeviceType","userAgent","navigator","test","deviceType"],"mappings":"aAIO,SAASA,IACd,MAAMC,EAAYC,UAAUD,UAExB,MAAA,wBAAwBE,KAAKF,GACxB,MAEA,WAAWE,KAAKF,GAChB,UAGA,SAEX,2CAoBO,WACE,MAAA,WAAWE,KAAKD,UAAUD,UACnC,gBATO,WACE,MAAA,wBAAwBE,KAAKD,UAAUD,UAChD,mBAVO,WACL,MAAMG,EAAaJ,IACZ,MAAe,QAAfI,GAAuC,YAAfA,CACjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-operations.js","sources":["../../../../packages/utils/src/file-operations.ts"],"sourcesContent":["/// <reference types=\"vite/client\" />\n\ndeclare global {\n interface Window {\n AliyunUpload: any\n OSS: any\n }\n}\n\nasync function loadScript(src: string): Promise<void> {\n return new Promise((resolve, reject) => {\n try {\n const script = document.createElement('script')\n script.src = src\n script.onload = () => {\n resolve()\n }\n script.onerror = () => {\n reject(new Error(`Failed to load script from ${src}`))\n }\n document.head.appendChild(script)\n }\n catch (error) {\n console.error('loadScript error:', error)\n reject(error)\n }\n })\n}\nasync function initAliyunSDK() {\n try {\n await loadScript('https://gosspublic.alicdn.com/aliyun-oss-sdk.min.js')\n await loadScript('https://cdnfile.yaomaitong.cn/cdn/js/aliyun-upload-sdk1.3.1.min.js')\n\n if (!window.AliyunUpload) {\n throw new Error('SDK 加载成功但未找到 AliyunUpload 对象')\n }\n }\n catch (error) {\n console.error('无法加载阿里云上传SDK:', error)\n throw error\n }\n}\n\nexport interface UploadInfo {\n file: File\n videoId?: string\n}\n\ninterface VideoUploadOptions {\n onUploadFailed?: (uploadInfo: any, code: string, message: string) => void\n onUploadSucceed?: (uploadInfo: any) => void\n onUploadProgress?: (uploadInfo: UploadInfo, totalSize: number, percent: number) => void\n onUploadTokenExpired?: (response: any) => void\n onUploadstarted?: (uploadInfo: UploadInfo) => Promise<{ uploadAuth: string, uploadAddress: string, videoId: string }>\n}\n\ninterface VideoUploadResult {\n videoId: string\n uploadInfo: any\n}\nexport interface IVideoUploader {\n uploader: any\n upload: (file: File) => Promise<VideoUploadResult>\n}\n\n/**\n * 创建阿里云视频上传器实例\n * @param options - 上传配置选项,包含各种回调函数\n * @returns 返回一个包含上传器实例和上传方法的对象\n */\nexport async function createVideoUploader(options: VideoUploadOptions): Promise<IVideoUploader> {\n // 检查是否在浏览器环境中运行\n if (typeof window === 'undefined') {\n throw new TypeError('VideoUploader 只能在浏览器环境中使用')\n }\n\n // 如果阿里云SDK未加载,则初始化SDK\n if (!window.AliyunUpload) {\n await initAliyunSDK()\n }\n\n // 声明Promise的resolve和reject函数,用于控制上传过程\n let currentResolve: ((value: VideoUploadResult) => void) | null = null\n let currentReject: ((reason: any) => void) | null = null\n\n // 创建阿里云上传实例\n const uploader = new window.AliyunUpload.Vod({\n // 上传进度回调\n onUploadProgress: options.onUploadProgress,\n // 上传凭证过期回调\n onUploadTokenExpired: options.onUploadTokenExpired || (() => {}),\n // 开始上传回调,用于设置上传凭证和地址\n onUploadstarted: async (uploadInfo: UploadInfo) => {\n try {\n const { uploadAuth, uploadAddress, videoId } = await options.onUploadstarted?.(uploadInfo) || {}\n if (uploadAuth && uploadAddress && videoId) {\n uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId)\n }\n }\n catch (error) {\n console.error('onUploadstarted error: ', error)\n throw error\n }\n },\n // 上传成功回调\n onUploadSucceed: (uploadInfo: any) => {\n currentResolve?.(uploadInfo)\n },\n // 上传失败回调\n onUploadFailed: (info: any, code: string, message: string) => {\n console.log('info: ', info)\n currentReject?.(new Error(`${message} ${code}`))\n },\n })\n\n /**\n * 上传文件方法\n * @param file - 要上传的文件对象\n * @returns Promise,解析为上传结果\n */\n const upload = async (file: File): Promise<VideoUploadResult> => {\n return new Promise((resolve, reject) => {\n currentResolve = resolve\n currentReject = reject\n\n // 设置上传的用户自定义数据\n const userData = JSON.stringify({\n Vod: {\n UserData: {\n IsShowWaterMark: 'false', // 不显示水印\n Priority: '7', // 上传优先级\n },\n },\n })\n\n // 添加文件到上传队列并开始上传\n uploader.addFile(file, null, null, null, userData)\n uploader.startUpload()\n })\n }\n\n // 返回上传器实例和上传方法\n return {\n uploader,\n upload,\n }\n}\n\n/**\n * 下载文件,创建一个隐藏的链接元素,设置下载属性并触发点击事件,然后移除该链接元素\n * @param url - 文件的URL\n * @param fileName - 文件的名称\n */\nexport function downloadFile(url: string, fileName: string) {\n const link = document.createElement('a')\n link.download = fileName\n link.style.display = 'none'\n link.href = url\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link)\n}\n"],"names":["async","loadScript","src","Promise","resolve","reject","script","document","createElement","onload","onerror","Error","head","appendChild","error","console","options","window","TypeError","AliyunUpload","initAliyunSDK","currentResolve","currentReject","uploader","Vod","onUploadProgress","onUploadTokenExpired","onUploadstarted","uploadAuth","uploadAddress","videoId","uploadInfo","setUploadAuthAndAddress","onUploadSucceed","onUploadFailed","info","code","message","log","upload","userData","JSON","stringify","UserData","IsShowWaterMark","Priority","addFile","file","startUpload","url","fileName","link","download","style","display","href","body","click","removeChild"],"mappings":"aASAA,eAAeC,EAAWC,GACxB,OAAO,IAAIC,SAAQ,CAACC,EAASC,KACvB,IACI,MAAAC,EAASC,SAASC,cAAc,UACtCF,EAAOJ,IAAMA,EACbI,EAAOG,OAAS,KACNL,GAAA,EAEVE,EAAOI,QAAU,KACfL,EAAO,IAAIM,MAAM,8BAA8BT,KAAM,EAE9CK,SAAAK,KAAKC,YAAYP,SAErBQ,GACGC,QAAAD,MAAM,oBAAqBA,GACnCT,EAAOS,EACT,IAEJ,6BA2CAd,eAA0CgB,GAEpC,GAAkB,oBAAXC,OACH,MAAA,IAAIC,UAAU,6BAIjBD,OAAOE,oBAjDdnB,iBACM,IAIE,SAHEC,EAAW,6DACXA,EAAW,uEAEZgB,OAAOE,aACJ,MAAA,IAAIR,MAAM,sCAGbG,GAEC,MADEC,QAAAD,MAAM,gBAAiBA,GACzBA,CACR,CACF,CAqCUM,GAIR,IAAIC,EAA8D,KAC9DC,EAAgD,KAGpD,MAAMC,EAAW,IAAIN,OAAOE,aAAaK,IAAI,CAE3CC,iBAAkBT,EAAQS,iBAE1BC,qBAAsBV,EAAQU,sBAAyB,MAAO,GAE9DC,gBAAiB3B,UACX,IACI,MAAA4B,WAAEA,EAAYC,cAAAA,EAAAC,QAAeA,SAAkBd,EAAQW,kBAAkBI,KAAe,CAAC,EAC3FH,GAAcC,GAAiBC,GACjCP,EAASS,wBAAwBD,EAAYH,EAAYC,EAAeC,SAGrEhB,GAEC,MADEC,QAAAD,MAAM,0BAA2BA,GACnCA,CACR,GAGFmB,gBAAkBF,IAChBV,IAAiBU,EAAU,EAG7BG,eAAgBA,CAACC,EAAWC,EAAcC,KAChCtB,QAAAuB,IAAI,SAAUH,GACtBb,IAAgB,IAAIX,MAAM,GAAG0B,KAAWD,KAAO,IA+B5C,MAAA,CACLb,WACAgB,OAxBavC,SACN,IAAIG,SAAQ,CAACC,EAASC,KACVgB,EAAAjB,EACDkB,EAAAjB,EAGV,MAAAmC,EAAWC,KAAKC,UAAU,CAC9BlB,IAAK,CACHmB,SAAU,CACRC,gBAAiB,QACjBC,SAAU,QAMhBtB,EAASuB,QAAQC,EAAM,KAAM,KAAM,KAAMP,GACzCjB,EAASyB,aAAY,IAS3B,uBAOgB,SAAaC,EAAaC,GAClC,MAAAC,EAAO5C,SAASC,cAAc,KACpC2C,EAAKC,SAAWF,EAChBC,EAAKE,MAAMC,QAAU,OACrBH,EAAKI,KAAON,EACH1C,SAAAiD,KAAK3C,YAAYsC,GAC1BA,EAAKM,QACIlD,SAAAiD,KAAKE,YAAYP,EAC5B"}
|
package/lib/src/json.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sources":["../../../../packages/utils/src/json.ts"],"sourcesContent":["import { read, utils, writeFile } from 'xlsx'\n\n/**\n * 将JSON数据导出为Excel文件\n * @param title - Excel文件的标题\n * @param json - JSON数据\n * @param merge - 合并单元格的配置\n * @returns 如果JSON数据为空,则返回undefined,否则返回Excel文件的名称\n */\nexport function JsonToExcel(title = '', json: (string | number)[][] = [], merge?: any) {\n try {\n if (!json.length) {\n return\n }\n // 创建worksheet\n const worksheet = utils.aoa_to_sheet(json)\n if (merge) {\n worksheet['!merges'] = merge\n }\n // 新建空workbook,加入worksheet\n const workbook = utils.book_new()\n utils.book_append_sheet(workbook, worksheet, '')\n writeFile(workbook, `${title}.xlsx`)\n }\n catch (e) {\n console.log('e: ', e)\n return new Error('数据导出失败')\n }\n}\n\n/**\n * 将Excel数据转换为JSON\n * @param file - Excel文件\n * @param cb - 转换完成后的回调函数\n * @param start - 开始行号\n */\nexport function excelToJson(file: File, cb: (json: any[]) => void, start: number): Promise<any[]> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.readAsArrayBuffer(file)\n reader.onload = (e) => {\n const data = e.target?.result\n const workbook = read(data, { type: 'binary' })\n // 遍历每张表读取\n const json: any[] = []\n for (const sheet in workbook.Sheets) {\n if (Object.prototype.hasOwnProperty.call(workbook.Sheets, sheet)) {\n let arr: string[][] = []\n const fromTo = workbook.Sheets[sheet]['!ref'] || ''\n const end = fromTo.split(':')\n const space = start + end[1].toString()\n arr = arr.concat(utils.sheet_to_json(workbook.Sheets[sheet], { header: 1, range: start ? space : fromTo }))\n const titleArr = arr[0]\n arr.shift()\n const excelJsonArr = arr.map((item) => {\n const obj: {\n [key: string]: any\n } = {}\n titleArr.forEach((titleItem: string, index: number) => {\n obj[titleItem] = item[index]\n })\n return obj\n })\n json.push(...excelJsonArr)\n }\n }\n if (cb) {\n cb(json)\n }\n resolve(json)\n }\n reader.onerror = (e) => {\n reject(e)\n }\n })\n}\n"],"names":["title","arguments","length","undefined","json","merge","worksheet","utils","aoa_to_sheet","workbook","book_new","book_append_sheet","writeFile","e","console","log","Error","file","cb","start","Promise","resolve","reject","reader","FileReader","readAsArrayBuffer","onload","data","target","result","read","type","sheet","Sheets","Object","prototype","hasOwnProperty","call","arr","fromTo","end","split","space","toString","concat","sheet_to_json","header","range","titleArr","shift","excelJsonArr","map","item","obj","forEach","titleItem","index","push","onerror"],"mappings":"uDASO,WAAgF,IAA3DA,EAAQC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAA,GAAIG,EAA8BH,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAA,GAAII,EAAaJ,UAAAC,OAAAD,EAAAA,kBAAAE,EACjF,IACE,IAACC,EAAKF,OACR,OAGI,MAAAI,EAAYC,EAAAA,MAAMC,aAAaJ,GACjCC,IACFC,EAAU,WAAaD,GAGnB,MAAAI,EAAWF,QAAMG,WACjBH,EAAAA,MAAAI,kBAAkBF,EAAUH,EAAW,IACnCM,EAAAA,UAAAH,EAAU,GAAGT,gBAElBa,GAEE,OADCC,QAAAC,IAAI,MAAOF,GACZ,IAAIG,MAAM,SACnB,CACF,sBAQgB,SAAYC,EAAYC,EAA2BC,GACjE,OAAO,IAAIC,SAAQ,CAACC,EAASC,KACrB,MAAAC,EAAS,IAAIC,WACnBD,EAAOE,kBAAkBR,GAClBM,EAAAG,OAAUb,IACT,MAAAc,EAAOd,EAAEe,QAAQC,OACjBpB,EAAWqB,EAAKA,KAAAH,EAAM,CAAEI,KAAM,WAE9B3B,EAAc,GACT,IAAA,MAAA4B,KAASvB,EAASwB,OAC3B,GAAIC,OAAOC,UAAUC,eAAeC,KAAK5B,EAASwB,OAAQD,GAAQ,CAChE,IAAIM,EAAkB,GACtB,MAAMC,EAAS9B,EAASwB,OAAOD,GAAO,SAAW,GAC3CQ,EAAMD,EAAOE,MAAM,KACnBC,EAAQvB,EAAQqB,EAAI,GAAGG,WAC7BL,EAAMA,EAAIM,OAAOrC,EAAAA,MAAMsC,cAAcpC,EAASwB,OAAOD,GAAQ,CAAEc,OAAQ,EAAGC,MAAO5B,EAAQuB,EAAQH,KAC3F,MAAAS,EAAWV,EAAI,GACrBA,EAAIW,QACJ,MAAMC,EAAeZ,EAAIa,KAAKC,IAC5B,MAAMC,EAEF,CAAC,EAIE,OAHEL,EAAAM,SAAQ,CAACC,EAAmBC,KAC/BH,EAAAE,GAAaH,EAAKI,EAAK,IAEtBH,CAAA,IAEJjD,EAAAqD,QAAQP,EACf,CAEEhC,GACFA,EAAGd,GAELiB,EAAQjB,EAAI,EAEPmB,EAAAmC,QAAW7C,IAChBS,EAAOT,EAAC,CACV,GAEJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oss-uploader.js","sources":["../../../../packages/utils/src/oss-uploader.ts"],"sourcesContent":["import OSS from 'ali-oss'\n\nexport interface OssCredentials {\n accessKeyId: string\n accessKeySecret: string\n securityToken: string\n}\n\nexport interface OssConfig extends Partial<Omit<OssClientConfig, 'accessKeyId' | 'accessKeySecret' | 'stsToken'>> {\n file: File\n onProgress?: (p: { percent: number }) => void\n path?: string\n getCredentials: () => Promise<OssCredentials | null>\n}\n\nexport interface OssClientConfig {\n accessKeyId: string\n accessKeySecret: string\n stsToken: string\n secure: boolean\n bucket: string\n region: string\n cors: boolean\n useFetch: boolean\n timeout: number\n headers: Record<string, string>\n}\n\n// 定义错误类型\nexport class OssError extends Error {\n constructor(message: string) {\n super(message)\n this.name = 'OssError'\n }\n}\n\nconst ossConfig: OssClientConfig = {\n accessKeyId: '',\n accessKeySecret: '',\n stsToken: '',\n secure: true,\n bucket: 'yao-file-daily',\n region: 'oss-cn-hangzhou',\n cors: true,\n useFetch: false,\n timeout: 60000,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE',\n 'Access-Control-Allow-Headers': '*',\n },\n}\n\nexport class OssUploader {\n private static client: OSS\n private static createTokenTime: number = 0\n private static readonly expireTime = 15 * 60 * 1000\n\n // 获取凭证\n private static async getOssCredentials(getCredentials: OssConfig['getCredentials']): Promise<Required<OssCredentials>> {\n const credentials = await getCredentials()\n if (!credentials) {\n throw new OssError('获取凭证失败')\n }\n return {\n accessKeyId: credentials.accessKeyId,\n accessKeySecret: credentials.accessKeySecret,\n securityToken: credentials.securityToken,\n }\n }\n\n // 修改初始化方法\n public static async initOssClient(getCredentials: OssConfig['getCredentials'], args?: Partial<OssConfig>): Promise<void> {\n const diff = Date.now() - this.createTokenTime\n if (!ossConfig.accessKeyId || diff > this.expireTime) {\n try {\n const { accessKeyId, accessKeySecret, securityToken: stsToken } = await this.getOssCredentials(getCredentials)\n Object.assign(ossConfig, {\n accessKeyId,\n accessKeySecret,\n stsToken,\n ...args,\n refreshSTSToken: async () => {\n return await this.getOssCredentials(getCredentials)\n },\n refreshSTSTokenInterval: 300000,\n })\n this.createTokenTime = Date.now()\n this.client = new OSS(ossConfig)\n }\n catch (error) {\n throw new OssError(error instanceof Error ? error.message : String(error))\n }\n }\n }\n\n // 修改上传方法\n public static async uploadFile(opts: OssConfig & { getCredentials: OssConfig['getCredentials'] }): Promise<OSS.MultipartUploadResult> {\n const { file, onProgress = () => {}, path = 'ksh/pdf', getCredentials, ...rest } = opts\n\n await this.initOssClient(getCredentials, rest)\n\n try {\n const result = await this.client.multipartUpload(`${path}/${file.name}`, file, {\n progress(p: number) {\n onProgress({ percent: Math.round(p * 100) })\n },\n })\n return result\n }\n catch (error) {\n throw new OssError(error instanceof Error ? error.message : String(error))\n }\n }\n\n // 修改生成签名URL方法\n public static async generateSignedUrl(\n objectKey: string,\n getCredentials: OssConfig['getCredentials'],\n args?: Partial<OssConfig>,\n ): Promise<string> {\n await this.initOssClient(getCredentials, args)\n try {\n return await this.client.signatureUrl(objectKey, { expires: 60 * 60 })\n }\n catch (error) {\n throw new OssError(error instanceof Error ? error.message : String(error))\n }\n }\n}\n\n// 导出便捷方法\nexport const uploadFile = OssUploader.uploadFile.bind(OssUploader)\nexport const generateSignedUrl = OssUploader.generateSignedUrl.bind(OssUploader)\n"],"names":["OssError","Error","constructor","message","super","this","name","ossConfig","accessKeyId","accessKeySecret","stsToken","secure","bucket","region","cors","useFetch","timeout","headers","OssUploader","getOssCredentials","getCredentials","credentials","securityToken","initOssClient","args","diff","Date","now","createTokenTime","expireTime","Object","assign","refreshSTSToken","async","refreshSTSTokenInterval","client","OSS","error","String","uploadFile","opts","file","onProgress","path","rest","multipartUpload","progress","p","percent","Math","round","generateSignedUrl","objectKey","signatureUrl","expires","__publicField","bind"],"mappings":"4LA6BO,MAAMA,UAAiBC,MAC5BC,WAAAA,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,UACd,EAGF,MAAMC,EAA6B,CACjCC,YAAa,GACbC,gBAAiB,GACjBC,SAAU,GACVC,QAAQ,EACRC,OAAQ,iBACRC,OAAQ,kBACRC,MAAM,EACNC,UAAU,EACVC,QAAS,IACTC,QAAS,CACP,8BAA+B,IAC/B,+BAAgC,yBAChC,+BAAgC,MAI7B,MAAMC,EAMX,8BAAqBC,CAAkBC,GAC/B,MAAAC,QAAoBD,IAC1B,IAAKC,EACG,MAAA,IAAIrB,EAAS,UAEd,MAAA,CACLQ,YAAaa,EAAYb,YACzBC,gBAAiBY,EAAYZ,gBAC7Ba,cAAeD,EAAYC,cAE/B,CAGA,0BAAoBC,CAAcH,EAA6CI,GAC7E,MAAMC,EAAOC,KAAKC,MAAQtB,KAAKuB,gBAC/B,IAAKrB,EAAUC,aAAeiB,EAAOpB,KAAKwB,WACpC,IACI,MAAArB,YAAEA,kBAAaC,EAAiBa,cAAeZ,SAAmBL,KAAKc,kBAAkBC,GAC/FU,OAAOC,OAAOxB,EAAW,CACvBC,cACAC,kBACAC,cACGc,EACHQ,gBAAiBC,eACF5B,KAAKc,kBAAkBC,GAEtCc,wBAAyB,MAEtB7B,KAAAuB,gBAAkBF,KAAKC,MACvBtB,KAAA8B,OAAS,IAAIC,EAAI7B,SAEjB8B,GACC,MAAA,IAAIrC,EAASqC,aAAiBpC,MAAQoC,EAAMlC,QAAUmC,OAAOD,GACrE,CAEJ,CAGA,uBAAoBE,CAAWC,GACvB,MAAAC,KAAEA,EAAMC,WAAAA,EAAaA,YAAUC,EAAO,UAAAvB,eAAWA,KAAmBwB,GAASJ,QAE7EnC,KAAKkB,cAAcH,EAAgBwB,GAErC,IAMK,aALcvC,KAAK8B,OAAOU,gBAAgB,GAAGF,KAAQF,EAAKnC,OAAQmC,EAAM,CAC7EK,QAAAA,CAASC,GACPL,EAAW,CAAEM,QAASC,KAAKC,MAAU,IAAJH,IACnC,UAIGV,GACC,MAAA,IAAIrC,EAASqC,aAAiBpC,MAAQoC,EAAMlC,QAAUmC,OAAOD,GACrE,CACF,CAGA,8BAAoBc,CAClBC,EACAhC,EACAI,SAEMnB,KAAKkB,cAAcH,EAAgBI,GACrC,IACK,aAAMnB,KAAK8B,OAAOkB,aAAaD,EAAW,CAAEE,QAAS,aAEvDjB,GACC,MAAA,IAAIrC,EAASqC,aAAiBpC,MAAQoC,EAAMlC,QAAUmC,OAAOD,GACrE,CACF,EA1EAkB,EADWrC,EACI,UACfqC,EAFWrC,EAEI,kBAA0B,GACzCqC,EAHWrC,EAGa,aAAa,KA4EhC,MAAMqB,EAAarB,EAAYqB,WAAWiB,KAAKtC,GACzCiC,EAAoBjC,EAAYiC,kBAAkBK,KAAKtC"}
|
package/lib/src/set-guid.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-guid.js","sources":["../../../../packages/utils/src/set-guid.ts"],"sourcesContent":["/**\n * 随机id\n */\nexport function setGuid() {\n return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = Math.random() * 16 | 0\n const v = c === 'x' ? r : (r & 0x3 | 0x8)\n return v.toString(16)\n })\n}\n"],"names":["replace","c","r","Math","random","toString"],"mappings":"6BAGO,WACL,MAAO,mCAAmCA,QAAQ,SAAUC,IAC1D,MAAMC,EAAoB,GAAhBC,KAAKC,SAAgB,EAExB,OADS,MAANH,EAAYC,EAAS,EAAJA,EAAU,GAC5BG,SAAS,GAAE,GAExB"}
|