karin-plugin-mys-core 1.0.10 → 1.0.12

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 (154) hide show
  1. package/README.md +1 -1
  2. package/lib/apps/MiHoYoLogin.js +6 -38
  3. package/lib/apps/MysDevice.js +5 -37
  4. package/lib/apps/UIDManage.js +6 -38
  5. package/lib/{chunk-JT3SU5UU.js → chunk-A5FZEOIN.js} +78 -6
  6. package/lib/{chunk-4BTKE3LO.js → chunk-HTL64YH2.js} +300 -178
  7. package/lib/chunk-IASM5MM5.js +639 -0
  8. package/lib/{chunk-5DXIT7UB.js → chunk-RX4VMVAI.js} +0 -5
  9. package/lib/{chunk-MQ52BX7O.js → chunk-SZHK7OGF.js} +9 -13
  10. package/lib/chunk-UIPRZFST.js +184 -0
  11. package/lib/exports/config/index.d.ts +56 -1
  12. package/lib/exports/config/index.js +3 -9
  13. package/lib/exports/database/index.d.ts +78 -12
  14. package/lib/exports/database/index.js +12 -40
  15. package/lib/exports/mys/index.d.ts +379 -14
  16. package/lib/exports/mys/index.js +9 -43
  17. package/lib/exports/render/index.d.ts +38 -4
  18. package/lib/exports/render/index.js +3 -8
  19. package/lib/exports/utils/index.d.ts +45 -2
  20. package/lib/exports/utils/index.js +1 -4
  21. package/lib/{exports/database/types/dbs/base.d.ts → mysUserInfo-BsyEENbc.d.ts} +60 -1
  22. package/package.json +1 -1
  23. package/resources/image/frame-logo.webp +0 -0
  24. package/resources/image/launcher-icon//345/216/237/347/245/236.webp +0 -0
  25. package/resources/image/launcher-icon//345/264/251/345/235/2173.webp +0 -0
  26. package/resources/image/launcher-icon//345/264/251/345/235/217/345/255/246/345/233/2552.webp +0 -0
  27. 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.webp +0 -0
  28. 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.webp +0 -0
  29. package/resources/image/launcher-icon//346/230/237/345/270/203/350/260/267/345/234/260.webp +0 -0
  30. package/resources/image/launcher-icon//346/234/252/345/256/232/344/272/213/344/273/266/347/260/277.webp +0 -0
  31. package/resources/image/launcher-icon//347/273/235/345/214/272/351/233/266.webp +0 -0
  32. package/resources/image/mys-core-logo.webp +0 -0
  33. package/resources/image/mys-logo.webp +0 -0
  34. package/resources/styles/karin-plugin-mys-core.css +4 -4
  35. package/lib/chunk-2BVJS5VE.js +0 -49
  36. package/lib/chunk-3ERB3ILC.js +0 -0
  37. package/lib/chunk-3JN5WYUN.js +0 -135
  38. package/lib/chunk-7KEG6SDX.js +0 -0
  39. package/lib/chunk-7VAWV6ZE.js +0 -0
  40. package/lib/chunk-ARLTXJFJ.js +0 -0
  41. package/lib/chunk-CFS2WFOO.js +0 -0
  42. package/lib/chunk-DMJ5OQR6.js +0 -73
  43. package/lib/chunk-EDNBKOMS.js +0 -30
  44. package/lib/chunk-FBWSEBAW.js +0 -0
  45. package/lib/chunk-FOAQZIZ2.js +0 -0
  46. package/lib/chunk-G5W5WAY5.js +0 -64
  47. package/lib/chunk-G7TMVDGP.js +0 -68
  48. package/lib/chunk-HJ6HX5HB.js +0 -29
  49. package/lib/chunk-I7XZONDN.js +0 -13
  50. package/lib/chunk-JRH4JC43.js +0 -0
  51. package/lib/chunk-JVJQKRJ4.js +0 -89
  52. package/lib/chunk-K5U2O3HH.js +0 -0
  53. package/lib/chunk-KQVWWGRH.js +0 -31
  54. package/lib/chunk-LBLGKL3W.js +0 -77
  55. package/lib/chunk-LJSDSOY6.js +0 -0
  56. package/lib/chunk-LYTNREAI.js +0 -0
  57. package/lib/chunk-MPZP23EX.js +0 -219
  58. package/lib/chunk-MWYDWDR4.js +0 -0
  59. package/lib/chunk-PMFOX5HA.js +0 -80
  60. package/lib/chunk-PYTECG57.js +0 -0
  61. package/lib/chunk-SEWEEPJN.js +0 -0
  62. package/lib/chunk-SHW6FHIB.js +0 -10
  63. package/lib/chunk-T7W4DXRM.js +0 -0
  64. package/lib/chunk-TTN7NFCA.js +0 -109
  65. package/lib/chunk-W4DBT7AD.js +0 -0
  66. package/lib/chunk-WCX7WZAQ.js +0 -0
  67. package/lib/chunk-Z5I6A73Y.js +0 -0
  68. package/lib/chunk-ZTOR2DXG.js +0 -38
  69. package/lib/common-BlI5Gsw_.d.ts +0 -35
  70. package/lib/define-B9r20dK6.d.ts +0 -130
  71. package/lib/exports/config/array.d.ts +0 -1
  72. package/lib/exports/config/array.js +0 -7
  73. package/lib/exports/config/config.d.ts +0 -56
  74. package/lib/exports/config/config.js +0 -12
  75. package/lib/exports/database/database.d.ts +0 -30
  76. package/lib/exports/database/database.js +0 -22
  77. package/lib/exports/database/dbs/base.d.ts +0 -25
  78. package/lib/exports/database/dbs/base.js +0 -19
  79. package/lib/exports/database/dbs/index.d.ts +0 -4
  80. package/lib/exports/database/dbs/index.js +0 -29
  81. package/lib/exports/database/dbs/sqlite3.d.ts +0 -27
  82. package/lib/exports/database/dbs/sqlite3.js +0 -23
  83. package/lib/exports/database/dbs/table.d.ts +0 -20
  84. package/lib/exports/database/dbs/table.js +0 -25
  85. package/lib/exports/database/tables/index.d.ts +0 -9
  86. package/lib/exports/database/tables/index.js +0 -40
  87. package/lib/exports/database/tables/mysAccountInfo.d.ts +0 -9
  88. package/lib/exports/database/tables/mysAccountInfo.js +0 -27
  89. package/lib/exports/database/tables/mysDeviceInfo.d.ts +0 -9
  90. package/lib/exports/database/tables/mysDeviceInfo.js +0 -27
  91. package/lib/exports/database/tables/mysUserInfo.d.ts +0 -9
  92. package/lib/exports/database/tables/mysUserInfo.js +0 -27
  93. package/lib/exports/database/types/database.d.ts +0 -6
  94. package/lib/exports/database/types/database.js +0 -1
  95. package/lib/exports/database/types/dbs/base.js +0 -11
  96. package/lib/exports/database/types/dbs/index.d.ts +0 -2
  97. package/lib/exports/database/types/dbs/index.js +0 -12
  98. package/lib/exports/database/types/index.d.ts +0 -6
  99. package/lib/exports/database/types/index.js +0 -24
  100. package/lib/exports/database/types/tables/index.d.ts +0 -5
  101. package/lib/exports/database/types/tables/index.js +0 -13
  102. package/lib/exports/database/types/tables/mysAccountInfo.d.ts +0 -14
  103. package/lib/exports/database/types/tables/mysAccountInfo.js +0 -7
  104. package/lib/exports/database/types/tables/mysDeviceInfo.d.ts +0 -19
  105. package/lib/exports/database/types/tables/mysDeviceInfo.js +0 -1
  106. package/lib/exports/database/types/tables/mysUserInfo.d.ts +0 -32
  107. package/lib/exports/database/types/tables/mysUserInfo.js +0 -7
  108. package/lib/exports/mys/api/apis.d.ts +0 -82
  109. package/lib/exports/mys/api/apis.js +0 -56
  110. package/lib/exports/mys/api/app.d.ts +0 -60
  111. package/lib/exports/mys/api/app.js +0 -32
  112. package/lib/exports/mys/api/define.d.ts +0 -6
  113. package/lib/exports/mys/api/define.js +0 -42
  114. package/lib/exports/mys/api/index.d.ts +0 -11
  115. package/lib/exports/mys/api/index.js +0 -63
  116. package/lib/exports/mys/types/api/define.d.ts +0 -6
  117. package/lib/exports/mys/types/api/define.js +0 -1
  118. package/lib/exports/mys/types/api/index.d.ts +0 -6
  119. package/lib/exports/mys/types/api/index.js +0 -2
  120. package/lib/exports/mys/types/index.d.ts +0 -12
  121. package/lib/exports/mys/types/index.js +0 -6
  122. package/lib/exports/mys/types/user/game.d.ts +0 -23
  123. package/lib/exports/mys/types/user/game.js +0 -1
  124. package/lib/exports/mys/types/user/index.d.ts +0 -12
  125. package/lib/exports/mys/types/user/index.js +0 -3
  126. package/lib/exports/mys/types/user/userInfo.d.ts +0 -42
  127. package/lib/exports/mys/types/user/userInfo.js +0 -1
  128. package/lib/exports/mys/user/deviceInfo.d.ts +0 -11
  129. package/lib/exports/mys/user/deviceInfo.js +0 -30
  130. package/lib/exports/mys/user/game.d.ts +0 -40
  131. package/lib/exports/mys/user/game.js +0 -9
  132. package/lib/exports/mys/user/index.d.ts +0 -14
  133. package/lib/exports/mys/user/index.js +0 -52
  134. package/lib/exports/mys/user/userInfo.d.ts +0 -53
  135. package/lib/exports/mys/user/userInfo.js +0 -44
  136. package/lib/exports/render/render.d.ts +0 -38
  137. package/lib/exports/render/render.js +0 -12
  138. package/lib/exports/utils/common.d.ts +0 -1
  139. package/lib/exports/utils/common.js +0 -15
  140. package/lib/exports/utils/types/common.d.ts +0 -11
  141. package/lib/exports/utils/types/common.js +0 -1
  142. package/lib/exports/utils/types/index.d.ts +0 -1
  143. package/lib/exports/utils/types/index.js +0 -2
  144. package/resources/image/frame-logo.png +0 -0
  145. package/resources/image/launcher-icon//345/216/237/347/245/236.png +0 -0
  146. package/resources/image/launcher-icon//345/264/251/345/235/2173.png +0 -0
  147. package/resources/image/launcher-icon//345/264/251/345/235/217/345/255/246/345/233/2552.png +0 -0
  148. 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
  149. 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
  150. package/resources/image/launcher-icon//346/230/237/345/270/203/350/260/267/345/234/260.png +0 -0
  151. package/resources/image/launcher-icon//346/234/252/345/256/232/344/272/213/344/273/266/347/260/277.png +0 -0
  152. package/resources/image/launcher-icon//347/273/235/345/214/272/351/233/266.png +0 -0
  153. package/resources/image/mys-core-logo.png +0 -0
  154. package/resources/image/mys-logo.png +0 -0
