@nocobase/plugin-data-source-main 1.5.0-beta.18 → 1.5.0-beta.19
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.
package/dist/externalVersion.js
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.5.0-beta.
|
|
12
|
-
"@nocobase/database": "1.5.0-beta.
|
|
13
|
-
"@nocobase/plugin-error-handler": "1.5.0-beta.
|
|
14
|
-
"@nocobase/server": "1.5.0-beta.
|
|
11
|
+
"@nocobase/client": "1.5.0-beta.19",
|
|
12
|
+
"@nocobase/database": "1.5.0-beta.19",
|
|
13
|
+
"@nocobase/plugin-error-handler": "1.5.0-beta.19",
|
|
14
|
+
"@nocobase/server": "1.5.0-beta.19",
|
|
15
15
|
"lodash": "4.17.21",
|
|
16
|
-
"@nocobase/test": "1.5.0-beta.
|
|
17
|
-
"@nocobase/utils": "1.5.0-beta.
|
|
16
|
+
"@nocobase/test": "1.5.0-beta.19",
|
|
17
|
+
"@nocobase/utils": "1.5.0-beta.19",
|
|
18
18
|
"sequelize": "6.35.2",
|
|
19
19
|
"dayjs": "1.11.10"
|
|
20
20
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Migration } from '@nocobase/server';
|
|
10
|
+
export default class extends Migration {
|
|
11
|
+
on: string;
|
|
12
|
+
up(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var update_bigint_to_unixtimestamp_exports = {};
|
|
28
|
+
__export(update_bigint_to_unixtimestamp_exports, {
|
|
29
|
+
default: () => update_bigint_to_unixtimestamp_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(update_bigint_to_unixtimestamp_exports);
|
|
32
|
+
var import_server = require("@nocobase/server");
|
|
33
|
+
/* istanbul ignore file -- @preserve */
|
|
34
|
+
class update_bigint_to_unixtimestamp_default extends import_server.Migration {
|
|
35
|
+
on = "afterLoad";
|
|
36
|
+
async up() {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
const Field = this.context.db.getRepository("fields");
|
|
39
|
+
const fields = await Field.find({
|
|
40
|
+
filter: {
|
|
41
|
+
interface: "unixTimestamp",
|
|
42
|
+
type: "bigInt"
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
for (const field of fields) {
|
|
46
|
+
const uiSchema = field.get("uiSchema");
|
|
47
|
+
uiSchema["x-component-props"] = {
|
|
48
|
+
picker: "date",
|
|
49
|
+
dateFormat: "YYYY-MM-DD",
|
|
50
|
+
timeFormat: "HH:mm:ss",
|
|
51
|
+
showTime: ((_a = uiSchema["x-component-props"]) == null ? void 0 : _a.showTime) || true,
|
|
52
|
+
accuracy: ((_b = uiSchema["x-component-props"]) == null ? void 0 : _b.accuracy) || "second"
|
|
53
|
+
};
|
|
54
|
+
field.set("type", "unixTimestamp");
|
|
55
|
+
field.set("uiSchema", uiSchema);
|
|
56
|
+
await field.save();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
package/dist/server/server.js
CHANGED
|
@@ -103,6 +103,11 @@ class PluginDataSourceMainServer extends import_server.Plugin {
|
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
105
|
this.app.db.on("collections.beforeCreate", (0, import_beforeCreateForViewCollection.beforeCreateForViewCollection)(this.db));
|
|
106
|
+
this.app.db.on("collections.beforeCreate", async (model, options) => {
|
|
107
|
+
if (this.app.db.getCollection(model.get("name")) && model.get("from") !== "db2cm" && !model.get("isThrough")) {
|
|
108
|
+
throw new Error(`Collection named ${model.get("name")} already exists`);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
106
111
|
this.app.db.on(
|
|
107
112
|
"collections.afterSaveWithAssociations",
|
|
108
113
|
async (model, { context, transaction }) => {
|
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.
|
|
7
|
+
"version": "1.5.0-beta.19",
|
|
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": "
|
|
25
|
+
"gitHead": "a564836d60b070f0ba1fcc0fb6a2a5c647675e13",
|
|
26
26
|
"keywords": [
|
|
27
27
|
"Data sources"
|
|
28
28
|
]
|