polyv-live-api-sdk 1.0.10 → 1.0.12

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.d.cts CHANGED
@@ -4634,21 +4634,155 @@ interface WinnerViewerInfo {
4634
4634
  */
4635
4635
  interface LotteryActivity {
4636
4636
  /** Activity ID */
4637
- activityId: string;
4637
+ id: number;
4638
4638
  /** Channel ID */
4639
- channelId: string;
4639
+ channelId?: string;
4640
4640
  /** Activity name */
4641
- name: string;
4642
- /** Activity type */
4643
- type: string;
4641
+ activityName: string;
4642
+ /** Lottery condition type */
4643
+ lotteryCondition: LotteryConditionType;
4644
4644
  /** Status */
4645
- status: YNFlag;
4646
- /** Start time */
4647
- startTime: number;
4648
- /** End time */
4649
- endTime: number;
4650
- /** Created time */
4651
- createdTime: number;
4645
+ status?: string | null;
4646
+ /** Winner count */
4647
+ amount: number;
4648
+ /** Prize name */
4649
+ prizeName: string;
4650
+ /** Hide winner count */
4651
+ hiddenWinnerAmount?: YNFlag;
4652
+ /** Lottery participant range */
4653
+ lotteryRange?: LotteryRange;
4654
+ /** Custom group info */
4655
+ customGroup?: Array<Record<string, unknown>>;
4656
+ /** Custom group lottery type */
4657
+ customGroupLotteryType?: CustomGroupLotteryType;
4658
+ /** Per-group winner count */
4659
+ customGroupLotteryAmount?: number | null;
4660
+ /** Hide attendee count */
4661
+ hiddenAttendeeNumber?: YNFlag;
4662
+ /** Allow repeat wins */
4663
+ repeatWinEnabled?: YNFlag;
4664
+ /** Whether prize receive info is enabled */
4665
+ receiveEnabled?: YNFlag;
4666
+ /** Prize receive info fields */
4667
+ receiveInfo?: LotteryReceiveInfo[] | null;
4668
+ /** Prize image */
4669
+ thumbnail?: string | null;
4670
+ /** Activity duration */
4671
+ activityDuration?: string | number | null;
4672
+ /** Activity duration unit */
4673
+ activityDurationType?: ActivityDurationType | null;
4674
+ /** Invite type */
4675
+ inviteType?: InviteType | null;
4676
+ /** External invite list URL */
4677
+ externalListLink?: string | null;
4678
+ /** External invite count URL */
4679
+ externalInviteNumLink?: string | null;
4680
+ /** Invite count */
4681
+ inviteNum?: number | null;
4682
+ /** Watch duration */
4683
+ duration?: number | null;
4684
+ /** Comment keyword */
4685
+ comment?: string | null;
4686
+ /** Prize accept type */
4687
+ acceptType?: AcceptType | null;
4688
+ /** Prize receive form fields */
4689
+ formInfo?: LotteryReceiveInfo[] | null;
4690
+ /** Prize link */
4691
+ prizeUrl?: string | null;
4692
+ /** Prize QR code URL */
4693
+ qrCode?: string | null;
4694
+ /** Prize QR code tips */
4695
+ qrCodeTips?: string | null;
4696
+ /** Discount price */
4697
+ realPrice?: number | null;
4698
+ /** Original price */
4699
+ price?: number | null;
4700
+ /** Question lottery prize info */
4701
+ prizeInfo?: LotteryPrizeInfo[] | null;
4702
+ /** Question group ID */
4703
+ questionGroupId?: number | null;
4704
+ /** Answer duration per question */
4705
+ perAnswerDuration?: number | null;
4706
+ /** Winners must be online when drawing */
4707
+ lotteryOnlineEnabled?: YNFlag;
4708
+ /** Question lottery answer type */
4709
+ answerType?: AnswerType;
4710
+ /** Show winner code */
4711
+ showWinnerCode?: YNFlag;
4712
+ /** Show winners */
4713
+ showWinners?: YNFlag;
4714
+ }
4715
+ /**
4716
+ * Lottery condition type
4717
+ */
4718
+ type LotteryConditionType = 'none' | 'invite' | 'duration' | 'comment' | 'question';
4719
+ /**
4720
+ * Lottery participant range
4721
+ */
4722
+ type LotteryRange = 'all' | 'customGroup';
4723
+ /**
4724
+ * Custom group lottery type
4725
+ */
4726
+ type CustomGroupLotteryType = 'average' | 'random';
4727
+ /**
4728
+ * Activity duration unit
4729
+ */
4730
+ type ActivityDurationType = 'second' | 'minute' | 'hour';
4731
+ /**
4732
+ * Invite type
4733
+ */
4734
+ type InviteType = 'poster' | 'external';
4735
+ /**
4736
+ * Prize accept type
4737
+ */
4738
+ type AcceptType = 'form' | 'link' | 'qrCode';
4739
+ /**
4740
+ * Question lottery answer type
4741
+ */
4742
+ type AnswerType = 'pushQuestion' | 'autonomyAnswer';
4743
+ /**
4744
+ * Prize receive info field
4745
+ */
4746
+ interface LotteryReceiveInfo {
4747
+ /** Field type */
4748
+ type?: 'userName' | 'userPhone' | 'custom';
4749
+ /** Field label */
4750
+ field: string;
4751
+ /** Field tips */
4752
+ tips: string;
4753
+ /** Whether field is required */
4754
+ required?: boolean;
4755
+ }
4756
+ /**
4757
+ * Question lottery prize info
4758
+ */
4759
+ interface LotteryPrizeInfo {
4760
+ /** Prize item name */
4761
+ prizeItem: string;
4762
+ /** Correct answer count */
4763
+ correctAnswerCount: number;
4764
+ /** Prize name */
4765
+ prizeName: string;
4766
+ /** Prize image */
4767
+ thumbnail?: string;
4768
+ /** Discount price */
4769
+ realPrice?: number;
4770
+ /** Original price */
4771
+ price?: number;
4772
+ /** Prize accept type */
4773
+ acceptType: AcceptType;
4774
+ /** Prize receive form fields */
4775
+ formInfo?: LotteryReceiveInfo[];
4776
+ /** Prize link */
4777
+ prizeUrl?: string;
4778
+ /** Prize QR code URL */
4779
+ qrCode?: string;
4780
+ /** Prize QR code tips */
4781
+ qrCodeTips?: string;
4782
+ /** Winner count */
4783
+ amount: number;
4784
+ /** Hide winner count */
4785
+ hiddenWinnerAmount?: YNFlag;
4652
4786
  }
4653
4787
  /**
4654
4788
  * Parameters for creating lottery activity
@@ -4657,21 +4791,82 @@ interface LotteryActivityCreateParams {
4657
4791
  /** Channel ID */
4658
4792
  channelId: string;
4659
4793
  /** Activity name */
4660
- name: string;
4661
- /** Activity type */
4662
- type: string;
4663
- /** Start time */
4664
- startTime?: number;
4665
- /** End time */
4666
- endTime?: number;
4794
+ activityName: string;
4795
+ /** Lottery condition type */
4796
+ lotteryCondition: LotteryConditionType;
4797
+ /** Winner count */
4798
+ amount: number;
4799
+ /** Hide winner count */
4800
+ hiddenWinnerAmount?: YNFlag;
4801
+ /** Lottery participant range */
4802
+ lotteryRange?: LotteryRange;
4803
+ /** Custom group IDs */
4804
+ customGroupIds?: number[];
4805
+ /** Custom group lottery type */
4806
+ customGroupLotteryType?: CustomGroupLotteryType;
4807
+ /** Per-group winner count */
4808
+ customGroupLotteryAmount?: number;
4809
+ /** Hide attendee count */
4810
+ hiddenAttendeeNumber?: YNFlag;
4811
+ /** Allow repeat wins */
4812
+ repeatWinEnabled?: YNFlag;
4813
+ /** Whether prize receive info is enabled */
4814
+ receiveEnabled?: YNFlag;
4815
+ /** Prize receive info fields */
4816
+ receiveInfo?: LotteryReceiveInfo[];
4817
+ /** Prize name */
4818
+ prizeName: string;
4819
+ /** Prize image */
4820
+ thumbnail?: string;
4821
+ /** Activity duration */
4822
+ activityDuration?: string;
4823
+ /** Activity duration unit */
4824
+ activityDurationType?: ActivityDurationType;
4825
+ /** Invite type */
4826
+ inviteType?: InviteType;
4827
+ /** External invite list URL */
4828
+ externalListLink?: string;
4829
+ /** External invite count URL */
4830
+ externalInviteNumLink?: string;
4831
+ /** Invite count */
4832
+ inviteNum?: number;
4833
+ /** Watch duration */
4834
+ duration?: number;
4835
+ /** Comment keyword */
4836
+ comment?: string;
4837
+ /** Prize accept type */
4838
+ acceptType?: AcceptType;
4839
+ /** Prize receive form fields */
4840
+ formInfo?: LotteryReceiveInfo[];
4841
+ /** Prize link */
4842
+ prizeUrl?: string;
4843
+ /** Prize QR code URL */
4844
+ qrCode?: string;
4845
+ /** Prize QR code tips */
4846
+ qrCodeTips?: string;
4847
+ /** Discount price */
4848
+ realPrice?: number;
4849
+ /** Original price */
4850
+ price?: number;
4851
+ /** Question lottery prize info */
4852
+ prizeInfo?: LotteryPrizeInfo[];
4853
+ /** Question group ID */
4854
+ questionGroupId?: number;
4855
+ /** Answer duration per question */
4856
+ perAnswerDuration?: number;
4857
+ /** Winners must be online when drawing */
4858
+ lotteryOnlineEnabled?: YNFlag;
4859
+ /** Question lottery answer type */
4860
+ answerType?: AnswerType;
4861
+ /** Show winner code */
4862
+ showWinnerCode?: YNFlag;
4863
+ /** Show winners */
4864
+ showWinners?: YNFlag;
4667
4865
  }
