@seayoo-web/gamer-api 2.0.20 → 2.1.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
@@ -312,12 +312,12 @@ const ve = {
312
312
  district: e.string(),
313
313
  address: e.string(),
314
314
  is_default: e.bool()
315
- }).lock(), Ie = e.object({
315
+ }).lock(), De = e.object({
316
316
  increased_credit: e.number(),
317
317
  decreased_credit: e.number(),
318
318
  expired_credit: e.number(),
319
319
  balance_credit: e.number()
320
- }).lock(), De = e.object({
320
+ }).lock(), Ie = e.object({
321
321
  id: e.number(),
322
322
  change_type: Ve,
323
323
  change_scene: Te,
@@ -397,8 +397,8 @@ const ve = {
397
397
  status: Se,
398
398
  created_at: e.number(),
399
399
  extra_data: e.union(Ne.clone(), Ae.clone()).satisfies().optional()
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),
400
+ }), Be = e.guard(Le), O = o({ player: Pe }), Me = o({ roles: e.array(J) }), T = o({ role_card: Ue }), B = e.guard(Fe), M = e.guard(K), Qe = o({ addresses: e.array(K) }), He = e.guard(De), ze = o({
401
+ credit_logs: e.array(Ie),
402
402
  next_token: e.string().optional()
403
403
  }), Je = o({ products: e.array(Y) }), Ke = o({ benefits: e.array(X) }), Xe = o({ benefit: Ge }), Ye = o({
404
404
  redemptions: e.array(Oe),
@@ -454,7 +454,7 @@ class kr {
454
454
  */
455
455
  async getRoles(t, n) {
456
456
  if (!await this.token.autoLogin()) return [];
457
- const { data: r } = await this.req.get("club/roles", Qe, {
457
+ const { data: r } = await this.req.get("club/roles", Me, {
458
458
  params: a({ player_id: t, refresh: n })
459
459
  });
460
460
  return (r == null ? void 0 : r.roles) || [];
@@ -520,7 +520,7 @@ class kr {
520
520
  */
521
521
  async getAddresses() {
522
522
  if (!await this.token.autoLogin()) return [];
523
- const { data: t } = await this.req.get("club/addresses", Me);
523
+ const { data: t } = await this.req.get("club/addresses", Qe);
524
524
  return (t == null ? void 0 : t.addresses) ?? [];
525
525
  }
526
526
  /**
@@ -530,7 +530,7 @@ class kr {
530
530
  */
531
531
  async addAddress(t) {
532
532
  if (!await this.token.autoLogin()) return null;
533
- const { data: n } = await this.req.post("/club/add-address", a(t), Q);
533
+ const { data: n } = await this.req.post("/club/add-address", a(t), M);
534
534
  return n;
535
535
  }
536
536
  /**
@@ -540,7 +540,7 @@ class kr {
540
540
  */
541
541
  async updateAddress(t) {
542
542
  await this.token.autoLogin();
543
- const { data: n, code: r } = await this.req.post("club/update-address", a(t), Q);
543
+ const { data: n, code: r } = await this.req.post("club/update-address", a(t), M);
544
544
  return n ?? { error: r };
545
545
  }
546
546
  /**
@@ -709,7 +709,11 @@ const R = {
709
709
  /** 社区发帖数量 */
710
710
  Posts: "community_posts",
711
711
  /** 社区评论数量 */
712
- Comments: "community_comments"
712
+ Comments: "community_comments",
713
+ /** 游戏对局次数 */
714
+ MatchCounts: "player_match_counts",
715
+ /** 游戏对局天数 */
716
+ MatchDays: "player_match_days"
713
717
  }, ee = e.string().enum(rt).lock(), it = {
714
718
  /** 官方上传 */
715
719
  System: "system",
@@ -908,9 +912,9 @@ const R = {
908
912
  draw_not_before: e.number(),
909
913
  draw_not_after: e.number()
910
914
  })
911
- }), It = c.Preregister, Dt = e.object({
915
+ }), Dt = c.Preregister, It = e.object({
912
916
  ...u.shape,
913
- feature_type: e.string().enum(It)
917
+ feature_type: e.string().enum(Dt)
914
918
  }), Gt = c.Quest, Nt = e.object({
915
919
  ...u.shape,
916
920
  feature_type: e.string().enum(Gt),
@@ -920,12 +924,17 @@ const R = {
920
924
  team: e.object({
921
925
  feature_id: e.number().optional(),
922
926
  completion_value: e.number()
927
+ }).optional(),
928
+ config: e.object({
929
+ topic_id: e.number().optional(),
930
+ required_players: e.number().min(1).optional(),
931
+ required_matches: e.number().min(1).optional()
923
932
  }).optional()
924
933
  })
925
934
  }), At = c.Register, Ot = e.object({
926
935
  ...u.shape,
927
936
  feature_type: e.string().enum(At)
928
- }), Bt = c.Share, Qt = e.object({
937
+ }), Bt = c.Share, Mt = e.object({
929
938
  ...u.shape,
930
939
  feature_type: e.string().enum(Bt),
931
940
  config: e.object({
@@ -933,9 +942,9 @@ const R = {
933
942
  jump_url: e.string().optional(),
934
943
  icon_url: e.string().optional()
935
944
  })
936
- }), Mt = c.Subscribe, Ht = e.object({
945
+ }), Qt = c.Subscribe, Ht = e.object({
937
946
  ...u.shape,
938
- feature_type: e.string().enum(Mt),
947
+ feature_type: e.string().enum(Qt),
939
948
  config: e.object({
940
949
  weixin_template_ids: e.array(e.string())
941
950
  })
@@ -985,10 +994,10 @@ const R = {
985
994
  St,
986
995
  $t,
987
996
  Ft,
988
- Dt,
997
+ It,
989
998
  Nt,
990
999
  Ot,
991
- Qt,
1000
+ Mt,
992
1001
  Ht,
993
1002
  Jt,
994
1003
  Xt,
@@ -1188,7 +1197,7 @@ const R = {
1188
1197
  scene: e.string()
1189
1198
  }), Fn = o({
1190
1199
  params: e.string()
1191
- }), In = o({
1200
+ }), Dn = o({
1192
1201
  img: e.string()
1193
1202
  });
1194
1203
  class qr {
@@ -1433,16 +1442,16 @@ class qr {
1433
1442
  */
1434
1443
  async generateUnlimitQrcode(t) {
1435
1444
  if (!await this.token.autoLogin()) return null;
1436
- const { data: n } = await this.req.post("event/unlimit-qrcode", a(t), In);
1445
+ const { data: n } = await this.req.post("event/unlimit-qrcode", a(t), Dn);
1437
1446
  return (n == null ? void 0 : n.img) ?? null;
1438
1447
  }
1439
1448
  }
1440
- const Dn = {
1449
+ const In = {
1441
1450
  /** 所有人均可以发帖 */
1442
1451
  All: "all",
1443
1452
  /** 指定用户可发帖 */
1444
1453
  Limit: "limit"
1445
- }, Gn = e.string().enum(Dn).lock(), Nn = {
1454
+ }, Gn = e.string().enum(In).lock(), Nn = {
1446
1455
  /** 待审核(仅自己可见) */
1447
1456
  Pending: "pending",
1448
1457
  /** 审核通过 */
@@ -1498,7 +1507,7 @@ const Dn = {
1498
1507
  description: e.string(),
1499
1508
  tags: e.array(e.string()),
1500
1509
  post_num: e.number()
1501
- }).lock(), I = e.object({
1510
+ }).lock(), D = e.object({
1502
1511
  post_id: e.number(),
1503
1512
  forum: ae,
1504
1513
  posted_by: e.string(),
@@ -1561,7 +1570,7 @@ const Dn = {
1561
1570
  create_time: e.number(),
1562
1571
  status: oe,
1563
1572
  replies: e.array(V).optional()
1564
- }).lock(), Qn = e.object({
1573
+ }).lock(), Mn = e.object({
1565
1574
  image_url: e.string(),
1566
1575
  upload_url: e.string(),
1567
1576
  existed: e.bool()
@@ -1573,10 +1582,10 @@ const Dn = {
1573
1582
  origin_user_id: e.string(),
1574
1583
  origin_user_name: e.string(),
1575
1584
  origin_user_avatar_url: e.string()
1576
- }).lock(), Mn = e.object({
1585
+ }).lock(), Qn = e.object({
1577
1586
  system_message_subject: e.string(),
1578
1587
  system_message_content: e.string()
1579
- }).lock(), D = e.object({
1588
+ }).lock(), I = e.object({
1580
1589
  post_id: e.number(),
1581
1590
  post_subject: e.string(),
1582
1591
  post_summary: e.string(),
@@ -1589,11 +1598,11 @@ const Dn = {
1589
1598
  reply_content: e.string()
1590
1599
  }).lock(), Hn = e.object({
1591
1600
  ...y.shape,
1592
- ...Mn.shape,
1601
+ ...Qn.shape,
1593
1602
  notification_type: e.string().enum(m.System)
1594
1603
  }), zn = e.object({
1595
1604
  ...y.shape,
1596
- ...D.shape,
1605
+ ...I.shape,
1597
1606
  notification_type: e.string().enum(
1598
1607
  m.PostPinned,
1599
1608
  m.PostHighlighted,
@@ -1602,7 +1611,7 @@ const Dn = {
1602
1611
  )
1603
1612
  }), Jn = e.object({
1604
1613
  ...y.shape,
1605
- ...D.shape,
1614
+ ...I.shape,
1606
1615
  ...j.shape,
1607
1616
  notification_type: e.string().enum(m.PostCommented)
1608
1617
  }), Kn = e.object({
@@ -1613,7 +1622,7 @@ const Dn = {
1613
1622
  }), Xn = e.object({
1614
1623
  ...y.shape,
1615
1624
  ...j.shape,
1616
- ...D.shape,
1625
+ ...I.shape,
1617
1626
  notification_type: e.string().enum(m.CommentLiked, m.CommentDeleted)
1618
1627
  }), Yn = e.object({
1619
1628
  ...y.shape,
@@ -1635,10 +1644,10 @@ const Dn = {
1635
1644
  Xn,
1636
1645
  Yn,
1637
1646
  Zn
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),
1647
+ ).satisfies().lock(), er = o({ forums: e.array(ae) }), tr = o({ topics: e.array(F) }), nr = o({ topic: F }), rr = o({ post: D }), Q = o({
1648
+ posts: e.array(D),
1640
1649
  next_token: e.string().optional()
1641
- }), ir = o({ post: I, antispam: se }), or = o({
1650
+ }), ir = o({ post: D, antispam: se }), or = o({
1642
1651
  replies: e.array(V),
1643
1652
  next_token: e.string().optional()
1644
1653
  }), ar = o({ reply: V }), sr = o({
@@ -1650,7 +1659,7 @@ const Dn = {
1650
1659
  }), lr = o({
1651
1660
  comment: k.clone().optional(),
1652
1661
  antispam: k.clone().optional()
1653
- }), mr = e.guard(Qn), dr = o({
1662
+ }), mr = e.guard(Mn), dr = o({
1654
1663
  notifications: e.array(Wn),
1655
1664
  next_token: e.string().optional()
1656
1665
  }), gr = o({
@@ -1699,7 +1708,7 @@ class Sr {
1699
1708
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=XKI9lDVrPq
1700
1709
  */
1701
1710
  async getPosts(t) {
1702
- const { data: n, code: r } = await this.req.get("community/posts", M, {
1711
+ const { data: n, code: r } = await this.req.get("community/posts", Q, {
1703
1712
  params: a(t)
1704
1713
  });
1705
1714
  return n ?? { error: r };
@@ -1710,7 +1719,7 @@ class Sr {
1710
1719
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=yXubbZuDlC
1711
1720
  */
1712
1721
  async getPinnedPosts(t, n, r) {
1713
- const { data: s, code: d } = await this.req.get("community/pinned-posts", M, {
1722
+ const { data: s, code: d } = await this.req.get("community/pinned-posts", Q, {
1714
1723
  params: a({ forum_id: t, max_results: n, next_token: r })
1715
1724
  });
1716
1725
  return s ?? { error: d };
@@ -2045,7 +2054,7 @@ export {
2045
2054
  Te as ClubCreditChangeSceneValidator,
2046
2055
  Re as ClubCreditChangeType,
2047
2056
  Ve as ClubCreditChangeTypeValidator,
2048
- De as ClubCreditLogValidator,
2057
+ Ie as ClubCreditLogValidator,
2049
2058
  Le as ClubGlobalConfigValidator,
2050
2059
  qe as ClubItemType,
2051
2060
  z as ClubItemTypeValidator,
@@ -2053,7 +2062,7 @@ export {
2053
2062
  Y as ClubProductValidator,
2054
2063
  xe as ClubRedemptionStatus,
2055
2064
  Se as ClubRedemptionStatusValidator,
2056
- Ie as ClubUserCreditValidator,
2065
+ De as ClubUserCreditValidator,
2057
2066
  Fe as ClubUserProfileValidator,
2058
2067
  fn as CommentEngagementValidator,
2059
2068
  k as CommentValidator,
@@ -2074,10 +2083,10 @@ export {
2074
2083
  St as EventFeatureConfigOfInvitedRegisterValidator,
2075
2084
  Ft as EventFeatureConfigOfLotteryDrawValidator,
2076
2085
  $t as EventFeatureConfigOfLotteryValidator,
2077
- Dt as EventFeatureConfigOfPreregisterValidator,
2086
+ It as EventFeatureConfigOfPreregisterValidator,
2078
2087
  Nt as EventFeatureConfigOfQuestValidator,
2079
2088
  Ot as EventFeatureConfigOfRegisterValidator,
2080
- Qt as EventFeatureConfigOfShareValidator,
2089
+ Mt as EventFeatureConfigOfShareValidator,
2081
2090
  Ht as EventFeatureConfigOfSubscribeValidator,
2082
2091
  Jt as EventFeatureConfigOfSurveyValidator,
2083
2092
  Xt as EventFeatureConfigOfTeamValidator,
@@ -2091,7 +2100,7 @@ export {
2091
2100
  gt as FeatureRewardValidator,
2092
2101
  c as FeatureType,
2093
2102
  nt as FeatureTypeValidator,
2094
- Dn as ForumMode,
2103
+ In as ForumMode,
2095
2104
  Gn as ForumModeValidator,
2096
2105
  ae as ForumValidator,
2097
2106
  R as GamerItemType,
@@ -2112,9 +2121,9 @@ export {
2112
2121
  Kn as NotificationCommentReplyValidator,
2113
2122
  Xn as NotificationCommentValidator,
2114
2123
  j as NotificationPayloadCommentValidator,
2115
- D as NotificationPayloadPostValidator,
2124
+ I as NotificationPayloadPostValidator,
2116
2125
  G as NotificationPayloadReplyValidator,
2117
- Mn as NotificationPayloadSystemValidator,
2126
+ Qn as NotificationPayloadSystemValidator,
2118
2127
  Jn as NotificationPostCommentValidator,
2119
2128
  zn as NotificationPostValidator,
2120
2129
  Yn as NotificationReplyRepliedValidator,
@@ -2127,9 +2136,9 @@ export {
2127
2136
  J as PlayerRoleValidator,
2128
2137
  Nn as PostStatus,
2129
2138
  oe as PostStatusValidator,
2130
- I as PostValidator,
2139
+ D as PostValidator,
2131
2140
  ln as PreregisterEngagementDataValidator,
2132
- Qn as PresignedUrlResponseValidator,
2141
+ Mn as PresignedUrlResponseValidator,
2133
2142
  mn as QuestEngagementDataValidator,
2134
2143
  rt as QuestObjective,
2135
2144
  ee as QuestObjectiveValidator,
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.20",
4
+ "version": "2.1.0",
5
5
  "type": "module",
6
6
  "source": "index.ts",
7
7
  "main": "./dist/index.js",
@@ -24,10 +24,10 @@
24
24
  "devDependencies": {
25
25
  "@types/node": "^22.13.1",
26
26
  "@seayoo-web/combo-webview": "^2.5.4",
27
- "@seayoo-web/tsconfig": "^1.0.3",
28
- "@seayoo-web/utils": "^3.5.1",
29
27
  "@seayoo-web/scripts": "^2.4.1",
30
- "@seayoo-web/request": "^3.1.4"
28
+ "@seayoo-web/request": "^3.1.4",
29
+ "@seayoo-web/utils": "^3.5.1",
30
+ "@seayoo-web/tsconfig": "^1.0.3"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@seayoo-web/combo-webview": "^2.5.4",
@@ -1,6 +1,6 @@
1
1
  import { type InferType } from "@seayoo-web/utils";
2
2
  import { type EventFeatureBaseConfig } from "./feature.base";
3
- declare const rewardItemTypeValidator: import("@seayoo-web/utils").StringValidator<"credit" | "event_item" | "game_item" | "physical_item" | "weixin_hongbao" | "external_gift_code" | "void_item", false, false>;
3
+ declare const rewardItemTypeValidator: import("@seayoo-web/utils").StringValidator<"event_item" | "game_item" | "physical_item" | "weixin_hongbao" | "credit" | "external_gift_code" | "void_item", false, false>;
4
4
  declare const featureType: "lottery";
5
5
  export interface FeatureLotteryItemConfig {
6
6
  /** 抽奖奖励道具 id */
@@ -13,6 +13,15 @@ export interface FeatureQuestConfig {
13
13
  /** 目标值 */
14
14
  completion_value: number;
15
15
  };
16
+ /** 任务专用配置,取决于任务目标类型 */
17
+ config?: {
18
+ /** 当任务目标为 community_posts 和 community_comments 有效,表示关联的社区话题,可能无值 */
19
+ topic_id?: number;
20
+ /** 参与对局的玩家数量,当任务目标为 player_match_counts 和 player_match_days 有效,不小于 1 */
21
+ required_players?: number;
22
+ /** 单日对局次数,当任务目标为 player_match_days 有效,不小于 1 */
23
+ required_matches?: number;
24
+ };
16
25
  }
17
26
  export type EventFeatureConfigOfQuest = EventFeatureBaseConfig & {
18
27
  feature_type: typeof featureType;
@@ -1,5 +1,5 @@
1
1
  import { type InferType } from "@seayoo-web/utils";
2
- declare const rewardItemTypeValidator: import("@seayoo-web/utils").StringValidator<"credit" | "event_item" | "game_item" | "physical_item" | "weixin_hongbao" | "external_gift_code" | "void_item", false, false>;
2
+ declare const rewardItemTypeValidator: import("@seayoo-web/utils").StringValidator<"event_item" | "game_item" | "physical_item" | "weixin_hongbao" | "credit" | "external_gift_code" | "void_item", false, false>;
3
3
  export interface EventRewardItemConfig {
4
4
  /** 玩法奖励道具 id */
5
5
  reward_item_id: number;
@@ -160,6 +160,10 @@ export declare const QuestObjective: {
160
160
  readonly Posts: "community_posts";
161
161
  /** 社区评论数量 */
162
162
  readonly Comments: "community_comments";
163
+ /** 游戏对局次数 */
164
+ readonly MatchCounts: "player_match_counts";
165
+ /** 游戏对局天数 */
166
+ readonly MatchDays: "player_match_days";
163
167
  };
164
168
  export type QuestObjective = ValueOf<typeof QuestObjective>;
165
169
  export declare const QuestObjectiveValidator: import("@seayoo-web/utils").StringValidator<QuestObjective, false, false> & {