@seayoo-web/gamer-api 2.13.10 → 2.13.12

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
@@ -200,9 +200,14 @@ class ia {
200
200
  const n = _();
201
201
  if (!this.idToken || n && !this.weixinToken)
202
202
  return !1;
203
- const { code: r, data: a } = await this.req.post("session/switch-game", c({ gameId: t }), fe, {
204
- message: !1
205
- });
203
+ const { code: r, data: a } = await this.req.post(
204
+ "session/switch-game",
205
+ c({ game_id: t }),
206
+ fe,
207
+ {
208
+ message: !1
209
+ }
210
+ );
206
211
  switch (r) {
207
212
  case "game_not_allowed":
208
213
  return !1;
@@ -810,7 +815,7 @@ const v = {
810
815
  UserSubmission: "user_submission",
811
816
  /** 投票入围 */
812
817
  Shortlisted: "shortlisted"
813
- }, st = e.string().enum(it).lock(), g = {
818
+ }, st = e.string().enum(it).lock(), d = {
814
819
  /** 未获得奖励 */
815
820
  Ineligible: "ineligible",
816
821
  /** 奖励未领取 */
@@ -821,26 +826,26 @@ const v = {
821
826
  Failed: "failed",
822
827
  /** 奖励已发货 */
823
828
  Delivered: "delivered"
824
- }, ua = e.string().enum(g).lock(), ct = {
829
+ }, ua = e.string().enum(d).lock(), ct = {
825
830
  /** 奖励未领取 */
826
- Unclaimed: g.Unclaimed,
831
+ Unclaimed: d.Unclaimed,
827
832
  /** 奖励已领取 */
828
- Received: g.Received,
833
+ Received: d.Received,
829
834
  /** 奖励发放失败 */
830
- Failed: g.Failed,
835
+ Failed: d.Failed,
831
836
  /** 奖励已发货 */
832
- Delivered: g.Delivered
837
+ Delivered: d.Delivered
833
838
  }, ne = e.string().enum(ct).lock(), lt = {
834
839
  /** 未获得奖励 */
835
- Ineligible: g.Ineligible,
840
+ Ineligible: d.Ineligible,
836
841
  /** 奖励未领取 */
837
- Unclaimed: g.Unclaimed,
842
+ Unclaimed: d.Unclaimed,
838
843
  /** 奖励已领取 */
839
- Received: g.Received,
844
+ Received: d.Received,
840
845
  /** 奖励发放失败 */
841
- Failed: g.Failed,
846
+ Failed: d.Failed,
842
847
  /** 奖励已发货 */
843
- Delivered: g.Delivered
848
+ Delivered: d.Delivered
844
849
  }, E = e.string().enum(lt).lock(), ut = {
845
850
  /** 玩法产出奖励 */
846
851
  Output: "output",
@@ -1591,7 +1596,7 @@ class _a {
1591
1596
  */
1592
1597
  async engage(t, n, r, a) {
1593
1598
  await this.token.autoLogin();
1594
- const { data: o, code: d, message: p } = await this.req.post(
1599
+ const { data: o, code: g, message: p } = await this.req.post(
1595
1600
  `event/${this.event}/engage`,
1596
1601
  c({
1597
1602
  feature_id: t,
@@ -1603,7 +1608,7 @@ class _a {
1603
1608
  );
1604
1609
  return o ?? {
1605
1610
  message: p,
1606
- error: d
1611
+ error: g
1607
1612
  };
1608
1613
  }
1609
1614
  /**
@@ -1855,20 +1860,18 @@ class _a {
1855
1860
  *
1856
1861
  * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=biEwrNKhAF
1857
1862
  */
1858
- async getUgcRecord(t, n, r) {
1863
+ async getUgcRecord(t, n) {
1859
1864
  if (!await this.token.autoLogin()) return null;
1860
- const { data: a, code: o, message: d } = await this.req.get("event/ugc/my", M, {
1861
- ...r,
1865
+ const { data: r, code: a, message: o } = await this.req.get("event/ugc/my", M, {
1866
+ ...n,
1862
1867
  params: {
1863
1868
  max_results: 20,
1864
- ...n,
1865
- feature_id: t,
1866
- event_id: this.event
1869
+ ...t
1867
1870
  }
1868
1871
  });
1869
- return a || {
1870
- message: d,
1871
- error: o
1872
+ return r || {
1873
+ message: o,
1874
+ error: a
1872
1875
  };
1873
1876
  }
1874
1877
  /**
@@ -1882,14 +1885,14 @@ class _a {
1882
1885
  */
1883
1886
  async ugcUploadImage(t, n, r) {
1884
1887
  if (!await this.token.autoLogin()) return null;
1885
- const { data: a, code: o, message: d } = await this.req.post(
1888
+ const { data: a, code: o, message: g } = await this.req.post(
1886
1889
  "event/ugc/upload-image",
1887
1890
  { feature_id: t, ...n, event_id: this.event },
1888
1891
  Vr,
1889
1892
  r
1890
1893
  );
1891
1894
  return a || {
1892
- message: d,
1895
+ message: g,
1893
1896
  error: o
1894
1897
  };
1895
1898
  }
@@ -2218,13 +2221,13 @@ class ya {
2218
2221
  * https://kdocs.cn/l/cbggfJodHLIz?linkname=yXubbZuDlC
2219
2222
  */
2220
2223
  async getPinnedPosts(t, n, r, a) {
2221
- const { data: o, code: d, message: p } = await this.req.get("community/pinned-posts", K, {
2224
+ const { data: o, code: g, message: p } = await this.req.get("community/pinned-posts", K, {
2222
2225
  ...a,
2223
2226
  params: c({ forum_id: t, max_results: n, next_token: r })
2224
2227
  });
2225
2228
  return o ?? {
2226
2229
  message: p,
2227
- error: d
2230
+ error: g
2228
2231
  };
2229
2232
  }
2230
2233
  /**
@@ -2517,14 +2520,14 @@ class ha {
2517
2520
  const n = await this.getLoginCache();
2518
2521
  if (n)
2519
2522
  return n;
2520
- const r = await ke(), { data: a, code: o, message: d } = await this.req.post(
2523
+ const r = await ke(), { data: a, code: o, message: g } = await this.req.post(
2521
2524
  "weixin/login",
2522
2525
  { code: r, appid: this.appid },
2523
2526
  L,
2524
2527
  { ...t, message: !1 }
2525
2528
  );
2526
2529
  return a && (this.token.weixinToken = a.weixin_token, this.token.storage.set(H, JSON.stringify(a))), a ?? {
2527
- message: d,
2530
+ message: g,
2528
2531
  error: o
2529
2532
  };
2530
2533
  }
@@ -2558,8 +2561,8 @@ class ha {
2558
2561
  message: "Error: " + r,
2559
2562
  error: r
2560
2563
  };
2561
- const d = G(["code", "state"]);
2562
- "replaceState" in history && history.replaceState({}, "", d);
2564
+ const g = G(["code", "state"]);
2565
+ "replaceState" in history && history.replaceState({}, "", g);
2563
2566
  const {
2564
2567
  data: p,
2565
2568
  code: le,
@@ -2734,7 +2737,7 @@ export {
2734
2737
  ee as RewardItemTypeValidator,
2735
2738
  ut as RewardSource,
2736
2739
  U as RewardSourceValidator,
2737
- g as RewardStatus,
2740
+ d as RewardStatus,
2738
2741
  ct as RewardStatusSuffix,
2739
2742
  ne as RewardStatusSuffixValidator,
2740
2743
  ua 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.13.10",
4
+ "version": "2.13.12",
5
5
  "type": "module",
6
6
  "source": "index.ts",
7
7
  "main": "./dist/index.js",
@@ -30,17 +30,17 @@
30
30
  "license": "MIT",
31
31
  "devDependencies": {
32
32
  "@types/node": "^22.13.1",
33
- "@seayoo-web/combo-webview": "2.8.0",
34
- "@seayoo-web/scripts": "3.1.6",
35
33
  "@seayoo-web/request": "3.4.2",
34
+ "@seayoo-web/combo-webview": "2.8.0",
36
35
  "@seayoo-web/tsconfig": "1.0.5",
36
+ "@seayoo-web/scripts": "3.1.6",
37
37
  "@seayoo-web/utils": "4.1.3",
38
38
  "@seayoo-web/validator": "2.0.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@seayoo-web/combo-webview": "^2.8.0",
42
- "@seayoo-web/utils": "^4.1.3",
43
- "@seayoo-web/validator": "^2.0.0"
42
+ "@seayoo-web/validator": "^2.0.0",
43
+ "@seayoo-web/utils": "^4.1.3"
44
44
  },
45
45
  "scripts": {
46
46
  "prebuild": "pnpm -F validator build && pnpm -F request build && pnpm -F combo-webview build",
@@ -343,7 +343,13 @@ export declare class EventApi {
343
343
  *
344
344
  * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=biEwrNKhAF
345
345
  */
346
- getUgcRecord(featureId: number, option: {
346
+ getUgcRecord(option: {
347
+ /** 按照多个活动 ID 批量查询投稿记录。若传入此参数,不再进行单活动/玩法的精确匹配*/
348
+ event_ids?: number[];
349
+ /** 单个活动 ID */
350
+ event_id?: number;
351
+ /** 活动玩法 ID */
352
+ feature_id?: number;
347
353
  /** 查询返回最大参与记录数 默认20*/
348
354
  max_results?: number;
349
355
  /** 分页标识,不传默认首页查询 */