@seayoo-web/gamer-api 2.7.0 → 2.8.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
@@ -322,7 +322,7 @@ const ke = {
322
322
  decreased_credit: e.number(),
323
323
  expired_credit: e.number(),
324
324
  balance_credit: e.number()
325
- }).lock(), De = e.object({
325
+ }).lock(), Ie = e.object({
326
326
  id: e.number(),
327
327
  change_type: Re,
328
328
  change_scene: je,
@@ -364,7 +364,7 @@ const ke = {
364
364
  created_at: e.number(),
365
365
  updated_at: e.number(),
366
366
  redeemable_quantity: e.number().optional()
367
- }).lock(), Ie = e.object({
367
+ }).lock(), De = e.object({
368
368
  ...C(W.shape, "tag"),
369
369
  product: ee.clone().optional()
370
370
  }).lock(), xr = e.union(
@@ -403,9 +403,9 @@ const ke = {
403
403
  created_at: e.number(),
404
404
  extra_data: e.union(Ge.clone(), Ae.clone()).satisfies().optional()
405
405
  }), Ne = e.guard(Se), M = s({ player: Le }), Be = s({ roles: e.array(X) }), q = s({ role_card: $e }), K = e.guard(Ue), H = e.guard(Y), Qe = s({ addresses: e.array(Y) }), Me = e.guard(Fe), Ke = s({
406
- credit_logs: e.array(De),
406
+ credit_logs: e.array(Ie),
407
407
  next_token: e.string().optional()
408
- }), He = s({ products: e.array(ee) }), ze = s({ benefits: e.array(W) }), Je = s({ benefit: Ie }), Ze = s({
408
+ }), He = s({ products: e.array(ee) }), ze = s({ benefits: e.array(W) }), Je = s({ benefit: De }), Ze = s({
409
409
  redemptions: e.array(Oe),
410
410
  next_token: e.string().optional()
411
411
  });
@@ -758,7 +758,11 @@ const R = {
758
758
  /** 游戏对局次数 */
759
759
  MatchCounts: "player_match_counts",
760
760
  /** 游戏对局天数 */
761
- MatchDays: "player_match_days"
761
+ MatchDays: "player_match_days",
762
+ /** 账号等级目标 */
763
+ PlayerLevel: "player_level",
764
+ /** 活动道具累计获取 */
765
+ EventItems: "event_items"
762
766
  }, re = e.string().enum(nt).lock(), rt = {
763
767
  /** 官方上传 */
764
768
  System: "system",
@@ -954,16 +958,16 @@ const R = {
954
958
  consume_item_desc: e.string().optional(),
955
959
  rewards: e.array($t)
956
960
  })
957
- }), Ft = u.LotteryDraw, Dt = e.object({
961
+ }), Ft = u.LotteryDraw, It = e.object({
958
962
  ...l.shape,
959
963
  feature_type: e.string().enum(Ft),
960
964
  config: e.object({
961
965
  draw_not_before: e.number(),
962
966
  draw_not_after: e.number()
963
967
  })
964
- }), It = u.Preregister, Gt = e.object({
968
+ }), Dt = u.Preregister, Gt = e.object({
965
969
  ...l.shape,
966
- feature_type: e.string().enum(It)
970
+ feature_type: e.string().enum(Dt)
967
971
  }), At = u.Quest, Ot = e.object({
968
972
  ...l.shape,
969
973
  feature_type: e.string().enum(At),
@@ -972,7 +976,9 @@ const R = {
972
976
  completion_value: e.number(),
973
977
  team: e.object({
974
978
  feature_id: e.number().optional(),
975
- completion_value: e.number()
979
+ completion_value: e.number(),
980
+ progress_algorithm: e.string().optional(),
981
+ top_n: e.number().optional()
976
982
  }).optional(),
977
983
  config: e.object({
978
984
  topic_id: e.number().optional(),
@@ -1045,7 +1051,7 @@ const R = {
1045
1051
  xt,
1046
1052
  Lt,
1047
1053
  Ut,
1048
- Dt,
1054
+ It,
1049
1055
  Gt,
1050
1056
  Ot,
1051
1057
  Bt,
@@ -1077,7 +1083,7 @@ const R = {
1077
1083
  avatar_url: e.string().optional()
1078
1084
  }), ln = e.object({
1079
1085
  lottery_count: e.number()
1080
- }), D = e.object({
1086
+ }), I = e.object({
1081
1087
  reward_id: e.number(),
1082
1088
  reward_item_id: e.number(),
1083
1089
  reward_source: U,
@@ -1103,7 +1109,7 @@ const R = {
1103
1109
  e.object({
1104
1110
  ticket: e.string(),
1105
1111
  status: e.string().enum(C(w, "Unknown", "Pending")),
1106
- reward: D
1112
+ reward: I
1107
1113
  })
1108
1114
  ).satisfies(), gn = e.object({
1109
1115
  tickets: e.array(dn)
@@ -1164,7 +1170,7 @@ const R = {
1164
1170
  comment: e.string(),
1165
1171
  video_note: e.number(),
1166
1172
  created_at: e.number()
1167
- }), I = e.union(
1173
+ }), D = e.union(
1168
1174
  pn,
1169
1175
  ln,
1170
1176
  fn,
@@ -1195,7 +1201,7 @@ const R = {
1195
1201
  reward_item_desc: e.string().optional(),
1196
1202
  reward_item_rating: e.number(),
1197
1203
  receive_time: e.number(),
1198
- extra_data: e.union(...I.validators, e.record(e.unknown())).satisfies().optional()
1204
+ extra_data: e.union(...D.validators, e.record(e.unknown())).satisfies().optional()
1199
1205
  }), jn = e.object({
1200
1206
  reward_id: e.number(),
1201
1207
  reward_item_id: e.number(),
@@ -1213,7 +1219,7 @@ const R = {
1213
1219
  event_id: e.number(),
1214
1220
  feature_id: e.number(),
1215
1221
  sequence: e.number(),
1216
- data: I.clone().optional(),
1222
+ data: D.clone().optional(),
1217
1223
  server_id: e.string().optional(),
1218
1224
  role_id: e.string().optional(),
1219
1225
  created_at: e.number(),
@@ -1231,7 +1237,7 @@ const R = {
1231
1237
  engagement_id: e.number(),
1232
1238
  sequence: e.number(),
1233
1239
  feature_id: e.number(),
1234
- data: I.clone().optional()
1240
+ data: D.clone().optional()
1235
1241
  }).optional(),
1236
1242
  rewards: e.array(jn).optional(),
1237
1243
  scan: e.bool().optional()
@@ -1242,19 +1248,19 @@ const R = {
1242
1248
  engagements: e.union(e.array(Rn), e.array(hn))
1243
1249
  }), Fn = s({
1244
1250
  status: e.array(xn)
1245
- }), Dn = s({
1246
- engagements_counts: e.record(e.number())
1247
1251
  }), In = s({
1252
+ engagements_counts: e.record(e.number())
1253
+ }), Dn = s({
1248
1254
  engagements: e.array(Tn),
1249
1255
  next_token: e.string().optional()
1250
1256
  }), Gn = e.guard(Sn), An = s({
1251
1257
  claimed_items: e.array(Ln)
1252
1258
  }), On = s({
1253
- rewards: e.array(D)
1259
+ rewards: e.array(I)
1254
1260
  }), Nn = s({
1255
1261
  reward_status: $
1256
1262
  }), Bn = s({
1257
- user_rewards: e.array(D),
1263
+ user_rewards: e.array(I),
1258
1264
  next_token: e.string().optional()
1259
1265
  }), Qn = s({
1260
1266
  scene: e.string()
@@ -1263,7 +1269,7 @@ const R = {
1263
1269
  }), Kn = s({
1264
1270
  img: e.string()
1265
1271
  });
1266
- class Dr {
1272
+ class Ir {
1267
1273
  token;
1268
1274
  event = 0;
1269
1275
  req;
@@ -1372,7 +1378,7 @@ class Dr {
1372
1378
  */
1373
1379
  async getUserEngagementCount(t, n) {
1374
1380
  if (!await this.token.autoLogin()) return {};
1375
- const { data: r } = await this.req.get("event/user-engagements-count", Dn, {
1381
+ const { data: r } = await this.req.get("event/user-engagements-count", In, {
1376
1382
  message: !1,
1377
1383
  params: c({ ...n, event_id: this.event, feature_id: t })
1378
1384
  });
@@ -1391,7 +1397,7 @@ class Dr {
1391
1397
  engagements: [],
1392
1398
  next_token: ""
1393
1399
  };
1394
- const { data: a } = await this.req.get("event/user-engagements", In, {
1400
+ const { data: a } = await this.req.get("event/user-engagements", Dn, {
1395
1401
  ...r,
1396
1402
  params: c({
1397
1403
  max_results: 20,
@@ -1624,7 +1630,7 @@ const Hn = {
1624
1630
  Comment: "comment",
1625
1631
  /** 点赞通知 */
1626
1632
  Like: "like"
1627
- }, Ir = e.string().enum(Zn).lock(), g = {
1633
+ }, Dr = e.string().enum(Zn).lock(), g = {
1628
1634
  /** 系统通知 */
1629
1635
  System: "system",
1630
1636
  /** 帖子被置顶 */
@@ -1686,7 +1692,7 @@ const Hn = {
1686
1692
  create_time: e.number()
1687
1693
  }).lock(), se = e.object({
1688
1694
  err_msg: e.string().optional()
1689
- }).lock(), Yn = e.object({
1695
+ }).optional().lock(), Yn = e.object({
1690
1696
  reply_id: e.number(),
1691
1697
  reply_content: e.string().optional(),
1692
1698
  replied_by: e.string(),
@@ -2286,12 +2292,12 @@ export {
2286
2292
  Y as ClubAddressValidator,
2287
2293
  Sr as ClubApi,
2288
2294
  W as ClubBenefitSummaryValidator,
2289
- Ie as ClubBenefitValidator,
2295
+ De as ClubBenefitValidator,
2290
2296
  Ve as ClubCreditChangeScene,
2291
2297
  je as ClubCreditChangeSceneValidator,
2292
2298
  Ce as ClubCreditChangeType,
2293
2299
  Re as ClubCreditChangeTypeValidator,
2294
- De as ClubCreditLogValidator,
2300
+ Ie as ClubCreditLogValidator,
2295
2301
  Se as ClubGlobalConfigValidator,
2296
2302
  Te as ClubItemType,
2297
2303
  Z as ClubItemTypeValidator,
@@ -2308,7 +2314,7 @@ export {
2308
2314
  Ye as EngageAccountTypeValidator,
2309
2315
  Sn as EngageResponseValidator,
2310
2316
  jn as EngageRewardValidator,
2311
- Dr as EventApi,
2317
+ Ir as EventApi,
2312
2318
  an as EventConfigValidator,
2313
2319
  pt as EventFeatureConfigOfCashbackValidator,
2314
2320
  bt as EventFeatureConfigOfCheckInValidator,
@@ -2319,7 +2325,7 @@ export {
2319
2325
  Tt as EventFeatureConfigOfGiftCodeValidator,
2320
2326
  xt as EventFeatureConfigOfInviteValidator,
2321
2327
  Lt as EventFeatureConfigOfInvitedRegisterValidator,
2322
- Dt as EventFeatureConfigOfLotteryDrawValidator,
2328
+ It as EventFeatureConfigOfLotteryDrawValidator,
2323
2329
  Ut as EventFeatureConfigOfLotteryValidator,
2324
2330
  Gt as EventFeatureConfigOfPreregisterValidator,
2325
2331
  Ot as EventFeatureConfigOfQuestValidator,
@@ -2355,7 +2361,7 @@ export {
2355
2361
  Pr as LotteryTicketStatusValidator,
2356
2362
  b as NotificationBaseValidator,
2357
2363
  Zn as NotificationCategory,
2358
- Ir as NotificationCategoryValidator,
2364
+ Dr as NotificationCategoryValidator,
2359
2365
  ar as NotificationCommentReplyValidator,
2360
2366
  ir as NotificationCommentValidator,
2361
2367
  j as NotificationPayloadCommentValidator,
@@ -2406,10 +2412,10 @@ export {
2406
2412
  ot as TeamVisibility,
2407
2413
  st as TeamVisibilityValidator,
2408
2414
  G as TopicValidator,
2409
- I as UserEngagementDataValidator,
2415
+ D as UserEngagementDataValidator,
2410
2416
  Tn as UserEngagementValidator,
2411
2417
  xn as UserFeatureStatusValidator,
2412
- D as UserRewardValidator,
2418
+ I as UserRewardValidator,
2413
2419
  qn as VerifyMobileResultValidator,
2414
2420
  kn as VoteEngagementDataValidator,
2415
2421
  rt as VoteOptionSource,
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.7.0",
4
+ "version": "2.8.0",
5
5
  "type": "module",
6
6
  "source": "index.ts",
7
7
  "main": "./dist/index.js",
@@ -31,8 +31,8 @@
31
31
  "devDependencies": {
32
32
  "@types/node": "^22.13.1",
33
33
  "@seayoo-web/combo-webview": "2.6.0",
34
- "@seayoo-web/scripts": "3.0.1",
35
34
  "@seayoo-web/request": "3.4.0",
35
+ "@seayoo-web/scripts": "3.0.5",
36
36
  "@seayoo-web/tsconfig": "1.0.5",
37
37
  "@seayoo-web/utils": "4.0.2",
38
38
  "@seayoo-web/validator": "1.0.1"
@@ -97,7 +97,7 @@ export declare class CommunityApi {
97
97
  topic_ids?: number[];
98
98
  }, requestOptions?: IRequestOptions): Promise<{
99
99
  post: import("./community.define").Post;
100
- antispam: import("./community.define").Antispam;
100
+ antispam: import("./community.define").Antispam | undefined;
101
101
  } | {
102
102
  message: string;
103
103
  error: RequestInternalError | "post_body_too_long" | "post_subject_too_long" | "post_tag_already_exists" | "moderation_check_text_error" | "moderation_check_image_error" | "unknown_moderation_suggestion" | "invalid_content_length" | "forum_disabled" | "not_allowed_to_post" | "please_real_name" | "post_tag_not_exists";
@@ -92,7 +92,7 @@ export interface Antispam {
92
92
  /** 安全检测返回异常提示 */
93
93
  err_msg?: string;
94
94
  }
95
- export declare const AntispamValidator: import("@seayoo-web/validator").ObjectValidator<Antispam, false, false> & {
95
+ export declare const AntispamValidator: import("@seayoo-web/validator").ObjectValidator<Antispam, true, false> & {
96
96
  plain: never;
97
97
  optional: never;
98
98
  maybeNull: never;
@@ -16,7 +16,7 @@ export declare const isGetPostsResponse: (data: unknown) => data is {
16
16
  };
17
17
  export declare const isCreatePostResponse: (data: unknown) => data is {
18
18
  post: import("./community.define").Post;
19
- antispam: import("./community.define").Antispam;
19
+ antispam: import("./community.define").Antispam | undefined;
20
20
  };
21
21
  export declare const isRelyListResponse: (data: unknown) => data is {
22
22
  replies: import("./community.define").Reply[];
@@ -12,6 +12,15 @@ export interface FeatureQuestConfig {
12
12
  feature_id?: number;
13
13
  /** 目标值 */
14
14
  completion_value: number;
15
+ /**
16
+ * 计算任务进度的算法。
17
+ * 支持以下取值:
18
+ * • sum 将所有队员的进度值求和,作为队伍进度值。
19
+ * • top_n 以进度值倒序排名第 N 的队员的进度值,作为队伍进度值。如果队伍人数不足 N,则队伍进度值为 0。N 的值来自于配置字段 top_n。
20
+ */
21
+ progress_algorithm?: string;
22
+ /** progress_algorithm 等于 top_n 时,N 的取值。 */
23
+ top_n?: number;
15
24
  };
16
25
  /** 任务专用配置,取决于任务目标类型 */
17
26
  config?: {
@@ -172,6 +172,10 @@ export declare const QuestObjective: {
172
172
  readonly MatchCounts: "player_match_counts";
173
173
  /** 游戏对局天数 */
174
174
  readonly MatchDays: "player_match_days";
175
+ /** 账号等级目标 */
176
+ readonly PlayerLevel: "player_level";
177
+ /** 活动道具累计获取 */
178
+ readonly EventItems: "event_items";
175
179
  };
176
180
  export type QuestObjective = ValueOf<typeof QuestObjective>;
177
181
  export declare const QuestObjectiveValidator: import("@seayoo-web/validator").StringValidator<QuestObjective, false, false> & {