@iflyrpa/actions 2.0.0-beta.8 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/getShipinhaoBgm/index.d.ts +1 -1
- package/dist/actions/shipinhaoPublish/index.d.ts +3 -8
- package/dist/actions/shipinhaoPublish/rpa-server.d.ts +2 -0
- package/dist/actions/shipinhaoPublish/rpa.d.ts +4 -0
- package/dist/actions/shipinhaoPublish/uploader.d.ts +102 -0
- package/dist/bundle.js +729 -222
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +726 -221
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +726 -221
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +2 -2
|
@@ -17,7 +17,7 @@ export interface BgmListResponse {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
export interface BgmDetail {
|
|
20
|
-
listenItem:
|
|
20
|
+
listenItem: unknown;
|
|
21
21
|
}
|
|
22
22
|
export type GetBgmAction = CommonAction<GetShipinhaoBgmParams, BgmListResponse["data"]>;
|
|
23
23
|
export declare const getShipinhaoBgm: GetBgmAction;
|
|
@@ -33,19 +33,14 @@ export declare const ShipinhaoPublishParamsSchema: z.ZodObject<{
|
|
|
33
33
|
topic: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
34
|
address: z.ZodOptional<z.ZodObject<{
|
|
35
35
|
poi_id: z.ZodString;
|
|
36
|
-
name: z.ZodString
|
|
37
|
-
address: z.ZodString
|
|
36
|
+
name: z.ZodOptional<z.ZodString>;
|
|
37
|
+
address: z.ZodOptional<z.ZodString>;
|
|
38
38
|
latitude: z.ZodNumber;
|
|
39
39
|
longitude: z.ZodNumber;
|
|
40
40
|
city_name: z.ZodString;
|
|
41
|
-
poi_type: z.ZodNumber;
|
|
42
|
-
type: z.ZodString;
|
|
43
41
|
}, z.core.$strip>>;
|
|
44
42
|
link: z.ZodOptional<z.ZodObject<{
|
|
45
|
-
urlType: z.
|
|
46
|
-
1: "1";
|
|
47
|
-
2: "2";
|
|
48
|
-
}>;
|
|
43
|
+
urlType: z.ZodNumber;
|
|
49
44
|
link: z.ZodString;
|
|
50
45
|
title: z.ZodString;
|
|
51
46
|
}, z.core.$strip>>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 视频号分片上传配置
|
|
3
|
+
*/
|
|
4
|
+
interface UploadConfig {
|
|
5
|
+
chunkSize?: number;
|
|
6
|
+
concurrentLimit?: number;
|
|
7
|
+
singleFileSize?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 上传进度回调
|
|
11
|
+
*/
|
|
12
|
+
type ProgressCallback = (progress: {
|
|
13
|
+
uploadedChunks: number;
|
|
14
|
+
totalChunks: number;
|
|
15
|
+
percent: number;
|
|
16
|
+
speed?: number;
|
|
17
|
+
}) => void;
|
|
18
|
+
/**
|
|
19
|
+
* 视频号分片上传器
|
|
20
|
+
* 参考前端代码逻辑实现
|
|
21
|
+
*/
|
|
22
|
+
export declare class VideoChannelUploader {
|
|
23
|
+
private chunkSize;
|
|
24
|
+
private concurrentLimit;
|
|
25
|
+
private singleFileSize;
|
|
26
|
+
private uploadTaskId;
|
|
27
|
+
private partInfo;
|
|
28
|
+
private md5;
|
|
29
|
+
private chunkCount;
|
|
30
|
+
private uploadedChunks;
|
|
31
|
+
private startTime;
|
|
32
|
+
private uploadSpeed;
|
|
33
|
+
private speedRecords;
|
|
34
|
+
private speedInterval?;
|
|
35
|
+
constructor(config?: UploadConfig);
|
|
36
|
+
/**
|
|
37
|
+
* 计算 Buffer MD5(前 5MB)
|
|
38
|
+
*/
|
|
39
|
+
private calculateMd5;
|
|
40
|
+
/**
|
|
41
|
+
* 计算分片 MD5(完整分片)
|
|
42
|
+
*/
|
|
43
|
+
private calculateChunkMd5;
|
|
44
|
+
/**
|
|
45
|
+
* 生成 UUID
|
|
46
|
+
*/
|
|
47
|
+
private generateUUID;
|
|
48
|
+
/**
|
|
49
|
+
* 获取图片尺寸
|
|
50
|
+
*/
|
|
51
|
+
private getImageSize;
|
|
52
|
+
/**
|
|
53
|
+
* 读取文件为 Buffer
|
|
54
|
+
*/
|
|
55
|
+
private readFile;
|
|
56
|
+
/**
|
|
57
|
+
* 获取上传认证参数(UploadID)
|
|
58
|
+
*/
|
|
59
|
+
private getUploadId;
|
|
60
|
+
/**
|
|
61
|
+
* 上传单个分片
|
|
62
|
+
*/
|
|
63
|
+
private uploadChunk;
|
|
64
|
+
/**
|
|
65
|
+
* 确认分片上传(用于断点续传检查)
|
|
66
|
+
*/
|
|
67
|
+
private confirmChunks;
|
|
68
|
+
/**
|
|
69
|
+
* 完成上传
|
|
70
|
+
*/
|
|
71
|
+
private completeUpload;
|
|
72
|
+
/**
|
|
73
|
+
* 并发控制执行器
|
|
74
|
+
*/
|
|
75
|
+
private asyncPool;
|
|
76
|
+
/**
|
|
77
|
+
* 开始上传(核心方法)
|
|
78
|
+
*/
|
|
79
|
+
upload(imagePath: string, uin: number, authKey: string, options?: {
|
|
80
|
+
onProgress?: ProgressCallback;
|
|
81
|
+
transFlag?: string;
|
|
82
|
+
}): Promise<{
|
|
83
|
+
downloadUrl: string;
|
|
84
|
+
width: number;
|
|
85
|
+
height: number;
|
|
86
|
+
fileSize: number;
|
|
87
|
+
md5: string;
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* 更新进度
|
|
91
|
+
*/
|
|
92
|
+
private updateProgress;
|
|
93
|
+
/**
|
|
94
|
+
* 启动速度监控
|
|
95
|
+
*/
|
|
96
|
+
private startSpeedWatch;
|
|
97
|
+
/**
|
|
98
|
+
* 停止速度监控
|
|
99
|
+
*/
|
|
100
|
+
private stopSpeedWatch;
|
|
101
|
+
}
|
|
102
|
+
export {};
|