@@ -1,15 +1,380 @@
1
- export { A as ApiInfoFn, B as BaseMysRes, a as BaseltuidInfoType, b as DefineApi, D as DeviceInfoType, R as RequestResult, U as UidInfoType } from '../../define-B9r20dK6.js';
2
- export { fetchQRcode, getCookieAccountInfoByGameToken, getCookieTokenBySToken, getDeviceFp, getTokenByGameToken, getUserFullInfo, getUserGameRolesByCookie, queryQRcode } from './api/apis.js';
3
- export { MysApp, MysHosts } from './api/app.js';
4
- export { GameUserInfoBase, gameName } from './types/user/game.js';
5
- export { CookieParamsType, RefreshUidResultType, StokenParamsType, UserGameRoleItemType } from './types/user/userInfo.js';
6
- export { DeviceInfo } from './user/deviceInfo.js';
7
- export { MysGame, RegisterGameBase } from './user/game.js';
8
- export { BaseUserInfo, UserInfo } from './user/userInfo.js';
9
- import '../database/types/tables/mysAccountInfo.js';
10
- import 'node-karin';
11
- import 'node-karin/axios';
12
- import '../database/types/tables/mysDeviceInfo.js';
13
- import '../database/types/tables/mysUserInfo.js';
14
- import '../database/types/dbs/base.js';
1
+ import { j as MysDeviceInfoDatabaseBaseType, k as MysDeviceInfoDatabaseIdFpType, i as MysAccountType, f as MysDeviceInfoTableType, B as BaseUserInfoTableType, e as MysAccountInfoTableType, d as DatabaseReturn, D as DatabaseType, h as DatabaseArray, U as UidPermission, g as BaseGameUIDInfoTableType } from '../../mysUserInfo-BsyEENbc.js';
2
+ import { SendMessage } from 'node-karin';
3
+ import { AxiosRequestConfig, AxiosResponse } from 'node-karin/axios';
15
4
  import 'sequelize';
