@tachybase/module-collection 1.6.46 → 1.6.47
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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"node-sql-parser","version":"5.3.10","description":"simple node sql parser","main":"index.js","types":"types.d.ts","scripts":{"start":"webpack --config webpack.config.js","build":"npm run lint && npm run compile && webpack --config webpack.config.js --mode production","test":"npm run lint && mochapack --reporter-option maxDiffSize=1000000 \"test/**/*.spec.js\"","lint":"eslint src","compile":"babel src -d lib","coverLocal":"cross-env NODE_ENV=coverage nyc --reporter=lcov --reporter=text npm run test","cover:run":"cross-env NODE_ENV=coverage nyc --reporter=text-lcov npm run test","cover":"npm run cover:run && nyc report --reporter=text-lcov | coveralls","release":"npm run build && npm publish output/prod"},"repository":{"type":"git","url":"git+https://github.com/taozhi8833998/node-sql-parser.git"},"pre-commit":"coverLocal","keywords":["sql","sql-parser","parser","node","nodejs","node-parser","node-sql-parser","ast","sql-ast"],"author":"taozhi8833998 <taozhi8833998@163.com>","files":["ast/","build","lib","umd/","index.d.ts","index.js","index.js.map","LICENSE","package.json","README.md","types.d.ts"],"license":"Apache-2.0","bugs":{"url":"https://github.com/taozhi8833998/node-sql-parser/issues"},"homepage":"https://github.com/taozhi8833998/node-sql-parser#readme","engines":{"node":">=8"},"devDependencies":{"@babel/cli":"^7.5.5","@babel/core":"^7.10.5","@babel/plugin-proposal-object-rest-spread":"^7.5.5","@babel/preset-env":"^7.10.4","@babel/register":"^7.10.5","@types/chai":"^4.1.7","@types/mocha":"^10.0.1","babel-loader":"^8.1.0","browserify":"^17.0.0","chai":"^4.4.1","copy-webpack-plugin":"^6.0.3","coveralls":"^3.0.13","cross-env":"^7.0.2","eslint":"^8.3.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-strict":"^14.0.1","eslint-plugin-filenames":"^1.3.2","eslint-plugin-import":"^2.16.0","filemanager-webpack-plugin":"^3.1.1","istanbul-instrumenter-loader":"^3.0.1","mocha":"^10.0.0","mochapack":"^2.0.3","nyc":"15.1.0","pegjs":"^0.10.0","pegjs-loader":"^0.5.6","pre-commit":"^1.2.2","rimraf":"^5.0.1","source-map-support":"^0.5.19","tinyify":"^4.0.0","vscode-mocha-hmr":"^1.0.0","webpack":"^4.43.0","webpack-cli":"^4.7.0","webpack-node-externals":"^3.0.0"},"nyc":{"include":["src/**/*.js"],"instrument":false,"sourceMap":false},"dependencies":{"@types/pegjs":"^0.10.0","big-integer":"^1.6.48"},"_lastModified":"2026-08-
|
|
1
|
+
{"name":"node-sql-parser","version":"5.3.10","description":"simple node sql parser","main":"index.js","types":"types.d.ts","scripts":{"start":"webpack --config webpack.config.js","build":"npm run lint && npm run compile && webpack --config webpack.config.js --mode production","test":"npm run lint && mochapack --reporter-option maxDiffSize=1000000 \"test/**/*.spec.js\"","lint":"eslint src","compile":"babel src -d lib","coverLocal":"cross-env NODE_ENV=coverage nyc --reporter=lcov --reporter=text npm run test","cover:run":"cross-env NODE_ENV=coverage nyc --reporter=text-lcov npm run test","cover":"npm run cover:run && nyc report --reporter=text-lcov | coveralls","release":"npm run build && npm publish output/prod"},"repository":{"type":"git","url":"git+https://github.com/taozhi8833998/node-sql-parser.git"},"pre-commit":"coverLocal","keywords":["sql","sql-parser","parser","node","nodejs","node-parser","node-sql-parser","ast","sql-ast"],"author":"taozhi8833998 <taozhi8833998@163.com>","files":["ast/","build","lib","umd/","index.d.ts","index.js","index.js.map","LICENSE","package.json","README.md","types.d.ts"],"license":"Apache-2.0","bugs":{"url":"https://github.com/taozhi8833998/node-sql-parser/issues"},"homepage":"https://github.com/taozhi8833998/node-sql-parser#readme","engines":{"node":">=8"},"devDependencies":{"@babel/cli":"^7.5.5","@babel/core":"^7.10.5","@babel/plugin-proposal-object-rest-spread":"^7.5.5","@babel/preset-env":"^7.10.4","@babel/register":"^7.10.5","@types/chai":"^4.1.7","@types/mocha":"^10.0.1","babel-loader":"^8.1.0","browserify":"^17.0.0","chai":"^4.4.1","copy-webpack-plugin":"^6.0.3","coveralls":"^3.0.13","cross-env":"^7.0.2","eslint":"^8.3.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-strict":"^14.0.1","eslint-plugin-filenames":"^1.3.2","eslint-plugin-import":"^2.16.0","filemanager-webpack-plugin":"^3.1.1","istanbul-instrumenter-loader":"^3.0.1","mocha":"^10.0.0","mochapack":"^2.0.3","nyc":"15.1.0","pegjs":"^0.10.0","pegjs-loader":"^0.5.6","pre-commit":"^1.2.2","rimraf":"^5.0.1","source-map-support":"^0.5.19","tinyify":"^4.0.0","vscode-mocha-hmr":"^1.0.0","webpack":"^4.43.0","webpack-cli":"^4.7.0","webpack-node-externals":"^3.0.0"},"nyc":{"include":["src/**/*.js"],"instrument":false,"sourceMap":false},"dependencies":{"@types/pegjs":"^0.10.0","big-integer":"^1.6.48"},"_lastModified":"2026-08-26T11:52:34.215Z"}
|
|
@@ -9,6 +9,7 @@ export declare class CollectionModel extends MagicAttributeModel {
|
|
|
9
9
|
get db(): Database;
|
|
10
10
|
toJSON(): any;
|
|
11
11
|
load(loadOptions?: LoadOptions): Promise<Collection<any, any>>;
|
|
12
|
+
loadRuntimeOptions(): Collection<any, any>;
|
|
12
13
|
loadFields(options?: Transactionable & {
|
|
13
14
|
skipField?: Array<string>;
|
|
14
15
|
includeFields?: Array<string>;
|
|
@@ -32,6 +32,9 @@ __export(collection_exports, {
|
|
|
32
32
|
module.exports = __toCommonJS(collection_exports);
|
|
33
33
|
var import_server = require("@tego/server");
|
|
34
34
|
var import_lodash = __toESM(require("lodash"));
|
|
35
|
+
const collectionOptionsMerge = {
|
|
36
|
+
arrayMerge: (_destination, source) => source
|
|
37
|
+
};
|
|
35
38
|
class CollectionModel extends import_server.MagicAttributeModel {
|
|
36
39
|
get db() {
|
|
37
40
|
return this.constructor.database;
|
|
@@ -65,7 +68,7 @@ class CollectionModel extends import_server.MagicAttributeModel {
|
|
|
65
68
|
if (resetFields) {
|
|
66
69
|
collection.resetFields();
|
|
67
70
|
}
|
|
68
|
-
collection.updateOptions(collectionOptions);
|
|
71
|
+
collection.updateOptions(collectionOptions, collectionOptionsMerge);
|
|
69
72
|
} else {
|
|
70
73
|
if (!collectionOptions.dumpRules) {
|
|
71
74
|
import_lodash.default.set(collectionOptions, "dumpRules.group", "custom");
|
|
@@ -84,6 +87,24 @@ class CollectionModel extends import_server.MagicAttributeModel {
|
|
|
84
87
|
});
|
|
85
88
|
return collection;
|
|
86
89
|
}
|
|
90
|
+
loadRuntimeOptions() {
|
|
91
|
+
const name = this.get("name");
|
|
92
|
+
const collection = this.db.getCollection(name);
|
|
93
|
+
if (!collection) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const collectionOptions = {
|
|
97
|
+
origin: "@tachybase/module-collection",
|
|
98
|
+
...import_lodash.default.omit(this.get(), ["fields"]),
|
|
99
|
+
name,
|
|
100
|
+
loadedFromCollectionManager: true
|
|
101
|
+
};
|
|
102
|
+
if (!this.db.inDialect("postgres") && collectionOptions.schema) {
|
|
103
|
+
delete collectionOptions.schema;
|
|
104
|
+
}
|
|
105
|
+
collection.updateOptions(collectionOptions, collectionOptionsMerge);
|
|
106
|
+
return collection;
|
|
107
|
+
}
|
|
87
108
|
async loadFields(options = {}) {
|
|
88
109
|
let fields = this.get("fields") || [];
|
|
89
110
|
if (!fields.length) {
|
package/dist/server/server.js
CHANGED
|
@@ -79,6 +79,15 @@ class CollectionManagerPlugin extends import_server.Plugin {
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
this.app.db.on("collections.beforeCreate", (0, import_beforeCreateForViewCollection.beforeCreateForViewCollection)(this.db));
|
|
82
|
+
this.app.db.on("collections.afterUpdate", (model, { transaction }) => {
|
|
83
|
+
if (transaction) {
|
|
84
|
+
transaction.afterCommit(() => {
|
|
85
|
+
model.loadRuntimeOptions();
|
|
86
|
+
});
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
model.loadRuntimeOptions();
|
|
90
|
+
});
|
|
82
91
|
this.app.db.on(
|
|
83
92
|
"collections.afterCreateWithAssociations",
|
|
84
93
|
async (model, { context, transaction }) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/module-collection",
|
|
3
3
|
"displayName": "Data source: Main",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.47",
|
|
5
5
|
"description": "TachyBase main database, supports relational databases such as MySQL, PostgreSQL, SQLite and so on.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Data sources"
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"lodash": "4.17.21",
|
|
31
31
|
"sequelize": "6.37.5",
|
|
32
32
|
"toposort": "^2.0.2",
|
|
33
|
-
"@tachybase/client": "1.6.
|
|
34
|
-
"@tachybase/module-error-handler": "1.6.
|
|
33
|
+
"@tachybase/client": "1.6.47",
|
|
34
|
+
"@tachybase/module-error-handler": "1.6.47"
|
|
35
35
|
},
|
|
36
36
|
"description.zh-CN": "TachyBase 主数据库,支持 MySQL、PostgreSQL、SQLite 等关系型数据库。",
|
|
37
37
|
"displayName.zh-CN": "数据源:主数据库",
|