@seayoo-web/gamer-api 2.9.9 → 2.10.0
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 +573 -482
- package/package.json +4 -4
- package/types/src/event.config/feature.d.ts +4 -2
- package/types/src/event.config/feature.vote2.d.ts +49 -0
- package/types/src/event.config/reward.d.ts +5 -0
- package/types/src/event.d.ts +17 -4
- package/types/src/event.engage/engage.d.ts +4 -2
- package/types/src/event.engage/engage.vote2.d.ts +38 -0
- package/types/src/event.engage/index.d.ts +3 -3
- package/types/src/event.enums.d.ts +24 -0
- package/types/src/event.guards.d.ts +4 -0
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { isComboWebView as
|
|
2
|
-
import { isPlainObject as w, supportWx as b, useConsole as
|
|
1
|
+
import { isComboWebView as ue } from "@seayoo-web/combo-webview";
|
|
2
|
+
import { isPlainObject as w, supportWx as b, useConsole as de, usePromise as ge, pruneURL as pe, supportWindow as _e, queryString as L, pruneObject as c, omitFields as k, parseJSON as be, removePara as G } from "@seayoo-web/utils";
|
|
3
3
|
import { v as e, objectGuard as s } from "@seayoo-web/validator";
|
|
4
|
-
function
|
|
4
|
+
function ye(i) {
|
|
5
5
|
return w(i, "gamer_token") && typeof i.gamer_token == "string";
|
|
6
6
|
}
|
|
7
7
|
function O(i) {
|
|
8
8
|
return w(i);
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
function
|
|
10
|
+
const j = de("GamerApiSDK");
|
|
11
|
+
function fe(i) {
|
|
12
12
|
return /^\/[a-z\d-]+$/.test(i);
|
|
13
13
|
}
|
|
14
|
-
async function
|
|
15
|
-
const { promise: i, resolve: t } =
|
|
14
|
+
async function he() {
|
|
15
|
+
const { promise: i, resolve: t } = ge();
|
|
16
16
|
return wx.login({
|
|
17
17
|
success(n) {
|
|
18
18
|
t(n.code);
|
|
@@ -22,7 +22,7 @@ async function fe() {
|
|
|
22
22
|
}
|
|
23
23
|
}), await i;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const we = {
|
|
26
26
|
get(i) {
|
|
27
27
|
return localStorage.getItem(i) || "";
|
|
28
28
|
},
|
|
@@ -32,12 +32,12 @@ const he = {
|
|
|
32
32
|
remove(i) {
|
|
33
33
|
localStorage.removeItem(i);
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, ke = {
|
|
36
36
|
get(i) {
|
|
37
37
|
try {
|
|
38
38
|
if (b()) return wx.getStorageSync(i) || "";
|
|
39
39
|
} catch (t) {
|
|
40
|
-
|
|
40
|
+
j.error("getStorageSyncError", t);
|
|
41
41
|
}
|
|
42
42
|
return "";
|
|
43
43
|
},
|
|
@@ -45,18 +45,18 @@ const he = {
|
|
|
45
45
|
try {
|
|
46
46
|
b() && wx.setStorageSync(i, t);
|
|
47
47
|
} catch (n) {
|
|
48
|
-
|
|
48
|
+
j.error("setStorageSyncError", n);
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
remove(i) {
|
|
52
52
|
try {
|
|
53
53
|
b() && wx.removeStorageSync(i);
|
|
54
54
|
} catch (t) {
|
|
55
|
-
|
|
55
|
+
j.error("removeStorageSync", t);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}, y = "gamer_token";
|
|
59
|
-
class
|
|
59
|
+
class Br {
|
|
60
60
|
$NetRequest;
|
|
61
61
|
$idToken = "";
|
|
62
62
|
$weixinToken = "";
|
|
@@ -64,8 +64,8 @@ class $r {
|
|
|
64
64
|
req;
|
|
65
65
|
storage;
|
|
66
66
|
constructor(t, n) {
|
|
67
|
-
this.storage = b() ?
|
|
68
|
-
const r =
|
|
67
|
+
this.storage = b() ? ke : we;
|
|
68
|
+
const r = fe(t) ? t : `https://${pe(t)}`;
|
|
69
69
|
if (this.$NetRequest = n, this.req = n({
|
|
70
70
|
baseURL: `${r}/v1`,
|
|
71
71
|
timeout: 1e4,
|
|
@@ -86,9 +86,9 @@ class $r {
|
|
|
86
86
|
requestTransformer: (a) => {
|
|
87
87
|
this.$gamerToken && (a.headers.Authorization = `Bearer ${this.$gamerToken}`);
|
|
88
88
|
}
|
|
89
|
-
}),
|
|
90
|
-
const a = /^(?:localhost|[\d.]+):\d{4}$/.test(location.host), o =
|
|
91
|
-
(
|
|
89
|
+
}), _e()) {
|
|
90
|
+
const a = /^(?:localhost|[\d.]+):\d{4}$/.test(location.host), o = L("gamer_token");
|
|
91
|
+
(ue() || a && o) && (this.$gamerToken = o);
|
|
92
92
|
}
|
|
93
93
|
this.$gamerToken || this.loadGamerTokenCache();
|
|
94
94
|
}
|
|
@@ -171,7 +171,7 @@ class $r {
|
|
|
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
|
+
ye,
|
|
175
175
|
{
|
|
176
176
|
message: !1,
|
|
177
177
|
cacheTTL: 300,
|
|
@@ -213,21 +213,21 @@ class $r {
|
|
|
213
213
|
return n;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const ve = {
|
|
217
217
|
/** 未知 */
|
|
218
218
|
Unknown: "unknown",
|
|
219
219
|
/** 男 */
|
|
220
220
|
Male: "male",
|
|
221
221
|
/** 女 */
|
|
222
222
|
Female: "female"
|
|
223
|
-
},
|
|
223
|
+
}, Ve = e.string().enum(ve).lock(), Ce = {
|
|
224
224
|
/** 积分增加 */
|
|
225
225
|
Increase: "increase",
|
|
226
226
|
/** 积分减少 */
|
|
227
227
|
Decrease: "decrease",
|
|
228
228
|
/** 积分过期 */
|
|
229
229
|
Expired: "expired"
|
|
230
|
-
},
|
|
230
|
+
}, Re = e.string().enum(Ce).lock(), je = {
|
|
231
231
|
/** 游戏内购买 */
|
|
232
232
|
Order: "order",
|
|
233
233
|
/** 游戏内消耗 */
|
|
@@ -240,21 +240,21 @@ const ke = {
|
|
|
240
240
|
Admin: "admin",
|
|
241
241
|
/** 运营活动 */
|
|
242
242
|
Event: "event"
|
|
243
|
-
},
|
|
243
|
+
}, Te = e.string().enum(je).lock(), qe = {
|
|
244
244
|
/** 游戏内奖励 */
|
|
245
245
|
GameReward: "game_reward",
|
|
246
246
|
/** 实物商品 */
|
|
247
247
|
Physical: "physical",
|
|
248
248
|
/** 虚拟商品 */
|
|
249
249
|
Virtual: "virtual"
|
|
250
|
-
},
|
|
250
|
+
}, z = e.string().enum(qe).lock(), xe = {
|
|
251
251
|
/** 待发放 */
|
|
252
252
|
Pending: "pending",
|
|
253
253
|
/** 已发放 */
|
|
254
254
|
Issued: "issued",
|
|
255
255
|
/** 发放失败 */
|
|
256
256
|
Failed: "failed"
|
|
257
|
-
},
|
|
257
|
+
}, Se = e.string().enum(xe).lock(), Le = 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 ke = {
|
|
|
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(), Pe = e.object({
|
|
276
276
|
member_id: e.string(),
|
|
277
277
|
player_id: e.string(),
|
|
278
278
|
exp: e.number(),
|
|
@@ -281,19 +281,19 @@ const ke = {
|
|
|
281
281
|
credit_expiring: e.number(),
|
|
282
282
|
level_change_time: e.number(),
|
|
283
283
|
level_expire_time: e.number()
|
|
284
|
-
}).lock(),
|
|
284
|
+
}).lock(), Ee = e.object({
|
|
285
285
|
server_id: e.string(),
|
|
286
286
|
server_name: e.string()
|
|
287
287
|
}).lock(), $e = e.object({
|
|
288
288
|
role_id: e.string(),
|
|
289
289
|
role_name: e.string()
|
|
290
|
-
}).lock(),
|
|
290
|
+
}).lock(), J = e.object({
|
|
291
291
|
...$e.shape,
|
|
292
|
-
...
|
|
292
|
+
...Ee.shape,
|
|
293
293
|
role_level: e.number(),
|
|
294
294
|
last_login_time: e.number()
|
|
295
|
-
}).lock(),
|
|
296
|
-
...
|
|
295
|
+
}).lock(), Fe = e.object({
|
|
296
|
+
...J.shape,
|
|
297
297
|
/** 角色战力 */
|
|
298
298
|
role_fighting: e.number(),
|
|
299
299
|
/** 宗门 ID */
|
|
@@ -302,13 +302,13 @@ const ke = {
|
|
|
302
302
|
kin_name: e.string().optional(),
|
|
303
303
|
/** 宗门职位 */
|
|
304
304
|
kin_position: e.string().optional()
|
|
305
|
-
}).lock(),
|
|
305
|
+
}).lock(), Ue = 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(), Z = e.object({
|
|
312
312
|
address_id: e.number(),
|
|
313
313
|
recipient: e.string(),
|
|
314
314
|
mobile: e.string(),
|
|
@@ -317,19 +317,19 @@ const ke = {
|
|
|
317
317
|
district: e.string(),
|
|
318
318
|
address: e.string(),
|
|
319
319
|
is_default: e.bool()
|
|
320
|
-
}).lock(),
|
|
320
|
+
}).lock(), Ie = 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: Re,
|
|
328
|
+
change_scene: Te,
|
|
329
329
|
change_credit: e.number(),
|
|
330
330
|
balance: e.number(),
|
|
331
331
|
change_time: e.number()
|
|
332
|
-
}).lock(),
|
|
332
|
+
}).lock(), X = e.object({
|
|
333
333
|
benefit_id: e.number(),
|
|
334
334
|
name: e.string(),
|
|
335
335
|
img_url: e.string(),
|
|
@@ -338,11 +338,11 @@ const ke = {
|
|
|
338
338
|
max_level: e.number(),
|
|
339
339
|
product_id: e.number(),
|
|
340
340
|
tag: e.string()
|
|
341
|
-
}).lock(),
|
|
341
|
+
}).lock(), Y = 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: z,
|
|
346
346
|
name: e.string(),
|
|
347
347
|
img_url: e.string(),
|
|
348
348
|
description: e.string(),
|
|
@@ -364,10 +364,10 @@ const ke = {
|
|
|
364
364
|
created_at: e.number(),
|
|
365
365
|
updated_at: e.number(),
|
|
366
366
|
redeemable_quantity: e.number().optional()
|
|
367
|
-
}).lock(),
|
|
368
|
-
...k(
|
|
369
|
-
product:
|
|
370
|
-
}).lock(),
|
|
367
|
+
}).lock(), Ae = e.object({
|
|
368
|
+
...k(X.shape, "tag"),
|
|
369
|
+
product: Y.clone().optional()
|
|
370
|
+
}).lock(), Mr = e.union(
|
|
371
371
|
e.object({
|
|
372
372
|
server_id: e.string(),
|
|
373
373
|
role_id: e.string()
|
|
@@ -375,7 +375,7 @@ const ke = {
|
|
|
375
375
|
e.object({
|
|
376
376
|
address_id: e.number()
|
|
377
377
|
})
|
|
378
|
-
).satisfies().lock(),
|
|
378
|
+
).satisfies().lock(), Ge = e.object({
|
|
379
379
|
recipient: e.string(),
|
|
380
380
|
mobile: e.string(),
|
|
381
381
|
province: e.string(),
|
|
@@ -384,32 +384,32 @@ const ke = {
|
|
|
384
384
|
address: e.string(),
|
|
385
385
|
express_company: e.string(),
|
|
386
386
|
express_number: e.string()
|
|
387
|
-
}).lock(),
|
|
387
|
+
}).lock(), Oe = e.object({
|
|
388
388
|
server_id: e.string(),
|
|
389
389
|
role_id: e.string(),
|
|
390
390
|
role_name: e.string()
|
|
391
|
-
}).lock(),
|
|
391
|
+
}).lock(), Ne = 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: z,
|
|
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: Se,
|
|
403
403
|
created_at: e.number(),
|
|
404
|
-
extra_data: e.union(
|
|
405
|
-
}),
|
|
406
|
-
credit_logs: e.array(
|
|
404
|
+
extra_data: e.union(Ge.clone(), Oe.clone()).satisfies().optional()
|
|
405
|
+
}), Qe = e.guard(Le), N = s({ player: Pe }), Be = s({ roles: e.array(J) }), T = s({ role_card: Fe }), Q = e.guard(Ue), B = e.guard(Z), Me = s({ addresses: e.array(Z) }), Ke = e.guard(Ie), He = s({
|
|
406
|
+
credit_logs: e.array(De),
|
|
407
407
|
next_token: e.string().optional()
|
|
408
|
-
}),
|
|
409
|
-
redemptions: e.array(
|
|
408
|
+
}), ze = s({ products: e.array(Y) }), Je = s({ benefits: e.array(X) }), Ze = s({ benefit: Ae }), Xe = s({
|
|
409
|
+
redemptions: e.array(Ne),
|
|
410
410
|
next_token: e.string().optional()
|
|
411
411
|
});
|
|
412
|
-
class
|
|
412
|
+
class Kr {
|
|
413
413
|
token;
|
|
414
414
|
req;
|
|
415
415
|
constructor(t) {
|
|
@@ -421,7 +421,7 @@ class Fr {
|
|
|
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", Qe, t);
|
|
425
425
|
return n;
|
|
426
426
|
}
|
|
427
427
|
/**
|
|
@@ -462,7 +462,7 @@ class Fr {
|
|
|
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", Be, {
|
|
466
466
|
...r,
|
|
467
467
|
params: c({ player_id: t, refresh: n })
|
|
468
468
|
});
|
|
@@ -474,7 +474,7 @@ class Fr {
|
|
|
474
474
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=A1Wr7kUXnS
|
|
475
475
|
*/
|
|
476
476
|
async getRoleCard(t, n) {
|
|
477
|
-
const { data: r } = await this.req.get("club/role-card",
|
|
477
|
+
const { data: r } = await this.req.get("club/role-card", T, {
|
|
478
478
|
...n,
|
|
479
479
|
params: { member_id: t }
|
|
480
480
|
});
|
|
@@ -487,7 +487,7 @@ class Fr {
|
|
|
487
487
|
*/
|
|
488
488
|
async setRoleCard(t, n) {
|
|
489
489
|
if (!await this.token.autoLogin()) return null;
|
|
490
|
-
const { data: r } = await this.req.post("club/role-card", t,
|
|
490
|
+
const { data: r } = await this.req.post("club/role-card", t, T, n);
|
|
491
491
|
return r?.role_card ?? null;
|
|
492
492
|
}
|
|
493
493
|
/**
|
|
@@ -497,7 +497,7 @@ class Fr {
|
|
|
497
497
|
*/
|
|
498
498
|
async refreshRoleCard(t) {
|
|
499
499
|
if (!await this.token.autoLogin()) return null;
|
|
500
|
-
const { data: n } = await this.req.post("club/refresh-role-card", {},
|
|
500
|
+
const { data: n } = await this.req.post("club/refresh-role-card", {}, T, t);
|
|
501
501
|
return n?.role_card ?? null;
|
|
502
502
|
}
|
|
503
503
|
/**
|
|
@@ -534,7 +534,7 @@ class Fr {
|
|
|
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", Me, t);
|
|
538
538
|
return n?.addresses ?? [];
|
|
539
539
|
}
|
|
540
540
|
/**
|
|
@@ -582,7 +582,7 @@ class Fr {
|
|
|
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", Ke, {
|
|
586
586
|
...n,
|
|
587
587
|
params: c(t)
|
|
588
588
|
});
|
|
@@ -598,7 +598,7 @@ class Fr {
|
|
|
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", He, {
|
|
602
602
|
...n,
|
|
603
603
|
params: c({ max_results: 20, ...t })
|
|
604
604
|
});
|
|
@@ -614,7 +614,7 @@ class Fr {
|
|
|
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", Je, t);
|
|
618
618
|
return n?.benefits || [];
|
|
619
619
|
}
|
|
620
620
|
/**
|
|
@@ -624,7 +624,7 @@ class Fr {
|
|
|
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", Ze, {
|
|
628
628
|
...n,
|
|
629
629
|
params: { benefit_id: t }
|
|
630
630
|
});
|
|
@@ -636,7 +636,7 @@ class Fr {
|
|
|
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", ze, {
|
|
640
640
|
...n,
|
|
641
641
|
params: t
|
|
642
642
|
});
|
|
@@ -662,7 +662,7 @@ class Fr {
|
|
|
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", Xe, {
|
|
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
|
+
}, W = e.string().enum(v).lock(), Hr = v, ee = W, Ye = {
|
|
697
697
|
/** 世游通行证 ID / Combo ID */
|
|
698
698
|
UserId: "user_id",
|
|
699
699
|
/** 游戏角色 ID */
|
|
700
700
|
RoleId: "role_id"
|
|
701
|
-
},
|
|
701
|
+
}, We = e.string().enum(Ye).lock(), et = {
|
|
702
702
|
None: "none",
|
|
703
703
|
Daily: "daily",
|
|
704
704
|
Weekly: "weekly",
|
|
705
705
|
Monthly: "monthly"
|
|
706
|
-
},
|
|
706
|
+
}, tt = e.string().enum(et).lock(), l = {
|
|
707
707
|
/** 预约 */
|
|
708
708
|
Preregister: "preregister",
|
|
709
709
|
/** 抽奖 */
|
|
@@ -722,6 +722,8 @@ const v = {
|
|
|
722
722
|
Comment: "comment",
|
|
723
723
|
/** 投票 */
|
|
724
724
|
Vote: "vote",
|
|
725
|
+
/** 投票 V2 */
|
|
726
|
+
Vote2: "vote2",
|
|
725
727
|
/** 礼包码 */
|
|
726
728
|
GiftCode: "gift_code",
|
|
727
729
|
/** 注册 */
|
|
@@ -744,7 +746,7 @@ const v = {
|
|
|
744
746
|
ClaimActivationKey: "claim_activation_key",
|
|
745
747
|
/** 不朽箴言特有的 AI 聊天 */
|
|
746
748
|
ZeroChatgpt: "zero_chatgpt"
|
|
747
|
-
},
|
|
749
|
+
}, nt = e.string().enum(l).lock(), rt = {
|
|
748
750
|
/** 累计游戏内活跃值 */
|
|
749
751
|
Active: "player_active_points",
|
|
750
752
|
/** 累计登录,单位 人天 */
|
|
@@ -763,14 +765,14 @@ const v = {
|
|
|
763
765
|
PlayerLevel: "player_level",
|
|
764
766
|
/** 活动道具累计获取 */
|
|
765
767
|
EventItems: "event_items"
|
|
766
|
-
},
|
|
768
|
+
}, te = e.string().enum(rt).lock(), at = {
|
|
767
769
|
/** 官方上传 */
|
|
768
770
|
System: "system",
|
|
769
771
|
/** 用户投稿 */
|
|
770
772
|
UserSubmission: "user_submission",
|
|
771
773
|
/** 投票入围 */
|
|
772
774
|
Shortlisted: "shortlisted"
|
|
773
|
-
},
|
|
775
|
+
}, ot = e.string().enum(at).lock(), d = {
|
|
774
776
|
/** 未获得奖励 */
|
|
775
777
|
Ineligible: "ineligible",
|
|
776
778
|
/** 奖励未领取 */
|
|
@@ -781,7 +783,7 @@ const v = {
|
|
|
781
783
|
Failed: "failed",
|
|
782
784
|
/** 奖励已发货 */
|
|
783
785
|
Delivered: "delivered"
|
|
784
|
-
},
|
|
786
|
+
}, zr = e.string().enum(d).lock(), it = {
|
|
785
787
|
/** 奖励未领取 */
|
|
786
788
|
Unclaimed: d.Unclaimed,
|
|
787
789
|
/** 奖励已领取 */
|
|
@@ -790,7 +792,7 @@ const v = {
|
|
|
790
792
|
Failed: d.Failed,
|
|
791
793
|
/** 奖励已发货 */
|
|
792
794
|
Delivered: d.Delivered
|
|
793
|
-
},
|
|
795
|
+
}, ne = e.string().enum(it).lock(), st = {
|
|
794
796
|
/** 未获得奖励 */
|
|
795
797
|
Ineligible: d.Ineligible,
|
|
796
798
|
/** 奖励未领取 */
|
|
@@ -801,17 +803,17 @@ const v = {
|
|
|
801
803
|
Failed: d.Failed,
|
|
802
804
|
/** 奖励已发货 */
|
|
803
805
|
Delivered: d.Delivered
|
|
804
|
-
},
|
|
806
|
+
}, P = e.string().enum(st).lock(), ct = {
|
|
805
807
|
/** 玩法产出奖励 */
|
|
806
808
|
Output: "output",
|
|
807
809
|
/** 玩法参与奖励 */
|
|
808
810
|
Engage: "engage"
|
|
809
|
-
},
|
|
811
|
+
}, E = e.string().enum(ct).lock(), lt = {
|
|
810
812
|
/** 私有队伍 */
|
|
811
813
|
Private: "private",
|
|
812
814
|
/** 公开队伍 */
|
|
813
815
|
Public: "public"
|
|
814
|
-
},
|
|
816
|
+
}, mt = e.string().enum(lt).lock(), f = {
|
|
815
817
|
/** 未知状态 */
|
|
816
818
|
Unknown: "unknown",
|
|
817
819
|
/** 等待开奖 */
|
|
@@ -822,7 +824,7 @@ const v = {
|
|
|
822
824
|
Claimed: "claimed",
|
|
823
825
|
/** 领奖失败 */
|
|
824
826
|
Fail: "fail"
|
|
825
|
-
},
|
|
827
|
+
}, Jr = e.string().enum(f).lock(), ut = {
|
|
826
828
|
/** 发起组队 */
|
|
827
829
|
Assemble: "assemble",
|
|
828
830
|
/** 加入队伍 */
|
|
@@ -833,78 +835,88 @@ const v = {
|
|
|
833
835
|
ChangeVisibility: "change_visibility",
|
|
834
836
|
/** 查询组队信息 */
|
|
835
837
|
Query: "query"
|
|
836
|
-
},
|
|
838
|
+
}, Zr = e.string().enum(ut).lock(), dt = {
|
|
837
839
|
/** 查询抽奖券 */
|
|
838
840
|
Query: "query",
|
|
839
841
|
/** 开奖 */
|
|
840
842
|
Draw: "draw",
|
|
841
843
|
/** 领奖 */
|
|
842
844
|
Claim: "claim"
|
|
843
|
-
},
|
|
845
|
+
}, Xr = e.string().enum(dt).lock(), re = {
|
|
844
846
|
/** 将所有队员的进度值求和,作为队伍进度值 */
|
|
845
847
|
Sum: "sum",
|
|
846
848
|
/** 以进度值倒序排名第 N 的队员的进度值,作为队伍进度值。如果队伍人数不足 N,则队伍进度值为 0。N 的值来自于配置字段 top_n */
|
|
847
849
|
TopN: "top_n"
|
|
848
|
-
},
|
|
850
|
+
}, Yr = e.string().enum(re).lock(), gt = e.string().enum(re).optional().lock(), pt = {
|
|
851
|
+
/** 尚未结算 */
|
|
852
|
+
None: "none",
|
|
853
|
+
/** 获胜奖励 */
|
|
854
|
+
Winner: "winner",
|
|
855
|
+
/** 安慰奖励 */
|
|
856
|
+
Consolation: "consolation"
|
|
857
|
+
}, _t = e.string().enum(pt).lock(), bt = e.string().enum(k(v, "GiftCode", "LotteryTicket")), $ = e.object({
|
|
849
858
|
reward_item_id: e.number(),
|
|
850
859
|
reward_amount: e.number(),
|
|
851
860
|
reward_item_name: e.string(),
|
|
852
861
|
reward_item_icon_url: e.string(),
|
|
853
862
|
reward_item_desc: e.string().optional(),
|
|
854
|
-
reward_item_type:
|
|
863
|
+
reward_item_type: bt,
|
|
855
864
|
reward_item_rating: e.number()
|
|
856
|
-
}).lock(),
|
|
865
|
+
}).lock(), yt = e.object({
|
|
857
866
|
engage_count: e.number(),
|
|
858
867
|
rewards: e.array($)
|
|
859
|
-
}).lock(),
|
|
868
|
+
}).lock(), ft = e.union(
|
|
860
869
|
e.object({
|
|
861
870
|
feature_reward_type: e.string().enum("every"),
|
|
862
871
|
reward_details: e.array($)
|
|
863
872
|
}),
|
|
864
873
|
e.object({
|
|
865
874
|
feature_reward_type: e.string().enum("regular"),
|
|
866
|
-
reward_details: e.array(
|
|
875
|
+
reward_details: e.array(yt)
|
|
867
876
|
})
|
|
868
|
-
).satisfies().lock(),
|
|
877
|
+
).satisfies().lock(), M = e.object({
|
|
878
|
+
item_id: e.number(),
|
|
879
|
+
item_amount: e.number()
|
|
880
|
+
}), m = e.object({
|
|
869
881
|
feature_name: e.string(),
|
|
870
882
|
feature_id: e.number(),
|
|
871
883
|
description: e.string(),
|
|
872
|
-
cycle:
|
|
884
|
+
cycle: tt,
|
|
873
885
|
cycle_limit: e.number(),
|
|
874
886
|
limit: e.number(),
|
|
875
887
|
since: e.number(),
|
|
876
888
|
until: e.number(),
|
|
877
|
-
engage_account:
|
|
878
|
-
feature_rewards:
|
|
889
|
+
engage_account: We,
|
|
890
|
+
feature_rewards: ft.clone().optional(),
|
|
879
891
|
sort: e.number().optional()
|
|
880
|
-
}),
|
|
892
|
+
}), ht = l.Cashback, wt = e.object({
|
|
881
893
|
...m.shape,
|
|
882
|
-
feature_type: e.string().enum(
|
|
894
|
+
feature_type: e.string().enum(ht),
|
|
883
895
|
config: e.object({
|
|
884
896
|
order_start_time: e.number(),
|
|
885
897
|
order_end_time: e.number(),
|
|
886
898
|
claim_rewards_start_time: e.number(),
|
|
887
899
|
claim_rewards_end_time: e.number()
|
|
888
900
|
})
|
|
889
|
-
}),
|
|
901
|
+
}), kt = l.CheckIn, vt = e.object({
|
|
890
902
|
...m.shape,
|
|
891
|
-
feature_type: e.string().enum(
|
|
892
|
-
}),
|
|
903
|
+
feature_type: e.string().enum(kt)
|
|
904
|
+
}), Vt = l.ClaimActivationKey, Ct = e.object({
|
|
893
905
|
...m.shape,
|
|
894
|
-
feature_type: e.string().enum(
|
|
895
|
-
}),
|
|
906
|
+
feature_type: e.string().enum(Vt)
|
|
907
|
+
}), Rt = l.ClaimRewards, jt = e.object({
|
|
896
908
|
...m.shape,
|
|
897
|
-
feature_type: e.string().enum(
|
|
898
|
-
}),
|
|
909
|
+
feature_type: e.string().enum(Rt)
|
|
910
|
+
}), Tt = l.Comment, qt = e.object({
|
|
899
911
|
...m.shape,
|
|
900
|
-
feature_type: e.string().enum(
|
|
912
|
+
feature_type: e.string().enum(Tt),
|
|
901
913
|
config: e.object({
|
|
902
914
|
comments: e.array(e.string()),
|
|
903
915
|
send_rate: e.number()
|
|
904
916
|
})
|
|
905
|
-
}),
|
|
917
|
+
}), xt = l.Follow, St = e.object({
|
|
906
918
|
...m.shape,
|
|
907
|
-
feature_type: e.string().enum(
|
|
919
|
+
feature_type: e.string().enum(xt),
|
|
908
920
|
config: e.object({
|
|
909
921
|
platform: e.string(),
|
|
910
922
|
platform_icon: e.string().optional(),
|
|
@@ -912,66 +924,66 @@ const v = {
|
|
|
912
924
|
qr_code_url: e.string().optional(),
|
|
913
925
|
platform_desc: e.string().optional()
|
|
914
926
|
})
|
|
915
|
-
}),
|
|
927
|
+
}), Lt = l.GiftCode, Pt = e.object({
|
|
916
928
|
name: e.string(),
|
|
917
929
|
icon_url: e.string(),
|
|
918
930
|
count: e.number()
|
|
919
|
-
}),
|
|
931
|
+
}), Et = e.object({
|
|
920
932
|
...m.shape,
|
|
921
|
-
feature_type: e.string().enum(
|
|
933
|
+
feature_type: e.string().enum(Lt),
|
|
922
934
|
config: e.object({
|
|
923
|
-
gift_items: e.array(
|
|
935
|
+
gift_items: e.array(Pt),
|
|
924
936
|
mp_url: e.string().optional(),
|
|
925
937
|
mp_qrcode_url: e.string().optional()
|
|
926
938
|
})
|
|
927
|
-
}),
|
|
939
|
+
}), $t = l.Invite, Ft = e.object({
|
|
928
940
|
...m.shape,
|
|
929
|
-
feature_type: e.string().enum(
|
|
941
|
+
feature_type: e.string().enum($t),
|
|
930
942
|
config: e.object({
|
|
931
943
|
share_url: e.string()
|
|
932
944
|
})
|
|
933
|
-
}),
|
|
945
|
+
}), Ut = l.InvitedRegister, It = e.object({
|
|
934
946
|
...m.shape,
|
|
935
|
-
feature_type: e.string().enum(
|
|
936
|
-
}),
|
|
947
|
+
feature_type: e.string().enum(Ut)
|
|
948
|
+
}), Dt = e.string().enum(k(v, "GiftCode", "LotteryTicket")), At = l.Lottery, Gt = e.object({
|
|
937
949
|
reward_item_id: e.number(),
|
|
938
950
|
reward_item_name: e.string(),
|
|
939
|
-
reward_item_type:
|
|
951
|
+
reward_item_type: Dt,
|
|
940
952
|
reward_item_icon_url: e.string(),
|
|
941
953
|
reward_item_desc: e.string().optional(),
|
|
942
954
|
reward_amount: e.number(),
|
|
943
955
|
reward_remaining_stock: e.number()
|
|
944
|
-
}),
|
|
956
|
+
}), Ot = e.object({
|
|
945
957
|
...m.shape,
|
|
946
|
-
feature_type: e.string().enum(
|
|
958
|
+
feature_type: e.string().enum(At),
|
|
947
959
|
config: e.object({
|
|
948
960
|
consume_item_id: e.number(),
|
|
949
961
|
consume_item_name: e.string(),
|
|
950
962
|
consume_item_icon_url: e.string(),
|
|
951
963
|
consume_item_count: e.array(e.number()),
|
|
952
964
|
consume_item_desc: e.string().optional(),
|
|
953
|
-
rewards: e.array(
|
|
965
|
+
rewards: e.array(Gt)
|
|
954
966
|
})
|
|
955
|
-
}),
|
|
967
|
+
}), Nt = l.LotteryDraw, Qt = e.object({
|
|
956
968
|
...m.shape,
|
|
957
|
-
feature_type: e.string().enum(
|
|
969
|
+
feature_type: e.string().enum(Nt),
|
|
958
970
|
config: e.object({
|
|
959
971
|
draw_not_before: e.number(),
|
|
960
972
|
draw_not_after: e.number()
|
|
961
973
|
})
|
|
962
|
-
}),
|
|
974
|
+
}), Bt = l.Preregister, Mt = e.object({
|
|
963
975
|
...m.shape,
|
|
964
|
-
feature_type: e.string().enum(
|
|
965
|
-
}),
|
|
976
|
+
feature_type: e.string().enum(Bt)
|
|
977
|
+
}), Kt = l.Quest, Ht = e.object({
|
|
966
978
|
...m.shape,
|
|
967
|
-
feature_type: e.string().enum(
|
|
979
|
+
feature_type: e.string().enum(Kt),
|
|
968
980
|
config: e.object({
|
|
969
|
-
objective:
|
|
981
|
+
objective: te,
|
|
970
982
|
completion_value: e.number(),
|
|
971
983
|
team: e.object({
|
|
972
984
|
feature_id: e.number().optional(),
|
|
973
985
|
completion_value: e.number(),
|
|
974
|
-
progress_algorithm:
|
|
986
|
+
progress_algorithm: gt,
|
|
975
987
|
top_n: e.number().optional()
|
|
976
988
|
}).optional(),
|
|
977
989
|
config: e.object({
|
|
@@ -981,38 +993,38 @@ const v = {
|
|
|
981
993
|
event_item_id: e.number().optional()
|
|
982
994
|
}).optional()
|
|
983
995
|
})
|
|
984
|
-
}),
|
|
996
|
+
}), zt = l.Register, Jt = e.object({
|
|
985
997
|
...m.shape,
|
|
986
|
-
feature_type: e.string().enum(
|
|
987
|
-
}),
|
|
998
|
+
feature_type: e.string().enum(zt)
|
|
999
|
+
}), Zt = l.Share, Xt = e.object({
|
|
988
1000
|
...m.shape,
|
|
989
|
-
feature_type: e.string().enum(
|
|
1001
|
+
feature_type: e.string().enum(Zt),
|
|
990
1002
|
config: e.object({
|
|
991
1003
|
share_platform: e.string(),
|
|
992
1004
|
jump_url: e.string().optional(),
|
|
993
1005
|
icon_url: e.string().optional()
|
|
994
1006
|
})
|
|
995
|
-
}),
|
|
1007
|
+
}), Yt = l.Subscribe, Wt = e.object({
|
|
996
1008
|
...m.shape,
|
|
997
|
-
feature_type: e.string().enum(
|
|
1009
|
+
feature_type: e.string().enum(Yt),
|
|
998
1010
|
config: e.object({
|
|
999
1011
|
weixin_template_ids: e.array(e.string())
|
|
1000
1012
|
})
|
|
1001
|
-
}),
|
|
1013
|
+
}), en = l.Survey, tn = e.object({
|
|
1002
1014
|
...m.shape,
|
|
1003
|
-
feature_type: e.string().enum(
|
|
1015
|
+
feature_type: e.string().enum(en),
|
|
1004
1016
|
config: e.object({
|
|
1005
1017
|
survey_id: e.string(),
|
|
1006
1018
|
survey_url: e.string()
|
|
1007
1019
|
})
|
|
1008
|
-
}),
|
|
1020
|
+
}), nn = l.Team, rn = e.object({
|
|
1009
1021
|
...m.shape,
|
|
1010
|
-
feature_type: e.string().enum(
|
|
1022
|
+
feature_type: e.string().enum(nn),
|
|
1011
1023
|
config: e.object({
|
|
1012
1024
|
max_members: e.number().min(1),
|
|
1013
1025
|
min_members: e.number().min(1)
|
|
1014
1026
|
})
|
|
1015
|
-
}),
|
|
1027
|
+
}), an = l.Vote, on = e.object({
|
|
1016
1028
|
sn: e.string(),
|
|
1017
1029
|
name: e.string(),
|
|
1018
1030
|
img_urls: e.array(e.string()).optional(),
|
|
@@ -1022,132 +1034,157 @@ const v = {
|
|
|
1022
1034
|
amount: e.number(),
|
|
1023
1035
|
finalists: e.bool(),
|
|
1024
1036
|
last_vote_time: e.number()
|
|
1025
|
-
}),
|
|
1037
|
+
}), sn = e.object({
|
|
1026
1038
|
...m.shape,
|
|
1027
|
-
feature_type: e.string().enum(
|
|
1039
|
+
feature_type: e.string().enum(an),
|
|
1028
1040
|
config: e.object({
|
|
1029
1041
|
vote_feature_ids: e.array(e.number()),
|
|
1030
1042
|
submission_feature_ids: e.array(e.number()),
|
|
1031
1043
|
finalists_amount: e.number(),
|
|
1032
|
-
source:
|
|
1033
|
-
options: e.array(
|
|
1044
|
+
source: ot,
|
|
1045
|
+
options: e.array(on),
|
|
1034
1046
|
rewards: e.array($)
|
|
1035
1047
|
})
|
|
1036
|
-
}),
|
|
1048
|
+
}), cn = l.Vote2, ln = e.object({
|
|
1049
|
+
candidate_id: e.string(),
|
|
1050
|
+
display_name: e.string(),
|
|
1051
|
+
images: e.array(e.string()).optional(),
|
|
1052
|
+
videos: e.array(e.string()).optional(),
|
|
1053
|
+
description: e.string().optional(),
|
|
1054
|
+
jump_url: e.string(),
|
|
1055
|
+
base_votes: e.number(),
|
|
1056
|
+
votes_multiplier: e.number()
|
|
1057
|
+
}), mn = e.object({
|
|
1037
1058
|
...m.shape,
|
|
1038
|
-
feature_type: e.string().enum(
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1059
|
+
feature_type: e.string().enum(cn),
|
|
1060
|
+
config: e.object({
|
|
1061
|
+
vote_item_id: e.number().optional(),
|
|
1062
|
+
candidates: e.array(ln),
|
|
1063
|
+
vote_since: e.number(),
|
|
1064
|
+
vote_until: e.number(),
|
|
1065
|
+
rewards_since: e.number(),
|
|
1066
|
+
rewards_until: e.number(),
|
|
1067
|
+
winner_strategy: e.string().enum("votes", "manual"),
|
|
1068
|
+
total_winners: e.number(),
|
|
1069
|
+
winner_rewards: e.array(M).optional(),
|
|
1070
|
+
consolation_rewards: e.array(M).optional()
|
|
1071
|
+
})
|
|
1072
|
+
}), un = l.ZeroChatgpt, dn = e.object({
|
|
1073
|
+
...m.shape,
|
|
1074
|
+
feature_type: e.string().enum(un)
|
|
1075
|
+
}), gn = e.union(
|
|
1076
|
+
wt,
|
|
1077
|
+
vt,
|
|
1078
|
+
jt,
|
|
1079
|
+
qt,
|
|
1045
1080
|
St,
|
|
1046
|
-
Pt,
|
|
1047
1081
|
Et,
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1082
|
+
Ft,
|
|
1083
|
+
It,
|
|
1084
|
+
Ot,
|
|
1085
|
+
Qt,
|
|
1086
|
+
Mt,
|
|
1087
|
+
Ht,
|
|
1088
|
+
Jt,
|
|
1089
|
+
Xt,
|
|
1090
|
+
Wt,
|
|
1091
|
+
tn,
|
|
1057
1092
|
rn,
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1093
|
+
sn,
|
|
1094
|
+
mn,
|
|
1095
|
+
Ct,
|
|
1096
|
+
dn
|
|
1097
|
+
).key("feature_type").satisfies(), pn = e.object({
|
|
1061
1098
|
event_name: e.string(),
|
|
1062
1099
|
rules: e.string(),
|
|
1063
1100
|
since: e.number(),
|
|
1064
1101
|
until: e.number(),
|
|
1065
1102
|
visit_count: e.number().optional(),
|
|
1066
|
-
features: e.array(
|
|
1067
|
-
}).lock(),
|
|
1068
|
-
order_total_amount:
|
|
1069
|
-
cashback_total_amount:
|
|
1070
|
-
game_item_count:
|
|
1071
|
-
}),
|
|
1103
|
+
features: e.array(gn)
|
|
1104
|
+
}).lock(), q = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()), _n = e.object({
|
|
1105
|
+
order_total_amount: q,
|
|
1106
|
+
cashback_total_amount: q,
|
|
1107
|
+
game_item_count: q
|
|
1108
|
+
}), bn = e.object({
|
|
1072
1109
|
activation_key: e.string().disallow("")
|
|
1073
|
-
}),
|
|
1110
|
+
}), yn = e.object({
|
|
1074
1111
|
gift_code: e.string()
|
|
1075
|
-
}),
|
|
1112
|
+
}), fn = e.object({
|
|
1076
1113
|
user_id: e.string(),
|
|
1077
1114
|
name: e.string().optional(),
|
|
1078
1115
|
avatar_url: e.string().optional()
|
|
1079
|
-
}),
|
|
1116
|
+
}), hn = e.object({
|
|
1080
1117
|
lottery_count: e.number()
|
|
1081
|
-
}),
|
|
1118
|
+
}), V = e.object({
|
|
1082
1119
|
reward_id: e.number(),
|
|
1083
1120
|
reward_item_id: e.number(),
|
|
1084
|
-
reward_source:
|
|
1121
|
+
reward_source: E,
|
|
1085
1122
|
reward_item_name: e.string(),
|
|
1086
|
-
reward_item_type:
|
|
1123
|
+
reward_item_type: W,
|
|
1087
1124
|
reward_item_icon_url: e.string(),
|
|
1088
1125
|
reward_item_desc: e.string().optional(),
|
|
1089
1126
|
reward_item_rating: e.number(),
|
|
1090
1127
|
reward_amount: e.number(),
|
|
1091
|
-
reward_status:
|
|
1128
|
+
reward_status: P,
|
|
1092
1129
|
event_id: e.number(),
|
|
1093
1130
|
event_name: e.string(),
|
|
1094
1131
|
feature_id: e.number(),
|
|
1095
1132
|
engagement_id: e.number(),
|
|
1096
|
-
feature_type:
|
|
1133
|
+
feature_type: nt,
|
|
1097
1134
|
receive_time: e.number(),
|
|
1098
1135
|
extra_data: e.record(e.unknown()).optional()
|
|
1099
|
-
}),
|
|
1136
|
+
}), wn = e.string().enum(f.Unknown, f.Pending), kn = e.union(
|
|
1100
1137
|
e.object({
|
|
1101
1138
|
ticket: e.string(),
|
|
1102
|
-
status:
|
|
1139
|
+
status: wn
|
|
1103
1140
|
}),
|
|
1104
1141
|
e.object({
|
|
1105
1142
|
ticket: e.string(),
|
|
1106
1143
|
status: e.string().enum(k(f, "Unknown", "Pending")),
|
|
1107
|
-
reward:
|
|
1144
|
+
reward: V
|
|
1108
1145
|
})
|
|
1109
|
-
).satisfies(),
|
|
1110
|
-
tickets: e.array(
|
|
1111
|
-
}),
|
|
1146
|
+
).satisfies(), vn = e.object({
|
|
1147
|
+
tickets: e.array(kn)
|
|
1148
|
+
}), Vn = e.object({
|
|
1112
1149
|
platforms: e.array(e.string())
|
|
1113
|
-
}),
|
|
1150
|
+
}), ae = e.object({
|
|
1114
1151
|
role_name: e.string(),
|
|
1115
1152
|
is_leader: e.bool(),
|
|
1116
1153
|
is_myself: e.bool().optional(),
|
|
1117
1154
|
progress: e.number().optional()
|
|
1118
|
-
}).lock(),
|
|
1119
|
-
objective:
|
|
1155
|
+
}).lock(), Cn = e.object({
|
|
1156
|
+
objective: te,
|
|
1120
1157
|
progress: e.number(),
|
|
1121
1158
|
completion_value: e.number().optional(),
|
|
1122
1159
|
team: e.object({
|
|
1123
1160
|
progress: e.number(),
|
|
1124
1161
|
completion_value: e.number().optional(),
|
|
1125
|
-
players: e.array(
|
|
1162
|
+
players: e.array(ae)
|
|
1126
1163
|
}).optional()
|
|
1127
|
-
}),
|
|
1164
|
+
}), Rn = e.object({
|
|
1128
1165
|
progress: e.number(),
|
|
1129
1166
|
team: e.object({
|
|
1130
1167
|
progress: e.number(),
|
|
1131
|
-
team_members: e.array(
|
|
1168
|
+
team_members: e.array(ae).optional()
|
|
1132
1169
|
}).optional()
|
|
1133
|
-
}),
|
|
1170
|
+
}), jn = e.object({
|
|
1134
1171
|
platform: e.string()
|
|
1135
|
-
}),
|
|
1172
|
+
}), Tn = e.object({
|
|
1136
1173
|
weixin_openid: e.string()
|
|
1137
|
-
}),
|
|
1174
|
+
}), qn = e.object({
|
|
1138
1175
|
serial_number: e.number()
|
|
1139
|
-
}),
|
|
1176
|
+
}), xn = e.object({
|
|
1140
1177
|
team_code: e.string(),
|
|
1141
1178
|
leader_name: e.string(),
|
|
1142
1179
|
total_members: e.number()
|
|
1143
|
-
}),
|
|
1180
|
+
}), Wr = e.object({
|
|
1144
1181
|
is_leader: e.bool(),
|
|
1145
1182
|
is_myself: e.bool().optional(),
|
|
1146
1183
|
role_name: e.string(),
|
|
1147
1184
|
server_name: e.string()
|
|
1148
|
-
}),
|
|
1185
|
+
}), Sn = e.object({
|
|
1149
1186
|
team_code: e.string(),
|
|
1150
|
-
visibility:
|
|
1187
|
+
visibility: mt,
|
|
1151
1188
|
members: e.array(
|
|
1152
1189
|
e.object({
|
|
1153
1190
|
is_leader: e.bool(),
|
|
@@ -1155,14 +1192,27 @@ const v = {
|
|
|
1155
1192
|
server_name: e.string()
|
|
1156
1193
|
})
|
|
1157
1194
|
)
|
|
1158
|
-
}),
|
|
1195
|
+
}), Ln = e.object({
|
|
1159
1196
|
option_sn: e.string()
|
|
1160
|
-
}),
|
|
1197
|
+
}), Pn = e.object({
|
|
1198
|
+
candidate_id: e.string(),
|
|
1199
|
+
total_votes: e.number().optional(),
|
|
1200
|
+
my_votes: e.number().optional(),
|
|
1201
|
+
votes: e.number().optional()
|
|
1202
|
+
}), En = e.object({
|
|
1203
|
+
rewards_type: _t,
|
|
1204
|
+
rewards: e.array(V).optional()
|
|
1205
|
+
}), $n = e.object({
|
|
1206
|
+
candidate_id: e.string(),
|
|
1207
|
+
is_winner: e.bool(),
|
|
1208
|
+
total_votes: e.number(),
|
|
1209
|
+
my_votes: e.number()
|
|
1210
|
+
}), Fn = e.object({
|
|
1161
1211
|
role: e.string(),
|
|
1162
1212
|
content: e.string()
|
|
1163
|
-
}),
|
|
1164
|
-
conversations: e.array(
|
|
1165
|
-
}),
|
|
1213
|
+
}), Un = e.object({
|
|
1214
|
+
conversations: e.array(Fn)
|
|
1215
|
+
}), In = e.object({
|
|
1166
1216
|
user_id: e.string(),
|
|
1167
1217
|
name: e.string(),
|
|
1168
1218
|
avatar_url: e.string(),
|
|
@@ -1170,50 +1220,51 @@ const v = {
|
|
|
1170
1220
|
video_note: e.number(),
|
|
1171
1221
|
created_at: e.number()
|
|
1172
1222
|
}), F = e.union(
|
|
1173
|
-
yn,
|
|
1174
|
-
gn,
|
|
1175
|
-
vn,
|
|
1176
|
-
dn,
|
|
1177
|
-
wn,
|
|
1178
|
-
Rn,
|
|
1179
|
-
kn,
|
|
1180
|
-
ln,
|
|
1181
|
-
un,
|
|
1182
1223
|
Vn,
|
|
1224
|
+
hn,
|
|
1225
|
+
qn,
|
|
1183
1226
|
fn,
|
|
1184
|
-
|
|
1185
|
-
|
|
1227
|
+
jn,
|
|
1228
|
+
Ln,
|
|
1229
|
+
Pn,
|
|
1186
1230
|
Tn,
|
|
1231
|
+
_n,
|
|
1232
|
+
yn,
|
|
1233
|
+
Sn,
|
|
1234
|
+
Cn,
|
|
1235
|
+
vn,
|
|
1236
|
+
bn,
|
|
1237
|
+
Un,
|
|
1187
1238
|
e.custom(
|
|
1188
1239
|
"EmptyObject",
|
|
1189
1240
|
(i) => w(i) && Object.keys(i).length === 0
|
|
1190
1241
|
)
|
|
1191
|
-
).satisfies().lock(),
|
|
1242
|
+
).satisfies().lock(), Dn = e.object({
|
|
1192
1243
|
reward_id: e.number(),
|
|
1193
1244
|
reward_item_id: e.number(),
|
|
1194
|
-
reward_item_type:
|
|
1245
|
+
reward_item_type: ee,
|
|
1195
1246
|
reward_count: e.number(),
|
|
1196
|
-
reward_status:
|
|
1197
|
-
reward_source:
|
|
1247
|
+
reward_status: ne,
|
|
1248
|
+
reward_source: E,
|
|
1198
1249
|
reward_item_name: e.string(),
|
|
1199
1250
|
reward_item_icon_url: e.string(),
|
|
1200
1251
|
reward_item_desc: e.string().optional(),
|
|
1201
1252
|
reward_item_rating: e.number(),
|
|
1202
1253
|
receive_time: e.number(),
|
|
1203
1254
|
extra_data: e.union(...F.validators, e.record(e.unknown())).satisfies().optional()
|
|
1204
|
-
}),
|
|
1255
|
+
}), An = e.object({
|
|
1205
1256
|
reward_id: e.number(),
|
|
1206
1257
|
reward_item_id: e.number(),
|
|
1207
1258
|
reward_item_name: e.string(),
|
|
1208
|
-
reward_item_type:
|
|
1259
|
+
reward_item_type: ee,
|
|
1209
1260
|
reward_item_icon_url: e.string(),
|
|
1210
1261
|
reward_item_desc: e.string().optional(),
|
|
1211
1262
|
reward_item_rating: e.number(),
|
|
1212
1263
|
reward_amount: e.number(),
|
|
1213
|
-
reward_status:
|
|
1214
|
-
reward_source:
|
|
1264
|
+
reward_status: ne,
|
|
1265
|
+
reward_source: E,
|
|
1215
1266
|
extra_data: e.record(e.unknown()).optional()
|
|
1216
|
-
}),
|
|
1267
|
+
}), Gn = e.object({
|
|
1217
1268
|
engagement_id: e.number(),
|
|
1218
1269
|
user_id: e.string(),
|
|
1219
1270
|
event_id: e.number(),
|
|
@@ -1223,15 +1274,15 @@ const v = {
|
|
|
1223
1274
|
server_id: e.string().optional(),
|
|
1224
1275
|
role_id: e.string().optional(),
|
|
1225
1276
|
created_at: e.number(),
|
|
1226
|
-
rewards: e.array(
|
|
1227
|
-
}).lock(),
|
|
1277
|
+
rewards: e.array(Dn).optional()
|
|
1278
|
+
}).lock(), On = e.object({
|
|
1228
1279
|
allowed: e.bool(),
|
|
1229
1280
|
registered: e.bool()
|
|
1230
|
-
}),
|
|
1281
|
+
}), Nn = e.object({
|
|
1231
1282
|
feature_id: e.number(),
|
|
1232
1283
|
can_engage: e.bool(),
|
|
1233
1284
|
has_unclaimed_rewards: e.bool()
|
|
1234
|
-
}),
|
|
1285
|
+
}), Qn = e.object({
|
|
1235
1286
|
engagement_id: e.number(),
|
|
1236
1287
|
engagement: e.object({
|
|
1237
1288
|
engagement_id: e.number(),
|
|
@@ -1239,37 +1290,41 @@ const v = {
|
|
|
1239
1290
|
feature_id: e.number(),
|
|
1240
1291
|
data: F.clone().optional()
|
|
1241
1292
|
}).optional(),
|
|
1242
|
-
rewards: e.array(
|
|
1293
|
+
rewards: e.array(An).optional(),
|
|
1243
1294
|
scan: e.bool().optional()
|
|
1244
|
-
}),
|
|
1295
|
+
}), Bn = e.object({
|
|
1245
1296
|
reward_id: e.number(),
|
|
1246
|
-
reward_status:
|
|
1247
|
-
}),
|
|
1248
|
-
engagements: e.union(e.array(
|
|
1249
|
-
}),
|
|
1250
|
-
status: e.array(
|
|
1251
|
-
}),
|
|
1297
|
+
reward_status: P
|
|
1298
|
+
}), Mn = e.guard(pn), Kn = e.guard(On), x = s({ count: e.number() }), Hn = s({ first_visit: e.bool() }), zn = s({
|
|
1299
|
+
engagements: e.union(e.array(In), e.array(xn))
|
|
1300
|
+
}), Jn = s({
|
|
1301
|
+
status: e.array(Nn)
|
|
1302
|
+
}), Zn = s({
|
|
1252
1303
|
engagements_counts: e.record(e.number())
|
|
1253
|
-
}),
|
|
1254
|
-
engagements: e.array(
|
|
1304
|
+
}), Xn = s({
|
|
1305
|
+
engagements: e.array(Gn),
|
|
1255
1306
|
next_token: e.string().optional()
|
|
1256
|
-
}),
|
|
1257
|
-
claimed_items: e.array(
|
|
1258
|
-
}),
|
|
1259
|
-
rewards: e.array(
|
|
1260
|
-
}),
|
|
1261
|
-
reward_status:
|
|
1262
|
-
}),
|
|
1263
|
-
user_rewards: e.array(
|
|
1307
|
+
}), Yn = e.guard(Qn), Wn = s({
|
|
1308
|
+
claimed_items: e.array(Bn)
|
|
1309
|
+
}), er = s({
|
|
1310
|
+
rewards: e.array(V)
|
|
1311
|
+
}), tr = s({
|
|
1312
|
+
reward_status: P
|
|
1313
|
+
}), nr = s({
|
|
1314
|
+
user_rewards: e.array(V),
|
|
1264
1315
|
next_token: e.string().optional()
|
|
1265
|
-
}),
|
|
1316
|
+
}), rr = s({
|
|
1266
1317
|
scene: e.string()
|
|
1267
|
-
}),
|
|
1318
|
+
}), ar = s({
|
|
1268
1319
|
params: e.string()
|
|
1269
|
-
}),
|
|
1320
|
+
}), or = s({
|
|
1270
1321
|
img: e.string()
|
|
1271
|
-
}),
|
|
1272
|
-
|
|
1322
|
+
}), ir = e.guard(Rn), sr = e.guard(En), cr = e.guard(
|
|
1323
|
+
e.object({
|
|
1324
|
+
candidate_votes: e.array($n)
|
|
1325
|
+
})
|
|
1326
|
+
);
|
|
1327
|
+
class ea {
|
|
1273
1328
|
token;
|
|
1274
1329
|
event = 0;
|
|
1275
1330
|
req;
|
|
@@ -1282,7 +1337,7 @@ class Qr {
|
|
|
1282
1337
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=OWGSPF3Ysl
|
|
1283
1338
|
*/
|
|
1284
1339
|
async verifyMobileAllowed(t, n, r) {
|
|
1285
|
-
const { data: a } = await this.req.get("verify-mobile-allowed",
|
|
1340
|
+
const { data: a } = await this.req.get("verify-mobile-allowed", Kn, {
|
|
1286
1341
|
...r,
|
|
1287
1342
|
params: { game_id: t, mobile: n }
|
|
1288
1343
|
});
|
|
@@ -1294,7 +1349,7 @@ class Qr {
|
|
|
1294
1349
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=wFXxtdNKPm
|
|
1295
1350
|
*/
|
|
1296
1351
|
async getConfig(t) {
|
|
1297
|
-
const { data: n } = await this.req.get(`event/${this.event}/event-config`,
|
|
1352
|
+
const { data: n } = await this.req.get(`event/${this.event}/event-config`, Mn, t);
|
|
1298
1353
|
return n;
|
|
1299
1354
|
}
|
|
1300
1355
|
/**
|
|
@@ -1303,7 +1358,7 @@ class Qr {
|
|
|
1303
1358
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=ejPOcWMvT1
|
|
1304
1359
|
*/
|
|
1305
1360
|
async getEngagementsUserCount(t, n) {
|
|
1306
|
-
const { data: r } = await this.req.get(`event/${this.event}/feature-engagement-count`,
|
|
1361
|
+
const { data: r } = await this.req.get(`event/${this.event}/feature-engagement-count`, x, {
|
|
1307
1362
|
...n,
|
|
1308
1363
|
params: { feature_id: t, type: "user" }
|
|
1309
1364
|
});
|
|
@@ -1315,7 +1370,7 @@ class Qr {
|
|
|
1315
1370
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=ejPOcWMvT1
|
|
1316
1371
|
*/
|
|
1317
1372
|
async getEngagementsCount(t, n) {
|
|
1318
|
-
const { data: r } = await this.req.get(`event/${this.event}/feature-engagement-count`,
|
|
1373
|
+
const { data: r } = await this.req.get(`event/${this.event}/feature-engagement-count`, x, {
|
|
1319
1374
|
...n,
|
|
1320
1375
|
params: { feature_id: t, type: "engagement" }
|
|
1321
1376
|
});
|
|
@@ -1329,7 +1384,7 @@ class Qr {
|
|
|
1329
1384
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=THtZ4ewIQW
|
|
1330
1385
|
*/
|
|
1331
1386
|
async getEngagements(t, n) {
|
|
1332
|
-
const { data: r } = await this.req.get(`event/${this.event}/feature-engagements`,
|
|
1387
|
+
const { data: r } = await this.req.get(`event/${this.event}/feature-engagements`, zn, {
|
|
1333
1388
|
...n,
|
|
1334
1389
|
params: { feature_id: t }
|
|
1335
1390
|
});
|
|
@@ -1345,7 +1400,7 @@ class Qr {
|
|
|
1345
1400
|
const { data: r, code: a, message: o } = await this.req.post(
|
|
1346
1401
|
`event/${this.event}/visit`,
|
|
1347
1402
|
c(t || {}),
|
|
1348
|
-
|
|
1403
|
+
Hn,
|
|
1349
1404
|
n
|
|
1350
1405
|
);
|
|
1351
1406
|
return r ?? {
|
|
@@ -1358,13 +1413,11 @@ class Qr {
|
|
|
1358
1413
|
*
|
|
1359
1414
|
* 💡活动下包含 engage_account_type 为 role_id 的玩法时,需要提供 server_id 和 role_id
|
|
1360
1415
|
*
|
|
1361
|
-
* 🔕请求静默进行,无消息提示
|
|
1362
|
-
*
|
|
1363
1416
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=WzX5BrMNpL
|
|
1364
1417
|
*/
|
|
1365
1418
|
async getUserFeatureStatus(t, n) {
|
|
1366
1419
|
if (!await this.token.autoLogin()) return [];
|
|
1367
|
-
const { data: r } = await this.req.get("event/user-feature-status",
|
|
1420
|
+
const { data: r } = await this.req.get("event/user-feature-status", Jn, {
|
|
1368
1421
|
...n,
|
|
1369
1422
|
message: !1,
|
|
1370
1423
|
params: c({ ...t, event_id: this.event })
|
|
@@ -1378,7 +1431,7 @@ class Qr {
|
|
|
1378
1431
|
*/
|
|
1379
1432
|
async getUserEngagementCount(t, n) {
|
|
1380
1433
|
if (!await this.token.autoLogin()) return {};
|
|
1381
|
-
const { data: r } = await this.req.get("event/user-engagements-count",
|
|
1434
|
+
const { data: r } = await this.req.get("event/user-engagements-count", Zn, {
|
|
1382
1435
|
message: !1,
|
|
1383
1436
|
params: c({ ...n, event_id: this.event, feature_id: t })
|
|
1384
1437
|
});
|
|
@@ -1397,7 +1450,7 @@ class Qr {
|
|
|
1397
1450
|
engagements: [],
|
|
1398
1451
|
next_token: ""
|
|
1399
1452
|
};
|
|
1400
|
-
const { data: a } = await this.req.get("event/user-engagements",
|
|
1453
|
+
const { data: a } = await this.req.get("event/user-engagements", Xn, {
|
|
1401
1454
|
...r,
|
|
1402
1455
|
params: c({
|
|
1403
1456
|
max_results: 20,
|
|
@@ -1429,13 +1482,13 @@ class Qr {
|
|
|
1429
1482
|
engagement: n,
|
|
1430
1483
|
...r
|
|
1431
1484
|
}),
|
|
1432
|
-
|
|
1485
|
+
Yn,
|
|
1433
1486
|
a
|
|
1434
1487
|
);
|
|
1435
1488
|
return o ?? {
|
|
1436
1489
|
message: p,
|
|
1437
1490
|
error: g
|
|
1438
|
-
//
|
|
1491
|
+
// 您的道具数量不足,请先获取足够的道具
|
|
1439
1492
|
};
|
|
1440
1493
|
}
|
|
1441
1494
|
/**
|
|
@@ -1453,7 +1506,7 @@ class Qr {
|
|
|
1453
1506
|
...t,
|
|
1454
1507
|
server_id: t.server_id ? +t.server_id : void 0
|
|
1455
1508
|
}),
|
|
1456
|
-
|
|
1509
|
+
Wn,
|
|
1457
1510
|
n
|
|
1458
1511
|
);
|
|
1459
1512
|
return r?.claimed_items || {
|
|
@@ -1474,7 +1527,7 @@ class Qr {
|
|
|
1474
1527
|
...t,
|
|
1475
1528
|
server_id: t.server_id ? +t.server_id : void 0
|
|
1476
1529
|
}),
|
|
1477
|
-
|
|
1530
|
+
er,
|
|
1478
1531
|
n
|
|
1479
1532
|
);
|
|
1480
1533
|
return r?.rewards || {
|
|
@@ -1492,7 +1545,7 @@ class Qr {
|
|
|
1492
1545
|
const { data: r, code: a, message: o } = await this.req.post(
|
|
1493
1546
|
"event/claim-weixin-hongbao",
|
|
1494
1547
|
{ reward_id: t },
|
|
1495
|
-
|
|
1548
|
+
tr,
|
|
1496
1549
|
n
|
|
1497
1550
|
);
|
|
1498
1551
|
return r || {
|
|
@@ -1533,7 +1586,7 @@ class Qr {
|
|
|
1533
1586
|
const { data: r } = await this.req.post(
|
|
1534
1587
|
"event/user-rewards",
|
|
1535
1588
|
c({ max_results: 20, ...t, event_id: this.event }),
|
|
1536
|
-
|
|
1589
|
+
nr,
|
|
1537
1590
|
n
|
|
1538
1591
|
);
|
|
1539
1592
|
return {
|
|
@@ -1548,7 +1601,7 @@ class Qr {
|
|
|
1548
1601
|
*/
|
|
1549
1602
|
async getUserItemCount(t, n) {
|
|
1550
1603
|
if (!await this.token.autoLogin()) return null;
|
|
1551
|
-
const { data: r } = await this.req.get(`event/${this.event}/user-item-count`,
|
|
1604
|
+
const { data: r } = await this.req.get(`event/${this.event}/user-item-count`, x, {
|
|
1552
1605
|
...n,
|
|
1553
1606
|
params: { item_id: t }
|
|
1554
1607
|
});
|
|
@@ -1581,7 +1634,7 @@ class Qr {
|
|
|
1581
1634
|
*/
|
|
1582
1635
|
async getUnlimitQrcodeScene(t, n) {
|
|
1583
1636
|
if (!await this.token.autoLogin()) return null;
|
|
1584
|
-
const { data: r } = await this.req.get("event/unlimit-qrcode-scene",
|
|
1637
|
+
const { data: r } = await this.req.get("event/unlimit-qrcode-scene", rr, {
|
|
1585
1638
|
...n,
|
|
1586
1639
|
params: { params: t }
|
|
1587
1640
|
});
|
|
@@ -1595,7 +1648,7 @@ class Qr {
|
|
|
1595
1648
|
* @param scene - 小程序码 scene 值
|
|
1596
1649
|
*/
|
|
1597
1650
|
async getParamsByQrcodeScene(t, n) {
|
|
1598
|
-
const { data: r } = await this.req.get("event/params-by-qrcode-scene",
|
|
1651
|
+
const { data: r } = await this.req.get("event/params-by-qrcode-scene", ar, {
|
|
1599
1652
|
...n,
|
|
1600
1653
|
params: { scene: t }
|
|
1601
1654
|
});
|
|
@@ -1611,19 +1664,19 @@ class Qr {
|
|
|
1611
1664
|
const { data: r } = await this.req.post(
|
|
1612
1665
|
"event/unlimit-qrcode",
|
|
1613
1666
|
c(t),
|
|
1614
|
-
|
|
1667
|
+
or,
|
|
1615
1668
|
n
|
|
1616
1669
|
);
|
|
1617
1670
|
return r?.img ?? null;
|
|
1618
1671
|
}
|
|
1619
1672
|
/**
|
|
1620
|
-
*
|
|
1673
|
+
* 本接口用于获取任务玩法的实时进度数据,支持部分任务进度的查询:累计充值金额 / 累计游戏内活跃值 / 账号等级目标
|
|
1621
1674
|
*
|
|
1622
1675
|
* https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=ZAnm12d3f0
|
|
1623
1676
|
*/
|
|
1624
1677
|
async getQuestProgress(t, n) {
|
|
1625
1678
|
if (!await this.token.autoLogin()) return null;
|
|
1626
|
-
const { data: r, code: a, message: o } = await this.req.get(`event/${this.event}/quest-progress`,
|
|
1679
|
+
const { data: r, code: a, message: o } = await this.req.get(`event/${this.event}/quest-progress`, ir, {
|
|
1627
1680
|
message: !1,
|
|
1628
1681
|
...n,
|
|
1629
1682
|
params: { feature_id: t }
|
|
@@ -1633,13 +1686,44 @@ class Qr {
|
|
|
1633
1686
|
error: a
|
|
1634
1687
|
};
|
|
1635
1688
|
}
|
|
1689
|
+
/**
|
|
1690
|
+
* 领取投票(vote2)玩法获得的奖励
|
|
1691
|
+
*
|
|
1692
|
+
* https://www.kdocs.cn/l/chlVWKom7DzU?linkname=fabGKteIEK
|
|
1693
|
+
*/
|
|
1694
|
+
async claimVote2Rewards(t, n) {
|
|
1695
|
+
if (!await this.token.autoLogin()) return null;
|
|
1696
|
+
const { data: r, code: a, message: o } = await this.req.post(
|
|
1697
|
+
"event/vote2/rewards",
|
|
1698
|
+
{ feature_id: t },
|
|
1699
|
+
sr,
|
|
1700
|
+
n
|
|
1701
|
+
);
|
|
1702
|
+
return r || {
|
|
1703
|
+
message: o,
|
|
1704
|
+
code: a
|
|
1705
|
+
};
|
|
1706
|
+
}
|
|
1707
|
+
/**
|
|
1708
|
+
* 查询投票(vote2)玩法排行榜数据
|
|
1709
|
+
*
|
|
1710
|
+
* https://www.kdocs.cn/l/chlVWKom7DzU?linkname=cYZMVXbP4u
|
|
1711
|
+
*/
|
|
1712
|
+
async getVote2Leaderboard(t, n) {
|
|
1713
|
+
if (!await this.token.autoLogin()) return [];
|
|
1714
|
+
const { data: r } = await this.req.get("event/vote2/leaderboard", cr, {
|
|
1715
|
+
...n,
|
|
1716
|
+
params: { feature_id: t }
|
|
1717
|
+
});
|
|
1718
|
+
return r?.candidate_votes || [];
|
|
1719
|
+
}
|
|
1636
1720
|
}
|
|
1637
|
-
const
|
|
1721
|
+
const lr = {
|
|
1638
1722
|
/** 所有人均可以发帖 */
|
|
1639
1723
|
All: "all",
|
|
1640
1724
|
/** 指定用户可发帖 */
|
|
1641
1725
|
Limit: "limit"
|
|
1642
|
-
},
|
|
1726
|
+
}, mr = e.string().enum(lr).lock(), ur = {
|
|
1643
1727
|
/** 待审核(仅自己可见) */
|
|
1644
1728
|
Pending: "pending",
|
|
1645
1729
|
/** 审核通过 */
|
|
@@ -1648,14 +1732,14 @@ const Yn = {
|
|
|
1648
1732
|
Failed: "failed",
|
|
1649
1733
|
/** 嫌疑(仅自己可见) */
|
|
1650
1734
|
Suspect: "suspect"
|
|
1651
|
-
},
|
|
1735
|
+
}, oe = e.string().enum(ur).lock(), dr = {
|
|
1652
1736
|
/** 系统通知 */
|
|
1653
1737
|
System: "system",
|
|
1654
1738
|
/** 评论我的 */
|
|
1655
1739
|
Comment: "comment",
|
|
1656
1740
|
/** 点赞通知 */
|
|
1657
1741
|
Like: "like"
|
|
1658
|
-
},
|
|
1742
|
+
}, ta = e.string().enum(dr).lock(), u = {
|
|
1659
1743
|
/** 系统通知 */
|
|
1660
1744
|
System: "system",
|
|
1661
1745
|
/** 帖子被置顶 */
|
|
@@ -1680,13 +1764,13 @@ const Yn = {
|
|
|
1680
1764
|
ReplyLiked: "reply_liked",
|
|
1681
1765
|
/** 回复被删除 */
|
|
1682
1766
|
ReplyDeleted: "reply_deleted"
|
|
1683
|
-
},
|
|
1767
|
+
}, gr = e.string().enum(u).lock(), ie = e.object({
|
|
1684
1768
|
forum_id: e.number(),
|
|
1685
1769
|
icon_url: e.string(),
|
|
1686
1770
|
name: e.string(),
|
|
1687
1771
|
tags: e.array(e.string()),
|
|
1688
1772
|
sort: e.number(),
|
|
1689
|
-
mode:
|
|
1773
|
+
mode: mr,
|
|
1690
1774
|
member_ids: e.array(e.number())
|
|
1691
1775
|
}).lock(), U = e.object({
|
|
1692
1776
|
topic_id: e.number(),
|
|
@@ -1697,7 +1781,7 @@ const Yn = {
|
|
|
1697
1781
|
post_num: e.number()
|
|
1698
1782
|
}).lock(), I = e.object({
|
|
1699
1783
|
post_id: e.number(),
|
|
1700
|
-
forum:
|
|
1784
|
+
forum: ie,
|
|
1701
1785
|
posted_by: e.string(),
|
|
1702
1786
|
nickname: e.string(),
|
|
1703
1787
|
avatar_url: e.string(),
|
|
@@ -1713,11 +1797,11 @@ const Yn = {
|
|
|
1713
1797
|
event_ids: e.array(e.number()),
|
|
1714
1798
|
is_pinned: e.bool(),
|
|
1715
1799
|
is_highlighted: e.bool(),
|
|
1716
|
-
status:
|
|
1800
|
+
status: oe,
|
|
1717
1801
|
create_time: e.number()
|
|
1718
|
-
}).lock(),
|
|
1802
|
+
}).lock(), se = e.object({
|
|
1719
1803
|
err_msg: e.string().optional()
|
|
1720
|
-
}).optional().lock(),
|
|
1804
|
+
}).optional().lock(), pr = e.object({
|
|
1721
1805
|
reply_id: e.number(),
|
|
1722
1806
|
reply_content: e.string().optional(),
|
|
1723
1807
|
replied_by: e.string(),
|
|
@@ -1736,7 +1820,7 @@ const Yn = {
|
|
|
1736
1820
|
content: e.string(),
|
|
1737
1821
|
like_num: e.number(),
|
|
1738
1822
|
liked: e.bool(),
|
|
1739
|
-
reply_to:
|
|
1823
|
+
reply_to: pr,
|
|
1740
1824
|
create_time: e.number()
|
|
1741
1825
|
}).lock(), h = e.object({
|
|
1742
1826
|
comment_id: e.number(),
|
|
@@ -1756,21 +1840,21 @@ const Yn = {
|
|
|
1756
1840
|
liked: e.bool(),
|
|
1757
1841
|
image_url: e.string(),
|
|
1758
1842
|
create_time: e.number(),
|
|
1759
|
-
status:
|
|
1843
|
+
status: oe,
|
|
1760
1844
|
replies: e.array(C).optional()
|
|
1761
|
-
}).lock(),
|
|
1845
|
+
}).lock(), _r = e.object({
|
|
1762
1846
|
image_url: e.string(),
|
|
1763
1847
|
upload_url: e.string(),
|
|
1764
1848
|
existed: e.bool()
|
|
1765
1849
|
}).lock(), _ = e.object({
|
|
1766
1850
|
notification_id: e.string(),
|
|
1767
|
-
notification_type:
|
|
1851
|
+
notification_type: gr,
|
|
1768
1852
|
is_read: e.bool(),
|
|
1769
1853
|
create_time: e.number(),
|
|
1770
1854
|
origin_user_id: e.string(),
|
|
1771
1855
|
origin_user_name: e.string(),
|
|
1772
1856
|
origin_user_avatar_url: e.string()
|
|
1773
|
-
}).lock(),
|
|
1857
|
+
}).lock(), br = e.object({
|
|
1774
1858
|
system_message_subject: e.string(),
|
|
1775
1859
|
system_message_content: e.string()
|
|
1776
1860
|
}).lock(), D = e.object({
|
|
@@ -1778,17 +1862,17 @@ const Yn = {
|
|
|
1778
1862
|
post_subject: e.string(),
|
|
1779
1863
|
post_summary: e.string(),
|
|
1780
1864
|
post_image_url: e.string()
|
|
1781
|
-
}).lock(),
|
|
1865
|
+
}).lock(), R = e.object({
|
|
1782
1866
|
comment_id: e.number(),
|
|
1783
1867
|
comment_content: e.string()
|
|
1784
1868
|
}).lock(), A = e.object({
|
|
1785
1869
|
reply_id: e.number(),
|
|
1786
1870
|
reply_content: e.string()
|
|
1787
|
-
}).lock(),
|
|
1871
|
+
}).lock(), yr = e.object({
|
|
1788
1872
|
..._.shape,
|
|
1789
|
-
...
|
|
1873
|
+
...br.shape,
|
|
1790
1874
|
notification_type: e.string().enum(u.System)
|
|
1791
|
-
}),
|
|
1875
|
+
}), fr = e.object({
|
|
1792
1876
|
..._.shape,
|
|
1793
1877
|
...D.shape,
|
|
1794
1878
|
notification_type: e.string().enum(
|
|
@@ -1797,68 +1881,68 @@ const Yn = {
|
|
|
1797
1881
|
u.PostDeleted,
|
|
1798
1882
|
u.PostLiked
|
|
1799
1883
|
)
|
|
1800
|
-
}),
|
|
1884
|
+
}), hr = e.object({
|
|
1801
1885
|
..._.shape,
|
|
1802
1886
|
...D.shape,
|
|
1803
|
-
...
|
|
1887
|
+
...R.shape,
|
|
1804
1888
|
notification_type: e.string().enum(u.PostCommented)
|
|
1805
|
-
}),
|
|
1889
|
+
}), wr = e.object({
|
|
1806
1890
|
..._.shape,
|
|
1807
|
-
...
|
|
1891
|
+
...R.shape,
|
|
1808
1892
|
...A.shape,
|
|
1809
1893
|
notification_type: e.string().enum(u.CommentReplied)
|
|
1810
|
-
}),
|
|
1894
|
+
}), kr = e.object({
|
|
1811
1895
|
..._.shape,
|
|
1812
|
-
...
|
|
1896
|
+
...R.shape,
|
|
1813
1897
|
...D.shape,
|
|
1814
1898
|
notification_type: e.string().enum(u.CommentLiked, u.CommentDeleted)
|
|
1815
|
-
}),
|
|
1899
|
+
}), vr = e.object({
|
|
1816
1900
|
..._.shape,
|
|
1817
1901
|
...A.shape,
|
|
1818
1902
|
notification_type: e.string().enum(u.ReplyReplied),
|
|
1819
1903
|
comment_id: e.number(),
|
|
1820
1904
|
reply_to_reply_id: e.number(),
|
|
1821
1905
|
reply_to_reply_content: e.string()
|
|
1822
|
-
}),
|
|
1906
|
+
}), Vr = e.object({
|
|
1823
1907
|
..._.shape,
|
|
1824
1908
|
...A.shape,
|
|
1825
|
-
...
|
|
1909
|
+
...R.shape,
|
|
1826
1910
|
notification_type: e.string().enum(u.ReplyLiked, u.ReplyDeleted)
|
|
1827
|
-
}),
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
).satisfies().lock(),
|
|
1911
|
+
}), Cr = e.union(
|
|
1912
|
+
yr,
|
|
1913
|
+
fr,
|
|
1914
|
+
hr,
|
|
1915
|
+
wr,
|
|
1916
|
+
kr,
|
|
1917
|
+
vr,
|
|
1918
|
+
Vr
|
|
1919
|
+
).satisfies().lock(), Rr = s({ forums: e.array(ie) }), jr = s({ topics: e.array(U) }), Tr = s({ topic: U }), qr = s({ post: I }), K = s({
|
|
1836
1920
|
posts: e.array(I),
|
|
1837
1921
|
next_token: e.string().optional()
|
|
1838
|
-
}),
|
|
1922
|
+
}), xr = s({
|
|
1839
1923
|
post: I.clone().optional(),
|
|
1840
|
-
antispam:
|
|
1841
|
-
}),
|
|
1924
|
+
antispam: se.clone().optional()
|
|
1925
|
+
}), Sr = s({
|
|
1842
1926
|
replies: e.array(C),
|
|
1843
1927
|
next_token: e.string().optional()
|
|
1844
|
-
}),
|
|
1928
|
+
}), Lr = s({ reply: C }), Pr = s({
|
|
1845
1929
|
reply: C.clone().optional(),
|
|
1846
|
-
antispam:
|
|
1847
|
-
}),
|
|
1930
|
+
antispam: se.clone().optional()
|
|
1931
|
+
}), Er = s({ comment: h }), $r = s({
|
|
1848
1932
|
comments: e.array(h),
|
|
1849
1933
|
next_token: e.string().optional()
|
|
1850
|
-
}),
|
|
1934
|
+
}), Fr = s({
|
|
1851
1935
|
comment: h.clone().optional(),
|
|
1852
1936
|
antispam: h.clone().optional()
|
|
1853
|
-
}),
|
|
1854
|
-
notifications: e.array(
|
|
1937
|
+
}), Ur = e.guard(_r), Ir = s({
|
|
1938
|
+
notifications: e.array(Cr),
|
|
1855
1939
|
next_token: e.string().optional()
|
|
1856
|
-
}),
|
|
1940
|
+
}), Dr = s({
|
|
1857
1941
|
system: e.number(),
|
|
1858
1942
|
comment: e.number(),
|
|
1859
1943
|
like: e.number()
|
|
1860
1944
|
});
|
|
1861
|
-
class
|
|
1945
|
+
class na {
|
|
1862
1946
|
token;
|
|
1863
1947
|
req;
|
|
1864
1948
|
constructor(t) {
|
|
@@ -1870,7 +1954,7 @@ class Mr {
|
|
|
1870
1954
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=QaqUa2K0z0
|
|
1871
1955
|
*/
|
|
1872
1956
|
async getForums(t) {
|
|
1873
|
-
const { data: n } = await this.req.get("community/forums",
|
|
1957
|
+
const { data: n } = await this.req.get("community/forums", Rr, t);
|
|
1874
1958
|
return n?.forums || [];
|
|
1875
1959
|
}
|
|
1876
1960
|
/**
|
|
@@ -1879,7 +1963,7 @@ class Mr {
|
|
|
1879
1963
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=mIwpymAQom
|
|
1880
1964
|
*/
|
|
1881
1965
|
async getTopics(t) {
|
|
1882
|
-
const { data: n } = await this.req.get("community/topics",
|
|
1966
|
+
const { data: n } = await this.req.get("community/topics", jr, t);
|
|
1883
1967
|
return n?.topics || [];
|
|
1884
1968
|
}
|
|
1885
1969
|
/**
|
|
@@ -1888,7 +1972,7 @@ class Mr {
|
|
|
1888
1972
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Jvw7xMK31K
|
|
1889
1973
|
*/
|
|
1890
1974
|
async getTopic(t, n) {
|
|
1891
|
-
const { data: r, code: a } = await this.req.get("community/topic",
|
|
1975
|
+
const { data: r, code: a } = await this.req.get("community/topic", Tr, {
|
|
1892
1976
|
...n,
|
|
1893
1977
|
params: { topic_id: t }
|
|
1894
1978
|
});
|
|
@@ -1900,7 +1984,7 @@ class Mr {
|
|
|
1900
1984
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=XKI9lDVrPq
|
|
1901
1985
|
*/
|
|
1902
1986
|
async getPosts(t, n) {
|
|
1903
|
-
const { data: r, code: a, message: o } = await this.req.get("community/posts",
|
|
1987
|
+
const { data: r, code: a, message: o } = await this.req.get("community/posts", K, {
|
|
1904
1988
|
...n,
|
|
1905
1989
|
params: c(t)
|
|
1906
1990
|
});
|
|
@@ -1915,7 +1999,7 @@ class Mr {
|
|
|
1915
1999
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=yXubbZuDlC
|
|
1916
2000
|
*/
|
|
1917
2001
|
async getPinnedPosts(t, n, r, a) {
|
|
1918
|
-
const { data: o, code: g, message: p } = await this.req.get("community/pinned-posts",
|
|
2002
|
+
const { data: o, code: g, message: p } = await this.req.get("community/pinned-posts", K, {
|
|
1919
2003
|
...a,
|
|
1920
2004
|
params: c({ forum_id: t, max_results: n, next_token: r })
|
|
1921
2005
|
});
|
|
@@ -1930,7 +2014,7 @@ class Mr {
|
|
|
1930
2014
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=hj1AZy5rcP
|
|
1931
2015
|
*/
|
|
1932
2016
|
async getPost(t, n) {
|
|
1933
|
-
const { data: r, code: a, message: o } = await this.req.get("community/post",
|
|
2017
|
+
const { data: r, code: a, message: o } = await this.req.get("community/post", qr, {
|
|
1934
2018
|
...n,
|
|
1935
2019
|
params: { post_id: t }
|
|
1936
2020
|
});
|
|
@@ -1948,7 +2032,7 @@ class Mr {
|
|
|
1948
2032
|
const { data: r, code: a, message: o } = await this.req.post(
|
|
1949
2033
|
"community/post",
|
|
1950
2034
|
c(t),
|
|
1951
|
-
|
|
2035
|
+
xr,
|
|
1952
2036
|
n
|
|
1953
2037
|
);
|
|
1954
2038
|
return r ?? {
|
|
@@ -1962,7 +2046,7 @@ class Mr {
|
|
|
1962
2046
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=djKbX7lFdp
|
|
1963
2047
|
*/
|
|
1964
2048
|
async getComments(t, n) {
|
|
1965
|
-
const { data: r, code: a, message: o } = await this.req.get("community/comments",
|
|
2049
|
+
const { data: r, code: a, message: o } = await this.req.get("community/comments", $r, {
|
|
1966
2050
|
...n,
|
|
1967
2051
|
params: c(t)
|
|
1968
2052
|
});
|
|
@@ -1977,7 +2061,7 @@ class Mr {
|
|
|
1977
2061
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=RIc7oxVGae
|
|
1978
2062
|
*/
|
|
1979
2063
|
async getComment(t, n) {
|
|
1980
|
-
const { data: r, code: a, message: o } = await this.req.get("community/comment",
|
|
2064
|
+
const { data: r, code: a, message: o } = await this.req.get("community/comment", Er, {
|
|
1981
2065
|
...n,
|
|
1982
2066
|
params: { comment_id: t }
|
|
1983
2067
|
});
|
|
@@ -1996,7 +2080,7 @@ class Mr {
|
|
|
1996
2080
|
const { data: r, code: a, message: o } = await this.req.post(
|
|
1997
2081
|
"community/comment",
|
|
1998
2082
|
c(t),
|
|
1999
|
-
|
|
2083
|
+
Fr,
|
|
2000
2084
|
n
|
|
2001
2085
|
);
|
|
2002
2086
|
return r ?? {
|
|
@@ -2010,7 +2094,7 @@ class Mr {
|
|
|
2010
2094
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=sVKBbY83MY
|
|
2011
2095
|
*/
|
|
2012
2096
|
async getReplies(t, n) {
|
|
2013
|
-
const { data: r } = await this.req.get("community/replies",
|
|
2097
|
+
const { data: r } = await this.req.get("community/replies", Sr, {
|
|
2014
2098
|
...n,
|
|
2015
2099
|
params: c({ max_results: 20, ...t })
|
|
2016
2100
|
});
|
|
@@ -2025,7 +2109,7 @@ class Mr {
|
|
|
2025
2109
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=kxhcSXD3MG
|
|
2026
2110
|
*/
|
|
2027
2111
|
async getReply(t, n) {
|
|
2028
|
-
const { data: r, code: a, message: o } = await this.req.get("community/reply",
|
|
2112
|
+
const { data: r, code: a, message: o } = await this.req.get("community/reply", Lr, {
|
|
2029
2113
|
...n,
|
|
2030
2114
|
params: { reply_id: t }
|
|
2031
2115
|
});
|
|
@@ -2044,7 +2128,7 @@ class Mr {
|
|
|
2044
2128
|
const { data: r, code: a, message: o } = await this.req.post(
|
|
2045
2129
|
"community/reply",
|
|
2046
2130
|
c(t),
|
|
2047
|
-
|
|
2131
|
+
Pr,
|
|
2048
2132
|
n
|
|
2049
2133
|
);
|
|
2050
2134
|
return r ?? {
|
|
@@ -2095,7 +2179,7 @@ class Mr {
|
|
|
2095
2179
|
*/
|
|
2096
2180
|
async getMediaPresignedUrl(t, n) {
|
|
2097
2181
|
await this.token.autoLogin();
|
|
2098
|
-
const { data: r } = await this.req.get("community/media-presign-url",
|
|
2182
|
+
const { data: r } = await this.req.get("community/media-presign-url", Ur, {
|
|
2099
2183
|
...n,
|
|
2100
2184
|
params: t
|
|
2101
2185
|
});
|
|
@@ -2110,7 +2194,7 @@ class Mr {
|
|
|
2110
2194
|
*/
|
|
2111
2195
|
async getNotifications(t, n) {
|
|
2112
2196
|
await this.token.autoLogin();
|
|
2113
|
-
const { data: r } = await this.req.get("community/notifications",
|
|
2197
|
+
const { data: r } = await this.req.get("community/notifications", Ir, {
|
|
2114
2198
|
...n,
|
|
2115
2199
|
params: c({ max_results: 20, ...t })
|
|
2116
2200
|
});
|
|
@@ -2128,7 +2212,7 @@ class Mr {
|
|
|
2128
2212
|
if (!await this.token.autoLogin()) return null;
|
|
2129
2213
|
const { data: n } = await this.req.get(
|
|
2130
2214
|
"community/unread-notifications-count",
|
|
2131
|
-
|
|
2215
|
+
Dr,
|
|
2132
2216
|
t
|
|
2133
2217
|
);
|
|
2134
2218
|
return n;
|
|
@@ -2144,17 +2228,17 @@ class Mr {
|
|
|
2144
2228
|
return r;
|
|
2145
2229
|
}
|
|
2146
2230
|
}
|
|
2147
|
-
const
|
|
2231
|
+
const Ar = s({
|
|
2148
2232
|
nonce_str: e.string(),
|
|
2149
2233
|
timestamp: e.number(),
|
|
2150
2234
|
signature: e.string()
|
|
2151
2235
|
});
|
|
2152
|
-
var
|
|
2153
|
-
function
|
|
2236
|
+
var Gr = /* @__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))(Gr || {});
|
|
2237
|
+
function S(i) {
|
|
2154
2238
|
return w(i, "open_id", "union_id", "weixin_token");
|
|
2155
2239
|
}
|
|
2156
|
-
const
|
|
2157
|
-
class
|
|
2240
|
+
const H = "wx_login_cache";
|
|
2241
|
+
class ra {
|
|
2158
2242
|
token;
|
|
2159
2243
|
$appid;
|
|
2160
2244
|
req;
|
|
@@ -2185,11 +2269,11 @@ class Kr {
|
|
|
2185
2269
|
* 也可以直接调用 login 方法,并传入 weixin code 的读取函数
|
|
2186
2270
|
*/
|
|
2187
2271
|
async getLoginCache() {
|
|
2188
|
-
const t = this.token.storage.get(
|
|
2272
|
+
const t = this.token.storage.get(H);
|
|
2189
2273
|
if (!t)
|
|
2190
2274
|
return null;
|
|
2191
|
-
const n =
|
|
2192
|
-
return
|
|
2275
|
+
const n = be(t);
|
|
2276
|
+
return S(n) ? (this.token.weixinToken = n.weixin_token, await this.token.autoLogin(), n) : null;
|
|
2193
2277
|
}
|
|
2194
2278
|
/**
|
|
2195
2279
|
* 小程序页面微信静默登录,获取 weixinToken / open_id / union_id。
|
|
@@ -2214,13 +2298,13 @@ class Kr {
|
|
|
2214
2298
|
const n = await this.getLoginCache();
|
|
2215
2299
|
if (n)
|
|
2216
2300
|
return n;
|
|
2217
|
-
const r = await
|
|
2301
|
+
const r = await he(), { data: a, code: o, message: g } = await this.req.post(
|
|
2218
2302
|
"weixin/login",
|
|
2219
2303
|
{ code: r, appid: this.appid },
|
|
2220
|
-
|
|
2304
|
+
S,
|
|
2221
2305
|
{ ...t, message: !1 }
|
|
2222
2306
|
);
|
|
2223
|
-
return a && (this.token.weixinToken = a.weixin_token, this.token.storage.set(
|
|
2307
|
+
return a && (this.token.weixinToken = a.weixin_token, this.token.storage.set(H, JSON.stringify(a))), a ?? {
|
|
2224
2308
|
message: g,
|
|
2225
2309
|
error: o
|
|
2226
2310
|
};
|
|
@@ -2242,11 +2326,11 @@ class Kr {
|
|
|
2242
2326
|
* - snsapi_userinfo 【默认】弹出授权页面,可拿到 openid、union_id、昵称、头像等信息,但用户也可能会拒绝授权
|
|
2243
2327
|
*/
|
|
2244
2328
|
async webLogin(t = "snsapi_userinfo", n) {
|
|
2245
|
-
const r =
|
|
2329
|
+
const r = L("code"), a = Date.now(), o = +L("state");
|
|
2246
2330
|
if (!r || !o || o < a - 1e3 * 60 * 5 || o > a) {
|
|
2247
|
-
const
|
|
2331
|
+
const me = G(["code", "state"]);
|
|
2248
2332
|
location.replace(
|
|
2249
|
-
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(
|
|
2333
|
+
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(me)}&response_type=code&scope=${t}&state=${a}#wechat_redirect`
|
|
2250
2334
|
);
|
|
2251
2335
|
return;
|
|
2252
2336
|
}
|
|
@@ -2259,12 +2343,12 @@ class Kr {
|
|
|
2259
2343
|
"replaceState" in history && history.replaceState({}, "", g);
|
|
2260
2344
|
const {
|
|
2261
2345
|
data: p,
|
|
2262
|
-
code:
|
|
2263
|
-
message:
|
|
2264
|
-
} = await this.req.post("weixin/login", { code: r, appid: this.appid },
|
|
2346
|
+
code: ce,
|
|
2347
|
+
message: le
|
|
2348
|
+
} = await this.req.post("weixin/login", { code: r, appid: this.appid }, S, n);
|
|
2265
2349
|
return p && (this.token.weixinToken = p.weixin_token, await this.token.autoLogin()), p ?? {
|
|
2266
|
-
message:
|
|
2267
|
-
error:
|
|
2350
|
+
message: le,
|
|
2351
|
+
error: ce
|
|
2268
2352
|
};
|
|
2269
2353
|
}
|
|
2270
2354
|
/**
|
|
@@ -2294,7 +2378,7 @@ class Kr {
|
|
|
2294
2378
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=CuWOqxr9Ue
|
|
2295
2379
|
*/
|
|
2296
2380
|
async getJSSDKConfig(t) {
|
|
2297
|
-
const { data: n } = await this.req.get("weixin/offiaccount/jssdk-sign",
|
|
2381
|
+
const { data: n } = await this.req.get("weixin/offiaccount/jssdk-sign", Ar, {
|
|
2298
2382
|
...t,
|
|
2299
2383
|
params: {
|
|
2300
2384
|
appid: this.appid,
|
|
@@ -2310,150 +2394,157 @@ class Kr {
|
|
|
2310
2394
|
}
|
|
2311
2395
|
}
|
|
2312
2396
|
export {
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
je as
|
|
2397
|
+
se as AntispamValidator,
|
|
2398
|
+
Br as AuthToken,
|
|
2399
|
+
$n as CandidateVoteValidator,
|
|
2400
|
+
_n as CashbackEngagementDataValidator,
|
|
2401
|
+
bn as ClaimActivationKeyEngagementDataValidator,
|
|
2402
|
+
st as ClaimRewardStatus,
|
|
2403
|
+
P as ClaimRewardStatusValidator,
|
|
2404
|
+
Bn as ClaimedItemValidator,
|
|
2405
|
+
Z as ClubAddressValidator,
|
|
2406
|
+
Kr as ClubApi,
|
|
2407
|
+
X as ClubBenefitSummaryValidator,
|
|
2408
|
+
Ae as ClubBenefitValidator,
|
|
2409
|
+
je as ClubCreditChangeScene,
|
|
2410
|
+
Te as ClubCreditChangeSceneValidator,
|
|
2326
2411
|
Ce as ClubCreditChangeType,
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2412
|
+
Re as ClubCreditChangeTypeValidator,
|
|
2413
|
+
De as ClubCreditLogValidator,
|
|
2414
|
+
Le as ClubGlobalConfigValidator,
|
|
2415
|
+
qe as ClubItemType,
|
|
2416
|
+
z as ClubItemTypeValidator,
|
|
2417
|
+
Pe as ClubPlayerValidator,
|
|
2418
|
+
Y as ClubProductValidator,
|
|
2419
|
+
xe as ClubRedemptionStatus,
|
|
2420
|
+
Se as ClubRedemptionStatusValidator,
|
|
2421
|
+
Ie as ClubUserCreditValidator,
|
|
2422
|
+
Ue as ClubUserProfileValidator,
|
|
2423
|
+
In as CommentEngagementValidator,
|
|
2339
2424
|
h as CommentValidator,
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
Ye as
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
Ct as
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
St as
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
rn as
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2425
|
+
M as CommonRewardItemValidator,
|
|
2426
|
+
na as CommunityApi,
|
|
2427
|
+
Ye as EngageAccountType,
|
|
2428
|
+
We as EngageAccountTypeValidator,
|
|
2429
|
+
Qn as EngageResponseValidator,
|
|
2430
|
+
An as EngageRewardValidator,
|
|
2431
|
+
ea as EventApi,
|
|
2432
|
+
pn as EventConfigValidator,
|
|
2433
|
+
wt as EventFeatureConfigOfCashbackValidator,
|
|
2434
|
+
vt as EventFeatureConfigOfCheckInValidator,
|
|
2435
|
+
Ct as EventFeatureConfigOfClaimActivationKeyValidator,
|
|
2436
|
+
jt as EventFeatureConfigOfClaimRewardsValidator,
|
|
2437
|
+
qt as EventFeatureConfigOfCommentValidator,
|
|
2438
|
+
St as EventFeatureConfigOfFollowValidator,
|
|
2439
|
+
Et as EventFeatureConfigOfGiftCodeValidator,
|
|
2440
|
+
Ft as EventFeatureConfigOfInviteValidator,
|
|
2441
|
+
It as EventFeatureConfigOfInvitedRegisterValidator,
|
|
2442
|
+
Qt as EventFeatureConfigOfLotteryDrawValidator,
|
|
2443
|
+
Ot as EventFeatureConfigOfLotteryValidator,
|
|
2444
|
+
Mt as EventFeatureConfigOfPreregisterValidator,
|
|
2445
|
+
Ht as EventFeatureConfigOfQuestValidator,
|
|
2446
|
+
Jt as EventFeatureConfigOfRegisterValidator,
|
|
2447
|
+
Xt as EventFeatureConfigOfShareValidator,
|
|
2448
|
+
Wt as EventFeatureConfigOfSubscribeValidator,
|
|
2449
|
+
tn as EventFeatureConfigOfSurveyValidator,
|
|
2450
|
+
rn as EventFeatureConfigOfTeamValidator,
|
|
2451
|
+
mn as EventFeatureConfigOfVote2Validator,
|
|
2452
|
+
sn as EventFeatureConfigOfVoteValidator,
|
|
2453
|
+
gn as EventFeatureConfigValidator,
|
|
2454
|
+
et as EventPeriodType,
|
|
2455
|
+
tt as EventPeriodTypeValidator,
|
|
2369
2456
|
$ as EventRewardItemConfigValidator,
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2457
|
+
Oe as ExtraGameRewardValidator,
|
|
2458
|
+
Ge as ExtraPhysicalShipmentValidator,
|
|
2459
|
+
ft as FeatureRewardValidator,
|
|
2373
2460
|
l as FeatureType,
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2461
|
+
nt as FeatureTypeValidator,
|
|
2462
|
+
lr as ForumMode,
|
|
2463
|
+
mr as ForumModeValidator,
|
|
2464
|
+
ie as ForumValidator,
|
|
2378
2465
|
v as GamerItemType,
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2466
|
+
W as GamerItemTypeValidator,
|
|
2467
|
+
ve as Gender,
|
|
2468
|
+
Ve as GenderValidator,
|
|
2469
|
+
yn as GiftCodeEngagementDataValidator,
|
|
2470
|
+
fn as InviteEngagementDataValidator,
|
|
2471
|
+
dt as LotteryDrawAction,
|
|
2472
|
+
Xr as LotteryDrawActionValidator,
|
|
2473
|
+
vn as LotteryDrawEngagementDataValidator,
|
|
2474
|
+
hn as LotteryEngagementDataValidator,
|
|
2388
2475
|
f as LotteryTicketStatus,
|
|
2389
|
-
|
|
2476
|
+
Jr as LotteryTicketStatusValidator,
|
|
2390
2477
|
_ as NotificationBaseValidator,
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2478
|
+
dr as NotificationCategory,
|
|
2479
|
+
ta as NotificationCategoryValidator,
|
|
2480
|
+
wr as NotificationCommentReplyValidator,
|
|
2481
|
+
kr as NotificationCommentValidator,
|
|
2482
|
+
R as NotificationPayloadCommentValidator,
|
|
2396
2483
|
D as NotificationPayloadPostValidator,
|
|
2397
2484
|
A as NotificationPayloadReplyValidator,
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2485
|
+
br as NotificationPayloadSystemValidator,
|
|
2486
|
+
hr as NotificationPostCommentValidator,
|
|
2487
|
+
fr as NotificationPostValidator,
|
|
2488
|
+
vr as NotificationReplyRepliedValidator,
|
|
2489
|
+
Vr as NotificationReplyValidator,
|
|
2490
|
+
yr as NotificationSystemValidator,
|
|
2404
2491
|
u as NotificationType,
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2492
|
+
gr as NotificationTypeValidator,
|
|
2493
|
+
Cr as NotificationValidator,
|
|
2494
|
+
Fe as PlayerRoleCardValidator,
|
|
2495
|
+
J as PlayerRoleValidator,
|
|
2496
|
+
ur as PostStatus,
|
|
2497
|
+
oe as PostStatusValidator,
|
|
2411
2498
|
I as PostValidator,
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2499
|
+
Vn as PreregisterEngagementDataValidator,
|
|
2500
|
+
_r as PresignedUrlResponseValidator,
|
|
2501
|
+
Cn as QuestEngagementDataValidator,
|
|
2502
|
+
rt as QuestObjective,
|
|
2503
|
+
te as QuestObjectiveValidator,
|
|
2504
|
+
re as QuestProgressAlgorithm,
|
|
2505
|
+
gt as QuestProgressAlgorithmOptionalValidator,
|
|
2506
|
+
Yr as QuestProgressAlgorithmValidator,
|
|
2507
|
+
Rn as QuestProgressValidator,
|
|
2508
|
+
Mr as RedeemParamsValidator,
|
|
2509
|
+
Ne as RedemptionValidator,
|
|
2510
|
+
yt as RegularRewardValidator,
|
|
2511
|
+
pr as ReplyToValidator,
|
|
2425
2512
|
C as ReplyValidator,
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2513
|
+
Hr as RewardItemType,
|
|
2514
|
+
ee as RewardItemTypeValidator,
|
|
2515
|
+
ct as RewardSource,
|
|
2516
|
+
E as RewardSourceValidator,
|
|
2430
2517
|
d as RewardStatus,
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2518
|
+
it as RewardStatusSuffix,
|
|
2519
|
+
ne as RewardStatusSuffixValidator,
|
|
2520
|
+
zr as RewardStatusValidator,
|
|
2521
|
+
Dn as RewardValidator,
|
|
2435
2522
|
$e as RoleBaseInfoValidator,
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2523
|
+
Ee as ServerBaseInfoValidator,
|
|
2524
|
+
jn as ShareEngagementDataValidator,
|
|
2525
|
+
qn as SurveyEngagementDataValidator,
|
|
2526
|
+
ut as TeamAction,
|
|
2527
|
+
Zr as TeamActionValidator,
|
|
2528
|
+
Sn as TeamEngagementDataValidator,
|
|
2529
|
+
xn as TeamEngagementValidator,
|
|
2530
|
+
Wr as TeamMemberValidator,
|
|
2531
|
+
lt as TeamVisibility,
|
|
2532
|
+
mt as TeamVisibilityValidator,
|
|
2446
2533
|
U as TopicValidator,
|
|
2447
2534
|
F as UserEngagementDataValidator,
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2535
|
+
Gn as UserEngagementValidator,
|
|
2536
|
+
Nn as UserFeatureStatusValidator,
|
|
2537
|
+
V as UserRewardValidator,
|
|
2538
|
+
On as VerifyMobileResultValidator,
|
|
2539
|
+
En as Vote2ClaimRewardsResponseValidator,
|
|
2540
|
+
Pn as Vote2EngagementDataValidator,
|
|
2541
|
+
pt as Vote2RewardType,
|
|
2542
|
+
_t as Vote2RewardTypeValidator,
|
|
2543
|
+
Ln as VoteEngagementDataValidator,
|
|
2544
|
+
at as VoteOptionSource,
|
|
2545
|
+
ot as VoteOptionSourceValidator,
|
|
2546
|
+
ra as WeixinApi,
|
|
2547
|
+
Tn as WeixinSubscribeEngagementDataValidator,
|
|
2548
|
+
Gr as WeixinWebLoginErrorCode,
|
|
2549
|
+
Ar as isWeixinSignResponse
|
|
2459
2550
|
};
|