polyv-live-api-sdk 1.0.18 → 1.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/dist/index.cjs +427 -157
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +164 -37
- package/dist/index.js +427 -157
- package/dist/index.js.map +1 -1
- package/dist/services/account.service.d.ts +4 -4
- package/dist/services/channel.service.d.ts +13 -8
- package/dist/services/channel.service.d.ts.map +1 -1
- package/dist/services/chat.service.d.ts +1 -1
- package/dist/services/chat.service.d.ts.map +1 -1
- package/dist/services/live-interaction.service.d.ts.map +1 -1
- package/dist/services/player.service.d.ts +1 -1
- package/dist/services/player.service.d.ts.map +1 -1
- package/dist/services/statistics.service.d.ts.map +1 -1
- package/dist/services/v4/ai.service.d.ts.map +1 -1
- package/dist/services/v4/channel.service.d.ts +11 -5
- package/dist/services/v4/channel.service.d.ts.map +1 -1
- package/dist/services/v4/global.service.d.ts.map +1 -1
- package/dist/services/v4/robot.service.d.ts.map +1 -1
- package/dist/services/v4/user.service.d.ts.map +1 -1
- package/dist/services/v4/webapp.service.d.ts.map +1 -1
- package/dist/services/web.service.d.ts +1 -1
- package/dist/services/web.service.d.ts.map +1 -1
- package/dist/types/account.d.ts +2 -1
- package/dist/types/account.d.ts.map +1 -1
- package/dist/types/channel.d.ts +59 -10
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/chat-censor-role.d.ts +5 -3
- package/dist/types/chat-censor-role.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/player.d.ts +4 -2
- package/dist/types/player.d.ts.map +1 -1
- package/dist/types/v4-channel.d.ts +53 -6
- package/dist/types/v4-channel.d.ts.map +1 -1
- package/dist/types/web.d.ts +4 -0
- package/dist/types/web.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var CryptoJS = require('crypto-js');
|
|
4
4
|
var crypto = require('crypto');
|
|
5
|
-
var
|
|
5
|
+
var axios2 = require('axios');
|
|
6
6
|
|
|
7
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
8
|
|
|
9
9
|
var CryptoJS__default = /*#__PURE__*/_interopDefault(CryptoJS);
|
|
10
|
-
var
|
|
10
|
+
var axios2__default = /*#__PURE__*/_interopDefault(axios2);
|
|
11
11
|
|
|
12
12
|
// src/errors/polyv-error.ts
|
|
13
13
|
var PolyVError = class _PolyVError extends Error {
|
|
@@ -583,6 +583,32 @@ var ChannelService = class {
|
|
|
583
583
|
throw PolyVValidationError.required(field);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
+
buildSignedFormBody(params) {
|
|
587
|
+
const timestamp = Date.now();
|
|
588
|
+
const signatureParams = {
|
|
589
|
+
appId: this.client.config.appId,
|
|
590
|
+
timestamp,
|
|
591
|
+
...params
|
|
592
|
+
};
|
|
593
|
+
const { sign } = generateSignature(signatureParams, {
|
|
594
|
+
appSecret: this.client.config.appSecret
|
|
595
|
+
});
|
|
596
|
+
const form = new URLSearchParams();
|
|
597
|
+
for (const [key, value] of Object.entries({ ...signatureParams, sign })) {
|
|
598
|
+
if (value !== void 0 && value !== null) {
|
|
599
|
+
form.append(key, String(value));
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
return form;
|
|
603
|
+
}
|
|
604
|
+
buildSignedFormConfig() {
|
|
605
|
+
return {
|
|
606
|
+
headers: {
|
|
607
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
608
|
+
"X-Skip-Auth": "true"
|
|
609
|
+
}
|
|
610
|
+
};
|
|
611
|
+
}
|
|
586
612
|
validateRequiredText(value, field, maxLength) {
|
|
587
613
|
if (!value || value.trim() === "") {
|
|
588
614
|
throw PolyVValidationError.required(field);
|
|
@@ -1245,7 +1271,8 @@ var ChannelService = class {
|
|
|
1245
1271
|
* Update teacher document relation
|
|
1246
1272
|
*
|
|
1247
1273
|
* Adds or removes the binding between a teacher and documents.
|
|
1248
|
-
* Note: fileIds is passed in the body
|
|
1274
|
+
* Note: fileIds is passed in the request body as application/x-www-form-urlencoded
|
|
1275
|
+
* (NOT signed), while teacherId/operation are query-string parameters that ARE signed.
|
|
1249
1276
|
*
|
|
1250
1277
|
* @param teacherId - The teacher ID
|
|
1251
1278
|
* @param fileIds - File IDs, comma-separated
|
|
@@ -1268,10 +1295,15 @@ var ChannelService = class {
|
|
|
1268
1295
|
if (!fileIds || fileIds.trim() === "") {
|
|
1269
1296
|
throw PolyVValidationError.required("fileIds");
|
|
1270
1297
|
}
|
|
1298
|
+
const form = new URLSearchParams();
|
|
1299
|
+
form.set("fileIds", fileIds);
|
|
1271
1300
|
const response = await this.client.httpClient.post(
|
|
1272
1301
|
"/live/v4/channel/doc/teacher/update-relation",
|
|
1273
|
-
|
|
1274
|
-
{
|
|
1302
|
+
form,
|
|
1303
|
+
{
|
|
1304
|
+
params: { teacherId, operation },
|
|
1305
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
1306
|
+
}
|
|
1275
1307
|
);
|
|
1276
1308
|
return response;
|
|
1277
1309
|
}
|
|
@@ -2080,8 +2112,8 @@ var ChannelService = class {
|
|
|
2080
2112
|
}
|
|
2081
2113
|
const response = await this.client.httpClient.post(
|
|
2082
2114
|
`/live/v2/channel/recordFile/${params.channelId}/convert`,
|
|
2083
|
-
|
|
2084
|
-
|
|
2115
|
+
this.buildSignedFormBody(query),
|
|
2116
|
+
this.buildSignedFormConfig()
|
|
2085
2117
|
);
|
|
2086
2118
|
return response;
|
|
2087
2119
|
}
|
|
@@ -2688,11 +2720,10 @@ var ChannelService = class {
|
|
|
2688
2720
|
throw PolyVValidationError.required("fileId");
|
|
2689
2721
|
}
|
|
2690
2722
|
const params = { channelId, fileId: options.fileId };
|
|
2691
|
-
if (options.startTime !== void 0) {
|
|
2692
|
-
params.
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
params.endTime = options.endTime;
|
|
2723
|
+
if (options.startTime !== void 0 && options.endTime !== void 0) {
|
|
2724
|
+
params.deleteTimeFrame = JSON.stringify([
|
|
2725
|
+
{ start: options.startTime, end: options.endTime }
|
|
2726
|
+
]);
|
|
2696
2727
|
}
|
|
2697
2728
|
if (options.fileName !== void 0) {
|
|
2698
2729
|
params.fileName = options.fileName;
|
|
@@ -2720,7 +2751,9 @@ var ChannelService = class {
|
|
|
2720
2751
|
* @example
|
|
2721
2752
|
* ```typescript
|
|
2722
2753
|
* const result = await channelService.recordConvert('ch123456', {
|
|
2723
|
-
*
|
|
2754
|
+
* userId: 'user123',
|
|
2755
|
+
* fileName: 'my-vod',
|
|
2756
|
+
* sessionId: 'fvlyin8qz3',
|
|
2724
2757
|
* });
|
|
2725
2758
|
* ```
|
|
2726
2759
|
*/
|
|
@@ -2728,37 +2761,62 @@ var ChannelService = class {
|
|
|
2728
2761
|
if (!channelId || channelId.trim() === "") {
|
|
2729
2762
|
throw PolyVValidationError.required("channelId");
|
|
2730
2763
|
}
|
|
2731
|
-
if (!options.
|
|
2732
|
-
throw PolyVValidationError.required("
|
|
2764
|
+
if (!options.userId || options.userId.trim() === "") {
|
|
2765
|
+
throw PolyVValidationError.required("userId");
|
|
2733
2766
|
}
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
params.fileName = options.fileName;
|
|
2767
|
+
if (!options.fileName || options.fileName.trim() === "") {
|
|
2768
|
+
throw PolyVValidationError.required("fileName");
|
|
2737
2769
|
}
|
|
2738
|
-
|
|
2739
|
-
|
|
2770
|
+
const hasSessionId = options.sessionId && options.sessionId.trim() !== "";
|
|
2771
|
+
const hasFileUrl = options.fileUrl && options.fileUrl.trim() !== "";
|
|
2772
|
+
if (!hasSessionId && !hasFileUrl) {
|
|
2773
|
+
throw PolyVValidationError.required("sessionId or fileUrl");
|
|
2774
|
+
}
|
|
2775
|
+
const params = {
|
|
2776
|
+
userId: options.userId,
|
|
2777
|
+
fileName: options.fileName
|
|
2778
|
+
};
|
|
2779
|
+
if (options.sessionId) {
|
|
2780
|
+
params.sessionId = options.sessionId;
|
|
2781
|
+
}
|
|
2782
|
+
if (options.fileUrl) {
|
|
2783
|
+
params.fileUrl = options.fileUrl;
|
|
2784
|
+
}
|
|
2785
|
+
if (options.cataid !== void 0) {
|
|
2786
|
+
params.cataid = options.cataid;
|
|
2787
|
+
}
|
|
2788
|
+
if (options.cataname !== void 0) {
|
|
2789
|
+
params.cataname = options.cataname;
|
|
2790
|
+
}
|
|
2791
|
+
if (options.toPlayList !== void 0) {
|
|
2792
|
+
params.toPlayList = options.toPlayList;
|
|
2793
|
+
}
|
|
2794
|
+
if (options.setAsDefault !== void 0) {
|
|
2795
|
+
params.setAsDefault = options.setAsDefault;
|
|
2740
2796
|
}
|
|
2741
2797
|
const response = await this.client.httpClient.post(
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2798
|
+
`/live/v2/channel/recordFile/${channelId}/convert`,
|
|
2799
|
+
this.buildSignedFormBody(params),
|
|
2800
|
+
this.buildSignedFormConfig()
|
|
2745
2801
|
);
|
|
2746
|
-
|
|
2802
|
+
const obj = typeof response === "object" && response !== null ? response : void 0;
|
|
2803
|
+
const vid = typeof response === "string" ? response : String(obj?.["vid"] ?? obj?.["fileId"] ?? "");
|
|
2804
|
+
return { vid };
|
|
2747
2805
|
}
|
|
2748
2806
|
/**
|
|
2749
2807
|
* Record convert async
|
|
2750
2808
|
*
|
|
2751
|
-
* Converts
|
|
2809
|
+
* Converts recording files to VOD asynchronously.
|
|
2752
2810
|
*
|
|
2753
2811
|
* @param channelId - The channel ID
|
|
2754
|
-
* @param options - Convert options
|
|
2812
|
+
* @param options - Convert options (requires comma-separated fileIds)
|
|
2755
2813
|
* @returns true if submitted successfully
|
|
2756
2814
|
* @throws PolyVValidationError if required parameters are empty
|
|
2757
2815
|
*
|
|
2758
2816
|
* @example
|
|
2759
2817
|
* ```typescript
|
|
2760
2818
|
* const result = await channelService.recordConvertAsync('ch123456', {
|
|
2761
|
-
*
|
|
2819
|
+
* fileIds: 'file1,file2',
|
|
2762
2820
|
* });
|
|
2763
2821
|
* ```
|
|
2764
2822
|
*/
|
|
@@ -2766,20 +2824,24 @@ var ChannelService = class {
|
|
|
2766
2824
|
if (!channelId || channelId.trim() === "") {
|
|
2767
2825
|
throw PolyVValidationError.required("channelId");
|
|
2768
2826
|
}
|
|
2769
|
-
if (!options.
|
|
2770
|
-
throw PolyVValidationError.required("
|
|
2827
|
+
if (!options.fileIds || options.fileIds.trim() === "") {
|
|
2828
|
+
throw PolyVValidationError.required("fileIds");
|
|
2771
2829
|
}
|
|
2772
|
-
const params = { channelId,
|
|
2830
|
+
const params = { channelId, fileIds: options.fileIds };
|
|
2773
2831
|
if (options.fileName !== void 0) {
|
|
2774
2832
|
params.fileName = options.fileName;
|
|
2775
2833
|
}
|
|
2834
|
+
if (options.cataId !== void 0) {
|
|
2835
|
+
params.cataId = options.cataId;
|
|
2836
|
+
}
|
|
2776
2837
|
if (options.callbackUrl !== void 0) {
|
|
2777
2838
|
params.callbackUrl = options.callbackUrl;
|
|
2778
2839
|
}
|
|
2840
|
+
params.canRepeat = options.canRepeat ?? 1;
|
|
2779
2841
|
await this.client.httpClient.post(
|
|
2780
|
-
"/live/v3/channel/record/convert
|
|
2781
|
-
|
|
2782
|
-
|
|
2842
|
+
"/live/v3/channel/record/convert",
|
|
2843
|
+
this.buildSignedFormBody(params),
|
|
2844
|
+
this.buildSignedFormConfig()
|
|
2783
2845
|
);
|
|
2784
2846
|
return true;
|
|
2785
2847
|
}
|
|
@@ -2895,12 +2957,16 @@ var ChannelService = class {
|
|
|
2895
2957
|
if (!channelId || channelId.trim() === "") {
|
|
2896
2958
|
throw PolyVValidationError.required("channelId");
|
|
2897
2959
|
}
|
|
2898
|
-
if (!options.
|
|
2899
|
-
throw PolyVValidationError.required("
|
|
2960
|
+
if (!options.startTime || String(options.startTime).trim() === "") {
|
|
2961
|
+
throw PolyVValidationError.required("startTime");
|
|
2962
|
+
}
|
|
2963
|
+
if (!options.endTime || String(options.endTime).trim() === "") {
|
|
2964
|
+
throw PolyVValidationError.required("endTime");
|
|
2900
2965
|
}
|
|
2901
2966
|
const params = {
|
|
2902
2967
|
channelId,
|
|
2903
|
-
|
|
2968
|
+
startTime: options.startTime,
|
|
2969
|
+
endTime: options.endTime
|
|
2904
2970
|
};
|
|
2905
2971
|
if (options.fileName !== void 0) {
|
|
2906
2972
|
params.fileName = options.fileName;
|
|
@@ -2936,12 +3002,16 @@ var ChannelService = class {
|
|
|
2936
3002
|
if (!channelId || channelId.trim() === "") {
|
|
2937
3003
|
throw PolyVValidationError.required("channelId");
|
|
2938
3004
|
}
|
|
2939
|
-
if (!options.
|
|
2940
|
-
throw PolyVValidationError.required("
|
|
3005
|
+
if (!options.startTime || String(options.startTime).trim() === "") {
|
|
3006
|
+
throw PolyVValidationError.required("startTime");
|
|
3007
|
+
}
|
|
3008
|
+
if (!options.endTime || String(options.endTime).trim() === "") {
|
|
3009
|
+
throw PolyVValidationError.required("endTime");
|
|
2941
3010
|
}
|
|
2942
3011
|
const params = {
|
|
2943
3012
|
channelId,
|
|
2944
|
-
|
|
3013
|
+
startTime: options.startTime,
|
|
3014
|
+
endTime: options.endTime
|
|
2945
3015
|
};
|
|
2946
3016
|
if (options.fileName !== void 0) {
|
|
2947
3017
|
params.fileName = options.fileName;
|
|
@@ -2978,13 +3048,17 @@ var ChannelService = class {
|
|
|
2978
3048
|
if (!channelId || channelId.trim() === "") {
|
|
2979
3049
|
throw PolyVValidationError.required("channelId");
|
|
2980
3050
|
}
|
|
2981
|
-
if (!options.
|
|
2982
|
-
throw PolyVValidationError.required("
|
|
3051
|
+
if (!options.type || options.type.trim() === "") {
|
|
3052
|
+
throw PolyVValidationError.required("type");
|
|
3053
|
+
}
|
|
3054
|
+
const params = { channelId, type: options.type };
|
|
3055
|
+
if (options.fromStartStop !== void 0) {
|
|
3056
|
+
params.fromStartStop = options.fromStartStop;
|
|
2983
3057
|
}
|
|
2984
3058
|
await this.client.httpClient.post(
|
|
2985
3059
|
"/live/v3/channel/record/add-breakpoint",
|
|
2986
3060
|
null,
|
|
2987
|
-
{ params
|
|
3061
|
+
{ params }
|
|
2988
3062
|
);
|
|
2989
3063
|
return true;
|
|
2990
3064
|
}
|
|
@@ -5959,8 +6033,25 @@ var ChannelService = class {
|
|
|
5959
6033
|
return response;
|
|
5960
6034
|
}
|
|
5961
6035
|
};
|
|
5962
|
-
|
|
5963
|
-
|
|
6036
|
+
var APICHAT_USERLIST_SIGN_SECRET = "polyvChatSignForExternal";
|
|
6037
|
+
function buildChatUserListSign(params) {
|
|
6038
|
+
let content = APICHAT_USERLIST_SIGN_SECRET;
|
|
6039
|
+
for (const key of Object.keys(params).sort()) {
|
|
6040
|
+
content += key + params[key];
|
|
6041
|
+
}
|
|
6042
|
+
content += APICHAT_USERLIST_SIGN_SECRET;
|
|
6043
|
+
return crypto.createHash("md5").update(content, "utf8").digest("hex").toUpperCase();
|
|
6044
|
+
}
|
|
6045
|
+
function decryptChatUserList(encryptedHex, sign) {
|
|
6046
|
+
const key = Buffer.from(sign.slice(0, 16), "utf8");
|
|
6047
|
+
const decipher = crypto.createDecipheriv("aes-128-cbc", key, key);
|
|
6048
|
+
const decrypted = Buffer.concat([
|
|
6049
|
+
decipher.update(Buffer.from(encryptedHex, "hex")),
|
|
6050
|
+
decipher.final()
|
|
6051
|
+
]);
|
|
6052
|
+
const json = Buffer.from(decrypted.toString("utf8"), "base64").toString("utf8");
|
|
6053
|
+
return JSON.parse(json);
|
|
6054
|
+
}
|
|
5964
6055
|
var ChatService = class {
|
|
5965
6056
|
client;
|
|
5966
6057
|
/**
|
|
@@ -6056,9 +6147,17 @@ var ChatService = class {
|
|
|
6056
6147
|
* ```
|
|
6057
6148
|
*/
|
|
6058
6149
|
async sendChat(params) {
|
|
6150
|
+
const encodedContent = typeof params.content === "string" ? Buffer.from(params.content, "utf8").toString("base64url") : params.content;
|
|
6059
6151
|
const response = await this.client.httpClient.post(
|
|
6060
6152
|
`/live/v1/channelSetting/${params.channelId}/send-chat`,
|
|
6061
|
-
|
|
6153
|
+
null,
|
|
6154
|
+
{
|
|
6155
|
+
params: {
|
|
6156
|
+
userId: params.userId,
|
|
6157
|
+
content: encodedContent,
|
|
6158
|
+
imgUrl: params.imgUrl
|
|
6159
|
+
}
|
|
6160
|
+
}
|
|
6062
6161
|
);
|
|
6063
6162
|
return response;
|
|
6064
6163
|
}
|
|
@@ -6350,11 +6449,27 @@ var ChatService = class {
|
|
|
6350
6449
|
if (params.len !== void 0 && (params.len < 1 || params.len > 1e3)) {
|
|
6351
6450
|
throw new PolyVValidationError("len must be between 1 and 1000");
|
|
6352
6451
|
}
|
|
6353
|
-
const
|
|
6452
|
+
const query = {
|
|
6453
|
+
roomId: params.roomId,
|
|
6454
|
+
page: String(params.page ?? 1),
|
|
6455
|
+
len: String(params.len ?? 100),
|
|
6456
|
+
hide: "0",
|
|
6457
|
+
toGetSubRooms: String(params.toGetSubRooms ?? false)
|
|
6458
|
+
};
|
|
6459
|
+
const sign = buildChatUserListSign(query);
|
|
6460
|
+
const response = await axios2__default.default.get(
|
|
6354
6461
|
"https://apichat.polyv.net/front/userlistExternal",
|
|
6355
|
-
{
|
|
6462
|
+
{
|
|
6463
|
+
params: { ...query, sign },
|
|
6464
|
+
responseType: "text",
|
|
6465
|
+
transformResponse: [(data) => data]
|
|
6466
|
+
}
|
|
6356
6467
|
);
|
|
6357
|
-
|
|
6468
|
+
const body = typeof response.data === "string" ? response.data.trim() : "";
|
|
6469
|
+
if (!body) {
|
|
6470
|
+
return { count: 0, userlist: [] };
|
|
6471
|
+
}
|
|
6472
|
+
return decryptChatUserList(body, sign);
|
|
6358
6473
|
}
|
|
6359
6474
|
/**
|
|
6360
6475
|
* updateAdminInfo - 更新管理员信息
|
|
@@ -6369,7 +6484,7 @@ var ChatService = class {
|
|
|
6369
6484
|
* channelId: '123456',
|
|
6370
6485
|
* nickname: '管理员',
|
|
6371
6486
|
* actor: '管理员1',
|
|
6372
|
-
* avatar:
|
|
6487
|
+
* avatar: avatarFile,
|
|
6373
6488
|
* });
|
|
6374
6489
|
* console.log(result.data);
|
|
6375
6490
|
* ```
|
|
@@ -6384,16 +6499,39 @@ var ChatService = class {
|
|
|
6384
6499
|
if (!params.actor) {
|
|
6385
6500
|
throw new PolyVValidationError("actor is required");
|
|
6386
6501
|
}
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6502
|
+
if (!params.avatar) {
|
|
6503
|
+
throw new PolyVValidationError("avatar is required");
|
|
6504
|
+
}
|
|
6505
|
+
const timestamp = Date.now();
|
|
6506
|
+
const { sign } = generateSignature(
|
|
6507
|
+
{
|
|
6508
|
+
appId: this.client.config.appId,
|
|
6509
|
+
timestamp,
|
|
6510
|
+
nickname: params.nickname,
|
|
6511
|
+
actor: params.actor
|
|
6512
|
+
},
|
|
6513
|
+
{ appSecret: this.client.config.appSecret }
|
|
6514
|
+
);
|
|
6515
|
+
const formData = new FormData();
|
|
6516
|
+
formData.append("appId", this.client.config.appId);
|
|
6517
|
+
formData.append("timestamp", String(timestamp));
|
|
6518
|
+
formData.append("sign", sign);
|
|
6519
|
+
formData.append("nickname", params.nickname);
|
|
6520
|
+
formData.append("actor", params.actor);
|
|
6521
|
+
if (params.avatar instanceof Blob) {
|
|
6522
|
+
formData.append("avatar", params.avatar, params.avatar.name || "avatar.png");
|
|
6523
|
+
} else {
|
|
6524
|
+
formData.append("avatar", new Blob([params.avatar]), "avatar.png");
|
|
6393
6525
|
}
|
|
6394
6526
|
const response = await this.client.httpClient.post(
|
|
6395
6527
|
`/live/v2/channelSetting/${params.channelId}/set-chat-admin`,
|
|
6396
|
-
|
|
6528
|
+
formData,
|
|
6529
|
+
{
|
|
6530
|
+
headers: {
|
|
6531
|
+
"Content-Type": "multipart/form-data",
|
|
6532
|
+
"X-Skip-Auth": "true"
|
|
6533
|
+
}
|
|
6534
|
+
}
|
|
6397
6535
|
);
|
|
6398
6536
|
return response;
|
|
6399
6537
|
}
|
|
@@ -7319,10 +7457,19 @@ var LiveInteractionService = class {
|
|
|
7319
7457
|
this.validateRequiredString(params.lotteryId, "lotteryId");
|
|
7320
7458
|
this.validateRequiredString(params.winnerCode, "winnerCode");
|
|
7321
7459
|
this.validateRequiredString(params.viewerId, "viewerId");
|
|
7460
|
+
const body = {
|
|
7461
|
+
channelId: params.channelId,
|
|
7462
|
+
lotteryId: params.lotteryId,
|
|
7463
|
+
winnerCode: params.winnerCode,
|
|
7464
|
+
viewerId: params.viewerId
|
|
7465
|
+
};
|
|
7466
|
+
if (params.receiveInfo !== void 0) {
|
|
7467
|
+
body.receiveInfo = JSON.stringify(params.receiveInfo);
|
|
7468
|
+
}
|
|
7322
7469
|
const response = await this.client.httpClient.post(
|
|
7323
7470
|
"/live/v4/channel/lottery/add-receive-info",
|
|
7324
|
-
|
|
7325
|
-
{ params: this.compactParams(params) }
|
|
7471
|
+
body,
|
|
7472
|
+
{ params: this.compactParams({ channelId: params.channelId }) }
|
|
7326
7473
|
);
|
|
7327
7474
|
return response;
|
|
7328
7475
|
}
|
|
@@ -7593,26 +7740,26 @@ var AccountService = class {
|
|
|
7593
7740
|
return { success: response };
|
|
7594
7741
|
}
|
|
7595
7742
|
/**
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7743
|
+
* Update category rank (sort order)
|
|
7744
|
+
*
|
|
7745
|
+
* @param params - Update parameters
|
|
7746
|
+
* @returns Update result
|
|
7747
|
+
*
|
|
7748
|
+
* @example
|
|
7749
|
+
* ```typescript
|
|
7750
|
+
* const result = await client.account.updateCategoryRank({
|
|
7751
|
+
* categoryId: 12345,
|
|
7752
|
+
* afterCategoryId: 67890,
|
|
7753
|
+
* });
|
|
7754
|
+
* console.log(result.success);
|
|
7755
|
+
* ```
|
|
7756
|
+
*/
|
|
7610
7757
|
async updateCategoryRank(params) {
|
|
7611
7758
|
if (!params.categoryId || params.categoryId <= 0) {
|
|
7612
7759
|
throw new PolyVValidationError("categoryId must be a positive number");
|
|
7613
7760
|
}
|
|
7614
|
-
if (params.
|
|
7615
|
-
throw new PolyVValidationError("
|
|
7761
|
+
if (params.afterCategoryId === void 0 || params.afterCategoryId === null) {
|
|
7762
|
+
throw new PolyVValidationError("afterCategoryId is required");
|
|
7616
7763
|
}
|
|
7617
7764
|
const response = await this.client.httpClient.post(
|
|
7618
7765
|
"/live/v3/user/category/update-rank",
|
|
@@ -8280,10 +8427,29 @@ var WebService = class {
|
|
|
8280
8427
|
if (!params.imgfile) {
|
|
8281
8428
|
throw new PolyVValidationError("imgfile is required");
|
|
8282
8429
|
}
|
|
8430
|
+
const timestamp = Date.now();
|
|
8431
|
+
const { sign } = generateSignature(
|
|
8432
|
+
{ appId: this.client.config.appId, timestamp },
|
|
8433
|
+
{ appSecret: this.client.config.appSecret }
|
|
8434
|
+
);
|
|
8435
|
+
const formData = new FormData();
|
|
8436
|
+
formData.append("appId", this.client.config.appId);
|
|
8437
|
+
formData.append("timestamp", String(timestamp));
|
|
8438
|
+
formData.append("sign", sign);
|
|
8439
|
+
if (params.imgfile instanceof Blob) {
|
|
8440
|
+
formData.append("imgfile", params.imgfile, params.imgfile.name || "logo.png");
|
|
8441
|
+
} else {
|
|
8442
|
+
formData.append("imgfile", params.imgfile);
|
|
8443
|
+
}
|
|
8283
8444
|
const response = await this.client.httpClient.post(
|
|
8284
8445
|
`/live/v2/channelSetting/${params.channelId}/setCoverImg`,
|
|
8285
|
-
|
|
8286
|
-
{
|
|
8446
|
+
formData,
|
|
8447
|
+
{
|
|
8448
|
+
headers: {
|
|
8449
|
+
"Content-Type": "multipart/form-data",
|
|
8450
|
+
"X-Skip-Auth": "true"
|
|
8451
|
+
}
|
|
8452
|
+
}
|
|
8287
8453
|
);
|
|
8288
8454
|
return response;
|
|
8289
8455
|
}
|
|
@@ -8833,18 +8999,20 @@ var WebService = class {
|
|
|
8833
8999
|
if (params.enabled !== void 0 && !["Y", "N"].includes(params.enabled)) {
|
|
8834
9000
|
throw new PolyVValidationError("enabled must be Y or N");
|
|
8835
9001
|
}
|
|
9002
|
+
const apiParams = {};
|
|
9003
|
+
if (params.channelId) {
|
|
9004
|
+
apiParams.channelId = params.channelId;
|
|
9005
|
+
}
|
|
8836
9006
|
const body = {
|
|
8837
9007
|
goods: params.goods
|
|
8838
9008
|
};
|
|
8839
|
-
if (params.channelId) {
|
|
8840
|
-
body.channelId = params.channelId;
|
|
8841
|
-
}
|
|
8842
9009
|
if (params.enabled) {
|
|
8843
9010
|
body.enabled = params.enabled;
|
|
8844
9011
|
}
|
|
8845
9012
|
const response = await this.client.httpClient.post(
|
|
8846
9013
|
"/live/v3/channel/donate/update-good",
|
|
8847
|
-
body
|
|
9014
|
+
body,
|
|
9015
|
+
{ params: apiParams }
|
|
8848
9016
|
);
|
|
8849
9017
|
return response;
|
|
8850
9018
|
}
|
|
@@ -8985,15 +9153,32 @@ var WebService = class {
|
|
|
8985
9153
|
if (params.files.length > 6) {
|
|
8986
9154
|
throw new PolyVValidationError("files must contain 1-6 files");
|
|
8987
9155
|
}
|
|
9156
|
+
const timestamp = Date.now();
|
|
9157
|
+
const { sign } = generateSignature(
|
|
9158
|
+
{ appId: this.client.config.appId, timestamp, type: params.type },
|
|
9159
|
+
{ appSecret: this.client.config.appSecret }
|
|
9160
|
+
);
|
|
8988
9161
|
const formData = new FormData();
|
|
9162
|
+
formData.append("appId", this.client.config.appId);
|
|
9163
|
+
formData.append("timestamp", String(timestamp));
|
|
9164
|
+
formData.append("sign", sign);
|
|
8989
9165
|
formData.append("type", params.type);
|
|
8990
9166
|
for (const file of params.files) {
|
|
8991
|
-
|
|
9167
|
+
if (file instanceof Blob) {
|
|
9168
|
+
formData.append("file", file, file.name || "image.png");
|
|
9169
|
+
} else {
|
|
9170
|
+
formData.append("file", file);
|
|
9171
|
+
}
|
|
8992
9172
|
}
|
|
8993
9173
|
const response = await this.client.httpClient.post(
|
|
8994
9174
|
"/live/v3/common/upload-image",
|
|
8995
9175
|
formData,
|
|
8996
|
-
{
|
|
9176
|
+
{
|
|
9177
|
+
headers: {
|
|
9178
|
+
"Content-Type": "multipart/form-data",
|
|
9179
|
+
"X-Skip-Auth": "true"
|
|
9180
|
+
}
|
|
9181
|
+
}
|
|
8997
9182
|
);
|
|
8998
9183
|
return response;
|
|
8999
9184
|
}
|
|
@@ -9321,16 +9506,38 @@ var WebService = class {
|
|
|
9321
9506
|
if (!params.file) {
|
|
9322
9507
|
throw new PolyVValidationError("file is required");
|
|
9323
9508
|
}
|
|
9509
|
+
const timestamp = Date.now();
|
|
9510
|
+
const signParams = {
|
|
9511
|
+
appId: this.client.config.appId,
|
|
9512
|
+
timestamp,
|
|
9513
|
+
rank: params.rank
|
|
9514
|
+
};
|
|
9515
|
+
if (params.channelId) {
|
|
9516
|
+
signParams.channelId = params.channelId;
|
|
9517
|
+
}
|
|
9518
|
+
const { sign } = generateSignature(signParams, { appSecret: this.client.config.appSecret });
|
|
9324
9519
|
const formData = new FormData();
|
|
9520
|
+
formData.append("appId", this.client.config.appId);
|
|
9521
|
+
formData.append("timestamp", String(timestamp));
|
|
9522
|
+
formData.append("sign", sign);
|
|
9325
9523
|
formData.append("rank", params.rank.toString());
|
|
9326
|
-
formData.append("file", params.file);
|
|
9327
9524
|
if (params.channelId) {
|
|
9328
9525
|
formData.append("channelId", params.channelId);
|
|
9329
9526
|
}
|
|
9527
|
+
if (params.file instanceof Blob) {
|
|
9528
|
+
formData.append("file", params.file, params.file.name || "whitelist.xls");
|
|
9529
|
+
} else {
|
|
9530
|
+
formData.append("file", params.file);
|
|
9531
|
+
}
|
|
9330
9532
|
const response = await this.client.httpClient.post(
|
|
9331
9533
|
"/live/v3/channel/auth/upload-white-list",
|
|
9332
9534
|
formData,
|
|
9333
|
-
{
|
|
9535
|
+
{
|
|
9536
|
+
headers: {
|
|
9537
|
+
"Content-Type": "multipart/form-data",
|
|
9538
|
+
"X-Skip-Auth": "true"
|
|
9539
|
+
}
|
|
9540
|
+
}
|
|
9334
9541
|
);
|
|
9335
9542
|
return response;
|
|
9336
9543
|
}
|
|
@@ -9487,15 +9694,19 @@ var WebService = class {
|
|
|
9487
9694
|
*
|
|
9488
9695
|
* @example
|
|
9489
9696
|
* ```typescript
|
|
9490
|
-
* const result = await client.web.getRecordField({ channelId: '123456' });
|
|
9697
|
+
* const result = await client.web.getRecordField({ channelId: '123456', rank: 1 });
|
|
9491
9698
|
* console.log(result.infoFields);
|
|
9492
9699
|
* ```
|
|
9493
9700
|
*/
|
|
9494
9701
|
async getRecordField(params) {
|
|
9495
9702
|
this.validateChannelId(params.channelId);
|
|
9703
|
+
const rank = params.rank ?? 1;
|
|
9704
|
+
if (rank !== 1 && rank !== 2) {
|
|
9705
|
+
throw new PolyVValidationError("rank must be 1 (primary) or 2 (secondary)");
|
|
9706
|
+
}
|
|
9496
9707
|
const response = await this.client.httpClient.get(
|
|
9497
9708
|
"/live/v3/channel/auth/get-record-field",
|
|
9498
|
-
{ params: { channelId: params.channelId } }
|
|
9709
|
+
{ params: { channelId: params.channelId, rank } }
|
|
9499
9710
|
);
|
|
9500
9711
|
return response;
|
|
9501
9712
|
}
|
|
@@ -9568,9 +9779,13 @@ var WebService = class {
|
|
|
9568
9779
|
*/
|
|
9569
9780
|
async downloadRecordInfo(params) {
|
|
9570
9781
|
this.validateChannelId(params.channelId);
|
|
9782
|
+
const rank = params.rank ?? 1;
|
|
9783
|
+
if (rank !== 1 && rank !== 2) {
|
|
9784
|
+
throw new PolyVValidationError("rank must be 1 (primary) or 2 (secondary)");
|
|
9785
|
+
}
|
|
9571
9786
|
const response = await this.client.httpClient.get(
|
|
9572
9787
|
"/live/v3/channel/auth/download-record-info",
|
|
9573
|
-
{ params: { channelId: params.channelId }, responseType: "arraybuffer" }
|
|
9788
|
+
{ params: { channelId: params.channelId, rank }, responseType: "arraybuffer" }
|
|
9574
9789
|
);
|
|
9575
9790
|
return response;
|
|
9576
9791
|
}
|
|
@@ -10934,15 +11149,15 @@ var PlayerService = class {
|
|
|
10934
11149
|
if (params.marqueeRestrict === "Y" && !params.url) {
|
|
10935
11150
|
throw new PolyVValidationError('url is required when marqueeRestrict is "Y"');
|
|
10936
11151
|
}
|
|
10937
|
-
const
|
|
11152
|
+
const queryParams = {
|
|
10938
11153
|
marqueeRestrict: params.marqueeRestrict
|
|
10939
11154
|
};
|
|
10940
11155
|
if (params.url !== void 0) {
|
|
10941
|
-
|
|
11156
|
+
queryParams.url = params.url;
|
|
10942
11157
|
}
|
|
10943
|
-
const response = await this.client.httpClient.
|
|
11158
|
+
const response = await this.client.httpClient.get(
|
|
10944
11159
|
`/live/v2/channelRestrict/${channelId}/set-diyurl-marquee`,
|
|
10945
|
-
|
|
11160
|
+
{ params: queryParams }
|
|
10946
11161
|
);
|
|
10947
11162
|
return response;
|
|
10948
11163
|
}
|
|
@@ -10961,7 +11176,7 @@ var PlayerService = class {
|
|
|
10961
11176
|
* ```typescript
|
|
10962
11177
|
* await client.player.updateHeadAdvert(123456, {
|
|
10963
11178
|
* headAdvertType: 'IMAGE',
|
|
10964
|
-
*
|
|
11179
|
+
* headAdvertMediaUrl: 'https://example.com/ad.jpg',
|
|
10965
11180
|
* });
|
|
10966
11181
|
* ```
|
|
10967
11182
|
*/
|
|
@@ -10971,33 +11186,32 @@ var PlayerService = class {
|
|
|
10971
11186
|
if (params.enabled !== void 0) {
|
|
10972
11187
|
this.validateYNValue(params.enabled, "enabled");
|
|
10973
11188
|
}
|
|
10974
|
-
const
|
|
10975
|
-
headAdvertType: params.headAdvertType
|
|
11189
|
+
const requestParams = {
|
|
11190
|
+
headAdvertType: String(params.headAdvertType).toLowerCase()
|
|
10976
11191
|
};
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
if (params.headAdvertFlv !== void 0) {
|
|
10981
|
-
body.headAdvertFlv = params.headAdvertFlv;
|
|
11192
|
+
const mediaUrl = params.headAdvertMediaUrl ?? params.headAdvertImage ?? params.headAdvertFlv;
|
|
11193
|
+
if (mediaUrl !== void 0) {
|
|
11194
|
+
requestParams.headAdvertMediaUrl = mediaUrl;
|
|
10982
11195
|
}
|
|
10983
11196
|
if (params.headAdvertHref !== void 0) {
|
|
10984
|
-
|
|
11197
|
+
requestParams.headAdvertHref = params.headAdvertHref;
|
|
10985
11198
|
}
|
|
10986
11199
|
if (params.headAdvertDuration !== void 0) {
|
|
10987
|
-
|
|
11200
|
+
requestParams.headAdvertDuration = params.headAdvertDuration;
|
|
10988
11201
|
}
|
|
10989
11202
|
if (params.headAdvertWidth !== void 0) {
|
|
10990
|
-
|
|
11203
|
+
requestParams.headAdvertWidth = params.headAdvertWidth;
|
|
10991
11204
|
}
|
|
10992
11205
|
if (params.headAdvertHeight !== void 0) {
|
|
10993
|
-
|
|
11206
|
+
requestParams.headAdvertHeight = params.headAdvertHeight;
|
|
10994
11207
|
}
|
|
10995
11208
|
if (params.enabled !== void 0) {
|
|
10996
|
-
|
|
11209
|
+
requestParams.enabled = params.enabled;
|
|
10997
11210
|
}
|
|
10998
11211
|
const response = await this.client.httpClient.post(
|
|
10999
11212
|
`/live/v2/channelAdvert/${channelId}/updateHead`,
|
|
11000
|
-
|
|
11213
|
+
null,
|
|
11214
|
+
{ params: requestParams }
|
|
11001
11215
|
);
|
|
11002
11216
|
return response;
|
|
11003
11217
|
}
|
|
@@ -11901,7 +12115,7 @@ var V4AiService = class {
|
|
|
11901
12115
|
}
|
|
11902
12116
|
await this.client.httpClient.post(
|
|
11903
12117
|
"/live/v4/ai/digital-human/set-organizations",
|
|
11904
|
-
params
|
|
12118
|
+
params.items
|
|
11905
12119
|
);
|
|
11906
12120
|
}
|
|
11907
12121
|
// ============================================
|
|
@@ -11949,7 +12163,7 @@ var V4AiService = class {
|
|
|
11949
12163
|
}
|
|
11950
12164
|
const response = await this.client.httpClient.get(
|
|
11951
12165
|
"/live/v4/ai/video-produce/get",
|
|
11952
|
-
{ params }
|
|
12166
|
+
{ params: { aiPPTVideoId: params.id } }
|
|
11953
12167
|
);
|
|
11954
12168
|
return response;
|
|
11955
12169
|
}
|
|
@@ -12013,7 +12227,7 @@ var V4AiService = class {
|
|
|
12013
12227
|
}
|
|
12014
12228
|
await this.client.httpClient.post(
|
|
12015
12229
|
"/live/v4/ai/video-produce/delete",
|
|
12016
|
-
params
|
|
12230
|
+
{ aiPPTVideoId: params.id }
|
|
12017
12231
|
);
|
|
12018
12232
|
}
|
|
12019
12233
|
/**
|
|
@@ -12238,7 +12452,7 @@ var V4RobotService = class {
|
|
|
12238
12452
|
}
|
|
12239
12453
|
const response = await this.client.httpClient.post(
|
|
12240
12454
|
"/live/v4/global/robot/save-batch",
|
|
12241
|
-
params
|
|
12455
|
+
params.robots
|
|
12242
12456
|
);
|
|
12243
12457
|
return response;
|
|
12244
12458
|
}
|
|
@@ -12974,9 +13188,11 @@ var V4ChannelService = class {
|
|
|
12974
13188
|
*/
|
|
12975
13189
|
async distributeCreateBatch(params) {
|
|
12976
13190
|
this.validateChannelId(params.channelId);
|
|
13191
|
+
const { channelId, distributes } = params;
|
|
12977
13192
|
await this.client.httpClient.post(
|
|
12978
13193
|
"/live/v4/channel/distribute/create-batch",
|
|
12979
|
-
|
|
13194
|
+
distributes,
|
|
13195
|
+
{ params: { channelId } }
|
|
12980
13196
|
);
|
|
12981
13197
|
}
|
|
12982
13198
|
/**
|
|
@@ -12986,9 +13202,11 @@ var V4ChannelService = class {
|
|
|
12986
13202
|
*/
|
|
12987
13203
|
async distributeUpdateBatch(params) {
|
|
12988
13204
|
this.validateChannelId(params.channelId);
|
|
13205
|
+
const { channelId, distributes } = params;
|
|
12989
13206
|
await this.client.httpClient.post(
|
|
12990
13207
|
"/live/v4/channel/distribute/update-batch",
|
|
12991
|
-
|
|
13208
|
+
distributes,
|
|
13209
|
+
{ params: { channelId } }
|
|
12992
13210
|
);
|
|
12993
13211
|
}
|
|
12994
13212
|
/**
|
|
@@ -13001,7 +13219,7 @@ var V4ChannelService = class {
|
|
|
13001
13219
|
await this.client.httpClient.post(
|
|
13002
13220
|
"/live/v4/channel/distribute/delete-batch",
|
|
13003
13221
|
null,
|
|
13004
|
-
{ params: { channelId: params.channelId,
|
|
13222
|
+
{ params: { channelId: params.channelId, distributeIds: params.ids.join(",") } }
|
|
13005
13223
|
);
|
|
13006
13224
|
}
|
|
13007
13225
|
/**
|
|
@@ -13025,10 +13243,11 @@ var V4ChannelService = class {
|
|
|
13025
13243
|
*/
|
|
13026
13244
|
async updateMasterSwitch(params) {
|
|
13027
13245
|
this.validateChannelId(params.channelId);
|
|
13246
|
+
const { channelId, enabled } = params;
|
|
13028
13247
|
await this.client.httpClient.post(
|
|
13029
13248
|
"/live/v4/channel/distribute/update-master-switch",
|
|
13030
13249
|
null,
|
|
13031
|
-
{ params }
|
|
13250
|
+
{ params: { channelId, distributeEnabled: enabled } }
|
|
13032
13251
|
);
|
|
13033
13252
|
}
|
|
13034
13253
|
/**
|
|
@@ -13038,10 +13257,11 @@ var V4ChannelService = class {
|
|
|
13038
13257
|
*/
|
|
13039
13258
|
async updateSwitch(params) {
|
|
13040
13259
|
this.validateChannelId(params.channelId);
|
|
13260
|
+
const { channelId, distributeId, enabled } = params;
|
|
13041
13261
|
await this.client.httpClient.post(
|
|
13042
13262
|
"/live/v4/channel/distribute/update-switch",
|
|
13043
13263
|
null,
|
|
13044
|
-
{ params }
|
|
13264
|
+
{ params: { channelId, distributeIds: String(distributeId), distributeEnabled: enabled } }
|
|
13045
13265
|
);
|
|
13046
13266
|
}
|
|
13047
13267
|
// ============================================
|
|
@@ -13298,29 +13518,56 @@ var V4ChannelService = class {
|
|
|
13298
13518
|
return response;
|
|
13299
13519
|
}
|
|
13300
13520
|
/**
|
|
13301
|
-
* Save interaction event
|
|
13521
|
+
* Save interaction event (create one or more interaction listener tasks).
|
|
13522
|
+
*
|
|
13523
|
+
* The body carries channelId/tasks/allDone (plus optional callbackUrl/payload);
|
|
13524
|
+
* only appId/timestamp are signed (query), the JSON body is unsigned.
|
|
13302
13525
|
*
|
|
13303
13526
|
* @param params - Save parameters
|
|
13304
13527
|
*/
|
|
13305
13528
|
async interactionEventSave(params) {
|
|
13306
13529
|
this.validateChannelId(params.channelId);
|
|
13307
|
-
|
|
13530
|
+
if (!Array.isArray(params.tasks) || params.tasks.length === 0) {
|
|
13531
|
+
throw new PolyVValidationError("tasks must be a non-empty array", "tasks");
|
|
13532
|
+
}
|
|
13533
|
+
if (params.allDone !== "Y" && params.allDone !== "N") {
|
|
13534
|
+
throw new PolyVValidationError("allDone must be 'Y' or 'N'", "allDone");
|
|
13535
|
+
}
|
|
13536
|
+
const body = {
|
|
13537
|
+
channelId: Number(params.channelId),
|
|
13538
|
+
tasks: params.tasks,
|
|
13539
|
+
allDone: params.allDone
|
|
13540
|
+
};
|
|
13541
|
+
if (params.callbackUrl !== void 0) body.callbackUrl = params.callbackUrl;
|
|
13542
|
+
if (params.payload !== void 0) body.payload = params.payload;
|
|
13543
|
+
const response = await this.client.httpClient.post(
|
|
13308
13544
|
"/live/v4/channel/interaction-event/save",
|
|
13309
|
-
|
|
13545
|
+
body
|
|
13310
13546
|
);
|
|
13547
|
+
return response;
|
|
13311
13548
|
}
|
|
13312
13549
|
/**
|
|
13313
|
-
* Delete interaction event
|
|
13550
|
+
* Delete interaction event.
|
|
13551
|
+
*
|
|
13552
|
+
* The body carries channelId + taskIds (pass the activityId when the activity
|
|
13553
|
+
* was saved with allDone=Y); only appId/timestamp are signed (query).
|
|
13314
13554
|
*
|
|
13315
13555
|
* @param params - Delete parameters
|
|
13316
13556
|
*/
|
|
13317
13557
|
async interactionEventDelete(params) {
|
|
13318
13558
|
this.validateChannelId(params.channelId);
|
|
13319
|
-
|
|
13559
|
+
if (!Array.isArray(params.taskIds) || params.taskIds.length === 0) {
|
|
13560
|
+
throw new PolyVValidationError("taskIds must be a non-empty array", "taskIds");
|
|
13561
|
+
}
|
|
13562
|
+
const body = {
|
|
13563
|
+
channelId: Number(params.channelId),
|
|
13564
|
+
taskIds: params.taskIds
|
|
13565
|
+
};
|
|
13566
|
+
const response = await this.client.httpClient.post(
|
|
13320
13567
|
"/live/v4/channel/interaction-event/delete",
|
|
13321
|
-
|
|
13322
|
-
{ params }
|
|
13568
|
+
body
|
|
13323
13569
|
);
|
|
13570
|
+
return response;
|
|
13324
13571
|
}
|
|
13325
13572
|
/**
|
|
13326
13573
|
* Create inviter
|
|
@@ -13944,7 +14191,8 @@ var V4ChannelService = class {
|
|
|
13944
14191
|
this.validateChannelId(params.channelId);
|
|
13945
14192
|
await this.client.httpClient.post(
|
|
13946
14193
|
"/live/v4/channel/role-config/update-by-role",
|
|
13947
|
-
params
|
|
14194
|
+
params.config,
|
|
14195
|
+
{ params: { channelId: params.channelId, role: params.role } }
|
|
13948
14196
|
);
|
|
13949
14197
|
}
|
|
13950
14198
|
/**
|
|
@@ -15008,10 +15256,19 @@ var V4ChannelService = class {
|
|
|
15008
15256
|
this.validateOptionalYn(params.aiKnowledgeQuizEnabled, "aiKnowledgeQuizEnabled");
|
|
15009
15257
|
this.validateOptionalYn(params.aiSummaryAuditEnabled, "aiSummaryAuditEnabled");
|
|
15010
15258
|
this.validateOptionalYn(params.syncToPlaybackDotEnabled, "syncToPlaybackDotEnabled");
|
|
15259
|
+
const body = { fileId: params.fileId };
|
|
15260
|
+
if (params.aiKnowledgeQuizEnabled !== void 0) {
|
|
15261
|
+
body.aiKnowledgeQuizEnabled = params.aiKnowledgeQuizEnabled;
|
|
15262
|
+
}
|
|
15263
|
+
if (params.aiSummaryAuditEnabled !== void 0) {
|
|
15264
|
+
body.aiSummaryAuditEnabled = params.aiSummaryAuditEnabled;
|
|
15265
|
+
}
|
|
15266
|
+
if (params.syncToPlaybackDotEnabled !== void 0) {
|
|
15267
|
+
body.syncToPlaybackDotEnabled = params.syncToPlaybackDotEnabled;
|
|
15268
|
+
}
|
|
15011
15269
|
const response = await this.client.httpClient.post(
|
|
15012
15270
|
"/live/v4/channel/record-file/subtitle/outline/create",
|
|
15013
|
-
|
|
15014
|
-
{ params }
|
|
15271
|
+
body
|
|
15015
15272
|
);
|
|
15016
15273
|
return response;
|
|
15017
15274
|
}
|
|
@@ -15038,8 +15295,7 @@ var V4ChannelService = class {
|
|
|
15038
15295
|
});
|
|
15039
15296
|
await this.client.httpClient.post(
|
|
15040
15297
|
"/live/v4/channel/record-file/subtitle/batch-publish",
|
|
15041
|
-
|
|
15042
|
-
{ params }
|
|
15298
|
+
params.subtitles
|
|
15043
15299
|
);
|
|
15044
15300
|
}
|
|
15045
15301
|
/**
|
|
@@ -15928,14 +16184,16 @@ var V4UserService = class {
|
|
|
15928
16184
|
if (params.childEmail) {
|
|
15929
16185
|
await this.client.httpClient.post(
|
|
15930
16186
|
"/live/v4/user/children/delete",
|
|
15931
|
-
|
|
16187
|
+
void 0,
|
|
16188
|
+
{ params: { childEmail: params.childEmail } }
|
|
15932
16189
|
);
|
|
15933
16190
|
return;
|
|
15934
16191
|
}
|
|
15935
16192
|
if (params.childEmails && params.childEmails.length > 0) {
|
|
15936
16193
|
await this.client.httpClient.post(
|
|
15937
16194
|
"/live/v4/user/children/delete",
|
|
15938
|
-
|
|
16195
|
+
void 0,
|
|
16196
|
+
{ params: { childEmails: params.childEmails } }
|
|
15939
16197
|
);
|
|
15940
16198
|
return;
|
|
15941
16199
|
}
|
|
@@ -16056,7 +16314,8 @@ var V4UserService = class {
|
|
|
16056
16314
|
this.validateRequiredNumber(params.organizationId, "organizationId");
|
|
16057
16315
|
await this.client.httpClient.post(
|
|
16058
16316
|
"/live/v4/user/organization/delete",
|
|
16059
|
-
|
|
16317
|
+
void 0,
|
|
16318
|
+
{ params: { organizationId: params.organizationId } }
|
|
16060
16319
|
);
|
|
16061
16320
|
}
|
|
16062
16321
|
// ============================================
|
|
@@ -17277,7 +17536,8 @@ var V4UserService = class {
|
|
|
17277
17536
|
this.validateYnValue(params.enabled, "enabled");
|
|
17278
17537
|
await this.client.httpClient.post(
|
|
17279
17538
|
"/live/v4/user/global-setting/pv-show/update",
|
|
17280
|
-
|
|
17539
|
+
void 0,
|
|
17540
|
+
{ params: { enabled: params.enabled } }
|
|
17281
17541
|
);
|
|
17282
17542
|
}
|
|
17283
17543
|
// ============================================
|
|
@@ -17741,14 +18001,16 @@ var V4GlobalService = class {
|
|
|
17741
18001
|
* ```
|
|
17742
18002
|
*/
|
|
17743
18003
|
async updatePageSetting(params) {
|
|
17744
|
-
const queryParams =
|
|
18004
|
+
const queryParams = {};
|
|
17745
18005
|
for (const [key, value] of Object.entries(params)) {
|
|
17746
18006
|
if (value !== void 0) {
|
|
17747
|
-
queryParams
|
|
18007
|
+
queryParams[key] = String(value);
|
|
17748
18008
|
}
|
|
17749
18009
|
}
|
|
17750
18010
|
await this.client.httpClient.post(
|
|
17751
|
-
|
|
18011
|
+
"/live/v4/user/template/page-setting/update",
|
|
18012
|
+
void 0,
|
|
18013
|
+
{ params: queryParams }
|
|
17752
18014
|
);
|
|
17753
18015
|
}
|
|
17754
18016
|
};
|
|
@@ -18631,7 +18893,9 @@ var V4WebAppService = class {
|
|
|
18631
18893
|
throw new PolyVValidationError("roleId is required", "roleId");
|
|
18632
18894
|
}
|
|
18633
18895
|
await this.client.httpClient.post(
|
|
18634
|
-
|
|
18896
|
+
"/live/v4/user/webapp-role/delete",
|
|
18897
|
+
void 0,
|
|
18898
|
+
{ params: { id: roleId } }
|
|
18635
18899
|
);
|
|
18636
18900
|
}
|
|
18637
18901
|
};
|
|
@@ -19123,31 +19387,37 @@ var StatisticsService = class {
|
|
|
19123
19387
|
"/live/v3/channel/session/stats/export",
|
|
19124
19388
|
{ params }
|
|
19125
19389
|
);
|
|
19126
|
-
if (
|
|
19127
|
-
|
|
19128
|
-
|
|
19129
|
-
const innerData = responseData.data;
|
|
19130
|
-
if (innerData.code && innerData.code !== 200) {
|
|
19131
|
-
throw new Error(innerData.message || "API Error");
|
|
19132
|
-
}
|
|
19133
|
-
if ("downloadUrl" in innerData) {
|
|
19134
|
-
return innerData;
|
|
19135
|
-
}
|
|
19136
|
-
if (typeof innerData.data === "string" && innerData.data) {
|
|
19137
|
-
return { downloadUrl: innerData.data };
|
|
19138
|
-
}
|
|
19390
|
+
if (typeof response === "string") {
|
|
19391
|
+
if (response.trim() === "") {
|
|
19392
|
+
throw new Error("\u573A\u6B21\u62A5\u8868\u5BFC\u51FA\u5931\u8D25\uFF1A\u62A5\u8868\u5C1A\u672A\u751F\u6210\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
|
19139
19393
|
}
|
|
19394
|
+
return { downloadUrl: response };
|
|
19140
19395
|
}
|
|
19141
|
-
if (response && typeof response === "object"
|
|
19142
|
-
const
|
|
19143
|
-
if (
|
|
19144
|
-
|
|
19396
|
+
if (response && typeof response === "object") {
|
|
19397
|
+
const obj = response;
|
|
19398
|
+
if (typeof obj["downloadUrl"] === "string" && obj["downloadUrl"]) {
|
|
19399
|
+
return { downloadUrl: obj["downloadUrl"] };
|
|
19400
|
+
}
|
|
19401
|
+
if (obj["code"] !== void 0 && obj["code"] !== 200) {
|
|
19402
|
+
throw new Error(String(obj["message"] || "\u573A\u6B21\u62A5\u8868\u5BFC\u51FA\u5931\u8D25"));
|
|
19403
|
+
}
|
|
19404
|
+
if (typeof obj["data"] === "string" && obj["data"]) {
|
|
19405
|
+
return { downloadUrl: obj["data"] };
|
|
19145
19406
|
}
|
|
19146
|
-
|
|
19147
|
-
|
|
19407
|
+
const inner = obj["data"];
|
|
19408
|
+
if (inner && typeof inner === "object") {
|
|
19409
|
+
if (inner["code"] !== void 0 && inner["code"] !== 200) {
|
|
19410
|
+
throw new Error(String(inner["message"] || "\u573A\u6B21\u62A5\u8868\u5BFC\u51FA\u5931\u8D25"));
|
|
19411
|
+
}
|
|
19412
|
+
if (typeof inner["downloadUrl"] === "string" && inner["downloadUrl"]) {
|
|
19413
|
+
return { downloadUrl: inner["downloadUrl"] };
|
|
19414
|
+
}
|
|
19415
|
+
if (typeof inner["data"] === "string" && inner["data"]) {
|
|
19416
|
+
return { downloadUrl: inner["data"] };
|
|
19417
|
+
}
|
|
19148
19418
|
}
|
|
19149
19419
|
}
|
|
19150
|
-
|
|
19420
|
+
throw new Error("\u573A\u6B21\u62A5\u8868\u5BFC\u51FA\u5931\u8D25\uFF1A\u63A5\u53E3\u672A\u8FD4\u56DE\u4E0B\u8F7D\u94FE\u63A5\uFF0C\u62A5\u8868\u53EF\u80FD\u5C1A\u672A\u751F\u6210\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
|
19151
19421
|
}
|
|
19152
19422
|
/**
|
|
19153
19423
|
* Validate parameters for exportSessionStats
|
|
@@ -19324,7 +19594,7 @@ var PolyVClient = class {
|
|
|
19324
19594
|
* Create and configure the Axios HTTP client with interceptors
|
|
19325
19595
|
*/
|
|
19326
19596
|
createHttpClient() {
|
|
19327
|
-
const client =
|
|
19597
|
+
const client = axios2__default.default.create({
|
|
19328
19598
|
baseURL: this.config.baseUrl,
|
|
19329
19599
|
timeout: this.config.timeout,
|
|
19330
19600
|
headers: this.config.headers
|
|
@@ -19387,12 +19657,12 @@ var PolyVClient = class {
|
|
|
19387
19657
|
* Transform Axios errors to PolyVAPIError
|
|
19388
19658
|
*/
|
|
19389
19659
|
transformAxiosError(error) {
|
|
19390
|
-
if (
|
|
19660
|
+
if (axios2__default.default.isCancel(error)) {
|
|
19391
19661
|
return new PolyVAPIError("Request cancelled", 0, {
|
|
19392
19662
|
code: "REQUEST_CANCELLED"
|
|
19393
19663
|
});
|
|
19394
19664
|
}
|
|
19395
|
-
if (
|
|
19665
|
+
if (axios2__default.default.isAxiosError(error)) {
|
|
19396
19666
|
if (error.response) {
|
|
19397
19667
|
const { status, data } = error.response;
|
|
19398
19668
|
return new PolyVAPIError(
|