@seayoo-web/gamer-api 4.6.4 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/gamer-api",
3
- "version": "4.6.4",
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/combo-webview": "2.9.8",
34
33
  "@seayoo-web/tsconfig": "1.0.7",
35
- "@seayoo-web/request": "4.1.3",
36
- "@seayoo-web/validator": "2.3.1",
37
34
  "@seayoo-web/scripts": "4.3.11",
38
- "@seayoo-web/utils": "4.5.6"
35
+ "@seayoo-web/request": "4.1.3",
36
+ "@seayoo-web/combo-webview": "2.9.8",
37
+ "@seayoo-web/utils": "4.5.7",
38
+ "@seayoo-web/validator": "2.3.1"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@seayoo-web/combo-webview": "^2.9.8",
42
- "@seayoo-web/utils": "^4.5.6",
42
+ "@seayoo-web/utils": "^4.5.7",
43
43
  "@seayoo-web/validator": "^2.3.1"
44
44
  },
45
45
  "engines": {
@@ -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
  *