@seayoo-web/gamer-api 2.13.10 → 2.13.11
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 +29 -31
- package/package.json +6 -6
- package/types/src/event.d.ts +7 -1
- package/types/src/utils.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -810,7 +810,7 @@ const v = {
|
|
|
810
810
|
UserSubmission: "user_submission",
|
|
811
811
|
/** 投票入围 */
|
|
812
812
|
Shortlisted: "shortlisted"
|
|
813
|
-
}, st = e.string().enum(it).lock(),
|
|
813
|
+
}, st = e.string().enum(it).lock(), d = {
|
|
814
814
|
/** 未获得奖励 */
|
|
815
815
|
Ineligible: "ineligible",
|
|
816
816
|
/** 奖励未领取 */
|
|
@@ -821,26 +821,26 @@ const v = {
|
|
|
821
821
|
Failed: "failed",
|
|
822
822
|
/** 奖励已发货 */
|
|
823
823
|
Delivered: "delivered"
|
|
824
|
-
}, ua = e.string().enum(
|
|
824
|
+
}, ua = e.string().enum(d).lock(), ct = {
|
|
825
825
|
/** 奖励未领取 */
|
|
826
|
-
Unclaimed:
|
|
826
|
+
Unclaimed: d.Unclaimed,
|
|
827
827
|
/** 奖励已领取 */
|
|
828
|
-
Received:
|
|
828
|
+
Received: d.Received,
|
|
829
829
|
/** 奖励发放失败 */
|
|
830
|
-
Failed:
|
|
830
|
+
Failed: d.Failed,
|
|
831
831
|
/** 奖励已发货 */
|
|
832
|
-
Delivered:
|
|
832
|
+
Delivered: d.Delivered
|
|
833
833
|
}, ne = e.string().enum(ct).lock(), lt = {
|
|
834
834
|
/** 未获得奖励 */
|
|
835
|
-
Ineligible:
|
|
835
|
+
Ineligible: d.Ineligible,
|
|
836
836
|
/** 奖励未领取 */
|
|
837
|
-
Unclaimed:
|
|
837
|
+
Unclaimed: d.Unclaimed,
|
|
838
838
|
/** 奖励已领取 */
|
|
839
|
-
Received:
|
|
839
|
+
Received: d.Received,
|
|
840
840
|
/** 奖励发放失败 */
|
|
841
|
-
Failed:
|
|
841
|
+
Failed: d.Failed,
|
|
842
842
|
/** 奖励已发货 */
|
|
843
|
-
Delivered:
|
|
843
|
+
Delivered: d.Delivered
|
|
844
844
|
}, E = e.string().enum(lt).lock(), ut = {
|
|
845
845
|
/** 玩法产出奖励 */
|
|
846
846
|
Output: "output",
|
|
@@ -1591,7 +1591,7 @@ class _a {
|
|
|
1591
1591
|
*/
|
|
1592
1592
|
async engage(t, n, r, a) {
|
|
1593
1593
|
await this.token.autoLogin();
|
|
1594
|
-
const { data: o, code:
|
|
1594
|
+
const { data: o, code: g, message: p } = await this.req.post(
|
|
1595
1595
|
`event/${this.event}/engage`,
|
|
1596
1596
|
c({
|
|
1597
1597
|
feature_id: t,
|
|
@@ -1603,7 +1603,7 @@ class _a {
|
|
|
1603
1603
|
);
|
|
1604
1604
|
return o ?? {
|
|
1605
1605
|
message: p,
|
|
1606
|
-
error:
|
|
1606
|
+
error: g
|
|
1607
1607
|
};
|
|
1608
1608
|
}
|
|
1609
1609
|
/**
|
|
@@ -1855,20 +1855,18 @@ class _a {
|
|
|
1855
1855
|
*
|
|
1856
1856
|
* https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=biEwrNKhAF
|
|
1857
1857
|
*/
|
|
1858
|
-
async getUgcRecord(t, n
|
|
1858
|
+
async getUgcRecord(t, n) {
|
|
1859
1859
|
if (!await this.token.autoLogin()) return null;
|
|
1860
|
-
const { data:
|
|
1861
|
-
...
|
|
1860
|
+
const { data: r, code: a, message: o } = await this.req.get("event/ugc/my", M, {
|
|
1861
|
+
...n,
|
|
1862
1862
|
params: {
|
|
1863
1863
|
max_results: 20,
|
|
1864
|
-
...
|
|
1865
|
-
feature_id: t,
|
|
1866
|
-
event_id: this.event
|
|
1864
|
+
...t
|
|
1867
1865
|
}
|
|
1868
1866
|
});
|
|
1869
|
-
return
|
|
1870
|
-
message:
|
|
1871
|
-
error:
|
|
1867
|
+
return r || {
|
|
1868
|
+
message: o,
|
|
1869
|
+
error: a
|
|
1872
1870
|
};
|
|
1873
1871
|
}
|
|
1874
1872
|
/**
|
|
@@ -1882,14 +1880,14 @@ class _a {
|
|
|
1882
1880
|
*/
|
|
1883
1881
|
async ugcUploadImage(t, n, r) {
|
|
1884
1882
|
if (!await this.token.autoLogin()) return null;
|
|
1885
|
-
const { data: a, code: o, message:
|
|
1883
|
+
const { data: a, code: o, message: g } = await this.req.post(
|
|
1886
1884
|
"event/ugc/upload-image",
|
|
1887
1885
|
{ feature_id: t, ...n, event_id: this.event },
|
|
1888
1886
|
Vr,
|
|
1889
1887
|
r
|
|
1890
1888
|
);
|
|
1891
1889
|
return a || {
|
|
1892
|
-
message:
|
|
1890
|
+
message: g,
|
|
1893
1891
|
error: o
|
|
1894
1892
|
};
|
|
1895
1893
|
}
|
|
@@ -2218,13 +2216,13 @@ class ya {
|
|
|
2218
2216
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=yXubbZuDlC
|
|
2219
2217
|
*/
|
|
2220
2218
|
async getPinnedPosts(t, n, r, a) {
|
|
2221
|
-
const { data: o, code:
|
|
2219
|
+
const { data: o, code: g, message: p } = await this.req.get("community/pinned-posts", K, {
|
|
2222
2220
|
...a,
|
|
2223
2221
|
params: c({ forum_id: t, max_results: n, next_token: r })
|
|
2224
2222
|
});
|
|
2225
2223
|
return o ?? {
|
|
2226
2224
|
message: p,
|
|
2227
|
-
error:
|
|
2225
|
+
error: g
|
|
2228
2226
|
};
|
|
2229
2227
|
}
|
|
2230
2228
|
/**
|
|
@@ -2517,14 +2515,14 @@ class ha {
|
|
|
2517
2515
|
const n = await this.getLoginCache();
|
|
2518
2516
|
if (n)
|
|
2519
2517
|
return n;
|
|
2520
|
-
const r = await ke(), { data: a, code: o, message:
|
|
2518
|
+
const r = await ke(), { data: a, code: o, message: g } = await this.req.post(
|
|
2521
2519
|
"weixin/login",
|
|
2522
2520
|
{ code: r, appid: this.appid },
|
|
2523
2521
|
L,
|
|
2524
2522
|
{ ...t, message: !1 }
|
|
2525
2523
|
);
|
|
2526
2524
|
return a && (this.token.weixinToken = a.weixin_token, this.token.storage.set(H, JSON.stringify(a))), a ?? {
|
|
2527
|
-
message:
|
|
2525
|
+
message: g,
|
|
2528
2526
|
error: o
|
|
2529
2527
|
};
|
|
2530
2528
|
}
|
|
@@ -2558,8 +2556,8 @@ class ha {
|
|
|
2558
2556
|
message: "Error: " + r,
|
|
2559
2557
|
error: r
|
|
2560
2558
|
};
|
|
2561
|
-
const
|
|
2562
|
-
"replaceState" in history && history.replaceState({}, "",
|
|
2559
|
+
const g = G(["code", "state"]);
|
|
2560
|
+
"replaceState" in history && history.replaceState({}, "", g);
|
|
2563
2561
|
const {
|
|
2564
2562
|
data: p,
|
|
2565
2563
|
code: le,
|
|
@@ -2734,7 +2732,7 @@ export {
|
|
|
2734
2732
|
ee as RewardItemTypeValidator,
|
|
2735
2733
|
ut as RewardSource,
|
|
2736
2734
|
U as RewardSourceValidator,
|
|
2737
|
-
|
|
2735
|
+
d as RewardStatus,
|
|
2738
2736
|
ct as RewardStatusSuffix,
|
|
2739
2737
|
ne as RewardStatusSuffixValidator,
|
|
2740
2738
|
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.
|
|
4
|
+
"version": "2.13.11",
|
|
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/scripts": "3.1.6",
|
|
35
|
-
"@seayoo-web/request": "3.4.2",
|
|
36
34
|
"@seayoo-web/tsconfig": "1.0.5",
|
|
35
|
+
"@seayoo-web/request": "3.4.2",
|
|
37
36
|
"@seayoo-web/utils": "4.1.3",
|
|
38
|
-
"@seayoo-web/validator": "2.0.0"
|
|
37
|
+
"@seayoo-web/validator": "2.0.0",
|
|
38
|
+
"@seayoo-web/scripts": "3.1.6"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@seayoo-web/combo-webview": "^2.8.0",
|
|
42
|
-
"@seayoo-web/
|
|
43
|
-
"@seayoo-web/
|
|
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",
|
package/types/src/event.d.ts
CHANGED
|
@@ -343,7 +343,13 @@ export declare class EventApi {
|
|
|
343
343
|
*
|
|
344
344
|
* https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=biEwrNKhAF
|
|
345
345
|
*/
|
|
346
|
-
getUgcRecord(
|
|
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
|
/** 分页标识,不传默认首页查询 */
|
package/types/src/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const console: Pick<Console, "
|
|
1
|
+
export declare const console: Pick<Console, "log" | "error" | "warn">;
|
|
2
2
|
/** 检测是否在 combo webview */
|
|
3
3
|
export declare function inComboWebview(): boolean;
|
|
4
4
|
export declare function isRootEndpoint(path: string): boolean;
|