@seayoo-web/gamer-api 2.6.0 → 2.7.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 +402 -398
- package/package.json +10 -8
- package/types/src/club.d.ts +4 -1
- package/types/src/club.define.d.ts +18 -18
- package/types/src/club.enums.d.ts +6 -6
- package/types/src/community.define.d.ts +21 -21
- package/types/src/community.enums.d.ts +5 -5
- package/types/src/event.config/feature.base.d.ts +1 -1
- package/types/src/event.config/feature.cashback.d.ts +1 -1
- package/types/src/event.config/feature.checkIn.d.ts +1 -1
- package/types/src/event.config/feature.claimActivationKey.d.ts +1 -1
- package/types/src/event.config/feature.claimRewards.d.ts +1 -1
- package/types/src/event.config/feature.comment.d.ts +1 -1
- package/types/src/event.config/feature.d.ts +1 -1
- package/types/src/event.config/feature.follow.d.ts +1 -1
- package/types/src/event.config/feature.giftcode.d.ts +1 -1
- package/types/src/event.config/feature.invite.d.ts +1 -1
- package/types/src/event.config/feature.invitedRegister.d.ts +1 -1
- package/types/src/event.config/feature.lottery.d.ts +3 -3
- package/types/src/event.config/feature.lotteryDraw.d.ts +1 -1
- package/types/src/event.config/feature.preregister.d.ts +1 -1
- package/types/src/event.config/feature.quest.d.ts +1 -1
- package/types/src/event.config/feature.register.d.ts +1 -1
- package/types/src/event.config/feature.share.d.ts +1 -1
- package/types/src/event.config/feature.subscribe.d.ts +1 -1
- package/types/src/event.config/feature.survey.d.ts +1 -1
- package/types/src/event.config/feature.team.d.ts +1 -1
- package/types/src/event.config/feature.vote.d.ts +1 -1
- package/types/src/event.config/feature.zeroChatgpt.d.ts +1 -1
- package/types/src/event.config/index.d.ts +1 -1
- package/types/src/event.config/reward.d.ts +6 -6
- package/types/src/event.d.ts +2 -2
- package/types/src/event.define.d.ts +4 -4
- package/types/src/event.engage/engage.cashback.d.ts +1 -1
- package/types/src/event.engage/engage.claimActivationKey.d.ts +1 -1
- package/types/src/event.engage/engage.comment.d.ts +1 -1
- package/types/src/event.engage/engage.d.ts +5 -5
- package/types/src/event.engage/engage.giftcode.d.ts +1 -1
- package/types/src/event.engage/engage.invite.d.ts +1 -1
- package/types/src/event.engage/engage.lottery.d.ts +1 -1
- package/types/src/event.engage/engage.lotteryDraw.d.ts +3 -3
- package/types/src/event.engage/engage.lotteryDraw.reward.d.ts +1 -1
- package/types/src/event.engage/engage.preregister.d.ts +1 -1
- package/types/src/event.engage/engage.quest.d.ts +1 -1
- package/types/src/event.engage/engage.share.d.ts +1 -1
- package/types/src/event.engage/engage.subscribe.d.ts +1 -1
- package/types/src/event.engage/engage.survey.d.ts +1 -1
- package/types/src/event.engage/engage.team.d.ts +3 -3
- package/types/src/event.engage/engage.vote.d.ts +1 -1
- package/types/src/event.engage/engage.zeroChatGPT.d.ts +2 -2
- package/types/src/event.engage/index.d.ts +1 -1
- package/types/src/event.engage/reward.d.ts +2 -2
- package/types/src/event.enums.d.ts +16 -16
package/dist/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { isComboWebView as le } from "@seayoo-web/combo-webview";
|
|
2
|
-
import { isPlainObject as v,
|
|
3
|
-
|
|
2
|
+
import { isPlainObject as v, supportWx as f, useConsole as me, usePromise as de, pruneURL as ge, supportWindow as pe, queryString as E, pruneObject as c, omitFields as C, parseJSON as _e, removePara as B } from "@seayoo-web/utils";
|
|
3
|
+
import { v as e, objectGuard as s } from "@seayoo-web/validator";
|
|
4
|
+
function be(o) {
|
|
4
5
|
return v(o, "gamer_token") && typeof o.gamer_token == "string";
|
|
5
6
|
}
|
|
6
7
|
function Q(o) {
|
|
7
8
|
return v(o);
|
|
8
9
|
}
|
|
9
10
|
const T = me("GamerApiSDK");
|
|
10
|
-
function
|
|
11
|
+
function ye(o) {
|
|
11
12
|
return /^\/[a-z\d-]+$/.test(o);
|
|
12
13
|
}
|
|
13
|
-
async function
|
|
14
|
+
async function fe() {
|
|
14
15
|
const { promise: o, resolve: t } = de();
|
|
15
16
|
return wx.login({
|
|
16
17
|
success(n) {
|
|
@@ -21,7 +22,7 @@ async function ye() {
|
|
|
21
22
|
}
|
|
22
23
|
}), await o;
|
|
23
24
|
}
|
|
24
|
-
const
|
|
25
|
+
const he = {
|
|
25
26
|
get(o) {
|
|
26
27
|
return localStorage.getItem(o) || "";
|
|
27
28
|
},
|
|
@@ -31,10 +32,10 @@ const fe = {
|
|
|
31
32
|
remove(o) {
|
|
32
33
|
localStorage.removeItem(o);
|
|
33
34
|
}
|
|
34
|
-
},
|
|
35
|
+
}, we = {
|
|
35
36
|
get(o) {
|
|
36
37
|
try {
|
|
37
|
-
if (
|
|
38
|
+
if (f()) return wx.getStorageSync(o) || "";
|
|
38
39
|
} catch (t) {
|
|
39
40
|
T.error("getStorageSyncError", t);
|
|
40
41
|
}
|
|
@@ -42,20 +43,20 @@ const fe = {
|
|
|
42
43
|
},
|
|
43
44
|
set(o, t) {
|
|
44
45
|
try {
|
|
45
|
-
|
|
46
|
+
f() && wx.setStorageSync(o, t);
|
|
46
47
|
} catch (n) {
|
|
47
48
|
T.error("setStorageSyncError", n);
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
51
|
remove(o) {
|
|
51
52
|
try {
|
|
52
|
-
|
|
53
|
+
f() && wx.removeStorageSync(o);
|
|
53
54
|
} catch (t) {
|
|
54
55
|
T.error("removeStorageSync", t);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}, h = "gamer_token";
|
|
58
|
-
class
|
|
59
|
+
class qr {
|
|
59
60
|
$NetRequest;
|
|
60
61
|
$idToken = "";
|
|
61
62
|
$weixinToken = "";
|
|
@@ -63,8 +64,8 @@ class jr {
|
|
|
63
64
|
req;
|
|
64
65
|
storage;
|
|
65
66
|
constructor(t, n) {
|
|
66
|
-
this.storage =
|
|
67
|
-
const r =
|
|
67
|
+
this.storage = f() ? we : he;
|
|
68
|
+
const r = ye(t) ? t : `https://${ge(t)}`;
|
|
68
69
|
if (this.$NetRequest = n, this.req = n({
|
|
69
70
|
baseURL: `${r}/v1`,
|
|
70
71
|
timeout: 1e4,
|
|
@@ -85,7 +86,7 @@ class jr {
|
|
|
85
86
|
requestTransformer: (a) => {
|
|
86
87
|
this.$gamerToken && (a.headers.Authorization = `Bearer ${this.$gamerToken}`);
|
|
87
88
|
}
|
|
88
|
-
}),
|
|
89
|
+
}), pe()) {
|
|
89
90
|
const a = /^(?:localhost|[\d.]+):\d{4}$/.test(location.host), i = E("gamer_token");
|
|
90
91
|
(le() || a && i) && (this.$gamerToken = i);
|
|
91
92
|
}
|
|
@@ -164,19 +165,20 @@ class jr {
|
|
|
164
165
|
async autoLogin() {
|
|
165
166
|
if (this.gamerToken)
|
|
166
167
|
return !0;
|
|
167
|
-
|
|
168
|
+
const t = f();
|
|
169
|
+
if (!this.idToken || t && !this.weixinToken)
|
|
168
170
|
return !1;
|
|
169
|
-
const { code:
|
|
171
|
+
const { code: n, data: r } = await this.req.post(
|
|
170
172
|
"login-with-token",
|
|
171
|
-
c({ id_token: this.idToken, weixin_token:
|
|
172
|
-
|
|
173
|
+
c({ id_token: this.idToken, weixin_token: t ? this.weixinToken : null }),
|
|
174
|
+
be,
|
|
173
175
|
{
|
|
174
176
|
message: !1,
|
|
175
177
|
cacheTTL: 300,
|
|
176
|
-
cacheResolve: () => `${this.idToken}_${
|
|
178
|
+
cacheResolve: () => `${this.idToken}_${t ? this.weixinToken : "null"}`
|
|
177
179
|
}
|
|
178
180
|
);
|
|
179
|
-
switch (
|
|
181
|
+
switch (n) {
|
|
180
182
|
case "invalid_id_token":
|
|
181
183
|
this.idToken = "";
|
|
182
184
|
break;
|
|
@@ -184,7 +186,7 @@ class jr {
|
|
|
184
186
|
this.weixinToken = "";
|
|
185
187
|
break;
|
|
186
188
|
}
|
|
187
|
-
return this.gamerToken =
|
|
189
|
+
return this.gamerToken = r?.gamer_token || "", !!this.gamerToken;
|
|
188
190
|
}
|
|
189
191
|
/**
|
|
190
192
|
* 获取当前登录用户的 Session 的信息
|
|
@@ -211,21 +213,21 @@ class jr {
|
|
|
211
213
|
return n;
|
|
212
214
|
}
|
|
213
215
|
}
|
|
214
|
-
const
|
|
216
|
+
const ke = {
|
|
215
217
|
/** 未知 */
|
|
216
218
|
Unknown: "unknown",
|
|
217
219
|
/** 男 */
|
|
218
220
|
Male: "male",
|
|
219
221
|
/** 女 */
|
|
220
222
|
Female: "female"
|
|
221
|
-
},
|
|
223
|
+
}, ve = e.string().enum(ke).lock(), Ce = {
|
|
222
224
|
/** 积分增加 */
|
|
223
225
|
Increase: "increase",
|
|
224
226
|
/** 积分减少 */
|
|
225
227
|
Decrease: "decrease",
|
|
226
228
|
/** 积分过期 */
|
|
227
229
|
Expired: "expired"
|
|
228
|
-
},
|
|
230
|
+
}, Re = e.string().enum(Ce).lock(), Ve = {
|
|
229
231
|
/** 游戏内购买 */
|
|
230
232
|
Order: "order",
|
|
231
233
|
/** 游戏内消耗 */
|
|
@@ -238,21 +240,21 @@ const we = {
|
|
|
238
240
|
Admin: "admin",
|
|
239
241
|
/** 运营活动 */
|
|
240
242
|
Event: "event"
|
|
241
|
-
},
|
|
243
|
+
}, je = e.string().enum(Ve).lock(), Te = {
|
|
242
244
|
/** 游戏内奖励 */
|
|
243
245
|
GameReward: "game_reward",
|
|
244
246
|
/** 实物商品 */
|
|
245
247
|
Physical: "physical",
|
|
246
248
|
/** 虚拟商品 */
|
|
247
249
|
Virtual: "virtual"
|
|
248
|
-
}, Z = e.string().enum(
|
|
250
|
+
}, Z = e.string().enum(Te).lock(), qe = {
|
|
249
251
|
/** 待发放 */
|
|
250
252
|
Pending: "pending",
|
|
251
253
|
/** 已发放 */
|
|
252
254
|
Issued: "issued",
|
|
253
255
|
/** 发放失败 */
|
|
254
256
|
Failed: "failed"
|
|
255
|
-
},
|
|
257
|
+
}, xe = e.string().enum(qe).lock(), Se = e.object({
|
|
256
258
|
default_avatar_url: e.string(),
|
|
257
259
|
official_avatar_urls: e.array(e.string()),
|
|
258
260
|
default_nickname: e.string(),
|
|
@@ -270,7 +272,7 @@ const we = {
|
|
|
270
272
|
exp_description: e.string(),
|
|
271
273
|
credit_description: e.string(),
|
|
272
274
|
send_role_mail_rate_limit: e.number()
|
|
273
|
-
}).lock(),
|
|
275
|
+
}).lock(), Le = e.object({
|
|
274
276
|
member_id: e.string(),
|
|
275
277
|
player_id: e.string(),
|
|
276
278
|
exp: e.number(),
|
|
@@ -279,18 +281,18 @@ const we = {
|
|
|
279
281
|
credit_expiring: e.number(),
|
|
280
282
|
level_change_time: e.number(),
|
|
281
283
|
level_expire_time: e.number()
|
|
282
|
-
}).lock(),
|
|
284
|
+
}).lock(), Ee = e.object({
|
|
283
285
|
server_id: e.string(),
|
|
284
286
|
server_name: e.string()
|
|
285
|
-
}).lock(),
|
|
287
|
+
}).lock(), Pe = e.object({
|
|
286
288
|
role_id: e.string(),
|
|
287
289
|
role_name: e.string()
|
|
288
290
|
}).lock(), X = e.object({
|
|
291
|
+
...Pe.shape,
|
|
289
292
|
...Ee.shape,
|
|
290
|
-
...Le.shape,
|
|
291
293
|
role_level: e.number(),
|
|
292
294
|
last_login_time: e.number()
|
|
293
|
-
}).lock(),
|
|
295
|
+
}).lock(), $e = e.object({
|
|
294
296
|
...X.shape,
|
|
295
297
|
/** 角色战力 */
|
|
296
298
|
role_fighting: e.number(),
|
|
@@ -300,11 +302,11 @@ const we = {
|
|
|
300
302
|
kin_name: e.string().optional(),
|
|
301
303
|
/** 宗门职位 */
|
|
302
304
|
kin_position: e.string().optional()
|
|
303
|
-
}).lock(),
|
|
305
|
+
}).lock(), Ue = e.object({
|
|
304
306
|
name: e.string(),
|
|
305
307
|
avatar_url: e.string(),
|
|
306
308
|
bio: e.string(),
|
|
307
|
-
gender:
|
|
309
|
+
gender: ve,
|
|
308
310
|
birthday: e.object({ year: e.number(), month: e.number(), day: e.number() })
|
|
309
311
|
}).lock(), Y = e.object({
|
|
310
312
|
address_id: e.number(),
|
|
@@ -315,15 +317,15 @@ const we = {
|
|
|
315
317
|
district: e.string(),
|
|
316
318
|
address: e.string(),
|
|
317
319
|
is_default: e.bool()
|
|
318
|
-
}).lock(),
|
|
320
|
+
}).lock(), Fe = e.object({
|
|
319
321
|
increased_credit: e.number(),
|
|
320
322
|
decreased_credit: e.number(),
|
|
321
323
|
expired_credit: e.number(),
|
|
322
324
|
balance_credit: e.number()
|
|
323
|
-
}).lock(),
|
|
325
|
+
}).lock(), De = e.object({
|
|
324
326
|
id: e.number(),
|
|
325
|
-
change_type:
|
|
326
|
-
change_scene:
|
|
327
|
+
change_type: Re,
|
|
328
|
+
change_scene: je,
|
|
327
329
|
change_credit: e.number(),
|
|
328
330
|
balance: e.number(),
|
|
329
331
|
change_time: e.number()
|
|
@@ -362,10 +364,10 @@ const we = {
|
|
|
362
364
|
created_at: e.number(),
|
|
363
365
|
updated_at: e.number(),
|
|
364
366
|
redeemable_quantity: e.number().optional()
|
|
365
|
-
}).lock(),
|
|
367
|
+
}).lock(), Ie = e.object({
|
|
366
368
|
...C(W.shape, "tag"),
|
|
367
369
|
product: ee.clone().optional()
|
|
368
|
-
}).lock(),
|
|
370
|
+
}).lock(), xr = e.union(
|
|
369
371
|
e.object({
|
|
370
372
|
server_id: e.string(),
|
|
371
373
|
role_id: e.string()
|
|
@@ -373,7 +375,7 @@ const we = {
|
|
|
373
375
|
e.object({
|
|
374
376
|
address_id: e.number()
|
|
375
377
|
})
|
|
376
|
-
).satisfies().lock(),
|
|
378
|
+
).satisfies().lock(), Ge = e.object({
|
|
377
379
|
recipient: e.string(),
|
|
378
380
|
mobile: e.string(),
|
|
379
381
|
province: e.string(),
|
|
@@ -382,11 +384,11 @@ const we = {
|
|
|
382
384
|
address: e.string(),
|
|
383
385
|
express_company: e.string(),
|
|
384
386
|
express_number: e.string()
|
|
385
|
-
}).lock(),
|
|
387
|
+
}).lock(), Ae = e.object({
|
|
386
388
|
server_id: e.string(),
|
|
387
389
|
role_id: e.string(),
|
|
388
390
|
role_name: e.string()
|
|
389
|
-
}).lock(),
|
|
391
|
+
}).lock(), Oe = e.object({
|
|
390
392
|
redemption_id: e.number(),
|
|
391
393
|
player_id: e.string(),
|
|
392
394
|
product_id: e.number(),
|
|
@@ -397,17 +399,17 @@ const we = {
|
|
|
397
399
|
catalog_name: e.string(),
|
|
398
400
|
quantity: e.number(),
|
|
399
401
|
amount: e.number(),
|
|
400
|
-
status:
|
|
402
|
+
status: xe,
|
|
401
403
|
created_at: e.number(),
|
|
402
|
-
extra_data: e.union(
|
|
403
|
-
}), Ne = e.guard(
|
|
404
|
-
credit_logs: e.array(
|
|
404
|
+
extra_data: e.union(Ge.clone(), Ae.clone()).satisfies().optional()
|
|
405
|
+
}), Ne = e.guard(Se), M = s({ player: Le }), Be = s({ roles: e.array(X) }), q = s({ role_card: $e }), K = e.guard(Ue), H = e.guard(Y), Qe = s({ addresses: e.array(Y) }), Me = e.guard(Fe), Ke = s({
|
|
406
|
+
credit_logs: e.array(De),
|
|
405
407
|
next_token: e.string().optional()
|
|
406
|
-
}),
|
|
407
|
-
redemptions: e.array(
|
|
408
|
+
}), He = s({ products: e.array(ee) }), ze = s({ benefits: e.array(W) }), Je = s({ benefit: Ie }), Ze = s({
|
|
409
|
+
redemptions: e.array(Oe),
|
|
408
410
|
next_token: e.string().optional()
|
|
409
411
|
});
|
|
410
|
-
class
|
|
412
|
+
class Sr {
|
|
411
413
|
token;
|
|
412
414
|
req;
|
|
413
415
|
constructor(t) {
|
|
@@ -460,7 +462,7 @@ class qr {
|
|
|
460
462
|
*/
|
|
461
463
|
async getRoles(t, n, r) {
|
|
462
464
|
if (!await this.token.autoLogin()) return [];
|
|
463
|
-
const { data: a } = await this.req.get("club/roles",
|
|
465
|
+
const { data: a } = await this.req.get("club/roles", Be, {
|
|
464
466
|
...r,
|
|
465
467
|
params: c({ player_id: t, refresh: n })
|
|
466
468
|
});
|
|
@@ -516,6 +518,8 @@ class qr {
|
|
|
516
518
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Qt822A57jd
|
|
517
519
|
*/
|
|
518
520
|
async updateUserProfile(t, n) {
|
|
521
|
+
if (Object.keys(t).length === 0)
|
|
522
|
+
return { error: "OptionIsEmpty", message: "请提供需要修改的信息" };
|
|
519
523
|
await this.token.autoLogin();
|
|
520
524
|
const { data: r, code: a, message: i } = await this.req.post("club/user-profile", t, K, n);
|
|
521
525
|
return r ?? {
|
|
@@ -530,7 +534,7 @@ class qr {
|
|
|
530
534
|
*/
|
|
531
535
|
async getAddresses(t) {
|
|
532
536
|
if (!await this.token.autoLogin()) return [];
|
|
533
|
-
const { data: n } = await this.req.get("club/addresses",
|
|
537
|
+
const { data: n } = await this.req.get("club/addresses", Qe, t);
|
|
534
538
|
return n?.addresses ?? [];
|
|
535
539
|
}
|
|
536
540
|
/**
|
|
@@ -578,7 +582,7 @@ class qr {
|
|
|
578
582
|
*/
|
|
579
583
|
async getUserCredit(t, n) {
|
|
580
584
|
await this.token.autoLogin();
|
|
581
|
-
const { data: r, code: a, message: i } = await this.req.get("club/user-credit",
|
|
585
|
+
const { data: r, code: a, message: i } = await this.req.get("club/user-credit", Me, {
|
|
582
586
|
...n,
|
|
583
587
|
params: c(t)
|
|
584
588
|
});
|
|
@@ -594,7 +598,7 @@ class qr {
|
|
|
594
598
|
*/
|
|
595
599
|
async getCreditLogs(t, n) {
|
|
596
600
|
await this.token.autoLogin();
|
|
597
|
-
const { data: r } = await this.req.get("club/credit-logs",
|
|
601
|
+
const { data: r } = await this.req.get("club/credit-logs", Ke, {
|
|
598
602
|
...n,
|
|
599
603
|
params: c({ max_results: 20, ...t })
|
|
600
604
|
});
|
|
@@ -610,7 +614,7 @@ class qr {
|
|
|
610
614
|
*/
|
|
611
615
|
async getBenefits(t) {
|
|
612
616
|
if (!await this.token.autoLogin()) return [];
|
|
613
|
-
const { data: n } = await this.req.get("club/benefits",
|
|
617
|
+
const { data: n } = await this.req.get("club/benefits", ze, t);
|
|
614
618
|
return n?.benefits || [];
|
|
615
619
|
}
|
|
616
620
|
/**
|
|
@@ -620,7 +624,7 @@ class qr {
|
|
|
620
624
|
*/
|
|
621
625
|
async getBenefit(t, n) {
|
|
622
626
|
if (!await this.token.autoLogin()) return null;
|
|
623
|
-
const { data: r } = await this.req.get("club/benefit",
|
|
627
|
+
const { data: r } = await this.req.get("club/benefit", Je, {
|
|
624
628
|
...n,
|
|
625
629
|
params: { benefit_id: t }
|
|
626
630
|
});
|
|
@@ -632,7 +636,7 @@ class qr {
|
|
|
632
636
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=r3vC3PzfMQ
|
|
633
637
|
*/
|
|
634
638
|
async getProducts(t, n) {
|
|
635
|
-
const { data: r } = await this.req.get("club/products",
|
|
639
|
+
const { data: r } = await this.req.get("club/products", He, {
|
|
636
640
|
...n,
|
|
637
641
|
params: t
|
|
638
642
|
});
|
|
@@ -658,7 +662,7 @@ class qr {
|
|
|
658
662
|
*/
|
|
659
663
|
async getRedemptions(t, n) {
|
|
660
664
|
await this.token.autoLogin();
|
|
661
|
-
const { data: r } = await this.req.get("club/redemptions",
|
|
665
|
+
const { data: r } = await this.req.get("club/redemptions", Ze, {
|
|
662
666
|
...n,
|
|
663
667
|
params: c({ max_results: 20, ...t })
|
|
664
668
|
});
|
|
@@ -689,17 +693,17 @@ const R = {
|
|
|
689
693
|
ExternalCode: "external_gift_code",
|
|
690
694
|
/** 空奖励 */
|
|
691
695
|
VoidItem: "void_item"
|
|
692
|
-
}, te = e.string().enum(R).lock(),
|
|
696
|
+
}, te = e.string().enum(R).lock(), Lr = R, ne = te, Xe = {
|
|
693
697
|
/** 世游通行证 ID / Combo ID */
|
|
694
698
|
UserId: "user_id",
|
|
695
699
|
/** 游戏角色 ID */
|
|
696
700
|
RoleId: "role_id"
|
|
697
|
-
},
|
|
701
|
+
}, Ye = e.string().enum(Xe).lock(), We = {
|
|
698
702
|
None: "none",
|
|
699
703
|
Daily: "daily",
|
|
700
704
|
Weekly: "weekly",
|
|
701
705
|
Monthly: "monthly"
|
|
702
|
-
},
|
|
706
|
+
}, et = e.string().enum(We).lock(), u = {
|
|
703
707
|
/** 预约 */
|
|
704
708
|
Preregister: "preregister",
|
|
705
709
|
/** 抽奖 */
|
|
@@ -740,7 +744,7 @@ const R = {
|
|
|
740
744
|
ClaimActivationKey: "claim_activation_key",
|
|
741
745
|
/** 不朽箴言特有的 AI 聊天 */
|
|
742
746
|
ZeroChatgpt: "zero_chatgpt"
|
|
743
|
-
},
|
|
747
|
+
}, tt = e.string().enum(u).lock(), nt = {
|
|
744
748
|
/** 累计游戏内活跃值 */
|
|
745
749
|
Active: "player_active_points",
|
|
746
750
|
/** 累计登录,单位 人天 */
|
|
@@ -755,14 +759,14 @@ const R = {
|
|
|
755
759
|
MatchCounts: "player_match_counts",
|
|
756
760
|
/** 游戏对局天数 */
|
|
757
761
|
MatchDays: "player_match_days"
|
|
758
|
-
}, re = e.string().enum(
|
|
762
|
+
}, re = e.string().enum(nt).lock(), rt = {
|
|
759
763
|
/** 官方上传 */
|
|
760
764
|
System: "system",
|
|
761
765
|
/** 用户投稿 */
|
|
762
766
|
UserSubmission: "user_submission",
|
|
763
767
|
/** 投票入围 */
|
|
764
768
|
Shortlisted: "shortlisted"
|
|
765
|
-
},
|
|
769
|
+
}, at = e.string().enum(rt).lock(), p = {
|
|
766
770
|
/** 未获得奖励 */
|
|
767
771
|
Ineligible: "ineligible",
|
|
768
772
|
/** 奖励未领取 */
|
|
@@ -773,7 +777,7 @@ const R = {
|
|
|
773
777
|
Failed: "failed",
|
|
774
778
|
/** 奖励已发货 */
|
|
775
779
|
Delivered: "delivered"
|
|
776
|
-
},
|
|
780
|
+
}, Er = e.string().enum(p).lock(), P = {
|
|
777
781
|
/**
|
|
778
782
|
* 奖励未领取,拼写错误以兼容后端历史版本,检查请使用 Unclaimed
|
|
779
783
|
*
|
|
@@ -805,17 +809,17 @@ const R = {
|
|
|
805
809
|
Failed: p.Failed,
|
|
806
810
|
/** 奖励已发货 */
|
|
807
811
|
Delivered: p.Delivered
|
|
808
|
-
}, $ = e.string().enum(_).lock(),
|
|
812
|
+
}, $ = e.string().enum(_).lock(), it = {
|
|
809
813
|
/** 玩法产出奖励 */
|
|
810
814
|
Output: "output",
|
|
811
815
|
/** 玩法参与奖励 */
|
|
812
816
|
Engage: "engage"
|
|
813
|
-
}, U = e.string().enum(
|
|
817
|
+
}, U = e.string().enum(it).lock(), ot = {
|
|
814
818
|
/** 私有队伍 */
|
|
815
819
|
Private: "private",
|
|
816
820
|
/** 公开队伍 */
|
|
817
821
|
Public: "public"
|
|
818
|
-
},
|
|
822
|
+
}, st = e.string().enum(ot).lock(), w = {
|
|
819
823
|
/** 未知状态 */
|
|
820
824
|
Unknown: "unknown",
|
|
821
825
|
/** 等待开奖 */
|
|
@@ -826,7 +830,7 @@ const R = {
|
|
|
826
830
|
Claimed: "claimed",
|
|
827
831
|
/** 领奖失败 */
|
|
828
832
|
Fail: "fail"
|
|
829
|
-
},
|
|
833
|
+
}, Pr = e.string().enum(w).lock(), ct = {
|
|
830
834
|
/** 发起组队 */
|
|
831
835
|
Assemble: "assemble",
|
|
832
836
|
/** 加入队伍 */
|
|
@@ -837,72 +841,72 @@ const R = {
|
|
|
837
841
|
ChangeVisibility: "change_visibility",
|
|
838
842
|
/** 查询组队信息 */
|
|
839
843
|
Query: "query"
|
|
840
|
-
},
|
|
844
|
+
}, $r = e.string().enum(ct).lock(), ut = {
|
|
841
845
|
/** 查询抽奖券 */
|
|
842
846
|
Query: "query",
|
|
843
847
|
/** 开奖 */
|
|
844
848
|
Draw: "draw",
|
|
845
849
|
/** 领奖 */
|
|
846
850
|
Claim: "claim"
|
|
847
|
-
},
|
|
851
|
+
}, Ur = e.string().enum(ut).lock(), lt = e.string().enum(C(R, "GiftCode", "LotteryTicket")), F = e.object({
|
|
848
852
|
reward_item_id: e.number(),
|
|
849
853
|
reward_amount: e.number(),
|
|
850
854
|
reward_item_name: e.string(),
|
|
851
855
|
reward_item_icon_url: e.string(),
|
|
852
856
|
reward_item_desc: e.string().optional(),
|
|
853
|
-
reward_item_type:
|
|
857
|
+
reward_item_type: lt,
|
|
854
858
|
reward_item_rating: e.number()
|
|
855
|
-
}).lock(),
|
|
859
|
+
}).lock(), mt = e.object({
|
|
856
860
|
engage_count: e.number(),
|
|
857
861
|
rewards: e.array(F)
|
|
858
|
-
}).lock(),
|
|
862
|
+
}).lock(), dt = e.union(
|
|
859
863
|
e.object({
|
|
860
864
|
feature_reward_type: e.string().enum("every"),
|
|
861
865
|
reward_details: e.array(F)
|
|
862
866
|
}),
|
|
863
867
|
e.object({
|
|
864
868
|
feature_reward_type: e.string().enum("regular"),
|
|
865
|
-
reward_details: e.array(
|
|
869
|
+
reward_details: e.array(mt)
|
|
866
870
|
})
|
|
867
871
|
).satisfies().lock(), l = e.object({
|
|
868
872
|
feature_name: e.string(),
|
|
869
873
|
feature_id: e.number(),
|
|
870
874
|
description: e.string(),
|
|
871
|
-
cycle:
|
|
875
|
+
cycle: et,
|
|
872
876
|
cycle_limit: e.number(),
|
|
873
877
|
limit: e.number(),
|
|
874
878
|
since: e.number(),
|
|
875
879
|
until: e.number(),
|
|
876
|
-
engage_account:
|
|
877
|
-
feature_rewards:
|
|
878
|
-
}),
|
|
880
|
+
engage_account: Ye,
|
|
881
|
+
feature_rewards: dt.clone().optional()
|
|
882
|
+
}), gt = u.Cashback, pt = e.object({
|
|
879
883
|
...l.shape,
|
|
880
|
-
feature_type: e.string().enum(
|
|
884
|
+
feature_type: e.string().enum(gt),
|
|
881
885
|
config: e.object({
|
|
882
886
|
order_start_time: e.number(),
|
|
883
887
|
order_end_time: e.number(),
|
|
884
888
|
claim_rewards_start_time: e.number(),
|
|
885
889
|
claim_rewards_end_time: e.number()
|
|
886
890
|
})
|
|
887
|
-
}),
|
|
891
|
+
}), _t = u.CheckIn, bt = e.object({
|
|
888
892
|
...l.shape,
|
|
889
|
-
feature_type: e.string().enum(
|
|
890
|
-
}),
|
|
893
|
+
feature_type: e.string().enum(_t)
|
|
894
|
+
}), yt = u.ClaimActivationKey, ft = e.object({
|
|
891
895
|
...l.shape,
|
|
892
|
-
feature_type: e.string().enum(
|
|
893
|
-
}),
|
|
896
|
+
feature_type: e.string().enum(yt)
|
|
897
|
+
}), ht = u.ClaimRewards, wt = e.object({
|
|
894
898
|
...l.shape,
|
|
895
|
-
feature_type: e.string().enum(
|
|
896
|
-
}),
|
|
899
|
+
feature_type: e.string().enum(ht)
|
|
900
|
+
}), kt = u.Comment, vt = e.object({
|
|
897
901
|
...l.shape,
|
|
898
|
-
feature_type: e.string().enum(
|
|
902
|
+
feature_type: e.string().enum(kt),
|
|
899
903
|
config: e.object({
|
|
900
904
|
comments: e.array(e.string()),
|
|
901
905
|
send_rate: e.number()
|
|
902
906
|
})
|
|
903
|
-
}),
|
|
907
|
+
}), Ct = u.Follow, Rt = e.object({
|
|
904
908
|
...l.shape,
|
|
905
|
-
feature_type: e.string().enum(
|
|
909
|
+
feature_type: e.string().enum(Ct),
|
|
906
910
|
config: e.object({
|
|
907
911
|
platform: e.string(),
|
|
908
912
|
platform_icon: e.string().optional(),
|
|
@@ -910,59 +914,59 @@ const R = {
|
|
|
910
914
|
qr_code_url: e.string().optional(),
|
|
911
915
|
platform_desc: e.string().optional()
|
|
912
916
|
})
|
|
913
|
-
}),
|
|
917
|
+
}), Vt = u.GiftCode, jt = e.object({
|
|
914
918
|
name: e.string(),
|
|
915
919
|
icon_url: e.string(),
|
|
916
920
|
count: e.number()
|
|
917
|
-
}),
|
|
921
|
+
}), Tt = e.object({
|
|
918
922
|
...l.shape,
|
|
919
|
-
feature_type: e.string().enum(
|
|
923
|
+
feature_type: e.string().enum(Vt),
|
|
920
924
|
config: e.object({
|
|
921
|
-
gift_items: e.array(
|
|
925
|
+
gift_items: e.array(jt),
|
|
922
926
|
mp_url: e.string().optional(),
|
|
923
927
|
mp_qrcode_url: e.string().optional()
|
|
924
928
|
})
|
|
925
|
-
}),
|
|
929
|
+
}), qt = u.Invite, xt = e.object({
|
|
926
930
|
...l.shape,
|
|
927
|
-
feature_type: e.string().enum(
|
|
931
|
+
feature_type: e.string().enum(qt),
|
|
928
932
|
config: e.object({
|
|
929
933
|
share_url: e.string()
|
|
930
934
|
})
|
|
931
|
-
}),
|
|
935
|
+
}), St = u.InvitedRegister, Lt = e.object({
|
|
932
936
|
...l.shape,
|
|
933
|
-
feature_type: e.string().enum(
|
|
934
|
-
}),
|
|
937
|
+
feature_type: e.string().enum(St)
|
|
938
|
+
}), Et = e.string().enum(C(R, "GiftCode", "LotteryTicket")), Pt = u.Lottery, $t = e.object({
|
|
935
939
|
reward_item_id: e.number(),
|
|
936
940
|
reward_item_name: e.string(),
|
|
937
|
-
reward_item_type:
|
|
941
|
+
reward_item_type: Et,
|
|
938
942
|
reward_item_icon_url: e.string(),
|
|
939
943
|
reward_item_desc: e.string().optional(),
|
|
940
944
|
reward_amount: e.number(),
|
|
941
945
|
reward_remaining_stock: e.number()
|
|
942
|
-
}),
|
|
946
|
+
}), Ut = e.object({
|
|
943
947
|
...l.shape,
|
|
944
|
-
feature_type: e.string().enum(
|
|
948
|
+
feature_type: e.string().enum(Pt),
|
|
945
949
|
config: e.object({
|
|
946
950
|
consume_item_id: e.number(),
|
|
947
951
|
consume_item_name: e.number(),
|
|
948
952
|
consume_item_icon_url: e.string(),
|
|
949
953
|
consume_item_count: e.number(),
|
|
950
954
|
consume_item_desc: e.string().optional(),
|
|
951
|
-
rewards: e.array(
|
|
955
|
+
rewards: e.array($t)
|
|
952
956
|
})
|
|
953
|
-
}),
|
|
957
|
+
}), Ft = u.LotteryDraw, Dt = e.object({
|
|
954
958
|
...l.shape,
|
|
955
|
-
feature_type: e.string().enum(
|
|
959
|
+
feature_type: e.string().enum(Ft),
|
|
956
960
|
config: e.object({
|
|
957
961
|
draw_not_before: e.number(),
|
|
958
962
|
draw_not_after: e.number()
|
|
959
963
|
})
|
|
960
|
-
}),
|
|
964
|
+
}), It = u.Preregister, Gt = e.object({
|
|
961
965
|
...l.shape,
|
|
962
|
-
feature_type: e.string().enum(
|
|
963
|
-
}),
|
|
966
|
+
feature_type: e.string().enum(It)
|
|
967
|
+
}), At = u.Quest, Ot = e.object({
|
|
964
968
|
...l.shape,
|
|
965
|
-
feature_type: e.string().enum(
|
|
969
|
+
feature_type: e.string().enum(At),
|
|
966
970
|
config: e.object({
|
|
967
971
|
objective: re,
|
|
968
972
|
completion_value: e.number(),
|
|
@@ -976,38 +980,38 @@ const R = {
|
|
|
976
980
|
required_matches: e.number().min(1).optional()
|
|
977
981
|
}).optional()
|
|
978
982
|
})
|
|
979
|
-
}), Nt = u.Register,
|
|
983
|
+
}), Nt = u.Register, Bt = e.object({
|
|
980
984
|
...l.shape,
|
|
981
985
|
feature_type: e.string().enum(Nt)
|
|
982
|
-
}),
|
|
986
|
+
}), Qt = u.Share, Mt = e.object({
|
|
983
987
|
...l.shape,
|
|
984
|
-
feature_type: e.string().enum(
|
|
988
|
+
feature_type: e.string().enum(Qt),
|
|
985
989
|
config: e.object({
|
|
986
990
|
share_platform: e.string(),
|
|
987
991
|
jump_url: e.string().optional(),
|
|
988
992
|
icon_url: e.string().optional()
|
|
989
993
|
})
|
|
990
|
-
}),
|
|
994
|
+
}), Kt = u.Subscribe, Ht = e.object({
|
|
991
995
|
...l.shape,
|
|
992
|
-
feature_type: e.string().enum(
|
|
996
|
+
feature_type: e.string().enum(Kt),
|
|
993
997
|
config: e.object({
|
|
994
998
|
weixin_template_ids: e.array(e.string())
|
|
995
999
|
})
|
|
996
|
-
}),
|
|
1000
|
+
}), zt = u.Survey, Jt = e.object({
|
|
997
1001
|
...l.shape,
|
|
998
|
-
feature_type: e.string().enum(
|
|
1002
|
+
feature_type: e.string().enum(zt),
|
|
999
1003
|
config: e.object({
|
|
1000
1004
|
survey_id: e.string(),
|
|
1001
1005
|
survey_url: e.string()
|
|
1002
1006
|
})
|
|
1003
|
-
}),
|
|
1007
|
+
}), Zt = u.Team, Xt = e.object({
|
|
1004
1008
|
...l.shape,
|
|
1005
|
-
feature_type: e.string().enum(
|
|
1009
|
+
feature_type: e.string().enum(Zt),
|
|
1006
1010
|
config: e.object({
|
|
1007
1011
|
max_members: e.number().min(1),
|
|
1008
1012
|
min_members: e.number().min(1)
|
|
1009
1013
|
})
|
|
1010
|
-
}),
|
|
1014
|
+
}), Yt = u.Vote, Wt = e.object({
|
|
1011
1015
|
sn: e.string(),
|
|
1012
1016
|
name: e.string(),
|
|
1013
1017
|
img_urls: e.array(e.string()).optional(),
|
|
@@ -1017,61 +1021,61 @@ const R = {
|
|
|
1017
1021
|
amount: e.number(),
|
|
1018
1022
|
finalists: e.bool(),
|
|
1019
1023
|
last_vote_time: e.number()
|
|
1020
|
-
}),
|
|
1024
|
+
}), en = e.object({
|
|
1021
1025
|
...l.shape,
|
|
1022
|
-
feature_type: e.string().enum(
|
|
1026
|
+
feature_type: e.string().enum(Yt),
|
|
1023
1027
|
config: e.object({
|
|
1024
1028
|
vote_feature_ids: e.array(e.number()),
|
|
1025
1029
|
submission_feature_ids: e.array(e.number()),
|
|
1026
1030
|
finalists_amount: e.number(),
|
|
1027
|
-
source:
|
|
1028
|
-
options: e.array(
|
|
1031
|
+
source: at,
|
|
1032
|
+
options: e.array(Wt),
|
|
1029
1033
|
rewards: e.array(F)
|
|
1030
1034
|
})
|
|
1031
|
-
}),
|
|
1035
|
+
}), tn = u.ZeroChatgpt, nn = e.object({
|
|
1032
1036
|
...l.shape,
|
|
1033
|
-
feature_type: e.string().enum(
|
|
1034
|
-
}),
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
At,
|
|
1037
|
+
feature_type: e.string().enum(tn)
|
|
1038
|
+
}), rn = e.union(
|
|
1039
|
+
pt,
|
|
1040
|
+
bt,
|
|
1041
|
+
wt,
|
|
1042
|
+
vt,
|
|
1043
|
+
Rt,
|
|
1044
|
+
Tt,
|
|
1045
|
+
xt,
|
|
1046
|
+
Lt,
|
|
1047
|
+
Ut,
|
|
1048
|
+
Dt,
|
|
1049
|
+
Gt,
|
|
1047
1050
|
Ot,
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1051
|
+
Bt,
|
|
1052
|
+
Mt,
|
|
1053
|
+
Ht,
|
|
1054
|
+
Jt,
|
|
1055
|
+
Xt,
|
|
1056
|
+
en,
|
|
1057
|
+
ft,
|
|
1058
|
+
nn
|
|
1059
|
+
).key("feature_type").satisfies(), an = e.object({
|
|
1056
1060
|
event_name: e.string(),
|
|
1057
1061
|
rules: e.string(),
|
|
1058
1062
|
since: e.number(),
|
|
1059
1063
|
until: e.number(),
|
|
1060
1064
|
visit_count: e.number().optional(),
|
|
1061
|
-
features: e.array(
|
|
1062
|
-
}).lock(), x = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()),
|
|
1065
|
+
features: e.array(rn)
|
|
1066
|
+
}).lock(), x = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()), on = e.object({
|
|
1063
1067
|
order_total_amount: x,
|
|
1064
1068
|
cashback_total_amount: x,
|
|
1065
1069
|
game_item_count: x
|
|
1066
|
-
}), on = e.object({
|
|
1067
|
-
activation_key: e.string().disallow("")
|
|
1068
1070
|
}), sn = e.object({
|
|
1069
|
-
|
|
1071
|
+
activation_key: e.string().disallow("")
|
|
1070
1072
|
}), cn = e.object({
|
|
1073
|
+
gift_code: e.string()
|
|
1074
|
+
}), un = e.object({
|
|
1071
1075
|
user_id: e.string(),
|
|
1072
1076
|
name: e.string().optional(),
|
|
1073
1077
|
avatar_url: e.string().optional()
|
|
1074
|
-
}),
|
|
1078
|
+
}), ln = e.object({
|
|
1075
1079
|
lottery_count: e.number()
|
|
1076
1080
|
}), D = e.object({
|
|
1077
1081
|
reward_id: e.number(),
|
|
@@ -1088,24 +1092,24 @@ const R = {
|
|
|
1088
1092
|
event_name: e.string(),
|
|
1089
1093
|
feature_id: e.number(),
|
|
1090
1094
|
engagement_id: e.number(),
|
|
1091
|
-
feature_type:
|
|
1095
|
+
feature_type: tt,
|
|
1092
1096
|
receive_time: e.number(),
|
|
1093
1097
|
extra_data: e.record(e.unknown()).optional()
|
|
1094
|
-
}),
|
|
1098
|
+
}), mn = e.string().enum(w.Unknown, w.Pending), dn = e.union(
|
|
1095
1099
|
e.object({
|
|
1096
1100
|
ticket: e.string(),
|
|
1097
|
-
status:
|
|
1101
|
+
status: mn
|
|
1098
1102
|
}),
|
|
1099
1103
|
e.object({
|
|
1100
1104
|
ticket: e.string(),
|
|
1101
1105
|
status: e.string().enum(C(w, "Unknown", "Pending")),
|
|
1102
1106
|
reward: D
|
|
1103
1107
|
})
|
|
1104
|
-
).satisfies(),
|
|
1105
|
-
tickets: e.array(
|
|
1106
|
-
}), gn = e.object({
|
|
1107
|
-
platforms: e.array(e.string())
|
|
1108
|
+
).satisfies(), gn = e.object({
|
|
1109
|
+
tickets: e.array(dn)
|
|
1108
1110
|
}), pn = e.object({
|
|
1111
|
+
platforms: e.array(e.string())
|
|
1112
|
+
}), _n = e.object({
|
|
1109
1113
|
objective: re,
|
|
1110
1114
|
progress: e.number(),
|
|
1111
1115
|
completion_value: e.number().optional(),
|
|
@@ -1121,24 +1125,24 @@ const R = {
|
|
|
1121
1125
|
})
|
|
1122
1126
|
)
|
|
1123
1127
|
}).optional()
|
|
1124
|
-
}), _n = e.object({
|
|
1125
|
-
platform: e.string()
|
|
1126
1128
|
}), bn = e.object({
|
|
1127
|
-
|
|
1129
|
+
platform: e.string()
|
|
1128
1130
|
}), yn = e.object({
|
|
1129
|
-
|
|
1131
|
+
weixin_openid: e.string()
|
|
1130
1132
|
}), fn = e.object({
|
|
1133
|
+
serial_number: e.number()
|
|
1134
|
+
}), hn = e.object({
|
|
1131
1135
|
team_code: e.string(),
|
|
1132
1136
|
leader_name: e.string(),
|
|
1133
1137
|
total_members: e.number()
|
|
1134
|
-
}),
|
|
1138
|
+
}), Fr = e.object({
|
|
1135
1139
|
is_leader: e.bool(),
|
|
1136
1140
|
is_myself: e.bool().optional(),
|
|
1137
1141
|
role_name: e.string(),
|
|
1138
1142
|
server_name: e.string()
|
|
1139
|
-
}),
|
|
1143
|
+
}), wn = e.object({
|
|
1140
1144
|
team_code: e.string(),
|
|
1141
|
-
visibility:
|
|
1145
|
+
visibility: st,
|
|
1142
1146
|
members: e.array(
|
|
1143
1147
|
e.object({
|
|
1144
1148
|
is_leader: e.bool(),
|
|
@@ -1146,14 +1150,14 @@ const R = {
|
|
|
1146
1150
|
server_name: e.string()
|
|
1147
1151
|
})
|
|
1148
1152
|
)
|
|
1149
|
-
}), wn = e.object({
|
|
1150
|
-
option_sn: e.string()
|
|
1151
1153
|
}), kn = e.object({
|
|
1154
|
+
option_sn: e.string()
|
|
1155
|
+
}), vn = e.object({
|
|
1152
1156
|
role: e.string(),
|
|
1153
1157
|
content: e.string()
|
|
1154
|
-
}), vn = e.object({
|
|
1155
|
-
conversations: e.array(kn)
|
|
1156
1158
|
}), Cn = e.object({
|
|
1159
|
+
conversations: e.array(vn)
|
|
1160
|
+
}), Rn = e.object({
|
|
1157
1161
|
user_id: e.string(),
|
|
1158
1162
|
name: e.string(),
|
|
1159
1163
|
avatar_url: e.string(),
|
|
@@ -1161,25 +1165,25 @@ const R = {
|
|
|
1161
1165
|
video_note: e.number(),
|
|
1162
1166
|
created_at: e.number()
|
|
1163
1167
|
}), I = e.union(
|
|
1164
|
-
|
|
1168
|
+
pn,
|
|
1169
|
+
ln,
|
|
1170
|
+
fn,
|
|
1165
1171
|
un,
|
|
1172
|
+
bn,
|
|
1173
|
+
kn,
|
|
1166
1174
|
yn,
|
|
1175
|
+
on,
|
|
1167
1176
|
cn,
|
|
1168
|
-
_n,
|
|
1169
1177
|
wn,
|
|
1170
|
-
|
|
1171
|
-
|
|
1178
|
+
_n,
|
|
1179
|
+
gn,
|
|
1172
1180
|
sn,
|
|
1173
|
-
|
|
1174
|
-
pn,
|
|
1175
|
-
dn,
|
|
1176
|
-
on,
|
|
1177
|
-
vn,
|
|
1181
|
+
Cn,
|
|
1178
1182
|
e.custom(
|
|
1179
1183
|
"EmptyObject",
|
|
1180
1184
|
(o) => v(o) && Object.keys(o).length === 0
|
|
1181
1185
|
)
|
|
1182
|
-
).satisfies().lock(),
|
|
1186
|
+
).satisfies().lock(), Vn = e.object({
|
|
1183
1187
|
reward_id: e.number(),
|
|
1184
1188
|
reward_item_id: e.number(),
|
|
1185
1189
|
reward_item_type: ne,
|
|
@@ -1192,7 +1196,7 @@ const R = {
|
|
|
1192
1196
|
reward_item_rating: e.number(),
|
|
1193
1197
|
receive_time: e.number(),
|
|
1194
1198
|
extra_data: e.union(...I.validators, e.record(e.unknown())).satisfies().optional()
|
|
1195
|
-
}),
|
|
1199
|
+
}), jn = e.object({
|
|
1196
1200
|
reward_id: e.number(),
|
|
1197
1201
|
reward_item_id: e.number(),
|
|
1198
1202
|
reward_item_name: e.string(),
|
|
@@ -1203,7 +1207,7 @@ const R = {
|
|
|
1203
1207
|
reward_status: ae,
|
|
1204
1208
|
reward_source: U,
|
|
1205
1209
|
extra_data: e.record(e.unknown()).optional()
|
|
1206
|
-
}),
|
|
1210
|
+
}), Tn = e.object({
|
|
1207
1211
|
engagement_id: e.number(),
|
|
1208
1212
|
user_id: e.string(),
|
|
1209
1213
|
event_id: e.number(),
|
|
@@ -1213,15 +1217,15 @@ const R = {
|
|
|
1213
1217
|
server_id: e.string().optional(),
|
|
1214
1218
|
role_id: e.string().optional(),
|
|
1215
1219
|
created_at: e.number(),
|
|
1216
|
-
rewards: e.array(
|
|
1217
|
-
}).lock(),
|
|
1220
|
+
rewards: e.array(Vn).optional()
|
|
1221
|
+
}).lock(), qn = e.object({
|
|
1218
1222
|
allowed: e.bool(),
|
|
1219
1223
|
registered: e.bool()
|
|
1220
|
-
}),
|
|
1224
|
+
}), xn = e.object({
|
|
1221
1225
|
feature_id: e.number(),
|
|
1222
1226
|
can_engage: e.bool(),
|
|
1223
1227
|
has_unclaimed_rewards: e.bool()
|
|
1224
|
-
}),
|
|
1228
|
+
}), Sn = e.object({
|
|
1225
1229
|
engagement_id: e.number(),
|
|
1226
1230
|
engagement: e.object({
|
|
1227
1231
|
engagement_id: e.number(),
|
|
@@ -1229,37 +1233,37 @@ const R = {
|
|
|
1229
1233
|
feature_id: e.number(),
|
|
1230
1234
|
data: I.clone().optional()
|
|
1231
1235
|
}).optional(),
|
|
1232
|
-
rewards: e.array(
|
|
1236
|
+
rewards: e.array(jn).optional(),
|
|
1233
1237
|
scan: e.bool().optional()
|
|
1234
|
-
}),
|
|
1238
|
+
}), Ln = e.object({
|
|
1235
1239
|
reward_id: e.number(),
|
|
1236
1240
|
reward_status: $
|
|
1237
|
-
}),
|
|
1238
|
-
engagements: e.union(e.array(
|
|
1239
|
-
}), Un = s({
|
|
1240
|
-
status: e.array(qn)
|
|
1241
|
+
}), En = e.guard(an), Pn = e.guard(qn), S = s({ count: e.number() }), $n = s({ first_visit: e.bool() }), Un = s({
|
|
1242
|
+
engagements: e.union(e.array(Rn), e.array(hn))
|
|
1241
1243
|
}), Fn = s({
|
|
1242
|
-
|
|
1244
|
+
status: e.array(xn)
|
|
1243
1245
|
}), Dn = s({
|
|
1244
|
-
|
|
1246
|
+
engagements_counts: e.record(e.number())
|
|
1247
|
+
}), In = s({
|
|
1248
|
+
engagements: e.array(Tn),
|
|
1245
1249
|
next_token: e.string().optional()
|
|
1246
|
-
}),
|
|
1247
|
-
claimed_items: e.array(
|
|
1248
|
-
}),
|
|
1250
|
+
}), Gn = e.guard(Sn), An = s({
|
|
1251
|
+
claimed_items: e.array(Ln)
|
|
1252
|
+
}), On = s({
|
|
1249
1253
|
rewards: e.array(D)
|
|
1250
1254
|
}), Nn = s({
|
|
1251
1255
|
reward_status: $
|
|
1252
|
-
}),
|
|
1256
|
+
}), Bn = s({
|
|
1253
1257
|
user_rewards: e.array(D),
|
|
1254
1258
|
next_token: e.string().optional()
|
|
1255
|
-
}), Bn = s({
|
|
1256
|
-
scene: e.string()
|
|
1257
1259
|
}), Qn = s({
|
|
1258
|
-
|
|
1260
|
+
scene: e.string()
|
|
1259
1261
|
}), Mn = s({
|
|
1262
|
+
params: e.string()
|
|
1263
|
+
}), Kn = s({
|
|
1260
1264
|
img: e.string()
|
|
1261
1265
|
});
|
|
1262
|
-
class
|
|
1266
|
+
class Dr {
|
|
1263
1267
|
token;
|
|
1264
1268
|
event = 0;
|
|
1265
1269
|
req;
|
|
@@ -1272,7 +1276,7 @@ class Ur {
|
|
|
1272
1276
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=OWGSPF3Ysl
|
|
1273
1277
|
*/
|
|
1274
1278
|
async verifyMobileAllowed(t, n, r) {
|
|
1275
|
-
const { data: a } = await this.req.get("verify-mobile-allowed",
|
|
1279
|
+
const { data: a } = await this.req.get("verify-mobile-allowed", Pn, {
|
|
1276
1280
|
...r,
|
|
1277
1281
|
params: { game_id: t, mobile: n }
|
|
1278
1282
|
});
|
|
@@ -1284,7 +1288,7 @@ class Ur {
|
|
|
1284
1288
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=wFXxtdNKPm
|
|
1285
1289
|
*/
|
|
1286
1290
|
async getConfig(t) {
|
|
1287
|
-
const { data: n } = await this.req.get(`event/${this.event}/event-config`,
|
|
1291
|
+
const { data: n } = await this.req.get(`event/${this.event}/event-config`, En, t);
|
|
1288
1292
|
return n;
|
|
1289
1293
|
}
|
|
1290
1294
|
/**
|
|
@@ -1319,7 +1323,7 @@ class Ur {
|
|
|
1319
1323
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=THtZ4ewIQW
|
|
1320
1324
|
*/
|
|
1321
1325
|
async getEngagements(t, n) {
|
|
1322
|
-
const { data: r } = await this.req.get(`event/${this.event}/feature-engagements`,
|
|
1326
|
+
const { data: r } = await this.req.get(`event/${this.event}/feature-engagements`, Un, {
|
|
1323
1327
|
...n,
|
|
1324
1328
|
params: { feature_id: t }
|
|
1325
1329
|
});
|
|
@@ -1335,7 +1339,7 @@ class Ur {
|
|
|
1335
1339
|
const { data: r, code: a, message: i } = await this.req.post(
|
|
1336
1340
|
`event/${this.event}/visit`,
|
|
1337
1341
|
c(t || {}),
|
|
1338
|
-
|
|
1342
|
+
$n,
|
|
1339
1343
|
n
|
|
1340
1344
|
);
|
|
1341
1345
|
return r ?? {
|
|
@@ -1354,7 +1358,7 @@ class Ur {
|
|
|
1354
1358
|
*/
|
|
1355
1359
|
async getUserFeatureStatus(t, n) {
|
|
1356
1360
|
if (!await this.token.autoLogin()) return [];
|
|
1357
|
-
const { data: r } = await this.req.get("event/user-feature-status",
|
|
1361
|
+
const { data: r } = await this.req.get("event/user-feature-status", Fn, {
|
|
1358
1362
|
...n,
|
|
1359
1363
|
message: !1,
|
|
1360
1364
|
params: c({ ...t, event_id: this.event })
|
|
@@ -1368,7 +1372,7 @@ class Ur {
|
|
|
1368
1372
|
*/
|
|
1369
1373
|
async getUserEngagementCount(t, n) {
|
|
1370
1374
|
if (!await this.token.autoLogin()) return {};
|
|
1371
|
-
const { data: r } = await this.req.get("event/user-engagements-count",
|
|
1375
|
+
const { data: r } = await this.req.get("event/user-engagements-count", Dn, {
|
|
1372
1376
|
message: !1,
|
|
1373
1377
|
params: c({ ...n, event_id: this.event, feature_id: t })
|
|
1374
1378
|
});
|
|
@@ -1387,7 +1391,7 @@ class Ur {
|
|
|
1387
1391
|
engagements: [],
|
|
1388
1392
|
next_token: ""
|
|
1389
1393
|
};
|
|
1390
|
-
const { data: a } = await this.req.get("event/user-engagements",
|
|
1394
|
+
const { data: a } = await this.req.get("event/user-engagements", In, {
|
|
1391
1395
|
...r,
|
|
1392
1396
|
params: c({
|
|
1393
1397
|
max_results: 20,
|
|
@@ -1419,10 +1423,10 @@ class Ur {
|
|
|
1419
1423
|
engagement: n,
|
|
1420
1424
|
...r
|
|
1421
1425
|
}),
|
|
1422
|
-
|
|
1426
|
+
Gn,
|
|
1423
1427
|
a
|
|
1424
1428
|
);
|
|
1425
|
-
return i && i.rewards && (i.rewards = i.rewards.map((
|
|
1429
|
+
return i && i.rewards && (i.rewards = i.rewards.map((y) => (y.reward_status = y.reward_status === P.UnclaimedErr ? P.Unclaimed : y.reward_status, y))), i ?? {
|
|
1426
1430
|
message: m,
|
|
1427
1431
|
error: d
|
|
1428
1432
|
// 激活码已领完
|
|
@@ -1443,7 +1447,7 @@ class Ur {
|
|
|
1443
1447
|
...t,
|
|
1444
1448
|
server_id: t.server_id ? +t.server_id : void 0
|
|
1445
1449
|
}),
|
|
1446
|
-
|
|
1450
|
+
An,
|
|
1447
1451
|
n
|
|
1448
1452
|
), d = r?.claimed_items;
|
|
1449
1453
|
return d ? d.map((m) => (m.reward_status = m.reward_status === _.UnclaimedErr ? _.Unclaimed : m.reward_status, m)) : {
|
|
@@ -1464,7 +1468,7 @@ class Ur {
|
|
|
1464
1468
|
...t,
|
|
1465
1469
|
server_id: t.server_id ? +t.server_id : void 0
|
|
1466
1470
|
}),
|
|
1467
|
-
|
|
1471
|
+
On,
|
|
1468
1472
|
n
|
|
1469
1473
|
), d = r?.rewards;
|
|
1470
1474
|
return d ? d.map((m) => (m.reward_status = m.reward_status === _.UnclaimedErr ? _.Unclaimed : m.reward_status, m)) : {
|
|
@@ -1523,7 +1527,7 @@ class Ur {
|
|
|
1523
1527
|
const { data: r } = await this.req.post(
|
|
1524
1528
|
"event/user-rewards",
|
|
1525
1529
|
c({ max_results: 20, ...t, event_id: this.event }),
|
|
1526
|
-
|
|
1530
|
+
Bn,
|
|
1527
1531
|
n
|
|
1528
1532
|
);
|
|
1529
1533
|
return {
|
|
@@ -1563,7 +1567,7 @@ class Ur {
|
|
|
1563
1567
|
*/
|
|
1564
1568
|
async getUnlimitQrcodeScene(t, n) {
|
|
1565
1569
|
if (!await this.token.autoLogin()) return null;
|
|
1566
|
-
const { data: r } = await this.req.get("event/unlimit-qrcode-scene",
|
|
1570
|
+
const { data: r } = await this.req.get("event/unlimit-qrcode-scene", Qn, {
|
|
1567
1571
|
...n,
|
|
1568
1572
|
params: { params: t }
|
|
1569
1573
|
});
|
|
@@ -1577,7 +1581,7 @@ class Ur {
|
|
|
1577
1581
|
* @param scene - 小程序码 scene 值
|
|
1578
1582
|
*/
|
|
1579
1583
|
async getParamsByQrcodeScene(t, n) {
|
|
1580
|
-
const { data: r } = await this.req.get("event/params-by-qrcode-scene",
|
|
1584
|
+
const { data: r } = await this.req.get("event/params-by-qrcode-scene", Mn, {
|
|
1581
1585
|
...n,
|
|
1582
1586
|
params: { scene: t }
|
|
1583
1587
|
});
|
|
@@ -1593,18 +1597,18 @@ class Ur {
|
|
|
1593
1597
|
const { data: r } = await this.req.post(
|
|
1594
1598
|
"event/unlimit-qrcode",
|
|
1595
1599
|
c(t),
|
|
1596
|
-
|
|
1600
|
+
Kn,
|
|
1597
1601
|
n
|
|
1598
1602
|
);
|
|
1599
1603
|
return r?.img ?? null;
|
|
1600
1604
|
}
|
|
1601
1605
|
}
|
|
1602
|
-
const
|
|
1606
|
+
const Hn = {
|
|
1603
1607
|
/** 所有人均可以发帖 */
|
|
1604
1608
|
All: "all",
|
|
1605
1609
|
/** 指定用户可发帖 */
|
|
1606
1610
|
Limit: "limit"
|
|
1607
|
-
},
|
|
1611
|
+
}, zn = e.string().enum(Hn).lock(), Jn = {
|
|
1608
1612
|
/** 待审核(仅自己可见) */
|
|
1609
1613
|
Pending: "pending",
|
|
1610
1614
|
/** 审核通过 */
|
|
@@ -1613,14 +1617,14 @@ const Kn = {
|
|
|
1613
1617
|
Failed: "failed",
|
|
1614
1618
|
/** 嫌疑(仅自己可见) */
|
|
1615
1619
|
Suspect: "suspect"
|
|
1616
|
-
}, ie = e.string().enum(
|
|
1620
|
+
}, ie = e.string().enum(Jn).lock(), Zn = {
|
|
1617
1621
|
/** 系统通知 */
|
|
1618
1622
|
System: "system",
|
|
1619
1623
|
/** 评论我的 */
|
|
1620
1624
|
Comment: "comment",
|
|
1621
1625
|
/** 点赞通知 */
|
|
1622
1626
|
Like: "like"
|
|
1623
|
-
},
|
|
1627
|
+
}, Ir = e.string().enum(Zn).lock(), g = {
|
|
1624
1628
|
/** 系统通知 */
|
|
1625
1629
|
System: "system",
|
|
1626
1630
|
/** 帖子被置顶 */
|
|
@@ -1645,13 +1649,13 @@ const Kn = {
|
|
|
1645
1649
|
ReplyLiked: "reply_liked",
|
|
1646
1650
|
/** 回复被删除 */
|
|
1647
1651
|
ReplyDeleted: "reply_deleted"
|
|
1648
|
-
},
|
|
1652
|
+
}, Xn = e.string().enum(g).lock(), oe = e.object({
|
|
1649
1653
|
forum_id: e.number(),
|
|
1650
1654
|
icon_url: e.string(),
|
|
1651
1655
|
name: e.string(),
|
|
1652
1656
|
tags: e.array(e.string()),
|
|
1653
1657
|
sort: e.number(),
|
|
1654
|
-
mode:
|
|
1658
|
+
mode: zn,
|
|
1655
1659
|
member_ids: e.array(e.number())
|
|
1656
1660
|
}).lock(), G = e.object({
|
|
1657
1661
|
topic_id: e.number(),
|
|
@@ -1682,7 +1686,7 @@ const Kn = {
|
|
|
1682
1686
|
create_time: e.number()
|
|
1683
1687
|
}).lock(), se = e.object({
|
|
1684
1688
|
err_msg: e.string().optional()
|
|
1685
|
-
}).lock(),
|
|
1689
|
+
}).lock(), Yn = e.object({
|
|
1686
1690
|
reply_id: e.number(),
|
|
1687
1691
|
reply_content: e.string().optional(),
|
|
1688
1692
|
replied_by: e.string(),
|
|
@@ -1701,7 +1705,7 @@ const Kn = {
|
|
|
1701
1705
|
content: e.string(),
|
|
1702
1706
|
like_num: e.number(),
|
|
1703
1707
|
liked: e.bool(),
|
|
1704
|
-
reply_to:
|
|
1708
|
+
reply_to: Yn,
|
|
1705
1709
|
create_time: e.number()
|
|
1706
1710
|
}).lock(), k = e.object({
|
|
1707
1711
|
comment_id: e.number(),
|
|
@@ -1723,22 +1727,22 @@ const Kn = {
|
|
|
1723
1727
|
create_time: e.number(),
|
|
1724
1728
|
status: ie,
|
|
1725
1729
|
replies: e.array(V).optional()
|
|
1726
|
-
}).lock(),
|
|
1730
|
+
}).lock(), Wn = e.object({
|
|
1727
1731
|
image_url: e.string(),
|
|
1728
1732
|
upload_url: e.string(),
|
|
1729
1733
|
existed: e.bool()
|
|
1730
|
-
}).lock(),
|
|
1734
|
+
}).lock(), b = e.object({
|
|
1731
1735
|
notification_id: e.string(),
|
|
1732
|
-
notification_type:
|
|
1736
|
+
notification_type: Xn,
|
|
1733
1737
|
is_read: e.bool(),
|
|
1734
1738
|
create_time: e.number(),
|
|
1735
1739
|
origin_user_id: e.string(),
|
|
1736
1740
|
origin_user_name: e.string(),
|
|
1737
1741
|
origin_user_avatar_url: e.string()
|
|
1738
|
-
}).lock(),
|
|
1742
|
+
}).lock(), er = e.object({
|
|
1739
1743
|
system_message_subject: e.string(),
|
|
1740
1744
|
system_message_content: e.string()
|
|
1741
|
-
}).lock(),
|
|
1745
|
+
}).lock(), O = e.object({
|
|
1742
1746
|
post_id: e.number(),
|
|
1743
1747
|
post_subject: e.string(),
|
|
1744
1748
|
post_summary: e.string(),
|
|
@@ -1746,81 +1750,81 @@ const Kn = {
|
|
|
1746
1750
|
}).lock(), j = e.object({
|
|
1747
1751
|
comment_id: e.number(),
|
|
1748
1752
|
comment_content: e.string()
|
|
1749
|
-
}).lock(),
|
|
1753
|
+
}).lock(), N = e.object({
|
|
1750
1754
|
reply_id: e.number(),
|
|
1751
1755
|
reply_content: e.string()
|
|
1752
|
-
}).lock(),
|
|
1753
|
-
...
|
|
1754
|
-
...
|
|
1756
|
+
}).lock(), tr = e.object({
|
|
1757
|
+
...b.shape,
|
|
1758
|
+
...er.shape,
|
|
1755
1759
|
notification_type: e.string().enum(g.System)
|
|
1756
|
-
}),
|
|
1757
|
-
...
|
|
1758
|
-
...
|
|
1760
|
+
}), nr = e.object({
|
|
1761
|
+
...b.shape,
|
|
1762
|
+
...O.shape,
|
|
1759
1763
|
notification_type: e.string().enum(
|
|
1760
1764
|
g.PostPinned,
|
|
1761
1765
|
g.PostHighlighted,
|
|
1762
1766
|
g.PostDeleted,
|
|
1763
1767
|
g.PostLiked
|
|
1764
1768
|
)
|
|
1765
|
-
}), nr = e.object({
|
|
1766
|
-
...y.shape,
|
|
1767
|
-
...N.shape,
|
|
1768
|
-
...j.shape,
|
|
1769
|
-
notification_type: e.string().enum(g.PostCommented)
|
|
1770
1769
|
}), rr = e.object({
|
|
1771
|
-
...
|
|
1772
|
-
...j.shape,
|
|
1770
|
+
...b.shape,
|
|
1773
1771
|
...O.shape,
|
|
1774
|
-
|
|
1772
|
+
...j.shape,
|
|
1773
|
+
notification_type: e.string().enum(g.PostCommented)
|
|
1775
1774
|
}), ar = e.object({
|
|
1776
|
-
...
|
|
1775
|
+
...b.shape,
|
|
1777
1776
|
...j.shape,
|
|
1778
1777
|
...N.shape,
|
|
1779
|
-
notification_type: e.string().enum(g.
|
|
1778
|
+
notification_type: e.string().enum(g.CommentReplied)
|
|
1780
1779
|
}), ir = e.object({
|
|
1781
|
-
...
|
|
1780
|
+
...b.shape,
|
|
1781
|
+
...j.shape,
|
|
1782
1782
|
...O.shape,
|
|
1783
|
+
notification_type: e.string().enum(g.CommentLiked, g.CommentDeleted)
|
|
1784
|
+
}), or = e.object({
|
|
1785
|
+
...b.shape,
|
|
1786
|
+
...N.shape,
|
|
1783
1787
|
notification_type: e.string().enum(g.ReplyReplied),
|
|
1784
1788
|
comment_id: e.number(),
|
|
1785
1789
|
reply_to_reply_id: e.number(),
|
|
1786
1790
|
reply_to_reply_content: e.string()
|
|
1787
|
-
}),
|
|
1788
|
-
...
|
|
1789
|
-
...
|
|
1791
|
+
}), sr = e.object({
|
|
1792
|
+
...b.shape,
|
|
1793
|
+
...N.shape,
|
|
1790
1794
|
...j.shape,
|
|
1791
1795
|
notification_type: e.string().enum(g.ReplyLiked, g.ReplyDeleted)
|
|
1792
|
-
}),
|
|
1793
|
-
er,
|
|
1796
|
+
}), cr = e.union(
|
|
1794
1797
|
tr,
|
|
1795
1798
|
nr,
|
|
1796
1799
|
rr,
|
|
1797
1800
|
ar,
|
|
1798
1801
|
ir,
|
|
1799
|
-
or
|
|
1800
|
-
|
|
1802
|
+
or,
|
|
1803
|
+
sr
|
|
1804
|
+
).satisfies().lock(), ur = s({ forums: e.array(oe) }), lr = s({ topics: e.array(G) }), mr = s({ topic: G }), dr = s({ post: A }), z = s({
|
|
1801
1805
|
posts: e.array(A),
|
|
1802
1806
|
next_token: e.string().optional()
|
|
1803
|
-
}),
|
|
1807
|
+
}), gr = s({ post: A, antispam: se }), pr = s({
|
|
1804
1808
|
replies: e.array(V),
|
|
1805
1809
|
next_token: e.string().optional()
|
|
1806
|
-
}),
|
|
1810
|
+
}), _r = s({ reply: V }), br = s({
|
|
1807
1811
|
reply: V.clone().optional(),
|
|
1808
1812
|
antispam: se.clone().optional()
|
|
1809
|
-
}),
|
|
1813
|
+
}), yr = s({ comment: k }), fr = s({
|
|
1810
1814
|
comments: e.array(k),
|
|
1811
1815
|
next_token: e.string().optional()
|
|
1812
|
-
}),
|
|
1816
|
+
}), hr = s({
|
|
1813
1817
|
comment: k.clone().optional(),
|
|
1814
1818
|
antispam: k.clone().optional()
|
|
1815
|
-
}),
|
|
1816
|
-
notifications: e.array(
|
|
1819
|
+
}), wr = e.guard(Wn), kr = s({
|
|
1820
|
+
notifications: e.array(cr),
|
|
1817
1821
|
next_token: e.string().optional()
|
|
1818
|
-
}),
|
|
1822
|
+
}), vr = s({
|
|
1819
1823
|
system: e.number(),
|
|
1820
1824
|
comment: e.number(),
|
|
1821
1825
|
like: e.number()
|
|
1822
1826
|
});
|
|
1823
|
-
class
|
|
1827
|
+
class Gr {
|
|
1824
1828
|
token;
|
|
1825
1829
|
req;
|
|
1826
1830
|
constructor(t) {
|
|
@@ -1832,7 +1836,7 @@ class Dr {
|
|
|
1832
1836
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=QaqUa2K0z0
|
|
1833
1837
|
*/
|
|
1834
1838
|
async getForums(t) {
|
|
1835
|
-
const { data: n } = await this.req.get("community/forums",
|
|
1839
|
+
const { data: n } = await this.req.get("community/forums", ur, t);
|
|
1836
1840
|
return n?.forums || [];
|
|
1837
1841
|
}
|
|
1838
1842
|
/**
|
|
@@ -1841,7 +1845,7 @@ class Dr {
|
|
|
1841
1845
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=mIwpymAQom
|
|
1842
1846
|
*/
|
|
1843
1847
|
async getTopics(t) {
|
|
1844
|
-
const { data: n } = await this.req.get("community/topics",
|
|
1848
|
+
const { data: n } = await this.req.get("community/topics", lr, t);
|
|
1845
1849
|
return n?.topics || [];
|
|
1846
1850
|
}
|
|
1847
1851
|
/**
|
|
@@ -1850,7 +1854,7 @@ class Dr {
|
|
|
1850
1854
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Jvw7xMK31K
|
|
1851
1855
|
*/
|
|
1852
1856
|
async getTopic(t, n) {
|
|
1853
|
-
const { data: r, code: a } = await this.req.get("community/topic",
|
|
1857
|
+
const { data: r, code: a } = await this.req.get("community/topic", mr, {
|
|
1854
1858
|
...n,
|
|
1855
1859
|
params: { topic_id: t }
|
|
1856
1860
|
});
|
|
@@ -1892,7 +1896,7 @@ class Dr {
|
|
|
1892
1896
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=hj1AZy5rcP
|
|
1893
1897
|
*/
|
|
1894
1898
|
async getPost(t, n) {
|
|
1895
|
-
const { data: r, code: a, message: i } = await this.req.get("community/post",
|
|
1899
|
+
const { data: r, code: a, message: i } = await this.req.get("community/post", dr, {
|
|
1896
1900
|
...n,
|
|
1897
1901
|
params: { post_id: t }
|
|
1898
1902
|
});
|
|
@@ -1910,7 +1914,7 @@ class Dr {
|
|
|
1910
1914
|
const { data: r, code: a, message: i } = await this.req.post(
|
|
1911
1915
|
"community/post",
|
|
1912
1916
|
c(t),
|
|
1913
|
-
|
|
1917
|
+
gr,
|
|
1914
1918
|
n
|
|
1915
1919
|
);
|
|
1916
1920
|
return r ?? {
|
|
@@ -1924,7 +1928,7 @@ class Dr {
|
|
|
1924
1928
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=djKbX7lFdp
|
|
1925
1929
|
*/
|
|
1926
1930
|
async getComments(t, n) {
|
|
1927
|
-
const { data: r, code: a, message: i } = await this.req.get("community/comments",
|
|
1931
|
+
const { data: r, code: a, message: i } = await this.req.get("community/comments", fr, {
|
|
1928
1932
|
...n,
|
|
1929
1933
|
params: c(t)
|
|
1930
1934
|
});
|
|
@@ -1939,7 +1943,7 @@ class Dr {
|
|
|
1939
1943
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=RIc7oxVGae
|
|
1940
1944
|
*/
|
|
1941
1945
|
async getComment(t, n) {
|
|
1942
|
-
const { data: r, code: a, message: i } = await this.req.get("community/comment",
|
|
1946
|
+
const { data: r, code: a, message: i } = await this.req.get("community/comment", yr, {
|
|
1943
1947
|
...n,
|
|
1944
1948
|
params: { comment_id: t }
|
|
1945
1949
|
});
|
|
@@ -1958,7 +1962,7 @@ class Dr {
|
|
|
1958
1962
|
const { data: r, code: a, message: i } = await this.req.post(
|
|
1959
1963
|
"community/comment",
|
|
1960
1964
|
c(t),
|
|
1961
|
-
|
|
1965
|
+
hr,
|
|
1962
1966
|
n
|
|
1963
1967
|
);
|
|
1964
1968
|
return r ?? {
|
|
@@ -1972,7 +1976,7 @@ class Dr {
|
|
|
1972
1976
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=sVKBbY83MY
|
|
1973
1977
|
*/
|
|
1974
1978
|
async getReplies(t, n) {
|
|
1975
|
-
const { data: r } = await this.req.get("community/replies",
|
|
1979
|
+
const { data: r } = await this.req.get("community/replies", pr, {
|
|
1976
1980
|
...n,
|
|
1977
1981
|
params: c({ max_results: 20, ...t })
|
|
1978
1982
|
});
|
|
@@ -1987,7 +1991,7 @@ class Dr {
|
|
|
1987
1991
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=kxhcSXD3MG
|
|
1988
1992
|
*/
|
|
1989
1993
|
async getReply(t, n) {
|
|
1990
|
-
const { data: r, code: a, message: i } = await this.req.get("community/reply",
|
|
1994
|
+
const { data: r, code: a, message: i } = await this.req.get("community/reply", _r, {
|
|
1991
1995
|
...n,
|
|
1992
1996
|
params: { reply_id: t }
|
|
1993
1997
|
});
|
|
@@ -2006,7 +2010,7 @@ class Dr {
|
|
|
2006
2010
|
const { data: r, code: a, message: i } = await this.req.post(
|
|
2007
2011
|
"community/reply",
|
|
2008
2012
|
c(t),
|
|
2009
|
-
|
|
2013
|
+
br,
|
|
2010
2014
|
n
|
|
2011
2015
|
);
|
|
2012
2016
|
return r ?? {
|
|
@@ -2057,7 +2061,7 @@ class Dr {
|
|
|
2057
2061
|
*/
|
|
2058
2062
|
async getMediaPresignedUrl(t, n) {
|
|
2059
2063
|
await this.token.autoLogin();
|
|
2060
|
-
const { data: r } = await this.req.get("community/media-presign-url",
|
|
2064
|
+
const { data: r } = await this.req.get("community/media-presign-url", wr, {
|
|
2061
2065
|
...n,
|
|
2062
2066
|
params: t
|
|
2063
2067
|
});
|
|
@@ -2072,7 +2076,7 @@ class Dr {
|
|
|
2072
2076
|
*/
|
|
2073
2077
|
async getNotifications(t, n) {
|
|
2074
2078
|
await this.token.autoLogin();
|
|
2075
|
-
const { data: r } = await this.req.get("community/notifications",
|
|
2079
|
+
const { data: r } = await this.req.get("community/notifications", kr, {
|
|
2076
2080
|
...n,
|
|
2077
2081
|
params: c({ max_results: 20, ...t })
|
|
2078
2082
|
});
|
|
@@ -2090,7 +2094,7 @@ class Dr {
|
|
|
2090
2094
|
if (!await this.token.autoLogin()) return null;
|
|
2091
2095
|
const { data: n } = await this.req.get(
|
|
2092
2096
|
"community/unread-notifications-count",
|
|
2093
|
-
|
|
2097
|
+
vr,
|
|
2094
2098
|
t
|
|
2095
2099
|
);
|
|
2096
2100
|
return n;
|
|
@@ -2106,17 +2110,17 @@ class Dr {
|
|
|
2106
2110
|
return r;
|
|
2107
2111
|
}
|
|
2108
2112
|
}
|
|
2109
|
-
const
|
|
2113
|
+
const Cr = s({
|
|
2110
2114
|
nonce_str: e.string(),
|
|
2111
2115
|
timestamp: e.number(),
|
|
2112
2116
|
signature: e.string()
|
|
2113
2117
|
});
|
|
2114
|
-
var
|
|
2118
|
+
var Rr = /* @__PURE__ */ ((o) => (o.RedirectUriDisMatch = "10003", o.AppidError = "10016", o.AuthorizationError = "10015", o.NoRightForScope = "10005", o.Frequently = "10009", o.AppBanded = "10004", o.ShouldFollow = "10006", o.ScopeNull = "10010", o.RedirectUriNull = "10011", o.AppidNull = "10012", o.StateNull = "10013", o))(Rr || {});
|
|
2115
2119
|
function L(o) {
|
|
2116
2120
|
return v(o, "open_id", "union_id", "weixin_token");
|
|
2117
2121
|
}
|
|
2118
2122
|
const J = "wx_login_cache";
|
|
2119
|
-
class
|
|
2123
|
+
class Ar {
|
|
2120
2124
|
token;
|
|
2121
2125
|
$appid;
|
|
2122
2126
|
req;
|
|
@@ -2150,7 +2154,7 @@ class Ir {
|
|
|
2150
2154
|
const t = this.token.storage.get(J);
|
|
2151
2155
|
if (!t)
|
|
2152
2156
|
return null;
|
|
2153
|
-
const n =
|
|
2157
|
+
const n = _e(t);
|
|
2154
2158
|
return L(n) ? (this.token.weixinToken = n.weixin_token, await this.token.autoLogin(), n) : null;
|
|
2155
2159
|
}
|
|
2156
2160
|
/**
|
|
@@ -2171,12 +2175,12 @@ class Ir {
|
|
|
2171
2175
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=GwIZ0givCb
|
|
2172
2176
|
*/
|
|
2173
2177
|
async login(t) {
|
|
2174
|
-
if (!
|
|
2178
|
+
if (!f())
|
|
2175
2179
|
throw new Error("当前环境非微信小程序");
|
|
2176
2180
|
const n = await this.getLoginCache();
|
|
2177
2181
|
if (n)
|
|
2178
2182
|
return n;
|
|
2179
|
-
const r = await
|
|
2183
|
+
const r = await fe(), { data: a, code: i, message: d } = await this.req.post(
|
|
2180
2184
|
"weixin/login",
|
|
2181
2185
|
{ code: r, appid: this.appid },
|
|
2182
2186
|
L,
|
|
@@ -2221,12 +2225,12 @@ class Ir {
|
|
|
2221
2225
|
"replaceState" in history && history.replaceState({}, "", d);
|
|
2222
2226
|
const {
|
|
2223
2227
|
data: m,
|
|
2224
|
-
code:
|
|
2228
|
+
code: y,
|
|
2225
2229
|
message: ce
|
|
2226
2230
|
} = await this.req.post("weixin/login", { code: r, appid: this.appid }, L, n);
|
|
2227
2231
|
return m && (this.token.weixinToken = m.weixin_token, await this.token.autoLogin()), m ?? {
|
|
2228
2232
|
message: ce,
|
|
2229
|
-
error:
|
|
2233
|
+
error: y
|
|
2230
2234
|
};
|
|
2231
2235
|
}
|
|
2232
2236
|
/**
|
|
@@ -2256,7 +2260,7 @@ class Ir {
|
|
|
2256
2260
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=CuWOqxr9Ue
|
|
2257
2261
|
*/
|
|
2258
2262
|
async getJSSDKConfig(t) {
|
|
2259
|
-
const { data: n } = await this.req.get("weixin/offiaccount/jssdk-sign",
|
|
2263
|
+
const { data: n } = await this.req.get("weixin/offiaccount/jssdk-sign", Cr, {
|
|
2260
2264
|
...t,
|
|
2261
2265
|
params: {
|
|
2262
2266
|
appid: this.appid,
|
|
@@ -2273,145 +2277,145 @@ class Ir {
|
|
|
2273
2277
|
}
|
|
2274
2278
|
export {
|
|
2275
2279
|
se as AntispamValidator,
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2280
|
+
qr as AuthToken,
|
|
2281
|
+
on as CashbackEngagementDataValidator,
|
|
2282
|
+
sn as ClaimActivationKeyEngagementDataValidator,
|
|
2279
2283
|
_ as ClaimRewardStatus,
|
|
2280
2284
|
$ as ClaimRewardStatusValidator,
|
|
2281
|
-
|
|
2285
|
+
Ln as ClaimedItemValidator,
|
|
2282
2286
|
Y as ClubAddressValidator,
|
|
2283
|
-
|
|
2287
|
+
Sr as ClubApi,
|
|
2284
2288
|
W as ClubBenefitSummaryValidator,
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2289
|
+
Ie as ClubBenefitValidator,
|
|
2290
|
+
Ve as ClubCreditChangeScene,
|
|
2291
|
+
je as ClubCreditChangeSceneValidator,
|
|
2292
|
+
Ce as ClubCreditChangeType,
|
|
2293
|
+
Re as ClubCreditChangeTypeValidator,
|
|
2294
|
+
De as ClubCreditLogValidator,
|
|
2295
|
+
Se as ClubGlobalConfigValidator,
|
|
2296
|
+
Te as ClubItemType,
|
|
2293
2297
|
Z as ClubItemTypeValidator,
|
|
2294
|
-
|
|
2298
|
+
Le as ClubPlayerValidator,
|
|
2295
2299
|
ee as ClubProductValidator,
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2300
|
+
qe as ClubRedemptionStatus,
|
|
2301
|
+
xe as ClubRedemptionStatusValidator,
|
|
2302
|
+
Fe as ClubUserCreditValidator,
|
|
2303
|
+
Ue as ClubUserProfileValidator,
|
|
2304
|
+
Rn as CommentEngagementValidator,
|
|
2301
2305
|
k as CommentValidator,
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2306
|
+
Gr as CommunityApi,
|
|
2307
|
+
Xe as EngageAccountType,
|
|
2308
|
+
Ye as EngageAccountTypeValidator,
|
|
2309
|
+
Sn as EngageResponseValidator,
|
|
2310
|
+
jn as EngageRewardValidator,
|
|
2311
|
+
Dr as EventApi,
|
|
2312
|
+
an as EventConfigValidator,
|
|
2313
|
+
pt as EventFeatureConfigOfCashbackValidator,
|
|
2314
|
+
bt as EventFeatureConfigOfCheckInValidator,
|
|
2315
|
+
ft as EventFeatureConfigOfClaimActivationKeyValidator,
|
|
2316
|
+
wt as EventFeatureConfigOfClaimRewardsValidator,
|
|
2317
|
+
vt as EventFeatureConfigOfCommentValidator,
|
|
2318
|
+
Rt as EventFeatureConfigOfFollowValidator,
|
|
2319
|
+
Tt as EventFeatureConfigOfGiftCodeValidator,
|
|
2320
|
+
xt as EventFeatureConfigOfInviteValidator,
|
|
2321
|
+
Lt as EventFeatureConfigOfInvitedRegisterValidator,
|
|
2322
|
+
Dt as EventFeatureConfigOfLotteryDrawValidator,
|
|
2323
|
+
Ut as EventFeatureConfigOfLotteryValidator,
|
|
2324
|
+
Gt as EventFeatureConfigOfPreregisterValidator,
|
|
2325
|
+
Ot as EventFeatureConfigOfQuestValidator,
|
|
2326
|
+
Bt as EventFeatureConfigOfRegisterValidator,
|
|
2327
|
+
Mt as EventFeatureConfigOfShareValidator,
|
|
2328
|
+
Ht as EventFeatureConfigOfSubscribeValidator,
|
|
2329
|
+
Jt as EventFeatureConfigOfSurveyValidator,
|
|
2330
|
+
Xt as EventFeatureConfigOfTeamValidator,
|
|
2331
|
+
en as EventFeatureConfigOfVoteValidator,
|
|
2332
|
+
rn as EventFeatureConfigValidator,
|
|
2333
|
+
We as EventPeriodType,
|
|
2334
|
+
et as EventPeriodTypeValidator,
|
|
2331
2335
|
F as EventRewardItemConfigValidator,
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2336
|
+
Ae as ExtraGameRewardValidator,
|
|
2337
|
+
Ge as ExtraPhysicalShipmentValidator,
|
|
2338
|
+
dt as FeatureRewardValidator,
|
|
2335
2339
|
u as FeatureType,
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2340
|
+
tt as FeatureTypeValidator,
|
|
2341
|
+
Hn as ForumMode,
|
|
2342
|
+
zn as ForumModeValidator,
|
|
2339
2343
|
oe as ForumValidator,
|
|
2340
2344
|
R as GamerItemType,
|
|
2341
2345
|
te as GamerItemTypeValidator,
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2346
|
+
ke as Gender,
|
|
2347
|
+
ve as GenderValidator,
|
|
2348
|
+
cn as GiftCodeEngagementDataValidator,
|
|
2349
|
+
un as InviteEngagementDataValidator,
|
|
2350
|
+
ut as LotteryDrawAction,
|
|
2351
|
+
Ur as LotteryDrawActionValidator,
|
|
2352
|
+
gn as LotteryDrawEngagementDataValidator,
|
|
2353
|
+
ln as LotteryEngagementDataValidator,
|
|
2350
2354
|
w as LotteryTicketStatus,
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2355
|
+
Pr as LotteryTicketStatusValidator,
|
|
2356
|
+
b as NotificationBaseValidator,
|
|
2357
|
+
Zn as NotificationCategory,
|
|
2358
|
+
Ir as NotificationCategoryValidator,
|
|
2359
|
+
ar as NotificationCommentReplyValidator,
|
|
2360
|
+
ir as NotificationCommentValidator,
|
|
2357
2361
|
j as NotificationPayloadCommentValidator,
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2362
|
+
O as NotificationPayloadPostValidator,
|
|
2363
|
+
N as NotificationPayloadReplyValidator,
|
|
2364
|
+
er as NotificationPayloadSystemValidator,
|
|
2365
|
+
rr as NotificationPostCommentValidator,
|
|
2366
|
+
nr as NotificationPostValidator,
|
|
2367
|
+
or as NotificationReplyRepliedValidator,
|
|
2368
|
+
sr as NotificationReplyValidator,
|
|
2369
|
+
tr as NotificationSystemValidator,
|
|
2366
2370
|
g as NotificationType,
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2371
|
+
Xn as NotificationTypeValidator,
|
|
2372
|
+
cr as NotificationValidator,
|
|
2373
|
+
$e as PlayerRoleCardValidator,
|
|
2370
2374
|
X as PlayerRoleValidator,
|
|
2371
|
-
|
|
2375
|
+
Jn as PostStatus,
|
|
2372
2376
|
ie as PostStatusValidator,
|
|
2373
2377
|
A as PostValidator,
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
+
pn as PreregisterEngagementDataValidator,
|
|
2379
|
+
Wn as PresignedUrlResponseValidator,
|
|
2380
|
+
_n as QuestEngagementDataValidator,
|
|
2381
|
+
nt as QuestObjective,
|
|
2378
2382
|
re as QuestObjectiveValidator,
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
+
xr as RedeemParamsValidator,
|
|
2384
|
+
Oe as RedemptionValidator,
|
|
2385
|
+
mt as RegularRewardValidator,
|
|
2386
|
+
Yn as ReplyToValidator,
|
|
2383
2387
|
V as ReplyValidator,
|
|
2384
|
-
|
|
2388
|
+
Lr as RewardItemType,
|
|
2385
2389
|
ne as RewardItemTypeValidator,
|
|
2386
|
-
|
|
2390
|
+
it as RewardSource,
|
|
2387
2391
|
U as RewardSourceValidator,
|
|
2388
2392
|
p as RewardStatus,
|
|
2389
2393
|
P as RewardStatusSuffix,
|
|
2390
2394
|
ae as RewardStatusSuffixValidator,
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2395
|
+
Er as RewardStatusValidator,
|
|
2396
|
+
Vn as RewardValidator,
|
|
2397
|
+
Pe as RoleBaseInfoValidator,
|
|
2398
|
+
Ee as ServerBaseInfoValidator,
|
|
2399
|
+
bn as ShareEngagementDataValidator,
|
|
2400
|
+
fn as SurveyEngagementDataValidator,
|
|
2401
|
+
ct as TeamAction,
|
|
2402
|
+
$r as TeamActionValidator,
|
|
2403
|
+
wn as TeamEngagementDataValidator,
|
|
2404
|
+
hn as TeamEngagementValidator,
|
|
2405
|
+
Fr as TeamMemberValidator,
|
|
2406
|
+
ot as TeamVisibility,
|
|
2407
|
+
st as TeamVisibilityValidator,
|
|
2404
2408
|
G as TopicValidator,
|
|
2405
2409
|
I as UserEngagementDataValidator,
|
|
2406
|
-
|
|
2407
|
-
|
|
2410
|
+
Tn as UserEngagementValidator,
|
|
2411
|
+
xn as UserFeatureStatusValidator,
|
|
2408
2412
|
D as UserRewardValidator,
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2413
|
+
qn as VerifyMobileResultValidator,
|
|
2414
|
+
kn as VoteEngagementDataValidator,
|
|
2415
|
+
rt as VoteOptionSource,
|
|
2416
|
+
at as VoteOptionSourceValidator,
|
|
2417
|
+
Ar as WeixinApi,
|
|
2418
|
+
yn as WeixinSubscribeEngagementDataValidator,
|
|
2419
|
+
Rr as WeixinWebLoginErrorCode,
|
|
2420
|
+
Cr as isWeixinSignResponse
|
|
2417
2421
|
};
|