@seayoo-web/gamer-api 4.6.3 → 4.6.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
@@ -1501,7 +1501,7 @@ var yi = {
1501
1501
  let { data: e, code: t, message: n } = await this.req.get("ggd/describe-role", null, d({
1502
1502
  combo_id: f.string(),
1503
1503
  showid: f.number().optional(),
1504
- role_id: f.number(),
1504
+ role_id: f.union(f.number(), f.string()),
1505
1505
  role_name: f.string(),
1506
1506
  role_level: f.number().optional(),
1507
1507
  avatar_url: f.string().optional(),
@@ -1550,7 +1550,7 @@ var yi = {
1550
1550
  player_status: wi,
1551
1551
  career_name: f.string(),
1552
1552
  mode_name: f.string()
1553
- })) }));
1553
+ })).optional() }));
1554
1554
  return t ? t.matches : {
1555
1555
  error: n,
1556
1556
  message: r
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/gamer-api",
3
- "version": "4.6.3",
3
+ "version": "4.6.5",
4
4
  "description": "agent for gamer api",
5
5
  "license": "MIT",
6
6
  "author": "web@seayoo.com",
@@ -30,16 +30,16 @@
30
30
  "@vitest/coverage-istanbul": "^4.1.4",
31
31
  "happy-dom": "^13.10.1",
32
32
  "vitest": "^4.1.4",
33
- "@seayoo-web/request": "4.1.3",
34
- "@seayoo-web/utils": "4.5.6",
35
33
  "@seayoo-web/tsconfig": "1.0.7",
36
- "@seayoo-web/validator": "2.3.1",
34
+ "@seayoo-web/scripts": "4.3.11",
35
+ "@seayoo-web/request": "4.1.3",
37
36
  "@seayoo-web/combo-webview": "2.9.8",
38
- "@seayoo-web/scripts": "4.3.11"
37
+ "@seayoo-web/utils": "4.5.7",
38
+ "@seayoo-web/validator": "2.3.1"
39
39
  },
40
40
  "peerDependencies": {
41
- "@seayoo-web/utils": "^4.5.6",
42
41
  "@seayoo-web/combo-webview": "^2.9.8",
42
+ "@seayoo-web/utils": "^4.5.7",
43
43
  "@seayoo-web/validator": "^2.3.1"
44
44
  },
45
45
  "engines": {
@@ -46,7 +46,7 @@ export declare class GGDPublicApi {
46
46
  describeRole(): Promise<{
47
47
  combo_id: string;
48
48
  showid: number | undefined;
49
- role_id: number;
49
+ role_id: string | number;
50
50
  role_name: string;
51
51
  role_level: number | undefined;
52
52
  avatar_url: string | undefined;
@@ -110,5 +110,5 @@ export declare class GGDPublicApi {
110
110
  }[] | {
111
111
  error: "role_not_found" | RequestInternalError;
112
112
  message: string;
113
- }>;
113
+ } | undefined>;
114
114
  }
@@ -0,0 +1,22 @@
1
+ import type { ValueOf } from "@seayoo-web/utils";
2
+ /** 房间状态 */
3
+ export declare const GGDRoomStatus: {
4
+ /** 等待中 */
5
+ readonly Waiting: 1;
6
+ /** 游戏中 */
7
+ readonly Playing: 2;
8
+ };
9
+ export type GGDRoomStatus = ValueOf<typeof GGDRoomStatus>;
10
+ export declare const GGDRoomStatusValidator: import("@seayoo-web/validator").NumberValidator<GGDRoomStatus, false, false> & {
11
+ int: never;
12
+ min: never;
13
+ max: never;
14
+ allowNaN: never;
15
+ allowInfinity: never;
16
+ unsafe: never;
17
+ enum: never;
18
+ disallow: never;
19
+ optional: never;
20
+ maybeNull: never;
21
+ lock: never;
22
+ };
@@ -1,5 +1,5 @@
1
1
  import type { AuthToken } from "./token";
2
- import type { WeixinWebLoginErrorCode } from "./weixin.define";
2
+ import type { WeixinLoginResponse, WeixinWebLoginErrorCode } from "./weixin.define";
3
3
  import type { RequestOptions, RequestInternalError } from "@seayoo-web/request";
4
4
  export declare class WeixinApi {
5
5
  private token;
@@ -27,7 +27,7 @@ export declare class WeixinApi {
27
27
  *
28
28
  * 也可以直接调用 login 方法,并传入 weixin code 的读取函数
29
29
  */
30
- getLoginCache(): Promise<import("./weixin.define").WeixinLoginResponse | null>;
30
+ getLoginCache(): Promise<WeixinLoginResponse | null>;
31
31
  /**
32
32
  * 小程序页面微信静默登录,获取 weixinToken / open_id / union_id。
33
33
  *
@@ -45,7 +45,7 @@ export declare class WeixinApi {
45
45
  *
46
46
  * https://kdocs.cn/l/cf2mO2uRLqh9?linkname=GwIZ0givCb
47
47
  */
48
- login(requestOptions?: RequestOptions): Promise<import("./weixin.define").WeixinLoginResponse | {
48
+ login(requestOptions?: RequestOptions): Promise<WeixinLoginResponse | {
49
49
  message: string;
50
50
  error: RequestInternalError | "invalid_weixin_appid" | "invalid_weixin_code";
51
51
  }>;
@@ -65,13 +65,10 @@ export declare class WeixinApi {
65
65
  * - snsapi_base 不弹出授权页面,用户无感知,只能获取用户 openid,如果需要获取 union_id 则需要 snsapi_userinfo
66
66
  * - snsapi_userinfo 【默认】弹出授权页面,可拿到 openid、union_id、昵称、头像等信息,但用户也可能会拒绝授权
67
67
  */
68
- webLogin(scope?: "snsapi_base" | "snsapi_userinfo", requestOptions?: RequestOptions): Promise<import("./weixin.define").WeixinLoginResponse | {
69
- message: string;
70
- error: WeixinWebLoginErrorCode;
71
- } | {
72
- message: string;
73
- error: RequestInternalError | "invalid_weixin_appid" | "invalid_weixin_code";
74
- } | undefined>;
68
+ webLogin(scope?: "snsapi_base" | "snsapi_userinfo", requestOptions?: RequestOptions): Promise<void | WeixinLoginResponse | {
69
+ message?: string;
70
+ error?: WeixinWebLoginErrorCode | RequestInternalError | "invalid_weixin_appid" | "invalid_weixin_code";
71
+ }>;
75
72
  /**
76
73
  * 关联游戏账号,无返回值,全程静默
77
74
  *