@seayoo-web/gamer-api 1.1.7 → 1.1.8
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/README.md +1 -1
- package/dist/index.js +220 -183
- package/package.json +4 -4
- package/types/src/event.d.ts +24 -0
- package/types/src/event.define.d.ts +35 -1
- package/types/src/event.enums.d.ts +20 -4
- package/types/src/event.guards.d.ts +6 -1
- package/types/src/token.d.ts +5 -1
- package/types/src/utils.d.ts +1 -1
- package/types/src/weixin.d.ts +4 -0
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ import { AuthToken, EventApi, ClubApi, CommunityApi } from "@seayoo-web/gamer-ap
|
|
|
8
8
|
import { captureException } from "@sentry/vue";
|
|
9
9
|
|
|
10
10
|
const authToken = new AuthToken(SY_GAMER_API, NetRequest);
|
|
11
|
-
const eventApi = new EventApi(authToken,
|
|
11
|
+
const eventApi = new EventApi(authToken, SY_EVENT_ID);
|
|
12
12
|
const clubApi = new ClubApi(authToken);
|
|
13
13
|
const communityApi = new CommunityApi(authToken);
|
|
14
14
|
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var V = Object.defineProperty;
|
|
|
2
2
|
var Q = (e, t, r) => t in e ? V(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var u = (e, t, r) => Q(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import { isComboWebView as T } from "@seayoo-web/combo-webview";
|
|
5
|
-
import { isPlainObject as n, useConsole as M, Support as m, usePromise as H, pruneURL as j, queryString as h, pruneObject as s, isArray as
|
|
5
|
+
import { isPlainObject as n, useConsole as M, Support as m, usePromise as H, pruneURL as j, queryString as h, pruneObject as s, isArray as o, isString as z, isValuedString as J, parseJSON as K, removePara as A } from "@seayoo-web/utils";
|
|
6
6
|
import "@seayoo-web/request";
|
|
7
7
|
function N(e) {
|
|
8
8
|
return n(e, "gamer_token") && typeof e.gamer_token == "string";
|
|
@@ -59,7 +59,7 @@ const Y = {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}, _ = "gamer_token";
|
|
62
|
-
class
|
|
62
|
+
class tr {
|
|
63
63
|
constructor(t, r) {
|
|
64
64
|
u(this, "$idToken", "");
|
|
65
65
|
u(this, "$weixinToken", "");
|
|
@@ -148,6 +148,8 @@ class Yt {
|
|
|
148
148
|
* - 此方法通常不需要手动调用,在需要登录的接口调用时会自动执行
|
|
149
149
|
* - 为了提高页面执行速度,可以在设置 Token 后立即调用 autoLogin
|
|
150
150
|
*
|
|
151
|
+
* 🔕请求静默进行,无消息提示
|
|
152
|
+
*
|
|
151
153
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=ReeJpWraRO
|
|
152
154
|
*/
|
|
153
155
|
async autoLogin() {
|
|
@@ -174,7 +176,9 @@ class Yt {
|
|
|
174
176
|
return this.gamerToken = (r == null ? void 0 : r.gamer_token) || "", !!this.gamerToken;
|
|
175
177
|
}
|
|
176
178
|
/**
|
|
177
|
-
*
|
|
179
|
+
* 获取当前登录用户的 Session 的信息
|
|
180
|
+
*
|
|
181
|
+
* 🔕请求静默进行,无消息提示
|
|
178
182
|
*
|
|
179
183
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=OdGVCdQxEu
|
|
180
184
|
*/
|
|
@@ -231,7 +235,7 @@ function ee(e) {
|
|
|
231
235
|
function C(e) {
|
|
232
236
|
return n(e, "player") && ee(e.player);
|
|
233
237
|
}
|
|
234
|
-
function
|
|
238
|
+
function D(e) {
|
|
235
239
|
return n(
|
|
236
240
|
e,
|
|
237
241
|
"role_id",
|
|
@@ -243,15 +247,15 @@ function S(e) {
|
|
|
243
247
|
) && z(e.server_id) && J(e.role_id);
|
|
244
248
|
}
|
|
245
249
|
function te(e) {
|
|
246
|
-
return n(e, "roles") &&
|
|
250
|
+
return n(e, "roles") && o(e.roles, D);
|
|
247
251
|
}
|
|
248
252
|
function re(e) {
|
|
249
|
-
return
|
|
253
|
+
return D(e) && n(e, "role_fighting");
|
|
250
254
|
}
|
|
251
255
|
function f(e) {
|
|
252
256
|
return n(e, "role_card") && re(e.role_card);
|
|
253
257
|
}
|
|
254
|
-
function
|
|
258
|
+
function U(e) {
|
|
255
259
|
return n(e, "name", "avatar_url", "bio", "gender", "birthday") && n(e.birthday, "year", "month", "day");
|
|
256
260
|
}
|
|
257
261
|
function v(e) {
|
|
@@ -268,7 +272,7 @@ function v(e) {
|
|
|
268
272
|
);
|
|
269
273
|
}
|
|
270
274
|
function ne(e) {
|
|
271
|
-
return n(e, "addresses") &&
|
|
275
|
+
return n(e, "addresses") && o(e.addresses, v);
|
|
272
276
|
}
|
|
273
277
|
function ie(e) {
|
|
274
278
|
return n(
|
|
@@ -291,7 +295,7 @@ function se(e) {
|
|
|
291
295
|
);
|
|
292
296
|
}
|
|
293
297
|
function oe(e) {
|
|
294
|
-
return n(e, "credit_logs") &&
|
|
298
|
+
return n(e, "credit_logs") && o(e.credit_logs, se);
|
|
295
299
|
}
|
|
296
300
|
function ae(e) {
|
|
297
301
|
return n(
|
|
@@ -307,7 +311,7 @@ function ae(e) {
|
|
|
307
311
|
);
|
|
308
312
|
}
|
|
309
313
|
function ue(e) {
|
|
310
|
-
return n(e, "benefits") &&
|
|
314
|
+
return n(e, "benefits") && o(e.benefits, ae);
|
|
311
315
|
}
|
|
312
316
|
function ce(e) {
|
|
313
317
|
return n(
|
|
@@ -319,12 +323,12 @@ function ce(e) {
|
|
|
319
323
|
"min_level",
|
|
320
324
|
"max_level",
|
|
321
325
|
"product_id"
|
|
322
|
-
) && ("product" in e ?
|
|
326
|
+
) && ("product" in e ? E(e.product) : !0);
|
|
323
327
|
}
|
|
324
328
|
function me(e) {
|
|
325
329
|
return n(e, "benefit") && ce(e.benefit);
|
|
326
330
|
}
|
|
327
|
-
function
|
|
331
|
+
function E(e) {
|
|
328
332
|
return n(
|
|
329
333
|
e,
|
|
330
334
|
"product_id",
|
|
@@ -354,7 +358,7 @@ function D(e) {
|
|
|
354
358
|
);
|
|
355
359
|
}
|
|
356
360
|
function le(e) {
|
|
357
|
-
return n(e, "products") &&
|
|
361
|
+
return n(e, "products") && o(e.products, E);
|
|
358
362
|
}
|
|
359
363
|
function _e(e) {
|
|
360
364
|
return n(
|
|
@@ -390,10 +394,10 @@ function de(e) {
|
|
|
390
394
|
return n(e, "server_id", "role_id", "role_name");
|
|
391
395
|
}
|
|
392
396
|
function pe(e) {
|
|
393
|
-
return n(e, "redemptions") &&
|
|
397
|
+
return n(e, "redemptions") && o(e.redemptions, _e);
|
|
394
398
|
}
|
|
395
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 || {});
|
|
396
|
-
class
|
|
400
|
+
class rr {
|
|
397
401
|
constructor(t) {
|
|
398
402
|
u(this, "token");
|
|
399
403
|
u(this, "req");
|
|
@@ -485,7 +489,7 @@ class Zt {
|
|
|
485
489
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=TMWBCFcOr2
|
|
486
490
|
*/
|
|
487
491
|
async getUserProfile(t) {
|
|
488
|
-
const { data: r } = await this.req.get("club/user-profile",
|
|
492
|
+
const { data: r } = await this.req.get("club/user-profile", U, {
|
|
489
493
|
params: { member_id: t }
|
|
490
494
|
});
|
|
491
495
|
return r;
|
|
@@ -497,7 +501,7 @@ class Zt {
|
|
|
497
501
|
*/
|
|
498
502
|
async updateUserProfile(t) {
|
|
499
503
|
await this.token.autoLogin();
|
|
500
|
-
const { data: r, code: i } = await this.req.post("club/user-profile", t,
|
|
504
|
+
const { data: r, code: i } = await this.req.post("club/user-profile", t, U);
|
|
501
505
|
return r ?? {
|
|
502
506
|
error: i
|
|
503
507
|
};
|
|
@@ -620,45 +624,45 @@ class Zt {
|
|
|
620
624
|
return r || { redemptions: [] };
|
|
621
625
|
}
|
|
622
626
|
}
|
|
623
|
-
var ke = /* @__PURE__ */ ((e) => (e.EventItem = "event_item", e.GameItem = "game_item", e.PhysicalItem = "physical_item", e.WeixinHongbao = "weixin_hongbao", e.GiftCode = "gift_code", e.LotteryTicket = "lottery_ticket", e.VoidItem = "void_item", e))(ke || {}), be = /* @__PURE__ */ ((e) => (e.UserId = "user_id", e.RoleId = "role_id", e))(be || {}), qe = /* @__PURE__ */ ((e) => (e.None = "none", e.Daily = "daily", e.Weekly = "weekly", e.Monthly = "monthly", e))(qe || {}),
|
|
624
|
-
function Ee(e) {
|
|
625
|
-
return n(e, "event_name", "rules", "since", "until", "features") && Array.isArray(e.features) && e.features.every(Ge);
|
|
626
|
-
}
|
|
627
|
+
var ke = /* @__PURE__ */ ((e) => (e.EventItem = "event_item", e.GameItem = "game_item", e.PhysicalItem = "physical_item", e.WeixinHongbao = "weixin_hongbao", e.GiftCode = "gift_code", e.LotteryTicket = "lottery_ticket", e.VoidItem = "void_item", e))(ke || {}), be = /* @__PURE__ */ ((e) => (e.UserId = "user_id", e.RoleId = "role_id", e))(be || {}), qe = /* @__PURE__ */ ((e) => (e.None = "none", e.Daily = "daily", e.Weekly = "weekly", e.Monthly = "monthly", e))(qe || {}), a = /* @__PURE__ */ ((e) => (e.Preregister = "preregister", e.Lottery = "lottery", e.Survey = "survey", e.Invite = "invite", e.Share = "share", e.Follow = "follow", e.Subscribe = "weixin_subscribe", e.Comment = "comment", e.Vote = "vote", e.GiftCode = "gift_code", e.Register = "register", e.InvitedRegister = "invited_register", e.ClaimRewards = "claim_rewards", e.Cashback = "cashback", e.Quest = "quest", e.Team = "team", e.LotteryDraw = "lottery_draw", e))(a || {}), Re = /* @__PURE__ */ ((e) => (e.Active = "player_active_points", e.Login = "player_login_days", e.OrderAmount = "order_total_amount", e.Posts = "community_posts", e.Comments = "community_comments", e))(Re || {}), xe = /* @__PURE__ */ ((e) => (e.System = "system", e.UserSubmission = "user_submission", e.Shortlisted = "shortlisted", e))(xe || {}), Ae = /* @__PURE__ */ ((e) => (e.Ineligible = "ineligible", e.Unclaimed = "unaccalimed", e.Received = "received", e))(Ae || {}), Le = /* @__PURE__ */ ((e) => (e.Unclaimed = "unaccalimed", e.Received = "received", e.Failed = "failed", e.Delivered = "delivered", e))(Le || {}), Ce = /* @__PURE__ */ ((e) => (e.Unclaimed = "unclaimed", e.Received = "received", e.Failed = "failed", e.Delivered = "delivered", e))(Ce || {}), Ue = /* @__PURE__ */ ((e) => (e.Ineligible = "ineligible", e.Unaccalimed = "unaccalimed", e.Received = "received", e.Failed = "failed", e))(Ue || {}), $e = /* @__PURE__ */ ((e) => (e.Output = "output", e.Engage = "engage", e))($e || {}), Pe = /* @__PURE__ */ ((e) => (e.Private = "private", e.Public = "public", e))(Pe || {}), De = /* @__PURE__ */ ((e) => (e.Unknown = "unknown", e.Pending = "pending", e.Drawn = "drawn", e.Claimed = "claimed", e.Fail = "fail", e))(De || {}), Ee = /* @__PURE__ */ ((e) => (e.Assemble = "assemble", e.Join = "join", e.Disband = "disband", e.ChangeVisibility = "change_visibility", e.Query = "query", e))(Ee || {}), Se = /* @__PURE__ */ ((e) => (e.Query = "query", e.Draw = "draw", e.Claim = "claim", e))(Se || {});
|
|
627
628
|
function Ge(e) {
|
|
628
|
-
|
|
629
|
+
return n(e, "event_name", "rules", "since", "until", "features") && Array.isArray(e.features) && e.features.every(Fe);
|
|
630
|
+
}
|
|
631
|
+
function Fe(e) {
|
|
632
|
+
if (!Be(e))
|
|
629
633
|
return !1;
|
|
630
634
|
switch (e.feature_type) {
|
|
631
|
-
case
|
|
632
|
-
case
|
|
633
|
-
case
|
|
634
|
-
case
|
|
635
|
+
case a.Preregister:
|
|
636
|
+
case a.ClaimRewards:
|
|
637
|
+
case a.Register:
|
|
638
|
+
case a.InvitedRegister:
|
|
635
639
|
return !0;
|
|
636
|
-
case
|
|
637
|
-
return Ve(e.config);
|
|
638
|
-
case o.Survey:
|
|
640
|
+
case a.Lottery:
|
|
639
641
|
return Qe(e.config);
|
|
640
|
-
case
|
|
642
|
+
case a.Survey:
|
|
641
643
|
return Te(e.config);
|
|
642
|
-
case
|
|
644
|
+
case a.Invite:
|
|
643
645
|
return Me(e.config);
|
|
644
|
-
case
|
|
646
|
+
case a.Share:
|
|
645
647
|
return He(e.config);
|
|
646
|
-
case
|
|
648
|
+
case a.Follow:
|
|
647
649
|
return je(e.config);
|
|
648
|
-
case
|
|
650
|
+
case a.Subscribe:
|
|
649
651
|
return ze(e.config);
|
|
650
|
-
case
|
|
652
|
+
case a.Comment:
|
|
651
653
|
return Je(e.config);
|
|
652
|
-
case
|
|
653
|
-
return
|
|
654
|
-
case
|
|
654
|
+
case a.Vote:
|
|
655
|
+
return Ke(e.config);
|
|
656
|
+
case a.Cashback:
|
|
655
657
|
return Oe(e.config);
|
|
656
|
-
case
|
|
657
|
-
return
|
|
658
|
-
case
|
|
658
|
+
case a.GiftCode:
|
|
659
|
+
return Xe(e.config);
|
|
660
|
+
case a.Quest:
|
|
659
661
|
return Ze(e.config);
|
|
660
|
-
case
|
|
662
|
+
case a.Team:
|
|
661
663
|
return We(e.config);
|
|
664
|
+
case a.LotteryDraw:
|
|
665
|
+
return et(e.config);
|
|
662
666
|
default:
|
|
663
667
|
return !1;
|
|
664
668
|
}
|
|
@@ -674,10 +678,10 @@ function k(e) {
|
|
|
674
678
|
"reward_item_rating"
|
|
675
679
|
);
|
|
676
680
|
}
|
|
677
|
-
function
|
|
681
|
+
function Ie(e) {
|
|
678
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);
|
|
679
683
|
}
|
|
680
|
-
function
|
|
684
|
+
function Be(e) {
|
|
681
685
|
return n(
|
|
682
686
|
e,
|
|
683
687
|
"feature_id",
|
|
@@ -689,9 +693,9 @@ function Ie(e) {
|
|
|
689
693
|
"since",
|
|
690
694
|
"until",
|
|
691
695
|
"engage_account"
|
|
692
|
-
) && ("feature_rewards" in e ?
|
|
696
|
+
) && ("feature_rewards" in e ? Ie(e.feature_rewards) : !0);
|
|
693
697
|
}
|
|
694
|
-
function
|
|
698
|
+
function Ve(e) {
|
|
695
699
|
return n(
|
|
696
700
|
e,
|
|
697
701
|
"reward_item_id",
|
|
@@ -702,7 +706,7 @@ function Be(e) {
|
|
|
702
706
|
"reward_remaining_stock"
|
|
703
707
|
);
|
|
704
708
|
}
|
|
705
|
-
function
|
|
709
|
+
function Qe(e) {
|
|
706
710
|
return n(
|
|
707
711
|
e,
|
|
708
712
|
"consume_item_id",
|
|
@@ -710,27 +714,27 @@ function Ve(e) {
|
|
|
710
714
|
"consume_item_icon_url",
|
|
711
715
|
"consume_item_count",
|
|
712
716
|
"rewards"
|
|
713
|
-
) && Array.isArray(e.rewards) && e.rewards.every(
|
|
717
|
+
) && Array.isArray(e.rewards) && e.rewards.every(Ve);
|
|
714
718
|
}
|
|
715
|
-
function
|
|
719
|
+
function Te(e) {
|
|
716
720
|
return n(e, "survey_id", "survey_url");
|
|
717
721
|
}
|
|
718
|
-
function
|
|
722
|
+
function Me(e) {
|
|
719
723
|
return n(e, "share_url");
|
|
720
724
|
}
|
|
721
|
-
function
|
|
725
|
+
function He(e) {
|
|
722
726
|
return n(e, "share_platform");
|
|
723
727
|
}
|
|
724
|
-
function
|
|
728
|
+
function je(e) {
|
|
725
729
|
return n(e, "platform");
|
|
726
730
|
}
|
|
727
|
-
function
|
|
731
|
+
function ze(e) {
|
|
728
732
|
return n(e, "weixin_template_ids") && Array.isArray(e.weixin_template_ids) && e.weixin_template_ids.every((t) => typeof t == "string");
|
|
729
733
|
}
|
|
730
|
-
function
|
|
734
|
+
function Je(e) {
|
|
731
735
|
return n(e, "comments", "send_rate") && Array.isArray(e.comments) && e.comments.every((t) => typeof t == "string");
|
|
732
736
|
}
|
|
733
|
-
function
|
|
737
|
+
function Ke(e) {
|
|
734
738
|
return n(
|
|
735
739
|
e,
|
|
736
740
|
"vote_feature_ids",
|
|
@@ -739,12 +743,12 @@ function Je(e) {
|
|
|
739
743
|
"source",
|
|
740
744
|
"options",
|
|
741
745
|
"rewards"
|
|
742
|
-
) && Array.isArray(e.vote_feature_ids) && Array.isArray(e.submission_feature_ids) && Array.isArray(e.options) && e.options.every(
|
|
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);
|
|
743
747
|
}
|
|
744
|
-
function
|
|
748
|
+
function Ne(e) {
|
|
745
749
|
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);
|
|
746
750
|
}
|
|
747
|
-
function
|
|
751
|
+
function Oe(e) {
|
|
748
752
|
return n(
|
|
749
753
|
e,
|
|
750
754
|
"order_start_time",
|
|
@@ -753,42 +757,42 @@ function Ne(e) {
|
|
|
753
757
|
"claim_rewards_end_time"
|
|
754
758
|
);
|
|
755
759
|
}
|
|
756
|
-
function Oe(e) {
|
|
757
|
-
return n(e, "gift_items") && Array.isArray(e.gift_items) && e.gift_items.every(Xe);
|
|
758
|
-
}
|
|
759
760
|
function Xe(e) {
|
|
760
|
-
return n(e, "
|
|
761
|
+
return n(e, "gift_items") && Array.isArray(e.gift_items) && e.gift_items.every(Ye);
|
|
761
762
|
}
|
|
762
763
|
function Ye(e) {
|
|
763
|
-
return n(e, "
|
|
764
|
+
return n(e, "name", "count", "icon_url");
|
|
764
765
|
}
|
|
765
766
|
function Ze(e) {
|
|
766
|
-
return n(e, "
|
|
767
|
+
return n(e, "objective", "completion_value") && ("team" in e ? n(e.team, "completion_value") : !0);
|
|
767
768
|
}
|
|
768
769
|
function We(e) {
|
|
769
|
-
return n(e, "
|
|
770
|
+
return n(e, "min_members", "max_members");
|
|
770
771
|
}
|
|
771
772
|
function et(e) {
|
|
773
|
+
return n(e, "draw_not_after", "draw_not_before");
|
|
774
|
+
}
|
|
775
|
+
function tt(e) {
|
|
772
776
|
return n(e, "allowed", "registered");
|
|
773
777
|
}
|
|
774
778
|
function w(e) {
|
|
775
779
|
return n(e, "count");
|
|
776
780
|
}
|
|
777
|
-
function
|
|
781
|
+
function rt(e) {
|
|
778
782
|
return n(e, "engagements") && Array.isArray(e.engagements) && (e.engagements.every(
|
|
779
783
|
(t) => n(t, "user_id", "name", "avatar_url", "comment", "video_note", "created_at")
|
|
780
784
|
) || e.engagements.every((t) => n(t, "team_code", "leader_name", "total_members")));
|
|
781
785
|
}
|
|
782
|
-
function
|
|
786
|
+
function nt(e) {
|
|
783
787
|
return n(e, "first_visit") && typeof e.first_visit == "boolean";
|
|
784
788
|
}
|
|
785
|
-
function
|
|
789
|
+
function it(e) {
|
|
786
790
|
return n(e, "status") && Array.isArray(e.status) && e.status.every((t) => n(t, "feature_id", "can_engage", "has_unclaimed_rewards"));
|
|
787
791
|
}
|
|
788
|
-
function
|
|
789
|
-
return n(e, "engagements") &&
|
|
792
|
+
function st(e) {
|
|
793
|
+
return n(e, "engagements") && o(e.engagements, S);
|
|
790
794
|
}
|
|
791
|
-
function
|
|
795
|
+
function S(e) {
|
|
792
796
|
if (!n(
|
|
793
797
|
e,
|
|
794
798
|
"engagement_id",
|
|
@@ -808,41 +812,61 @@ function E(e) {
|
|
|
808
812
|
if (!("data" in e))
|
|
809
813
|
return !0;
|
|
810
814
|
const t = e.data;
|
|
811
|
-
return
|
|
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);
|
|
812
816
|
}
|
|
813
|
-
function
|
|
817
|
+
function ot(e) {
|
|
818
|
+
return n(e, "engagements") && o(e.engagements, at);
|
|
819
|
+
}
|
|
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);
|
|
822
|
+
}
|
|
823
|
+
function ut(e) {
|
|
824
|
+
return n(
|
|
825
|
+
e,
|
|
826
|
+
"reward_id",
|
|
827
|
+
"reward_item_id",
|
|
828
|
+
"reward_item_name",
|
|
829
|
+
"reward_source",
|
|
830
|
+
"reward_item_type",
|
|
831
|
+
"reward_item_icon_url",
|
|
832
|
+
"reward_count",
|
|
833
|
+
"reward_status",
|
|
834
|
+
"receive_time"
|
|
835
|
+
) && ("extra_data" in e ? n(e.extra_data) : !0);
|
|
836
|
+
}
|
|
837
|
+
function ct(e) {
|
|
814
838
|
return n(e, "platforms") && Array.isArray(e.platforms);
|
|
815
839
|
}
|
|
816
|
-
function
|
|
840
|
+
function mt(e) {
|
|
817
841
|
return n(e, "lottery_count");
|
|
818
842
|
}
|
|
819
|
-
function
|
|
843
|
+
function lt(e) {
|
|
820
844
|
return n(e, "serial_number");
|
|
821
845
|
}
|
|
822
|
-
function
|
|
846
|
+
function _t(e) {
|
|
823
847
|
return n(e, "user_id");
|
|
824
848
|
}
|
|
825
|
-
function
|
|
849
|
+
function gt(e) {
|
|
826
850
|
return n(e, "platform");
|
|
827
851
|
}
|
|
828
|
-
function
|
|
852
|
+
function dt(e) {
|
|
829
853
|
return n(e, "option_sn");
|
|
830
854
|
}
|
|
831
|
-
function
|
|
855
|
+
function pt(e) {
|
|
832
856
|
return n(e, "weixin_openid");
|
|
833
857
|
}
|
|
834
|
-
function
|
|
858
|
+
function ft(e) {
|
|
835
859
|
return n(e, "cashback_total_amount", "game_item_count", "order_total_amount");
|
|
836
860
|
}
|
|
837
|
-
function
|
|
861
|
+
function wt(e) {
|
|
838
862
|
return n(e, "gift_code");
|
|
839
863
|
}
|
|
840
|
-
function
|
|
864
|
+
function yt(e) {
|
|
841
865
|
return n(e, "team_code", "visibility", "members") && Array.isArray(e.members) && e.members.every(
|
|
842
866
|
(t) => n(t, "is_leader", "role_name", "server_name")
|
|
843
867
|
);
|
|
844
868
|
}
|
|
845
|
-
function
|
|
869
|
+
function ht(e) {
|
|
846
870
|
return n(e, "objective", "progress") ? "team" in e ? n(e.team, "progress", "players") && Array.isArray(e.team.players) && e.team.players.every(
|
|
847
871
|
(t) => n(
|
|
848
872
|
t,
|
|
@@ -871,10 +895,10 @@ function G(e) {
|
|
|
871
895
|
"receive_time"
|
|
872
896
|
) && ("extra_data" in e ? n(e.extra_data) : !0);
|
|
873
897
|
}
|
|
874
|
-
function
|
|
898
|
+
function vt(e) {
|
|
875
899
|
return !n(e, "tickets") || !("status" in e) ? !1 : e.status === "unknown" || e.status === "pending" ? !0 : "reward" in e ? G(e.reward) : !1;
|
|
876
900
|
}
|
|
877
|
-
function
|
|
901
|
+
function kt(e) {
|
|
878
902
|
return n(
|
|
879
903
|
e,
|
|
880
904
|
"reward_id",
|
|
@@ -887,31 +911,31 @@ function wt(e) {
|
|
|
887
911
|
"reward_source"
|
|
888
912
|
);
|
|
889
913
|
}
|
|
890
|
-
function
|
|
891
|
-
return n(e, "engagement_id") && ("engagement" in e ?
|
|
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);
|
|
892
916
|
}
|
|
893
|
-
function
|
|
917
|
+
function qt(e) {
|
|
894
918
|
return n(e, "reward_id", "reward_status");
|
|
895
919
|
}
|
|
896
|
-
function
|
|
897
|
-
return n(e, "claimed_items") &&
|
|
920
|
+
function Rt(e) {
|
|
921
|
+
return n(e, "claimed_items") && o(e.claimed_items, qt);
|
|
898
922
|
}
|
|
899
|
-
function
|
|
923
|
+
function xt(e) {
|
|
900
924
|
return n(e, "reward_status");
|
|
901
925
|
}
|
|
902
|
-
function
|
|
903
|
-
return n(e, "user_rewards") &&
|
|
926
|
+
function At(e) {
|
|
927
|
+
return n(e, "user_rewards") && o(e.user_rewards, G);
|
|
904
928
|
}
|
|
905
|
-
function
|
|
929
|
+
function Lt(e) {
|
|
906
930
|
return n(e, "scene");
|
|
907
931
|
}
|
|
908
|
-
function
|
|
932
|
+
function Ct(e) {
|
|
909
933
|
return n(e, "params");
|
|
910
934
|
}
|
|
911
|
-
function
|
|
935
|
+
function Ut(e) {
|
|
912
936
|
return n(e, "img") && typeof e.img == "string";
|
|
913
937
|
}
|
|
914
|
-
class
|
|
938
|
+
class nr {
|
|
915
939
|
constructor(t, r) {
|
|
916
940
|
u(this, "token");
|
|
917
941
|
u(this, "event", 0);
|
|
@@ -924,7 +948,7 @@ class Wt {
|
|
|
924
948
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=OWGSPF3Ysl
|
|
925
949
|
*/
|
|
926
950
|
async verifyMobileAllowed(t) {
|
|
927
|
-
const { data: r } = await this.req.get("verify-mobile-allowed",
|
|
951
|
+
const { data: r } = await this.req.get("verify-mobile-allowed", tt, {
|
|
928
952
|
params: { mobile: t }
|
|
929
953
|
});
|
|
930
954
|
return r;
|
|
@@ -935,7 +959,7 @@ class Wt {
|
|
|
935
959
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=wFXxtdNKPm
|
|
936
960
|
*/
|
|
937
961
|
async getConfig() {
|
|
938
|
-
const { data: t } = await this.req.get(`event/${this.event}/event-config`,
|
|
962
|
+
const { data: t } = await this.req.get(`event/${this.event}/event-config`, Ge);
|
|
939
963
|
return t;
|
|
940
964
|
}
|
|
941
965
|
/**
|
|
@@ -966,7 +990,7 @@ class Wt {
|
|
|
966
990
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=THtZ4ewIQW
|
|
967
991
|
*/
|
|
968
992
|
async getEngagements(t) {
|
|
969
|
-
const { data: r } = await this.req.get(`event/${this.event}/feature-engagements`,
|
|
993
|
+
const { data: r } = await this.req.get(`event/${this.event}/feature-engagements`, rt, {
|
|
970
994
|
params: { feature_id: t }
|
|
971
995
|
});
|
|
972
996
|
return (r == null ? void 0 : r.engagements) || [];
|
|
@@ -981,7 +1005,7 @@ class Wt {
|
|
|
981
1005
|
const { data: r, code: i } = await this.req.post(
|
|
982
1006
|
`event/${this.event}/visit`,
|
|
983
1007
|
s(t || {}),
|
|
984
|
-
|
|
1008
|
+
nt
|
|
985
1009
|
);
|
|
986
1010
|
return r ?? {
|
|
987
1011
|
error: i
|
|
@@ -992,11 +1016,13 @@ class Wt {
|
|
|
992
1016
|
*
|
|
993
1017
|
* 💡活动下包含 engage_account_type 为 role_id 的玩法时,前端需要提供 server_id 和 role_id
|
|
994
1018
|
*
|
|
1019
|
+
* 🔕请求静默进行,无消息提示
|
|
1020
|
+
*
|
|
995
1021
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=WzX5BrMNpL
|
|
996
1022
|
*/
|
|
997
1023
|
async getUserFeatureStatus(t) {
|
|
998
1024
|
if (!await this.token.autoLogin()) return [];
|
|
999
|
-
const { data: r } = await this.req.get("event/user-feature-status",
|
|
1025
|
+
const { data: r } = await this.req.get("event/user-feature-status", it, {
|
|
1000
1026
|
params: s({ ...t, event_id: this.event }),
|
|
1001
1027
|
message: !1
|
|
1002
1028
|
});
|
|
@@ -1006,14 +1032,28 @@ class Wt {
|
|
|
1006
1032
|
* 获取当前登录用户参与某个玩法的记录
|
|
1007
1033
|
*
|
|
1008
1034
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=WSbAeDZc8F
|
|
1035
|
+
*
|
|
1036
|
+
* @deprecated 请改用 getUserEngagementsV2
|
|
1009
1037
|
*/
|
|
1010
1038
|
async getUserEngagements(t) {
|
|
1011
1039
|
if (!await this.token.autoLogin()) return [];
|
|
1012
|
-
const { data: r } = await this.req.get(`event/${this.event}/user-engagements`,
|
|
1040
|
+
const { data: r } = await this.req.get(`event/${this.event}/user-engagements`, st, {
|
|
1013
1041
|
params: { feature_id: t }
|
|
1014
1042
|
});
|
|
1015
1043
|
return (r == null ? void 0 : r.engagements) || [];
|
|
1016
1044
|
}
|
|
1045
|
+
/**
|
|
1046
|
+
* 获取当前登录用户参与某个玩法的记录
|
|
1047
|
+
*
|
|
1048
|
+
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=NFDdV1dwWb
|
|
1049
|
+
*/
|
|
1050
|
+
async getUserEngagementsV2(t, r) {
|
|
1051
|
+
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 })
|
|
1054
|
+
});
|
|
1055
|
+
return (i == null ? void 0 : i.engagements) || [];
|
|
1056
|
+
}
|
|
1017
1057
|
/**
|
|
1018
1058
|
* 用户参与某个玩法(需要先调用 visit 接口)
|
|
1019
1059
|
*
|
|
@@ -1021,7 +1061,7 @@ class Wt {
|
|
|
1021
1061
|
*/
|
|
1022
1062
|
async engage(t) {
|
|
1023
1063
|
await this.token.autoLogin();
|
|
1024
|
-
const { data: r, code: i } = await this.req.post(`event/${this.event}/engage`, s(t),
|
|
1064
|
+
const { data: r, code: i } = await this.req.post(`event/${this.event}/engage`, s(t), bt);
|
|
1025
1065
|
return r ?? {
|
|
1026
1066
|
error: i
|
|
1027
1067
|
};
|
|
@@ -1036,7 +1076,7 @@ class Wt {
|
|
|
1036
1076
|
const { data: r, code: i } = await this.req.post(
|
|
1037
1077
|
`event/${this.event}/claim-rewards`,
|
|
1038
1078
|
s(t),
|
|
1039
|
-
|
|
1079
|
+
Rt
|
|
1040
1080
|
);
|
|
1041
1081
|
return (r == null ? void 0 : r.claimed_items) ?? {
|
|
1042
1082
|
error: i
|
|
@@ -1052,7 +1092,7 @@ class Wt {
|
|
|
1052
1092
|
const { data: r, code: i } = await this.req.post(
|
|
1053
1093
|
`event/${this.event}/claim-weixin-hongbao`,
|
|
1054
1094
|
{ reward_id: t },
|
|
1055
|
-
|
|
1095
|
+
xt
|
|
1056
1096
|
);
|
|
1057
1097
|
return r ?? {
|
|
1058
1098
|
error: i
|
|
@@ -1068,7 +1108,7 @@ class Wt {
|
|
|
1068
1108
|
const { data: r } = await this.req.post(
|
|
1069
1109
|
"event/user-rewards",
|
|
1070
1110
|
s({ ...t, event_id: this.event }),
|
|
1071
|
-
|
|
1111
|
+
At
|
|
1072
1112
|
);
|
|
1073
1113
|
return (r == null ? void 0 : r.user_rewards) || [];
|
|
1074
1114
|
}
|
|
@@ -1103,7 +1143,7 @@ class Wt {
|
|
|
1103
1143
|
*/
|
|
1104
1144
|
async getUnlimitQrcodeScene(t) {
|
|
1105
1145
|
if (!await this.token.autoLogin()) return null;
|
|
1106
|
-
const { data: r } = await this.req.get("event/unlimit-qrcode-scene",
|
|
1146
|
+
const { data: r } = await this.req.get("event/unlimit-qrcode-scene", Lt, {
|
|
1107
1147
|
params: { params: t }
|
|
1108
1148
|
});
|
|
1109
1149
|
return (r == null ? void 0 : r.scene) ?? null;
|
|
@@ -1116,7 +1156,7 @@ class Wt {
|
|
|
1116
1156
|
* @param scene - 小程序码 scene 值
|
|
1117
1157
|
*/
|
|
1118
1158
|
async getParamsByQrcodeScene(t) {
|
|
1119
|
-
const { data: r } = await this.req.get("event/params-by-qrcode-scene",
|
|
1159
|
+
const { data: r } = await this.req.get("event/params-by-qrcode-scene", Ct, {
|
|
1120
1160
|
params: { scene: t }
|
|
1121
1161
|
});
|
|
1122
1162
|
return (r == null ? void 0 : r.params) ?? null;
|
|
@@ -1128,23 +1168,23 @@ class Wt {
|
|
|
1128
1168
|
*/
|
|
1129
1169
|
async generateUnlimitQrcode(t) {
|
|
1130
1170
|
if (!await this.token.autoLogin()) return null;
|
|
1131
|
-
const { data: r } = await this.req.post("event/unlimit-qrcode", s(t),
|
|
1171
|
+
const { data: r } = await this.req.post("event/unlimit-qrcode", s(t), Ut);
|
|
1132
1172
|
return (r == null ? void 0 : r.img) ?? null;
|
|
1133
1173
|
}
|
|
1134
1174
|
}
|
|
1135
1175
|
function F(e) {
|
|
1136
1176
|
return n(e, "forum_id", "icon_url", "name", "tags", "sort", "mode", "member_ids") && Array.isArray(e.tags) && Array.isArray(e.member_ids);
|
|
1137
1177
|
}
|
|
1138
|
-
function
|
|
1139
|
-
return n(e, "forums") &&
|
|
1178
|
+
function $t(e) {
|
|
1179
|
+
return n(e, "forums") && o(e.forums, F);
|
|
1140
1180
|
}
|
|
1141
1181
|
function b(e) {
|
|
1142
1182
|
return n(e, "topic_id", "cover_url", "name", "description", "tags", "post_num") && Array.isArray(e.tags);
|
|
1143
1183
|
}
|
|
1144
|
-
function
|
|
1145
|
-
return n(e, "topics") &&
|
|
1184
|
+
function Pt(e) {
|
|
1185
|
+
return n(e, "topics") && o(e.topics, b);
|
|
1146
1186
|
}
|
|
1147
|
-
function
|
|
1187
|
+
function Dt(e) {
|
|
1148
1188
|
return n(e, "topic") && b(e.topic);
|
|
1149
1189
|
}
|
|
1150
1190
|
function q(e) {
|
|
@@ -1167,18 +1207,18 @@ function q(e) {
|
|
|
1167
1207
|
"is_highlighted",
|
|
1168
1208
|
"status",
|
|
1169
1209
|
"create_time"
|
|
1170
|
-
) &&
|
|
1210
|
+
) && o(e.topics, b) && F(e.forum);
|
|
1171
1211
|
}
|
|
1172
|
-
function
|
|
1173
|
-
return n(e, "next_token", "posts") &&
|
|
1212
|
+
function $(e) {
|
|
1213
|
+
return n(e, "next_token", "posts") && o(e.posts, q);
|
|
1174
1214
|
}
|
|
1175
|
-
function
|
|
1215
|
+
function Et(e) {
|
|
1176
1216
|
return n(e, "post") && q(e.post);
|
|
1177
1217
|
}
|
|
1178
1218
|
function R(e) {
|
|
1179
1219
|
return n(e);
|
|
1180
1220
|
}
|
|
1181
|
-
function
|
|
1221
|
+
function St(e) {
|
|
1182
1222
|
return n(e) && ("post" in e ? q(e.post) : !0) && ("antispam" in e ? R(e.antispam) : !0);
|
|
1183
1223
|
}
|
|
1184
1224
|
function g(e) {
|
|
@@ -1196,13 +1236,13 @@ function g(e) {
|
|
|
1196
1236
|
"image_url",
|
|
1197
1237
|
"create_time",
|
|
1198
1238
|
"status"
|
|
1199
|
-
) && ("replies" in e ?
|
|
1239
|
+
) && ("replies" in e ? o(e.replies, x) : !0);
|
|
1200
1240
|
}
|
|
1201
|
-
function
|
|
1241
|
+
function Gt(e) {
|
|
1202
1242
|
return n(e, "comment") && g(e.comment);
|
|
1203
1243
|
}
|
|
1204
|
-
function
|
|
1205
|
-
return n(e, "comments") &&
|
|
1244
|
+
function Ft(e) {
|
|
1245
|
+
return n(e, "comments") && o(e.comments, g);
|
|
1206
1246
|
}
|
|
1207
1247
|
function x(e) {
|
|
1208
1248
|
return n(
|
|
@@ -1217,27 +1257,27 @@ function x(e) {
|
|
|
1217
1257
|
"liked",
|
|
1218
1258
|
"reply_to",
|
|
1219
1259
|
"create_time"
|
|
1220
|
-
) &&
|
|
1260
|
+
) && It(e.reply_to);
|
|
1221
1261
|
}
|
|
1222
|
-
function
|
|
1262
|
+
function It(e) {
|
|
1223
1263
|
return n(e, "reply_id", "replied_by", "avatar_url", "nickname");
|
|
1224
1264
|
}
|
|
1225
|
-
function
|
|
1265
|
+
function Bt(e) {
|
|
1226
1266
|
return n(e) && ("comment" in e ? g(e.comment) : !0) && ("antispam" in e ? R(e.antispam) : !0);
|
|
1227
1267
|
}
|
|
1228
|
-
function
|
|
1229
|
-
return n(e, "replies") &&
|
|
1268
|
+
function Vt(e) {
|
|
1269
|
+
return n(e, "replies") && o(e.replies, x);
|
|
1230
1270
|
}
|
|
1231
|
-
function
|
|
1271
|
+
function Qt(e) {
|
|
1232
1272
|
return n(e, "reply") && x(e.reply);
|
|
1233
1273
|
}
|
|
1234
|
-
function
|
|
1274
|
+
function Tt(e) {
|
|
1235
1275
|
return n(e) && ("reply" in e ? g(e.comment) : !0) && ("antispam" in e ? R(e.antispam) : !0);
|
|
1236
1276
|
}
|
|
1237
|
-
function
|
|
1277
|
+
function Mt(e) {
|
|
1238
1278
|
return n(e, "image_url", "upload_url", "existed") && typeof e.existed == "boolean";
|
|
1239
1279
|
}
|
|
1240
|
-
function
|
|
1280
|
+
function Ht(e) {
|
|
1241
1281
|
return n(
|
|
1242
1282
|
e,
|
|
1243
1283
|
"notification_id",
|
|
@@ -1249,14 +1289,14 @@ function Vt(e) {
|
|
|
1249
1289
|
"origin_user_avatar_url"
|
|
1250
1290
|
);
|
|
1251
1291
|
}
|
|
1252
|
-
function
|
|
1253
|
-
return n(e, "notifications") &&
|
|
1292
|
+
function jt(e) {
|
|
1293
|
+
return n(e, "notifications") && o(e.notifications, Ht);
|
|
1254
1294
|
}
|
|
1255
|
-
function
|
|
1295
|
+
function zt(e) {
|
|
1256
1296
|
return n(e, "system", "comment", "like");
|
|
1257
1297
|
}
|
|
1258
|
-
var
|
|
1259
|
-
class
|
|
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 {
|
|
1260
1300
|
constructor(t) {
|
|
1261
1301
|
u(this, "token");
|
|
1262
1302
|
u(this, "req");
|
|
@@ -1268,7 +1308,7 @@ class er {
|
|
|
1268
1308
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=QaqUa2K0z0
|
|
1269
1309
|
*/
|
|
1270
1310
|
async getForums() {
|
|
1271
|
-
const { data: t } = await this.req.get("community/forums",
|
|
1311
|
+
const { data: t } = await this.req.get("community/forums", $t);
|
|
1272
1312
|
return (t == null ? void 0 : t.forums) || [];
|
|
1273
1313
|
}
|
|
1274
1314
|
/**
|
|
@@ -1277,7 +1317,7 @@ class er {
|
|
|
1277
1317
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=mIwpymAQom
|
|
1278
1318
|
*/
|
|
1279
1319
|
async getTopics() {
|
|
1280
|
-
const { data: t } = await this.req.get("community/topics",
|
|
1320
|
+
const { data: t } = await this.req.get("community/topics", Pt);
|
|
1281
1321
|
return (t == null ? void 0 : t.topics) || [];
|
|
1282
1322
|
}
|
|
1283
1323
|
/**
|
|
@@ -1286,7 +1326,7 @@ class er {
|
|
|
1286
1326
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Jvw7xMK31K
|
|
1287
1327
|
*/
|
|
1288
1328
|
async getTopic(t) {
|
|
1289
|
-
const { data: r, code: i } = await this.req.get("community/topic",
|
|
1329
|
+
const { data: r, code: i } = await this.req.get("community/topic", Dt, {
|
|
1290
1330
|
params: { topic_id: t }
|
|
1291
1331
|
});
|
|
1292
1332
|
return (r == null ? void 0 : r.topic) ?? { error: i };
|
|
@@ -1297,7 +1337,7 @@ class er {
|
|
|
1297
1337
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=XKI9lDVrPq
|
|
1298
1338
|
*/
|
|
1299
1339
|
async getPosts(t) {
|
|
1300
|
-
const { data: r, code: i } = await this.req.get("community/posts",
|
|
1340
|
+
const { data: r, code: i } = await this.req.get("community/posts", $, {
|
|
1301
1341
|
params: s(t)
|
|
1302
1342
|
});
|
|
1303
1343
|
return r ?? { error: i };
|
|
@@ -1308,7 +1348,7 @@ class er {
|
|
|
1308
1348
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=yXubbZuDlC
|
|
1309
1349
|
*/
|
|
1310
1350
|
async getPinnedPosts(t, r, i) {
|
|
1311
|
-
const { data: c, code: d } = await this.req.get("community/pinned-posts",
|
|
1351
|
+
const { data: c, code: d } = await this.req.get("community/pinned-posts", $, {
|
|
1312
1352
|
params: s({ forum_id: t, max_results: r, next_token: i })
|
|
1313
1353
|
});
|
|
1314
1354
|
return c ?? { error: d };
|
|
@@ -1319,7 +1359,7 @@ class er {
|
|
|
1319
1359
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=hj1AZy5rcP
|
|
1320
1360
|
*/
|
|
1321
1361
|
async getPost(t) {
|
|
1322
|
-
const { data: r, code: i } = await this.req.get("community/post",
|
|
1362
|
+
const { data: r, code: i } = await this.req.get("community/post", Et, {
|
|
1323
1363
|
params: { post_id: t }
|
|
1324
1364
|
});
|
|
1325
1365
|
return (r == null ? void 0 : r.post) ?? { error: i };
|
|
@@ -1330,7 +1370,7 @@ class er {
|
|
|
1330
1370
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=M5okHBuaVk
|
|
1331
1371
|
*/
|
|
1332
1372
|
async post(t) {
|
|
1333
|
-
const { data: r, code: i } = await this.req.post("community/post", s(t),
|
|
1373
|
+
const { data: r, code: i } = await this.req.post("community/post", s(t), St);
|
|
1334
1374
|
return r ?? {
|
|
1335
1375
|
error: i
|
|
1336
1376
|
};
|
|
@@ -1341,7 +1381,7 @@ class er {
|
|
|
1341
1381
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=djKbX7lFdp
|
|
1342
1382
|
*/
|
|
1343
1383
|
async getComments(t) {
|
|
1344
|
-
const { data: r, code: i } = await this.req.get("community/comments",
|
|
1384
|
+
const { data: r, code: i } = await this.req.get("community/comments", Ft, {
|
|
1345
1385
|
params: s(t)
|
|
1346
1386
|
});
|
|
1347
1387
|
return r ?? { error: i };
|
|
@@ -1352,7 +1392,7 @@ class er {
|
|
|
1352
1392
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=RIc7oxVGae
|
|
1353
1393
|
*/
|
|
1354
1394
|
async getComment(t) {
|
|
1355
|
-
const { data: r, code: i } = await this.req.get("community/comment",
|
|
1395
|
+
const { data: r, code: i } = await this.req.get("community/comment", Gt, {
|
|
1356
1396
|
params: { comment_id: t }
|
|
1357
1397
|
});
|
|
1358
1398
|
return (r == null ? void 0 : r.comment) ?? { error: i };
|
|
@@ -1364,7 +1404,7 @@ class er {
|
|
|
1364
1404
|
*/
|
|
1365
1405
|
async comment(t) {
|
|
1366
1406
|
await this.token.autoLogin();
|
|
1367
|
-
const { data: r, code: i } = await this.req.post("community/comment", s(t),
|
|
1407
|
+
const { data: r, code: i } = await this.req.post("community/comment", s(t), Bt);
|
|
1368
1408
|
return r ?? {
|
|
1369
1409
|
error: i
|
|
1370
1410
|
};
|
|
@@ -1375,7 +1415,7 @@ class er {
|
|
|
1375
1415
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=sVKBbY83MY
|
|
1376
1416
|
*/
|
|
1377
1417
|
async getReplies(t) {
|
|
1378
|
-
const { data: r } = await this.req.get("community/replies",
|
|
1418
|
+
const { data: r } = await this.req.get("community/replies", Vt, {
|
|
1379
1419
|
params: s({ max_results: 20, ...t })
|
|
1380
1420
|
});
|
|
1381
1421
|
return r ?? { replies: [] };
|
|
@@ -1386,7 +1426,7 @@ class er {
|
|
|
1386
1426
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=kxhcSXD3MG
|
|
1387
1427
|
*/
|
|
1388
1428
|
async getReply(t) {
|
|
1389
|
-
const { data: r, code: i } = await this.req.get("community/reply",
|
|
1429
|
+
const { data: r, code: i } = await this.req.get("community/reply", Qt, {
|
|
1390
1430
|
params: { reply_id: t }
|
|
1391
1431
|
});
|
|
1392
1432
|
return (r == null ? void 0 : r.reply) ?? { error: i };
|
|
@@ -1398,7 +1438,7 @@ class er {
|
|
|
1398
1438
|
*/
|
|
1399
1439
|
async reply(t) {
|
|
1400
1440
|
await this.token.autoLogin();
|
|
1401
|
-
const { data: r, code: i } = await this.req.post("community/reply", s(t),
|
|
1441
|
+
const { data: r, code: i } = await this.req.post("community/reply", s(t), Tt);
|
|
1402
1442
|
return r ?? {
|
|
1403
1443
|
error: i
|
|
1404
1444
|
};
|
|
@@ -1434,7 +1474,7 @@ class er {
|
|
|
1434
1474
|
*/
|
|
1435
1475
|
async getMediaPresignUrl(t) {
|
|
1436
1476
|
await this.token.autoLogin();
|
|
1437
|
-
const { data: r } = await this.req.get("community/media-presign-url",
|
|
1477
|
+
const { data: r } = await this.req.get("community/media-presign-url", Mt, {
|
|
1438
1478
|
params: t
|
|
1439
1479
|
});
|
|
1440
1480
|
return r;
|
|
@@ -1448,7 +1488,7 @@ class er {
|
|
|
1448
1488
|
*/
|
|
1449
1489
|
async getNotifications(t) {
|
|
1450
1490
|
await this.token.autoLogin();
|
|
1451
|
-
const { data: r } = await this.req.get("community/notifications",
|
|
1491
|
+
const { data: r } = await this.req.get("community/notifications", jt, {
|
|
1452
1492
|
params: s({ max_results: 20, ...t })
|
|
1453
1493
|
});
|
|
1454
1494
|
return r || { notifications: [] };
|
|
@@ -1460,7 +1500,7 @@ class er {
|
|
|
1460
1500
|
*/
|
|
1461
1501
|
async getUnreadNotificationsCount() {
|
|
1462
1502
|
if (!await this.token.autoLogin()) return null;
|
|
1463
|
-
const { data: t } = await this.req.get("community/unread-notifications-count",
|
|
1503
|
+
const { data: t } = await this.req.get("community/unread-notifications-count", zt);
|
|
1464
1504
|
return t;
|
|
1465
1505
|
}
|
|
1466
1506
|
/**
|
|
@@ -1477,9 +1517,9 @@ class er {
|
|
|
1477
1517
|
function y(e) {
|
|
1478
1518
|
return n(e, "openid", "unionid", "weixin_token");
|
|
1479
1519
|
}
|
|
1480
|
-
var
|
|
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 || {});
|
|
1481
1521
|
const P = "wx_login_cache";
|
|
1482
|
-
class
|
|
1522
|
+
class sr {
|
|
1483
1523
|
/**
|
|
1484
1524
|
* 创建微信相关功能接口
|
|
1485
1525
|
*
|
|
@@ -1526,6 +1566,8 @@ class tr {
|
|
|
1526
1566
|
* - 由于小程序的存储是以用户维度隔离的,每个微信用户在每个小程序下只要成功调用一次此 API 就会缓存请求结果。
|
|
1527
1567
|
* - 微信公众号网页授权请使用 webLogin 方法
|
|
1528
1568
|
*
|
|
1569
|
+
* 🔕请求静默进行,无消息提示
|
|
1570
|
+
*
|
|
1529
1571
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=GwIZ0givCb
|
|
1530
1572
|
*/
|
|
1531
1573
|
async login() {
|
|
@@ -1586,53 +1628,48 @@ class tr {
|
|
|
1586
1628
|
*
|
|
1587
1629
|
* 用于从游戏内跳转至小程序时,将微信用户身份和游戏内身份关联起来,使得后续的企业微信客服流程能够知道该微信用户在游戏内的身份。
|
|
1588
1630
|
*
|
|
1631
|
+
* 🔕请求静默进行,无消息提示
|
|
1632
|
+
*
|
|
1589
1633
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=ci73N833Mk
|
|
1590
1634
|
*
|
|
1591
1635
|
* @param weixinToken 调用 login 后,得到的 weixinToken,如果 weixinToken 为空则跳过不处理
|
|
1592
1636
|
* @param gameCode 从游戏内跳转至小程序时,通过请求参数 query 携带的 game_code,如果值为空则跳过不处理
|
|
1593
1637
|
*/
|
|
1594
1638
|
async linkPlayer(t, r) {
|
|
1595
|
-
!t || !r || await this.req.post(
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
weixin_token: t,
|
|
1599
|
-
game_code: r
|
|
1600
|
-
},
|
|
1601
|
-
null,
|
|
1602
|
-
{
|
|
1603
|
-
message: !1
|
|
1604
|
-
}
|
|
1605
|
-
);
|
|
1639
|
+
!t || !r || await this.req.post("weixin/link-player", { weixin_token: t, game_code: r }, null, {
|
|
1640
|
+
message: !1
|
|
1641
|
+
});
|
|
1606
1642
|
}
|
|
1607
1643
|
}
|
|
1608
1644
|
export {
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1645
|
+
tr as AuthToken,
|
|
1646
|
+
Ue as CliamRewardStatus,
|
|
1647
|
+
rr as ClubApi,
|
|
1612
1648
|
ye as ClubCreditChangeSence,
|
|
1613
1649
|
we as ClubCreditChangeType,
|
|
1614
1650
|
he as ClubItemType,
|
|
1615
1651
|
ve as ClubRedemptionStatus,
|
|
1616
|
-
|
|
1652
|
+
ir as CommunityApi,
|
|
1617
1653
|
be as EngageAccountType,
|
|
1618
|
-
|
|
1654
|
+
nr as EventApi,
|
|
1619
1655
|
qe as EventPeriodType,
|
|
1620
|
-
|
|
1621
|
-
|
|
1656
|
+
a as FeatureType,
|
|
1657
|
+
Jt as ForumMode,
|
|
1622
1658
|
ke as GamerItemType,
|
|
1623
1659
|
fe as Gender,
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1660
|
+
Se as LotteryDrawAction,
|
|
1661
|
+
De as LotteryTicketStatus,
|
|
1662
|
+
Nt as NotificationCategory,
|
|
1663
|
+
Ot as NotificationType,
|
|
1664
|
+
Kt as PostStatus,
|
|
1629
1665
|
Re as QuestObjective,
|
|
1630
1666
|
$e as RewardSoure,
|
|
1631
1667
|
Ae as RewardStatusPrefix,
|
|
1632
1668
|
Le as RewardStatusSuffix,
|
|
1633
|
-
|
|
1634
|
-
|
|
1669
|
+
Ce as RewardStatusSuffixV2,
|
|
1670
|
+
Ee as TeamAction,
|
|
1671
|
+
Pe as TeamVisibility,
|
|
1635
1672
|
xe as VoteOptionSource,
|
|
1636
|
-
|
|
1637
|
-
|
|
1673
|
+
sr as WeixinApi,
|
|
1674
|
+
Xt as WeixinWebLoginErrorCode
|
|
1638
1675
|
};
|
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.
|
|
4
|
+
"version": "1.1.8",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "index.ts",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"@seayoo-web/combo-webview": "^2.5.0",
|
|
26
26
|
"@seayoo-web/tsconfig": "^1.0.3",
|
|
27
27
|
"@seayoo-web/request": "^2.1.2",
|
|
28
|
-
"@seayoo-web/
|
|
29
|
-
"@seayoo-web/
|
|
28
|
+
"@seayoo-web/utils": "^3.1.1",
|
|
29
|
+
"@seayoo-web/scripts": "^1.3.15"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@seayoo-web/combo-webview": "^2.5.0",
|
|
33
|
-
"@seayoo-web/utils": "^3.
|
|
33
|
+
"@seayoo-web/utils": "^3.1.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "vite build && tsc --emitDeclarationOnly",
|
package/types/src/event.d.ts
CHANGED
|
@@ -64,6 +64,8 @@ export declare class EventApi {
|
|
|
64
64
|
*
|
|
65
65
|
* 💡活动下包含 engage_account_type 为 role_id 的玩法时,前端需要提供 server_id 和 role_id
|
|
66
66
|
*
|
|
67
|
+
* 🔕请求静默进行,无消息提示
|
|
68
|
+
*
|
|
67
69
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=WzX5BrMNpL
|
|
68
70
|
*/
|
|
69
71
|
getUserFeatureStatus(option?: {
|
|
@@ -74,8 +76,30 @@ export declare class EventApi {
|
|
|
74
76
|
* 获取当前登录用户参与某个玩法的记录
|
|
75
77
|
*
|
|
76
78
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=WSbAeDZc8F
|
|
79
|
+
*
|
|
80
|
+
* @deprecated 请改用 getUserEngagementsV2
|
|
77
81
|
*/
|
|
78
82
|
getUserEngagements(featureId: number): Promise<import("./event.define").UserEngagement[]>;
|
|
83
|
+
/**
|
|
84
|
+
* 获取当前登录用户参与某个玩法的记录
|
|
85
|
+
*
|
|
86
|
+
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=NFDdV1dwWb
|
|
87
|
+
*/
|
|
88
|
+
getUserEngagementsV2(featureId: number, option?: {
|
|
89
|
+
/** 单页返回的最大数量,默认 10 */
|
|
90
|
+
max_results?: number;
|
|
91
|
+
next_token?: string;
|
|
92
|
+
/** 是否返回参与获得的记录,默认 false */
|
|
93
|
+
return_rewards?: string;
|
|
94
|
+
/**
|
|
95
|
+
* 当玩法的 engage_account_type 为 role_id 时,可提供 server_id 和 role_id 获取具体角色的参与记录
|
|
96
|
+
*/
|
|
97
|
+
server_id?: string;
|
|
98
|
+
/**
|
|
99
|
+
* 当玩法的 engage_account_type 为 role_id 时,可提供 server_id 和 role_id 获取具体角色的参与记录
|
|
100
|
+
*/
|
|
101
|
+
role_id?: string;
|
|
102
|
+
}): Promise<import("./event.define").UserEngagementV2[]>;
|
|
79
103
|
/**
|
|
80
104
|
* 用户参与某个玩法(需要先调用 visit 接口)
|
|
81
105
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CliamRewardStatus, FeatureType, GamerItemType, LotteryDrawAction, LotteryTicketStatus, QuestObjective, RewardSoure, RewardStatusPrefix, RewardStatusSuffix, TeamAction, TeamVisibility } from "./event.enums";
|
|
1
|
+
import type { CliamRewardStatus, FeatureType, GamerItemType, LotteryDrawAction, LotteryTicketStatus, QuestObjective, RewardSoure, RewardStatusPrefix, RewardStatusSuffix, RewardStatusSuffixV2, TeamAction, TeamVisibility } from "./event.enums";
|
|
2
2
|
export interface VerifyMobileResult {
|
|
3
3
|
/** 手机号是否允许登录此游戏(游戏 ID 由 Request Header 的 Origin 或 Referer 决定) */
|
|
4
4
|
allowed: boolean;
|
|
@@ -39,6 +39,9 @@ export interface UserFeatureStatus {
|
|
|
39
39
|
/** 是否有已获得但尚未领取的玩法参与奖励 */
|
|
40
40
|
has_unclaimed_rewards: boolean;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* 用户参与记录,已经作废
|
|
44
|
+
*/
|
|
42
45
|
export interface UserEngagement {
|
|
43
46
|
/** 参与记录 ID */
|
|
44
47
|
engagement_id: number;
|
|
@@ -68,6 +71,37 @@ export interface UserEngagement {
|
|
|
68
71
|
role_id?: string;
|
|
69
72
|
created_at: number;
|
|
70
73
|
}
|
|
74
|
+
export type UserEngagementV2 = Pick<UserEngagement, "engagement_id" | "feature_id" | "sequence" | "data" | "server_id" | "role_id" | "created_at"> & {
|
|
75
|
+
user_id: number;
|
|
76
|
+
/** 参与奖励列表 */
|
|
77
|
+
rewards?: Reward[];
|
|
78
|
+
};
|
|
79
|
+
export interface Reward {
|
|
80
|
+
/** 用户奖励记录 id */
|
|
81
|
+
reward_id: number;
|
|
82
|
+
/** 奖励道具 id */
|
|
83
|
+
reward_item_id: number;
|
|
84
|
+
/** 奖励道具类型 */
|
|
85
|
+
reward_item_type: GamerItemType;
|
|
86
|
+
/** 奖励道具数量 */
|
|
87
|
+
reward_count: number;
|
|
88
|
+
/** 奖励状态 */
|
|
89
|
+
reward_status: RewardStatusSuffixV2;
|
|
90
|
+
/** 奖励来源 */
|
|
91
|
+
reward_source: RewardSoure;
|
|
92
|
+
/** 奖励道具名称 */
|
|
93
|
+
reward_item_name: string;
|
|
94
|
+
/** 奖励道具图片地址 */
|
|
95
|
+
reward_item_icon_url: string;
|
|
96
|
+
/** 奖励道具描述 */
|
|
97
|
+
reward_item_desc?: string;
|
|
98
|
+
/** 奖励道具评级,用于前端展示 */
|
|
99
|
+
reward_item_rating: number;
|
|
100
|
+
/** 领奖时间 */
|
|
101
|
+
receive_time: number;
|
|
102
|
+
/** 提供额外扩展信息,比如收获地址等 */
|
|
103
|
+
extra_data?: Record<string, unknown>;
|
|
104
|
+
}
|
|
71
105
|
export interface PreregisterEngagementData {
|
|
72
106
|
/** 用户预约平台 */
|
|
73
107
|
platforms: string[];
|
|
@@ -88,19 +88,35 @@ export declare const enum VoteOptionSource {
|
|
|
88
88
|
/** 投票入围 */
|
|
89
89
|
Shortlisted = "shortlisted"
|
|
90
90
|
}
|
|
91
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* 奖励领取状态(不含发货状态和领取失败)
|
|
93
|
+
*/
|
|
92
94
|
export declare const enum RewardStatusPrefix {
|
|
93
95
|
/** 未获得奖励 */
|
|
94
96
|
Ineligible = "ineligible",
|
|
95
97
|
/** 奖励未领取 */
|
|
96
|
-
|
|
98
|
+
Unclaimed = "unaccalimed",
|
|
97
99
|
/** 奖励已领取 */
|
|
98
100
|
Received = "received"
|
|
99
101
|
}
|
|
100
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* 已获得实物奖励的奖励状态
|
|
104
|
+
*
|
|
105
|
+
* @deprecated
|
|
106
|
+
*/
|
|
101
107
|
export declare const enum RewardStatusSuffix {
|
|
102
108
|
/** 奖励未领取 */
|
|
103
|
-
|
|
109
|
+
Unclaimed = "unaccalimed",
|
|
110
|
+
/** 奖励已领取 */
|
|
111
|
+
Received = "received",
|
|
112
|
+
/** 奖励发放失败 */
|
|
113
|
+
Failed = "failed",
|
|
114
|
+
/** 奖励已发货 */
|
|
115
|
+
Delivered = "delivered"
|
|
116
|
+
}
|
|
117
|
+
export declare const enum RewardStatusSuffixV2 {
|
|
118
|
+
/** 奖励未领取 */
|
|
119
|
+
Unclaimed = "unclaimed",
|
|
104
120
|
/** 奖励已领取 */
|
|
105
121
|
Received = "received",
|
|
106
122
|
/** 奖励发放失败 */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClaimedItem, CommentEngagement, EngageResponse, TeamEngagement, UserEngagement, UserFeatureStatus, UserReward, VerifyMobileResult } from "./event.define";
|
|
1
|
+
import type { ClaimedItem, CommentEngagement, EngageResponse, Reward, TeamEngagement, UserEngagement, UserEngagementV2, UserFeatureStatus, UserReward, VerifyMobileResult } from "./event.define";
|
|
2
2
|
import type { CliamRewardStatus } from "./event.enums";
|
|
3
3
|
export declare function isVerifyMobileResponse(data: unknown): data is VerifyMobileResult;
|
|
4
4
|
export declare function isCommonCountResponse(data: unknown): data is {
|
|
@@ -16,6 +16,11 @@ export declare function isUserFeatureStatusResponse(data: unknown): data is {
|
|
|
16
16
|
export declare function isUserEngagementsResponse(data: unknown): data is {
|
|
17
17
|
engagements: UserEngagement[];
|
|
18
18
|
};
|
|
19
|
+
export declare function isUserEngagementsV2Response(data: unknown): data is {
|
|
20
|
+
engagements: UserEngagementV2[];
|
|
21
|
+
};
|
|
22
|
+
export declare function isUserEngagementV2(data: unknown): data is UserEngagementV2;
|
|
23
|
+
export declare function isReward(data: unknown): data is Reward;
|
|
19
24
|
export declare function isEngageResponse(data: unknown): data is EngageResponse;
|
|
20
25
|
export declare function isClaimRewardsResponse(data: unknown): data is {
|
|
21
26
|
claimed_items: ClaimedItem[];
|
package/types/src/token.d.ts
CHANGED
|
@@ -62,11 +62,15 @@ export declare class AuthToken {
|
|
|
62
62
|
* - 此方法通常不需要手动调用,在需要登录的接口调用时会自动执行
|
|
63
63
|
* - 为了提高页面执行速度,可以在设置 Token 后立即调用 autoLogin
|
|
64
64
|
*
|
|
65
|
+
* 🔕请求静默进行,无消息提示
|
|
66
|
+
*
|
|
65
67
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=ReeJpWraRO
|
|
66
68
|
*/
|
|
67
69
|
autoLogin(): Promise<boolean>;
|
|
68
70
|
/**
|
|
69
|
-
*
|
|
71
|
+
* 获取当前登录用户的 Session 的信息
|
|
72
|
+
*
|
|
73
|
+
* 🔕请求静默进行,无消息提示
|
|
70
74
|
*
|
|
71
75
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=OdGVCdQxEu
|
|
72
76
|
*/
|
package/types/src/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const console: Pick<Console, "
|
|
1
|
+
export declare const console: Pick<Console, "error" | "log" | "warn">;
|
|
2
2
|
/** 检测是否在 combo webview */
|
|
3
3
|
export declare function inComboWebview(): boolean;
|
|
4
4
|
export declare function isRootEndpoint(path: string): boolean;
|
package/types/src/weixin.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ export declare class WeixinApi {
|
|
|
41
41
|
* - 由于小程序的存储是以用户维度隔离的,每个微信用户在每个小程序下只要成功调用一次此 API 就会缓存请求结果。
|
|
42
42
|
* - 微信公众号网页授权请使用 webLogin 方法
|
|
43
43
|
*
|
|
44
|
+
* 🔕请求静默进行,无消息提示
|
|
45
|
+
*
|
|
44
46
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=GwIZ0givCb
|
|
45
47
|
*/
|
|
46
48
|
login(): Promise<import("./weixin.define").WeixinLoginResponse | {
|
|
@@ -72,6 +74,8 @@ export declare class WeixinApi {
|
|
|
72
74
|
*
|
|
73
75
|
* 用于从游戏内跳转至小程序时,将微信用户身份和游戏内身份关联起来,使得后续的企业微信客服流程能够知道该微信用户在游戏内的身份。
|
|
74
76
|
*
|
|
77
|
+
* 🔕请求静默进行,无消息提示
|
|
78
|
+
*
|
|
75
79
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=ci73N833Mk
|
|
76
80
|
*
|
|
77
81
|
* @param weixinToken 调用 login 后,得到的 weixinToken,如果 weixinToken 为空则跳过不处理
|