@seayoo-web/gamer-api 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +735 -664
- package/package.json +6 -6
- package/types/src/club.d.ts +21 -21
- package/types/src/community.d.ts +20 -20
- package/types/src/event.config/feature.lottery.d.ts +1 -1
- package/types/src/event.config/reward.d.ts +1 -1
- package/types/src/event.d.ts +18 -18
- package/types/src/event.engage/index.d.ts +2 -2
- package/types/src/weixin.d.ts +4 -4
- package/types/index.d.ts +0 -5
- package/types/src/club.define.d.ts +0 -371
- package/types/src/club.enums.d.ts +0 -104
- package/types/src/club.guards.d.ts +0 -33
- package/types/src/community.define.d.ts +0 -331
- package/types/src/community.enums.d.ts +0 -99
- package/types/src/community.guards.d.ts +0 -52
- package/types/src/event.config/feature.base.d.ts +0 -23
- package/types/src/event.config/feature.cashback.d.ts +0 -18
- package/types/src/event.config/feature.checkIn.d.ts +0 -7
- package/types/src/event.config/feature.claimActivationKey.d.ts +0 -7
- package/types/src/event.config/feature.claimRewards.d.ts +0 -7
- package/types/src/event.config/feature.comment.d.ts +0 -14
- package/types/src/event.config/feature.d.ts +0 -40
- package/types/src/event.config/feature.follow.d.ts +0 -24
- package/types/src/event.config/feature.giftcode.d.ts +0 -24
- package/types/src/event.config/feature.invite.d.ts +0 -12
- package/types/src/event.config/feature.invitedRegister.d.ts +0 -7
- package/types/src/event.config/feature.lotteryDraw.d.ts +0 -14
- package/types/src/event.config/feature.preregister.d.ts +0 -7
- package/types/src/event.config/feature.quest.d.ts +0 -31
- package/types/src/event.config/feature.register.d.ts +0 -7
- package/types/src/event.config/feature.share.d.ts +0 -16
- package/types/src/event.config/feature.subscribe.d.ts +0 -12
- package/types/src/event.config/feature.survey.d.ts +0 -14
- package/types/src/event.config/feature.team.d.ts +0 -14
- package/types/src/event.config/feature.vote.d.ts +0 -44
- package/types/src/event.config/index.d.ts +0 -23
- package/types/src/event.config.d.ts +0 -228
- package/types/src/event.define.d.ts +0 -48
- package/types/src/event.engage/engage.cashback.d.ts +0 -9
- package/types/src/event.engage/engage.claimActivationKey.d.ts +0 -5
- package/types/src/event.engage/engage.comment.d.ts +0 -22
- package/types/src/event.engage/engage.d.ts +0 -49
- package/types/src/event.engage/engage.giftcode.d.ts +0 -5
- package/types/src/event.engage/engage.invite.d.ts +0 -9
- package/types/src/event.engage/engage.lottery.d.ts +0 -9
- package/types/src/event.engage/engage.lotteryDraw.d.ts +0 -40
- package/types/src/event.engage/engage.lotteryDraw.reward.d.ts +0 -38
- package/types/src/event.engage/engage.preregister.d.ts +0 -11
- package/types/src/event.engage/engage.quest.d.ts +0 -28
- package/types/src/event.engage/engage.share.d.ts +0 -9
- package/types/src/event.engage/engage.subscribe.d.ts +0 -14
- package/types/src/event.engage/engage.survey.d.ts +0 -7
- package/types/src/event.engage/engage.team.d.ts +0 -53
- package/types/src/event.engage/engage.vote.d.ts +0 -9
- package/types/src/event.engage/reward.d.ts +0 -52
- package/types/src/event.enums.d.ts +0 -392
- package/types/src/event.guards.d.ts +0 -38
- package/types/src/token.d.ts +0 -93
- package/types/src/token.define.d.ts +0 -31
- package/types/src/token.guards.d.ts +0 -5
- package/types/src/utils.d.ts +0 -12
- package/types/src/weixin.define.d.ts +0 -46
- package/types/src/weixin.guards.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { isComboWebView as
|
|
5
|
-
import { isPlainObject as
|
|
6
|
-
function
|
|
7
|
-
return
|
|
1
|
+
var le = Object.defineProperty;
|
|
2
|
+
var me = (o, t, n) => t in o ? le(o, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[t] = n;
|
|
3
|
+
var m = (o, t, n) => me(o, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { isComboWebView as de } from "@seayoo-web/combo-webview";
|
|
5
|
+
import { isPlainObject as C, useConsole as ge, Support as y, usePromise as pe, pruneURL as _e, queryString as P, pruneObject as s, v as e, omitFields as R, typedObjectGuard as a, parseJSON as be, removePara as O } from "@seayoo-web/utils";
|
|
6
|
+
function ye(o) {
|
|
7
|
+
return C(o, "gamer_token") && typeof o.gamer_token == "string";
|
|
8
8
|
}
|
|
9
|
-
function B(
|
|
10
|
-
return
|
|
9
|
+
function B(o) {
|
|
10
|
+
return C(o);
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
return /^\/[a-z\d-]+$/.test(
|
|
12
|
+
const h = ge("GamerApiSDK");
|
|
13
|
+
function fe(o) {
|
|
14
|
+
return /^\/[a-z\d-]+$/.test(o);
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
17
|
-
const { promise:
|
|
16
|
+
async function he() {
|
|
17
|
+
const { promise: o, resolve: t } = pe();
|
|
18
18
|
return wx.login({
|
|
19
19
|
success(n) {
|
|
20
20
|
t(n.code);
|
|
@@ -22,89 +22,89 @@ async function fe() {
|
|
|
22
22
|
fail() {
|
|
23
23
|
t("");
|
|
24
24
|
}
|
|
25
|
-
}), await
|
|
25
|
+
}), await o;
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
get(
|
|
29
|
-
return localStorage.getItem(
|
|
27
|
+
const we = {
|
|
28
|
+
get(o) {
|
|
29
|
+
return localStorage.getItem(o) || "";
|
|
30
30
|
},
|
|
31
|
-
set(
|
|
32
|
-
localStorage.setItem(
|
|
31
|
+
set(o, t) {
|
|
32
|
+
localStorage.setItem(o, t);
|
|
33
33
|
},
|
|
34
|
-
remove(
|
|
35
|
-
localStorage.removeItem(
|
|
34
|
+
remove(o) {
|
|
35
|
+
localStorage.removeItem(o);
|
|
36
36
|
}
|
|
37
|
-
},
|
|
38
|
-
get(
|
|
37
|
+
}, ke = {
|
|
38
|
+
get(o) {
|
|
39
39
|
try {
|
|
40
|
-
if (
|
|
40
|
+
if (y.wx) return wx.getStorageSync(o) || "";
|
|
41
41
|
} catch (t) {
|
|
42
|
-
|
|
42
|
+
h.error("getStorageSyncError", t);
|
|
43
43
|
}
|
|
44
44
|
return "";
|
|
45
45
|
},
|
|
46
|
-
set(
|
|
46
|
+
set(o, t) {
|
|
47
47
|
try {
|
|
48
|
-
|
|
48
|
+
y.wx && wx.setStorageSync(o, t);
|
|
49
49
|
} catch (n) {
|
|
50
|
-
|
|
50
|
+
h.error("setStorageSyncError", n);
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
remove(
|
|
53
|
+
remove(o) {
|
|
54
54
|
try {
|
|
55
|
-
|
|
55
|
+
y.wx && wx.removeStorageSync(o);
|
|
56
56
|
} catch (t) {
|
|
57
|
-
|
|
57
|
+
h.error("removeStorageSync", t);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
},
|
|
61
|
-
class
|
|
60
|
+
}, w = "gamer_token";
|
|
61
|
+
class Cr {
|
|
62
62
|
constructor(t, n) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
this.storage =
|
|
70
|
-
const r =
|
|
63
|
+
m(this, "$NetRequest");
|
|
64
|
+
m(this, "$idToken", "");
|
|
65
|
+
m(this, "$weixinToken", "");
|
|
66
|
+
m(this, "$gamerToken", "");
|
|
67
|
+
m(this, "req");
|
|
68
|
+
m(this, "storage");
|
|
69
|
+
this.storage = y.wx ? ke : we;
|
|
70
|
+
const r = fe(t) ? t : `https://${_e(t)}`;
|
|
71
71
|
this.$NetRequest = n, this.req = n({
|
|
72
72
|
baseURL: `${r}/v1`,
|
|
73
73
|
timeout: 1e4,
|
|
74
74
|
maxRetry: 2,
|
|
75
75
|
retryInterval: "2EB",
|
|
76
|
-
retryResolve({ method:
|
|
77
|
-
return
|
|
76
|
+
retryResolve({ method: d, status: p }) {
|
|
77
|
+
return d === "GET" && p < 0;
|
|
78
78
|
},
|
|
79
79
|
responseRule: {
|
|
80
80
|
ok: { resolve: "body" },
|
|
81
81
|
failed: {
|
|
82
82
|
resolve: "json",
|
|
83
83
|
statusField: "error",
|
|
84
|
-
messageField: "message"
|
|
84
|
+
messageField: ["user_message", "message"]
|
|
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
|
|
93
|
-
(
|
|
92
|
+
const i = /^(?:localhost|[\d.]+):\d{4}$/.test(location.host), l = P("gamer_token");
|
|
93
|
+
(de() || i && l) && (this.$gamerToken = l), this.$gamerToken || this.loadGamerTokenCache();
|
|
94
94
|
}
|
|
95
95
|
get NetRequest() {
|
|
96
96
|
return this.$NetRequest;
|
|
97
97
|
}
|
|
98
98
|
loadGamerTokenCache() {
|
|
99
|
-
const n = this.storage.get(
|
|
99
|
+
const n = this.storage.get(w).match(/^(\d{12,})#(.{8,})$/);
|
|
100
100
|
if (n) {
|
|
101
|
-
const r = parseInt(n[1]),
|
|
101
|
+
const r = parseInt(n[1]), i = n[2];
|
|
102
102
|
if (r > Date.now() - (24 * 3600 - 10) * 1e3) {
|
|
103
|
-
this.$gamerToken =
|
|
103
|
+
this.$gamerToken = i;
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
this.storage.remove(
|
|
107
|
+
this.storage.remove(w);
|
|
108
108
|
}
|
|
109
109
|
/** 当前是否为登录状态,即是否拥有 gamerToken */
|
|
110
110
|
get isLoggedIn() {
|
|
@@ -138,7 +138,7 @@ class vr {
|
|
|
138
138
|
* 直接写入 Gamer Token,并更新缓存
|
|
139
139
|
*/
|
|
140
140
|
set gamerToken(t) {
|
|
141
|
-
this.$gamerToken = t, t ? this.storage.set(
|
|
141
|
+
this.$gamerToken = t, t ? this.storage.set(w, `${Date.now()}#${t}`) : this.storage.remove(w);
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
144
|
* 退出登录,销毁相关 Token
|
|
@@ -166,13 +166,13 @@ class vr {
|
|
|
166
166
|
if (this.gamerToken)
|
|
167
167
|
return !0;
|
|
168
168
|
if (!this.idToken)
|
|
169
|
-
return
|
|
170
|
-
if (
|
|
171
|
-
return
|
|
169
|
+
return h.error("Missing idToken when call autoLogin()"), !1;
|
|
170
|
+
if (y.wx && !this.weixinToken)
|
|
171
|
+
return h.error("Missing weixinToken when call autoLogin()"), !1;
|
|
172
172
|
const { code: t, data: n } = await this.req.post(
|
|
173
173
|
"login-with-token",
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
s({ id_token: this.idToken, weixin_token: y.wx ? this.weixinToken : null }),
|
|
175
|
+
ye,
|
|
176
176
|
{ message: !1 }
|
|
177
177
|
);
|
|
178
178
|
switch (t) {
|
|
@@ -206,25 +206,25 @@ class vr {
|
|
|
206
206
|
*/
|
|
207
207
|
async authRealName(t) {
|
|
208
208
|
if (!await this.autoLogin()) return null;
|
|
209
|
-
const { data: n } = await this.req.post("auth-real-name",
|
|
209
|
+
const { data: n } = await this.req.post("auth-real-name", s(t), B);
|
|
210
210
|
return n;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
const
|
|
213
|
+
const ve = {
|
|
214
214
|
/** 未知 */
|
|
215
215
|
Unknown: "unknown",
|
|
216
216
|
/** 男 */
|
|
217
217
|
Male: "male",
|
|
218
218
|
/** 女 */
|
|
219
219
|
Female: "female"
|
|
220
|
-
},
|
|
220
|
+
}, Ce = e.string().enum(ve).lock(), Re = {
|
|
221
221
|
/** 积分增加 */
|
|
222
222
|
Increase: "increase",
|
|
223
223
|
/** 积分减少 */
|
|
224
224
|
Decrease: "decrease",
|
|
225
225
|
/** 积分过期 */
|
|
226
226
|
Expired: "expired"
|
|
227
|
-
},
|
|
227
|
+
}, Ve = e.string().enum(Re).lock(), je = {
|
|
228
228
|
/** 游戏内购买 */
|
|
229
229
|
Order: "order",
|
|
230
230
|
/** 游戏内消耗 */
|
|
@@ -237,21 +237,21 @@ const ke = {
|
|
|
237
237
|
Admin: "admin",
|
|
238
238
|
/** 运营活动 */
|
|
239
239
|
Event: "event"
|
|
240
|
-
},
|
|
240
|
+
}, Te = e.string().enum(je).lock(), qe = {
|
|
241
241
|
/** 游戏内奖励 */
|
|
242
242
|
GameReward: "game_reward",
|
|
243
243
|
/** 实物商品 */
|
|
244
244
|
Physical: "physical",
|
|
245
245
|
/** 虚拟商品 */
|
|
246
246
|
Virtual: "virtual"
|
|
247
|
-
}, J = e.string().enum(
|
|
247
|
+
}, J = e.string().enum(qe).lock(), xe = {
|
|
248
248
|
/** 待发放 */
|
|
249
249
|
Pending: "pending",
|
|
250
250
|
/** 已发放 */
|
|
251
251
|
Issued: "issued",
|
|
252
252
|
/** 发放失败 */
|
|
253
253
|
Failed: "failed"
|
|
254
|
-
},
|
|
254
|
+
}, Se = e.string().enum(xe).lock(), Le = e.object({
|
|
255
255
|
default_avatar_url: e.string(),
|
|
256
256
|
official_avatar_urls: e.array(e.string()),
|
|
257
257
|
default_nickname: e.string(),
|
|
@@ -269,7 +269,7 @@ const ke = {
|
|
|
269
269
|
exp_description: e.string(),
|
|
270
270
|
credit_description: e.string(),
|
|
271
271
|
send_role_mail_rate_limit: e.number()
|
|
272
|
-
}).lock(),
|
|
272
|
+
}).lock(), Pe = e.object({
|
|
273
273
|
member_id: e.string(),
|
|
274
274
|
player_id: e.string(),
|
|
275
275
|
exp: e.number(),
|
|
@@ -278,18 +278,18 @@ const ke = {
|
|
|
278
278
|
credit_expiring: e.number(),
|
|
279
279
|
level_change_time: e.number(),
|
|
280
280
|
level_expire_time: e.number()
|
|
281
|
-
}).lock(),
|
|
281
|
+
}).lock(), Ee = e.object({
|
|
282
282
|
server_id: e.string(),
|
|
283
283
|
server_name: e.string()
|
|
284
|
-
}).lock(),
|
|
284
|
+
}).lock(), $e = e.object({
|
|
285
285
|
role_id: e.string(),
|
|
286
286
|
role_name: e.string()
|
|
287
287
|
}).lock(), X = e.object({
|
|
288
|
+
...$e.shape,
|
|
288
289
|
...Ee.shape,
|
|
289
|
-
...Pe.shape,
|
|
290
290
|
role_level: e.number(),
|
|
291
291
|
last_login_time: e.number()
|
|
292
|
-
}).lock(),
|
|
292
|
+
}).lock(), Ue = e.object({
|
|
293
293
|
...X.shape,
|
|
294
294
|
/** 角色战力 */
|
|
295
295
|
role_fighting: e.number(),
|
|
@@ -299,11 +299,11 @@ const ke = {
|
|
|
299
299
|
kin_name: e.string().optional(),
|
|
300
300
|
/** 宗门职位 */
|
|
301
301
|
kin_position: e.string().optional()
|
|
302
|
-
}).lock(),
|
|
302
|
+
}).lock(), Fe = e.object({
|
|
303
303
|
name: e.string(),
|
|
304
304
|
avatar_url: e.string(),
|
|
305
305
|
bio: e.string(),
|
|
306
|
-
gender:
|
|
306
|
+
gender: Ce,
|
|
307
307
|
birthday: e.object({ year: e.number(), month: e.number(), day: e.number() })
|
|
308
308
|
}).lock(), Y = e.object({
|
|
309
309
|
address_id: e.number(),
|
|
@@ -314,15 +314,15 @@ const ke = {
|
|
|
314
314
|
district: e.string(),
|
|
315
315
|
address: e.string(),
|
|
316
316
|
is_default: e.bool()
|
|
317
|
-
}).lock(),
|
|
317
|
+
}).lock(), De = 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(), Ie = e.object({
|
|
323
323
|
id: e.number(),
|
|
324
|
-
change_type:
|
|
325
|
-
change_scene:
|
|
324
|
+
change_type: Ve,
|
|
325
|
+
change_scene: Te,
|
|
326
326
|
change_credit: e.number(),
|
|
327
327
|
balance: e.number(),
|
|
328
328
|
change_time: e.number()
|
|
@@ -361,10 +361,10 @@ const ke = {
|
|
|
361
361
|
created_at: e.number(),
|
|
362
362
|
updated_at: e.number(),
|
|
363
363
|
redeemable_quantity: e.number().optional()
|
|
364
|
-
}).lock(),
|
|
365
|
-
...
|
|
364
|
+
}).lock(), Ge = e.object({
|
|
365
|
+
...R(Z.shape, "tag"),
|
|
366
366
|
product: W.clone().optional()
|
|
367
|
-
}).lock(),
|
|
367
|
+
}).lock(), Rr = e.union(
|
|
368
368
|
e.object({
|
|
369
369
|
server_id: e.string(),
|
|
370
370
|
role_id: e.string()
|
|
@@ -372,7 +372,7 @@ const ke = {
|
|
|
372
372
|
e.object({
|
|
373
373
|
address_id: e.number()
|
|
374
374
|
})
|
|
375
|
-
).satisfies().lock(),
|
|
375
|
+
).satisfies().lock(), Ae = e.object({
|
|
376
376
|
recipient: e.string(),
|
|
377
377
|
mobile: e.string(),
|
|
378
378
|
province: e.string(),
|
|
@@ -381,11 +381,11 @@ const ke = {
|
|
|
381
381
|
address: e.string(),
|
|
382
382
|
express_company: e.string(),
|
|
383
383
|
express_number: e.string()
|
|
384
|
-
}).lock(),
|
|
384
|
+
}).lock(), Ne = e.object({
|
|
385
385
|
server_id: e.string(),
|
|
386
386
|
role_id: e.string(),
|
|
387
387
|
role_name: e.string()
|
|
388
|
-
}).lock(),
|
|
388
|
+
}).lock(), Oe = e.object({
|
|
389
389
|
redemption_id: e.number(),
|
|
390
390
|
player_id: e.string(),
|
|
391
391
|
product_id: e.number(),
|
|
@@ -396,20 +396,20 @@ const ke = {
|
|
|
396
396
|
catalog_name: e.string(),
|
|
397
397
|
quantity: e.number(),
|
|
398
398
|
amount: e.number(),
|
|
399
|
-
status:
|
|
399
|
+
status: Se,
|
|
400
400
|
created_at: e.number(),
|
|
401
|
-
extra_data: e.union(
|
|
402
|
-
}),
|
|
403
|
-
credit_logs: e.array(
|
|
401
|
+
extra_data: e.union(Ae.clone(), Ne.clone()).satisfies().optional()
|
|
402
|
+
}), Be = e.guard(Le), M = a({ player: Pe }), Me = a({ roles: e.array(X) }), q = a({ role_card: Ue }), Q = e.guard(Fe), K = e.guard(Y), Qe = a({ addresses: e.array(Y) }), Ke = e.guard(De), He = a({
|
|
403
|
+
credit_logs: e.array(Ie),
|
|
404
404
|
next_token: e.string().optional()
|
|
405
|
-
}),
|
|
406
|
-
redemptions: e.array(
|
|
405
|
+
}), ze = a({ products: e.array(W) }), Je = a({ benefits: e.array(Z) }), Xe = a({ benefit: Ge }), Ye = a({
|
|
406
|
+
redemptions: e.array(Oe),
|
|
407
407
|
next_token: e.string().optional()
|
|
408
408
|
});
|
|
409
|
-
class
|
|
409
|
+
class Vr {
|
|
410
410
|
constructor(t) {
|
|
411
|
-
|
|
412
|
-
|
|
411
|
+
m(this, "token");
|
|
412
|
+
m(this, "req");
|
|
413
413
|
this.token = t, this.req = t.req;
|
|
414
414
|
}
|
|
415
415
|
/**
|
|
@@ -417,36 +417,37 @@ class Rr {
|
|
|
417
417
|
*
|
|
418
418
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=tuhsPt3ihp
|
|
419
419
|
*/
|
|
420
|
-
async getConfig() {
|
|
421
|
-
const { data:
|
|
422
|
-
return
|
|
420
|
+
async getConfig(t) {
|
|
421
|
+
const { data: n } = await this.req.get("club/config", Be, t);
|
|
422
|
+
return n;
|
|
423
423
|
}
|
|
424
424
|
/**
|
|
425
425
|
* 用于游戏内嵌 Web 页面和微信小程序获取当前登录的游戏账号在俱乐部中的信息。
|
|
426
426
|
*
|
|
427
427
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=hIDfaMlT7m
|
|
428
428
|
*/
|
|
429
|
-
async getCurrentPlayer() {
|
|
429
|
+
async getCurrentPlayer(t) {
|
|
430
430
|
await this.token.autoLogin();
|
|
431
|
-
const { data:
|
|
432
|
-
return (
|
|
431
|
+
const { data: n, code: r } = await this.req.get("club/current-player", M, t);
|
|
432
|
+
return (n == null ? void 0 : n.player) ?? { error: r };
|
|
433
433
|
}
|
|
434
434
|
/**
|
|
435
435
|
* 俱乐部用户关联游戏账号
|
|
436
436
|
*
|
|
437
437
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Dpb9JAKqzG
|
|
438
438
|
*/
|
|
439
|
-
async linkPlayer() {
|
|
439
|
+
async linkPlayer(t) {
|
|
440
440
|
await this.token.autoLogin();
|
|
441
|
-
const { data:
|
|
441
|
+
const { data: n, code: r } = await this.req.post(
|
|
442
442
|
"club/link-player",
|
|
443
443
|
{
|
|
444
444
|
id_token: this.token.idToken
|
|
445
445
|
},
|
|
446
|
-
M
|
|
446
|
+
M,
|
|
447
|
+
t
|
|
447
448
|
);
|
|
448
|
-
return (
|
|
449
|
-
error:
|
|
449
|
+
return (n == null ? void 0 : n.player) ?? {
|
|
450
|
+
error: r
|
|
450
451
|
};
|
|
451
452
|
}
|
|
452
453
|
/**
|
|
@@ -454,65 +455,68 @@ class Rr {
|
|
|
454
455
|
*
|
|
455
456
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=nwu4FiGM9V
|
|
456
457
|
*/
|
|
457
|
-
async getRoles(t, n) {
|
|
458
|
+
async getRoles(t, n, r) {
|
|
458
459
|
if (!await this.token.autoLogin()) return [];
|
|
459
|
-
const { data:
|
|
460
|
-
|
|
460
|
+
const { data: i } = await this.req.get("club/roles", Me, {
|
|
461
|
+
...r,
|
|
462
|
+
params: s({ player_id: t, refresh: n })
|
|
461
463
|
});
|
|
462
|
-
return (
|
|
464
|
+
return (i == null ? void 0 : i.roles) || [];
|
|
463
465
|
}
|
|
464
466
|
/**
|
|
465
467
|
* 获取俱乐部会员的角色卡片数据
|
|
466
468
|
*
|
|
467
469
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=A1Wr7kUXnS
|
|
468
470
|
*/
|
|
469
|
-
async getRoleCard(t) {
|
|
470
|
-
const { data:
|
|
471
|
+
async getRoleCard(t, n) {
|
|
472
|
+
const { data: r } = await this.req.get("club/role-card", q, {
|
|
473
|
+
...n,
|
|
471
474
|
params: { member_id: t }
|
|
472
475
|
});
|
|
473
|
-
return (
|
|
476
|
+
return (r == null ? void 0 : r.role_card) ?? null;
|
|
474
477
|
}
|
|
475
478
|
/**
|
|
476
479
|
* 设置自己的角色卡片
|
|
477
480
|
*
|
|
478
481
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=XgMf6OFE5i
|
|
479
482
|
*/
|
|
480
|
-
async setRoleCard(t) {
|
|
483
|
+
async setRoleCard(t, n) {
|
|
481
484
|
if (!await this.token.autoLogin()) return null;
|
|
482
|
-
const { data:
|
|
483
|
-
return (
|
|
485
|
+
const { data: r } = await this.req.post("club/role-card", t, q, n);
|
|
486
|
+
return (r == null ? void 0 : r.role_card) ?? null;
|
|
484
487
|
}
|
|
485
488
|
/**
|
|
486
489
|
* 强制刷新自己的角色卡片,从游戏内获取最新数据
|
|
487
490
|
*
|
|
488
491
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=RPdJquwmgv
|
|
489
492
|
*/
|
|
490
|
-
async refreshRoleCard() {
|
|
493
|
+
async refreshRoleCard(t) {
|
|
491
494
|
if (!await this.token.autoLogin()) return null;
|
|
492
|
-
const { data:
|
|
493
|
-
return (
|
|
495
|
+
const { data: n } = await this.req.post("club/refresh-role-card", {}, q, t);
|
|
496
|
+
return (n == null ? void 0 : n.role_card) ?? null;
|
|
494
497
|
}
|
|
495
498
|
/**
|
|
496
499
|
* 获取俱乐部用户的信息
|
|
497
500
|
*
|
|
498
501
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=TMWBCFcOr2
|
|
499
502
|
*/
|
|
500
|
-
async getUserProfile(t) {
|
|
501
|
-
const { data:
|
|
503
|
+
async getUserProfile(t, n) {
|
|
504
|
+
const { data: r } = await this.req.get("club/user-profile", Q, {
|
|
505
|
+
...n,
|
|
502
506
|
params: { member_id: t }
|
|
503
507
|
});
|
|
504
|
-
return
|
|
508
|
+
return r;
|
|
505
509
|
}
|
|
506
510
|
/**
|
|
507
511
|
* 修改自己的俱乐部用户信息
|
|
508
512
|
*
|
|
509
513
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Qt822A57jd
|
|
510
514
|
*/
|
|
511
|
-
async updateUserProfile(t) {
|
|
515
|
+
async updateUserProfile(t, n) {
|
|
512
516
|
await this.token.autoLogin();
|
|
513
|
-
const { data:
|
|
514
|
-
return
|
|
515
|
-
error:
|
|
517
|
+
const { data: r, code: i } = await this.req.post("club/user-profile", t, Q, n);
|
|
518
|
+
return r ?? {
|
|
519
|
+
error: i
|
|
516
520
|
};
|
|
517
521
|
}
|
|
518
522
|
/**
|
|
@@ -520,106 +524,117 @@ class Rr {
|
|
|
520
524
|
*
|
|
521
525
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=NowUIynMVn
|
|
522
526
|
*/
|
|
523
|
-
async getAddresses() {
|
|
527
|
+
async getAddresses(t) {
|
|
524
528
|
if (!await this.token.autoLogin()) return [];
|
|
525
|
-
const { data:
|
|
526
|
-
return (
|
|
529
|
+
const { data: n } = await this.req.get("club/addresses", Qe, t);
|
|
530
|
+
return (n == null ? void 0 : n.addresses) ?? [];
|
|
527
531
|
}
|
|
528
532
|
/**
|
|
529
533
|
* 增加俱乐部收货地址
|
|
530
534
|
*
|
|
531
535
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=TaGIIYDRYA
|
|
532
536
|
*/
|
|
533
|
-
async addAddress(t) {
|
|
537
|
+
async addAddress(t, n) {
|
|
534
538
|
if (!await this.token.autoLogin()) return null;
|
|
535
|
-
const { data:
|
|
536
|
-
return
|
|
539
|
+
const { data: r } = await this.req.post("/club/add-address", s(t), K, n);
|
|
540
|
+
return r;
|
|
537
541
|
}
|
|
538
542
|
/**
|
|
539
543
|
* 修改自己的俱乐部收货地址
|
|
540
544
|
*
|
|
541
545
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=p9FlJhHnWN
|
|
542
546
|
*/
|
|
543
|
-
async updateAddress(t) {
|
|
547
|
+
async updateAddress(t, n) {
|
|
544
548
|
await this.token.autoLogin();
|
|
545
|
-
const { data:
|
|
546
|
-
|
|
549
|
+
const { data: r, code: i } = await this.req.post(
|
|
550
|
+
"club/update-address",
|
|
551
|
+
s(t),
|
|
552
|
+
K,
|
|
553
|
+
n
|
|
554
|
+
);
|
|
555
|
+
return r ?? { error: i };
|
|
547
556
|
}
|
|
548
557
|
/**
|
|
549
558
|
* 删除自己的俱乐部收货地址
|
|
550
559
|
*
|
|
551
560
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=MEEOBdf8rm
|
|
552
561
|
*/
|
|
553
|
-
async deleteAddress(t) {
|
|
562
|
+
async deleteAddress(t, n) {
|
|
554
563
|
if (!await this.token.autoLogin()) return null;
|
|
555
|
-
const { ok:
|
|
556
|
-
return
|
|
564
|
+
const { ok: r } = await this.req.post("club/delete-address", { address_id: t }, null, n);
|
|
565
|
+
return r;
|
|
557
566
|
}
|
|
558
567
|
/**
|
|
559
568
|
* 获取俱乐部积分统计信息
|
|
560
569
|
*
|
|
561
570
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=x4uxtGstRL
|
|
562
571
|
*/
|
|
563
|
-
async getUserCredit(t) {
|
|
572
|
+
async getUserCredit(t, n) {
|
|
564
573
|
await this.token.autoLogin();
|
|
565
|
-
const { data:
|
|
566
|
-
|
|
574
|
+
const { data: r, code: i } = await this.req.get("club/user-credit", Ke, {
|
|
575
|
+
...n,
|
|
576
|
+
params: s(t)
|
|
577
|
+
});
|
|
578
|
+
return r ?? { error: i };
|
|
567
579
|
}
|
|
568
580
|
/**
|
|
569
581
|
* 获取自己的俱乐部积分变动记录
|
|
570
582
|
*
|
|
571
583
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=lQFgF689P8
|
|
572
584
|
*/
|
|
573
|
-
async getCreditLogs(t) {
|
|
585
|
+
async getCreditLogs(t, n) {
|
|
574
586
|
await this.token.autoLogin();
|
|
575
|
-
const { data:
|
|
576
|
-
|
|
587
|
+
const { data: r } = await this.req.get("club/credit-logs", He, {
|
|
588
|
+
...n,
|
|
589
|
+
params: s({ max_results: 20, ...t })
|
|
577
590
|
});
|
|
578
|
-
return { credit_logs: (
|
|
591
|
+
return { credit_logs: (r == null ? void 0 : r.credit_logs) || [], next_token: r == null ? void 0 : r.next_token };
|
|
579
592
|
}
|
|
580
593
|
/**
|
|
581
594
|
* 获取自己的俱乐部权益列表
|
|
582
595
|
*
|
|
583
596
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=UFSDGvqkdV
|
|
584
597
|
*/
|
|
585
|
-
async getBenefits() {
|
|
598
|
+
async getBenefits(t) {
|
|
586
599
|
if (!await this.token.autoLogin()) return [];
|
|
587
|
-
const { data:
|
|
588
|
-
return (
|
|
600
|
+
const { data: n } = await this.req.get("club/benefits", Je, t);
|
|
601
|
+
return (n == null ? void 0 : n.benefits) || [];
|
|
589
602
|
}
|
|
590
603
|
/**
|
|
591
604
|
* 获取某个权益详细信息
|
|
592
605
|
*
|
|
593
606
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=XKto0MeaHF
|
|
594
607
|
*/
|
|
595
|
-
async getBenefit(t) {
|
|
608
|
+
async getBenefit(t, n) {
|
|
596
609
|
if (!await this.token.autoLogin()) return null;
|
|
597
|
-
const { data:
|
|
610
|
+
const { data: r } = await this.req.get("club/benefit", Xe, {
|
|
611
|
+
...n,
|
|
598
612
|
params: { benefit_id: t }
|
|
599
613
|
});
|
|
600
|
-
return (
|
|
614
|
+
return (r == null ? void 0 : r.benefit) || null;
|
|
601
615
|
}
|
|
602
616
|
/**
|
|
603
617
|
* 获取商城商品列表
|
|
604
618
|
*
|
|
605
619
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=r3vC3PzfMQ
|
|
606
620
|
*/
|
|
607
|
-
async getProducts(t) {
|
|
608
|
-
const { data:
|
|
621
|
+
async getProducts(t, n) {
|
|
622
|
+
const { data: r } = await this.req.get("club/products", ze, {
|
|
623
|
+
...n,
|
|
609
624
|
params: t
|
|
610
625
|
});
|
|
611
|
-
return (
|
|
626
|
+
return (r == null ? void 0 : r.products) || [];
|
|
612
627
|
}
|
|
613
628
|
/**
|
|
614
629
|
* 兑换商城商品
|
|
615
630
|
*
|
|
616
631
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=LWcMVwX3OY
|
|
617
632
|
*/
|
|
618
|
-
async redeemProduct(t) {
|
|
633
|
+
async redeemProduct(t, n) {
|
|
619
634
|
await this.token.autoLogin();
|
|
620
|
-
const { ok:
|
|
621
|
-
return
|
|
622
|
-
error:
|
|
635
|
+
const { ok: r, code: i } = await this.req.post("club/redeem-product", s(t), null, n);
|
|
636
|
+
return r || {
|
|
637
|
+
error: i
|
|
623
638
|
};
|
|
624
639
|
}
|
|
625
640
|
/**
|
|
@@ -627,15 +642,16 @@ class Rr {
|
|
|
627
642
|
*
|
|
628
643
|
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Ml6mLgT4cM
|
|
629
644
|
*/
|
|
630
|
-
async getRedemptions(t) {
|
|
645
|
+
async getRedemptions(t, n) {
|
|
631
646
|
await this.token.autoLogin();
|
|
632
|
-
const { data:
|
|
633
|
-
|
|
647
|
+
const { data: r } = await this.req.get("club/redemptions", Ye, {
|
|
648
|
+
...n,
|
|
649
|
+
params: s({ max_results: 20, ...t })
|
|
634
650
|
});
|
|
635
|
-
return { redemptions: (
|
|
651
|
+
return { redemptions: (r == null ? void 0 : r.redemptions) || [], next_token: r == null ? void 0 : r.next_token };
|
|
636
652
|
}
|
|
637
653
|
}
|
|
638
|
-
const
|
|
654
|
+
const V = {
|
|
639
655
|
/** 活动道具 */
|
|
640
656
|
EventItem: "event_item",
|
|
641
657
|
/** 游戏内道具 */
|
|
@@ -654,17 +670,17 @@ const R = {
|
|
|
654
670
|
ExternalCode: "external_gift_code",
|
|
655
671
|
/** 空奖励 */
|
|
656
672
|
VoidItem: "void_item"
|
|
657
|
-
}, ee = e.string().enum(
|
|
673
|
+
}, ee = e.string().enum(V).lock(), jr = V, te = ee, Ze = {
|
|
658
674
|
/** 世游通行证 ID / Combo ID */
|
|
659
675
|
UserId: "user_id",
|
|
660
676
|
/** 游戏角色 ID */
|
|
661
677
|
RoleId: "role_id"
|
|
662
|
-
},
|
|
678
|
+
}, We = e.string().enum(Ze).lock(), et = {
|
|
663
679
|
None: "none",
|
|
664
680
|
Daily: "daily",
|
|
665
681
|
Weekly: "weekly",
|
|
666
682
|
Monthly: "monthly"
|
|
667
|
-
},
|
|
683
|
+
}, tt = e.string().enum(et).lock(), c = {
|
|
668
684
|
/** 预约 */
|
|
669
685
|
Preregister: "preregister",
|
|
670
686
|
/** 抽奖 */
|
|
@@ -703,7 +719,7 @@ const R = {
|
|
|
703
719
|
CheckIn: "check_in",
|
|
704
720
|
/** 领取激活码 */
|
|
705
721
|
ClaimActivationKey: "claim_activation_key"
|
|
706
|
-
},
|
|
722
|
+
}, nt = e.string().enum(c).lock(), rt = {
|
|
707
723
|
/** 累计游戏内活跃值 */
|
|
708
724
|
Active: "player_active_points",
|
|
709
725
|
/** 累计登录,单位 人天 */
|
|
@@ -718,14 +734,14 @@ const R = {
|
|
|
718
734
|
MatchCounts: "player_match_counts",
|
|
719
735
|
/** 游戏对局天数 */
|
|
720
736
|
MatchDays: "player_match_days"
|
|
721
|
-
}, ne = e.string().enum(
|
|
737
|
+
}, ne = e.string().enum(rt).lock(), it = {
|
|
722
738
|
/** 官方上传 */
|
|
723
739
|
System: "system",
|
|
724
740
|
/** 用户投稿 */
|
|
725
741
|
UserSubmission: "user_submission",
|
|
726
742
|
/** 投票入围 */
|
|
727
743
|
Shortlisted: "shortlisted"
|
|
728
|
-
},
|
|
744
|
+
}, ot = e.string().enum(it).lock(), _ = {
|
|
729
745
|
/** 未获得奖励 */
|
|
730
746
|
Ineligible: "ineligible",
|
|
731
747
|
/** 奖励未领取 */
|
|
@@ -736,7 +752,7 @@ const R = {
|
|
|
736
752
|
Failed: "failed",
|
|
737
753
|
/** 奖励已发货 */
|
|
738
754
|
Delivered: "delivered"
|
|
739
|
-
},
|
|
755
|
+
}, Tr = e.string().enum(_).lock(), E = {
|
|
740
756
|
/**
|
|
741
757
|
* 奖励未领取,拼写错误以兼容后端历史版本,检查请使用 Unclaimed
|
|
742
758
|
*
|
|
@@ -744,16 +760,16 @@ const R = {
|
|
|
744
760
|
*/
|
|
745
761
|
UnclaimedErr: "unaccalimed",
|
|
746
762
|
/** 奖励未领取 */
|
|
747
|
-
Unclaimed:
|
|
763
|
+
Unclaimed: _.Unclaimed,
|
|
748
764
|
/** 奖励已领取 */
|
|
749
|
-
Received:
|
|
765
|
+
Received: _.Received,
|
|
750
766
|
/** 奖励发放失败 */
|
|
751
|
-
Failed:
|
|
767
|
+
Failed: _.Failed,
|
|
752
768
|
/** 奖励已发货 */
|
|
753
|
-
Delivered:
|
|
754
|
-
}, re = e.string().enum(E).lock(),
|
|
769
|
+
Delivered: _.Delivered
|
|
770
|
+
}, re = e.string().enum(E).lock(), b = {
|
|
755
771
|
/** 未获得奖励 */
|
|
756
|
-
Ineligible:
|
|
772
|
+
Ineligible: _.Ineligible,
|
|
757
773
|
/**
|
|
758
774
|
* 奖励未领取,拼写错误以兼容后端历史版本,检查请使用 Unclaimed
|
|
759
775
|
*
|
|
@@ -761,24 +777,24 @@ const R = {
|
|
|
761
777
|
*/
|
|
762
778
|
UnclaimedErr: "unaccalimed",
|
|
763
779
|
/** 奖励未领取 */
|
|
764
|
-
Unclaimed:
|
|
780
|
+
Unclaimed: _.Unclaimed,
|
|
765
781
|
/** 奖励已领取 */
|
|
766
|
-
Received:
|
|
782
|
+
Received: _.Received,
|
|
767
783
|
/** 奖励发放失败 */
|
|
768
|
-
Failed:
|
|
784
|
+
Failed: _.Failed,
|
|
769
785
|
/** 奖励已发货 */
|
|
770
|
-
Delivered:
|
|
771
|
-
}, $ = e.string().enum(
|
|
786
|
+
Delivered: _.Delivered
|
|
787
|
+
}, $ = e.string().enum(b).lock(), at = {
|
|
772
788
|
/** 玩法产出奖励 */
|
|
773
789
|
Output: "output",
|
|
774
790
|
/** 玩法参与奖励 */
|
|
775
791
|
Engage: "engage"
|
|
776
|
-
}, U = e.string().enum(
|
|
792
|
+
}, U = e.string().enum(at).lock(), st = {
|
|
777
793
|
/** 私有队伍 */
|
|
778
794
|
Private: "private",
|
|
779
795
|
/** 公开队伍 */
|
|
780
796
|
Public: "public"
|
|
781
|
-
},
|
|
797
|
+
}, ct = e.string().enum(st).lock(), k = {
|
|
782
798
|
/** 未知状态 */
|
|
783
799
|
Unknown: "unknown",
|
|
784
800
|
/** 等待开奖 */
|
|
@@ -789,7 +805,7 @@ const R = {
|
|
|
789
805
|
Claimed: "claimed",
|
|
790
806
|
/** 领奖失败 */
|
|
791
807
|
Fail: "fail"
|
|
792
|
-
},
|
|
808
|
+
}, qr = e.string().enum(k).lock(), ut = {
|
|
793
809
|
/** 发起组队 */
|
|
794
810
|
Assemble: "assemble",
|
|
795
811
|
/** 加入队伍 */
|
|
@@ -800,71 +816,71 @@ const R = {
|
|
|
800
816
|
ChangeVisibility: "change_visibility",
|
|
801
817
|
/** 查询组队信息 */
|
|
802
818
|
Query: "query"
|
|
803
|
-
},
|
|
819
|
+
}, xr = e.string().enum(ut).lock(), lt = {
|
|
804
820
|
/** 查询抽奖券 */
|
|
805
821
|
Query: "query",
|
|
806
822
|
/** 开奖 */
|
|
807
823
|
Draw: "draw",
|
|
808
824
|
/** 领奖 */
|
|
809
825
|
Claim: "claim"
|
|
810
|
-
},
|
|
826
|
+
}, Sr = e.string().enum(lt).lock(), mt = e.string().enum(R(V, "GiftCode", "LotteryTicket")), F = e.object({
|
|
811
827
|
reward_item_id: e.number(),
|
|
812
828
|
reward_amount: e.number(),
|
|
813
829
|
reward_item_name: e.string(),
|
|
814
830
|
reward_item_icon_url: e.string(),
|
|
815
831
|
reward_item_desc: e.string().optional(),
|
|
816
|
-
reward_item_type:
|
|
832
|
+
reward_item_type: mt,
|
|
817
833
|
reward_item_rating: e.number()
|
|
818
|
-
}).lock(),
|
|
834
|
+
}).lock(), dt = e.object({
|
|
819
835
|
engage_count: e.number(),
|
|
820
836
|
rewards: e.array(F)
|
|
821
|
-
}).lock(),
|
|
837
|
+
}).lock(), gt = e.union(
|
|
822
838
|
e.object({
|
|
823
839
|
feature_reward_type: e.string().enum("every"),
|
|
824
840
|
reward_details: e.array(F)
|
|
825
841
|
}),
|
|
826
842
|
e.object({
|
|
827
843
|
feature_reward_type: e.string().enum("regular"),
|
|
828
|
-
reward_details: e.array(
|
|
844
|
+
reward_details: e.array(dt)
|
|
829
845
|
})
|
|
830
846
|
).satisfies().lock(), u = e.object({
|
|
831
847
|
feature_name: e.string(),
|
|
832
848
|
feature_id: e.number(),
|
|
833
849
|
description: e.string(),
|
|
834
|
-
cycle:
|
|
850
|
+
cycle: tt,
|
|
835
851
|
limit: e.number(),
|
|
836
852
|
since: e.number(),
|
|
837
853
|
until: e.number(),
|
|
838
|
-
engage_account:
|
|
839
|
-
feature_rewards:
|
|
840
|
-
}),
|
|
854
|
+
engage_account: We,
|
|
855
|
+
feature_rewards: gt.clone().optional()
|
|
856
|
+
}), pt = c.Cashback, _t = e.object({
|
|
841
857
|
...u.shape,
|
|
842
|
-
feature_type: e.string().enum(
|
|
858
|
+
feature_type: e.string().enum(pt),
|
|
843
859
|
config: e.object({
|
|
844
860
|
order_start_time: e.number(),
|
|
845
861
|
order_end_time: e.number(),
|
|
846
862
|
claim_rewards_start_time: e.number(),
|
|
847
863
|
claim_rewards_end_time: e.number()
|
|
848
864
|
})
|
|
849
|
-
}),
|
|
865
|
+
}), bt = c.CheckIn, yt = e.object({
|
|
850
866
|
...u.shape,
|
|
851
|
-
feature_type: e.string().enum(
|
|
852
|
-
}),
|
|
867
|
+
feature_type: e.string().enum(bt)
|
|
868
|
+
}), ft = c.ClaimActivationKey, ht = e.object({
|
|
853
869
|
...u.shape,
|
|
854
|
-
feature_type: e.string().enum(
|
|
855
|
-
}),
|
|
870
|
+
feature_type: e.string().enum(ft)
|
|
871
|
+
}), wt = c.ClaimRewards, kt = e.object({
|
|
856
872
|
...u.shape,
|
|
857
|
-
feature_type: e.string().enum(
|
|
858
|
-
}),
|
|
873
|
+
feature_type: e.string().enum(wt)
|
|
874
|
+
}), vt = c.Comment, Ct = e.object({
|
|
859
875
|
...u.shape,
|
|
860
|
-
feature_type: e.string().enum(
|
|
876
|
+
feature_type: e.string().enum(vt),
|
|
861
877
|
config: e.object({
|
|
862
878
|
comments: e.array(e.string()),
|
|
863
879
|
send_rate: e.number()
|
|
864
880
|
})
|
|
865
|
-
}),
|
|
881
|
+
}), Rt = c.Follow, Vt = e.object({
|
|
866
882
|
...u.shape,
|
|
867
|
-
feature_type: e.string().enum(
|
|
883
|
+
feature_type: e.string().enum(Rt),
|
|
868
884
|
config: e.object({
|
|
869
885
|
platform: e.string(),
|
|
870
886
|
platform_icon: e.string().optional(),
|
|
@@ -872,59 +888,59 @@ const R = {
|
|
|
872
888
|
qr_code_url: e.string().optional(),
|
|
873
889
|
platform_desc: e.string().optional()
|
|
874
890
|
})
|
|
875
|
-
}),
|
|
891
|
+
}), jt = c.GiftCode, Tt = e.object({
|
|
876
892
|
name: e.string(),
|
|
877
893
|
icon_url: e.string(),
|
|
878
894
|
count: e.number()
|
|
879
|
-
}),
|
|
895
|
+
}), qt = e.object({
|
|
880
896
|
...u.shape,
|
|
881
|
-
feature_type: e.string().enum(
|
|
897
|
+
feature_type: e.string().enum(jt),
|
|
882
898
|
config: e.object({
|
|
883
|
-
gift_items: e.array(
|
|
899
|
+
gift_items: e.array(Tt),
|
|
884
900
|
mp_url: e.string().optional(),
|
|
885
901
|
mp_qrcode_url: e.string().optional()
|
|
886
902
|
})
|
|
887
|
-
}),
|
|
903
|
+
}), xt = c.Invite, St = e.object({
|
|
888
904
|
...u.shape,
|
|
889
|
-
feature_type: e.string().enum(
|
|
905
|
+
feature_type: e.string().enum(xt),
|
|
890
906
|
config: e.object({
|
|
891
907
|
share_url: e.string()
|
|
892
908
|
})
|
|
893
|
-
}),
|
|
909
|
+
}), Lt = c.InvitedRegister, Pt = e.object({
|
|
894
910
|
...u.shape,
|
|
895
|
-
feature_type: e.string().enum(
|
|
896
|
-
}),
|
|
911
|
+
feature_type: e.string().enum(Lt)
|
|
912
|
+
}), Et = e.string().enum(R(V, "GiftCode", "LotteryTicket")), $t = c.Lottery, Ut = e.object({
|
|
897
913
|
reward_item_id: e.number(),
|
|
898
914
|
reward_item_name: e.string(),
|
|
899
|
-
reward_item_type:
|
|
915
|
+
reward_item_type: Et,
|
|
900
916
|
reward_item_icon_url: e.string(),
|
|
901
917
|
reward_item_desc: e.string().optional(),
|
|
902
918
|
reward_amount: e.number(),
|
|
903
919
|
reward_remaining_stock: e.number()
|
|
904
|
-
}),
|
|
920
|
+
}), Ft = e.object({
|
|
905
921
|
...u.shape,
|
|
906
|
-
feature_type: e.string().enum(
|
|
922
|
+
feature_type: e.string().enum($t),
|
|
907
923
|
config: e.object({
|
|
908
924
|
consume_item_id: e.number(),
|
|
909
925
|
consume_item_name: e.number(),
|
|
910
926
|
consume_item_icon_url: e.string(),
|
|
911
927
|
consume_item_count: e.number(),
|
|
912
928
|
consume_item_desc: e.string().optional(),
|
|
913
|
-
rewards: e.array(
|
|
929
|
+
rewards: e.array(Ut)
|
|
914
930
|
})
|
|
915
|
-
}),
|
|
931
|
+
}), Dt = c.LotteryDraw, It = e.object({
|
|
916
932
|
...u.shape,
|
|
917
|
-
feature_type: e.string().enum(
|
|
933
|
+
feature_type: e.string().enum(Dt),
|
|
918
934
|
config: e.object({
|
|
919
935
|
draw_not_before: e.number(),
|
|
920
936
|
draw_not_after: e.number()
|
|
921
937
|
})
|
|
922
|
-
}),
|
|
938
|
+
}), Gt = c.Preregister, At = e.object({
|
|
923
939
|
...u.shape,
|
|
924
|
-
feature_type: e.string().enum(
|
|
925
|
-
}),
|
|
940
|
+
feature_type: e.string().enum(Gt)
|
|
941
|
+
}), Nt = c.Quest, Ot = e.object({
|
|
926
942
|
...u.shape,
|
|
927
|
-
feature_type: e.string().enum(
|
|
943
|
+
feature_type: e.string().enum(Nt),
|
|
928
944
|
config: e.object({
|
|
929
945
|
objective: ne,
|
|
930
946
|
completion_value: e.number(),
|
|
@@ -938,38 +954,38 @@ const R = {
|
|
|
938
954
|
required_matches: e.number().min(1).optional()
|
|
939
955
|
}).optional()
|
|
940
956
|
})
|
|
941
|
-
}),
|
|
957
|
+
}), Bt = c.Register, Mt = e.object({
|
|
942
958
|
...u.shape,
|
|
943
|
-
feature_type: e.string().enum(
|
|
944
|
-
}),
|
|
959
|
+
feature_type: e.string().enum(Bt)
|
|
960
|
+
}), Qt = c.Share, Kt = e.object({
|
|
945
961
|
...u.shape,
|
|
946
|
-
feature_type: e.string().enum(
|
|
962
|
+
feature_type: e.string().enum(Qt),
|
|
947
963
|
config: e.object({
|
|
948
964
|
share_platform: e.string(),
|
|
949
965
|
jump_url: e.string().optional(),
|
|
950
966
|
icon_url: e.string().optional()
|
|
951
967
|
})
|
|
952
|
-
}),
|
|
968
|
+
}), Ht = c.Subscribe, zt = e.object({
|
|
953
969
|
...u.shape,
|
|
954
|
-
feature_type: e.string().enum(
|
|
970
|
+
feature_type: e.string().enum(Ht),
|
|
955
971
|
config: e.object({
|
|
956
972
|
weixin_template_ids: e.array(e.string())
|
|
957
973
|
})
|
|
958
|
-
}),
|
|
974
|
+
}), Jt = c.Survey, Xt = e.object({
|
|
959
975
|
...u.shape,
|
|
960
|
-
feature_type: e.string().enum(
|
|
976
|
+
feature_type: e.string().enum(Jt),
|
|
961
977
|
config: e.object({
|
|
962
978
|
survey_id: e.string(),
|
|
963
979
|
survey_url: e.string()
|
|
964
980
|
})
|
|
965
|
-
}),
|
|
981
|
+
}), Yt = c.Team, Zt = e.object({
|
|
966
982
|
...u.shape,
|
|
967
|
-
feature_type: e.string().enum(
|
|
983
|
+
feature_type: e.string().enum(Yt),
|
|
968
984
|
config: e.object({
|
|
969
985
|
max_members: e.number().min(1),
|
|
970
986
|
min_members: e.number().min(1)
|
|
971
987
|
})
|
|
972
|
-
}),
|
|
988
|
+
}), Wt = c.Vote, en = e.object({
|
|
973
989
|
sn: e.string(),
|
|
974
990
|
name: e.string(),
|
|
975
991
|
img_urls: e.array(e.string()).optional(),
|
|
@@ -979,57 +995,57 @@ const R = {
|
|
|
979
995
|
amount: e.number(),
|
|
980
996
|
finalists: e.bool(),
|
|
981
997
|
last_vote_time: e.number()
|
|
982
|
-
}),
|
|
998
|
+
}), tn = e.object({
|
|
983
999
|
...u.shape,
|
|
984
|
-
feature_type: e.string().enum(
|
|
1000
|
+
feature_type: e.string().enum(Wt),
|
|
985
1001
|
config: e.object({
|
|
986
1002
|
vote_feature_ids: e.array(e.number()),
|
|
987
1003
|
submission_feature_ids: e.array(e.number()),
|
|
988
1004
|
finalists_amount: e.number(),
|
|
989
|
-
source:
|
|
990
|
-
options: e.array(
|
|
1005
|
+
source: ot,
|
|
1006
|
+
options: e.array(en),
|
|
991
1007
|
rewards: e.array(F)
|
|
992
1008
|
})
|
|
993
|
-
}),
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
).key("feature_type").satisfies(),
|
|
1009
|
+
}), nn = e.union(
|
|
1010
|
+
_t,
|
|
1011
|
+
yt,
|
|
1012
|
+
kt,
|
|
1013
|
+
Ct,
|
|
1014
|
+
Vt,
|
|
1015
|
+
qt,
|
|
1016
|
+
St,
|
|
1017
|
+
Pt,
|
|
1018
|
+
Ft,
|
|
1019
|
+
It,
|
|
1020
|
+
At,
|
|
1021
|
+
Ot,
|
|
1022
|
+
Mt,
|
|
1023
|
+
Kt,
|
|
1024
|
+
zt,
|
|
1025
|
+
Xt,
|
|
1026
|
+
Zt,
|
|
1027
|
+
tn,
|
|
1028
|
+
ht
|
|
1029
|
+
).key("feature_type").satisfies(), rn = e.object({
|
|
1014
1030
|
event_name: e.string(),
|
|
1015
1031
|
rules: e.string(),
|
|
1016
1032
|
since: e.number(),
|
|
1017
1033
|
until: e.number(),
|
|
1018
1034
|
visit_count: e.number().optional(),
|
|
1019
|
-
features: e.array(
|
|
1020
|
-
}).lock(), x = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()),
|
|
1035
|
+
features: e.array(nn)
|
|
1036
|
+
}).lock(), x = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()), on = e.object({
|
|
1021
1037
|
order_total_amount: x,
|
|
1022
1038
|
cashback_total_amount: x,
|
|
1023
1039
|
game_item_count: x
|
|
1024
|
-
}), on = e.object({
|
|
1025
|
-
activation_key: e.string().disallow("")
|
|
1026
1040
|
}), an = e.object({
|
|
1027
|
-
|
|
1041
|
+
activation_key: e.string().disallow("")
|
|
1028
1042
|
}), sn = e.object({
|
|
1043
|
+
gift_code: e.string()
|
|
1044
|
+
}), cn = e.object({
|
|
1029
1045
|
user_id: e.string(),
|
|
1030
1046
|
name: e.string().optional(),
|
|
1031
1047
|
avatar_url: e.string().optional()
|
|
1032
|
-
}),
|
|
1048
|
+
}), un = e.object({
|
|
1033
1049
|
lottery_count: e.number()
|
|
1034
1050
|
}), ie = e.object({
|
|
1035
1051
|
reward_id: e.number(),
|
|
@@ -1046,26 +1062,26 @@ const R = {
|
|
|
1046
1062
|
event_name: e.string(),
|
|
1047
1063
|
feature_id: e.number(),
|
|
1048
1064
|
engagement_id: e.number(),
|
|
1049
|
-
feature_type:
|
|
1065
|
+
feature_type: nt,
|
|
1050
1066
|
receive_time: e.number(),
|
|
1051
1067
|
// https://kdocs.cn/l/ckWFDcOsYEUA?linkname=merUzJsVYH
|
|
1052
1068
|
// 后续会格式化为具体的类型,此处的校验需要对应增加
|
|
1053
1069
|
extra_data: e.record(e.unknown()).optional()
|
|
1054
|
-
}),
|
|
1070
|
+
}), ln = e.string().enum(k.Unknown, k.Pending), mn = e.union(
|
|
1055
1071
|
e.object({
|
|
1056
1072
|
ticket: e.string(),
|
|
1057
|
-
status:
|
|
1073
|
+
status: ln
|
|
1058
1074
|
}),
|
|
1059
1075
|
e.object({
|
|
1060
1076
|
ticket: e.string(),
|
|
1061
|
-
status: e.string().enum(
|
|
1077
|
+
status: e.string().enum(R(k, "Unknown", "Pending")),
|
|
1062
1078
|
reward: ie
|
|
1063
1079
|
})
|
|
1064
|
-
).satisfies(),
|
|
1065
|
-
tickets: e.array(
|
|
1066
|
-
}), dn = e.object({
|
|
1067
|
-
platforms: e.array(e.string())
|
|
1080
|
+
).satisfies(), dn = e.object({
|
|
1081
|
+
tickets: e.array(mn)
|
|
1068
1082
|
}), gn = e.object({
|
|
1083
|
+
platforms: e.array(e.string())
|
|
1084
|
+
}), pn = e.object({
|
|
1069
1085
|
objective: ne,
|
|
1070
1086
|
progress: e.number(),
|
|
1071
1087
|
completion_value: e.number().optional(),
|
|
@@ -1081,24 +1097,24 @@ const R = {
|
|
|
1081
1097
|
})
|
|
1082
1098
|
)
|
|
1083
1099
|
}).optional()
|
|
1084
|
-
}), pn = e.object({
|
|
1085
|
-
platform: e.string()
|
|
1086
1100
|
}), _n = e.object({
|
|
1087
|
-
|
|
1101
|
+
platform: e.string()
|
|
1088
1102
|
}), bn = e.object({
|
|
1089
|
-
|
|
1103
|
+
weixin_openid: e.string()
|
|
1090
1104
|
}), yn = e.object({
|
|
1105
|
+
serial_number: e.number()
|
|
1106
|
+
}), fn = e.object({
|
|
1091
1107
|
team_code: e.string(),
|
|
1092
1108
|
leader_name: e.string(),
|
|
1093
1109
|
total_members: e.number()
|
|
1094
|
-
}),
|
|
1110
|
+
}), Lr = e.object({
|
|
1095
1111
|
is_leader: e.bool(),
|
|
1096
1112
|
is_myself: e.bool().optional(),
|
|
1097
1113
|
role_name: e.string(),
|
|
1098
1114
|
server_name: e.string()
|
|
1099
|
-
}),
|
|
1115
|
+
}), hn = e.object({
|
|
1100
1116
|
team_code: e.string(),
|
|
1101
|
-
visibility:
|
|
1117
|
+
visibility: ct,
|
|
1102
1118
|
members: e.array(
|
|
1103
1119
|
e.object({
|
|
1104
1120
|
is_leader: e.bool(),
|
|
@@ -1106,9 +1122,9 @@ const R = {
|
|
|
1106
1122
|
server_name: e.string()
|
|
1107
1123
|
})
|
|
1108
1124
|
)
|
|
1109
|
-
}), hn = e.object({
|
|
1110
|
-
option_sn: e.string()
|
|
1111
1125
|
}), wn = e.object({
|
|
1126
|
+
option_sn: e.string()
|
|
1127
|
+
}), kn = e.object({
|
|
1112
1128
|
user_id: e.string(),
|
|
1113
1129
|
name: e.string(),
|
|
1114
1130
|
avatar_url: e.string(),
|
|
@@ -1116,24 +1132,24 @@ const R = {
|
|
|
1116
1132
|
video_note: e.number(),
|
|
1117
1133
|
created_at: e.number()
|
|
1118
1134
|
}), D = e.union(
|
|
1119
|
-
|
|
1135
|
+
gn,
|
|
1136
|
+
un,
|
|
1137
|
+
yn,
|
|
1120
1138
|
cn,
|
|
1139
|
+
_n,
|
|
1140
|
+
wn,
|
|
1121
1141
|
bn,
|
|
1142
|
+
on,
|
|
1122
1143
|
sn,
|
|
1123
|
-
pn,
|
|
1124
1144
|
hn,
|
|
1125
|
-
|
|
1126
|
-
|
|
1145
|
+
pn,
|
|
1146
|
+
dn,
|
|
1127
1147
|
an,
|
|
1128
|
-
fn,
|
|
1129
|
-
gn,
|
|
1130
|
-
mn,
|
|
1131
|
-
on,
|
|
1132
1148
|
e.custom(
|
|
1133
1149
|
"EmptyObject",
|
|
1134
|
-
(
|
|
1150
|
+
(o) => C(o) && Object.keys(o).length === 0
|
|
1135
1151
|
)
|
|
1136
|
-
).satisfies().lock(),
|
|
1152
|
+
).satisfies().lock(), vn = e.object({
|
|
1137
1153
|
reward_id: e.number(),
|
|
1138
1154
|
reward_item_id: e.number(),
|
|
1139
1155
|
reward_item_type: te,
|
|
@@ -1146,7 +1162,7 @@ const R = {
|
|
|
1146
1162
|
reward_item_rating: e.number(),
|
|
1147
1163
|
receive_time: e.number(),
|
|
1148
1164
|
extra_data: e.union(...D.validators, e.record(e.unknown())).satisfies().optional()
|
|
1149
|
-
}),
|
|
1165
|
+
}), Cn = e.object({
|
|
1150
1166
|
reward_id: e.number(),
|
|
1151
1167
|
reward_item_id: e.number(),
|
|
1152
1168
|
reward_item_name: e.string(),
|
|
@@ -1157,7 +1173,7 @@ const R = {
|
|
|
1157
1173
|
reward_status: re,
|
|
1158
1174
|
reward_source: U,
|
|
1159
1175
|
extra_data: e.record(e.unknown()).optional()
|
|
1160
|
-
}),
|
|
1176
|
+
}), Rn = e.object({
|
|
1161
1177
|
engagement_id: e.number(),
|
|
1162
1178
|
user_id: e.string(),
|
|
1163
1179
|
event_id: e.number(),
|
|
@@ -1167,15 +1183,15 @@ const R = {
|
|
|
1167
1183
|
server_id: e.string().optional(),
|
|
1168
1184
|
role_id: e.string().optional(),
|
|
1169
1185
|
created_at: e.number(),
|
|
1170
|
-
rewards: e.array(
|
|
1171
|
-
}).lock(),
|
|
1186
|
+
rewards: e.array(vn).optional()
|
|
1187
|
+
}).lock(), Vn = e.object({
|
|
1172
1188
|
allowed: e.bool(),
|
|
1173
1189
|
registered: e.bool()
|
|
1174
|
-
}),
|
|
1190
|
+
}), jn = e.object({
|
|
1175
1191
|
feature_id: e.number(),
|
|
1176
1192
|
can_engage: e.bool(),
|
|
1177
1193
|
has_unclaimed_rewards: e.bool()
|
|
1178
|
-
}),
|
|
1194
|
+
}), Tn = e.object({
|
|
1179
1195
|
engagement_id: e.number(),
|
|
1180
1196
|
engagement: e.object({
|
|
1181
1197
|
engagement_id: e.number(),
|
|
@@ -1183,37 +1199,37 @@ const R = {
|
|
|
1183
1199
|
feature_id: e.number(),
|
|
1184
1200
|
data: D.clone().optional()
|
|
1185
1201
|
}).optional(),
|
|
1186
|
-
rewards: e.array(
|
|
1202
|
+
rewards: e.array(Cn).optional(),
|
|
1187
1203
|
scan: e.bool().optional()
|
|
1188
|
-
}),
|
|
1204
|
+
}), qn = e.object({
|
|
1189
1205
|
reward_id: e.number(),
|
|
1190
1206
|
reward_status: $
|
|
1191
|
-
}),
|
|
1192
|
-
engagements: e.union(e.array(
|
|
1193
|
-
}),
|
|
1194
|
-
status: e.array(
|
|
1195
|
-
}),
|
|
1196
|
-
engagements: e.array(
|
|
1207
|
+
}), xn = e.guard(rn), Sn = e.guard(Vn), S = a({ count: e.number() }), Ln = a({ first_visit: e.bool() }), Pn = a({
|
|
1208
|
+
engagements: e.union(e.array(kn), e.array(fn))
|
|
1209
|
+
}), En = a({
|
|
1210
|
+
status: e.array(jn)
|
|
1211
|
+
}), $n = a({
|
|
1212
|
+
engagements: e.array(Rn),
|
|
1197
1213
|
next_token: e.string().optional()
|
|
1198
|
-
}),
|
|
1199
|
-
claimed_items: e.array(
|
|
1200
|
-
}),
|
|
1214
|
+
}), Un = e.guard(Tn), Fn = a({
|
|
1215
|
+
claimed_items: e.array(qn)
|
|
1216
|
+
}), Dn = a({
|
|
1201
1217
|
reward_status: $
|
|
1202
|
-
}),
|
|
1218
|
+
}), In = a({
|
|
1203
1219
|
user_rewards: e.array(ie),
|
|
1204
1220
|
next_token: e.string().optional()
|
|
1205
|
-
}),
|
|
1221
|
+
}), Gn = a({
|
|
1206
1222
|
scene: e.string()
|
|
1207
|
-
}),
|
|
1223
|
+
}), An = a({
|
|
1208
1224
|
params: e.string()
|
|
1209
|
-
}),
|
|
1225
|
+
}), Nn = a({
|
|
1210
1226
|
img: e.string()
|
|
1211
1227
|
});
|
|
1212
|
-
class
|
|
1228
|
+
class Pr {
|
|
1213
1229
|
constructor(t, n) {
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1230
|
+
m(this, "token");
|
|
1231
|
+
m(this, "event", 0);
|
|
1232
|
+
m(this, "req");
|
|
1217
1233
|
this.token = t, this.event = +n, this.req = t.req;
|
|
1218
1234
|
}
|
|
1219
1235
|
/**
|
|
@@ -1221,42 +1237,45 @@ class Lr {
|
|
|
1221
1237
|
*
|
|
1222
1238
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=OWGSPF3Ysl
|
|
1223
1239
|
*/
|
|
1224
|
-
async verifyMobileAllowed(t, n) {
|
|
1225
|
-
const { data:
|
|
1240
|
+
async verifyMobileAllowed(t, n, r) {
|
|
1241
|
+
const { data: i } = await this.req.get("verify-mobile-allowed", Sn, {
|
|
1242
|
+
...r,
|
|
1226
1243
|
params: { game_id: t, mobile: n }
|
|
1227
1244
|
});
|
|
1228
|
-
return
|
|
1245
|
+
return i;
|
|
1229
1246
|
}
|
|
1230
1247
|
/**
|
|
1231
1248
|
* 获取运营活动的基础配置信息
|
|
1232
1249
|
*
|
|
1233
1250
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=wFXxtdNKPm
|
|
1234
1251
|
*/
|
|
1235
|
-
async getConfig() {
|
|
1236
|
-
const { data:
|
|
1237
|
-
return
|
|
1252
|
+
async getConfig(t) {
|
|
1253
|
+
const { data: n } = await this.req.get(`event/${this.event}/event-config`, xn, t);
|
|
1254
|
+
return n;
|
|
1238
1255
|
}
|
|
1239
1256
|
/**
|
|
1240
1257
|
* 获取某个玩法参与用户数量
|
|
1241
1258
|
*
|
|
1242
1259
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=ejPOcWMvT1
|
|
1243
1260
|
*/
|
|
1244
|
-
async getEngagementsUserCount(t) {
|
|
1245
|
-
const { data:
|
|
1261
|
+
async getEngagementsUserCount(t, n) {
|
|
1262
|
+
const { data: r } = await this.req.get(`event/${this.event}/feature-engagement-count`, S, {
|
|
1263
|
+
...n,
|
|
1246
1264
|
params: { feature_id: t, type: "user" }
|
|
1247
1265
|
});
|
|
1248
|
-
return (
|
|
1266
|
+
return (r == null ? void 0 : r.count) ?? null;
|
|
1249
1267
|
}
|
|
1250
1268
|
/**
|
|
1251
1269
|
* 获取某个玩法参与次数
|
|
1252
1270
|
*
|
|
1253
1271
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=ejPOcWMvT1
|
|
1254
1272
|
*/
|
|
1255
|
-
async getEngagementsCount(t) {
|
|
1256
|
-
const { data:
|
|
1273
|
+
async getEngagementsCount(t, n) {
|
|
1274
|
+
const { data: r } = await this.req.get(`event/${this.event}/feature-engagement-count`, S, {
|
|
1275
|
+
...n,
|
|
1257
1276
|
params: { feature_id: t, type: "engagement" }
|
|
1258
1277
|
});
|
|
1259
|
-
return (
|
|
1278
|
+
return (r == null ? void 0 : r.count) ?? null;
|
|
1260
1279
|
}
|
|
1261
1280
|
/**
|
|
1262
1281
|
* 获取某个玩法的参与记录(和特定用户无关)
|
|
@@ -1265,26 +1284,28 @@ class Lr {
|
|
|
1265
1284
|
*
|
|
1266
1285
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=THtZ4ewIQW
|
|
1267
1286
|
*/
|
|
1268
|
-
async getEngagements(t) {
|
|
1269
|
-
const { data:
|
|
1287
|
+
async getEngagements(t, n) {
|
|
1288
|
+
const { data: r } = await this.req.get(`event/${this.event}/feature-engagements`, Pn, {
|
|
1289
|
+
...n,
|
|
1270
1290
|
params: { feature_id: t }
|
|
1271
1291
|
});
|
|
1272
|
-
return (
|
|
1292
|
+
return (r == null ? void 0 : r.engagements) || [];
|
|
1273
1293
|
}
|
|
1274
1294
|
/**
|
|
1275
1295
|
* 用户访问某个活动或玩法
|
|
1276
1296
|
*
|
|
1277
1297
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=DWtJrnrBCn
|
|
1278
1298
|
*/
|
|
1279
|
-
async visit(t) {
|
|
1299
|
+
async visit(t, n) {
|
|
1280
1300
|
await this.token.autoLogin();
|
|
1281
|
-
const { data:
|
|
1301
|
+
const { data: r, code: i } = await this.req.post(
|
|
1282
1302
|
`event/${this.event}/visit`,
|
|
1283
|
-
|
|
1284
|
-
|
|
1303
|
+
s(t || {}),
|
|
1304
|
+
Ln,
|
|
1305
|
+
n
|
|
1285
1306
|
);
|
|
1286
|
-
return
|
|
1287
|
-
error:
|
|
1307
|
+
return r ?? {
|
|
1308
|
+
error: i
|
|
1288
1309
|
};
|
|
1289
1310
|
}
|
|
1290
1311
|
/**
|
|
@@ -1296,13 +1317,14 @@ class Lr {
|
|
|
1296
1317
|
*
|
|
1297
1318
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=WzX5BrMNpL
|
|
1298
1319
|
*/
|
|
1299
|
-
async getUserFeatureStatus(t) {
|
|
1320
|
+
async getUserFeatureStatus(t, n) {
|
|
1300
1321
|
if (!await this.token.autoLogin()) return [];
|
|
1301
|
-
const { data:
|
|
1302
|
-
|
|
1303
|
-
message: !1
|
|
1322
|
+
const { data: r } = await this.req.get("event/user-feature-status", En, {
|
|
1323
|
+
...n,
|
|
1324
|
+
message: !1,
|
|
1325
|
+
params: s({ ...t, event_id: this.event })
|
|
1304
1326
|
});
|
|
1305
|
-
return (
|
|
1327
|
+
return (r == null ? void 0 : r.status) || [];
|
|
1306
1328
|
}
|
|
1307
1329
|
/**
|
|
1308
1330
|
* 获取当前登录用户参与某个玩法的记录
|
|
@@ -1311,10 +1333,11 @@ class Lr {
|
|
|
1311
1333
|
*
|
|
1312
1334
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=NFDdV1dwWb
|
|
1313
1335
|
*/
|
|
1314
|
-
async getUserEngagements(t, n) {
|
|
1336
|
+
async getUserEngagements(t, n, r) {
|
|
1315
1337
|
if (!await this.token.autoLogin()) return [];
|
|
1316
|
-
const { data:
|
|
1317
|
-
|
|
1338
|
+
const { data: i } = await this.req.get("event/user-engagements", $n, {
|
|
1339
|
+
...r,
|
|
1340
|
+
params: s({
|
|
1318
1341
|
max_results: 20,
|
|
1319
1342
|
...n,
|
|
1320
1343
|
event_id: this.event,
|
|
@@ -1322,8 +1345,8 @@ class Lr {
|
|
|
1322
1345
|
})
|
|
1323
1346
|
});
|
|
1324
1347
|
return {
|
|
1325
|
-
engagements: (
|
|
1326
|
-
next_token: (
|
|
1348
|
+
engagements: (i == null ? void 0 : i.engagements) || [],
|
|
1349
|
+
next_token: (i == null ? void 0 : i.next_token) || ""
|
|
1327
1350
|
};
|
|
1328
1351
|
}
|
|
1329
1352
|
/**
|
|
@@ -1335,19 +1358,20 @@ class Lr {
|
|
|
1335
1358
|
*
|
|
1336
1359
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=vuOyrcry3S
|
|
1337
1360
|
*/
|
|
1338
|
-
async engage(t, n, r) {
|
|
1361
|
+
async engage(t, n, r, i) {
|
|
1339
1362
|
await this.token.autoLogin();
|
|
1340
|
-
const { data:
|
|
1363
|
+
const { data: l, code: d } = await this.req.post(
|
|
1341
1364
|
`event/${this.event}/engage`,
|
|
1342
|
-
|
|
1365
|
+
s({
|
|
1343
1366
|
feature_id: t,
|
|
1344
1367
|
engagement: n,
|
|
1345
1368
|
...r
|
|
1346
1369
|
}),
|
|
1347
|
-
|
|
1370
|
+
Un,
|
|
1371
|
+
i
|
|
1348
1372
|
);
|
|
1349
|
-
return
|
|
1350
|
-
error:
|
|
1373
|
+
return l && l.rewards && (l.rewards = l.rewards.map((p) => (p.reward_status = p.reward_status === E.UnclaimedErr ? E.Unclaimed : p.reward_status, p))), l ?? {
|
|
1374
|
+
error: d
|
|
1351
1375
|
};
|
|
1352
1376
|
}
|
|
1353
1377
|
/**
|
|
@@ -1355,11 +1379,16 @@ class Lr {
|
|
|
1355
1379
|
*
|
|
1356
1380
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=lCGuqgvUDP
|
|
1357
1381
|
*/
|
|
1358
|
-
async claimRewards(t) {
|
|
1382
|
+
async claimRewards(t, n) {
|
|
1359
1383
|
await this.token.autoLogin();
|
|
1360
|
-
const { data:
|
|
1361
|
-
|
|
1362
|
-
|
|
1384
|
+
const { data: r, code: i } = await this.req.post(
|
|
1385
|
+
"event/claim-rewards",
|
|
1386
|
+
s(t),
|
|
1387
|
+
Fn,
|
|
1388
|
+
n
|
|
1389
|
+
), l = r == null ? void 0 : r.claimed_items;
|
|
1390
|
+
return l ? l.map((d) => (d.reward_status = d.reward_status === b.UnclaimedErr ? b.Unclaimed : d.reward_status, d)) : {
|
|
1391
|
+
error: i
|
|
1363
1392
|
};
|
|
1364
1393
|
}
|
|
1365
1394
|
/**
|
|
@@ -1367,15 +1396,16 @@ class Lr {
|
|
|
1367
1396
|
*
|
|
1368
1397
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=aQLhlOAB4Q
|
|
1369
1398
|
*/
|
|
1370
|
-
async claimWeixinHongbao(t) {
|
|
1399
|
+
async claimWeixinHongbao(t, n) {
|
|
1371
1400
|
await this.token.autoLogin();
|
|
1372
|
-
const { data:
|
|
1401
|
+
const { data: r, code: i } = await this.req.post(
|
|
1373
1402
|
"event/claim-weixin-hongbao",
|
|
1374
1403
|
{ reward_id: t },
|
|
1375
|
-
|
|
1404
|
+
Dn,
|
|
1405
|
+
n
|
|
1376
1406
|
);
|
|
1377
|
-
return
|
|
1378
|
-
error:
|
|
1407
|
+
return r ? (r.reward_status = r.reward_status === b.UnclaimedErr ? b.Unclaimed : r.reward_status, r) : {
|
|
1408
|
+
error: i
|
|
1379
1409
|
};
|
|
1380
1410
|
}
|
|
1381
1411
|
/**
|
|
@@ -1383,16 +1413,17 @@ class Lr {
|
|
|
1383
1413
|
*
|
|
1384
1414
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=qj12eIgYQG
|
|
1385
1415
|
*/
|
|
1386
|
-
async getUserRewards(t) {
|
|
1416
|
+
async getUserRewards(t, n) {
|
|
1387
1417
|
if (!await this.token.autoLogin()) return { user_rewards: [], next_token: "" };
|
|
1388
|
-
const { data:
|
|
1418
|
+
const { data: r } = await this.req.post(
|
|
1389
1419
|
"event/user-rewards",
|
|
1390
|
-
|
|
1391
|
-
|
|
1420
|
+
s({ max_results: 20, ...t, event_id: this.event }),
|
|
1421
|
+
In,
|
|
1422
|
+
n
|
|
1392
1423
|
);
|
|
1393
1424
|
return {
|
|
1394
|
-
user_rewards: ((
|
|
1395
|
-
next_token: (
|
|
1425
|
+
user_rewards: ((r == null ? void 0 : r.user_rewards) || []).map((i) => (i.reward_status = i.reward_status === b.UnclaimedErr ? b.Unclaimed : i.reward_status, i)),
|
|
1426
|
+
next_token: (r == null ? void 0 : r.next_token) || ""
|
|
1396
1427
|
};
|
|
1397
1428
|
}
|
|
1398
1429
|
/**
|
|
@@ -1400,22 +1431,23 @@ class Lr {
|
|
|
1400
1431
|
*
|
|
1401
1432
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=mnGCTeTgMb
|
|
1402
1433
|
*/
|
|
1403
|
-
async getUserItemCount(t) {
|
|
1434
|
+
async getUserItemCount(t, n) {
|
|
1404
1435
|
if (!await this.token.autoLogin()) return null;
|
|
1405
|
-
const { data:
|
|
1436
|
+
const { data: r } = await this.req.get(`event/${this.event}/user-item-count`, S, {
|
|
1437
|
+
...n,
|
|
1406
1438
|
params: { item_id: t }
|
|
1407
1439
|
});
|
|
1408
|
-
return (
|
|
1440
|
+
return (r == null ? void 0 : r.count) ?? null;
|
|
1409
1441
|
}
|
|
1410
1442
|
/**
|
|
1411
1443
|
* 填写实物奖励收货地址
|
|
1412
1444
|
*
|
|
1413
1445
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=QIwGhnaexb
|
|
1414
1446
|
*/
|
|
1415
|
-
async submitUserRewardAddress(t) {
|
|
1447
|
+
async submitUserRewardAddress(t, n) {
|
|
1416
1448
|
if (!await this.token.autoLogin()) return null;
|
|
1417
|
-
const { ok:
|
|
1418
|
-
return
|
|
1449
|
+
const { ok: r } = await this.req.post(`event/${this.event}/user-reward-address`, t, null, n);
|
|
1450
|
+
return r;
|
|
1419
1451
|
}
|
|
1420
1452
|
/**
|
|
1421
1453
|
* 小程序码携带参数最多 32 个可见字符,若前端携带参数过长,则将参数保存在 api 中,并返回符合小程序码要求的 scene
|
|
@@ -1424,12 +1456,13 @@ class Lr {
|
|
|
1424
1456
|
*
|
|
1425
1457
|
* @param params - 前端扫描二维码打开小程序所需参数
|
|
1426
1458
|
*/
|
|
1427
|
-
async getUnlimitQrcodeScene(t) {
|
|
1459
|
+
async getUnlimitQrcodeScene(t, n) {
|
|
1428
1460
|
if (!await this.token.autoLogin()) return null;
|
|
1429
|
-
const { data:
|
|
1461
|
+
const { data: r } = await this.req.get("event/unlimit-qrcode-scene", Gn, {
|
|
1462
|
+
...n,
|
|
1430
1463
|
params: { params: t }
|
|
1431
1464
|
});
|
|
1432
|
-
return (
|
|
1465
|
+
return (r == null ? void 0 : r.scene) ?? null;
|
|
1433
1466
|
}
|
|
1434
1467
|
/**
|
|
1435
1468
|
* 根据小程序码携带 scene 值,获取对应的前端所需参数
|
|
@@ -1438,29 +1471,35 @@ class Lr {
|
|
|
1438
1471
|
*
|
|
1439
1472
|
* @param scene - 小程序码 scene 值
|
|
1440
1473
|
*/
|
|
1441
|
-
async getParamsByQrcodeScene(t) {
|
|
1442
|
-
const { data:
|
|
1474
|
+
async getParamsByQrcodeScene(t, n) {
|
|
1475
|
+
const { data: r } = await this.req.get("event/params-by-qrcode-scene", An, {
|
|
1476
|
+
...n,
|
|
1443
1477
|
params: { scene: t }
|
|
1444
1478
|
});
|
|
1445
|
-
return (
|
|
1479
|
+
return (r == null ? void 0 : r.params) ?? null;
|
|
1446
1480
|
}
|
|
1447
1481
|
/**
|
|
1448
1482
|
* 生成不限制的带参数的小程序码(dataURI 格式的小程序码图片)
|
|
1449
1483
|
*
|
|
1450
1484
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=Rvmoq8iIy0
|
|
1451
1485
|
*/
|
|
1452
|
-
async generateUnlimitQrcode(t) {
|
|
1486
|
+
async generateUnlimitQrcode(t, n) {
|
|
1453
1487
|
if (!await this.token.autoLogin()) return null;
|
|
1454
|
-
const { data:
|
|
1455
|
-
|
|
1488
|
+
const { data: r } = await this.req.post(
|
|
1489
|
+
"event/unlimit-qrcode",
|
|
1490
|
+
s(t),
|
|
1491
|
+
Nn,
|
|
1492
|
+
n
|
|
1493
|
+
);
|
|
1494
|
+
return (r == null ? void 0 : r.img) ?? null;
|
|
1456
1495
|
}
|
|
1457
1496
|
}
|
|
1458
|
-
const
|
|
1497
|
+
const On = {
|
|
1459
1498
|
/** 所有人均可以发帖 */
|
|
1460
1499
|
All: "all",
|
|
1461
1500
|
/** 指定用户可发帖 */
|
|
1462
1501
|
Limit: "limit"
|
|
1463
|
-
},
|
|
1502
|
+
}, Bn = e.string().enum(On).lock(), Mn = {
|
|
1464
1503
|
/** 待审核(仅自己可见) */
|
|
1465
1504
|
Pending: "pending",
|
|
1466
1505
|
/** 审核通过 */
|
|
@@ -1469,14 +1508,14 @@ const Nn = {
|
|
|
1469
1508
|
Failed: "failed",
|
|
1470
1509
|
/** 嫌疑(仅自己可见) */
|
|
1471
1510
|
Suspect: "suspect"
|
|
1472
|
-
}, oe = e.string().enum(
|
|
1511
|
+
}, oe = e.string().enum(Mn).lock(), Qn = {
|
|
1473
1512
|
/** 系统通知 */
|
|
1474
1513
|
System: "system",
|
|
1475
1514
|
/** 评论我的 */
|
|
1476
1515
|
Comment: "comment",
|
|
1477
1516
|
/** 点赞通知 */
|
|
1478
1517
|
Like: "like"
|
|
1479
|
-
},
|
|
1518
|
+
}, Er = e.string().enum(Qn).lock(), g = {
|
|
1480
1519
|
/** 系统通知 */
|
|
1481
1520
|
System: "system",
|
|
1482
1521
|
/** 帖子被置顶 */
|
|
@@ -1501,13 +1540,13 @@ const Nn = {
|
|
|
1501
1540
|
ReplyLiked: "reply_liked",
|
|
1502
1541
|
/** 回复被删除 */
|
|
1503
1542
|
ReplyDeleted: "reply_deleted"
|
|
1504
|
-
},
|
|
1543
|
+
}, Kn = e.string().enum(g).lock(), ae = e.object({
|
|
1505
1544
|
forum_id: e.number(),
|
|
1506
1545
|
icon_url: e.string(),
|
|
1507
1546
|
name: e.string(),
|
|
1508
1547
|
tags: e.array(e.string()),
|
|
1509
1548
|
sort: e.number(),
|
|
1510
|
-
mode:
|
|
1549
|
+
mode: Bn,
|
|
1511
1550
|
member_ids: e.array(e.number())
|
|
1512
1551
|
}).lock(), I = e.object({
|
|
1513
1552
|
topic_id: e.number(),
|
|
@@ -1538,13 +1577,13 @@ const Nn = {
|
|
|
1538
1577
|
create_time: e.number()
|
|
1539
1578
|
}).lock(), se = e.object({
|
|
1540
1579
|
err_msg: e.string().optional()
|
|
1541
|
-
}).lock(),
|
|
1580
|
+
}).lock(), Hn = e.object({
|
|
1542
1581
|
reply_id: e.number(),
|
|
1543
1582
|
reply_content: e.string().optional(),
|
|
1544
1583
|
replied_by: e.string(),
|
|
1545
1584
|
nickname: e.string(),
|
|
1546
1585
|
avatar_url: e.string()
|
|
1547
|
-
}).lock(),
|
|
1586
|
+
}).lock(), j = e.object({
|
|
1548
1587
|
reply_id: e.number(),
|
|
1549
1588
|
comment_id: e.number(),
|
|
1550
1589
|
comment_content: e.string().optional(),
|
|
@@ -1557,9 +1596,9 @@ const Nn = {
|
|
|
1557
1596
|
content: e.string(),
|
|
1558
1597
|
like_num: e.number(),
|
|
1559
1598
|
liked: e.bool(),
|
|
1560
|
-
reply_to:
|
|
1599
|
+
reply_to: Hn,
|
|
1561
1600
|
create_time: e.number()
|
|
1562
|
-
}).lock(),
|
|
1601
|
+
}).lock(), v = e.object({
|
|
1563
1602
|
comment_id: e.number(),
|
|
1564
1603
|
post_id: e.number(),
|
|
1565
1604
|
post_subject: e.string().optional(),
|
|
@@ -1578,20 +1617,20 @@ const Nn = {
|
|
|
1578
1617
|
image_url: e.string(),
|
|
1579
1618
|
create_time: e.number(),
|
|
1580
1619
|
status: oe,
|
|
1581
|
-
replies: e.array(
|
|
1582
|
-
}).lock(),
|
|
1620
|
+
replies: e.array(j).optional()
|
|
1621
|
+
}).lock(), zn = e.object({
|
|
1583
1622
|
image_url: e.string(),
|
|
1584
1623
|
upload_url: e.string(),
|
|
1585
1624
|
existed: e.bool()
|
|
1586
|
-
}).lock(),
|
|
1625
|
+
}).lock(), f = e.object({
|
|
1587
1626
|
notification_id: e.string(),
|
|
1588
|
-
notification_type:
|
|
1627
|
+
notification_type: Kn,
|
|
1589
1628
|
is_read: e.bool(),
|
|
1590
1629
|
create_time: e.number(),
|
|
1591
1630
|
origin_user_id: e.string(),
|
|
1592
1631
|
origin_user_name: e.string(),
|
|
1593
1632
|
origin_user_avatar_url: e.string()
|
|
1594
|
-
}).lock(),
|
|
1633
|
+
}).lock(), Jn = e.object({
|
|
1595
1634
|
system_message_subject: e.string(),
|
|
1596
1635
|
system_message_content: e.string()
|
|
1597
1636
|
}).lock(), A = e.object({
|
|
@@ -1599,87 +1638,87 @@ const Nn = {
|
|
|
1599
1638
|
post_subject: e.string(),
|
|
1600
1639
|
post_summary: e.string(),
|
|
1601
1640
|
post_image_url: e.string()
|
|
1602
|
-
}).lock(),
|
|
1641
|
+
}).lock(), T = e.object({
|
|
1603
1642
|
comment_id: e.number(),
|
|
1604
1643
|
comment_content: e.string()
|
|
1605
1644
|
}).lock(), N = e.object({
|
|
1606
1645
|
reply_id: e.number(),
|
|
1607
1646
|
reply_content: e.string()
|
|
1608
|
-
}).lock(),
|
|
1609
|
-
...
|
|
1610
|
-
...
|
|
1611
|
-
notification_type: e.string().enum(
|
|
1612
|
-
}),
|
|
1613
|
-
...
|
|
1647
|
+
}).lock(), Xn = e.object({
|
|
1648
|
+
...f.shape,
|
|
1649
|
+
...Jn.shape,
|
|
1650
|
+
notification_type: e.string().enum(g.System)
|
|
1651
|
+
}), Yn = e.object({
|
|
1652
|
+
...f.shape,
|
|
1614
1653
|
...A.shape,
|
|
1615
1654
|
notification_type: e.string().enum(
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1655
|
+
g.PostPinned,
|
|
1656
|
+
g.PostHighlighted,
|
|
1657
|
+
g.PostDeleted,
|
|
1658
|
+
g.PostLiked
|
|
1620
1659
|
)
|
|
1621
|
-
}), Yn = e.object({
|
|
1622
|
-
...y.shape,
|
|
1623
|
-
...A.shape,
|
|
1624
|
-
...j.shape,
|
|
1625
|
-
notification_type: e.string().enum(d.PostCommented)
|
|
1626
1660
|
}), Zn = e.object({
|
|
1627
|
-
...
|
|
1628
|
-
...j.shape,
|
|
1629
|
-
...N.shape,
|
|
1630
|
-
notification_type: e.string().enum(d.CommentReplied)
|
|
1631
|
-
}), Wn = e.object({
|
|
1632
|
-
...y.shape,
|
|
1633
|
-
...j.shape,
|
|
1661
|
+
...f.shape,
|
|
1634
1662
|
...A.shape,
|
|
1635
|
-
|
|
1663
|
+
...T.shape,
|
|
1664
|
+
notification_type: e.string().enum(g.PostCommented)
|
|
1665
|
+
}), Wn = e.object({
|
|
1666
|
+
...f.shape,
|
|
1667
|
+
...T.shape,
|
|
1668
|
+
...N.shape,
|
|
1669
|
+
notification_type: e.string().enum(g.CommentReplied)
|
|
1636
1670
|
}), er = e.object({
|
|
1637
|
-
...
|
|
1671
|
+
...f.shape,
|
|
1672
|
+
...T.shape,
|
|
1673
|
+
...A.shape,
|
|
1674
|
+
notification_type: e.string().enum(g.CommentLiked, g.CommentDeleted)
|
|
1675
|
+
}), tr = e.object({
|
|
1676
|
+
...f.shape,
|
|
1638
1677
|
...N.shape,
|
|
1639
|
-
notification_type: e.string().enum(
|
|
1678
|
+
notification_type: e.string().enum(g.ReplyReplied),
|
|
1640
1679
|
comment_id: e.number(),
|
|
1641
1680
|
reply_to_reply_id: e.number(),
|
|
1642
1681
|
reply_to_reply_content: e.string()
|
|
1643
|
-
}),
|
|
1644
|
-
...
|
|
1682
|
+
}), nr = e.object({
|
|
1683
|
+
...f.shape,
|
|
1645
1684
|
...N.shape,
|
|
1646
|
-
...
|
|
1647
|
-
notification_type: e.string().enum(
|
|
1648
|
-
}),
|
|
1649
|
-
Jn,
|
|
1685
|
+
...T.shape,
|
|
1686
|
+
notification_type: e.string().enum(g.ReplyLiked, g.ReplyDeleted)
|
|
1687
|
+
}), rr = e.union(
|
|
1650
1688
|
Xn,
|
|
1651
1689
|
Yn,
|
|
1652
1690
|
Zn,
|
|
1653
1691
|
Wn,
|
|
1654
1692
|
er,
|
|
1655
|
-
tr
|
|
1656
|
-
|
|
1693
|
+
tr,
|
|
1694
|
+
nr
|
|
1695
|
+
).satisfies().lock(), ir = a({ forums: e.array(ae) }), or = a({ topics: e.array(I) }), ar = a({ topic: I }), sr = a({ post: G }), H = a({
|
|
1657
1696
|
posts: e.array(G),
|
|
1658
1697
|
next_token: e.string().optional()
|
|
1659
|
-
}),
|
|
1660
|
-
replies: e.array(
|
|
1698
|
+
}), cr = a({ post: G, antispam: se }), ur = a({
|
|
1699
|
+
replies: e.array(j),
|
|
1661
1700
|
next_token: e.string().optional()
|
|
1662
|
-
}),
|
|
1663
|
-
reply:
|
|
1701
|
+
}), lr = a({ reply: j }), mr = a({
|
|
1702
|
+
reply: j.clone().optional(),
|
|
1664
1703
|
antispam: se.clone().optional()
|
|
1665
|
-
}),
|
|
1666
|
-
comments: e.array(
|
|
1704
|
+
}), dr = a({ comment: v }), gr = a({
|
|
1705
|
+
comments: e.array(v),
|
|
1667
1706
|
next_token: e.string().optional()
|
|
1668
|
-
}),
|
|
1669
|
-
comment:
|
|
1670
|
-
antispam:
|
|
1671
|
-
}),
|
|
1672
|
-
notifications: e.array(
|
|
1707
|
+
}), pr = a({
|
|
1708
|
+
comment: v.clone().optional(),
|
|
1709
|
+
antispam: v.clone().optional()
|
|
1710
|
+
}), _r = e.guard(zn), br = a({
|
|
1711
|
+
notifications: e.array(rr),
|
|
1673
1712
|
next_token: e.string().optional()
|
|
1674
|
-
}),
|
|
1713
|
+
}), yr = a({
|
|
1675
1714
|
system: e.number(),
|
|
1676
1715
|
comment: e.number(),
|
|
1677
1716
|
like: e.number()
|
|
1678
1717
|
});
|
|
1679
|
-
class
|
|
1718
|
+
class $r {
|
|
1680
1719
|
constructor(t) {
|
|
1681
|
-
|
|
1682
|
-
|
|
1720
|
+
m(this, "token");
|
|
1721
|
+
m(this, "req");
|
|
1683
1722
|
this.token = t, this.req = t.req;
|
|
1684
1723
|
}
|
|
1685
1724
|
/**
|
|
@@ -1687,72 +1726,81 @@ class Er {
|
|
|
1687
1726
|
*
|
|
1688
1727
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=QaqUa2K0z0
|
|
1689
1728
|
*/
|
|
1690
|
-
async getForums() {
|
|
1691
|
-
const { data:
|
|
1692
|
-
return (
|
|
1729
|
+
async getForums(t) {
|
|
1730
|
+
const { data: n } = await this.req.get("community/forums", ir, t);
|
|
1731
|
+
return (n == null ? void 0 : n.forums) || [];
|
|
1693
1732
|
}
|
|
1694
1733
|
/**
|
|
1695
1734
|
* 获取社区话题列表,仅返回启用状态的话题
|
|
1696
1735
|
*
|
|
1697
1736
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=mIwpymAQom
|
|
1698
1737
|
*/
|
|
1699
|
-
async getTopics() {
|
|
1700
|
-
const { data:
|
|
1701
|
-
return (
|
|
1738
|
+
async getTopics(t) {
|
|
1739
|
+
const { data: n } = await this.req.get("community/topics", or, t);
|
|
1740
|
+
return (n == null ? void 0 : n.topics) || [];
|
|
1702
1741
|
}
|
|
1703
1742
|
/**
|
|
1704
1743
|
* 根据话题 ID 获取社区话题信息
|
|
1705
1744
|
*
|
|
1706
1745
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Jvw7xMK31K
|
|
1707
1746
|
*/
|
|
1708
|
-
async getTopic(t) {
|
|
1709
|
-
const { data:
|
|
1747
|
+
async getTopic(t, n) {
|
|
1748
|
+
const { data: r, code: i } = await this.req.get("community/topic", ar, {
|
|
1749
|
+
...n,
|
|
1710
1750
|
params: { topic_id: t }
|
|
1711
1751
|
});
|
|
1712
|
-
return (
|
|
1752
|
+
return (r == null ? void 0 : r.topic) ?? { error: i };
|
|
1713
1753
|
}
|
|
1714
1754
|
/**
|
|
1715
1755
|
* 获取社区帖子列表
|
|
1716
1756
|
*
|
|
1717
1757
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=XKI9lDVrPq
|
|
1718
1758
|
*/
|
|
1719
|
-
async getPosts(t) {
|
|
1720
|
-
const { data:
|
|
1721
|
-
|
|
1759
|
+
async getPosts(t, n) {
|
|
1760
|
+
const { data: r, code: i } = await this.req.get("community/posts", H, {
|
|
1761
|
+
...n,
|
|
1762
|
+
params: s(t)
|
|
1722
1763
|
});
|
|
1723
|
-
return
|
|
1764
|
+
return r ?? { error: i };
|
|
1724
1765
|
}
|
|
1725
1766
|
/**
|
|
1726
1767
|
* 获取社区置顶帖子列表
|
|
1727
1768
|
*
|
|
1728
1769
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=yXubbZuDlC
|
|
1729
1770
|
*/
|
|
1730
|
-
async getPinnedPosts(t, n, r) {
|
|
1731
|
-
const { data:
|
|
1732
|
-
|
|
1771
|
+
async getPinnedPosts(t, n, r, i) {
|
|
1772
|
+
const { data: l, code: d } = await this.req.get("community/pinned-posts", H, {
|
|
1773
|
+
...i,
|
|
1774
|
+
params: s({ forum_id: t, max_results: n, next_token: r })
|
|
1733
1775
|
});
|
|
1734
|
-
return
|
|
1776
|
+
return l ?? { error: d };
|
|
1735
1777
|
}
|
|
1736
1778
|
/**
|
|
1737
1779
|
* 根据帖子 id 获取帖子详情
|
|
1738
1780
|
*
|
|
1739
1781
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=hj1AZy5rcP
|
|
1740
1782
|
*/
|
|
1741
|
-
async getPost(t) {
|
|
1742
|
-
const { data:
|
|
1783
|
+
async getPost(t, n) {
|
|
1784
|
+
const { data: r, code: i } = await this.req.get("community/post", sr, {
|
|
1785
|
+
...n,
|
|
1743
1786
|
params: { post_id: t }
|
|
1744
1787
|
});
|
|
1745
|
-
return (
|
|
1788
|
+
return (r == null ? void 0 : r.post) ?? { error: i };
|
|
1746
1789
|
}
|
|
1747
1790
|
/**
|
|
1748
1791
|
* 发布帖子
|
|
1749
1792
|
*
|
|
1750
1793
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=M5okHBuaVk
|
|
1751
1794
|
*/
|
|
1752
|
-
async post(t) {
|
|
1753
|
-
const { data:
|
|
1754
|
-
|
|
1755
|
-
|
|
1795
|
+
async post(t, n) {
|
|
1796
|
+
const { data: r, code: i } = await this.req.post(
|
|
1797
|
+
"community/post",
|
|
1798
|
+
s(t),
|
|
1799
|
+
cr,
|
|
1800
|
+
n
|
|
1801
|
+
);
|
|
1802
|
+
return r ?? {
|
|
1803
|
+
error: i
|
|
1756
1804
|
};
|
|
1757
1805
|
}
|
|
1758
1806
|
/**
|
|
@@ -1760,33 +1808,40 @@ class Er {
|
|
|
1760
1808
|
*
|
|
1761
1809
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=djKbX7lFdp
|
|
1762
1810
|
*/
|
|
1763
|
-
async getComments(t) {
|
|
1764
|
-
const { data:
|
|
1765
|
-
|
|
1811
|
+
async getComments(t, n) {
|
|
1812
|
+
const { data: r, code: i } = await this.req.get("community/comments", gr, {
|
|
1813
|
+
...n,
|
|
1814
|
+
params: s(t)
|
|
1766
1815
|
});
|
|
1767
|
-
return
|
|
1816
|
+
return r ?? { error: i };
|
|
1768
1817
|
}
|
|
1769
1818
|
/**
|
|
1770
1819
|
* 根据评论 id 获取评论详情
|
|
1771
1820
|
*
|
|
1772
1821
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=RIc7oxVGae
|
|
1773
1822
|
*/
|
|
1774
|
-
async getComment(t) {
|
|
1775
|
-
const { data:
|
|
1823
|
+
async getComment(t, n) {
|
|
1824
|
+
const { data: r, code: i } = await this.req.get("community/comment", dr, {
|
|
1825
|
+
...n,
|
|
1776
1826
|
params: { comment_id: t }
|
|
1777
1827
|
});
|
|
1778
|
-
return (
|
|
1828
|
+
return (r == null ? void 0 : r.comment) ?? { error: i };
|
|
1779
1829
|
}
|
|
1780
1830
|
/**
|
|
1781
1831
|
* 帖子下发表评论
|
|
1782
1832
|
*
|
|
1783
1833
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Nv7lk0nTmr
|
|
1784
1834
|
*/
|
|
1785
|
-
async comment(t) {
|
|
1835
|
+
async comment(t, n) {
|
|
1786
1836
|
await this.token.autoLogin();
|
|
1787
|
-
const { data:
|
|
1788
|
-
|
|
1789
|
-
|
|
1837
|
+
const { data: r, code: i } = await this.req.post(
|
|
1838
|
+
"community/comment",
|
|
1839
|
+
s(t),
|
|
1840
|
+
pr,
|
|
1841
|
+
n
|
|
1842
|
+
);
|
|
1843
|
+
return r ?? {
|
|
1844
|
+
error: i
|
|
1790
1845
|
};
|
|
1791
1846
|
}
|
|
1792
1847
|
/**
|
|
@@ -1794,33 +1849,40 @@ class Er {
|
|
|
1794
1849
|
*
|
|
1795
1850
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=sVKBbY83MY
|
|
1796
1851
|
*/
|
|
1797
|
-
async getReplies(t) {
|
|
1798
|
-
const { data:
|
|
1799
|
-
|
|
1852
|
+
async getReplies(t, n) {
|
|
1853
|
+
const { data: r } = await this.req.get("community/replies", ur, {
|
|
1854
|
+
...n,
|
|
1855
|
+
params: s({ max_results: 20, ...t })
|
|
1800
1856
|
});
|
|
1801
|
-
return
|
|
1857
|
+
return r ?? { replies: [] };
|
|
1802
1858
|
}
|
|
1803
1859
|
/**
|
|
1804
1860
|
* 根据回复 id 获取回复详情
|
|
1805
1861
|
*
|
|
1806
1862
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=kxhcSXD3MG
|
|
1807
1863
|
*/
|
|
1808
|
-
async getReply(t) {
|
|
1809
|
-
const { data:
|
|
1864
|
+
async getReply(t, n) {
|
|
1865
|
+
const { data: r, code: i } = await this.req.get("community/reply", lr, {
|
|
1866
|
+
...n,
|
|
1810
1867
|
params: { reply_id: t }
|
|
1811
1868
|
});
|
|
1812
|
-
return (
|
|
1869
|
+
return (r == null ? void 0 : r.reply) ?? { error: i };
|
|
1813
1870
|
}
|
|
1814
1871
|
/**
|
|
1815
1872
|
* 回复帖子评论或回复
|
|
1816
1873
|
*
|
|
1817
1874
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=KA8WpTX2pg
|
|
1818
1875
|
*/
|
|
1819
|
-
async reply(t) {
|
|
1876
|
+
async reply(t, n) {
|
|
1820
1877
|
await this.token.autoLogin();
|
|
1821
|
-
const { data:
|
|
1822
|
-
|
|
1823
|
-
|
|
1878
|
+
const { data: r, code: i } = await this.req.post(
|
|
1879
|
+
"community/reply",
|
|
1880
|
+
s(t),
|
|
1881
|
+
mr,
|
|
1882
|
+
n
|
|
1883
|
+
);
|
|
1884
|
+
return r ?? {
|
|
1885
|
+
error: i
|
|
1824
1886
|
};
|
|
1825
1887
|
}
|
|
1826
1888
|
/**
|
|
@@ -1828,11 +1890,11 @@ class Er {
|
|
|
1828
1890
|
*
|
|
1829
1891
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=CR3m6PyXfZ
|
|
1830
1892
|
*/
|
|
1831
|
-
async like(t) {
|
|
1893
|
+
async like(t, n) {
|
|
1832
1894
|
await this.token.autoLogin();
|
|
1833
|
-
const { ok:
|
|
1834
|
-
return
|
|
1835
|
-
error:
|
|
1895
|
+
const { ok: r, code: i } = await this.req.post("community/like", { ...t, action: "like" }, null, n);
|
|
1896
|
+
return r || {
|
|
1897
|
+
error: i
|
|
1836
1898
|
};
|
|
1837
1899
|
}
|
|
1838
1900
|
/**
|
|
@@ -1840,11 +1902,11 @@ class Er {
|
|
|
1840
1902
|
*
|
|
1841
1903
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=CR3m6PyXfZ
|
|
1842
1904
|
*/
|
|
1843
|
-
async unlike(t) {
|
|
1905
|
+
async unlike(t, n) {
|
|
1844
1906
|
await this.token.autoLogin();
|
|
1845
|
-
const { ok:
|
|
1846
|
-
return
|
|
1847
|
-
error:
|
|
1907
|
+
const { ok: r, code: i } = await this.req.post("community/like", { ...t, action: "unlike" }, null, n);
|
|
1908
|
+
return r || {
|
|
1909
|
+
error: i
|
|
1848
1910
|
};
|
|
1849
1911
|
}
|
|
1850
1912
|
/**
|
|
@@ -1852,12 +1914,13 @@ class Er {
|
|
|
1852
1914
|
*
|
|
1853
1915
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=dWWhpoShxZ
|
|
1854
1916
|
*/
|
|
1855
|
-
async getMediaPresignedUrl(t) {
|
|
1917
|
+
async getMediaPresignedUrl(t, n) {
|
|
1856
1918
|
await this.token.autoLogin();
|
|
1857
|
-
const { data:
|
|
1919
|
+
const { data: r } = await this.req.get("community/media-presign-url", _r, {
|
|
1920
|
+
...n,
|
|
1858
1921
|
params: t
|
|
1859
1922
|
});
|
|
1860
|
-
return
|
|
1923
|
+
return r;
|
|
1861
1924
|
}
|
|
1862
1925
|
/**
|
|
1863
1926
|
* 获取用户社区通知
|
|
@@ -1866,45 +1929,50 @@ class Er {
|
|
|
1866
1929
|
*
|
|
1867
1930
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=W5lceDgbBG
|
|
1868
1931
|
*/
|
|
1869
|
-
async getNotifications(t) {
|
|
1932
|
+
async getNotifications(t, n) {
|
|
1870
1933
|
await this.token.autoLogin();
|
|
1871
|
-
const { data:
|
|
1872
|
-
|
|
1934
|
+
const { data: r } = await this.req.get("community/notifications", br, {
|
|
1935
|
+
...n,
|
|
1936
|
+
params: s({ max_results: 20, ...t })
|
|
1873
1937
|
});
|
|
1874
|
-
return
|
|
1938
|
+
return r || { notifications: [] };
|
|
1875
1939
|
}
|
|
1876
1940
|
/**
|
|
1877
1941
|
* 获取用户未读通知数量
|
|
1878
1942
|
*
|
|
1879
1943
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=CwIOMjAfMU
|
|
1880
1944
|
*/
|
|
1881
|
-
async getUnreadNotificationsCount() {
|
|
1945
|
+
async getUnreadNotificationsCount(t) {
|
|
1882
1946
|
if (!await this.token.autoLogin()) return null;
|
|
1883
|
-
const { data:
|
|
1884
|
-
|
|
1947
|
+
const { data: n } = await this.req.get(
|
|
1948
|
+
"community/unread-notifications-count",
|
|
1949
|
+
yr,
|
|
1950
|
+
t
|
|
1951
|
+
);
|
|
1952
|
+
return n;
|
|
1885
1953
|
}
|
|
1886
1954
|
/**
|
|
1887
1955
|
* 社区用户将通知标为已读
|
|
1888
1956
|
*
|
|
1889
1957
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=TCJQxnOjJe
|
|
1890
1958
|
*/
|
|
1891
|
-
async clearUnreadNotifications(t) {
|
|
1959
|
+
async clearUnreadNotifications(t, n) {
|
|
1892
1960
|
if (!await this.token.autoLogin()) return !1;
|
|
1893
|
-
const { ok:
|
|
1894
|
-
return
|
|
1961
|
+
const { ok: r } = await this.req.post("community/clear-unread-notifications", { category: t }, null, n);
|
|
1962
|
+
return r;
|
|
1895
1963
|
}
|
|
1896
1964
|
}
|
|
1897
|
-
const
|
|
1965
|
+
const fr = a({
|
|
1898
1966
|
nonce_str: e.string(),
|
|
1899
1967
|
timestamp: e.number(),
|
|
1900
1968
|
signature: e.string()
|
|
1901
1969
|
});
|
|
1902
|
-
var
|
|
1903
|
-
function L(
|
|
1904
|
-
return
|
|
1970
|
+
var hr = /* @__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))(hr || {});
|
|
1971
|
+
function L(o) {
|
|
1972
|
+
return C(o, "open_id", "union_id", "weixin_token");
|
|
1905
1973
|
}
|
|
1906
1974
|
const z = "wx_login_cache";
|
|
1907
|
-
class
|
|
1975
|
+
class Ur {
|
|
1908
1976
|
/**
|
|
1909
1977
|
* 创建微信相关功能接口
|
|
1910
1978
|
*
|
|
@@ -1919,9 +1987,9 @@ class $r {
|
|
|
1919
1987
|
* https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html
|
|
1920
1988
|
*/
|
|
1921
1989
|
constructor(t, n) {
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1990
|
+
m(this, "token");
|
|
1991
|
+
m(this, "$appid");
|
|
1992
|
+
m(this, "req");
|
|
1925
1993
|
this.token = t, this.req = t.req, this.$appid = n, this.getLoginCache();
|
|
1926
1994
|
}
|
|
1927
1995
|
get appid() {
|
|
@@ -1938,7 +2006,7 @@ class $r {
|
|
|
1938
2006
|
const t = this.token.storage.get(z);
|
|
1939
2007
|
if (!t)
|
|
1940
2008
|
return null;
|
|
1941
|
-
const n =
|
|
2009
|
+
const n = be(t);
|
|
1942
2010
|
return L(n) ? (this.token.weixinToken = n.weixin_token, await this.token.autoLogin(), n) : null;
|
|
1943
2011
|
}
|
|
1944
2012
|
/**
|
|
@@ -1959,18 +2027,18 @@ class $r {
|
|
|
1959
2027
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=GwIZ0givCb
|
|
1960
2028
|
*/
|
|
1961
2029
|
async login() {
|
|
1962
|
-
if (!
|
|
2030
|
+
if (!y.wx)
|
|
1963
2031
|
throw new Error("当前环境非微信小程序");
|
|
1964
2032
|
const t = await this.getLoginCache();
|
|
1965
2033
|
if (t)
|
|
1966
2034
|
return t;
|
|
1967
|
-
const n = await
|
|
2035
|
+
const n = await he(), { data: r, code: i } = await this.req.post(
|
|
1968
2036
|
"weixin/login",
|
|
1969
2037
|
{ code: n, appid: this.appid },
|
|
1970
2038
|
L,
|
|
1971
2039
|
{ message: !1 }
|
|
1972
2040
|
);
|
|
1973
|
-
return r && (this.token.weixinToken = r.weixin_token, this.token.storage.set(z, JSON.stringify(r)), await this.token.autoLogin()), r ?? { error:
|
|
2041
|
+
return r && (this.token.weixinToken = r.weixin_token, this.token.storage.set(z, JSON.stringify(r)), await this.token.autoLogin()), r ?? { error: i };
|
|
1974
2042
|
}
|
|
1975
2043
|
/**
|
|
1976
2044
|
* 在微信内嵌网页中调用微信公众号授权登录【暂未启用】
|
|
@@ -1988,28 +2056,29 @@ class $r {
|
|
|
1988
2056
|
* - snsapi_base 不弹出授权页面,用户无感知,只能获取用户 openid,如果需要获取 union_id 则需要 snsapi_userinfo
|
|
1989
2057
|
* - snsapi_userinfo 【默认】弹出授权页面,可拿到 openid、union_id、昵称、头像等信息,但用户也可能会拒绝授权
|
|
1990
2058
|
*/
|
|
1991
|
-
async webLogin(t = "snsapi_userinfo") {
|
|
1992
|
-
const
|
|
1993
|
-
if (!
|
|
1994
|
-
const
|
|
2059
|
+
async webLogin(t = "snsapi_userinfo", n) {
|
|
2060
|
+
const r = P("code"), i = Date.now(), l = +P("state");
|
|
2061
|
+
if (!r || !l || l < i - 1e3 * 60 * 5 || l > i) {
|
|
2062
|
+
const ue = O(["code", "state"]);
|
|
1995
2063
|
location.replace(
|
|
1996
|
-
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(
|
|
2064
|
+
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(ue)}&response_type=code&scope=${t}&state=${i}#wechat_redirect`
|
|
1997
2065
|
);
|
|
1998
2066
|
return;
|
|
1999
2067
|
}
|
|
2000
|
-
if (/^100\d{2}$/.test(
|
|
2001
|
-
return { error:
|
|
2002
|
-
const
|
|
2003
|
-
"replaceState" in history && history.replaceState({}, "",
|
|
2004
|
-
const { data:
|
|
2068
|
+
if (/^100\d{2}$/.test(r))
|
|
2069
|
+
return { error: r };
|
|
2070
|
+
const d = O(["code", "state"]);
|
|
2071
|
+
"replaceState" in history && history.replaceState({}, "", d);
|
|
2072
|
+
const { data: p, code: ce } = await this.req.post(
|
|
2005
2073
|
"weixin/login",
|
|
2006
2074
|
{
|
|
2007
|
-
code:
|
|
2075
|
+
code: r,
|
|
2008
2076
|
appid: this.appid
|
|
2009
2077
|
},
|
|
2010
|
-
L
|
|
2078
|
+
L,
|
|
2079
|
+
n
|
|
2011
2080
|
);
|
|
2012
|
-
return
|
|
2081
|
+
return p && (this.token.weixinToken = p.weixin_token, await this.token.autoLogin()), p ?? { error: ce };
|
|
2013
2082
|
}
|
|
2014
2083
|
/**
|
|
2015
2084
|
* 关联游戏账号,无返回值,全程静默
|
|
@@ -2023,8 +2092,9 @@ class $r {
|
|
|
2023
2092
|
* @param weixinToken 调用 login 后,得到的 weixinToken,如果 weixinToken 为空则跳过不处理
|
|
2024
2093
|
* @param gameCode 从游戏内跳转至小程序时,通过请求参数 query 携带的 game_code,如果值为空则跳过不处理
|
|
2025
2094
|
*/
|
|
2026
|
-
async linkPlayer(t, n) {
|
|
2095
|
+
async linkPlayer(t, n, r) {
|
|
2027
2096
|
!t || !n || await this.req.post("weixin/link-player", { weixin_token: t, game_code: n }, null, {
|
|
2097
|
+
...r,
|
|
2028
2098
|
message: !1
|
|
2029
2099
|
});
|
|
2030
2100
|
}
|
|
@@ -2033,162 +2103,163 @@ class $r {
|
|
|
2033
2103
|
*
|
|
2034
2104
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=CuWOqxr9Ue
|
|
2035
2105
|
*/
|
|
2036
|
-
async getJSSDKConfig() {
|
|
2037
|
-
const { data:
|
|
2106
|
+
async getJSSDKConfig(t) {
|
|
2107
|
+
const { data: n } = await this.req.get("weixin/offiaccount/jssdk-sign", fr, {
|
|
2108
|
+
...t,
|
|
2038
2109
|
params: {
|
|
2039
2110
|
appid: this.appid,
|
|
2040
2111
|
url: location.href.split("#")[0]
|
|
2041
2112
|
}
|
|
2042
2113
|
});
|
|
2043
|
-
return
|
|
2114
|
+
return n ? {
|
|
2044
2115
|
appid: this.appid,
|
|
2045
|
-
nonceStr:
|
|
2046
|
-
timestamp:
|
|
2047
|
-
signature:
|
|
2116
|
+
nonceStr: n.nonce_str,
|
|
2117
|
+
timestamp: n.timestamp,
|
|
2118
|
+
signature: n.signature
|
|
2048
2119
|
} : null;
|
|
2049
2120
|
}
|
|
2050
2121
|
}
|
|
2051
2122
|
export {
|
|
2052
2123
|
se as AntispamValidator,
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2124
|
+
Cr as AuthToken,
|
|
2125
|
+
on as CashbackEngagementDataValidator,
|
|
2126
|
+
an as ClaimActivationKeyEngagementDataValidator,
|
|
2127
|
+
b as ClaimRewardStatus,
|
|
2057
2128
|
$ as ClaimRewardStatusValidator,
|
|
2058
|
-
|
|
2129
|
+
qn as ClaimedItemValidator,
|
|
2059
2130
|
Y as ClubAddressValidator,
|
|
2060
|
-
|
|
2131
|
+
Vr as ClubApi,
|
|
2061
2132
|
Z as ClubBenefitSummaryValidator,
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2133
|
+
Ge as ClubBenefitValidator,
|
|
2134
|
+
je as ClubCreditChangeScene,
|
|
2135
|
+
Te as ClubCreditChangeSceneValidator,
|
|
2136
|
+
Re as ClubCreditChangeType,
|
|
2137
|
+
Ve as ClubCreditChangeTypeValidator,
|
|
2138
|
+
Ie as ClubCreditLogValidator,
|
|
2139
|
+
Le as ClubGlobalConfigValidator,
|
|
2140
|
+
qe as ClubItemType,
|
|
2070
2141
|
J as ClubItemTypeValidator,
|
|
2071
|
-
|
|
2142
|
+
Pe as ClubPlayerValidator,
|
|
2072
2143
|
W as ClubProductValidator,
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2144
|
+
xe as ClubRedemptionStatus,
|
|
2145
|
+
Se as ClubRedemptionStatusValidator,
|
|
2146
|
+
De as ClubUserCreditValidator,
|
|
2147
|
+
Fe as ClubUserProfileValidator,
|
|
2148
|
+
kn as CommentEngagementValidator,
|
|
2149
|
+
v as CommentValidator,
|
|
2150
|
+
$r as CommunityApi,
|
|
2151
|
+
Ze as EngageAccountType,
|
|
2152
|
+
We as EngageAccountTypeValidator,
|
|
2153
|
+
Tn as EngageResponseValidator,
|
|
2154
|
+
Cn as EngageRewardValidator,
|
|
2155
|
+
Pr as EventApi,
|
|
2156
|
+
rn as EventConfigValidator,
|
|
2157
|
+
_t as EventFeatureConfigOfCashbackValidator,
|
|
2158
|
+
yt as EventFeatureConfigOfCheckInValidator,
|
|
2159
|
+
ht as EventFeatureConfigOfClaimActivationKeyValidator,
|
|
2160
|
+
kt as EventFeatureConfigOfClaimRewardsValidator,
|
|
2161
|
+
Ct as EventFeatureConfigOfCommentValidator,
|
|
2162
|
+
Vt as EventFeatureConfigOfFollowValidator,
|
|
2163
|
+
qt as EventFeatureConfigOfGiftCodeValidator,
|
|
2164
|
+
St as EventFeatureConfigOfInviteValidator,
|
|
2165
|
+
Pt as EventFeatureConfigOfInvitedRegisterValidator,
|
|
2166
|
+
It as EventFeatureConfigOfLotteryDrawValidator,
|
|
2167
|
+
Ft as EventFeatureConfigOfLotteryValidator,
|
|
2168
|
+
At as EventFeatureConfigOfPreregisterValidator,
|
|
2169
|
+
Ot as EventFeatureConfigOfQuestValidator,
|
|
2170
|
+
Mt as EventFeatureConfigOfRegisterValidator,
|
|
2171
|
+
Kt as EventFeatureConfigOfShareValidator,
|
|
2172
|
+
zt as EventFeatureConfigOfSubscribeValidator,
|
|
2173
|
+
Xt as EventFeatureConfigOfSurveyValidator,
|
|
2174
|
+
Zt as EventFeatureConfigOfTeamValidator,
|
|
2175
|
+
tn as EventFeatureConfigOfVoteValidator,
|
|
2176
|
+
nn as EventFeatureConfigValidator,
|
|
2177
|
+
et as EventPeriodType,
|
|
2178
|
+
tt as EventPeriodTypeValidator,
|
|
2108
2179
|
F as EventRewardItemConfigValidator,
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2180
|
+
Ne as ExtraGameRewardValidator,
|
|
2181
|
+
Ae as ExtraPhysicalShipmentValidator,
|
|
2182
|
+
gt as FeatureRewardValidator,
|
|
2112
2183
|
c as FeatureType,
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2184
|
+
nt as FeatureTypeValidator,
|
|
2185
|
+
On as ForumMode,
|
|
2186
|
+
Bn as ForumModeValidator,
|
|
2116
2187
|
ae as ForumValidator,
|
|
2117
|
-
|
|
2188
|
+
V as GamerItemType,
|
|
2118
2189
|
ee as GamerItemTypeValidator,
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2190
|
+
ve as Gender,
|
|
2191
|
+
Ce as GenderValidator,
|
|
2192
|
+
sn as GiftCodeEngagementDataValidator,
|
|
2193
|
+
cn as InviteEngagementDataValidator,
|
|
2194
|
+
lt as LotteryDrawAction,
|
|
2195
|
+
Sr as LotteryDrawActionValidator,
|
|
2196
|
+
dn as LotteryDrawEngagementDataValidator,
|
|
2197
|
+
un as LotteryEngagementDataValidator,
|
|
2198
|
+
k as LotteryTicketStatus,
|
|
2199
|
+
qr as LotteryTicketStatusValidator,
|
|
2200
|
+
f as NotificationBaseValidator,
|
|
2201
|
+
Qn as NotificationCategory,
|
|
2202
|
+
Er as NotificationCategoryValidator,
|
|
2203
|
+
Wn as NotificationCommentReplyValidator,
|
|
2204
|
+
er as NotificationCommentValidator,
|
|
2205
|
+
T as NotificationPayloadCommentValidator,
|
|
2135
2206
|
A as NotificationPayloadPostValidator,
|
|
2136
2207
|
N as NotificationPayloadReplyValidator,
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2208
|
+
Jn as NotificationPayloadSystemValidator,
|
|
2209
|
+
Zn as NotificationPostCommentValidator,
|
|
2210
|
+
Yn as NotificationPostValidator,
|
|
2211
|
+
tr as NotificationReplyRepliedValidator,
|
|
2212
|
+
nr as NotificationReplyValidator,
|
|
2213
|
+
Xn as NotificationSystemValidator,
|
|
2214
|
+
g as NotificationType,
|
|
2215
|
+
Kn as NotificationTypeValidator,
|
|
2216
|
+
rr as NotificationValidator,
|
|
2217
|
+
Ue as PlayerRoleCardValidator,
|
|
2147
2218
|
X as PlayerRoleValidator,
|
|
2148
|
-
|
|
2219
|
+
Mn as PostStatus,
|
|
2149
2220
|
oe as PostStatusValidator,
|
|
2150
2221
|
G as PostValidator,
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2222
|
+
gn as PreregisterEngagementDataValidator,
|
|
2223
|
+
zn as PresignedUrlResponseValidator,
|
|
2224
|
+
pn as QuestEngagementDataValidator,
|
|
2225
|
+
rt as QuestObjective,
|
|
2155
2226
|
ne as QuestObjectiveValidator,
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2227
|
+
Rr as RedeemParamsValidator,
|
|
2228
|
+
Oe as RedemptionValidator,
|
|
2229
|
+
dt as RegularRewardValidator,
|
|
2230
|
+
Hn as ReplyToValidator,
|
|
2231
|
+
j as ReplyValidator,
|
|
2232
|
+
jr as RewardItemType,
|
|
2162
2233
|
te as RewardItemTypeValidator,
|
|
2163
|
-
|
|
2234
|
+
at as RewardSource,
|
|
2164
2235
|
U as RewardSourceValidator,
|
|
2165
|
-
|
|
2236
|
+
_ as RewardStatus,
|
|
2166
2237
|
E as RewardStatusSuffix,
|
|
2167
2238
|
re as RewardStatusSuffixValidator,
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2239
|
+
Tr as RewardStatusValidator,
|
|
2240
|
+
vn as RewardValidator,
|
|
2241
|
+
$e as RoleBaseInfoValidator,
|
|
2242
|
+
Ee as ServerBaseInfoValidator,
|
|
2243
|
+
_n as ShareEngagementDataValidator,
|
|
2244
|
+
yn as SurveyEngagementDataValidator,
|
|
2245
|
+
ut as TeamAction,
|
|
2246
|
+
xr as TeamActionValidator,
|
|
2247
|
+
hn as TeamEngagementDataValidator,
|
|
2248
|
+
fn as TeamEngagementValidator,
|
|
2249
|
+
Lr as TeamMemberValidator,
|
|
2250
|
+
st as TeamVisibility,
|
|
2251
|
+
ct as TeamVisibilityValidator,
|
|
2181
2252
|
I as TopicValidator,
|
|
2182
2253
|
D as UserEngagementDataValidator,
|
|
2183
|
-
|
|
2184
|
-
|
|
2254
|
+
Rn as UserEngagementValidator,
|
|
2255
|
+
jn as UserFeatureStatusValidator,
|
|
2185
2256
|
ie as UserRewardValidator,
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2257
|
+
Vn as VerifyMobileResultValidator,
|
|
2258
|
+
wn as VoteEngagementDataValidator,
|
|
2259
|
+
it as VoteOptionSource,
|
|
2260
|
+
ot as VoteOptionSourceValidator,
|
|
2261
|
+
Ur as WeixinApi,
|
|
2262
|
+
bn as WeixinSubscribeEngagementDataValidator,
|
|
2263
|
+
hr as WeixinWebLoginErrorCode,
|
|
2264
|
+
fr as isWeixinSignResponse
|
|
2194
2265
|
};
|