@seayoo-web/gamer-api 2.10.5 → 2.10.7
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
|
|
1
|
+
import { isComboWebView as ue } from "@seayoo-web/combo-webview";
|
|
2
|
+
import { isPlainObject as k, supportWx as b, useConsole as me, usePromise as de, pruneURL as ge, supportWindow as pe, queryString as L, pruneObject as c, omitFields as P, parseJSON as _e, removePara as G } from "@seayoo-web/utils";
|
|
3
3
|
import { v as e, objectGuard as s } from "@seayoo-web/validator";
|
|
4
|
-
function
|
|
5
|
-
return
|
|
4
|
+
function be(i) {
|
|
5
|
+
return k(i, "gamer_token") && typeof i.gamer_token == "string";
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
return
|
|
7
|
+
function O(i) {
|
|
8
|
+
return k(i);
|
|
9
9
|
}
|
|
10
|
-
const j =
|
|
11
|
-
function
|
|
10
|
+
const j = me("GamerApiSDK");
|
|
11
|
+
function ye(i) {
|
|
12
12
|
return /^\/[a-z\d-]+$/.test(i);
|
|
13
13
|
}
|
|
14
|
-
async function
|
|
15
|
-
const { promise: i, resolve: t } =
|
|
14
|
+
async function fe() {
|
|
15
|
+
const { promise: i, resolve: t } = de();
|
|
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 he = {
|
|
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
|
+
}, we = {
|
|
36
36
|
get(i) {
|
|
37
37
|
try {
|
|
38
38
|
if (b()) return wx.getStorageSync(i) || "";
|
|
@@ -55,7 +55,7 @@ const we = {
|
|
|
55
55
|
j.error("removeStorageSync", t);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, f = "gamer_token";
|
|
59
59
|
class Qr {
|
|
60
60
|
$NetRequest;
|
|
61
61
|
$idToken = "";
|
|
@@ -64,8 +64,8 @@ class Qr {
|
|
|
64
64
|
req;
|
|
65
65
|
storage;
|
|
66
66
|
constructor(t, n) {
|
|
67
|
-
this.storage = b() ?
|
|
68
|
-
const r =
|
|
67
|
+
this.storage = b() ? we : he;
|
|
68
|
+
const r = ye(t) ? t : `https://${ge(t)}`;
|
|
69
69
|
if (this.$NetRequest = n, this.req = n({
|
|
70
70
|
baseURL: `${r}/v1`,
|
|
71
71
|
timeout: 1e4,
|
|
@@ -86,9 +86,9 @@ class Qr {
|
|
|
86
86
|
requestTransformer: (a) => {
|
|
87
87
|
this.$gamerToken && (a.headers.Authorization = `Bearer ${this.$gamerToken}`);
|
|
88
88
|
}
|
|
89
|
-
}),
|
|
89
|
+
}), pe()) {
|
|
90
90
|
const a = /^(?:localhost|[\d.]+):\d{4}$/.test(location.host), o = L("gamer_token");
|
|
91
|
-
(
|
|
91
|
+
(ue() || a && o) && (this.$gamerToken = o);
|
|
92
92
|
}
|
|
93
93
|
this.$gamerToken || this.loadGamerTokenCache();
|
|
94
94
|
}
|
|
@@ -96,7 +96,7 @@ class Qr {
|
|
|
96
96
|
return this.$NetRequest;
|
|
97
97
|
}
|
|
98
98
|
loadGamerTokenCache() {
|
|
99
|
-
const n = this.storage.get(
|
|
99
|
+
const n = this.storage.get(f).match(/^(\d{12,})#(.{8,})$/);
|
|
100
100
|
if (n) {
|
|
101
101
|
const r = parseInt(n[1]), a = n[2];
|
|
102
102
|
if (r > Date.now() - (24 * 3600 - 10) * 1e3) {
|
|
@@ -104,7 +104,7 @@ class Qr {
|
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
this.storage.remove(
|
|
107
|
+
this.storage.remove(f);
|
|
108
108
|
}
|
|
109
109
|
/** 当前是否为登录状态,即是否拥有 gamerToken */
|
|
110
110
|
get isLoggedIn() {
|
|
@@ -138,7 +138,7 @@ class Qr {
|
|
|
138
138
|
* 直接写入 Gamer Token,并更新缓存
|
|
139
139
|
*/
|
|
140
140
|
set gamerToken(t) {
|
|
141
|
-
this.$gamerToken = t, t ? this.storage.set(
|
|
141
|
+
this.$gamerToken = t, t ? this.storage.set(f, `${Date.now()}#${t}`) : this.storage.remove(f);
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
144
|
* 退出登录,销毁相关 Token
|
|
@@ -171,7 +171,7 @@ class Qr {
|
|
|
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
|
+
be,
|
|
175
175
|
{
|
|
176
176
|
message: !1,
|
|
177
177
|
cacheTTL: 300,
|
|
@@ -197,7 +197,7 @@ class Qr {
|
|
|
197
197
|
*/
|
|
198
198
|
async getSession() {
|
|
199
199
|
if (!await this.autoLogin()) return null;
|
|
200
|
-
const { data: t } = await this.req.get("session",
|
|
200
|
+
const { data: t } = await this.req.get("session", O, {
|
|
201
201
|
message: !1
|
|
202
202
|
});
|
|
203
203
|
return t;
|
|
@@ -209,25 +209,25 @@ class Qr {
|
|
|
209
209
|
*/
|
|
210
210
|
async authRealName(t) {
|
|
211
211
|
if (!await this.autoLogin()) return null;
|
|
212
|
-
const { data: n } = await this.req.post("auth-real-name", c(t),
|
|
212
|
+
const { data: n } = await this.req.post("auth-real-name", c(t), O);
|
|
213
213
|
return n;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const ke = {
|
|
217
217
|
/** 未知 */
|
|
218
218
|
Unknown: "unknown",
|
|
219
219
|
/** 男 */
|
|
220
220
|
Male: "male",
|
|
221
221
|
/** 女 */
|
|
222
222
|
Female: "female"
|
|
223
|
-
},
|
|
223
|
+
}, ve = e.string().enum(ke).lock(), Ve = {
|
|
224
224
|
/** 积分增加 */
|
|
225
225
|
Increase: "increase",
|
|
226
226
|
/** 积分减少 */
|
|
227
227
|
Decrease: "decrease",
|
|
228
228
|
/** 积分过期 */
|
|
229
229
|
Expired: "expired"
|
|
230
|
-
},
|
|
230
|
+
}, Ce = e.string().enum(Ve).lock(), Re = {
|
|
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
|
+
}, je = e.string().enum(Re).lock(), Te = {
|
|
244
244
|
/** 游戏内奖励 */
|
|
245
245
|
GameReward: "game_reward",
|
|
246
246
|
/** 实物商品 */
|
|
247
247
|
Physical: "physical",
|
|
248
248
|
/** 虚拟商品 */
|
|
249
249
|
Virtual: "virtual"
|
|
250
|
-
},
|
|
250
|
+
}, H = e.string().enum(Te).lock(), qe = {
|
|
251
251
|
/** 待发放 */
|
|
252
252
|
Pending: "pending",
|
|
253
253
|
/** 已发放 */
|
|
254
254
|
Issued: "issued",
|
|
255
255
|
/** 发放失败 */
|
|
256
256
|
Failed: "failed"
|
|
257
|
-
},
|
|
257
|
+
}, xe = e.string().enum(qe).lock(), Se = 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(), Le = e.object({
|
|
276
276
|
member_id: e.string(),
|
|
277
277
|
player_id: e.string(),
|
|
278
278
|
exp: e.number(),
|
|
@@ -281,19 +281,19 @@ 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(), Pe = e.object({
|
|
285
285
|
server_id: e.string(),
|
|
286
286
|
server_name: e.string()
|
|
287
|
-
}).lock(),
|
|
287
|
+
}).lock(), Ee = e.object({
|
|
288
288
|
role_id: e.string(),
|
|
289
289
|
role_name: e.string()
|
|
290
|
-
}).lock(),
|
|
291
|
-
...$e.shape,
|
|
290
|
+
}).lock(), z = e.object({
|
|
292
291
|
...Ee.shape,
|
|
292
|
+
...Pe.shape,
|
|
293
293
|
role_level: e.number(),
|
|
294
294
|
last_login_time: e.number()
|
|
295
|
-
}).lock(),
|
|
296
|
-
...
|
|
295
|
+
}).lock(), $e = e.object({
|
|
296
|
+
...z.shape,
|
|
297
297
|
/** 角色战力 */
|
|
298
298
|
role_fighting: e.number(),
|
|
299
299
|
/** 宗门 ID */
|
|
@@ -302,13 +302,13 @@ const ve = {
|
|
|
302
302
|
kin_name: e.string().optional(),
|
|
303
303
|
/** 宗门职位 */
|
|
304
304
|
kin_position: e.string().optional()
|
|
305
|
-
}).lock(),
|
|
305
|
+
}).lock(), Fe = 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
|
-
}).lock(),
|
|
311
|
+
}).lock(), J = e.object({
|
|
312
312
|
address_id: e.number(),
|
|
313
313
|
recipient: e.string(),
|
|
314
314
|
mobile: e.string(),
|
|
@@ -317,19 +317,19 @@ const ve = {
|
|
|
317
317
|
district: e.string(),
|
|
318
318
|
address: e.string(),
|
|
319
319
|
is_default: e.bool()
|
|
320
|
-
}).lock(),
|
|
320
|
+
}).lock(), Ue = 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(), De = e.object({
|
|
326
326
|
id: e.number(),
|
|
327
|
-
change_type:
|
|
328
|
-
change_scene:
|
|
327
|
+
change_type: Ce,
|
|
328
|
+
change_scene: je,
|
|
329
329
|
change_credit: e.number(),
|
|
330
330
|
balance: e.number(),
|
|
331
331
|
change_time: e.number()
|
|
332
|
-
}).lock(),
|
|
332
|
+
}).lock(), Z = e.object({
|
|
333
333
|
benefit_id: e.number(),
|
|
334
334
|
name: e.string(),
|
|
335
335
|
img_url: e.string(),
|
|
@@ -338,11 +338,11 @@ const ve = {
|
|
|
338
338
|
max_level: e.number(),
|
|
339
339
|
product_id: e.number(),
|
|
340
340
|
tag: e.string()
|
|
341
|
-
}).lock(),
|
|
341
|
+
}).lock(), X = e.object({
|
|
342
342
|
product_id: e.number(),
|
|
343
343
|
catalog_id: e.number(),
|
|
344
344
|
catalog_name: e.string(),
|
|
345
|
-
item_type:
|
|
345
|
+
item_type: H,
|
|
346
346
|
name: e.string(),
|
|
347
347
|
img_url: e.string(),
|
|
348
348
|
description: e.string(),
|
|
@@ -364,9 +364,9 @@ const ve = {
|
|
|
364
364
|
created_at: e.number(),
|
|
365
365
|
updated_at: e.number(),
|
|
366
366
|
redeemable_quantity: e.number().optional()
|
|
367
|
-
}).lock(),
|
|
368
|
-
...
|
|
369
|
-
product:
|
|
367
|
+
}).lock(), Ie = e.object({
|
|
368
|
+
...P(Z.shape, "tag"),
|
|
369
|
+
product: X.clone().optional()
|
|
370
370
|
}).lock(), Br = e.union(
|
|
371
371
|
e.object({
|
|
372
372
|
server_id: e.string(),
|
|
@@ -375,7 +375,7 @@ const ve = {
|
|
|
375
375
|
e.object({
|
|
376
376
|
address_id: e.number()
|
|
377
377
|
})
|
|
378
|
-
).satisfies().lock(),
|
|
378
|
+
).satisfies().lock(), Ae = e.object({
|
|
379
379
|
recipient: e.string(),
|
|
380
380
|
mobile: e.string(),
|
|
381
381
|
province: e.string(),
|
|
@@ -384,29 +384,29 @@ const ve = {
|
|
|
384
384
|
address: e.string(),
|
|
385
385
|
express_company: e.string(),
|
|
386
386
|
express_number: e.string()
|
|
387
|
-
}).lock(),
|
|
387
|
+
}).lock(), Ge = e.object({
|
|
388
388
|
server_id: e.string(),
|
|
389
389
|
role_id: e.string(),
|
|
390
390
|
role_name: e.string()
|
|
391
|
-
}).lock(),
|
|
391
|
+
}).lock(), Oe = e.object({
|
|
392
392
|
redemption_id: e.number(),
|
|
393
393
|
player_id: e.string(),
|
|
394
394
|
product_id: e.number(),
|
|
395
395
|
name: e.string(),
|
|
396
396
|
img_url: e.string(),
|
|
397
|
-
item_type:
|
|
397
|
+
item_type: H,
|
|
398
398
|
catalog_id: e.number(),
|
|
399
399
|
catalog_name: e.string(),
|
|
400
400
|
quantity: e.number(),
|
|
401
401
|
amount: e.number(),
|
|
402
|
-
status:
|
|
402
|
+
status: xe,
|
|
403
403
|
created_at: e.number(),
|
|
404
|
-
extra_data: e.union(
|
|
405
|
-
}),
|
|
406
|
-
credit_logs: e.array(
|
|
404
|
+
extra_data: e.union(Ae.clone(), Ge.clone()).satisfies().optional()
|
|
405
|
+
}), Ne = e.guard(Se), N = s({ player: Le }), Qe = s({ roles: e.array(z) }), T = s({ role_card: $e }), Q = e.guard(Fe), B = e.guard(J), Be = s({ addresses: e.array(J) }), Me = e.guard(Ue), Ke = s({
|
|
406
|
+
credit_logs: e.array(De),
|
|
407
407
|
next_token: e.string().optional()
|
|
408
|
-
}),
|
|
409
|
-
redemptions: e.array(
|
|
408
|
+
}), He = s({ products: e.array(X) }), ze = s({ benefits: e.array(Z) }), Je = s({ benefit: Ie }), Ze = s({
|
|
409
|
+
redemptions: e.array(Oe),
|
|
410
410
|
next_token: e.string().optional()
|
|
411
411
|
});
|
|
412
412
|
class Mr {
|
|
@@ -421,7 +421,7 @@ class Mr {
|
|
|
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", Ne, t);
|
|
425
425
|
return n;
|
|
426
426
|
}
|
|
427
427
|
/**
|
|
@@ -431,7 +431,7 @@ class Mr {
|
|
|
431
431
|
*/
|
|
432
432
|
async getCurrentPlayer(t) {
|
|
433
433
|
await this.token.autoLogin();
|
|
434
|
-
const { data: n, code: r, message: a } = await this.req.get("club/current-player",
|
|
434
|
+
const { data: n, code: r, message: a } = await this.req.get("club/current-player", N, t);
|
|
435
435
|
return n?.player ?? {
|
|
436
436
|
message: a,
|
|
437
437
|
error: r
|
|
@@ -447,7 +447,7 @@ class Mr {
|
|
|
447
447
|
const { data: n, code: r, message: a } = await this.req.post(
|
|
448
448
|
"club/link-player",
|
|
449
449
|
{ id_token: this.token.idToken },
|
|
450
|
-
|
|
450
|
+
N,
|
|
451
451
|
t
|
|
452
452
|
);
|
|
453
453
|
return n?.player ?? {
|
|
@@ -462,7 +462,7 @@ class Mr {
|
|
|
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", Qe, {
|
|
466
466
|
...r,
|
|
467
467
|
params: c({ player_id: t, refresh: n })
|
|
468
468
|
});
|
|
@@ -506,7 +506,7 @@ class Mr {
|
|
|
506
506
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=TMWBCFcOr2
|
|
507
507
|
*/
|
|
508
508
|
async getUserProfile(t, n) {
|
|
509
|
-
const { data: r } = await this.req.get("club/user-profile",
|
|
509
|
+
const { data: r } = await this.req.get("club/user-profile", Q, {
|
|
510
510
|
...n,
|
|
511
511
|
params: { member_id: t }
|
|
512
512
|
});
|
|
@@ -521,7 +521,7 @@ class Mr {
|
|
|
521
521
|
if (Object.keys(t).length === 0)
|
|
522
522
|
return { error: "OptionIsEmpty", message: "请提供需要修改的信息" };
|
|
523
523
|
await this.token.autoLogin();
|
|
524
|
-
const { data: r, code: a, message: o } = await this.req.post("club/user-profile", t,
|
|
524
|
+
const { data: r, code: a, message: o } = await this.req.post("club/user-profile", t, Q, n);
|
|
525
525
|
return r ?? {
|
|
526
526
|
message: o,
|
|
527
527
|
error: a
|
|
@@ -534,7 +534,7 @@ class Mr {
|
|
|
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", Be, t);
|
|
538
538
|
return n?.addresses ?? [];
|
|
539
539
|
}
|
|
540
540
|
/**
|
|
@@ -544,7 +544,7 @@ class Mr {
|
|
|
544
544
|
*/
|
|
545
545
|
async addAddress(t, n) {
|
|
546
546
|
if (!await this.token.autoLogin()) return null;
|
|
547
|
-
const { data: r } = await this.req.post("/club/add-address", c(t),
|
|
547
|
+
const { data: r } = await this.req.post("/club/add-address", c(t), B, n);
|
|
548
548
|
return r;
|
|
549
549
|
}
|
|
550
550
|
/**
|
|
@@ -557,7 +557,7 @@ class Mr {
|
|
|
557
557
|
const { data: r, code: a, message: o } = await this.req.post(
|
|
558
558
|
"club/update-address",
|
|
559
559
|
c(t),
|
|
560
|
-
|
|
560
|
+
B,
|
|
561
561
|
n
|
|
562
562
|
);
|
|
563
563
|
return r ?? {
|
|
@@ -582,7 +582,7 @@ class Mr {
|
|
|
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", Me, {
|
|
586
586
|
...n,
|
|
587
587
|
params: c(t)
|
|
588
588
|
});
|
|
@@ -598,7 +598,7 @@ class Mr {
|
|
|
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", Ke, {
|
|
602
602
|
...n,
|
|
603
603
|
params: c({ max_results: 20, ...t })
|
|
604
604
|
});
|
|
@@ -614,7 +614,7 @@ class Mr {
|
|
|
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 Mr {
|
|
|
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", Je, {
|
|
628
628
|
...n,
|
|
629
629
|
params: { benefit_id: t }
|
|
630
630
|
});
|
|
@@ -636,7 +636,7 @@ class Mr {
|
|
|
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", He, {
|
|
640
640
|
...n,
|
|
641
641
|
params: t
|
|
642
642
|
});
|
|
@@ -662,7 +662,7 @@ class Mr {
|
|
|
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", Ze, {
|
|
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
|
-
},
|
|
696
|
+
}, Y = e.string().enum(v).lock(), Kr = v, W = Y, Xe = {
|
|
697
697
|
/** 世游通行证 ID / Combo ID */
|
|
698
698
|
UserId: "user_id",
|
|
699
699
|
/** 游戏角色 ID */
|
|
700
700
|
RoleId: "role_id"
|
|
701
|
-
},
|
|
701
|
+
}, Ye = e.string().enum(Xe).lock(), We = {
|
|
702
702
|
None: "none",
|
|
703
703
|
Daily: "daily",
|
|
704
704
|
Weekly: "weekly",
|
|
705
705
|
Monthly: "monthly"
|
|
706
|
-
},
|
|
706
|
+
}, et = e.string().enum(We).lock(), l = {
|
|
707
707
|
/** 预约 */
|
|
708
708
|
Preregister: "preregister",
|
|
709
709
|
/** 抽奖 */
|
|
@@ -746,7 +746,7 @@ const v = {
|
|
|
746
746
|
ClaimActivationKey: "claim_activation_key",
|
|
747
747
|
/** 不朽箴言特有的 AI 聊天 */
|
|
748
748
|
ZeroChatgpt: "zero_chatgpt"
|
|
749
|
-
},
|
|
749
|
+
}, tt = e.string().enum(l).lock(), nt = {
|
|
750
750
|
/** 累计游戏内活跃值 */
|
|
751
751
|
Active: "player_active_points",
|
|
752
752
|
/** 累计登录,单位 人天 */
|
|
@@ -765,14 +765,14 @@ const v = {
|
|
|
765
765
|
PlayerLevel: "player_level",
|
|
766
766
|
/** 活动道具累计获取 */
|
|
767
767
|
EventItems: "event_items"
|
|
768
|
-
},
|
|
768
|
+
}, ee = e.string().enum(nt).lock(), rt = {
|
|
769
769
|
/** 官方上传 */
|
|
770
770
|
System: "system",
|
|
771
771
|
/** 用户投稿 */
|
|
772
772
|
UserSubmission: "user_submission",
|
|
773
773
|
/** 投票入围 */
|
|
774
774
|
Shortlisted: "shortlisted"
|
|
775
|
-
},
|
|
775
|
+
}, at = e.string().enum(rt).lock(), d = {
|
|
776
776
|
/** 未获得奖励 */
|
|
777
777
|
Ineligible: "ineligible",
|
|
778
778
|
/** 奖励未领取 */
|
|
@@ -783,7 +783,7 @@ const v = {
|
|
|
783
783
|
Failed: "failed",
|
|
784
784
|
/** 奖励已发货 */
|
|
785
785
|
Delivered: "delivered"
|
|
786
|
-
}, Hr = e.string().enum(d).lock(),
|
|
786
|
+
}, Hr = e.string().enum(d).lock(), ot = {
|
|
787
787
|
/** 奖励未领取 */
|
|
788
788
|
Unclaimed: d.Unclaimed,
|
|
789
789
|
/** 奖励已领取 */
|
|
@@ -792,7 +792,7 @@ const v = {
|
|
|
792
792
|
Failed: d.Failed,
|
|
793
793
|
/** 奖励已发货 */
|
|
794
794
|
Delivered: d.Delivered
|
|
795
|
-
},
|
|
795
|
+
}, te = e.string().enum(ot).lock(), it = {
|
|
796
796
|
/** 未获得奖励 */
|
|
797
797
|
Ineligible: d.Ineligible,
|
|
798
798
|
/** 奖励未领取 */
|
|
@@ -803,17 +803,17 @@ const v = {
|
|
|
803
803
|
Failed: d.Failed,
|
|
804
804
|
/** 奖励已发货 */
|
|
805
805
|
Delivered: d.Delivered
|
|
806
|
-
}, E = e.string().enum(
|
|
806
|
+
}, E = e.string().enum(it).lock(), st = {
|
|
807
807
|
/** 玩法产出奖励 */
|
|
808
808
|
Output: "output",
|
|
809
809
|
/** 玩法参与奖励 */
|
|
810
810
|
Engage: "engage"
|
|
811
|
-
}, $ = e.string().enum(
|
|
811
|
+
}, $ = e.string().enum(st).lock(), ct = {
|
|
812
812
|
/** 私有队伍 */
|
|
813
813
|
Private: "private",
|
|
814
814
|
/** 公开队伍 */
|
|
815
815
|
Public: "public"
|
|
816
|
-
},
|
|
816
|
+
}, lt = e.string().enum(ct).lock(), h = {
|
|
817
817
|
/** 未知状态 */
|
|
818
818
|
Unknown: "unknown",
|
|
819
819
|
/** 等待开奖 */
|
|
@@ -824,7 +824,7 @@ const v = {
|
|
|
824
824
|
Claimed: "claimed",
|
|
825
825
|
/** 领奖失败 */
|
|
826
826
|
Fail: "fail"
|
|
827
|
-
}, zr = e.string().enum(
|
|
827
|
+
}, zr = e.string().enum(h).lock(), ut = {
|
|
828
828
|
/** 发起组队 */
|
|
829
829
|
Assemble: "assemble",
|
|
830
830
|
/** 加入队伍 */
|
|
@@ -835,85 +835,85 @@ const v = {
|
|
|
835
835
|
ChangeVisibility: "change_visibility",
|
|
836
836
|
/** 查询组队信息 */
|
|
837
837
|
Query: "query"
|
|
838
|
-
}, Jr = e.string().enum(
|
|
838
|
+
}, Jr = e.string().enum(ut).lock(), mt = {
|
|
839
839
|
/** 查询抽奖券 */
|
|
840
840
|
Query: "query",
|
|
841
841
|
/** 开奖 */
|
|
842
842
|
Draw: "draw",
|
|
843
843
|
/** 领奖 */
|
|
844
844
|
Claim: "claim"
|
|
845
|
-
}, Zr = e.string().enum(
|
|
845
|
+
}, Zr = e.string().enum(mt).lock(), ne = {
|
|
846
846
|
/** 将所有队员的进度值求和,作为队伍进度值 */
|
|
847
847
|
Sum: "sum",
|
|
848
848
|
/** 以进度值倒序排名第 N 的队员的进度值,作为队伍进度值。如果队伍人数不足 N,则队伍进度值为 0。N 的值来自于配置字段 top_n */
|
|
849
849
|
TopN: "top_n"
|
|
850
|
-
}, Xr = e.string().enum(
|
|
850
|
+
}, Xr = e.string().enum(ne).lock(), dt = e.string().enum(ne).optional().lock(), gt = {
|
|
851
851
|
/** 尚未结算 */
|
|
852
852
|
None: "none",
|
|
853
853
|
/** 获胜奖励 */
|
|
854
854
|
Winner: "winner",
|
|
855
855
|
/** 安慰奖励 */
|
|
856
856
|
Consolation: "consolation"
|
|
857
|
-
},
|
|
857
|
+
}, pt = e.string().enum(gt).lock(), _t = e.string().enum(v), y = e.object({
|
|
858
858
|
reward_item_id: e.number(),
|
|
859
859
|
reward_amount: e.number(),
|
|
860
860
|
reward_item_name: e.string(),
|
|
861
861
|
reward_item_icon_url: e.string(),
|
|
862
862
|
reward_item_desc: e.string().optional(),
|
|
863
|
-
reward_item_type:
|
|
863
|
+
reward_item_type: _t,
|
|
864
864
|
reward_item_rating: e.number()
|
|
865
|
-
}).lock(),
|
|
865
|
+
}).lock(), bt = e.object({
|
|
866
866
|
engage_count: e.number(),
|
|
867
|
-
rewards: e.array(
|
|
868
|
-
}).lock(),
|
|
867
|
+
rewards: e.array(y)
|
|
868
|
+
}).lock(), yt = e.union(
|
|
869
869
|
e.object({
|
|
870
870
|
feature_reward_type: e.string().enum("every"),
|
|
871
|
-
reward_details: e.array(
|
|
871
|
+
reward_details: e.array(y)
|
|
872
872
|
}),
|
|
873
873
|
e.object({
|
|
874
874
|
feature_reward_type: e.string().enum("regular"),
|
|
875
|
-
reward_details: e.array(
|
|
875
|
+
reward_details: e.array(bt)
|
|
876
876
|
})
|
|
877
877
|
).satisfies().lock(), u = e.object({
|
|
878
878
|
feature_name: e.string(),
|
|
879
879
|
feature_id: e.number(),
|
|
880
880
|
description: e.string(),
|
|
881
|
-
cycle:
|
|
881
|
+
cycle: et,
|
|
882
882
|
cycle_limit: e.number(),
|
|
883
883
|
limit: e.number(),
|
|
884
884
|
since: e.number(),
|
|
885
885
|
until: e.number(),
|
|
886
|
-
engage_account:
|
|
887
|
-
feature_rewards:
|
|
886
|
+
engage_account: Ye,
|
|
887
|
+
feature_rewards: yt.clone().optional(),
|
|
888
888
|
sort: e.number().optional()
|
|
889
|
-
}),
|
|
889
|
+
}), ft = l.Cashback, ht = e.object({
|
|
890
890
|
...u.shape,
|
|
891
|
-
feature_type: e.string().enum(
|
|
891
|
+
feature_type: e.string().enum(ft),
|
|
892
892
|
config: e.object({
|
|
893
893
|
order_start_time: e.number(),
|
|
894
894
|
order_end_time: e.number(),
|
|
895
895
|
claim_rewards_start_time: e.number(),
|
|
896
896
|
claim_rewards_end_time: e.number()
|
|
897
897
|
})
|
|
898
|
-
}),
|
|
898
|
+
}), wt = l.CheckIn, kt = e.object({
|
|
899
899
|
...u.shape,
|
|
900
|
-
feature_type: e.string().enum(
|
|
901
|
-
}),
|
|
900
|
+
feature_type: e.string().enum(wt)
|
|
901
|
+
}), vt = l.ClaimActivationKey, Vt = e.object({
|
|
902
902
|
...u.shape,
|
|
903
|
-
feature_type: e.string().enum(
|
|
904
|
-
}),
|
|
903
|
+
feature_type: e.string().enum(vt)
|
|
904
|
+
}), Ct = l.ClaimRewards, Rt = e.object({
|
|
905
905
|
...u.shape,
|
|
906
|
-
feature_type: e.string().enum(
|
|
907
|
-
}),
|
|
906
|
+
feature_type: e.string().enum(Ct)
|
|
907
|
+
}), jt = l.Comment, Tt = e.object({
|
|
908
908
|
...u.shape,
|
|
909
|
-
feature_type: e.string().enum(
|
|
909
|
+
feature_type: e.string().enum(jt),
|
|
910
910
|
config: e.object({
|
|
911
911
|
comments: e.array(e.string()),
|
|
912
912
|
send_rate: e.number()
|
|
913
913
|
})
|
|
914
|
-
}),
|
|
914
|
+
}), qt = l.Follow, xt = e.object({
|
|
915
915
|
...u.shape,
|
|
916
|
-
feature_type: e.string().enum(
|
|
916
|
+
feature_type: e.string().enum(qt),
|
|
917
917
|
config: e.object({
|
|
918
918
|
platform: e.string(),
|
|
919
919
|
platform_icon: e.string().optional(),
|
|
@@ -921,67 +921,67 @@ const v = {
|
|
|
921
921
|
qr_code_url: e.string().optional(),
|
|
922
922
|
platform_desc: e.string().optional()
|
|
923
923
|
})
|
|
924
|
-
}),
|
|
924
|
+
}), St = l.GiftCode, Lt = e.object({
|
|
925
925
|
name: e.string(),
|
|
926
926
|
icon_url: e.string(),
|
|
927
927
|
count: e.number()
|
|
928
|
-
}),
|
|
928
|
+
}), Pt = e.object({
|
|
929
929
|
...u.shape,
|
|
930
|
-
feature_type: e.string().enum(
|
|
930
|
+
feature_type: e.string().enum(St),
|
|
931
931
|
config: e.object({
|
|
932
|
-
gift_items: e.array(
|
|
932
|
+
gift_items: e.array(Lt),
|
|
933
933
|
mp_url: e.string().optional(),
|
|
934
934
|
mp_qrcode_url: e.string().optional()
|
|
935
935
|
})
|
|
936
|
-
}),
|
|
936
|
+
}), Et = l.Invite, $t = e.object({
|
|
937
937
|
...u.shape,
|
|
938
|
-
feature_type: e.string().enum(
|
|
938
|
+
feature_type: e.string().enum(Et),
|
|
939
939
|
config: e.object({
|
|
940
940
|
share_url: e.string()
|
|
941
941
|
})
|
|
942
|
-
}),
|
|
942
|
+
}), Ft = l.InvitedRegister, Ut = e.object({
|
|
943
943
|
...u.shape,
|
|
944
|
-
feature_type: e.string().enum(
|
|
945
|
-
}),
|
|
944
|
+
feature_type: e.string().enum(Ft)
|
|
945
|
+
}), Dt = e.string().enum(P(v, "GiftCode", "LotteryTicket")), It = l.Lottery, At = e.object({
|
|
946
946
|
reward_item_id: e.number(),
|
|
947
947
|
reward_item_name: e.string(),
|
|
948
|
-
reward_item_type:
|
|
948
|
+
reward_item_type: Dt,
|
|
949
949
|
reward_item_icon_url: e.string(),
|
|
950
950
|
reward_item_desc: e.string().optional(),
|
|
951
951
|
reward_amount: e.number(),
|
|
952
952
|
reward_remaining_stock: e.number(),
|
|
953
953
|
reward_item_rating: e.number()
|
|
954
|
-
}),
|
|
954
|
+
}), Gt = e.object({
|
|
955
955
|
...u.shape,
|
|
956
|
-
feature_type: e.string().enum(
|
|
956
|
+
feature_type: e.string().enum(It),
|
|
957
957
|
config: e.object({
|
|
958
958
|
consume_item_id: e.number(),
|
|
959
959
|
consume_item_name: e.string(),
|
|
960
960
|
consume_item_icon_url: e.string(),
|
|
961
961
|
consume_item_count: e.array(e.number()),
|
|
962
962
|
consume_item_desc: e.string().optional(),
|
|
963
|
-
rewards: e.array(
|
|
963
|
+
rewards: e.array(At)
|
|
964
964
|
})
|
|
965
|
-
}),
|
|
965
|
+
}), Ot = l.LotteryDraw, Nt = e.object({
|
|
966
966
|
...u.shape,
|
|
967
|
-
feature_type: e.string().enum(
|
|
967
|
+
feature_type: e.string().enum(Ot),
|
|
968
968
|
config: e.object({
|
|
969
969
|
draw_not_before: e.number(),
|
|
970
970
|
draw_not_after: e.number()
|
|
971
971
|
})
|
|
972
|
-
}),
|
|
972
|
+
}), Qt = l.Preregister, Bt = e.object({
|
|
973
973
|
...u.shape,
|
|
974
|
-
feature_type: e.string().enum(
|
|
975
|
-
}),
|
|
974
|
+
feature_type: e.string().enum(Qt)
|
|
975
|
+
}), Mt = l.Quest, Kt = e.object({
|
|
976
976
|
...u.shape,
|
|
977
|
-
feature_type: e.string().enum(
|
|
977
|
+
feature_type: e.string().enum(Mt),
|
|
978
978
|
config: e.object({
|
|
979
|
-
objective:
|
|
979
|
+
objective: ee,
|
|
980
980
|
completion_value: e.number(),
|
|
981
981
|
team: e.object({
|
|
982
982
|
feature_id: e.number().optional(),
|
|
983
983
|
completion_value: e.number(),
|
|
984
|
-
progress_algorithm:
|
|
984
|
+
progress_algorithm: dt,
|
|
985
985
|
top_n: e.number().optional()
|
|
986
986
|
}).optional(),
|
|
987
987
|
config: e.object({
|
|
@@ -991,38 +991,38 @@ const v = {
|
|
|
991
991
|
event_item_id: e.number().optional()
|
|
992
992
|
}).optional()
|
|
993
993
|
})
|
|
994
|
-
}),
|
|
994
|
+
}), Ht = l.Register, zt = e.object({
|
|
995
995
|
...u.shape,
|
|
996
|
-
feature_type: e.string().enum(
|
|
997
|
-
}),
|
|
996
|
+
feature_type: e.string().enum(Ht)
|
|
997
|
+
}), Jt = l.Share, Zt = e.object({
|
|
998
998
|
...u.shape,
|
|
999
|
-
feature_type: e.string().enum(
|
|
999
|
+
feature_type: e.string().enum(Jt),
|
|
1000
1000
|
config: e.object({
|
|
1001
1001
|
share_platform: e.string(),
|
|
1002
1002
|
jump_url: e.string().optional(),
|
|
1003
1003
|
icon_url: e.string().optional()
|
|
1004
1004
|
})
|
|
1005
|
-
}),
|
|
1005
|
+
}), Xt = l.Subscribe, Yt = e.object({
|
|
1006
1006
|
...u.shape,
|
|
1007
|
-
feature_type: e.string().enum(
|
|
1007
|
+
feature_type: e.string().enum(Xt),
|
|
1008
1008
|
config: e.object({
|
|
1009
1009
|
weixin_template_ids: e.array(e.string())
|
|
1010
1010
|
})
|
|
1011
|
-
}),
|
|
1011
|
+
}), Wt = l.Survey, en = e.object({
|
|
1012
1012
|
...u.shape,
|
|
1013
|
-
feature_type: e.string().enum(
|
|
1013
|
+
feature_type: e.string().enum(Wt),
|
|
1014
1014
|
config: e.object({
|
|
1015
1015
|
survey_id: e.string(),
|
|
1016
1016
|
survey_url: e.string()
|
|
1017
1017
|
})
|
|
1018
|
-
}),
|
|
1018
|
+
}), tn = l.Team, nn = e.object({
|
|
1019
1019
|
...u.shape,
|
|
1020
|
-
feature_type: e.string().enum(
|
|
1020
|
+
feature_type: e.string().enum(tn),
|
|
1021
1021
|
config: e.object({
|
|
1022
1022
|
max_members: e.number().min(1),
|
|
1023
1023
|
min_members: e.number().min(1)
|
|
1024
1024
|
})
|
|
1025
|
-
}),
|
|
1025
|
+
}), rn = l.Vote, an = e.object({
|
|
1026
1026
|
sn: e.string(),
|
|
1027
1027
|
name: e.string(),
|
|
1028
1028
|
img_urls: e.array(e.string()).optional(),
|
|
@@ -1032,89 +1032,89 @@ const v = {
|
|
|
1032
1032
|
amount: e.number(),
|
|
1033
1033
|
finalists: e.bool(),
|
|
1034
1034
|
last_vote_time: e.number()
|
|
1035
|
-
}),
|
|
1035
|
+
}), on = e.object({
|
|
1036
1036
|
...u.shape,
|
|
1037
|
-
feature_type: e.string().enum(
|
|
1037
|
+
feature_type: e.string().enum(rn),
|
|
1038
1038
|
config: e.object({
|
|
1039
1039
|
vote_feature_ids: e.array(e.number()),
|
|
1040
1040
|
submission_feature_ids: e.array(e.number()),
|
|
1041
1041
|
finalists_amount: e.number(),
|
|
1042
|
-
source:
|
|
1043
|
-
options: e.array(
|
|
1044
|
-
rewards: e.array(
|
|
1042
|
+
source: at,
|
|
1043
|
+
options: e.array(an),
|
|
1044
|
+
rewards: e.array(y)
|
|
1045
1045
|
})
|
|
1046
|
-
}),
|
|
1046
|
+
}), sn = l.Vote2, cn = e.object({
|
|
1047
1047
|
candidate_id: e.string(),
|
|
1048
1048
|
display_name: e.string(),
|
|
1049
1049
|
images: e.array(e.string()).optional(),
|
|
1050
1050
|
videos: e.array(e.string()).optional(),
|
|
1051
1051
|
description: e.string().optional(),
|
|
1052
1052
|
jump_url: e.string()
|
|
1053
|
-
}),
|
|
1053
|
+
}), ln = e.object({
|
|
1054
1054
|
...u.shape,
|
|
1055
|
-
feature_type: e.string().enum(
|
|
1055
|
+
feature_type: e.string().enum(sn),
|
|
1056
1056
|
config: e.object({
|
|
1057
1057
|
vote_item_id: e.number().optional(),
|
|
1058
|
-
candidates: e.array(
|
|
1058
|
+
candidates: e.array(cn),
|
|
1059
1059
|
vote_since: e.number(),
|
|
1060
1060
|
vote_until: e.number(),
|
|
1061
1061
|
rewards_since: e.number(),
|
|
1062
1062
|
rewards_until: e.number(),
|
|
1063
|
-
winner_rewards: e.array(
|
|
1064
|
-
consolation_rewards: e.array(
|
|
1063
|
+
winner_rewards: e.array(y).optional(),
|
|
1064
|
+
consolation_rewards: e.array(y).optional()
|
|
1065
1065
|
})
|
|
1066
|
-
}),
|
|
1066
|
+
}), un = l.ZeroChatgpt, mn = e.object({
|
|
1067
1067
|
...u.shape,
|
|
1068
|
-
feature_type: e.string().enum(
|
|
1069
|
-
}),
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
).key("feature_type").satisfies(),
|
|
1068
|
+
feature_type: e.string().enum(un)
|
|
1069
|
+
}), dn = e.union(
|
|
1070
|
+
ht,
|
|
1071
|
+
kt,
|
|
1072
|
+
Rt,
|
|
1073
|
+
Tt,
|
|
1074
|
+
xt,
|
|
1075
|
+
Pt,
|
|
1076
|
+
$t,
|
|
1077
|
+
Ut,
|
|
1078
|
+
Gt,
|
|
1079
|
+
Nt,
|
|
1080
|
+
Bt,
|
|
1081
|
+
Kt,
|
|
1082
|
+
zt,
|
|
1083
|
+
Zt,
|
|
1084
|
+
Yt,
|
|
1085
|
+
en,
|
|
1086
|
+
nn,
|
|
1087
|
+
on,
|
|
1088
|
+
ln,
|
|
1089
|
+
Vt,
|
|
1090
|
+
mn
|
|
1091
|
+
).key("feature_type").satisfies(), gn = e.object({
|
|
1092
1092
|
event_name: e.string(),
|
|
1093
1093
|
rules: e.string(),
|
|
1094
1094
|
since: e.number(),
|
|
1095
1095
|
until: e.number(),
|
|
1096
1096
|
visit_count: e.number().optional(),
|
|
1097
|
-
features: e.array(
|
|
1098
|
-
}).lock(), q = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()),
|
|
1097
|
+
features: e.array(dn)
|
|
1098
|
+
}).lock(), q = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()), pn = e.object({
|
|
1099
1099
|
order_total_amount: q,
|
|
1100
1100
|
cashback_total_amount: q,
|
|
1101
1101
|
game_item_count: q
|
|
1102
|
-
}),
|
|
1102
|
+
}), _n = e.object({
|
|
1103
1103
|
activation_key: e.string().disallow("")
|
|
1104
|
-
}),
|
|
1104
|
+
}), bn = e.object({
|
|
1105
1105
|
gift_code: e.string()
|
|
1106
|
-
}),
|
|
1106
|
+
}), yn = e.object({
|
|
1107
1107
|
user_id: e.string(),
|
|
1108
1108
|
name: e.string().optional(),
|
|
1109
1109
|
avatar_url: e.string().optional()
|
|
1110
|
-
}),
|
|
1110
|
+
}), fn = e.object({
|
|
1111
1111
|
lottery_count: e.number()
|
|
1112
1112
|
}), V = e.object({
|
|
1113
1113
|
reward_id: e.number(),
|
|
1114
1114
|
reward_item_id: e.number(),
|
|
1115
1115
|
reward_source: $,
|
|
1116
1116
|
reward_item_name: e.string(),
|
|
1117
|
-
reward_item_type:
|
|
1117
|
+
reward_item_type: Y,
|
|
1118
1118
|
reward_item_icon_url: e.string(),
|
|
1119
1119
|
reward_item_desc: e.string().optional(),
|
|
1120
1120
|
reward_item_rating: e.number(),
|
|
@@ -1124,50 +1124,50 @@ const v = {
|
|
|
1124
1124
|
event_name: e.string(),
|
|
1125
1125
|
feature_id: e.number(),
|
|
1126
1126
|
engagement_id: e.number(),
|
|
1127
|
-
feature_type:
|
|
1127
|
+
feature_type: tt,
|
|
1128
1128
|
receive_time: e.number(),
|
|
1129
1129
|
extra_data: e.record(e.unknown()).optional()
|
|
1130
|
-
}),
|
|
1130
|
+
}), hn = e.string().enum(h.Unknown, h.Pending), wn = e.union(
|
|
1131
1131
|
e.object({
|
|
1132
1132
|
ticket: e.string(),
|
|
1133
|
-
status:
|
|
1133
|
+
status: hn
|
|
1134
1134
|
}),
|
|
1135
1135
|
e.object({
|
|
1136
1136
|
ticket: e.string(),
|
|
1137
|
-
status: e.string().enum(
|
|
1137
|
+
status: e.string().enum(P(h, "Unknown", "Pending")),
|
|
1138
1138
|
reward: V
|
|
1139
1139
|
})
|
|
1140
|
-
).satisfies(),
|
|
1141
|
-
tickets: e.array(
|
|
1142
|
-
}),
|
|
1140
|
+
).satisfies(), kn = e.object({
|
|
1141
|
+
tickets: e.array(wn)
|
|
1142
|
+
}), vn = e.object({
|
|
1143
1143
|
platforms: e.array(e.string())
|
|
1144
|
-
}),
|
|
1144
|
+
}), re = e.object({
|
|
1145
1145
|
role_name: e.string(),
|
|
1146
1146
|
is_leader: e.bool(),
|
|
1147
1147
|
is_myself: e.bool().optional(),
|
|
1148
1148
|
progress: e.number().optional()
|
|
1149
|
-
}).lock(),
|
|
1150
|
-
objective:
|
|
1149
|
+
}).lock(), Vn = e.object({
|
|
1150
|
+
objective: ee,
|
|
1151
1151
|
progress: e.number(),
|
|
1152
1152
|
completion_value: e.number().optional(),
|
|
1153
1153
|
team: e.object({
|
|
1154
1154
|
progress: e.number(),
|
|
1155
1155
|
completion_value: e.number().optional(),
|
|
1156
|
-
players: e.array(
|
|
1156
|
+
players: e.array(re)
|
|
1157
1157
|
}).optional()
|
|
1158
|
-
}),
|
|
1158
|
+
}), Cn = e.object({
|
|
1159
1159
|
progress: e.number(),
|
|
1160
1160
|
team: e.object({
|
|
1161
1161
|
progress: e.number(),
|
|
1162
|
-
team_members: e.array(
|
|
1162
|
+
team_members: e.array(re).optional()
|
|
1163
1163
|
}).optional()
|
|
1164
|
-
}),
|
|
1164
|
+
}), Rn = e.object({
|
|
1165
1165
|
platform: e.string()
|
|
1166
|
-
}),
|
|
1166
|
+
}), jn = e.object({
|
|
1167
1167
|
weixin_openid: e.string()
|
|
1168
|
-
}),
|
|
1168
|
+
}), Tn = e.object({
|
|
1169
1169
|
serial_number: e.number()
|
|
1170
|
-
}),
|
|
1170
|
+
}), qn = e.object({
|
|
1171
1171
|
team_code: e.string(),
|
|
1172
1172
|
leader_name: e.string(),
|
|
1173
1173
|
total_members: e.number()
|
|
@@ -1176,9 +1176,9 @@ const v = {
|
|
|
1176
1176
|
is_myself: e.bool().optional(),
|
|
1177
1177
|
role_name: e.string(),
|
|
1178
1178
|
server_name: e.string()
|
|
1179
|
-
}),
|
|
1179
|
+
}), xn = e.object({
|
|
1180
1180
|
team_code: e.string(),
|
|
1181
|
-
visibility:
|
|
1181
|
+
visibility: lt,
|
|
1182
1182
|
members: e.array(
|
|
1183
1183
|
e.object({
|
|
1184
1184
|
is_leader: e.bool(),
|
|
@@ -1186,76 +1186,76 @@ const v = {
|
|
|
1186
1186
|
server_name: e.string()
|
|
1187
1187
|
})
|
|
1188
1188
|
)
|
|
1189
|
-
}),
|
|
1189
|
+
}), Sn = e.object({
|
|
1190
1190
|
option_sn: e.string()
|
|
1191
|
-
}),
|
|
1191
|
+
}), Ln = e.object({
|
|
1192
1192
|
candidate_id: e.string(),
|
|
1193
1193
|
total_votes: e.number().optional(),
|
|
1194
1194
|
my_votes: e.number().optional(),
|
|
1195
1195
|
votes: e.number().optional()
|
|
1196
|
-
}),
|
|
1197
|
-
rewards_type:
|
|
1196
|
+
}), Pn = e.object({
|
|
1197
|
+
rewards_type: pt,
|
|
1198
1198
|
rewards: e.array(V).optional()
|
|
1199
|
-
}),
|
|
1199
|
+
}), En = e.object({
|
|
1200
1200
|
candidate_id: e.string(),
|
|
1201
1201
|
is_winner: e.bool(),
|
|
1202
1202
|
total_votes: e.number(),
|
|
1203
1203
|
my_votes: e.number()
|
|
1204
|
-
}),
|
|
1204
|
+
}), $n = e.object({
|
|
1205
1205
|
role: e.string(),
|
|
1206
1206
|
content: e.string()
|
|
1207
|
+
}), Fn = e.object({
|
|
1208
|
+
conversations: e.array($n)
|
|
1207
1209
|
}), Un = e.object({
|
|
1208
|
-
conversations: e.array(Fn)
|
|
1209
|
-
}), Dn = e.object({
|
|
1210
1210
|
user_id: e.string(),
|
|
1211
1211
|
name: e.string(),
|
|
1212
1212
|
avatar_url: e.string(),
|
|
1213
1213
|
comment: e.string(),
|
|
1214
1214
|
video_note: e.number(),
|
|
1215
1215
|
created_at: e.number()
|
|
1216
|
-
}),
|
|
1217
|
-
|
|
1218
|
-
hn,
|
|
1219
|
-
qn,
|
|
1216
|
+
}), F = e.union(
|
|
1217
|
+
vn,
|
|
1220
1218
|
fn,
|
|
1221
|
-
jn,
|
|
1222
|
-
Ln,
|
|
1223
|
-
Pn,
|
|
1224
1219
|
Tn,
|
|
1225
|
-
_n,
|
|
1226
1220
|
yn,
|
|
1221
|
+
Rn,
|
|
1227
1222
|
Sn,
|
|
1228
|
-
|
|
1229
|
-
|
|
1223
|
+
Ln,
|
|
1224
|
+
jn,
|
|
1225
|
+
pn,
|
|
1230
1226
|
bn,
|
|
1231
|
-
|
|
1227
|
+
xn,
|
|
1228
|
+
Vn,
|
|
1229
|
+
kn,
|
|
1230
|
+
_n,
|
|
1231
|
+
Fn,
|
|
1232
1232
|
e.custom(
|
|
1233
1233
|
"EmptyObject",
|
|
1234
|
-
(i) =>
|
|
1234
|
+
(i) => k(i) && Object.keys(i).length === 0
|
|
1235
1235
|
)
|
|
1236
|
-
).satisfies().lock(),
|
|
1236
|
+
).satisfies().lock(), Dn = e.object({
|
|
1237
1237
|
reward_id: e.number(),
|
|
1238
1238
|
reward_item_id: e.number(),
|
|
1239
|
-
reward_item_type:
|
|
1239
|
+
reward_item_type: W,
|
|
1240
1240
|
reward_count: e.number(),
|
|
1241
|
-
reward_status:
|
|
1241
|
+
reward_status: te,
|
|
1242
1242
|
reward_source: $,
|
|
1243
1243
|
reward_item_name: e.string(),
|
|
1244
1244
|
reward_item_icon_url: e.string(),
|
|
1245
1245
|
reward_item_desc: e.string().optional(),
|
|
1246
1246
|
reward_item_rating: e.number(),
|
|
1247
1247
|
receive_time: e.number(),
|
|
1248
|
-
extra_data: e.union(...
|
|
1249
|
-
}),
|
|
1248
|
+
extra_data: e.union(...F.validators, e.record(e.unknown())).satisfies().optional()
|
|
1249
|
+
}), In = e.object({
|
|
1250
1250
|
reward_id: e.number(),
|
|
1251
1251
|
reward_item_id: e.number(),
|
|
1252
1252
|
reward_item_name: e.string(),
|
|
1253
|
-
reward_item_type:
|
|
1253
|
+
reward_item_type: W,
|
|
1254
1254
|
reward_item_icon_url: e.string(),
|
|
1255
1255
|
reward_item_desc: e.string().optional(),
|
|
1256
1256
|
reward_item_rating: e.number(),
|
|
1257
1257
|
reward_amount: e.number(),
|
|
1258
|
-
reward_status:
|
|
1258
|
+
reward_status: te,
|
|
1259
1259
|
reward_source: $,
|
|
1260
1260
|
extra_data: e.record(e.unknown()).optional()
|
|
1261
1261
|
}), An = e.object({
|
|
@@ -1264,11 +1264,11 @@ const v = {
|
|
|
1264
1264
|
event_id: e.number(),
|
|
1265
1265
|
feature_id: e.number(),
|
|
1266
1266
|
sequence: e.number(),
|
|
1267
|
-
data:
|
|
1267
|
+
data: F.clone().optional(),
|
|
1268
1268
|
server_id: e.string().optional(),
|
|
1269
1269
|
role_id: e.string().optional(),
|
|
1270
1270
|
created_at: e.number(),
|
|
1271
|
-
rewards: e.array(
|
|
1271
|
+
rewards: e.array(Dn).optional()
|
|
1272
1272
|
}).lock(), Gn = e.object({
|
|
1273
1273
|
allowed: e.bool(),
|
|
1274
1274
|
registered: e.bool()
|
|
@@ -1282,15 +1282,15 @@ const v = {
|
|
|
1282
1282
|
engagement_id: e.number(),
|
|
1283
1283
|
sequence: e.number(),
|
|
1284
1284
|
feature_id: e.number(),
|
|
1285
|
-
data:
|
|
1285
|
+
data: F.clone().optional()
|
|
1286
1286
|
}).optional(),
|
|
1287
|
-
rewards: e.array(
|
|
1287
|
+
rewards: e.array(In).optional(),
|
|
1288
1288
|
scan: e.bool().optional()
|
|
1289
1289
|
}), Qn = e.object({
|
|
1290
1290
|
reward_id: e.number(),
|
|
1291
1291
|
reward_status: E
|
|
1292
|
-
}), Bn = e.guard(
|
|
1293
|
-
engagements: e.union(e.array(
|
|
1292
|
+
}), Bn = e.guard(gn), Mn = e.guard(Gn), x = s({ count: e.number() }), Kn = s({ first_visit: e.bool() }), Hn = s({
|
|
1293
|
+
engagements: e.union(e.array(Un), e.array(qn))
|
|
1294
1294
|
}), zn = s({
|
|
1295
1295
|
status: e.array(On)
|
|
1296
1296
|
}), Jn = s({
|
|
@@ -1313,9 +1313,9 @@ const v = {
|
|
|
1313
1313
|
params: e.string()
|
|
1314
1314
|
}), ar = s({
|
|
1315
1315
|
img: e.string()
|
|
1316
|
-
}), or = e.guard(
|
|
1316
|
+
}), or = e.guard(Cn), ir = e.guard(Pn), sr = e.guard(
|
|
1317
1317
|
e.object({
|
|
1318
|
-
candidate_votes: e.array(
|
|
1318
|
+
candidate_votes: e.array(En)
|
|
1319
1319
|
})
|
|
1320
1320
|
);
|
|
1321
1321
|
class Wr {
|
|
@@ -1726,7 +1726,7 @@ const cr = {
|
|
|
1726
1726
|
Failed: "failed",
|
|
1727
1727
|
/** 嫌疑(仅自己可见) */
|
|
1728
1728
|
Suspect: "suspect"
|
|
1729
|
-
},
|
|
1729
|
+
}, ae = e.string().enum(ur).lock(), mr = {
|
|
1730
1730
|
/** 系统通知 */
|
|
1731
1731
|
System: "system",
|
|
1732
1732
|
/** 评论我的 */
|
|
@@ -1758,7 +1758,7 @@ const cr = {
|
|
|
1758
1758
|
ReplyLiked: "reply_liked",
|
|
1759
1759
|
/** 回复被删除 */
|
|
1760
1760
|
ReplyDeleted: "reply_deleted"
|
|
1761
|
-
}, dr = e.string().enum(m).lock(),
|
|
1761
|
+
}, dr = e.string().enum(m).lock(), oe = e.object({
|
|
1762
1762
|
forum_id: e.number(),
|
|
1763
1763
|
icon_url: e.string(),
|
|
1764
1764
|
name: e.string(),
|
|
@@ -1766,16 +1766,16 @@ const cr = {
|
|
|
1766
1766
|
sort: e.number(),
|
|
1767
1767
|
mode: lr,
|
|
1768
1768
|
member_ids: e.array(e.number())
|
|
1769
|
-
}).lock(),
|
|
1769
|
+
}).lock(), U = e.object({
|
|
1770
1770
|
topic_id: e.number(),
|
|
1771
1771
|
cover_url: e.string(),
|
|
1772
1772
|
name: e.string(),
|
|
1773
1773
|
description: e.string(),
|
|
1774
1774
|
tags: e.array(e.string()),
|
|
1775
1775
|
post_num: e.number()
|
|
1776
|
-
}).lock(),
|
|
1776
|
+
}).lock(), D = e.object({
|
|
1777
1777
|
post_id: e.number(),
|
|
1778
|
-
forum:
|
|
1778
|
+
forum: oe,
|
|
1779
1779
|
posted_by: e.string(),
|
|
1780
1780
|
nickname: e.string(),
|
|
1781
1781
|
avatar_url: e.string(),
|
|
@@ -1787,13 +1787,13 @@ const cr = {
|
|
|
1787
1787
|
comments_num: e.number(),
|
|
1788
1788
|
liked: e.bool(),
|
|
1789
1789
|
image_urls: e.array(e.string()),
|
|
1790
|
-
topics: e.array(
|
|
1790
|
+
topics: e.array(U),
|
|
1791
1791
|
event_ids: e.array(e.number()),
|
|
1792
1792
|
is_pinned: e.bool(),
|
|
1793
1793
|
is_highlighted: e.bool(),
|
|
1794
|
-
status:
|
|
1794
|
+
status: ae,
|
|
1795
1795
|
create_time: e.number()
|
|
1796
|
-
}).lock(),
|
|
1796
|
+
}).lock(), ie = e.object({
|
|
1797
1797
|
err_msg: e.string().optional()
|
|
1798
1798
|
}).optional().lock(), gr = e.object({
|
|
1799
1799
|
reply_id: e.number(),
|
|
@@ -1816,7 +1816,7 @@ const cr = {
|
|
|
1816
1816
|
liked: e.bool(),
|
|
1817
1817
|
reply_to: gr,
|
|
1818
1818
|
create_time: e.number()
|
|
1819
|
-
}).lock(),
|
|
1819
|
+
}).lock(), w = e.object({
|
|
1820
1820
|
comment_id: e.number(),
|
|
1821
1821
|
post_id: e.number(),
|
|
1822
1822
|
post_subject: e.string().optional(),
|
|
@@ -1834,7 +1834,7 @@ const cr = {
|
|
|
1834
1834
|
liked: e.bool(),
|
|
1835
1835
|
image_url: e.string(),
|
|
1836
1836
|
create_time: e.number(),
|
|
1837
|
-
status:
|
|
1837
|
+
status: ae,
|
|
1838
1838
|
replies: e.array(C).optional()
|
|
1839
1839
|
}).lock(), pr = e.object({
|
|
1840
1840
|
image_url: e.string(),
|
|
@@ -1851,7 +1851,7 @@ const cr = {
|
|
|
1851
1851
|
}).lock(), _r = e.object({
|
|
1852
1852
|
system_message_subject: e.string(),
|
|
1853
1853
|
system_message_content: e.string()
|
|
1854
|
-
}).lock(),
|
|
1854
|
+
}).lock(), I = e.object({
|
|
1855
1855
|
post_id: e.number(),
|
|
1856
1856
|
post_subject: e.string(),
|
|
1857
1857
|
post_summary: e.string(),
|
|
@@ -1859,7 +1859,7 @@ const cr = {
|
|
|
1859
1859
|
}).lock(), R = e.object({
|
|
1860
1860
|
comment_id: e.number(),
|
|
1861
1861
|
comment_content: e.string()
|
|
1862
|
-
}).lock(),
|
|
1862
|
+
}).lock(), A = e.object({
|
|
1863
1863
|
reply_id: e.number(),
|
|
1864
1864
|
reply_content: e.string()
|
|
1865
1865
|
}).lock(), br = e.object({
|
|
@@ -1868,7 +1868,7 @@ const cr = {
|
|
|
1868
1868
|
notification_type: e.string().enum(m.System)
|
|
1869
1869
|
}), yr = e.object({
|
|
1870
1870
|
..._.shape,
|
|
1871
|
-
...
|
|
1871
|
+
...I.shape,
|
|
1872
1872
|
notification_type: e.string().enum(
|
|
1873
1873
|
m.PostPinned,
|
|
1874
1874
|
m.PostHighlighted,
|
|
@@ -1877,29 +1877,29 @@ const cr = {
|
|
|
1877
1877
|
)
|
|
1878
1878
|
}), fr = e.object({
|
|
1879
1879
|
..._.shape,
|
|
1880
|
-
...
|
|
1880
|
+
...I.shape,
|
|
1881
1881
|
...R.shape,
|
|
1882
1882
|
notification_type: e.string().enum(m.PostCommented)
|
|
1883
1883
|
}), hr = e.object({
|
|
1884
1884
|
..._.shape,
|
|
1885
1885
|
...R.shape,
|
|
1886
|
-
...
|
|
1886
|
+
...A.shape,
|
|
1887
1887
|
notification_type: e.string().enum(m.CommentReplied)
|
|
1888
1888
|
}), wr = e.object({
|
|
1889
1889
|
..._.shape,
|
|
1890
1890
|
...R.shape,
|
|
1891
|
-
...
|
|
1891
|
+
...I.shape,
|
|
1892
1892
|
notification_type: e.string().enum(m.CommentLiked, m.CommentDeleted)
|
|
1893
1893
|
}), kr = e.object({
|
|
1894
1894
|
..._.shape,
|
|
1895
|
-
...
|
|
1895
|
+
...A.shape,
|
|
1896
1896
|
notification_type: e.string().enum(m.ReplyReplied),
|
|
1897
1897
|
comment_id: e.number(),
|
|
1898
1898
|
reply_to_reply_id: e.number(),
|
|
1899
1899
|
reply_to_reply_content: e.string()
|
|
1900
1900
|
}), vr = e.object({
|
|
1901
1901
|
..._.shape,
|
|
1902
|
-
...
|
|
1902
|
+
...A.shape,
|
|
1903
1903
|
...R.shape,
|
|
1904
1904
|
notification_type: e.string().enum(m.ReplyLiked, m.ReplyDeleted)
|
|
1905
1905
|
}), Vr = e.union(
|
|
@@ -1910,24 +1910,24 @@ const cr = {
|
|
|
1910
1910
|
wr,
|
|
1911
1911
|
kr,
|
|
1912
1912
|
vr
|
|
1913
|
-
).satisfies().lock(), Cr = s({ forums: e.array(
|
|
1914
|
-
posts: e.array(
|
|
1913
|
+
).satisfies().lock(), Cr = s({ forums: e.array(oe) }), Rr = s({ topics: e.array(U) }), jr = s({ topic: U }), Tr = s({ post: D }), M = s({
|
|
1914
|
+
posts: e.array(D),
|
|
1915
1915
|
next_token: e.string().optional()
|
|
1916
1916
|
}), qr = s({
|
|
1917
|
-
post:
|
|
1918
|
-
antispam:
|
|
1917
|
+
post: D.clone().optional(),
|
|
1918
|
+
antispam: ie.clone().optional()
|
|
1919
1919
|
}), xr = s({
|
|
1920
1920
|
replies: e.array(C),
|
|
1921
1921
|
next_token: e.string().optional()
|
|
1922
1922
|
}), Sr = s({ reply: C }), Lr = s({
|
|
1923
1923
|
reply: C.clone().optional(),
|
|
1924
|
-
antispam:
|
|
1925
|
-
}), Pr = s({ comment:
|
|
1926
|
-
comments: e.array(
|
|
1924
|
+
antispam: ie.clone().optional()
|
|
1925
|
+
}), Pr = s({ comment: w }), Er = s({
|
|
1926
|
+
comments: e.array(w),
|
|
1927
1927
|
next_token: e.string().optional()
|
|
1928
1928
|
}), $r = s({
|
|
1929
|
-
comment:
|
|
1930
|
-
antispam:
|
|
1929
|
+
comment: w.clone().optional(),
|
|
1930
|
+
antispam: w.clone().optional()
|
|
1931
1931
|
}), Fr = e.guard(pr), Ur = s({
|
|
1932
1932
|
notifications: e.array(Vr),
|
|
1933
1933
|
next_token: e.string().optional()
|
|
@@ -1978,7 +1978,7 @@ class ta {
|
|
|
1978
1978
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=XKI9lDVrPq
|
|
1979
1979
|
*/
|
|
1980
1980
|
async getPosts(t, n) {
|
|
1981
|
-
const { data: r, code: a, message: o } = await this.req.get("community/posts",
|
|
1981
|
+
const { data: r, code: a, message: o } = await this.req.get("community/posts", M, {
|
|
1982
1982
|
...n,
|
|
1983
1983
|
params: c(t)
|
|
1984
1984
|
});
|
|
@@ -1993,7 +1993,7 @@ class ta {
|
|
|
1993
1993
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=yXubbZuDlC
|
|
1994
1994
|
*/
|
|
1995
1995
|
async getPinnedPosts(t, n, r, a) {
|
|
1996
|
-
const { data: o, code: g, message: p } = await this.req.get("community/pinned-posts",
|
|
1996
|
+
const { data: o, code: g, message: p } = await this.req.get("community/pinned-posts", M, {
|
|
1997
1997
|
...a,
|
|
1998
1998
|
params: c({ forum_id: t, max_results: n, next_token: r })
|
|
1999
1999
|
});
|
|
@@ -2229,9 +2229,9 @@ const Ir = s({
|
|
|
2229
2229
|
});
|
|
2230
2230
|
var Ar = /* @__PURE__ */ ((i) => (i.RedirectUriDisMatch = "10003", i.AppidError = "10016", i.AuthorizationError = "10015", i.NoRightForScope = "10005", i.Frequently = "10009", i.AppBanded = "10004", i.ShouldFollow = "10006", i.ScopeNull = "10010", i.RedirectUriNull = "10011", i.AppidNull = "10012", i.StateNull = "10013", i))(Ar || {});
|
|
2231
2231
|
function S(i) {
|
|
2232
|
-
return
|
|
2232
|
+
return k(i, "open_id", "union_id", "weixin_token");
|
|
2233
2233
|
}
|
|
2234
|
-
const
|
|
2234
|
+
const K = "wx_login_cache";
|
|
2235
2235
|
class na {
|
|
2236
2236
|
token;
|
|
2237
2237
|
$appid;
|
|
@@ -2263,10 +2263,10 @@ class na {
|
|
|
2263
2263
|
* 也可以直接调用 login 方法,并传入 weixin code 的读取函数
|
|
2264
2264
|
*/
|
|
2265
2265
|
async getLoginCache() {
|
|
2266
|
-
const t = this.token.storage.get(
|
|
2266
|
+
const t = this.token.storage.get(K);
|
|
2267
2267
|
if (!t)
|
|
2268
2268
|
return null;
|
|
2269
|
-
const n =
|
|
2269
|
+
const n = _e(t);
|
|
2270
2270
|
return S(n) ? (this.token.weixinToken = n.weixin_token, await this.token.autoLogin(), n) : null;
|
|
2271
2271
|
}
|
|
2272
2272
|
/**
|
|
@@ -2292,13 +2292,13 @@ class na {
|
|
|
2292
2292
|
const n = await this.getLoginCache();
|
|
2293
2293
|
if (n)
|
|
2294
2294
|
return n;
|
|
2295
|
-
const r = await
|
|
2295
|
+
const r = await fe(), { data: a, code: o, message: g } = await this.req.post(
|
|
2296
2296
|
"weixin/login",
|
|
2297
2297
|
{ code: r, appid: this.appid },
|
|
2298
2298
|
S,
|
|
2299
2299
|
{ ...t, message: !1 }
|
|
2300
2300
|
);
|
|
2301
|
-
return a && (this.token.weixinToken = a.weixin_token, this.token.storage.set(
|
|
2301
|
+
return a && (this.token.weixinToken = a.weixin_token, this.token.storage.set(K, JSON.stringify(a))), a ?? {
|
|
2302
2302
|
message: g,
|
|
2303
2303
|
error: o
|
|
2304
2304
|
};
|
|
@@ -2322,9 +2322,9 @@ class na {
|
|
|
2322
2322
|
async webLogin(t = "snsapi_userinfo", n) {
|
|
2323
2323
|
const r = L("code"), a = Date.now(), o = +L("state");
|
|
2324
2324
|
if (!r || !o || o < a - 1e3 * 60 * 5 || o > a) {
|
|
2325
|
-
const
|
|
2325
|
+
const le = G(["code", "state"]);
|
|
2326
2326
|
location.replace(
|
|
2327
|
-
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(
|
|
2327
|
+
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(le)}&response_type=code&scope=${t}&state=${a}#wechat_redirect`
|
|
2328
2328
|
);
|
|
2329
2329
|
return;
|
|
2330
2330
|
}
|
|
@@ -2333,16 +2333,16 @@ class na {
|
|
|
2333
2333
|
message: "Error: " + r,
|
|
2334
2334
|
error: r
|
|
2335
2335
|
};
|
|
2336
|
-
const g =
|
|
2336
|
+
const g = G(["code", "state"]);
|
|
2337
2337
|
"replaceState" in history && history.replaceState({}, "", g);
|
|
2338
2338
|
const {
|
|
2339
2339
|
data: p,
|
|
2340
|
-
code:
|
|
2341
|
-
message:
|
|
2340
|
+
code: se,
|
|
2341
|
+
message: ce
|
|
2342
2342
|
} = await this.req.post("weixin/login", { code: r, appid: this.appid }, S, n);
|
|
2343
2343
|
return p && (this.token.weixinToken = p.weixin_token, await this.token.autoLogin()), p ?? {
|
|
2344
|
-
message:
|
|
2345
|
-
error:
|
|
2344
|
+
message: ce,
|
|
2345
|
+
error: se
|
|
2346
2346
|
};
|
|
2347
2347
|
}
|
|
2348
2348
|
/**
|
|
@@ -2388,84 +2388,84 @@ class na {
|
|
|
2388
2388
|
}
|
|
2389
2389
|
}
|
|
2390
2390
|
export {
|
|
2391
|
-
|
|
2391
|
+
ie as AntispamValidator,
|
|
2392
2392
|
Qr as AuthToken,
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2393
|
+
En as CandidateVoteValidator,
|
|
2394
|
+
pn as CashbackEngagementDataValidator,
|
|
2395
|
+
_n as ClaimActivationKeyEngagementDataValidator,
|
|
2396
|
+
it as ClaimRewardStatus,
|
|
2397
2397
|
E as ClaimRewardStatusValidator,
|
|
2398
2398
|
Qn as ClaimedItemValidator,
|
|
2399
|
-
|
|
2399
|
+
J as ClubAddressValidator,
|
|
2400
2400
|
Mr as ClubApi,
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2401
|
+
Z as ClubBenefitSummaryValidator,
|
|
2402
|
+
Ie as ClubBenefitValidator,
|
|
2403
|
+
Re as ClubCreditChangeScene,
|
|
2404
|
+
je as ClubCreditChangeSceneValidator,
|
|
2405
|
+
Ve as ClubCreditChangeType,
|
|
2406
|
+
Ce as ClubCreditChangeTypeValidator,
|
|
2407
|
+
De as ClubCreditLogValidator,
|
|
2408
|
+
Se as ClubGlobalConfigValidator,
|
|
2409
|
+
Te as ClubItemType,
|
|
2410
|
+
H as ClubItemTypeValidator,
|
|
2411
|
+
Le as ClubPlayerValidator,
|
|
2412
|
+
X as ClubProductValidator,
|
|
2413
|
+
qe as ClubRedemptionStatus,
|
|
2414
|
+
xe as ClubRedemptionStatusValidator,
|
|
2415
|
+
Ue as ClubUserCreditValidator,
|
|
2416
|
+
Fe as ClubUserProfileValidator,
|
|
2417
|
+
Un as CommentEngagementValidator,
|
|
2418
|
+
w as CommentValidator,
|
|
2419
2419
|
ta as CommunityApi,
|
|
2420
|
-
|
|
2421
|
-
|
|
2420
|
+
Xe as EngageAccountType,
|
|
2421
|
+
Ye as EngageAccountTypeValidator,
|
|
2422
2422
|
Nn as EngageResponseValidator,
|
|
2423
|
-
|
|
2423
|
+
In as EngageRewardValidator,
|
|
2424
2424
|
Wr as EventApi,
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2425
|
+
gn as EventConfigValidator,
|
|
2426
|
+
ht as EventFeatureConfigOfCashbackValidator,
|
|
2427
|
+
kt as EventFeatureConfigOfCheckInValidator,
|
|
2428
|
+
Vt as EventFeatureConfigOfClaimActivationKeyValidator,
|
|
2429
|
+
Rt as EventFeatureConfigOfClaimRewardsValidator,
|
|
2430
|
+
Tt as EventFeatureConfigOfCommentValidator,
|
|
2431
|
+
xt as EventFeatureConfigOfFollowValidator,
|
|
2432
|
+
Pt as EventFeatureConfigOfGiftCodeValidator,
|
|
2433
|
+
$t as EventFeatureConfigOfInviteValidator,
|
|
2434
|
+
Ut as EventFeatureConfigOfInvitedRegisterValidator,
|
|
2435
|
+
Nt as EventFeatureConfigOfLotteryDrawValidator,
|
|
2436
|
+
Gt as EventFeatureConfigOfLotteryValidator,
|
|
2437
|
+
Bt as EventFeatureConfigOfPreregisterValidator,
|
|
2438
|
+
Kt as EventFeatureConfigOfQuestValidator,
|
|
2439
|
+
zt as EventFeatureConfigOfRegisterValidator,
|
|
2440
|
+
Zt as EventFeatureConfigOfShareValidator,
|
|
2441
|
+
Yt as EventFeatureConfigOfSubscribeValidator,
|
|
2442
|
+
en as EventFeatureConfigOfSurveyValidator,
|
|
2443
|
+
nn as EventFeatureConfigOfTeamValidator,
|
|
2444
|
+
ln as EventFeatureConfigOfVote2Validator,
|
|
2445
|
+
on as EventFeatureConfigOfVoteValidator,
|
|
2446
|
+
dn as EventFeatureConfigValidator,
|
|
2447
|
+
We as EventPeriodType,
|
|
2448
|
+
et as EventPeriodTypeValidator,
|
|
2449
|
+
y as EventRewardItemConfigValidator,
|
|
2450
|
+
Ge as ExtraGameRewardValidator,
|
|
2451
|
+
Ae as ExtraPhysicalShipmentValidator,
|
|
2452
|
+
yt as FeatureRewardValidator,
|
|
2453
2453
|
l as FeatureType,
|
|
2454
|
-
|
|
2454
|
+
tt as FeatureTypeValidator,
|
|
2455
2455
|
cr as ForumMode,
|
|
2456
2456
|
lr as ForumModeValidator,
|
|
2457
|
-
|
|
2457
|
+
oe as ForumValidator,
|
|
2458
2458
|
v as GamerItemType,
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2459
|
+
Y as GamerItemTypeValidator,
|
|
2460
|
+
ke as Gender,
|
|
2461
|
+
ve as GenderValidator,
|
|
2462
|
+
bn as GiftCodeEngagementDataValidator,
|
|
2463
|
+
yn as InviteEngagementDataValidator,
|
|
2464
|
+
mt as LotteryDrawAction,
|
|
2465
2465
|
Zr as LotteryDrawActionValidator,
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2466
|
+
kn as LotteryDrawEngagementDataValidator,
|
|
2467
|
+
fn as LotteryEngagementDataValidator,
|
|
2468
|
+
h as LotteryTicketStatus,
|
|
2469
2469
|
zr as LotteryTicketStatusValidator,
|
|
2470
2470
|
_ as NotificationBaseValidator,
|
|
2471
2471
|
mr as NotificationCategory,
|
|
@@ -2473,8 +2473,8 @@ export {
|
|
|
2473
2473
|
hr as NotificationCommentReplyValidator,
|
|
2474
2474
|
wr as NotificationCommentValidator,
|
|
2475
2475
|
R as NotificationPayloadCommentValidator,
|
|
2476
|
-
|
|
2477
|
-
|
|
2476
|
+
I as NotificationPayloadPostValidator,
|
|
2477
|
+
A as NotificationPayloadReplyValidator,
|
|
2478
2478
|
_r as NotificationPayloadSystemValidator,
|
|
2479
2479
|
fr as NotificationPostCommentValidator,
|
|
2480
2480
|
yr as NotificationPostValidator,
|
|
@@ -2484,60 +2484,60 @@ export {
|
|
|
2484
2484
|
m as NotificationType,
|
|
2485
2485
|
dr as NotificationTypeValidator,
|
|
2486
2486
|
Vr as NotificationValidator,
|
|
2487
|
-
|
|
2488
|
-
|
|
2487
|
+
$e as PlayerRoleCardValidator,
|
|
2488
|
+
z as PlayerRoleValidator,
|
|
2489
2489
|
ur as PostStatus,
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2490
|
+
ae as PostStatusValidator,
|
|
2491
|
+
D as PostValidator,
|
|
2492
|
+
vn as PreregisterEngagementDataValidator,
|
|
2493
2493
|
pr as PresignedUrlResponseValidator,
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2494
|
+
Vn as QuestEngagementDataValidator,
|
|
2495
|
+
nt as QuestObjective,
|
|
2496
|
+
ee as QuestObjectiveValidator,
|
|
2497
|
+
ne as QuestProgressAlgorithm,
|
|
2498
|
+
dt as QuestProgressAlgorithmOptionalValidator,
|
|
2499
2499
|
Xr as QuestProgressAlgorithmValidator,
|
|
2500
|
-
|
|
2500
|
+
Cn as QuestProgressValidator,
|
|
2501
2501
|
Br as RedeemParamsValidator,
|
|
2502
|
-
|
|
2503
|
-
|
|
2502
|
+
Oe as RedemptionValidator,
|
|
2503
|
+
bt as RegularRewardValidator,
|
|
2504
2504
|
gr as ReplyToValidator,
|
|
2505
2505
|
C as ReplyValidator,
|
|
2506
2506
|
Kr as RewardItemType,
|
|
2507
|
-
|
|
2508
|
-
|
|
2507
|
+
W as RewardItemTypeValidator,
|
|
2508
|
+
st as RewardSource,
|
|
2509
2509
|
$ as RewardSourceValidator,
|
|
2510
2510
|
d as RewardStatus,
|
|
2511
|
-
|
|
2512
|
-
|
|
2511
|
+
ot as RewardStatusSuffix,
|
|
2512
|
+
te as RewardStatusSuffixValidator,
|
|
2513
2513
|
Hr as RewardStatusValidator,
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2514
|
+
Dn as RewardValidator,
|
|
2515
|
+
Ee as RoleBaseInfoValidator,
|
|
2516
|
+
Pe as ServerBaseInfoValidator,
|
|
2517
|
+
Rn as ShareEngagementDataValidator,
|
|
2518
|
+
Tn as SurveyEngagementDataValidator,
|
|
2519
|
+
ut as TeamAction,
|
|
2520
2520
|
Jr as TeamActionValidator,
|
|
2521
|
-
|
|
2522
|
-
|
|
2521
|
+
xn as TeamEngagementDataValidator,
|
|
2522
|
+
qn as TeamEngagementValidator,
|
|
2523
2523
|
Yr as TeamMemberValidator,
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2524
|
+
ct as TeamVisibility,
|
|
2525
|
+
lt as TeamVisibilityValidator,
|
|
2526
|
+
U as TopicValidator,
|
|
2527
|
+
F as UserEngagementDataValidator,
|
|
2528
2528
|
An as UserEngagementValidator,
|
|
2529
2529
|
On as UserFeatureStatusValidator,
|
|
2530
2530
|
V as UserRewardValidator,
|
|
2531
2531
|
Gn as VerifyMobileResultValidator,
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2532
|
+
Pn as Vote2ClaimRewardsResponseValidator,
|
|
2533
|
+
Ln as Vote2EngagementDataValidator,
|
|
2534
|
+
gt as Vote2RewardType,
|
|
2535
|
+
pt as Vote2RewardTypeValidator,
|
|
2536
|
+
Sn as VoteEngagementDataValidator,
|
|
2537
|
+
rt as VoteOptionSource,
|
|
2538
|
+
at as VoteOptionSourceValidator,
|
|
2539
2539
|
na as WeixinApi,
|
|
2540
|
-
|
|
2540
|
+
jn as WeixinSubscribeEngagementDataValidator,
|
|
2541
2541
|
Ar as WeixinWebLoginErrorCode,
|
|
2542
2542
|
Ir as isWeixinSignResponse
|
|
2543
2543
|
};
|