@sinoia/hubdoc-tools 1.0.3 → 1.2.0
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/README.md +115 -34
- package/dist/__tests__/fixtures/plugins/connection-plugin/index.d.ts +15 -0
- package/dist/__tests__/fixtures/plugins/connection-plugin/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/plugins/connection-plugin/index.js +37 -0
- package/dist/__tests__/fixtures/plugins/connection-plugin/index.js.map +1 -0
- package/dist/__tests__/fixtures/plugins/scan-plugin/index.d.ts +15 -0
- package/dist/__tests__/fixtures/plugins/scan-plugin/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/plugins/scan-plugin/index.js +54 -0
- package/dist/__tests__/fixtures/plugins/scan-plugin/index.js.map +1 -0
- package/dist/__tests__/fixtures/plugins/test-plugin/index.d.ts +15 -0
- package/dist/__tests__/fixtures/plugins/test-plugin/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/plugins/test-plugin/index.js +34 -0
- package/dist/__tests__/fixtures/plugins/test-plugin/index.js.map +1 -0
- package/dist/__tests__/fixtures/plugins/workflow-plugin/index.d.ts +16 -0
- package/dist/__tests__/fixtures/plugins/workflow-plugin/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/plugins/workflow-plugin/index.js +145 -0
- package/dist/__tests__/fixtures/plugins/workflow-plugin/index.js.map +1 -0
- package/dist/api/api/authentication-api.d.ts +208 -0
- package/dist/api/api/authentication-api.d.ts.map +1 -0
- package/dist/api/api/authentication-api.js +385 -0
- package/dist/api/api/authentication-api.js.map +1 -0
- package/dist/api/api/bulk-uploads-api.d.ts +101 -0
- package/dist/api/api/bulk-uploads-api.d.ts.map +1 -0
- package/dist/api/api/bulk-uploads-api.js +195 -0
- package/dist/api/api/bulk-uploads-api.js.map +1 -0
- package/dist/api/api/contacts-api.d.ts +246 -0
- package/dist/api/api/contacts-api.d.ts.map +1 -0
- package/dist/api/api/contacts-api.js +465 -0
- package/dist/api/api/contacts-api.js.map +1 -0
- package/dist/api/api/documents-api.d.ts +267 -0
- package/dist/api/api/documents-api.d.ts.map +1 -0
- package/dist/api/api/documents-api.js +506 -0
- package/dist/api/api/documents-api.js.map +1 -0
- package/dist/api/api/folders-api.d.ts +255 -0
- package/dist/api/api/folders-api.d.ts.map +1 -0
- package/dist/api/api/folders-api.js +479 -0
- package/dist/api/api/folders-api.js.map +1 -0
- package/dist/api/api/groups-api.d.ts +246 -0
- package/dist/api/api/groups-api.d.ts.map +1 -0
- package/dist/api/api/groups-api.js +465 -0
- package/dist/api/api/groups-api.js.map +1 -0
- package/dist/api/api/permissions-api.d.ts +246 -0
- package/dist/api/api/permissions-api.d.ts.map +1 -0
- package/dist/api/api/permissions-api.js +465 -0
- package/dist/api/api/permissions-api.js.map +1 -0
- package/dist/api/api/workspaces-api.d.ts +213 -0
- package/dist/api/api/workspaces-api.d.ts.map +1 -0
- package/dist/api/api/workspaces-api.js +424 -0
- package/dist/api/api/workspaces-api.js.map +1 -0
- package/dist/api/api.d.ts +20 -0
- package/dist/api/api.d.ts.map +1 -0
- package/dist/api/api.js +38 -0
- package/dist/api/api.js.map +1 -0
- package/dist/api/base.d.ts +43 -0
- package/dist/api/base.d.ts.map +1 -0
- package/dist/api/base.js +49 -0
- package/dist/api/base.js.map +1 -0
- package/dist/api/common.d.ts +29 -0
- package/dist/api/common.d.ts.map +1 -0
- package/dist/api/common.js +109 -0
- package/dist/api/common.js.map +1 -0
- package/dist/api/configuration.d.ts +99 -0
- package/dist/api/configuration.d.ts.map +1 -0
- package/dist/api/configuration.js +49 -0
- package/dist/api/configuration.js.map +1 -0
- package/dist/api/index.d.ts +15 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +33 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/models/api-v1-documents-documents-post-request1.d.ts +34 -0
- package/dist/api/models/api-v1-documents-documents-post-request1.d.ts.map +1 -0
- package/dist/api/models/api-v1-documents-documents-post-request1.js +16 -0
- package/dist/api/models/api-v1-documents-documents-post-request1.js.map +1 -0
- package/dist/api/models/api-v1-documents-documents-post201-response.d.ts +17 -0
- package/dist/api/models/api-v1-documents-documents-post201-response.d.ts.map +1 -0
- package/dist/api/models/api-v1-documents-documents-post201-response.js +16 -0
- package/dist/api/models/api-v1-documents-documents-post201-response.js.map +1 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response-all-of-items-inner-one-of.d.ts +17 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response-all-of-items-inner-one-of.d.ts.map +1 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response-all-of-items-inner-one-of.js +16 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response-all-of-items-inner-one-of.js.map +1 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response-all-of-items-inner-one-of1.d.ts +17 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response-all-of-items-inner-one-of1.d.ts.map +1 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response-all-of-items-inner-one-of1.js +16 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response-all-of-items-inner-one-of1.js.map +1 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response-all-of-items-inner.d.ts +18 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response-all-of-items-inner.d.ts.map +1 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response-all-of-items-inner.js +16 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response-all-of-items-inner.js.map +1 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response.d.ts +17 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response.d.ts.map +1 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response.js +16 -0
- package/dist/api/models/api-v1-documents-folders-id-get200-response.js.map +1 -0
- package/dist/api/models/bulk-upload-mutation.d.ts +34 -0
- package/dist/api/models/bulk-upload-mutation.d.ts.map +1 -0
- package/dist/api/models/bulk-upload-mutation.js +16 -0
- package/dist/api/models/bulk-upload-mutation.js.map +1 -0
- package/dist/api/models/bulk-upload.d.ts +91 -0
- package/dist/api/models/bulk-upload.d.ts.map +1 -0
- package/dist/api/models/bulk-upload.js +23 -0
- package/dist/api/models/bulk-upload.js.map +1 -0
- package/dist/api/models/contact-mutation.d.ts +30 -0
- package/dist/api/models/contact-mutation.d.ts.map +1 -0
- package/dist/api/models/contact-mutation.js +16 -0
- package/dist/api/models/contact-mutation.js.map +1 -0
- package/dist/api/models/contact.d.ts +54 -0
- package/dist/api/models/contact.d.ts.map +1 -0
- package/dist/api/models/contact.js +16 -0
- package/dist/api/models/contact.js.map +1 -0
- package/dist/api/models/document-document-type.d.ts +19 -0
- package/dist/api/models/document-document-type.d.ts.map +1 -0
- package/dist/api/models/document-document-type.js +16 -0
- package/dist/api/models/document-document-type.js.map +1 -0
- package/dist/api/models/document-domain.d.ts +19 -0
- package/dist/api/models/document-domain.d.ts.map +1 -0
- package/dist/api/models/document-domain.js +16 -0
- package/dist/api/models/document-domain.js.map +1 -0
- package/dist/api/models/document-folder.d.ts +19 -0
- package/dist/api/models/document-folder.d.ts.map +1 -0
- package/dist/api/models/document-folder.js +16 -0
- package/dist/api/models/document-folder.js.map +1 -0
- package/dist/api/models/document-mutation.d.ts +50 -0
- package/dist/api/models/document-mutation.d.ts.map +1 -0
- package/dist/api/models/document-mutation.js +16 -0
- package/dist/api/models/document-mutation.js.map +1 -0
- package/dist/api/models/document.d.ts +73 -0
- package/dist/api/models/document.d.ts.map +1 -0
- package/dist/api/models/document.js +16 -0
- package/dist/api/models/document.js.map +1 -0
- package/dist/api/models/folder-mutation.d.ts +38 -0
- package/dist/api/models/folder-mutation.d.ts.map +1 -0
- package/dist/api/models/folder-mutation.js +16 -0
- package/dist/api/models/folder-mutation.js.map +1 -0
- package/dist/api/models/folder-parent.d.ts +19 -0
- package/dist/api/models/folder-parent.d.ts.map +1 -0
- package/dist/api/models/folder-parent.js +16 -0
- package/dist/api/models/folder-parent.js.map +1 -0
- package/dist/api/models/folder.d.ts +65 -0
- package/dist/api/models/folder.d.ts.map +1 -0
- package/dist/api/models/folder.js +16 -0
- package/dist/api/models/folder.js.map +1 -0
- package/dist/api/models/group-mutation.d.ts +26 -0
- package/dist/api/models/group-mutation.d.ts.map +1 -0
- package/dist/api/models/group-mutation.js +16 -0
- package/dist/api/models/group-mutation.js.map +1 -0
- package/dist/api/models/group.d.ts +38 -0
- package/dist/api/models/group.d.ts.map +1 -0
- package/dist/api/models/group.js +16 -0
- package/dist/api/models/group.js.map +1 -0
- package/dist/api/models/index.d.ts +35 -0
- package/dist/api/models/index.d.ts.map +1 -0
- package/dist/api/models/index.js +51 -0
- package/dist/api/models/index.js.map +1 -0
- package/dist/api/models/model-error.d.ts +26 -0
- package/dist/api/models/model-error.d.ts.map +1 -0
- package/dist/api/models/model-error.js +16 -0
- package/dist/api/models/model-error.js.map +1 -0
- package/dist/api/models/oauth-revoke-post200-response.d.ts +15 -0
- package/dist/api/models/oauth-revoke-post200-response.d.ts.map +1 -0
- package/dist/api/models/oauth-revoke-post200-response.js +16 -0
- package/dist/api/models/oauth-revoke-post200-response.js.map +1 -0
- package/dist/api/models/permission-actor.d.ts +20 -0
- package/dist/api/models/permission-actor.d.ts.map +1 -0
- package/dist/api/models/permission-actor.js +16 -0
- package/dist/api/models/permission-actor.js.map +1 -0
- package/dist/api/models/permission-mutation.d.ts +44 -0
- package/dist/api/models/permission-mutation.d.ts.map +1 -0
- package/dist/api/models/permission-mutation.js +22 -0
- package/dist/api/models/permission-mutation.js.map +1 -0
- package/dist/api/models/permission-permissible.d.ts +20 -0
- package/dist/api/models/permission-permissible.d.ts.map +1 -0
- package/dist/api/models/permission-permissible.js +16 -0
- package/dist/api/models/permission-permissible.js.map +1 -0
- package/dist/api/models/permission.d.ts +60 -0
- package/dist/api/models/permission.d.ts.map +1 -0
- package/dist/api/models/permission.js +22 -0
- package/dist/api/models/permission.js.map +1 -0
- package/dist/api/models/token-response.d.ts +41 -0
- package/dist/api/models/token-response.d.ts.map +1 -0
- package/dist/api/models/token-response.js +16 -0
- package/dist/api/models/token-response.js.map +1 -0
- package/dist/api/models/user.d.ts +18 -0
- package/dist/api/models/user.d.ts.map +1 -0
- package/dist/api/models/user.js +16 -0
- package/dist/api/models/user.js.map +1 -0
- package/dist/api/models/workspace-mutation-settings-validation.d.ts +26 -0
- package/dist/api/models/workspace-mutation-settings-validation.d.ts.map +1 -0
- package/dist/api/models/workspace-mutation-settings-validation.js +16 -0
- package/dist/api/models/workspace-mutation-settings-validation.js.map +1 -0
- package/dist/api/models/workspace-mutation-settings.d.ts +60 -0
- package/dist/api/models/workspace-mutation-settings.d.ts.map +1 -0
- package/dist/api/models/workspace-mutation-settings.js +16 -0
- package/dist/api/models/workspace-mutation-settings.js.map +1 -0
- package/dist/api/models/workspace-mutation.d.ts +44 -0
- package/dist/api/models/workspace-mutation.d.ts.map +1 -0
- package/dist/api/models/workspace-mutation.js +16 -0
- package/dist/api/models/workspace-mutation.js.map +1 -0
- package/dist/api/models/workspace-settings-validation.d.ts +26 -0
- package/dist/api/models/workspace-settings-validation.d.ts.map +1 -0
- package/dist/api/models/workspace-settings-validation.js +16 -0
- package/dist/api/models/workspace-settings-validation.js.map +1 -0
- package/dist/api/models/workspace-settings.d.ts +60 -0
- package/dist/api/models/workspace-settings.d.ts.map +1 -0
- package/dist/api/models/workspace-settings.js +16 -0
- package/dist/api/models/workspace-settings.js.map +1 -0
- package/dist/api/models/workspace.d.ts +62 -0
- package/dist/api/models/workspace.d.ts.map +1 -0
- package/dist/api/models/workspace.js +16 -0
- package/dist/api/models/workspace.js.map +1 -0
- package/dist/cli/handlers/command-handlers.d.ts +29 -0
- package/dist/cli/handlers/command-handlers.d.ts.map +1 -0
- package/dist/cli/handlers/command-handlers.js +261 -0
- package/dist/cli/handlers/command-handlers.js.map +1 -0
- package/dist/cli/handlers/engine-handlers.d.ts +15 -0
- package/dist/cli/handlers/engine-handlers.d.ts.map +1 -0
- package/dist/cli/handlers/engine-handlers.js +174 -0
- package/dist/cli/handlers/engine-handlers.js.map +1 -0
- package/dist/cli/interactive.d.ts +15 -0
- package/dist/cli/interactive.d.ts.map +1 -0
- package/dist/cli/interactive.js +234 -0
- package/dist/cli/interactive.js.map +1 -0
- package/dist/cli.js +31 -739
- package/dist/cli.js.map +1 -1
- package/dist/commands/export.d.ts +1 -1
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +1 -1
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/import.js +1 -1
- package/dist/commands/import.js.map +1 -1
- package/dist/index.d.ts +27 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -20
- package/dist/index.js.map +1 -1
- package/dist/services/hubdoc-api.d.ts +5 -0
- package/dist/services/hubdoc-api.d.ts.map +1 -1
- package/dist/services/hubdoc-api.js +48 -26
- package/dist/services/hubdoc-api.js.map +1 -1
- package/dist/services/hubdoc-export.d.ts +1 -1
- package/dist/services/hubdoc-export.d.ts.map +1 -1
- package/dist/services/hubdoc-export.js +1 -1
- package/dist/services/hubdoc-export.js.map +1 -1
- package/dist/services/oauth-token-service.d.ts +27 -14
- package/dist/services/oauth-token-service.d.ts.map +1 -1
- package/dist/services/oauth-token-service.js +147 -80
- package/dist/services/oauth-token-service.js.map +1 -1
- package/dist/services/plugin-import.d.ts +2 -2
- package/dist/services/plugin-import.d.ts.map +1 -1
- package/dist/services/plugin-import.js +2 -2
- package/dist/services/plugin-import.js.map +1 -1
- package/dist/services/plugin-manager.d.ts +1 -1
- package/dist/services/plugin-manager.d.ts.map +1 -1
- package/dist/services/plugin-manager.js +2 -2
- package/dist/services/plugin-manager.js.map +1 -1
- package/dist/types/index.d.ts +12 -37
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/config.d.ts +30 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +187 -40
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/csv.d.ts +1 -0
- package/dist/utils/csv.d.ts.map +1 -1
- package/dist/utils/csv.js +21 -0
- package/dist/utils/csv.js.map +1 -1
- package/package.json +23 -6
- package/.env.example +0 -23
- package/BAUTECH_HubDoc_Import.pptx +0 -0
- package/CHANGELOG.md +0 -127
- package/DEMO-DOCUMENTATION.html +0 -356
- package/DEMO-DOCUMENTATION.md +0 -411
- package/EXPORT-DOCUMENTATION.md +0 -333
- package/HUBDOC-API-V2.md +0 -248
- package/INSTALL.md +0 -175
- package/PACKAGING.md +0 -206
- package/PLUGINS.md +0 -328
- package/PRESENTATION-CLIENT.md +0 -100
- package/README-hubdoc-tool.md +0 -369
- package/README-npm.md +0 -238
- package/TESTING.md +0 -129
- package/config-examples/README.md +0 -36
- package/config-examples/alfresco-config.example.json +0 -8
- package/config-examples/azure-blob-config.example.json +0 -7
- package/config-examples/box-config.example.json +0 -5
- package/config-examples/nuxeo-config.example.json +0 -8
- package/config-examples/opentext-config.example.json +0 -7
- package/config-examples/s3-config.example.json +0 -8
- package/config-examples/sharepoint-config.example.json +0 -7
- package/demo/README.md +0 -199
- package/demo/demo-script.md +0 -284
- package/demo/generate-sample-csv.js +0 -351
- package/demo/mapping_bautech_15k.csv +0 -1
- package/demo/simulate-import.js +0 -273
- package/dist/commands/export-v2.d.ts +0 -45
- package/dist/commands/export-v2.d.ts.map +0 -1
- package/dist/commands/export-v2.js +0 -369
- package/dist/commands/export-v2.js.map +0 -1
- package/dist/commands/import-v2.d.ts +0 -32
- package/dist/commands/import-v2.d.ts.map +0 -1
- package/dist/commands/import-v2.js +0 -331
- package/dist/commands/import-v2.js.map +0 -1
- package/dist/services/hubdoc-api-v2.d.ts +0 -150
- package/dist/services/hubdoc-api-v2.d.ts.map +0 -1
- package/dist/services/hubdoc-api-v2.js +0 -418
- package/dist/services/hubdoc-api-v2.js.map +0 -1
- package/dist/services/hubdoc-client.d.ts +0 -246
- package/dist/services/hubdoc-client.d.ts.map +0 -1
- package/dist/services/hubdoc-client.js +0 -714
- package/dist/services/hubdoc-client.js.map +0 -1
- package/dist/services/hubdoc-export-service.d.ts +0 -90
- package/dist/services/hubdoc-export-service.d.ts.map +0 -1
- package/dist/services/hubdoc-export-service.js +0 -443
- package/dist/services/hubdoc-export-service.js.map +0 -1
- package/dist/services/hubdoc-export-v2.d.ts +0 -77
- package/dist/services/hubdoc-export-v2.d.ts.map +0 -1
- package/dist/services/hubdoc-export-v2.js +0 -329
- package/dist/services/hubdoc-export-v2.js.map +0 -1
- package/dist/services/hubdoc-import-service.d.ts +0 -64
- package/dist/services/hubdoc-import-service.d.ts.map +0 -1
- package/dist/services/hubdoc-import-service.js +0 -374
- package/dist/services/hubdoc-import-service.js.map +0 -1
- package/docs/README.md +0 -65
- package/docs/connectors/alfresco.md +0 -211
- package/docs/connectors/aws-s3.md +0 -187
- package/docs/connectors/azure-blob.md +0 -195
- package/docs/connectors/box.md +0 -115
- package/docs/connectors/nuxeo.md +0 -214
- package/docs/connectors/opentext.md +0 -234
- package/docs/connectors/sharepoint.md +0 -207
- package/documentation.html +0 -273
- package/jest.config.js +0 -15
- package/plugins/core/README.md +0 -122
- package/plugins/core/TESTING.md +0 -155
- package/plugins/core/plugin.json +0 -26
- package/plugins/dropbox/plugin.json +0 -12
- package/plugins/filesystem/plugin.json +0 -12
- package/plugins/googledrive/plugin.json +0 -12
- package/plugins/onedrive/TESTING.md +0 -197
- package/plugins/onedrive/plugin.json +0 -12
- package/scripts/build-windows-installer.ps1 +0 -132
- package/scripts/build-windows-installer.sh +0 -106
- package/scripts/prepare-publish.js +0 -62
- package/scripts/restore-package.js +0 -29
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HubDocImportService = void 0;
|
|
7
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
-
const csv_parser_1 = __importDefault(require("csv-parser"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const hubdoc_client_1 = require("./hubdoc-client");
|
|
11
|
-
const concurrent_processor_1 = require("../utils/concurrent-processor");
|
|
12
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
13
|
-
/**
|
|
14
|
-
* Service for importing documents to HubDoc using CSV mapping files
|
|
15
|
-
*/
|
|
16
|
-
class HubDocImportService {
|
|
17
|
-
constructor(config) {
|
|
18
|
-
this.config = config;
|
|
19
|
-
this.client = new hubdoc_client_1.HubDocClient(config);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Test connection to HubDoc API
|
|
23
|
-
*/
|
|
24
|
-
async testConnection() {
|
|
25
|
-
return await this.client.testConnection();
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Parse CSV mapping file into DocumentMapping objects
|
|
29
|
-
*/
|
|
30
|
-
async parseMappingFile(filePath, baseDir) {
|
|
31
|
-
if (!await fs_extra_1.default.pathExists(filePath)) {
|
|
32
|
-
throw new Error(`Mapping file not found: ${filePath}`);
|
|
33
|
-
}
|
|
34
|
-
console.log(chalk_1.default.blue(`📋 Parsing mapping file: ${filePath}`));
|
|
35
|
-
return new Promise((resolve, reject) => {
|
|
36
|
-
const mappings = [];
|
|
37
|
-
const errors = [];
|
|
38
|
-
fs_extra_1.default.createReadStream(filePath)
|
|
39
|
-
.pipe((0, csv_parser_1.default)())
|
|
40
|
-
.on('data', (row, index) => {
|
|
41
|
-
try {
|
|
42
|
-
const mapping = this.parseRowToMapping(row, index + 1, baseDir);
|
|
43
|
-
if (mapping) {
|
|
44
|
-
mappings.push(mapping);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
errors.push(`Row ${index + 2}: ${error.message}`);
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
.on('end', () => {
|
|
52
|
-
if (errors.length > 0) {
|
|
53
|
-
console.error(chalk_1.default.red('❌ CSV parsing errors:'));
|
|
54
|
-
errors.forEach(error => console.error(chalk_1.default.red(` ${error}`)));
|
|
55
|
-
reject(new Error(`${errors.length} errors found in CSV file`));
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
console.log(chalk_1.default.green(`✅ Parsed ${mappings.length} mappings from CSV`));
|
|
59
|
-
resolve(mappings);
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
.on('error', reject);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Parse CSV row into DocumentMapping object
|
|
67
|
-
*/
|
|
68
|
-
parseRowToMapping(row, rowNumber, baseDir) {
|
|
69
|
-
// Skip empty rows
|
|
70
|
-
if (!row.filePath && !row.file_path && !row.sourcePath && !row.source_path) {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
// Get file path (support multiple column names)
|
|
74
|
-
const filePath = row.filePath || row.file_path || row.sourcePath || row.source_path;
|
|
75
|
-
if (!filePath) {
|
|
76
|
-
throw new Error('Missing file path column (expected: filePath, file_path, sourcePath, or source_path)');
|
|
77
|
-
}
|
|
78
|
-
// Resolve full path
|
|
79
|
-
const fullFilePath = path_1.default.isAbsolute(filePath) ? filePath :
|
|
80
|
-
path_1.default.resolve(baseDir || process.cwd(), filePath);
|
|
81
|
-
// Build mapping object
|
|
82
|
-
const mapping = {
|
|
83
|
-
filePath: fullFilePath,
|
|
84
|
-
workspace: row.workspace || row.workspaceName || row.workspace_name,
|
|
85
|
-
targetFolder: row.targetFolder || row.target_folder || row.folderPath || row.folder_path,
|
|
86
|
-
domain: row.domain,
|
|
87
|
-
metadata: {}
|
|
88
|
-
};
|
|
89
|
-
// Parse metadata from additional columns
|
|
90
|
-
const metadataColumns = ['title', 'description', 'category', 'tags', 'author', 'project', 'client'];
|
|
91
|
-
metadataColumns.forEach(col => {
|
|
92
|
-
if (row[col]) {
|
|
93
|
-
mapping.metadata[col] = row[col];
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
// Parse custom metadata (JSON columns)
|
|
97
|
-
if (row.metadata) {
|
|
98
|
-
try {
|
|
99
|
-
mapping.metadata = { ...mapping.metadata, ...JSON.parse(row.metadata) };
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
console.warn(chalk_1.default.yellow(`⚠️ Row ${rowNumber}: Invalid JSON in metadata column, ignoring`));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
// Parse permissions
|
|
106
|
-
if (row.permissions) {
|
|
107
|
-
try {
|
|
108
|
-
mapping.permissions = JSON.parse(row.permissions);
|
|
109
|
-
}
|
|
110
|
-
catch (error) {
|
|
111
|
-
console.warn(chalk_1.default.yellow(`⚠️ Row ${rowNumber}: Invalid JSON in permissions column, ignoring`));
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
// Build permissions from individual columns
|
|
116
|
-
const permissions = {};
|
|
117
|
-
if (row.readUsers || row.read_users) {
|
|
118
|
-
permissions.read = {
|
|
119
|
-
users: (row.readUsers || row.read_users).split(',').map((u) => u.trim())
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
if (row.writeUsers || row.write_users) {
|
|
123
|
-
permissions.write = {
|
|
124
|
-
users: (row.writeUsers || row.write_users).split(',').map((u) => u.trim())
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
if (row.readGroups || row.read_groups) {
|
|
128
|
-
permissions.read = {
|
|
129
|
-
...permissions.read,
|
|
130
|
-
groups: (row.readGroups || row.read_groups).split(',').map((g) => g.trim())
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
if (row.writeGroups || row.write_groups) {
|
|
134
|
-
permissions.write = {
|
|
135
|
-
...permissions.write,
|
|
136
|
-
groups: (row.writeGroups || row.write_groups).split(',').map((g) => g.trim())
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
if (Object.keys(permissions).length > 0) {
|
|
140
|
-
mapping.permissions = permissions;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return mapping;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Validate mapping file and mappings
|
|
147
|
-
*/
|
|
148
|
-
async validateMappings(mappings) {
|
|
149
|
-
const result = {
|
|
150
|
-
valid: true,
|
|
151
|
-
errors: [],
|
|
152
|
-
warnings: [],
|
|
153
|
-
mappingCount: mappings.length
|
|
154
|
-
};
|
|
155
|
-
console.log(chalk_1.default.blue(`🔍 Validating ${mappings.length} mappings...`));
|
|
156
|
-
for (let i = 0; i < mappings.length; i++) {
|
|
157
|
-
const mapping = mappings[i];
|
|
158
|
-
const rowNum = i + 1;
|
|
159
|
-
// Check if file exists
|
|
160
|
-
if (!await fs_extra_1.default.pathExists(mapping.filePath)) {
|
|
161
|
-
result.errors.push(`Row ${rowNum}: File not found: ${mapping.filePath}`);
|
|
162
|
-
result.valid = false;
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
// Check file size
|
|
166
|
-
try {
|
|
167
|
-
const stats = await fs_extra_1.default.stat(mapping.filePath);
|
|
168
|
-
if (stats.size === 0) {
|
|
169
|
-
result.warnings.push(`Row ${rowNum}: File is empty: ${mapping.filePath}`);
|
|
170
|
-
}
|
|
171
|
-
else if (stats.size > 100 * 1024 * 1024) { // 100MB
|
|
172
|
-
result.warnings.push(`Row ${rowNum}: Large file (${Math.round(stats.size / 1024 / 1024)}MB): ${mapping.filePath}`);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
catch (error) {
|
|
176
|
-
result.errors.push(`Row ${rowNum}: Cannot read file: ${mapping.filePath}`);
|
|
177
|
-
result.valid = false;
|
|
178
|
-
}
|
|
179
|
-
// Validate workspace name
|
|
180
|
-
if (mapping.workspace && mapping.workspace.length > 255) {
|
|
181
|
-
result.errors.push(`Row ${rowNum}: Workspace name too long (max 255 chars): ${mapping.workspace}`);
|
|
182
|
-
result.valid = false;
|
|
183
|
-
}
|
|
184
|
-
// Validate folder path
|
|
185
|
-
if (mapping.targetFolder) {
|
|
186
|
-
if (mapping.targetFolder.length > 1000) {
|
|
187
|
-
result.errors.push(`Row ${rowNum}: Folder path too long (max 1000 chars): ${mapping.targetFolder}`);
|
|
188
|
-
result.valid = false;
|
|
189
|
-
}
|
|
190
|
-
// Check for invalid characters
|
|
191
|
-
const invalidChars = /[<>:"|?*]/;
|
|
192
|
-
if (invalidChars.test(mapping.targetFolder)) {
|
|
193
|
-
result.errors.push(`Row ${rowNum}: Invalid characters in folder path: ${mapping.targetFolder}`);
|
|
194
|
-
result.valid = false;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
// Validate domain
|
|
198
|
-
if (mapping.domain && mapping.domain.length > 100) {
|
|
199
|
-
result.errors.push(`Row ${rowNum}: Domain name too long (max 100 chars): ${mapping.domain}`);
|
|
200
|
-
result.valid = false;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
// Summary
|
|
204
|
-
if (result.valid) {
|
|
205
|
-
console.log(chalk_1.default.green(`✅ Validation passed for ${mappings.length} mappings`));
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
console.log(chalk_1.default.red(`❌ Validation failed with ${result.errors.length} errors`));
|
|
209
|
-
}
|
|
210
|
-
if (result.warnings.length > 0) {
|
|
211
|
-
console.log(chalk_1.default.yellow(`⚠️ ${result.warnings.length} warnings found`));
|
|
212
|
-
}
|
|
213
|
-
return result;
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Import documents using mappings
|
|
217
|
-
*/
|
|
218
|
-
async importDocuments(mappings, options = {}) {
|
|
219
|
-
const startTime = Date.now();
|
|
220
|
-
console.log(chalk_1.default.blue(`📦 Starting import of ${mappings.length} documents`));
|
|
221
|
-
// Filter mappings if needed
|
|
222
|
-
let filteredMappings = mappings;
|
|
223
|
-
if (options.domain) {
|
|
224
|
-
filteredMappings = mappings.filter(m => m.domain === options.domain);
|
|
225
|
-
console.log(chalk_1.default.gray(`🔍 Filtered to ${filteredMappings.length} mappings for domain: ${options.domain}`));
|
|
226
|
-
}
|
|
227
|
-
const results = [];
|
|
228
|
-
if (options.dryRun) {
|
|
229
|
-
console.log(chalk_1.default.yellow('🧪 DRY RUN MODE - No files will be uploaded'));
|
|
230
|
-
// Simulate dry run results
|
|
231
|
-
for (const mapping of filteredMappings) {
|
|
232
|
-
results.push({
|
|
233
|
-
success: true,
|
|
234
|
-
filePath: mapping.filePath,
|
|
235
|
-
document: undefined // No actual upload in dry run
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
// Actual import
|
|
241
|
-
if (options.concurrency && options.concurrency > 1) {
|
|
242
|
-
// Concurrent import
|
|
243
|
-
const processingResult = await concurrent_processor_1.ConcurrentProcessor.processWithProgress(filteredMappings, async (mapping) => {
|
|
244
|
-
return await this.client.importDocument(mapping);
|
|
245
|
-
}, {
|
|
246
|
-
concurrency: options.concurrency,
|
|
247
|
-
operation: 'Import',
|
|
248
|
-
itemName: 'documents'
|
|
249
|
-
});
|
|
250
|
-
results.push(...processingResult.results.filter(r => r !== undefined));
|
|
251
|
-
// Add error results
|
|
252
|
-
const errorResults = processingResult.errors.map(({ item, error }) => ({
|
|
253
|
-
success: false,
|
|
254
|
-
filePath: item.filePath,
|
|
255
|
-
error: error.message
|
|
256
|
-
}));
|
|
257
|
-
results.push(...errorResults);
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
// Sequential import
|
|
261
|
-
for (let i = 0; i < filteredMappings.length; i++) {
|
|
262
|
-
const mapping = filteredMappings[i];
|
|
263
|
-
const progress = `(${i + 1}/${filteredMappings.length})`;
|
|
264
|
-
console.log(chalk_1.default.cyan(`${progress} Importing: ${path_1.default.basename(mapping.filePath)}`));
|
|
265
|
-
try {
|
|
266
|
-
const result = await this.client.importDocument(mapping);
|
|
267
|
-
results.push(result);
|
|
268
|
-
}
|
|
269
|
-
catch (error) {
|
|
270
|
-
results.push({
|
|
271
|
-
success: false,
|
|
272
|
-
filePath: mapping.filePath,
|
|
273
|
-
error: error.message
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
// Progress update every 10 documents
|
|
277
|
-
if ((i + 1) % 10 === 0) {
|
|
278
|
-
console.log(chalk_1.default.blue(`📊 Progress: ${i + 1}/${filteredMappings.length} processed`));
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
const endTime = Date.now();
|
|
284
|
-
const duration = endTime - startTime;
|
|
285
|
-
const summary = {
|
|
286
|
-
total: filteredMappings.length,
|
|
287
|
-
successful: results.filter(r => r.success).length,
|
|
288
|
-
failed: results.filter(r => !r.success).length,
|
|
289
|
-
skipped: mappings.length - filteredMappings.length,
|
|
290
|
-
results,
|
|
291
|
-
duration
|
|
292
|
-
};
|
|
293
|
-
this.printImportSummary(summary, options.dryRun);
|
|
294
|
-
return summary;
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Bulk import with CSV file
|
|
298
|
-
*/
|
|
299
|
-
async bulkImportFromCsv(options) {
|
|
300
|
-
console.log(chalk_1.default.blue(`🚀 Starting bulk import from: ${options.mappingFile}`));
|
|
301
|
-
// Step 1: Parse CSV
|
|
302
|
-
const mappings = await this.parseMappingFile(options.mappingFile, options.baseDir);
|
|
303
|
-
// Step 2: Validate mappings
|
|
304
|
-
if (!options.dryRun) {
|
|
305
|
-
const validation = await this.validateMappings(mappings);
|
|
306
|
-
if (!validation.valid) {
|
|
307
|
-
throw new Error(`Validation failed with ${validation.errors.length} errors. Fix the issues and try again.`);
|
|
308
|
-
}
|
|
309
|
-
if (validation.warnings.length > 0 && options.interactive) {
|
|
310
|
-
console.log(chalk_1.default.yellow('\n⚠️ Warnings found:'));
|
|
311
|
-
validation.warnings.forEach(warning => console.log(chalk_1.default.yellow(` ${warning}`)));
|
|
312
|
-
// In a real interactive scenario, you'd prompt the user here
|
|
313
|
-
console.log(chalk_1.default.blue('Continuing with import...'));
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
if (options.validateOnly) {
|
|
317
|
-
console.log(chalk_1.default.green('✅ Validation complete. Use --no-validate-only to proceed with import.'));
|
|
318
|
-
return {
|
|
319
|
-
total: mappings.length,
|
|
320
|
-
successful: 0,
|
|
321
|
-
failed: 0,
|
|
322
|
-
skipped: 0,
|
|
323
|
-
results: [],
|
|
324
|
-
duration: 0,
|
|
325
|
-
mappingFile: options.mappingFile
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
// Step 3: Test connection
|
|
329
|
-
if (!options.dryRun) {
|
|
330
|
-
console.log(chalk_1.default.blue('🔗 Testing API connection...'));
|
|
331
|
-
const connected = await this.testConnection();
|
|
332
|
-
if (!connected) {
|
|
333
|
-
throw new Error('Failed to connect to HubDoc API. Check your configuration.');
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
// Step 4: Import documents
|
|
337
|
-
return await this.importDocuments(mappings, options);
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* Print import summary
|
|
341
|
-
*/
|
|
342
|
-
printImportSummary(summary, isDryRun = false) {
|
|
343
|
-
const durationStr = (summary.duration / 1000).toFixed(1);
|
|
344
|
-
console.log('\n' + chalk_1.default.bold(`📊 Import Summary ${isDryRun ? '(DRY RUN)' : ''}`));
|
|
345
|
-
console.log(chalk_1.default.green(`✅ Successful: ${summary.successful}`));
|
|
346
|
-
if (summary.failed > 0) {
|
|
347
|
-
console.log(chalk_1.default.red(`❌ Failed: ${summary.failed}`));
|
|
348
|
-
const failedResults = summary.results.filter(r => !r.success);
|
|
349
|
-
if (failedResults.length > 0 && failedResults.length <= 10) {
|
|
350
|
-
console.log('\n' + chalk_1.default.red('Failed imports:'));
|
|
351
|
-
failedResults.forEach(result => {
|
|
352
|
-
console.log(chalk_1.default.red(` • ${path_1.default.basename(result.filePath)}: ${result.error}`));
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
else if (failedResults.length > 10) {
|
|
356
|
-
console.log('\n' + chalk_1.default.red('Failed imports (showing first 10):'));
|
|
357
|
-
failedResults.slice(0, 10).forEach(result => {
|
|
358
|
-
console.log(chalk_1.default.red(` • ${path_1.default.basename(result.filePath)}: ${result.error}`));
|
|
359
|
-
});
|
|
360
|
-
console.log(chalk_1.default.red(` ... and ${failedResults.length - 10} more`));
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
if (summary.skipped > 0) {
|
|
364
|
-
console.log(chalk_1.default.gray(`⏭️ Skipped: ${summary.skipped}`));
|
|
365
|
-
}
|
|
366
|
-
console.log(chalk_1.default.blue(`\n📈 Total processed: ${summary.total} documents in ${durationStr}s`));
|
|
367
|
-
if (summary.total > 0 && summary.duration > 0) {
|
|
368
|
-
const rate = (summary.total / (summary.duration / 1000)).toFixed(1);
|
|
369
|
-
console.log(chalk_1.default.gray(`⚡ Rate: ${rate} docs/second`));
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
exports.HubDocImportService = HubDocImportService;
|
|
374
|
-
//# sourceMappingURL=hubdoc-import-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hubdoc-import-service.js","sourceRoot":"","sources":["../../src/services/hubdoc-import-service.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA0B;AAC1B,4DAAmC;AACnC,gDAAwB;AACxB,mDAA6D;AAE7D,wEAAoE;AACpE,kDAA0B;AA8B1B;;GAEG;AACH,MAAa,mBAAmB;IAI9B,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,IAAI,4BAAY,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QAClB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gBAAgB,CAAC,QAAgB,EAAE,OAAgB;QACvD,IAA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,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,WAAW,IAAI,cAAc,CAAC,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;CACF;AA7ZD,kDA6ZC"}
|
package/docs/README.md
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Documentation des Connecteurs
|
|
2
|
-
|
|
3
|
-
Cette section contient la documentation détaillée pour chaque connecteur supporté par hubdoc-tools.
|
|
4
|
-
|
|
5
|
-
## 📁 Connecteurs disponibles
|
|
6
|
-
|
|
7
|
-
### Cloud Storage
|
|
8
|
-
- **[Box](./connectors/box.md)** - Box Cloud Storage
|
|
9
|
-
- **[AWS S3](./connectors/aws-s3.md)** - Amazon S3 et services compatibles
|
|
10
|
-
- **[Azure Blob](./connectors/azure-blob.md)** - Azure Blob Storage
|
|
11
|
-
|
|
12
|
-
### ECM/GED (Enterprise Content Management)
|
|
13
|
-
- **[Alfresco](./connectors/alfresco.md)** - Alfresco Content Services
|
|
14
|
-
- **[Nuxeo](./connectors/nuxeo.md)** - Nuxeo Platform
|
|
15
|
-
- **[OpenText](./connectors/opentext.md)** - OpenText Content Server
|
|
16
|
-
|
|
17
|
-
### Microsoft 365 / SharePoint
|
|
18
|
-
- **[SharePoint](./connectors/sharepoint.md)** - SharePoint Online via Microsoft Graph
|
|
19
|
-
|
|
20
|
-
## 🚀 Utilisation générale
|
|
21
|
-
|
|
22
|
-
Tous les connecteurs supportent les opérations suivantes :
|
|
23
|
-
|
|
24
|
-
### Scan
|
|
25
|
-
Parcourir et lister les documents disponibles dans la source.
|
|
26
|
-
|
|
27
|
-
### Import
|
|
28
|
-
Télécharger les documents depuis la source vers le système local.
|
|
29
|
-
|
|
30
|
-
### Export
|
|
31
|
-
Uploader des documents locaux vers la source externe.
|
|
32
|
-
|
|
33
|
-
## ⚙️ Configuration commune
|
|
34
|
-
|
|
35
|
-
Chaque connecteur peut être configuré via :
|
|
36
|
-
|
|
37
|
-
1. **Mode interactif** : `hubdoc-tool --engine [nom] --interactive`
|
|
38
|
-
2. **Fichier de configuration** : `[nom]-config.json`
|
|
39
|
-
3. **Variables d'environnement** : selon le connecteur
|
|
40
|
-
|
|
41
|
-
## 🔍 Filtres supportés
|
|
42
|
-
|
|
43
|
-
Tous les connecteurs supportent les filtres suivants :
|
|
44
|
-
|
|
45
|
-
- **Taille** : `maxSize` - Taille maximale des fichiers
|
|
46
|
-
- **Date** : `dateRange` - Plage de dates de modification
|
|
47
|
-
- **Type MIME** : `mimeTypes` - Types de fichiers acceptés
|
|
48
|
-
- **Limite** : `limit` - Nombre maximum de documents
|
|
49
|
-
|
|
50
|
-
## 📊 Métadonnées
|
|
51
|
-
|
|
52
|
-
Chaque connecteur extrait et préserve les métadonnées spécifiques à sa plateforme :
|
|
53
|
-
|
|
54
|
-
- Métadonnées standard (nom, taille, dates)
|
|
55
|
-
- Métadonnées spécifiques à la plateforme
|
|
56
|
-
- Informations d'audit (créateur, modificateur)
|
|
57
|
-
- Tags et classifications selon disponibilité
|
|
58
|
-
|
|
59
|
-
## 🛠️ Développement
|
|
60
|
-
|
|
61
|
-
Pour ajouter un nouveau connecteur, consulter l'architecture des plugins existants et implémenter l'interface `DocumentSourcePlugin`.
|
|
62
|
-
|
|
63
|
-
## 📞 Support
|
|
64
|
-
|
|
65
|
-
Pour les problèmes spécifiques à un connecteur, consulter la section "Troubleshooting" de sa documentation respective.
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
# Alfresco ECM Connector
|
|
2
|
-
|
|
3
|
-
Plugin pour importer/exporter des documents depuis/vers Alfresco Content Management.
|
|
4
|
-
|
|
5
|
-
## Configuration
|
|
6
|
-
|
|
7
|
-
### Paramètres requis
|
|
8
|
-
- `baseUrl` : URL de base Alfresco (ex: http://localhost:8080/alfresco)
|
|
9
|
-
- `username` : Nom d'utilisateur Alfresco
|
|
10
|
-
- `password` : Mot de passe Alfresco
|
|
11
|
-
|
|
12
|
-
### Paramètres optionnels
|
|
13
|
-
- `siteId` : ID du site Alfresco à scanner (optionnel)
|
|
14
|
-
- `folderId` : ID du dossier de départ (optionnel)
|
|
15
|
-
- `includeFolders` : Inclure les sous-dossiers (défaut: true)
|
|
16
|
-
- `limit` : Nombre maximum de documents à scanner
|
|
17
|
-
|
|
18
|
-
## Configuration Alfresco
|
|
19
|
-
|
|
20
|
-
### Prérequis
|
|
21
|
-
- Alfresco Community ou Enterprise 5.2+
|
|
22
|
-
- API REST Alfresco activée
|
|
23
|
-
- Utilisateur avec permissions de lecture/écriture appropriées
|
|
24
|
-
|
|
25
|
-
### Vérification de l'API
|
|
26
|
-
1. Tester l'accès à l'API : `http://your-alfresco/alfresco/api/-default-/public/alfresco/versions/1/people/-me-`
|
|
27
|
-
2. Vérifier que l'authentification fonctionne
|
|
28
|
-
3. Tester l'accès aux contenus avec votre utilisateur
|
|
29
|
-
|
|
30
|
-
## Structure Alfresco
|
|
31
|
-
|
|
32
|
-
### Sites Alfresco
|
|
33
|
-
Si vous utilisez Alfresco Share avec des sites :
|
|
34
|
-
```json
|
|
35
|
-
{
|
|
36
|
-
"baseUrl": "http://localhost:8080/alfresco",
|
|
37
|
-
"username": "admin",
|
|
38
|
-
"password": "admin",
|
|
39
|
-
"siteId": "my-site"
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Dossier spécifique
|
|
44
|
-
Pour scanner à partir d'un dossier spécifique :
|
|
45
|
-
```json
|
|
46
|
-
{
|
|
47
|
-
"baseUrl": "http://localhost:8080/alfresco",
|
|
48
|
-
"username": "admin",
|
|
49
|
-
"password": "admin",
|
|
50
|
-
"folderId": "workspace://SpacesStore/uuid-of-folder"
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Repository racine (défaut)
|
|
55
|
-
Sans siteId ni folderId, scan depuis `-root-` :
|
|
56
|
-
```json
|
|
57
|
-
{
|
|
58
|
-
"baseUrl": "http://localhost:8080/alfresco",
|
|
59
|
-
"username": "admin",
|
|
60
|
-
"password": "admin"
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Utilisation
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
# Mode interactif
|
|
68
|
-
hubdoc-tool --engine alfresco
|
|
69
|
-
|
|
70
|
-
# Avec limite de documents
|
|
71
|
-
hubdoc-tool --engine alfresco --limit 50
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Fichier de configuration
|
|
75
|
-
|
|
76
|
-
Créer `alfresco-config.json` :
|
|
77
|
-
|
|
78
|
-
```json
|
|
79
|
-
{
|
|
80
|
-
"baseUrl": "https://alfresco.example.com/alfresco",
|
|
81
|
-
"username": "jdoe",
|
|
82
|
-
"password": "password123",
|
|
83
|
-
"siteId": "project-documents",
|
|
84
|
-
"includeFolders": true,
|
|
85
|
-
"limit": 200
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Fonctionnalités supportées
|
|
90
|
-
|
|
91
|
-
### Scan (✅)
|
|
92
|
-
- Parcours récursif des dossiers et sous-dossiers
|
|
93
|
-
- Support des sites Alfresco Share
|
|
94
|
-
- Métadonnées complètes Alfresco (aspects, propriétés)
|
|
95
|
-
- Types de contenu personnalisés
|
|
96
|
-
- Filtrage par taille, date, type MIME
|
|
97
|
-
|
|
98
|
-
### Import (✅)
|
|
99
|
-
- Téléchargement du contenu binaire
|
|
100
|
-
- Préservation de la structure de dossiers
|
|
101
|
-
- Conservation des métadonnées Alfresco
|
|
102
|
-
- Gestion des versions de documents
|
|
103
|
-
|
|
104
|
-
### Export (✅)
|
|
105
|
-
- Upload multipart pour gros fichiers
|
|
106
|
-
- Création automatique de l'arborescence
|
|
107
|
-
- Assignment du type de contenu `cm:content`
|
|
108
|
-
- Métadonnées de base (titre, description)
|
|
109
|
-
|
|
110
|
-
## Métadonnées Alfresco
|
|
111
|
-
|
|
112
|
-
### Propriétés standard extraites
|
|
113
|
-
- **Dublin Core** : title, description, creator, created, modified
|
|
114
|
-
- **Content Model** : name, type, parent, version
|
|
115
|
-
- **Audit** : created_by, modified_by, creation date
|
|
116
|
-
- **Custom Properties** : aspects et propriétés personnalisés
|
|
117
|
-
|
|
118
|
-
### Types de contenu supportés
|
|
119
|
-
- `cm:content` : Documents standards
|
|
120
|
-
- `cm:folder` : Dossiers
|
|
121
|
-
- Types personnalisés définis dans votre modèle de contenu
|
|
122
|
-
|
|
123
|
-
## API Alfresco utilisée
|
|
124
|
-
|
|
125
|
-
### Version API
|
|
126
|
-
- **API REST** : Alfresco REST API v1
|
|
127
|
-
- **Base Path** : `/api/-default-/public/alfresco/versions/1`
|
|
128
|
-
- **Documentation** : [Alfresco REST API](https://docs.alfresco.com/content-services/latest/develop/rest-api-guide/)
|
|
129
|
-
|
|
130
|
-
### Endpoints utilisés
|
|
131
|
-
- `GET /nodes/{nodeId}/children` : Liste le contenu d'un nœud
|
|
132
|
-
- `GET /nodes/{nodeId}/content` : Télécharge le contenu d'un fichier
|
|
133
|
-
- `POST /nodes/{nodeId}/children` : Crée un nouveau document/dossier
|
|
134
|
-
- `GET /sites/{siteId}/containers` : Accède aux conteneurs de site
|
|
135
|
-
|
|
136
|
-
## Structure des nœuds
|
|
137
|
-
|
|
138
|
-
### Identifiants Alfresco
|
|
139
|
-
- **NodeRef** : `workspace://SpacesStore/uuid`
|
|
140
|
-
- **Node ID** : uuid court utilisé dans l'API REST
|
|
141
|
-
- **Path** : Chemin depuis Company Home
|
|
142
|
-
|
|
143
|
-
### Hiérarchie standard
|
|
144
|
-
```
|
|
145
|
-
Company Home/
|
|
146
|
-
├── Data Dictionary/
|
|
147
|
-
├── Sites/
|
|
148
|
-
│ └── my-site/
|
|
149
|
-
│ └── documentLibrary/
|
|
150
|
-
└── User Homes/
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
## Limitations
|
|
154
|
-
|
|
155
|
-
### Alfresco Community
|
|
156
|
-
- Pas de clustering avancé
|
|
157
|
-
- Limitations sur certains aspects enterprise
|
|
158
|
-
|
|
159
|
-
### Alfresco Enterprise
|
|
160
|
-
- Fonctionnalités complètes
|
|
161
|
-
- Support des transformations avancées
|
|
162
|
-
- Workflows complexes
|
|
163
|
-
|
|
164
|
-
### API REST
|
|
165
|
-
- Pagination max : 100 items par défaut
|
|
166
|
-
- Timeout par défaut : 30 secondes
|
|
167
|
-
- Pas de support des transactions
|
|
168
|
-
|
|
169
|
-
## Troubleshooting
|
|
170
|
-
|
|
171
|
-
### Erreur 401: Authentication failed
|
|
172
|
-
- Vérifier username/password
|
|
173
|
-
- Vérifier que l'utilisateur existe et est actif
|
|
174
|
-
- Tester la connexion via navigateur
|
|
175
|
-
|
|
176
|
-
### Erreur 403: Access denied
|
|
177
|
-
- Vérifier les permissions sur le site/dossier
|
|
178
|
-
- S'assurer que l'utilisateur a les rôles appropriés
|
|
179
|
-
- Vérifier les ACL sur les contenus
|
|
180
|
-
|
|
181
|
-
### Erreur 404: Node not found
|
|
182
|
-
- Vérifier que le siteId ou folderId existe
|
|
183
|
-
- Contrôler l'orthographe des identifiants
|
|
184
|
-
- Tester l'accès via Share interface
|
|
185
|
-
|
|
186
|
-
### Erreur 500: Internal server error
|
|
187
|
-
- Vérifier les logs Alfresco (alfresco.log, catalina.out)
|
|
188
|
-
- Contrôler l'espace disque disponible
|
|
189
|
-
- Vérifier la configuration de la base de données
|
|
190
|
-
|
|
191
|
-
## Bonnes pratiques
|
|
192
|
-
|
|
193
|
-
### Performance
|
|
194
|
-
- Limiter la profondeur de scan pour les gros repositories
|
|
195
|
-
- Utiliser des filtres appropriés (date, taille)
|
|
196
|
-
- Planifier les imports/exports en dehors des heures de pointe
|
|
197
|
-
|
|
198
|
-
### Sécurité
|
|
199
|
-
- Utiliser HTTPS pour les connexions
|
|
200
|
-
- Créer un utilisateur dédié avec permissions minimales
|
|
201
|
-
- Auditer les accès aux contenus sensibles
|
|
202
|
-
|
|
203
|
-
### Maintenance
|
|
204
|
-
- Surveiller l'utilisation de l'espace disque
|
|
205
|
-
- Configurer des règles de rétention appropriées
|
|
206
|
-
- Sauvegarder régulièrement le repository et la DB
|
|
207
|
-
|
|
208
|
-
### Modèle de contenu
|
|
209
|
-
- Définir des aspects personnalisés pour vos métadonnées
|
|
210
|
-
- Utiliser des contraintes sur les propriétés
|
|
211
|
-
- Implémenter des règles d'auto-classification
|