@seayoo-web/gamer-api 2.12.4 → 2.12.6

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/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.4",
4
+ "version": "2.12.6",
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/request": "3.4.0",
36
35
  "@seayoo-web/scripts": "3.1.5",
36
+ "@seayoo-web/tsconfig": "1.0.5",
37
37
  "@seayoo-web/utils": "4.1.3",
38
38
  "@seayoo-web/validator": "1.1.1"
39
39
  },
40
40
  "peerDependencies": {
41
+ "@seayoo-web/combo-webview": "^2.8.0",
41
42
  "@seayoo-web/utils": "^4.1.3",
42
- "@seayoo-web/validator": "^1.1.1",
43
- "@seayoo-web/combo-webview": "^2.8.0"
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;
@@ -375,6 +373,29 @@ export declare class EventApi {
375
373
  image_url: string;
376
374
  } | {
377
375
  message: string;
378
- code: RequestInternalError | "event_not_found" | "feature_not_found";
376
+ error: RequestInternalError | "event_not_found" | "feature_not_found";
377
+ } | null>;
378
+ /**
379
+ * 获取推荐稿件列表,随机显示 N 条被接受的投稿记录
380
+ *
381
+ * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=WzvcAPjHAh
382
+ */
383
+ getUgcRecommendation(featureId: number, requestOptions?: IRequestOptions): Promise<import("./event.engage").UgcRecordResponse | {
384
+ message: string;
385
+ error: RequestInternalError | "event_not_found" | "feature_not_found";
386
+ } | null>;
387
+ /**
388
+ * 获取指定活动玩法的 UGC 投稿排行榜数据
389
+ *
390
+ * 该接口仅在管理员在 Console 后台完成排行榜结算后才会返回有效数据。
391
+ * 结算前调用将返回空结果集。
392
+ * 排行榜结算通常在活动结束后由管理员在 Console 后台手动触发。
393
+ * 目前前端无法直接在投稿玩法中获得「是否已经结算」的状态。
394
+ *
395
+ * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=KoB7S8omkC
396
+ */
397
+ getUgcLeaderboard(featureId: number, requestOptions?: IRequestOptions): Promise<import("./event.engage").UgcLeaderboardResponse | {
398
+ message: string;
399
+ error: RequestInternalError | "event_not_found" | "feature_not_found";
379
400
  } | null>;
380
401
  }
@@ -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
  /** 稿件列表 */
@@ -73,3 +75,26 @@ export declare const UgcUploadImageValidator: import("@seayoo-web/validator").Ob
73
75
  upload_url: string | undefined;
74
76
  image_url: string;
75
77
  }, false, false>;
78
+ export interface LeaderboardEntry {
79
+ /** 投稿记录 ID */
80
+ ugc_id: number;
81
+ /** 排名 */
82
+ rank: number;
83
+ /** 投稿记录获得的总赞数 */
84
+ total_likes: number;
85
+ /** 图片 URL 列表 */
86
+ image_urls?: string[];
87
+ /** 服务器 ID */
88
+ server_id?: number;
89
+ /** 服务器名称 */
90
+ server_name?: string;
91
+ /** 角色 ID */
92
+ role_id?: string;
93
+ /** 角色名称 */
94
+ role_name?: string;
95
+ }
96
+ export interface UgcLeaderboardResponse {
97
+ /** 投稿排行榜列表 */
98
+ ugcs: Array<LeaderboardEntry>;
99
+ }
100
+ export declare const UgcLeaderboardResponseValidator: import("@seayoo-web/validator").ObjectValidator<UgcLeaderboardResponse, false, false>;
@@ -54,3 +54,4 @@ export declare const isUgcUploadImageResponse: (data: unknown) => data is {
54
54
  upload_url: string | undefined;
55
55
  image_url: string;
56
56
  };
57
+ export declare const isUgcLeaderboardResponse: (data: unknown) => data is import("./event.engage").UgcLeaderboardResponse;