4668
4866
  /**
4669
4867
  * Response for creating lottery activity
4670
4868
  */
4671
- interface LotteryActivityCreateResponse {
4672
- /** Activity ID */
4673
- activityId: string;
4674
- }
4869
+ type LotteryActivityCreateResponse = LotteryActivity;
4675
4870
  /**
4676
4871
  * Parameters for getting lottery activity
4677
4872
  */
@@ -4679,7 +4874,7 @@ interface LotteryActivityGetParams {
4679
4874
  /** Channel ID */
4680
4875
  channelId: string;
4681
4876
  /** Activity ID */
4682
- activityId: string;
4877
+ id: string | number;
4683
4878
  }
4684
4879
  /**
4685
4880
  * Parameters for listing lottery activities
@@ -4699,15 +4894,75 @@ interface LotteryActivityUpdateParams {
4699
4894
  /** Channel ID */
4700
4895
  channelId: string;
4701
4896
  /** Activity ID */
4702
- activityId: string;
4897
+ id: string | number;
4703
4898
  /** Activity name */
4704
- name?: string;
4705
- /** Start time */
4706
- startTime?: number;
4707
- /** End time */
4708
- endTime?: number;
4709
- /** Status */
4710
- status?: YNFlag;
4899
+ activityName?: string;
4900
+ /** Lottery condition type */
4901
+ lotteryCondition?: LotteryConditionType;
4902
+ /** Winner count */
4903
+ amount?: number;
4904
+ /** Hide winner count */
4905
+ hiddenWinnerAmount?: YNFlag;
4906
+ /** Lottery participant range */
4907
+ lotteryRange?: LotteryRange;
4908
+ /** Custom group IDs */
4909
+ customGroupIds?: number[];
4910
+ /** Custom group lottery type */
4911
+ customGroupLotteryType?: CustomGroupLotteryType;
4912
+ /** Per-group winner count */
4913
+ customGroupLotteryAmount?: number;
4914
+ /** Hide attendee count */
4915
+ hiddenAttendeeNumber?: YNFlag;
4916
+ /** Allow repeat wins */
4917
+ repeatWinEnabled?: YNFlag;
4918
+ /** Whether prize receive info is enabled */
4919
+ receiveEnabled?: YNFlag;
4920
+ /** Prize receive info fields */
4921
+ receiveInfo?: LotteryReceiveInfo[];
4922
+ /** Prize name */
4923
+ prizeName?: string;
4924
+ /** Prize image */
4925
+ thumbnail?: string;
4926
+ /** Activity duration */
4927
+ activityDuration?: string;
4928
+ /** Activity duration unit */
4929
+ activityDurationType?: ActivityDurationType;
4930
+ /** Invite type */
4931
+ inviteType?: InviteType;
4932
+ /** External invite list URL */
4933
+ externalListLink?: string;
4934
+ /** External invite count URL */
4935
+ externalInviteNumLink?: string;
4936
+ /** Invite count */
4937
+ inviteNum?: number;
4938
+ /** Watch duration */
4939
+ duration?: number;
4940
+ /** Comment keyword */
4941
+ comment?: string;
4942
+ /** Prize accept type */
4943
+ acceptType?: AcceptType;
4944
+ /** Prize receive form fields */
4945
+ formInfo?: LotteryReceiveInfo[];
4946
+ /** Prize link */
4947
+ prizeUrl?: string;
4948
+ /** Prize QR code URL */
4949
+ qrCode?: string;
4950
+ /** Prize QR code tips */
4951
+ qrCodeTips?: string;
4952
+ /** Discount price */
4953
+ realPrice?: number;
4954
+ /** Original price */
4955
+ price?: number;
4956
+ /** Question lottery prize info */
4957
+ prizeInfo?: LotteryPrizeInfo[];
4958
+ /** Question group ID */
4959
+ questionGroupId?: number;
4960
+ /** Answer duration per question */
4961
+ perAnswerDuration?: number;
4962
+ /** Winners must be online when drawing */
4963
+ lotteryOnlineEnabled?: YNFlag;
4964
+ /** Question lottery answer type */
4965
+ answerType?: AnswerType;
4711
4966
  }
