karin-plugin-mys-core 1.0.3 → 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.
Files changed (53) hide show
  1. package/lib/apps/MiHoYoLogin.js +17 -17
  2. package/lib/apps/MysDevice.js +14 -14
  3. package/lib/apps/UIDManage.js +15 -15
  4. package/lib/{chunk-KN5SHBVI.js → chunk-7ZQQ76WC.js} +1 -1
  5. package/lib/{chunk-COKAJ7V6.js → chunk-BH4S574A.js} +1 -1
  6. package/lib/{chunk-UVMX6WUC.js → chunk-BNSHDFFN.js} +4 -4
  7. package/lib/{chunk-HVYNK5BN.js → chunk-CDBMB57U.js} +15 -8
  8. package/lib/{chunk-5NA7ZPDS.js → chunk-EAVXU4Q2.js} +3 -0
  9. package/lib/{chunk-7WESXE4X.js → chunk-HTH25YE2.js} +1 -1
  10. package/lib/{chunk-HNODD2IL.js → chunk-NC54IKOY.js} +1 -1
  11. package/lib/{chunk-IVZICDGW.js → chunk-T6MFN2MO.js} +6 -2
  12. package/lib/{chunk-RWBRS7SA.js → chunk-WQK5RDUV.js} +17 -17
  13. package/lib/{define-BWuQ7acM.d.ts → define-B9r20dK6.d.ts} +4 -5
  14. package/lib/exports/database/dbs/index.js +1 -1
  15. package/lib/exports/database/dbs/table.d.ts +3 -0
  16. package/lib/exports/database/dbs/table.js +1 -1
  17. package/lib/exports/database/index.js +10 -10
  18. package/lib/exports/database/tables/index.js +10 -10
  19. package/lib/exports/database/tables/mysAccountInfo.js +2 -2
  20. package/lib/exports/database/tables/mysDeviceInfo.js +5 -5
  21. package/lib/exports/database/tables/mysUserInfo.js +2 -2
  22. package/lib/exports/mys/api/apis.d.ts +4 -4
  23. package/lib/exports/mys/api/apis.js +14 -14
  24. package/lib/exports/mys/api/app.js +7 -7
  25. package/lib/exports/mys/api/define.d.ts +1 -1
  26. package/lib/exports/mys/api/define.js +14 -14
  27. package/lib/exports/mys/api/index.d.ts +2 -2
  28. package/lib/exports/mys/api/index.js +14 -14
  29. package/lib/exports/mys/index.d.ts +4 -2
  30. package/lib/exports/mys/index.js +14 -14
  31. package/lib/exports/mys/types/api/define.d.ts +1 -1
  32. package/lib/exports/mys/types/api/index.d.ts +1 -1
  33. package/lib/exports/mys/types/index.d.ts +4 -2
  34. package/lib/exports/mys/types/index.js +2 -2
  35. package/lib/exports/mys/types/user/game.d.ts +28 -4
  36. package/lib/exports/mys/types/user/game.js +7 -1
  37. package/lib/exports/mys/types/user/index.d.ts +4 -2
  38. package/lib/exports/mys/types/user/index.js +2 -2
  39. package/lib/exports/mys/types/user/userInfo.d.ts +40 -8
  40. package/lib/exports/mys/types/user/userInfo.js +1 -7
  41. package/lib/exports/mys/user/deviceInfo.js +8 -8
  42. package/lib/exports/mys/user/game.d.ts +4 -2
  43. package/lib/exports/mys/user/index.d.ts +4 -2
  44. package/lib/exports/mys/user/index.js +14 -14
  45. package/lib/exports/mys/user/userInfo.d.ts +49 -6
  46. package/lib/exports/mys/user/userInfo.js +14 -14
  47. package/lib/exports/utils/index.d.ts +1 -0
  48. package/lib/exports/utils/index.js +1 -1
  49. package/lib/exports/utils/render.d.ts +7 -1
  50. package/lib/exports/utils/render.js +1 -1
  51. package/package.json +1 -1
  52. package/lib/index-DEEWbZ0V.d.ts +0 -102
  53. /package/lib/{chunk-FOAQZIZ2.js → chunk-WCX7WZAQ.js} +0 -0
