polyv-live-api-sdk 1.0.9 → 1.0.11
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 +39 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -1
- package/dist/index.js +39 -1
- package/dist/index.js.map +1 -1
- package/dist/services/v4/channel.service.d.ts +21 -1
- package/dist/services/v4/channel.service.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/v4-channel.d.ts +9 -0
- package/dist/types/v4-channel.d.ts.map +1 -1
- package/package.json +17 -16
- package/LICENSE +0 -21
package/dist/index.cjs
CHANGED
|
@@ -10945,7 +10945,7 @@ var V4ChannelService = class {
|
|
|
10945
10945
|
async getChannel(params) {
|
|
10946
10946
|
this.validateChannelId(params.channelId);
|
|
10947
10947
|
const response = await this.client.httpClient.get(
|
|
10948
|
-
"/live/v4/channel/
|
|
10948
|
+
"/live/v4/channel/basic/get",
|
|
10949
10949
|
{ params }
|
|
10950
10950
|
);
|
|
10951
10951
|
return response;
|
|
@@ -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
|
*/
|