karin-plugin-mys-core 1.0.4 → 1.0.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/README.md +1031 -76
- package/lib/apps/MiHoYoLogin.js +13 -12
- package/lib/apps/MysDevice.js +12 -13
- package/lib/apps/UIDManage.js +13 -12
- package/lib/{array-DuqoS2wx.d.ts → array-CCexQ14j.d.ts} +1 -1
- package/lib/chunk-AY34PPJT.js +72 -0
- package/lib/{chunk-3BIQN6QA.js → chunk-BWFWWHCT.js} +20 -1
- package/lib/{chunk-JKZ5NRPX.js → chunk-BXA3VAQC.js} +3 -2
- package/lib/{chunk-WQK5RDUV.js → chunk-DJTJKSNN.js} +157 -164
- package/lib/chunk-UC6INRYV.js +0 -0
- package/lib/chunk-UX2BDLJF.js +6 -0
- package/lib/{chunk-NC54IKOY.js → chunk-ZZ5BYFNK.js} +83 -6
- 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 +1 -1
- package/lib/exports/config/index.js +1 -1
- package/lib/exports/database/database.js +1 -1
- package/lib/exports/database/dbs/base.js +1 -1
- package/lib/exports/database/dbs/index.js +1 -1
- package/lib/exports/database/dbs/sqlite3.js +1 -1
- package/lib/exports/database/dbs/table.js +1 -1
- package/lib/exports/database/index.js +8 -9
- package/lib/exports/database/tables/index.js +6 -7
- package/lib/exports/database/tables/mysAccountInfo.js +1 -1
- package/lib/exports/database/tables/mysDeviceInfo.js +2 -3
- package/lib/exports/database/tables/mysUserInfo.js +1 -1
- package/lib/exports/database/types/index.js +3 -3
- package/lib/exports/database/types/tables/index.js +3 -3
- package/lib/exports/mys/api/apis.d.ts +2 -2
- package/lib/exports/mys/api/apis.js +10 -11
- package/lib/exports/mys/api/app.js +3 -4
- package/lib/exports/mys/api/define.js +10 -11
- package/lib/exports/mys/api/index.js +13 -14
- package/lib/exports/mys/index.d.ts +3 -3
- package/lib/exports/mys/index.js +15 -17
- package/lib/exports/mys/types/index.d.ts +2 -2
- package/lib/exports/mys/types/index.js +1 -7
- package/lib/exports/mys/types/user/game.d.ts +2 -13
- package/lib/exports/mys/types/user/game.js +1 -7
- package/lib/exports/mys/types/user/index.d.ts +2 -2
- package/lib/exports/mys/types/user/index.js +1 -7
- package/lib/exports/mys/types/user/userInfo.d.ts +2 -2
- package/lib/exports/mys/user/deviceInfo.js +3 -4
- package/lib/exports/mys/user/game.d.ts +15 -4
- package/lib/exports/mys/user/game.js +5 -3
- package/lib/exports/mys/user/index.d.ts +1 -1
- package/lib/exports/mys/user/index.js +16 -15
- package/lib/exports/mys/user/userInfo.js +10 -11
- package/lib/exports/render/index.d.ts +3 -0
- package/lib/exports/render/index.js +13 -0
- package/lib/exports/render/render.d.ts +38 -0
- package/lib/exports/render/render.js +9 -0
- package/lib/exports/utils/common.d.ts +33 -1
- package/lib/exports/utils/index.d.ts +1 -3
- package/lib/exports/utils/index.js +1 -5
- package/package.json +11 -2
- package/resources/styles/karin-plugin-mys-core.css +1059 -0
- package/lib/chunk-CDBMB57U.js +0 -52
- package/lib/chunk-T6MFN2MO.js +0 -23
- package/lib/common-Dw5l6Uud.d.ts +0 -33
- package/lib/exports/utils/render.d.ts +0 -27
- package/lib/exports/utils/render.js +0 -7
- package/resources/template/ShowBindAccount/index.css +0 -1
- package/resources/template/ShowBindAccount/index.html +0 -65
- package/resources/template/ShowBindDevice/index.html +0 -20
- package/resources/template/ShowBindDevice/inex.css +0 -1
- package/resources/template/layout/default.css +0 -1
- package/resources/template/layout/default.html +0 -27
- /package/lib/{chunk-ARLTXJFJ.js → chunk-FOAQZIZ2.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { A as ApiInfoFn, B as BaseMysRes, a as BaseltuidInfoType, D as DeviceInfoType, R as RequestResult, U as UidInfoType } from '../../../define-B9r20dK6.js';
|
|
2
|
-
export { GameUserInfoBase,
|
|
3
|
-
export { CookieParamsType, RefreshUidResultType, StokenParamsType,
|
|
2
|
+
export { GameUserInfoBase, gameName } from './user/game.js';
|
|
3
|
+
export { CookieParamsType, RefreshUidResultType, StokenParamsType, UserGameRoleItemType } from './user/userInfo.js';
|
|
4
4
|
import '../../database/types/tables/mysAccountInfo.js';
|
|
5
5
|
import 'node-karin';
|
|
6
6
|
import 'node-karin/axios';
|
|
@@ -2,11 +2,5 @@ import "../../../chunk-7VAWV6ZE.js";
|
|
|
2
2
|
import "../../../chunk-LJSDSOY6.js";
|
|
3
3
|
import "../../../chunk-CFS2WFOO.js";
|
|
4
4
|
import "../../../chunk-MWYDWDR4.js";
|
|
5
|
-
import
|
|
6
|
-
RegisterGameBase
|
|
7
|
-
} from "../../../chunk-T6MFN2MO.js";
|
|
5
|
+
import "../../../chunk-FOAQZIZ2.js";
|
|
8
6
|
import "../../../chunk-WCX7WZAQ.js";
|
|
9
|
-
import "../../../chunk-MLKGABMK.js";
|
|
10
|
-
export {
|
|
11
|
-
RegisterGameBase
|
|
12
|
-
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './userInfo.js';
|
|
2
2
|
import { U as UidInfoType } from '../../../../define-B9r20dK6.js';
|
|
3
3
|
import { BaseUserInfoTableType, BaseGameUIDInfoTableType } from '../../../database/types/tables/mysUserInfo.js';
|
|
4
4
|
import { BaseUserInfo } from '../../user/userInfo.js';
|
|
@@ -19,16 +19,5 @@ declare class GameUserInfoBase<GameUserInfoTableType extends BaseUserInfoTableTy
|
|
|
19
19
|
getUIDInfo(uid: string): UidInfoType | undefined;
|
|
20
20
|
}
|
|
21
21
|
type gameName = '崩坏:星穹铁道' | '崩坏:因缘精灵' | '原神' | '崩坏3' | '崩坏学园2' | '未定事件簿' | '绝区零' | '星布谷地';
|
|
22
|
-
declare class RegisterGameBase<GameUserInfoTableType extends BaseUserInfoTableType> {
|
|
23
|
-
game: string;
|
|
24
|
-
columnKey: `${string}-uids`;
|
|
25
|
-
/** @description 游戏名称 */
|
|
26
|
-
name: gameName;
|
|
27
|
-
/** @description 指令前缀匹配 */
|
|
28
|
-
prefix: RegExp;
|
|
29
|
-
refresh: (info: UserGameRoleItem[]) => string[];
|
|
30
|
-
UserInfo: typeof GameUserInfoBase<GameUserInfoTableType>;
|
|
31
|
-
constructor(game: string, name: gameName, prefix: RegExp, userInfo: typeof GameUserInfoBase<GameUserInfoTableType>, refreshFuc: (info: UserGameRoleItem[]) => string[]);
|
|
32
|
-
}
|
|
33
22
|
|
|
34
|
-
export { GameUserInfoBase,
|
|
23
|
+
export { GameUserInfoBase, type gameName };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { GameUserInfoBase,
|
|
2
|
-
export { CookieParamsType, RefreshUidResultType, StokenParamsType,
|
|
1
|
+
export { GameUserInfoBase, gameName } from './game.js';
|
|
2
|
+
export { CookieParamsType, RefreshUidResultType, StokenParamsType, UserGameRoleItemType } from './userInfo.js';
|
|
3
3
|
import '../../../../define-B9r20dK6.js';
|
|
4
4
|
import '../../../database/types/tables/mysAccountInfo.js';
|
|
5
5
|
import 'node-karin';
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import "../../../../chunk-MWYDWDR4.js";
|
|
2
|
-
import
|
|
3
|
-
RegisterGameBase
|
|
4
|
-
} from "../../../../chunk-T6MFN2MO.js";
|
|
2
|
+
import "../../../../chunk-FOAQZIZ2.js";
|
|
5
3
|
import "../../../../chunk-WCX7WZAQ.js";
|
|
6
|
-
import "../../../../chunk-MLKGABMK.js";
|
|
7
|
-
export {
|
|
8
|
-
RegisterGameBase
|
|
9
|
-
};
|
|
@@ -22,7 +22,7 @@ type CookieParamsType = Partial<{
|
|
|
22
22
|
account_mid_v2: string;
|
|
23
23
|
mi18nLang: string;
|
|
24
24
|
}>;
|
|
25
|
-
interface
|
|
25
|
+
interface UserGameRoleItemType {
|
|
26
26
|
game_biz: string;
|
|
27
27
|
region: string;
|
|
28
28
|
game_uid: string;
|
|
@@ -39,4 +39,4 @@ interface RefreshUidResultType {
|
|
|
39
39
|
message: string;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export type { CookieParamsType, RefreshUidResultType, StokenParamsType,
|
|
42
|
+
export type { CookieParamsType, RefreshUidResultType, StokenParamsType, UserGameRoleItemType };
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
} from "../../../chunk-BH4S574A.js";
|
|
4
4
|
import "../../../chunk-W4DBT7AD.js";
|
|
5
5
|
import "../../../chunk-Z5I6A73Y.js";
|
|
6
|
+
import "../../../chunk-BNSHDFFN.js";
|
|
6
7
|
import "../../../chunk-HTH25YE2.js";
|
|
7
8
|
import "../../../chunk-7ZQQ76WC.js";
|
|
8
|
-
import "../../../chunk-BNSHDFFN.js";
|
|
9
9
|
import "../../../chunk-SEWEEPJN.js";
|
|
10
10
|
import "../../../chunk-EAVXU4Q2.js";
|
|
11
11
|
import "../../../chunk-G547WVGV.js";
|
|
@@ -15,13 +15,12 @@ import "../../../chunk-7KEG6SDX.js";
|
|
|
15
15
|
import "../../../chunk-FBWSEBAW.js";
|
|
16
16
|
import "../../../chunk-JVJQKRJ4.js";
|
|
17
17
|
import "../../../chunk-LYTNREAI.js";
|
|
18
|
+
import "../../../chunk-SHW6FHIB.js";
|
|
18
19
|
import "../../../chunk-K5U2O3HH.js";
|
|
19
20
|
import "../../../chunk-I7XZONDN.js";
|
|
20
|
-
import "../../../chunk-SHW6FHIB.js";
|
|
21
21
|
import "../../../chunk-JRH4JC43.js";
|
|
22
|
-
import "../../../chunk-
|
|
22
|
+
import "../../../chunk-UC6INRYV.js";
|
|
23
23
|
import "../../../chunk-LG34FPBI.js";
|
|
24
|
-
import "../../../chunk-CDBMB57U.js";
|
|
25
24
|
import "../../../chunk-SHLPPEAY.js";
|
|
26
25
|
import "../../../chunk-MLKGABMK.js";
|
|
27
26
|
export {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BaseUserInfoTableType } from '../../database/types/tables/mysUserInfo.js';
|
|
2
|
-
import {
|
|
2
|
+
import { gameName, GameUserInfoBase } from '../types/user/game.js';
|
|
3
|
+
import { UserGameRoleItemType } from '../types/user/userInfo.js';
|
|
3
4
|
import '../../database/types/dbs/base.js';
|
|
4
5
|
import 'sequelize';
|
|
5
|
-
import '../types/user/userInfo.js';
|
|
6
|
-
import '../../database/types/tables/mysAccountInfo.js';
|
|
7
6
|
import '../../../define-B9r20dK6.js';
|
|
7
|
+
import '../../database/types/tables/mysAccountInfo.js';
|
|
8
8
|
import 'node-karin';
|
|
9
9
|
import 'node-karin/axios';
|
|
10
10
|
import '../../database/types/tables/mysDeviceInfo.js';
|
|
@@ -18,5 +18,16 @@ declare const MysGame: {
|
|
|
18
18
|
RegisterGame<GameUserInfoTableType extends BaseUserInfoTableType>(Game: RegisterGameBase<GameUserInfoTableType>): void;
|
|
19
19
|
forEachGame<GameUserInfoTableType extends BaseUserInfoTableType>(fn: (Game: RegisterGameBase<GameUserInfoTableType>) => Promise<void | "break">): Promise<void>;
|
|
20
20
|
};
|
|
21
|
+
declare class RegisterGameBase<GameUserInfoTableType extends BaseUserInfoTableType> {
|
|
22
|
+
game: string;
|
|
23
|
+
columnKey: `${string}-uids`;
|
|
24
|
+
/** @description 游戏名称 */
|
|
25
|
+
name: gameName;
|
|
26
|
+
/** @description 指令前缀匹配 */
|
|
27
|
+
prefix: RegExp;
|
|
28
|
+
refresh: (info: UserGameRoleItemType[]) => string[];
|
|
29
|
+
UserInfo: typeof GameUserInfoBase<GameUserInfoTableType>;
|
|
30
|
+
constructor(game: string, name: gameName, prefix: RegExp, userInfo: typeof GameUserInfoBase<GameUserInfoTableType>, refreshFuc: (info: UserGameRoleItemType[]) => string[]);
|
|
31
|
+
}
|
|
21
32
|
|
|
22
|
-
export { MysGame };
|
|
33
|
+
export { MysGame, RegisterGameBase };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { DeviceInfo } from './deviceInfo.js';
|
|
2
|
-
export { MysGame } from './game.js';
|
|
2
|
+
export { MysGame, RegisterGameBase } from './game.js';
|
|
3
3
|
export { BaseUserInfo, UserInfo } from './userInfo.js';
|
|
4
4
|
import '../../database/types/tables/mysDeviceInfo.js';
|
|
5
5
|
import '../../database/types/tables/mysUserInfo.js';
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseUserInfo,
|
|
3
3
|
UserInfo
|
|
4
|
-
} from "../../../chunk-
|
|
5
|
-
import {
|
|
6
|
-
DeviceInfo
|
|
7
|
-
} from "../../../chunk-BH4S574A.js";
|
|
8
|
-
import {
|
|
9
|
-
MysGame
|
|
10
|
-
} from "../../../chunk-3BIQN6QA.js";
|
|
11
|
-
import "../../../chunk-G5W5WAY5.js";
|
|
4
|
+
} from "../../../chunk-DJTJKSNN.js";
|
|
12
5
|
import "../../../chunk-7VAWV6ZE.js";
|
|
13
6
|
import "../../../chunk-LJSDSOY6.js";
|
|
14
7
|
import "../../../chunk-CFS2WFOO.js";
|
|
15
8
|
import "../../../chunk-MWYDWDR4.js";
|
|
16
|
-
import "../../../chunk-
|
|
9
|
+
import "../../../chunk-FOAQZIZ2.js";
|
|
17
10
|
import "../../../chunk-WCX7WZAQ.js";
|
|
11
|
+
import {
|
|
12
|
+
DeviceInfo
|
|
13
|
+
} from "../../../chunk-BH4S574A.js";
|
|
14
|
+
import {
|
|
15
|
+
MysGame,
|
|
16
|
+
RegisterGameBase
|
|
17
|
+
} from "../../../chunk-BWFWWHCT.js";
|
|
18
|
+
import "../../../chunk-G5W5WAY5.js";
|
|
18
19
|
import "../../../chunk-XQWTJIT4.js";
|
|
19
20
|
import "../../../chunk-7SZX3RBZ.js";
|
|
21
|
+
import "../../../chunk-2DHTKQ34.js";
|
|
20
22
|
import "../../../chunk-W4DBT7AD.js";
|
|
21
23
|
import "../../../chunk-Z5I6A73Y.js";
|
|
24
|
+
import "../../../chunk-BNSHDFFN.js";
|
|
22
25
|
import "../../../chunk-HTH25YE2.js";
|
|
23
26
|
import "../../../chunk-7ZQQ76WC.js";
|
|
24
|
-
import "../../../chunk-BNSHDFFN.js";
|
|
25
27
|
import "../../../chunk-SEWEEPJN.js";
|
|
26
28
|
import "../../../chunk-EAVXU4Q2.js";
|
|
27
29
|
import "../../../chunk-G547WVGV.js";
|
|
@@ -31,21 +33,20 @@ import "../../../chunk-7KEG6SDX.js";
|
|
|
31
33
|
import "../../../chunk-FBWSEBAW.js";
|
|
32
34
|
import "../../../chunk-JVJQKRJ4.js";
|
|
33
35
|
import "../../../chunk-LYTNREAI.js";
|
|
36
|
+
import "../../../chunk-SHW6FHIB.js";
|
|
34
37
|
import "../../../chunk-K5U2O3HH.js";
|
|
35
38
|
import "../../../chunk-I7XZONDN.js";
|
|
36
|
-
import "../../../chunk-SHW6FHIB.js";
|
|
37
39
|
import "../../../chunk-JRH4JC43.js";
|
|
38
|
-
import "../../../chunk-
|
|
40
|
+
import "../../../chunk-UC6INRYV.js";
|
|
39
41
|
import "../../../chunk-LG34FPBI.js";
|
|
40
|
-
import "../../../chunk-CDBMB57U.js";
|
|
41
|
-
import "../../../chunk-2DHTKQ34.js";
|
|
42
42
|
import "../../../chunk-SHLPPEAY.js";
|
|
43
|
-
import "../../../chunk-
|
|
43
|
+
import "../../../chunk-BXA3VAQC.js";
|
|
44
44
|
import "../../../chunk-6PIXUPZ6.js";
|
|
45
45
|
import "../../../chunk-MLKGABMK.js";
|
|
46
46
|
export {
|
|
47
47
|
BaseUserInfo,
|
|
48
48
|
DeviceInfo,
|
|
49
49
|
MysGame,
|
|
50
|
+
RegisterGameBase,
|
|
50
51
|
UserInfo
|
|
51
52
|
};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseUserInfo,
|
|
3
3
|
UserInfo
|
|
4
|
-
} from "../../../chunk-
|
|
5
|
-
import "../../../chunk-BH4S574A.js";
|
|
6
|
-
import "../../../chunk-3BIQN6QA.js";
|
|
7
|
-
import "../../../chunk-G5W5WAY5.js";
|
|
4
|
+
} from "../../../chunk-DJTJKSNN.js";
|
|
8
5
|
import "../../../chunk-7VAWV6ZE.js";
|
|
9
6
|
import "../../../chunk-LJSDSOY6.js";
|
|
10
7
|
import "../../../chunk-CFS2WFOO.js";
|
|
11
8
|
import "../../../chunk-MWYDWDR4.js";
|
|
12
|
-
import "../../../chunk-
|
|
9
|
+
import "../../../chunk-FOAQZIZ2.js";
|
|
13
10
|
import "../../../chunk-WCX7WZAQ.js";
|
|
11
|
+
import "../../../chunk-BH4S574A.js";
|
|
12
|
+
import "../../../chunk-BWFWWHCT.js";
|
|
13
|
+
import "../../../chunk-G5W5WAY5.js";
|
|
14
14
|
import "../../../chunk-XQWTJIT4.js";
|
|
15
15
|
import "../../../chunk-7SZX3RBZ.js";
|
|
16
|
+
import "../../../chunk-2DHTKQ34.js";
|
|
16
17
|
import "../../../chunk-W4DBT7AD.js";
|
|
17
18
|
import "../../../chunk-Z5I6A73Y.js";
|
|
19
|
+
import "../../../chunk-BNSHDFFN.js";
|
|
18
20
|
import "../../../chunk-HTH25YE2.js";
|
|
19
21
|
import "../../../chunk-7ZQQ76WC.js";
|
|
20
|
-
import "../../../chunk-BNSHDFFN.js";
|
|
21
22
|
import "../../../chunk-SEWEEPJN.js";
|
|
22
23
|
import "../../../chunk-EAVXU4Q2.js";
|
|
23
24
|
import "../../../chunk-G547WVGV.js";
|
|
@@ -27,16 +28,14 @@ import "../../../chunk-7KEG6SDX.js";
|
|
|
27
28
|
import "../../../chunk-FBWSEBAW.js";
|
|
28
29
|
import "../../../chunk-JVJQKRJ4.js";
|
|
29
30
|
import "../../../chunk-LYTNREAI.js";
|
|
31
|
+
import "../../../chunk-SHW6FHIB.js";
|
|
30
32
|
import "../../../chunk-K5U2O3HH.js";
|
|
31
33
|
import "../../../chunk-I7XZONDN.js";
|
|
32
|
-
import "../../../chunk-SHW6FHIB.js";
|
|
33
34
|
import "../../../chunk-JRH4JC43.js";
|
|
34
|
-
import "../../../chunk-
|
|
35
|
+
import "../../../chunk-UC6INRYV.js";
|
|
35
36
|
import "../../../chunk-LG34FPBI.js";
|
|
36
|
-
import "../../../chunk-CDBMB57U.js";
|
|
37
|
-
import "../../../chunk-2DHTKQ34.js";
|
|
38
37
|
import "../../../chunk-SHLPPEAY.js";
|
|
39
|
-
import "../../../chunk-
|
|
38
|
+
import "../../../chunk-BXA3VAQC.js";
|
|
40
39
|
import "../../../chunk-6PIXUPZ6.js";
|
|
41
40
|
import "../../../chunk-MLKGABMK.js";
|
|
42
41
|
export {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
React
|
|
3
|
+
} from "../../chunk-UX2BDLJF.js";
|
|
4
|
+
import {
|
|
5
|
+
ReactRender
|
|
6
|
+
} from "../../chunk-AY34PPJT.js";
|
|
7
|
+
import "../../chunk-UC6INRYV.js";
|
|
8
|
+
import "../../chunk-LG34FPBI.js";
|
|
9
|
+
import "../../chunk-MLKGABMK.js";
|
|
10
|
+
export {
|
|
11
|
+
React,
|
|
12
|
+
ReactRender
|
|
13
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Options } from 'node-karin';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
interface RenderCfg {
|
|
5
|
+
/** @description 插件名称 package.json 的 name */
|
|
6
|
+
name: string;
|
|
7
|
+
/** @description 插件版本 package.json 的 version */
|
|
8
|
+
version: string;
|
|
9
|
+
/** @description 根目录绝对路径 */
|
|
10
|
+
pluginDir: string;
|
|
11
|
+
/** @description 插件资源目录 `@karinjs/karin-plugin-xxx/resources` */
|
|
12
|
+
ResourcesDir: string;
|
|
13
|
+
}
|
|
14
|
+
interface DefaultRenderPluginOptionsType {
|
|
15
|
+
name: string;
|
|
16
|
+
version: string;
|
|
17
|
+
resources: {
|
|
18
|
+
/** @description 插件内部资源 */
|
|
19
|
+
default: string;
|
|
20
|
+
/** @description 插件外部资源 @karinjs/karin-plugin-xxx/resources */
|
|
21
|
+
download: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
declare class ReactRender<P extends Record<string, any>, K extends string> {
|
|
25
|
+
#private;
|
|
26
|
+
constructor(cfg: RenderCfg, pluginOptions?: Omit<P, 'name' | 'version' | 'resources'>);
|
|
27
|
+
get plugin(): Omit<P, 'name' | 'version' | 'resources'> & DefaultRenderPluginOptionsType;
|
|
28
|
+
get karin(): {
|
|
29
|
+
version: string;
|
|
30
|
+
};
|
|
31
|
+
template<C extends React.ComponentType<any>>(template: K, component: C, props: React.ComponentProps<C>, options?: {
|
|
32
|
+
type?: 'png' | 'jpeg' | 'webp';
|
|
33
|
+
plugin?: Record<string, any>;
|
|
34
|
+
render?: Omit<Options, 'file' | 'data'>;
|
|
35
|
+
}): Promise<string | null>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { type DefaultRenderPluginOptionsType, ReactRender, type RenderCfg };
|
|
@@ -1 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @description 生成随机字符串
|
|
3
|
+
* @param length - 字符串长度
|
|
4
|
+
*/
|
|
5
|
+
declare const randomString: (length: number, type: "Lower" | "Upper" | "All") => string;
|
|
6
|
+
/**
|
|
7
|
+
* @description 生成设备guid
|
|
8
|
+
*/
|
|
9
|
+
declare const getDeviceGuid: () => string;
|
|
10
|
+
/**
|
|
11
|
+
* @description 将字符串解析为key-value键值对
|
|
12
|
+
* @param Str - 字符串
|
|
13
|
+
* @param sep - 分隔符
|
|
14
|
+
*/
|
|
15
|
+
declare const StrToObj: <D extends {
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
}>(Str: string, sep: string | RegExp) => Partial<D>;
|
|
18
|
+
/**
|
|
19
|
+
* @description 将key-value键值对解析为字符串
|
|
20
|
+
* @param obj - key-value键值对
|
|
21
|
+
* @param sep - 分隔符
|
|
22
|
+
*/
|
|
23
|
+
declare const ObjToStr: (obj: Record<string, string | number>, sep: string) => string;
|
|
24
|
+
|
|
25
|
+
declare const common_ObjToStr: typeof ObjToStr;
|
|
26
|
+
declare const common_StrToObj: typeof StrToObj;
|
|
27
|
+
declare const common_getDeviceGuid: typeof getDeviceGuid;
|
|
28
|
+
declare const common_randomString: typeof randomString;
|
|
29
|
+
declare namespace common {
|
|
30
|
+
export { common_ObjToStr as ObjToStr, common_StrToObj as StrToObj, common_getDeviceGuid as getDeviceGuid, common_randomString as randomString };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { ObjToStr, StrToObj, common as c, getDeviceGuid, randomString };
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import "../../chunk-
|
|
1
|
+
import "../../chunk-UC6INRYV.js";
|
|
2
2
|
import {
|
|
3
3
|
common_exports
|
|
4
4
|
} from "../../chunk-LG34FPBI.js";
|
|
5
|
-
import {
|
|
6
|
-
RenderTemplate
|
|
7
|
-
} from "../../chunk-CDBMB57U.js";
|
|
8
5
|
import "../../chunk-MLKGABMK.js";
|
|
9
6
|
export {
|
|
10
|
-
RenderTemplate,
|
|
11
7
|
common_exports as common
|
|
12
8
|
};
|
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.5",
|
|
4
4
|
"author": "babanbang",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "karin-plugin-mys-core",
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"app": "node lib/app.js",
|
|
17
|
-
"build": "tsup",
|
|
17
|
+
"build": "npm run build:css && tsup",
|
|
18
|
+
"build:css": "tailwindcss -i src/template/tailwind.css -o resources/styles/karin-plugin-mys-core.css",
|
|
18
19
|
"dev": "cross-env EBV_FILE=\"development.env\" node --import tsx src/app.ts",
|
|
20
|
+
"dev:css": "tailwindcss -i src/template/tailwind.css -o resources/styles/karin-plugin-mys-core.css --watch",
|
|
19
21
|
"pub": "npm publish --access public"
|
|
20
22
|
},
|
|
21
23
|
"exports": {
|
|
@@ -34,6 +36,11 @@
|
|
|
34
36
|
"development": "./src/exports/mys/index.ts",
|
|
35
37
|
"default": "./lib/exports/mys/index.js"
|
|
36
38
|
},
|
|
39
|
+
"./render": {
|
|
40
|
+
"types": "./lib/exports/render/index.d.ts",
|
|
41
|
+
"development": "./src/exports/render/index.ts",
|
|
42
|
+
"default": "./lib/exports/render/index.js"
|
|
43
|
+
},
|
|
37
44
|
"./utils": {
|
|
38
45
|
"types": "./lib/exports/utils/index.d.ts",
|
|
39
46
|
"development": "./src/exports/utils/index.ts",
|
|
@@ -44,6 +51,8 @@
|
|
|
44
51
|
"dependencies": {
|
|
45
52
|
"md5": "^2.3.0",
|
|
46
53
|
"qrcode": "^1.5.4",
|
|
54
|
+
"react": "^19.2.0",
|
|
55
|
+
"react-dom": "^19.2.0",
|
|
47
56
|
"sequelize": "^6.37.7"
|
|
48
57
|
},
|
|
49
58
|
"karin": {
|