polyv-live-api-sdk 1.0.9 → 1.0.10

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
@@ -12436,6 +12436,44 @@ var V4ChannelService = class {
12436
12436
  throw new PolyVValidationError("channelId must be a string or number", "channelId");
12437
12437
  }
12438
12438
  }
12439
+ // ============================================
12440
+ // Channel Coupon Association
12441
+ // ============================================
12442
+ /**
12443
+ * Add platform coupons to a channel
12444
+ *
12445
+ * Associates existing platform coupons with a specific channel.
12446
+ * Invalid or already-added coupon IDs are silently ignored.
12447
+ * If all coupon IDs are invalid, the request will fail.
12448
+ *
12449
+ * @param params - Parameters including channelId and couponIds
12450
+ * @returns true if the operation was successful
12451
+ * @throws PolyVValidationError if required parameters are missing
12452
+ *
12453
+ * @example
12454
+ * ```typescript
12455
+ * await v4Channel.addChannelCoupon({
12456
+ * channelId: '3151318',
12457
+ * couponIds: ['caqfi6rqutunvofor5jrqbinswh14p2g'],
12458
+ * });
12459
+ * ```
12460
+ */
12461
+ async addChannelCoupon(params) {
12462
+ if (!params.channelId || String(params.channelId).trim() === "") {
12463
+ throw PolyVValidationError.required("channelId");
12464
+ }
12465
+ if (!Array.isArray(params.couponIds) || params.couponIds.length === 0) {
12466
+ throw new PolyVValidationError("couponIds must be a non-empty array", "couponIds");
12467
+ }
12468
+ if (params.couponIds.length > 30) {
12469
+ throw new PolyVValidationError("couponIds must contain at most 30 items", "couponIds");
12470
+ }
12471
+ const response = await this.client.httpClient.post(
12472
+ "/live/v4/channel/coupon/create",
12473
+ params
12474
+ );
12475
+ return response;
12476
+ }
12439
12477
  /**
12440
12478
  * Validate channel name
12441
12479
  */