@seayoo-web/gamer-api 2.2.2 → 2.3.1
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 +736 -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 +19 -19
- 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,21 @@ 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
|
|
1375
|
+
// 没有可领取的激活码
|
|
1351
1376
|
};
|
|
1352
1377
|
}
|
|
1353
1378
|
/**
|
|
@@ -1355,11 +1380,16 @@ class Lr {
|
|
|
1355
1380
|
*
|
|
1356
1381
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=lCGuqgvUDP
|
|
1357
1382
|
*/
|
|
1358
|
-
async claimRewards(t) {
|
|
1383
|
+
async claimRewards(t, n) {
|
|
1359
1384
|
await this.token.autoLogin();
|
|
1360
|
-
const { data:
|
|
1361
|
-
|
|
1362
|
-
|
|
1385
|
+
const { data: r, code: i } = await this.req.post(
|
|
1386
|
+
"event/claim-rewards",
|
|
1387
|
+
s(t),
|
|
1388
|
+
Fn,
|
|
1389
|
+
n
|
|
1390
|
+
), l = r == null ? void 0 : r.claimed_items;
|
|
1391
|
+
return l ? l.map((d) => (d.reward_status = d.reward_status === b.UnclaimedErr ? b.Unclaimed : d.reward_status, d)) : {
|
|
1392
|
+
error: i
|
|
1363
1393
|
};
|
|
1364
1394
|
}
|
|
1365
1395
|
/**
|
|
@@ -1367,15 +1397,16 @@ class Lr {
|
|
|
1367
1397
|
*
|
|
1368
1398
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=aQLhlOAB4Q
|
|
1369
1399
|
*/
|
|
1370
|
-
async claimWeixinHongbao(t) {
|
|
1400
|
+
async claimWeixinHongbao(t, n) {
|
|
1371
1401
|
await this.token.autoLogin();
|
|
1372
|
-
const { data:
|
|
1402
|
+
const { data: r, code: i } = await this.req.post(
|
|
1373
1403
|
"event/claim-weixin-hongbao",
|
|
1374
1404
|
{ reward_id: t },
|
|
1375
|
-
|
|
1405
|
+
Dn,
|
|
1406
|
+
n
|
|
1376
1407
|
);
|
|
1377
|
-
return
|
|
1378
|
-
error:
|
|
1408
|
+
return r ? (r.reward_status = r.reward_status === b.UnclaimedErr ? b.Unclaimed : r.reward_status, r) : {
|
|
1409
|
+
error: i
|
|
1379
1410
|
};
|
|
1380
1411
|
}
|
|
1381
1412
|
/**
|
|
@@ -1383,16 +1414,17 @@ class Lr {
|
|
|
1383
1414
|
*
|
|
1384
1415
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=qj12eIgYQG
|
|
1385
1416
|
*/
|
|
1386
|
-
async getUserRewards(t) {
|
|
1417
|
+
async getUserRewards(t, n) {
|
|
1387
1418
|
if (!await this.token.autoLogin()) return { user_rewards: [], next_token: "" };
|
|
1388
|
-
const { data:
|
|
1419
|
+
const { data: r } = await this.req.post(
|
|
1389
1420
|
"event/user-rewards",
|
|
1390
|
-
|
|
1391
|
-
|
|
1421
|
+
s({ max_results: 20, ...t, event_id: this.event }),
|
|
1422
|
+
In,
|
|
1423
|
+
n
|
|
1392
1424
|
);
|
|
1393
1425
|
return {
|
|
1394
|
-
user_rewards: ((
|
|
1395
|
-
next_token: (
|
|
1426
|
+
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)),
|
|
1427
|
+
next_token: (r == null ? void 0 : r.next_token) || ""
|
|
1396
1428
|
};
|
|
1397
1429
|
}
|
|
1398
1430
|
/**
|
|
@@ -1400,22 +1432,23 @@ class Lr {
|
|
|
1400
1432
|
*
|
|
1401
1433
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=mnGCTeTgMb
|
|
1402
1434
|
*/
|
|
1403
|
-
async getUserItemCount(t) {
|
|
1435
|
+
async getUserItemCount(t, n) {
|
|
1404
1436
|
if (!await this.token.autoLogin()) return null;
|
|
1405
|
-
const { data:
|
|
1437
|
+
const { data: r } = await this.req.get(`event/${this.event}/user-item-count`, S, {
|
|
1438
|
+
...n,
|
|
1406
1439
|
params: { item_id: t }
|
|
1407
1440
|
});
|
|
1408
|
-
return (
|
|
1441
|
+
return (r == null ? void 0 : r.count) ?? null;
|
|
1409
1442
|
}
|
|
1410
1443
|
/**
|
|
1411
1444
|
* 填写实物奖励收货地址
|
|
1412
1445
|
*
|
|
1413
1446
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=QIwGhnaexb
|
|
1414
1447
|
*/
|
|
1415
|
-
async submitUserRewardAddress(t) {
|
|
1448
|
+
async submitUserRewardAddress(t, n) {
|
|
1416
1449
|
if (!await this.token.autoLogin()) return null;
|
|
1417
|
-
const { ok:
|
|
1418
|
-
return
|
|
1450
|
+
const { ok: r } = await this.req.post(`event/${this.event}/user-reward-address`, t, null, n);
|
|
1451
|
+
return r;
|
|
1419
1452
|
}
|
|
1420
1453
|
/**
|
|
1421
1454
|
* 小程序码携带参数最多 32 个可见字符,若前端携带参数过长,则将参数保存在 api 中,并返回符合小程序码要求的 scene
|
|
@@ -1424,12 +1457,13 @@ class Lr {
|
|
|
1424
1457
|
*
|
|
1425
1458
|
* @param params - 前端扫描二维码打开小程序所需参数
|
|
1426
1459
|
*/
|
|
1427
|
-
async getUnlimitQrcodeScene(t) {
|
|
1460
|
+
async getUnlimitQrcodeScene(t, n) {
|
|
1428
1461
|
if (!await this.token.autoLogin()) return null;
|
|
1429
|
-
const { data:
|
|
1462
|
+
const { data: r } = await this.req.get("event/unlimit-qrcode-scene", Gn, {
|
|
1463
|
+
...n,
|
|
1430
1464
|
params: { params: t }
|
|
1431
1465
|
});
|
|
1432
|
-
return (
|
|
1466
|
+
return (r == null ? void 0 : r.scene) ?? null;
|
|
1433
1467
|
}
|
|
1434
1468
|
/**
|
|
1435
1469
|
* 根据小程序码携带 scene 值,获取对应的前端所需参数
|
|
@@ -1438,29 +1472,35 @@ class Lr {
|
|
|
1438
1472
|
*
|
|
1439
1473
|
* @param scene - 小程序码 scene 值
|
|
1440
1474
|
*/
|
|
1441
|
-
async getParamsByQrcodeScene(t) {
|
|
1442
|
-
const { data:
|
|
1475
|
+
async getParamsByQrcodeScene(t, n) {
|
|
1476
|
+
const { data: r } = await this.req.get("event/params-by-qrcode-scene", An, {
|
|
1477
|
+
...n,
|
|
1443
1478
|
params: { scene: t }
|
|
1444
1479
|
});
|
|
1445
|
-
return (
|
|
1480
|
+
return (r == null ? void 0 : r.params) ?? null;
|
|
1446
1481
|
}
|
|
1447
1482
|
/**
|
|
1448
1483
|
* 生成不限制的带参数的小程序码(dataURI 格式的小程序码图片)
|
|
1449
1484
|
*
|
|
1450
1485
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=Rvmoq8iIy0
|
|
1451
1486
|
*/
|
|
1452
|
-
async generateUnlimitQrcode(t) {
|
|
1487
|
+
async generateUnlimitQrcode(t, n) {
|
|
1453
1488
|
if (!await this.token.autoLogin()) return null;
|
|
1454
|
-
const { data:
|
|
1455
|
-
|
|
1489
|
+
const { data: r } = await this.req.post(
|
|
1490
|
+
"event/unlimit-qrcode",
|
|
1491
|
+
s(t),
|
|
1492
|
+
Nn,
|
|
1493
|
+
n
|
|
1494
|
+
);
|
|
1495
|
+
return (r == null ? void 0 : r.img) ?? null;
|
|
1456
1496
|
}
|
|
1457
1497
|
}
|
|
1458
|
-
const
|
|
1498
|
+
const On = {
|
|
1459
1499
|
/** 所有人均可以发帖 */
|
|
1460
1500
|
All: "all",
|
|
1461
1501
|
/** 指定用户可发帖 */
|
|
1462
1502
|
Limit: "limit"
|
|
1463
|
-
},
|
|
1503
|
+
}, Bn = e.string().enum(On).lock(), Mn = {
|
|
1464
1504
|
/** 待审核(仅自己可见) */
|
|
1465
1505
|
Pending: "pending",
|
|
1466
1506
|
/** 审核通过 */
|
|
@@ -1469,14 +1509,14 @@ const Nn = {
|
|
|
1469
1509
|
Failed: "failed",
|
|
1470
1510
|
/** 嫌疑(仅自己可见) */
|
|
1471
1511
|
Suspect: "suspect"
|
|
1472
|
-
}, oe = e.string().enum(
|
|
1512
|
+
}, oe = e.string().enum(Mn).lock(), Qn = {
|
|
1473
1513
|
/** 系统通知 */
|
|
1474
1514
|
System: "system",
|
|
1475
1515
|
/** 评论我的 */
|
|
1476
1516
|
Comment: "comment",
|
|
1477
1517
|
/** 点赞通知 */
|
|
1478
1518
|
Like: "like"
|
|
1479
|
-
},
|
|
1519
|
+
}, Er = e.string().enum(Qn).lock(), g = {
|
|
1480
1520
|
/** 系统通知 */
|
|
1481
1521
|
System: "system",
|
|
1482
1522
|
/** 帖子被置顶 */
|
|
@@ -1501,13 +1541,13 @@ const Nn = {
|
|
|
1501
1541
|
ReplyLiked: "reply_liked",
|
|
1502
1542
|
/** 回复被删除 */
|
|
1503
1543
|
ReplyDeleted: "reply_deleted"
|
|
1504
|
-
},
|
|
1544
|
+
}, Kn = e.string().enum(g).lock(), ae = e.object({
|
|
1505
1545
|
forum_id: e.number(),
|
|
1506
1546
|
icon_url: e.string(),
|
|
1507
1547
|
name: e.string(),
|
|
1508
1548
|
tags: e.array(e.string()),
|
|
1509
1549
|
sort: e.number(),
|
|
1510
|
-
mode:
|
|
1550
|
+
mode: Bn,
|
|
1511
1551
|
member_ids: e.array(e.number())
|
|
1512
1552
|
}).lock(), I = e.object({
|
|
1513
1553
|
topic_id: e.number(),
|
|
@@ -1538,13 +1578,13 @@ const Nn = {
|
|
|
1538
1578
|
create_time: e.number()
|
|
1539
1579
|
}).lock(), se = e.object({
|
|
1540
1580
|
err_msg: e.string().optional()
|
|
1541
|
-
}).lock(),
|
|
1581
|
+
}).lock(), Hn = e.object({
|
|
1542
1582
|
reply_id: e.number(),
|
|
1543
1583
|
reply_content: e.string().optional(),
|
|
1544
1584
|
replied_by: e.string(),
|
|
1545
1585
|
nickname: e.string(),
|
|
1546
1586
|
avatar_url: e.string()
|
|
1547
|
-
}).lock(),
|
|
1587
|
+
}).lock(), j = e.object({
|
|
1548
1588
|
reply_id: e.number(),
|
|
1549
1589
|
comment_id: e.number(),
|
|
1550
1590
|
comment_content: e.string().optional(),
|
|
@@ -1557,9 +1597,9 @@ const Nn = {
|
|
|
1557
1597
|
content: e.string(),
|
|
1558
1598
|
like_num: e.number(),
|
|
1559
1599
|
liked: e.bool(),
|
|
1560
|
-
reply_to:
|
|
1600
|
+
reply_to: Hn,
|
|
1561
1601
|
create_time: e.number()
|
|
1562
|
-
}).lock(),
|
|
1602
|
+
}).lock(), v = e.object({
|
|
1563
1603
|
comment_id: e.number(),
|
|
1564
1604
|
post_id: e.number(),
|
|
1565
1605
|
post_subject: e.string().optional(),
|
|
@@ -1578,20 +1618,20 @@ const Nn = {
|
|
|
1578
1618
|
image_url: e.string(),
|
|
1579
1619
|
create_time: e.number(),
|
|
1580
1620
|
status: oe,
|
|
1581
|
-
replies: e.array(
|
|
1582
|
-
}).lock(),
|
|
1621
|
+
replies: e.array(j).optional()
|
|
1622
|
+
}).lock(), zn = e.object({
|
|
1583
1623
|
image_url: e.string(),
|
|
1584
1624
|
upload_url: e.string(),
|
|
1585
1625
|
existed: e.bool()
|
|
1586
|
-
}).lock(),
|
|
1626
|
+
}).lock(), f = e.object({
|
|
1587
1627
|
notification_id: e.string(),
|
|
1588
|
-
notification_type:
|
|
1628
|
+
notification_type: Kn,
|
|
1589
1629
|
is_read: e.bool(),
|
|
1590
1630
|
create_time: e.number(),
|
|
1591
1631
|
origin_user_id: e.string(),
|
|
1592
1632
|
origin_user_name: e.string(),
|
|
1593
1633
|
origin_user_avatar_url: e.string()
|
|
1594
|
-
}).lock(),
|
|
1634
|
+
}).lock(), Jn = e.object({
|
|
1595
1635
|
system_message_subject: e.string(),
|
|
1596
1636
|
system_message_content: e.string()
|
|
1597
1637
|
}).lock(), A = e.object({
|
|
@@ -1599,87 +1639,87 @@ const Nn = {
|
|
|
1599
1639
|
post_subject: e.string(),
|
|
1600
1640
|
post_summary: e.string(),
|
|
1601
1641
|
post_image_url: e.string()
|
|
1602
|
-
}).lock(),
|
|
1642
|
+
}).lock(), T = e.object({
|
|
1603
1643
|
comment_id: e.number(),
|
|
1604
1644
|
comment_content: e.string()
|
|
1605
1645
|
}).lock(), N = e.object({
|
|
1606
1646
|
reply_id: e.number(),
|
|
1607
1647
|
reply_content: e.string()
|
|
1608
|
-
}).lock(),
|
|
1609
|
-
...
|
|
1610
|
-
...
|
|
1611
|
-
notification_type: e.string().enum(
|
|
1612
|
-
}),
|
|
1613
|
-
...
|
|
1648
|
+
}).lock(), Xn = e.object({
|
|
1649
|
+
...f.shape,
|
|
1650
|
+
...Jn.shape,
|
|
1651
|
+
notification_type: e.string().enum(g.System)
|
|
1652
|
+
}), Yn = e.object({
|
|
1653
|
+
...f.shape,
|
|
1614
1654
|
...A.shape,
|
|
1615
1655
|
notification_type: e.string().enum(
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1656
|
+
g.PostPinned,
|
|
1657
|
+
g.PostHighlighted,
|
|
1658
|
+
g.PostDeleted,
|
|
1659
|
+
g.PostLiked
|
|
1620
1660
|
)
|
|
1621
|
-
}), Yn = e.object({
|
|
1622
|
-
...y.shape,
|
|
1623
|
-
...A.shape,
|
|
1624
|
-
...j.shape,
|
|
1625
|
-
notification_type: e.string().enum(d.PostCommented)
|
|
1626
1661
|
}), 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,
|
|
1662
|
+
...f.shape,
|
|
1634
1663
|
...A.shape,
|
|
1635
|
-
|
|
1664
|
+
...T.shape,
|
|
1665
|
+
notification_type: e.string().enum(g.PostCommented)
|
|
1666
|
+
}), Wn = e.object({
|
|
1667
|
+
...f.shape,
|
|
1668
|
+
...T.shape,
|
|
1669
|
+
...N.shape,
|
|
1670
|
+
notification_type: e.string().enum(g.CommentReplied)
|
|
1636
1671
|
}), er = e.object({
|
|
1637
|
-
...
|
|
1672
|
+
...f.shape,
|
|
1673
|
+
...T.shape,
|
|
1674
|
+
...A.shape,
|
|
1675
|
+
notification_type: e.string().enum(g.CommentLiked, g.CommentDeleted)
|
|
1676
|
+
}), tr = e.object({
|
|
1677
|
+
...f.shape,
|
|
1638
1678
|
...N.shape,
|
|
1639
|
-
notification_type: e.string().enum(
|
|
1679
|
+
notification_type: e.string().enum(g.ReplyReplied),
|
|
1640
1680
|
comment_id: e.number(),
|
|
1641
1681
|
reply_to_reply_id: e.number(),
|
|
1642
1682
|
reply_to_reply_content: e.string()
|
|
1643
|
-
}),
|
|
1644
|
-
...
|
|
1683
|
+
}), nr = e.object({
|
|
1684
|
+
...f.shape,
|
|
1645
1685
|
...N.shape,
|
|
1646
|
-
...
|
|
1647
|
-
notification_type: e.string().enum(
|
|
1648
|
-
}),
|
|
1649
|
-
Jn,
|
|
1686
|
+
...T.shape,
|
|
1687
|
+
notification_type: e.string().enum(g.ReplyLiked, g.ReplyDeleted)
|
|
1688
|
+
}), rr = e.union(
|
|
1650
1689
|
Xn,
|
|
1651
1690
|
Yn,
|
|
1652
1691
|
Zn,
|
|
1653
1692
|
Wn,
|
|
1654
1693
|
er,
|
|
1655
|
-
tr
|
|
1656
|
-
|
|
1694
|
+
tr,
|
|
1695
|
+
nr
|
|
1696
|
+
).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
1697
|
posts: e.array(G),
|
|
1658
1698
|
next_token: e.string().optional()
|
|
1659
|
-
}),
|
|
1660
|
-
replies: e.array(
|
|
1699
|
+
}), cr = a({ post: G, antispam: se }), ur = a({
|
|
1700
|
+
replies: e.array(j),
|
|
1661
1701
|
next_token: e.string().optional()
|
|
1662
|
-
}),
|
|
1663
|
-
reply:
|
|
1702
|
+
}), lr = a({ reply: j }), mr = a({
|
|
1703
|
+
reply: j.clone().optional(),
|
|
1664
1704
|
antispam: se.clone().optional()
|
|
1665
|
-
}),
|
|
1666
|
-
comments: e.array(
|
|
1705
|
+
}), dr = a({ comment: v }), gr = a({
|
|
1706
|
+
comments: e.array(v),
|
|
1667
1707
|
next_token: e.string().optional()
|
|
1668
|
-
}),
|
|
1669
|
-
comment:
|
|
1670
|
-
antispam:
|
|
1671
|
-
}),
|
|
1672
|
-
notifications: e.array(
|
|
1708
|
+
}), pr = a({
|
|
1709
|
+
comment: v.clone().optional(),
|
|
1710
|
+
antispam: v.clone().optional()
|
|
1711
|
+
}), _r = e.guard(zn), br = a({
|
|
1712
|
+
notifications: e.array(rr),
|
|
1673
1713
|
next_token: e.string().optional()
|
|
1674
|
-
}),
|
|
1714
|
+
}), yr = a({
|
|
1675
1715
|
system: e.number(),
|
|
1676
1716
|
comment: e.number(),
|
|
1677
1717
|
like: e.number()
|
|
1678
1718
|
});
|
|
1679
|
-
class
|
|
1719
|
+
class $r {
|
|
1680
1720
|
constructor(t) {
|
|
1681
|
-
|
|
1682
|
-
|
|
1721
|
+
m(this, "token");
|
|
1722
|
+
m(this, "req");
|
|
1683
1723
|
this.token = t, this.req = t.req;
|
|
1684
1724
|
}
|
|
1685
1725
|
/**
|
|
@@ -1687,72 +1727,81 @@ class Er {
|
|
|
1687
1727
|
*
|
|
1688
1728
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=QaqUa2K0z0
|
|
1689
1729
|
*/
|
|
1690
|
-
async getForums() {
|
|
1691
|
-
const { data:
|
|
1692
|
-
return (
|
|
1730
|
+
async getForums(t) {
|
|
1731
|
+
const { data: n } = await this.req.get("community/forums", ir, t);
|
|
1732
|
+
return (n == null ? void 0 : n.forums) || [];
|
|
1693
1733
|
}
|
|
1694
1734
|
/**
|
|
1695
1735
|
* 获取社区话题列表,仅返回启用状态的话题
|
|
1696
1736
|
*
|
|
1697
1737
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=mIwpymAQom
|
|
1698
1738
|
*/
|
|
1699
|
-
async getTopics() {
|
|
1700
|
-
const { data:
|
|
1701
|
-
return (
|
|
1739
|
+
async getTopics(t) {
|
|
1740
|
+
const { data: n } = await this.req.get("community/topics", or, t);
|
|
1741
|
+
return (n == null ? void 0 : n.topics) || [];
|
|
1702
1742
|
}
|
|
1703
1743
|
/**
|
|
1704
1744
|
* 根据话题 ID 获取社区话题信息
|
|
1705
1745
|
*
|
|
1706
1746
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Jvw7xMK31K
|
|
1707
1747
|
*/
|
|
1708
|
-
async getTopic(t) {
|
|
1709
|
-
const { data:
|
|
1748
|
+
async getTopic(t, n) {
|
|
1749
|
+
const { data: r, code: i } = await this.req.get("community/topic", ar, {
|
|
1750
|
+
...n,
|
|
1710
1751
|
params: { topic_id: t }
|
|
1711
1752
|
});
|
|
1712
|
-
return (
|
|
1753
|
+
return (r == null ? void 0 : r.topic) ?? { error: i };
|
|
1713
1754
|
}
|
|
1714
1755
|
/**
|
|
1715
1756
|
* 获取社区帖子列表
|
|
1716
1757
|
*
|
|
1717
1758
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=XKI9lDVrPq
|
|
1718
1759
|
*/
|
|
1719
|
-
async getPosts(t) {
|
|
1720
|
-
const { data:
|
|
1721
|
-
|
|
1760
|
+
async getPosts(t, n) {
|
|
1761
|
+
const { data: r, code: i } = await this.req.get("community/posts", H, {
|
|
1762
|
+
...n,
|
|
1763
|
+
params: s(t)
|
|
1722
1764
|
});
|
|
1723
|
-
return
|
|
1765
|
+
return r ?? { error: i };
|
|
1724
1766
|
}
|
|
1725
1767
|
/**
|
|
1726
1768
|
* 获取社区置顶帖子列表
|
|
1727
1769
|
*
|
|
1728
1770
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=yXubbZuDlC
|
|
1729
1771
|
*/
|
|
1730
|
-
async getPinnedPosts(t, n, r) {
|
|
1731
|
-
const { data:
|
|
1732
|
-
|
|
1772
|
+
async getPinnedPosts(t, n, r, i) {
|
|
1773
|
+
const { data: l, code: d } = await this.req.get("community/pinned-posts", H, {
|
|
1774
|
+
...i,
|
|
1775
|
+
params: s({ forum_id: t, max_results: n, next_token: r })
|
|
1733
1776
|
});
|
|
1734
|
-
return
|
|
1777
|
+
return l ?? { error: d };
|
|
1735
1778
|
}
|
|
1736
1779
|
/**
|
|
1737
1780
|
* 根据帖子 id 获取帖子详情
|
|
1738
1781
|
*
|
|
1739
1782
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=hj1AZy5rcP
|
|
1740
1783
|
*/
|
|
1741
|
-
async getPost(t) {
|
|
1742
|
-
const { data:
|
|
1784
|
+
async getPost(t, n) {
|
|
1785
|
+
const { data: r, code: i } = await this.req.get("community/post", sr, {
|
|
1786
|
+
...n,
|
|
1743
1787
|
params: { post_id: t }
|
|
1744
1788
|
});
|
|
1745
|
-
return (
|
|
1789
|
+
return (r == null ? void 0 : r.post) ?? { error: i };
|
|
1746
1790
|
}
|
|
1747
1791
|
/**
|
|
1748
1792
|
* 发布帖子
|
|
1749
1793
|
*
|
|
1750
1794
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=M5okHBuaVk
|
|
1751
1795
|
*/
|
|
1752
|
-
async post(t) {
|
|
1753
|
-
const { data:
|
|
1754
|
-
|
|
1755
|
-
|
|
1796
|
+
async post(t, n) {
|
|
1797
|
+
const { data: r, code: i } = await this.req.post(
|
|
1798
|
+
"community/post",
|
|
1799
|
+
s(t),
|
|
1800
|
+
cr,
|
|
1801
|
+
n
|
|
1802
|
+
);
|
|
1803
|
+
return r ?? {
|
|
1804
|
+
error: i
|
|
1756
1805
|
};
|
|
1757
1806
|
}
|
|
1758
1807
|
/**
|
|
@@ -1760,33 +1809,40 @@ class Er {
|
|
|
1760
1809
|
*
|
|
1761
1810
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=djKbX7lFdp
|
|
1762
1811
|
*/
|
|
1763
|
-
async getComments(t) {
|
|
1764
|
-
const { data:
|
|
1765
|
-
|
|
1812
|
+
async getComments(t, n) {
|
|
1813
|
+
const { data: r, code: i } = await this.req.get("community/comments", gr, {
|
|
1814
|
+
...n,
|
|
1815
|
+
params: s(t)
|
|
1766
1816
|
});
|
|
1767
|
-
return
|
|
1817
|
+
return r ?? { error: i };
|
|
1768
1818
|
}
|
|
1769
1819
|
/**
|
|
1770
1820
|
* 根据评论 id 获取评论详情
|
|
1771
1821
|
*
|
|
1772
1822
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=RIc7oxVGae
|
|
1773
1823
|
*/
|
|
1774
|
-
async getComment(t) {
|
|
1775
|
-
const { data:
|
|
1824
|
+
async getComment(t, n) {
|
|
1825
|
+
const { data: r, code: i } = await this.req.get("community/comment", dr, {
|
|
1826
|
+
...n,
|
|
1776
1827
|
params: { comment_id: t }
|
|
1777
1828
|
});
|
|
1778
|
-
return (
|
|
1829
|
+
return (r == null ? void 0 : r.comment) ?? { error: i };
|
|
1779
1830
|
}
|
|
1780
1831
|
/**
|
|
1781
1832
|
* 帖子下发表评论
|
|
1782
1833
|
*
|
|
1783
1834
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Nv7lk0nTmr
|
|
1784
1835
|
*/
|
|
1785
|
-
async comment(t) {
|
|
1836
|
+
async comment(t, n) {
|
|
1786
1837
|
await this.token.autoLogin();
|
|
1787
|
-
const { data:
|
|
1788
|
-
|
|
1789
|
-
|
|
1838
|
+
const { data: r, code: i } = await this.req.post(
|
|
1839
|
+
"community/comment",
|
|
1840
|
+
s(t),
|
|
1841
|
+
pr,
|
|
1842
|
+
n
|
|
1843
|
+
);
|
|
1844
|
+
return r ?? {
|
|
1845
|
+
error: i
|
|
1790
1846
|
};
|
|
1791
1847
|
}
|
|
1792
1848
|
/**
|
|
@@ -1794,33 +1850,40 @@ class Er {
|
|
|
1794
1850
|
*
|
|
1795
1851
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=sVKBbY83MY
|
|
1796
1852
|
*/
|
|
1797
|
-
async getReplies(t) {
|
|
1798
|
-
const { data:
|
|
1799
|
-
|
|
1853
|
+
async getReplies(t, n) {
|
|
1854
|
+
const { data: r } = await this.req.get("community/replies", ur, {
|
|
1855
|
+
...n,
|
|
1856
|
+
params: s({ max_results: 20, ...t })
|
|
1800
1857
|
});
|
|
1801
|
-
return
|
|
1858
|
+
return r ?? { replies: [] };
|
|
1802
1859
|
}
|
|
1803
1860
|
/**
|
|
1804
1861
|
* 根据回复 id 获取回复详情
|
|
1805
1862
|
*
|
|
1806
1863
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=kxhcSXD3MG
|
|
1807
1864
|
*/
|
|
1808
|
-
async getReply(t) {
|
|
1809
|
-
const { data:
|
|
1865
|
+
async getReply(t, n) {
|
|
1866
|
+
const { data: r, code: i } = await this.req.get("community/reply", lr, {
|
|
1867
|
+
...n,
|
|
1810
1868
|
params: { reply_id: t }
|
|
1811
1869
|
});
|
|
1812
|
-
return (
|
|
1870
|
+
return (r == null ? void 0 : r.reply) ?? { error: i };
|
|
1813
1871
|
}
|
|
1814
1872
|
/**
|
|
1815
1873
|
* 回复帖子评论或回复
|
|
1816
1874
|
*
|
|
1817
1875
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=KA8WpTX2pg
|
|
1818
1876
|
*/
|
|
1819
|
-
async reply(t) {
|
|
1877
|
+
async reply(t, n) {
|
|
1820
1878
|
await this.token.autoLogin();
|
|
1821
|
-
const { data:
|
|
1822
|
-
|
|
1823
|
-
|
|
1879
|
+
const { data: r, code: i } = await this.req.post(
|
|
1880
|
+
"community/reply",
|
|
1881
|
+
s(t),
|
|
1882
|
+
mr,
|
|
1883
|
+
n
|
|
1884
|
+
);
|
|
1885
|
+
return r ?? {
|
|
1886
|
+
error: i
|
|
1824
1887
|
};
|
|
1825
1888
|
}
|
|
1826
1889
|
/**
|
|
@@ -1828,11 +1891,11 @@ class Er {
|
|
|
1828
1891
|
*
|
|
1829
1892
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=CR3m6PyXfZ
|
|
1830
1893
|
*/
|
|
1831
|
-
async like(t) {
|
|
1894
|
+
async like(t, n) {
|
|
1832
1895
|
await this.token.autoLogin();
|
|
1833
|
-
const { ok:
|
|
1834
|
-
return
|
|
1835
|
-
error:
|
|
1896
|
+
const { ok: r, code: i } = await this.req.post("community/like", { ...t, action: "like" }, null, n);
|
|
1897
|
+
return r || {
|
|
1898
|
+
error: i
|
|
1836
1899
|
};
|
|
1837
1900
|
}
|
|
1838
1901
|
/**
|
|
@@ -1840,11 +1903,11 @@ class Er {
|
|
|
1840
1903
|
*
|
|
1841
1904
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=CR3m6PyXfZ
|
|
1842
1905
|
*/
|
|
1843
|
-
async unlike(t) {
|
|
1906
|
+
async unlike(t, n) {
|
|
1844
1907
|
await this.token.autoLogin();
|
|
1845
|
-
const { ok:
|
|
1846
|
-
return
|
|
1847
|
-
error:
|
|
1908
|
+
const { ok: r, code: i } = await this.req.post("community/like", { ...t, action: "unlike" }, null, n);
|
|
1909
|
+
return r || {
|
|
1910
|
+
error: i
|
|
1848
1911
|
};
|
|
1849
1912
|
}
|
|
1850
1913
|
/**
|
|
@@ -1852,12 +1915,13 @@ class Er {
|
|
|
1852
1915
|
*
|
|
1853
1916
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=dWWhpoShxZ
|
|
1854
1917
|
*/
|
|
1855
|
-
async getMediaPresignedUrl(t) {
|
|
1918
|
+
async getMediaPresignedUrl(t, n) {
|
|
1856
1919
|
await this.token.autoLogin();
|
|
1857
|
-
const { data:
|
|
1920
|
+
const { data: r } = await this.req.get("community/media-presign-url", _r, {
|
|
1921
|
+
...n,
|
|
1858
1922
|
params: t
|
|
1859
1923
|
});
|
|
1860
|
-
return
|
|
1924
|
+
return r;
|
|
1861
1925
|
}
|
|
1862
1926
|
/**
|
|
1863
1927
|
* 获取用户社区通知
|
|
@@ -1866,45 +1930,50 @@ class Er {
|
|
|
1866
1930
|
*
|
|
1867
1931
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=W5lceDgbBG
|
|
1868
1932
|
*/
|
|
1869
|
-
async getNotifications(t) {
|
|
1933
|
+
async getNotifications(t, n) {
|
|
1870
1934
|
await this.token.autoLogin();
|
|
1871
|
-
const { data:
|
|
1872
|
-
|
|
1935
|
+
const { data: r } = await this.req.get("community/notifications", br, {
|
|
1936
|
+
...n,
|
|
1937
|
+
params: s({ max_results: 20, ...t })
|
|
1873
1938
|
});
|
|
1874
|
-
return
|
|
1939
|
+
return r || { notifications: [] };
|
|
1875
1940
|
}
|
|
1876
1941
|
/**
|
|
1877
1942
|
* 获取用户未读通知数量
|
|
1878
1943
|
*
|
|
1879
1944
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=CwIOMjAfMU
|
|
1880
1945
|
*/
|
|
1881
|
-
async getUnreadNotificationsCount() {
|
|
1946
|
+
async getUnreadNotificationsCount(t) {
|
|
1882
1947
|
if (!await this.token.autoLogin()) return null;
|
|
1883
|
-
const { data:
|
|
1884
|
-
|
|
1948
|
+
const { data: n } = await this.req.get(
|
|
1949
|
+
"community/unread-notifications-count",
|
|
1950
|
+
yr,
|
|
1951
|
+
t
|
|
1952
|
+
);
|
|
1953
|
+
return n;
|
|
1885
1954
|
}
|
|
1886
1955
|
/**
|
|
1887
1956
|
* 社区用户将通知标为已读
|
|
1888
1957
|
*
|
|
1889
1958
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=TCJQxnOjJe
|
|
1890
1959
|
*/
|
|
1891
|
-
async clearUnreadNotifications(t) {
|
|
1960
|
+
async clearUnreadNotifications(t, n) {
|
|
1892
1961
|
if (!await this.token.autoLogin()) return !1;
|
|
1893
|
-
const { ok:
|
|
1894
|
-
return
|
|
1962
|
+
const { ok: r } = await this.req.post("community/clear-unread-notifications", { category: t }, null, n);
|
|
1963
|
+
return r;
|
|
1895
1964
|
}
|
|
1896
1965
|
}
|
|
1897
|
-
const
|
|
1966
|
+
const fr = a({
|
|
1898
1967
|
nonce_str: e.string(),
|
|
1899
1968
|
timestamp: e.number(),
|
|
1900
1969
|
signature: e.string()
|
|
1901
1970
|
});
|
|
1902
|
-
var
|
|
1903
|
-
function L(
|
|
1904
|
-
return
|
|
1971
|
+
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 || {});
|
|
1972
|
+
function L(o) {
|
|
1973
|
+
return C(o, "open_id", "union_id", "weixin_token");
|
|
1905
1974
|
}
|
|
1906
1975
|
const z = "wx_login_cache";
|
|
1907
|
-
class
|
|
1976
|
+
class Ur {
|
|
1908
1977
|
/**
|
|
1909
1978
|
* 创建微信相关功能接口
|
|
1910
1979
|
*
|
|
@@ -1919,9 +1988,9 @@ class $r {
|
|
|
1919
1988
|
* https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html
|
|
1920
1989
|
*/
|
|
1921
1990
|
constructor(t, n) {
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1991
|
+
m(this, "token");
|
|
1992
|
+
m(this, "$appid");
|
|
1993
|
+
m(this, "req");
|
|
1925
1994
|
this.token = t, this.req = t.req, this.$appid = n, this.getLoginCache();
|
|
1926
1995
|
}
|
|
1927
1996
|
get appid() {
|
|
@@ -1938,7 +2007,7 @@ class $r {
|
|
|
1938
2007
|
const t = this.token.storage.get(z);
|
|
1939
2008
|
if (!t)
|
|
1940
2009
|
return null;
|
|
1941
|
-
const n =
|
|
2010
|
+
const n = be(t);
|
|
1942
2011
|
return L(n) ? (this.token.weixinToken = n.weixin_token, await this.token.autoLogin(), n) : null;
|
|
1943
2012
|
}
|
|
1944
2013
|
/**
|
|
@@ -1959,18 +2028,18 @@ class $r {
|
|
|
1959
2028
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=GwIZ0givCb
|
|
1960
2029
|
*/
|
|
1961
2030
|
async login() {
|
|
1962
|
-
if (!
|
|
2031
|
+
if (!y.wx)
|
|
1963
2032
|
throw new Error("当前环境非微信小程序");
|
|
1964
2033
|
const t = await this.getLoginCache();
|
|
1965
2034
|
if (t)
|
|
1966
2035
|
return t;
|
|
1967
|
-
const n = await
|
|
2036
|
+
const n = await he(), { data: r, code: i } = await this.req.post(
|
|
1968
2037
|
"weixin/login",
|
|
1969
2038
|
{ code: n, appid: this.appid },
|
|
1970
2039
|
L,
|
|
1971
2040
|
{ message: !1 }
|
|
1972
2041
|
);
|
|
1973
|
-
return r && (this.token.weixinToken = r.weixin_token, this.token.storage.set(z, JSON.stringify(r)), await this.token.autoLogin()), r ?? { error:
|
|
2042
|
+
return r && (this.token.weixinToken = r.weixin_token, this.token.storage.set(z, JSON.stringify(r)), await this.token.autoLogin()), r ?? { error: i };
|
|
1974
2043
|
}
|
|
1975
2044
|
/**
|
|
1976
2045
|
* 在微信内嵌网页中调用微信公众号授权登录【暂未启用】
|
|
@@ -1988,28 +2057,29 @@ class $r {
|
|
|
1988
2057
|
* - snsapi_base 不弹出授权页面,用户无感知,只能获取用户 openid,如果需要获取 union_id 则需要 snsapi_userinfo
|
|
1989
2058
|
* - snsapi_userinfo 【默认】弹出授权页面,可拿到 openid、union_id、昵称、头像等信息,但用户也可能会拒绝授权
|
|
1990
2059
|
*/
|
|
1991
|
-
async webLogin(t = "snsapi_userinfo") {
|
|
1992
|
-
const
|
|
1993
|
-
if (!
|
|
1994
|
-
const
|
|
2060
|
+
async webLogin(t = "snsapi_userinfo", n) {
|
|
2061
|
+
const r = P("code"), i = Date.now(), l = +P("state");
|
|
2062
|
+
if (!r || !l || l < i - 1e3 * 60 * 5 || l > i) {
|
|
2063
|
+
const ue = O(["code", "state"]);
|
|
1995
2064
|
location.replace(
|
|
1996
|
-
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(
|
|
2065
|
+
`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
2066
|
);
|
|
1998
2067
|
return;
|
|
1999
2068
|
}
|
|
2000
|
-
if (/^100\d{2}$/.test(
|
|
2001
|
-
return { error:
|
|
2002
|
-
const
|
|
2003
|
-
"replaceState" in history && history.replaceState({}, "",
|
|
2004
|
-
const { data:
|
|
2069
|
+
if (/^100\d{2}$/.test(r))
|
|
2070
|
+
return { error: r };
|
|
2071
|
+
const d = O(["code", "state"]);
|
|
2072
|
+
"replaceState" in history && history.replaceState({}, "", d);
|
|
2073
|
+
const { data: p, code: ce } = await this.req.post(
|
|
2005
2074
|
"weixin/login",
|
|
2006
2075
|
{
|
|
2007
|
-
code:
|
|
2076
|
+
code: r,
|
|
2008
2077
|
appid: this.appid
|
|
2009
2078
|
},
|
|
2010
|
-
L
|
|
2079
|
+
L,
|
|
2080
|
+
n
|
|
2011
2081
|
);
|
|
2012
|
-
return
|
|
2082
|
+
return p && (this.token.weixinToken = p.weixin_token, await this.token.autoLogin()), p ?? { error: ce };
|
|
2013
2083
|
}
|
|
2014
2084
|
/**
|
|
2015
2085
|
* 关联游戏账号,无返回值,全程静默
|
|
@@ -2023,8 +2093,9 @@ class $r {
|
|
|
2023
2093
|
* @param weixinToken 调用 login 后,得到的 weixinToken,如果 weixinToken 为空则跳过不处理
|
|
2024
2094
|
* @param gameCode 从游戏内跳转至小程序时,通过请求参数 query 携带的 game_code,如果值为空则跳过不处理
|
|
2025
2095
|
*/
|
|
2026
|
-
async linkPlayer(t, n) {
|
|
2096
|
+
async linkPlayer(t, n, r) {
|
|
2027
2097
|
!t || !n || await this.req.post("weixin/link-player", { weixin_token: t, game_code: n }, null, {
|
|
2098
|
+
...r,
|
|
2028
2099
|
message: !1
|
|
2029
2100
|
});
|
|
2030
2101
|
}
|
|
@@ -2033,162 +2104,163 @@ class $r {
|
|
|
2033
2104
|
*
|
|
2034
2105
|
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=CuWOqxr9Ue
|
|
2035
2106
|
*/
|
|
2036
|
-
async getJSSDKConfig() {
|
|
2037
|
-
const { data:
|
|
2107
|
+
async getJSSDKConfig(t) {
|
|
2108
|
+
const { data: n } = await this.req.get("weixin/offiaccount/jssdk-sign", fr, {
|
|
2109
|
+
...t,
|
|
2038
2110
|
params: {
|
|
2039
2111
|
appid: this.appid,
|
|
2040
2112
|
url: location.href.split("#")[0]
|
|
2041
2113
|
}
|
|
2042
2114
|
});
|
|
2043
|
-
return
|
|
2115
|
+
return n ? {
|
|
2044
2116
|
appid: this.appid,
|
|
2045
|
-
nonceStr:
|
|
2046
|
-
timestamp:
|
|
2047
|
-
signature:
|
|
2117
|
+
nonceStr: n.nonce_str,
|
|
2118
|
+
timestamp: n.timestamp,
|
|
2119
|
+
signature: n.signature
|
|
2048
2120
|
} : null;
|
|
2049
2121
|
}
|
|
2050
2122
|
}
|
|
2051
2123
|
export {
|
|
2052
2124
|
se as AntispamValidator,
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2125
|
+
Cr as AuthToken,
|
|
2126
|
+
on as CashbackEngagementDataValidator,
|
|
2127
|
+
an as ClaimActivationKeyEngagementDataValidator,
|
|
2128
|
+
b as ClaimRewardStatus,
|
|
2057
2129
|
$ as ClaimRewardStatusValidator,
|
|
2058
|
-
|
|
2130
|
+
qn as ClaimedItemValidator,
|
|
2059
2131
|
Y as ClubAddressValidator,
|
|
2060
|
-
|
|
2132
|
+
Vr as ClubApi,
|
|
2061
2133
|
Z as ClubBenefitSummaryValidator,
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2134
|
+
Ge as ClubBenefitValidator,
|
|
2135
|
+
je as ClubCreditChangeScene,
|
|
2136
|
+
Te as ClubCreditChangeSceneValidator,
|
|
2137
|
+
Re as ClubCreditChangeType,
|
|
2138
|
+
Ve as ClubCreditChangeTypeValidator,
|
|
2139
|
+
Ie as ClubCreditLogValidator,
|
|
2140
|
+
Le as ClubGlobalConfigValidator,
|
|
2141
|
+
qe as ClubItemType,
|
|
2070
2142
|
J as ClubItemTypeValidator,
|
|
2071
|
-
|
|
2143
|
+
Pe as ClubPlayerValidator,
|
|
2072
2144
|
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
|
-
|
|
2145
|
+
xe as ClubRedemptionStatus,
|
|
2146
|
+
Se as ClubRedemptionStatusValidator,
|
|
2147
|
+
De as ClubUserCreditValidator,
|
|
2148
|
+
Fe as ClubUserProfileValidator,
|
|
2149
|
+
kn as CommentEngagementValidator,
|
|
2150
|
+
v as CommentValidator,
|
|
2151
|
+
$r as CommunityApi,
|
|
2152
|
+
Ze as EngageAccountType,
|
|
2153
|
+
We as EngageAccountTypeValidator,
|
|
2154
|
+
Tn as EngageResponseValidator,
|
|
2155
|
+
Cn as EngageRewardValidator,
|
|
2156
|
+
Pr as EventApi,
|
|
2157
|
+
rn as EventConfigValidator,
|
|
2158
|
+
_t as EventFeatureConfigOfCashbackValidator,
|
|
2159
|
+
yt as EventFeatureConfigOfCheckInValidator,
|
|
2160
|
+
ht as EventFeatureConfigOfClaimActivationKeyValidator,
|
|
2161
|
+
kt as EventFeatureConfigOfClaimRewardsValidator,
|
|
2162
|
+
Ct as EventFeatureConfigOfCommentValidator,
|
|
2163
|
+
Vt as EventFeatureConfigOfFollowValidator,
|
|
2164
|
+
qt as EventFeatureConfigOfGiftCodeValidator,
|
|
2165
|
+
St as EventFeatureConfigOfInviteValidator,
|
|
2166
|
+
Pt as EventFeatureConfigOfInvitedRegisterValidator,
|
|
2167
|
+
It as EventFeatureConfigOfLotteryDrawValidator,
|
|
2168
|
+
Ft as EventFeatureConfigOfLotteryValidator,
|
|
2169
|
+
At as EventFeatureConfigOfPreregisterValidator,
|
|
2170
|
+
Ot as EventFeatureConfigOfQuestValidator,
|
|
2171
|
+
Mt as EventFeatureConfigOfRegisterValidator,
|
|
2172
|
+
Kt as EventFeatureConfigOfShareValidator,
|
|
2173
|
+
zt as EventFeatureConfigOfSubscribeValidator,
|
|
2174
|
+
Xt as EventFeatureConfigOfSurveyValidator,
|
|
2175
|
+
Zt as EventFeatureConfigOfTeamValidator,
|
|
2176
|
+
tn as EventFeatureConfigOfVoteValidator,
|
|
2177
|
+
nn as EventFeatureConfigValidator,
|
|
2178
|
+
et as EventPeriodType,
|
|
2179
|
+
tt as EventPeriodTypeValidator,
|
|
2108
2180
|
F as EventRewardItemConfigValidator,
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2181
|
+
Ne as ExtraGameRewardValidator,
|
|
2182
|
+
Ae as ExtraPhysicalShipmentValidator,
|
|
2183
|
+
gt as FeatureRewardValidator,
|
|
2112
2184
|
c as FeatureType,
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2185
|
+
nt as FeatureTypeValidator,
|
|
2186
|
+
On as ForumMode,
|
|
2187
|
+
Bn as ForumModeValidator,
|
|
2116
2188
|
ae as ForumValidator,
|
|
2117
|
-
|
|
2189
|
+
V as GamerItemType,
|
|
2118
2190
|
ee as GamerItemTypeValidator,
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2191
|
+
ve as Gender,
|
|
2192
|
+
Ce as GenderValidator,
|
|
2193
|
+
sn as GiftCodeEngagementDataValidator,
|
|
2194
|
+
cn as InviteEngagementDataValidator,
|
|
2195
|
+
lt as LotteryDrawAction,
|
|
2196
|
+
Sr as LotteryDrawActionValidator,
|
|
2197
|
+
dn as LotteryDrawEngagementDataValidator,
|
|
2198
|
+
un as LotteryEngagementDataValidator,
|
|
2199
|
+
k as LotteryTicketStatus,
|
|
2200
|
+
qr as LotteryTicketStatusValidator,
|
|
2201
|
+
f as NotificationBaseValidator,
|
|
2202
|
+
Qn as NotificationCategory,
|
|
2203
|
+
Er as NotificationCategoryValidator,
|
|
2204
|
+
Wn as NotificationCommentReplyValidator,
|
|
2205
|
+
er as NotificationCommentValidator,
|
|
2206
|
+
T as NotificationPayloadCommentValidator,
|
|
2135
2207
|
A as NotificationPayloadPostValidator,
|
|
2136
2208
|
N as NotificationPayloadReplyValidator,
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2209
|
+
Jn as NotificationPayloadSystemValidator,
|
|
2210
|
+
Zn as NotificationPostCommentValidator,
|
|
2211
|
+
Yn as NotificationPostValidator,
|
|
2212
|
+
tr as NotificationReplyRepliedValidator,
|
|
2213
|
+
nr as NotificationReplyValidator,
|
|
2214
|
+
Xn as NotificationSystemValidator,
|
|
2215
|
+
g as NotificationType,
|
|
2216
|
+
Kn as NotificationTypeValidator,
|
|
2217
|
+
rr as NotificationValidator,
|
|
2218
|
+
Ue as PlayerRoleCardValidator,
|
|
2147
2219
|
X as PlayerRoleValidator,
|
|
2148
|
-
|
|
2220
|
+
Mn as PostStatus,
|
|
2149
2221
|
oe as PostStatusValidator,
|
|
2150
2222
|
G as PostValidator,
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2223
|
+
gn as PreregisterEngagementDataValidator,
|
|
2224
|
+
zn as PresignedUrlResponseValidator,
|
|
2225
|
+
pn as QuestEngagementDataValidator,
|
|
2226
|
+
rt as QuestObjective,
|
|
2155
2227
|
ne as QuestObjectiveValidator,
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2228
|
+
Rr as RedeemParamsValidator,
|
|
2229
|
+
Oe as RedemptionValidator,
|
|
2230
|
+
dt as RegularRewardValidator,
|
|
2231
|
+
Hn as ReplyToValidator,
|
|
2232
|
+
j as ReplyValidator,
|
|
2233
|
+
jr as RewardItemType,
|
|
2162
2234
|
te as RewardItemTypeValidator,
|
|
2163
|
-
|
|
2235
|
+
at as RewardSource,
|
|
2164
2236
|
U as RewardSourceValidator,
|
|
2165
|
-
|
|
2237
|
+
_ as RewardStatus,
|
|
2166
2238
|
E as RewardStatusSuffix,
|
|
2167
2239
|
re as RewardStatusSuffixValidator,
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2240
|
+
Tr as RewardStatusValidator,
|
|
2241
|
+
vn as RewardValidator,
|
|
2242
|
+
$e as RoleBaseInfoValidator,
|
|
2243
|
+
Ee as ServerBaseInfoValidator,
|
|
2244
|
+
_n as ShareEngagementDataValidator,
|
|
2245
|
+
yn as SurveyEngagementDataValidator,
|
|
2246
|
+
ut as TeamAction,
|
|
2247
|
+
xr as TeamActionValidator,
|
|
2248
|
+
hn as TeamEngagementDataValidator,
|
|
2249
|
+
fn as TeamEngagementValidator,
|
|
2250
|
+
Lr as TeamMemberValidator,
|
|
2251
|
+
st as TeamVisibility,
|
|
2252
|
+
ct as TeamVisibilityValidator,
|
|
2181
2253
|
I as TopicValidator,
|
|
2182
2254
|
D as UserEngagementDataValidator,
|
|
2183
|
-
|
|
2184
|
-
|
|
2255
|
+
Rn as UserEngagementValidator,
|
|
2256
|
+
jn as UserFeatureStatusValidator,
|
|
2185
2257
|
ie as UserRewardValidator,
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2258
|
+
Vn as VerifyMobileResultValidator,
|
|
2259
|
+
wn as VoteEngagementDataValidator,
|
|
2260
|
+
it as VoteOptionSource,
|
|
2261
|
+
ot as VoteOptionSourceValidator,
|
|
2262
|
+
Ur as WeixinApi,
|
|
2263
|
+
bn as WeixinSubscribeEngagementDataValidator,
|
|
2264
|
+
hr as WeixinWebLoginErrorCode,
|
|
2265
|
+
fr as isWeixinSignResponse
|
|
2194
2266
|
};
|