@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.
Files changed (64) hide show
  1. package/dist/index.js +735 -664
  2. package/package.json +6 -6
  3. package/types/src/club.d.ts +21 -21
  4. package/types/src/community.d.ts +20 -20
  5. package/types/src/event.config/feature.lottery.d.ts +1 -1
  6. package/types/src/event.config/reward.d.ts +1 -1
  7. package/types/src/event.d.ts +18 -18
  8. package/types/src/event.engage/index.d.ts +2 -2
  9. package/types/src/weixin.d.ts +4 -4
  10. package/types/index.d.ts +0 -5
  11. package/types/src/club.define.d.ts +0 -371
  12. package/types/src/club.enums.d.ts +0 -104
  13. package/types/src/club.guards.d.ts +0 -33
  14. package/types/src/community.define.d.ts +0 -331
  15. package/types/src/community.enums.d.ts +0 -99
  16. package/types/src/community.guards.d.ts +0 -52
  17. package/types/src/event.config/feature.base.d.ts +0 -23
  18. package/types/src/event.config/feature.cashback.d.ts +0 -18
  19. package/types/src/event.config/feature.checkIn.d.ts +0 -7
  20. package/types/src/event.config/feature.claimActivationKey.d.ts +0 -7
  21. package/types/src/event.config/feature.claimRewards.d.ts +0 -7
  22. package/types/src/event.config/feature.comment.d.ts +0 -14
  23. package/types/src/event.config/feature.d.ts +0 -40
  24. package/types/src/event.config/feature.follow.d.ts +0 -24
  25. package/types/src/event.config/feature.giftcode.d.ts +0 -24
  26. package/types/src/event.config/feature.invite.d.ts +0 -12
  27. package/types/src/event.config/feature.invitedRegister.d.ts +0 -7
  28. package/types/src/event.config/feature.lotteryDraw.d.ts +0 -14
  29. package/types/src/event.config/feature.preregister.d.ts +0 -7
  30. package/types/src/event.config/feature.quest.d.ts +0 -31
  31. package/types/src/event.config/feature.register.d.ts +0 -7
  32. package/types/src/event.config/feature.share.d.ts +0 -16
  33. package/types/src/event.config/feature.subscribe.d.ts +0 -12
  34. package/types/src/event.config/feature.survey.d.ts +0 -14
  35. package/types/src/event.config/feature.team.d.ts +0 -14
  36. package/types/src/event.config/feature.vote.d.ts +0 -44
  37. package/types/src/event.config/index.d.ts +0 -23
  38. package/types/src/event.config.d.ts +0 -228
  39. package/types/src/event.define.d.ts +0 -48
  40. package/types/src/event.engage/engage.cashback.d.ts +0 -9
  41. package/types/src/event.engage/engage.claimActivationKey.d.ts +0 -5
  42. package/types/src/event.engage/engage.comment.d.ts +0 -22
  43. package/types/src/event.engage/engage.d.ts +0 -49
  44. package/types/src/event.engage/engage.giftcode.d.ts +0 -5
  45. package/types/src/event.engage/engage.invite.d.ts +0 -9
  46. package/types/src/event.engage/engage.lottery.d.ts +0 -9
  47. package/types/src/event.engage/engage.lotteryDraw.d.ts +0 -40
  48. package/types/src/event.engage/engage.lotteryDraw.reward.d.ts +0 -38
  49. package/types/src/event.engage/engage.preregister.d.ts +0 -11
  50. package/types/src/event.engage/engage.quest.d.ts +0 -28
  51. package/types/src/event.engage/engage.share.d.ts +0 -9
  52. package/types/src/event.engage/engage.subscribe.d.ts +0 -14
  53. package/types/src/event.engage/engage.survey.d.ts +0 -7
  54. package/types/src/event.engage/engage.team.d.ts +0 -53
  55. package/types/src/event.engage/engage.vote.d.ts +0 -9
  56. package/types/src/event.engage/reward.d.ts +0 -52
  57. package/types/src/event.enums.d.ts +0 -392
  58. package/types/src/event.guards.d.ts +0 -38
  59. package/types/src/token.d.ts +0 -93
  60. package/types/src/token.define.d.ts +0 -31
  61. package/types/src/token.guards.d.ts +0 -5
  62. package/types/src/utils.d.ts +0 -12
  63. package/types/src/weixin.define.d.ts +0 -46
  64. package/types/src/weixin.guards.d.ts +0 -2
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
- var ue = Object.defineProperty;
2
- var le = (i, t, n) => t in i ? ue(i, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[t] = n;
3
- var l = (i, t, n) => le(i, typeof t != "symbol" ? t + "" : t, n);
4
- import { isComboWebView as me } from "@seayoo-web/combo-webview";
5
- import { isPlainObject as v, useConsole as de, Support as b, usePromise as ge, pruneURL as pe, queryString as P, pruneObject as a, v as e, omitFields as C, typedObjectGuard as o, parseJSON as _e, removePara as O } from "@seayoo-web/utils";
6
- function be(i) {
7
- return v(i, "gamer_token") && typeof i.gamer_token == "string";
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(i) {
10
- return v(i);
9
+ function B(o) {
10
+ return C(o);
11
11
  }
12
- const f = de("GamerApiSDK");
13
- function ye(i) {
14
- return /^\/[a-z\d-]+$/.test(i);
12
+ const h = ge("GamerApiSDK");
13
+ function fe(o) {
14
+ return /^\/[a-z\d-]+$/.test(o);
15
15
  }
16
- async function fe() {
17
- const { promise: i, resolve: t } = ge();
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 i;
25
+ }), await o;
26
26
  }
27
- const he = {
28
- get(i) {
29
- return localStorage.getItem(i) || "";
27
+ const we = {
28
+ get(o) {
29
+ return localStorage.getItem(o) || "";
30
30
  },
31
- set(i, t) {
32
- localStorage.setItem(i, t);
31
+ set(o, t) {
32
+ localStorage.setItem(o, t);
33
33
  },
34
- remove(i) {
35
- localStorage.removeItem(i);
34
+ remove(o) {
35
+ localStorage.removeItem(o);
36
36
  }
37
- }, we = {
38
- get(i) {
37
+ }, ke = {
38
+ get(o) {
39
39
  try {
40
- if (b.wx) return wx.getStorageSync(i) || "";
40
+ if (y.wx) return wx.getStorageSync(o) || "";
41
41
  } catch (t) {
42
- f.error("getStorageSyncError", t);
42
+ h.error("getStorageSyncError", t);
43
43
  }
44
44
  return "";
45
45
  },
46
- set(i, t) {
46
+ set(o, t) {
47
47
  try {
48
- b.wx && wx.setStorageSync(i, t);
48
+ y.wx && wx.setStorageSync(o, t);
49
49
  } catch (n) {
50
- f.error("setStorageSyncError", n);
50
+ h.error("setStorageSyncError", n);
51
51
  }
52
52
  },
53
- remove(i) {
53
+ remove(o) {
54
54
  try {
55
- b.wx && wx.removeStorageSync(i);
55
+ y.wx && wx.removeStorageSync(o);
56
56
  } catch (t) {
57
- f.error("removeStorageSync", t);
57
+ h.error("removeStorageSync", t);
58
58
  }
59
59
  }
60
- }, h = "gamer_token";
61
- class vr {
60
+ }, w = "gamer_token";
61
+ class Cr {
62
62
  constructor(t, n) {
63
- l(this, "$NetRequest");
64
- l(this, "$idToken", "");
65
- l(this, "$weixinToken", "");
66
- l(this, "$gamerToken", "");
67
- l(this, "req");
68
- l(this, "storage");
69
- this.storage = b.wx ? we : he;
70
- const r = ye(t) ? t : `https://${pe(t)}`;
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: g, status: T }) {
77
- return g === "GET" && T < 0;
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: (g) => {
89
- this.$gamerToken && (g.headers.Authorization = `Bearer ${this.$gamerToken}`);
88
+ requestTransformer: (d) => {
89
+ this.$gamerToken && (d.headers.Authorization = `Bearer ${this.$gamerToken}`);
90
90
  }
91
91
  });
92
- const s = /^(?:localhost|[\d.]+):\d{4}$/.test(location.host), m = P("gamer_token");
93
- (me() || s && m) && (this.$gamerToken = m), this.$gamerToken || this.loadGamerTokenCache();
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(h).match(/^(\d{12,})#(.{8,})$/);
99
+ const n = this.storage.get(w).match(/^(\d{12,})#(.{8,})$/);
100
100
  if (n) {
101
- const r = parseInt(n[1]), s = n[2];
101
+ const r = parseInt(n[1]), i = n[2];
102
102
  if (r > Date.now() - (24 * 3600 - 10) * 1e3) {
103
- this.$gamerToken = s;
103
+ this.$gamerToken = i;
104
104
  return;
105
105
  }
106
106
  }
107
- this.storage.remove(h);
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(h, `${Date.now()}#${t}`) : this.storage.remove(h);
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 f.error("Missing idToken when call autoLogin()"), !1;
170
- if (b.wx && !this.weixinToken)
171
- return f.error("Missing weixinToken when call autoLogin()"), !1;
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
- a({ id_token: this.idToken, weixin_token: b.wx ? this.weixinToken : null }),
175
- be,
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", a(t), B);
209
+ const { data: n } = await this.req.post("auth-real-name", s(t), B);
210
210
  return n;
211
211
  }
212
212
  }
213
- const ke = {
213
+ const ve = {
214
214
  /** 未知 */
215
215
  Unknown: "unknown",
216
216
  /** 男 */
217
217
  Male: "male",
218
218
  /** 女 */
219
219
  Female: "female"
220
- }, ve = e.string().enum(ke).lock(), Ce = {
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
- }, Re = e.string().enum(Ce).lock(), Ve = {
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
- }, je = e.string().enum(Ve).lock(), Te = {
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(Te).lock(), qe = {
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
- }, xe = e.string().enum(qe).lock(), Se = e.object({
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(), Le = e.object({
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(), Pe = e.object({
281
+ }).lock(), Ee = e.object({
282
282
  server_id: e.string(),
283
283
  server_name: e.string()
284
- }).lock(), Ee = e.object({
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(), $e = e.object({
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(), Ue = e.object({
302
+ }).lock(), Fe = e.object({
303
303
  name: e.string(),
304
304
  avatar_url: e.string(),
305
305
  bio: e.string(),
306
- gender: ve,
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(), Fe = e.object({
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(), De = e.object({
322
+ }).lock(), Ie = e.object({
323
323
  id: e.number(),
324
- change_type: Re,
325
- change_scene: je,
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(), Ie = e.object({
365
- ...C(Z.shape, "tag"),
364
+ }).lock(), Ge = e.object({
365
+ ...R(Z.shape, "tag"),
366
366
  product: W.clone().optional()
367
- }).lock(), Cr = e.union(
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(), Ge = e.object({
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(), Ae = e.object({
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(), Ne = e.object({
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: xe,
399
+ status: Se,
400
400
  created_at: e.number(),
401
- extra_data: e.union(Ge.clone(), Ae.clone()).satisfies().optional()
402
- }), Oe = e.guard(Se), M = o({ player: Le }), Be = o({ roles: e.array(X) }), q = o({ role_card: $e }), Q = e.guard(Ue), K = e.guard(Y), Me = o({ addresses: e.array(Y) }), Qe = e.guard(Fe), Ke = o({
403
- credit_logs: e.array(De),
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
- }), He = o({ products: e.array(W) }), ze = o({ benefits: e.array(Z) }), Je = o({ benefit: Ie }), Xe = o({
406
- redemptions: e.array(Ne),
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 Rr {
409
+ class Vr {
410
410
  constructor(t) {
411
- l(this, "token");
412
- l(this, "req");
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: t } = await this.req.get("club/config", Oe);
422
- return t;
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: t, code: n } = await this.req.get("club/current-player", M);
432
- return (t == null ? void 0 : t.player) ?? { error: n };
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: t, code: n } = await this.req.post(
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 (t == null ? void 0 : t.player) ?? {
449
- error: n
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: r } = await this.req.get("club/roles", Be, {
460
- params: a({ player_id: t, refresh: n })
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 (r == null ? void 0 : r.roles) || [];
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: n } = await this.req.get("club/role-card", q, {
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 (n == null ? void 0 : n.role_card) ?? null;
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: n } = await this.req.post("club/role-card", t, q);
483
- return (n == null ? void 0 : n.role_card) ?? null;
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: t } = await this.req.post("club/refresh-role-card", {}, q);
493
- return (t == null ? void 0 : t.role_card) ?? null;
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: n } = await this.req.get("club/user-profile", Q, {
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 n;
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: n, code: r } = await this.req.post("club/user-profile", t, Q);
514
- return n ?? {
515
- error: r
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: t } = await this.req.get("club/addresses", Me);
526
- return (t == null ? void 0 : t.addresses) ?? [];
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: n } = await this.req.post("/club/add-address", a(t), K);
536
- return n;
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: n, code: r } = await this.req.post("club/update-address", a(t), K);
546
- return n ?? { error: r };
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: n } = await this.req.post("club/delete-address", { address_id: t });
556
- return n;
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: n, code: r } = await this.req.get("club/user-credit", Qe, { params: a(t) });
566
- return n ?? { error: r };
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: n } = await this.req.get("club/credit-logs", Ke, {
576
- params: a({ max_results: 20, ...t })
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: (n == null ? void 0 : n.credit_logs) || [], next_token: n == null ? void 0 : n.next_token };
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: t } = await this.req.get("club/benefits", ze);
588
- return (t == null ? void 0 : t.benefits) || [];
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: n } = await this.req.get("club/benefit", Je, {
610
+ const { data: r } = await this.req.get("club/benefit", Xe, {
611
+ ...n,
598
612
  params: { benefit_id: t }
599
613
  });
600
- return (n == null ? void 0 : n.benefit) || null;
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: n } = await this.req.get("club/products", He, {
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 (n == null ? void 0 : n.products) || [];
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: n, code: r } = await this.req.post("club/redeem-product", a(t));
621
- return n || {
622
- error: r
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: n } = await this.req.get("club/redemptions", Xe, {
633
- params: a({ max_results: 20, ...t })
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: (n == null ? void 0 : n.redemptions) || [], next_token: n == null ? void 0 : n.next_token };
651
+ return { redemptions: (r == null ? void 0 : r.redemptions) || [], next_token: r == null ? void 0 : r.next_token };
636
652
  }
637
653
  }
638
- const R = {
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(R).lock(), Vr = R, te = ee, Ye = {
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
- }, Ze = e.string().enum(Ye).lock(), We = {
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
- }, et = e.string().enum(We).lock(), c = {
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
- }, tt = e.string().enum(c).lock(), nt = {
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(nt).lock(), rt = {
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
- }, it = e.string().enum(rt).lock(), p = {
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
- }, jr = e.string().enum(p).lock(), E = {
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: p.Unclaimed,
763
+ Unclaimed: _.Unclaimed,
748
764
  /** 奖励已领取 */
749
- Received: p.Received,
765
+ Received: _.Received,
750
766
  /** 奖励发放失败 */
751
- Failed: p.Failed,
767
+ Failed: _.Failed,
752
768
  /** 奖励已发货 */
753
- Delivered: p.Delivered
754
- }, re = e.string().enum(E).lock(), _ = {
769
+ Delivered: _.Delivered
770
+ }, re = e.string().enum(E).lock(), b = {
755
771
  /** 未获得奖励 */
756
- Ineligible: p.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: p.Unclaimed,
780
+ Unclaimed: _.Unclaimed,
765
781
  /** 奖励已领取 */
766
- Received: p.Received,
782
+ Received: _.Received,
767
783
  /** 奖励发放失败 */
768
- Failed: p.Failed,
784
+ Failed: _.Failed,
769
785
  /** 奖励已发货 */
770
- Delivered: p.Delivered
771
- }, $ = e.string().enum(_).lock(), ot = {
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(ot).lock(), at = {
792
+ }, U = e.string().enum(at).lock(), st = {
777
793
  /** 私有队伍 */
778
794
  Private: "private",
779
795
  /** 公开队伍 */
780
796
  Public: "public"
781
- }, st = e.string().enum(at).lock(), w = {
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
- }, Tr = e.string().enum(w).lock(), ct = {
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
- }, qr = e.string().enum(ct).lock(), ut = {
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
- }, xr = e.string().enum(ut).lock(), lt = e.string().enum(C(R, "GiftCode", "LotteryTicket")), F = e.object({
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: lt,
832
+ reward_item_type: mt,
817
833
  reward_item_rating: e.number()
818
- }).lock(), mt = e.object({
834
+ }).lock(), dt = e.object({
819
835
  engage_count: e.number(),
820
836
  rewards: e.array(F)
821
- }).lock(), dt = e.union(
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(mt)
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: et,
850
+ cycle: tt,
835
851
  limit: e.number(),
836
852
  since: e.number(),
837
853
  until: e.number(),
838
- engage_account: Ze,
839
- feature_rewards: dt.clone().optional()
840
- }), gt = c.Cashback, pt = e.object({
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(gt),
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
- }), _t = c.CheckIn, bt = e.object({
865
+ }), bt = c.CheckIn, yt = e.object({
850
866
  ...u.shape,
851
- feature_type: e.string().enum(_t)
852
- }), yt = c.ClaimActivationKey, ft = e.object({
867
+ feature_type: e.string().enum(bt)
868
+ }), ft = c.ClaimActivationKey, ht = e.object({
853
869
  ...u.shape,
854
- feature_type: e.string().enum(yt)
855
- }), ht = c.ClaimRewards, wt = e.object({
870
+ feature_type: e.string().enum(ft)
871
+ }), wt = c.ClaimRewards, kt = e.object({
856
872
  ...u.shape,
857
- feature_type: e.string().enum(ht)
858
- }), kt = c.Comment, vt = e.object({
873
+ feature_type: e.string().enum(wt)
874
+ }), vt = c.Comment, Ct = e.object({
859
875
  ...u.shape,
860
- feature_type: e.string().enum(kt),
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
- }), Ct = c.Follow, Rt = e.object({
881
+ }), Rt = c.Follow, Vt = e.object({
866
882
  ...u.shape,
867
- feature_type: e.string().enum(Ct),
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
- }), Vt = c.GiftCode, jt = e.object({
891
+ }), jt = c.GiftCode, Tt = e.object({
876
892
  name: e.string(),
877
893
  icon_url: e.string(),
878
894
  count: e.number()
879
- }), Tt = e.object({
895
+ }), qt = e.object({
880
896
  ...u.shape,
881
- feature_type: e.string().enum(Vt),
897
+ feature_type: e.string().enum(jt),
882
898
  config: e.object({
883
- gift_items: e.array(jt),
899
+ gift_items: e.array(Tt),
884
900
  mp_url: e.string().optional(),
885
901
  mp_qrcode_url: e.string().optional()
886
902
  })
887
- }), qt = c.Invite, xt = e.object({
903
+ }), xt = c.Invite, St = e.object({
888
904
  ...u.shape,
889
- feature_type: e.string().enum(qt),
905
+ feature_type: e.string().enum(xt),
890
906
  config: e.object({
891
907
  share_url: e.string()
892
908
  })
893
- }), St = c.InvitedRegister, Lt = e.object({
909
+ }), Lt = c.InvitedRegister, Pt = e.object({
894
910
  ...u.shape,
895
- feature_type: e.string().enum(St)
896
- }), Pt = e.string().enum(C(R, "GiftCode", "LotteryTicket")), Et = c.Lottery, $t = e.object({
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: Pt,
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
- }), Ut = e.object({
920
+ }), Ft = e.object({
905
921
  ...u.shape,
906
- feature_type: e.string().enum(Et),
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($t)
929
+ rewards: e.array(Ut)
914
930
  })
915
- }), Ft = c.LotteryDraw, Dt = e.object({
931
+ }), Dt = c.LotteryDraw, It = e.object({
916
932
  ...u.shape,
917
- feature_type: e.string().enum(Ft),
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
- }), It = c.Preregister, Gt = e.object({
938
+ }), Gt = c.Preregister, At = e.object({
923
939
  ...u.shape,
924
- feature_type: e.string().enum(It)
925
- }), At = c.Quest, Nt = e.object({
940
+ feature_type: e.string().enum(Gt)
941
+ }), Nt = c.Quest, Ot = e.object({
926
942
  ...u.shape,
927
- feature_type: e.string().enum(At),
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
- }), Ot = c.Register, Bt = e.object({
957
+ }), Bt = c.Register, Mt = e.object({
942
958
  ...u.shape,
943
- feature_type: e.string().enum(Ot)
944
- }), Mt = c.Share, Qt = e.object({
959
+ feature_type: e.string().enum(Bt)
960
+ }), Qt = c.Share, Kt = e.object({
945
961
  ...u.shape,
946
- feature_type: e.string().enum(Mt),
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
- }), Kt = c.Subscribe, Ht = e.object({
968
+ }), Ht = c.Subscribe, zt = e.object({
953
969
  ...u.shape,
954
- feature_type: e.string().enum(Kt),
970
+ feature_type: e.string().enum(Ht),
955
971
  config: e.object({
956
972
  weixin_template_ids: e.array(e.string())
957
973
  })
958
- }), zt = c.Survey, Jt = e.object({
974
+ }), Jt = c.Survey, Xt = e.object({
959
975
  ...u.shape,
960
- feature_type: e.string().enum(zt),
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
- }), Xt = c.Team, Yt = e.object({
981
+ }), Yt = c.Team, Zt = e.object({
966
982
  ...u.shape,
967
- feature_type: e.string().enum(Xt),
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
- }), Zt = c.Vote, Wt = e.object({
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
- }), en = e.object({
998
+ }), tn = e.object({
983
999
  ...u.shape,
984
- feature_type: e.string().enum(Zt),
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: it,
990
- options: e.array(Wt),
1005
+ source: ot,
1006
+ options: e.array(en),
991
1007
  rewards: e.array(F)
992
1008
  })
993
- }), tn = e.union(
994
- pt,
995
- bt,
996
- wt,
997
- vt,
998
- Rt,
999
- Tt,
1000
- xt,
1001
- Lt,
1002
- Ut,
1003
- Dt,
1004
- Gt,
1005
- Nt,
1006
- Bt,
1007
- Qt,
1008
- Ht,
1009
- Jt,
1010
- Yt,
1011
- en,
1012
- ft
1013
- ).key("feature_type").satisfies(), nn = e.object({
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(tn)
1020
- }).lock(), x = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()), rn = e.object({
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
- gift_code: e.string()
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
- }), cn = e.object({
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: tt,
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
- }), un = e.string().enum(w.Unknown, w.Pending), ln = e.union(
1070
+ }), ln = e.string().enum(k.Unknown, k.Pending), mn = e.union(
1055
1071
  e.object({
1056
1072
  ticket: e.string(),
1057
- status: un
1073
+ status: ln
1058
1074
  }),
1059
1075
  e.object({
1060
1076
  ticket: e.string(),
1061
- status: e.string().enum(C(w, "Unknown", "Pending")),
1077
+ status: e.string().enum(R(k, "Unknown", "Pending")),
1062
1078
  reward: ie
1063
1079
  })
1064
- ).satisfies(), mn = e.object({
1065
- tickets: e.array(ln)
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
- weixin_openid: e.string()
1101
+ platform: e.string()
1088
1102
  }), bn = e.object({
1089
- serial_number: e.number()
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
- }), Sr = e.object({
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
- }), fn = e.object({
1115
+ }), hn = e.object({
1100
1116
  team_code: e.string(),
1101
- visibility: st,
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
- dn,
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
- _n,
1126
- rn,
1145
+ pn,
1146
+ dn,
1127
1147
  an,
1128
- fn,
1129
- gn,
1130
- mn,
1131
- on,
1132
1148
  e.custom(
1133
1149
  "EmptyObject",
1134
- (i) => v(i) && Object.keys(i).length === 0
1150
+ (o) => C(o) && Object.keys(o).length === 0
1135
1151
  )
1136
- ).satisfies().lock(), kn = e.object({
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
- }), vn = e.object({
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
- }), Cn = e.object({
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(kn).optional()
1171
- }).lock(), Rn = e.object({
1186
+ rewards: e.array(vn).optional()
1187
+ }).lock(), Vn = e.object({
1172
1188
  allowed: e.bool(),
1173
1189
  registered: e.bool()
1174
- }), Vn = e.object({
1190
+ }), jn = e.object({
1175
1191
  feature_id: e.number(),
1176
1192
  can_engage: e.bool(),
1177
1193
  has_unclaimed_rewards: e.bool()
1178
- }), jn = e.object({
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(vn).optional(),
1202
+ rewards: e.array(Cn).optional(),
1187
1203
  scan: e.bool().optional()
1188
- }), Tn = e.object({
1204
+ }), qn = e.object({
1189
1205
  reward_id: e.number(),
1190
1206
  reward_status: $
1191
- }), qn = e.guard(nn), xn = e.guard(Rn), S = o({ count: e.number() }), Sn = o({ first_visit: e.bool() }), Ln = o({
1192
- engagements: e.union(e.array(wn), e.array(yn))
1193
- }), Pn = o({
1194
- status: e.array(Vn)
1195
- }), En = o({
1196
- engagements: e.array(Cn),
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
- }), $n = e.guard(jn), Un = o({
1199
- claimed_items: e.array(Tn)
1200
- }), Fn = o({
1214
+ }), Un = e.guard(Tn), Fn = a({
1215
+ claimed_items: e.array(qn)
1216
+ }), Dn = a({
1201
1217
  reward_status: $
1202
- }), Dn = o({
1218
+ }), In = a({
1203
1219
  user_rewards: e.array(ie),
1204
1220
  next_token: e.string().optional()
1205
- }), In = o({
1221
+ }), Gn = a({
1206
1222
  scene: e.string()
1207
- }), Gn = o({
1223
+ }), An = a({
1208
1224
  params: e.string()
1209
- }), An = o({
1225
+ }), Nn = a({
1210
1226
  img: e.string()
1211
1227
  });
1212
- class Lr {
1228
+ class Pr {
1213
1229
  constructor(t, n) {
1214
- l(this, "token");
1215
- l(this, "event", 0);
1216
- l(this, "req");
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: r } = await this.req.get("verify-mobile-allowed", xn, {
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 r;
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: t } = await this.req.get(`event/${this.event}/event-config`, qn);
1237
- return t;
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: n } = await this.req.get(`event/${this.event}/feature-engagement-count`, S, {
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 (n == null ? void 0 : n.count) ?? null;
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: n } = await this.req.get(`event/${this.event}/feature-engagement-count`, S, {
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 (n == null ? void 0 : n.count) ?? null;
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: n } = await this.req.get(`event/${this.event}/feature-engagements`, Ln, {
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 (n == null ? void 0 : n.engagements) || [];
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: n, code: r } = await this.req.post(
1301
+ const { data: r, code: i } = await this.req.post(
1282
1302
  `event/${this.event}/visit`,
1283
- a(t || {}),
1284
- Sn
1303
+ s(t || {}),
1304
+ Ln,
1305
+ n
1285
1306
  );
1286
- return n ?? {
1287
- error: r
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: n } = await this.req.get("event/user-feature-status", Pn, {
1302
- params: a({ ...t, event_id: this.event }),
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 (n == null ? void 0 : n.status) || [];
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: r } = await this.req.get("event/user-engagements", En, {
1317
- params: a({
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: (r == null ? void 0 : r.engagements) || [],
1326
- next_token: (r == null ? void 0 : r.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: s, code: m } = await this.req.post(
1363
+ const { data: l, code: d } = await this.req.post(
1341
1364
  `event/${this.event}/engage`,
1342
- a({
1365
+ s({
1343
1366
  feature_id: t,
1344
1367
  engagement: n,
1345
1368
  ...r
1346
1369
  }),
1347
- $n
1370
+ Un,
1371
+ i
1348
1372
  );
1349
- return s && s.rewards && (s.rewards = s.rewards.map((g) => (g.reward_status = g.reward_status === E.UnclaimedErr ? E.Unclaimed : g.reward_status, g))), s ?? {
1350
- error: m
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: n, code: r } = await this.req.post("event/claim-rewards", a(t), Un), s = n == null ? void 0 : n.claimed_items;
1361
- return s ? s.map((m) => (m.reward_status = m.reward_status === _.UnclaimedErr ? _.Unclaimed : m.reward_status, m)) : {
1362
- error: r
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: n, code: r } = await this.req.post(
1401
+ const { data: r, code: i } = await this.req.post(
1373
1402
  "event/claim-weixin-hongbao",
1374
1403
  { reward_id: t },
1375
- Fn
1404
+ Dn,
1405
+ n
1376
1406
  );
1377
- return n ? (n.reward_status = n.reward_status === _.UnclaimedErr ? _.Unclaimed : n.reward_status, n) : {
1378
- error: r
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: n } = await this.req.post(
1418
+ const { data: r } = await this.req.post(
1389
1419
  "event/user-rewards",
1390
- a({ max_results: 20, ...t, event_id: this.event }),
1391
- Dn
1420
+ s({ max_results: 20, ...t, event_id: this.event }),
1421
+ In,
1422
+ n
1392
1423
  );
1393
1424
  return {
1394
- user_rewards: ((n == null ? void 0 : n.user_rewards) || []).map((r) => (r.reward_status = r.reward_status === _.UnclaimedErr ? _.Unclaimed : r.reward_status, r)),
1395
- next_token: (n == null ? void 0 : n.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: n } = await this.req.get(`event/${this.event}/user-item-count`, S, {
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 (n == null ? void 0 : n.count) ?? null;
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: n } = await this.req.post(`event/${this.event}/user-reward-address`, t);
1418
- return n;
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: n } = await this.req.get("event/unlimit-qrcode-scene", In, {
1461
+ const { data: r } = await this.req.get("event/unlimit-qrcode-scene", Gn, {
1462
+ ...n,
1430
1463
  params: { params: t }
1431
1464
  });
1432
- return (n == null ? void 0 : n.scene) ?? null;
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: n } = await this.req.get("event/params-by-qrcode-scene", Gn, {
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 (n == null ? void 0 : n.params) ?? null;
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: n } = await this.req.post("event/unlimit-qrcode", a(t), An);
1455
- return (n == null ? void 0 : n.img) ?? null;
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 Nn = {
1497
+ const On = {
1459
1498
  /** 所有人均可以发帖 */
1460
1499
  All: "all",
1461
1500
  /** 指定用户可发帖 */
1462
1501
  Limit: "limit"
1463
- }, On = e.string().enum(Nn).lock(), Bn = {
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(Bn).lock(), Mn = {
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
- }, Pr = e.string().enum(Mn).lock(), d = {
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
- }, Qn = e.string().enum(d).lock(), ae = e.object({
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: On,
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(), Kn = e.object({
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(), V = e.object({
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: Kn,
1599
+ reply_to: Hn,
1561
1600
  create_time: e.number()
1562
- }).lock(), k = e.object({
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(V).optional()
1582
- }).lock(), Hn = e.object({
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(), y = e.object({
1625
+ }).lock(), f = e.object({
1587
1626
  notification_id: e.string(),
1588
- notification_type: Qn,
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(), zn = e.object({
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(), j = e.object({
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(), Jn = e.object({
1609
- ...y.shape,
1610
- ...zn.shape,
1611
- notification_type: e.string().enum(d.System)
1612
- }), Xn = e.object({
1613
- ...y.shape,
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
- d.PostPinned,
1617
- d.PostHighlighted,
1618
- d.PostDeleted,
1619
- d.PostLiked
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
- ...y.shape,
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
- notification_type: e.string().enum(d.CommentLiked, d.CommentDeleted)
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
- ...y.shape,
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(d.ReplyReplied),
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
- }), tr = e.object({
1644
- ...y.shape,
1682
+ }), nr = e.object({
1683
+ ...f.shape,
1645
1684
  ...N.shape,
1646
- ...j.shape,
1647
- notification_type: e.string().enum(d.ReplyLiked, d.ReplyDeleted)
1648
- }), nr = e.union(
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
- ).satisfies().lock(), rr = o({ forums: e.array(ae) }), ir = o({ topics: e.array(I) }), or = o({ topic: I }), ar = o({ post: G }), H = o({
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
- }), sr = o({ post: G, antispam: se }), cr = o({
1660
- replies: e.array(V),
1698
+ }), cr = a({ post: G, antispam: se }), ur = a({
1699
+ replies: e.array(j),
1661
1700
  next_token: e.string().optional()
1662
- }), ur = o({ reply: V }), lr = o({
1663
- reply: V.clone().optional(),
1701
+ }), lr = a({ reply: j }), mr = a({
1702
+ reply: j.clone().optional(),
1664
1703
  antispam: se.clone().optional()
1665
- }), mr = o({ comment: k }), dr = o({
1666
- comments: e.array(k),
1704
+ }), dr = a({ comment: v }), gr = a({
1705
+ comments: e.array(v),
1667
1706
  next_token: e.string().optional()
1668
- }), gr = o({
1669
- comment: k.clone().optional(),
1670
- antispam: k.clone().optional()
1671
- }), pr = e.guard(Hn), _r = o({
1672
- notifications: e.array(nr),
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
- }), br = o({
1713
+ }), yr = a({
1675
1714
  system: e.number(),
1676
1715
  comment: e.number(),
1677
1716
  like: e.number()
1678
1717
  });
1679
- class Er {
1718
+ class $r {
1680
1719
  constructor(t) {
1681
- l(this, "token");
1682
- l(this, "req");
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: t } = await this.req.get("community/forums", rr);
1692
- return (t == null ? void 0 : t.forums) || [];
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: t } = await this.req.get("community/topics", ir);
1701
- return (t == null ? void 0 : t.topics) || [];
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: n, code: r } = await this.req.get("community/topic", or, {
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 (n == null ? void 0 : n.topic) ?? { error: r };
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: n, code: r } = await this.req.get("community/posts", H, {
1721
- params: a(t)
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 n ?? { error: r };
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: s, code: m } = await this.req.get("community/pinned-posts", H, {
1732
- params: a({ forum_id: t, max_results: n, next_token: r })
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 s ?? { error: m };
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: n, code: r } = await this.req.get("community/post", ar, {
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 (n == null ? void 0 : n.post) ?? { error: r };
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: n, code: r } = await this.req.post("community/post", a(t), sr);
1754
- return n ?? {
1755
- error: r
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: n, code: r } = await this.req.get("community/comments", dr, {
1765
- params: a(t)
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 n ?? { error: r };
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: n, code: r } = await this.req.get("community/comment", mr, {
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 (n == null ? void 0 : n.comment) ?? { error: r };
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: n, code: r } = await this.req.post("community/comment", a(t), gr);
1788
- return n ?? {
1789
- error: r
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: n } = await this.req.get("community/replies", cr, {
1799
- params: a({ max_results: 20, ...t })
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 n ?? { replies: [] };
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: n, code: r } = await this.req.get("community/reply", ur, {
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 (n == null ? void 0 : n.reply) ?? { error: r };
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: n, code: r } = await this.req.post("community/reply", a(t), lr);
1822
- return n ?? {
1823
- error: r
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: n, code: r } = await this.req.post("community/like", { ...t, action: "like" });
1834
- return n || {
1835
- error: r
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: n, code: r } = await this.req.post("community/like", { ...t, action: "unlike" });
1846
- return n || {
1847
- error: r
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: n } = await this.req.get("community/media-presign-url", pr, {
1919
+ const { data: r } = await this.req.get("community/media-presign-url", _r, {
1920
+ ...n,
1858
1921
  params: t
1859
1922
  });
1860
- return n;
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: n } = await this.req.get("community/notifications", _r, {
1872
- params: a({ max_results: 20, ...t })
1934
+ const { data: r } = await this.req.get("community/notifications", br, {
1935
+ ...n,
1936
+ params: s({ max_results: 20, ...t })
1873
1937
  });
1874
- return n || { notifications: [] };
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: t } = await this.req.get("community/unread-notifications-count", br);
1884
- return t;
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: n } = await this.req.post("community/clear-unread-notifications", { category: t });
1894
- return n;
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 yr = o({
1965
+ const fr = a({
1898
1966
  nonce_str: e.string(),
1899
1967
  timestamp: e.number(),
1900
1968
  signature: e.string()
1901
1969
  });
1902
- var fr = /* @__PURE__ */ ((i) => (i.RedirectUriDisMatch = "10003", i.AppidError = "10016", i.AuthorizationError = "10015", i.NoRightForScope = "10005", i.Frequently = "10009", i.AppBanded = "10004", i.ShouldFollow = "10006", i.ScopeNull = "10010", i.RedirectUriNull = "10011", i.AppidNull = "10012", i.StateNull = "10013", i))(fr || {});
1903
- function L(i) {
1904
- return v(i, "open_id", "union_id", "weixin_token");
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 $r {
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
- l(this, "token");
1923
- l(this, "$appid");
1924
- l(this, "req");
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 = _e(t);
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 (!b.wx)
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 fe(), { data: r, code: s } = await this.req.post(
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: s };
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 n = P("code"), r = Date.now(), s = +P("state");
1993
- if (!n || !s || s < r - 1e3 * 60 * 5 || s > r) {
1994
- const ce = O(["code", "state"]);
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(ce)}&response_type=code&scope=${t}&state=${r}#wechat_redirect`
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(n))
2001
- return { error: n };
2002
- const m = O(["code", "state"]);
2003
- "replaceState" in history && history.replaceState({}, "", m);
2004
- const { data: g, code: T } = await this.req.post(
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: n,
2075
+ code: r,
2008
2076
  appid: this.appid
2009
2077
  },
2010
- L
2078
+ L,
2079
+ n
2011
2080
  );
2012
- return g && (this.token.weixinToken = g.weixin_token, await this.token.autoLogin()), g ?? { error: T };
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: t } = await this.req.get("weixin/offiaccount/jssdk-sign", yr, {
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 t ? {
2114
+ return n ? {
2044
2115
  appid: this.appid,
2045
- nonceStr: t.nonce_str,
2046
- timestamp: t.timestamp,
2047
- signature: t.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
- vr as AuthToken,
2054
- rn as CashbackEngagementDataValidator,
2055
- on as ClaimActivationKeyEngagementDataValidator,
2056
- _ as ClaimRewardStatus,
2124
+ Cr as AuthToken,
2125
+ on as CashbackEngagementDataValidator,
2126
+ an as ClaimActivationKeyEngagementDataValidator,
2127
+ b as ClaimRewardStatus,
2057
2128
  $ as ClaimRewardStatusValidator,
2058
- Tn as ClaimedItemValidator,
2129
+ qn as ClaimedItemValidator,
2059
2130
  Y as ClubAddressValidator,
2060
- Rr as ClubApi,
2131
+ Vr as ClubApi,
2061
2132
  Z as ClubBenefitSummaryValidator,
2062
- Ie as ClubBenefitValidator,
2063
- Ve as ClubCreditChangeScene,
2064
- je as ClubCreditChangeSceneValidator,
2065
- Ce as ClubCreditChangeType,
2066
- Re as ClubCreditChangeTypeValidator,
2067
- De as ClubCreditLogValidator,
2068
- Se as ClubGlobalConfigValidator,
2069
- Te as ClubItemType,
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
- Le as ClubPlayerValidator,
2142
+ Pe as ClubPlayerValidator,
2072
2143
  W as ClubProductValidator,
2073
- qe as ClubRedemptionStatus,
2074
- xe as ClubRedemptionStatusValidator,
2075
- Fe as ClubUserCreditValidator,
2076
- Ue as ClubUserProfileValidator,
2077
- wn as CommentEngagementValidator,
2078
- k as CommentValidator,
2079
- Er as CommunityApi,
2080
- Ye as EngageAccountType,
2081
- Ze as EngageAccountTypeValidator,
2082
- jn as EngageResponseValidator,
2083
- vn as EngageRewardValidator,
2084
- Lr as EventApi,
2085
- nn as EventConfigValidator,
2086
- pt as EventFeatureConfigOfCashbackValidator,
2087
- bt as EventFeatureConfigOfCheckInValidator,
2088
- ft as EventFeatureConfigOfClaimActivationKeyValidator,
2089
- wt as EventFeatureConfigOfClaimRewardsValidator,
2090
- vt as EventFeatureConfigOfCommentValidator,
2091
- Rt as EventFeatureConfigOfFollowValidator,
2092
- Tt as EventFeatureConfigOfGiftCodeValidator,
2093
- xt as EventFeatureConfigOfInviteValidator,
2094
- Lt as EventFeatureConfigOfInvitedRegisterValidator,
2095
- Dt as EventFeatureConfigOfLotteryDrawValidator,
2096
- Ut as EventFeatureConfigOfLotteryValidator,
2097
- Gt as EventFeatureConfigOfPreregisterValidator,
2098
- Nt as EventFeatureConfigOfQuestValidator,
2099
- Bt as EventFeatureConfigOfRegisterValidator,
2100
- Qt as EventFeatureConfigOfShareValidator,
2101
- Ht as EventFeatureConfigOfSubscribeValidator,
2102
- Jt as EventFeatureConfigOfSurveyValidator,
2103
- Yt as EventFeatureConfigOfTeamValidator,
2104
- en as EventFeatureConfigOfVoteValidator,
2105
- tn as EventFeatureConfigValidator,
2106
- We as EventPeriodType,
2107
- et as EventPeriodTypeValidator,
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
- Ae as ExtraGameRewardValidator,
2110
- Ge as ExtraPhysicalShipmentValidator,
2111
- dt as FeatureRewardValidator,
2180
+ Ne as ExtraGameRewardValidator,
2181
+ Ae as ExtraPhysicalShipmentValidator,
2182
+ gt as FeatureRewardValidator,
2112
2183
  c as FeatureType,
2113
- tt as FeatureTypeValidator,
2114
- Nn as ForumMode,
2115
- On as ForumModeValidator,
2184
+ nt as FeatureTypeValidator,
2185
+ On as ForumMode,
2186
+ Bn as ForumModeValidator,
2116
2187
  ae as ForumValidator,
2117
- R as GamerItemType,
2188
+ V as GamerItemType,
2118
2189
  ee as GamerItemTypeValidator,
2119
- ke as Gender,
2120
- ve as GenderValidator,
2121
- an as GiftCodeEngagementDataValidator,
2122
- sn as InviteEngagementDataValidator,
2123
- ut as LotteryDrawAction,
2124
- xr as LotteryDrawActionValidator,
2125
- mn as LotteryDrawEngagementDataValidator,
2126
- cn as LotteryEngagementDataValidator,
2127
- w as LotteryTicketStatus,
2128
- Tr as LotteryTicketStatusValidator,
2129
- y as NotificationBaseValidator,
2130
- Mn as NotificationCategory,
2131
- Pr as NotificationCategoryValidator,
2132
- Zn as NotificationCommentReplyValidator,
2133
- Wn as NotificationCommentValidator,
2134
- j as NotificationPayloadCommentValidator,
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
- zn as NotificationPayloadSystemValidator,
2138
- Yn as NotificationPostCommentValidator,
2139
- Xn as NotificationPostValidator,
2140
- er as NotificationReplyRepliedValidator,
2141
- tr as NotificationReplyValidator,
2142
- Jn as NotificationSystemValidator,
2143
- d as NotificationType,
2144
- Qn as NotificationTypeValidator,
2145
- nr as NotificationValidator,
2146
- $e as PlayerRoleCardValidator,
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
- Bn as PostStatus,
2219
+ Mn as PostStatus,
2149
2220
  oe as PostStatusValidator,
2150
2221
  G as PostValidator,
2151
- dn as PreregisterEngagementDataValidator,
2152
- Hn as PresignedUrlResponseValidator,
2153
- gn as QuestEngagementDataValidator,
2154
- nt as QuestObjective,
2222
+ gn as PreregisterEngagementDataValidator,
2223
+ zn as PresignedUrlResponseValidator,
2224
+ pn as QuestEngagementDataValidator,
2225
+ rt as QuestObjective,
2155
2226
  ne as QuestObjectiveValidator,
2156
- Cr as RedeemParamsValidator,
2157
- Ne as RedemptionValidator,
2158
- mt as RegularRewardValidator,
2159
- Kn as ReplyToValidator,
2160
- V as ReplyValidator,
2161
- Vr as RewardItemType,
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
- ot as RewardSource,
2234
+ at as RewardSource,
2164
2235
  U as RewardSourceValidator,
2165
- p as RewardStatus,
2236
+ _ as RewardStatus,
2166
2237
  E as RewardStatusSuffix,
2167
2238
  re as RewardStatusSuffixValidator,
2168
- jr as RewardStatusValidator,
2169
- kn as RewardValidator,
2170
- Ee as RoleBaseInfoValidator,
2171
- Pe as ServerBaseInfoValidator,
2172
- pn as ShareEngagementDataValidator,
2173
- bn as SurveyEngagementDataValidator,
2174
- ct as TeamAction,
2175
- qr as TeamActionValidator,
2176
- fn as TeamEngagementDataValidator,
2177
- yn as TeamEngagementValidator,
2178
- Sr as TeamMemberValidator,
2179
- at as TeamVisibility,
2180
- st as TeamVisibilityValidator,
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
- Cn as UserEngagementValidator,
2184
- Vn as UserFeatureStatusValidator,
2254
+ Rn as UserEngagementValidator,
2255
+ jn as UserFeatureStatusValidator,
2185
2256
  ie as UserRewardValidator,
2186
- Rn as VerifyMobileResultValidator,
2187
- hn as VoteEngagementDataValidator,
2188
- rt as VoteOptionSource,
2189
- it as VoteOptionSourceValidator,
2190
- $r as WeixinApi,
2191
- _n as WeixinSubscribeEngagementDataValidator,
2192
- fr as WeixinWebLoginErrorCode,
2193
- yr as isWeixinSignResponse
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
  };