@seayoo-web/gamer-api 2.9.0 → 2.9.2
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
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { isComboWebView as
|
|
2
|
-
import { isPlainObject as v, supportWx as f, useConsole as
|
|
1
|
+
import { isComboWebView as de } from "@seayoo-web/combo-webview";
|
|
2
|
+
import { isPlainObject as v, supportWx as f, useConsole as ge, usePromise as pe, pruneURL as _e, supportWindow as be, queryString as P, pruneObject as c, omitFields as C, parseJSON as ye, removePara as Q } from "@seayoo-web/utils";
|
|
3
3
|
import { v as e, objectGuard as s } from "@seayoo-web/validator";
|
|
4
|
-
function
|
|
4
|
+
function fe(i) {
|
|
5
5
|
return v(i, "gamer_token") && typeof i.gamer_token == "string";
|
|
6
6
|
}
|
|
7
7
|
function B(i) {
|
|
8
8
|
return v(i);
|
|
9
9
|
}
|
|
10
|
-
const T =
|
|
11
|
-
function
|
|
10
|
+
const T = ge("GamerApiSDK");
|
|
11
|
+
function he(i) {
|
|
12
12
|
return /^\/[a-z\d-]+$/.test(i);
|
|
13
13
|
}
|
|
14
|
-
async function
|
|
15
|
-
const { promise: i, resolve: t } =
|
|
14
|
+
async function we() {
|
|
15
|
+
const { promise: i, resolve: t } = pe();
|
|
16
16
|
return wx.login({
|
|
17
17
|
success(n) {
|
|
18
18
|
t(n.code);
|
|
@@ -22,7 +22,7 @@ async function he() {
|
|
|
22
22
|
}
|
|
23
23
|
}), await i;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const ke = {
|
|
26
26
|
get(i) {
|
|
27
27
|
return localStorage.getItem(i) || "";
|
|
28
28
|
},
|
|
@@ -32,7 +32,7 @@ const we = {
|
|
|
32
32
|
remove(i) {
|
|
33
33
|
localStorage.removeItem(i);
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, ve = {
|
|
36
36
|
get(i) {
|
|
37
37
|
try {
|
|
38
38
|
if (f()) return wx.getStorageSync(i) || "";
|
|
@@ -64,8 +64,8 @@ class Er {
|
|
|
64
64
|
req;
|
|
65
65
|
storage;
|
|
66
66
|
constructor(t, n) {
|
|
67
|
-
this.storage = f() ?
|
|
68
|
-
const r =
|
|
67
|
+
this.storage = f() ? ve : ke;
|
|
68
|
+
const r = he(t) ? t : `https://${_e(t)}`;
|
|
69
69
|
if (this.$NetRequest = n, this.req = n({
|
|
70
70
|
baseURL: `${r}/v1`,
|
|
71
71
|
timeout: 1e4,
|
|
@@ -86,9 +86,9 @@ class Er {
|
|
|
86
86
|
requestTransformer: (a) => {
|
|
87
87
|
this.$gamerToken && (a.headers.Authorization = `Bearer ${this.$gamerToken}`);
|
|
88
88
|
}
|
|
89
|
-
}),
|
|
89
|
+
}), be()) {
|
|
90
90
|
const a = /^(?:localhost|[\d.]+):\d{4}$/.test(location.host), o = P("gamer_token");
|
|
91
|
-
(
|
|
91
|
+
(de() || a && o) && (this.$gamerToken = o);
|
|
92
92
|
}
|
|
93
93
|
this.$gamerToken || this.loadGamerTokenCache();
|
|
94
94
|
}
|
|
@@ -171,7 +171,7 @@ class Er {
|
|
|
171
171
|
const { code: n, data: r } = await this.req.post(
|
|
172
172
|
"login-with-token",
|
|
173
173
|
c({ id_token: this.idToken, weixin_token: t ? this.weixinToken : null }),
|
|
174
|
-
|
|
174
|
+
fe,
|
|
175
175
|
{
|
|
176
176
|
message: !1,
|
|
177
177
|
cacheTTL: 300,
|
|
@@ -213,21 +213,21 @@ class Er {
|
|
|
213
213
|
return n;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const Ce = {
|
|
217
217
|
/** 未知 */
|
|
218
218
|
Unknown: "unknown",
|
|
219
219
|
/** 男 */
|
|
220
220
|
Male: "male",
|
|
221
221
|
/** 女 */
|
|
222
222
|
Female: "female"
|
|
223
|
-
},
|
|
223
|
+
}, Ve = e.string().enum(Ce).lock(), Re = {
|
|
224
224
|
/** 积分增加 */
|
|
225
225
|
Increase: "increase",
|
|
226
226
|
/** 积分减少 */
|
|
227
227
|
Decrease: "decrease",
|
|
228
228
|
/** 积分过期 */
|
|
229
229
|
Expired: "expired"
|
|
230
|
-
},
|
|
230
|
+
}, je = e.string().enum(Re).lock(), Te = {
|
|
231
231
|
/** 游戏内购买 */
|
|
232
232
|
Order: "order",
|
|
233
233
|
/** 游戏内消耗 */
|
|
@@ -240,21 +240,21 @@ const ve = {
|
|
|
240
240
|
Admin: "admin",
|
|
241
241
|
/** 运营活动 */
|
|
242
242
|
Event: "event"
|
|
243
|
-
},
|
|
243
|
+
}, qe = e.string().enum(Te).lock(), xe = {
|
|
244
244
|
/** 游戏内奖励 */
|
|
245
245
|
GameReward: "game_reward",
|
|
246
246
|
/** 实物商品 */
|
|
247
247
|
Physical: "physical",
|
|
248
248
|
/** 虚拟商品 */
|
|
249
249
|
Virtual: "virtual"
|
|
250
|
-
}, Z = e.string().enum(
|
|
250
|
+
}, Z = e.string().enum(xe).lock(), Se = {
|
|
251
251
|
/** 待发放 */
|
|
252
252
|
Pending: "pending",
|
|
253
253
|
/** 已发放 */
|
|
254
254
|
Issued: "issued",
|
|
255
255
|
/** 发放失败 */
|
|
256
256
|
Failed: "failed"
|
|
257
|
-
},
|
|
257
|
+
}, Le = e.string().enum(Se).lock(), Pe = e.object({
|
|
258
258
|
default_avatar_url: e.string(),
|
|
259
259
|
official_avatar_urls: e.array(e.string()),
|
|
260
260
|
default_nickname: e.string(),
|
|
@@ -272,7 +272,7 @@ const ve = {
|
|
|
272
272
|
exp_description: e.string(),
|
|
273
273
|
credit_description: e.string(),
|
|
274
274
|
send_role_mail_rate_limit: e.number()
|
|
275
|
-
}).lock(),
|
|
275
|
+
}).lock(), Ee = e.object({
|
|
276
276
|
member_id: e.string(),
|
|
277
277
|
player_id: e.string(),
|
|
278
278
|
exp: e.number(),
|
|
@@ -281,18 +281,18 @@ const ve = {
|
|
|
281
281
|
credit_expiring: e.number(),
|
|
282
282
|
level_change_time: e.number(),
|
|
283
283
|
level_expire_time: e.number()
|
|
284
|
-
}).lock(),
|
|
284
|
+
}).lock(), $e = e.object({
|
|
285
285
|
server_id: e.string(),
|
|
286
286
|
server_name: e.string()
|
|
287
|
-
}).lock(),
|
|
287
|
+
}).lock(), Ue = e.object({
|
|
288
288
|
role_id: e.string(),
|
|
289
289
|
role_name: e.string()
|
|
290
290
|
}).lock(), X = e.object({
|
|
291
|
+
...Ue.shape,
|
|
291
292
|
...$e.shape,
|
|
292
|
-
...Ee.shape,
|
|
293
293
|
role_level: e.number(),
|
|
294
294
|
last_login_time: e.number()
|
|
295
|
-
}).lock(),
|
|
295
|
+
}).lock(), Fe = e.object({
|
|
296
296
|
...X.shape,
|
|
297
297
|
/** 角色战力 */
|
|
298
298
|
role_fighting: e.number(),
|
|
@@ -302,11 +302,11 @@ const ve = {
|
|
|
302
302
|
kin_name: e.string().optional(),
|
|
303
303
|
/** 宗门职位 */
|
|
304
304
|
kin_position: e.string().optional()
|
|
305
|
-
}).lock(),
|
|
305
|
+
}).lock(), Ie = e.object({
|
|
306
306
|
name: e.string(),
|
|
307
307
|
avatar_url: e.string(),
|
|
308
308
|
bio: e.string(),
|
|
309
|
-
gender:
|
|
309
|
+
gender: Ve,
|
|
310
310
|
birthday: e.object({ year: e.number(), month: e.number(), day: e.number() })
|
|
311
311
|
}).lock(), Y = e.object({
|
|
312
312
|
address_id: e.number(),
|
|
@@ -317,15 +317,15 @@ const ve = {
|
|
|
317
317
|
district: e.string(),
|
|
318
318
|
address: e.string(),
|
|
319
319
|
is_default: e.bool()
|
|
320
|
-
}).lock(),
|
|
320
|
+
}).lock(), De = e.object({
|
|
321
321
|
increased_credit: e.number(),
|
|
322
322
|
decreased_credit: e.number(),
|
|
323
323
|
expired_credit: e.number(),
|
|
324
324
|
balance_credit: e.number()
|
|
325
|
-
}).lock(),
|
|
325
|
+
}).lock(), Ae = e.object({
|
|
326
326
|
id: e.number(),
|
|
327
|
-
change_type:
|
|
328
|
-
change_scene:
|
|
327
|
+
change_type: je,
|
|
328
|
+
change_scene: qe,
|
|
329
329
|
change_credit: e.number(),
|
|
330
330
|
balance: e.number(),
|
|
331
331
|
change_time: e.number()
|
|
@@ -364,7 +364,7 @@ const ve = {
|
|
|
364
364
|
created_at: e.number(),
|
|
365
365
|
updated_at: e.number(),
|
|
366
366
|
redeemable_quantity: e.number().optional()
|
|
367
|
-
}).lock(),
|
|
367
|
+
}).lock(), Ge = e.object({
|
|
368
368
|
...C(W.shape, "tag"),
|
|
369
369
|
product: ee.clone().optional()
|
|
370
370
|
}).lock(), $r = e.union(
|
|
@@ -375,7 +375,7 @@ const ve = {
|
|
|
375
375
|
e.object({
|
|
376
376
|
address_id: e.number()
|
|
377
377
|
})
|
|
378
|
-
).satisfies().lock(),
|
|
378
|
+
).satisfies().lock(), Oe = e.object({
|
|
379
379
|
recipient: e.string(),
|
|
380
380
|
mobile: e.string(),
|
|
381
381
|
province: e.string(),
|
|
@@ -384,11 +384,11 @@ const ve = {
|
|
|
384
384
|
address: e.string(),
|
|
385
385
|
express_company: e.string(),
|
|
386
386
|
express_number: e.string()
|
|
387
|
-
}).lock(),
|
|
387
|
+
}).lock(), Ne = e.object({
|
|
388
388
|
server_id: e.string(),
|
|
389
389
|
role_id: e.string(),
|
|
390
390
|
role_name: e.string()
|
|
391
|
-
}).lock(),
|
|
391
|
+
}).lock(), Qe = e.object({
|
|
392
392
|
redemption_id: e.number(),
|
|
393
393
|
player_id: e.string(),
|
|
394
394
|
product_id: e.number(),
|
|
@@ -399,14 +399,14 @@ const ve = {
|
|
|
399
399
|
catalog_name: e.string(),
|
|
400
400
|
quantity: e.number(),
|
|
401
401
|
amount: e.number(),
|
|
402
|
-
status:
|
|
402
|
+
status: Le,
|
|
403
403
|
created_at: e.number(),
|
|
404
|
-
extra_data: e.union(
|
|
405
|
-
}),
|
|
406
|
-
credit_logs: e.array(
|
|
404
|
+
extra_data: e.union(Oe.clone(), Ne.clone()).satisfies().optional()
|
|
405
|
+
}), Be = e.guard(Pe), M = s({ player: Ee }), Me = s({ roles: e.array(X) }), q = s({ role_card: Fe }), K = e.guard(Ie), H = e.guard(Y), Ke = s({ addresses: e.array(Y) }), He = e.guard(De), ze = s({
|
|
406
|
+
credit_logs: e.array(Ae),
|
|
407
407
|
next_token: e.string().optional()
|
|
408
|
-
}),
|
|
409
|
-
redemptions: e.array(
|
|
408
|
+
}), Je = s({ products: e.array(ee) }), Ze = s({ benefits: e.array(W) }), Xe = s({ benefit: Ge }), Ye = s({
|
|
409
|
+
redemptions: e.array(Qe),
|
|
410
410
|
next_token: e.string().optional()
|
|
411
411
|
});
|
|
412
412
|
class Ur {
|
|
@@ -421,7 +421,7 @@ class Ur {
|
|
|
421
421
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=tuhsPt3ihp
|
|
422
422
|
*/
|
|
423
423
|
async getConfig(t) {
|
|
424
|
-
const { data: n } = await this.req.get("club/config",
|
|
424
|
+
const { data: n } = await this.req.get("club/config", Be, t);
|
|
425
425
|
return n;
|
|
426
426
|
}
|
|
427
427
|
/**
|
|
@@ -462,7 +462,7 @@ class Ur {
|
|
|
462
462
|
*/
|
|
463
463
|
async getRoles(t, n, r) {
|
|
464
464
|
if (!await this.token.autoLogin()) return [];
|
|
465
|
-
const { data: a } = await this.req.get("club/roles",
|
|
465
|
+
const { data: a } = await this.req.get("club/roles", Me, {
|
|
466
466
|
...r,
|
|
467
467
|
params: c({ player_id: t, refresh: n })
|
|
468
468
|
});
|
|
@@ -534,7 +534,7 @@ class Ur {
|
|
|
534
534
|
*/
|
|
535
535
|
async getAddresses(t) {
|
|
536
536
|
if (!await this.token.autoLogin()) return [];
|
|
537
|
-
const { data: n } = await this.req.get("club/addresses",
|
|
537
|
+
const { data: n } = await this.req.get("club/addresses", Ke, t);
|
|
538
538
|
return n?.addresses ?? [];
|
|
539
539
|
}
|
|
540
540
|
/**
|
|
@@ -582,7 +582,7 @@ class Ur {
|
|
|
582
582
|
*/
|
|
583
583
|
async getUserCredit(t, n) {
|
|
584
584
|
await this.token.autoLogin();
|
|
585
|
-
const { data: r, code: a, message: o } = await this.req.get("club/user-credit",
|
|
585
|
+
const { data: r, code: a, message: o } = await this.req.get("club/user-credit", He, {
|
|
586
586
|
...n,
|
|
587
587
|
params: c(t)
|
|
588
588
|
});
|
|
@@ -598,7 +598,7 @@ class Ur {
|
|
|
598
598
|
*/
|
|
599
599
|
async getCreditLogs(t, n) {
|
|
600
600
|
await this.token.autoLogin();
|
|
601
|
-
const { data: r } = await this.req.get("club/credit-logs",
|
|
601
|
+
const { data: r } = await this.req.get("club/credit-logs", ze, {
|
|
602
602
|
...n,
|
|
603
603
|
params: c({ max_results: 20, ...t })
|
|
604
604
|
});
|
|
@@ -614,7 +614,7 @@ class Ur {
|
|
|
614
614
|
*/
|
|
615
615
|
async getBenefits(t) {
|
|
616
616
|
if (!await this.token.autoLogin()) return [];
|
|
617
|
-
const { data: n } = await this.req.get("club/benefits",
|
|
617
|
+
const { data: n } = await this.req.get("club/benefits", Ze, t);
|
|
618
618
|
return n?.benefits || [];
|
|
619
619
|
}
|
|
620
620
|
/**
|
|
@@ -624,7 +624,7 @@ class Ur {
|
|
|
624
624
|
*/
|
|
625
625
|
async getBenefit(t, n) {
|
|
626
626
|
if (!await this.token.autoLogin()) return null;
|
|
627
|
-
const { data: r } = await this.req.get("club/benefit",
|
|
627
|
+
const { data: r } = await this.req.get("club/benefit", Xe, {
|
|
628
628
|
...n,
|
|
629
629
|
params: { benefit_id: t }
|
|
630
630
|
});
|
|
@@ -636,7 +636,7 @@ class Ur {
|
|
|
636
636
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=r3vC3PzfMQ
|
|
637
637
|
*/
|
|
638
638
|
async getProducts(t, n) {
|
|
639
|
-
const { data: r } = await this.req.get("club/products",
|
|
639
|
+
const { data: r } = await this.req.get("club/products", Je, {
|
|
640
640
|
...n,
|
|
641
641
|
params: t
|
|
642
642
|
});
|
|
@@ -662,7 +662,7 @@ class Ur {
|
|
|
662
662
|
*/
|
|
663
663
|
async getRedemptions(t, n) {
|
|
664
664
|
await this.token.autoLogin();
|
|
665
|
-
const { data: r } = await this.req.get("club/redemptions",
|
|
665
|
+
const { data: r } = await this.req.get("club/redemptions", Ye, {
|
|
666
666
|
...n,
|
|
667
667
|
params: c({ max_results: 20, ...t })
|
|
668
668
|
});
|
|
@@ -693,17 +693,17 @@ const V = {
|
|
|
693
693
|
ExternalCode: "external_gift_code",
|
|
694
694
|
/** 空奖励 */
|
|
695
695
|
VoidItem: "void_item"
|
|
696
|
-
}, te = e.string().enum(V).lock(), Fr = V, ne = te,
|
|
696
|
+
}, te = e.string().enum(V).lock(), Fr = V, ne = te, We = {
|
|
697
697
|
/** 世游通行证 ID / Combo ID */
|
|
698
698
|
UserId: "user_id",
|
|
699
699
|
/** 游戏角色 ID */
|
|
700
700
|
RoleId: "role_id"
|
|
701
|
-
},
|
|
701
|
+
}, et = e.string().enum(We).lock(), tt = {
|
|
702
702
|
None: "none",
|
|
703
703
|
Daily: "daily",
|
|
704
704
|
Weekly: "weekly",
|
|
705
705
|
Monthly: "monthly"
|
|
706
|
-
},
|
|
706
|
+
}, nt = e.string().enum(tt).lock(), u = {
|
|
707
707
|
/** 预约 */
|
|
708
708
|
Preregister: "preregister",
|
|
709
709
|
/** 抽奖 */
|
|
@@ -744,7 +744,7 @@ const V = {
|
|
|
744
744
|
ClaimActivationKey: "claim_activation_key",
|
|
745
745
|
/** 不朽箴言特有的 AI 聊天 */
|
|
746
746
|
ZeroChatgpt: "zero_chatgpt"
|
|
747
|
-
},
|
|
747
|
+
}, rt = e.string().enum(u).lock(), at = {
|
|
748
748
|
/** 累计游戏内活跃值 */
|
|
749
749
|
Active: "player_active_points",
|
|
750
750
|
/** 累计登录,单位 人天 */
|
|
@@ -763,14 +763,14 @@ const V = {
|
|
|
763
763
|
PlayerLevel: "player_level",
|
|
764
764
|
/** 活动道具累计获取 */
|
|
765
765
|
EventItems: "event_items"
|
|
766
|
-
}, re = e.string().enum(
|
|
766
|
+
}, re = e.string().enum(at).lock(), ot = {
|
|
767
767
|
/** 官方上传 */
|
|
768
768
|
System: "system",
|
|
769
769
|
/** 用户投稿 */
|
|
770
770
|
UserSubmission: "user_submission",
|
|
771
771
|
/** 投票入围 */
|
|
772
772
|
Shortlisted: "shortlisted"
|
|
773
|
-
},
|
|
773
|
+
}, it = e.string().enum(ot).lock(), p = {
|
|
774
774
|
/** 未获得奖励 */
|
|
775
775
|
Ineligible: "ineligible",
|
|
776
776
|
/** 奖励未领取 */
|
|
@@ -813,17 +813,17 @@ const V = {
|
|
|
813
813
|
Failed: p.Failed,
|
|
814
814
|
/** 奖励已发货 */
|
|
815
815
|
Delivered: p.Delivered
|
|
816
|
-
}, $ = e.string().enum(_).lock(),
|
|
816
|
+
}, $ = e.string().enum(_).lock(), st = {
|
|
817
817
|
/** 玩法产出奖励 */
|
|
818
818
|
Output: "output",
|
|
819
819
|
/** 玩法参与奖励 */
|
|
820
820
|
Engage: "engage"
|
|
821
|
-
}, U = e.string().enum(
|
|
821
|
+
}, U = e.string().enum(st).lock(), ct = {
|
|
822
822
|
/** 私有队伍 */
|
|
823
823
|
Private: "private",
|
|
824
824
|
/** 公开队伍 */
|
|
825
825
|
Public: "public"
|
|
826
|
-
},
|
|
826
|
+
}, ut = e.string().enum(ct).lock(), w = {
|
|
827
827
|
/** 未知状态 */
|
|
828
828
|
Unknown: "unknown",
|
|
829
829
|
/** 等待开奖 */
|
|
@@ -845,78 +845,78 @@ const V = {
|
|
|
845
845
|
ChangeVisibility: "change_visibility",
|
|
846
846
|
/** 查询组队信息 */
|
|
847
847
|
Query: "query"
|
|
848
|
-
}, Ar = e.string().enum(lt).lock(),
|
|
848
|
+
}, Ar = e.string().enum(lt).lock(), mt = {
|
|
849
849
|
/** 查询抽奖券 */
|
|
850
850
|
Query: "query",
|
|
851
851
|
/** 开奖 */
|
|
852
852
|
Draw: "draw",
|
|
853
853
|
/** 领奖 */
|
|
854
854
|
Claim: "claim"
|
|
855
|
-
}, Gr = e.string().enum(
|
|
855
|
+
}, Gr = e.string().enum(mt).lock(), oe = {
|
|
856
856
|
/** 将所有队员的进度值求和,作为队伍进度值 */
|
|
857
857
|
Sum: "sum",
|
|
858
858
|
/** 以进度值倒序排名第 N 的队员的进度值,作为队伍进度值。如果队伍人数不足 N,则队伍进度值为 0。N 的值来自于配置字段 top_n */
|
|
859
859
|
TopN: "top_n"
|
|
860
|
-
}, Or = e.string().enum(oe).lock(),
|
|
860
|
+
}, Or = e.string().enum(oe).lock(), dt = e.string().enum(oe).optional().lock(), gt = e.string().enum(C(V, "GiftCode", "LotteryTicket")), F = e.object({
|
|
861
861
|
reward_item_id: e.number(),
|
|
862
862
|
reward_amount: e.number(),
|
|
863
863
|
reward_item_name: e.string(),
|
|
864
864
|
reward_item_icon_url: e.string(),
|
|
865
865
|
reward_item_desc: e.string().optional(),
|
|
866
|
-
reward_item_type:
|
|
866
|
+
reward_item_type: gt,
|
|
867
867
|
reward_item_rating: e.number()
|
|
868
|
-
}).lock(),
|
|
868
|
+
}).lock(), pt = e.object({
|
|
869
869
|
engage_count: e.number(),
|
|
870
870
|
rewards: e.array(F)
|
|
871
|
-
}).lock(),
|
|
871
|
+
}).lock(), _t = e.union(
|
|
872
872
|
e.object({
|
|
873
873
|
feature_reward_type: e.string().enum("every"),
|
|
874
874
|
reward_details: e.array(F)
|
|
875
875
|
}),
|
|
876
876
|
e.object({
|
|
877
877
|
feature_reward_type: e.string().enum("regular"),
|
|
878
|
-
reward_details: e.array(
|
|
878
|
+
reward_details: e.array(pt)
|
|
879
879
|
})
|
|
880
|
-
).satisfies().lock(),
|
|
880
|
+
).satisfies().lock(), l = e.object({
|
|
881
881
|
feature_name: e.string(),
|
|
882
882
|
feature_id: e.number(),
|
|
883
883
|
description: e.string(),
|
|
884
|
-
cycle:
|
|
884
|
+
cycle: nt,
|
|
885
885
|
cycle_limit: e.number(),
|
|
886
886
|
limit: e.number(),
|
|
887
887
|
since: e.number(),
|
|
888
888
|
until: e.number(),
|
|
889
|
-
engage_account:
|
|
890
|
-
feature_rewards:
|
|
889
|
+
engage_account: et,
|
|
890
|
+
feature_rewards: _t.clone().optional(),
|
|
891
891
|
sort: e.number().optional()
|
|
892
|
-
}),
|
|
893
|
-
...
|
|
894
|
-
feature_type: e.string().enum(
|
|
892
|
+
}), bt = u.Cashback, yt = e.object({
|
|
893
|
+
...l.shape,
|
|
894
|
+
feature_type: e.string().enum(bt),
|
|
895
895
|
config: e.object({
|
|
896
896
|
order_start_time: e.number(),
|
|
897
897
|
order_end_time: e.number(),
|
|
898
898
|
claim_rewards_start_time: e.number(),
|
|
899
899
|
claim_rewards_end_time: e.number()
|
|
900
900
|
})
|
|
901
|
-
}),
|
|
902
|
-
...
|
|
903
|
-
feature_type: e.string().enum(
|
|
904
|
-
}),
|
|
905
|
-
...
|
|
906
|
-
feature_type: e.string().enum(
|
|
907
|
-
}),
|
|
908
|
-
...
|
|
909
|
-
feature_type: e.string().enum(
|
|
910
|
-
}),
|
|
911
|
-
...
|
|
912
|
-
feature_type: e.string().enum(
|
|
901
|
+
}), ft = u.CheckIn, ht = e.object({
|
|
902
|
+
...l.shape,
|
|
903
|
+
feature_type: e.string().enum(ft)
|
|
904
|
+
}), wt = u.ClaimActivationKey, kt = e.object({
|
|
905
|
+
...l.shape,
|
|
906
|
+
feature_type: e.string().enum(wt)
|
|
907
|
+
}), vt = u.ClaimRewards, Ct = e.object({
|
|
908
|
+
...l.shape,
|
|
909
|
+
feature_type: e.string().enum(vt)
|
|
910
|
+
}), Vt = u.Comment, Rt = e.object({
|
|
911
|
+
...l.shape,
|
|
912
|
+
feature_type: e.string().enum(Vt),
|
|
913
913
|
config: e.object({
|
|
914
914
|
comments: e.array(e.string()),
|
|
915
915
|
send_rate: e.number()
|
|
916
916
|
})
|
|
917
|
-
}),
|
|
918
|
-
...
|
|
919
|
-
feature_type: e.string().enum(
|
|
917
|
+
}), jt = u.Follow, Tt = e.object({
|
|
918
|
+
...l.shape,
|
|
919
|
+
feature_type: e.string().enum(jt),
|
|
920
920
|
config: e.object({
|
|
921
921
|
platform: e.string(),
|
|
922
922
|
platform_icon: e.string().optional(),
|
|
@@ -924,66 +924,66 @@ const V = {
|
|
|
924
924
|
qr_code_url: e.string().optional(),
|
|
925
925
|
platform_desc: e.string().optional()
|
|
926
926
|
})
|
|
927
|
-
}),
|
|
927
|
+
}), qt = u.GiftCode, xt = e.object({
|
|
928
928
|
name: e.string(),
|
|
929
929
|
icon_url: e.string(),
|
|
930
930
|
count: e.number()
|
|
931
|
-
}),
|
|
932
|
-
...
|
|
933
|
-
feature_type: e.string().enum(
|
|
931
|
+
}), St = e.object({
|
|
932
|
+
...l.shape,
|
|
933
|
+
feature_type: e.string().enum(qt),
|
|
934
934
|
config: e.object({
|
|
935
|
-
gift_items: e.array(
|
|
935
|
+
gift_items: e.array(xt),
|
|
936
936
|
mp_url: e.string().optional(),
|
|
937
937
|
mp_qrcode_url: e.string().optional()
|
|
938
938
|
})
|
|
939
|
-
}),
|
|
940
|
-
...
|
|
941
|
-
feature_type: e.string().enum(
|
|
939
|
+
}), Lt = u.Invite, Pt = e.object({
|
|
940
|
+
...l.shape,
|
|
941
|
+
feature_type: e.string().enum(Lt),
|
|
942
942
|
config: e.object({
|
|
943
943
|
share_url: e.string()
|
|
944
944
|
})
|
|
945
|
-
}),
|
|
946
|
-
...
|
|
947
|
-
feature_type: e.string().enum(
|
|
948
|
-
}),
|
|
945
|
+
}), Et = u.InvitedRegister, $t = e.object({
|
|
946
|
+
...l.shape,
|
|
947
|
+
feature_type: e.string().enum(Et)
|
|
948
|
+
}), Ut = e.string().enum(C(V, "GiftCode", "LotteryTicket")), Ft = u.Lottery, It = e.object({
|
|
949
949
|
reward_item_id: e.number(),
|
|
950
950
|
reward_item_name: e.string(),
|
|
951
|
-
reward_item_type:
|
|
951
|
+
reward_item_type: Ut,
|
|
952
952
|
reward_item_icon_url: e.string(),
|
|
953
953
|
reward_item_desc: e.string().optional(),
|
|
954
954
|
reward_amount: e.number(),
|
|
955
955
|
reward_remaining_stock: e.number()
|
|
956
|
-
}),
|
|
957
|
-
...
|
|
958
|
-
feature_type: e.string().enum(
|
|
956
|
+
}), Dt = e.object({
|
|
957
|
+
...l.shape,
|
|
958
|
+
feature_type: e.string().enum(Ft),
|
|
959
959
|
config: e.object({
|
|
960
960
|
consume_item_id: e.number(),
|
|
961
961
|
consume_item_name: e.number(),
|
|
962
962
|
consume_item_icon_url: e.string(),
|
|
963
963
|
consume_item_count: e.number(),
|
|
964
964
|
consume_item_desc: e.string().optional(),
|
|
965
|
-
rewards: e.array(
|
|
965
|
+
rewards: e.array(It)
|
|
966
966
|
})
|
|
967
|
-
}),
|
|
968
|
-
...
|
|
969
|
-
feature_type: e.string().enum(
|
|
967
|
+
}), At = u.LotteryDraw, Gt = e.object({
|
|
968
|
+
...l.shape,
|
|
969
|
+
feature_type: e.string().enum(At),
|
|
970
970
|
config: e.object({
|
|
971
971
|
draw_not_before: e.number(),
|
|
972
972
|
draw_not_after: e.number()
|
|
973
973
|
})
|
|
974
|
-
}),
|
|
975
|
-
...
|
|
976
|
-
feature_type: e.string().enum(
|
|
977
|
-
}),
|
|
978
|
-
...
|
|
979
|
-
feature_type: e.string().enum(
|
|
974
|
+
}), Ot = u.Preregister, Nt = e.object({
|
|
975
|
+
...l.shape,
|
|
976
|
+
feature_type: e.string().enum(Ot)
|
|
977
|
+
}), Qt = u.Quest, Bt = e.object({
|
|
978
|
+
...l.shape,
|
|
979
|
+
feature_type: e.string().enum(Qt),
|
|
980
980
|
config: e.object({
|
|
981
981
|
objective: re,
|
|
982
982
|
completion_value: e.number(),
|
|
983
983
|
team: e.object({
|
|
984
984
|
feature_id: e.number().optional(),
|
|
985
985
|
completion_value: e.number(),
|
|
986
|
-
progress_algorithm:
|
|
986
|
+
progress_algorithm: dt,
|
|
987
987
|
top_n: e.number().optional()
|
|
988
988
|
}).optional(),
|
|
989
989
|
config: e.object({
|
|
@@ -993,38 +993,38 @@ const V = {
|
|
|
993
993
|
event_item_id: e.number().optional()
|
|
994
994
|
}).optional()
|
|
995
995
|
})
|
|
996
|
-
}),
|
|
997
|
-
...
|
|
998
|
-
feature_type: e.string().enum(
|
|
999
|
-
}),
|
|
1000
|
-
...
|
|
1001
|
-
feature_type: e.string().enum(
|
|
996
|
+
}), Mt = u.Register, Kt = e.object({
|
|
997
|
+
...l.shape,
|
|
998
|
+
feature_type: e.string().enum(Mt)
|
|
999
|
+
}), Ht = u.Share, zt = e.object({
|
|
1000
|
+
...l.shape,
|
|
1001
|
+
feature_type: e.string().enum(Ht),
|
|
1002
1002
|
config: e.object({
|
|
1003
1003
|
share_platform: e.string(),
|
|
1004
1004
|
jump_url: e.string().optional(),
|
|
1005
1005
|
icon_url: e.string().optional()
|
|
1006
1006
|
})
|
|
1007
|
-
}),
|
|
1008
|
-
...
|
|
1009
|
-
feature_type: e.string().enum(
|
|
1007
|
+
}), Jt = u.Subscribe, Zt = e.object({
|
|
1008
|
+
...l.shape,
|
|
1009
|
+
feature_type: e.string().enum(Jt),
|
|
1010
1010
|
config: e.object({
|
|
1011
1011
|
weixin_template_ids: e.array(e.string())
|
|
1012
1012
|
})
|
|
1013
|
-
}),
|
|
1014
|
-
...
|
|
1015
|
-
feature_type: e.string().enum(
|
|
1013
|
+
}), Xt = u.Survey, Yt = e.object({
|
|
1014
|
+
...l.shape,
|
|
1015
|
+
feature_type: e.string().enum(Xt),
|
|
1016
1016
|
config: e.object({
|
|
1017
1017
|
survey_id: e.string(),
|
|
1018
1018
|
survey_url: e.string()
|
|
1019
1019
|
})
|
|
1020
|
-
}),
|
|
1021
|
-
...
|
|
1022
|
-
feature_type: e.string().enum(
|
|
1020
|
+
}), Wt = u.Team, en = e.object({
|
|
1021
|
+
...l.shape,
|
|
1022
|
+
feature_type: e.string().enum(Wt),
|
|
1023
1023
|
config: e.object({
|
|
1024
1024
|
max_members: e.number().min(1),
|
|
1025
1025
|
min_members: e.number().min(1)
|
|
1026
1026
|
})
|
|
1027
|
-
}),
|
|
1027
|
+
}), tn = u.Vote, nn = e.object({
|
|
1028
1028
|
sn: e.string(),
|
|
1029
1029
|
name: e.string(),
|
|
1030
1030
|
img_urls: e.array(e.string()).optional(),
|
|
@@ -1034,61 +1034,61 @@ const V = {
|
|
|
1034
1034
|
amount: e.number(),
|
|
1035
1035
|
finalists: e.bool(),
|
|
1036
1036
|
last_vote_time: e.number()
|
|
1037
|
-
}),
|
|
1038
|
-
...
|
|
1039
|
-
feature_type: e.string().enum(
|
|
1037
|
+
}), rn = e.object({
|
|
1038
|
+
...l.shape,
|
|
1039
|
+
feature_type: e.string().enum(tn),
|
|
1040
1040
|
config: e.object({
|
|
1041
1041
|
vote_feature_ids: e.array(e.number()),
|
|
1042
1042
|
submission_feature_ids: e.array(e.number()),
|
|
1043
1043
|
finalists_amount: e.number(),
|
|
1044
|
-
source:
|
|
1045
|
-
options: e.array(
|
|
1044
|
+
source: it,
|
|
1045
|
+
options: e.array(nn),
|
|
1046
1046
|
rewards: e.array(F)
|
|
1047
1047
|
})
|
|
1048
|
-
}),
|
|
1049
|
-
...
|
|
1050
|
-
feature_type: e.string().enum(
|
|
1051
|
-
}),
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
).key("feature_type").satisfies(),
|
|
1048
|
+
}), an = u.ZeroChatgpt, on = e.object({
|
|
1049
|
+
...l.shape,
|
|
1050
|
+
feature_type: e.string().enum(an)
|
|
1051
|
+
}), sn = e.union(
|
|
1052
|
+
yt,
|
|
1053
|
+
ht,
|
|
1054
|
+
Ct,
|
|
1055
|
+
Rt,
|
|
1056
|
+
Tt,
|
|
1057
|
+
St,
|
|
1058
|
+
Pt,
|
|
1059
|
+
$t,
|
|
1060
|
+
Dt,
|
|
1061
|
+
Gt,
|
|
1062
|
+
Nt,
|
|
1063
|
+
Bt,
|
|
1064
|
+
Kt,
|
|
1065
|
+
zt,
|
|
1066
|
+
Zt,
|
|
1067
|
+
Yt,
|
|
1068
|
+
en,
|
|
1069
|
+
rn,
|
|
1070
|
+
kt,
|
|
1071
|
+
on
|
|
1072
|
+
).key("feature_type").satisfies(), cn = e.object({
|
|
1073
1073
|
event_name: e.string(),
|
|
1074
1074
|
rules: e.string(),
|
|
1075
1075
|
since: e.number(),
|
|
1076
1076
|
until: e.number(),
|
|
1077
1077
|
visit_count: e.number().optional(),
|
|
1078
|
-
features: e.array(
|
|
1079
|
-
}).lock(), x = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()),
|
|
1078
|
+
features: e.array(sn)
|
|
1079
|
+
}).lock(), x = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()), un = e.object({
|
|
1080
1080
|
order_total_amount: x,
|
|
1081
1081
|
cashback_total_amount: x,
|
|
1082
1082
|
game_item_count: x
|
|
1083
1083
|
}), ln = e.object({
|
|
1084
1084
|
activation_key: e.string().disallow("")
|
|
1085
|
-
}), un = e.object({
|
|
1086
|
-
gift_code: e.string()
|
|
1087
1085
|
}), mn = e.object({
|
|
1086
|
+
gift_code: e.string()
|
|
1087
|
+
}), dn = e.object({
|
|
1088
1088
|
user_id: e.string(),
|
|
1089
1089
|
name: e.string().optional(),
|
|
1090
1090
|
avatar_url: e.string().optional()
|
|
1091
|
-
}),
|
|
1091
|
+
}), gn = e.object({
|
|
1092
1092
|
lottery_count: e.number()
|
|
1093
1093
|
}), I = e.object({
|
|
1094
1094
|
reward_id: e.number(),
|
|
@@ -1105,51 +1105,44 @@ const V = {
|
|
|
1105
1105
|
event_name: e.string(),
|
|
1106
1106
|
feature_id: e.number(),
|
|
1107
1107
|
engagement_id: e.number(),
|
|
1108
|
-
feature_type:
|
|
1108
|
+
feature_type: rt,
|
|
1109
1109
|
receive_time: e.number(),
|
|
1110
1110
|
extra_data: e.record(e.unknown()).optional()
|
|
1111
|
-
}),
|
|
1111
|
+
}), pn = e.string().enum(w.Unknown, w.Pending), _n = e.union(
|
|
1112
1112
|
e.object({
|
|
1113
1113
|
ticket: e.string(),
|
|
1114
|
-
status:
|
|
1114
|
+
status: pn
|
|
1115
1115
|
}),
|
|
1116
1116
|
e.object({
|
|
1117
1117
|
ticket: e.string(),
|
|
1118
1118
|
status: e.string().enum(C(w, "Unknown", "Pending")),
|
|
1119
1119
|
reward: I
|
|
1120
1120
|
})
|
|
1121
|
-
).satisfies(),
|
|
1122
|
-
tickets: e.array(
|
|
1123
|
-
}), bn = e.object({
|
|
1124
|
-
platforms: e.array(e.string())
|
|
1121
|
+
).satisfies(), bn = e.object({
|
|
1122
|
+
tickets: e.array(_n)
|
|
1125
1123
|
}), yn = e.object({
|
|
1124
|
+
platforms: e.array(e.string())
|
|
1125
|
+
}), ie = e.object({
|
|
1126
|
+
role_name: e.string(),
|
|
1127
|
+
is_leader: e.bool(),
|
|
1128
|
+
is_myself: e.bool().optional(),
|
|
1129
|
+
progress: e.number().optional()
|
|
1130
|
+
}).lock(), fn = e.object({
|
|
1126
1131
|
objective: re,
|
|
1127
1132
|
progress: e.number(),
|
|
1128
1133
|
completion_value: e.number().optional(),
|
|
1129
1134
|
team: e.object({
|
|
1130
1135
|
progress: e.number(),
|
|
1131
1136
|
completion_value: e.number().optional(),
|
|
1132
|
-
players: e.array(
|
|
1133
|
-
e.object({
|
|
1134
|
-
is_myself: e.bool().optional(),
|
|
1135
|
-
role_name: e.string(),
|
|
1136
|
-
is_leader: e.bool(),
|
|
1137
|
-
progress: e.number().optional()
|
|
1138
|
-
})
|
|
1139
|
-
)
|
|
1137
|
+
players: e.array(ie)
|
|
1140
1138
|
}).optional()
|
|
1141
|
-
}), fn = e.object({
|
|
1142
|
-
role_name: e.string(),
|
|
1143
|
-
is_leader: e.bool(),
|
|
1144
|
-
is_myself: e.bool(),
|
|
1145
|
-
progress: e.number()
|
|
1146
1139
|
}), hn = e.object({
|
|
1147
1140
|
progress: e.number(),
|
|
1148
1141
|
team: e.object({
|
|
1149
1142
|
progress: e.number(),
|
|
1150
|
-
team_members: e.array(
|
|
1143
|
+
team_members: e.array(ie).optional()
|
|
1151
1144
|
}).optional()
|
|
1152
|
-
})
|
|
1145
|
+
}), wn = e.object({
|
|
1153
1146
|
platform: e.string()
|
|
1154
1147
|
}), kn = e.object({
|
|
1155
1148
|
weixin_openid: e.string()
|
|
@@ -1166,7 +1159,7 @@ const V = {
|
|
|
1166
1159
|
server_name: e.string()
|
|
1167
1160
|
}), Vn = e.object({
|
|
1168
1161
|
team_code: e.string(),
|
|
1169
|
-
visibility:
|
|
1162
|
+
visibility: ut,
|
|
1170
1163
|
members: e.array(
|
|
1171
1164
|
e.object({
|
|
1172
1165
|
is_leader: e.bool(),
|
|
@@ -1189,18 +1182,18 @@ const V = {
|
|
|
1189
1182
|
video_note: e.number(),
|
|
1190
1183
|
created_at: e.number()
|
|
1191
1184
|
}), D = e.union(
|
|
1192
|
-
|
|
1193
|
-
|
|
1185
|
+
yn,
|
|
1186
|
+
gn,
|
|
1194
1187
|
vn,
|
|
1195
|
-
|
|
1188
|
+
dn,
|
|
1196
1189
|
wn,
|
|
1197
1190
|
Rn,
|
|
1198
1191
|
kn,
|
|
1199
|
-
cn,
|
|
1200
1192
|
un,
|
|
1193
|
+
mn,
|
|
1201
1194
|
Vn,
|
|
1202
|
-
|
|
1203
|
-
|
|
1195
|
+
fn,
|
|
1196
|
+
bn,
|
|
1204
1197
|
ln,
|
|
1205
1198
|
Tn,
|
|
1206
1199
|
e.custom(
|
|
@@ -1262,7 +1255,7 @@ const V = {
|
|
|
1262
1255
|
}), Un = e.object({
|
|
1263
1256
|
reward_id: e.number(),
|
|
1264
1257
|
reward_status: $
|
|
1265
|
-
}), Fn = e.guard(
|
|
1258
|
+
}), Fn = e.guard(cn), In = e.guard(Pn), S = s({ count: e.number() }), Dn = s({ first_visit: e.bool() }), An = s({
|
|
1266
1259
|
engagements: e.union(e.array(qn), e.array(Cn))
|
|
1267
1260
|
}), Gn = s({
|
|
1268
1261
|
status: e.array(En)
|
|
@@ -1633,9 +1626,10 @@ class Qr {
|
|
|
1633
1626
|
*/
|
|
1634
1627
|
async getQuestProgress(t, n) {
|
|
1635
1628
|
if (!await this.token.autoLogin()) return null;
|
|
1636
|
-
const { data: r, code: a, message: o } = await this.req.get(
|
|
1629
|
+
const { data: r, code: a, message: o } = await this.req.get(`event/${this.event}/quest-progress`, Xn, {
|
|
1637
1630
|
message: !1,
|
|
1638
|
-
|
|
1631
|
+
...n,
|
|
1632
|
+
params: { feature_id: t }
|
|
1639
1633
|
});
|
|
1640
1634
|
return r || {
|
|
1641
1635
|
message: o,
|
|
@@ -1657,7 +1651,7 @@ const Yn = {
|
|
|
1657
1651
|
Failed: "failed",
|
|
1658
1652
|
/** 嫌疑(仅自己可见) */
|
|
1659
1653
|
Suspect: "suspect"
|
|
1660
|
-
},
|
|
1654
|
+
}, se = e.string().enum(er).lock(), tr = {
|
|
1661
1655
|
/** 系统通知 */
|
|
1662
1656
|
System: "system",
|
|
1663
1657
|
/** 评论我的 */
|
|
@@ -1689,7 +1683,7 @@ const Yn = {
|
|
|
1689
1683
|
ReplyLiked: "reply_liked",
|
|
1690
1684
|
/** 回复被删除 */
|
|
1691
1685
|
ReplyDeleted: "reply_deleted"
|
|
1692
|
-
}, nr = e.string().enum(g).lock(),
|
|
1686
|
+
}, nr = e.string().enum(g).lock(), ce = e.object({
|
|
1693
1687
|
forum_id: e.number(),
|
|
1694
1688
|
icon_url: e.string(),
|
|
1695
1689
|
name: e.string(),
|
|
@@ -1706,7 +1700,7 @@ const Yn = {
|
|
|
1706
1700
|
post_num: e.number()
|
|
1707
1701
|
}).lock(), G = e.object({
|
|
1708
1702
|
post_id: e.number(),
|
|
1709
|
-
forum:
|
|
1703
|
+
forum: ce,
|
|
1710
1704
|
posted_by: e.string(),
|
|
1711
1705
|
nickname: e.string(),
|
|
1712
1706
|
avatar_url: e.string(),
|
|
@@ -1722,9 +1716,9 @@ const Yn = {
|
|
|
1722
1716
|
event_ids: e.array(e.number()),
|
|
1723
1717
|
is_pinned: e.bool(),
|
|
1724
1718
|
is_highlighted: e.bool(),
|
|
1725
|
-
status:
|
|
1719
|
+
status: se,
|
|
1726
1720
|
create_time: e.number()
|
|
1727
|
-
}).lock(),
|
|
1721
|
+
}).lock(), ue = e.object({
|
|
1728
1722
|
err_msg: e.string().optional()
|
|
1729
1723
|
}).optional().lock(), rr = e.object({
|
|
1730
1724
|
reply_id: e.number(),
|
|
@@ -1765,7 +1759,7 @@ const Yn = {
|
|
|
1765
1759
|
liked: e.bool(),
|
|
1766
1760
|
image_url: e.string(),
|
|
1767
1761
|
create_time: e.number(),
|
|
1768
|
-
status:
|
|
1762
|
+
status: se,
|
|
1769
1763
|
replies: e.array(R).optional()
|
|
1770
1764
|
}).lock(), ar = e.object({
|
|
1771
1765
|
image_url: e.string(),
|
|
@@ -1811,12 +1805,12 @@ const Yn = {
|
|
|
1811
1805
|
...O.shape,
|
|
1812
1806
|
...j.shape,
|
|
1813
1807
|
notification_type: e.string().enum(g.PostCommented)
|
|
1814
|
-
}),
|
|
1808
|
+
}), ur = e.object({
|
|
1815
1809
|
...b.shape,
|
|
1816
1810
|
...j.shape,
|
|
1817
1811
|
...N.shape,
|
|
1818
1812
|
notification_type: e.string().enum(g.CommentReplied)
|
|
1819
|
-
}),
|
|
1813
|
+
}), lr = e.object({
|
|
1820
1814
|
...b.shape,
|
|
1821
1815
|
...j.shape,
|
|
1822
1816
|
...O.shape,
|
|
@@ -1837,19 +1831,19 @@ const Yn = {
|
|
|
1837
1831
|
ir,
|
|
1838
1832
|
sr,
|
|
1839
1833
|
cr,
|
|
1840
|
-
lr,
|
|
1841
1834
|
ur,
|
|
1835
|
+
lr,
|
|
1842
1836
|
mr,
|
|
1843
1837
|
dr
|
|
1844
|
-
).satisfies().lock(), pr = s({ forums: e.array(
|
|
1838
|
+
).satisfies().lock(), pr = s({ forums: e.array(ce) }), _r = s({ topics: e.array(A) }), br = s({ topic: A }), yr = s({ post: G }), z = s({
|
|
1845
1839
|
posts: e.array(G),
|
|
1846
1840
|
next_token: e.string().optional()
|
|
1847
|
-
}), fr = s({ post: G, antispam:
|
|
1841
|
+
}), fr = s({ post: G, antispam: ue }), hr = s({
|
|
1848
1842
|
replies: e.array(R),
|
|
1849
1843
|
next_token: e.string().optional()
|
|
1850
1844
|
}), wr = s({ reply: R }), kr = s({
|
|
1851
1845
|
reply: R.clone().optional(),
|
|
1852
|
-
antispam:
|
|
1846
|
+
antispam: ue.clone().optional()
|
|
1853
1847
|
}), vr = s({ comment: k }), Cr = s({
|
|
1854
1848
|
comments: e.array(k),
|
|
1855
1849
|
next_token: e.string().optional()
|
|
@@ -2194,7 +2188,7 @@ class Kr {
|
|
|
2194
2188
|
const t = this.token.storage.get(J);
|
|
2195
2189
|
if (!t)
|
|
2196
2190
|
return null;
|
|
2197
|
-
const n =
|
|
2191
|
+
const n = ye(t);
|
|
2198
2192
|
return L(n) ? (this.token.weixinToken = n.weixin_token, await this.token.autoLogin(), n) : null;
|
|
2199
2193
|
}
|
|
2200
2194
|
/**
|
|
@@ -2220,7 +2214,7 @@ class Kr {
|
|
|
2220
2214
|
const n = await this.getLoginCache();
|
|
2221
2215
|
if (n)
|
|
2222
2216
|
return n;
|
|
2223
|
-
const r = await
|
|
2217
|
+
const r = await we(), { data: a, code: o, message: d } = await this.req.post(
|
|
2224
2218
|
"weixin/login",
|
|
2225
2219
|
{ code: r, appid: this.appid },
|
|
2226
2220
|
L,
|
|
@@ -2250,9 +2244,9 @@ class Kr {
|
|
|
2250
2244
|
async webLogin(t = "snsapi_userinfo", n) {
|
|
2251
2245
|
const r = P("code"), a = Date.now(), o = +P("state");
|
|
2252
2246
|
if (!r || !o || o < a - 1e3 * 60 * 5 || o > a) {
|
|
2253
|
-
const
|
|
2247
|
+
const me = Q(["code", "state"]);
|
|
2254
2248
|
location.replace(
|
|
2255
|
-
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(
|
|
2249
|
+
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(me)}&response_type=code&scope=${t}&state=${a}#wechat_redirect`
|
|
2256
2250
|
);
|
|
2257
2251
|
return;
|
|
2258
2252
|
}
|
|
@@ -2316,9 +2310,9 @@ class Kr {
|
|
|
2316
2310
|
}
|
|
2317
2311
|
}
|
|
2318
2312
|
export {
|
|
2319
|
-
|
|
2313
|
+
ue as AntispamValidator,
|
|
2320
2314
|
Er as AuthToken,
|
|
2321
|
-
|
|
2315
|
+
un as CashbackEngagementDataValidator,
|
|
2322
2316
|
ln as ClaimActivationKeyEngagementDataValidator,
|
|
2323
2317
|
_ as ClaimRewardStatus,
|
|
2324
2318
|
$ as ClaimRewardStatusValidator,
|
|
@@ -2326,78 +2320,78 @@ export {
|
|
|
2326
2320
|
Y as ClubAddressValidator,
|
|
2327
2321
|
Ur as ClubApi,
|
|
2328
2322
|
W as ClubBenefitSummaryValidator,
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2323
|
+
Ge as ClubBenefitValidator,
|
|
2324
|
+
Te as ClubCreditChangeScene,
|
|
2325
|
+
qe as ClubCreditChangeSceneValidator,
|
|
2326
|
+
Re as ClubCreditChangeType,
|
|
2327
|
+
je as ClubCreditChangeTypeValidator,
|
|
2328
|
+
Ae as ClubCreditLogValidator,
|
|
2329
|
+
Pe as ClubGlobalConfigValidator,
|
|
2330
|
+
xe as ClubItemType,
|
|
2337
2331
|
Z as ClubItemTypeValidator,
|
|
2338
|
-
|
|
2332
|
+
Ee as ClubPlayerValidator,
|
|
2339
2333
|
ee as ClubProductValidator,
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2334
|
+
Se as ClubRedemptionStatus,
|
|
2335
|
+
Le as ClubRedemptionStatusValidator,
|
|
2336
|
+
De as ClubUserCreditValidator,
|
|
2337
|
+
Ie as ClubUserProfileValidator,
|
|
2344
2338
|
qn as CommentEngagementValidator,
|
|
2345
2339
|
k as CommentValidator,
|
|
2346
2340
|
Mr as CommunityApi,
|
|
2347
|
-
|
|
2348
|
-
|
|
2341
|
+
We as EngageAccountType,
|
|
2342
|
+
et as EngageAccountTypeValidator,
|
|
2349
2343
|
$n as EngageResponseValidator,
|
|
2350
2344
|
Sn as EngageRewardValidator,
|
|
2351
2345
|
Qr as EventApi,
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2346
|
+
cn as EventConfigValidator,
|
|
2347
|
+
yt as EventFeatureConfigOfCashbackValidator,
|
|
2348
|
+
ht as EventFeatureConfigOfCheckInValidator,
|
|
2349
|
+
kt as EventFeatureConfigOfClaimActivationKeyValidator,
|
|
2350
|
+
Ct as EventFeatureConfigOfClaimRewardsValidator,
|
|
2351
|
+
Rt as EventFeatureConfigOfCommentValidator,
|
|
2352
|
+
Tt as EventFeatureConfigOfFollowValidator,
|
|
2353
|
+
St as EventFeatureConfigOfGiftCodeValidator,
|
|
2354
|
+
Pt as EventFeatureConfigOfInviteValidator,
|
|
2355
|
+
$t as EventFeatureConfigOfInvitedRegisterValidator,
|
|
2356
|
+
Gt as EventFeatureConfigOfLotteryDrawValidator,
|
|
2357
|
+
Dt as EventFeatureConfigOfLotteryValidator,
|
|
2358
|
+
Nt as EventFeatureConfigOfPreregisterValidator,
|
|
2359
|
+
Bt as EventFeatureConfigOfQuestValidator,
|
|
2360
|
+
Kt as EventFeatureConfigOfRegisterValidator,
|
|
2361
|
+
zt as EventFeatureConfigOfShareValidator,
|
|
2362
|
+
Zt as EventFeatureConfigOfSubscribeValidator,
|
|
2363
|
+
Yt as EventFeatureConfigOfSurveyValidator,
|
|
2364
|
+
en as EventFeatureConfigOfTeamValidator,
|
|
2365
|
+
rn as EventFeatureConfigOfVoteValidator,
|
|
2366
|
+
sn as EventFeatureConfigValidator,
|
|
2367
|
+
tt as EventPeriodType,
|
|
2368
|
+
nt as EventPeriodTypeValidator,
|
|
2375
2369
|
F as EventRewardItemConfigValidator,
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2370
|
+
Ne as ExtraGameRewardValidator,
|
|
2371
|
+
Oe as ExtraPhysicalShipmentValidator,
|
|
2372
|
+
_t as FeatureRewardValidator,
|
|
2373
|
+
u as FeatureType,
|
|
2374
|
+
rt as FeatureTypeValidator,
|
|
2381
2375
|
Yn as ForumMode,
|
|
2382
2376
|
Wn as ForumModeValidator,
|
|
2383
|
-
|
|
2377
|
+
ce as ForumValidator,
|
|
2384
2378
|
V as GamerItemType,
|
|
2385
2379
|
te as GamerItemTypeValidator,
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2380
|
+
Ce as Gender,
|
|
2381
|
+
Ve as GenderValidator,
|
|
2382
|
+
mn as GiftCodeEngagementDataValidator,
|
|
2383
|
+
dn as InviteEngagementDataValidator,
|
|
2384
|
+
mt as LotteryDrawAction,
|
|
2391
2385
|
Gr as LotteryDrawActionValidator,
|
|
2392
|
-
|
|
2393
|
-
|
|
2386
|
+
bn as LotteryDrawEngagementDataValidator,
|
|
2387
|
+
gn as LotteryEngagementDataValidator,
|
|
2394
2388
|
w as LotteryTicketStatus,
|
|
2395
2389
|
Dr as LotteryTicketStatusValidator,
|
|
2396
2390
|
b as NotificationBaseValidator,
|
|
2397
2391
|
tr as NotificationCategory,
|
|
2398
2392
|
Br as NotificationCategoryValidator,
|
|
2399
|
-
|
|
2400
|
-
|
|
2393
|
+
ur as NotificationCommentReplyValidator,
|
|
2394
|
+
lr as NotificationCommentValidator,
|
|
2401
2395
|
j as NotificationPayloadCommentValidator,
|
|
2402
2396
|
O as NotificationPayloadPostValidator,
|
|
2403
2397
|
N as NotificationPayloadReplyValidator,
|
|
@@ -2410,36 +2404,36 @@ export {
|
|
|
2410
2404
|
g as NotificationType,
|
|
2411
2405
|
nr as NotificationTypeValidator,
|
|
2412
2406
|
gr as NotificationValidator,
|
|
2413
|
-
|
|
2407
|
+
Fe as PlayerRoleCardValidator,
|
|
2414
2408
|
X as PlayerRoleValidator,
|
|
2415
2409
|
er as PostStatus,
|
|
2416
|
-
|
|
2410
|
+
se as PostStatusValidator,
|
|
2417
2411
|
G as PostValidator,
|
|
2418
|
-
|
|
2412
|
+
yn as PreregisterEngagementDataValidator,
|
|
2419
2413
|
ar as PresignedUrlResponseValidator,
|
|
2420
|
-
|
|
2421
|
-
|
|
2414
|
+
fn as QuestEngagementDataValidator,
|
|
2415
|
+
at as QuestObjective,
|
|
2422
2416
|
re as QuestObjectiveValidator,
|
|
2423
2417
|
oe as QuestProgressAlgorithm,
|
|
2424
|
-
|
|
2418
|
+
dt as QuestProgressAlgorithmOptionalValidator,
|
|
2425
2419
|
Or as QuestProgressAlgorithmValidator,
|
|
2426
2420
|
hn as QuestProgressValidator,
|
|
2427
2421
|
$r as RedeemParamsValidator,
|
|
2428
|
-
|
|
2429
|
-
|
|
2422
|
+
Qe as RedemptionValidator,
|
|
2423
|
+
pt as RegularRewardValidator,
|
|
2430
2424
|
rr as ReplyToValidator,
|
|
2431
2425
|
R as ReplyValidator,
|
|
2432
2426
|
Fr as RewardItemType,
|
|
2433
2427
|
ne as RewardItemTypeValidator,
|
|
2434
|
-
|
|
2428
|
+
st as RewardSource,
|
|
2435
2429
|
U as RewardSourceValidator,
|
|
2436
2430
|
p as RewardStatus,
|
|
2437
2431
|
E as RewardStatusSuffix,
|
|
2438
2432
|
ae as RewardStatusSuffixValidator,
|
|
2439
2433
|
Ir as RewardStatusValidator,
|
|
2440
2434
|
xn as RewardValidator,
|
|
2441
|
-
|
|
2442
|
-
|
|
2435
|
+
Ue as RoleBaseInfoValidator,
|
|
2436
|
+
$e as ServerBaseInfoValidator,
|
|
2443
2437
|
wn as ShareEngagementDataValidator,
|
|
2444
2438
|
vn as SurveyEngagementDataValidator,
|
|
2445
2439
|
lt as TeamAction,
|
|
@@ -2447,8 +2441,8 @@ export {
|
|
|
2447
2441
|
Vn as TeamEngagementDataValidator,
|
|
2448
2442
|
Cn as TeamEngagementValidator,
|
|
2449
2443
|
Nr as TeamMemberValidator,
|
|
2450
|
-
|
|
2451
|
-
|
|
2444
|
+
ct as TeamVisibility,
|
|
2445
|
+
ut as TeamVisibilityValidator,
|
|
2452
2446
|
A as TopicValidator,
|
|
2453
2447
|
D as UserEngagementDataValidator,
|
|
2454
2448
|
Ln as UserEngagementValidator,
|
|
@@ -2456,8 +2450,8 @@ export {
|
|
|
2456
2450
|
I as UserRewardValidator,
|
|
2457
2451
|
Pn as VerifyMobileResultValidator,
|
|
2458
2452
|
Rn as VoteEngagementDataValidator,
|
|
2459
|
-
|
|
2460
|
-
|
|
2453
|
+
ot as VoteOptionSource,
|
|
2454
|
+
it as VoteOptionSourceValidator,
|
|
2461
2455
|
Kr as WeixinApi,
|
|
2462
2456
|
kn as WeixinSubscribeEngagementDataValidator,
|
|
2463
2457
|
xr as WeixinWebLoginErrorCode,
|
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": "2.9.
|
|
4
|
+
"version": "2.9.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "index.ts",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
"@types/node": "^22.13.1",
|
|
33
33
|
"@seayoo-web/combo-webview": "2.6.0",
|
|
34
34
|
"@seayoo-web/request": "3.4.0",
|
|
35
|
-
"@seayoo-web/scripts": "3.1.
|
|
36
|
-
"@seayoo-web/validator": "1.0.1",
|
|
35
|
+
"@seayoo-web/scripts": "3.1.1",
|
|
37
36
|
"@seayoo-web/tsconfig": "1.0.5",
|
|
38
|
-
"@seayoo-web/utils": "4.0
|
|
37
|
+
"@seayoo-web/utils": "4.1.0",
|
|
38
|
+
"@seayoo-web/validator": "1.0.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@seayoo-web/combo-webview": "2.6.0",
|
|
42
42
|
"@seayoo-web/validator": "1.0.1",
|
|
43
|
-
"@seayoo-web/utils": "4.0
|
|
43
|
+
"@seayoo-web/utils": "4.1.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"prebuild": "pnpm -F validator build && pnpm -F request build && pnpm -F combo-webview build",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InferType } from "@seayoo-web/validator";
|
|
2
2
|
import { type EventFeatureBaseConfig } from "./feature.base";
|
|
3
|
-
declare const rewardItemTypeValidator: import("@seayoo-web/validator").StringValidator<"
|
|
3
|
+
declare const rewardItemTypeValidator: import("@seayoo-web/validator").StringValidator<"event_item" | "game_item" | "physical_item" | "weixin_hongbao" | "activation_key" | "credit" | "external_gift_code" | "void_item", false, false>;
|
|
4
4
|
declare const featureType: "lottery";
|
|
5
5
|
export interface FeatureLotteryItemConfig {
|
|
6
6
|
/** 抽奖奖励道具 id */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type InferType } from "@seayoo-web/validator";
|
|
2
|
-
declare const rewardItemTypeValidator: import("@seayoo-web/validator").StringValidator<"
|
|
2
|
+
declare const rewardItemTypeValidator: import("@seayoo-web/validator").StringValidator<"event_item" | "game_item" | "physical_item" | "weixin_hongbao" | "activation_key" | "credit" | "external_gift_code" | "void_item", false, false>;
|
|
3
3
|
export interface EventRewardItemConfig {
|
|
4
4
|
/** 玩法奖励道具 id */
|
|
5
5
|
reward_item_id: number;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { type QuestObjective } from "../event.enums";
|
|
2
|
+
export type QuestTeamMember = {
|
|
3
|
+
/** 角色名称 */
|
|
4
|
+
role_name: string;
|
|
5
|
+
/** 是否是队长 */
|
|
6
|
+
is_leader: boolean;
|
|
7
|
+
/** 是否是自己 */
|
|
8
|
+
is_myself?: boolean;
|
|
9
|
+
/** 当前用户任务进度值 */
|
|
10
|
+
progress?: number;
|
|
11
|
+
};
|
|
2
12
|
export interface QuestEngagementData {
|
|
3
13
|
/** 任务目标 */
|
|
4
14
|
objective: QuestObjective;
|
|
@@ -13,33 +23,15 @@ export interface QuestEngagementData {
|
|
|
13
23
|
/** 目标值 */
|
|
14
24
|
completion_value?: number;
|
|
15
25
|
/** 队伍信息 */
|
|
16
|
-
players:
|
|
17
|
-
is_myself?: boolean;
|
|
18
|
-
/** 角色名 */
|
|
19
|
-
role_name: string;
|
|
20
|
-
/** 是否为队长 */
|
|
21
|
-
is_leader: boolean;
|
|
22
|
-
/** 进度值 */
|
|
23
|
-
progress?: number;
|
|
24
|
-
}[];
|
|
26
|
+
players: QuestTeamMember[];
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
29
|
export declare const QuestEngagementDataValidator: import("@seayoo-web/validator").ObjectValidator<QuestEngagementData, false, false>;
|
|
28
|
-
export type QuestProgressMember = {
|
|
29
|
-
/** 角色名称 */
|
|
30
|
-
role_name: string;
|
|
31
|
-
/** 是否是队长 */
|
|
32
|
-
is_leader: boolean;
|
|
33
|
-
/** 是否是自己 */
|
|
34
|
-
is_myself: boolean;
|
|
35
|
-
/** 当前用户任务进度值 */
|
|
36
|
-
progress: number;
|
|
37
|
-
};
|
|
38
30
|
export type QuestProgressTeam = {
|
|
39
31
|
/** 个人任务进度值 */
|
|
40
32
|
progress: number;
|
|
41
33
|
/** 组队任务团队成员信息,数组内的数据是按照 progress 倒序排序的 */
|
|
42
|
-
team_members?:
|
|
34
|
+
team_members?: QuestTeamMember[];
|
|
43
35
|
};
|
|
44
36
|
export type QuestProgress = {
|
|
45
37
|
/** 个人任务进度值 */
|
|
@@ -47,9 +39,4 @@ export type QuestProgress = {
|
|
|
47
39
|
/** 任务进度数据 */
|
|
48
40
|
team?: QuestProgressTeam;
|
|
49
41
|
};
|
|
50
|
-
export declare const QuestProgressValidator: import("@seayoo-web/validator").ObjectValidator<QuestProgress, false, false
|
|
51
|
-
plain: never;
|
|
52
|
-
optional: never;
|
|
53
|
-
maybeNull: never;
|
|
54
|
-
lock: never;
|
|
55
|
-
};
|
|
42
|
+
export declare const QuestProgressValidator: import("@seayoo-web/validator").ObjectValidator<QuestProgress, false, false>;
|