@tachybase/data-source 0.23.41 → 0.23.48
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/lib/collection-field.js +0 -1
- package/lib/collection-manager.js +3 -3
- package/lib/collection.js +1 -2
- package/lib/data-source-factory.js +3 -1
- package/lib/data-source-manager.js +2 -3
- package/lib/data-source.js +0 -3
- package/lib/sequelize-collection-manager.js +0 -2
- package/package.json +7 -7
package/lib/collection-field.js
CHANGED
|
@@ -23,10 +23,10 @@ __export(collection_manager_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(collection_manager_exports);
|
|
24
24
|
var import_collection = require("./collection");
|
|
25
25
|
const _CollectionManager = class _CollectionManager {
|
|
26
|
-
collections = /* @__PURE__ */ new Map();
|
|
27
|
-
repositories = /* @__PURE__ */ new Map();
|
|
28
|
-
models = /* @__PURE__ */ new Map();
|
|
29
26
|
constructor(options = {}) {
|
|
27
|
+
this.collections = /* @__PURE__ */ new Map();
|
|
28
|
+
this.repositories = /* @__PURE__ */ new Map();
|
|
29
|
+
this.models = /* @__PURE__ */ new Map();
|
|
30
30
|
}
|
|
31
31
|
getRegisteredFieldType(type) {
|
|
32
32
|
}
|
package/lib/collection.js
CHANGED
|
@@ -38,6 +38,7 @@ const _Collection = class _Collection {
|
|
|
38
38
|
constructor(options, collectionManager) {
|
|
39
39
|
this.options = options;
|
|
40
40
|
this.collectionManager = collectionManager;
|
|
41
|
+
this.fields = /* @__PURE__ */ new Map();
|
|
41
42
|
this.setRepository(options.repository);
|
|
42
43
|
if (options.fields) {
|
|
43
44
|
for (const field of options.fields) {
|
|
@@ -45,8 +46,6 @@ const _Collection = class _Collection {
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
repository;
|
|
49
|
-
fields = /* @__PURE__ */ new Map();
|
|
50
49
|
updateOptions(options, mergeOptions) {
|
|
51
50
|
let newOptions = import_lodash.default.cloneDeep(options);
|
|
52
51
|
newOptions = (0, import_deepmerge.default)(this.options, newOptions, mergeOptions);
|
|
@@ -22,7 +22,9 @@ __export(data_source_factory_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(data_source_factory_exports);
|
|
24
24
|
const _DataSourceFactory = class _DataSourceFactory {
|
|
25
|
-
|
|
25
|
+
constructor() {
|
|
26
|
+
this.collectionTypes = /* @__PURE__ */ new Map();
|
|
27
|
+
}
|
|
26
28
|
register(type, dataSourceClass) {
|
|
27
29
|
this.collectionTypes.set(type, dataSourceClass);
|
|
28
30
|
}
|
|
@@ -25,12 +25,11 @@ var import_data_source_factory = require("./data-source-factory");
|
|
|
25
25
|
const _DataSourceManager = class _DataSourceManager {
|
|
26
26
|
constructor(options = {}) {
|
|
27
27
|
this.options = options;
|
|
28
|
+
this.factory = new import_data_source_factory.DataSourceFactory();
|
|
29
|
+
this.middlewares = [];
|
|
28
30
|
this.dataSources = /* @__PURE__ */ new Map();
|
|
29
31
|
this.middlewares = [];
|
|
30
32
|
}
|
|
31
|
-
dataSources;
|
|
32
|
-
factory = new import_data_source_factory.DataSourceFactory();
|
|
33
|
-
middlewares = [];
|
|
34
33
|
async add(dataSource, options = {}) {
|
|
35
34
|
await dataSource.load(options);
|
|
36
35
|
this.dataSources.set(dataSource.name, dataSource);
|
package/lib/data-source.js
CHANGED
|
@@ -33,8 +33,6 @@ __export(sequelize_collection_manager_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(sequelize_collection_manager_exports);
|
|
34
34
|
var import_database = __toESM(require("@tachybase/database"));
|
|
35
35
|
const _SequelizeCollectionManager = class _SequelizeCollectionManager {
|
|
36
|
-
db;
|
|
37
|
-
options;
|
|
38
36
|
constructor(options) {
|
|
39
37
|
this.db = this.createDB(options);
|
|
40
38
|
this.options = options;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/data-source",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.48",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"jsonwebtoken": "^8.5.1",
|
|
12
12
|
"koa-compose": "^4.1.0",
|
|
13
13
|
"lodash": "4.17.21",
|
|
14
|
-
"@tachybase/acl": "0.23.
|
|
15
|
-
"@tachybase/
|
|
16
|
-
"@tachybase/
|
|
17
|
-
"@tachybase/
|
|
18
|
-
"@tachybase/
|
|
19
|
-
"@tachybase/
|
|
14
|
+
"@tachybase/acl": "0.23.48",
|
|
15
|
+
"@tachybase/database": "0.23.48",
|
|
16
|
+
"@tachybase/resourcer": "0.23.48",
|
|
17
|
+
"@tachybase/utils": "0.23.48",
|
|
18
|
+
"@tachybase/cache": "0.23.48",
|
|
19
|
+
"@tachybase/actions": "0.23.48"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/koa": "^2.15.0",
|