5
+
6
+ declare const MysApp: Readonly<{
7
+ version: {
8
+ cn: string;
9
+ os: string;
10
+ };
11
+ appId: 2;
12
+ salt: {
13
+ os: string;
14
+ '4X': string;
15
+ '6X': string;
16
+ K2: string;
17
+ LK2: string;
18
+ PROD: string;
19
+ };
20
+ }>;
21
+ declare const MysHosts: Readonly<{
22
+ bbs: {
23
+ mihoyo: string;
24
+ hoyolab: string;
25
+ };
26
+ web: {
27
+ mihoyo: string;
28
+ hoyolab: string;
29
+ /** new web host */
30
+ miyoushe: string;
31
+ };
32
+ static: "https://api-takumi-static.mihoyo.com/";
33
+ record: {
34
+ mihoyo: string;
35
+ hoyolab: string;
36
+ };
37
+ hk4e: {
38
+ mihoyo: string;
39
+ hoyolab: string;
40
+ };
41
+ hk4eGacha: "https://public-operation-hk4e.mihoyo.com/";
42
+ hk4eSdk: "https://hk4e-sdk.mihoyo.com/";
43
+ napGacha: {
44
+ mihoyo: string;
45
+ hoyolab: string;
46
+ };
47
+ publicData: {
48
+ mihoyo: string;
49
+ hoyolab: string;
50
+ };
51
+ napAct: {
52
+ mihoyo: string;
53
+ hoyolab: string;
54
+ };
55
+ passport: "https://passport-api.mihoyo.com/";
56
+ hk4eSg: {
57
+ hoyolab: string;
58
+ };
59
+ publicSg: {
60
+ hoyolab: string;
61
+ hoyoverse: string;
62
+ };
63
+ }>;
64
+
65
+ declare class DefineApi<R extends BaseMysRes & Record<string, any> | null = null, D extends Record<string, any> | null = null, U extends Record<string, any> | null = null> {
66
+ #private;
67
+ UserInfo: U;
68
+ DeviceInfo: MysDeviceInfoDatabaseBaseType & MysDeviceInfoDatabaseIdFpType & {
69
+ /** @description 重要参数 */
70
+ brand: string;
71
+ display: string;
72
+ };
73
+ constructor(apiInfo: ApiInfoFn<R, D, U>);
74
+ get isHoyolab(): boolean;
75
+ init(userInfo: U): {
76
+ request: (data: D) => Promise<RequestResult<R>>;
77
+ requestCache: (key: string, seconds: number, data: D) => Promise<RequestResult<R>>;
78
+ };
79
+ /** @description 使用CookieHeaders等需要device进行请求时使用 */
80
+ initDevice(userInfo: U, deviceFp?: boolean): Promise<{
81
+ request: (data: D) => Promise<RequestResult<R>>;
82
+ requestCache: (key: string, seconds: number, data: D) => Promise<RequestResult<R>>;
83
+ }>;
84
+ getDS1(saltKey: keyof typeof MysApp.salt, query?: string, body?: string): string;
85
+ getDS2(saltKey: keyof typeof MysApp.salt, query?: string, body?: string): string;
86
+ NoHeaders: (options?: {
87
+ query?: string;
88
+ body?: any;
89
+ }) => {};
90
+ BaseCnHeaders: () => {
91
+ 'x-rpc-app_version': string;
92
+ 'x-rpc-client_type': string;
93
+ 'x-rpc-device_id': string;
94
+ 'User-Agent': string;
95
+ Referer: string;
96
+ };
97
+ BaseOsHeaders: () => {
98
+ 'x-rpc-app_version': string;
99
+ 'x-rpc-client_type': string;
100
+ 'x-rpc-language': string;
101
+ };
102
+ PassportHeaders: (options?: {
103
+ query?: string;
104
+ body?: any;
105
+ }) => {
106
+ 'x-rpc-app_version': string;
107
+ 'x-rpc-game_biz': string;
108
+ 'x-rpc-client_type': string;
109
+ 'User-Agent': string;
110
+ 'x-rpc-app_id': string;
111
+ DS: string;
112
+ };
113
+ CookieHeaders: (options?: {
114
+ query?: string;
115
+ body?: any;
116
+ }) => {
117
+ 'x-rpc-app_version': string;
118
+ 'x-rpc-client_type': string;
119
+ 'x-rpc-language': string;
120
+ Cookie: any;
121
+ } | {
122
+ 'x-rpc-app_version': string;
123
+ 'x-rpc-client_type': string;
124
+ 'x-rpc-device_id': string;
125
+ 'User-Agent': string;
126
+ Referer: string;
127
+ Cookie: any;
128
+ };
129
+ OkHttpHeaders: (options?: {
130
+ query?: string;
131
+ body?: any;
132
+ }) => {
133
+ 'User-Agent': string;
134
+ Connection: string;
135
+ 'Accept-Encoding': string;
136
+ 'Content-Type': string;
137
+ };
138
+ }
139
+
140
+ type RequestResult<R> = {
141
+ data: R;
142
+ check: () => Promise<RequestResult<R>>;
143
+ error: SendMessage[];
144
+ };
145
+ interface BaseMysRes {
146
+ retcode: number;
147
+ message: string;
148
+ }
149
+ type ApiInfoFn<
150
+ /** @description 请求参数 */
151
+ R extends BaseMysRes & Record<string, any> | null = null,
152
+ /** @description 响应数据 */
153
+ D extends Record<string, any> | null = null, U extends Record<string, any> | null = null> = (self: DefineApi<R, D, U>, data: D) => {
154
+ Url: URL;
155
+ Body?: any;
156
+ Method: 'GET' | 'POST';
157
+ Options?: Omit<AxiosRequestConfig, 'url' | 'method' | 'data' | 'headers'>;
158
+ HeaderFn: () => Record<string, string> | Promise<Record<string, string>>;
159
+ /** @description 对响应数据进行处理 */
160
+ Result?: (response: AxiosResponse) => Promise<{
161
+ data: R;
162
+ row: any;
163
+ }>;
164
+ };
165
+ interface BaseltuidInfoType {
166
+ ltuid: string;
167
+ type: MysAccountType;
168
+ /** @description 未绑定则使用deviceList中首个设备 */
169
+ deviceMd5: string;
170
+ }
171
+ interface UidInfoType extends BaseltuidInfoType {
172
+ uid: string;
173
+ userId: string;
174
+ cookie: string;
175
+ stoken: string;
176
+ }
177
+ interface DeviceInfoType {
178
+ id: string;
179
+ name: string;
180
+ board: string;
181
+ model: string;
182
+ oaid: string;
183
+ androidVersion: string;
184
+ fingerprint: string;
185
+ product: string;
186
+ }
187
+
188
+ declare const fetchQRcode: DefineApi<BaseMysRes & {
189
+ data: {
190
+ url: string;
191
+ };
192
+ }, {
193
+ device: string;
194
+ }, null>;
195
+ declare const queryQRcode: DefineApi<BaseMysRes & {
196
+ data: {
197
+ stat: "Scanned" | "Confirmed";
198
+ payload: {
199
+ raw: string;
200
+ };
201
+ };
202
+ }, {
203
+ device: string;
204
+ ticket: string;
205
+ }, null>;
206
+ declare const getTokenByGameToken: DefineApi<BaseMysRes & {
207
+ data: {
208
+ token: {
209
+ token: string;
210
+ };
211
+ user_info: {
212
+ aid: string;
213
+ mid: string;
214
+ };
215
+ };
216
+ }, {
217
+ account_id: number;
218
+ game_token: string;
219
+ }, null>;
220
+ declare const getCookieAccountInfoByGameToken: DefineApi<BaseMysRes & {
221
+ data: {
222
+ cookie_token: string;
223
+ };
224
+ }, {
225
+ account_id: string;
226
+ game_token: string;
227
+ }, null>;
228
+ declare const getCookieTokenBySToken: DefineApi<BaseMysRes & {
229
+ data: {
230
+ cookie_token: string;
231
+ };
232
+ }, {
233
+ stoken: string;
234
+ method: "GET" | "POST";
235
+ }, null>;
236
+ declare const getUserGameRolesByCookie: DefineApi<BaseMysRes & {
237
+ data: {
238
+ list: UserGameRoleItemType[];
239
+ };
240
+ }, null, {
241
+ cookie: string;
242
+ } & BaseltuidInfoType>;
243
+ declare const getUserFullInfo: DefineApi<BaseMysRes & {
244
+ data: {
245
+ user_info: {
246
+ uid: string;
247
+ };
248
+ };
249
+ }, null, {
250
+ cookie: string;
251
+ } & BaseltuidInfoType>;
252
+ declare const getDeviceFp: DefineApi<BaseMysRes & {
253
+ data: {
254
+ device_fp: string;
255
+ };
256
+ }, null, null>;
257
+
258
+ declare class DeviceInfo {
259
+ static get(Md5: string): Promise<(MysDeviceInfoTableType & {
260
+ save: (data: Partial<MysDeviceInfoTableType>) => Promise<MysDeviceInfoTableType & /*elided*/ any>;
261
+ destroy: () => Promise<boolean>;
262
+ }) | undefined>;
263
+ static create(userId: string, deviceInfo: Partial<MysDeviceInfoDatabaseBaseType & MysDeviceInfoDatabaseIdFpType>): Promise<string>;
264
+ }
265
+
266
+ declare const MysGame: {
267
+ "__#private@#games": Map<string, RegisterGameBase<any>>;
268
+ get num(): number;
269
+ match(prefix: string): RegisterGameBase<any> | undefined;
270
+ RegisterGame<GameUserInfoTableType extends BaseUserInfoTableType>(Game: RegisterGameBase<GameUserInfoTableType>): void;
271
+ forEachGame<GameUserInfoTableType extends BaseUserInfoTableType>(fn: (Game: RegisterGameBase<GameUserInfoTableType>) => Promise<void | "break">): Promise<void>;
272
+ };
273
+ declare class RegisterGameBase<GameUserInfoTableType extends BaseUserInfoTableType> {
274
+ game: string;
275
+ columnKey: `${string}-uids`;
276
+ /** @description 游戏名称 */
277
+ name: gameName;
278
+ /** @description 指令前缀 */
279
+ prefixs: string[];
280
+ refresh: (info: UserGameRoleItemType[], options: {
281
+ userId: string;
282
+ cookie: string;
283
+ } & BaseltuidInfoType) => Promise<string[]>;
284
+ UserInfo: typeof GameUserInfoBase<GameUserInfoTableType>;
285
+ constructor(game: string, name: gameName, prefixs: string[], userInfo: typeof GameUserInfoBase<GameUserInfoTableType>, refreshFuc: (info: UserGameRoleItemType[], options: {
286
+ userId: string;
287
+ cookie: string;
288
+ } & BaseltuidInfoType) => Promise<string[]>);
289
+ get prefix(): RegExp;
290
+ }
291
+
292
+ declare class BaseUserInfo<U extends BaseUserInfoTableType> {
293
+ userId: BaseUserInfoTableType['userId'];
294
+ ltuidMap: Map<string, MysAccountInfoTableType & {
295
+ save: (data: Partial<MysAccountInfoTableType>) => Promise<MysAccountInfoTableType & /*elided*/ any>;
296
+ destroy: () => Promise<boolean>;
297
+ }>;
298
+ UserInfo: DatabaseReturn<U>[DatabaseType.Db];
299
+ refresh: () => Promise<this>;
300
+ constructor(userId: string);
301
+ get ltuids(): DatabaseArray<string>;
302
+ get stuids(): DatabaseArray<string>;
303
+ get deviceList(): DatabaseArray<string>;
304
+ get LtuidInfoList(): Readonly<MysAccountInfoTableType & {
305
+ save: (data: Partial<MysAccountInfoTableType>) => Promise<MysAccountInfoTableType & /*elided*/ any>;
306
+ destroy: () => Promise<boolean>;
307
+ }>[];
308
+ initMysAccountInfo(UserInfo: DatabaseReturn<U>[DatabaseType.Db], initAll: boolean): Promise<void>;
309
+ getLtuidInfo(ltuid: string): Readonly<(MysAccountInfoTableType & {
310
+ save: (data: Partial<MysAccountInfoTableType>) => Promise<MysAccountInfoTableType & /*elided*/ any>;
311
+ destroy: () => Promise<boolean>;
312
+ }) | undefined>;
313
+ getDeviceInfoList(): Promise<(MysDeviceInfoTableType & {
314
+ save: (data: Partial<MysDeviceInfoTableType>) => Promise<MysDeviceInfoTableType & /*elided*/ any>;
315
+ destroy: () => Promise<boolean>;
316
+ })[]>;
317
+ saveUserInfo(data: Partial<U>): Promise<void>;
318
+ saveMysAccountInfo(ltuid: string, data: Partial<MysAccountInfoTableType>): Promise<void>;
319
+ }
320
+ declare class UserInfo extends BaseUserInfo<BaseUserInfoTableType> {
321
+ static create(userId: string, initAll?: boolean): Promise<UserInfo>;
322
+ static refreshUid(options: {
323
+ userId: string;
324
+ cookie: string;
325
+ } & BaseltuidInfoType, perm: UidPermission): Promise<RefreshUidResultType>;
326
+ static refreshCookie(stokenParams: StokenParamsType, serv: MysAccountType | MysAccountType[]): Promise<{
327
+ Serv: MysAccountType;
328
+ cookieParams: CookieParamsType;
329
+ message: string;
330
+ }>;
331
+ }
332
+
333
+ declare class GameUserInfoBase<GameUserInfoTableType extends BaseUserInfoTableType> extends BaseUserInfo<GameUserInfoTableType> {
334
+ get main_uid(): string;
335
+ get bind_uids(): BaseGameUIDInfoTableType<string>[`${string}-uids`];
336
+ get mainUIDInfo(): UidInfoType | undefined;
337
+ get uidInfoList(): UidInfoType[];
338
+ static create(userId: string): Promise<GameUserInfoBase<any>>;
339
+ getUIDInfo(uid: string): UidInfoType | undefined;
340
+ }
341
+ type gameName = '崩坏:星穹铁道' | '崩坏:因缘精灵' | '原神' | '崩坏3' | '崩坏学园2' | '未定事件簿' | '绝区零' | '星布谷地';
342
+
343
+ interface StokenParamsType {
344
+ stuid: string;
345
+ stoken: string;
346
+ mid: string;
347
+ }
348
+ type CookieParamsType = Partial<{
349
+ ltmid_v2: string;
350
+ ltuid: string;
351
+ ltuid_v2: string;
352
+ login_uid: string;
353
+ ltoken: string;
354
+ ltoken_v2: string;
355
+ cookie_token: string;
356
+ cookie_token_v2: string;
357
+ account_id: string;
358
+ account_id_v2: string;
359
+ account_mid_v2: string;
360
+ mi18nLang: string;
361
+ }>;
362
+ interface UserGameRoleItemType {
363
+ game_biz: string;
364
+ region: string;
365
+ game_uid: string;
366
+ level: number;
367
+ nickname: string;
368
+ is_chosen: boolean;
369
+ }
370
+ interface RefreshUidResultType {
371
+ Serv: MysAccountType;
372
+ uids: {
373
+ name: string;
374
+ columnKey: `${string}-uids`;
375
+ data: BaseGameUIDInfoTableType<string>[`${string}-uids`];
376
+ }[];
377
+ message: string;
378
+ }
379
+
380
+ export { type ApiInfoFn, type BaseMysRes, BaseUserInfo, type BaseltuidInfoType, type CookieParamsType, DefineApi, DeviceInfo, type DeviceInfoType, GameUserInfoBase, MysApp, MysGame, MysHosts, type RefreshUidResultType, RegisterGameBase, type RequestResult, type StokenParamsType, type UidInfoType, type UserGameRoleItemType, UserInfo, fetchQRcode, type gameName, getCookieAccountInfoByGameToken, getCookieTokenBySToken, getDeviceFp, getTokenByGameToken, getUserFullInfo, getUserGameRolesByCookie, queryQRcode };
@@ -1,6 +1,11 @@
1
1
  import {
2
2
  BaseUserInfo,
3
3
  DefineApi,
4
+ DeviceInfo,
5
+ MysApp,
6
+ MysGame,
7
+ MysHosts,
8
+ RegisterGameBase,
4
9
  UserInfo,
5
10
  fetchQRcode,
6
11
  getCookieAccountInfoByGameToken,
@@ -10,50 +15,11 @@ import {
10
15
  getUserFullInfo,
11
16
  getUserGameRolesByCookie,
12
17
  queryQRcode
13
- } from "../../chunk-4BTKE3LO.js";
14
- import {
15
- MysGame,
16
- RegisterGameBase
17
- } from "../../chunk-2BVJS5VE.js";
18
- import {
19
- MysApp,
20
- MysHosts
21
- } from "../../chunk-G5W5WAY5.js";
22
- import "../../chunk-7VAWV6ZE.js";
23
- import "../../chunk-LJSDSOY6.js";
24
- import "../../chunk-CFS2WFOO.js";
25
- import "../../chunk-MWYDWDR4.js";
26
- import "../../chunk-FOAQZIZ2.js";
27
- import "../../chunk-WCX7WZAQ.js";
28
- import {
29
- DeviceInfo
30
- } from "../../chunk-KQVWWGRH.js";
31
- import "../../chunk-3ERB3ILC.js";
32
- import "../../chunk-W4DBT7AD.js";
33
- import "../../chunk-Z5I6A73Y.js";
34
- import "../../chunk-EDNBKOMS.js";
35
- import "../../chunk-ZTOR2DXG.js";
36
- import "../../chunk-HJ6HX5HB.js";
37
- import "../../chunk-SEWEEPJN.js";
38
- import "../../chunk-G7TMVDGP.js";
39
- import "../../chunk-DMJ5OQR6.js";
40
- import "../../chunk-MPZP23EX.js";
41
- import "../../chunk-3JN5WYUN.js";
42
- import "../../chunk-7KEG6SDX.js";
43
- import "../../chunk-FBWSEBAW.js";
44
- import "../../chunk-JVJQKRJ4.js";
45
- import "../../chunk-LYTNREAI.js";
46
- import "../../chunk-SHW6FHIB.js";
47
- import "../../chunk-K5U2O3HH.js";
48
- import "../../chunk-I7XZONDN.js";
49
- import "../../chunk-JRH4JC43.js";
18
+ } from "../../chunk-HTL64YH2.js";
19
+ import "../../chunk-IASM5MM5.js";
50
20
  import "../../chunk-SHLPPEAY.js";
