@seayoo-web/gamer-api 1.1.12 → 1.1.14

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
@@ -59,7 +59,7 @@ const Y = {
59
59
  }
60
60
  }
61
61
  }, _ = "gamer_token";
62
- class tr {
62
+ class rr {
63
63
  constructor(t, r) {
64
64
  u(this, "$idToken", "");
65
65
  u(this, "$weixinToken", "");
@@ -397,7 +397,7 @@ function pe(e) {
397
397
  return n(e, "redemptions") && o(e.redemptions, _e);
398
398
  }
399
399
  var fe = /* @__PURE__ */ ((e) => (e.Unknown = "unknown", e.Male = "male", e.Female = "female", e))(fe || {}), we = /* @__PURE__ */ ((e) => (e.Increase = "increase", e.Decrease = "decrease", e.Expired = "expired", e))(we || {}), ye = /* @__PURE__ */ ((e) => (e.Order = "order", e.Consumption = "consumption", e.Redeem = "redeem", e.Expire = "expire", e.Admin = "admin", e.Event = "event", e))(ye || {}), he = /* @__PURE__ */ ((e) => (e.GameReward = "game_reward", e.Physical = "physical", e.Virtual = "virtual", e))(he || {}), ve = /* @__PURE__ */ ((e) => (e.Pending = "pending", e.issued = "issued", e.failed = "failed", e))(ve || {});
400
- class rr {
400
+ class nr {
401
401
  constructor(t) {
402
402
  u(this, "token");
403
403
  u(this, "req");
@@ -629,7 +629,7 @@ function Ge(e) {
629
629
  return n(e, "event_name", "rules", "since", "until", "features") && Array.isArray(e.features) && e.features.every(Fe);
630
630
  }
631
631
  function Fe(e) {
632
- if (!Be(e))
632
+ if (!Ve(e))
633
633
  return !1;
634
634
  switch (e.feature_type) {
635
635
  case a.Preregister:
@@ -638,31 +638,31 @@ function Fe(e) {
638
638
  case a.InvitedRegister:
639
639
  return !0;
640
640
  case a.Lottery:
641
- return Qe(e.config);
642
- case a.Survey:
643
641
  return Te(e.config);
644
- case a.Invite:
642
+ case a.Survey:
645
643
  return Me(e.config);
646
- case a.Share:
644
+ case a.Invite:
647
645
  return He(e.config);
648
- case a.Follow:
646
+ case a.Share:
649
647
  return je(e.config);
650
- case a.Subscribe:
648
+ case a.Follow:
651
649
  return ze(e.config);
652
- case a.Comment:
650
+ case a.Subscribe:
653
651
  return Je(e.config);
654
- case a.Vote:
652
+ case a.Comment:
655
653
  return Ke(e.config);
654
+ case a.Vote:
655
+ return Ne(e.config);
656
656
  case a.Cashback:
657
- return Oe(e.config);
658
- case a.GiftCode:
659
657
  return Xe(e.config);
658
+ case a.GiftCode:
659
+ return Ye(e.config);
660
660
  case a.Quest:
661
- return Ze(e.config);
662
- case a.Team:
663
661
  return We(e.config);
664
- case a.LotteryDraw:
662
+ case a.Team:
665
663
  return et(e.config);
664
+ case a.LotteryDraw:
665
+ return tt(e.config);
666
666
  default:
667
667
  return !1;
668
668
  }
@@ -679,9 +679,12 @@ function k(e) {
679
679
  );
680
680
  }
681
681
  function Ie(e) {
682
- return n(e, "feature_reward_type", "reward_details") && (e.feature_reward_type === "every" ? Array.isArray(e.reward_details) && e.reward_details.every(k) : e.feature_reward_type === "regular" ? n(e.reward_details, "engage_count", "rewards") && Array.isArray(e.reward_details.rewards) && e.reward_details.rewards.every(k) : !1);
682
+ return n(e, "engage_count", "rewards") && Array.isArray(e.rewards) && e.rewards.every(k);
683
683
  }
684
684
  function Be(e) {
685
+ return n(e, "feature_reward_type", "reward_details") && (e.feature_reward_type === "every" ? Array.isArray(e.reward_details) && e.reward_details.every(k) : e.feature_reward_type === "regular" ? Array.isArray(e.reward_details) && e.reward_details.every(Ie) : !1);
686
+ }
687
+ function Ve(e) {
685
688
  return n(
686
689
  e,
687
690
  "feature_id",
@@ -693,9 +696,9 @@ function Be(e) {
693
696
  "since",
694
697
  "until",
695
698
  "engage_account"
696
- ) && ("feature_rewards" in e ? Ie(e.feature_rewards) : !0);
699
+ ) && ("feature_rewards" in e ? Be(e.feature_rewards) : !0);
697
700
  }
698
- function Ve(e) {
701
+ function Qe(e) {
699
702
  return n(
700
703
  e,
701
704
  "reward_item_id",
@@ -706,7 +709,7 @@ function Ve(e) {
706
709
  "reward_remaining_stock"
707
710
  );
708
711
  }
709
- function Qe(e) {
712
+ function Te(e) {
710
713
  return n(
711
714
  e,
712
715
  "consume_item_id",
@@ -714,27 +717,27 @@ function Qe(e) {
714
717
  "consume_item_icon_url",
715
718
  "consume_item_count",
716
719
  "rewards"
717
- ) && Array.isArray(e.rewards) && e.rewards.every(Ve);
720
+ ) && Array.isArray(e.rewards) && e.rewards.every(Qe);
718
721
  }
719
- function Te(e) {
722
+ function Me(e) {
720
723
  return n(e, "survey_id", "survey_url");
721
724
  }
722
- function Me(e) {
725
+ function He(e) {
723
726
  return n(e, "share_url");
724
727
  }
725
- function He(e) {
728
+ function je(e) {
726
729
  return n(e, "share_platform");
727
730
  }
728
- function je(e) {
731
+ function ze(e) {
729
732
  return n(e, "platform");
730
733
  }
731
- function ze(e) {
734
+ function Je(e) {
732
735
  return n(e, "weixin_template_ids") && Array.isArray(e.weixin_template_ids) && e.weixin_template_ids.every((t) => typeof t == "string");
733
736
  }
734
- function Je(e) {
737
+ function Ke(e) {
735
738
  return n(e, "comments", "send_rate") && Array.isArray(e.comments) && e.comments.every((t) => typeof t == "string");
736
739
  }
737
- function Ke(e) {
740
+ function Ne(e) {
738
741
  return n(
739
742
  e,
740
743
  "vote_feature_ids",
@@ -743,12 +746,12 @@ function Ke(e) {
743
746
  "source",
744
747
  "options",
745
748
  "rewards"
746
- ) && Array.isArray(e.vote_feature_ids) && Array.isArray(e.submission_feature_ids) && Array.isArray(e.options) && e.options.every(Ne) && Array.isArray(e.rewards) && e.rewards.every(k);
749
+ ) && Array.isArray(e.vote_feature_ids) && Array.isArray(e.submission_feature_ids) && Array.isArray(e.options) && e.options.every(Oe) && Array.isArray(e.rewards) && e.rewards.every(k);
747
750
  }
748
- function Ne(e) {
751
+ function Oe(e) {
749
752
  return n(e, "sn", "name", "amount", "jump_url", "last_vote_time", "finalists") && ("img_urls" in e ? Array.isArray(e.img_urls) : !0) && ("video_urls" in e ? Array.isArray(e.video_urls) : !0) && ("descriptions" in e ? Array.isArray(e.descriptions) : !0);
750
753
  }
751
- function Oe(e) {
754
+ function Xe(e) {
752
755
  return n(
753
756
  e,
754
757
  "order_start_time",
@@ -757,39 +760,39 @@ function Oe(e) {
757
760
  "claim_rewards_end_time"
758
761
  );
759
762
  }
760
- function Xe(e) {
761
- return n(e, "gift_items") && Array.isArray(e.gift_items) && e.gift_items.every(Ye);
762
- }
763
763
  function Ye(e) {
764
- return n(e, "name", "count", "icon_url");
764
+ return n(e, "gift_items") && Array.isArray(e.gift_items) && e.gift_items.every(Ze);
765
765
  }
766
766
  function Ze(e) {
767
- return n(e, "objective", "completion_value") && ("team" in e ? n(e.team, "completion_value") : !0);
767
+ return n(e, "name", "count", "icon_url");
768
768
  }
769
769
  function We(e) {
770
- return n(e, "min_members", "max_members");
770
+ return n(e, "objective", "completion_value") && ("team" in e ? n(e.team, "completion_value") : !0);
771
771
  }
772
772
  function et(e) {
773
- return n(e, "draw_not_after", "draw_not_before");
773
+ return n(e, "min_members", "max_members");
774
774
  }
775
775
  function tt(e) {
776
+ return n(e, "draw_not_after", "draw_not_before");
777
+ }
778
+ function rt(e) {
776
779
  return n(e, "allowed", "registered");
777
780
  }
778
781
  function w(e) {
779
782
  return n(e, "count");
780
783
  }
781
- function rt(e) {
784
+ function nt(e) {
782
785
  return n(e, "engagements") && Array.isArray(e.engagements) && (e.engagements.every(
783
786
  (t) => n(t, "user_id", "name", "avatar_url", "comment", "video_note", "created_at")
784
787
  ) || e.engagements.every((t) => n(t, "team_code", "leader_name", "total_members")));
785
788
  }
786
- function nt(e) {
789
+ function it(e) {
787
790
  return n(e, "first_visit") && typeof e.first_visit == "boolean";
788
791
  }
789
- function it(e) {
792
+ function st(e) {
790
793
  return n(e, "status") && Array.isArray(e.status) && e.status.every((t) => n(t, "feature_id", "can_engage", "has_unclaimed_rewards"));
791
794
  }
792
- function st(e) {
795
+ function ot(e) {
793
796
  return n(e, "engagements") && o(e.engagements, S);
794
797
  }
795
798
  function S(e) {
@@ -812,15 +815,15 @@ function S(e) {
812
815
  if (!("data" in e))
813
816
  return !0;
814
817
  const t = e.data;
815
- return ct(t) || mt(t) || lt(t) || _t(t) || gt(t) || dt(t) || pt(t) || ft(t) || wt(t) || yt(t) || ht(t) || vt(t);
816
- }
817
- function ot(e) {
818
- return n(e, "engagements") && o(e.engagements, at);
818
+ return mt(t) || lt(t) || _t(t) || gt(t) || dt(t) || pt(t) || ft(t) || wt(t) || yt(t) || ht(t) || vt(t) || kt(t);
819
819
  }
820
820
  function at(e) {
821
- return n(e, "engagement_id", "sequence", "feature_id", "created_at", "user_id") && ("rewards" in e ? o(e.rewards, ut) : !0);
821
+ return n(e, "engagements") && o(e.engagements, ut);
822
822
  }
823
823
  function ut(e) {
824
+ return n(e, "engagement_id", "sequence", "feature_id", "created_at", "user_id") && ("rewards" in e ? o(e.rewards, ct) : !0);
825
+ }
826
+ function ct(e) {
824
827
  return n(
825
828
  e,
826
829
  "reward_id",
@@ -834,39 +837,39 @@ function ut(e) {
834
837
  "receive_time"
835
838
  ) && ("extra_data" in e ? n(e.extra_data) : !0);
836
839
  }
837
- function ct(e) {
840
+ function mt(e) {
838
841
  return n(e, "platforms") && Array.isArray(e.platforms);
839
842
  }
840
- function mt(e) {
843
+ function lt(e) {
841
844
  return n(e, "lottery_count");
842
845
  }
843
- function lt(e) {
846
+ function _t(e) {
844
847
  return n(e, "serial_number");
845
848
  }
846
- function _t(e) {
849
+ function gt(e) {
847
850
  return n(e, "user_id");
848
851
  }
849
- function gt(e) {
852
+ function dt(e) {
850
853
  return n(e, "platform");
851
854
  }
852
- function dt(e) {
855
+ function pt(e) {
853
856
  return n(e, "option_sn");
854
857
  }
855
- function pt(e) {
858
+ function ft(e) {
856
859
  return n(e, "weixin_openid");
857
860
  }
858
- function ft(e) {
861
+ function wt(e) {
859
862
  return n(e, "cashback_total_amount", "game_item_count", "order_total_amount");
860
863
  }
861
- function wt(e) {
864
+ function yt(e) {
862
865
  return n(e, "gift_code");
863
866
  }
864
- function yt(e) {
867
+ function ht(e) {
865
868
  return n(e, "team_code", "visibility", "members") && Array.isArray(e.members) && e.members.every(
866
869
  (t) => n(t, "is_leader", "role_name", "server_name")
867
870
  );
868
871
  }
869
- function ht(e) {
872
+ function vt(e) {
870
873
  return n(e, "objective", "progress") ? "team" in e ? n(e.team, "progress", "players") && Array.isArray(e.team.players) && e.team.players.every(
871
874
  (t) => n(
872
875
  t,
@@ -895,10 +898,10 @@ function G(e) {
895
898
  "receive_time"
896
899
  ) && ("extra_data" in e ? n(e.extra_data) : !0);
897
900
  }
898
- function vt(e) {
901
+ function kt(e) {
899
902
  return !n(e, "tickets") || !("status" in e) ? !1 : e.status === "unknown" || e.status === "pending" ? !0 : "reward" in e ? G(e.reward) : !1;
900
903
  }
901
- function kt(e) {
904
+ function bt(e) {
902
905
  return n(
903
906
  e,
904
907
  "reward_id",
@@ -911,31 +914,31 @@ function kt(e) {
911
914
  "reward_source"
912
915
  );
913
916
  }
914
- function bt(e) {
915
- return n(e, "engagement_id") && ("engagement" in e ? S(e.engagement) : !0) && ("rewards" in e ? o(e.rewards, kt) : !0);
916
- }
917
917
  function qt(e) {
918
- return n(e, "reward_id", "reward_status");
918
+ return n(e, "engagement_id") && ("engagement" in e ? S(e.engagement) : !0) && ("rewards" in e ? o(e.rewards, bt) : !0);
919
919
  }
920
920
  function Rt(e) {
921
- return n(e, "claimed_items") && o(e.claimed_items, qt);
921
+ return n(e, "reward_id", "reward_status");
922
922
  }
923
923
  function xt(e) {
924
- return n(e, "reward_status");
924
+ return n(e, "claimed_items") && o(e.claimed_items, Rt);
925
925
  }
926
926
  function At(e) {
927
- return n(e, "user_rewards") && o(e.user_rewards, G);
927
+ return n(e, "reward_status");
928
928
  }
929
929
  function Lt(e) {
930
- return n(e, "scene");
930
+ return n(e, "user_rewards") && o(e.user_rewards, G);
931
931
  }
932
932
  function Ct(e) {
933
- return n(e, "params");
933
+ return n(e, "scene");
934
934
  }
935
935
  function Ut(e) {
936
+ return n(e, "params");
937
+ }
938
+ function $t(e) {
936
939
  return n(e, "img") && typeof e.img == "string";
937
940
  }
938
- class nr {
941
+ class ir {
939
942
  constructor(t, r) {
940
943
  u(this, "token");
941
944
  u(this, "event", 0);
@@ -948,7 +951,7 @@ class nr {
948
951
  * https://kdocs.cn/l/cf2mO2uRLqh9?linkname=OWGSPF3Ysl
949
952
  */
950
953
  async verifyMobileAllowed(t) {
951
- const { data: r } = await this.req.get("verify-mobile-allowed", tt, {
954
+ const { data: r } = await this.req.get("verify-mobile-allowed", rt, {
952
955
  params: { mobile: t }
953
956
  });
954
957
  return r;
@@ -990,7 +993,7 @@ class nr {
990
993
  * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=THtZ4ewIQW
991
994
  */
992
995
  async getEngagements(t) {
993
- const { data: r } = await this.req.get(`event/${this.event}/feature-engagements`, rt, {
996
+ const { data: r } = await this.req.get(`event/${this.event}/feature-engagements`, nt, {
994
997
  params: { feature_id: t }
995
998
  });
996
999
  return (r == null ? void 0 : r.engagements) || [];
@@ -1005,7 +1008,7 @@ class nr {
1005
1008
  const { data: r, code: i } = await this.req.post(
1006
1009
  `event/${this.event}/visit`,
1007
1010
  s(t || {}),
1008
- nt
1011
+ it
1009
1012
  );
1010
1013
  return r ?? {
1011
1014
  error: i
@@ -1022,7 +1025,7 @@ class nr {
1022
1025
  */
1023
1026
  async getUserFeatureStatus(t) {
1024
1027
  if (!await this.token.autoLogin()) return [];
1025
- const { data: r } = await this.req.get("event/user-feature-status", it, {
1028
+ const { data: r } = await this.req.get("event/user-feature-status", st, {
1026
1029
  params: s({ ...t, event_id: this.event }),
1027
1030
  message: !1
1028
1031
  });
@@ -1037,7 +1040,7 @@ class nr {
1037
1040
  */
1038
1041
  async getUserEngagements(t) {
1039
1042
  if (!await this.token.autoLogin()) return [];
1040
- const { data: r } = await this.req.get(`event/${this.event}/user-engagements`, st, {
1043
+ const { data: r } = await this.req.get(`event/${this.event}/user-engagements`, ot, {
1041
1044
  params: { feature_id: t }
1042
1045
  });
1043
1046
  return (r == null ? void 0 : r.engagements) || [];
@@ -1049,8 +1052,8 @@ class nr {
1049
1052
  */
1050
1053
  async getUserEngagementsV2(t, r) {
1051
1054
  if (!await this.token.autoLogin()) return [];
1052
- const { data: i } = await this.req.get("event/user-engagements", ot, {
1053
- params: s({ max_results: 10, ...r, feature_id: t })
1055
+ const { data: i } = await this.req.get("event/user-engagements", at, {
1056
+ params: s({ max_results: 10, ...r, event_id: this.event, feature_id: t })
1054
1057
  });
1055
1058
  return (i == null ? void 0 : i.engagements) || [];
1056
1059
  }
@@ -1061,7 +1064,7 @@ class nr {
1061
1064
  */
1062
1065
  async engage(t) {
1063
1066
  await this.token.autoLogin();
1064
- const { data: r, code: i } = await this.req.post(`event/${this.event}/engage`, s(t), bt);
1067
+ const { data: r, code: i } = await this.req.post(`event/${this.event}/engage`, s(t), qt);
1065
1068
  return r ?? {
1066
1069
  error: i
1067
1070
  };
@@ -1076,7 +1079,7 @@ class nr {
1076
1079
  const { data: r, code: i } = await this.req.post(
1077
1080
  `event/${this.event}/claim-rewards`,
1078
1081
  s(t),
1079
- Rt
1082
+ xt
1080
1083
  );
1081
1084
  return (r == null ? void 0 : r.claimed_items) ?? {
1082
1085
  error: i
@@ -1092,7 +1095,7 @@ class nr {
1092
1095
  const { data: r, code: i } = await this.req.post(
1093
1096
  `event/${this.event}/claim-weixin-hongbao`,
1094
1097
  { reward_id: t },
1095
- xt
1098
+ At
1096
1099
  );
1097
1100
  return r ?? {
1098
1101
  error: i
@@ -1108,7 +1111,7 @@ class nr {
1108
1111
  const { data: r } = await this.req.post(
1109
1112
  "event/user-rewards",
1110
1113
  s({ ...t, event_id: this.event }),
1111
- At
1114
+ Lt
1112
1115
  );
1113
1116
  return (r == null ? void 0 : r.user_rewards) || [];
1114
1117
  }
@@ -1143,7 +1146,7 @@ class nr {
1143
1146
  */
1144
1147
  async getUnlimitQrcodeScene(t) {
1145
1148
  if (!await this.token.autoLogin()) return null;
1146
- const { data: r } = await this.req.get("event/unlimit-qrcode-scene", Lt, {
1149
+ const { data: r } = await this.req.get("event/unlimit-qrcode-scene", Ct, {
1147
1150
  params: { params: t }
1148
1151
  });
1149
1152
  return (r == null ? void 0 : r.scene) ?? null;
@@ -1156,7 +1159,7 @@ class nr {
1156
1159
  * @param scene - 小程序码 scene 值
1157
1160
  */
1158
1161
  async getParamsByQrcodeScene(t) {
1159
- const { data: r } = await this.req.get("event/params-by-qrcode-scene", Ct, {
1162
+ const { data: r } = await this.req.get("event/params-by-qrcode-scene", Ut, {
1160
1163
  params: { scene: t }
1161
1164
  });
1162
1165
  return (r == null ? void 0 : r.params) ?? null;
@@ -1168,23 +1171,23 @@ class nr {
1168
1171
  */
1169
1172
  async generateUnlimitQrcode(t) {
1170
1173
  if (!await this.token.autoLogin()) return null;
1171
- const { data: r } = await this.req.post("event/unlimit-qrcode", s(t), Ut);
1174
+ const { data: r } = await this.req.post("event/unlimit-qrcode", s(t), $t);
1172
1175
  return (r == null ? void 0 : r.img) ?? null;
1173
1176
  }
1174
1177
  }
1175
1178
  function F(e) {
1176
1179
  return n(e, "forum_id", "icon_url", "name", "tags", "sort", "mode", "member_ids") && Array.isArray(e.tags) && Array.isArray(e.member_ids);
1177
1180
  }
1178
- function $t(e) {
1181
+ function Pt(e) {
1179
1182
  return n(e, "forums") && o(e.forums, F);
1180
1183
  }
1181
1184
  function b(e) {
1182
1185
  return n(e, "topic_id", "cover_url", "name", "description", "tags", "post_num") && Array.isArray(e.tags);
1183
1186
  }
1184
- function Pt(e) {
1187
+ function Dt(e) {
1185
1188
  return n(e, "topics") && o(e.topics, b);
1186
1189
  }
1187
- function Dt(e) {
1190
+ function Et(e) {
1188
1191
  return n(e, "topic") && b(e.topic);
1189
1192
  }
1190
1193
  function q(e) {
@@ -1212,13 +1215,13 @@ function q(e) {
1212
1215
  function $(e) {
1213
1216
  return n(e, "next_token", "posts") && o(e.posts, q);
1214
1217
  }
1215
- function Et(e) {
1218
+ function St(e) {
1216
1219
  return n(e, "post") && q(e.post);
1217
1220
  }
1218
1221
  function R(e) {
1219
1222
  return n(e);
1220
1223
  }
1221
- function St(e) {
1224
+ function Gt(e) {
1222
1225
  return n(e) && ("post" in e ? q(e.post) : !0) && ("antispam" in e ? R(e.antispam) : !0);
1223
1226
  }
1224
1227
  function g(e) {
@@ -1238,10 +1241,10 @@ function g(e) {
1238
1241
  "status"
1239
1242
  ) && ("replies" in e ? o(e.replies, x) : !0);
1240
1243
  }
1241
- function Gt(e) {
1244
+ function Ft(e) {
1242
1245
  return n(e, "comment") && g(e.comment);
1243
1246
  }
1244
- function Ft(e) {
1247
+ function It(e) {
1245
1248
  return n(e, "comments") && o(e.comments, g);
1246
1249
  }
1247
1250
  function x(e) {
@@ -1257,27 +1260,27 @@ function x(e) {
1257
1260
  "liked",
1258
1261
  "reply_to",
1259
1262
  "create_time"
1260
- ) && It(e.reply_to);
1263
+ ) && Bt(e.reply_to);
1261
1264
  }
1262
- function It(e) {
1265
+ function Bt(e) {
1263
1266
  return n(e, "reply_id", "replied_by", "avatar_url", "nickname");
1264
1267
  }
1265
- function Bt(e) {
1268
+ function Vt(e) {
1266
1269
  return n(e) && ("comment" in e ? g(e.comment) : !0) && ("antispam" in e ? R(e.antispam) : !0);
1267
1270
  }
1268
- function Vt(e) {
1271
+ function Qt(e) {
1269
1272
  return n(e, "replies") && o(e.replies, x);
1270
1273
  }
1271
- function Qt(e) {
1274
+ function Tt(e) {
1272
1275
  return n(e, "reply") && x(e.reply);
1273
1276
  }
1274
- function Tt(e) {
1277
+ function Mt(e) {
1275
1278
  return n(e) && ("reply" in e ? g(e.comment) : !0) && ("antispam" in e ? R(e.antispam) : !0);
1276
1279
  }
1277
- function Mt(e) {
1280
+ function Ht(e) {
1278
1281
  return n(e, "image_url", "upload_url", "existed") && typeof e.existed == "boolean";
1279
1282
  }
1280
- function Ht(e) {
1283
+ function jt(e) {
1281
1284
  return n(
1282
1285
  e,
1283
1286
  "notification_id",
@@ -1289,14 +1292,14 @@ function Ht(e) {
1289
1292
  "origin_user_avatar_url"
1290
1293
  );
1291
1294
  }
1292
- function jt(e) {
1293
- return n(e, "notifications") && o(e.notifications, Ht);
1294
- }
1295
1295
  function zt(e) {
1296
+ return n(e, "notifications") && o(e.notifications, jt);
1297
+ }
1298
+ function Jt(e) {
1296
1299
  return n(e, "system", "comment", "like");
1297
1300
  }
1298
- var Jt = /* @__PURE__ */ ((e) => (e.All = "all", e.Limit = "limit", e))(Jt || {}), Kt = /* @__PURE__ */ ((e) => (e.Pending = "pending", e.Approved = "approved", e.Failed = "failed", e.Suspect = "suspect", e))(Kt || {}), Nt = /* @__PURE__ */ ((e) => (e.System = "system", e.Comment = "comment", e.Like = "like", e))(Nt || {}), Ot = /* @__PURE__ */ ((e) => (e.System = "system", e.PostPinned = "post_pinned", e.PostHighlighted = "post_highlighted", e.PostDeleted = "post_deleted", e.PostCommented = "post_commented", e.PostLiked = "post_liked", e.CommentReplied = "comment_replied", e.CommentLiked = "comment_liked", e.CommentDeleted = "comment_deleted", e.ReplyReplied = "reply_replied", e.ReplyLiked = "reply_liked", e.ReplyDeleted = "reply_deleted", e))(Ot || {});
1299
- class ir {
1301
+ var Kt = /* @__PURE__ */ ((e) => (e.All = "all", e.Limit = "limit", e))(Kt || {}), Nt = /* @__PURE__ */ ((e) => (e.Pending = "pending", e.Approved = "approved", e.Failed = "failed", e.Suspect = "suspect", e))(Nt || {}), Ot = /* @__PURE__ */ ((e) => (e.System = "system", e.Comment = "comment", e.Like = "like", e))(Ot || {}), Xt = /* @__PURE__ */ ((e) => (e.System = "system", e.PostPinned = "post_pinned", e.PostHighlighted = "post_highlighted", e.PostDeleted = "post_deleted", e.PostCommented = "post_commented", e.PostLiked = "post_liked", e.CommentReplied = "comment_replied", e.CommentLiked = "comment_liked", e.CommentDeleted = "comment_deleted", e.ReplyReplied = "reply_replied", e.ReplyLiked = "reply_liked", e.ReplyDeleted = "reply_deleted", e))(Xt || {});
1302
+ class sr {
1300
1303
  constructor(t) {
1301
1304
  u(this, "token");
1302
1305
  u(this, "req");
@@ -1308,7 +1311,7 @@ class ir {
1308
1311
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=QaqUa2K0z0
1309
1312
  */
1310
1313
  async getForums() {
1311
- const { data: t } = await this.req.get("community/forums", $t);
1314
+ const { data: t } = await this.req.get("community/forums", Pt);
1312
1315
  return (t == null ? void 0 : t.forums) || [];
1313
1316
  }
1314
1317
  /**
@@ -1317,7 +1320,7 @@ class ir {
1317
1320
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=mIwpymAQom
1318
1321
  */
1319
1322
  async getTopics() {
1320
- const { data: t } = await this.req.get("community/topics", Pt);
1323
+ const { data: t } = await this.req.get("community/topics", Dt);
1321
1324
  return (t == null ? void 0 : t.topics) || [];
1322
1325
  }
1323
1326
  /**
@@ -1326,7 +1329,7 @@ class ir {
1326
1329
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=Jvw7xMK31K
1327
1330
  */
1328
1331
  async getTopic(t) {
1329
- const { data: r, code: i } = await this.req.get("community/topic", Dt, {
1332
+ const { data: r, code: i } = await this.req.get("community/topic", Et, {
1330
1333
  params: { topic_id: t }
1331
1334
  });
1332
1335
  return (r == null ? void 0 : r.topic) ?? { error: i };
@@ -1359,7 +1362,7 @@ class ir {
1359
1362
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=hj1AZy5rcP
1360
1363
  */
1361
1364
  async getPost(t) {
1362
- const { data: r, code: i } = await this.req.get("community/post", Et, {
1365
+ const { data: r, code: i } = await this.req.get("community/post", St, {
1363
1366
  params: { post_id: t }
1364
1367
  });
1365
1368
  return (r == null ? void 0 : r.post) ?? { error: i };
@@ -1370,7 +1373,7 @@ class ir {
1370
1373
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=M5okHBuaVk
1371
1374
  */
1372
1375
  async post(t) {
1373
- const { data: r, code: i } = await this.req.post("community/post", s(t), St);
1376
+ const { data: r, code: i } = await this.req.post("community/post", s(t), Gt);
1374
1377
  return r ?? {
1375
1378
  error: i
1376
1379
  };
@@ -1381,7 +1384,7 @@ class ir {
1381
1384
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=djKbX7lFdp
1382
1385
  */
1383
1386
  async getComments(t) {
1384
- const { data: r, code: i } = await this.req.get("community/comments", Ft, {
1387
+ const { data: r, code: i } = await this.req.get("community/comments", It, {
1385
1388
  params: s(t)
1386
1389
  });
1387
1390
  return r ?? { error: i };
@@ -1392,7 +1395,7 @@ class ir {
1392
1395
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=RIc7oxVGae
1393
1396
  */
1394
1397
  async getComment(t) {
1395
- const { data: r, code: i } = await this.req.get("community/comment", Gt, {
1398
+ const { data: r, code: i } = await this.req.get("community/comment", Ft, {
1396
1399
  params: { comment_id: t }
1397
1400
  });
1398
1401
  return (r == null ? void 0 : r.comment) ?? { error: i };
@@ -1404,7 +1407,7 @@ class ir {
1404
1407
  */
1405
1408
  async comment(t) {
1406
1409
  await this.token.autoLogin();
1407
- const { data: r, code: i } = await this.req.post("community/comment", s(t), Bt);
1410
+ const { data: r, code: i } = await this.req.post("community/comment", s(t), Vt);
1408
1411
  return r ?? {
1409
1412
  error: i
1410
1413
  };
@@ -1415,7 +1418,7 @@ class ir {
1415
1418
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=sVKBbY83MY
1416
1419
  */
1417
1420
  async getReplies(t) {
1418
- const { data: r } = await this.req.get("community/replies", Vt, {
1421
+ const { data: r } = await this.req.get("community/replies", Qt, {
1419
1422
  params: s({ max_results: 20, ...t })
1420
1423
  });
1421
1424
  return r ?? { replies: [] };
@@ -1426,7 +1429,7 @@ class ir {
1426
1429
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=kxhcSXD3MG
1427
1430
  */
1428
1431
  async getReply(t) {
1429
- const { data: r, code: i } = await this.req.get("community/reply", Qt, {
1432
+ const { data: r, code: i } = await this.req.get("community/reply", Tt, {
1430
1433
  params: { reply_id: t }
1431
1434
  });
1432
1435
  return (r == null ? void 0 : r.reply) ?? { error: i };
@@ -1438,7 +1441,7 @@ class ir {
1438
1441
  */
1439
1442
  async reply(t) {
1440
1443
  await this.token.autoLogin();
1441
- const { data: r, code: i } = await this.req.post("community/reply", s(t), Tt);
1444
+ const { data: r, code: i } = await this.req.post("community/reply", s(t), Mt);
1442
1445
  return r ?? {
1443
1446
  error: i
1444
1447
  };
@@ -1474,7 +1477,7 @@ class ir {
1474
1477
  */
1475
1478
  async getMediaPresignUrl(t) {
1476
1479
  await this.token.autoLogin();
1477
- const { data: r } = await this.req.get("community/media-presign-url", Mt, {
1480
+ const { data: r } = await this.req.get("community/media-presign-url", Ht, {
1478
1481
  params: t
1479
1482
  });
1480
1483
  return r;
@@ -1488,7 +1491,7 @@ class ir {
1488
1491
  */
1489
1492
  async getNotifications(t) {
1490
1493
  await this.token.autoLogin();
1491
- const { data: r } = await this.req.get("community/notifications", jt, {
1494
+ const { data: r } = await this.req.get("community/notifications", zt, {
1492
1495
  params: s({ max_results: 20, ...t })
1493
1496
  });
1494
1497
  return r || { notifications: [] };
@@ -1500,7 +1503,7 @@ class ir {
1500
1503
  */
1501
1504
  async getUnreadNotificationsCount() {
1502
1505
  if (!await this.token.autoLogin()) return null;
1503
- const { data: t } = await this.req.get("community/unread-notifications-count", zt);
1506
+ const { data: t } = await this.req.get("community/unread-notifications-count", Jt);
1504
1507
  return t;
1505
1508
  }
1506
1509
  /**
@@ -1517,9 +1520,9 @@ class ir {
1517
1520
  function y(e) {
1518
1521
  return n(e, "openid", "unionid", "weixin_token");
1519
1522
  }
1520
- var Xt = /* @__PURE__ */ ((e) => (e.RedirectUriDisMatch = "10003", e.AppidError = "10016", e.AuthorizationError = "10015", e.NoRightForScope = "10005", e.Frequently = "10009", e.AppBanded = "10004", e.ShouldFllow = "10006", e.ScopeNull = "10010", e.RedirectUriNull = "10011", e.AppidNull = "10012", e.StateNull = "10013", e))(Xt || {});
1523
+ var Yt = /* @__PURE__ */ ((e) => (e.RedirectUriDisMatch = "10003", e.AppidError = "10016", e.AuthorizationError = "10015", e.NoRightForScope = "10005", e.Frequently = "10009", e.AppBanded = "10004", e.ShouldFllow = "10006", e.ScopeNull = "10010", e.RedirectUriNull = "10011", e.AppidNull = "10012", e.StateNull = "10013", e))(Yt || {});
1521
1524
  const P = "wx_login_cache";
1522
- class sr {
1525
+ class or {
1523
1526
  /**
1524
1527
  * 创建微信相关功能接口
1525
1528
  *
@@ -1642,26 +1645,26 @@ class sr {
1642
1645
  }
1643
1646
  }
1644
1647
  export {
1645
- tr as AuthToken,
1648
+ rr as AuthToken,
1646
1649
  Ue as CliamRewardStatus,
1647
- rr as ClubApi,
1650
+ nr as ClubApi,
1648
1651
  ye as ClubCreditChangeSence,
1649
1652
  we as ClubCreditChangeType,
1650
1653
  he as ClubItemType,
1651
1654
  ve as ClubRedemptionStatus,
1652
- ir as CommunityApi,
1655
+ sr as CommunityApi,
1653
1656
  be as EngageAccountType,
1654
- nr as EventApi,
1657
+ ir as EventApi,
1655
1658
  qe as EventPeriodType,
1656
1659
  a as FeatureType,
1657
- Jt as ForumMode,
1660
+ Kt as ForumMode,
1658
1661
  ke as GamerItemType,
1659
1662
  fe as Gender,
1660
1663
  Se as LotteryDrawAction,
1661
1664
  De as LotteryTicketStatus,
1662
- Nt as NotificationCategory,
1663
- Ot as NotificationType,
1664
- Kt as PostStatus,
1665
+ Ot as NotificationCategory,
1666
+ Xt as NotificationType,
1667
+ Nt as PostStatus,
1665
1668
  Re as QuestObjective,
1666
1669
  $e as RewardSoure,
1667
1670
  Ae as RewardStatusPrefix,
@@ -1670,7 +1673,7 @@ export {
1670
1673
  Ee as TeamAction,
1671
1674
  Pe as TeamVisibility,
1672
1675
  xe as VoteOptionSource,
1673
- sr as WeixinApi,
1674
- Xt as WeixinWebLoginErrorCode,
1676
+ or as WeixinApi,
1677
+ Yt as WeixinWebLoginErrorCode,
1675
1678
  Ge as isEventConfig
1676
1679
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@seayoo-web/gamer-api",
3
3
  "description": "agent for gamer api",
4
- "version": "1.1.12",
4
+ "version": "1.1.14",
5
5
  "type": "module",
6
6
  "source": "index.ts",
7
7
  "main": "./dist/index.js",
@@ -32,11 +32,15 @@
32
32
  "@seayoo-web/combo-webview": "^2.5.0",
33
33
  "@seayoo-web/utils": "^3.2.1"
34
34
  },
35
+ "dependencies": {
36
+ "vitest": "^3.0.5"
37
+ },
35
38
  "scripts": {
36
39
  "build": "vite build && tsc --emitDeclarationOnly",
37
40
  "type-check": "tsc --noEmit",
38
41
  "lint": "eslint ./src/**/*.ts",
39
42
  "lint:fix": "eslint \"./src/**/*.{ts,js}\" --fix",
40
- "prepublish": "pnpm lint:fix && pnpm build"
43
+ "test": "vitest",
44
+ "prepublish": "pnpm lint:fix && pnpm -w build"
41
45
  }
42
46
  }
@@ -31,15 +31,16 @@ export interface EventRewardItemConfig {
31
31
  /** 奖励道具评级,用于前端展示 */
32
32
  reward_item_rating: number;
33
33
  }
34
+ export interface RegularReward {
35
+ engage_count: number;
36
+ rewards: EventRewardItemConfig[];
37
+ }
34
38
  export type FeatureReward = {
35
39
  feature_reward_type: "every";
36
40
  reward_details: EventRewardItemConfig[];
37
41
  } | {
38
42
  feature_reward_type: "regular";
39
- reward_details: {
40
- engage_count: number;
41
- rewards: EventRewardItemConfig[];
42
- }[];
43
+ reward_details: RegularReward[];
43
44
  };
44
45
  export type NoopFeatureConfig = {} | null;
45
46
  export interface EventFeatureBaseConfig<T extends FeatureType = FeatureType, C extends object | null = object> {