@@ -1,10 +1,53 @@
1
- import '../../database/types/dbs/base.js';
2
- import '../../database/types/tables/mysAccountInfo.js';
3
- import '../../database/types/tables/mysDeviceInfo.js';
4
- import '../../database/types/tables/mysUserInfo.js';
5
- import '../../../define-BWuQ7acM.js';
6
- export { B as BaseUserInfo, b as UserInfo } from '../../../index-DEEWbZ0V.js';
1
+ import { DatabaseReturn, DatabaseType, DatabaseArray } from '../../database/types/dbs/base.js';
2
+ import { MysAccountInfoTableType, MysAccountType } from '../../database/types/tables/mysAccountInfo.js';
3
+ import { MysDeviceInfoTableType } from '../../database/types/tables/mysDeviceInfo.js';
4
+ import { BaseUserInfoTableType, UidPermission } from '../../database/types/tables/mysUserInfo.js';
5
+ import { a as BaseltuidInfoType } from '../../../define-B9r20dK6.js';
6
+ import { RefreshUidResultType, StokenParamsType, CookieParamsType } from '../types/user/userInfo.js';
7
7
  import 'sequelize';
8
8
  import 'node-karin';
9
9
  import 'node-karin/axios';
10
10
  import '../api/app.js';
11
+
12
+ declare class BaseUserInfo<U extends BaseUserInfoTableType> {
13
+ userId: BaseUserInfoTableType['userId'];
14
+ ltuidMap: Map<string, MysAccountInfoTableType & {
15
+ save: (data: Partial<MysAccountInfoTableType>) => Promise<MysAccountInfoTableType & /*elided*/ any>;
16
+ destroy: () => Promise<boolean>;
17
+ }>;
18
+ UserInfo: DatabaseReturn<U>[DatabaseType.Db];
19
+ refresh: () => Promise<this>;
20
+ constructor(userId: string);
21
+ get ltuids(): DatabaseArray<string>;
22
+ get stuids(): DatabaseArray<string>;
23
+ get deviceList(): DatabaseArray<string>;
24
+ get LtuidInfoList(): Readonly<MysAccountInfoTableType & {
25
+ save: (data: Partial<MysAccountInfoTableType>) => Promise<MysAccountInfoTableType & /*elided*/ any>;
26
+ destroy: () => Promise<boolean>;
27
+ }>[];
28
+ initMysAccountInfo(UserInfo: DatabaseReturn<U>[DatabaseType.Db], initAll: boolean): Promise<void>;
29
+ getLtuidInfo(ltuid: string): Readonly<(MysAccountInfoTableType & {
30
+ save: (data: Partial<MysAccountInfoTableType>) => Promise<MysAccountInfoTableType & /*elided*/ any>;
31
+ destroy: () => Promise<boolean>;
32
+ }) | undefined>;
33
+ getDeviceInfoList(): Promise<(MysDeviceInfoTableType & {
34
+ save: (data: Partial<MysDeviceInfoTableType>) => Promise<MysDeviceInfoTableType & /*elided*/ any>;
35
+ destroy: () => Promise<boolean>;
36
+ })[]>;
37
+ saveUserInfo(data: Partial<U>): Promise<void>;
38
+ saveMysAccountInfo(ltuid: string, data: Partial<MysAccountInfoTableType>): Promise<void>;
39
+ }
40
+ declare class UserInfo extends BaseUserInfo<BaseUserInfoTableType> {
41
+ static create(userId: string, initAll?: boolean): Promise<UserInfo>;
42
+ static refreshUid(options: {
43
+ userId: string;
44
+ cookie: string;
45
+ } & BaseltuidInfoType, perm: UidPermission): Promise<RefreshUidResultType>;
46
+ static refreshCookie(stokenParams: StokenParamsType, serv: MysAccountType | MysAccountType[]): Promise<{
47
+ Serv: MysAccountType;
48
+ cookieParams: CookieParamsType;
49
+ message: string;
50
+ }>;
51
+ }
52
+
53
+ export { BaseUserInfo, UserInfo };
@@ -1,31 +1,25 @@
1
1
  import {
2
2
  BaseUserInfo,
3
3
  UserInfo
4
- } from "../../../chunk-RWBRS7SA.js";
5
- import "../../../chunk-COKAJ7V6.js";
4
+ } from "../../../chunk-WQK5RDUV.js";
5
+ import "../../../chunk-BH4S574A.js";
6
6
  import "../../../chunk-3BIQN6QA.js";
7
7
  import "../../../chunk-G5W5WAY5.js";
8
8
  import "../../../chunk-7VAWV6ZE.js";
9
9
  import "../../../chunk-LJSDSOY6.js";
10
10
  import "../../../chunk-CFS2WFOO.js";
11
11
  import "../../../chunk-MWYDWDR4.js";
