polyv-live-api-sdk 1.0.8 → 1.0.9

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 CHANGED
@@ -4356,6 +4356,74 @@ var ChannelService = class {
4356
4356
  );
4357
4357
  return response;
4358
4358
  }
4359
+ /**
4360
+ * Update channel product library enabled status
4361
+ *
4362
+ * Toggles the channel product library on or off.
4363
+ * All params (channelId, enabled, appId, timestamp) participate in signature.
4364
+ *
4365
+ * @param params - Parameters including channelId and enabled (Y/N)
4366
+ * @returns true if update was successful
4367
+ * @throws PolyVValidationError if required parameters are missing
4368
+ *
4369
+ * @example
4370
+ * ```typescript
4371
+ * await channelService.updateChannelProductEnabled({
4372
+ * channelId: 'ch123456',
4373
+ * enabled: 'Y',
4374
+ * });
4375
+ * ```
4376
+ */
4377
+ async updateChannelProductEnabled(params) {
4378
+ if (!params.channelId || params.channelId.trim() === "") {
4379
+ throw PolyVValidationError.required("channelId");
4380
+ }
4381
+ if (!params.enabled || params.enabled !== "Y" && params.enabled !== "N") {
4382
+ throw PolyVValidationError.required("enabled");
4383
+ }
4384
+ const response = await this.client.httpClient.post(
4385
+ "/live/v3/channel/product/update-enabled",
4386
+ null,
4387
+ { params: { channelId: params.channelId, enabled: params.enabled } }
4388
+ );
4389
+ return response;
4390
+ }
4391
+ /**
4392
+ * Update channel configuration
4393
+ *
4394
+ * Updates a channel config key-value pair via /v3/channel/config/update.
4395
+ * Common keys include: couponEnabled, productEnabled, etc.
4396
+ *
4397
+ * @param params - Parameters including channelId, key, and value
4398
+ * @returns true if update was successful
4399
+ * @throws PolyVValidationError if required parameters are missing
4400
+ *
4401
+ * @example
4402
+ * ```typescript
4403
+ * await channelService.updateChannelConfig({
4404
+ * channelId: 'ch123456',
4405
+ * key: 'couponEnabled',
4406
+ * value: 'Y',
4407
+ * });
4408
+ * ```
4409
+ */
4410
+ async updateChannelConfig(params) {
4411
+ if (!params.channelId || params.channelId.trim() === "") {
4412
+ throw PolyVValidationError.required("channelId");
4413
+ }
4414
+ if (!params.key || params.key.trim() === "") {
4415
+ throw PolyVValidationError.required("key");
4416
+ }
4417
+ if (!params.value || params.value.trim() === "") {
4418
+ throw PolyVValidationError.required("value");
4419
+ }
4420
+ const response = await this.client.httpClient.post(
4421
+ "/live/v3/channel/config/update",
4422
+ null,
4423
+ { params: { channelId: params.channelId, key: params.key, value: params.value } }
4424
+ );
4425
+ return response;
4426
+ }
4359
4427
  };
4360
4428
 
4361
4429
  // src/services/chat.service.ts