4712
4967
  /**
4713
4968
  * Parameters for deleting lottery activity
@@ -4716,7 +4971,7 @@ interface LotteryActivityDeleteParams {
4716
4971
  /** Channel ID */
4717
4972
  channelId: string;
4718
4973
  /** Activity ID */
4719
- activityId: string;
4974
+ id: string | number;
4720
4975
  }
4721
4976
  /**
4722
4977
  * Parameters for adding to blacklist
package/dist/index.js CHANGED
@@ -10938,7 +10938,7 @@ var V4ChannelService = class {
10938
10938
  async getChannel(params) {
10939
10939
  this.validateChannelId(params.channelId);
10940
10940
  const response = await this.client.httpClient.get(
10941
- "/live/v4/channel/operate/get-channel",
10941
+ "/live/v4/channel/basic/get",
10942
10942
  { params }
10943
10943
  );
10944
10944
  return response;
@@ -11480,9 +11480,11 @@ var V4ChannelService = class {
11480
11480
  */
11481
11481
  async lotteryActivityCreate(params) {
11482
11482
  this.validateChannelId(params.channelId);
11483
+ const { channelId, ...body } = params;
11483
11484
  const response = await this.client.httpClient.post(
11484
- "/live/v4/channel/lottery-activity/lottery-activity-create",
11485
- params
11485
+ "/live/v4/channel/lottery-activity/create",
11486
+ body,
11487
+ { params: { channelId } }
11486
11488
  );
11487
11489
  return response;
11488
11490
  }
