@seayoo-web/gamer-api 2.4.3 → 2.4.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 +418 -404
- package/package.json +3 -3
- package/types/src/event.d.ts +1 -1
- package/types/src/weixin.d.ts +4 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var m = (a, t, r) =>
|
|
4
|
-
import { isComboWebView as
|
|
5
|
-
import { isPlainObject as R, useConsole as
|
|
6
|
-
function
|
|
1
|
+
var me = Object.defineProperty;
|
|
2
|
+
var de = (a, t, r) => t in a ? me(a, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[t] = r;
|
|
3
|
+
var m = (a, t, r) => de(a, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { isComboWebView as ge } from "@seayoo-web/combo-webview";
|
|
5
|
+
import { isPlainObject as R, useConsole as pe, Support as y, usePromise as _e, pruneURL as be, queryString as P, pruneObject as c, v as e, omitFields as V, typedObjectGuard as s, parseJSON as ye, removePara as B } from "@seayoo-web/utils";
|
|
6
|
+
function fe(a) {
|
|
7
7
|
return R(a, "gamer_token") && typeof a.gamer_token == "string";
|
|
8
8
|
}
|
|
9
9
|
function M(a) {
|
|
10
10
|
return R(a);
|
|
11
11
|
}
|
|
12
|
-
const w =
|
|
13
|
-
function
|
|
12
|
+
const w = pe("GamerApiSDK");
|
|
13
|
+
function he(a) {
|
|
14
14
|
return /^\/[a-z\d-]+$/.test(a);
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
17
|
-
const { promise: a, resolve: t } =
|
|
16
|
+
async function we() {
|
|
17
|
+
const { promise: a, resolve: t } = _e();
|
|
18
18
|
return wx.login({
|
|
19
19
|
success(r) {
|
|
20
20
|
t(r.code);
|
|
@@ -24,7 +24,7 @@ async function he() {
|
|
|
24
24
|
}
|
|
25
25
|
}), await a;
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const ke = {
|
|
28
28
|
get(a) {
|
|
29
29
|
return localStorage.getItem(a) || "";
|
|
30
30
|
},
|
|
@@ -34,7 +34,7 @@ const we = {
|
|
|
34
34
|
remove(a) {
|
|
35
35
|
localStorage.removeItem(a);
|
|
36
36
|
}
|
|
37
|
-
},
|
|
37
|
+
}, ve = {
|
|
38
38
|
get(a) {
|
|
39
39
|
try {
|
|
40
40
|
if (y.wx) return wx.getStorageSync(a) || "";
|
|
@@ -58,7 +58,7 @@ const we = {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}, k = "gamer_token";
|
|
61
|
-
class
|
|
61
|
+
class Rr {
|
|
62
62
|
constructor(t, r) {
|
|
63
63
|
m(this, "$NetRequest");
|
|
64
64
|
m(this, "$idToken", "");
|
|
@@ -66,15 +66,15 @@ class Cr {
|
|
|
66
66
|
m(this, "$gamerToken", "");
|
|
67
67
|
m(this, "req");
|
|
68
68
|
m(this, "storage");
|
|
69
|
-
this.storage = y.wx ?
|
|
70
|
-
const n =
|
|
69
|
+
this.storage = y.wx ? ve : ke;
|
|
70
|
+
const n = he(t) ? t : `https://${be(t)}`;
|
|
71
71
|
this.$NetRequest = r, this.req = r({
|
|
72
72
|
baseURL: `${n}/v1`,
|
|
73
73
|
timeout: 1e4,
|
|
74
74
|
maxRetry: 2,
|
|
75
75
|
retryInterval: "2EB",
|
|
76
|
-
retryResolve({ method:
|
|
77
|
-
return
|
|
76
|
+
retryResolve({ method: d, status: g }) {
|
|
77
|
+
return d === "GET" && g < 0;
|
|
78
78
|
},
|
|
79
79
|
responseRule: {
|
|
80
80
|
ok: { resolve: "body" },
|
|
@@ -85,12 +85,12 @@ class Cr {
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
// 使用箭头函数绑定执行上下文
|
|
88
|
-
requestTransformer: (
|
|
89
|
-
this.$gamerToken && (
|
|
88
|
+
requestTransformer: (d) => {
|
|
89
|
+
this.$gamerToken && (d.headers.Authorization = `Bearer ${this.$gamerToken}`);
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
const i = /^(?:localhost|[\d.]+):\d{4}$/.test(location.host), o =
|
|
93
|
-
(
|
|
92
|
+
const i = /^(?:localhost|[\d.]+):\d{4}$/.test(location.host), o = P("gamer_token");
|
|
93
|
+
(ge() || i && o) && (this.$gamerToken = o), this.$gamerToken || this.loadGamerTokenCache();
|
|
94
94
|
}
|
|
95
95
|
get NetRequest() {
|
|
96
96
|
return this.$NetRequest;
|
|
@@ -172,7 +172,7 @@ class Cr {
|
|
|
172
172
|
const { code: t, data: r } = await this.req.post(
|
|
173
173
|
"login-with-token",
|
|
174
174
|
c({ id_token: this.idToken, weixin_token: y.wx ? this.weixinToken : null }),
|
|
175
|
-
|
|
175
|
+
fe,
|
|
176
176
|
{ message: !1 }
|
|
177
177
|
);
|
|
178
178
|
switch (t) {
|
|
@@ -210,21 +210,21 @@ class Cr {
|
|
|
210
210
|
return r;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
const
|
|
213
|
+
const Ce = {
|
|
214
214
|
/** 未知 */
|
|
215
215
|
Unknown: "unknown",
|
|
216
216
|
/** 男 */
|
|
217
217
|
Male: "male",
|
|
218
218
|
/** 女 */
|
|
219
219
|
Female: "female"
|
|
220
|
-
},
|
|
220
|
+
}, Re = e.string().enum(Ce).lock(), Ve = {
|
|
221
221
|
/** 积分增加 */
|
|
222
222
|
Increase: "increase",
|
|
223
223
|
/** 积分减少 */
|
|
224
224
|
Decrease: "decrease",
|
|
225
225
|
/** 积分过期 */
|
|
226
226
|
Expired: "expired"
|
|
227
|
-
},
|
|
227
|
+
}, je = e.string().enum(Ve).lock(), Te = {
|
|
228
228
|
/** 游戏内购买 */
|
|
229
229
|
Order: "order",
|
|
230
230
|
/** 游戏内消耗 */
|
|
@@ -237,21 +237,21 @@ const ve = {
|
|
|
237
237
|
Admin: "admin",
|
|
238
238
|
/** 运营活动 */
|
|
239
239
|
Event: "event"
|
|
240
|
-
},
|
|
240
|
+
}, qe = e.string().enum(Te).lock(), xe = {
|
|
241
241
|
/** 游戏内奖励 */
|
|
242
242
|
GameReward: "game_reward",
|
|
243
243
|
/** 实物商品 */
|
|
244
244
|
Physical: "physical",
|
|
245
245
|
/** 虚拟商品 */
|
|
246
246
|
Virtual: "virtual"
|
|
247
|
-
}, X = e.string().enum(
|
|
247
|
+
}, X = e.string().enum(xe).lock(), Se = {
|
|
248
248
|
/** 待发放 */
|
|
249
249
|
Pending: "pending",
|
|
250
250
|
/** 已发放 */
|
|
251
251
|
Issued: "issued",
|
|
252
252
|
/** 发放失败 */
|
|
253
253
|
Failed: "failed"
|
|
254
|
-
},
|
|
254
|
+
}, Le = e.string().enum(Se).lock(), Ee = e.object({
|
|
255
255
|
default_avatar_url: e.string(),
|
|
256
256
|
official_avatar_urls: e.array(e.string()),
|
|
257
257
|
default_nickname: e.string(),
|
|
@@ -278,18 +278,18 @@ const ve = {
|
|
|
278
278
|
credit_expiring: e.number(),
|
|
279
279
|
level_change_time: e.number(),
|
|
280
280
|
level_expire_time: e.number()
|
|
281
|
-
}).lock(),
|
|
281
|
+
}).lock(), $e = e.object({
|
|
282
282
|
server_id: e.string(),
|
|
283
283
|
server_name: e.string()
|
|
284
|
-
}).lock(),
|
|
284
|
+
}).lock(), Ue = e.object({
|
|
285
285
|
role_id: e.string(),
|
|
286
286
|
role_name: e.string()
|
|
287
287
|
}).lock(), Y = e.object({
|
|
288
|
+
...Ue.shape,
|
|
288
289
|
...$e.shape,
|
|
289
|
-
...Ee.shape,
|
|
290
290
|
role_level: e.number(),
|
|
291
291
|
last_login_time: e.number()
|
|
292
|
-
}).lock(),
|
|
292
|
+
}).lock(), Fe = e.object({
|
|
293
293
|
...Y.shape,
|
|
294
294
|
/** 角色战力 */
|
|
295
295
|
role_fighting: e.number(),
|
|
@@ -299,11 +299,11 @@ const ve = {
|
|
|
299
299
|
kin_name: e.string().optional(),
|
|
300
300
|
/** 宗门职位 */
|
|
301
301
|
kin_position: e.string().optional()
|
|
302
|
-
}).lock(),
|
|
302
|
+
}).lock(), De = e.object({
|
|
303
303
|
name: e.string(),
|
|
304
304
|
avatar_url: e.string(),
|
|
305
305
|
bio: e.string(),
|
|
306
|
-
gender:
|
|
306
|
+
gender: Re,
|
|
307
307
|
birthday: e.object({ year: e.number(), month: e.number(), day: e.number() })
|
|
308
308
|
}).lock(), Z = e.object({
|
|
309
309
|
address_id: e.number(),
|
|
@@ -314,15 +314,15 @@ const ve = {
|
|
|
314
314
|
district: e.string(),
|
|
315
315
|
address: e.string(),
|
|
316
316
|
is_default: e.bool()
|
|
317
|
-
}).lock(),
|
|
317
|
+
}).lock(), Ie = e.object({
|
|
318
318
|
increased_credit: e.number(),
|
|
319
319
|
decreased_credit: e.number(),
|
|
320
320
|
expired_credit: e.number(),
|
|
321
321
|
balance_credit: e.number()
|
|
322
|
-
}).lock(),
|
|
322
|
+
}).lock(), Ge = e.object({
|
|
323
323
|
id: e.number(),
|
|
324
|
-
change_type:
|
|
325
|
-
change_scene:
|
|
324
|
+
change_type: je,
|
|
325
|
+
change_scene: qe,
|
|
326
326
|
change_credit: e.number(),
|
|
327
327
|
balance: e.number(),
|
|
328
328
|
change_time: e.number()
|
|
@@ -361,10 +361,10 @@ const ve = {
|
|
|
361
361
|
created_at: e.number(),
|
|
362
362
|
updated_at: e.number(),
|
|
363
363
|
redeemable_quantity: e.number().optional()
|
|
364
|
-
}).lock(),
|
|
364
|
+
}).lock(), Ae = e.object({
|
|
365
365
|
...V(W.shape, "tag"),
|
|
366
366
|
product: ee.clone().optional()
|
|
367
|
-
}).lock(),
|
|
367
|
+
}).lock(), Vr = e.union(
|
|
368
368
|
e.object({
|
|
369
369
|
server_id: e.string(),
|
|
370
370
|
role_id: e.string()
|
|
@@ -372,7 +372,7 @@ const ve = {
|
|
|
372
372
|
e.object({
|
|
373
373
|
address_id: e.number()
|
|
374
374
|
})
|
|
375
|
-
).satisfies().lock(),
|
|
375
|
+
).satisfies().lock(), Ne = e.object({
|
|
376
376
|
recipient: e.string(),
|
|
377
377
|
mobile: e.string(),
|
|
378
378
|
province: e.string(),
|
|
@@ -381,11 +381,11 @@ const ve = {
|
|
|
381
381
|
address: e.string(),
|
|
382
382
|
express_company: e.string(),
|
|
383
383
|
express_number: e.string()
|
|
384
|
-
}).lock(),
|
|
384
|
+
}).lock(), Oe = e.object({
|
|
385
385
|
server_id: e.string(),
|
|
386
386
|
role_id: e.string(),
|
|
387
387
|
role_name: e.string()
|
|
388
|
-
}).lock(),
|
|
388
|
+
}).lock(), Be = e.object({
|
|
389
389
|
redemption_id: e.number(),
|
|
390
390
|
player_id: e.string(),
|
|
391
391
|
product_id: e.number(),
|
|
@@ -396,17 +396,17 @@ const ve = {
|
|
|
396
396
|
catalog_name: e.string(),
|
|
397
397
|
quantity: e.number(),
|
|
398
398
|
amount: e.number(),
|
|
399
|
-
status:
|
|
399
|
+
status: Le,
|
|
400
400
|
created_at: e.number(),
|
|
401
|
-
extra_data: e.union(
|
|
402
|
-
}),
|
|
403
|
-
credit_logs: e.array(
|
|
401
|
+
extra_data: e.union(Ne.clone(), Oe.clone()).satisfies().optional()
|
|
402
|
+
}), Me = e.guard(Ee), Q = s({ player: Pe }), Qe = s({ roles: e.array(Y) }), x = s({ role_card: Fe }), K = e.guard(De), H = e.guard(Z), Ke = s({ addresses: e.array(Z) }), He = e.guard(Ie), ze = s({
|
|
403
|
+
credit_logs: e.array(Ge),
|
|
404
404
|
next_token: e.string().optional()
|
|
405
|
-
}),
|
|
406
|
-
redemptions: e.array(
|
|
405
|
+
}), Je = s({ products: e.array(ee) }), Xe = s({ benefits: e.array(W) }), Ye = s({ benefit: Ae }), Ze = s({
|
|
406
|
+
redemptions: e.array(Be),
|
|
407
407
|
next_token: e.string().optional()
|
|
408
408
|
});
|
|
409
|
-
class
|
|
409
|
+
class jr {
|
|
410
410
|
constructor(t) {
|
|
411
411
|
m(this, "token");
|
|
412
412
|
m(this, "req");
|
|
@@ -418,7 +418,7 @@ class Vr {
|
|
|
418
418
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=tuhsPt3ihp
|
|
419
419
|
*/
|
|
420
420
|
async getConfig(t) {
|
|
421
|
-
const { data: r } = await this.req.get("club/config",
|
|
421
|
+
const { data: r } = await this.req.get("club/config", Me, t);
|
|
422
422
|
return r;
|
|
423
423
|
}
|
|
424
424
|
/**
|
|
@@ -459,7 +459,7 @@ class Vr {
|
|
|
459
459
|
*/
|
|
460
460
|
async getRoles(t, r, n) {
|
|
461
461
|
if (!await this.token.autoLogin()) return [];
|
|
462
|
-
const { data: i } = await this.req.get("club/roles",
|
|
462
|
+
const { data: i } = await this.req.get("club/roles", Qe, {
|
|
463
463
|
...n,
|
|
464
464
|
params: c({ player_id: t, refresh: r })
|
|
465
465
|
});
|
|
@@ -529,7 +529,7 @@ class Vr {
|
|
|
529
529
|
*/
|
|
530
530
|
async getAddresses(t) {
|
|
531
531
|
if (!await this.token.autoLogin()) return [];
|
|
532
|
-
const { data: r } = await this.req.get("club/addresses",
|
|
532
|
+
const { data: r } = await this.req.get("club/addresses", Ke, t);
|
|
533
533
|
return (r == null ? void 0 : r.addresses) ?? [];
|
|
534
534
|
}
|
|
535
535
|
/**
|
|
@@ -577,7 +577,7 @@ class Vr {
|
|
|
577
577
|
*/
|
|
578
578
|
async getUserCredit(t, r) {
|
|
579
579
|
await this.token.autoLogin();
|
|
580
|
-
const { data: n, code: i, message: o } = await this.req.get("club/user-credit",
|
|
580
|
+
const { data: n, code: i, message: o } = await this.req.get("club/user-credit", He, {
|
|
581
581
|
...r,
|
|
582
582
|
params: c(t)
|
|
583
583
|
});
|
|
@@ -593,7 +593,7 @@ class Vr {
|
|
|
593
593
|
*/
|
|
594
594
|
async getCreditLogs(t, r) {
|
|
595
595
|
await this.token.autoLogin();
|
|
596
|
-
const { data: n } = await this.req.get("club/credit-logs",
|
|
596
|
+
const { data: n } = await this.req.get("club/credit-logs", ze, {
|
|
597
597
|
...r,
|
|
598
598
|
params: c({ max_results: 20, ...t })
|
|
599
599
|
});
|
|
@@ -609,7 +609,7 @@ class Vr {
|
|
|
609
609
|
*/
|
|
610
610
|
async getBenefits(t) {
|
|
611
611
|
if (!await this.token.autoLogin()) return [];
|
|
612
|
-
const { data: r } = await this.req.get("club/benefits",
|
|
612
|
+
const { data: r } = await this.req.get("club/benefits", Xe, t);
|
|
613
613
|
return (r == null ? void 0 : r.benefits) || [];
|
|
614
614
|
}
|
|
615
615
|
/**
|
|
@@ -619,7 +619,7 @@ class Vr {
|
|
|
619
619
|
*/
|
|
620
620
|
async getBenefit(t, r) {
|
|
621
621
|
if (!await this.token.autoLogin()) return null;
|
|
622
|
-
const { data: n } = await this.req.get("club/benefit",
|
|
622
|
+
const { data: n } = await this.req.get("club/benefit", Ye, {
|
|
623
623
|
...r,
|
|
624
624
|
params: { benefit_id: t }
|
|
625
625
|
});
|
|
@@ -631,7 +631,7 @@ class Vr {
|
|
|
631
631
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=r3vC3PzfMQ
|
|
632
632
|
*/
|
|
633
633
|
async getProducts(t, r) {
|
|
634
|
-
const { data: n } = await this.req.get("club/products",
|
|
634
|
+
const { data: n } = await this.req.get("club/products", Je, {
|
|
635
635
|
...r,
|
|
636
636
|
params: t
|
|
637
637
|
});
|
|
@@ -657,7 +657,7 @@ class Vr {
|
|
|
657
657
|
*/
|
|
658
658
|
async getRedemptions(t, r) {
|
|
659
659
|
await this.token.autoLogin();
|
|
660
|
-
const { data: n } = await this.req.get("club/redemptions",
|
|
660
|
+
const { data: n } = await this.req.get("club/redemptions", Ze, {
|
|
661
661
|
...r,
|
|
662
662
|
params: c({ max_results: 20, ...t })
|
|
663
663
|
});
|
|
@@ -686,17 +686,17 @@ const j = {
|
|
|
686
686
|
ExternalCode: "external_gift_code",
|
|
687
687
|
/** 空奖励 */
|
|
688
688
|
VoidItem: "void_item"
|
|
689
|
-
}, te = e.string().enum(j).lock(),
|
|
689
|
+
}, te = e.string().enum(j).lock(), Tr = j, ne = te, We = {
|
|
690
690
|
/** 世游通行证 ID / Combo ID */
|
|
691
691
|
UserId: "user_id",
|
|
692
692
|
/** 游戏角色 ID */
|
|
693
693
|
RoleId: "role_id"
|
|
694
|
-
},
|
|
694
|
+
}, et = e.string().enum(We).lock(), tt = {
|
|
695
695
|
None: "none",
|
|
696
696
|
Daily: "daily",
|
|
697
697
|
Weekly: "weekly",
|
|
698
698
|
Monthly: "monthly"
|
|
699
|
-
},
|
|
699
|
+
}, nt = e.string().enum(tt).lock(), u = {
|
|
700
700
|
/** 预约 */
|
|
701
701
|
Preregister: "preregister",
|
|
702
702
|
/** 抽奖 */
|
|
@@ -735,7 +735,7 @@ const j = {
|
|
|
735
735
|
CheckIn: "check_in",
|
|
736
736
|
/** 领取激活码 */
|
|
737
737
|
ClaimActivationKey: "claim_activation_key"
|
|
738
|
-
},
|
|
738
|
+
}, rt = e.string().enum(u).lock(), it = {
|
|
739
739
|
/** 累计游戏内活跃值 */
|
|
740
740
|
Active: "player_active_points",
|
|
741
741
|
/** 累计登录,单位 人天 */
|
|
@@ -750,14 +750,14 @@ const j = {
|
|
|
750
750
|
MatchCounts: "player_match_counts",
|
|
751
751
|
/** 游戏对局天数 */
|
|
752
752
|
MatchDays: "player_match_days"
|
|
753
|
-
}, re = e.string().enum(
|
|
753
|
+
}, re = e.string().enum(it).lock(), ot = {
|
|
754
754
|
/** 官方上传 */
|
|
755
755
|
System: "system",
|
|
756
756
|
/** 用户投稿 */
|
|
757
757
|
UserSubmission: "user_submission",
|
|
758
758
|
/** 投票入围 */
|
|
759
759
|
Shortlisted: "shortlisted"
|
|
760
|
-
},
|
|
760
|
+
}, at = e.string().enum(ot).lock(), _ = {
|
|
761
761
|
/** 未获得奖励 */
|
|
762
762
|
Ineligible: "ineligible",
|
|
763
763
|
/** 奖励未领取 */
|
|
@@ -768,7 +768,7 @@ const j = {
|
|
|
768
768
|
Failed: "failed",
|
|
769
769
|
/** 奖励已发货 */
|
|
770
770
|
Delivered: "delivered"
|
|
771
|
-
},
|
|
771
|
+
}, qr = e.string().enum(_).lock(), $ = {
|
|
772
772
|
/**
|
|
773
773
|
* 奖励未领取,拼写错误以兼容后端历史版本,检查请使用 Unclaimed
|
|
774
774
|
*
|
|
@@ -800,17 +800,17 @@ const j = {
|
|
|
800
800
|
Failed: _.Failed,
|
|
801
801
|
/** 奖励已发货 */
|
|
802
802
|
Delivered: _.Delivered
|
|
803
|
-
}, U = e.string().enum(b).lock(),
|
|
803
|
+
}, U = e.string().enum(b).lock(), st = {
|
|
804
804
|
/** 玩法产出奖励 */
|
|
805
805
|
Output: "output",
|
|
806
806
|
/** 玩法参与奖励 */
|
|
807
807
|
Engage: "engage"
|
|
808
|
-
}, F = e.string().enum(
|
|
808
|
+
}, F = e.string().enum(st).lock(), ct = {
|
|
809
809
|
/** 私有队伍 */
|
|
810
810
|
Private: "private",
|
|
811
811
|
/** 公开队伍 */
|
|
812
812
|
Public: "public"
|
|
813
|
-
},
|
|
813
|
+
}, ut = e.string().enum(ct).lock(), v = {
|
|
814
814
|
/** 未知状态 */
|
|
815
815
|
Unknown: "unknown",
|
|
816
816
|
/** 等待开奖 */
|
|
@@ -821,7 +821,7 @@ const j = {
|
|
|
821
821
|
Claimed: "claimed",
|
|
822
822
|
/** 领奖失败 */
|
|
823
823
|
Fail: "fail"
|
|
824
|
-
},
|
|
824
|
+
}, xr = e.string().enum(v).lock(), lt = {
|
|
825
825
|
/** 发起组队 */
|
|
826
826
|
Assemble: "assemble",
|
|
827
827
|
/** 加入队伍 */
|
|
@@ -832,71 +832,71 @@ const j = {
|
|
|
832
832
|
ChangeVisibility: "change_visibility",
|
|
833
833
|
/** 查询组队信息 */
|
|
834
834
|
Query: "query"
|
|
835
|
-
},
|
|
835
|
+
}, Sr = e.string().enum(lt).lock(), mt = {
|
|
836
836
|
/** 查询抽奖券 */
|
|
837
837
|
Query: "query",
|
|
838
838
|
/** 开奖 */
|
|
839
839
|
Draw: "draw",
|
|
840
840
|
/** 领奖 */
|
|
841
841
|
Claim: "claim"
|
|
842
|
-
},
|
|
842
|
+
}, Lr = e.string().enum(mt).lock(), dt = e.string().enum(V(j, "GiftCode", "LotteryTicket")), D = e.object({
|
|
843
843
|
reward_item_id: e.number(),
|
|
844
844
|
reward_amount: e.number(),
|
|
845
845
|
reward_item_name: e.string(),
|
|
846
846
|
reward_item_icon_url: e.string(),
|
|
847
847
|
reward_item_desc: e.string().optional(),
|
|
848
|
-
reward_item_type:
|
|
848
|
+
reward_item_type: dt,
|
|
849
849
|
reward_item_rating: e.number()
|
|
850
|
-
}).lock(),
|
|
850
|
+
}).lock(), gt = e.object({
|
|
851
851
|
engage_count: e.number(),
|
|
852
852
|
rewards: e.array(D)
|
|
853
|
-
}).lock(),
|
|
853
|
+
}).lock(), pt = e.union(
|
|
854
854
|
e.object({
|
|
855
855
|
feature_reward_type: e.string().enum("every"),
|
|
856
856
|
reward_details: e.array(D)
|
|
857
857
|
}),
|
|
858
858
|
e.object({
|
|
859
859
|
feature_reward_type: e.string().enum("regular"),
|
|
860
|
-
reward_details: e.array(
|
|
860
|
+
reward_details: e.array(gt)
|
|
861
861
|
})
|
|
862
862
|
).satisfies().lock(), l = e.object({
|
|
863
863
|
feature_name: e.string(),
|
|
864
864
|
feature_id: e.number(),
|
|
865
865
|
description: e.string(),
|
|
866
|
-
cycle:
|
|
866
|
+
cycle: nt,
|
|
867
867
|
limit: e.number(),
|
|
868
868
|
since: e.number(),
|
|
869
869
|
until: e.number(),
|
|
870
|
-
engage_account:
|
|
871
|
-
feature_rewards:
|
|
872
|
-
}),
|
|
870
|
+
engage_account: et,
|
|
871
|
+
feature_rewards: pt.clone().optional()
|
|
872
|
+
}), _t = u.Cashback, bt = e.object({
|
|
873
873
|
...l.shape,
|
|
874
|
-
feature_type: e.string().enum(
|
|
874
|
+
feature_type: e.string().enum(_t),
|
|
875
875
|
config: e.object({
|
|
876
876
|
order_start_time: e.number(),
|
|
877
877
|
order_end_time: e.number(),
|
|
878
878
|
claim_rewards_start_time: e.number(),
|
|
879
879
|
claim_rewards_end_time: e.number()
|
|
880
880
|
})
|
|
881
|
-
}),
|
|
881
|
+
}), yt = u.CheckIn, ft = e.object({
|
|
882
882
|
...l.shape,
|
|
883
|
-
feature_type: e.string().enum(
|
|
884
|
-
}),
|
|
883
|
+
feature_type: e.string().enum(yt)
|
|
884
|
+
}), ht = u.ClaimActivationKey, wt = e.object({
|
|
885
885
|
...l.shape,
|
|
886
|
-
feature_type: e.string().enum(
|
|
887
|
-
}),
|
|
886
|
+
feature_type: e.string().enum(ht)
|
|
887
|
+
}), kt = u.ClaimRewards, vt = e.object({
|
|
888
888
|
...l.shape,
|
|
889
|
-
feature_type: e.string().enum(
|
|
890
|
-
}),
|
|
889
|
+
feature_type: e.string().enum(kt)
|
|
890
|
+
}), Ct = u.Comment, Rt = e.object({
|
|
891
891
|
...l.shape,
|
|
892
|
-
feature_type: e.string().enum(
|
|
892
|
+
feature_type: e.string().enum(Ct),
|
|
893
893
|
config: e.object({
|
|
894
894
|
comments: e.array(e.string()),
|
|
895
895
|
send_rate: e.number()
|
|
896
896
|
})
|
|
897
|
-
}),
|
|
897
|
+
}), Vt = u.Follow, jt = e.object({
|
|
898
898
|
...l.shape,
|
|
899
|
-
feature_type: e.string().enum(
|
|
899
|
+
feature_type: e.string().enum(Vt),
|
|
900
900
|
config: e.object({
|
|
901
901
|
platform: e.string(),
|
|
902
902
|
platform_icon: e.string().optional(),
|
|
@@ -904,59 +904,59 @@ const j = {
|
|
|
904
904
|
qr_code_url: e.string().optional(),
|
|
905
905
|
platform_desc: e.string().optional()
|
|
906
906
|
})
|
|
907
|
-
}),
|
|
907
|
+
}), Tt = u.GiftCode, qt = e.object({
|
|
908
908
|
name: e.string(),
|
|
909
909
|
icon_url: e.string(),
|
|
910
910
|
count: e.number()
|
|
911
|
-
}),
|
|
911
|
+
}), xt = e.object({
|
|
912
912
|
...l.shape,
|
|
913
|
-
feature_type: e.string().enum(
|
|
913
|
+
feature_type: e.string().enum(Tt),
|
|
914
914
|
config: e.object({
|
|
915
|
-
gift_items: e.array(
|
|
915
|
+
gift_items: e.array(qt),
|
|
916
916
|
mp_url: e.string().optional(),
|
|
917
917
|
mp_qrcode_url: e.string().optional()
|
|
918
918
|
})
|
|
919
|
-
}),
|
|
919
|
+
}), St = u.Invite, Lt = e.object({
|
|
920
920
|
...l.shape,
|
|
921
|
-
feature_type: e.string().enum(
|
|
921
|
+
feature_type: e.string().enum(St),
|
|
922
922
|
config: e.object({
|
|
923
923
|
share_url: e.string()
|
|
924
924
|
})
|
|
925
|
-
}),
|
|
925
|
+
}), Et = u.InvitedRegister, Pt = e.object({
|
|
926
926
|
...l.shape,
|
|
927
|
-
feature_type: e.string().enum(
|
|
928
|
-
}),
|
|
927
|
+
feature_type: e.string().enum(Et)
|
|
928
|
+
}), $t = e.string().enum(V(j, "GiftCode", "LotteryTicket")), Ut = u.Lottery, Ft = e.object({
|
|
929
929
|
reward_item_id: e.number(),
|
|
930
930
|
reward_item_name: e.string(),
|
|
931
|
-
reward_item_type:
|
|
931
|
+
reward_item_type: $t,
|
|
932
932
|
reward_item_icon_url: e.string(),
|
|
933
933
|
reward_item_desc: e.string().optional(),
|
|
934
934
|
reward_amount: e.number(),
|
|
935
935
|
reward_remaining_stock: e.number()
|
|
936
|
-
}),
|
|
936
|
+
}), Dt = e.object({
|
|
937
937
|
...l.shape,
|
|
938
|
-
feature_type: e.string().enum(
|
|
938
|
+
feature_type: e.string().enum(Ut),
|
|
939
939
|
config: e.object({
|
|
940
940
|
consume_item_id: e.number(),
|
|
941
941
|
consume_item_name: e.number(),
|
|
942
942
|
consume_item_icon_url: e.string(),
|
|
943
943
|
consume_item_count: e.number(),
|
|
944
944
|
consume_item_desc: e.string().optional(),
|
|
945
|
-
rewards: e.array(
|
|
945
|
+
rewards: e.array(Ft)
|
|
946
946
|
})
|
|
947
|
-
}),
|
|
947
|
+
}), It = u.LotteryDraw, Gt = e.object({
|
|
948
948
|
...l.shape,
|
|
949
|
-
feature_type: e.string().enum(
|
|
949
|
+
feature_type: e.string().enum(It),
|
|
950
950
|
config: e.object({
|
|
951
951
|
draw_not_before: e.number(),
|
|
952
952
|
draw_not_after: e.number()
|
|
953
953
|
})
|
|
954
|
-
}),
|
|
954
|
+
}), At = u.Preregister, Nt = e.object({
|
|
955
955
|
...l.shape,
|
|
956
|
-
feature_type: e.string().enum(
|
|
957
|
-
}),
|
|
956
|
+
feature_type: e.string().enum(At)
|
|
957
|
+
}), Ot = u.Quest, Bt = e.object({
|
|
958
958
|
...l.shape,
|
|
959
|
-
feature_type: e.string().enum(
|
|
959
|
+
feature_type: e.string().enum(Ot),
|
|
960
960
|
config: e.object({
|
|
961
961
|
objective: re,
|
|
962
962
|
completion_value: e.number(),
|
|
@@ -970,38 +970,38 @@ const j = {
|
|
|
970
970
|
required_matches: e.number().min(1).optional()
|
|
971
971
|
}).optional()
|
|
972
972
|
})
|
|
973
|
-
}),
|
|
973
|
+
}), Mt = u.Register, Qt = e.object({
|
|
974
974
|
...l.shape,
|
|
975
|
-
feature_type: e.string().enum(
|
|
976
|
-
}),
|
|
975
|
+
feature_type: e.string().enum(Mt)
|
|
976
|
+
}), Kt = u.Share, Ht = e.object({
|
|
977
977
|
...l.shape,
|
|
978
|
-
feature_type: e.string().enum(
|
|
978
|
+
feature_type: e.string().enum(Kt),
|
|
979
979
|
config: e.object({
|
|
980
980
|
share_platform: e.string(),
|
|
981
981
|
jump_url: e.string().optional(),
|
|
982
982
|
icon_url: e.string().optional()
|
|
983
983
|
})
|
|
984
|
-
}),
|
|
984
|
+
}), zt = u.Subscribe, Jt = e.object({
|
|
985
985
|
...l.shape,
|
|
986
|
-
feature_type: e.string().enum(
|
|
986
|
+
feature_type: e.string().enum(zt),
|
|
987
987
|
config: e.object({
|
|
988
988
|
weixin_template_ids: e.array(e.string())
|
|
989
989
|
})
|
|
990
|
-
}),
|
|
990
|
+
}), Xt = u.Survey, Yt = e.object({
|
|
991
991
|
...l.shape,
|
|
992
|
-
feature_type: e.string().enum(
|
|
992
|
+
feature_type: e.string().enum(Xt),
|
|
993
993
|
config: e.object({
|
|
994
994
|
survey_id: e.string(),
|
|
995
995
|
survey_url: e.string()
|
|
996
996
|
})
|
|
997
|
-
}),
|
|
997
|
+
}), Zt = u.Team, Wt = e.object({
|
|
998
998
|
...l.shape,
|
|
999
|
-
feature_type: e.string().enum(
|
|
999
|
+
feature_type: e.string().enum(Zt),
|
|
1000
1000
|
config: e.object({
|
|
1001
1001
|
max_members: e.number().min(1),
|
|
1002
1002
|
min_members: e.number().min(1)
|
|
1003
1003
|
})
|
|
1004
|
-
}),
|
|
1004
|
+
}), en = u.Vote, tn = e.object({
|
|
1005
1005
|
sn: e.string(),
|
|
1006
1006
|
name: e.string(),
|
|
1007
1007
|
img_urls: e.array(e.string()).optional(),
|
|
@@ -1011,57 +1011,57 @@ const j = {
|
|
|
1011
1011
|
amount: e.number(),
|
|
1012
1012
|
finalists: e.bool(),
|
|
1013
1013
|
last_vote_time: e.number()
|
|
1014
|
-
}),
|
|
1014
|
+
}), nn = e.object({
|
|
1015
1015
|
...l.shape,
|
|
1016
|
-
feature_type: e.string().enum(
|
|
1016
|
+
feature_type: e.string().enum(en),
|
|
1017
1017
|
config: e.object({
|
|
1018
1018
|
vote_feature_ids: e.array(e.number()),
|
|
1019
1019
|
submission_feature_ids: e.array(e.number()),
|
|
1020
1020
|
finalists_amount: e.number(),
|
|
1021
|
-
source:
|
|
1022
|
-
options: e.array(
|
|
1021
|
+
source: at,
|
|
1022
|
+
options: e.array(tn),
|
|
1023
1023
|
rewards: e.array(D)
|
|
1024
1024
|
})
|
|
1025
|
-
}),
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1025
|
+
}), rn = e.union(
|
|
1026
|
+
bt,
|
|
1027
|
+
ft,
|
|
1028
|
+
vt,
|
|
1029
|
+
Rt,
|
|
1030
|
+
jt,
|
|
1031
|
+
xt,
|
|
1032
|
+
Lt,
|
|
1033
1033
|
Pt,
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
).key("feature_type").satisfies(),
|
|
1034
|
+
Dt,
|
|
1035
|
+
Gt,
|
|
1036
|
+
Nt,
|
|
1037
|
+
Bt,
|
|
1038
|
+
Qt,
|
|
1039
|
+
Ht,
|
|
1040
|
+
Jt,
|
|
1041
|
+
Yt,
|
|
1042
|
+
Wt,
|
|
1043
|
+
nn,
|
|
1044
|
+
wt
|
|
1045
|
+
).key("feature_type").satisfies(), on = e.object({
|
|
1046
1046
|
event_name: e.string(),
|
|
1047
1047
|
rules: e.string(),
|
|
1048
1048
|
since: e.number(),
|
|
1049
1049
|
until: e.number(),
|
|
1050
1050
|
visit_count: e.number().optional(),
|
|
1051
|
-
features: e.array(
|
|
1052
|
-
}).lock(), S = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()),
|
|
1051
|
+
features: e.array(rn)
|
|
1052
|
+
}).lock(), S = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()), an = e.object({
|
|
1053
1053
|
order_total_amount: S,
|
|
1054
1054
|
cashback_total_amount: S,
|
|
1055
1055
|
game_item_count: S
|
|
1056
|
-
}), an = e.object({
|
|
1057
|
-
activation_key: e.string().disallow("")
|
|
1058
1056
|
}), sn = e.object({
|
|
1059
|
-
|
|
1057
|
+
activation_key: e.string().disallow("")
|
|
1060
1058
|
}), cn = e.object({
|
|
1059
|
+
gift_code: e.string()
|
|
1060
|
+
}), un = e.object({
|
|
1061
1061
|
user_id: e.string(),
|
|
1062
1062
|
name: e.string().optional(),
|
|
1063
1063
|
avatar_url: e.string().optional()
|
|
1064
|
-
}),
|
|
1064
|
+
}), ln = e.object({
|
|
1065
1065
|
lottery_count: e.number()
|
|
1066
1066
|
}), oe = e.object({
|
|
1067
1067
|
reward_id: e.number(),
|
|
@@ -1078,26 +1078,26 @@ const j = {
|
|
|
1078
1078
|
event_name: e.string(),
|
|
1079
1079
|
feature_id: e.number(),
|
|
1080
1080
|
engagement_id: e.number(),
|
|
1081
|
-
feature_type:
|
|
1081
|
+
feature_type: rt,
|
|
1082
1082
|
receive_time: e.number(),
|
|
1083
1083
|
// https://kdocs.cn/l/ckWFDcOsYEUA?linkname=merUzJsVYH
|
|
1084
1084
|
// 后续会格式化为具体的类型,此处的校验需要对应增加
|
|
1085
1085
|
extra_data: e.record(e.unknown()).optional()
|
|
1086
|
-
}),
|
|
1086
|
+
}), mn = e.string().enum(v.Unknown, v.Pending), dn = e.union(
|
|
1087
1087
|
e.object({
|
|
1088
1088
|
ticket: e.string(),
|
|
1089
|
-
status:
|
|
1089
|
+
status: mn
|
|
1090
1090
|
}),
|
|
1091
1091
|
e.object({
|
|
1092
1092
|
ticket: e.string(),
|
|
1093
1093
|
status: e.string().enum(V(v, "Unknown", "Pending")),
|
|
1094
1094
|
reward: oe
|
|
1095
1095
|
})
|
|
1096
|
-
).satisfies(),
|
|
1097
|
-
tickets: e.array(
|
|
1098
|
-
}), gn = e.object({
|
|
1099
|
-
platforms: e.array(e.string())
|
|
1096
|
+
).satisfies(), gn = e.object({
|
|
1097
|
+
tickets: e.array(dn)
|
|
1100
1098
|
}), pn = e.object({
|
|
1099
|
+
platforms: e.array(e.string())
|
|
1100
|
+
}), _n = e.object({
|
|
1101
1101
|
objective: re,
|
|
1102
1102
|
progress: e.number(),
|
|
1103
1103
|
completion_value: e.number().optional(),
|
|
@@ -1113,24 +1113,24 @@ const j = {
|
|
|
1113
1113
|
})
|
|
1114
1114
|
)
|
|
1115
1115
|
}).optional()
|
|
1116
|
-
}), _n = e.object({
|
|
1117
|
-
platform: e.string()
|
|
1118
1116
|
}), bn = e.object({
|
|
1119
|
-
|
|
1117
|
+
platform: e.string()
|
|
1120
1118
|
}), yn = e.object({
|
|
1121
|
-
|
|
1119
|
+
weixin_openid: e.string()
|
|
1122
1120
|
}), fn = e.object({
|
|
1121
|
+
serial_number: e.number()
|
|
1122
|
+
}), hn = e.object({
|
|
1123
1123
|
team_code: e.string(),
|
|
1124
1124
|
leader_name: e.string(),
|
|
1125
1125
|
total_members: e.number()
|
|
1126
|
-
}),
|
|
1126
|
+
}), Er = e.object({
|
|
1127
1127
|
is_leader: e.bool(),
|
|
1128
1128
|
is_myself: e.bool().optional(),
|
|
1129
1129
|
role_name: e.string(),
|
|
1130
1130
|
server_name: e.string()
|
|
1131
|
-
}),
|
|
1131
|
+
}), wn = e.object({
|
|
1132
1132
|
team_code: e.string(),
|
|
1133
|
-
visibility:
|
|
1133
|
+
visibility: ut,
|
|
1134
1134
|
members: e.array(
|
|
1135
1135
|
e.object({
|
|
1136
1136
|
is_leader: e.bool(),
|
|
@@ -1138,9 +1138,9 @@ const j = {
|
|
|
1138
1138
|
server_name: e.string()
|
|
1139
1139
|
})
|
|
1140
1140
|
)
|
|
1141
|
-
}), wn = e.object({
|
|
1142
|
-
option_sn: e.string()
|
|
1143
1141
|
}), kn = e.object({
|
|
1142
|
+
option_sn: e.string()
|
|
1143
|
+
}), vn = e.object({
|
|
1144
1144
|
user_id: e.string(),
|
|
1145
1145
|
name: e.string(),
|
|
1146
1146
|
avatar_url: e.string(),
|
|
@@ -1148,24 +1148,24 @@ const j = {
|
|
|
1148
1148
|
video_note: e.number(),
|
|
1149
1149
|
created_at: e.number()
|
|
1150
1150
|
}), I = e.union(
|
|
1151
|
-
|
|
1151
|
+
pn,
|
|
1152
|
+
ln,
|
|
1153
|
+
fn,
|
|
1152
1154
|
un,
|
|
1155
|
+
bn,
|
|
1156
|
+
kn,
|
|
1153
1157
|
yn,
|
|
1158
|
+
an,
|
|
1154
1159
|
cn,
|
|
1155
|
-
_n,
|
|
1156
1160
|
wn,
|
|
1157
|
-
|
|
1158
|
-
|
|
1161
|
+
_n,
|
|
1162
|
+
gn,
|
|
1159
1163
|
sn,
|
|
1160
|
-
hn,
|
|
1161
|
-
pn,
|
|
1162
|
-
dn,
|
|
1163
|
-
an,
|
|
1164
1164
|
e.custom(
|
|
1165
1165
|
"EmptyObject",
|
|
1166
1166
|
(a) => R(a) && Object.keys(a).length === 0
|
|
1167
1167
|
)
|
|
1168
|
-
).satisfies().lock(),
|
|
1168
|
+
).satisfies().lock(), Cn = e.object({
|
|
1169
1169
|
reward_id: e.number(),
|
|
1170
1170
|
reward_item_id: e.number(),
|
|
1171
1171
|
reward_item_type: ne,
|
|
@@ -1178,7 +1178,7 @@ const j = {
|
|
|
1178
1178
|
reward_item_rating: e.number(),
|
|
1179
1179
|
receive_time: e.number(),
|
|
1180
1180
|
extra_data: e.union(...I.validators, e.record(e.unknown())).satisfies().optional()
|
|
1181
|
-
}),
|
|
1181
|
+
}), Rn = e.object({
|
|
1182
1182
|
reward_id: e.number(),
|
|
1183
1183
|
reward_item_id: e.number(),
|
|
1184
1184
|
reward_item_name: e.string(),
|
|
@@ -1189,7 +1189,7 @@ const j = {
|
|
|
1189
1189
|
reward_status: ie,
|
|
1190
1190
|
reward_source: F,
|
|
1191
1191
|
extra_data: e.record(e.unknown()).optional()
|
|
1192
|
-
}),
|
|
1192
|
+
}), Vn = e.object({
|
|
1193
1193
|
engagement_id: e.number(),
|
|
1194
1194
|
user_id: e.string(),
|
|
1195
1195
|
event_id: e.number(),
|
|
@@ -1199,15 +1199,15 @@ const j = {
|
|
|
1199
1199
|
server_id: e.string().optional(),
|
|
1200
1200
|
role_id: e.string().optional(),
|
|
1201
1201
|
created_at: e.number(),
|
|
1202
|
-
rewards: e.array(
|
|
1203
|
-
}).lock(),
|
|
1202
|
+
rewards: e.array(Cn).optional()
|
|
1203
|
+
}).lock(), jn = e.object({
|
|
1204
1204
|
allowed: e.bool(),
|
|
1205
1205
|
registered: e.bool()
|
|
1206
|
-
}),
|
|
1206
|
+
}), Tn = e.object({
|
|
1207
1207
|
feature_id: e.number(),
|
|
1208
1208
|
can_engage: e.bool(),
|
|
1209
1209
|
has_unclaimed_rewards: e.bool()
|
|
1210
|
-
}),
|
|
1210
|
+
}), qn = e.object({
|
|
1211
1211
|
engagement_id: e.number(),
|
|
1212
1212
|
engagement: e.object({
|
|
1213
1213
|
engagement_id: e.number(),
|
|
@@ -1215,30 +1215,30 @@ const j = {
|
|
|
1215
1215
|
feature_id: e.number(),
|
|
1216
1216
|
data: I.clone().optional()
|
|
1217
1217
|
}).optional(),
|
|
1218
|
-
rewards: e.array(
|
|
1218
|
+
rewards: e.array(Rn).optional(),
|
|
1219
1219
|
scan: e.bool().optional()
|
|
1220
|
-
}),
|
|
1220
|
+
}), xn = e.object({
|
|
1221
1221
|
reward_id: e.number(),
|
|
1222
1222
|
reward_status: U
|
|
1223
|
-
}),
|
|
1224
|
-
engagements: e.union(e.array(
|
|
1225
|
-
}), En = s({
|
|
1226
|
-
status: e.array(jn)
|
|
1223
|
+
}), Sn = e.guard(on), Ln = e.guard(jn), L = s({ count: e.number() }), En = s({ first_visit: e.bool() }), Pn = s({
|
|
1224
|
+
engagements: e.union(e.array(vn), e.array(hn))
|
|
1227
1225
|
}), $n = s({
|
|
1228
|
-
|
|
1226
|
+
status: e.array(Tn)
|
|
1227
|
+
}), Un = s({
|
|
1228
|
+
engagements: e.array(Vn),
|
|
1229
1229
|
next_token: e.string().optional()
|
|
1230
|
-
}),
|
|
1231
|
-
claimed_items: e.array(
|
|
1232
|
-
}), Dn = s({
|
|
1233
|
-
reward_status: U
|
|
1230
|
+
}), Fn = e.guard(qn), Dn = s({
|
|
1231
|
+
claimed_items: e.array(xn)
|
|
1234
1232
|
}), In = s({
|
|
1233
|
+
reward_status: U
|
|
1234
|
+
}), Gn = s({
|
|
1235
1235
|
user_rewards: e.array(oe),
|
|
1236
1236
|
next_token: e.string().optional()
|
|
1237
|
-
}), Gn = s({
|
|
1238
|
-
scene: e.string()
|
|
1239
1237
|
}), An = s({
|
|
1240
|
-
|
|
1238
|
+
scene: e.string()
|
|
1241
1239
|
}), Nn = s({
|
|
1240
|
+
params: e.string()
|
|
1241
|
+
}), On = s({
|
|
1242
1242
|
img: e.string()
|
|
1243
1243
|
});
|
|
1244
1244
|
class Pr {
|
|
@@ -1254,7 +1254,7 @@ class Pr {
|
|
|
1254
1254
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=OWGSPF3Ysl
|
|
1255
1255
|
*/
|
|
1256
1256
|
async verifyMobileAllowed(t, r, n) {
|
|
1257
|
-
const { data: i } = await this.req.get("verify-mobile-allowed",
|
|
1257
|
+
const { data: i } = await this.req.get("verify-mobile-allowed", Ln, {
|
|
1258
1258
|
...n,
|
|
1259
1259
|
params: { game_id: t, mobile: r }
|
|
1260
1260
|
});
|
|
@@ -1266,7 +1266,7 @@ class Pr {
|
|
|
1266
1266
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=wFXxtdNKPm
|
|
1267
1267
|
*/
|
|
1268
1268
|
async getConfig(t) {
|
|
1269
|
-
const { data: r } = await this.req.get(`event/${this.event}/event-config`,
|
|
1269
|
+
const { data: r } = await this.req.get(`event/${this.event}/event-config`, Sn, t);
|
|
1270
1270
|
return r;
|
|
1271
1271
|
}
|
|
1272
1272
|
/**
|
|
@@ -1317,7 +1317,7 @@ class Pr {
|
|
|
1317
1317
|
const { data: n, code: i, message: o } = await this.req.post(
|
|
1318
1318
|
`event/${this.event}/visit`,
|
|
1319
1319
|
c(t || {}),
|
|
1320
|
-
|
|
1320
|
+
En,
|
|
1321
1321
|
r
|
|
1322
1322
|
);
|
|
1323
1323
|
return n ?? {
|
|
@@ -1336,7 +1336,7 @@ class Pr {
|
|
|
1336
1336
|
*/
|
|
1337
1337
|
async getUserFeatureStatus(t, r) {
|
|
1338
1338
|
if (!await this.token.autoLogin()) return [];
|
|
1339
|
-
const { data: n } = await this.req.get("event/user-feature-status",
|
|
1339
|
+
const { data: n } = await this.req.get("event/user-feature-status", $n, {
|
|
1340
1340
|
...r,
|
|
1341
1341
|
message: !1,
|
|
1342
1342
|
params: c({ ...t, event_id: this.event })
|
|
@@ -1356,7 +1356,7 @@ class Pr {
|
|
|
1356
1356
|
engagements: [],
|
|
1357
1357
|
next_token: ""
|
|
1358
1358
|
};
|
|
1359
|
-
const { data: i } = await this.req.get("event/user-engagements",
|
|
1359
|
+
const { data: i } = await this.req.get("event/user-engagements", Un, {
|
|
1360
1360
|
...n,
|
|
1361
1361
|
params: c({
|
|
1362
1362
|
max_results: 20,
|
|
@@ -1381,19 +1381,19 @@ class Pr {
|
|
|
1381
1381
|
*/
|
|
1382
1382
|
async engage(t, r, n, i) {
|
|
1383
1383
|
await this.token.autoLogin();
|
|
1384
|
-
const { data: o, code:
|
|
1384
|
+
const { data: o, code: d, message: g } = await this.req.post(
|
|
1385
1385
|
`event/${this.event}/engage`,
|
|
1386
1386
|
c({
|
|
1387
1387
|
feature_id: t,
|
|
1388
1388
|
engagement: r,
|
|
1389
1389
|
...n
|
|
1390
1390
|
}),
|
|
1391
|
-
|
|
1391
|
+
Fn,
|
|
1392
1392
|
i
|
|
1393
1393
|
);
|
|
1394
1394
|
return o && o.rewards && (o.rewards = o.rewards.map((h) => (h.reward_status = h.reward_status === $.UnclaimedErr ? $.Unclaimed : h.reward_status, h))), o ?? {
|
|
1395
|
-
message:
|
|
1396
|
-
error:
|
|
1395
|
+
message: g,
|
|
1396
|
+
error: d
|
|
1397
1397
|
// 没有可领取的激活码
|
|
1398
1398
|
};
|
|
1399
1399
|
}
|
|
@@ -1406,11 +1406,14 @@ class Pr {
|
|
|
1406
1406
|
await this.token.autoLogin();
|
|
1407
1407
|
const { data: n, code: i, message: o } = await this.req.post(
|
|
1408
1408
|
"event/claim-rewards",
|
|
1409
|
-
c(
|
|
1410
|
-
|
|
1409
|
+
c({
|
|
1410
|
+
...t,
|
|
1411
|
+
server_id: t.server_id ? +t.server_id : void 0
|
|
1412
|
+
}),
|
|
1413
|
+
Dn,
|
|
1411
1414
|
r
|
|
1412
|
-
),
|
|
1413
|
-
return
|
|
1415
|
+
), d = n == null ? void 0 : n.claimed_items;
|
|
1416
|
+
return d ? d.map((g) => (g.reward_status = g.reward_status === b.UnclaimedErr ? b.Unclaimed : g.reward_status, g)) : {
|
|
1414
1417
|
message: o,
|
|
1415
1418
|
error: i
|
|
1416
1419
|
};
|
|
@@ -1425,7 +1428,7 @@ class Pr {
|
|
|
1425
1428
|
const { data: n, code: i, message: o } = await this.req.post(
|
|
1426
1429
|
"event/claim-weixin-hongbao",
|
|
1427
1430
|
{ reward_id: t },
|
|
1428
|
-
|
|
1431
|
+
In,
|
|
1429
1432
|
r
|
|
1430
1433
|
);
|
|
1431
1434
|
return n ? (n.reward_status = n.reward_status === b.UnclaimedErr ? b.Unclaimed : n.reward_status, n) : {
|
|
@@ -1466,7 +1469,7 @@ class Pr {
|
|
|
1466
1469
|
const { data: n } = await this.req.post(
|
|
1467
1470
|
"event/user-rewards",
|
|
1468
1471
|
c({ max_results: 20, ...t, event_id: this.event }),
|
|
1469
|
-
|
|
1472
|
+
Gn,
|
|
1470
1473
|
r
|
|
1471
1474
|
);
|
|
1472
1475
|
return {
|
|
@@ -1506,7 +1509,7 @@ class Pr {
|
|
|
1506
1509
|
*/
|
|
1507
1510
|
async getUnlimitQrcodeScene(t, r) {
|
|
1508
1511
|
if (!await this.token.autoLogin()) return null;
|
|
1509
|
-
const { data: n } = await this.req.get("event/unlimit-qrcode-scene",
|
|
1512
|
+
const { data: n } = await this.req.get("event/unlimit-qrcode-scene", An, {
|
|
1510
1513
|
...r,
|
|
1511
1514
|
params: { params: t }
|
|
1512
1515
|
});
|
|
@@ -1520,7 +1523,7 @@ class Pr {
|
|
|
1520
1523
|
* @param scene - 小程序码 scene 值
|
|
1521
1524
|
*/
|
|
1522
1525
|
async getParamsByQrcodeScene(t, r) {
|
|
1523
|
-
const { data: n } = await this.req.get("event/params-by-qrcode-scene",
|
|
1526
|
+
const { data: n } = await this.req.get("event/params-by-qrcode-scene", Nn, {
|
|
1524
1527
|
...r,
|
|
1525
1528
|
params: { scene: t }
|
|
1526
1529
|
});
|
|
@@ -1536,18 +1539,18 @@ class Pr {
|
|
|
1536
1539
|
const { data: n } = await this.req.post(
|
|
1537
1540
|
"event/unlimit-qrcode",
|
|
1538
1541
|
c(t),
|
|
1539
|
-
|
|
1542
|
+
On,
|
|
1540
1543
|
r
|
|
1541
1544
|
);
|
|
1542
1545
|
return (n == null ? void 0 : n.img) ?? null;
|
|
1543
1546
|
}
|
|
1544
1547
|
}
|
|
1545
|
-
const
|
|
1548
|
+
const Bn = {
|
|
1546
1549
|
/** 所有人均可以发帖 */
|
|
1547
1550
|
All: "all",
|
|
1548
1551
|
/** 指定用户可发帖 */
|
|
1549
1552
|
Limit: "limit"
|
|
1550
|
-
},
|
|
1553
|
+
}, Mn = e.string().enum(Bn).lock(), Qn = {
|
|
1551
1554
|
/** 待审核(仅自己可见) */
|
|
1552
1555
|
Pending: "pending",
|
|
1553
1556
|
/** 审核通过 */
|
|
@@ -1556,14 +1559,14 @@ const On = {
|
|
|
1556
1559
|
Failed: "failed",
|
|
1557
1560
|
/** 嫌疑(仅自己可见) */
|
|
1558
1561
|
Suspect: "suspect"
|
|
1559
|
-
}, ae = e.string().enum(
|
|
1562
|
+
}, ae = e.string().enum(Qn).lock(), Kn = {
|
|
1560
1563
|
/** 系统通知 */
|
|
1561
1564
|
System: "system",
|
|
1562
1565
|
/** 评论我的 */
|
|
1563
1566
|
Comment: "comment",
|
|
1564
1567
|
/** 点赞通知 */
|
|
1565
1568
|
Like: "like"
|
|
1566
|
-
},
|
|
1569
|
+
}, $r = e.string().enum(Kn).lock(), p = {
|
|
1567
1570
|
/** 系统通知 */
|
|
1568
1571
|
System: "system",
|
|
1569
1572
|
/** 帖子被置顶 */
|
|
@@ -1588,13 +1591,13 @@ const On = {
|
|
|
1588
1591
|
ReplyLiked: "reply_liked",
|
|
1589
1592
|
/** 回复被删除 */
|
|
1590
1593
|
ReplyDeleted: "reply_deleted"
|
|
1591
|
-
},
|
|
1594
|
+
}, Hn = e.string().enum(p).lock(), se = e.object({
|
|
1592
1595
|
forum_id: e.number(),
|
|
1593
1596
|
icon_url: e.string(),
|
|
1594
1597
|
name: e.string(),
|
|
1595
1598
|
tags: e.array(e.string()),
|
|
1596
1599
|
sort: e.number(),
|
|
1597
|
-
mode:
|
|
1600
|
+
mode: Mn,
|
|
1598
1601
|
member_ids: e.array(e.number())
|
|
1599
1602
|
}).lock(), G = e.object({
|
|
1600
1603
|
topic_id: e.number(),
|
|
@@ -1625,7 +1628,7 @@ const On = {
|
|
|
1625
1628
|
create_time: e.number()
|
|
1626
1629
|
}).lock(), ce = e.object({
|
|
1627
1630
|
err_msg: e.string().optional()
|
|
1628
|
-
}).lock(),
|
|
1631
|
+
}).lock(), zn = e.object({
|
|
1629
1632
|
reply_id: e.number(),
|
|
1630
1633
|
reply_content: e.string().optional(),
|
|
1631
1634
|
replied_by: e.string(),
|
|
@@ -1644,7 +1647,7 @@ const On = {
|
|
|
1644
1647
|
content: e.string(),
|
|
1645
1648
|
like_num: e.number(),
|
|
1646
1649
|
liked: e.bool(),
|
|
1647
|
-
reply_to:
|
|
1650
|
+
reply_to: zn,
|
|
1648
1651
|
create_time: e.number()
|
|
1649
1652
|
}).lock(), C = e.object({
|
|
1650
1653
|
comment_id: e.number(),
|
|
@@ -1666,19 +1669,19 @@ const On = {
|
|
|
1666
1669
|
create_time: e.number(),
|
|
1667
1670
|
status: ae,
|
|
1668
1671
|
replies: e.array(T).optional()
|
|
1669
|
-
}).lock(),
|
|
1672
|
+
}).lock(), Jn = e.object({
|
|
1670
1673
|
image_url: e.string(),
|
|
1671
1674
|
upload_url: e.string(),
|
|
1672
1675
|
existed: e.bool()
|
|
1673
1676
|
}).lock(), f = e.object({
|
|
1674
1677
|
notification_id: e.string(),
|
|
1675
|
-
notification_type:
|
|
1678
|
+
notification_type: Hn,
|
|
1676
1679
|
is_read: e.bool(),
|
|
1677
1680
|
create_time: e.number(),
|
|
1678
1681
|
origin_user_id: e.string(),
|
|
1679
1682
|
origin_user_name: e.string(),
|
|
1680
1683
|
origin_user_avatar_url: e.string()
|
|
1681
|
-
}).lock(),
|
|
1684
|
+
}).lock(), Xn = e.object({
|
|
1682
1685
|
system_message_subject: e.string(),
|
|
1683
1686
|
system_message_content: e.string()
|
|
1684
1687
|
}).lock(), N = e.object({
|
|
@@ -1692,78 +1695,78 @@ const On = {
|
|
|
1692
1695
|
}).lock(), O = e.object({
|
|
1693
1696
|
reply_id: e.number(),
|
|
1694
1697
|
reply_content: e.string()
|
|
1695
|
-
}).lock(),
|
|
1698
|
+
}).lock(), Yn = e.object({
|
|
1696
1699
|
...f.shape,
|
|
1697
|
-
...
|
|
1698
|
-
notification_type: e.string().enum(
|
|
1699
|
-
}),
|
|
1700
|
+
...Xn.shape,
|
|
1701
|
+
notification_type: e.string().enum(p.System)
|
|
1702
|
+
}), Zn = e.object({
|
|
1700
1703
|
...f.shape,
|
|
1701
1704
|
...N.shape,
|
|
1702
1705
|
notification_type: e.string().enum(
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1706
|
+
p.PostPinned,
|
|
1707
|
+
p.PostHighlighted,
|
|
1708
|
+
p.PostDeleted,
|
|
1709
|
+
p.PostLiked
|
|
1707
1710
|
)
|
|
1708
|
-
}),
|
|
1711
|
+
}), Wn = e.object({
|
|
1709
1712
|
...f.shape,
|
|
1710
1713
|
...N.shape,
|
|
1711
1714
|
...q.shape,
|
|
1712
|
-
notification_type: e.string().enum(
|
|
1713
|
-
}),
|
|
1715
|
+
notification_type: e.string().enum(p.PostCommented)
|
|
1716
|
+
}), er = e.object({
|
|
1714
1717
|
...f.shape,
|
|
1715
1718
|
...q.shape,
|
|
1716
1719
|
...O.shape,
|
|
1717
|
-
notification_type: e.string().enum(
|
|
1718
|
-
}),
|
|
1720
|
+
notification_type: e.string().enum(p.CommentReplied)
|
|
1721
|
+
}), tr = e.object({
|
|
1719
1722
|
...f.shape,
|
|
1720
1723
|
...q.shape,
|
|
1721
1724
|
...N.shape,
|
|
1722
|
-
notification_type: e.string().enum(
|
|
1723
|
-
}),
|
|
1725
|
+
notification_type: e.string().enum(p.CommentLiked, p.CommentDeleted)
|
|
1726
|
+
}), nr = e.object({
|
|
1724
1727
|
...f.shape,
|
|
1725
1728
|
...O.shape,
|
|
1726
|
-
notification_type: e.string().enum(
|
|
1729
|
+
notification_type: e.string().enum(p.ReplyReplied),
|
|
1727
1730
|
comment_id: e.number(),
|
|
1728
1731
|
reply_to_reply_id: e.number(),
|
|
1729
1732
|
reply_to_reply_content: e.string()
|
|
1730
|
-
}),
|
|
1733
|
+
}), rr = e.object({
|
|
1731
1734
|
...f.shape,
|
|
1732
1735
|
...O.shape,
|
|
1733
1736
|
...q.shape,
|
|
1734
|
-
notification_type: e.string().enum(
|
|
1735
|
-
}),
|
|
1736
|
-
Xn,
|
|
1737
|
+
notification_type: e.string().enum(p.ReplyLiked, p.ReplyDeleted)
|
|
1738
|
+
}), ir = e.union(
|
|
1737
1739
|
Yn,
|
|
1738
1740
|
Zn,
|
|
1739
1741
|
Wn,
|
|
1740
1742
|
er,
|
|
1741
1743
|
tr,
|
|
1742
|
-
nr
|
|
1743
|
-
|
|
1744
|
+
nr,
|
|
1745
|
+
rr
|
|
1746
|
+
).satisfies().lock(), or = s({ forums: e.array(se) }), ar = s({ topics: e.array(G) }), sr = s({ topic: G }), cr = s({ post: A }), z = s({
|
|
1744
1747
|
posts: e.array(A),
|
|
1745
1748
|
next_token: e.string().optional()
|
|
1746
|
-
}),
|
|
1749
|
+
}), ur = s({ post: A, antispam: ce }), lr = s({
|
|
1747
1750
|
replies: e.array(T),
|
|
1748
1751
|
next_token: e.string().optional()
|
|
1749
|
-
}),
|
|
1752
|
+
}), mr = s({ reply: T }), dr = s({
|
|
1750
1753
|
reply: T.clone().optional(),
|
|
1751
1754
|
antispam: ce.clone().optional()
|
|
1752
|
-
}),
|
|
1755
|
+
}), gr = s({ comment: C }), pr = s({
|
|
1753
1756
|
comments: e.array(C),
|
|
1754
1757
|
next_token: e.string().optional()
|
|
1755
|
-
}),
|
|
1758
|
+
}), _r = s({
|
|
1756
1759
|
comment: C.clone().optional(),
|
|
1757
1760
|
antispam: C.clone().optional()
|
|
1758
|
-
}),
|
|
1759
|
-
notifications: e.array(
|
|
1761
|
+
}), br = e.guard(Jn), yr = s({
|
|
1762
|
+
notifications: e.array(ir),
|
|
1760
1763
|
next_token: e.string().optional()
|
|
1761
|
-
}),
|
|
1764
|
+
}), fr = s({
|
|
1762
1765
|
system: e.number(),
|
|
1763
1766
|
comment: e.number(),
|
|
1764
1767
|
like: e.number()
|
|
1765
1768
|
});
|
|
1766
|
-
class
|
|
1769
|
+
class Ur {
|
|
1767
1770
|
constructor(t) {
|
|
1768
1771
|
m(this, "token");
|
|
1769
1772
|
m(this, "req");
|
|
@@ -1775,7 +1778,7 @@ class $r {
|
|
|
1775
1778
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=QaqUa2K0z0
|
|
1776
1779
|
*/
|
|
1777
1780
|
async getForums(t) {
|
|
1778
|
-
const { data: r } = await this.req.get("community/forums",
|
|
1781
|
+
const { data: r } = await this.req.get("community/forums", or, t);
|
|
1779
1782
|
return (r == null ? void 0 : r.forums) || [];
|
|
1780
1783
|
}
|
|
1781
1784
|
/**
|
|
@@ -1784,7 +1787,7 @@ class $r {
|
|
|
1784
1787
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=mIwpymAQom
|
|
1785
1788
|
*/
|
|
1786
1789
|
async getTopics(t) {
|
|
1787
|
-
const { data: r } = await this.req.get("community/topics",
|
|
1790
|
+
const { data: r } = await this.req.get("community/topics", ar, t);
|
|
1788
1791
|
return (r == null ? void 0 : r.topics) || [];
|
|
1789
1792
|
}
|
|
1790
1793
|
/**
|
|
@@ -1793,7 +1796,7 @@ class $r {
|
|
|
1793
1796
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Jvw7xMK31K
|
|
1794
1797
|
*/
|
|
1795
1798
|
async getTopic(t, r) {
|
|
1796
|
-
const { data: n, code: i } = await this.req.get("community/topic",
|
|
1799
|
+
const { data: n, code: i } = await this.req.get("community/topic", sr, {
|
|
1797
1800
|
...r,
|
|
1798
1801
|
params: { topic_id: t }
|
|
1799
1802
|
});
|
|
@@ -1820,13 +1823,13 @@ class $r {
|
|
|
1820
1823
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=yXubbZuDlC
|
|
1821
1824
|
*/
|
|
1822
1825
|
async getPinnedPosts(t, r, n, i) {
|
|
1823
|
-
const { data: o, code:
|
|
1826
|
+
const { data: o, code: d, message: g } = await this.req.get("community/pinned-posts", z, {
|
|
1824
1827
|
...i,
|
|
1825
1828
|
params: c({ forum_id: t, max_results: r, next_token: n })
|
|
1826
1829
|
});
|
|
1827
1830
|
return o ?? {
|
|
1828
|
-
message:
|
|
1829
|
-
error:
|
|
1831
|
+
message: g,
|
|
1832
|
+
error: d
|
|
1830
1833
|
};
|
|
1831
1834
|
}
|
|
1832
1835
|
/**
|
|
@@ -1835,7 +1838,7 @@ class $r {
|
|
|
1835
1838
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=hj1AZy5rcP
|
|
1836
1839
|
*/
|
|
1837
1840
|
async getPost(t, r) {
|
|
1838
|
-
const { data: n, code: i, message: o } = await this.req.get("community/post",
|
|
1841
|
+
const { data: n, code: i, message: o } = await this.req.get("community/post", cr, {
|
|
1839
1842
|
...r,
|
|
1840
1843
|
params: { post_id: t }
|
|
1841
1844
|
});
|
|
@@ -1853,7 +1856,7 @@ class $r {
|
|
|
1853
1856
|
const { data: n, code: i, message: o } = await this.req.post(
|
|
1854
1857
|
"community/post",
|
|
1855
1858
|
c(t),
|
|
1856
|
-
|
|
1859
|
+
ur,
|
|
1857
1860
|
r
|
|
1858
1861
|
);
|
|
1859
1862
|
return n ?? {
|
|
@@ -1867,7 +1870,7 @@ class $r {
|
|
|
1867
1870
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=djKbX7lFdp
|
|
1868
1871
|
*/
|
|
1869
1872
|
async getComments(t, r) {
|
|
1870
|
-
const { data: n, code: i, message: o } = await this.req.get("community/comments",
|
|
1873
|
+
const { data: n, code: i, message: o } = await this.req.get("community/comments", pr, {
|
|
1871
1874
|
...r,
|
|
1872
1875
|
params: c(t)
|
|
1873
1876
|
});
|
|
@@ -1882,7 +1885,7 @@ class $r {
|
|
|
1882
1885
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=RIc7oxVGae
|
|
1883
1886
|
*/
|
|
1884
1887
|
async getComment(t, r) {
|
|
1885
|
-
const { data: n, code: i, message: o } = await this.req.get("community/comment",
|
|
1888
|
+
const { data: n, code: i, message: o } = await this.req.get("community/comment", gr, {
|
|
1886
1889
|
...r,
|
|
1887
1890
|
params: { comment_id: t }
|
|
1888
1891
|
});
|
|
@@ -1901,7 +1904,7 @@ class $r {
|
|
|
1901
1904
|
const { data: n, code: i, message: o } = await this.req.post(
|
|
1902
1905
|
"community/comment",
|
|
1903
1906
|
c(t),
|
|
1904
|
-
|
|
1907
|
+
_r,
|
|
1905
1908
|
r
|
|
1906
1909
|
);
|
|
1907
1910
|
return n ?? {
|
|
@@ -1915,7 +1918,7 @@ class $r {
|
|
|
1915
1918
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=sVKBbY83MY
|
|
1916
1919
|
*/
|
|
1917
1920
|
async getReplies(t, r) {
|
|
1918
|
-
const { data: n } = await this.req.get("community/replies",
|
|
1921
|
+
const { data: n } = await this.req.get("community/replies", lr, {
|
|
1919
1922
|
...r,
|
|
1920
1923
|
params: c({ max_results: 20, ...t })
|
|
1921
1924
|
});
|
|
@@ -1930,7 +1933,7 @@ class $r {
|
|
|
1930
1933
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=kxhcSXD3MG
|
|
1931
1934
|
*/
|
|
1932
1935
|
async getReply(t, r) {
|
|
1933
|
-
const { data: n, code: i, message: o } = await this.req.get("community/reply",
|
|
1936
|
+
const { data: n, code: i, message: o } = await this.req.get("community/reply", mr, {
|
|
1934
1937
|
...r,
|
|
1935
1938
|
params: { reply_id: t }
|
|
1936
1939
|
});
|
|
@@ -1949,7 +1952,7 @@ class $r {
|
|
|
1949
1952
|
const { data: n, code: i, message: o } = await this.req.post(
|
|
1950
1953
|
"community/reply",
|
|
1951
1954
|
c(t),
|
|
1952
|
-
|
|
1955
|
+
dr,
|
|
1953
1956
|
r
|
|
1954
1957
|
);
|
|
1955
1958
|
return n ?? {
|
|
@@ -2000,7 +2003,7 @@ class $r {
|
|
|
2000
2003
|
*/
|
|
2001
2004
|
async getMediaPresignedUrl(t, r) {
|
|
2002
2005
|
await this.token.autoLogin();
|
|
2003
|
-
const { data: n } = await this.req.get("community/media-presign-url",
|
|
2006
|
+
const { data: n } = await this.req.get("community/media-presign-url", br, {
|
|
2004
2007
|
...r,
|
|
2005
2008
|
params: t
|
|
2006
2009
|
});
|
|
@@ -2015,7 +2018,7 @@ class $r {
|
|
|
2015
2018
|
*/
|
|
2016
2019
|
async getNotifications(t, r) {
|
|
2017
2020
|
await this.token.autoLogin();
|
|
2018
|
-
const { data: n } = await this.req.get("community/notifications",
|
|
2021
|
+
const { data: n } = await this.req.get("community/notifications", yr, {
|
|
2019
2022
|
...r,
|
|
2020
2023
|
params: c({ max_results: 20, ...t })
|
|
2021
2024
|
});
|
|
@@ -2033,7 +2036,7 @@ class $r {
|
|
|
2033
2036
|
if (!await this.token.autoLogin()) return null;
|
|
2034
2037
|
const { data: r } = await this.req.get(
|
|
2035
2038
|
"community/unread-notifications-count",
|
|
2036
|
-
|
|
2039
|
+
fr,
|
|
2037
2040
|
t
|
|
2038
2041
|
);
|
|
2039
2042
|
return r;
|
|
@@ -2049,17 +2052,17 @@ class $r {
|
|
|
2049
2052
|
return n;
|
|
2050
2053
|
}
|
|
2051
2054
|
}
|
|
2052
|
-
const
|
|
2055
|
+
const hr = s({
|
|
2053
2056
|
nonce_str: e.string(),
|
|
2054
2057
|
timestamp: e.number(),
|
|
2055
2058
|
signature: e.string()
|
|
2056
2059
|
});
|
|
2057
|
-
var
|
|
2058
|
-
function
|
|
2060
|
+
var wr = /* @__PURE__ */ ((a) => (a.RedirectUriDisMatch = "10003", a.AppidError = "10016", a.AuthorizationError = "10015", a.NoRightForScope = "10005", a.Frequently = "10009", a.AppBanded = "10004", a.ShouldFollow = "10006", a.ScopeNull = "10010", a.RedirectUriNull = "10011", a.AppidNull = "10012", a.StateNull = "10013", a))(wr || {});
|
|
2061
|
+
function E(a) {
|
|
2059
2062
|
return R(a, "open_id", "union_id", "weixin_token");
|
|
2060
2063
|
}
|
|
2061
2064
|
const J = "wx_login_cache";
|
|
2062
|
-
class
|
|
2065
|
+
class Fr {
|
|
2063
2066
|
/**
|
|
2064
2067
|
* 创建微信相关功能接口
|
|
2065
2068
|
*
|
|
@@ -2093,8 +2096,8 @@ class Ur {
|
|
|
2093
2096
|
const t = this.token.storage.get(J);
|
|
2094
2097
|
if (!t)
|
|
2095
2098
|
return null;
|
|
2096
|
-
const r =
|
|
2097
|
-
return
|
|
2099
|
+
const r = ye(t);
|
|
2100
|
+
return E(r) ? (this.token.weixinToken = r.weixin_token, await this.token.autoLogin(), r) : null;
|
|
2098
2101
|
}
|
|
2099
2102
|
/**
|
|
2100
2103
|
* 小程序页面微信静默登录,获取 weixinToken / open_id / union_id。
|
|
@@ -2119,13 +2122,16 @@ class Ur {
|
|
|
2119
2122
|
const r = await this.getLoginCache();
|
|
2120
2123
|
if (r)
|
|
2121
2124
|
return r;
|
|
2122
|
-
const n = await
|
|
2125
|
+
const n = await we(), { data: i, code: o, message: d } = await this.req.post(
|
|
2123
2126
|
"weixin/login",
|
|
2124
2127
|
{ code: n, appid: this.appid },
|
|
2125
|
-
|
|
2128
|
+
E,
|
|
2126
2129
|
{ ...t, message: !1 }
|
|
2127
2130
|
);
|
|
2128
|
-
return i && (this.token.weixinToken = i.weixin_token, this.token.storage.set(J, JSON.stringify(i)), await this.token.autoLogin()), i ?? {
|
|
2131
|
+
return i && (this.token.weixinToken = i.weixin_token, this.token.storage.set(J, JSON.stringify(i)), await this.token.autoLogin()), i ?? {
|
|
2132
|
+
message: d,
|
|
2133
|
+
error: o
|
|
2134
|
+
};
|
|
2129
2135
|
}
|
|
2130
2136
|
/**
|
|
2131
2137
|
* 在微信内嵌网页中调用微信公众号授权登录【暂未启用】
|
|
@@ -2144,25 +2150,30 @@ class Ur {
|
|
|
2144
2150
|
* - snsapi_userinfo 【默认】弹出授权页面,可拿到 openid、union_id、昵称、头像等信息,但用户也可能会拒绝授权
|
|
2145
2151
|
*/
|
|
2146
2152
|
async webLogin(t = "snsapi_userinfo", r) {
|
|
2147
|
-
const n =
|
|
2153
|
+
const n = P("code"), i = Date.now(), o = +P("state");
|
|
2148
2154
|
if (!n || !o || o < i - 1e3 * 60 * 5 || o > i) {
|
|
2149
|
-
const
|
|
2155
|
+
const le = B(["code", "state"]);
|
|
2150
2156
|
location.replace(
|
|
2151
|
-
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(
|
|
2157
|
+
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(le)}&response_type=code&scope=${t}&state=${i}#wechat_redirect`
|
|
2152
2158
|
);
|
|
2153
2159
|
return;
|
|
2154
2160
|
}
|
|
2155
2161
|
if (/^100\d{2}$/.test(n))
|
|
2156
|
-
return {
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2162
|
+
return {
|
|
2163
|
+
message: "Error: " + n,
|
|
2164
|
+
error: n
|
|
2165
|
+
};
|
|
2166
|
+
const d = B(["code", "state"]);
|
|
2167
|
+
"replaceState" in history && history.replaceState({}, "", d);
|
|
2168
|
+
const {
|
|
2169
|
+
data: g,
|
|
2170
|
+
code: h,
|
|
2171
|
+
message: ue
|
|
2172
|
+
} = await this.req.post("weixin/login", { code: n, appid: this.appid }, E, r);
|
|
2173
|
+
return g && (this.token.weixinToken = g.weixin_token, await this.token.autoLogin()), g ?? {
|
|
2174
|
+
message: ue,
|
|
2175
|
+
error: h
|
|
2176
|
+
};
|
|
2166
2177
|
}
|
|
2167
2178
|
/**
|
|
2168
2179
|
* 关联游戏账号,无返回值,全程静默
|
|
@@ -2177,10 +2188,13 @@ class Ur {
|
|
|
2177
2188
|
* @param gameCode 从游戏内跳转至小程序时,通过请求参数 query 携带的 game_code,如果值为空则跳过不处理
|
|
2178
2189
|
*/
|
|
2179
2190
|
async linkPlayer(t, r, n) {
|
|
2180
|
-
!t || !r
|
|
2191
|
+
if (!t || !r)
|
|
2192
|
+
return !1;
|
|
2193
|
+
const { ok: i } = await this.req.post("weixin/link-player", { weixin_token: t, game_code: r }, null, {
|
|
2181
2194
|
...n,
|
|
2182
2195
|
message: !1
|
|
2183
2196
|
});
|
|
2197
|
+
return i;
|
|
2184
2198
|
}
|
|
2185
2199
|
/**
|
|
2186
2200
|
* 获取集成 JSSDK 所需的签名信息
|
|
@@ -2188,7 +2202,7 @@ class Ur {
|
|
|
2188
2202
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=CuWOqxr9Ue
|
|
2189
2203
|
*/
|
|
2190
2204
|
async getJSSDKConfig(t) {
|
|
2191
|
-
const { data: r } = await this.req.get("weixin/offiaccount/jssdk-sign",
|
|
2205
|
+
const { data: r } = await this.req.get("weixin/offiaccount/jssdk-sign", hr, {
|
|
2192
2206
|
...t,
|
|
2193
2207
|
params: {
|
|
2194
2208
|
appid: this.appid,
|
|
@@ -2205,145 +2219,145 @@ class Ur {
|
|
|
2205
2219
|
}
|
|
2206
2220
|
export {
|
|
2207
2221
|
ce as AntispamValidator,
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2222
|
+
Rr as AuthToken,
|
|
2223
|
+
an as CashbackEngagementDataValidator,
|
|
2224
|
+
sn as ClaimActivationKeyEngagementDataValidator,
|
|
2211
2225
|
b as ClaimRewardStatus,
|
|
2212
2226
|
U as ClaimRewardStatusValidator,
|
|
2213
|
-
|
|
2227
|
+
xn as ClaimedItemValidator,
|
|
2214
2228
|
Z as ClubAddressValidator,
|
|
2215
|
-
|
|
2229
|
+
jr as ClubApi,
|
|
2216
2230
|
W as ClubBenefitSummaryValidator,
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2231
|
+
Ae as ClubBenefitValidator,
|
|
2232
|
+
Te as ClubCreditChangeScene,
|
|
2233
|
+
qe as ClubCreditChangeSceneValidator,
|
|
2234
|
+
Ve as ClubCreditChangeType,
|
|
2235
|
+
je as ClubCreditChangeTypeValidator,
|
|
2236
|
+
Ge as ClubCreditLogValidator,
|
|
2237
|
+
Ee as ClubGlobalConfigValidator,
|
|
2238
|
+
xe as ClubItemType,
|
|
2225
2239
|
X as ClubItemTypeValidator,
|
|
2226
2240
|
Pe as ClubPlayerValidator,
|
|
2227
2241
|
ee as ClubProductValidator,
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2242
|
+
Se as ClubRedemptionStatus,
|
|
2243
|
+
Le as ClubRedemptionStatusValidator,
|
|
2244
|
+
Ie as ClubUserCreditValidator,
|
|
2245
|
+
De as ClubUserProfileValidator,
|
|
2246
|
+
vn as CommentEngagementValidator,
|
|
2233
2247
|
C as CommentValidator,
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2248
|
+
Ur as CommunityApi,
|
|
2249
|
+
We as EngageAccountType,
|
|
2250
|
+
et as EngageAccountTypeValidator,
|
|
2251
|
+
qn as EngageResponseValidator,
|
|
2252
|
+
Rn as EngageRewardValidator,
|
|
2239
2253
|
Pr as EventApi,
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2254
|
+
on as EventConfigValidator,
|
|
2255
|
+
bt as EventFeatureConfigOfCashbackValidator,
|
|
2256
|
+
ft as EventFeatureConfigOfCheckInValidator,
|
|
2257
|
+
wt as EventFeatureConfigOfClaimActivationKeyValidator,
|
|
2258
|
+
vt as EventFeatureConfigOfClaimRewardsValidator,
|
|
2259
|
+
Rt as EventFeatureConfigOfCommentValidator,
|
|
2260
|
+
jt as EventFeatureConfigOfFollowValidator,
|
|
2261
|
+
xt as EventFeatureConfigOfGiftCodeValidator,
|
|
2262
|
+
Lt as EventFeatureConfigOfInviteValidator,
|
|
2249
2263
|
Pt as EventFeatureConfigOfInvitedRegisterValidator,
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2264
|
+
Gt as EventFeatureConfigOfLotteryDrawValidator,
|
|
2265
|
+
Dt as EventFeatureConfigOfLotteryValidator,
|
|
2266
|
+
Nt as EventFeatureConfigOfPreregisterValidator,
|
|
2267
|
+
Bt as EventFeatureConfigOfQuestValidator,
|
|
2268
|
+
Qt as EventFeatureConfigOfRegisterValidator,
|
|
2269
|
+
Ht as EventFeatureConfigOfShareValidator,
|
|
2270
|
+
Jt as EventFeatureConfigOfSubscribeValidator,
|
|
2271
|
+
Yt as EventFeatureConfigOfSurveyValidator,
|
|
2272
|
+
Wt as EventFeatureConfigOfTeamValidator,
|
|
2273
|
+
nn as EventFeatureConfigOfVoteValidator,
|
|
2274
|
+
rn as EventFeatureConfigValidator,
|
|
2275
|
+
tt as EventPeriodType,
|
|
2276
|
+
nt as EventPeriodTypeValidator,
|
|
2263
2277
|
D as EventRewardItemConfigValidator,
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2278
|
+
Oe as ExtraGameRewardValidator,
|
|
2279
|
+
Ne as ExtraPhysicalShipmentValidator,
|
|
2280
|
+
pt as FeatureRewardValidator,
|
|
2267
2281
|
u as FeatureType,
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2282
|
+
rt as FeatureTypeValidator,
|
|
2283
|
+
Bn as ForumMode,
|
|
2284
|
+
Mn as ForumModeValidator,
|
|
2271
2285
|
se as ForumValidator,
|
|
2272
2286
|
j as GamerItemType,
|
|
2273
2287
|
te as GamerItemTypeValidator,
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2288
|
+
Ce as Gender,
|
|
2289
|
+
Re as GenderValidator,
|
|
2290
|
+
cn as GiftCodeEngagementDataValidator,
|
|
2291
|
+
un as InviteEngagementDataValidator,
|
|
2292
|
+
mt as LotteryDrawAction,
|
|
2293
|
+
Lr as LotteryDrawActionValidator,
|
|
2294
|
+
gn as LotteryDrawEngagementDataValidator,
|
|
2295
|
+
ln as LotteryEngagementDataValidator,
|
|
2282
2296
|
v as LotteryTicketStatus,
|
|
2283
|
-
|
|
2297
|
+
xr as LotteryTicketStatusValidator,
|
|
2284
2298
|
f as NotificationBaseValidator,
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2299
|
+
Kn as NotificationCategory,
|
|
2300
|
+
$r as NotificationCategoryValidator,
|
|
2301
|
+
er as NotificationCommentReplyValidator,
|
|
2302
|
+
tr as NotificationCommentValidator,
|
|
2289
2303
|
q as NotificationPayloadCommentValidator,
|
|
2290
2304
|
N as NotificationPayloadPostValidator,
|
|
2291
2305
|
O as NotificationPayloadReplyValidator,
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2306
|
+
Xn as NotificationPayloadSystemValidator,
|
|
2307
|
+
Wn as NotificationPostCommentValidator,
|
|
2308
|
+
Zn as NotificationPostValidator,
|
|
2309
|
+
nr as NotificationReplyRepliedValidator,
|
|
2310
|
+
rr as NotificationReplyValidator,
|
|
2311
|
+
Yn as NotificationSystemValidator,
|
|
2312
|
+
p as NotificationType,
|
|
2313
|
+
Hn as NotificationTypeValidator,
|
|
2314
|
+
ir as NotificationValidator,
|
|
2315
|
+
Fe as PlayerRoleCardValidator,
|
|
2302
2316
|
Y as PlayerRoleValidator,
|
|
2303
|
-
|
|
2317
|
+
Qn as PostStatus,
|
|
2304
2318
|
ae as PostStatusValidator,
|
|
2305
2319
|
A as PostValidator,
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2320
|
+
pn as PreregisterEngagementDataValidator,
|
|
2321
|
+
Jn as PresignedUrlResponseValidator,
|
|
2322
|
+
_n as QuestEngagementDataValidator,
|
|
2323
|
+
it as QuestObjective,
|
|
2310
2324
|
re as QuestObjectiveValidator,
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2325
|
+
Vr as RedeemParamsValidator,
|
|
2326
|
+
Be as RedemptionValidator,
|
|
2327
|
+
gt as RegularRewardValidator,
|
|
2328
|
+
zn as ReplyToValidator,
|
|
2315
2329
|
T as ReplyValidator,
|
|
2316
|
-
|
|
2330
|
+
Tr as RewardItemType,
|
|
2317
2331
|
ne as RewardItemTypeValidator,
|
|
2318
|
-
|
|
2332
|
+
st as RewardSource,
|
|
2319
2333
|
F as RewardSourceValidator,
|
|
2320
2334
|
_ as RewardStatus,
|
|
2321
2335
|
$ as RewardStatusSuffix,
|
|
2322
2336
|
ie as RewardStatusSuffixValidator,
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2337
|
+
qr as RewardStatusValidator,
|
|
2338
|
+
Cn as RewardValidator,
|
|
2339
|
+
Ue as RoleBaseInfoValidator,
|
|
2340
|
+
$e as ServerBaseInfoValidator,
|
|
2341
|
+
bn as ShareEngagementDataValidator,
|
|
2342
|
+
fn as SurveyEngagementDataValidator,
|
|
2343
|
+
lt as TeamAction,
|
|
2344
|
+
Sr as TeamActionValidator,
|
|
2345
|
+
wn as TeamEngagementDataValidator,
|
|
2346
|
+
hn as TeamEngagementValidator,
|
|
2347
|
+
Er as TeamMemberValidator,
|
|
2348
|
+
ct as TeamVisibility,
|
|
2349
|
+
ut as TeamVisibilityValidator,
|
|
2336
2350
|
G as TopicValidator,
|
|
2337
2351
|
I as UserEngagementDataValidator,
|
|
2338
|
-
|
|
2339
|
-
|
|
2352
|
+
Vn as UserEngagementValidator,
|
|
2353
|
+
Tn as UserFeatureStatusValidator,
|
|
2340
2354
|
oe as UserRewardValidator,
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2355
|
+
jn as VerifyMobileResultValidator,
|
|
2356
|
+
kn as VoteEngagementDataValidator,
|
|
2357
|
+
ot as VoteOptionSource,
|
|
2358
|
+
at as VoteOptionSourceValidator,
|
|
2359
|
+
Fr as WeixinApi,
|
|
2360
|
+
yn as WeixinSubscribeEngagementDataValidator,
|
|
2361
|
+
wr as WeixinWebLoginErrorCode,
|
|
2362
|
+
hr as isWeixinSignResponse
|
|
2349
2363
|
};
|