@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.
Files changed (113) hide show
  1. package/dist/client/DatabaseConnectionProvider.d.ts +8 -0
  2. package/dist/client/ThridDataSource.d.ts +8 -0
  3. package/dist/client/component/BreadcumbTitle.d.ts +8 -0
  4. package/dist/client/component/CollectionsManager/AddFieldAction.d.ts +8 -0
  5. package/dist/client/component/CollectionsManager/CollectionFields.d.ts +8 -0
  6. package/dist/client/component/CollectionsManager/ConfigurationTable.d.ts +8 -0
  7. package/dist/client/component/CollectionsManager/ConfigurationTabs.d.ts +8 -0
  8. package/dist/client/component/CollectionsManager/EditCollectionAction.d.ts +8 -0
  9. package/dist/client/component/CollectionsManager/EditFieldAction.d.ts +8 -0
  10. package/dist/client/component/CollectionsManager/components/CollectionFieldInterfaceSelect.d.ts +8 -0
  11. package/dist/client/component/CollectionsManager/components/CollectionName.d.ts +8 -0
  12. package/dist/client/component/CollectionsManager/components/FieldTitleInput.d.ts +8 -0
  13. package/dist/client/component/CollectionsManager/components/FieldType.d.ts +8 -0
  14. package/dist/client/component/CollectionsManager/components/TitleField.d.ts +8 -0
  15. package/dist/client/component/CollectionsManager/components/UnSupportFields.d.ts +8 -0
  16. package/dist/client/component/CollectionsManager/components/index.d.ts +8 -0
  17. package/dist/client/component/CollectionsManager/hooks.d.ts +8 -0
  18. package/dist/client/component/CollectionsManager/index.d.ts +8 -0
  19. package/dist/client/component/CollectionsManager/schema/collectionFields.d.ts +8 -0
  20. package/dist/client/component/CollectionsManager/schema/collections.d.ts +8 -0
  21. package/dist/client/component/CreateDatabaseConnectAction.d.ts +8 -0
  22. package/dist/client/component/DatabaseConnectionManager.d.ts +8 -0
  23. package/dist/client/component/EditDatabaseConnectionAction.d.ts +8 -0
  24. package/dist/client/component/MainDataSourceManager/Configuration/AddCategoryAction.d.ts +8 -0
  25. package/dist/client/component/MainDataSourceManager/Configuration/CollectionFields.d.ts +8 -0
  26. package/dist/client/component/MainDataSourceManager/Configuration/ConfigurationTable.d.ts +8 -0
  27. package/dist/client/component/MainDataSourceManager/Configuration/ConfigurationTabs.d.ts +8 -0
  28. package/dist/client/component/MainDataSourceManager/Configuration/EditCategoryAction.d.ts +8 -0
  29. package/dist/client/component/MainDataSourceManager/Configuration/index.d.ts +8 -0
  30. package/dist/client/component/MainDataSourceManager/Configuration/interfaces.d.ts +8 -0
  31. package/dist/client/component/MainDataSourceManager/Configuration/schemas/collectionFields.d.ts +8 -0
  32. package/dist/client/component/MainDataSourceManager/Configuration/schemas/collections.d.ts +8 -0
  33. package/dist/client/component/MainDataSourceManager/index.d.ts +8 -0
  34. package/dist/client/component/PermissionManager/DataSourceTable.d.ts +8 -0
  35. package/dist/client/component/PermissionManager/PermisionProvider.d.ts +8 -0
  36. package/dist/client/component/PermissionManager/RoleConfigure.d.ts +8 -0
  37. package/dist/client/component/PermissionManager/RolesResourcesActions.d.ts +8 -0
  38. package/dist/client/component/PermissionManager/ScopeSelect.d.ts +8 -0
  39. package/dist/client/component/PermissionManager/StrategyActions.d.ts +8 -0
  40. package/dist/client/component/PermissionManager/index.d.ts +8 -0
  41. package/dist/client/component/PermissionManager/schemas/dataSourceTable.d.ts +8 -0
  42. package/dist/client/component/PermissionManager/schemas/roleCollections.d.ts +8 -0
  43. package/dist/client/component/PermissionManager/schemas/scopes.d.ts +8 -0
  44. package/dist/client/component/PermissionManager/schemas/useRoleResourceValues.d.ts +8 -0
  45. package/dist/client/component/PermissionManager/schemas/useSaveRoleResourceAction.d.ts +8 -0
  46. package/dist/client/component/PermissionManager/style.d.ts +8 -0
  47. package/dist/client/component/ViewDatabaseConnectionAction.d.ts +8 -0
  48. package/dist/client/constant.d.ts +8 -0
  49. package/dist/client/hooks/index.d.ts +8 -0
  50. package/dist/client/index.d.ts +8 -0
  51. package/dist/client/index.js +20 -11
  52. package/dist/client/locale/index.d.ts +8 -0
  53. package/dist/client/schema/index.d.ts +8 -0
  54. package/dist/externalVersion.js +15 -6
  55. package/dist/index.d.ts +8 -0
  56. package/dist/index.js +9 -0
  57. package/dist/server/collections/data-sources-collections.d.ts +8 -0
  58. package/dist/server/collections/data-sources-collections.js +9 -0
  59. package/dist/server/collections/data-sources-fields.d.ts +8 -0
  60. package/dist/server/collections/data-sources-fields.js +9 -0
  61. package/dist/server/collections/data-sources-roles-resources-actions.d.ts +8 -0
  62. package/dist/server/collections/data-sources-roles-resources-actions.js +9 -0
  63. package/dist/server/collections/data-sources-roles-resources-scopes.d.ts +8 -0
  64. package/dist/server/collections/data-sources-roles-resources-scopes.js +9 -0
  65. package/dist/server/collections/data-sources-roles-resources.d.ts +8 -0
  66. package/dist/server/collections/data-sources-roles-resources.js +9 -0
  67. package/dist/server/collections/data-sources-roles.d.ts +8 -0
  68. package/dist/server/collections/data-sources-roles.js +9 -0
  69. package/dist/server/collections/data-sources.d.ts +8 -0
  70. package/dist/server/collections/data-sources.js +9 -0
  71. package/dist/server/errors/type-infer-error.d.ts +8 -0
  72. package/dist/server/errors/type-infer-error.js +9 -0
  73. package/dist/server/index.d.ts +8 -0
  74. package/dist/server/index.js +9 -0
  75. package/dist/server/migrations/20240301164024-migrate-acl-resources.d.ts +8 -0
  76. package/dist/server/migrations/20240301164024-migrate-acl-resources.js +10 -0
  77. package/dist/server/migrations/20240414103927-update-snippet-name.d.ts +8 -0
  78. package/dist/server/migrations/20240414103927-update-snippet-name.js +9 -0
  79. package/dist/server/models/connections-roles-resources-action.d.ts +8 -0
  80. package/dist/server/models/connections-roles-resources-action.js +9 -0
  81. package/dist/server/models/connections-roles-resources.d.ts +8 -0
  82. package/dist/server/models/connections-roles-resources.js +9 -0
  83. package/dist/server/models/data-source.d.ts +8 -0
  84. package/dist/server/models/data-source.js +11 -4
  85. package/dist/server/models/data-sources-collection-model.d.ts +8 -0
  86. package/dist/server/models/data-sources-collection-model.js +9 -0
  87. package/dist/server/models/data-sources-field-model.d.ts +8 -0
  88. package/dist/server/models/data-sources-field-model.js +9 -0
  89. package/dist/server/models/data-sources-roles-model.d.ts +8 -2
  90. package/dist/server/models/data-sources-roles-model.js +10 -3
  91. package/dist/server/plugin.d.ts +8 -0
  92. package/dist/server/plugin.js +34 -31
  93. package/dist/server/resourcers/data-sources-collections-fields.d.ts +8 -0
  94. package/dist/server/resourcers/data-sources-collections-fields.js +9 -0
  95. package/dist/server/resourcers/data-sources-collections.d.ts +8 -0
  96. package/dist/server/resourcers/data-sources-collections.js +9 -0
  97. package/dist/server/resourcers/data-sources-resources.d.ts +8 -0
  98. package/dist/server/resourcers/data-sources-resources.js +9 -0
  99. package/dist/server/resourcers/data-sources-roles.d.ts +8 -0
  100. package/dist/server/resourcers/data-sources-roles.js +9 -0
  101. package/dist/server/resourcers/roles-data-sources-collections.d.ts +8 -0
  102. package/dist/server/resourcers/roles-data-sources-collections.js +9 -0
  103. package/dist/server/services/full-data-repository.d.ts +8 -0
  104. package/dist/server/services/full-data-repository.js +9 -0
  105. package/dist/server/services/type-interface-map.d.ts +8 -0
  106. package/dist/server/services/type-interface-map.js +10 -0
  107. package/dist/server/utils.d.ts +8 -0
  108. package/dist/server/utils.js +9 -0
  109. package/package.json +5 -5
  110. package/dist/server/services/collection-manager.d.ts +0 -6
  111. package/dist/server/services/collection-manager.js +0 -33
  112. package/dist/server/services/database-introspector.d.ts +0 -70
  113. package/dist/server/services/database-introspector.js +0 -235
