karin-plugin-mys-core 1.0.2 → 1.0.4
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/lib/apps/MiHoYoLogin.js +11 -11
- package/lib/apps/MysDevice.js +10 -10
- package/lib/apps/UIDManage.js +11 -11
- package/lib/{array-CZDr9qst.d.ts → array-DuqoS2wx.d.ts} +1 -1
- package/lib/{chunk-KN5SHBVI.js → chunk-7ZQQ76WC.js} +1 -1
- package/lib/{chunk-3CNBOOKY.js → chunk-BH4S574A.js} +1 -1
- package/lib/{chunk-QMSYS77M.js → chunk-BNSHDFFN.js} +1 -1
- package/lib/{chunk-HVYNK5BN.js → chunk-CDBMB57U.js} +15 -8
- package/lib/{chunk-5NA7ZPDS.js → chunk-EAVXU4Q2.js} +3 -0
- package/lib/{chunk-7WESXE4X.js → chunk-HTH25YE2.js} +1 -1
- package/lib/{chunk-7YZHHLS5.js → chunk-JKZ5NRPX.js} +4 -4
- package/lib/{chunk-JBGXPVO2.js → chunk-NC54IKOY.js} +1 -1
- package/lib/{chunk-IVZICDGW.js → chunk-T6MFN2MO.js} +6 -2
- package/lib/{chunk-X75DW4KI.js → chunk-WQK5RDUV.js} +14 -14
- package/lib/{define-BWuQ7acM.d.ts → define-B9r20dK6.d.ts} +4 -5
- package/lib/exports/config/array.d.ts +1 -1
- package/lib/exports/config/config.d.ts +1 -1
- package/lib/exports/config/config.js +1 -1
- package/lib/exports/config/index.d.ts +2 -2
- package/lib/exports/config/index.js +1 -1
- package/lib/exports/config/types/config.d.ts +3 -3
- package/lib/exports/config/types/index.d.ts +1 -1
- package/lib/exports/database/dbs/index.js +1 -1
- package/lib/exports/database/dbs/table.d.ts +3 -0
- package/lib/exports/database/dbs/table.js +1 -1
- package/lib/exports/database/index.js +5 -5
- package/lib/exports/database/tables/index.js +5 -5
- package/lib/exports/database/tables/mysAccountInfo.js +2 -2
- package/lib/exports/database/tables/mysDeviceInfo.js +3 -3
- package/lib/exports/database/tables/mysUserInfo.js +2 -2
- package/lib/exports/mys/api/apis.d.ts +4 -4
- package/lib/exports/mys/api/apis.js +10 -10
- package/lib/exports/mys/api/app.js +5 -5
- package/lib/exports/mys/api/define.d.ts +1 -1
- package/lib/exports/mys/api/define.js +10 -10
- package/lib/exports/mys/api/index.d.ts +2 -2
- package/lib/exports/mys/api/index.js +10 -10
- package/lib/exports/mys/index.d.ts +4 -2
- package/lib/exports/mys/index.js +10 -10
- package/lib/exports/mys/types/api/define.d.ts +1 -1
- package/lib/exports/mys/types/api/index.d.ts +1 -1
- package/lib/exports/mys/types/index.d.ts +4 -2
- package/lib/exports/mys/types/index.js +2 -2
- package/lib/exports/mys/types/user/game.d.ts +28 -4
- package/lib/exports/mys/types/user/game.js +7 -1
- package/lib/exports/mys/types/user/index.d.ts +4 -2
- package/lib/exports/mys/types/user/index.js +2 -2
- package/lib/exports/mys/types/user/userInfo.d.ts +40 -8
- package/lib/exports/mys/types/user/userInfo.js +1 -7
- package/lib/exports/mys/user/deviceInfo.js +6 -6
- package/lib/exports/mys/user/game.d.ts +4 -2
- package/lib/exports/mys/user/index.d.ts +4 -2
- package/lib/exports/mys/user/index.js +10 -10
- package/lib/exports/mys/user/userInfo.d.ts +49 -6
- package/lib/exports/mys/user/userInfo.js +10 -10
- package/lib/exports/utils/index.d.ts +1 -0
- package/lib/exports/utils/index.js +1 -1
- package/lib/exports/utils/render.d.ts +7 -1
- package/lib/exports/utils/render.js +1 -1
- package/package.json +1 -1
- package/lib/index-DEEWbZ0V.d.ts +0 -102
- /package/lib/{chunk-FOAQZIZ2.js → chunk-WCX7WZAQ.js} +0 -0
package/lib/apps/MiHoYoLogin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ShowBindAccountCmdFunc
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-NC54IKOY.js";
|
|
4
4
|
import {
|
|
5
5
|
UserInfo,
|
|
6
6
|
fetchQRcode,
|
|
@@ -8,25 +8,25 @@ import {
|
|
|
8
8
|
getTokenByGameToken,
|
|
9
9
|
getUserFullInfo,
|
|
10
10
|
queryQRcode
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
} from "../chunk-WQK5RDUV.js";
|
|
12
|
+
import "../chunk-BH4S574A.js";
|
|
13
13
|
import "../chunk-3BIQN6QA.js";
|
|
14
14
|
import "../chunk-G5W5WAY5.js";
|
|
15
15
|
import "../chunk-7VAWV6ZE.js";
|
|
16
16
|
import "../chunk-LJSDSOY6.js";
|
|
17
17
|
import "../chunk-CFS2WFOO.js";
|
|
18
18
|
import "../chunk-MWYDWDR4.js";
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-T6MFN2MO.js";
|
|
20
|
+
import "../chunk-WCX7WZAQ.js";
|
|
21
21
|
import "../chunk-XQWTJIT4.js";
|
|
22
22
|
import "../chunk-7SZX3RBZ.js";
|
|
23
23
|
import "../chunk-W4DBT7AD.js";
|
|
24
24
|
import "../chunk-Z5I6A73Y.js";
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-HTH25YE2.js";
|
|
26
|
+
import "../chunk-7ZQQ76WC.js";
|
|
27
|
+
import "../chunk-BNSHDFFN.js";
|
|
28
28
|
import "../chunk-SEWEEPJN.js";
|
|
29
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-EAVXU4Q2.js";
|
|
30
30
|
import "../chunk-G547WVGV.js";
|
|
31
31
|
import "../chunk-EMAUATE3.js";
|
|
32
32
|
import "../chunk-Y3J3J5B2.js";
|
|
@@ -42,10 +42,10 @@ import "../chunk-ARLTXJFJ.js";
|
|
|
42
42
|
import {
|
|
43
43
|
common_exports
|
|
44
44
|
} from "../chunk-LG34FPBI.js";
|
|
45
|
-
import "../chunk-
|
|
45
|
+
import "../chunk-CDBMB57U.js";
|
|
46
46
|
import "../chunk-2DHTKQ34.js";
|
|
47
47
|
import "../chunk-SHLPPEAY.js";
|
|
48
|
-
import "../chunk-
|
|
48
|
+
import "../chunk-JKZ5NRPX.js";
|
|
49
49
|
import "../chunk-6PIXUPZ6.js";
|
|
50
50
|
import "../chunk-MLKGABMK.js";
|
|
51
51
|
|
package/lib/apps/MysDevice.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UserInfo
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-WQK5RDUV.js";
|
|
4
4
|
import {
|
|
5
5
|
DeviceInfo
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-BH4S574A.js";
|
|
7
7
|
import "../chunk-3BIQN6QA.js";
|
|
8
8
|
import "../chunk-G5W5WAY5.js";
|
|
9
9
|
import "../chunk-7VAWV6ZE.js";
|
|
10
10
|
import "../chunk-LJSDSOY6.js";
|
|
11
11
|
import "../chunk-CFS2WFOO.js";
|
|
12
12
|
import "../chunk-MWYDWDR4.js";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-T6MFN2MO.js";
|
|
14
|
+
import "../chunk-WCX7WZAQ.js";
|
|
15
15
|
import "../chunk-XQWTJIT4.js";
|
|
16
16
|
import "../chunk-7SZX3RBZ.js";
|
|
17
17
|
import "../chunk-W4DBT7AD.js";
|
|
18
18
|
import "../chunk-Z5I6A73Y.js";
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-HTH25YE2.js";
|
|
20
|
+
import "../chunk-7ZQQ76WC.js";
|
|
21
|
+
import "../chunk-BNSHDFFN.js";
|
|
22
22
|
import "../chunk-SEWEEPJN.js";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-EAVXU4Q2.js";
|
|
24
24
|
import "../chunk-G547WVGV.js";
|
|
25
25
|
import "../chunk-EMAUATE3.js";
|
|
26
26
|
import "../chunk-Y3J3J5B2.js";
|
|
@@ -34,10 +34,10 @@ import "../chunk-SHW6FHIB.js";
|
|
|
34
34
|
import "../chunk-JRH4JC43.js";
|
|
35
35
|
import "../chunk-ARLTXJFJ.js";
|
|
36
36
|
import "../chunk-LG34FPBI.js";
|
|
37
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-CDBMB57U.js";
|
|
38
38
|
import "../chunk-2DHTKQ34.js";
|
|
39
39
|
import "../chunk-SHLPPEAY.js";
|
|
40
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-JKZ5NRPX.js";
|
|
41
41
|
import "../chunk-6PIXUPZ6.js";
|
|
42
42
|
import "../chunk-MLKGABMK.js";
|
|
43
43
|
|
package/lib/apps/UIDManage.js
CHANGED
|
@@ -4,26 +4,26 @@ import {
|
|
|
4
4
|
ShowBindAccountCmdFunc,
|
|
5
5
|
UnbindAccount,
|
|
6
6
|
UnbindUID
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-NC54IKOY.js";
|
|
8
|
+
import "../chunk-WQK5RDUV.js";
|
|
9
|
+
import "../chunk-BH4S574A.js";
|
|
10
10
|
import "../chunk-3BIQN6QA.js";
|
|
11
11
|
import "../chunk-G5W5WAY5.js";
|
|
12
12
|
import "../chunk-7VAWV6ZE.js";
|
|
13
13
|
import "../chunk-LJSDSOY6.js";
|
|
14
14
|
import "../chunk-CFS2WFOO.js";
|
|
15
15
|
import "../chunk-MWYDWDR4.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-T6MFN2MO.js";
|
|
17
|
+
import "../chunk-WCX7WZAQ.js";
|
|
18
18
|
import "../chunk-XQWTJIT4.js";
|
|
19
19
|
import "../chunk-7SZX3RBZ.js";
|
|
20
20
|
import "../chunk-W4DBT7AD.js";
|
|
21
21
|
import "../chunk-Z5I6A73Y.js";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-HTH25YE2.js";
|
|
23
|
+
import "../chunk-7ZQQ76WC.js";
|
|
24
|
+
import "../chunk-BNSHDFFN.js";
|
|
25
25
|
import "../chunk-SEWEEPJN.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-EAVXU4Q2.js";
|
|
27
27
|
import "../chunk-G547WVGV.js";
|
|
28
28
|
import "../chunk-EMAUATE3.js";
|
|
29
29
|
import "../chunk-Y3J3J5B2.js";
|
|
@@ -37,10 +37,10 @@ import "../chunk-SHW6FHIB.js";
|
|
|
37
37
|
import "../chunk-JRH4JC43.js";
|
|
38
38
|
import "../chunk-ARLTXJFJ.js";
|
|
39
39
|
import "../chunk-LG34FPBI.js";
|
|
40
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-CDBMB57U.js";
|
|
41
41
|
import "../chunk-2DHTKQ34.js";
|
|
42
42
|
import "../chunk-SHLPPEAY.js";
|
|
43
|
-
import "../chunk-
|
|
43
|
+
import "../chunk-JKZ5NRPX.js";
|
|
44
44
|
import "../chunk-6PIXUPZ6.js";
|
|
45
45
|
import "../chunk-MLKGABMK.js";
|
|
46
46
|
export {
|
|
@@ -3,7 +3,7 @@ declare class Config<C extends Record<string, any>> {
|
|
|
3
3
|
/**
|
|
4
4
|
* @param name 插件名称:配置名称
|
|
5
5
|
*/
|
|
6
|
-
constructor(name: `${string}:${string}`, ConfigPath: string, DefaultConfig: C,
|
|
6
|
+
constructor(name: `${string}:${string}`, ConfigPath: string, DefaultConfig: C, DefineConfig: Record<string, any>);
|
|
7
7
|
loadConfig(): C;
|
|
8
8
|
mergeWithDefaults(userConfig: Record<string, any>, defaultConfig: Record<string, any>, IgnoreConfig: Record<string, any>): C;
|
|
9
9
|
/**
|
|
@@ -3,16 +3,30 @@ import karin, { config } from "node-karin";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
var RenderTemplate = class {
|
|
5
5
|
#renderCfg;
|
|
6
|
-
|
|
6
|
+
#pluginOptions;
|
|
7
|
+
/**
|
|
8
|
+
* @param pluginOptions 自定义额外plugin参数
|
|
9
|
+
*/
|
|
10
|
+
constructor(cfg, pluginOptions = {}) {
|
|
7
11
|
this.#renderCfg = cfg;
|
|
12
|
+
this.#pluginOptions = pluginOptions;
|
|
8
13
|
}
|
|
9
14
|
/** @description 渲染Html路径为:resources/template/${template}/index.html */
|
|
10
15
|
async template(template, rendeDdata, options = {}) {
|
|
11
16
|
const img = await karin.render({
|
|
17
|
+
type: options.type || "jpeg",
|
|
18
|
+
omitBackground: options.type === "png",
|
|
19
|
+
selector: "container",
|
|
20
|
+
setViewport: {
|
|
21
|
+
deviceScaleFactor: 2
|
|
22
|
+
},
|
|
23
|
+
...options.render || {},
|
|
12
24
|
name: `${this.#renderCfg.name}/${template}`,
|
|
25
|
+
file: path.join(this.#renderCfg.pluginDir, `resources/template/${template}/index.html`),
|
|
13
26
|
data: {
|
|
14
27
|
...rendeDdata,
|
|
15
28
|
plugin: {
|
|
29
|
+
...this.#pluginOptions,
|
|
16
30
|
...options.plugin || {},
|
|
17
31
|
template,
|
|
18
32
|
name: this.#renderCfg.name,
|
|
@@ -26,13 +40,6 @@ var RenderTemplate = class {
|
|
|
26
40
|
karin: {
|
|
27
41
|
version: config.pkg().version
|
|
28
42
|
}
|
|
29
|
-
},
|
|
30
|
-
type: options.type || "jpeg",
|
|
31
|
-
omitBackground: options.type === "png",
|
|
32
|
-
selector: "container",
|
|
33
|
-
file: path.join(this.#renderCfg.pluginDir, `resources/template/${template}/index.html`),
|
|
34
|
-
setViewport: {
|
|
35
|
-
deviceScaleFactor: 2
|
|
36
43
|
}
|
|
37
44
|
});
|
|
38
45
|
if (!img) return null;
|
|
@@ -9,6 +9,9 @@ var Table = class {
|
|
|
9
9
|
#DataDir;
|
|
10
10
|
#tableName;
|
|
11
11
|
#type;
|
|
12
|
+
/**
|
|
13
|
+
* @param type Db: 直接保存在sqlite数据中、 File: 保存在单个json文件中、 Dir: 保存在多个json文件的目录中、Schema中除pk外每一个键值对应一个文件 e.g tableName/user/key.json
|
|
14
|
+
*/
|
|
12
15
|
constructor(DataDir, tableName, type) {
|
|
13
16
|
this.#Database = Database.get();
|
|
14
17
|
this.#dialect = this.#Database.dialect;
|
|
@@ -15,7 +15,7 @@ var Config = class {
|
|
|
15
15
|
* @description 默认配置
|
|
16
16
|
*/
|
|
17
17
|
#DefaultConfig;
|
|
18
|
-
#
|
|
18
|
+
#DefineConfig;
|
|
19
19
|
/**
|
|
20
20
|
* @description 配置保存路径
|
|
21
21
|
*/
|
|
@@ -23,17 +23,17 @@ var Config = class {
|
|
|
23
23
|
/**
|
|
24
24
|
* @param name 插件名称:配置名称
|
|
25
25
|
*/
|
|
26
|
-
constructor(name, ConfigPath, DefaultConfig,
|
|
26
|
+
constructor(name, ConfigPath, DefaultConfig, DefineConfig) {
|
|
27
27
|
this.#cfgName = name;
|
|
28
28
|
this.#ConfigPath = ConfigPath;
|
|
29
29
|
this.#DefaultConfig = DefaultConfig;
|
|
30
|
-
this.#
|
|
30
|
+
this.#DefineConfig = DefineConfig;
|
|
31
31
|
!existsSync(ConfigPath) && writeJsonSync(ConfigPath, DefaultConfig);
|
|
32
32
|
this.loadConfig();
|
|
33
33
|
}
|
|
34
34
|
loadConfig() {
|
|
35
35
|
const config = requireFileSync(this.#ConfigPath);
|
|
36
|
-
const mergedConfig = this.mergeWithDefaults(config, this.#DefaultConfig, this.#
|
|
36
|
+
const mergedConfig = this.mergeWithDefaults(config, this.#DefaultConfig, this.#DefineConfig);
|
|
37
37
|
this.#ConfigCache = mergedConfig;
|
|
38
38
|
return mergedConfig;
|
|
39
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/exports/mys/types/user/
|
|
1
|
+
// src/exports/mys/types/user/game.ts
|
|
2
2
|
var RegisterGameBase = class {
|
|
3
3
|
game;
|
|
4
4
|
columnKey;
|
|
@@ -6,11 +6,15 @@ var RegisterGameBase = class {
|
|
|
6
6
|
name;
|
|
7
7
|
/** @description 指令前缀匹配 */
|
|
8
8
|
prefix;
|
|
9
|
-
|
|
9
|
+
refresh;
|
|
10
|
+
UserInfo;
|
|
11
|
+
constructor(game, name, prefix, userInfo, refreshFuc) {
|
|
10
12
|
this.game = game;
|
|
11
13
|
this.columnKey = `${game}-uids`;
|
|
12
14
|
this.name = name;
|
|
13
15
|
this.prefix = prefix;
|
|
16
|
+
this.UserInfo = userInfo;
|
|
17
|
+
this.refresh = refreshFuc;
|
|
14
18
|
}
|
|
15
19
|
};
|
|
16
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeviceInfo
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BH4S574A.js";
|
|
4
4
|
import {
|
|
5
5
|
MysGame
|
|
6
6
|
} from "./chunk-3BIQN6QA.js";
|
|
@@ -10,25 +10,25 @@ import {
|
|
|
10
10
|
} from "./chunk-G5W5WAY5.js";
|
|
11
11
|
import {
|
|
12
12
|
MysUserInfoDB
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-HTH25YE2.js";
|
|
14
14
|
import {
|
|
15
15
|
MysAccountInfoDB
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7ZQQ76WC.js";
|
|
17
17
|
import {
|
|
18
18
|
MysDeviceInfoDB
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-BNSHDFFN.js";
|
|
20
20
|
import {
|
|
21
21
|
common_exports
|
|
22
22
|
} from "./chunk-LG34FPBI.js";
|
|
23
23
|
import {
|
|
24
24
|
RenderTemplate
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-CDBMB57U.js";
|
|
26
26
|
import {
|
|
27
27
|
dir
|
|
28
28
|
} from "./chunk-SHLPPEAY.js";
|
|
29
29
|
import {
|
|
30
30
|
Config
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-JKZ5NRPX.js";
|
|
32
32
|
|
|
33
33
|
// src/core/config/device.ts
|
|
34
34
|
import path from "path";
|
|
@@ -54,7 +54,7 @@ import axios, { AxiosHeaders } from "node-karin/axios";
|
|
|
54
54
|
// src/exports/mys/user/userInfo.ts
|
|
55
55
|
var BaseUserInfo = class {
|
|
56
56
|
userId;
|
|
57
|
-
|
|
57
|
+
ltuidMap = /* @__PURE__ */ new Map();
|
|
58
58
|
constructor(userId) {
|
|
59
59
|
this.userId = userId;
|
|
60
60
|
}
|
|
@@ -68,28 +68,28 @@ var BaseUserInfo = class {
|
|
|
68
68
|
return this.UserInfo.deviceList;
|
|
69
69
|
}
|
|
70
70
|
get LtuidInfoList() {
|
|
71
|
-
return Array.from(this
|
|
71
|
+
return Array.from(this.ltuidMap.values()).map((info) => Object.freeze(info)).sort((a, b) => +a.ltuid - +b.ltuid);
|
|
72
72
|
}
|
|
73
73
|
async initMysAccountInfo(UserInfo2, initAll) {
|
|
74
74
|
this.UserInfo = UserInfo2;
|
|
75
|
-
this
|
|
75
|
+
this.ltuidMap.clear();
|
|
76
76
|
const idList = Array.from(/* @__PURE__ */ new Set([...UserInfo2.ltuids, ...UserInfo2.stuids]));
|
|
77
77
|
if (initAll) {
|
|
78
78
|
const MysAccountInfoList = await (await MysAccountInfoDB()).findAllByPks(idList);
|
|
79
79
|
MysAccountInfoList.forEach((MysAccountInfo) => {
|
|
80
|
-
this
|
|
80
|
+
this.ltuidMap.set(MysAccountInfo.ltuid, MysAccountInfo);
|
|
81
81
|
});
|
|
82
82
|
} else {
|
|
83
83
|
const self = this;
|
|
84
84
|
const mainLtuid = self.bind_uids?.[self.main_uid]?.ltuid;
|
|
85
85
|
if (mainLtuid) {
|
|
86
86
|
const MysAccountInfo = await (await MysAccountInfoDB()).findByPk(mainLtuid);
|
|
87
|
-
MysAccountInfo && this
|
|
87
|
+
MysAccountInfo && this.ltuidMap.set(MysAccountInfo.ltuid, MysAccountInfo);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
getLtuidInfo(ltuid) {
|
|
92
|
-
return Object.freeze(this
|
|
92
|
+
return Object.freeze(this.ltuidMap.get(ltuid));
|
|
93
93
|
}
|
|
94
94
|
async getDeviceInfoList() {
|
|
95
95
|
return await (await MysDeviceInfoDB()).findAllByPks(this.deviceList);
|
|
@@ -98,12 +98,12 @@ var BaseUserInfo = class {
|
|
|
98
98
|
await this.UserInfo.save(data);
|
|
99
99
|
}
|
|
100
100
|
async saveMysAccountInfo(ltuid, data) {
|
|
101
|
-
let MysAccountInfo = this
|
|
101
|
+
let MysAccountInfo = this.ltuidMap.get(ltuid);
|
|
102
102
|
if (!MysAccountInfo) {
|
|
103
103
|
MysAccountInfo = await (await MysAccountInfoDB()).findByPk(ltuid, true);
|
|
104
104
|
}
|
|
105
105
|
await MysAccountInfo.save(data);
|
|
106
|
-
this
|
|
106
|
+
this.ltuidMap.set(ltuid, { ...MysAccountInfo, ...data });
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
var UserInfo = class _UserInfo extends BaseUserInfo {
|
|
@@ -104,18 +104,17 @@ D extends Record<string, any> | null = null, U extends Record<string, any> | nul
|
|
|
104
104
|
row: any;
|
|
105
105
|
}>;
|
|
106
106
|
};
|
|
107
|
-
interface
|
|
107
|
+
interface BaseltuidInfoType {
|
|
108
108
|
ltuid: string;
|
|
109
109
|
type: MysAccountType;
|
|
110
110
|
/** @description 未绑定则使用deviceList中首个设备 */
|
|
111
111
|
deviceMd5: string;
|
|
112
112
|
}
|
|
113
|
-
interface
|
|
113
|
+
interface UidInfoType extends BaseltuidInfoType {
|
|
114
114
|
uid: string;
|
|
115
|
+
userId: string;
|
|
115
116
|
cookie: string;
|
|
116
117
|
stoken: string;
|
|
117
|
-
userId: string;
|
|
118
|
-
owner: boolean;
|
|
119
118
|
}
|
|
120
119
|
interface DeviceInfoType {
|
|
121
120
|
id: string;
|
|
@@ -128,4 +127,4 @@ interface DeviceInfoType {
|
|
|
128
127
|
product: string;
|
|
129
128
|
}
|
|
130
129
|
|
|
131
|
-
export { type ApiInfoFn as A, type BaseMysRes as B, type DeviceInfoType as D, type RequestResult as R, type
|
|
130
|
+
export { type ApiInfoFn as A, type BaseMysRes as B, type DeviceInfoType as D, type RequestResult as R, type UidInfoType as U, type BaseltuidInfoType as a, DefineApi as b };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { E as EnhancedArray } from '../../array-
|
|
1
|
+
export { E as EnhancedArray } from '../../array-DuqoS2wx.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as Config } from '../../array-
|
|
1
|
+
export { C as Config } from '../../array-DuqoS2wx.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as Config, E as EnhancedArray } from '../../array-
|
|
2
|
-
export {
|
|
1
|
+
export { C as Config, E as EnhancedArray } from '../../array-DuqoS2wx.js';
|
|
2
|
+
export { ConfigDefine, ConfigDefineArray } from './types/config.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface ConfigDefine<T> {
|
|
2
2
|
defaultConfig: T;
|
|
3
3
|
}
|
|
4
|
-
interface
|
|
4
|
+
interface ConfigDefineArray<T> {
|
|
5
5
|
defaultConfig: T[];
|
|
6
6
|
defaultConfigItem: {
|
|
7
7
|
defaultConfig: T;
|
|
@@ -9,4 +9,4 @@ interface ConfigIgnoreArray<T> {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export type {
|
|
12
|
+
export type { ConfigDefine, ConfigDefineArray };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ConfigDefine, ConfigDefineArray } from './config.js';
|
|
@@ -5,6 +5,9 @@ declare class Table<TableType extends Record<string, any>, DBType extends Databa
|
|
|
5
5
|
#private;
|
|
6
6
|
initCache: DatabaseClassInstance<TableType, DBType>;
|
|
7
7
|
modelSchema: Record<keyof TableType, ModelAttributeColumnOptions<Model>>;
|
|
8
|
+
/**
|
|
9
|
+
* @param type Db: 直接保存在sqlite数据中、 File: 保存在单个json文件中、 Dir: 保存在多个json文件的目录中、Schema中除pk外每一个键值对应一个文件 e.g tableName/user/key.json
|
|
10
|
+
*/
|
|
8
11
|
constructor(DataDir: string, tableName: string, type: DBType);
|
|
9
12
|
init(Schema: Record<keyof TableType, ModelAttributeColumnOptions<Model>>): Promise<() => Promise<DatabaseClassInstance<TableType, DBType>>>;
|
|
10
13
|
addSchem<newTableType extends ExtraTableType>(newSchema: Record<keyof newTableType, ModelAttributeColumnOptions<Model>>): Promise<() => Promise<DatabaseClassInstance<TableType & newTableType, DBType>>>;
|
|
@@ -3,19 +3,19 @@ import "../../chunk-Z5I6A73Y.js";
|
|
|
3
3
|
import {
|
|
4
4
|
MysUserInfoDB,
|
|
5
5
|
MysUserInfoTable
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-HTH25YE2.js";
|
|
7
7
|
import {
|
|
8
8
|
MysAccountInfoDB,
|
|
9
9
|
MysAccountInfoTable
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-7ZQQ76WC.js";
|
|
11
11
|
import {
|
|
12
12
|
MysDeviceInfoDB,
|
|
13
13
|
MysDeviceInfoTable
|
|
14
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-BNSHDFFN.js";
|
|
15
15
|
import "../../chunk-SEWEEPJN.js";
|
|
16
16
|
import {
|
|
17
17
|
Table
|
|
18
|
-
} from "../../chunk-
|
|
18
|
+
} from "../../chunk-EAVXU4Q2.js";
|
|
19
19
|
import {
|
|
20
20
|
Database
|
|
21
21
|
} from "../../chunk-G547WVGV.js";
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
import "../../chunk-JRH4JC43.js";
|
|
42
42
|
import "../../chunk-ARLTXJFJ.js";
|
|
43
43
|
import "../../chunk-LG34FPBI.js";
|
|
44
|
-
import "../../chunk-
|
|
44
|
+
import "../../chunk-CDBMB57U.js";
|
|
45
45
|
import "../../chunk-SHLPPEAY.js";
|
|
46
46
|
import "../../chunk-MLKGABMK.js";
|
|
47
47
|
export {
|
|
@@ -2,17 +2,17 @@ import "../../../chunk-Z5I6A73Y.js";
|
|
|
2
2
|
import {
|
|
3
3
|
MysUserInfoDB,
|
|
4
4
|
MysUserInfoTable
|
|
5
|
-
} from "../../../chunk-
|
|
5
|
+
} from "../../../chunk-HTH25YE2.js";
|
|
6
6
|
import {
|
|
7
7
|
MysAccountInfoDB,
|
|
8
8
|
MysAccountInfoTable
|
|
9
|
-
} from "../../../chunk-
|
|
9
|
+
} from "../../../chunk-7ZQQ76WC.js";
|
|
10
10
|
import {
|
|
11
11
|
MysDeviceInfoDB,
|
|
12
12
|
MysDeviceInfoTable
|
|
13
|
-
} from "../../../chunk-
|
|
13
|
+
} from "../../../chunk-BNSHDFFN.js";
|
|
14
14
|
import "../../../chunk-SEWEEPJN.js";
|
|
15
|
-
import "../../../chunk-
|
|
15
|
+
import "../../../chunk-EAVXU4Q2.js";
|
|
16
16
|
import "../../../chunk-G547WVGV.js";
|
|
17
17
|
import "../../../chunk-EMAUATE3.js";
|
|
18
18
|
import "../../../chunk-Y3J3J5B2.js";
|
|
@@ -26,7 +26,7 @@ import "../../../chunk-SHW6FHIB.js";
|
|
|
26
26
|
import "../../../chunk-JRH4JC43.js";
|
|
27
27
|
import "../../../chunk-ARLTXJFJ.js";
|
|
28
28
|
import "../../../chunk-LG34FPBI.js";
|
|
29
|
-
import "../../../chunk-
|
|
29
|
+
import "../../../chunk-CDBMB57U.js";
|
|
30
30
|
import "../../../chunk-SHLPPEAY.js";
|
|
31
31
|
import "../../../chunk-MLKGABMK.js";
|
|
32
32
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MysAccountInfoDB,
|
|
3
3
|
MysAccountInfoTable
|
|
4
|
-
} from "../../../chunk-
|
|
4
|
+
} from "../../../chunk-7ZQQ76WC.js";
|
|
5
5
|
import "../../../chunk-SEWEEPJN.js";
|
|
6
|
-
import "../../../chunk-
|
|
6
|
+
import "../../../chunk-EAVXU4Q2.js";
|
|
7
7
|
import "../../../chunk-G547WVGV.js";
|
|
8
8
|
import "../../../chunk-EMAUATE3.js";
|
|
9
9
|
import "../../../chunk-Y3J3J5B2.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MysDeviceInfoDB,
|
|
3
3
|
MysDeviceInfoTable
|
|
4
|
-
} from "../../../chunk-
|
|
4
|
+
} from "../../../chunk-BNSHDFFN.js";
|
|
5
5
|
import "../../../chunk-SEWEEPJN.js";
|
|
6
|
-
import "../../../chunk-
|
|
6
|
+
import "../../../chunk-EAVXU4Q2.js";
|
|
7
7
|
import "../../../chunk-G547WVGV.js";
|
|
8
8
|
import "../../../chunk-EMAUATE3.js";
|
|
9
9
|
import "../../../chunk-Y3J3J5B2.js";
|
|
@@ -17,7 +17,7 @@ import "../../../chunk-SHW6FHIB.js";
|
|
|
17
17
|
import "../../../chunk-JRH4JC43.js";
|
|
18
18
|
import "../../../chunk-ARLTXJFJ.js";
|
|
19
19
|
import "../../../chunk-LG34FPBI.js";
|
|
20
|
-
import "../../../chunk-
|
|
20
|
+
import "../../../chunk-CDBMB57U.js";
|
|
21
21
|
import "../../../chunk-SHLPPEAY.js";
|
|
22
22
|
import "../../../chunk-MLKGABMK.js";
|
|
23
23
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MysUserInfoDB,
|
|
3
3
|
MysUserInfoTable
|
|
4
|
-
} from "../../../chunk-
|
|
4
|
+
} from "../../../chunk-HTH25YE2.js";
|
|
5
5
|
import "../../../chunk-SEWEEPJN.js";
|
|
6
|
-
import "../../../chunk-
|
|
6
|
+
import "../../../chunk-EAVXU4Q2.js";
|
|
7
7
|
import "../../../chunk-G547WVGV.js";
|
|
8
8
|
import "../../../chunk-EMAUATE3.js";
|
|
9
9
|
import "../../../chunk-Y3J3J5B2.js";
|