karin-plugin-mys-core 1.0.26 → 1.0.27

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ShowBindAccountCmdFunc
3
- } from "../chunk-VNA6MX7Y.js";
3
+ } from "../chunk-6QS5SG35.js";
4
4
  import "../chunk-7DVGA2JO.js";
5
5
  import {
6
6
  UserInfo,
@@ -9,11 +9,11 @@ import {
9
9
  getTokenByGameToken,
10
10
  getUserFullInfo,
11
11
  queryQRcode
12
- } from "../chunk-XSW4HNMM.js";
12
+ } from "../chunk-4HJNTODO.js";
13
13
  import "../chunk-5LRGHP36.js";
14
14
  import "../chunk-HI6OZTI2.js";
15
15
  import "../chunk-BLE3V6QR.js";
16
- import "../chunk-A4WGB4ID.js";
16
+ import "../chunk-MSOQW3UL.js";
17
17
  import {
18
18
  common_exports
19
19
  } from "../chunk-RX4VMVAI.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  DeviceInfo,
3
3
  UserInfo
4
- } from "../chunk-XSW4HNMM.js";
4
+ } from "../chunk-4HJNTODO.js";
5
5
  import "../chunk-5LRGHP36.js";
6
6
  import "../chunk-HI6OZTI2.js";
7
7
  import "../chunk-BLE3V6QR.js";
8
- import "../chunk-A4WGB4ID.js";
8
+ import "../chunk-MSOQW3UL.js";
9
9
  import "../chunk-RX4VMVAI.js";
10
10
  import "../chunk-SHLPPEAY.js";
11
11
  import "../chunk-MLKGABMK.js";
@@ -5,13 +5,13 @@ import {
5
5
  ShowBindAccountCmdFunc,
6
6
  UnbindAccount,
7
7
  UnbindUID
8
- } from "../chunk-VNA6MX7Y.js";
8
+ } from "../chunk-6QS5SG35.js";
9
9
  import "../chunk-7DVGA2JO.js";
10
- import "../chunk-XSW4HNMM.js";
10
+ import "../chunk-4HJNTODO.js";
11
11
  import "../chunk-5LRGHP36.js";
12
12
  import "../chunk-HI6OZTI2.js";
13
13
  import "../chunk-BLE3V6QR.js";
14
- import "../chunk-A4WGB4ID.js";
14
+ import "../chunk-MSOQW3UL.js";
15
15
  import "../chunk-RX4VMVAI.js";
16
16
  import "../chunk-SHLPPEAY.js";
17
17
  import "../chunk-MLKGABMK.js";
@@ -5,7 +5,7 @@ import {
5
5
  MysAccountInfoDB,
6
6
  MysDeviceInfoDB,
7
7
  MysUserInfoDB
8
- } from "./chunk-A4WGB4ID.js";
8
+ } from "./chunk-MSOQW3UL.js";
9
9
  import {
10
10
  common_exports
11
11
  } from "./chunk-RX4VMVAI.js";
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  MysGame,
8
8
  UserInfo
9
- } from "./chunk-XSW4HNMM.js";
9
+ } from "./chunk-4HJNTODO.js";
10
10
  import {
11
11
  dir
12
12
  } from "./chunk-SHLPPEAY.js";
@@ -423,15 +423,24 @@ var Sqlite3Static = new class Sqlite3Static2 {
423
423
  ...option
424
424
  }
425
425
  });
