@nocobase/plugin-data-source-main 1.5.0-beta.17 → 1.5.0-beta.18

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.
@@ -8,13 +8,13 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.5.0-beta.17",
12
- "@nocobase/database": "1.5.0-beta.17",
13
- "@nocobase/plugin-error-handler": "1.5.0-beta.17",
14
- "@nocobase/server": "1.5.0-beta.17",
11
+ "@nocobase/client": "1.5.0-beta.18",
12
+ "@nocobase/database": "1.5.0-beta.18",
13
+ "@nocobase/plugin-error-handler": "1.5.0-beta.18",
14
+ "@nocobase/server": "1.5.0-beta.18",
15
15
  "lodash": "4.17.21",
16
- "@nocobase/test": "1.5.0-beta.17",
17
- "@nocobase/utils": "1.5.0-beta.17",
16
+ "@nocobase/test": "1.5.0-beta.18",
17
+ "@nocobase/utils": "1.5.0-beta.18",
18
18
  "sequelize": "6.35.2",
19
19
  "dayjs": "1.11.10"
20
20
  };
@@ -22,5 +22,6 @@ export declare class FieldModel extends MagicAttributeModel {
22
22
  }): Promise<void>;
23
23
  syncReferenceCheckOption(options: Transactionable): Promise<void>;
24
24
  protected getFieldCollection(): Collection | null;
25
+ toJSON(): any;
25
26
  }
26
27
  export {};
@@ -7,9 +7,11 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
+ var __create = Object.create;
10
11
  var __defProp = Object.defineProperty;
11
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
13
  var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
13
15
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
16
  var __export = (target, all) => {
15
17
  for (var name in all)
@@ -23,6 +25,14 @@ var __copyProps = (to, from, except, desc) => {
23
25
  }
24
26
  return to;
25
27
  };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
26
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
37
  var field_exports = {};
28
38
  __export(field_exports, {
@@ -30,6 +40,7 @@ __export(field_exports, {
30
40
  });
31
41
  module.exports = __toCommonJS(field_exports);
32
42
  var import_database = require("@nocobase/database");
43
+ var import_lodash = __toESM(require("lodash"));
33
44
  class FieldModel extends import_database.MagicAttributeModel {
34
45
  get db() {
35
46
  return this.constructor.database;
@@ -48,7 +59,7 @@ class FieldModel extends import_database.MagicAttributeModel {
48
59
  if (skipExist && collection.hasField(name)) {
49
60
  return collection.getField(name);
50
61
  }
51
- const options = this.get();
62
+ const options = this.toJSON();
52
63
  const field = await (async () => {
53
64
  await new Promise((resolve) => setTimeout(resolve, 0));
54
65
  return collection.setField(name, options);
@@ -169,6 +180,13 @@ class FieldModel extends import_database.MagicAttributeModel {
169
180
  }
170
181
  return this.db.getCollection(collectionName);
171
182
  }
183
+ toJSON() {
184
+ const json = super.toJSON();
185
+ if (json.interface === "unixTimestamp" && json.accuracy) {
186
+ import_lodash.default.set(json, "uiSchema.x-component-props.accuracy", json.accuracy);
187
+ }
188
+ return json;
189
+ }
172
190
  }
173
191
  // Annotate the CommonJS export names for ESM import in node:
174
192
  0 && (module.exports = {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "数据源:主数据库",
5
5
  "description": "NocoBase main database, supports relational databases such as PostgreSQL, MySQL, MariaDB and so on.",
6
6
  "description.zh-CN": "NocoBase 主数据库,支持 PostgreSQL、MySQL、MariaDB 等关系型数据库。",
7
- "version": "1.5.0-beta.17",
7
+ "version": "1.5.0-beta.18",
8
8
  "main": "./dist/server/index.js",
9
9
  "homepage": "https://docs.nocobase.com/handbook/data-source-main",
10
10
  "homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/data-source-main",
@@ -22,7 +22,7 @@
22
22
  "@nocobase/test": "1.x",
23
23
  "@nocobase/utils": "1.x"
24
24
  },
25
- "gitHead": "5de21d251f1c40b9f8bf43c255e023293da7a639",
25
+ "gitHead": "36d954cdb922f1d6a086ef9a371b94a47bfad3f2",
26
26
  "keywords": [
27
27
  "Data sources"
28
28
  ]