@seayoo-web/gamer-api 1.1.3 → 1.1.5
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 +40 -40
- package/package.json +4 -4
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 a, 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";
|
|
@@ -241,7 +241,7 @@ function S(e) {
|
|
|
241
241
|
) && z(e.server_id) && J(e.role_id);
|
|
242
242
|
}
|
|
243
243
|
function te(e) {
|
|
244
|
-
return n(e, "roles") &&
|
|
244
|
+
return n(e, "roles") && a(e.roles, S);
|
|
245
245
|
}
|
|
246
246
|
function re(e) {
|
|
247
247
|
return S(e) && n(e, "role_fighting");
|
|
@@ -266,7 +266,7 @@ function v(e) {
|
|
|
266
266
|
);
|
|
267
267
|
}
|
|
268
268
|
function ne(e) {
|
|
269
|
-
return n(e, "addresses") &&
|
|
269
|
+
return n(e, "addresses") && a(e.addresses, v);
|
|
270
270
|
}
|
|
271
271
|
function ie(e) {
|
|
272
272
|
return n(
|
|
@@ -289,7 +289,7 @@ function se(e) {
|
|
|
289
289
|
);
|
|
290
290
|
}
|
|
291
291
|
function oe(e) {
|
|
292
|
-
return n(e, "credit_logs") &&
|
|
292
|
+
return n(e, "credit_logs") && a(e.credit_logs, se);
|
|
293
293
|
}
|
|
294
294
|
function ae(e) {
|
|
295
295
|
return n(
|
|
@@ -305,7 +305,7 @@ function ae(e) {
|
|
|
305
305
|
);
|
|
306
306
|
}
|
|
307
307
|
function ue(e) {
|
|
308
|
-
return n(e, "benefits") &&
|
|
308
|
+
return n(e, "benefits") && a(e.benefits, ae);
|
|
309
309
|
}
|
|
310
310
|
function ce(e) {
|
|
311
311
|
return n(
|
|
@@ -352,7 +352,7 @@ function D(e) {
|
|
|
352
352
|
);
|
|
353
353
|
}
|
|
354
354
|
function le(e) {
|
|
355
|
-
return n(e, "products") &&
|
|
355
|
+
return n(e, "products") && a(e.products, D);
|
|
356
356
|
}
|
|
357
357
|
function _e(e) {
|
|
358
358
|
return n(
|
|
@@ -388,7 +388,7 @@ function de(e) {
|
|
|
388
388
|
return n(e, "server_id", "role_id", "role_name");
|
|
389
389
|
}
|
|
390
390
|
function pe(e) {
|
|
391
|
-
return n(e, "redemptions") &&
|
|
391
|
+
return n(e, "redemptions") && a(e.redemptions, _e);
|
|
392
392
|
}
|
|
393
393
|
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 || {});
|
|
394
394
|
class Zt {
|
|
@@ -618,7 +618,7 @@ class Zt {
|
|
|
618
618
|
return r || { redemptions: [] };
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
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 || {}),
|
|
621
|
+
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 || {}), o = /* @__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))(o || {}), 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.Unaccalimed = "unaccalimed", e.Received = "received", e))(Ae || {}), Le = /* @__PURE__ */ ((e) => (e.Unaccalimed = "unaccalimed", e.Received = "received", e.Failed = "failed", e.Delivered = "delivered", e))(Le || {}), Ce = /* @__PURE__ */ ((e) => (e.Ineligible = "ineligible", e.Unaccalimed = "unaccalimed", e.Received = "received", e.Failed = "failed", e))(Ce || {}), Ue = /* @__PURE__ */ ((e) => (e.Output = "output", e.Engage = "engage", e))(Ue || {}), $e = /* @__PURE__ */ ((e) => (e.Private = "private", e.Public = "public", e))($e || {}), Pe = /* @__PURE__ */ ((e) => (e.Unknown = "unknown", e.Pending = "pending", e.Drawn = "drawn", e.Claimed = "claimed", e.Fail = "fail", e))(Pe || {}), Se = /* @__PURE__ */ ((e) => (e.Assemble = "assemble", e.Join = "join", e.Disband = "disband", e.ChangeVisibility = "change_visibility", e.Query = "query", e))(Se || {}), De = /* @__PURE__ */ ((e) => (e.Query = "query", e.Draw = "draw", e.Claim = "claim", e))(De || {});
|
|
622
622
|
function Ee(e) {
|
|
623
623
|
return n(e, "event_name", "rules", "since", "until", "features") && Array.isArray(e.features) && e.features.every(Ge);
|
|
624
624
|
}
|
|
@@ -626,36 +626,36 @@ function Ge(e) {
|
|
|
626
626
|
if (!Ie(e))
|
|
627
627
|
return !1;
|
|
628
628
|
switch (e.feature_type) {
|
|
629
|
-
case
|
|
630
|
-
case
|
|
631
|
-
case
|
|
632
|
-
case
|
|
629
|
+
case o.Preregister:
|
|
630
|
+
case o.ClaimRewards:
|
|
631
|
+
case o.Register:
|
|
632
|
+
case o.InvitedRegister:
|
|
633
633
|
return !0;
|
|
634
|
-
case
|
|
634
|
+
case o.Lottery:
|
|
635
635
|
return Ve(e.config);
|
|
636
|
-
case
|
|
636
|
+
case o.Survey:
|
|
637
637
|
return Qe(e.config);
|
|
638
|
-
case
|
|
638
|
+
case o.Invite:
|
|
639
639
|
return Te(e.config);
|
|
640
|
-
case
|
|
640
|
+
case o.Share:
|
|
641
641
|
return Me(e.config);
|
|
642
|
-
case
|
|
642
|
+
case o.Follow:
|
|
643
643
|
return He(e.config);
|
|
644
|
-
case
|
|
644
|
+
case o.Subscribe:
|
|
645
645
|
return je(e.config);
|
|
646
|
-
case
|
|
646
|
+
case o.Comment:
|
|
647
647
|
return ze(e.config);
|
|
648
|
-
case
|
|
648
|
+
case o.Vote:
|
|
649
649
|
return Je(e.config);
|
|
650
|
-
case
|
|
650
|
+
case o.Cashback:
|
|
651
651
|
return Ne(e.config);
|
|
652
|
-
case
|
|
652
|
+
case o.GiftCode:
|
|
653
653
|
return Oe(e.config);
|
|
654
|
-
case
|
|
654
|
+
case o.Quest:
|
|
655
655
|
return Ye(e.config);
|
|
656
|
-
case
|
|
656
|
+
case o.Team:
|
|
657
657
|
return Ze(e.config);
|
|
658
|
-
case
|
|
658
|
+
case o.LotteryDraw:
|
|
659
659
|
return We(e.config);
|
|
660
660
|
default:
|
|
661
661
|
return !1;
|
|
@@ -687,7 +687,7 @@ function Ie(e) {
|
|
|
687
687
|
"since",
|
|
688
688
|
"until",
|
|
689
689
|
"engage_account"
|
|
690
|
-
) && ("feature_rewards" in e ?
|
|
690
|
+
) && ("feature_rewards" in e ? Fe(e.feature_rewards) : !0);
|
|
691
691
|
}
|
|
692
692
|
function Be(e) {
|
|
693
693
|
return n(
|
|
@@ -784,7 +784,7 @@ function nt(e) {
|
|
|
784
784
|
return n(e, "status") && Array.isArray(e.status) && e.status.every((t) => n(t, "feature_id", "can_engage", "has_unclaimed_rewards"));
|
|
785
785
|
}
|
|
786
786
|
function it(e) {
|
|
787
|
-
return n(e, "engagements") &&
|
|
787
|
+
return n(e, "engagements") && a(e.engagements, E);
|
|
788
788
|
}
|
|
789
789
|
function E(e) {
|
|
790
790
|
if (!n(
|
|
@@ -886,19 +886,19 @@ function wt(e) {
|
|
|
886
886
|
);
|
|
887
887
|
}
|
|
888
888
|
function yt(e) {
|
|
889
|
-
return n(e, "engagement_id") && ("engagement" in e ? E(e.engagement) : !0) && ("rewards" in e ?
|
|
889
|
+
return n(e, "engagement_id") && ("engagement" in e ? E(e.engagement) : !0) && ("rewards" in e ? a(e.rewards, wt) : !0);
|
|
890
890
|
}
|
|
891
891
|
function ht(e) {
|
|
892
892
|
return n(e, "reward_id", "reward_status");
|
|
893
893
|
}
|
|
894
894
|
function vt(e) {
|
|
895
|
-
return n(e, "claimed_items") &&
|
|
895
|
+
return n(e, "claimed_items") && a(e.claimed_items, ht);
|
|
896
896
|
}
|
|
897
897
|
function kt(e) {
|
|
898
898
|
return n(e, "reward_status");
|
|
899
899
|
}
|
|
900
900
|
function bt(e) {
|
|
901
|
-
return n(e, "user_rewards") &&
|
|
901
|
+
return n(e, "user_rewards") && a(e.user_rewards, G);
|
|
902
902
|
}
|
|
903
903
|
function qt(e) {
|
|
904
904
|
return n(e, "scene");
|
|
@@ -1019,7 +1019,7 @@ class Wt {
|
|
|
1019
1019
|
*/
|
|
1020
1020
|
async engage(t) {
|
|
1021
1021
|
await this.token.autoLogin();
|
|
1022
|
-
const { data: r, code: i } = await this.req.post(`event/${this.event}/
|
|
1022
|
+
const { data: r, code: i } = await this.req.post(`event/${this.event}/engage`, s(t), yt);
|
|
1023
1023
|
return r ?? {
|
|
1024
1024
|
error: i
|
|
1025
1025
|
};
|
|
@@ -1134,13 +1134,13 @@ function F(e) {
|
|
|
1134
1134
|
return n(e, "forum_id", "icon_url", "name", "tags", "sort", "mode", "member_ids") && Array.isArray(e.tags) && Array.isArray(e.member_ids);
|
|
1135
1135
|
}
|
|
1136
1136
|
function At(e) {
|
|
1137
|
-
return n(e, "forums") &&
|
|
1137
|
+
return n(e, "forums") && a(e.forums, F);
|
|
1138
1138
|
}
|
|
1139
1139
|
function b(e) {
|
|
1140
1140
|
return n(e, "topic_id", "cover_url", "name", "description", "tags", "post_num") && Array.isArray(e.tags);
|
|
1141
1141
|
}
|
|
1142
1142
|
function Lt(e) {
|
|
1143
|
-
return n(e, "topics") &&
|
|
1143
|
+
return n(e, "topics") && a(e.topics, b);
|
|
1144
1144
|
}
|
|
1145
1145
|
function Ct(e) {
|
|
1146
1146
|
return n(e, "topic") && b(e.topic);
|
|
@@ -1165,10 +1165,10 @@ function q(e) {
|
|
|
1165
1165
|
"is_highlighted",
|
|
1166
1166
|
"status",
|
|
1167
1167
|
"create_time"
|
|
1168
|
-
) &&
|
|
1168
|
+
) && a(e.topics, b) && F(e.forum);
|
|
1169
1169
|
}
|
|
1170
1170
|
function $(e) {
|
|
1171
|
-
return n(e, "next_token", "posts") &&
|
|
1171
|
+
return n(e, "next_token", "posts") && a(e.posts, q);
|
|
1172
1172
|
}
|
|
1173
1173
|
function Ut(e) {
|
|
1174
1174
|
return n(e, "post") && q(e.post);
|
|
@@ -1194,13 +1194,13 @@ function g(e) {
|
|
|
1194
1194
|
"image_url",
|
|
1195
1195
|
"create_time",
|
|
1196
1196
|
"status"
|
|
1197
|
-
) && ("replies" in e ?
|
|
1197
|
+
) && ("replies" in e ? a(e.replies, x) : !0);
|
|
1198
1198
|
}
|
|
1199
1199
|
function Pt(e) {
|
|
1200
1200
|
return n(e, "comment") && g(e.comment);
|
|
1201
1201
|
}
|
|
1202
1202
|
function St(e) {
|
|
1203
|
-
return n(e, "comments") &&
|
|
1203
|
+
return n(e, "comments") && a(e.comments, g);
|
|
1204
1204
|
}
|
|
1205
1205
|
function x(e) {
|
|
1206
1206
|
return n(
|
|
@@ -1224,7 +1224,7 @@ function Et(e) {
|
|
|
1224
1224
|
return n(e) && ("comment" in e ? g(e.comment) : !0) && ("antispam" in e ? R(e.antispam) : !0);
|
|
1225
1225
|
}
|
|
1226
1226
|
function Gt(e) {
|
|
1227
|
-
return n(e, "replies") &&
|
|
1227
|
+
return n(e, "replies") && a(e.replies, x);
|
|
1228
1228
|
}
|
|
1229
1229
|
function Ft(e) {
|
|
1230
1230
|
return n(e, "reply") && x(e.reply);
|
|
@@ -1248,7 +1248,7 @@ function Vt(e) {
|
|
|
1248
1248
|
);
|
|
1249
1249
|
}
|
|
1250
1250
|
function Qt(e) {
|
|
1251
|
-
return n(e, "notifications") &&
|
|
1251
|
+
return n(e, "notifications") && a(e.notifications, Vt);
|
|
1252
1252
|
}
|
|
1253
1253
|
function Tt(e) {
|
|
1254
1254
|
return n(e, "system", "comment", "like");
|
|
@@ -1615,7 +1615,7 @@ export {
|
|
|
1615
1615
|
be as EngageAccountType,
|
|
1616
1616
|
Wt as EventApi,
|
|
1617
1617
|
qe as EventPeriodType,
|
|
1618
|
-
|
|
1618
|
+
o as FeatureType,
|
|
1619
1619
|
Mt as ForumMode,
|
|
1620
1620
|
ke as GamerItemType,
|
|
1621
1621
|
fe as Gender,
|
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.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "index.ts",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^22.13.1",
|
|
25
25
|
"@seayoo-web/combo-webview": "^2.5.0",
|
|
26
|
-
"@seayoo-web/utils": "^3.0.10",
|
|
27
|
-
"@seayoo-web/tsconfig": "^1.0.3",
|
|
28
26
|
"@seayoo-web/request": "^2.1.2",
|
|
29
|
-
"@seayoo-web/
|
|
27
|
+
"@seayoo-web/tsconfig": "^1.0.3",
|
|
28
|
+
"@seayoo-web/scripts": "^1.3.9",
|
|
29
|
+
"@seayoo-web/utils": "^3.0.10"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@seayoo-web/combo-webview": "^2.5.0",
|