@seayoo-web/gamer-api 2.8.2 → 2.8.4
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 +405 -395
- package/package.json +6 -6
- package/types/src/event.config/feature.base.d.ts +2 -0
- package/types/src/event.config/feature.lottery.d.ts +1 -1
- package/types/src/event.config/feature.quest.d.ts +4 -2
- package/types/src/event.config/reward.d.ts +1 -1
- package/types/src/event.enums.d.ts +28 -0
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { isComboWebView as
|
|
2
|
-
import { isPlainObject as v, supportWx as f, useConsole as
|
|
1
|
+
import { isComboWebView as me } from "@seayoo-web/combo-webview";
|
|
2
|
+
import { isPlainObject as v, supportWx as f, useConsole as de, usePromise as ge, pruneURL as pe, supportWindow as _e, queryString as E, pruneObject as c, omitFields as C, parseJSON as be, removePara as Q } from "@seayoo-web/utils";
|
|
3
3
|
import { v as e, objectGuard as s } from "@seayoo-web/validator";
|
|
4
|
-
function
|
|
4
|
+
function ye(o) {
|
|
5
5
|
return v(o, "gamer_token") && typeof o.gamer_token == "string";
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function B(o) {
|
|
8
8
|
return v(o);
|
|
9
9
|
}
|
|
10
|
-
const T =
|
|
11
|
-
function
|
|
10
|
+
const T = de("GamerApiSDK");
|
|
11
|
+
function fe(o) {
|
|
12
12
|
return /^\/[a-z\d-]+$/.test(o);
|
|
13
13
|
}
|
|
14
|
-
async function
|
|
15
|
-
const { promise: o, resolve: t } =
|
|
14
|
+
async function he() {
|
|
15
|
+
const { promise: o, 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 o;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const we = {
|
|
26
26
|
get(o) {
|
|
27
27
|
return localStorage.getItem(o) || "";
|
|
28
28
|
},
|
|
@@ -32,7 +32,7 @@ const he = {
|
|
|
32
32
|
remove(o) {
|
|
33
33
|
localStorage.removeItem(o);
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, ke = {
|
|
36
36
|
get(o) {
|
|
37
37
|
try {
|
|
38
38
|
if (f()) return wx.getStorageSync(o) || "";
|
|
@@ -56,7 +56,7 @@ const he = {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}, h = "gamer_token";
|
|
59
|
-
class
|
|
59
|
+
class Sr {
|
|
60
60
|
$NetRequest;
|
|
61
61
|
$idToken = "";
|
|
62
62
|
$weixinToken = "";
|
|
@@ -64,8 +64,8 @@ class qr {
|
|
|
64
64
|
req;
|
|
65
65
|
storage;
|
|
66
66
|
constructor(t, n) {
|
|
67
|
-
this.storage = f() ?
|
|
68
|
-
const r =
|
|
67
|
+
this.storage = f() ? 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 qr {
|
|
|
86
86
|
requestTransformer: (a) => {
|
|
87
87
|
this.$gamerToken && (a.headers.Authorization = `Bearer ${this.$gamerToken}`);
|
|
88
88
|
}
|
|
89
|
-
}),
|
|
89
|
+
}), _e()) {
|
|
90
90
|
const a = /^(?:localhost|[\d.]+):\d{4}$/.test(location.host), i = E("gamer_token");
|
|
91
|
-
(
|
|
91
|
+
(me() || a && i) && (this.$gamerToken = i);
|
|
92
92
|
}
|
|
93
93
|
this.$gamerToken || this.loadGamerTokenCache();
|
|
94
94
|
}
|
|
@@ -171,7 +171,7 @@ class qr {
|
|
|
171
171
|
const { code: n, data: r } = await this.req.post(
|
|
172
172
|
"login-with-token",
|
|
173
173
|
c({ id_token: this.idToken, weixin_token: t ? this.weixinToken : null }),
|
|
174
|
-
|
|
174
|
+
ye,
|
|
175
175
|
{
|
|
176
176
|
message: !1,
|
|
177
177
|
cacheTTL: 300,
|
|
@@ -197,7 +197,7 @@ class qr {
|
|
|
197
197
|
*/
|
|
198
198
|
async getSession() {
|
|
199
199
|
if (!await this.autoLogin()) return null;
|
|
200
|
-
const { data: t } = await this.req.get("session",
|
|
200
|
+
const { data: t } = await this.req.get("session", B, {
|
|
201
201
|
message: !1
|
|
202
202
|
});
|
|
203
203
|
return t;
|
|
@@ -209,25 +209,25 @@ class qr {
|
|
|
209
209
|
*/
|
|
210
210
|
async authRealName(t) {
|
|
211
211
|
if (!await this.autoLogin()) return null;
|
|
212
|
-
const { data: n } = await this.req.post("auth-real-name", c(t),
|
|
212
|
+
const { data: n } = await this.req.post("auth-real-name", c(t), B);
|
|
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
|
+
}, Ce = e.string().enum(ve).lock(), Ve = {
|
|
224
224
|
/** 积分增加 */
|
|
225
225
|
Increase: "increase",
|
|
226
226
|
/** 积分减少 */
|
|
227
227
|
Decrease: "decrease",
|
|
228
228
|
/** 积分过期 */
|
|
229
229
|
Expired: "expired"
|
|
230
|
-
}, Re = e.string().enum(
|
|
230
|
+
}, Re = e.string().enum(Ve).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
|
-
}, Z = e.string().enum(
|
|
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(), Ee = e.object({
|
|
276
276
|
member_id: e.string(),
|
|
277
277
|
player_id: e.string(),
|
|
278
278
|
exp: e.number(),
|
|
@@ -281,18 +281,18 @@ const 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(), Pe = e.object({
|
|
285
285
|
server_id: e.string(),
|
|
286
286
|
server_name: e.string()
|
|
287
|
-
}).lock(),
|
|
287
|
+
}).lock(), $e = e.object({
|
|
288
288
|
role_id: e.string(),
|
|
289
289
|
role_name: e.string()
|
|
290
290
|
}).lock(), X = e.object({
|
|
291
|
+
...$e.shape,
|
|
291
292
|
...Pe.shape,
|
|
292
|
-
...Ee.shape,
|
|
293
293
|
role_level: e.number(),
|
|
294
294
|
last_login_time: e.number()
|
|
295
|
-
}).lock(),
|
|
295
|
+
}).lock(), Ue = e.object({
|
|
296
296
|
...X.shape,
|
|
297
297
|
/** 角色战力 */
|
|
298
298
|
role_fighting: e.number(),
|
|
@@ -302,11 +302,11 @@ const ke = {
|
|
|
302
302
|
kin_name: e.string().optional(),
|
|
303
303
|
/** 宗门职位 */
|
|
304
304
|
kin_position: e.string().optional()
|
|
305
|
-
}).lock(),
|
|
305
|
+
}).lock(), Fe = e.object({
|
|
306
306
|
name: e.string(),
|
|
307
307
|
avatar_url: e.string(),
|
|
308
308
|
bio: e.string(),
|
|
309
|
-
gender:
|
|
309
|
+
gender: Ce,
|
|
310
310
|
birthday: e.object({ year: e.number(), month: e.number(), day: e.number() })
|
|
311
311
|
}).lock(), Y = e.object({
|
|
312
312
|
address_id: e.number(),
|
|
@@ -317,15 +317,15 @@ const 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
327
|
change_type: Re,
|
|
328
|
-
change_scene:
|
|
328
|
+
change_scene: Te,
|
|
329
329
|
change_credit: e.number(),
|
|
330
330
|
balance: e.number(),
|
|
331
331
|
change_time: e.number()
|
|
@@ -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(),
|
|
367
|
+
}).lock(), Ae = e.object({
|
|
368
368
|
...C(W.shape, "tag"),
|
|
369
369
|
product: ee.clone().optional()
|
|
370
|
-
}).lock(),
|
|
370
|
+
}).lock(), Lr = e.union(
|
|
371
371
|
e.object({
|
|
372
372
|
server_id: e.string(),
|
|
373
373
|
role_id: e.string()
|
|
@@ -384,11 +384,11 @@ 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(),
|
|
@@ -399,17 +399,17 @@ const ke = {
|
|
|
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(Ge.clone(),
|
|
405
|
-
}),
|
|
406
|
-
credit_logs: e.array(
|
|
404
|
+
extra_data: e.union(Ge.clone(), Oe.clone()).satisfies().optional()
|
|
405
|
+
}), Qe = e.guard(Le), M = s({ player: Ee }), Be = s({ roles: e.array(X) }), q = s({ role_card: Ue }), K = e.guard(Fe), H = e.guard(Y), Me = s({ addresses: e.array(Y) }), 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(ee) }), Je = s({ benefits: e.array(W) }), Ze = s({ benefit: Ae }), Xe = s({
|
|
409
|
+
redemptions: e.array(Ne),
|
|
410
410
|
next_token: e.string().optional()
|
|
411
411
|
});
|
|
412
|
-
class
|
|
412
|
+
class Er {
|
|
413
413
|
token;
|
|
414
414
|
req;
|
|
415
415
|
constructor(t) {
|
|
@@ -421,7 +421,7 @@ class Sr {
|
|
|
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
|
/**
|
|
@@ -534,7 +534,7 @@ class Sr {
|
|
|
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 Sr {
|
|
|
582
582
|
*/
|
|
583
583
|
async getUserCredit(t, n) {
|
|
584
584
|
await this.token.autoLogin();
|
|
585
|
-
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", Ke, {
|
|
586
586
|
...n,
|
|
587
587
|
params: c(t)
|
|
588
588
|
});
|
|
@@ -598,7 +598,7 @@ class Sr {
|
|
|
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 Sr {
|
|
|
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 Sr {
|
|
|
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 Sr {
|
|
|
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 Sr {
|
|
|
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
|
});
|
|
@@ -672,7 +672,7 @@ class Sr {
|
|
|
672
672
|
};
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
|
-
const
|
|
675
|
+
const V = {
|
|
676
676
|
/** 活动道具 */
|
|
677
677
|
EventItem: "event_item",
|
|
678
678
|
/** 游戏内道具 */
|
|
@@ -693,17 +693,17 @@ const R = {
|
|
|
693
693
|
ExternalCode: "external_gift_code",
|
|
694
694
|
/** 空奖励 */
|
|
695
695
|
VoidItem: "void_item"
|
|
696
|
-
}, te = e.string().enum(
|
|
696
|
+
}, te = e.string().enum(V).lock(), Pr = V, ne = te, 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(), u = {
|
|
707
707
|
/** 预约 */
|
|
708
708
|
Preregister: "preregister",
|
|
709
709
|
/** 抽奖 */
|
|
@@ -744,7 +744,7 @@ const R = {
|
|
|
744
744
|
ClaimActivationKey: "claim_activation_key",
|
|
745
745
|
/** 不朽箴言特有的 AI 聊天 */
|
|
746
746
|
ZeroChatgpt: "zero_chatgpt"
|
|
747
|
-
},
|
|
747
|
+
}, nt = e.string().enum(u).lock(), rt = {
|
|
748
748
|
/** 累计游戏内活跃值 */
|
|
749
749
|
Active: "player_active_points",
|
|
750
750
|
/** 累计登录,单位 人天 */
|
|
@@ -763,14 +763,14 @@ const R = {
|
|
|
763
763
|
PlayerLevel: "player_level",
|
|
764
764
|
/** 活动道具累计获取 */
|
|
765
765
|
EventItems: "event_items"
|
|
766
|
-
}, re = e.string().enum(
|
|
766
|
+
}, re = e.string().enum(rt).lock(), at = {
|
|
767
767
|
/** 官方上传 */
|
|
768
768
|
System: "system",
|
|
769
769
|
/** 用户投稿 */
|
|
770
770
|
UserSubmission: "user_submission",
|
|
771
771
|
/** 投票入围 */
|
|
772
772
|
Shortlisted: "shortlisted"
|
|
773
|
-
},
|
|
773
|
+
}, it = e.string().enum(at).lock(), p = {
|
|
774
774
|
/** 未获得奖励 */
|
|
775
775
|
Ineligible: "ineligible",
|
|
776
776
|
/** 奖励未领取 */
|
|
@@ -781,7 +781,7 @@ const R = {
|
|
|
781
781
|
Failed: "failed",
|
|
782
782
|
/** 奖励已发货 */
|
|
783
783
|
Delivered: "delivered"
|
|
784
|
-
},
|
|
784
|
+
}, $r = e.string().enum(p).lock(), P = {
|
|
785
785
|
/**
|
|
786
786
|
* 奖励未领取,拼写错误以兼容后端历史版本,检查请使用 Unclaimed
|
|
787
787
|
*
|
|
@@ -813,17 +813,17 @@ const R = {
|
|
|
813
813
|
Failed: p.Failed,
|
|
814
814
|
/** 奖励已发货 */
|
|
815
815
|
Delivered: p.Delivered
|
|
816
|
-
}, $ = e.string().enum(_).lock(),
|
|
816
|
+
}, $ = e.string().enum(_).lock(), ot = {
|
|
817
817
|
/** 玩法产出奖励 */
|
|
818
818
|
Output: "output",
|
|
819
819
|
/** 玩法参与奖励 */
|
|
820
820
|
Engage: "engage"
|
|
821
|
-
}, U = e.string().enum(
|
|
821
|
+
}, U = e.string().enum(ot).lock(), st = {
|
|
822
822
|
/** 私有队伍 */
|
|
823
823
|
Private: "private",
|
|
824
824
|
/** 公开队伍 */
|
|
825
825
|
Public: "public"
|
|
826
|
-
},
|
|
826
|
+
}, ct = e.string().enum(st).lock(), w = {
|
|
827
827
|
/** 未知状态 */
|
|
828
828
|
Unknown: "unknown",
|
|
829
829
|
/** 等待开奖 */
|
|
@@ -834,7 +834,7 @@ const R = {
|
|
|
834
834
|
Claimed: "claimed",
|
|
835
835
|
/** 领奖失败 */
|
|
836
836
|
Fail: "fail"
|
|
837
|
-
},
|
|
837
|
+
}, Ur = e.string().enum(w).lock(), ut = {
|
|
838
838
|
/** 发起组队 */
|
|
839
839
|
Assemble: "assemble",
|
|
840
840
|
/** 加入队伍 */
|
|
@@ -845,72 +845,78 @@ const R = {
|
|
|
845
845
|
ChangeVisibility: "change_visibility",
|
|
846
846
|
/** 查询组队信息 */
|
|
847
847
|
Query: "query"
|
|
848
|
-
},
|
|
848
|
+
}, Fr = e.string().enum(ut).lock(), lt = {
|
|
849
849
|
/** 查询抽奖券 */
|
|
850
850
|
Query: "query",
|
|
851
851
|
/** 开奖 */
|
|
852
852
|
Draw: "draw",
|
|
853
853
|
/** 领奖 */
|
|
854
854
|
Claim: "claim"
|
|
855
|
-
},
|
|
855
|
+
}, Ir = e.string().enum(lt).lock(), ie = {
|
|
856
|
+
/** 将所有队员的进度值求和,作为队伍进度值 */
|
|
857
|
+
Sum: "sum",
|
|
858
|
+
/** 以进度值倒序排名第 N 的队员的进度值,作为队伍进度值。如果队伍人数不足 N,则队伍进度值为 0。N 的值来自于配置字段 top_n */
|
|
859
|
+
TopN: "top_n"
|
|
860
|
+
}, Dr = e.string().enum(ie).lock(), mt = e.string().enum(ie).optional().lock(), dt = e.string().enum(C(V, "GiftCode", "LotteryTicket")), F = e.object({
|
|
856
861
|
reward_item_id: e.number(),
|
|
857
862
|
reward_amount: e.number(),
|
|
858
863
|
reward_item_name: e.string(),
|
|
859
864
|
reward_item_icon_url: e.string(),
|
|
860
865
|
reward_item_desc: e.string().optional(),
|
|
861
|
-
reward_item_type:
|
|
866
|
+
reward_item_type: dt,
|
|
862
867
|
reward_item_rating: e.number()
|
|
863
|
-
}).lock(),
|
|
868
|
+
}).lock(), gt = e.object({
|
|
864
869
|
engage_count: e.number(),
|
|
865
870
|
rewards: e.array(F)
|
|
866
|
-
}).lock(),
|
|
871
|
+
}).lock(), pt = e.union(
|
|
867
872
|
e.object({
|
|
868
873
|
feature_reward_type: e.string().enum("every"),
|
|
869
874
|
reward_details: e.array(F)
|
|
870
875
|
}),
|
|
871
876
|
e.object({
|
|
872
877
|
feature_reward_type: e.string().enum("regular"),
|
|
873
|
-
reward_details: e.array(
|
|
878
|
+
reward_details: e.array(gt)
|
|
874
879
|
})
|
|
875
880
|
).satisfies().lock(), l = e.object({
|
|
876
881
|
feature_name: e.string(),
|
|
877
882
|
feature_id: e.number(),
|
|
878
883
|
description: e.string(),
|
|
879
|
-
cycle:
|
|
884
|
+
cycle: tt,
|
|
880
885
|
cycle_limit: e.number(),
|
|
881
886
|
limit: e.number(),
|
|
882
887
|
since: e.number(),
|
|
883
888
|
until: e.number(),
|
|
884
|
-
engage_account:
|
|
885
|
-
feature_rewards:
|
|
886
|
-
|
|
889
|
+
engage_account: We,
|
|
890
|
+
feature_rewards: pt.clone().optional(),
|
|
891
|
+
sort: e.number().optional()
|
|
892
|
+
}), _t = u.Cashback, bt = e.object({
|
|
887
893
|
...l.shape,
|
|
888
|
-
feature_type: e.string().enum(
|
|
894
|
+
feature_type: e.string().enum(_t),
|
|
889
895
|
config: e.object({
|
|
890
896
|
order_start_time: e.number(),
|
|
891
897
|
order_end_time: e.number(),
|
|
892
898
|
claim_rewards_start_time: e.number(),
|
|
893
899
|
claim_rewards_end_time: e.number()
|
|
894
900
|
})
|
|
895
|
-
}),
|
|
896
|
-
...l.shape,
|
|
897
|
-
feature_type: e.string().enum(_t)
|
|
898
|
-
}), yt = u.ClaimActivationKey, ft = e.object({
|
|
901
|
+
}), yt = u.CheckIn, ft = e.object({
|
|
899
902
|
...l.shape,
|
|
900
903
|
feature_type: e.string().enum(yt)
|
|
901
|
-
}), ht = u.
|
|
904
|
+
}), ht = u.ClaimActivationKey, wt = e.object({
|
|
902
905
|
...l.shape,
|
|
903
906
|
feature_type: e.string().enum(ht)
|
|
904
|
-
}), kt = u.
|
|
907
|
+
}), kt = u.ClaimRewards, vt = e.object({
|
|
908
|
+
...l.shape,
|
|
909
|
+
feature_type: e.string().enum(kt)
|
|
910
|
+
}), Ct = u.Comment, Vt = e.object({
|
|
905
911
|
...l.shape,
|
|
906
|
-
feature_type: e.string().enum(
|
|
912
|
+
feature_type: e.string().enum(Ct),
|
|
907
913
|
config: e.object({
|
|
908
914
|
comments: e.array(e.string()),
|
|
909
915
|
send_rate: e.number()
|
|
910
916
|
})
|
|
911
|
-
}),
|
|
917
|
+
}), Rt = u.Follow, jt = e.object({
|
|
912
918
|
...l.shape,
|
|
913
|
-
feature_type: e.string().enum(
|
|
919
|
+
feature_type: e.string().enum(Rt),
|
|
914
920
|
config: e.object({
|
|
915
921
|
platform: e.string(),
|
|
916
922
|
platform_icon: e.string().optional(),
|
|
@@ -918,106 +924,107 @@ const R = {
|
|
|
918
924
|
qr_code_url: e.string().optional(),
|
|
919
925
|
platform_desc: e.string().optional()
|
|
920
926
|
})
|
|
921
|
-
}),
|
|
927
|
+
}), Tt = u.GiftCode, qt = e.object({
|
|
922
928
|
name: e.string(),
|
|
923
929
|
icon_url: e.string(),
|
|
924
930
|
count: e.number()
|
|
925
|
-
}),
|
|
931
|
+
}), xt = e.object({
|
|
926
932
|
...l.shape,
|
|
927
|
-
feature_type: e.string().enum(
|
|
933
|
+
feature_type: e.string().enum(Tt),
|
|
928
934
|
config: e.object({
|
|
929
|
-
gift_items: e.array(
|
|
935
|
+
gift_items: e.array(qt),
|
|
930
936
|
mp_url: e.string().optional(),
|
|
931
937
|
mp_qrcode_url: e.string().optional()
|
|
932
938
|
})
|
|
933
|
-
}),
|
|
939
|
+
}), St = u.Invite, Lt = e.object({
|
|
934
940
|
...l.shape,
|
|
935
|
-
feature_type: e.string().enum(
|
|
941
|
+
feature_type: e.string().enum(St),
|
|
936
942
|
config: e.object({
|
|
937
943
|
share_url: e.string()
|
|
938
944
|
})
|
|
939
|
-
}),
|
|
945
|
+
}), Et = u.InvitedRegister, Pt = e.object({
|
|
940
946
|
...l.shape,
|
|
941
|
-
feature_type: e.string().enum(
|
|
942
|
-
}),
|
|
947
|
+
feature_type: e.string().enum(Et)
|
|
948
|
+
}), $t = e.string().enum(C(V, "GiftCode", "LotteryTicket")), Ut = u.Lottery, Ft = e.object({
|
|
943
949
|
reward_item_id: e.number(),
|
|
944
950
|
reward_item_name: e.string(),
|
|
945
|
-
reward_item_type:
|
|
951
|
+
reward_item_type: $t,
|
|
946
952
|
reward_item_icon_url: e.string(),
|
|
947
953
|
reward_item_desc: e.string().optional(),
|
|
948
954
|
reward_amount: e.number(),
|
|
949
955
|
reward_remaining_stock: e.number()
|
|
950
|
-
}),
|
|
956
|
+
}), It = e.object({
|
|
951
957
|
...l.shape,
|
|
952
|
-
feature_type: e.string().enum(
|
|
958
|
+
feature_type: e.string().enum(Ut),
|
|
953
959
|
config: e.object({
|
|
954
960
|
consume_item_id: e.number(),
|
|
955
961
|
consume_item_name: e.number(),
|
|
956
962
|
consume_item_icon_url: e.string(),
|
|
957
963
|
consume_item_count: e.number(),
|
|
958
964
|
consume_item_desc: e.string().optional(),
|
|
959
|
-
rewards: e.array(
|
|
965
|
+
rewards: e.array(Ft)
|
|
960
966
|
})
|
|
961
|
-
}),
|
|
967
|
+
}), Dt = u.LotteryDraw, At = e.object({
|
|
962
968
|
...l.shape,
|
|
963
|
-
feature_type: e.string().enum(
|
|
969
|
+
feature_type: e.string().enum(Dt),
|
|
964
970
|
config: e.object({
|
|
965
971
|
draw_not_before: e.number(),
|
|
966
972
|
draw_not_after: e.number()
|
|
967
973
|
})
|
|
968
|
-
}),
|
|
974
|
+
}), Gt = u.Preregister, Ot = e.object({
|
|
969
975
|
...l.shape,
|
|
970
|
-
feature_type: e.string().enum(
|
|
971
|
-
}),
|
|
976
|
+
feature_type: e.string().enum(Gt)
|
|
977
|
+
}), Nt = u.Quest, Qt = e.object({
|
|
972
978
|
...l.shape,
|
|
973
|
-
feature_type: e.string().enum(
|
|
979
|
+
feature_type: e.string().enum(Nt),
|
|
974
980
|
config: e.object({
|
|
975
981
|
objective: re,
|
|
976
982
|
completion_value: e.number(),
|
|
977
983
|
team: e.object({
|
|
978
984
|
feature_id: e.number().optional(),
|
|
979
985
|
completion_value: e.number(),
|
|
980
|
-
progress_algorithm:
|
|
986
|
+
progress_algorithm: mt,
|
|
981
987
|
top_n: e.number().optional()
|
|
982
988
|
}).optional(),
|
|
983
989
|
config: e.object({
|
|
984
990
|
topic_id: e.number().optional(),
|
|
985
991
|
required_players: e.number().min(1).optional(),
|
|
986
|
-
required_matches: e.number().min(1).optional()
|
|
992
|
+
required_matches: e.number().min(1).optional(),
|
|
993
|
+
event_item_id: e.number().optional()
|
|
987
994
|
}).optional()
|
|
988
995
|
})
|
|
989
|
-
}),
|
|
996
|
+
}), Bt = u.Register, Mt = e.object({
|
|
990
997
|
...l.shape,
|
|
991
|
-
feature_type: e.string().enum(
|
|
992
|
-
}),
|
|
998
|
+
feature_type: e.string().enum(Bt)
|
|
999
|
+
}), Kt = u.Share, Ht = e.object({
|
|
993
1000
|
...l.shape,
|
|
994
|
-
feature_type: e.string().enum(
|
|
1001
|
+
feature_type: e.string().enum(Kt),
|
|
995
1002
|
config: e.object({
|
|
996
1003
|
share_platform: e.string(),
|
|
997
1004
|
jump_url: e.string().optional(),
|
|
998
1005
|
icon_url: e.string().optional()
|
|
999
1006
|
})
|
|
1000
|
-
}),
|
|
1007
|
+
}), zt = u.Subscribe, Jt = e.object({
|
|
1001
1008
|
...l.shape,
|
|
1002
|
-
feature_type: e.string().enum(
|
|
1009
|
+
feature_type: e.string().enum(zt),
|
|
1003
1010
|
config: e.object({
|
|
1004
1011
|
weixin_template_ids: e.array(e.string())
|
|
1005
1012
|
})
|
|
1006
|
-
}),
|
|
1013
|
+
}), Zt = u.Survey, Xt = e.object({
|
|
1007
1014
|
...l.shape,
|
|
1008
|
-
feature_type: e.string().enum(
|
|
1015
|
+
feature_type: e.string().enum(Zt),
|
|
1009
1016
|
config: e.object({
|
|
1010
1017
|
survey_id: e.string(),
|
|
1011
1018
|
survey_url: e.string()
|
|
1012
1019
|
})
|
|
1013
|
-
}),
|
|
1020
|
+
}), Yt = u.Team, Wt = e.object({
|
|
1014
1021
|
...l.shape,
|
|
1015
|
-
feature_type: e.string().enum(
|
|
1022
|
+
feature_type: e.string().enum(Yt),
|
|
1016
1023
|
config: e.object({
|
|
1017
1024
|
max_members: e.number().min(1),
|
|
1018
1025
|
min_members: e.number().min(1)
|
|
1019
1026
|
})
|
|
1020
|
-
}),
|
|
1027
|
+
}), en = u.Vote, tn = e.object({
|
|
1021
1028
|
sn: e.string(),
|
|
1022
1029
|
name: e.string(),
|
|
1023
1030
|
img_urls: e.array(e.string()).optional(),
|
|
@@ -1027,61 +1034,61 @@ const R = {
|
|
|
1027
1034
|
amount: e.number(),
|
|
1028
1035
|
finalists: e.bool(),
|
|
1029
1036
|
last_vote_time: e.number()
|
|
1030
|
-
}),
|
|
1037
|
+
}), nn = e.object({
|
|
1031
1038
|
...l.shape,
|
|
1032
|
-
feature_type: e.string().enum(
|
|
1039
|
+
feature_type: e.string().enum(en),
|
|
1033
1040
|
config: e.object({
|
|
1034
1041
|
vote_feature_ids: e.array(e.number()),
|
|
1035
1042
|
submission_feature_ids: e.array(e.number()),
|
|
1036
1043
|
finalists_amount: e.number(),
|
|
1037
|
-
source:
|
|
1038
|
-
options: e.array(
|
|
1044
|
+
source: it,
|
|
1045
|
+
options: e.array(tn),
|
|
1039
1046
|
rewards: e.array(F)
|
|
1040
1047
|
})
|
|
1041
|
-
}),
|
|
1048
|
+
}), rn = u.ZeroChatgpt, an = e.object({
|
|
1042
1049
|
...l.shape,
|
|
1043
|
-
feature_type: e.string().enum(
|
|
1044
|
-
}),
|
|
1045
|
-
pt,
|
|
1050
|
+
feature_type: e.string().enum(rn)
|
|
1051
|
+
}), on = e.union(
|
|
1046
1052
|
bt,
|
|
1047
|
-
|
|
1053
|
+
ft,
|
|
1048
1054
|
vt,
|
|
1049
|
-
|
|
1050
|
-
|
|
1055
|
+
Vt,
|
|
1056
|
+
jt,
|
|
1051
1057
|
xt,
|
|
1052
1058
|
Lt,
|
|
1053
|
-
|
|
1059
|
+
Pt,
|
|
1054
1060
|
It,
|
|
1055
|
-
|
|
1061
|
+
At,
|
|
1056
1062
|
Ot,
|
|
1057
|
-
|
|
1063
|
+
Qt,
|
|
1058
1064
|
Mt,
|
|
1059
1065
|
Ht,
|
|
1060
1066
|
Jt,
|
|
1061
1067
|
Xt,
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1068
|
+
Wt,
|
|
1069
|
+
nn,
|
|
1070
|
+
wt,
|
|
1071
|
+
an
|
|
1072
|
+
).key("feature_type").satisfies(), sn = e.object({
|
|
1066
1073
|
event_name: e.string(),
|
|
1067
1074
|
rules: e.string(),
|
|
1068
1075
|
since: e.number(),
|
|
1069
1076
|
until: e.number(),
|
|
1070
1077
|
visit_count: e.number().optional(),
|
|
1071
|
-
features: e.array(
|
|
1072
|
-
}).lock(), x = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()),
|
|
1078
|
+
features: e.array(on)
|
|
1079
|
+
}).lock(), x = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()), cn = e.object({
|
|
1073
1080
|
order_total_amount: x,
|
|
1074
1081
|
cashback_total_amount: x,
|
|
1075
1082
|
game_item_count: x
|
|
1076
|
-
}),
|
|
1083
|
+
}), un = e.object({
|
|
1077
1084
|
activation_key: e.string().disallow("")
|
|
1078
|
-
}),
|
|
1085
|
+
}), ln = e.object({
|
|
1079
1086
|
gift_code: e.string()
|
|
1080
|
-
}),
|
|
1087
|
+
}), mn = e.object({
|
|
1081
1088
|
user_id: e.string(),
|
|
1082
1089
|
name: e.string().optional(),
|
|
1083
1090
|
avatar_url: e.string().optional()
|
|
1084
|
-
}),
|
|
1091
|
+
}), dn = e.object({
|
|
1085
1092
|
lottery_count: e.number()
|
|
1086
1093
|
}), I = e.object({
|
|
1087
1094
|
reward_id: e.number(),
|
|
@@ -1098,24 +1105,24 @@ const R = {
|
|
|
1098
1105
|
event_name: e.string(),
|
|
1099
1106
|
feature_id: e.number(),
|
|
1100
1107
|
engagement_id: e.number(),
|
|
1101
|
-
feature_type:
|
|
1108
|
+
feature_type: nt,
|
|
1102
1109
|
receive_time: e.number(),
|
|
1103
1110
|
extra_data: e.record(e.unknown()).optional()
|
|
1104
|
-
}),
|
|
1111
|
+
}), gn = e.string().enum(w.Unknown, w.Pending), pn = e.union(
|
|
1105
1112
|
e.object({
|
|
1106
1113
|
ticket: e.string(),
|
|
1107
|
-
status:
|
|
1114
|
+
status: gn
|
|
1108
1115
|
}),
|
|
1109
1116
|
e.object({
|
|
1110
1117
|
ticket: e.string(),
|
|
1111
1118
|
status: e.string().enum(C(w, "Unknown", "Pending")),
|
|
1112
1119
|
reward: I
|
|
1113
1120
|
})
|
|
1114
|
-
).satisfies(),
|
|
1115
|
-
tickets: e.array(
|
|
1116
|
-
}),
|
|
1121
|
+
).satisfies(), _n = e.object({
|
|
1122
|
+
tickets: e.array(pn)
|
|
1123
|
+
}), bn = e.object({
|
|
1117
1124
|
platforms: e.array(e.string())
|
|
1118
|
-
}),
|
|
1125
|
+
}), yn = e.object({
|
|
1119
1126
|
objective: re,
|
|
1120
1127
|
progress: e.number(),
|
|
1121
1128
|
completion_value: e.number().optional(),
|
|
@@ -1131,24 +1138,24 @@ const R = {
|
|
|
1131
1138
|
})
|
|
1132
1139
|
)
|
|
1133
1140
|
}).optional()
|
|
1134
|
-
}),
|
|
1141
|
+
}), fn = e.object({
|
|
1135
1142
|
platform: e.string()
|
|
1136
|
-
}),
|
|
1143
|
+
}), hn = e.object({
|
|
1137
1144
|
weixin_openid: e.string()
|
|
1138
|
-
}),
|
|
1145
|
+
}), wn = e.object({
|
|
1139
1146
|
serial_number: e.number()
|
|
1140
|
-
}),
|
|
1147
|
+
}), kn = e.object({
|
|
1141
1148
|
team_code: e.string(),
|
|
1142
1149
|
leader_name: e.string(),
|
|
1143
1150
|
total_members: e.number()
|
|
1144
|
-
}),
|
|
1151
|
+
}), Ar = e.object({
|
|
1145
1152
|
is_leader: e.bool(),
|
|
1146
1153
|
is_myself: e.bool().optional(),
|
|
1147
1154
|
role_name: e.string(),
|
|
1148
1155
|
server_name: e.string()
|
|
1149
|
-
}),
|
|
1156
|
+
}), vn = e.object({
|
|
1150
1157
|
team_code: e.string(),
|
|
1151
|
-
visibility:
|
|
1158
|
+
visibility: ct,
|
|
1152
1159
|
members: e.array(
|
|
1153
1160
|
e.object({
|
|
1154
1161
|
is_leader: e.bool(),
|
|
@@ -1156,14 +1163,14 @@ const R = {
|
|
|
1156
1163
|
server_name: e.string()
|
|
1157
1164
|
})
|
|
1158
1165
|
)
|
|
1159
|
-
}),
|
|
1166
|
+
}), Cn = e.object({
|
|
1160
1167
|
option_sn: e.string()
|
|
1161
|
-
}),
|
|
1168
|
+
}), Vn = e.object({
|
|
1162
1169
|
role: e.string(),
|
|
1163
1170
|
content: e.string()
|
|
1164
|
-
}), Cn = e.object({
|
|
1165
|
-
conversations: e.array(vn)
|
|
1166
1171
|
}), Rn = e.object({
|
|
1172
|
+
conversations: e.array(Vn)
|
|
1173
|
+
}), jn = e.object({
|
|
1167
1174
|
user_id: e.string(),
|
|
1168
1175
|
name: e.string(),
|
|
1169
1176
|
avatar_url: e.string(),
|
|
@@ -1171,25 +1178,25 @@ const R = {
|
|
|
1171
1178
|
video_note: e.number(),
|
|
1172
1179
|
created_at: e.number()
|
|
1173
1180
|
}), D = e.union(
|
|
1174
|
-
pn,
|
|
1175
|
-
ln,
|
|
1176
|
-
fn,
|
|
1177
|
-
un,
|
|
1178
1181
|
bn,
|
|
1179
|
-
|
|
1180
|
-
yn,
|
|
1181
|
-
on,
|
|
1182
|
-
cn,
|
|
1182
|
+
dn,
|
|
1183
1183
|
wn,
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
sn,
|
|
1184
|
+
mn,
|
|
1185
|
+
fn,
|
|
1187
1186
|
Cn,
|
|
1187
|
+
hn,
|
|
1188
|
+
cn,
|
|
1189
|
+
ln,
|
|
1190
|
+
vn,
|
|
1191
|
+
yn,
|
|
1192
|
+
_n,
|
|
1193
|
+
un,
|
|
1194
|
+
Rn,
|
|
1188
1195
|
e.custom(
|
|
1189
1196
|
"EmptyObject",
|
|
1190
1197
|
(o) => v(o) && Object.keys(o).length === 0
|
|
1191
1198
|
)
|
|
1192
|
-
).satisfies().lock(),
|
|
1199
|
+
).satisfies().lock(), Tn = e.object({
|
|
1193
1200
|
reward_id: e.number(),
|
|
1194
1201
|
reward_item_id: e.number(),
|
|
1195
1202
|
reward_item_type: ne,
|
|
@@ -1202,7 +1209,7 @@ const R = {
|
|
|
1202
1209
|
reward_item_rating: e.number(),
|
|
1203
1210
|
receive_time: e.number(),
|
|
1204
1211
|
extra_data: e.union(...D.validators, e.record(e.unknown())).satisfies().optional()
|
|
1205
|
-
}),
|
|
1212
|
+
}), qn = e.object({
|
|
1206
1213
|
reward_id: e.number(),
|
|
1207
1214
|
reward_item_id: e.number(),
|
|
1208
1215
|
reward_item_name: e.string(),
|
|
@@ -1213,7 +1220,7 @@ const R = {
|
|
|
1213
1220
|
reward_status: ae,
|
|
1214
1221
|
reward_source: U,
|
|
1215
1222
|
extra_data: e.record(e.unknown()).optional()
|
|
1216
|
-
}),
|
|
1223
|
+
}), xn = e.object({
|
|
1217
1224
|
engagement_id: e.number(),
|
|
1218
1225
|
user_id: e.string(),
|
|
1219
1226
|
event_id: e.number(),
|
|
@@ -1223,15 +1230,15 @@ const R = {
|
|
|
1223
1230
|
server_id: e.string().optional(),
|
|
1224
1231
|
role_id: e.string().optional(),
|
|
1225
1232
|
created_at: e.number(),
|
|
1226
|
-
rewards: e.array(
|
|
1227
|
-
}).lock(),
|
|
1233
|
+
rewards: e.array(Tn).optional()
|
|
1234
|
+
}).lock(), Sn = e.object({
|
|
1228
1235
|
allowed: e.bool(),
|
|
1229
1236
|
registered: e.bool()
|
|
1230
|
-
}),
|
|
1237
|
+
}), Ln = e.object({
|
|
1231
1238
|
feature_id: e.number(),
|
|
1232
1239
|
can_engage: e.bool(),
|
|
1233
1240
|
has_unclaimed_rewards: e.bool()
|
|
1234
|
-
}),
|
|
1241
|
+
}), En = e.object({
|
|
1235
1242
|
engagement_id: e.number(),
|
|
1236
1243
|
engagement: e.object({
|
|
1237
1244
|
engagement_id: e.number(),
|
|
@@ -1239,37 +1246,37 @@ const R = {
|
|
|
1239
1246
|
feature_id: e.number(),
|
|
1240
1247
|
data: D.clone().optional()
|
|
1241
1248
|
}).optional(),
|
|
1242
|
-
rewards: e.array(
|
|
1249
|
+
rewards: e.array(qn).optional(),
|
|
1243
1250
|
scan: e.bool().optional()
|
|
1244
|
-
}),
|
|
1251
|
+
}), Pn = e.object({
|
|
1245
1252
|
reward_id: e.number(),
|
|
1246
1253
|
reward_status: $
|
|
1247
|
-
}),
|
|
1248
|
-
engagements: e.union(e.array(
|
|
1249
|
-
}), Fn = s({
|
|
1250
|
-
status: e.array(xn)
|
|
1251
|
-
}), In = s({
|
|
1252
|
-
engagements_counts: e.record(e.number())
|
|
1254
|
+
}), $n = e.guard(sn), Un = e.guard(Sn), S = s({ count: e.number() }), Fn = s({ first_visit: e.bool() }), In = s({
|
|
1255
|
+
engagements: e.union(e.array(jn), e.array(kn))
|
|
1253
1256
|
}), Dn = s({
|
|
1254
|
-
|
|
1257
|
+
status: e.array(Ln)
|
|
1258
|
+
}), An = s({
|
|
1259
|
+
engagements_counts: e.record(e.number())
|
|
1260
|
+
}), Gn = s({
|
|
1261
|
+
engagements: e.array(xn),
|
|
1255
1262
|
next_token: e.string().optional()
|
|
1256
|
-
}),
|
|
1257
|
-
claimed_items: e.array(
|
|
1258
|
-
}),
|
|
1263
|
+
}), On = e.guard(En), Nn = s({
|
|
1264
|
+
claimed_items: e.array(Pn)
|
|
1265
|
+
}), Qn = s({
|
|
1259
1266
|
rewards: e.array(I)
|
|
1260
|
-
}), Nn = s({
|
|
1261
|
-
reward_status: $
|
|
1262
1267
|
}), Bn = s({
|
|
1268
|
+
reward_status: $
|
|
1269
|
+
}), Mn = s({
|
|
1263
1270
|
user_rewards: e.array(I),
|
|
1264
1271
|
next_token: e.string().optional()
|
|
1265
|
-
}),
|
|
1272
|
+
}), Kn = s({
|
|
1266
1273
|
scene: e.string()
|
|
1267
|
-
}),
|
|
1274
|
+
}), Hn = s({
|
|
1268
1275
|
params: e.string()
|
|
1269
|
-
}),
|
|
1276
|
+
}), zn = s({
|
|
1270
1277
|
img: e.string()
|
|
1271
1278
|
});
|
|
1272
|
-
class
|
|
1279
|
+
class Gr {
|
|
1273
1280
|
token;
|
|
1274
1281
|
event = 0;
|
|
1275
1282
|
req;
|
|
@@ -1282,7 +1289,7 @@ class Ir {
|
|
|
1282
1289
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=OWGSPF3Ysl
|
|
1283
1290
|
*/
|
|
1284
1291
|
async verifyMobileAllowed(t, n, r) {
|
|
1285
|
-
const { data: a } = await this.req.get("verify-mobile-allowed",
|
|
1292
|
+
const { data: a } = await this.req.get("verify-mobile-allowed", Un, {
|
|
1286
1293
|
...r,
|
|
1287
1294
|
params: { game_id: t, mobile: n }
|
|
1288
1295
|
});
|
|
@@ -1294,7 +1301,7 @@ class Ir {
|
|
|
1294
1301
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=wFXxtdNKPm
|
|
1295
1302
|
*/
|
|
1296
1303
|
async getConfig(t) {
|
|
1297
|
-
const { data: n } = await this.req.get(`event/${this.event}/event-config`,
|
|
1304
|
+
const { data: n } = await this.req.get(`event/${this.event}/event-config`, $n, t);
|
|
1298
1305
|
return n;
|
|
1299
1306
|
}
|
|
1300
1307
|
/**
|
|
@@ -1329,7 +1336,7 @@ class Ir {
|
|
|
1329
1336
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=THtZ4ewIQW
|
|
1330
1337
|
*/
|
|
1331
1338
|
async getEngagements(t, n) {
|
|
1332
|
-
const { data: r } = await this.req.get(`event/${this.event}/feature-engagements`,
|
|
1339
|
+
const { data: r } = await this.req.get(`event/${this.event}/feature-engagements`, In, {
|
|
1333
1340
|
...n,
|
|
1334
1341
|
params: { feature_id: t }
|
|
1335
1342
|
});
|
|
@@ -1345,7 +1352,7 @@ class Ir {
|
|
|
1345
1352
|
const { data: r, code: a, message: i } = await this.req.post(
|
|
1346
1353
|
`event/${this.event}/visit`,
|
|
1347
1354
|
c(t || {}),
|
|
1348
|
-
|
|
1355
|
+
Fn,
|
|
1349
1356
|
n
|
|
1350
1357
|
);
|
|
1351
1358
|
return r ?? {
|
|
@@ -1364,7 +1371,7 @@ class Ir {
|
|
|
1364
1371
|
*/
|
|
1365
1372
|
async getUserFeatureStatus(t, n) {
|
|
1366
1373
|
if (!await this.token.autoLogin()) return [];
|
|
1367
|
-
const { data: r } = await this.req.get("event/user-feature-status",
|
|
1374
|
+
const { data: r } = await this.req.get("event/user-feature-status", Dn, {
|
|
1368
1375
|
...n,
|
|
1369
1376
|
message: !1,
|
|
1370
1377
|
params: c({ ...t, event_id: this.event })
|
|
@@ -1378,7 +1385,7 @@ class Ir {
|
|
|
1378
1385
|
*/
|
|
1379
1386
|
async getUserEngagementCount(t, n) {
|
|
1380
1387
|
if (!await this.token.autoLogin()) return {};
|
|
1381
|
-
const { data: r } = await this.req.get("event/user-engagements-count",
|
|
1388
|
+
const { data: r } = await this.req.get("event/user-engagements-count", An, {
|
|
1382
1389
|
message: !1,
|
|
1383
1390
|
params: c({ ...n, event_id: this.event, feature_id: t })
|
|
1384
1391
|
});
|
|
@@ -1397,7 +1404,7 @@ class Ir {
|
|
|
1397
1404
|
engagements: [],
|
|
1398
1405
|
next_token: ""
|
|
1399
1406
|
};
|
|
1400
|
-
const { data: a } = await this.req.get("event/user-engagements",
|
|
1407
|
+
const { data: a } = await this.req.get("event/user-engagements", Gn, {
|
|
1401
1408
|
...r,
|
|
1402
1409
|
params: c({
|
|
1403
1410
|
max_results: 20,
|
|
@@ -1429,7 +1436,7 @@ class Ir {
|
|
|
1429
1436
|
engagement: n,
|
|
1430
1437
|
...r
|
|
1431
1438
|
}),
|
|
1432
|
-
|
|
1439
|
+
On,
|
|
1433
1440
|
a
|
|
1434
1441
|
);
|
|
1435
1442
|
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 ?? {
|
|
@@ -1453,7 +1460,7 @@ class Ir {
|
|
|
1453
1460
|
...t,
|
|
1454
1461
|
server_id: t.server_id ? +t.server_id : void 0
|
|
1455
1462
|
}),
|
|
1456
|
-
|
|
1463
|
+
Nn,
|
|
1457
1464
|
n
|
|
1458
1465
|
), d = r?.claimed_items;
|
|
1459
1466
|
return d ? d.map((m) => (m.reward_status = m.reward_status === _.UnclaimedErr ? _.Unclaimed : m.reward_status, m)) : {
|
|
@@ -1474,7 +1481,7 @@ class Ir {
|
|
|
1474
1481
|
...t,
|
|
1475
1482
|
server_id: t.server_id ? +t.server_id : void 0
|
|
1476
1483
|
}),
|
|
1477
|
-
|
|
1484
|
+
Qn,
|
|
1478
1485
|
n
|
|
1479
1486
|
), d = r?.rewards;
|
|
1480
1487
|
return d ? d.map((m) => (m.reward_status = m.reward_status === _.UnclaimedErr ? _.Unclaimed : m.reward_status, m)) : {
|
|
@@ -1492,7 +1499,7 @@ class Ir {
|
|
|
1492
1499
|
const { data: r, code: a, message: i } = await this.req.post(
|
|
1493
1500
|
"event/claim-weixin-hongbao",
|
|
1494
1501
|
{ reward_id: t },
|
|
1495
|
-
|
|
1502
|
+
Bn,
|
|
1496
1503
|
n
|
|
1497
1504
|
);
|
|
1498
1505
|
return r ? (r.reward_status = r.reward_status === _.UnclaimedErr ? _.Unclaimed : r.reward_status, r) : {
|
|
@@ -1533,7 +1540,7 @@ class Ir {
|
|
|
1533
1540
|
const { data: r } = await this.req.post(
|
|
1534
1541
|
"event/user-rewards",
|
|
1535
1542
|
c({ max_results: 20, ...t, event_id: this.event }),
|
|
1536
|
-
|
|
1543
|
+
Mn,
|
|
1537
1544
|
n
|
|
1538
1545
|
);
|
|
1539
1546
|
return {
|
|
@@ -1573,7 +1580,7 @@ class Ir {
|
|
|
1573
1580
|
*/
|
|
1574
1581
|
async getUnlimitQrcodeScene(t, n) {
|
|
1575
1582
|
if (!await this.token.autoLogin()) return null;
|
|
1576
|
-
const { data: r } = await this.req.get("event/unlimit-qrcode-scene",
|
|
1583
|
+
const { data: r } = await this.req.get("event/unlimit-qrcode-scene", Kn, {
|
|
1577
1584
|
...n,
|
|
1578
1585
|
params: { params: t }
|
|
1579
1586
|
});
|
|
@@ -1587,7 +1594,7 @@ class Ir {
|
|
|
1587
1594
|
* @param scene - 小程序码 scene 值
|
|
1588
1595
|
*/
|
|
1589
1596
|
async getParamsByQrcodeScene(t, n) {
|
|
1590
|
-
const { data: r } = await this.req.get("event/params-by-qrcode-scene",
|
|
1597
|
+
const { data: r } = await this.req.get("event/params-by-qrcode-scene", Hn, {
|
|
1591
1598
|
...n,
|
|
1592
1599
|
params: { scene: t }
|
|
1593
1600
|
});
|
|
@@ -1603,18 +1610,18 @@ class Ir {
|
|
|
1603
1610
|
const { data: r } = await this.req.post(
|
|
1604
1611
|
"event/unlimit-qrcode",
|
|
1605
1612
|
c(t),
|
|
1606
|
-
|
|
1613
|
+
zn,
|
|
1607
1614
|
n
|
|
1608
1615
|
);
|
|
1609
1616
|
return r?.img ?? null;
|
|
1610
1617
|
}
|
|
1611
1618
|
}
|
|
1612
|
-
const
|
|
1619
|
+
const Jn = {
|
|
1613
1620
|
/** 所有人均可以发帖 */
|
|
1614
1621
|
All: "all",
|
|
1615
1622
|
/** 指定用户可发帖 */
|
|
1616
1623
|
Limit: "limit"
|
|
1617
|
-
},
|
|
1624
|
+
}, Zn = e.string().enum(Jn).lock(), Xn = {
|
|
1618
1625
|
/** 待审核(仅自己可见) */
|
|
1619
1626
|
Pending: "pending",
|
|
1620
1627
|
/** 审核通过 */
|
|
@@ -1623,14 +1630,14 @@ const Hn = {
|
|
|
1623
1630
|
Failed: "failed",
|
|
1624
1631
|
/** 嫌疑(仅自己可见) */
|
|
1625
1632
|
Suspect: "suspect"
|
|
1626
|
-
},
|
|
1633
|
+
}, oe = e.string().enum(Xn).lock(), Yn = {
|
|
1627
1634
|
/** 系统通知 */
|
|
1628
1635
|
System: "system",
|
|
1629
1636
|
/** 评论我的 */
|
|
1630
1637
|
Comment: "comment",
|
|
1631
1638
|
/** 点赞通知 */
|
|
1632
1639
|
Like: "like"
|
|
1633
|
-
},
|
|
1640
|
+
}, Or = e.string().enum(Yn).lock(), g = {
|
|
1634
1641
|
/** 系统通知 */
|
|
1635
1642
|
System: "system",
|
|
1636
1643
|
/** 帖子被置顶 */
|
|
@@ -1655,24 +1662,24 @@ const Hn = {
|
|
|
1655
1662
|
ReplyLiked: "reply_liked",
|
|
1656
1663
|
/** 回复被删除 */
|
|
1657
1664
|
ReplyDeleted: "reply_deleted"
|
|
1658
|
-
},
|
|
1665
|
+
}, Wn = e.string().enum(g).lock(), se = e.object({
|
|
1659
1666
|
forum_id: e.number(),
|
|
1660
1667
|
icon_url: e.string(),
|
|
1661
1668
|
name: e.string(),
|
|
1662
1669
|
tags: e.array(e.string()),
|
|
1663
1670
|
sort: e.number(),
|
|
1664
|
-
mode:
|
|
1671
|
+
mode: Zn,
|
|
1665
1672
|
member_ids: e.array(e.number())
|
|
1666
|
-
}).lock(),
|
|
1673
|
+
}).lock(), A = e.object({
|
|
1667
1674
|
topic_id: e.number(),
|
|
1668
1675
|
cover_url: e.string(),
|
|
1669
1676
|
name: e.string(),
|
|
1670
1677
|
description: e.string(),
|
|
1671
1678
|
tags: e.array(e.string()),
|
|
1672
1679
|
post_num: e.number()
|
|
1673
|
-
}).lock(),
|
|
1680
|
+
}).lock(), G = e.object({
|
|
1674
1681
|
post_id: e.number(),
|
|
1675
|
-
forum:
|
|
1682
|
+
forum: se,
|
|
1676
1683
|
posted_by: e.string(),
|
|
1677
1684
|
nickname: e.string(),
|
|
1678
1685
|
avatar_url: e.string(),
|
|
@@ -1684,21 +1691,21 @@ const Hn = {
|
|
|
1684
1691
|
comments_num: e.number(),
|
|
1685
1692
|
liked: e.bool(),
|
|
1686
1693
|
image_urls: e.array(e.string()),
|
|
1687
|
-
topics: e.array(
|
|
1694
|
+
topics: e.array(A),
|
|
1688
1695
|
event_ids: e.array(e.number()),
|
|
1689
1696
|
is_pinned: e.bool(),
|
|
1690
1697
|
is_highlighted: e.bool(),
|
|
1691
|
-
status:
|
|
1698
|
+
status: oe,
|
|
1692
1699
|
create_time: e.number()
|
|
1693
|
-
}).lock(),
|
|
1700
|
+
}).lock(), ce = e.object({
|
|
1694
1701
|
err_msg: e.string().optional()
|
|
1695
|
-
}).optional().lock(),
|
|
1702
|
+
}).optional().lock(), er = e.object({
|
|
1696
1703
|
reply_id: e.number(),
|
|
1697
1704
|
reply_content: e.string().optional(),
|
|
1698
1705
|
replied_by: e.string(),
|
|
1699
1706
|
nickname: e.string(),
|
|
1700
1707
|
avatar_url: e.string()
|
|
1701
|
-
}).lock(),
|
|
1708
|
+
}).lock(), R = e.object({
|
|
1702
1709
|
reply_id: e.number(),
|
|
1703
1710
|
comment_id: e.number(),
|
|
1704
1711
|
comment_content: e.string().optional(),
|
|
@@ -1711,7 +1718,7 @@ const Hn = {
|
|
|
1711
1718
|
content: e.string(),
|
|
1712
1719
|
like_num: e.number(),
|
|
1713
1720
|
liked: e.bool(),
|
|
1714
|
-
reply_to:
|
|
1721
|
+
reply_to: er,
|
|
1715
1722
|
create_time: e.number()
|
|
1716
1723
|
}).lock(), k = e.object({
|
|
1717
1724
|
comment_id: e.number(),
|
|
@@ -1731,21 +1738,21 @@ const Hn = {
|
|
|
1731
1738
|
liked: e.bool(),
|
|
1732
1739
|
image_url: e.string(),
|
|
1733
1740
|
create_time: e.number(),
|
|
1734
|
-
status:
|
|
1735
|
-
replies: e.array(
|
|
1736
|
-
}).lock(),
|
|
1741
|
+
status: oe,
|
|
1742
|
+
replies: e.array(R).optional()
|
|
1743
|
+
}).lock(), tr = e.object({
|
|
1737
1744
|
image_url: e.string(),
|
|
1738
1745
|
upload_url: e.string(),
|
|
1739
1746
|
existed: e.bool()
|
|
1740
1747
|
}).lock(), b = e.object({
|
|
1741
1748
|
notification_id: e.string(),
|
|
1742
|
-
notification_type:
|
|
1749
|
+
notification_type: Wn,
|
|
1743
1750
|
is_read: e.bool(),
|
|
1744
1751
|
create_time: e.number(),
|
|
1745
1752
|
origin_user_id: e.string(),
|
|
1746
1753
|
origin_user_name: e.string(),
|
|
1747
1754
|
origin_user_avatar_url: e.string()
|
|
1748
|
-
}).lock(),
|
|
1755
|
+
}).lock(), nr = e.object({
|
|
1749
1756
|
system_message_subject: e.string(),
|
|
1750
1757
|
system_message_content: e.string()
|
|
1751
1758
|
}).lock(), O = e.object({
|
|
@@ -1759,11 +1766,11 @@ const Hn = {
|
|
|
1759
1766
|
}).lock(), N = e.object({
|
|
1760
1767
|
reply_id: e.number(),
|
|
1761
1768
|
reply_content: e.string()
|
|
1762
|
-
}).lock(),
|
|
1769
|
+
}).lock(), rr = e.object({
|
|
1763
1770
|
...b.shape,
|
|
1764
|
-
...
|
|
1771
|
+
...nr.shape,
|
|
1765
1772
|
notification_type: e.string().enum(g.System)
|
|
1766
|
-
}),
|
|
1773
|
+
}), ar = e.object({
|
|
1767
1774
|
...b.shape,
|
|
1768
1775
|
...O.shape,
|
|
1769
1776
|
notification_type: e.string().enum(
|
|
@@ -1772,65 +1779,65 @@ const Hn = {
|
|
|
1772
1779
|
g.PostDeleted,
|
|
1773
1780
|
g.PostLiked
|
|
1774
1781
|
)
|
|
1775
|
-
}),
|
|
1782
|
+
}), ir = e.object({
|
|
1776
1783
|
...b.shape,
|
|
1777
1784
|
...O.shape,
|
|
1778
1785
|
...j.shape,
|
|
1779
1786
|
notification_type: e.string().enum(g.PostCommented)
|
|
1780
|
-
}),
|
|
1787
|
+
}), or = e.object({
|
|
1781
1788
|
...b.shape,
|
|
1782
1789
|
...j.shape,
|
|
1783
1790
|
...N.shape,
|
|
1784
1791
|
notification_type: e.string().enum(g.CommentReplied)
|
|
1785
|
-
}),
|
|
1792
|
+
}), sr = e.object({
|
|
1786
1793
|
...b.shape,
|
|
1787
1794
|
...j.shape,
|
|
1788
1795
|
...O.shape,
|
|
1789
1796
|
notification_type: e.string().enum(g.CommentLiked, g.CommentDeleted)
|
|
1790
|
-
}),
|
|
1797
|
+
}), cr = e.object({
|
|
1791
1798
|
...b.shape,
|
|
1792
1799
|
...N.shape,
|
|
1793
1800
|
notification_type: e.string().enum(g.ReplyReplied),
|
|
1794
1801
|
comment_id: e.number(),
|
|
1795
1802
|
reply_to_reply_id: e.number(),
|
|
1796
1803
|
reply_to_reply_content: e.string()
|
|
1797
|
-
}),
|
|
1804
|
+
}), ur = e.object({
|
|
1798
1805
|
...b.shape,
|
|
1799
1806
|
...N.shape,
|
|
1800
1807
|
...j.shape,
|
|
1801
1808
|
notification_type: e.string().enum(g.ReplyLiked, g.ReplyDeleted)
|
|
1802
|
-
}),
|
|
1803
|
-
tr,
|
|
1804
|
-
nr,
|
|
1809
|
+
}), lr = e.union(
|
|
1805
1810
|
rr,
|
|
1806
1811
|
ar,
|
|
1807
1812
|
ir,
|
|
1808
1813
|
or,
|
|
1809
|
-
sr
|
|
1810
|
-
|
|
1811
|
-
|
|
1814
|
+
sr,
|
|
1815
|
+
cr,
|
|
1816
|
+
ur
|
|
1817
|
+
).satisfies().lock(), mr = s({ forums: e.array(se) }), dr = s({ topics: e.array(A) }), gr = s({ topic: A }), pr = s({ post: G }), z = s({
|
|
1818
|
+
posts: e.array(G),
|
|
1812
1819
|
next_token: e.string().optional()
|
|
1813
|
-
}),
|
|
1814
|
-
replies: e.array(
|
|
1820
|
+
}), _r = s({ post: G, antispam: ce }), br = s({
|
|
1821
|
+
replies: e.array(R),
|
|
1815
1822
|
next_token: e.string().optional()
|
|
1816
|
-
}),
|
|
1817
|
-
reply:
|
|
1818
|
-
antispam:
|
|
1819
|
-
}),
|
|
1823
|
+
}), yr = s({ reply: R }), fr = s({
|
|
1824
|
+
reply: R.clone().optional(),
|
|
1825
|
+
antispam: ce.clone().optional()
|
|
1826
|
+
}), hr = s({ comment: k }), wr = s({
|
|
1820
1827
|
comments: e.array(k),
|
|
1821
1828
|
next_token: e.string().optional()
|
|
1822
|
-
}),
|
|
1829
|
+
}), kr = s({
|
|
1823
1830
|
comment: k.clone().optional(),
|
|
1824
1831
|
antispam: k.clone().optional()
|
|
1825
|
-
}),
|
|
1826
|
-
notifications: e.array(
|
|
1832
|
+
}), vr = e.guard(tr), Cr = s({
|
|
1833
|
+
notifications: e.array(lr),
|
|
1827
1834
|
next_token: e.string().optional()
|
|
1828
|
-
}),
|
|
1835
|
+
}), Vr = s({
|
|
1829
1836
|
system: e.number(),
|
|
1830
1837
|
comment: e.number(),
|
|
1831
1838
|
like: e.number()
|
|
1832
1839
|
});
|
|
1833
|
-
class
|
|
1840
|
+
class Nr {
|
|
1834
1841
|
token;
|
|
1835
1842
|
req;
|
|
1836
1843
|
constructor(t) {
|
|
@@ -1842,7 +1849,7 @@ class Gr {
|
|
|
1842
1849
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=QaqUa2K0z0
|
|
1843
1850
|
*/
|
|
1844
1851
|
async getForums(t) {
|
|
1845
|
-
const { data: n } = await this.req.get("community/forums",
|
|
1852
|
+
const { data: n } = await this.req.get("community/forums", mr, t);
|
|
1846
1853
|
return n?.forums || [];
|
|
1847
1854
|
}
|
|
1848
1855
|
/**
|
|
@@ -1851,7 +1858,7 @@ class Gr {
|
|
|
1851
1858
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=mIwpymAQom
|
|
1852
1859
|
*/
|
|
1853
1860
|
async getTopics(t) {
|
|
1854
|
-
const { data: n } = await this.req.get("community/topics",
|
|
1861
|
+
const { data: n } = await this.req.get("community/topics", dr, t);
|
|
1855
1862
|
return n?.topics || [];
|
|
1856
1863
|
}
|
|
1857
1864
|
/**
|
|
@@ -1860,7 +1867,7 @@ class Gr {
|
|
|
1860
1867
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Jvw7xMK31K
|
|
1861
1868
|
*/
|
|
1862
1869
|
async getTopic(t, n) {
|
|
1863
|
-
const { data: r, code: a } = await this.req.get("community/topic",
|
|
1870
|
+
const { data: r, code: a } = await this.req.get("community/topic", gr, {
|
|
1864
1871
|
...n,
|
|
1865
1872
|
params: { topic_id: t }
|
|
1866
1873
|
});
|
|
@@ -1902,7 +1909,7 @@ class Gr {
|
|
|
1902
1909
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=hj1AZy5rcP
|
|
1903
1910
|
*/
|
|
1904
1911
|
async getPost(t, n) {
|
|
1905
|
-
const { data: r, code: a, message: i } = await this.req.get("community/post",
|
|
1912
|
+
const { data: r, code: a, message: i } = await this.req.get("community/post", pr, {
|
|
1906
1913
|
...n,
|
|
1907
1914
|
params: { post_id: t }
|
|
1908
1915
|
});
|
|
@@ -1920,7 +1927,7 @@ class Gr {
|
|
|
1920
1927
|
const { data: r, code: a, message: i } = await this.req.post(
|
|
1921
1928
|
"community/post",
|
|
1922
1929
|
c(t),
|
|
1923
|
-
|
|
1930
|
+
_r,
|
|
1924
1931
|
n
|
|
1925
1932
|
);
|
|
1926
1933
|
return r ?? {
|
|
@@ -1934,7 +1941,7 @@ class Gr {
|
|
|
1934
1941
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=djKbX7lFdp
|
|
1935
1942
|
*/
|
|
1936
1943
|
async getComments(t, n) {
|
|
1937
|
-
const { data: r, code: a, message: i } = await this.req.get("community/comments",
|
|
1944
|
+
const { data: r, code: a, message: i } = await this.req.get("community/comments", wr, {
|
|
1938
1945
|
...n,
|
|
1939
1946
|
params: c(t)
|
|
1940
1947
|
});
|
|
@@ -1949,7 +1956,7 @@ class Gr {
|
|
|
1949
1956
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=RIc7oxVGae
|
|
1950
1957
|
*/
|
|
1951
1958
|
async getComment(t, n) {
|
|
1952
|
-
const { data: r, code: a, message: i } = await this.req.get("community/comment",
|
|
1959
|
+
const { data: r, code: a, message: i } = await this.req.get("community/comment", hr, {
|
|
1953
1960
|
...n,
|
|
1954
1961
|
params: { comment_id: t }
|
|
1955
1962
|
});
|
|
@@ -1968,7 +1975,7 @@ class Gr {
|
|
|
1968
1975
|
const { data: r, code: a, message: i } = await this.req.post(
|
|
1969
1976
|
"community/comment",
|
|
1970
1977
|
c(t),
|
|
1971
|
-
|
|
1978
|
+
kr,
|
|
1972
1979
|
n
|
|
1973
1980
|
);
|
|
1974
1981
|
return r ?? {
|
|
@@ -1982,7 +1989,7 @@ class Gr {
|
|
|
1982
1989
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=sVKBbY83MY
|
|
1983
1990
|
*/
|
|
1984
1991
|
async getReplies(t, n) {
|
|
1985
|
-
const { data: r } = await this.req.get("community/replies",
|
|
1992
|
+
const { data: r } = await this.req.get("community/replies", br, {
|
|
1986
1993
|
...n,
|
|
1987
1994
|
params: c({ max_results: 20, ...t })
|
|
1988
1995
|
});
|
|
@@ -1997,7 +2004,7 @@ class Gr {
|
|
|
1997
2004
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=kxhcSXD3MG
|
|
1998
2005
|
*/
|
|
1999
2006
|
async getReply(t, n) {
|
|
2000
|
-
const { data: r, code: a, message: i } = await this.req.get("community/reply",
|
|
2007
|
+
const { data: r, code: a, message: i } = await this.req.get("community/reply", yr, {
|
|
2001
2008
|
...n,
|
|
2002
2009
|
params: { reply_id: t }
|
|
2003
2010
|
});
|
|
@@ -2016,7 +2023,7 @@ class Gr {
|
|
|
2016
2023
|
const { data: r, code: a, message: i } = await this.req.post(
|
|
2017
2024
|
"community/reply",
|
|
2018
2025
|
c(t),
|
|
2019
|
-
|
|
2026
|
+
fr,
|
|
2020
2027
|
n
|
|
2021
2028
|
);
|
|
2022
2029
|
return r ?? {
|
|
@@ -2067,7 +2074,7 @@ class Gr {
|
|
|
2067
2074
|
*/
|
|
2068
2075
|
async getMediaPresignedUrl(t, n) {
|
|
2069
2076
|
await this.token.autoLogin();
|
|
2070
|
-
const { data: r } = await this.req.get("community/media-presign-url",
|
|
2077
|
+
const { data: r } = await this.req.get("community/media-presign-url", vr, {
|
|
2071
2078
|
...n,
|
|
2072
2079
|
params: t
|
|
2073
2080
|
});
|
|
@@ -2082,7 +2089,7 @@ class Gr {
|
|
|
2082
2089
|
*/
|
|
2083
2090
|
async getNotifications(t, n) {
|
|
2084
2091
|
await this.token.autoLogin();
|
|
2085
|
-
const { data: r } = await this.req.get("community/notifications",
|
|
2092
|
+
const { data: r } = await this.req.get("community/notifications", Cr, {
|
|
2086
2093
|
...n,
|
|
2087
2094
|
params: c({ max_results: 20, ...t })
|
|
2088
2095
|
});
|
|
@@ -2100,7 +2107,7 @@ class Gr {
|
|
|
2100
2107
|
if (!await this.token.autoLogin()) return null;
|
|
2101
2108
|
const { data: n } = await this.req.get(
|
|
2102
2109
|
"community/unread-notifications-count",
|
|
2103
|
-
|
|
2110
|
+
Vr,
|
|
2104
2111
|
t
|
|
2105
2112
|
);
|
|
2106
2113
|
return n;
|
|
@@ -2116,17 +2123,17 @@ class Gr {
|
|
|
2116
2123
|
return r;
|
|
2117
2124
|
}
|
|
2118
2125
|
}
|
|
2119
|
-
const
|
|
2126
|
+
const Rr = s({
|
|
2120
2127
|
nonce_str: e.string(),
|
|
2121
2128
|
timestamp: e.number(),
|
|
2122
2129
|
signature: e.string()
|
|
2123
2130
|
});
|
|
2124
|
-
var
|
|
2131
|
+
var jr = /* @__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))(jr || {});
|
|
2125
2132
|
function L(o) {
|
|
2126
2133
|
return v(o, "open_id", "union_id", "weixin_token");
|
|
2127
2134
|
}
|
|
2128
2135
|
const J = "wx_login_cache";
|
|
2129
|
-
class
|
|
2136
|
+
class Qr {
|
|
2130
2137
|
token;
|
|
2131
2138
|
$appid;
|
|
2132
2139
|
req;
|
|
@@ -2160,7 +2167,7 @@ class Ar {
|
|
|
2160
2167
|
const t = this.token.storage.get(J);
|
|
2161
2168
|
if (!t)
|
|
2162
2169
|
return null;
|
|
2163
|
-
const n =
|
|
2170
|
+
const n = be(t);
|
|
2164
2171
|
return L(n) ? (this.token.weixinToken = n.weixin_token, await this.token.autoLogin(), n) : null;
|
|
2165
2172
|
}
|
|
2166
2173
|
/**
|
|
@@ -2186,7 +2193,7 @@ class Ar {
|
|
|
2186
2193
|
const n = await this.getLoginCache();
|
|
2187
2194
|
if (n)
|
|
2188
2195
|
return n;
|
|
2189
|
-
const r = await
|
|
2196
|
+
const r = await he(), { data: a, code: i, message: d } = await this.req.post(
|
|
2190
2197
|
"weixin/login",
|
|
2191
2198
|
{ code: r, appid: this.appid },
|
|
2192
2199
|
L,
|
|
@@ -2216,9 +2223,9 @@ class Ar {
|
|
|
2216
2223
|
async webLogin(t = "snsapi_userinfo", n) {
|
|
2217
2224
|
const r = E("code"), a = Date.now(), i = +E("state");
|
|
2218
2225
|
if (!r || !i || i < a - 1e3 * 60 * 5 || i > a) {
|
|
2219
|
-
const
|
|
2226
|
+
const le = Q(["code", "state"]);
|
|
2220
2227
|
location.replace(
|
|
2221
|
-
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(
|
|
2228
|
+
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(le)}&response_type=code&scope=${t}&state=${a}#wechat_redirect`
|
|
2222
2229
|
);
|
|
2223
2230
|
return;
|
|
2224
2231
|
}
|
|
@@ -2227,15 +2234,15 @@ class Ar {
|
|
|
2227
2234
|
message: "Error: " + r,
|
|
2228
2235
|
error: r
|
|
2229
2236
|
};
|
|
2230
|
-
const d =
|
|
2237
|
+
const d = Q(["code", "state"]);
|
|
2231
2238
|
"replaceState" in history && history.replaceState({}, "", d);
|
|
2232
2239
|
const {
|
|
2233
2240
|
data: m,
|
|
2234
2241
|
code: y,
|
|
2235
|
-
message:
|
|
2242
|
+
message: ue
|
|
2236
2243
|
} = await this.req.post("weixin/login", { code: r, appid: this.appid }, L, n);
|
|
2237
2244
|
return m && (this.token.weixinToken = m.weixin_token, await this.token.autoLogin()), m ?? {
|
|
2238
|
-
message:
|
|
2245
|
+
message: ue,
|
|
2239
2246
|
error: y
|
|
2240
2247
|
};
|
|
2241
2248
|
}
|
|
@@ -2266,7 +2273,7 @@ class Ar {
|
|
|
2266
2273
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=CuWOqxr9Ue
|
|
2267
2274
|
*/
|
|
2268
2275
|
async getJSSDKConfig(t) {
|
|
2269
|
-
const { data: n } = await this.req.get("weixin/offiaccount/jssdk-sign",
|
|
2276
|
+
const { data: n } = await this.req.get("weixin/offiaccount/jssdk-sign", Rr, {
|
|
2270
2277
|
...t,
|
|
2271
2278
|
params: {
|
|
2272
2279
|
appid: this.appid,
|
|
@@ -2282,146 +2289,149 @@ class Ar {
|
|
|
2282
2289
|
}
|
|
2283
2290
|
}
|
|
2284
2291
|
export {
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2292
|
+
ce as AntispamValidator,
|
|
2293
|
+
Sr as AuthToken,
|
|
2294
|
+
cn as CashbackEngagementDataValidator,
|
|
2295
|
+
un as ClaimActivationKeyEngagementDataValidator,
|
|
2289
2296
|
_ as ClaimRewardStatus,
|
|
2290
2297
|
$ as ClaimRewardStatusValidator,
|
|
2291
|
-
|
|
2298
|
+
Pn as ClaimedItemValidator,
|
|
2292
2299
|
Y as ClubAddressValidator,
|
|
2293
|
-
|
|
2300
|
+
Er as ClubApi,
|
|
2294
2301
|
W as ClubBenefitSummaryValidator,
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2302
|
+
Ae as ClubBenefitValidator,
|
|
2303
|
+
je as ClubCreditChangeScene,
|
|
2304
|
+
Te as ClubCreditChangeSceneValidator,
|
|
2305
|
+
Ve as ClubCreditChangeType,
|
|
2299
2306
|
Re as ClubCreditChangeTypeValidator,
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2307
|
+
De as ClubCreditLogValidator,
|
|
2308
|
+
Le as ClubGlobalConfigValidator,
|
|
2309
|
+
qe as ClubItemType,
|
|
2303
2310
|
Z as ClubItemTypeValidator,
|
|
2304
|
-
|
|
2311
|
+
Ee as ClubPlayerValidator,
|
|
2305
2312
|
ee as ClubProductValidator,
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2313
|
+
xe as ClubRedemptionStatus,
|
|
2314
|
+
Se as ClubRedemptionStatusValidator,
|
|
2315
|
+
Ie as ClubUserCreditValidator,
|
|
2316
|
+
Fe as ClubUserProfileValidator,
|
|
2317
|
+
jn as CommentEngagementValidator,
|
|
2311
2318
|
k as CommentValidator,
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2319
|
+
Nr as CommunityApi,
|
|
2320
|
+
Ye as EngageAccountType,
|
|
2321
|
+
We as EngageAccountTypeValidator,
|
|
2322
|
+
En as EngageResponseValidator,
|
|
2323
|
+
qn as EngageRewardValidator,
|
|
2324
|
+
Gr as EventApi,
|
|
2325
|
+
sn as EventConfigValidator,
|
|
2326
|
+
bt as EventFeatureConfigOfCashbackValidator,
|
|
2327
|
+
ft as EventFeatureConfigOfCheckInValidator,
|
|
2328
|
+
wt as EventFeatureConfigOfClaimActivationKeyValidator,
|
|
2329
|
+
vt as EventFeatureConfigOfClaimRewardsValidator,
|
|
2330
|
+
Vt as EventFeatureConfigOfCommentValidator,
|
|
2331
|
+
jt as EventFeatureConfigOfFollowValidator,
|
|
2332
|
+
xt as EventFeatureConfigOfGiftCodeValidator,
|
|
2333
|
+
Lt as EventFeatureConfigOfInviteValidator,
|
|
2334
|
+
Pt as EventFeatureConfigOfInvitedRegisterValidator,
|
|
2335
|
+
At as EventFeatureConfigOfLotteryDrawValidator,
|
|
2336
|
+
It as EventFeatureConfigOfLotteryValidator,
|
|
2337
|
+
Ot as EventFeatureConfigOfPreregisterValidator,
|
|
2338
|
+
Qt as EventFeatureConfigOfQuestValidator,
|
|
2339
|
+
Mt as EventFeatureConfigOfRegisterValidator,
|
|
2340
|
+
Ht as EventFeatureConfigOfShareValidator,
|
|
2341
|
+
Jt as EventFeatureConfigOfSubscribeValidator,
|
|
2342
|
+
Xt as EventFeatureConfigOfSurveyValidator,
|
|
2343
|
+
Wt as EventFeatureConfigOfTeamValidator,
|
|
2344
|
+
nn as EventFeatureConfigOfVoteValidator,
|
|
2345
|
+
on as EventFeatureConfigValidator,
|
|
2346
|
+
et as EventPeriodType,
|
|
2347
|
+
tt as EventPeriodTypeValidator,
|
|
2341
2348
|
F as EventRewardItemConfigValidator,
|
|
2342
|
-
|
|
2349
|
+
Oe as ExtraGameRewardValidator,
|
|
2343
2350
|
Ge as ExtraPhysicalShipmentValidator,
|
|
2344
|
-
|
|
2351
|
+
pt as FeatureRewardValidator,
|
|
2345
2352
|
u as FeatureType,
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2353
|
+
nt as FeatureTypeValidator,
|
|
2354
|
+
Jn as ForumMode,
|
|
2355
|
+
Zn as ForumModeValidator,
|
|
2356
|
+
se as ForumValidator,
|
|
2357
|
+
V as GamerItemType,
|
|
2351
2358
|
te as GamerItemTypeValidator,
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2359
|
+
ve as Gender,
|
|
2360
|
+
Ce as GenderValidator,
|
|
2361
|
+
ln as GiftCodeEngagementDataValidator,
|
|
2362
|
+
mn as InviteEngagementDataValidator,
|
|
2363
|
+
lt as LotteryDrawAction,
|
|
2364
|
+
Ir as LotteryDrawActionValidator,
|
|
2365
|
+
_n as LotteryDrawEngagementDataValidator,
|
|
2366
|
+
dn as LotteryEngagementDataValidator,
|
|
2360
2367
|
w as LotteryTicketStatus,
|
|
2361
|
-
|
|
2368
|
+
Ur as LotteryTicketStatusValidator,
|
|
2362
2369
|
b as NotificationBaseValidator,
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2370
|
+
Yn as NotificationCategory,
|
|
2371
|
+
Or as NotificationCategoryValidator,
|
|
2372
|
+
or as NotificationCommentReplyValidator,
|
|
2373
|
+
sr as NotificationCommentValidator,
|
|
2367
2374
|
j as NotificationPayloadCommentValidator,
|
|
2368
2375
|
O as NotificationPayloadPostValidator,
|
|
2369
2376
|
N as NotificationPayloadReplyValidator,
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2377
|
+
nr as NotificationPayloadSystemValidator,
|
|
2378
|
+
ir as NotificationPostCommentValidator,
|
|
2379
|
+
ar as NotificationPostValidator,
|
|
2380
|
+
cr as NotificationReplyRepliedValidator,
|
|
2381
|
+
ur as NotificationReplyValidator,
|
|
2382
|
+
rr as NotificationSystemValidator,
|
|
2376
2383
|
g as NotificationType,
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2384
|
+
Wn as NotificationTypeValidator,
|
|
2385
|
+
lr as NotificationValidator,
|
|
2386
|
+
Ue as PlayerRoleCardValidator,
|
|
2380
2387
|
X as PlayerRoleValidator,
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
+
Xn as PostStatus,
|
|
2389
|
+
oe as PostStatusValidator,
|
|
2390
|
+
G as PostValidator,
|
|
2391
|
+
bn as PreregisterEngagementDataValidator,
|
|
2392
|
+
tr as PresignedUrlResponseValidator,
|
|
2393
|
+
yn as QuestEngagementDataValidator,
|
|
2394
|
+
rt as QuestObjective,
|
|
2388
2395
|
re as QuestObjectiveValidator,
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2396
|
+
ie as QuestProgressAlgorithm,
|
|
2397
|
+
mt as QuestProgressAlgorithmOptionalValidator,
|
|
2398
|
+
Dr as QuestProgressAlgorithmValidator,
|
|
2399
|
+
Lr as RedeemParamsValidator,
|
|
2400
|
+
Ne as RedemptionValidator,
|
|
2401
|
+
gt as RegularRewardValidator,
|
|
2402
|
+
er as ReplyToValidator,
|
|
2403
|
+
R as ReplyValidator,
|
|
2404
|
+
Pr as RewardItemType,
|
|
2395
2405
|
ne as RewardItemTypeValidator,
|
|
2396
|
-
|
|
2406
|
+
ot as RewardSource,
|
|
2397
2407
|
U as RewardSourceValidator,
|
|
2398
2408
|
p as RewardStatus,
|
|
2399
2409
|
P as RewardStatusSuffix,
|
|
2400
2410
|
ae as RewardStatusSuffixValidator,
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2411
|
+
$r as RewardStatusValidator,
|
|
2412
|
+
Tn as RewardValidator,
|
|
2413
|
+
$e as RoleBaseInfoValidator,
|
|
2414
|
+
Pe as ServerBaseInfoValidator,
|
|
2415
|
+
fn as ShareEngagementDataValidator,
|
|
2416
|
+
wn as SurveyEngagementDataValidator,
|
|
2417
|
+
ut as TeamAction,
|
|
2418
|
+
Fr as TeamActionValidator,
|
|
2419
|
+
vn as TeamEngagementDataValidator,
|
|
2420
|
+
kn as TeamEngagementValidator,
|
|
2421
|
+
Ar as TeamMemberValidator,
|
|
2422
|
+
st as TeamVisibility,
|
|
2423
|
+
ct as TeamVisibilityValidator,
|
|
2424
|
+
A as TopicValidator,
|
|
2415
2425
|
D as UserEngagementDataValidator,
|
|
2416
|
-
|
|
2417
|
-
|
|
2426
|
+
xn as UserEngagementValidator,
|
|
2427
|
+
Ln as UserFeatureStatusValidator,
|
|
2418
2428
|
I as UserRewardValidator,
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2429
|
+
Sn as VerifyMobileResultValidator,
|
|
2430
|
+
Cn as VoteEngagementDataValidator,
|
|
2431
|
+
at as VoteOptionSource,
|
|
2432
|
+
it as VoteOptionSourceValidator,
|
|
2433
|
+
Qr as WeixinApi,
|
|
2434
|
+
hn as WeixinSubscribeEngagementDataValidator,
|
|
2435
|
+
jr as WeixinWebLoginErrorCode,
|
|
2436
|
+
Rr as isWeixinSignResponse
|
|
2427
2437
|
};
|