polyv-live-api-sdk 1.0.3 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5285,6 +5285,9 @@ var LiveInteractionService = class {
5285
5285
  * ```
5286
5286
  */
5287
5287
  async getCheckinList(params) {
5288
+ if (!params.channelId) {
5289
+ throw new Error("channelId is required");
5290
+ }
5288
5291
  const response = await this.client.httpClient.get(
5289
5292
  "/live/v2/chat/getCheckinList",
5290
5293
  { params }
@@ -7619,7 +7622,8 @@ var WebService = class {
7619
7622
  * ```typescript
7620
7623
  * const result = await client.web.updateWhiteList({
7621
7624
  * rank: 1,
7622
- * code: '13800138000',
7625
+ * oldCode: '13800138000',
7626
+ * code: '13900139000',
7623
7627
  * name: 'Updated Name',
7624
7628
  * channelId: '123456',
7625
7629
  * });
@@ -7629,6 +7633,9 @@ var WebService = class {
7629
7633
  if (params.rank !== 1 && params.rank !== 2) {
7630
7634
  throw new PolyVValidationError("rank must be 1 or 2");
7631
7635
  }
7636
+ if (!params.oldCode || params.oldCode.trim() === "") {
7637
+ throw new PolyVValidationError("oldCode is required");
7638
+ }
7632
7639
  if (!params.code || params.code.trim() === "") {
7633
7640
  throw new PolyVValidationError("code is required");
7634
7641
  }
@@ -7640,6 +7647,7 @@ var WebService = class {
7640
7647
  }
7641
7648
  const apiParams = {
7642
7649
  rank: params.rank,
7650
+ oldCode: params.oldCode,
7643
7651
  code: params.code
7644
7652
  };
7645
7653
  if (params.name) {
@@ -7664,24 +7672,39 @@ var WebService = class {
7664
7672
  *
7665
7673
  * @example
7666
7674
  * ```typescript
7675
+ * // Delete specific codes
7667
7676
  * const result = await client.web.deleteWhiteList({
7668
7677
  * rank: 1,
7678
+ * isClear: 'N',
7669
7679
  * codes: '13800138000,13800138001',
7670
7680
  * channelId: '123456',
7671
7681
  * });
7682
+ *
7683
+ * // Clear all
7684
+ * const result = await client.web.deleteWhiteList({
7685
+ * rank: 1,
7686
+ * isClear: 'Y',
7687
+ * channelId: '123456',
7688
+ * });
7672
7689
  * ```
7673
7690
  */
7674
7691
  async deleteWhiteList(params) {
7675
7692
  if (params.rank !== 1 && params.rank !== 2) {
7676
7693
  throw new PolyVValidationError("rank must be 1 or 2");
7677
7694
  }
7678
- if (!params.codes || params.codes.trim() === "") {
7679
- throw new PolyVValidationError("codes is required");
7695
+ if (!params.isClear) {
7696
+ throw new PolyVValidationError("isClear is required");
7697
+ }
7698
+ if (params.isClear === "N" && (!params.codes || params.codes.trim() === "")) {
7699
+ throw new PolyVValidationError("codes is required when isClear=N");
7680
7700
  }
7681
7701
  const apiParams = {
7682
7702
  rank: params.rank,
7683
- codes: params.codes
7703
+ isClear: params.isClear
7684
7704
  };
7705
+ if (params.codes) {
7706
+ apiParams.code = params.codes;
7707
+ }
7685
7708
  if (params.channelId) {
7686
7709
  apiParams.channelId = params.channelId;
7687
7710
  }
@@ -13119,7 +13142,7 @@ var V4UserService = class {
13119
13142
  */
13120
13143
  async listViewerLabels() {
13121
13144
  const response = await this.client.httpClient.get(
13122
- "/live/v4/user/viewer-record/label/list",
13145
+ "/live/v4/user/viewer-label/list",
13123
13146
  {}
13124
13147
  );
13125
13148
  return response;
@@ -13199,8 +13222,11 @@ var V4UserService = class {
13199
13222
  this.validateRequiredString(params.viewerUnionId, "viewerUnionId");
13200
13223
  this.validateRequiredNumber(params.labelId, "labelId");
13201
13224
  await this.client.httpClient.post(
13202
- "/live/v4/user/viewer-record/label/add",
13203
- params
13225
+ "/live/v4/user/viewer-label/add-viewers-label",
13226
+ {
13227
+ viewerUnionIds: [params.viewerUnionId],
13228
+ labelIds: [params.labelId]
13229
+ }
13204
13230
  );
13205
13231
  }
13206
13232
  /**
@@ -13220,8 +13246,11 @@ var V4UserService = class {
13220
13246
  this.validateRequiredString(params.viewerUnionId, "viewerUnionId");
13221
13247
  this.validateRequiredNumber(params.labelId, "labelId");
13222
13248
  await this.client.httpClient.post(
13223
- "/live/v4/user/viewer-record/label/delete-ref",
13224
- params
13249
+ "/live/v4/user/viewer-label/remove-viewers-label",
13250
+ {
13251
+ viewerUnionIds: [params.viewerUnionId],
13252
+ labelIds: [params.labelId]
13253
+ }
13225
13254
  );
13226
13255
  }
13227
13256
  // ============================================
@@ -14235,6 +14264,47 @@ var V4UserService = class {
14235
14264
  return response;
14236
14265
  }
14237
14266
  // ============================================
14267
+ // Story 13-3: Global Channel Settings APIs
14268
+ // ============================================
14269
+ /**
14270
+ * Get global channel settings
14271
+ *
14272
+ * @returns Global channel settings
14273
+ *
14274
+ * @example
14275
+ * ```typescript
14276
+ * const settings = await client.v4User.getGlobalChannelSettings();
14277
+ * ```
14278
+ */
14279
+ async getGlobalChannelSettings() {
14280
+ const response = await this.client.httpClient.get(
14281
+ "/live/v4/user/global-setting/switch/get",
14282
+ {}
14283
+ );
14284
+ return response;
14285
+ }
14286
+ /**
14287
+ * Update global channel settings
14288
+ *
14289
+ * @param params - Update parameters
14290
+ *
14291
+ * @example
14292
+ * ```typescript
14293
+ * await client.v4User.updateGlobalChannelSettings({
14294
+ * channelConcurrencesEnabled: 'Y',
14295
+ * donateEnabled: 'N',
14296
+ * coverImgType: 'contain',
14297
+ * });
14298
+ * ```
14299
+ */
14300
+ async updateGlobalChannelSettings(params) {
14301
+ this.validateGlobalSettingsParams(params);
14302
+ await this.client.httpClient.post(
14303
+ "/live/v4/user/global-setting/switch/update",
14304
+ params
14305
+ );
14306
+ }
14307
+ // ============================================
14238
14308
  // Private Validation Helpers
14239
14309
  // ============================================
14240
14310
  /**
@@ -14264,6 +14334,31 @@ var V4UserService = class {
14264
14334
  throw new PolyVValidationError(`${fieldName} is required`, fieldName, value);
14265
14335
  }
14266
14336
  }
14337
+ /**
14338
+ * Validate global settings update parameters
14339
+ */
14340
+ validateGlobalSettingsParams(params) {
14341
+ const booleanFields = [
14342
+ "channelConcurrencesEnabled",
14343
+ "timelyConvertEnabled",
14344
+ "donateEnabled",
14345
+ "rebirthAutoUploadEnabled",
14346
+ "rebirthAutoConvertEnabled",
14347
+ "pptCoveredEnabled",
14348
+ "testModeButtonEnabled"
14349
+ ];
14350
+ for (const field of booleanFields) {
14351
+ const value = params[field];
14352
+ if (value !== void 0 && value !== "Y" && value !== "N") {
14353
+ throw new PolyVValidationError(`${field} must be 'Y' or 'N'`, field, value);
14354
+ }
14355
+ }
14356
+ if (params.coverImgType !== void 0) {
14357
+ if (params.coverImgType !== "contain" && params.coverImgType !== "cover") {
14358
+ throw new PolyVValidationError("coverImgType must be 'contain' or 'cover'", "coverImgType", params.coverImgType);
14359
+ }
14360
+ }
14361
+ }
14267
14362
  };
14268
14363
 
14269
14364
  // src/services/v4/global.service.ts