@nocobase/database 1.6.24 → 1.6.25

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.
@@ -11,7 +11,7 @@ import { BaseColumnFieldOptions, Field } from './field';
11
11
  export declare class StringField extends Field {
12
12
  get dataType(): DataTypes.StringDataTypeConstructor | DataTypes.StringDataType;
13
13
  additionalSequelizeOptions(): {
14
- set(value: any): void;
14
+ set(value: any): any;
15
15
  };
16
16
  }
17
17
  export interface StringFieldOptions extends BaseColumnFieldOptions {
@@ -43,7 +43,13 @@ const _StringField = class _StringField extends import_field.Field {
43
43
  const { name, trim } = this.options;
44
44
  return {
45
45
  set(value) {
46
- this.setDataValue(name, trim ? value == null ? void 0 : value.trim() : value);
46
+ if (value == null) {
47
+ return value;
48
+ }
49
+ if (typeof value !== "string") {
50
+ value = value.toString();
51
+ }
52
+ this.setDataValue(name, trim ? value.trim() : value);
47
53
  }
48
54
  };
49
55
  }
@@ -12,7 +12,7 @@ export declare class TextField extends Field {
12
12
  get dataType(): DataTypes.TextDataTypeConstructor | DataTypes.TextDataType;
13
13
  init(): void;
14
14
  additionalSequelizeOptions(): {
15
- set(value: any): void;
15
+ set(value: any): any;
16
16
  };
17
17
  }
18
18
  export interface TextFieldOptions extends BaseColumnFieldOptions {
@@ -48,7 +48,13 @@ const _TextField = class _TextField extends import_field.Field {
48
48
  const { name, trim } = this.options;
49
49
  return {
50
50
  set(value) {
51
- this.setDataValue(name, trim ? value == null ? void 0 : value.trim() : value);
51
+ if (value == null) {
52
+ return value;
53
+ }
54
+ if (typeof value !== "string") {
55
+ value = value.toString();
56
+ }
57
+ this.setDataValue(name, trim ? value.trim() : value);
52
58
  }
53
59
  };
54
60
  }
@@ -44,7 +44,7 @@ const _ViewCollection = class _ViewCollection extends import_collection.Collecti
44
44
  if (this.options.writableView) {
45
45
  return [];
46
46
  }
47
- return ["create", "update", "destroy"];
47
+ return ["create", "update", "destroy", "importXlsx", "destroyMany", "updateMany"];
48
48
  }
49
49
  sequelizeModelOptions() {
50
50
  const modelOptions = super.sequelizeModelOptions();
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nocobase/database",
3
- "version": "1.6.24",
3
+ "version": "1.6.25",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
7
7
  "license": "AGPL-3.0",
8
8
  "dependencies": {
9
- "@nocobase/logger": "1.6.24",
10
- "@nocobase/utils": "1.6.24",
9
+ "@nocobase/logger": "1.6.25",
10
+ "@nocobase/utils": "1.6.25",
11
11
  "async-mutex": "^0.3.2",
12
12
  "chalk": "^4.1.1",
13
13
  "cron-parser": "4.4.0",
@@ -38,5 +38,5 @@
38
38
  "url": "git+https://github.com/nocobase/nocobase.git",
39
39
  "directory": "packages/database"
40
40
  },
41
- "gitHead": "d453b271bc1dedb56af2252dcb5d1a3ab9828ca1"
41
+ "gitHead": "569e5ab32f72a9876408ff2bc37fc8a2a307f237"
42
42
  }