51
- import "../../chunk-TTN7NFCA.js";
52
- import "../../chunk-ARLTXJFJ.js";
53
- import "../../chunk-PYTECG57.js";
54
- import "../../chunk-T7W4DXRM.js";
55
- import "../../chunk-5DXIT7UB.js";
56
- import "../../chunk-PMFOX5HA.js";
21
+ import "../../chunk-UIPRZFST.js";
22
+ import "../../chunk-RX4VMVAI.js";
57
23
  import "../../chunk-MLKGABMK.js";
58
24
  export {
59
25
  BaseUserInfo,
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  export { default as React } from 'react';
3
- export { DefaultRenderPluginOptionsType, ReactRender, RenderCfg } from './render.js';
4
- import 'node-karin';
3
+ import { Options } from 'node-karin';
5
4
 
6
5
  interface DefaultLayoutProps {
7
6
  children: React.ReactNode;
8
- bgColor: string;
7
+ bg: string;
8
+ width: string;
9
9
  mysPlugin?: {
10
10
  name: string;
11
11
  version: string;
@@ -14,4 +14,38 @@ interface DefaultLayoutProps {
14
14
  }
15
15
  declare const DefaultLayoutComponent: React.FC<DefaultLayoutProps>;
16
16
 
17
- export { DefaultLayoutComponent, type DefaultLayoutProps };
17
+ interface RenderCfg {
18
+ /** @description 插件名称 package.json 的 name */
19
+ name: string;
20
+ /** @description 插件版本 package.json 的 version */
21
+ version: string;
22
+ /** @description 根目录绝对路径 */
23
+ pluginDir: string;
24
+ /** @description 插件资源目录 `@karinjs/karin-plugin-xxx/resources` */
25
+ ResourcesDir: string;
26
+ }
27
+ interface DefaultRenderPluginOptionsType {
28
+ name: string;
29
+ version: string;
30
+ resources: {
31
+ /** @description 插件内部资源 */
32
+ default: string;
33
+ /** @description 插件外部资源 @karinjs/karin-plugin-xxx/resources */
34
+ download: string;
35
+ };
36
+ }
37
+ declare class ReactRender<P extends Record<string, any>, K extends string> {
38
+ #private;
39
+ constructor(cfg: RenderCfg, pluginOptions?: Omit<P, 'name' | 'version' | 'resources'>);
40
+ get plugin(): Omit<P, 'name' | 'version' | 'resources'> & DefaultRenderPluginOptionsType;
41
+ get karin(): {
42
+ version: string;
43
+ };
44
+ template<C extends React.ComponentType<any>>(template: K, component: C, props: React.ComponentProps<C>, options?: {
45
+ type?: 'png' | 'jpeg' | 'webp';
46
+ plugin?: Record<string, any>;
47
+ render?: Omit<Options, 'file' | 'data'>;
48
+ }): Promise<string | null>;
49
+ }
50
+
51
+ export { DefaultLayoutComponent, type DefaultLayoutProps, type DefaultRenderPluginOptionsType, ReactRender, type RenderCfg };
@@ -1,15 +1,10 @@
1
1
  import {
2
2
  DefaultLayoutComponent,
3
- React
4
- } from "../../chunk-JT3SU5UU.js";
5
- import {
3
+ React,
6
4
  ReactRender
7
- } from "../../chunk-LBLGKL3W.js";
5
+ } from "../../chunk-A5FZEOIN.js";
8
6
  import "../../chunk-SHLPPEAY.js";
9
- import "../../chunk-ARLTXJFJ.js";
10
- import "../../chunk-PYTECG57.js";
11
- import "../../chunk-T7W4DXRM.js";
12
- import "../../chunk-5DXIT7UB.js";
7
+ import "../../chunk-RX4VMVAI.js";
13
8
  import "../../chunk-MLKGABMK.js";
14
9
  export {
15
10
  DefaultLayoutComponent,
@@ -1,2 +1,45 @@
1
- export { c as common } from '../../common-BlI5Gsw_.js';
2
- export { DefineData, DefineDataArray } from './types/common.js';
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
+ declare function filterData(user: any, defaults: any, Define: any): any;
25
+
26
+ declare const common_ObjToStr: typeof ObjToStr;
27
+ declare const common_StrToObj: typeof StrToObj;
28
+ declare const common_filterData: typeof filterData;
29
+ declare const common_getDeviceGuid: typeof getDeviceGuid;
30
+ declare const common_randomString: typeof randomString;
31
+ declare namespace common {
32
+ export { common_ObjToStr as ObjToStr, common_StrToObj as StrToObj, common_filterData as filterData, common_getDeviceGuid as getDeviceGuid, common_randomString as randomString };
33
+ }
34
+
35
+ interface DefineData<T> {
36
+ defaultConfig: T;
37
+ }
38
+ interface DefineDataArray<T> extends DefineData<T[]> {
39
+ defaultConfigItem: {
40
+ defaultConfig: T;
41
+ required?: T extends Record<string, any> ? (keyof T)[] : never;
42
+ };
43
+ }
44
+
45
+ export { type DefineData, type DefineDataArray, common };
@@ -1,9 +1,6 @@
1
- import "../../chunk-ARLTXJFJ.js";
2
- import "../../chunk-PYTECG57.js";
3
- import "../../chunk-T7W4DXRM.js";
4
1
  import {
5
2
  common_exports
6
- } from "../../chunk-5DXIT7UB.js";
3
+ } from "../../chunk-RX4VMVAI.js";
7
4
  import "../../chunk-MLKGABMK.js";
8
5
  export {
9
6
  common_exports as common
@@ -122,4 +122,63 @@ declare class DatabaseArray<T> extends Array<T> {
122
122
  clear(): this;
123
123
  }
124
124
 
125
- export { DatabaseArray, type DatabaseClassInstance, type DatabaseClassStatic, type DatabaseReturn, DatabaseType, Dialect, type ModelAttributes };
125
+ declare const enum MysAccountType {
126
+ cn = "mihoyo",
127
+ os = "hoyolab"
128
+ }
129
+ interface MysAccountInfoTableType {
130
+ ltuid: string;
131
+ type: MysAccountType;
132
+ cookie: string;
133
+ stoken: string;
134
+ /** 绑定的设备md5 */
135
+ deviceMd5: string;
136
+ }
137
+
138
+ interface MysDeviceInfoDatabaseBaseType {
139
+ name: string;
140
+ board: string;
141
+ /** @description 重要参数 */
142
+ model: string;
143
+ oaid: string;
144
+ version: number;
145
+ fingerprint: string;
146
+ product: string;
147
+ }
148
+ interface MysDeviceInfoDatabaseIdFpType {
149
+ deviceId: string;
150
+ deviceFp: string;
151
+ }
152
+ interface MysDeviceInfoTableType extends MysDeviceInfoDatabaseBaseType, MysDeviceInfoDatabaseIdFpType {
153
+ md5: string;
154
+ }
155
+
156
+ interface BaseUserInfoTableType {
157
+ userId: string;
158
+ ltuids: DatabaseArray<string>;
159
+ stuids: DatabaseArray<string>;
160
+ deviceList: DatabaseArray<string>;
161
+ }
162
+ declare const enum UidPermission {
163
+ /** @description 普通绑定 */
164
+ BIND = 0,
165
+ /** @description Cookie */
166
+ CK = 1,
167
+ /** @description SToken */
168
+ ST = 2,
169
+ /** @description Cookie + SToken */
170
+ CS = 3,
171
+ /** @description 删除绑定 */
172
+ DEL = 4
173
+ }
174
+ interface BindUidsItemType {
175
+ perm: UidPermission;
176
+ ltuid: string;
177
+ }
178
+ type BaseGameUIDInfoTableType<Game extends string> = {
179
+ [P in `${Game}-main`]: string;
180
+ } & {
181
+ [P in `${Game}-uids`]: Partial<Record<string, BindUidsItemType>>;
182
+ };
183
+
184
+ export { type BaseUserInfoTableType as B, DatabaseType as D, type ModelAttributes as M, UidPermission as U, type DatabaseClassInstance as a, Dialect as b, type DatabaseClassStatic as c, type DatabaseReturn as d, type MysAccountInfoTableType as e, type MysDeviceInfoTableType as f, type BaseGameUIDInfoTableType as g, DatabaseArray as h, MysAccountType as i, type MysDeviceInfoDatabaseBaseType as j, type MysDeviceInfoDatabaseIdFpType as k, type BindUidsItemType as l };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "karin-plugin-mys-core",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "author": "babanbang",
5
5
  "type": "module",
6
6
  "description": "karin-plugin-mys-core",
Binary file