@seayoo-web/gamer-api 2.0.17 → 2.0.19

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
@@ -71,6 +71,11 @@ class hr {
71
71
  this.$NetRequest = n, this.req = n({
72
72
  baseURL: `${r}/v1`,
73
73
  timeout: 1e4,
74
+ maxRetry: 2,
75
+ retryInterval: "2EB",
76
+ retryResolve({ method: s, status: d }) {
77
+ return s === "GET" && d < 0;
78
+ },
74
79
  responseRule: {
75
80
  ok: { resolve: "body" },
76
81
  failed: {
@@ -307,12 +312,12 @@ const ve = {
307
312
  district: e.string(),
308
313
  address: e.string(),
309
314
  is_default: e.bool()
310
- }).lock(), De = e.object({
315
+ }).lock(), Ie = e.object({
311
316
  increased_credit: e.number(),
312
317
  decreased_credit: e.number(),
313
318
  expired_credit: e.number(),
314
319
  balance_credit: e.number()
315
- }).lock(), Ie = e.object({
320
+ }).lock(), De = e.object({
316
321
  id: e.number(),
317
322
  change_type: Ve,
318
323
  change_scene: Te,
@@ -392,8 +397,8 @@ const ve = {
392
397
  status: Se,
393
398
  created_at: e.number(),
394
399
  extra_data: e.union(Ne.clone(), Ae.clone()).satisfies().optional()
395
- }), Be = e.guard(Le), O = o({ player: Pe }), Qe = o({ roles: e.array(J) }), T = o({ role_card: Ue }), B = e.guard(Fe), Q = e.guard(K), Me = o({ addresses: e.array(K) }), He = e.guard(De), ze = o({
396
- credit_logs: e.array(Ie),
400
+ }), Be = e.guard(Le), O = o({ player: Pe }), Qe = o({ roles: e.array(J) }), T = o({ role_card: Ue }), B = e.guard(Fe), Q = e.guard(K), Me = o({ addresses: e.array(K) }), He = e.guard(Ie), ze = o({
401
+ credit_logs: e.array(De),
397
402
  next_token: e.string().optional()
398
403
  }), Je = o({ products: e.array(Y) }), Ke = o({ benefits: e.array(X) }), Xe = o({ benefit: Ge }), Ye = o({
399
404
  redemptions: e.array(Oe),
@@ -903,9 +908,9 @@ const R = {
903
908
  draw_not_before: e.number(),
904
909
  draw_not_after: e.number()
905
910
  })
906
- }), Dt = c.Preregister, It = e.object({
911
+ }), It = c.Preregister, Dt = e.object({
907
912
  ...u.shape,
908
- feature_type: e.string().enum(Dt)
913
+ feature_type: e.string().enum(It)
909
914
  }), Gt = c.Quest, Nt = e.object({
910
915
  ...u.shape,
911
916
  feature_type: e.string().enum(Gt),
@@ -980,7 +985,7 @@ const R = {
980
985
  St,
981
986
  $t,
982
987
  Ft,
983
- It,
988
+ Dt,
984
989
  Nt,
985
990
  Ot,
986
991
  Qt,
@@ -1183,7 +1188,7 @@ const R = {
1183
1188
  scene: e.string()
1184
1189
  }), Fn = o({
1185
1190
  params: e.string()
1186
- }), Dn = o({
1191
+ }), In = o({
1187
1192
  img: e.string()
1188
1193
  });
1189
1194
  class qr {
@@ -1428,16 +1433,16 @@ class qr {
1428
1433
  */
1429
1434
  async generateUnlimitQrcode(t) {
1430
1435
  if (!await this.token.autoLogin()) return null;
1431
- const { data: n } = await this.req.post("event/unlimit-qrcode", a(t), Dn);
1436
+ const { data: n } = await this.req.post("event/unlimit-qrcode", a(t), In);
1432
1437
  return (n == null ? void 0 : n.img) ?? null;
1433
1438
  }
1434
1439
  }
1435
- const In = {
1440
+ const Dn = {
1436
1441
  /** 所有人均可以发帖 */
1437
1442
  All: "all",
1438
1443
  /** 指定用户可发帖 */
1439
1444
  Limit: "limit"
1440
- }, Gn = e.string().enum(In).lock(), Nn = {
1445
+ }, Gn = e.string().enum(Dn).lock(), Nn = {
1441
1446
  /** 待审核(仅自己可见) */
1442
1447
  Pending: "pending",
1443
1448
  /** 审核通过 */
@@ -1493,7 +1498,7 @@ const In = {
1493
1498
  description: e.string(),
1494
1499
  tags: e.array(e.string()),
1495
1500
  post_num: e.number()
1496
- }).lock(), D = e.object({
1501
+ }).lock(), I = e.object({
1497
1502
  post_id: e.number(),
1498
1503
  forum: ae,
1499
1504
  posted_by: e.string(),
@@ -1501,6 +1506,7 @@ const In = {
1501
1506
  avatar_url: e.string(),
1502
1507
  title: e.string().optional(),
1503
1508
  content: e.string(),
1509
+ content_text_count: e.number(),
1504
1510
  summary: e.string(),
1505
1511
  like_num: e.number(),
1506
1512
  comments_num: e.number(),
@@ -1570,7 +1576,7 @@ const In = {
1570
1576
  }).lock(), Mn = e.object({
1571
1577
  system_message_subject: e.string(),
1572
1578
  system_message_content: e.string()
1573
- }).lock(), I = e.object({
1579
+ }).lock(), D = e.object({
1574
1580
  post_id: e.number(),
1575
1581
  post_subject: e.string(),
1576
1582
  post_summary: e.string(),
@@ -1587,7 +1593,7 @@ const In = {
1587
1593
  notification_type: e.string().enum(m.System)
1588
1594
  }), zn = e.object({
1589
1595
  ...y.shape,
1590
- ...I.shape,
1596
+ ...D.shape,
1591
1597
  notification_type: e.string().enum(
1592
1598
  m.PostPinned,
1593
1599
  m.PostHighlighted,
@@ -1596,7 +1602,7 @@ const In = {
1596
1602
  )
1597
1603
  }), Jn = e.object({
1598
1604
  ...y.shape,
1599
- ...I.shape,
1605
+ ...D.shape,
1600
1606
  ...j.shape,
1601
1607
  notification_type: e.string().enum(m.PostCommented)
1602
1608
  }), Kn = e.object({
@@ -1607,7 +1613,7 @@ const In = {
1607
1613
  }), Xn = e.object({
1608
1614
  ...y.shape,
1609
1615
  ...j.shape,
1610
- ...I.shape,
1616
+ ...D.shape,
1611
1617
  notification_type: e.string().enum(m.CommentLiked, m.CommentDeleted)
1612
1618
  }), Yn = e.object({
1613
1619
  ...y.shape,
@@ -1629,10 +1635,10 @@ const In = {
1629
1635
  Xn,
1630
1636
  Yn,
1631
1637
  Zn
1632
- ).satisfies().lock(), er = o({ forums: e.array(ae) }), tr = o({ topics: e.array(F) }), nr = o({ topic: F }), rr = o({ post: D }), M = o({
1633
- posts: e.array(D),
1638
+ ).satisfies().lock(), er = o({ forums: e.array(ae) }), tr = o({ topics: e.array(F) }), nr = o({ topic: F }), rr = o({ post: I }), M = o({
1639
+ posts: e.array(I),
1634
1640
  next_token: e.string().optional()
1635
- }), ir = o({ post: D, antispam: se }), or = o({
1641
+ }), ir = o({ post: I, antispam: se }), or = o({
1636
1642
  replies: e.array(V),
1637
1643
  next_token: e.string().optional()
1638
1644
  }), ar = o({ reply: V }), sr = o({
@@ -2039,7 +2045,7 @@ export {
2039
2045
  Te as ClubCreditChangeSceneValidator,
2040
2046
  Re as ClubCreditChangeType,
2041
2047
  Ve as ClubCreditChangeTypeValidator,
2042
- Ie as ClubCreditLogValidator,
2048
+ De as ClubCreditLogValidator,
2043
2049
  Le as ClubGlobalConfigValidator,
2044
2050
  qe as ClubItemType,
2045
2051
  z as ClubItemTypeValidator,
@@ -2047,7 +2053,7 @@ export {
2047
2053
  Y as ClubProductValidator,
2048
2054
  xe as ClubRedemptionStatus,
2049
2055
  Se as ClubRedemptionStatusValidator,
2050
- De as ClubUserCreditValidator,
2056
+ Ie as ClubUserCreditValidator,
2051
2057
  Fe as ClubUserProfileValidator,
2052
2058
  fn as CommentEngagementValidator,
2053
2059
  k as CommentValidator,
@@ -2068,7 +2074,7 @@ export {
2068
2074
  St as EventFeatureConfigOfInvitedRegisterValidator,
2069
2075
  Ft as EventFeatureConfigOfLotteryDrawValidator,
2070
2076
  $t as EventFeatureConfigOfLotteryValidator,
2071
- It as EventFeatureConfigOfPreregisterValidator,
2077
+ Dt as EventFeatureConfigOfPreregisterValidator,
2072
2078
  Nt as EventFeatureConfigOfQuestValidator,
2073
2079
  Ot as EventFeatureConfigOfRegisterValidator,
2074
2080
  Qt as EventFeatureConfigOfShareValidator,
@@ -2085,7 +2091,7 @@ export {
2085
2091
  gt as FeatureRewardValidator,
2086
2092
  c as FeatureType,
2087
2093
  nt as FeatureTypeValidator,
2088
- In as ForumMode,
2094
+ Dn as ForumMode,
2089
2095
  Gn as ForumModeValidator,
2090
2096
  ae as ForumValidator,
2091
2097
  R as GamerItemType,
@@ -2106,7 +2112,7 @@ export {
2106
2112
  Kn as NotificationCommentReplyValidator,
2107
2113
  Xn as NotificationCommentValidator,
2108
2114
  j as NotificationPayloadCommentValidator,
2109
- I as NotificationPayloadPostValidator,
2115
+ D as NotificationPayloadPostValidator,
2110
2116
  G as NotificationPayloadReplyValidator,
2111
2117
  Mn as NotificationPayloadSystemValidator,
2112
2118
  Jn as NotificationPostCommentValidator,
@@ -2121,7 +2127,7 @@ export {
2121
2127
  J as PlayerRoleValidator,
2122
2128
  Nn as PostStatus,
2123
2129
  oe as PostStatusValidator,
2124
- D as PostValidator,
2130
+ I as PostValidator,
2125
2131
  ln as PreregisterEngagementDataValidator,
2126
2132
  Qn as PresignedUrlResponseValidator,
2127
2133
  mn as QuestEngagementDataValidator,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@seayoo-web/gamer-api",
3
3
  "description": "agent for gamer api",
4
- "version": "2.0.17",
4
+ "version": "2.0.19",
5
5
  "type": "module",
6
6
  "source": "index.ts",
7
7
  "main": "./dist/index.js",
@@ -24,15 +24,15 @@
24
24
  "devDependencies": {
25
25
  "@types/node": "^22.13.1",
26
26
  "@seayoo-web/combo-webview": "^2.5.4",
27
- "@seayoo-web/utils": "^3.5.1",
28
- "@seayoo-web/request": "^3.0.4",
27
+ "@seayoo-web/request": "^3.1.1",
29
28
  "@seayoo-web/tsconfig": "^1.0.3",
30
- "@seayoo-web/scripts": "^2.1.0"
29
+ "@seayoo-web/utils": "^3.5.1",
30
+ "@seayoo-web/scripts": "^2.4.1"
31
31
  },
32
32
  "peerDependencies": {
33
- "@seayoo-web/request": "^3.0.4",
34
- "@seayoo-web/utils": "^3.5.1",
35
- "@seayoo-web/combo-webview": "^2.5.4"
33
+ "@seayoo-web/combo-webview": "^2.5.4",
34
+ "@seayoo-web/request": "^3.1.1",
35
+ "@seayoo-web/utils": "^3.5.1"
36
36
  },
37
37
  "scripts": {
38
38
  "prebuild": "pnpm -F request build && pnpm -F combo-webview build",
@@ -57,6 +57,8 @@ export interface Post {
57
57
  title?: string;
58
58
  /** 帖子内容,富文本 HTML 格式 */
59
59
  content: string;
60
+ /** 帖子内容纯文本长度,不含 html 标签部分 */
61
+ content_text_count: number;
60
62
  /** 帖子内容,纯文本格式 */
61
63
  summary: string;
62
64
  /** 点赞数量 */