@nocobase/data-source-manager 0.21.0-alpha.10 → 0.21.0-alpha.12

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.
@@ -9,6 +9,7 @@ export declare class DataSourceManager {
9
9
  onceHooks: Array<DataSourceHook>;
10
10
  protected middlewares: any[];
11
11
  constructor(options?: {});
12
+ get(dataSourceKey: string): DataSource;
12
13
  add(dataSource: DataSource, options?: any): Promise<void>;
13
14
  use(fn: any, options?: ToposortOptions): void;
14
15
  middleware(): (ctx: any, next: any) => Promise<any>;
@@ -32,6 +32,9 @@ const _DataSourceManager = class _DataSourceManager {
32
32
  factory = new import_data_source_factory.DataSourceFactory();
33
33
  onceHooks = [];
34
34
  middlewares = [];
35
+ get(dataSourceKey) {
36
+ return this.dataSources.get(dataSourceKey);
37
+ }
35
38
  async add(dataSource, options = {}) {
36
39
  await dataSource.load(options);
37
40
  this.dataSources.set(dataSource.name, dataSource);
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@nocobase/data-source-manager",
3
- "version": "0.21.0-alpha.10",
3
+ "version": "0.21.0-alpha.12",
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.21.0-alpha.10",
10
- "@nocobase/cache": "0.21.0-alpha.10",
11
- "@nocobase/database": "0.21.0-alpha.10",
12
- "@nocobase/resourcer": "0.21.0-alpha.10",
13
- "@nocobase/utils": "0.21.0-alpha.10",
9
+ "@nocobase/actions": "0.21.0-alpha.12",
10
+ "@nocobase/cache": "0.21.0-alpha.12",
11
+ "@nocobase/database": "0.21.0-alpha.12",
12
+ "@nocobase/resourcer": "0.21.0-alpha.12",
13
+ "@nocobase/utils": "0.21.0-alpha.12",
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": "98adf5ec996a4f359c6ca1c4a6ac837c43b6e268"
22
+ "gitHead": "dd6229634ae442894b0f0666a00ba4a3888b8985"
23
23
  }