12
- import "../../../chunk-FOAQZIZ2.js";
13
- import "../../../chunk-IVZICDGW.js";
12
+ import "../../../chunk-T6MFN2MO.js";
13
+ import "../../../chunk-WCX7WZAQ.js";
14
14
  import "../../../chunk-XQWTJIT4.js";
15
15
  import "../../../chunk-7SZX3RBZ.js";
16
- import "../../../chunk-2DHTKQ34.js";
17
- import "../../../chunk-JKZ5NRPX.js";
18
- import "../../../chunk-6PIXUPZ6.js";
19
16
  import "../../../chunk-W4DBT7AD.js";
20
17
  import "../../../chunk-Z5I6A73Y.js";
21
- import "../../../chunk-KN5SHBVI.js";
22
- import "../../../chunk-UVMX6WUC.js";
23
- import "../../../chunk-7WESXE4X.js";
18
+ import "../../../chunk-HTH25YE2.js";
19
+ import "../../../chunk-7ZQQ76WC.js";
20
+ import "../../../chunk-BNSHDFFN.js";
24
21
  import "../../../chunk-SEWEEPJN.js";
25
- import "../../../chunk-5NA7ZPDS.js";
26
- import "../../../chunk-ARLTXJFJ.js";
27
- import "../../../chunk-LG34FPBI.js";
28
- import "../../../chunk-HVYNK5BN.js";
22
+ import "../../../chunk-EAVXU4Q2.js";
29
23
  import "../../../chunk-G547WVGV.js";
30
24
  import "../../../chunk-EMAUATE3.js";
31
25
  import "../../../chunk-Y3J3J5B2.js";
@@ -37,7 +31,13 @@ import "../../../chunk-K5U2O3HH.js";
37
31
  import "../../../chunk-I7XZONDN.js";
38
32
  import "../../../chunk-SHW6FHIB.js";
39
33
  import "../../../chunk-JRH4JC43.js";
34
+ import "../../../chunk-ARLTXJFJ.js";
35
+ import "../../../chunk-LG34FPBI.js";
36
+ import "../../../chunk-CDBMB57U.js";
37
+ import "../../../chunk-2DHTKQ34.js";
40
38
  import "../../../chunk-SHLPPEAY.js";
39
+ import "../../../chunk-JKZ5NRPX.js";
40
+ import "../../../chunk-6PIXUPZ6.js";
41
41
  import "../../../chunk-MLKGABMK.js";
42
42
  export {
43
43
  BaseUserInfo,
@@ -1,2 +1,3 @@
1
1
  export { c as common } from '../../common-Dw5l6Uud.js';
2
2
  export { RenderCfg, RenderTemplate } from './render.js';
3
+ import 'node-karin';
@@ -4,7 +4,7 @@ import {
4
4
  } from "../../chunk-LG34FPBI.js";
5
5
  import {
6
6
  RenderTemplate
7
- } from "../../chunk-HVYNK5BN.js";
7
+ } from "../../chunk-CDBMB57U.js";
8
8
  import "../../chunk-MLKGABMK.js";
9
9
  export {
10
10
  RenderTemplate,
@@ -1,3 +1,5 @@
1
+ import { Options } from 'node-karin';
2
+
1
3
  interface RenderCfg {
2
4
  /** @description 插件名称 package.json 的 name */
3
5
  name: string;
@@ -10,11 +12,15 @@ interface RenderCfg {
10
12
  }
11
13
  declare class RenderTemplate<K extends string> {
12
14
  #private;
13
- constructor(cfg: RenderCfg);
15
+ /**
16
+ * @param pluginOptions 自定义额外plugin参数
17
+ */
18
+ constructor(cfg: RenderCfg, pluginOptions?: Omit<Record<string, any>, 'template' | 'name' | 'version' | 'resources' | 'defaultLayout'>);
14
19
  /** @description 渲染Html路径为:resources/template/${template}/index.html */
15
20
  template(template: K, rendeDdata: Record<string, any>, options?: {
16
21
  type?: 'png' | 'jpeg' | 'webp';
17
22
  plugin?: Record<string, any>;
23
+ render?: Omit<Options, 'name' | 'file' | 'data'>;
18
24
  }): Promise<string | null>;
19
25
  }
20
26
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RenderTemplate
3
- } from "../../chunk-HVYNK5BN.js";
3
+ } from "../../chunk-CDBMB57U.js";
4
4
  import "../../chunk-MLKGABMK.js";
5
5
  export {
6
6
  RenderTemplate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "karin-plugin-mys-core",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "author": "babanbang",
5
5
  "type": "module",
6
6
  "description": "karin-plugin-mys-core",
@@ -1,102 +0,0 @@
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 };
File without changes