@seayoo-web/gamer-api 2.12.3 → 2.12.5

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
@@ -778,7 +778,7 @@ const v = {
778
778
  UserSubmission: "user_submission",
779
779
  /** 投票入围 */
780
780
  Shortlisted: "shortlisted"
781
- }, ot = e.string().enum(at).lock(), d = {
781
+ }, ot = e.string().enum(at).lock(), g = {
782
782
  /** 未获得奖励 */
783
783
  Ineligible: "ineligible",
784
784
  /** 奖励未领取 */
@@ -789,26 +789,26 @@ const v = {
789
789
  Failed: "failed",
790
790
  /** 奖励已发货 */
791
791
  Delivered: "delivered"
792
- }, oa = e.string().enum(d).lock(), it = {
792
+ }, oa = e.string().enum(g).lock(), it = {
793
793
  /** 奖励未领取 */
794
- Unclaimed: d.Unclaimed,
794
+ Unclaimed: g.Unclaimed,
795
795
  /** 奖励已领取 */
796
- Received: d.Received,
796
+ Received: g.Received,
797
797
  /** 奖励发放失败 */
798
- Failed: d.Failed,
798
+ Failed: g.Failed,
799
799
  /** 奖励已发货 */
800
- Delivered: d.Delivered
800
+ Delivered: g.Delivered
801
801
  }, te = e.string().enum(it).lock(), st = {
802
802
  /** 未获得奖励 */
803
- Ineligible: d.Ineligible,
803
+ Ineligible: g.Ineligible,
804
804
  /** 奖励未领取 */
805
- Unclaimed: d.Unclaimed,
805
+ Unclaimed: g.Unclaimed,
806
806
  /** 奖励已领取 */
807
- Received: d.Received,
807
+ Received: g.Received,
808
808
  /** 奖励发放失败 */
809
- Failed: d.Failed,
809
+ Failed: g.Failed,
810
810
  /** 奖励已发货 */
811
- Delivered: d.Delivered
811
+ Delivered: g.Delivered
812
812
  }, E = e.string().enum(st).lock(), ct = {
813
813
  /** 玩法产出奖励 */
814
814
  Output: "output",
@@ -1223,7 +1223,7 @@ const v = {
1223
1223
  })
1224
1224
  )
1225
1225
  }), Fn = e.object({
1226
- ugc_id: e.string(),
1226
+ ugc_id: e.number(),
1227
1227
  title: e.string(),
1228
1228
  content: e.string().optional(),
1229
1229
  image_urls: e.array(e.string()).optional(),
@@ -1243,7 +1243,8 @@ const v = {
1243
1243
  server_name: e.string().optional(),
1244
1244
  role_id: e.string().optional(),
1245
1245
  role_name: e.string().optional(),
1246
- total_likes: e.number().optional()
1246
+ total_likes: e.number().optional(),
1247
+ created_at: e.number()
1247
1248
  })
1248
1249
  ).optional(),
1249
1250
  next_token: e.string().optional()