426
- ArrayColumn = (key, fn) => ({
426
+ ArrayColumn = (key, split, fn) => ({
427
427
  key,
428
428
  type: "array" /* Array */,
429
429
  Option: {
430
430
  type: DataTypes.STRING,
431
431
  defaultValue: [].join(","),
432
432
  get() {
433
- const data = this.getDataValue(key).split(",").filter(Boolean);
434
- return new DatabaseArray(data);
433
+ let data = this.getDataValue(key);
434
+ if (split) {
435
+ return new DatabaseArray(data.split(",").filter(Boolean));
436
+ } else {
437
+ try {
438
+ data = JSON.parse(data) || [];
439
+ } catch (e) {
440
+ data = [];
441
+ }
442
+ return new DatabaseArray(data);
443
+ }
435
444
  },
436
445
  set(data) {
437
446
  const setData = (fn ? fn(data) : data) || [];
@@ -634,9 +643,9 @@ var MysUserInfoTable = createTable(
634
643
  var MysUserInfoDB = await MysUserInfoTable.init(
635
644
  [
636
645
  Database.PkColumn("userId", "STRING"),
637
- Database.ArrayColumn("ltuids"),
638
- Database.ArrayColumn("stuids"),
639
- Database.ArrayColumn("deviceList")
646
+ Database.ArrayColumn("ltuids", true),
647
+ Database.ArrayColumn("stuids", true),
648
+ Database.ArrayColumn("deviceList", true)
640
649
  ]
641
650
  );
642
651
 
package/lib/core/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  DeviceCfg
5
5
  } from "../chunk-HI6OZTI2.js";
6
6
  import "../chunk-BLE3V6QR.js";
7
- import "../chunk-A4WGB4ID.js";
7
+ import "../chunk-MSOQW3UL.js";
8
8
  import "../chunk-RX4VMVAI.js";
9
9
  import "../chunk-SHLPPEAY.js";
10
10
  import "../chunk-MLKGABMK.js";
@@ -1,5 +1,5 @@
1
- import { D as DatabaseType, a as DatabaseClassInstance, b as Dialect, c as DatabaseClassStatic, C as ColumnOption, d as ColumnOptionType, M as ModelAttributes, e as DatabaseReturn, V as ValidateSchema, f as MysDeviceInfoTableType, B as BaseUserInfoTableType, g as BaseGameUIDInfoTableType } from '../../mysUserInfo-CYNdwJxY.js';
2
- export { k as BindUidsItemType, h as DatabaseArray, i as MysDeviceInfoDatabaseBaseType, j as MysDeviceInfoDatabaseIdFpType, U as UidPermission } from '../../mysUserInfo-CYNdwJxY.js';
1
+ import { D as DatabaseType, a as DatabaseClassInstance, b as Dialect, c as DatabaseClassStatic, C as ColumnOption, d as ColumnOptionType, M as ModelAttributes, e as DatabaseReturn, V as ValidateSchema, f as MysDeviceInfoTableType, B as BaseUserInfoTableType, g as BaseGameUIDInfoTableType } from '../../mysUserInfo-D0yyoCGB.js';
2
+ export { k as BindUidsItemType, h as DatabaseArray, i as MysDeviceInfoDatabaseBaseType, j as MysDeviceInfoDatabaseIdFpType, U as UidPermission } from '../../mysUserInfo-D0yyoCGB.js';
3
3
  import { DataTypes, ModelAttributeColumnOptions, Model, ModelStatic } from 'sequelize';
4
4
  import { a as MysAccountInfoTableType } from '../../mysAccountInfo-B7u5Sl8f.js';
5
5
  export { M as MysAccountType } from '../../mysAccountInfo-B7u5Sl8f.js';
@@ -15,7 +15,7 @@ import {
15
15
  Table,
16
16
  UidPermission,
17
17
  createTable
18
- } from "../../chunk-A4WGB4ID.js";
18
+ } from "../../chunk-MSOQW3UL.js";
19
19
  import "../../chunk-RX4VMVAI.js";
20
20
  import "../../chunk-SHLPPEAY.js";
21
21
  import "../../chunk-MLKGABMK.js";
@@ -1,7 +1,7 @@
1
1
  import { M as MysAccountType, a as MysAccountInfoTableType } from '../../mysAccountInfo-B7u5Sl8f.js';
2
2
  import { SendMessage } from 'node-karin';
3
3
  import { AxiosRequestConfig, AxiosResponse } from 'node-karin/axios';
4
- import { i as MysDeviceInfoDatabaseBaseType, j as MysDeviceInfoDatabaseIdFpType, f as MysDeviceInfoTableType, B as BaseUserInfoTableType, e as DatabaseReturn, D as DatabaseType, h as DatabaseArray, U as UidPermission, g as BaseGameUIDInfoTableType } from '../../mysUserInfo-CYNdwJxY.js';
4
+ import { i as MysDeviceInfoDatabaseBaseType, j as MysDeviceInfoDatabaseIdFpType, f as MysDeviceInfoTableType, B as BaseUserInfoTableType, e as DatabaseReturn, D as DatabaseType, h as DatabaseArray, U as UidPermission, g as BaseGameUIDInfoTableType } from '../../mysUserInfo-D0yyoCGB.js';
5
5
  import 'sequelize';
6
6
 
7
7
  declare const MysApp: Readonly<{
@@ -15,11 +15,11 @@ import {
15
15
  getUserFullInfo,
16
16
  getUserGameRolesByCookie,
17
17
  queryQRcode
18
- } from "../../chunk-XSW4HNMM.js";
18
+ } from "../../chunk-4HJNTODO.js";
19
19
  import "../../chunk-5LRGHP36.js";
20
20
  import "../../chunk-HI6OZTI2.js";
21
21
  import "../../chunk-BLE3V6QR.js";
22
- import "../../chunk-A4WGB4ID.js";
22
+ import "../../chunk-MSOQW3UL.js";
23
23
  import "../../chunk-RX4VMVAI.js";
24
24
  import "../../chunk-SHLPPEAY.js";
25
25
  import "../../chunk-MLKGABMK.js";
@@ -106,7 +106,7 @@ interface DatabaseClassStatic {
106
106
  /** @description 数据库说明 */
107
107
  description: string;
108
108
  Column<T, K extends string>(key: K, type: keyof typeof DataTypes, def: T, option?: Partial<ModelAttributeColumnOptions<Model>>): ColumnOption<ColumnOptionType.Normal, K>;
109
- ArrayColumn<T, K extends string>(key: K, fn?: (data: DatabaseArray<T>) => T[]): ColumnOption<ColumnOptionType.Array, K>;
109
+ ArrayColumn<T, K extends string>(key: K, split: boolean, fn?: (data: DatabaseArray<T>) => T[]): ColumnOption<ColumnOptionType.Array, K>;
110
110
  JsonColumn<T extends Record<string, any>, K extends string>(key: K, def: T): ColumnOption<ColumnOptionType.Json, K>;
111
111
  }
112
112
  declare class DatabaseArray<T> extends Array<T> {
package/lib/web.config.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  DeviceCfg
4
4
  } from "./chunk-HI6OZTI2.js";
5
5
  import "./chunk-BLE3V6QR.js";
6
- import "./chunk-A4WGB4ID.js";
6
+ import "./chunk-MSOQW3UL.js";
7
7
  import "./chunk-RX4VMVAI.js";
8
8
  import {
9
9
  dir
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "karin-plugin-mys-core",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "author": "babanbang",
5
5
  "type": "module",
6
6
  "description": "karin-plugin-mys-core",