karin-plugin-mys-core 1.0.1 → 1.0.2

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 (168) hide show
  1. package/LICENSE +674 -0
  2. package/lib/apps/MiHoYoLogin.d.ts +3 -1
  3. package/lib/apps/MiHoYoLogin.js +177 -109
  4. package/lib/apps/MysDevice.d.ts +2 -2
  5. package/lib/apps/MysDevice.js +65 -23
  6. package/lib/apps/UIDManage.d.ts +10 -0
  7. package/lib/apps/UIDManage.js +52 -0
  8. package/lib/array-CZDr9qst.d.ts +62 -0
  9. package/lib/chunk-2DHTKQ34.js +0 -0
  10. package/lib/chunk-3BIQN6QA.js +27 -0
  11. package/lib/chunk-3CNBOOKY.js +31 -0
  12. package/lib/chunk-5NA7ZPDS.js +54 -0
  13. package/lib/chunk-6PIXUPZ6.js +82 -0
  14. package/lib/chunk-7KEG6SDX.js +0 -0
  15. package/lib/chunk-7SZX3RBZ.js +0 -0
  16. package/lib/chunk-7VAWV6ZE.js +0 -0
  17. package/lib/chunk-7WESXE4X.js +29 -0
  18. package/lib/chunk-7YZHHLS5.js +130 -0
  19. package/lib/chunk-ARLTXJFJ.js +0 -0
  20. package/lib/chunk-CFS2WFOO.js +0 -0
  21. package/lib/chunk-EMAUATE3.js +217 -0
  22. package/lib/chunk-FBWSEBAW.js +0 -0
  23. package/lib/chunk-FOAQZIZ2.js +0 -0
  24. package/lib/chunk-G547WVGV.js +73 -0
  25. package/lib/chunk-G5W5WAY5.js +64 -0
  26. package/lib/chunk-HVYNK5BN.js +45 -0
  27. package/lib/chunk-I7XZONDN.js +13 -0
  28. package/lib/chunk-IVZICDGW.js +19 -0
  29. package/lib/chunk-JBGXPVO2.js +179 -0
  30. package/lib/chunk-JRH4JC43.js +0 -0
  31. package/lib/chunk-JVJQKRJ4.js +89 -0
  32. package/lib/chunk-K5U2O3HH.js +0 -0
  33. package/lib/chunk-KN5SHBVI.js +30 -0
  34. package/lib/chunk-LG34FPBI.js +50 -0
  35. package/lib/chunk-LJSDSOY6.js +0 -0
  36. package/lib/chunk-LYTNREAI.js +0 -0
  37. package/lib/chunk-MWYDWDR4.js +0 -0
  38. package/lib/chunk-QMSYS77M.js +38 -0
  39. package/lib/chunk-SEWEEPJN.js +0 -0
  40. package/lib/{chunk-JML6VYXN.js → chunk-SHLPPEAY.js} +13 -17
  41. package/lib/chunk-SHW6FHIB.js +10 -0
  42. package/lib/chunk-W4DBT7AD.js +0 -0
  43. package/lib/chunk-X75DW4KI.js +510 -0
  44. package/lib/chunk-XQWTJIT4.js +0 -0
  45. package/lib/chunk-Y3J3J5B2.js +124 -0
  46. package/lib/chunk-Z5I6A73Y.js +0 -0
  47. package/lib/common-Dw5l6Uud.d.ts +33 -0
  48. package/lib/define-BWuQ7acM.d.ts +131 -0
  49. package/lib/dir.d.ts +11 -13
  50. package/lib/dir.js +1 -1
  51. package/lib/exports/config/array.d.ts +1 -0
  52. package/lib/exports/config/array.js +7 -0
  53. package/lib/exports/config/config.d.ts +1 -0
  54. package/lib/exports/config/config.js +8 -0
  55. package/lib/exports/config/index.d.ts +2 -0
  56. package/lib/exports/config/index.js +14 -0
  57. package/lib/exports/config/types/config.d.ts +12 -0
  58. package/lib/exports/config/types/config.js +1 -0
  59. package/lib/exports/config/types/index.d.ts +1 -0
  60. package/lib/exports/config/types/index.js +2 -0
  61. package/lib/exports/database/database.d.ts +30 -0
  62. package/lib/exports/database/database.js +18 -0
  63. package/lib/exports/database/dbs/base.d.ts +23 -0
  64. package/lib/exports/database/dbs/base.js +15 -0
  65. package/lib/exports/database/dbs/index.d.ts +4 -0
  66. package/lib/exports/database/dbs/index.js +23 -0
  67. package/lib/exports/database/dbs/sqlite3.d.ts +23 -0
  68. package/lib/exports/database/dbs/sqlite3.js +19 -0
  69. package/lib/exports/database/dbs/table.d.ts +13 -0
  70. package/lib/exports/database/dbs/table.js +19 -0
  71. package/lib/exports/database/index.d.ts +12 -0
  72. package/lib/exports/database/index.js +62 -0
  73. package/lib/exports/database/tables/index.d.ts +9 -0
  74. package/lib/exports/database/tables/index.js +39 -0
  75. package/lib/exports/database/tables/mysAccountInfo.d.ts +9 -0
  76. package/lib/exports/database/tables/mysAccountInfo.js +23 -0
  77. package/lib/exports/database/tables/mysDeviceInfo.d.ts +9 -0
  78. package/lib/exports/database/tables/mysDeviceInfo.js +26 -0
  79. package/lib/exports/database/tables/mysUserInfo.d.ts +9 -0
  80. package/lib/exports/database/tables/mysUserInfo.js +23 -0
  81. package/lib/exports/database/types/database.d.ts +6 -0
  82. package/lib/exports/database/types/database.js +1 -0
  83. package/lib/exports/database/types/dbs/base.d.ts +114 -0
  84. package/lib/exports/database/types/dbs/base.js +11 -0
  85. package/lib/exports/database/types/dbs/index.d.ts +2 -0
  86. package/lib/exports/database/types/dbs/index.js +12 -0
  87. package/lib/exports/database/types/index.d.ts +6 -0
  88. package/lib/exports/database/types/index.js +24 -0
  89. package/lib/exports/database/types/tables/index.d.ts +5 -0
  90. package/lib/exports/database/types/tables/index.js +13 -0
  91. package/lib/exports/database/types/tables/mysAccountInfo.d.ts +14 -0
  92. package/lib/exports/database/types/tables/mysAccountInfo.js +7 -0
  93. package/lib/exports/database/types/tables/mysDeviceInfo.d.ts +19 -0
  94. package/lib/exports/database/types/tables/mysDeviceInfo.js +1 -0
  95. package/lib/exports/database/types/tables/mysUserInfo.d.ts +31 -0
  96. package/lib/exports/database/types/tables/mysUserInfo.js +7 -0
  97. package/lib/exports/mys/api/apis.d.ts +82 -0
  98. package/lib/exports/mys/api/apis.js +57 -0
  99. package/lib/exports/mys/api/app.d.ts +60 -0
  100. package/lib/exports/mys/api/app.js +31 -0
  101. package/lib/exports/mys/api/define.d.ts +6 -0
  102. package/lib/exports/mys/api/define.js +43 -0
  103. package/lib/exports/mys/api/index.d.ts +11 -0
  104. package/lib/exports/mys/api/index.js +64 -0
  105. package/lib/exports/mys/index.d.ts +13 -0
  106. package/lib/exports/mys/index.js +77 -0
  107. package/lib/exports/mys/types/api/define.d.ts +6 -0
  108. package/lib/exports/mys/types/api/define.js +1 -0
  109. package/lib/exports/mys/types/api/index.d.ts +6 -0
  110. package/lib/exports/mys/types/api/index.js +2 -0
  111. package/lib/exports/mys/types/index.d.ts +10 -0
  112. package/lib/exports/mys/types/index.js +12 -0
  113. package/lib/exports/mys/types/user/game.d.ts +10 -0
  114. package/lib/exports/mys/types/user/game.js +1 -0
  115. package/lib/exports/mys/types/user/index.d.ts +10 -0
  116. package/lib/exports/mys/types/user/index.js +9 -0
  117. package/lib/exports/mys/types/user/userInfo.d.ts +10 -0
  118. package/lib/exports/mys/types/user/userInfo.js +7 -0
  119. package/lib/exports/mys/user/deviceInfo.d.ts +11 -0
  120. package/lib/exports/mys/user/deviceInfo.js +29 -0
  121. package/lib/exports/mys/user/game.d.ts +20 -0
  122. package/lib/exports/mys/user/game.js +7 -0
  123. package/lib/exports/mys/user/index.d.ts +12 -0
  124. package/lib/exports/mys/user/index.js +51 -0
  125. package/lib/exports/mys/user/userInfo.d.ts +10 -0
  126. package/lib/exports/mys/user/userInfo.js +45 -0
  127. package/lib/exports/utils/common.d.ts +1 -0
  128. package/lib/exports/utils/common.js +13 -0
  129. package/lib/exports/utils/index.d.ts +2 -0
  130. package/lib/exports/utils/index.js +12 -0
  131. package/lib/exports/utils/render.d.ts +21 -0
  132. package/lib/exports/utils/render.js +7 -0
  133. package/lib/index-DEEWbZ0V.d.ts +102 -0
  134. package/lib/index.js +1 -1
  135. package/package.json +29 -15
  136. package/resources/fonts/HYWenHei-55W.ttf +0 -0
  137. package/resources/image/launcher-icon//345/216/237/347/245/236.png +0 -0
  138. package/resources/image/launcher-icon//345/264/251/345/235/2173.png +0 -0
  139. package/resources/image/launcher-icon//345/264/251/345/235/217/345/255/246/345/233/2552.png +0 -0
  140. 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
  141. 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
  142. package/resources/image/launcher-icon//346/230/237/345/270/203/350/260/267/345/234/260.png +0 -0
  143. package/resources/image/launcher-icon//346/234/252/345/256/232/344/272/213/344/273/266/347/260/277.png +0 -0
  144. package/resources/image/launcher-icon//347/273/235/345/214/272/351/233/266.png +0 -0
  145. package/resources/image/mys-logo.png +0 -0
  146. package/resources/template/ShowBindAccount/index.css +1 -0
  147. package/resources/template/ShowBindAccount/index.html +65 -0
  148. package/resources/template/ShowBindDevice/index.html +20 -0
  149. package/resources/template/ShowBindDevice/inex.css +1 -0
  150. package/resources/template/layout/default.css +1 -0
  151. package/resources/template/layout/default.html +27 -0
  152. package/lib/app.d.ts +0 -2
  153. package/lib/base-BJv9XnQP.d.ts +0 -120
  154. package/lib/chunk-CQNW7LJI.js +0 -38
  155. package/lib/chunk-MV2UE7C7.js +0 -410
  156. package/lib/chunk-NHUNEZXM.js +0 -371
  157. package/lib/chunk-WYRIRWT5.js +0 -213
  158. package/lib/database-byVXw91u.d.ts +0 -5
  159. package/lib/define-pa_pWNWT.d.ts +0 -182
  160. package/lib/exports/core.d.ts +0 -249
  161. package/lib/exports/core.js +0 -45
  162. package/lib/exports/database.d.ts +0 -48
  163. package/lib/exports/database.js +0 -20
  164. package/lib/exports/types.d.ts +0 -5
  165. package/lib/exports/types.js +0 -13
  166. package/lib/index.d.ts +0 -2
  167. package/lib/web.config.d.ts +0 -5
  168. package/lib/web.config.js +0 -55