@@ -1535,7 +1536,7 @@ class ua {
1535
1536
  */
1536
1537
  async engage(t, n, r, a) {
1537
1538
  await this.token.autoLogin();
1538
- const { data: o, code: g, message: p } = await this.req.post(
1539
+ const { data: o, code: d, message: p } = await this.req.post(
1539
1540
  `event/${this.event}/engage`,
1540
1541
  c({
1541
1542
  feature_id: t,
@@ -1547,7 +1548,7 @@ class ua {
1547
1548
  );
1548
1549
  return o ?? {
1549
1550
  message: p,
1550
- error: g
1551
+ error: d
1551
1552
  };
1552
1553
  }
1553
1554
  /**
@@ -1799,20 +1800,21 @@ class ua {
1799
1800
  *
1800
1801
  * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=biEwrNKhAF
1801
1802
  */
1802
- async getUgcRecord(t, n) {
1803
+ async getUgcRecord(t, n, r) {
1803
1804
  if (!await this.token.autoLogin()) return null;
1804
- const { data: r, code: a, message: o } = await this.req.get("event/ugc/my", hr, {
1805
- ...n,
1805
+ const { data: a, code: o, message: d } = await this.req.get("event/ugc/my", hr, {
1806
+ ...r,
1806
1807
  params: {
1808
+ feature_id: t,
1807
1809
  max_results: 20,
1808
- ...t,
1810
+ ...n,
1809
1811
  event_id: this.event
1810
1812
  /** 查询返回最大参与记录数 */
1811
1813
  }
1812
1814
  });
1813
- return r || {
1814
- message: o,
1815
- error: a
1815
+ return a || {
1816
+ message: d,
1817
+ error: o
1816
1818
  };
1817
1819
  }
1818
1820
  /**
@@ -1824,17 +1826,17 @@ class ua {
1824
1826
  *
1825
1827
  * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=xhGGpJEbol
1826
1828
  */
1827
- async ugcUploadImage(t, n) {
1829
+ async ugcUploadImage(t, n, r) {
1828
1830
  if (!await this.token.autoLogin()) return null;
1829
- const { data: r, code: a, message: o } = await this.req.post(
1831
+ const { data: a, code: o, message: d } = await this.req.post(
1830
1832
  "event/ugc/upload-image",
1831
- { ...t, event_id: this.event },
1833
+ { feature_id: t, ...n, event_id: this.event },
1832
1834
  fr,
1833
- n
1835
+ r
1834
1836
  );
1835
- return r || {
1836
- message: o,
1837
- code: a
1837
+ return a || {
1838
+ message: d,
1839
+ code: o
1838
1840
  };
1839
1841
  }
1840
1842
  }
@@ -2119,13 +2121,13 @@ class da {
2119
2121
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=yXubbZuDlC
2120
2122
  */
2121
2123
  async getPinnedPosts(t, n, r, a) {
2122
- const { data: o, code: g, message: p } = await this.req.get("community/pinned-posts", M, {
2124
+ const { data: o, code: d, message: p } = await this.req.get("community/pinned-posts", M, {
2123
2125
  ...a,
2124
2126
  params: c({ forum_id: t, max_results: n, next_token: r })
2125
2127
  });
2126
2128
  return o ?? {
2127
2129
  message: p,
2128
- error: g
2130
+ error: d
2129
2131
  };
2130
2132
  }
2131
2133
  /**
@@ -2418,14 +2420,14 @@ class ga {
2418
2420
  const n = await this.getLoginCache();
2419
2421
  if (n)
2420
2422
  return n;
2421
- const r = await fe(), { data: a, code: o, message: g } = await this.req.post(
2423
+ const r = await fe(), { data: a, code: o, message: d } = await this.req.post(
2422
2424
  "weixin/login",
2423
2425
  { code: r, appid: this.appid },
2424
2426
  S,
2425
2427
  { ...t, message: !1 }
2426
2428
  );
2427
2429
  return a && (this.token.weixinToken = a.weixin_token, this.token.storage.set(K, JSON.stringify(a))), a ?? {
2428
- message: g,
2430
+ message: d,
2429
2431
  error: o
2430
2432
  };
2431
2433
  }
@@ -2459,8 +2461,8 @@ class ga {
2459
2461
  message: "Error: " + r,
2460
2462
  error: r
2461
2463
  };
2462
- const g = G(["code", "state"]);
2463
- "replaceState" in history && history.replaceState({}, "", g);
2464
+ const d = G(["code", "state"]);
2465
+ "replaceState" in history && history.replaceState({}, "", d);
2464
2466
  const {
2465
2467
  data: p,
2466
2468
  code: ce,
@@ -2634,7 +2636,7 @@ export {
2634
2636
  W as RewardItemTypeValidator,
2635
2637
  ct as RewardSource,
2636
2638
  $ as RewardSourceValidator,
2637
- d as RewardStatus,
2639
+ g as RewardStatus,
2638
2640
  it as RewardStatusSuffix,
2639
2641
  te as RewardStatusSuffixValidator,
2640
2642
  oa as RewardStatusValidator,
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.12.3",
4
+ "version": "2.12.5",
5
5
  "type": "module",
6
6
  "source": "index.ts",
7
7
  "main": "./dist/index.js",
@@ -31,16 +31,16 @@
31
31
  "devDependencies": {
32
32
  "@types/node": "^22.13.1",
33
33
  "@seayoo-web/combo-webview": "2.8.0",
34
- "@seayoo-web/tsconfig": "1.0.5",
35
34
  "@seayoo-web/scripts": "3.1.5",
36
- "@seayoo-web/utils": "4.1.3",
37
35
  "@seayoo-web/request": "3.4.0",
36
+ "@seayoo-web/tsconfig": "1.0.5",
37
+ "@seayoo-web/utils": "4.1.3",
38
38
  "@seayoo-web/validator": "1.1.1"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@seayoo-web/combo-webview": "^2.8.0",
42
- "@seayoo-web/validator": "^1.1.1",
43
- "@seayoo-web/utils": "^4.1.3"
42
+ "@seayoo-web/utils": "^4.1.3",
43
+ "@seayoo-web/validator": "^1.1.1"
44
44
  },
45
45
  "scripts": {
46
46
  "prebuild": "pnpm -F validator build && pnpm -F request build && pnpm -F combo-webview build",
@@ -343,8 +343,7 @@ export declare class EventApi {
343
343
  *
344
344
  * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=biEwrNKhAF
345
345
  */
346
- getUgcRecord(option: {
347
- feature_id: number;
346
+ getUgcRecord(featureId: number, option: {
348
347
  /** 查询返回最大参与记录数 默认20*/
349
348
  max_results?: number;
350
349
  /** 分页标识,不传默认首页查询 */
@@ -362,8 +361,7 @@ export declare class EventApi {
362
361
  *
363
362
  * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=xhGGpJEbol
364
363
  */
365
- ugcUploadImage(option: {
366
- feature_id: number;
364
+ ugcUploadImage(featureId: number, option: {
367
365
  image_type: "png" | "jpg" | "jpeg";
368
366
  /** 媒体文件大小 */
369
367
  size: number;
@@ -14,7 +14,7 @@ export type UgcEngagementParam = {
14
14
  };
15
15
  export interface UgcEngagementData {
16
16
  /** 投稿记录 ID */
17
- ugc_id: string;
17
+ ugc_id: number;
18
18
  /** 标题 */
19
19
  title: string;
20
20
  /** 描述 */
@@ -52,6 +52,8 @@ export interface UgcRecord {
52
52
  role_name?: string;
53
53
  /** 投稿记录获得的总赞数 */
54
54
  total_likes?: number;
55
+ /** 投稿记录创建时间,Unix timestamp in seconds */
56
+ created_at: number;
55
57
  }
56
58
  export interface UgcRecordResponse {
57
59
  /** 稿件列表 */