@nocobase/plugin-data-source-manager 0.21.0-alpha.9 → 1.0.0-alpha.10
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/dist/client/DatabaseConnectionProvider.d.ts +8 -0
- package/dist/client/ThridDataSource.d.ts +8 -0
- package/dist/client/component/BreadcumbTitle.d.ts +8 -0
- package/dist/client/component/CollectionsManager/AddFieldAction.d.ts +8 -0
- package/dist/client/component/CollectionsManager/CollectionFields.d.ts +8 -0
- package/dist/client/component/CollectionsManager/ConfigurationTable.d.ts +8 -0
- package/dist/client/component/CollectionsManager/ConfigurationTabs.d.ts +8 -0
- package/dist/client/component/CollectionsManager/EditCollectionAction.d.ts +8 -0
- package/dist/client/component/CollectionsManager/EditFieldAction.d.ts +8 -0
- package/dist/client/component/CollectionsManager/components/CollectionFieldInterfaceSelect.d.ts +8 -0
- package/dist/client/component/CollectionsManager/components/CollectionName.d.ts +8 -0
- package/dist/client/component/CollectionsManager/components/FieldTitleInput.d.ts +8 -0
- package/dist/client/component/CollectionsManager/components/FieldType.d.ts +8 -0
- package/dist/client/component/CollectionsManager/components/TitleField.d.ts +8 -0
- package/dist/client/component/CollectionsManager/components/UnSupportFields.d.ts +8 -0
- package/dist/client/component/CollectionsManager/components/index.d.ts +8 -0
- package/dist/client/component/CollectionsManager/hooks.d.ts +8 -0
- package/dist/client/component/CollectionsManager/index.d.ts +8 -0
- package/dist/client/component/CollectionsManager/schema/collectionFields.d.ts +8 -0
- package/dist/client/component/CollectionsManager/schema/collections.d.ts +8 -0
- package/dist/client/component/CreateDatabaseConnectAction.d.ts +8 -0
- package/dist/client/component/DatabaseConnectionManager.d.ts +8 -0
- package/dist/client/component/EditDatabaseConnectionAction.d.ts +8 -0
- package/dist/client/component/MainDataSourceManager/Configuration/AddCategoryAction.d.ts +8 -0
- package/dist/client/component/MainDataSourceManager/Configuration/CollectionFields.d.ts +8 -0
- package/dist/client/component/MainDataSourceManager/Configuration/ConfigurationTable.d.ts +8 -0
- package/dist/client/component/MainDataSourceManager/Configuration/ConfigurationTabs.d.ts +8 -0
- package/dist/client/component/MainDataSourceManager/Configuration/EditCategoryAction.d.ts +8 -0
- package/dist/client/component/MainDataSourceManager/Configuration/index.d.ts +8 -0
- package/dist/client/component/MainDataSourceManager/Configuration/interfaces.d.ts +8 -0
- package/dist/client/component/MainDataSourceManager/Configuration/schemas/collectionFields.d.ts +8 -0
- package/dist/client/component/MainDataSourceManager/Configuration/schemas/collections.d.ts +8 -0
- package/dist/client/component/MainDataSourceManager/index.d.ts +8 -0
- package/dist/client/component/PermissionManager/DataSourceTable.d.ts +8 -0
- package/dist/client/component/PermissionManager/PermisionProvider.d.ts +8 -0
- package/dist/client/component/PermissionManager/RoleConfigure.d.ts +8 -0
- package/dist/client/component/PermissionManager/RolesResourcesActions.d.ts +8 -0
- package/dist/client/component/PermissionManager/ScopeSelect.d.ts +8 -0
- package/dist/client/component/PermissionManager/StrategyActions.d.ts +8 -0
- package/dist/client/component/PermissionManager/index.d.ts +8 -0
- package/dist/client/component/PermissionManager/schemas/dataSourceTable.d.ts +8 -0
- package/dist/client/component/PermissionManager/schemas/roleCollections.d.ts +8 -0
- package/dist/client/component/PermissionManager/schemas/scopes.d.ts +8 -0
- package/dist/client/component/PermissionManager/schemas/useRoleResourceValues.d.ts +8 -0
- package/dist/client/component/PermissionManager/schemas/useSaveRoleResourceAction.d.ts +8 -0
- package/dist/client/component/PermissionManager/style.d.ts +8 -0
- package/dist/client/component/ViewDatabaseConnectionAction.d.ts +8 -0
- package/dist/client/constant.d.ts +8 -0
- package/dist/client/hooks/index.d.ts +8 -0
- package/dist/client/index.d.ts +8 -0
- package/dist/client/index.js +20 -11
- package/dist/client/locale/index.d.ts +8 -0
- package/dist/client/schema/index.d.ts +8 -0
- package/dist/externalVersion.js +15 -6
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/server/collections/data-sources-collections.d.ts +8 -0
- package/dist/server/collections/data-sources-collections.js +9 -0
- package/dist/server/collections/data-sources-fields.d.ts +8 -0
- package/dist/server/collections/data-sources-fields.js +9 -0
- package/dist/server/collections/data-sources-roles-resources-actions.d.ts +8 -0
- package/dist/server/collections/data-sources-roles-resources-actions.js +9 -0
- package/dist/server/collections/data-sources-roles-resources-scopes.d.ts +8 -0
- package/dist/server/collections/data-sources-roles-resources-scopes.js +9 -0
- package/dist/server/collections/data-sources-roles-resources.d.ts +8 -0
- package/dist/server/collections/data-sources-roles-resources.js +9 -0
- package/dist/server/collections/data-sources-roles.d.ts +8 -0
- package/dist/server/collections/data-sources-roles.js +9 -0
- package/dist/server/collections/data-sources.d.ts +8 -0
- package/dist/server/collections/data-sources.js +9 -0
- package/dist/server/errors/type-infer-error.d.ts +8 -0
- package/dist/server/errors/type-infer-error.js +9 -0
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.js +9 -0
- package/dist/server/migrations/20240301164024-migrate-acl-resources.d.ts +8 -0
- package/dist/server/migrations/20240301164024-migrate-acl-resources.js +10 -0
- package/dist/server/migrations/20240414103927-update-snippet-name.d.ts +8 -0
- package/dist/server/migrations/20240414103927-update-snippet-name.js +9 -0
- package/dist/server/models/connections-roles-resources-action.d.ts +8 -0
- package/dist/server/models/connections-roles-resources-action.js +9 -0
- package/dist/server/models/connections-roles-resources.d.ts +8 -0
- package/dist/server/models/connections-roles-resources.js +9 -0
- package/dist/server/models/data-source.d.ts +8 -0
- package/dist/server/models/data-source.js +11 -4
- package/dist/server/models/data-sources-collection-model.d.ts +8 -0
- package/dist/server/models/data-sources-collection-model.js +9 -0
- package/dist/server/models/data-sources-field-model.d.ts +8 -0
- package/dist/server/models/data-sources-field-model.js +9 -0
- package/dist/server/models/data-sources-roles-model.d.ts +8 -2
- package/dist/server/models/data-sources-roles-model.js +10 -3
- package/dist/server/plugin.d.ts +8 -0
- package/dist/server/plugin.js +34 -31
- package/dist/server/resourcers/data-sources-collections-fields.d.ts +8 -0
- package/dist/server/resourcers/data-sources-collections-fields.js +9 -0
- package/dist/server/resourcers/data-sources-collections.d.ts +8 -0
- package/dist/server/resourcers/data-sources-collections.js +9 -0
- package/dist/server/resourcers/data-sources-resources.d.ts +8 -0
- package/dist/server/resourcers/data-sources-resources.js +9 -0
- package/dist/server/resourcers/data-sources-roles.d.ts +8 -0
- package/dist/server/resourcers/data-sources-roles.js +9 -0
- package/dist/server/resourcers/roles-data-sources-collections.d.ts +8 -0
- package/dist/server/resourcers/roles-data-sources-collections.js +9 -0
- package/dist/server/services/full-data-repository.d.ts +8 -0
- package/dist/server/services/full-data-repository.js +9 -0
- package/dist/server/services/type-interface-map.d.ts +8 -0
- package/dist/server/services/type-interface-map.js +10 -0
- package/dist/server/utils.d.ts +8 -0
- package/dist/server/utils.js +9 -0
- package/package.json +5 -5
- package/dist/server/services/collection-manager.d.ts +0 -6
- package/dist/server/services/collection-manager.js +0 -33
- package/dist/server/services/database-introspector.d.ts +0 -70
- package/dist/server/services/database-introspector.js +0 -235
package/dist/server/plugin.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
var __create = Object.create;
|
|
2
11
|
var __defProp = Object.defineProperty;
|
|
3
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -303,31 +312,31 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
|
303
312
|
this.app.setMaintainingMessage("Loading data sources...");
|
|
304
313
|
await Promise.all(loadPromises);
|
|
305
314
|
});
|
|
306
|
-
this.app.db.on(
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
this.app.db.on(
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
transaction
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
|
|
315
|
+
this.app.db.on(
|
|
316
|
+
"dataSourcesRolesResources.afterSaveWithAssociations",
|
|
317
|
+
async (model, options) => {
|
|
318
|
+
const { transaction } = options;
|
|
319
|
+
const dataSource = this.app.dataSourceManager.dataSources.get(model.get("dataSourceKey"));
|
|
320
|
+
await model.writeToACL({
|
|
321
|
+
acl: dataSource.acl,
|
|
322
|
+
transaction
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
this.app.db.on(
|
|
327
|
+
"dataSourcesRolesResourcesActions.afterUpdateWithAssociations",
|
|
328
|
+
async (model, options) => {
|
|
329
|
+
const { transaction } = options;
|
|
330
|
+
const resource = await model.getResource({
|
|
331
|
+
transaction
|
|
332
|
+
});
|
|
333
|
+
const dataSource = this.app.dataSourceManager.dataSources.get(resource.get("dataSourceKey"));
|
|
334
|
+
await resource.writeToACL({
|
|
335
|
+
acl: dataSource.acl,
|
|
336
|
+
transaction
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
);
|
|
331
340
|
this.app.db.on("dataSourcesRolesResources.afterDestroy", async (model, options) => {
|
|
332
341
|
const dataSource = this.app.dataSourceManager.dataSources.get(model.get("dataSourceKey"));
|
|
333
342
|
const roleName = model.get("roleName");
|
|
@@ -338,11 +347,8 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
|
338
347
|
});
|
|
339
348
|
this.app.db.on("dataSourcesRoles.afterSave", async (model, options) => {
|
|
340
349
|
const { transaction } = options;
|
|
341
|
-
const pluginACL = this.app.pm.get("acl");
|
|
342
350
|
const dataSource = this.app.dataSourceManager.dataSources.get(model.get("dataSourceKey"));
|
|
343
351
|
await model.writeToAcl({
|
|
344
|
-
grantHelper: pluginACL.grantHelper,
|
|
345
|
-
associationFieldsActions: pluginACL.associationFieldsActions,
|
|
346
352
|
acl: dataSource.acl,
|
|
347
353
|
transaction
|
|
348
354
|
});
|
|
@@ -359,7 +365,6 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
|
359
365
|
});
|
|
360
366
|
this.app.on("acl:writeResources", async ({ roleName, transaction }) => {
|
|
361
367
|
const dataSource = this.app.dataSourceManager.dataSources.get("main");
|
|
362
|
-
const pluginACL = this.app.pm.get("acl");
|
|
363
368
|
const dataSourceRole = await this.app.db.getRepository("dataSourcesRoles").findOne({
|
|
364
369
|
filter: {
|
|
365
370
|
dataSourceKey: "main",
|
|
@@ -368,8 +373,6 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
|
368
373
|
transaction
|
|
369
374
|
});
|
|
370
375
|
await dataSourceRole.writeToAcl({
|
|
371
|
-
grantHelper: pluginACL.grantHelper,
|
|
372
|
-
associationFieldsActions: pluginACL.associationFieldsActions,
|
|
373
376
|
acl: dataSource.acl,
|
|
374
377
|
transaction
|
|
375
378
|
});
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
declare const _default: {
|
|
2
10
|
name: string;
|
|
3
11
|
actions: {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
var __create = Object.create;
|
|
2
11
|
var __defProp = Object.defineProperty;
|
|
3
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
declare const _default: {
|
|
2
10
|
name: string;
|
|
3
11
|
actions: {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
var __create = Object.create;
|
|
2
11
|
var __defProp = Object.defineProperty;
|
|
3
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
declare const _default: {
|
|
2
10
|
name: string;
|
|
3
11
|
actions: {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
var __defProp = Object.defineProperty;
|
|
2
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
declare const _default: {
|
|
2
10
|
name: string;
|
|
3
11
|
actions: {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
var __defProp = Object.defineProperty;
|
|
2
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
declare const rolesRemoteCollectionsResourcer: {
|
|
2
10
|
name: string;
|
|
3
11
|
actions: {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
var __create = Object.create;
|
|
2
11
|
var __defProp = Object.defineProperty;
|
|
3
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
import { CountOptions, FindOptions } from '@nocobase/database';
|
|
2
10
|
export declare class FullDataRepository<T> {
|
|
3
11
|
data: Array<T>;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
var __defProp = Object.defineProperty;
|
|
2
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
declare const typeInterfaceMap: {
|
|
2
10
|
array: string;
|
|
3
11
|
belongsTo: string;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
var __defProp = Object.defineProperty;
|
|
2
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -20,6 +29,7 @@ __export(type_interface_map_exports, {
|
|
|
20
29
|
default: () => type_interface_map_default
|
|
21
30
|
});
|
|
22
31
|
module.exports = __toCommonJS(type_interface_map_exports);
|
|
32
|
+
/* istanbul ignore file -- @preserve */
|
|
23
33
|
const typeInterfaceMap = {
|
|
24
34
|
array: "",
|
|
25
35
|
belongsTo: "",
|
package/dist/server/utils.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
1
9
|
export declare function mergeOptions(fieldOptions: any, modelOptions: any): any;
|
package/dist/server/utils.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
var __defProp = Object.defineProperty;
|
|
2
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-data-source-manager",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.10",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"displayName": "Data source manager",
|
|
6
6
|
"displayName.zh-CN": "数据源管理",
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
"homepage": "https://docs.nocobase.com/handbook/data-source-manager",
|
|
10
10
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/data-source-manager",
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"@nocobase/client": "
|
|
13
|
-
"@nocobase/server": "
|
|
14
|
-
"@nocobase/test": "
|
|
12
|
+
"@nocobase/client": "1.x",
|
|
13
|
+
"@nocobase/server": "1.x",
|
|
14
|
+
"@nocobase/test": "1.x"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"Data model tools"
|
|
18
18
|
],
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "39c634c88f835f8eadedf72ca11a9fb3323a50f8"
|
|
20
20
|
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var collection_manager_exports = {};
|
|
19
|
-
__export(collection_manager_exports, {
|
|
20
|
-
CollectionManager: () => CollectionManager
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(collection_manager_exports);
|
|
23
|
-
class CollectionManager {
|
|
24
|
-
constructor(db) {
|
|
25
|
-
this.db = db;
|
|
26
|
-
}
|
|
27
|
-
findAndCount() {
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
-
0 && (module.exports = {
|
|
32
|
-
CollectionManager
|
|
33
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Database } from '@nocobase/database';
|
|
2
|
-
type tableInfo = {
|
|
3
|
-
tableName: string;
|
|
4
|
-
schema?: string;
|
|
5
|
-
};
|
|
6
|
-
type GetCollectionOptions = {
|
|
7
|
-
tableInfo: tableInfo;
|
|
8
|
-
localOptions?: PartialCollectionOptions;
|
|
9
|
-
};
|
|
10
|
-
export type LocalData = {
|
|
11
|
-
[collectionName: string]: PartialCollectionOptions;
|
|
12
|
-
};
|
|
13
|
-
type GetCollectionsOptions = {
|
|
14
|
-
localData?: LocalData;
|
|
15
|
-
};
|
|
16
|
-
export type PartialCollectionOptions = Partial<Omit<CollectionOptions, 'fields'> & {
|
|
17
|
-
fields?: Partial<FieldOptions>[];
|
|
18
|
-
}>;
|
|
19
|
-
interface CollectionOptions {
|
|
20
|
-
name: string;
|
|
21
|
-
schema?: string;
|
|
22
|
-
tableName: string;
|
|
23
|
-
title?: string;
|
|
24
|
-
timestamps?: boolean;
|
|
25
|
-
filterTargetKey?: string;
|
|
26
|
-
fields: FieldOptions[];
|
|
27
|
-
unsupportedFields?: UnsupportedFieldOptions[];
|
|
28
|
-
}
|
|
29
|
-
interface UnsupportedFieldOptions {
|
|
30
|
-
rawType: string;
|
|
31
|
-
name: string;
|
|
32
|
-
supported: false;
|
|
33
|
-
}
|
|
34
|
-
interface FieldOptions {
|
|
35
|
-
name: string;
|
|
36
|
-
field: string;
|
|
37
|
-
rawType: string;
|
|
38
|
-
type: string;
|
|
39
|
-
description?: string;
|
|
40
|
-
interface?: string;
|
|
41
|
-
uiSchema?: any;
|
|
42
|
-
possibleTypes?: string[];
|
|
43
|
-
defaultValue?: any;
|
|
44
|
-
primaryKey: boolean;
|
|
45
|
-
unique: boolean;
|
|
46
|
-
allowNull?: boolean;
|
|
47
|
-
autoIncrement?: boolean;
|
|
48
|
-
}
|
|
49
|
-
export declare class DatabaseIntrospector {
|
|
50
|
-
private db;
|
|
51
|
-
constructor(db: Database);
|
|
52
|
-
getCollections(options?: GetCollectionsOptions): Promise<Array<CollectionOptions>>;
|
|
53
|
-
getCollection(options: GetCollectionOptions): Promise<CollectionOptions>;
|
|
54
|
-
loadCollection(options: CollectionOptions): void;
|
|
55
|
-
loadCollections(options: {
|
|
56
|
-
collections: CollectionOptions[];
|
|
57
|
-
}): void;
|
|
58
|
-
tableInfoToCollectionOptions(tableInfo: tableInfo): {
|
|
59
|
-
name: string;
|
|
60
|
-
schema?: string;
|
|
61
|
-
tableName: string;
|
|
62
|
-
title?: string;
|
|
63
|
-
};
|
|
64
|
-
private collectionOptionsByFields;
|
|
65
|
-
private mergeLocalDataIntoCollectionOptions;
|
|
66
|
-
private columnInfoToFieldOptions;
|
|
67
|
-
private getDefaultInterfaceByType;
|
|
68
|
-
private columnAttribute;
|
|
69
|
-
}
|
|
70
|
-
export {};
|