@seayoo-web/gamer-api 4.5.6 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -143,30 +143,30 @@ var p = "gamer_token", se = class {
143
143
  let { data: t } = await this.req.post("auth-real-name", a(e), ie);
144
144
  return t;
145
145
  }
146
- }, ce = {
146
+ }, m = {
147
147
  Unknown: "unknown",
148
148
  Male: "male",
149
149
  Female: "female"
150
- }, le = f.string().enum(ce).lock(), ue = {
150
+ }, ce = f.string().enum(m).lock(), le = {
151
151
  Increase: "increase",
152
152
  Decrease: "decrease",
153
153
  Expired: "expired"
154
- }, de = f.string().enum(ue).lock(), fe = {
154
+ }, ue = f.string().enum(le).lock(), de = {
155
155
  Order: "order",
156
156
  Consumption: "consumption",
157
157
  Redeem: "redeem",
158
158
  Expire: "expire",
159
159
  Admin: "admin",
160
160
  Event: "event"
161
- }, pe = f.string().enum(fe).lock(), me = {
161
+ }, fe = f.string().enum(de).lock(), pe = {
162
162
  GameReward: "game_reward",
163
163
  Physical: "physical",
164
164
  Virtual: "virtual"
165
- }, m = f.string().enum(me).lock(), he = {
165
+ }, h = f.string().enum(pe).lock(), me = {
166
166
  Pending: "pending",
167
167
  Issued: "issued",
168
168
  Failed: "failed"
169
- }, ge = f.string().enum(he).lock(), _e = f.object({
169
+ }, he = f.string().enum(me).lock(), ge = f.object({
170
170
  default_avatar_url: f.string(),
171
171
  official_avatar_urls: f.array(f.string()),
172
172
  default_nickname: f.string(),
@@ -182,7 +182,7 @@ var p = "gamer_token", se = class {
182
182
  exp_description: f.string(),
183
183
  credit_description: f.string(),
184
184
  send_role_mail_rate_limit: f.number()
185
- }).lock(), ve = f.object({
185
+ }).lock(), _e = f.object({
186
186
  member_id: f.string(),
187
187
  player_id: f.string(),
188
188
  exp: f.number(),
@@ -191,28 +191,28 @@ var p = "gamer_token", se = class {
191
191
  credit_expiring: f.number(),
192
192
  level_change_time: f.number(),
193
193
  level_expire_time: f.number()
194
- }).lock(), ye = f.object({
194
+ }).lock(), ve = f.object({
195
195
  server_id: f.string(),
196
196
  server_name: f.string()
197
- }).lock(), be = f.object({
197
+ }).lock(), ye = f.object({
198
198
  role_id: f.string(),
199
199
  role_name: f.string()
200
- }).lock(), h = f.object({
201
- ...be.shape,
200
+ }).lock(), g = f.object({
202
201
  ...ye.shape,
202
+ ...ve.shape,
203
203
  role_level: f.number(),
204
204
  last_login_time: f.number()
205
- }).lock(), xe = f.object({
206
- ...h.shape,
205
+ }).lock(), be = f.object({
206
+ ...g.shape,
207
207
  role_fighting: f.number(),
208
208
  kin_id: f.string().optional(),
209
209
  kin_name: f.string().optional(),
210
210
  kin_position: f.string().optional()
211
- }).lock(), Se = f.object({
211
+ }).lock(), xe = f.object({
212
212
  name: f.string(),
213
213
  avatar_url: f.string(),
214
214
  bio: f.string(),
215
- gender: le,
215
+ gender: ce,
216
216
  birthday: f.object({
217
217
  year: f.number(),
218
218
  month: f.number(),
@@ -222,7 +222,7 @@ var p = "gamer_token", se = class {
222
222
  homepage_url: f.string(),
223
223
  homepage_image_url: f.string()
224
224
  }).optional()).optional()
225
- }).lock(), g = f.object({
225
+ }).lock(), _ = f.object({
226
226
  address_id: f.number(),
227
227
  recipient: f.string(),
228
228
  mobile: f.string(),
@@ -231,20 +231,20 @@ var p = "gamer_token", se = class {
231
231
  district: f.string(),
232
232
  address: f.string(),
233
233
  is_default: f.bool()
234
- }).lock(), Ce = f.object({
234
+ }).lock(), Se = f.object({
235
235
  increased_credit: f.number(),
236
236
  decreased_credit: f.number(),
237
237
  expired_credit: f.number(),
238
238
  balance_credit: f.number()
239
- }).lock(), we = f.object({
239
+ }).lock(), Ce = f.object({
240
240
  id: f.number(),
241
- change_type: de,
242
- change_scene: pe,
241
+ change_type: ue,
242
+ change_scene: fe,
243
243
  change_credit: f.number(),
244
244
  balance: f.number(),
245
245
  change_time: f.number(),
246
246
  metadata: f.record(f.unknown()).optional()
247
- }).lock(), _ = f.object({
247
+ }).lock(), v = f.object({
248
248
  benefit_id: f.number(),
249
249
  name: f.string(),
250
250
  img_url: f.string(),
@@ -253,11 +253,11 @@ var p = "gamer_token", se = class {
253
253
  max_level: f.number(),
254
254
  product_id: f.number(),
255
255
  tag: f.string()
256
- }).lock(), v = f.object({
256
+ }).lock(), y = f.object({
257
257
  product_id: f.number(),
258
258
  catalog_id: f.number(),
259
259
  catalog_name: f.string(),
260
- item_type: m,
260
+ item_type: h,
261
261
  name: f.string(),
262
262
  img_url: f.string(),
263
263
  description: f.string(),
@@ -279,13 +279,13 @@ var p = "gamer_token", se = class {
279
279
  created_at: f.number(),
280
280
  updated_at: f.number(),
281
281
  redeemable_quantity: f.number().optional()
282
- }).lock(), Te = f.object({
283
- ...r(_.shape, "tag"),
284
- product: v.clone().optional()
285
- }).lock(), Ee = f.union(f.object({
282
+ }).lock(), we = f.object({
283
+ ...r(v.shape, "tag"),
284
+ product: y.clone().optional()
285
+ }).lock(), Te = f.union(f.object({
286
286
  server_id: f.string(),
287
287
  role_id: f.string()
288
- }), f.object({ address_id: f.number() })).satisfies().lock(), De = f.object({
288
+ }), f.object({ address_id: f.number() })).satisfies().lock(), Ee = f.object({
289
289
  recipient: f.string(),
290
290
  mobile: f.string(),
291
291
  province: f.string(),
@@ -294,29 +294,29 @@ var p = "gamer_token", se = class {
294
294
  address: f.string(),
295
295
  express_company: f.string(),
296
296
  express_number: f.string()
297
- }).lock(), Oe = f.object({
297
+ }).lock(), De = f.object({
298
298
  server_id: f.string(),
299
299
  role_id: f.string(),
300
300
  role_name: f.string()
301
- }).lock(), ke = f.object({
301
+ }).lock(), Oe = f.object({
302
302
  redemption_id: f.number(),
303
303
  player_id: f.string(),
304
304
  product_id: f.number(),
305
305
  name: f.string(),
306
306
  img_url: f.string(),
307
- item_type: m,
307
+ item_type: h,
308
308
  catalog_id: f.number(),
309
309
  catalog_name: f.string(),
310
310
  quantity: f.number(),
311
311
  amount: f.number(),
312
- status: ge,
312
+ status: he,
313
313
  created_at: f.number(),
314
- extra_data: f.union(De.clone(), Oe.clone()).satisfies().optional()
315
- }), Ae = f.guard(_e), je = d({ player: ve }), Me = d({ roles: f.array(h) }), y = d({ role_card: xe }), b = f.guard(Se), x = f.guard(g), Ne = d({ addresses: f.array(g) }), Pe = f.guard(Ce), Fe = d({
316
- credit_logs: f.array(we),
314
+ extra_data: f.union(Ee.clone(), De.clone()).satisfies().optional()
315
+ }), ke = f.guard(ge), Ae = d({ player: _e }), je = d({ roles: f.array(g) }), b = d({ role_card: be }), Me = f.guard(xe), x = f.guard(_), Ne = d({ addresses: f.array(_) }), Pe = f.guard(Se), Fe = d({
316
+ credit_logs: f.array(Ce),
317
317
  next_token: f.string().optional()
318
- }), Ie = d({ products: f.array(v) }), Le = d({ benefits: f.array(_) }), Re = d({ benefit: Te }), ze = d({
319
- redemptions: f.array(ke),
318
+ }), Ie = d({ products: f.array(y) }), Le = d({ benefits: f.array(v) }), Re = d({ benefit: we }), ze = d({
319
+ redemptions: f.array(Oe),
320
320
  next_token: f.string().optional()
321
321
  }), Be = d({
322
322
  existed: f.bool(),
@@ -330,12 +330,12 @@ var p = "gamer_token", se = class {
330
330
  }
331
331
  async getConfig(e) {
332
332
  await this.token.autoLogin();
333
- let { data: t } = await this.req.get("club/config", null, Ae, e);
333
+ let { data: t } = await this.req.get("club/config", null, ke, e);
334
334
  return t;
335
335
  }
336
336
  async getCurrentPlayer(e) {
337
337
  await this.token.autoLogin();
338
- let { data: t, code: n, message: r } = await this.req.get("club/current-player", null, je, e);
338
+ let { data: t, code: n, message: r } = await this.req.get("club/current-player", null, Ae, e);
339
339
  return t?.player ?? {
340
340
  message: r,
341
341
  error: n
@@ -343,7 +343,7 @@ var p = "gamer_token", se = class {
343
343
  }
344
344
  async linkPlayer(e) {
345
345
  await this.token.autoLogin();
346
- let { data: t, code: n, message: r } = await this.req.post("club/link-player", { id_token: this.token.idToken }, je, e);
346
+ let { data: t, code: n, message: r } = await this.req.post("club/link-player", { id_token: this.token.idToken }, Ae, e);
347
347
  return t?.player ?? {
348
348
  message: r,
349
349
  error: n
@@ -354,27 +354,27 @@ var p = "gamer_token", se = class {
354
354
  let { data: r } = await this.req.get("club/roles", {
355
355
  player_id: e,
356
356
  refresh: t
357
- }, Me, n);
357
+ }, je, n);
358
358
  return r?.roles || [];
359
359
  }
360
360
  async getRoleCard(e, t) {
361
361
  await this.token.autoLogin();
362
- let { data: n } = await this.req.get("club/role-card", { member_id: e }, y, t);
362
+ let { data: n } = await this.req.get("club/role-card", { member_id: e }, b, t);
363
363
  return n?.role_card ?? null;
364
364
  }
365
365
  async setRoleCard(e, t) {
366
366
  if (!await this.token.autoLogin()) return null;
367
- let { data: n } = await this.req.post("club/role-card", e, y, t);
367
+ let { data: n } = await this.req.post("club/role-card", e, b, t);
368
368
  return n?.role_card ?? null;
369
369
  }
370
370
  async refreshRoleCard(e) {
371
371
  if (!await this.token.autoLogin()) return null;
372
- let { data: t } = await this.req.post("club/refresh-role-card", {}, y, e);
372
+ let { data: t } = await this.req.post("club/refresh-role-card", {}, b, e);
373
373
  return t?.role_card ?? null;
374
374
  }
375
375
  async getUserProfile(e, t) {
376
376
  await this.token.autoLogin();
377
- let { data: n } = await this.req.get("club/user-profile", { member_id: e }, b, t);
377
+ let { data: n } = await this.req.get("club/user-profile", { member_id: e }, Me, t);
378
378
  return n;
379
379
  }
380
380
  async updateUserProfile(e, t) {
@@ -383,7 +383,7 @@ var p = "gamer_token", se = class {
383
383
  message: "请提供需要修改的信息"
384
384
  };
385
385
  await this.token.autoLogin();
386
- let { data: n, code: r, message: i } = await this.req.post("club/user-profile", e, b, t);
386
+ let { data: n, code: r, message: i } = await this.req.post("club/user-profile", e, Me, t);
387
387
  return n ?? {
388
388
  message: i,
389
389
  error: r
@@ -1426,25 +1426,46 @@ async function vi(e, t, n) {
1426
1426
  var yi = {
1427
1427
  Waiting: 1,
1428
1428
  Playing: 2
1429
- }, bi = f.number().enum(yi).lock(), xi = class {
1430
- req;
1429
+ }, bi = f.number().enum(yi).lock(), xi = {
1430
+ Unknown: 0,
1431
+ Goose: 1,
1432
+ Duck: 2,
1433
+ Bird: 3
1434
+ }, Si = f.number().enum(xi).lock(), Ci = {
1435
+ Unknown: 0,
1436
+ Win: 1,
1437
+ Lose: 2,
1438
+ Mvp: 3,
1439
+ Flee: 4,
1440
+ KickOut: 5
1441
+ }, wi = f.number().enum(Ci).lock(), Ti = class {
1442
+ req = null;
1431
1443
  constructor(e, t) {
1432
- this.req = t({
1433
- baseURL: `${ae(e) ? e : `https://${o(e)}`}/v1/ggd`,
1434
- timeout: 1e4,
1435
- maxRetry: 2,
1436
- retryInterval: "2EB",
1437
- responseRule: {
1438
- ok: { resolve: "body" },
1439
- failed: {
1440
- resolve: "json",
1441
- statusField: "error",
1442
- messageField: ["user_message", "message"]
1444
+ if (typeof e == "string" && t) {
1445
+ let n = ae(e) ? e : `https://${o(e)}`;
1446
+ this.req = t({
1447
+ baseURL: `${n}/v1/ggd`,
1448
+ timeout: 1e4,
1449
+ maxRetry: 2,
1450
+ retryInterval: "2EB",
1451
+ responseRule: {
1452
+ ok: { resolve: "body" },
1453
+ failed: {
1454
+ resolve: "json",
1455
+ statusField: "error",
1456
+ messageField: ["user_message", "message"]
1457
+ }
1443
1458
  }
1444
- }
1445
- });
1459
+ });
1460
+ return;
1461
+ }
1462
+ if (typeof e == "object" && "req" in e) {
1463
+ this.req = e.req;
1464
+ return;
1465
+ }
1446
1466
  }
1447
1467
  async describeRoomByCode(e, t, n) {
1468
+ if (!this.req) throw Error("初始化错误,没有找到请求工具");
1448
1469
  let r = String(n || s("expires_at")), i = e || s("invitation_code"), a = t || s("server_id");
1449
1470
  if (!i && !a || !/^\d+$/.test(r)) return {
1450
1471
  error: "invitation_code_invalid",
@@ -1475,19 +1496,79 @@ var yi = {
1475
1496
  message: u
1476
1497
  };
1477
1498
  }
1478
- }, Si = {
1499
+ async describeRole() {
1500
+ if (!this.req) throw Error("初始化错误,没有找到请求工具");
1501
+ let { data: e, code: t, message: n } = await this.req.get("describe-role", null, d({
1502
+ combo_id: f.string(),
1503
+ showid: f.number(),
1504
+ role_id: f.number(),
1505
+ role_name: f.string(),
1506
+ role_level: f.number(),
1507
+ avatar_url: f.string().optional(),
1508
+ behavior_score: f.number(),
1509
+ lead_goose_level: f.number(),
1510
+ create_time: f.number()
1511
+ }));
1512
+ return e || {
1513
+ error: t,
1514
+ message: n
1515
+ };
1516
+ }
1517
+ async describeRoleMatchStats(e) {
1518
+ if (!this.req) throw Error("初始化错误,没有找到请求工具");
1519
+ let { data: t, code: n, message: r } = await this.req.post("describe-role-match-stats", { role_id: e }, d({
1520
+ inference_level: f.string().optional(),
1521
+ recent_classic_survival_round: f.number().optional(),
1522
+ recent_goose_vote_correct_rate: f.string().optional(),
1523
+ recent_duck_vote_correct_rate: f.string().optional(),
1524
+ recent_total_killed_count: f.number().optional(),
1525
+ season_top_count: f.number().optional(),
1526
+ goose_win_rate: f.string().optional(),
1527
+ duck_win_rate: f.string().optional(),
1528
+ neutral_win_rate: f.string().optional(),
1529
+ goose_win_count: f.number().optional(),
1530
+ duck_win_count: f.number().optional(),
1531
+ neutral_win_count: f.number().optional(),
1532
+ total_win_rate: f.string().optional(),
1533
+ total_count: f.number().optional(),
1534
+ goose_vote_correct_rate: f.string().optional(),
1535
+ duck_vote_correct_rate: f.string().optional(),
1536
+ total_killed_count: f.number().optional()
1537
+ }));
1538
+ return t || {
1539
+ error: n,
1540
+ message: r
1541
+ };
1542
+ }
1543
+ async listRoleMatches(e) {
1544
+ if (!this.req) throw Error("初始化错误,没有找到请求工具");
1545
+ let { data: t, code: n, message: r } = await this.req.post("list-role-matches", { role_id: e }, d({ matches: f.array(f.object({
1546
+ players_num: f.number(),
1547
+ end_time: f.number(),
1548
+ map_name: f.string(),
1549
+ career_camp: Si,
1550
+ player_status: wi,
1551
+ career_name: f.string(),
1552
+ mode_name: f.string()
1553
+ })) }));
1554
+ return t ? t.matches : {
1555
+ error: n,
1556
+ message: r
1557
+ };
1558
+ }
1559
+ }, Ei = {
1479
1560
  All: "all",
1480
1561
  Limit: "limit"
1481
- }, Ci = f.string().enum(Si).lock(), wi = {
1562
+ }, Di = f.string().enum(Ei).lock(), Oi = {
1482
1563
  Pending: "pending",
1483
1564
  Approved: "approved",
1484
1565
  Failed: "failed",
1485
1566
  Suspect: "suspect"
1486
- }, V = f.string().enum(wi).lock(), Ti = {
1567
+ }, V = f.string().enum(Oi).lock(), ki = {
1487
1568
  System: "system",
1488
1569
  Comment: "comment",
1489
1570
  Like: "like"
1490
- }, Ei = f.string().enum(Ti).lock(), H = {
1571
+ }, Ai = f.string().enum(ki).lock(), H = {
1491
1572
  System: "system",
1492
1573
  PostPinned: "post_pinned",
1493
1574
  PostHighlighted: "post_highlighted",
@@ -1500,13 +1581,13 @@ var yi = {
1500
1581
  ReplyReplied: "reply_replied",
1501
1582
  ReplyLiked: "reply_liked",
1502
1583
  ReplyDeleted: "reply_deleted"
1503
- }, Di = f.string().enum(H).lock(), U = f.object({
1584
+ }, ji = f.string().enum(H).lock(), U = f.object({
1504
1585
  forum_id: f.number(),
1505
1586
  icon_url: f.string(),
1506
1587
  name: f.string(),
1507
1588
  tags: f.array(f.string()),
1508
1589
  sort: f.number(),
1509
- mode: Ci,
1590
+ mode: Di,
1510
1591
  member_ids: f.array(f.number())
1511
1592
  }).lock(), W = f.object({
1512
1593
  topic_id: f.number(),
@@ -1535,7 +1616,7 @@ var yi = {
1535
1616
  is_highlighted: f.bool(),
1536
1617
  status: V,
1537
1618
  create_time: f.number()
1538
- }).lock(), K = f.object({ err_msg: f.string().optional() }).optional().lock(), Oi = f.object({
1619
+ }).lock(), K = f.object({ err_msg: f.string().optional() }).optional().lock(), Mi = f.object({
1539
1620
  reply_id: f.number(),
1540
1621
  reply_content: f.string().optional(),
1541
1622
  replied_by: f.string(),
@@ -1554,7 +1635,7 @@ var yi = {
1554
1635
  content: f.string(),
1555
1636
  like_num: f.number(),
1556
1637
  liked: f.bool(),
1557
- reply_to: Oi,
1638
+ reply_to: Mi,
1558
1639
  create_time: f.number()
1559
1640
  }).lock(), J = f.object({
1560
1641
  comment_id: f.number(),
@@ -1576,19 +1657,19 @@ var yi = {
1576
1657
  create_time: f.number(),
1577
1658
  status: V,
1578
1659
  replies: f.array(q).optional()
1579
- }).lock(), ki = f.object({
1660
+ }).lock(), Ni = f.object({
1580
1661
  image_url: f.string(),
1581
1662
  upload_url: f.string(),
1582
1663
  existed: f.bool()
1583
1664
  }).lock(), Y = f.object({
1584
1665
  notification_id: f.string(),
1585
- notification_type: Di,
1666
+ notification_type: ji,
1586
1667
  is_read: f.bool(),
1587
1668
  create_time: f.number(),
1588
1669
  origin_user_id: f.string(),
1589
1670
  origin_user_name: f.string(),
1590
1671
  origin_user_avatar_url: f.string()
1591
- }).lock(), Ai = f.object({
1672
+ }).lock(), Pi = f.object({
1592
1673
  system_message_subject: f.string(),
1593
1674
  system_message_content: f.string()
1594
1675
  }).lock(), X = f.object({
@@ -1602,86 +1683,86 @@ var yi = {
1602
1683
  }).lock(), Q = f.object({
1603
1684
  reply_id: f.number(),
1604
1685
  reply_content: f.string()
1605
- }).lock(), ji = f.object({
1686
+ }).lock(), Fi = f.object({
1606
1687
  ...Y.shape,
1607
- ...Ai.shape,
1688
+ ...Pi.shape,
1608
1689
  notification_type: f.string().enum(H.System)
1609
- }), Mi = f.object({
1690
+ }), Ii = f.object({
1610
1691
  ...Y.shape,
1611
1692
  ...X.shape,
1612
1693
  notification_type: f.string().enum(H.PostPinned, H.PostHighlighted, H.PostDeleted, H.PostLiked)
1613
- }), Ni = f.object({
1694
+ }), Li = f.object({
1614
1695
  ...Y.shape,
1615
1696
  ...X.shape,
1616
1697
  ...Z.shape,
1617
1698
  notification_type: f.string().enum(H.PostCommented)
1618
- }), Pi = f.object({
1699
+ }), Ri = f.object({
1619
1700
  ...Y.shape,
1620
1701
  ...Z.shape,
1621
1702
  ...Q.shape,
1622
1703
  notification_type: f.string().enum(H.CommentReplied)
1623
- }), Fi = f.object({
1704
+ }), zi = f.object({
1624
1705
  ...Y.shape,
1625
1706
  ...Z.shape,
1626
1707
  ...X.shape,
1627
1708
  notification_type: f.string().enum(H.CommentLiked, H.CommentDeleted)
1628
- }), Ii = f.object({
1709
+ }), Bi = f.object({
1629
1710
  ...Y.shape,
1630
1711
  ...Q.shape,
1631
1712
  notification_type: f.string().enum(H.ReplyReplied),
1632
1713
  comment_id: f.number(),
1633
1714
  reply_to_reply_id: f.number(),
1634
1715
  reply_to_reply_content: f.string()
1635
- }), Li = f.object({
1716
+ }), Vi = f.object({
1636
1717
  ...Y.shape,
1637
1718
  ...Q.shape,
1638
1719
  ...Z.shape,
1639
1720
  notification_type: f.string().enum(H.ReplyLiked, H.ReplyDeleted)
1640
- }), Ri = f.union(ji, Mi, Ni, Pi, Fi, Ii, Li).satisfies().lock(), zi = d({ forums: f.array(U) }), Bi = d({ topics: f.array(W) }), Vi = d({ topic: W }), Hi = d({ post: G }), Ui = d({
1721
+ }), Hi = f.union(Fi, Ii, Li, Ri, zi, Bi, Vi).satisfies().lock(), Ui = d({ forums: f.array(U) }), Wi = d({ topics: f.array(W) }), Gi = d({ topic: W }), Ki = d({ post: G }), qi = d({
1641
1722
  posts: f.array(G),
1642
1723
  next_token: f.string().optional()
1643
- }), Wi = d({
1724
+ }), Ji = d({
1644
1725
  post: G.clone().optional(),
1645
1726
  antispam: K.clone().optional()
1646
- }), Gi = d({
1727
+ }), Yi = d({
1647
1728
  replies: f.array(q),
1648
1729
  next_token: f.string().optional()
1649
- }), Ki = d({ reply: q }), qi = d({
1730
+ }), Xi = d({ reply: q }), Zi = d({
1650
1731
  reply: q.clone().optional(),
1651
1732
  antispam: K.clone().optional()
1652
- }), Ji = d({ comment: J }), Yi = d({
1733
+ }), Qi = d({ comment: J }), $i = d({
1653
1734
  comments: f.array(J),
1654
1735
  next_token: f.string().optional()
1655
- }), Xi = d({
1736
+ }), ea = d({
1656
1737
  comment: J.clone().optional(),
1657
1738
  antispam: J.clone().optional()
1658
- }), Zi = f.guard(ki), Qi = d({
1659
- notifications: f.array(Ri),
1739
+ }), ta = f.guard(Ni), na = d({
1740
+ notifications: f.array(Hi),
1660
1741
  next_token: f.string().optional()
1661
- }), $i = d({
1742
+ }), ra = d({
1662
1743
  system: f.number(),
1663
1744
  comment: f.number(),
1664
1745
  like: f.number()
1665
- }), ea = class {
1746
+ }), ia = class {
1666
1747
  token;
1667
1748
  req;
1668
1749
  constructor(e) {
1669
1750
  this.token = e, this.req = e.req;
1670
1751
  }
1671
1752
  async getForums(e) {
1672
- let { data: t } = await this.req.get("community/forums", null, zi, e);
1753
+ let { data: t } = await this.req.get("community/forums", null, Ui, e);
1673
1754
  return t?.forums || [];
1674
1755
  }
1675
1756
  async getTopics(e) {
1676
- let { data: t } = await this.req.get("community/topics", null, Bi, e);
1757
+ let { data: t } = await this.req.get("community/topics", null, Wi, e);
1677
1758
  return t?.topics || [];
1678
1759
  }
1679
1760
  async getTopic(e, t) {
1680
- let { data: n, code: r } = await this.req.get("community/topic", { topic_id: e }, Vi, t);
1761
+ let { data: n, code: r } = await this.req.get("community/topic", { topic_id: e }, Gi, t);
1681
1762
  return n?.topic ?? { error: r };
1682
1763
  }
1683
1764
  async getPosts(e, t) {
1684
- let { data: n, code: r, message: i } = await this.req.get("community/posts", e || null, Ui, t);
1765
+ let { data: n, code: r, message: i } = await this.req.get("community/posts", e || null, qi, t);
1685
1766
  return n ?? {
1686
1767
  message: i,
1687
1768
  error: r
@@ -1692,35 +1773,35 @@ var yi = {
1692
1773
  forum_id: e,
1693
1774
  max_results: t,
1694
1775
  next_token: n
1695
- }, Ui, r);
1776
+ }, qi, r);
1696
1777
  return i ?? {
1697
1778
  message: o,
1698
1779
  error: a
1699
1780
  };
1700
1781
  }
1701
1782
  async getPost(e, t) {
1702
- let { data: n, code: r, message: i } = await this.req.get("community/post", { post_id: e }, Hi, t);
1783
+ let { data: n, code: r, message: i } = await this.req.get("community/post", { post_id: e }, Ki, t);
1703
1784
  return n?.post ?? {
1704
1785
  message: i,
1705
1786
  error: r
1706
1787
  };
1707
1788
  }
1708
1789
  async post(e, t) {
1709
- let { data: n, code: r, message: i } = await this.req.post("community/post", a(e), Wi, t);
1790
+ let { data: n, code: r, message: i } = await this.req.post("community/post", a(e), Ji, t);
1710
1791
  return n ?? {
1711
1792
  message: i,
1712
1793
  error: r
1713
1794
  };
1714
1795
  }
1715
1796
  async getComments(e, t) {
1716
- let { data: n, code: r, message: i } = await this.req.get("community/comments", e, Yi, t);
1797
+ let { data: n, code: r, message: i } = await this.req.get("community/comments", e, $i, t);
1717
1798
  return n ?? {
1718
1799
  message: i,
1719
1800
  error: r
1720
1801
  };
1721
1802
  }
1722
1803
  async getComment(e, t) {
1723
- let { data: n, code: r, message: i } = await this.req.get("community/comment", { comment_id: e }, Ji, t);
1804
+ let { data: n, code: r, message: i } = await this.req.get("community/comment", { comment_id: e }, Qi, t);
1724
1805
  return n?.comment ?? {
1725
1806
  message: i,
1726
1807
  error: r
@@ -1728,7 +1809,7 @@ var yi = {
1728
1809
  }
1729
1810
  async comment(e, t) {
1730
1811
  await this.token.autoLogin();
1731
- let { data: n, code: r, message: i } = await this.req.post("community/comment", a(e), Xi, t);
1812
+ let { data: n, code: r, message: i } = await this.req.post("community/comment", a(e), ea, t);
1732
1813
  return n ?? {
1733
1814
  message: i,
1734
1815
  error: r
@@ -1738,14 +1819,14 @@ var yi = {
1738
1819
  let { data: n } = await this.req.get("community/replies", {
1739
1820
  max_results: 20,
1740
1821
  ...e
1741
- }, Gi, t);
1822
+ }, Yi, t);
1742
1823
  return {
1743
1824
  replies: n?.replies || [],
1744
1825
  next_token: n?.next_token || ""
1745
1826
  };
1746
1827
  }
1747
1828
  async getReply(e, t) {
1748
- let { data: n, code: r, message: i } = await this.req.get("community/reply", { reply_id: e }, Ki, t);
1829
+ let { data: n, code: r, message: i } = await this.req.get("community/reply", { reply_id: e }, Xi, t);
1749
1830
  return n?.reply ?? {
1750
1831
  message: i,
1751
1832
  error: r
@@ -1753,7 +1834,7 @@ var yi = {
1753
1834
  }
1754
1835
  async reply(e, t) {
1755
1836
  await this.token.autoLogin();
1756
- let { data: n, code: r, message: i } = await this.req.post("community/reply", a(e), qi, t);
1837
+ let { data: n, code: r, message: i } = await this.req.post("community/reply", a(e), Zi, t);
1757
1838
  return n ?? {
1758
1839
  message: i,
1759
1840
  error: r
@@ -1783,7 +1864,7 @@ var yi = {
1783
1864
  }
1784
1865
  async getMediaPresignedUrl(e, t) {
1785
1866
  await this.token.autoLogin();
1786
- let { data: n } = await this.req.get("community/media-presign-url", e, Zi, t);
1867
+ let { data: n } = await this.req.get("community/media-presign-url", e, ta, t);
1787
1868
  return n;
1788
1869
  }
1789
1870
  async getNotifications(e, t) {
@@ -1791,7 +1872,7 @@ var yi = {
1791
1872
  let { data: n } = await this.req.get("community/notifications", {
1792
1873
  max_results: 20,
1793
1874
  ...e
1794
- }, Qi, t);
1875
+ }, na, t);
1795
1876
  return {
1796
1877
  notifications: n?.notifications || [],
1797
1878
  next_token: n?.next_token || ""
@@ -1799,7 +1880,7 @@ var yi = {
1799
1880
  }
1800
1881
  async getUnreadNotificationsCount(e) {
1801
1882
  if (!await this.token.autoLogin()) return null;
1802
- let { data: t } = await this.req.get("community/unread-notifications-count", null, $i, e);
1883
+ let { data: t } = await this.req.get("community/unread-notifications-count", null, ra, e);
1803
1884
  return t;
1804
1885
  }
1805
1886
  async clearUnreadNotifications(e, t) {
@@ -1807,11 +1888,11 @@ var yi = {
1807
1888
  let { ok: n } = await this.req.post("community/clear-unread-notifications", { category: e }, null, t);
1808
1889
  return n;
1809
1890
  }
1810
- }, ta = d({
1891
+ }, aa = d({
1811
1892
  nonce_str: f.string(),
1812
1893
  timestamp: f.number(),
1813
1894
  signature: f.string()
1814
- }), na = /* @__PURE__ */ function(e) {
1895
+ }), oa = /* @__PURE__ */ function(e) {
1815
1896
  return e.RedirectUriDisMatch = "10003", e.AppidError = "10016", e.AuthorizationError = "10015", e.NoRightForScope = "10005", e.Frequently = "10009", e.AppBanded = "10004", e.ShouldFollow = "10006", e.ScopeNull = "10010", e.RedirectUriNull = "10011", e.AppidNull = "10012", e.StateNull = "10013", e;
1816
1897
  }({});
1817
1898
  //#endregion
@@ -1821,7 +1902,7 @@ function $(e) {
1821
1902
  }
1822
1903
  //#endregion
1823
1904
  //#region src/weixin.ts
1824
- var ra = "wx_login_cache", ia = class {
1905
+ var sa = "wx_login_cache", ca = class {
1825
1906
  token;
1826
1907
  _appid;
1827
1908
  req;
@@ -1832,7 +1913,7 @@ var ra = "wx_login_cache", ia = class {
1832
1913
  return this._appid;
1833
1914
  }
1834
1915
  async getLoginCache() {
1835
- let e = this.token.storage.get(ra);
1916
+ let e = this.token.storage.get(sa);
1836
1917
  if (!e) return null;
1837
1918
  let t = i(e);
1838
1919
  return $(t) ? (this.token.weixinToken = t.weixin_token, await this.token.autoLogin(), t) : null;
@@ -1848,7 +1929,7 @@ var ra = "wx_login_cache", ia = class {
1848
1929
  ...e,
1849
1930
  message: !1
1850
1931
  });
1851
- return r && (this.token.weixinToken = r.weixin_token, this.token.storage.set(ra, JSON.stringify(r))), r ?? {
1932
+ return r && (this.token.weixinToken = r.weixin_token, this.token.storage.set(sa, JSON.stringify(r))), r ?? {
1852
1933
  message: a,
1853
1934
  error: i
1854
1935
  };
@@ -1890,7 +1971,7 @@ var ra = "wx_login_cache", ia = class {
1890
1971
  let { data: t } = await this.req.get("weixin/offiaccount/jssdk-sign", {
1891
1972
  appid: this.appid,
1892
1973
  url: location.href.split("#")[0]
1893
- }, ta, e);
1974
+ }, aa, e);
1894
1975
  return t ? {
1895
1976
  appid: this.appid,
1896
1977
  nonceStr: t.nonce_str,
@@ -1900,4 +1981,4 @@ var ra = "wx_login_cache", ia = class {
1900
1981
  }
1901
1982
  };
1902
1983
  //#endregion
1903
- export { K as AntispamValidator, se as AuthToken, Yn as CandidateVoteValidator, I as CashbackEngagementDataValidator, vn as ClaimActivationKeyEngagementDataValidator, Qe as ClaimRewardStatus, k as ClaimRewardStatusValidator, ar as ClaimedItemValidator, g as ClubAddressValidator, Ve as ClubApi, _ as ClubBenefitSummaryValidator, Te as ClubBenefitValidator, fe as ClubCreditChangeScene, pe as ClubCreditChangeSceneValidator, ue as ClubCreditChangeType, de as ClubCreditChangeTypeValidator, we as ClubCreditLogValidator, _e as ClubGlobalConfigValidator, me as ClubItemType, m as ClubItemTypeValidator, ve as ClubPlayerValidator, v as ClubProductValidator, he as ClubRedemptionStatus, ge as ClubRedemptionStatusValidator, Ce as ClubUserCreditValidator, Se as ClubUserProfileValidator, Qn as CommentEngagementValidator, J as CommentValidator, ea as CommunityApi, Xn as ConversationValidator, We as EngageAccountType, Ge as EngageAccountTypeValidator, ir as EngageResponseValidator, er as EngageRewardValidator, He as EventApi, fr as EventConfigValidator, bt as EventFeatureConfigOfCashbackValidator, St as EventFeatureConfigOfCheckInValidator, wt as EventFeatureConfigOfClaimActivationKeyValidator, Et as EventFeatureConfigOfClaimRewardsValidator, Ot as EventFeatureConfigOfCommentValidator, At as EventFeatureConfigOfFollowValidator, Nt as EventFeatureConfigOfGiftCodeValidator, Ft as EventFeatureConfigOfInviteValidator, Lt as EventFeatureConfigOfInvitedRegisterValidator, Ut as EventFeatureConfigOfLotteryDrawValidator, Vt as EventFeatureConfigOfLotteryValidator, Gt as EventFeatureConfigOfPreregisterValidator, qt as EventFeatureConfigOfQuestValidator, Xt as EventFeatureConfigOfRedeemValidator, $t as EventFeatureConfigOfReferralValidator, tn as EventFeatureConfigOfRegisterValidator, rn as EventFeatureConfigOfShareValidator, on as EventFeatureConfigOfSubscribeValidator, cn as EventFeatureConfigOfSurveyValidator, un as EventFeatureConfigOfTeamValidator, mn as EventFeatureConfigOfUgcLikeValidator, fn as EventFeatureConfigOfUgcValidator, cr as EventFeatureConfigOfVote2Validator, _n as EventFeatureConfigOfVoteValidator, dr as EventFeatureConfigValidator, Ke as EventPeriodType, qe as EventPeriodTypeValidator, N as EventRewardItemConfigValidator, Oe as ExtraGameRewardValidator, De as ExtraPhysicalShipmentValidator, Yt as FeatureRedeemItemConfigValidator, Qt as FeatureReferralTierItemValidator, vt as FeatureRewardValidator, T as FeatureType, Je as FeatureTypeValidator, Si as ForumMode, Ci as ForumModeValidator, U as ForumValidator, xi as GGDPublicApi, yi as GGDRoomStatus, bi as GGDRoomStatusValidator, S as GamerItemType, C as GamerItemTypeValidator, ce as Gender, le as GenderValidator, Nn as GenerateReferralRewardsResponseValidator, yn as GiftCodeEngagementDataValidator, L as InviteEngagementDataValidator, st as LotteryDrawAction, ct as LotteryDrawActionValidator, Cn as LotteryDrawEngagementDataValidator, bn as LotteryEngagementDataValidator, j as LotteryTicketStatus, nt as LotteryTicketStatusValidator, Y as NotificationBaseValidator, Ti as NotificationCategory, Ei as NotificationCategoryValidator, Pi as NotificationCommentReplyValidator, Fi as NotificationCommentValidator, Z as NotificationPayloadCommentValidator, X as NotificationPayloadPostValidator, Q as NotificationPayloadReplyValidator, Ai as NotificationPayloadSystemValidator, Ni as NotificationPostCommentValidator, Mi as NotificationPostValidator, Ii as NotificationReplyRepliedValidator, Li as NotificationReplyValidator, ji as NotificationSystemValidator, H as NotificationType, Di as NotificationTypeValidator, Ri as NotificationValidator, xe as PlayerRoleCardValidator, h as PlayerRoleValidator, wi as PostStatus, V as PostStatusValidator, G as PostValidator, wn as PreregisterEngagementDataValidator, ki as PresignedUrlResponseValidator, En as QuestEngagementDataValidator, Ye as QuestObjective, E as QuestObjectiveValidator, lt as QuestProgressAlgorithm, ut as QuestProgressAlgorithmValidator, Dn as QuestProgressValidator, On as RedeemEngagementDataValidator, Ee as RedeemParamsValidator, kn as RedeemStocksResponseValidator, ke as RedemptionValidator, at as ReferralAction, ot as ReferralActionValidator, jn as ReferralEngagementDataValidator, An as ReferralInviteValidator, _t as RegularRewardValidator, Oi as ReplyToValidator, q as ReplyValidator, Ue as RewardItemType, w as RewardItemTypeValidator, $e as RewardSource, A as RewardSourceValidator, D as RewardStatus, O as RewardStatusValidator, $n as RewardValidator, be as RoleBaseInfoValidator, ye as ServerBaseInfoValidator, Pn as ShareEngagementDataValidator, In as SurveyEngagementDataValidator, rt as TeamAction, it as TeamActionValidator, zn as TeamEngagementDataValidator, Ln as TeamEngagementValidator, Rn as TeamMemberValidator, et as TeamVisibility, tt as TeamVisibilityValidator, Mn as TierStatusValidator, W as TopicValidator, Un as UgcCountResponseValidator, Bn as UgcEngagementDataValidator, Gn as UgcLeaderboardResponseValidator, Vn as UgcRecordBaseResponseValidator, Hn as UgcRecordResponseValidator, mt as UgcReviewStatus, ht as UgcReviewStatusValidator, pt as UgcSocialMedia, M as UgcSocialMediaValidator, Wn as UgcUploadImageValidator, z as UserEngagementDataValidator, tr as UserEngagementValidator, rr as UserFeatureStatusValidator, R as UserRewardValidator, nr as VerifyMobileResultValidator, Jn as Vote2ClaimRewardsResponseValidator, qn as Vote2EngagementDataValidator, dt as Vote2RewardType, ft as Vote2RewardTypeValidator, Kn as VoteEngagementDataValidator, Xe as VoteOptionSource, Ze as VoteOptionSourceValidator, ia as WeixinApi, Fn as WeixinSubscribeEngagementDataValidator, na as WeixinWebLoginErrorCode, Zn as ZeroChatGPTDataValidator, Xr as claimRewards, si as claimRewardsV2, ci as claimWeixinHongbao, Yr as engage, vi as generateReferralRewards, ei as generateUnlimitQrcode, ii as getCashbackQuery, Vr as getConfig, Wr as getEngagements, Ur as getEngagementsCount, Hr as getEngagementsUserCount, $r as getParamsByQrcodeScene, ti as getQuestProgress, _i as getRedeemItemStocks, gi as getUgcLeaderboard, oi as getUgcMyCount, mi as getUgcRecommendation, ai as getUgcRecord, hi as getUgcs, Qr as getUnlimitQrcodeScene, qr as getUserEngagementCount, Jr as getUserEngagements, Kr as getUserFeatureStatus, fi as getUserItemCount, ui as getUserRewards, di as getUserRewardsCount, ri as getVote2Leaderboard, ta as isWeixinSignResponse, Zr as submitUserRewardAddress, pi as ugcUploadImage, li as verifyActivationKey, Br as verifyMobileAllowed, Gr as visit, ni as vote2Rewards };
1984
+ export { K as AntispamValidator, se as AuthToken, Yn as CandidateVoteValidator, I as CashbackEngagementDataValidator, vn as ClaimActivationKeyEngagementDataValidator, Qe as ClaimRewardStatus, k as ClaimRewardStatusValidator, ar as ClaimedItemValidator, _ as ClubAddressValidator, Ve as ClubApi, v as ClubBenefitSummaryValidator, we as ClubBenefitValidator, de as ClubCreditChangeScene, fe as ClubCreditChangeSceneValidator, le as ClubCreditChangeType, ue as ClubCreditChangeTypeValidator, Ce as ClubCreditLogValidator, ge as ClubGlobalConfigValidator, pe as ClubItemType, h as ClubItemTypeValidator, _e as ClubPlayerValidator, y as ClubProductValidator, me as ClubRedemptionStatus, he as ClubRedemptionStatusValidator, Se as ClubUserCreditValidator, xe as ClubUserProfileValidator, Qn as CommentEngagementValidator, J as CommentValidator, ia as CommunityApi, Xn as ConversationValidator, We as EngageAccountType, Ge as EngageAccountTypeValidator, ir as EngageResponseValidator, er as EngageRewardValidator, He as EventApi, fr as EventConfigValidator, bt as EventFeatureConfigOfCashbackValidator, St as EventFeatureConfigOfCheckInValidator, wt as EventFeatureConfigOfClaimActivationKeyValidator, Et as EventFeatureConfigOfClaimRewardsValidator, Ot as EventFeatureConfigOfCommentValidator, At as EventFeatureConfigOfFollowValidator, Nt as EventFeatureConfigOfGiftCodeValidator, Ft as EventFeatureConfigOfInviteValidator, Lt as EventFeatureConfigOfInvitedRegisterValidator, Ut as EventFeatureConfigOfLotteryDrawValidator, Vt as EventFeatureConfigOfLotteryValidator, Gt as EventFeatureConfigOfPreregisterValidator, qt as EventFeatureConfigOfQuestValidator, Xt as EventFeatureConfigOfRedeemValidator, $t as EventFeatureConfigOfReferralValidator, tn as EventFeatureConfigOfRegisterValidator, rn as EventFeatureConfigOfShareValidator, on as EventFeatureConfigOfSubscribeValidator, cn as EventFeatureConfigOfSurveyValidator, un as EventFeatureConfigOfTeamValidator, mn as EventFeatureConfigOfUgcLikeValidator, fn as EventFeatureConfigOfUgcValidator, cr as EventFeatureConfigOfVote2Validator, _n as EventFeatureConfigOfVoteValidator, dr as EventFeatureConfigValidator, Ke as EventPeriodType, qe as EventPeriodTypeValidator, N as EventRewardItemConfigValidator, De as ExtraGameRewardValidator, Ee as ExtraPhysicalShipmentValidator, Yt as FeatureRedeemItemConfigValidator, Qt as FeatureReferralTierItemValidator, vt as FeatureRewardValidator, T as FeatureType, Je as FeatureTypeValidator, Ei as ForumMode, Di as ForumModeValidator, U as ForumValidator, xi as GGDCareerCampType, Si as GGDCareerCampTypeValidator, Ci as GGDPlayerStatus, wi as GGDPlayerStatusValidator, Ti as GGDPublicApi, yi as GGDRoomStatus, bi as GGDRoomStatusValidator, S as GamerItemType, C as GamerItemTypeValidator, m as Gender, ce as GenderValidator, Nn as GenerateReferralRewardsResponseValidator, yn as GiftCodeEngagementDataValidator, L as InviteEngagementDataValidator, st as LotteryDrawAction, ct as LotteryDrawActionValidator, Cn as LotteryDrawEngagementDataValidator, bn as LotteryEngagementDataValidator, j as LotteryTicketStatus, nt as LotteryTicketStatusValidator, Y as NotificationBaseValidator, ki as NotificationCategory, Ai as NotificationCategoryValidator, Ri as NotificationCommentReplyValidator, zi as NotificationCommentValidator, Z as NotificationPayloadCommentValidator, X as NotificationPayloadPostValidator, Q as NotificationPayloadReplyValidator, Pi as NotificationPayloadSystemValidator, Li as NotificationPostCommentValidator, Ii as NotificationPostValidator, Bi as NotificationReplyRepliedValidator, Vi as NotificationReplyValidator, Fi as NotificationSystemValidator, H as NotificationType, ji as NotificationTypeValidator, Hi as NotificationValidator, be as PlayerRoleCardValidator, g as PlayerRoleValidator, Oi as PostStatus, V as PostStatusValidator, G as PostValidator, wn as PreregisterEngagementDataValidator, Ni as PresignedUrlResponseValidator, En as QuestEngagementDataValidator, Ye as QuestObjective, E as QuestObjectiveValidator, lt as QuestProgressAlgorithm, ut as QuestProgressAlgorithmValidator, Dn as QuestProgressValidator, On as RedeemEngagementDataValidator, Te as RedeemParamsValidator, kn as RedeemStocksResponseValidator, Oe as RedemptionValidator, at as ReferralAction, ot as ReferralActionValidator, jn as ReferralEngagementDataValidator, An as ReferralInviteValidator, _t as RegularRewardValidator, Mi as ReplyToValidator, q as ReplyValidator, Ue as RewardItemType, w as RewardItemTypeValidator, $e as RewardSource, A as RewardSourceValidator, D as RewardStatus, O as RewardStatusValidator, $n as RewardValidator, ye as RoleBaseInfoValidator, ve as ServerBaseInfoValidator, Pn as ShareEngagementDataValidator, In as SurveyEngagementDataValidator, rt as TeamAction, it as TeamActionValidator, zn as TeamEngagementDataValidator, Ln as TeamEngagementValidator, Rn as TeamMemberValidator, et as TeamVisibility, tt as TeamVisibilityValidator, Mn as TierStatusValidator, W as TopicValidator, Un as UgcCountResponseValidator, Bn as UgcEngagementDataValidator, Gn as UgcLeaderboardResponseValidator, Vn as UgcRecordBaseResponseValidator, Hn as UgcRecordResponseValidator, mt as UgcReviewStatus, ht as UgcReviewStatusValidator, pt as UgcSocialMedia, M as UgcSocialMediaValidator, Wn as UgcUploadImageValidator, z as UserEngagementDataValidator, tr as UserEngagementValidator, rr as UserFeatureStatusValidator, R as UserRewardValidator, nr as VerifyMobileResultValidator, Jn as Vote2ClaimRewardsResponseValidator, qn as Vote2EngagementDataValidator, dt as Vote2RewardType, ft as Vote2RewardTypeValidator, Kn as VoteEngagementDataValidator, Xe as VoteOptionSource, Ze as VoteOptionSourceValidator, ca as WeixinApi, Fn as WeixinSubscribeEngagementDataValidator, oa as WeixinWebLoginErrorCode, Zn as ZeroChatGPTDataValidator, Xr as claimRewards, si as claimRewardsV2, ci as claimWeixinHongbao, Yr as engage, vi as generateReferralRewards, ei as generateUnlimitQrcode, ii as getCashbackQuery, Vr as getConfig, Wr as getEngagements, Ur as getEngagementsCount, Hr as getEngagementsUserCount, $r as getParamsByQrcodeScene, ti as getQuestProgress, _i as getRedeemItemStocks, gi as getUgcLeaderboard, oi as getUgcMyCount, mi as getUgcRecommendation, ai as getUgcRecord, hi as getUgcs, Qr as getUnlimitQrcodeScene, qr as getUserEngagementCount, Jr as getUserEngagements, Kr as getUserFeatureStatus, fi as getUserItemCount, ui as getUserRewards, di as getUserRewardsCount, ri as getVote2Leaderboard, aa as isWeixinSignResponse, Zr as submitUserRewardAddress, pi as ugcUploadImage, li as verifyActivationKey, Br as verifyMobileAllowed, Gr as visit, ni as vote2Rewards };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/gamer-api",
3
- "version": "4.5.6",
3
+ "version": "4.6.0",
4
4
  "description": "agent for gamer api",
5
5
  "license": "MIT",
6
6
  "author": "web@seayoo.com",
@@ -30,16 +30,16 @@
30
30
  "@vitest/coverage-istanbul": "^4.1.4",
31
31
  "happy-dom": "^13.10.1",
32
32
  "vitest": "^4.1.4",
33
- "@seayoo-web/combo-webview": "2.9.8",
34
33
  "@seayoo-web/request": "4.1.3",
35
34
  "@seayoo-web/scripts": "4.3.11",
36
35
  "@seayoo-web/tsconfig": "1.0.7",
36
+ "@seayoo-web/validator": "2.3.1",
37
37
  "@seayoo-web/utils": "4.5.5",
38
- "@seayoo-web/validator": "2.3.1"
38
+ "@seayoo-web/combo-webview": "2.9.8"
39
39
  },
40
40
  "peerDependencies": {
41
- "@seayoo-web/utils": "^4.5.5",
42
41
  "@seayoo-web/combo-webview": "^2.9.8",
42
+ "@seayoo-web/utils": "^4.5.5",
43
43
  "@seayoo-web/validator": "^2.3.1"
44
44
  },
45
45
  "engines": {
@@ -1,13 +1,17 @@
1
+ import type { AuthToken } from "./token";
1
2
  import type { NetRequestFactory, RequestInternalError } from "@seayoo-web/request";
2
3
  /**
3
- * 鹅鸭杀(ggd)定制化 public 接口
4
+ * 鹅鸭杀(ggd)定制化 public 接口,如果需要调用需要登录态的接口,初始化需要传入 AuthToken
4
5
  */
5
6
  export declare class GGDPublicApi {
6
- req: ReturnType<NetRequestFactory>;
7
+ req: ReturnType<NetRequestFactory> | null;
8
+ constructor(authToken: AuthToken);
7
9
  constructor(endpoint: string, NetRequest: NetRequestFactory);
8
10
  /**
9
11
  * 获取鹅鸭杀房间内详情
10
12
  *
13
+ * 💡不需要登录
14
+ *
11
15
  * - 参数 `invitationCode` 默认从 url query 的 `invitation_code` 参数读取
12
16
  * - 参数 `serverId` 默认从 url query 的 `server_id` 参数读取
13
17
  * - 参数 `expiresAt` 默认从 url query 的 `expires_at` 参数读取
@@ -32,4 +36,79 @@ export declare class GGDPublicApi {
32
36
  error: RequestInternalError | "room_not_found" | "invitation_code_invalid" | "invitation_code_expired";
33
37
  message: string;
34
38
  }>;
39
+ /**
40
+ * 查询当前登录用户的游戏角色信息,包括角色编号、昵称、等级、行为分、领头鹅等级、头像、创角时间等
41
+ *
42
+ * 💡需要登录
43
+ *
44
+ * https://www.kdocs.cn/l/ccZPz3rWSl4o?linkname=NtItEHncF8
45
+ */
46
+ describeRole(): Promise<{
47
+ combo_id: string;
48
+ showid: number;
49
+ role_id: number;
50
+ role_name: string;
51
+ role_level: number;
52
+ avatar_url: string | undefined;
53
+ behavior_score: number;
54
+ lead_goose_level: number;
55
+ create_time: number;
56
+ } | {
57
+ error: "role_not_found" | RequestInternalError;
58
+ message: string;
59
+ }>;
60
+ /**
61
+ * 查询当前登录用户的对局统计数据,包括推理等级、巅峰数、各阵营胜率/胜场、击杀、票准率等
62
+ *
63
+ * 💡需要登录
64
+ *
65
+ * https://www.kdocs.cn/l/ccZPz3rWSl4o?linkname=CntoE573fE
66
+ *
67
+ * [GM 命令 DescribeRoleMatchStats](https://www.kdocs.cn/l/cnZbBuB5x12C?linkname=mhjVTRxSVD)
68
+ */
69
+ describeRoleMatchStats(roleId: number): Promise<{
70
+ inference_level: string | undefined;
71
+ recent_classic_survival_round: number | undefined;
72
+ recent_goose_vote_correct_rate: string | undefined;
73
+ recent_duck_vote_correct_rate: string | undefined;
74
+ recent_total_killed_count: number | undefined;
75
+ season_top_count: number | undefined;
76
+ goose_win_rate: string | undefined;
77
+ duck_win_rate: string | undefined;
78
+ neutral_win_rate: string | undefined;
79
+ goose_win_count: number | undefined;
80
+ duck_win_count: number | undefined;
81
+ neutral_win_count: number | undefined;
82
+ total_win_rate: string | undefined;
83
+ total_count: number | undefined;
84
+ goose_vote_correct_rate: string | undefined;
85
+ duck_vote_correct_rate: string | undefined;
86
+ total_killed_count: number | undefined;
87
+ } | {
88
+ error: "role_not_found" | RequestInternalError;
89
+ message: string;
90
+ }>;
91
+ /**
92
+ * 查询当前登录用户的对局记录,返回近 30 天的对局记录,最多 50 场。
93
+ *
94
+ * 除展示对局列表外,本接口返回条数同时作为「近 30 天总场次」的数据来源,修改返回上限或时间窗口时需同步评估影响
95
+ *
96
+ * 💡需要登录
97
+ *
98
+ * https://www.kdocs.cn/l/ccZPz3rWSl4o?linkname=NSvUAib1FA
99
+ *
100
+ * [GM 命令 ListRoleMatches](https://www.kdocs.cn/l/cnZbBuB5x12C?linkname=ftJhlIPOX2)
101
+ */
102
+ listRoleMatches(roleId: number): Promise<{
103
+ players_num: number;
104
+ end_time: number;
105
+ map_name: string;
106
+ career_camp: import("./ggd.enums").GGDCareerCampType;
107
+ player_status: import("./ggd.enums").GGDPlayerStatus;
108
+ career_name: string;
109
+ mode_name: string;
110
+ }[] | {
111
+ error: "role_not_found" | RequestInternalError;
112
+ message: string;
113
+ }>;
35
114
  }
@@ -0,0 +1,22 @@
1
+ import type { ValueOf } from "@seayoo-web/utils";
2
+ /** 房间状态 */
3
+ export declare const GGDRoomStatus: {
4
+ /** 等待中 */
5
+ readonly Waiting: 1;
6
+ /** 游戏中 */
7
+ readonly Playing: 2;
8
+ };
9
+ export type GGDRoomStatus = ValueOf<typeof GGDRoomStatus>;
10
+ export declare const GGDRoomStatusValidator: import("@seayoo-web/validator").NumberValidator<GGDRoomStatus, false, false> & {
11
+ int: never;
12
+ min: never;
13
+ max: never;
14
+ allowNaN: never;
15
+ allowInfinity: never;
16
+ unsafe: never;
17
+ enum: never;
18
+ disallow: never;
19
+ optional: never;
20
+ maybeNull: never;
21
+ lock: never;
22
+ };
@@ -20,3 +20,52 @@ export declare const GGDRoomStatusValidator: import("@seayoo-web/validator").Num
20
20
  maybeNull: never;
21
21
  lock: never;
22
22
  };
23
+ /** 对局所在阵营 */
24
+ export declare const GGDCareerCampType: {
25
+ readonly Unknown: 0;
26
+ readonly Goose: 1;
27
+ readonly Duck: 2;
28
+ readonly Bird: 3;
29
+ };
30
+ export type GGDCareerCampType = ValueOf<typeof GGDCareerCampType>;
31
+ export declare const GGDCareerCampTypeValidator: import("@seayoo-web/validator").NumberValidator<GGDCareerCampType, false, false> & {
32
+ int: never;
33
+ min: never;
34
+ max: never;
35
+ allowNaN: never;
36
+ allowInfinity: never;
37
+ unsafe: never;
38
+ enum: never;
39
+ disallow: never;
40
+ optional: never;
41
+ maybeNull: never;
42
+ lock: never;
43
+ };
44
+ /** 对局结果 */
45
+ export declare const GGDPlayerStatus: {
46
+ readonly Unknown: 0;
47
+ /** 胜利 */
48
+ readonly Win: 1;
49
+ /** 失败 */
50
+ readonly Lose: 2;
51
+ /** MVP */
52
+ readonly Mvp: 3;
53
+ /** 逃跑 */
54
+ readonly Flee: 4;
55
+ /** 踢下线,行为违规 */
56
+ readonly KickOut: 5;
57
+ };
58
+ export type GGDPlayerStatus = ValueOf<typeof GGDPlayerStatus>;
59
+ export declare const GGDPlayerStatusValidator: import("@seayoo-web/validator").NumberValidator<GGDPlayerStatus, false, false> & {
60
+ int: never;
61
+ min: never;
62
+ max: never;
63
+ allowNaN: never;
64
+ allowInfinity: never;
65
+ unsafe: never;
66
+ enum: never;
67
+ disallow: never;
68
+ optional: never;
69
+ maybeNull: never;
70
+ lock: never;
71
+ };