@nocobase/data-source-manager 0.20.0-alpha.1 → 0.20.0-alpha.11
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/default-actions/proxy-to-repository.js +1 -1
- package/lib/default-actions/utils.d.ts +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +37 -0
- package/package.json +7 -7
|
@@ -31,8 +31,8 @@ __export(proxy_to_repository_exports, {
|
|
|
31
31
|
proxyToRepository: () => proxyToRepository
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(proxy_to_repository_exports);
|
|
34
|
-
var import_utils = require("./utils");
|
|
35
34
|
var import_lodash = __toESM(require("lodash"));
|
|
35
|
+
var import_utils = require("./utils");
|
|
36
36
|
function proxyToRepository(paramKeys, repositoryMethod) {
|
|
37
37
|
return async function(ctx, next) {
|
|
38
38
|
const repository = (0, import_utils.getRepositoryFromParams)(ctx);
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __reExport(src_exports, require("./sequelize-data-source"), module.exports);
|
|
|
23
23
|
__reExport(src_exports, require("./load-default-actions"), module.exports);
|
|
24
24
|
__reExport(src_exports, require("./types"), module.exports);
|
|
25
25
|
__reExport(src_exports, require("./data-source-with-database"), module.exports);
|
|
26
|
+
__reExport(src_exports, require("./utils"), module.exports);
|
|
26
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
28
|
0 && (module.exports = {
|
|
28
29
|
...require("./collection-manager"),
|
|
@@ -33,5 +34,6 @@ __reExport(src_exports, require("./data-source-with-database"), module.exports);
|
|
|
33
34
|
...require("./sequelize-data-source"),
|
|
34
35
|
...require("./load-default-actions"),
|
|
35
36
|
...require("./types"),
|
|
36
|
-
...require("./data-source-with-database")
|
|
37
|
+
...require("./data-source-with-database"),
|
|
38
|
+
...require("./utils")
|
|
37
39
|
});
|
package/lib/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseCollectionName(collection: string): string[];
|
package/lib/utils.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
parseCollectionName: () => parseCollectionName
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(utils_exports);
|
|
24
|
+
function parseCollectionName(collection) {
|
|
25
|
+
if (!collection) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
const dataSourceCollection = collection.split(":");
|
|
29
|
+
const collectionName = dataSourceCollection.pop();
|
|
30
|
+
const dataSourceName = dataSourceCollection[0] ?? "main";
|
|
31
|
+
return [dataSourceName, collectionName];
|
|
32
|
+
}
|
|
33
|
+
__name(parseCollectionName, "parseCollectionName");
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
parseCollectionName
|
|
37
|
+
});
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/data-source-manager",
|
|
3
|
-
"version": "0.20.0-alpha.
|
|
3
|
+
"version": "0.20.0-alpha.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/actions": "0.20.0-alpha.
|
|
10
|
-
"@nocobase/cache": "0.20.0-alpha.
|
|
11
|
-
"@nocobase/database": "0.20.0-alpha.
|
|
12
|
-
"@nocobase/resourcer": "0.20.0-alpha.
|
|
13
|
-
"@nocobase/utils": "0.20.0-alpha.
|
|
9
|
+
"@nocobase/actions": "0.20.0-alpha.11",
|
|
10
|
+
"@nocobase/cache": "0.20.0-alpha.11",
|
|
11
|
+
"@nocobase/database": "0.20.0-alpha.11",
|
|
12
|
+
"@nocobase/resourcer": "0.20.0-alpha.11",
|
|
13
|
+
"@nocobase/utils": "0.20.0-alpha.11",
|
|
14
14
|
"@types/jsonwebtoken": "^8.5.8",
|
|
15
15
|
"jsonwebtoken": "^8.5.1"
|
|
16
16
|
},
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
20
20
|
"directory": "packages/auth"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "ed56e8464869fefbd6e263a2358fc14930c22f96"
|
|
23
23
|
}
|