@@ -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("dataSourcesRolesResources.afterSaveWithAssociations", async (model, options) => {
307
- const { transaction } = options;
308
- const pluginACL = this.app.pm.get("acl");
309
- const dataSource = this.app.dataSourceManager.dataSources.get(model.get("dataSourceKey"));
310
- await model.writeToACL({
311
- acl: dataSource.acl,
312
- associationFieldsActions: pluginACL.associationFieldsActions,
313
- transaction,
314
- grantHelper: pluginACL.grantHelper
315
- });
316
- });
317
- this.app.db.on("dataSourcesRolesResourcesActions.afterUpdateWithAssociations", async (model, options) => {
318
- const { transaction } = options;
319
- const resource = await model.getResource({
320
- transaction
321
- });
322
- const pluginACL = this.app.pm.get("acl");
323
- const dataSource = this.app.dataSourceManager.dataSources.get(resource.get("dataSourceKey"));
324
- await resource.writeToACL({
325
- acl: dataSource.acl,
326
- associationFieldsActions: pluginACL.associationFieldsActions,
327
- transaction,
328
- grantHelper: pluginACL.grantHelper
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: "",
@@ -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;
@@ -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.21.0-alpha.9",
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": "0.x",
13
- "@nocobase/server": "0.x",
14
- "@nocobase/test": "0.x"
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": "a6fe6c4ee532c04e5a50ec777bf76436ca624cbd"
19
+ "gitHead": "39c634c88f835f8eadedf72ca11a9fb3323a50f8"
20
20
  }
@@ -1,6 +0,0 @@
1
- import { Database } from '@nocobase/database';
2
- export declare class CollectionManager {
3
- private db;
4
- constructor(db: Database);
5
- findAndCount(): void;
6
- }
@@ -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 {};