@nocobase/data-source-manager 2.1.40 → 2.1.43

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.
@@ -11,17 +11,21 @@ import { DatabaseIntrospector } from './database-introspector/database-introspec
11
11
  import { DataSource } from './data-source';
12
12
  import { Context } from '@nocobase/actions';
13
13
  import { CollectionOptions, FieldOptions } from './types';
14
+ export type LoadedCollectionOptions = {
15
+ name: string;
16
+ fields?: FieldOptions[];
17
+ [key: string]: unknown;
18
+ };
19
+ export type LoadedCollections = Record<string, LoadedCollectionOptions>;
20
+ export type LoadTablesOptions = {
21
+ localData?: LoadedCollections;
22
+ };
14
23
  export declare abstract class DatabaseDataSource<T extends DatabaseIntrospector = DatabaseIntrospector> extends DataSource {
15
24
  introspector: T;
16
25
  createDatabaseIntrospector(db: Database): T;
17
26
  abstract readTables(): Promise<any>;
18
- abstract loadTables(ctx: Context, tables: string[]): Promise<any>;
19
- mergeWithLoadedCollections(collections: CollectionOptions[], loadedCollections: {
20
- [name: string]: {
21
- name: string;
22
- fields: FieldOptions[];
23
- };
24
- }): CollectionOptions[];
27
+ abstract loadTables(ctx: Context, tables: string[], options?: LoadTablesOptions): Promise<unknown>;
28
+ mergeWithLoadedCollections(collections: CollectionOptions[], loadedCollections: LoadedCollections): CollectionOptions[];
25
29
  private mergeFieldOptions;
26
30
  private hasCompatibleStorageType;
27
31
  private getFieldStorageType;
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@nocobase/data-source-manager",
3
- "version": "2.1.40",
3
+ "version": "2.1.43",
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": "2.1.40",
10
- "@nocobase/cache": "2.1.40",
11
- "@nocobase/database": "2.1.40",
12
- "@nocobase/resourcer": "2.1.40",
13
- "@nocobase/utils": "2.1.40",
9
+ "@nocobase/actions": "2.1.43",
10
+ "@nocobase/cache": "2.1.43",
11
+ "@nocobase/database": "2.1.43",
12
+ "@nocobase/resourcer": "2.1.43",
13
+ "@nocobase/utils": "2.1.43",
14
14
  "@types/jsonwebtoken": "^8.5.8",
15
15
  "jsonwebtoken": "^9.0.2"
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": "4099ac7037f46789c6eff98be54f20ae9fdde0e2"
22
+ "gitHead": "7b133bbdf1a7ae7e7b42514f808e6d4fdf0e4a78"
23
23
  }