@nocobase/data-source-manager 2.1.37 → 2.1.39

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.
@@ -6,6 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import type { TargetKey } from '@nocobase/database';
9
10
  import { DataSource } from './data-source';
10
11
  import { CollectionOptions, ICollection, ICollectionManager, IField, IFieldInterface, IRepository, MergeOptions } from './types';
11
12
  export declare class CollectionManager implements ICollectionManager {
@@ -34,7 +35,7 @@ export declare class CollectionManager implements ICollectionManager {
34
35
  hasCollection(name: string): boolean;
35
36
  getCollection(name: string): ICollection;
36
37
  getCollections(): Array<ICollection>;
37
- getRepository(name: string, sourceId?: string | number): IRepository;
38
+ getRepository(name: string, sourceId?: TargetKey): IRepository;
38
39
  sync(): Promise<void>;
39
40
  removeCollection(name: string): void;
40
41
  protected newCollection(options: any): ICollection;
@@ -7,6 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { Database } from '@nocobase/database';
10
+ import type { TargetKey } from '@nocobase/database';
10
11
  import { DataSource } from './data-source';
11
12
  import { CollectionOptions, ICollection, ICollectionManager, IField, IFieldInterface, IRepository, MergeOptions } from './types';
12
13
  export declare class SequelizeCollectionManager implements ICollectionManager {
@@ -29,7 +30,7 @@ export declare class SequelizeCollectionManager implements ICollectionManager {
29
30
  getCollection(name: string): import("@nocobase/database").Collection<any, any>;
30
31
  removeCollection(name: string): import("@nocobase/database").Collection<any, any>;
31
32
  getCollections(): import("@nocobase/database").Collection<any, any>[];
32
- getRepository<R = IRepository>(name: string, sourceId?: string | number): R;
33
+ getRepository<R = IRepository>(name: string, sourceId?: TargetKey): R;
33
34
  sync(): Promise<void>;
34
35
  registerFieldInterface(name: string, fieldInterface: new (options: any) => IFieldInterface): void;
35
36
  getFieldInterface(name: string): {
package/lib/types.d.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import type { TargetKey } from '@nocobase/database';
9
10
  import { DataSource } from './data-source';
10
11
  export type DataSourceConstructor<T extends DataSource = DataSource> = Omit<typeof DataSource, 'prototype'> & {
11
12
  new (...args: any[]): T;
@@ -113,6 +114,6 @@ export interface ICollectionManager {
113
114
  getCollection(name: string): ICollection;
114
115
  getCollections(): Array<ICollection>;
115
116
  removeCollection(name: string): void;
116
- getRepository(name: string, sourceId?: string | number): IRepository;
117
+ getRepository(name: string, sourceId?: TargetKey): IRepository;
117
118
  sync(): Promise<void>;
118
119
  }
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@nocobase/data-source-manager",
3
- "version": "2.1.37",
3
+ "version": "2.1.39",
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.37",
10
- "@nocobase/cache": "2.1.37",
11
- "@nocobase/database": "2.1.37",
12
- "@nocobase/resourcer": "2.1.37",
13
- "@nocobase/utils": "2.1.37",
9
+ "@nocobase/actions": "2.1.39",
10
+ "@nocobase/cache": "2.1.39",
11
+ "@nocobase/database": "2.1.39",
12
+ "@nocobase/resourcer": "2.1.39",
13
+ "@nocobase/utils": "2.1.39",
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": "a0c3201363ae028058845af0176ee902a9eeb3e1"
22
+ "gitHead": "ddbf88ac2a5de1ad94ff4779618cdf1b81aae037"
23
23
  }