karin-plugin-mys-core 1.0.1 → 1.0.3
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/LICENSE +674 -0
- package/lib/apps/MiHoYoLogin.d.ts +3 -1
- package/lib/apps/MiHoYoLogin.js +177 -109
- package/lib/apps/MysDevice.d.ts +2 -2
- package/lib/apps/MysDevice.js +65 -23
- package/lib/apps/UIDManage.d.ts +10 -0
- package/lib/apps/UIDManage.js +52 -0
- package/lib/array-DuqoS2wx.d.ts +62 -0
- package/lib/chunk-2DHTKQ34.js +0 -0
- package/lib/chunk-3BIQN6QA.js +27 -0
- package/lib/chunk-5NA7ZPDS.js +54 -0
- package/lib/chunk-6PIXUPZ6.js +82 -0
- package/lib/chunk-7KEG6SDX.js +0 -0
- package/lib/chunk-7SZX3RBZ.js +0 -0
- package/lib/chunk-7VAWV6ZE.js +0 -0
- package/lib/chunk-7WESXE4X.js +29 -0
- package/lib/chunk-ARLTXJFJ.js +0 -0
- package/lib/chunk-CFS2WFOO.js +0 -0
- package/lib/chunk-COKAJ7V6.js +31 -0
- package/lib/chunk-EMAUATE3.js +217 -0
- package/lib/chunk-FBWSEBAW.js +0 -0
- package/lib/chunk-FOAQZIZ2.js +0 -0
- package/lib/chunk-G547WVGV.js +73 -0
- package/lib/chunk-G5W5WAY5.js +64 -0
- package/lib/chunk-HNODD2IL.js +179 -0
- package/lib/chunk-HVYNK5BN.js +45 -0
- package/lib/chunk-I7XZONDN.js +13 -0
- package/lib/chunk-IVZICDGW.js +19 -0
- package/lib/chunk-JKZ5NRPX.js +130 -0
- package/lib/chunk-JRH4JC43.js +0 -0
- package/lib/chunk-JVJQKRJ4.js +89 -0
- package/lib/chunk-K5U2O3HH.js +0 -0
- package/lib/chunk-KN5SHBVI.js +30 -0
- package/lib/chunk-LG34FPBI.js +50 -0
- package/lib/chunk-LJSDSOY6.js +0 -0
- package/lib/chunk-LYTNREAI.js +0 -0
- package/lib/chunk-MWYDWDR4.js +0 -0
- package/lib/chunk-RWBRS7SA.js +510 -0
- package/lib/chunk-SEWEEPJN.js +0 -0
- package/lib/{chunk-JML6VYXN.js → chunk-SHLPPEAY.js} +13 -17
- package/lib/chunk-SHW6FHIB.js +10 -0
- package/lib/chunk-UVMX6WUC.js +38 -0
- package/lib/chunk-W4DBT7AD.js +0 -0
- package/lib/chunk-XQWTJIT4.js +0 -0
- package/lib/chunk-Y3J3J5B2.js +124 -0
- package/lib/chunk-Z5I6A73Y.js +0 -0
- package/lib/common-Dw5l6Uud.d.ts +33 -0
- package/lib/define-BWuQ7acM.d.ts +131 -0
- package/lib/dir.d.ts +11 -13
- package/lib/dir.js +1 -1
- package/lib/exports/config/array.d.ts +1 -0
- package/lib/exports/config/array.js +7 -0
- package/lib/exports/config/config.d.ts +1 -0
- package/lib/exports/config/config.js +8 -0
- package/lib/exports/config/index.d.ts +2 -0
- package/lib/exports/config/index.js +14 -0
- package/lib/exports/config/types/config.d.ts +12 -0
- package/lib/exports/config/types/config.js +1 -0
- package/lib/exports/config/types/index.d.ts +1 -0
- package/lib/exports/config/types/index.js +2 -0
- package/lib/exports/database/database.d.ts +30 -0
- package/lib/exports/database/database.js +18 -0
- package/lib/exports/database/dbs/base.d.ts +23 -0
- package/lib/exports/database/dbs/base.js +15 -0
- package/lib/exports/database/dbs/index.d.ts +4 -0
- package/lib/exports/database/dbs/index.js +23 -0
- package/lib/exports/database/dbs/sqlite3.d.ts +23 -0
- package/lib/exports/database/dbs/sqlite3.js +19 -0
- package/lib/exports/database/dbs/table.d.ts +13 -0
- package/lib/exports/database/dbs/table.js +19 -0
- package/lib/exports/database/index.d.ts +12 -0
- package/lib/exports/database/index.js +62 -0
- package/lib/exports/database/tables/index.d.ts +9 -0
- package/lib/exports/database/tables/index.js +39 -0
- package/lib/exports/database/tables/mysAccountInfo.d.ts +9 -0
- package/lib/exports/database/tables/mysAccountInfo.js +23 -0
- package/lib/exports/database/tables/mysDeviceInfo.d.ts +9 -0
- package/lib/exports/database/tables/mysDeviceInfo.js +26 -0
- package/lib/exports/database/tables/mysUserInfo.d.ts +9 -0
- package/lib/exports/database/tables/mysUserInfo.js +23 -0
- package/lib/exports/database/types/database.d.ts +6 -0
- package/lib/exports/database/types/database.js +1 -0
- package/lib/exports/database/types/dbs/base.d.ts +114 -0
- package/lib/exports/database/types/dbs/base.js +11 -0
- package/lib/exports/database/types/dbs/index.d.ts +2 -0
- package/lib/exports/database/types/dbs/index.js +12 -0
- package/lib/exports/database/types/index.d.ts +6 -0
- package/lib/exports/database/types/index.js +24 -0
- package/lib/exports/database/types/tables/index.d.ts +5 -0
- package/lib/exports/database/types/tables/index.js +13 -0
- package/lib/exports/database/types/tables/mysAccountInfo.d.ts +14 -0
- package/lib/exports/database/types/tables/mysAccountInfo.js +7 -0
- package/lib/exports/database/types/tables/mysDeviceInfo.d.ts +19 -0
- package/lib/exports/database/types/tables/mysDeviceInfo.js +1 -0
- package/lib/exports/database/types/tables/mysUserInfo.d.ts +31 -0
- package/lib/exports/database/types/tables/mysUserInfo.js +7 -0
- package/lib/exports/mys/api/apis.d.ts +82 -0
- package/lib/exports/mys/api/apis.js +57 -0
- package/lib/exports/mys/api/app.d.ts +60 -0
- package/lib/exports/mys/api/app.js +31 -0
- package/lib/exports/mys/api/define.d.ts +6 -0
- package/lib/exports/mys/api/define.js +43 -0
- package/lib/exports/mys/api/index.d.ts +11 -0
- package/lib/exports/mys/api/index.js +64 -0
- package/lib/exports/mys/index.d.ts +13 -0
- package/lib/exports/mys/index.js +77 -0
- package/lib/exports/mys/types/api/define.d.ts +6 -0
- package/lib/exports/mys/types/api/define.js +1 -0
- package/lib/exports/mys/types/api/index.d.ts +6 -0
- package/lib/exports/mys/types/api/index.js +2 -0
- package/lib/exports/mys/types/index.d.ts +10 -0
- package/lib/exports/mys/types/index.js +12 -0
- package/lib/exports/mys/types/user/game.d.ts +10 -0
- package/lib/exports/mys/types/user/game.js +1 -0
- package/lib/exports/mys/types/user/index.d.ts +10 -0
- package/lib/exports/mys/types/user/index.js +9 -0
- package/lib/exports/mys/types/user/userInfo.d.ts +10 -0
- package/lib/exports/mys/types/user/userInfo.js +7 -0
- package/lib/exports/mys/user/deviceInfo.d.ts +11 -0
- package/lib/exports/mys/user/deviceInfo.js +29 -0
- package/lib/exports/mys/user/game.d.ts +20 -0
- package/lib/exports/mys/user/game.js +7 -0
- package/lib/exports/mys/user/index.d.ts +12 -0
- package/lib/exports/mys/user/index.js +51 -0
- package/lib/exports/mys/user/userInfo.d.ts +10 -0
- package/lib/exports/mys/user/userInfo.js +45 -0
- package/lib/exports/utils/common.d.ts +1 -0
- package/lib/exports/utils/common.js +13 -0
- package/lib/exports/utils/index.d.ts +2 -0
- package/lib/exports/utils/index.js +12 -0
- package/lib/exports/utils/render.d.ts +21 -0
- package/lib/exports/utils/render.js +7 -0
- package/lib/index-DEEWbZ0V.d.ts +102 -0
- package/lib/index.js +1 -1
- package/package.json +29 -15
- package/resources/fonts/HYWenHei-55W.ttf +0 -0
- package/resources/image/launcher-icon//345/216/237/347/245/236.png +0 -0
- package/resources/image/launcher-icon//345/264/251/345/235/2173.png +0 -0
- package/resources/image/launcher-icon//345/264/251/345/235/217/345/255/246/345/233/2552.png +0 -0
- package/resources/image/launcher-icon//345/264/251/345/235/217/357/274/232/345/233/240/347/274/230/347/262/276/347/201/265.png +0 -0
- package/resources/image/launcher-icon//345/264/251/345/235/217/357/274/232/346/230/237/347/251/271/351/223/201/351/201/223.png +0 -0
- package/resources/image/launcher-icon//346/230/237/345/270/203/350/260/267/345/234/260.png +0 -0
- package/resources/image/launcher-icon//346/234/252/345/256/232/344/272/213/344/273/266/347/260/277.png +0 -0
- package/resources/image/launcher-icon//347/273/235/345/214/272/351/233/266.png +0 -0
- package/resources/image/mys-logo.png +0 -0
- package/resources/template/ShowBindAccount/index.css +1 -0
- package/resources/template/ShowBindAccount/index.html +65 -0
- package/resources/template/ShowBindDevice/index.html +20 -0
- package/resources/template/ShowBindDevice/inex.css +1 -0
- package/resources/template/layout/default.css +1 -0
- package/resources/template/layout/default.html +27 -0
- package/lib/app.d.ts +0 -2
- package/lib/base-BJv9XnQP.d.ts +0 -120
- package/lib/chunk-CQNW7LJI.js +0 -38
- package/lib/chunk-MV2UE7C7.js +0 -410
- package/lib/chunk-NHUNEZXM.js +0 -371
- package/lib/chunk-WYRIRWT5.js +0 -213
- package/lib/database-byVXw91u.d.ts +0 -5
- package/lib/define-pa_pWNWT.d.ts +0 -182
- package/lib/exports/core.d.ts +0 -249
- package/lib/exports/core.js +0 -45
- package/lib/exports/database.d.ts +0 -48
- package/lib/exports/database.js +0 -20
- package/lib/exports/types.d.ts +0 -5
- package/lib/exports/types.js +0 -13
- package/lib/index.d.ts +0 -2
- package/lib/web.config.d.ts +0 -5
- package/lib/web.config.js +0 -55
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "../../chunk-ARLTXJFJ.js";
|
|
2
|
+
import {
|
|
3
|
+
common_exports
|
|
4
|
+
} from "../../chunk-LG34FPBI.js";
|
|
5
|
+
import {
|
|
6
|
+
RenderTemplate
|
|
7
|
+
} from "../../chunk-HVYNK5BN.js";
|
|
8
|
+
import "../../chunk-MLKGABMK.js";
|
|
9
|
+
export {
|
|
10
|
+
RenderTemplate,
|
|
11
|
+
common_exports as common
|
|
12
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface RenderCfg {
|
|
2
|
+
/** @description 插件名称 package.json 的 name */
|
|
3
|
+
name: string;
|
|
4
|
+
/** @description 插件版本 package.json 的 version */
|
|
5
|
+
version: string;
|
|
6
|
+
/** @description 根目录绝对路径 */
|
|
7
|
+
pluginDir: string;
|
|
8
|
+
/** @description 插件资源目录 `@karinjs/karin-plugin-xxx/resources` */
|
|
9
|
+
ResourcesDir: string;
|
|
10
|
+
}
|
|
11
|
+
declare class RenderTemplate<K extends string> {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(cfg: RenderCfg);
|
|
14
|
+
/** @description 渲染Html路径为:resources/template/${template}/index.html */
|
|
15
|
+
template(template: K, rendeDdata: Record<string, any>, options?: {
|
|
16
|
+
type?: 'png' | 'jpeg' | 'webp';
|
|
17
|
+
plugin?: Record<string, any>;
|
|
18
|
+
}): Promise<string | null>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { type RenderCfg, RenderTemplate };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { a as BaseltuidInfo, U as UidInfo } from './define-BWuQ7acM.js';
|
|
2
|
+
import { BaseUserInfoTableType, UidPermission, BaseGameUIDInfoTableType } from './exports/database/types/tables/mysUserInfo.js';
|
|
3
|
+
import { DatabaseReturn, DatabaseType, DatabaseArray } from './exports/database/types/dbs/base.js';
|
|
4
|
+
import { MysAccountInfoTableType, MysAccountType } from './exports/database/types/tables/mysAccountInfo.js';
|
|
5
|
+
import { MysDeviceInfoTableType } from './exports/database/types/tables/mysDeviceInfo.js';
|
|
6
|
+
|
|
7
|
+
declare class BaseUserInfo<U extends BaseUserInfoTableType> {
|
|
8
|
+
#private;
|
|
9
|
+
userId: BaseUserInfoTableType['userId'];
|
|
10
|
+
UserInfo: DatabaseReturn<BaseUserInfoTableType>[DatabaseType.Db];
|
|
11
|
+
refresh: () => Promise<this>;
|
|
12
|
+
constructor(userId: string);
|
|
13
|
+
get ltuids(): DatabaseArray<string>;
|
|
14
|
+
get stuids(): DatabaseArray<string>;
|
|
15
|
+
get deviceList(): DatabaseArray<string>;
|
|
16
|
+
get LtuidInfoList(): Readonly<MysAccountInfoTableType & {
|
|
17
|
+
save: (data: Partial<MysAccountInfoTableType>) => Promise<MysAccountInfoTableType & /*elided*/ any>;
|
|
18
|
+
destroy: () => Promise<boolean>;
|
|
19
|
+
}>[];
|
|
20
|
+
initMysAccountInfo(UserInfo: DatabaseReturn<BaseUserInfoTableType>[DatabaseType.Db], initAll: boolean): Promise<void>;
|
|
21
|
+
getLtuidInfo(ltuid: string): Readonly<(MysAccountInfoTableType & {
|
|
22
|
+
save: (data: Partial<MysAccountInfoTableType>) => Promise<MysAccountInfoTableType & /*elided*/ any>;
|
|
23
|
+
destroy: () => Promise<boolean>;
|
|
24
|
+
}) | undefined>;
|
|
25
|
+
getDeviceInfoList(): Promise<(MysDeviceInfoTableType & {
|
|
26
|
+
save: (data: Partial<MysDeviceInfoTableType>) => Promise<MysDeviceInfoTableType & /*elided*/ any>;
|
|
27
|
+
destroy: () => Promise<boolean>;
|
|
28
|
+
})[]>;
|
|
29
|
+
saveUserInfo(data: Partial<U>): Promise<void>;
|
|
30
|
+
saveMysAccountInfo(ltuid: string, data: Partial<MysAccountInfoTableType>): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
declare class UserInfo extends BaseUserInfo<BaseUserInfoTableType> {
|
|
33
|
+
static create(userId: string, initAll?: boolean): Promise<UserInfo>;
|
|
34
|
+
static refreshUid(options: {
|
|
35
|
+
userId: string;
|
|
36
|
+
cookie: string;
|
|
37
|
+
} & BaseltuidInfo, perm: UidPermission): Promise<RefreshUidResultType>;
|
|
38
|
+
static refreshCookie(stokenParams: StokenParamsType, serv: MysAccountType | MysAccountType[]): Promise<{
|
|
39
|
+
Serv: MysAccountType;
|
|
40
|
+
cookieParams: CookieParamsType;
|
|
41
|
+
message: string;
|
|
42
|
+
}>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare class GameUserInfoBase<GameUserInfoTableType extends BaseUserInfoTableType> extends BaseUserInfo<GameUserInfoTableType> {
|
|
46
|
+
get main_uid(): string;
|
|
47
|
+
get bind_uids(): BaseGameUIDInfoTableType<string>[`${string}-uids`];
|
|
48
|
+
get mainUIDInfo(): UidInfo | undefined;
|
|
49
|
+
get uidInfoList(): UidInfo[];
|
|
50
|
+
static create<T extends BaseUserInfoTableType>(userId: string): Promise<GameUserInfoBase<T>>;
|
|
51
|
+
getUIDInfo(uid: string): UidInfo | undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface StokenParamsType {
|
|
55
|
+
stuid: string;
|
|
56
|
+
stoken: string;
|
|
57
|
+
mid: string;
|
|
58
|
+
}
|
|
59
|
+
type CookieParamsType = Partial<{
|
|
60
|
+
ltmid_v2: string;
|
|
61
|
+
ltuid: string;
|
|
62
|
+
ltuid_v2: string;
|
|
63
|
+
login_uid: string;
|
|
64
|
+
ltoken: string;
|
|
65
|
+
ltoken_v2: string;
|
|
66
|
+
cookie_token: string;
|
|
67
|
+
cookie_token_v2: string;
|
|
68
|
+
account_id: string;
|
|
69
|
+
account_id_v2: string;
|
|
70
|
+
account_mid_v2: string;
|
|
71
|
+
mi18nLang: string;
|
|
72
|
+
}>;
|
|
73
|
+
interface UserGameRoleItem {
|
|
74
|
+
game_biz: string;
|
|
75
|
+
region: string;
|
|
76
|
+
game_uid: string;
|
|
77
|
+
nickname: string;
|
|
78
|
+
is_chosen: boolean;
|
|
79
|
+
}
|
|
80
|
+
interface RefreshUidResultType {
|
|
81
|
+
Serv: MysAccountType;
|
|
82
|
+
uids: {
|
|
83
|
+
name: string;
|
|
84
|
+
columnKey: `${string}-uids`;
|
|
85
|
+
data: BaseGameUIDInfoTableType<string>[`${string}-uids`];
|
|
86
|
+
}[];
|
|
87
|
+
message: string;
|
|
88
|
+
}
|
|
89
|
+
type gameName = '崩坏:星穹铁道' | '崩坏:因缘精灵' | '原神' | '崩坏3' | '崩坏学园2' | '未定事件簿' | '绝区零' | '星布谷地';
|
|
90
|
+
declare class RegisterGameBase<GameUserInfoTableType extends BaseUserInfoTableType> {
|
|
91
|
+
game: string;
|
|
92
|
+
columnKey: `${string}-uids`;
|
|
93
|
+
/** @description 游戏名称 */
|
|
94
|
+
name: gameName;
|
|
95
|
+
/** @description 指令前缀匹配 */
|
|
96
|
+
prefix: RegExp;
|
|
97
|
+
refresh: (info: UserGameRoleItem[]) => string[];
|
|
98
|
+
UserInfo: typeof GameUserInfoBase<GameUserInfoTableType>;
|
|
99
|
+
constructor(game: string, name: gameName, prefix: RegExp);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { BaseUserInfo as B, type CookieParamsType as C, GameUserInfoBase as G, type RefreshUidResultType as R, type StokenParamsType as S, type UserGameRoleItem as U, RegisterGameBase as a, UserInfo as b };
|
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "karin-plugin-mys-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"author": "babanbang",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "karin-plugin-mys-core",
|
|
@@ -19,20 +19,25 @@
|
|
|
19
19
|
"pub": "npm publish --access public"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
|
-
"./
|
|
23
|
-
"types": "./lib/exports/
|
|
24
|
-
"development": "./src/exports/
|
|
25
|
-
"default": "./lib/exports/
|
|
22
|
+
"./config": {
|
|
23
|
+
"types": "./lib/exports/config/index.d.ts",
|
|
24
|
+
"development": "./src/exports/config/index.ts",
|
|
25
|
+
"default": "./lib/exports/config/index.js"
|
|
26
26
|
},
|
|
27
27
|
"./database": {
|
|
28
|
-
"types": "./lib/exports/database.d.ts",
|
|
29
|
-
"development": "./src/exports/database.ts",
|
|
30
|
-
"default": "./lib/exports/database.js"
|
|
28
|
+
"types": "./lib/exports/database/index.d.ts",
|
|
29
|
+
"development": "./src/exports/database/index.ts",
|
|
30
|
+
"default": "./lib/exports/database/index.js"
|
|
31
31
|
},
|
|
32
|
-
"./
|
|
33
|
-
"types": "./lib/exports/
|
|
34
|
-
"development": "./src/exports/
|
|
35
|
-
"default": "./lib/exports/
|
|
32
|
+
"./mys": {
|
|
33
|
+
"types": "./lib/exports/mys/index.d.ts",
|
|
34
|
+
"development": "./src/exports/mys/index.ts",
|
|
35
|
+
"default": "./lib/exports/mys/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./utils": {
|
|
38
|
+
"types": "./lib/exports/utils/index.d.ts",
|
|
39
|
+
"development": "./src/exports/utils/index.ts",
|
|
40
|
+
"default": "./lib/exports/utils/index.js"
|
|
36
41
|
}
|
|
37
42
|
},
|
|
38
43
|
"main": "lib/index.js",
|
|
@@ -51,16 +56,25 @@
|
|
|
51
56
|
],
|
|
52
57
|
"web": "./lib/web.config.js",
|
|
53
58
|
"ts-web": "./src/web.config.ts",
|
|
54
|
-
"static": [
|
|
59
|
+
"static": [
|
|
60
|
+
"resources"
|
|
61
|
+
],
|
|
55
62
|
"files": [
|
|
56
63
|
"config",
|
|
57
|
-
"data"
|
|
64
|
+
"data",
|
|
65
|
+
"resources"
|
|
58
66
|
]
|
|
59
67
|
},
|
|
60
68
|
"files": [
|
|
69
|
+
"LICENSE",
|
|
61
70
|
"/lib/**/*.js",
|
|
62
71
|
"/lib/**/*.d.ts",
|
|
63
|
-
"
|
|
72
|
+
"resources",
|
|
73
|
+
"!resources/**/*.css.map",
|
|
74
|
+
"!resources/**/*.scss",
|
|
75
|
+
"!lib/app.js",
|
|
76
|
+
"!lib/app.d.ts",
|
|
77
|
+
"!lib/index.d.ts"
|
|
64
78
|
],
|
|
65
79
|
"publishConfig": {
|
|
66
80
|
"access": "public",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#container.container{background-color:#f6f0e6;padding:20px 18px 36px 18px}#container.container .mys-logo-bg{position:absolute;top:-10px;right:0;width:150px;height:72px;background-image:url("../../image/mys-logo.png");background-size:contain;background-repeat:no-repeat;background-position:center;opacity:.5;z-index:5}#container.container .no-accounts{text-align:center;color:#6b6b6b;padding:20px;margin:12px 0;font-weight:600}#container.container .user{display:flex;align-items:center;gap:10px;margin-bottom:12px}#container.container .user .avatar{width:40px;height:40px;border-radius:50%;-o-object-fit:cover;object-fit:cover;flex:0 0 auto}#container.container .user .nickname{color:#222;font-size:14px;min-width:0;white-space:normal;overflow-wrap:anywhere;word-break:break-word}#container.container .bind-account{display:flex;flex-direction:column;gap:6px;background:#fff;border:1px solid rgba(0,0,0,.06);padding:12px;margin-bottom:12px;border-radius:8px;box-shadow:0 2px 6px rgba(0,0,0,.04)}#container.container .bind-account .title{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px}#container.container .bind-account .title .ltuid{display:flex;color:#3f7dd1;font-size:14px;font-weight:600}#container.container .bind-account .title .perm{display:flex;gap:8px;align-items:center}#container.container .bind-account .title .perm .cookie,#container.container .bind-account .title .perm .stoken{display:inline-block;padding:4px 8px;font-size:12px;border-radius:12px;color:#fff;font-weight:600}#container.container .bind-account .title .perm .cookie{background:linear-gradient(180deg, rgb(52.5469767442, 193.0530232558, 85.6744186047), #2ea94b);box-shadow:0 1px 0 rgba(0,0,0,.06) inset}#container.container .bind-account .title .perm .stoken{background:linear-gradient(180deg, #f6d86a, #f1c40f);color:rgba(0,0,0,.85)}#container.container .bind-account .bind-uid{display:flex;align-items:center;gap:12px;padding:6px 4px;border-radius:6px}#container.container .bind-account .bind-uid .game{border-radius:10px;width:40px;display:flex;align-items:center;justify-content:center}#container.container .bind-account .bind-uid .uids{flex:1 1 auto;display:grid;grid-template-columns:repeat(3, minmax(0, 1fr));gap:8px}#container.container .bind-account .bind-uid .uids .uid-item{display:flex;align-items:center;justify-content:center;padding:6px 8px;border-radius:8px;background:rgba(0,0,0,.06);color:#111;font-weight:600;font-size:13px;position:relative;overflow:visible;word-break:break-all}#container.container .bind-account .bind-uid .uids .uid-item[class~="4"]{color:rgba(0,0,0,.6)}#container.container .bind-account .bind-uid .uids .uid-item[class~="4"]::after{content:"";position:absolute;left:8%;right:8%;top:50%;height:1px;background:#d32f2f;transform:translateY(-50%);border-radius:2px}#container.container .bind-account .bind-uid+.bind-uid{padding-top:8px;position:relative}#container.container .bind-account .bind-uid+.bind-uid::before{content:"";position:absolute;width:90%;left:5%;right:0;top:0;height:1px;background:#3f7dd1;border-radius:1px}/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!-- default layout -->
|
|
2
|
+
{{extend plugin.defaultLayout}}
|
|
3
|
+
|
|
4
|
+
<!-- 页面样式资源 -->
|
|
5
|
+
{{block 'css'}}
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="{{plugin.resources.default}}/template/{{plugin.template}}/index.css" />
|
|
7
|
+
|
|
8
|
+
{{/block}}
|
|
9
|
+
|
|
10
|
+
<!-- 页面布局内容 -->
|
|
11
|
+
{{block 'container'}}
|
|
12
|
+
<!-- 右上角装饰 logo -->
|
|
13
|
+
<div class="mys-logo-bg"></div>
|
|
14
|
+
|
|
15
|
+
<div class="user">
|
|
16
|
+
<img class="avatar" src="{{User.avatar}}" />
|
|
17
|
+
<span class="nickname">{{@User.nickname}} ({{User.userId}})</span>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
{{if AccountList && AccountList.length > 0}}
|
|
21
|
+
{{each AccountList account idx}}
|
|
22
|
+
<div class="bind-account">
|
|
23
|
+
|
|
24
|
+
<div class="title">
|
|
25
|
+
<span class="ltuid">MYS UID ({{idx + 1}}):{{account.ltuid}}</span>
|
|
26
|
+
|
|
27
|
+
<div class="perm">
|
|
28
|
+
{{if account.permission >= 1}}
|
|
29
|
+
<span class="cookie">cookie</span>
|
|
30
|
+
{{/if}}
|
|
31
|
+
|
|
32
|
+
{{if account.permission >= 2}}
|
|
33
|
+
<span class="stoken">stoken</span>
|
|
34
|
+
{{/if}}
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
{{each account.bindUids bindUid}}
|
|
40
|
+
<div class="bind-uid">
|
|
41
|
+
<img class="game" src="{{plugin.resources.default}}/image/launcher-icon/{{bindUid.gameName}}.png" />
|
|
42
|
+
|
|
43
|
+
<div class="uids">
|
|
44
|
+
{{each bindUid.uids info}}
|
|
45
|
+
<span class="uid-item {{info.perm}}">{{info.uid}}</span>
|
|
46
|
+
{{/each}}
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
</div>
|
|
50
|
+
{{/each}}
|
|
51
|
+
|
|
52
|
+
</div>
|
|
53
|
+
{{/each}}
|
|
54
|
+
{{else}}
|
|
55
|
+
<div class="no-accounts">暂未绑定账号</div>
|
|
56
|
+
{{/if}}
|
|
57
|
+
|
|
58
|
+
{{/block}}
|
|
59
|
+
|
|
60
|
+
<!-- 页面脚本资源 -->
|
|
61
|
+
{{block 'script'}}
|
|
62
|
+
<script>
|
|
63
|
+
|
|
64
|
+
</script>
|
|
65
|
+
{{/block}}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!-- default layout -->
|
|
2
|
+
{{extend plugin.defaultLayout}}
|
|
3
|
+
|
|
4
|
+
<!-- 页面样式资源 -->
|
|
5
|
+
{{block 'css'}}
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="{{plugin.resources.default}}/template/{{plugin.template}}/index.css" />
|
|
7
|
+
|
|
8
|
+
{{/block}}
|
|
9
|
+
|
|
10
|
+
<!-- 页面布局内容 -->
|
|
11
|
+
{{block 'container'}}
|
|
12
|
+
|
|
13
|
+
{{/block}}
|
|
14
|
+
|
|
15
|
+
<!-- 页面脚本资源 -->
|
|
16
|
+
{{block 'script'}}
|
|
17
|
+
<script>
|
|
18
|
+
|
|
19
|
+
</script>
|
|
20
|
+
{{/block}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*# sourceMappingURL=inex.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:"HYWenHei-55W";src:url("../../fonts//HYWenHei-55W.ttf")}:root{--width: 600px }*{margin:0;padding:0;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none}body{background:rgba(0,0,0,0);color:#fff;width:var(--width)}.container{font-family:"HYWenHei-55W";padding-bottom:40px;position:relative;display:flex;flex-direction:column;width:100%}.copyright{left:0;bottom:0;display:flex;width:100%;font-size:16px;position:absolute;align-items:center;justify-content:center;padding:10px 0 10px 0;background-color:#000}.copyright strong{padding-top:5px;font-weight:bold;font-size:10px;color:#f2c06f}/*# sourceMappingURL=default.css.map */
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="{{plugin.resources.default}}/template/layout/default.css" />
|
|
7
|
+
|
|
8
|
+
{{block 'css'}}{{/block}}
|
|
9
|
+
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<div class="container" id="container">
|
|
14
|
+
|
|
15
|
+
{{block 'container'}}{{/block}}
|
|
16
|
+
|
|
17
|
+
<div class="copyright">
|
|
18
|
+
Created by Karin<strong>v{{karin.version}}</strong> & {{plugin.name}}<strong>v{{plugin.version}}</strong>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
{{block 'script'}}{{/block}}
|
|
24
|
+
|
|
25
|
+
</body>
|
|
26
|
+
|
|
27
|
+
</html>
|
package/lib/app.d.ts
DELETED
package/lib/base-BJv9XnQP.d.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { ModelStatic, Model, ModelAttributeColumnOptions, DataTypes } from 'sequelize';
|
|
2
|
-
|
|
3
|
-
interface MysAccountInfoType {
|
|
4
|
-
ltuid: string;
|
|
5
|
-
type: MysAccountType;
|
|
6
|
-
cookie: string;
|
|
7
|
-
stoken: string;
|
|
8
|
-
/** 绑定的设备md5 */
|
|
9
|
-
deviceMd5: string;
|
|
10
|
-
}
|
|
11
|
-
declare const enum MysAccountType {
|
|
12
|
-
cn = "mihoyo",
|
|
13
|
-
os = "hoyolab"
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface MysDeviceInfoItem {
|
|
17
|
-
deviceId: string;
|
|
18
|
-
deviceFp: string;
|
|
19
|
-
name: string;
|
|
20
|
-
board: string;
|
|
21
|
-
model: string;
|
|
22
|
-
oaid: string;
|
|
23
|
-
androidVersion: string;
|
|
24
|
-
fingerprint: string;
|
|
25
|
-
product: string;
|
|
26
|
-
}
|
|
27
|
-
interface MysDeviceInfoType extends MysDeviceInfoItem {
|
|
28
|
-
md5: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface BaseUserInfoType {
|
|
32
|
-
userId: string;
|
|
33
|
-
ltuids: string[];
|
|
34
|
-
stuids: string[];
|
|
35
|
-
deviceList: string[];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
declare const enum Dialect {
|
|
39
|
-
Sqlite = "sqlite",
|
|
40
|
-
MySQL = "mysql",
|
|
41
|
-
MariaDB = "mariadb",
|
|
42
|
-
PostgreSQL = "postgres",
|
|
43
|
-
MSSQL = "mssql",
|
|
44
|
-
Oracle = "oracle",
|
|
45
|
-
DB2 = "db2",
|
|
46
|
-
Snowflake = "snowflake"
|
|
47
|
-
}
|
|
48
|
-
declare enum DatabaseType {
|
|
49
|
-
File = "file",
|
|
50
|
-
Dir = "dir",
|
|
51
|
-
Db = "db"
|
|
52
|
-
}
|
|
53
|
-
type ModelAttributes<M extends Model = Model, TAttributes = any> = {
|
|
54
|
-
[name in keyof TAttributes]: ModelAttributeColumnOptions<M>;
|
|
55
|
-
};
|
|
56
|
-
interface DatabaseReturn<T> {
|
|
57
|
-
[DatabaseType.Db]: T & {
|
|
58
|
-
save: (data: Partial<T>) => Promise<DatabaseReturn<T>[DatabaseType.Db]>;
|
|
59
|
-
};
|
|
60
|
-
[DatabaseType.File]: T & {
|
|
61
|
-
save: (data: T) => Promise<DatabaseReturn<T>[DatabaseType.File]>;
|
|
62
|
-
};
|
|
63
|
-
[DatabaseType.Dir]: T & {
|
|
64
|
-
save: (data: T) => Promise<DatabaseReturn<T>[DatabaseType.Dir]>;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
type DatabaseClassInstance<T extends Record<string, any>, D extends DatabaseType> = {
|
|
68
|
-
/** 数据库标识 */
|
|
69
|
-
dialect: Dialect;
|
|
70
|
-
model: ModelStatic<Model>;
|
|
71
|
-
databasePath: string;
|
|
72
|
-
databaseType: D;
|
|
73
|
-
/** 表名 */
|
|
74
|
-
modelName: string;
|
|
75
|
-
/** 表定义 */
|
|
76
|
-
modelSchema: ModelAttributes<Model>;
|
|
77
|
-
/** 检查数据库是否可用 */
|
|
78
|
-
check(): Promise<boolean>;
|
|
79
|
-
/**
|
|
80
|
-
* 初始化表
|
|
81
|
-
* @param DataDir 插件数据目录
|
|
82
|
-
* @param modelName 表名
|
|
83
|
-
* @param modelSchema 表定义
|
|
84
|
-
* @param type 数据库类型
|
|
85
|
-
*/
|
|
86
|
-
init(DataDir: string, modelName: string, modelSchema: Record<keyof T, ModelAttributeColumnOptions<Model>>, type: D): Promise<DatabaseClassInstance<T, D>>;
|
|
87
|
-
/** 将表定义转换为 JSON 对象 */
|
|
88
|
-
schemaToJSON(pk: string): T;
|
|
89
|
-
/** 获取用户数据文件路径 */
|
|
90
|
-
userPath(pk: string): string;
|
|
91
|
-
/** 根据主键读取用户数据文件 */
|
|
92
|
-
readSync(path: string, pk: string): DatabaseReturn<T>[DatabaseType.File];
|
|
93
|
-
/** 根据主键读取用户数据目录 */
|
|
94
|
-
readDirSync(pk: string): DatabaseReturn<T>[DatabaseType.Dir];
|
|
95
|
-
/** 写入用户数据目录 */
|
|
96
|
-
writeDirSync(pk: string, data: Record<string, any>): boolean;
|
|
97
|
-
/** 保存用户数据到文件 */
|
|
98
|
-
saveFile(pk: string): (data: T) => Promise<DatabaseReturn<T>[DatabaseType.File]>;
|
|
99
|
-
/** 保存用户数据到目录 */
|
|
100
|
-
saveDir(pk: string): (data: T) => Promise<DatabaseReturn<T>[DatabaseType.Dir]>;
|
|
101
|
-
/** 保存用户数据到 SQL 数据库 */
|
|
102
|
-
saveSql(model: Model<any, any>, pk: string): (data: Partial<T>) => Promise<DatabaseReturn<T>[DatabaseType.Db]>;
|
|
103
|
-
/** 根据主键查找或创建用户数据 */
|
|
104
|
-
findByPk(pk: string, create: true): Promise<DatabaseReturn<T>[D]>;
|
|
105
|
-
/** 根据主键查找用户数据 */
|
|
106
|
-
findByPk(pk: string, create?: boolean): Promise<DatabaseReturn<T>[D] | undefined>;
|
|
107
|
-
/** 根据主键数组查找用户数据 */
|
|
108
|
-
findAllByPks(pks: string[]): Promise<DatabaseReturn<T>[D][]>;
|
|
109
|
-
/** 删除用户数据 */
|
|
110
|
-
destroy(pk: string): Promise<boolean>;
|
|
111
|
-
};
|
|
112
|
-
interface DatabaseClassStatic {
|
|
113
|
-
Column(type: keyof typeof DataTypes, def: any, option?: Partial<ModelAttributeColumnOptions<Model>>): ModelAttributeColumnOptions<Model>;
|
|
114
|
-
ArrayColumn(key: string, fn?: (data: string[]) => string[]): ModelAttributeColumnOptions<Model>;
|
|
115
|
-
JsonColumn(key: string, def: {
|
|
116
|
-
[key in string]: any;
|
|
117
|
-
}): ModelAttributeColumnOptions<Model>;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export { type BaseUserInfoType as B, Dialect as D, type ModelAttributes as M, DatabaseType as a, type DatabaseReturn as b, type DatabaseClassInstance as c, type DatabaseClassStatic as d, type MysAccountInfoType as e, MysAccountType as f, type MysDeviceInfoItem as g, type MysDeviceInfoType as h };
|
package/lib/chunk-CQNW7LJI.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// src/types/app/command.ts
|
|
2
|
-
var CoreCommand = /* @__PURE__ */ ((CoreCommand2) => {
|
|
3
|
-
CoreCommand2["BingMysDevice"] = "BingMysDevice";
|
|
4
|
-
return CoreCommand2;
|
|
5
|
-
})(CoreCommand || {});
|
|
6
|
-
|
|
7
|
-
// src/types/database/dbs/base.ts
|
|
8
|
-
var Dialect = /* @__PURE__ */ ((Dialect2) => {
|
|
9
|
-
Dialect2["Sqlite"] = "sqlite";
|
|
10
|
-
Dialect2["MySQL"] = "mysql";
|
|
11
|
-
Dialect2["MariaDB"] = "mariadb";
|
|
12
|
-
Dialect2["PostgreSQL"] = "postgres";
|
|
13
|
-
Dialect2["MSSQL"] = "mssql";
|
|
14
|
-
Dialect2["Oracle"] = "oracle";
|
|
15
|
-
Dialect2["DB2"] = "db2";
|
|
16
|
-
Dialect2["Snowflake"] = "snowflake";
|
|
17
|
-
return Dialect2;
|
|
18
|
-
})(Dialect || {});
|
|
19
|
-
var DatabaseType = /* @__PURE__ */ ((DatabaseType2) => {
|
|
20
|
-
DatabaseType2["File"] = "file";
|
|
21
|
-
DatabaseType2["Dir"] = "dir";
|
|
22
|
-
DatabaseType2["Db"] = "db";
|
|
23
|
-
return DatabaseType2;
|
|
24
|
-
})(DatabaseType || {});
|
|
25
|
-
|
|
26
|
-
// src/types/database/tables/mysAccountInfo.ts
|
|
27
|
-
var MysAccountType = /* @__PURE__ */ ((MysAccountType2) => {
|
|
28
|
-
MysAccountType2["cn"] = "mihoyo";
|
|
29
|
-
MysAccountType2["os"] = "hoyolab";
|
|
30
|
-
return MysAccountType2;
|
|
31
|
-
})(MysAccountType || {});
|
|
32
|
-
|
|
33
|
-
export {
|
|
34
|
-
CoreCommand,
|
|
35
|
-
Dialect,
|
|
36
|
-
DatabaseType,
|
|
37
|
-
MysAccountType
|
|
38
|
-
};
|