@@ -11495,7 +11497,7 @@ var V4ChannelService = class {
11495
11497
  async lotteryActivityGet(params) {
11496
11498
  this.validateChannelId(params.channelId);
11497
11499
  const response = await this.client.httpClient.get(
11498
- "/live/v4/channel/lottery-activity/lottery-activity-get",
11500
+ "/live/v4/channel/lottery-activity/get",
11499
11501
  { params }
11500
11502
  );
11501
11503
  return response;
@@ -11510,7 +11512,7 @@ var V4ChannelService = class {
11510
11512
  this.validateChannelId(params.channelId);
11511
11513
  this.validatePaginationParams(params);
11512
11514
  const response = await this.client.httpClient.get(
11513
- "/live/v4/channel/lottery-activity/lottery-activity-list",
11515
+ "/live/v4/channel/lottery-activity/list",
11514
11516
  { params }
11515
11517
  );
11516
11518
  return response;
@@ -11522,9 +11524,11 @@ var V4ChannelService = class {
11522
11524
  */
11523
11525
  async lotteryActivityUpdate(params) {
11524
11526
  this.validateChannelId(params.channelId);
11527
+ const { channelId, ...body } = params;
11525
11528
  await this.client.httpClient.post(
11526
- "/live/v4/channel/lottery-activity/lottery-activity-update",
11527
- params
11529
+ "/live/v4/channel/lottery-activity/update",
11530
+ body,
11531
+ { params: { channelId } }
11528
11532
  );
11529
11533
  }
11530
11534
  /**
@@ -11535,9 +11539,9 @@ var V4ChannelService = class {
11535
11539
  async lotteryActivityDelete(params) {
11536
11540
  this.validateChannelId(params.channelId);
11537
11541
  await this.client.httpClient.post(
11538
- "/live/v4/channel/lottery-activity/lottery-activity-delete",
11539
- null,
11540
- { params }
11542
+ "/live/v4/channel/lottery-activity/delete",
11543
+ { id: params.id },
11544
+ { params: { channelId: params.channelId } }
11541
11545
  );
11542
11546
  }
11543
11547
  /**