@@ -1,182 +0,0 @@
1
- import { AxiosHeaders } from 'node-karin/axios';
2
- import { f as MysAccountType } from './base-BJv9XnQP.js';
3
-
4
- declare const enum CoreCommand {
5
- BingMysDevice = "BingMysDevice"
6
- }
7
-
8
- interface BaseltuidInfo {
9
- ltuid: string;
10
- type: MysAccountType;
11
- }
12
- interface UidInfo extends BaseltuidInfo {
13
- uid?: string;
14
- cookie?: string;
15
- stoken?: string;
16
- owner?: boolean;
17
- }
18
- interface DeviceInfo {
19
- id: string;
20
- name: string;
21
- }
22
- interface BaseMysRes {
23
- retcode: number;
24
- message: string;
25
- error?: string[];
26
- isCache?: boolean;
27
- }
28
- type MysApiInfoFn<R extends BaseMysRes & Record<string, any> | undefined = undefined, D extends Record<string, any> = {}> = (self: DefineMysApi<R, D>, data: D) => {
29
- Method: 'GET' | 'POST';
30
- Url: URL;
31
- Body?: any;
32
- HeaderFn: (options: {
33
- query: string;
34
- body: any;
35
- }, data?: D) => Record<string, string> | Promise<Record<string, string>>;
36
- };
37
-
38
- interface UserGameRoleItem {
39
- game_biz: string;
40
- region: string;
41
- game_uid: string;
42
- nickname: string;
43
- is_chosen: boolean;
44
- }
45
-
46
- interface RefreshUidData {
47
- data: {
48
- [key: string]: {};
49
- };
50
- names: {
51
- [key: string]: string;
52
- };
53
- }
54
- interface StokenParms {
55
- stuid: string;
56
- stoken: string;
57
- mid: string;
58
- }
59
-
60
- interface ConfigType {
61
- device: DeviceConfig;
62
- commands: Record<CoreCommand, CommandItem>;
63
- }
64
- interface CommandItem {
65
- cmds: string[];
66
- end: boolean;
67
- flags: string;
68
- }
69
- interface DeviceConfig {
70
- deviceName: string;
71
- deviceBoard: string;
72
- deviceModel: string;
73
- androidVersion: string;
74
- deviceFingerprint: string;
75
- deviceProduct: string;
76
- }
77
-
78
- declare const MysApp: Readonly<{
79
- version: {
80
- cn: string;
81
- os: string;
82
- };
83
- appId: 2;
84
- salt: {
85
- os: string;
86
- '4X': string;
87
- '6X': string;
88
- K2: string;
89
- LK2: string;
90
- PROD: string;
91
- };
92
- }>;
93
-
94
- declare class DefineMysApi<R extends BaseMysRes & Record<string, any> | undefined = undefined, D extends Record<string, any> = {}> {
95
- #private;
96
- uidInfo: UidInfo;
97
- Device: DeviceInfo;
98
- constructor(apiInfo: MysApiInfoFn<R, D>, uidInfo?: UidInfo, opt?: {
99
- deviceFp?: boolean;
100
- checkCode?: boolean;
101
- });
102
- get isHoyolab(): boolean;
103
- getApi(data: D): Promise<{
104
- Method: "GET" | "POST";
105
- Url: URL;
106
- Body: any;
107
- Headers: AxiosHeaders;
108
- }>;
109
- getDevice(): Promise<DeviceInfo>;
110
- request(data: D, checkCode?: boolean): Promise<R>;
111
- checkRetCode(res: R, data?: D, validate?: boolean): Promise<R>;
112
- getDS1(saltKey: keyof typeof MysApp.salt, query?: string, body?: string): string;
113
- getDS2(saltKey: keyof typeof MysApp.salt, query?: string, body?: string): string;
114
- NoHeaders: (options?: {
115
- query?: string;
116
- body?: any;
117
- }) => {};
118
- BaseCnHeaders: () => Promise<{
119
- 'x-rpc-app_version': string;
120
- 'x-rpc-client_type': string;
121
- 'x-rpc-device_id': string;
122
- 'User-Agent': string;
123
- Referer: string;
124
- }>;
125
- BaseOsHeaders: () => {
126
- 'x-rpc-app_version': string;
127
- 'x-rpc-client_type': string;
128
- 'x-rpc-language': string;
129
- };
130
- PassportHeaders: (options?: {
131
- query?: string;
132
- body?: any;
133
- }) => {
134
- 'x-rpc-app_version': string;
135
- 'x-rpc-game_biz': string;
136
- 'x-rpc-client_type': string;
137
- 'User-Agent': string;
138
- 'x-rpc-app_id': string;
139
- DS: string;
140
- };
141
- CookieHeaders: (options?: {
142
- query?: string;
143
- body?: any;
144
- }) => {
145
- then<TResult1 = {
146
- 'x-rpc-app_version': string;
147
- 'x-rpc-client_type': string;
148
- 'x-rpc-device_id': string;
149
- 'User-Agent': string;
150
- Referer: string;
151
- }, TResult2 = never>(onfulfilled?: ((value: {
152
- 'x-rpc-app_version': string;
153
- 'x-rpc-client_type': string;
154
- 'x-rpc-device_id': string;
155
- 'User-Agent': string;
156
- Referer: string;
157
- }) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
158
- catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<{
159
- 'x-rpc-app_version': string;
160
- 'x-rpc-client_type': string;
161
- 'x-rpc-device_id': string;
162
- 'User-Agent': string;
163
- Referer: string;
164
- } | TResult>;
165
- finally(onfinally?: (() => void) | null | undefined): Promise<{
166
- 'x-rpc-app_version': string;
167
- 'x-rpc-client_type': string;
168
- 'x-rpc-device_id': string;
169
- 'User-Agent': string;
170
- Referer: string;
171
- }>;
172
- [Symbol.toStringTag]: string;
173
- Cookie: string;
174
- } | {
175
- 'x-rpc-app_version': string;
176
- 'x-rpc-client_type': string;
177
- 'x-rpc-language': string;
178
- Cookie: string;
179
- };
180
- }
181
-
182
- export { type BaseltuidInfo as B, CoreCommand as C, type DeviceInfo as D, type MysApiInfoFn as M, type RefreshUidData as R, type StokenParms as S, type UidInfo as U, type BaseMysRes as a, type UserGameRoleItem as b, type ConfigType as c, type CommandItem as d, type DeviceConfig as e, DefineMysApi as f, MysApp as g };
@@ -1,249 +0,0 @@
1
- import { f as DefineMysApi, a as BaseMysRes, B as BaseltuidInfo, b as UserGameRoleItem, S as StokenParms, R as RefreshUidData, C as CoreCommand, c as ConfigType } from '../define-pa_pWNWT.js';
2
- export { g as MysApp } from '../define-pa_pWNWT.js';
3
- import { B as BaseUserInfoType, b as DatabaseReturn, a as DatabaseType, e as MysAccountInfoType, h as MysDeviceInfoType, f as MysAccountType, g as MysDeviceInfoItem } from '../base-BJv9XnQP.js';
4
- export { dir as CoreDir } from '../dir.js';
5
- import 'node-karin/axios';
6
- import 'sequelize';
7
-
8
- declare const fetchQRcode: () => DefineMysApi<BaseMysRes & {
9
- data: {
10
- url: string;
11
- };
12
- }, {
13
- device: string;
14
- }>;
15
- declare const queryQRcode: () => DefineMysApi<BaseMysRes & {
16
- data: {
17
- stat: "Scanned" | "Confirmed";
18
- payload: {
19
- raw: string;
20
- };
21
- };
22
- }, {
23
- device: string;
24
- ticket: string;
25
- }>;
26
- declare const getTokenByGameToken: () => DefineMysApi<BaseMysRes & {
27
- data: {
28
- token: {
29
- token: string;
30
- };
31
- user_info: {
32
- aid: string;
33
- mid: string;
34
- };
35
- };
36
- }, {
37
- account_id: number;
38
- game_token: string;
39
- }>;
40
- declare const getCookieAccountInfoByGameToken: () => DefineMysApi<BaseMysRes & {
41
- data: {
42
- cookie_token: string;
43
- };
44
- }, {
45
- account_id: string;
46
- game_token: string;
47
- }>;
48
- declare const getCookieTokenBySToken: (method: "GET" | "POST") => DefineMysApi<BaseMysRes & {
49
- data: {
50
- cookie_token: string;
51
- };
52
- }, {
53
- stoken: string;
54
- }>;
55
- declare const getUserGameRolesByCookie: (uidInfo: {
56
- cookie: string;
57
- } & BaseltuidInfo) => DefineMysApi<BaseMysRes & {
58
- data: {
59
- list: UserGameRoleItem[];
60
- };
61
- }, {}>;
62
- declare const getUserFullInfo: (uidInfo: {
63
- cookie: string;
64
- } & BaseltuidInfo) => DefineMysApi<BaseMysRes & {
65
- data: {
66
- user_info: {
67
- uid: string;
68
- };
69
- };
70
- }, {}>;
71
-
72
- declare const MysHosts: Readonly<{
73
- bbs: {
74
- mihoyo: string;
75
- hoyolab: string;
76
- };
77
- web: {
78
- mihoyo: string;
79
- hoyolab: string;
80
- /** new web host */
81
- miyoushe: string;
82
- };
83
- static: "https://api-takumi-static.mihoyo.com/";
84
- record: {
85
- mihoyo: string;
86
- hoyolab: string;
87
- };
88
- hk4e: {
89
- mihoyo: string;
90
- hoyolab: string;
91
- };
92
- hk4eGacha: "https://public-operation-hk4e.mihoyo.com/";
93
- hk4eSdk: "https://hk4e-sdk.mihoyo.com/";
94
- napGacha: {
95
- mihoyo: string;
96
- hoyolab: string;
97
- };
98
- publicData: {
99
- mihoyo: string;
100
- hoyolab: string;
101
- };
102
- napAct: {
103
- mihoyo: string;
104
- hoyolab: string;
105
- };
106
- passport: "https://passport-api.mihoyo.com/";
107
- hk4eSg: {
108
- hoyolab: string;
109
- };
110
- publicSg: {
111
- hoyolab: string;
112
- hoyoverse: string;
113
- };
114
- }>;
115
-
116
- declare class BaseUserInfo<U extends BaseUserInfoType> {
117
- #private;
118
- userId: BaseUserInfoType['userId'];
119
- UserInfo: DatabaseReturn<BaseUserInfoType>[DatabaseType.Db];
120
- refresh: () => Promise<this>;
121
- constructor(userId: string);
122
- get ltuids(): string[];
123
- get stuids(): string[];
124
- get deviceList(): string[];
125
- initMysAccountInfo(UserInfo: DatabaseReturn<BaseUserInfoType>[DatabaseType.Db]): Promise<void>;
126
- getLtuidInfo(ltuid: string): Readonly<(MysAccountInfoType & {
127
- save: (data: Partial<MysAccountInfoType>) => Promise<MysAccountInfoType & /*elided*/ any>;
128
- }) | undefined>;
129
- getLtuidInfoList(): Readonly<MysAccountInfoType & {
130
- save: (data: Partial<MysAccountInfoType>) => Promise<MysAccountInfoType & /*elided*/ any>;
131
- }>[];
132
- getDeviceList(): Promise<(MysDeviceInfoType & {
133
- save: (data: Partial<MysDeviceInfoType>) => Promise<MysDeviceInfoType & /*elided*/ any>;
134
- })[]>;
135
- saveUserInfo(data: Partial<U>): Promise<void>;
136
- saveMysAccountInfo(ltuid: string, data: Partial<MysAccountInfoType>): Promise<void>;
137
- }
138
- declare class UserInfo extends BaseUserInfo<BaseUserInfoType> {
139
- static create(userId: string): Promise<BaseUserInfo<BaseUserInfoType>>;
140
- static refreshCookie(stokenParams: StokenParms, serv: MysAccountType): Promise<{
141
- Serv: MysAccountType;
142
- cookie: string;
143
- message: string;
144
- }>;
145
- static refreshUidFn(key: string, fn: (uidList: RefreshUidData) => void): void;
146
- static refreshUid: (options: {
147
- cookie: string;
148
- } & BaseltuidInfo) => Promise<{
149
- Serv: MysAccountType;
150
- uids: RefreshUidData;
151
- message: string;
152
- }>;
153
- }
154
-
155
- declare class DeviceInfo {
156
- static get(Md5: string): Promise<(MysDeviceInfoType & {
157
- save: (data: Partial<MysDeviceInfoType>) => Promise<MysDeviceInfoType & /*elided*/ any>;
158
- }) | undefined>;
159
- static create(UserInfo: BaseUserInfo<BaseUserInfoType>, deviceInfo: Partial<MysDeviceInfoItem>): Promise<void>;
160
- }
161
-
162
- /**
163
- * 生成随机数
164
- * @param min - 最小值
165
- * @param max - 最大值
166
- * @returns
167
- */
168
- declare const random: (min: number, max: number) => number;
169
- /**
170
- * 睡眠函数
171
- * @param ms - 毫秒
172
- */
173
- declare const sleep: (ms: number) => Promise<unknown>;
174
- /**
175
- * 使用moment返回时间
176
- * @param format - 格式
177
- */
178
- declare const timef: (format?: string) => string;
179
- /**
180
- * 生成设备guid
181
- */
182
- declare const getDeviceGuid: () => string;
183
- /**
184
- * 生成随机字符串
185
- * @param length - 字符串长度
186
- */
187
- declare const randomString: (length: number, type: "Lower" | "Upper" | "All") => string;
188
- /**
189
- * 将字符串解析为key-value键值对
190
- * @param Str - 字符串
191
- * @param sep - 分隔符
192
- */
193
- declare const StrToObj: <D extends {
194
- [key: string]: string;
195
- }>(Str: string, sep: string | RegExp) => Partial<D>;
196
- /**
197
- * 将key-value键值对解析为字符串
198
- * @param obj - key-value键值对
199
- * @param sep - 分隔符
200
- */
201
- declare const ObjToStr: (obj: {
202
- [key: string]: string | number;
203
- }, sep: string) => string;
204
- /**
205
- * 使用moment返回今日剩余时间
206
- */
207
- declare const getEndOfDay: () => number;
208
-
209
- declare const common_ObjToStr: typeof ObjToStr;
210
- declare const common_StrToObj: typeof StrToObj;
211
- declare const common_getDeviceGuid: typeof getDeviceGuid;
212
- declare const common_getEndOfDay: typeof getEndOfDay;
213
- declare const common_random: typeof random;
214
- declare const common_randomString: typeof randomString;
215
- declare const common_sleep: typeof sleep;
216
- declare const common_timef: typeof timef;
217
- declare namespace common {
218
- export { common_ObjToStr as ObjToStr, common_StrToObj as StrToObj, common_getDeviceGuid as getDeviceGuid, common_getEndOfDay as getEndOfDay, common_random as random, common_randomString as randomString, common_sleep as sleep, common_timef as timef };
219
- }
220
-
221
- declare class Config<C extends Record<string, any>> {
222
- #private;
223
- constructor(ConfigPath: string, DefaultConfig: C);
224
- loadConfig(): C;
225
- mergeWithDefaults(userConfig: Record<string, any>, defaultConfig: Record<string, any>): C;
226
- /**
227
- * @description 获取配置路径对应的默认配置
228
- */
229
- getDef<T>(path: string): T;
230
- /**
231
- * @description 获取配置路径对应的配置
232
- */
233
- get<T>(path: string, isArray?: false): T;
234
- get<T>(path: string, isArray: true): EnhancedArray<T>;
235
- set<T>(path: string, value: T): void;
236
- /**
237
- * @description 获取触发指令正则表达式
238
- */
239
- getCommand(cmd: CoreCommand): RegExp;
240
- }
241
- declare const Cfg: Config<ConfigType>;
242
- declare class EnhancedArray<T> extends Array<T> {
243
- #private;
244
- constructor(items: T[], path: string);
245
- add(element: T): this;
246
- remove(predicate: T | ((item: T) => boolean), isIndex?: boolean): this;
247
- }
248
-
249
- export { BaseUserInfo, Cfg, Config, DefineMysApi, DeviceInfo, MysHosts, UserInfo, common, fetchQRcode, getCookieAccountInfoByGameToken, getCookieTokenBySToken, getTokenByGameToken, getUserFullInfo, getUserGameRolesByCookie, queryQRcode };
@@ -1,45 +0,0 @@
1
- import {
2
- BaseUserInfo,
3
- DefineMysApi,
4
- DeviceInfo,
5
- MysApp,
6
- MysHosts,
7
- UserInfo,
8
- fetchQRcode,
9
- getCookieAccountInfoByGameToken,
10
- getCookieTokenBySToken,
11
- getTokenByGameToken,
12
- getUserFullInfo,
13
- getUserGameRolesByCookie,
14
- queryQRcode
15
- } from "../chunk-MV2UE7C7.js";
16
- import "../chunk-NHUNEZXM.js";
17
- import {
18
- Cfg,
19
- Config,
20
- common_exports
21
- } from "../chunk-WYRIRWT5.js";
22
- import "../chunk-CQNW7LJI.js";
23
- import {
24
- dir
25
- } from "../chunk-JML6VYXN.js";
26
- import "../chunk-MLKGABMK.js";
27
- export {
28
- BaseUserInfo,
29
- Cfg,
30
- Config,
31
- dir as CoreDir,
32
- DefineMysApi,
33
- DeviceInfo,
34
- MysApp,
35
- MysHosts,
36
- UserInfo,
37
- common_exports as common,
38
- fetchQRcode,
39
- getCookieAccountInfoByGameToken,
40
- getCookieTokenBySToken,
41
- getTokenByGameToken,
42
- getUserFullInfo,
43
- getUserGameRolesByCookie,
44
- queryQRcode
45
- };
@@ -1,48 +0,0 @@
1
- import { D as DatabaseFn } from '../database-byVXw91u.js';
2
- import { d as DatabaseClassStatic, a as DatabaseType, c as DatabaseClassInstance, M as ModelAttributes, b as DatabaseReturn, e as MysAccountInfoType, h as MysDeviceInfoType, B as BaseUserInfoType } from '../base-BJv9XnQP.js';
3
- import * as sequelize from 'sequelize';
4
- import { DataTypes, ModelAttributeColumnOptions, Model, ModelStatic } from 'sequelize';
5
-
6
- declare class DatabaseClass {
7
- #private;
8
- constructor();
9
- /** 设置默认数据库 */
10
- default(Database: DatabaseFn, Static: DatabaseClassStatic): Promise<void>;
11
- /** 获取当前使用的数据库 */
12
- get<T extends Record<string, any>, D extends DatabaseType>(): DatabaseClassInstance<T, D>;
13
- get PkColumn(): (type: keyof typeof DataTypes, option?: Partial<ModelAttributeColumnOptions<Model>>) => ModelAttributeColumnOptions<Model>;
14
- get Column(): DatabaseClassStatic['Column'];
15
- get ArrayColumn(): DatabaseClassStatic['ArrayColumn'];
16
- get JsonColumn(): DatabaseClassStatic['JsonColumn'];
17
- }
18
- declare const Database: DatabaseClass;
19
-
20
- declare class DbBase<T extends Record<string, any>, D extends DatabaseType> {
21
- model: ModelStatic<Model>;
22
- databasePath: string;
23
- databaseType: D;
24
- modelName: string;
25
- modelSchema: ModelAttributes<Model>;
26
- schemaToJSON(pk: string): T;
27
- userPath(pk: string): string;
28
- readSync(path: string, pk: string): DatabaseReturn<T>[DatabaseType.File];
29
- readDirSync(pk: string): DatabaseReturn<T>[DatabaseType.Dir];
30
- writeDirSync(pk: string, data: Record<string, any>): boolean;
31
- saveFile(pk: string): (data: T) => Promise<DatabaseReturn<T>[DatabaseType.File]>;
32
- saveDir(pk: string): (data: T) => Promise<DatabaseReturn<T>[DatabaseType.Dir]>;
33
- saveSql(model: Model<any, any>, pk: string): (data: Partial<T>) => Promise<DatabaseReturn<T>[DatabaseType.Db]>;
34
- }
35
-
36
- declare const MysAccountInfoDB: DatabaseClassInstance<MysAccountInfoType, DatabaseType.Db>;
37
-
38
- declare const MysDeviceInfoDB: DatabaseClassInstance<MysDeviceInfoType, DatabaseType.Db>;
39
-
40
- declare const BaseMysUserInfoSchema: {
41
- userId: sequelize.ModelAttributeColumnOptions<sequelize.Model<any, any>>;
42
- ltuids: sequelize.ModelAttributeColumnOptions<sequelize.Model<any, any>>;
43
- stuids: sequelize.ModelAttributeColumnOptions<sequelize.Model<any, any>>;
44
- deviceList: sequelize.ModelAttributeColumnOptions<sequelize.Model<any, any>>;
45
- };
46
- declare const MysUserInfoDB: DatabaseClassInstance<BaseUserInfoType, DatabaseType.Db>;
47
-
48
- export { BaseMysUserInfoSchema, Database, DbBase, MysAccountInfoDB, MysDeviceInfoDB, MysUserInfoDB };
@@ -1,20 +0,0 @@
1
- import {
2
- BaseMysUserInfoSchema,
3
- Database,
4
- DbBase,
5
- MysAccountInfoDB,
6
- MysDeviceInfoDB,
7
- MysUserInfoDB
8
- } from "../chunk-NHUNEZXM.js";
9
- import "../chunk-WYRIRWT5.js";
10
- import "../chunk-CQNW7LJI.js";
11
- import "../chunk-JML6VYXN.js";
12
- import "../chunk-MLKGABMK.js";
13
- export {
14
- BaseMysUserInfoSchema,
15
- Database,
16
- DbBase,
17
- MysAccountInfoDB,
18
- MysDeviceInfoDB,
19
- MysUserInfoDB
20
- };
@@ -1,5 +0,0 @@
1
- export { a as BaseMysRes, B as BaseltuidInfo, d as CommandItem, c as ConfigType, C as CoreCommand, e as DeviceConfig, D as DeviceInfo, M as MysApiInfoFn, R as RefreshUidData, S as StokenParms, U as UidInfo, b as UserGameRoleItem } from '../define-pa_pWNWT.js';
2
- export { D as DatabaseFn } from '../database-byVXw91u.js';
3
- export { B as BaseUserInfoType, c as DatabaseClassInstance, d as DatabaseClassStatic, b as DatabaseReturn, a as DatabaseType, D as Dialect, M as ModelAttributes, e as MysAccountInfoType, f as MysAccountType, g as MysDeviceInfoItem, h as MysDeviceInfoType } from '../base-BJv9XnQP.js';
4
- import 'node-karin/axios';
5
- import 'sequelize';
@@ -1,13 +0,0 @@
1
- import {
2
- CoreCommand,
3
- DatabaseType,
4
- Dialect,
5
- MysAccountType
6
- } from "../chunk-CQNW7LJI.js";
7
- import "../chunk-MLKGABMK.js";
8
- export {
9
- CoreCommand,
10
- DatabaseType,
11
- Dialect,
12
- MysAccountType
13
- };
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
-
2
- export { }
@@ -1,5 +0,0 @@
1
- import * as node_karin from 'node-karin';
2
-
3
- declare const _default: node_karin.DefineConfig<any>;
4
-
5
- export { _default as default };
package/lib/web.config.js DELETED
@@ -1,55 +0,0 @@
1
- import {
2
- Cfg
3
- } from "./chunk-WYRIRWT5.js";
4
- import "./chunk-CQNW7LJI.js";
5
- import {
6
- dir
7
- } from "./chunk-JML6VYXN.js";
8
- import "./chunk-MLKGABMK.js";
9
-
10
- // src/web.config.ts
11
- import { components, defineConfig } from "node-karin";
12
- var web_config_default = defineConfig({
13
- /** 插件信息配置 */
14
- info: {
15
- id: dir.name,
16
- name: "Mihoyo",
17
- version: dir.version,
18
- description: dir.pkg.description,
19
- author: [
20
- {
21
- name: dir.pkg.author,
22
- avatar: "https://github.com/babanbang.png"
23
- }
24
- ]
25
- },
26
- /** 动态渲染的组件 */
27
- components: () => [
28
- // 基本调用方法
29
- components.accordion.create("accordion-device-key", {
30
- label: "\u9ED8\u8BA4\u8BBE\u5907\u4FE1\u606F",
31
- children: [
32
- components.accordion.createItem("accordion-device-item-key", {
33
- title: "\u9ED8\u8BA4\u8BBE\u5907\u4FE1\u606F",
34
- subtitle: "\u5982\u679C\u4E0D\u77E5\u9053\u8FD9\u662F\u4EC0\u4E48\u8BF7\u52FF\u4FEE\u6539",
35
- children: Object.keys(Cfg.getDef("device")).map((key) => components.input.string(`device-${key}`, {
36
- defaultValue: Cfg.get(`device.${key}`),
37
- label: key,
38
- isRequired: true
39
- }))
40
- })
41
- ]
42
- })
43
- ],
44
- /** 前端点击保存之后调用的方法 */
45
- save: (config) => {
46
- console.log("\u4FDD\u5B58\u7684\u914D\u7F6E:", config);
47
- return {
48
- success: true,
49
- message: "\u4FDD\u5B58\u6210\u529F"
50
- };
51
- }
52
- });
53
- export {
54
- web_config_default as default
55
- };