@sinoia/hubdoc-tools 1.0.4 → 1.2.1
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 -740
- 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.d.ts.map +1 -1
- package/dist/commands/import.js +5 -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 +63 -20
- package/dist/index.js.map +1 -1
- package/dist/services/hubdoc-api.d.ts +26 -6
- package/dist/services/hubdoc-api.d.ts.map +1 -1
- package/dist/services/hubdoc-api.js +194 -43
- 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 +6 -1
- package/dist/services/plugin-manager.d.ts.map +1 -1
- package/dist/services/plugin-manager.js +28 -2
- package/dist/services/plugin-manager.js.map +1 -1
- package/dist/types/index.d.ts +11 -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.map +1 -1
- package/dist/utils/csv.js +14 -3
- 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 -134
- 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,197 +0,0 @@
|
|
|
1
|
-
# Guide de test du plugin OneDrive
|
|
2
|
-
|
|
3
|
-
Ce guide vous permet de tester le plugin OneDrive avec Microsoft Graph API.
|
|
4
|
-
|
|
5
|
-
## Prérequis
|
|
6
|
-
|
|
7
|
-
1. **Azure CLI installé** : `brew install azure-cli` (macOS) ou voir [docs Azure](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
|
8
|
-
2. **Compte Microsoft/Office 365** avec accès OneDrive
|
|
9
|
-
3. **HubDoc Tools configuré**
|
|
10
|
-
|
|
11
|
-
> ⚠️ **Note** : Pour un test rapide, seul Azure CLI est nécessaire. L'enregistrement d'application Azure AD n'est requis que pour une intégration production.
|
|
12
|
-
|
|
13
|
-
## Configuration de test
|
|
14
|
-
|
|
15
|
-
### 1. Enregistrer une application Azure AD
|
|
16
|
-
|
|
17
|
-
1. Aller sur [Azure Portal](https://portal.azure.com)
|
|
18
|
-
2. Naviguer vers **Azure Active Directory** → **App registrations**
|
|
19
|
-
3. Cliquer **New registration**
|
|
20
|
-
4. Configurer les permissions Microsoft Graph :
|
|
21
|
-
- `Files.Read.All` (pour lire tous les fichiers)
|
|
22
|
-
- `Sites.Read.All` (pour SharePoint)
|
|
23
|
-
- `User.Read` (pour les informations utilisateur)
|
|
24
|
-
|
|
25
|
-
### 2. Obtenir un token d'accès (Test rapide avec Azure CLI)
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
# Installer Azure CLI si nécessaire
|
|
29
|
-
brew install azure-cli
|
|
30
|
-
|
|
31
|
-
# Se connecter à votre compte Microsoft/Office 365
|
|
32
|
-
az login
|
|
33
|
-
|
|
34
|
-
# Obtenir un token pour Microsoft Graph
|
|
35
|
-
az account get-access-token --resource https://graph.microsoft.com/
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
La commande retournera un JSON avec le token dans le champ `accessToken` :
|
|
39
|
-
```json
|
|
40
|
-
{
|
|
41
|
-
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIs...",
|
|
42
|
-
"expiresOn": "2025-01-10 15:30:00.000000",
|
|
43
|
-
...
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 3. Configuration pour test rapide
|
|
48
|
-
|
|
49
|
-
Pour un test avec Azure CLI (pas besoin d'enregistrer d'app) :
|
|
50
|
-
|
|
51
|
-
```json
|
|
52
|
-
{
|
|
53
|
-
"clientId": "dummy",
|
|
54
|
-
"clientSecret": "dummy",
|
|
55
|
-
"tenantId": "dummy",
|
|
56
|
-
"accessToken": "YOUR_TOKEN_FROM_AZ_CLI_COMMAND",
|
|
57
|
-
"rootPath": "/",
|
|
58
|
-
"limit": 10
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
> 💡 Les champs `clientId`, `clientSecret`, et `tenantId` peuvent être des valeurs factices quand vous utilisez un token direct d'Azure CLI.
|
|
63
|
-
|
|
64
|
-
### 4. Tester la connexion
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
# Lister les plugins disponibles
|
|
68
|
-
npm run dev -- plugins
|
|
69
|
-
|
|
70
|
-
# Vérifier que OneDrive est bien listé
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### 5. Scanner les documents (test rapide)
|
|
74
|
-
|
|
75
|
-
Utiliser le script de test :
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
# Modifier le fichier test-onedrive.js avec vos vraies valeurs
|
|
79
|
-
node test-onedrive.js
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Résultats attendus
|
|
83
|
-
|
|
84
|
-
### Scan réussi
|
|
85
|
-
- ✅ Connection: SUCCESS
|
|
86
|
-
- ✅ Documents trouvés avec métadonnées OneDrive
|
|
87
|
-
- ✅ Limitation respectée (paramètre `limit`)
|
|
88
|
-
- ✅ Types de documents variés (Office, PDF, images, etc.)
|
|
89
|
-
|
|
90
|
-
### Structure des documents
|
|
91
|
-
- **Chemin** : Structure de dossiers OneDrive/SharePoint
|
|
92
|
-
- **Métadonnées** : OneDrive ID, download URL, parent path
|
|
93
|
-
- **Types MIME** : Détection automatique basée sur l'extension
|
|
94
|
-
|
|
95
|
-
## Test d'intégration complète
|
|
96
|
-
|
|
97
|
-
### 1. Configuration d'une connexion
|
|
98
|
-
```bash
|
|
99
|
-
echo '{
|
|
100
|
-
"clientId": "YOUR_CLIENT_ID",
|
|
101
|
-
"clientSecret": "YOUR_CLIENT_SECRET",
|
|
102
|
-
"tenantId": "YOUR_TENANT_ID",
|
|
103
|
-
"accessToken": "YOUR_TOKEN",
|
|
104
|
-
"rootPath": "/Documents",
|
|
105
|
-
"limit": 10
|
|
106
|
-
}' > onedrive-config.json
|
|
107
|
-
|
|
108
|
-
npm run dev -- connect onedrive --config onedrive-config.json --name test-onedrive
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### 2. Scan des documents
|
|
112
|
-
```bash
|
|
113
|
-
npm run dev -- plugin-scan test-onedrive --output onedrive-mapping.csv
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### 3. Vérification du mapping
|
|
117
|
-
```bash
|
|
118
|
-
head -10 onedrive-mapping.csv
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
Le fichier doit contenir :
|
|
122
|
-
- Colonnes : File Path, Target Folder, Workspace, Metadata (JSON), Permissions
|
|
123
|
-
- Métadonnées JSON avec OneDrive ID, download URL
|
|
124
|
-
- Chemins organisés selon la structure OneDrive
|
|
125
|
-
|
|
126
|
-
## Dépannage
|
|
127
|
-
|
|
128
|
-
### Token expiré
|
|
129
|
-
```
|
|
130
|
-
Error: Request failed with status code 401
|
|
131
|
-
```
|
|
132
|
-
→ Renouveler le token avec `az account get-access-token --resource https://graph.microsoft.com/`
|
|
133
|
-
|
|
134
|
-
### Permissions insuffisantes
|
|
135
|
-
```
|
|
136
|
-
Error: Insufficient privileges to complete the operation
|
|
137
|
-
```
|
|
138
|
-
→ Vérifier les permissions Microsoft Graph de l'application Azure
|
|
139
|
-
|
|
140
|
-
### Dossier introuvable
|
|
141
|
-
```
|
|
142
|
-
Error: The resource could not be found
|
|
143
|
-
```
|
|
144
|
-
→ Vérifier le `rootPath` ou utiliser `/` pour la racine
|
|
145
|
-
|
|
146
|
-
### Limite de débit
|
|
147
|
-
```
|
|
148
|
-
Error: Too many requests
|
|
149
|
-
```
|
|
150
|
-
→ Le plugin a déjà des délais intégrés, augmenter si nécessaire
|
|
151
|
-
|
|
152
|
-
## Performance
|
|
153
|
-
|
|
154
|
-
Avec limit=10 :
|
|
155
|
-
- Durée : ~2-3 secondes
|
|
156
|
-
- Documents : 10 maximum
|
|
157
|
-
- API calls : 1-2 requêtes
|
|
158
|
-
|
|
159
|
-
Avec limit=100 :
|
|
160
|
-
- Durée : ~10-15 secondes
|
|
161
|
-
- Documents : 100 maximum
|
|
162
|
-
- API calls : Pagination automatique
|
|
163
|
-
|
|
164
|
-
## Paramètres utiles
|
|
165
|
-
|
|
166
|
-
- **limit** : Nombre max de documents (utile pour tests)
|
|
167
|
-
- **rootPath** : Dossier spécifique à scanner (ex: `/Documents`)
|
|
168
|
-
- **accessToken** : Token direct (évite l'OAuth flow complexe)
|
|
169
|
-
- **clientId/clientSecret** : Pour l'authentification OAuth2
|
|
170
|
-
|
|
171
|
-
## Types de documents OneDrive observés
|
|
172
|
-
|
|
173
|
-
- **Office** : .docx, .xlsx, .pptx (exportés automatiquement)
|
|
174
|
-
- **PDF** : Documents PDF
|
|
175
|
-
- **Images** : .jpg, .png, .gif
|
|
176
|
-
- **Archives** : .zip, .rar
|
|
177
|
-
- **Texte** : .txt, .csv, .json
|
|
178
|
-
|
|
179
|
-
## Différences avec SharePoint
|
|
180
|
-
|
|
181
|
-
Le plugin fonctionne pour :
|
|
182
|
-
- **OneDrive personnel** : `/me/drive/`
|
|
183
|
-
- **SharePoint** : Modifier l'URL de base si nécessaire
|
|
184
|
-
- **OneDrive Entreprise** : Même API que personnel
|
|
185
|
-
|
|
186
|
-
## Commandes utiles
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
# Test rapide de connexion
|
|
190
|
-
node test-onedrive.js
|
|
191
|
-
|
|
192
|
-
# Scan avec limite
|
|
193
|
-
npm run dev -- plugin-scan test-onedrive --limit 5
|
|
194
|
-
|
|
195
|
-
# Import vers dossier local
|
|
196
|
-
npm run dev -- plugin-import test-onedrive ./downloads --limit 3
|
|
197
|
-
```
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "onedrive",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Microsoft OneDrive document source plugin",
|
|
5
|
-
"author": "HubDoc Tools",
|
|
6
|
-
"main": "index.js",
|
|
7
|
-
"hubdocToolVersion": "^1.0.0",
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"axios": "^1.5.0",
|
|
10
|
-
"fs-extra": "^11.1.0"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# Build Windows Installer for HubDoc Tool
|
|
2
|
-
# PowerShell script for Windows users
|
|
3
|
-
|
|
4
|
-
param(
|
|
5
|
-
[switch]$SkipTests,
|
|
6
|
-
[switch]$BuildInstaller
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
Write-Host "🚀 Building HubDoc Tool Windows Package..." -ForegroundColor Cyan
|
|
10
|
-
|
|
11
|
-
# Check if we're in the right directory
|
|
12
|
-
if (-not (Test-Path "package.json")) {
|
|
13
|
-
Write-Host "❌ Error: package.json not found. Please run from project root." -ForegroundColor Red
|
|
14
|
-
exit 1
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
Write-Host "📦 Step 1: Installing dependencies..." -ForegroundColor Blue
|
|
18
|
-
npm install
|
|
19
|
-
if ($LASTEXITCODE -ne 0) {
|
|
20
|
-
Write-Host "❌ npm install failed!" -ForegroundColor Red
|
|
21
|
-
exit 1
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
Write-Host "🔨 Step 2: Building TypeScript..." -ForegroundColor Blue
|
|
25
|
-
npm run build
|
|
26
|
-
if ($LASTEXITCODE -ne 0) {
|
|
27
|
-
Write-Host "❌ TypeScript build failed!" -ForegroundColor Red
|
|
28
|
-
exit 1
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (-not $SkipTests) {
|
|
32
|
-
Write-Host "📐 Step 3: Running tests..." -ForegroundColor Blue
|
|
33
|
-
npm run test-connectors
|
|
34
|
-
if ($LASTEXITCODE -ne 0) {
|
|
35
|
-
Write-Host "⚠️ Some tests failed, but continuing..." -ForegroundColor Yellow
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
Write-Host "🎯 Step 4: Creating Windows executable..." -ForegroundColor Blue
|
|
40
|
-
npm run pkg
|
|
41
|
-
if ($LASTEXITCODE -ne 0) {
|
|
42
|
-
Write-Host "❌ PKG build failed!" -ForegroundColor Red
|
|
43
|
-
exit 1
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
Write-Host "📊 Step 5: Creating multi-platform executables..." -ForegroundColor Blue
|
|
47
|
-
npm run pkg:all
|
|
48
|
-
if ($LASTEXITCODE -ne 0) {
|
|
49
|
-
Write-Host "⚠️ Multi-platform build partially failed" -ForegroundColor Yellow
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
# Check build artifacts
|
|
53
|
-
Write-Host "📏 Step 6: Checking build artifacts..." -ForegroundColor Blue
|
|
54
|
-
Get-ChildItem -Path "build" -File | Format-Table Name, @{Label="Size (MB)"; Expression={[math]::Round($_.Length/1MB, 2)}}
|
|
55
|
-
|
|
56
|
-
# Create LICENSE if it doesn't exist
|
|
57
|
-
if (-not (Test-Path "LICENSE")) {
|
|
58
|
-
Write-Host "📜 Creating LICENSE file..." -ForegroundColor Yellow
|
|
59
|
-
@"
|
|
60
|
-
MIT License
|
|
61
|
-
|
|
62
|
-
Copyright (c) 2024 Sinoia
|
|
63
|
-
|
|
64
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
65
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
66
|
-
in the Software without restriction, including without limitation the rights
|
|
67
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
68
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
69
|
-
furnished to do so, subject to the following conditions:
|
|
70
|
-
|
|
71
|
-
The above copyright notice and this permission notice shall be included in all
|
|
72
|
-
copies or substantial portions of the Software.
|
|
73
|
-
|
|
74
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
75
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
76
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
77
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
78
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
79
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
80
|
-
SOFTWARE.
|
|
81
|
-
"@ | Out-File -FilePath "LICENSE" -Encoding UTF8
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
# Build NSIS installer if requested and available
|
|
85
|
-
if ($BuildInstaller) {
|
|
86
|
-
Write-Host "🏗️ Step 7: Building NSIS installer..." -ForegroundColor Blue
|
|
87
|
-
|
|
88
|
-
# Check if NSIS is installed
|
|
89
|
-
$nsisPath = Get-Command "makensis" -ErrorAction SilentlyContinue
|
|
90
|
-
if ($nsisPath) {
|
|
91
|
-
Set-Location "installer"
|
|
92
|
-
& makensis "hubdoc-tool.nsi"
|
|
93
|
-
Set-Location ".."
|
|
94
|
-
|
|
95
|
-
if ($LASTEXITCODE -eq 0) {
|
|
96
|
-
Write-Host "✅ NSIS installer created successfully!" -ForegroundColor Green
|
|
97
|
-
} else {
|
|
98
|
-
Write-Host "❌ NSIS installer build failed!" -ForegroundColor Red
|
|
99
|
-
}
|
|
100
|
-
} else {
|
|
101
|
-
Write-Host "⚠️ NSIS not found. Install from https://nsis.sourceforge.io/" -ForegroundColor Yellow
|
|
102
|
-
Write-Host " Then run: makensis installer/hubdoc-tool.nsi" -ForegroundColor Yellow
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
Write-Host "✅ Build completed successfully!" -ForegroundColor Green
|
|
107
|
-
Write-Host ""
|
|
108
|
-
Write-Host "📋 Build Summary:" -ForegroundColor Blue
|
|
109
|
-
|
|
110
|
-
if (Test-Path "build/hubdoc-tool-windows.exe") {
|
|
111
|
-
$size = [math]::Round((Get-Item "build/hubdoc-tool-windows.exe").Length/1MB, 1)
|
|
112
|
-
Write-Host " ✓ Windows executable: build/hubdoc-tool-windows.exe ($size MB)" -ForegroundColor Green
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (Test-Path "build/HubDoc-Tool-1.0.0-Setup.exe") {
|
|
116
|
-
$size = [math]::Round((Get-Item "build/HubDoc-Tool-1.0.0-Setup.exe").Length/1MB, 1)
|
|
117
|
-
Write-Host " ✓ Windows installer: build/HubDoc-Tool-1.0.0-Setup.exe ($size MB)" -ForegroundColor Green
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
Write-Host ""
|
|
121
|
-
Write-Host "🎯 Next Steps:" -ForegroundColor Blue
|
|
122
|
-
Write-Host " 1. Test executable: build\hubdoc-tool-windows.exe --help"
|
|
123
|
-
Write-Host " 2. Distribute to clients via:"
|
|
124
|
-
Write-Host " • Standalone .exe (no installation required)"
|
|
125
|
-
Write-Host " • Full installer .exe (with start menu, PATH, etc.)"
|
|
126
|
-
Write-Host ""
|
|
127
|
-
Write-Host "📚 Documentation included:" -ForegroundColor Blue
|
|
128
|
-
Write-Host " • docs/README.md - Overview"
|
|
129
|
-
Write-Host " • docs/connectors/ - Connector guides"
|
|
130
|
-
Write-Host " • config-examples/ - Configuration templates"
|
|
131
|
-
Write-Host ""
|
|
132
|
-
Write-Host "🎉 Ready for distribution!" -ForegroundColor Green
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Build Windows Installer for HubDoc Tool
|
|
4
|
-
# This script creates both a standalone executable and a Windows installer
|
|
5
|
-
|
|
6
|
-
echo "🚀 Building HubDoc Tool Windows Installer..."
|
|
7
|
-
|
|
8
|
-
# Colors for output
|
|
9
|
-
RED='\033[0;31m'
|
|
10
|
-
GREEN='\033[0;32m'
|
|
11
|
-
YELLOW='\033[1;33m'
|
|
12
|
-
BLUE='\033[0;34m'
|
|
13
|
-
NC='\033[0m' # No Color
|
|
14
|
-
|
|
15
|
-
# Check if we're in the right directory
|
|
16
|
-
if [ ! -f "package.json" ]; then
|
|
17
|
-
echo -e "${RED}❌ Error: package.json not found. Please run from project root.${NC}"
|
|
18
|
-
exit 1
|
|
19
|
-
fi
|
|
20
|
-
|
|
21
|
-
echo -e "${BLUE}📦 Step 1: Installing dependencies...${NC}"
|
|
22
|
-
npm install
|
|
23
|
-
|
|
24
|
-
echo -e "${BLUE}🔨 Step 2: Building TypeScript...${NC}"
|
|
25
|
-
npm run build
|
|
26
|
-
if [ $? -ne 0 ]; then
|
|
27
|
-
echo -e "${RED}❌ TypeScript build failed!${NC}"
|
|
28
|
-
exit 1
|
|
29
|
-
fi
|
|
30
|
-
|
|
31
|
-
echo -e "${BLUE}📐 Step 3: Running tests...${NC}"
|
|
32
|
-
npm run test-connectors
|
|
33
|
-
if [ $? -ne 0 ]; then
|
|
34
|
-
echo -e "${YELLOW}⚠️ Some tests failed, but continuing...${NC}"
|
|
35
|
-
fi
|
|
36
|
-
|
|
37
|
-
echo -e "${BLUE}🎯 Step 4: Creating standalone executable...${NC}"
|
|
38
|
-
npm run pkg
|
|
39
|
-
if [ $? -ne 0 ]; then
|
|
40
|
-
echo -e "${RED}❌ PKG build failed!${NC}"
|
|
41
|
-
exit 1
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
echo -e "${BLUE}📊 Step 5: Creating multi-platform executables...${NC}"
|
|
45
|
-
npm run pkg:all
|
|
46
|
-
if [ $? -ne 0 ]; then
|
|
47
|
-
echo -e "${YELLOW}⚠️ Multi-platform build failed, but Windows exe exists${NC}"
|
|
48
|
-
fi
|
|
49
|
-
|
|
50
|
-
# Check file sizes
|
|
51
|
-
echo -e "${BLUE}📏 Step 6: Checking build artifacts...${NC}"
|
|
52
|
-
ls -lh build/
|
|
53
|
-
|
|
54
|
-
# Create license file if it doesn't exist
|
|
55
|
-
if [ ! -f "LICENSE" ]; then
|
|
56
|
-
echo -e "${YELLOW}📜 Creating LICENSE file...${NC}"
|
|
57
|
-
cat > LICENSE << 'EOF'
|
|
58
|
-
MIT License
|
|
59
|
-
|
|
60
|
-
Copyright (c) 2024 Sinoia
|
|
61
|
-
|
|
62
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
63
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
64
|
-
in the Software without restriction, including without limitation the rights
|
|
65
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
66
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
67
|
-
furnished to do so, subject to the following conditions:
|
|
68
|
-
|
|
69
|
-
The above copyright notice and this permission notice shall be included in all
|
|
70
|
-
copies or substantial portions of the Software.
|
|
71
|
-
|
|
72
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
73
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
74
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
75
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
76
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
77
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
78
|
-
SOFTWARE.
|
|
79
|
-
EOF
|
|
80
|
-
fi
|
|
81
|
-
|
|
82
|
-
echo -e "${GREEN}✅ Build completed successfully!${NC}"
|
|
83
|
-
echo ""
|
|
84
|
-
echo -e "${BLUE}📋 Build Summary:${NC}"
|
|
85
|
-
echo -e " ${GREEN}✓${NC} Standalone Windows executable: ${YELLOW}build/hubdoc-tool-windows.exe${NC}"
|
|
86
|
-
|
|
87
|
-
if [ -f "build/hubdoc-tool-linux" ]; then
|
|
88
|
-
echo -e " ${GREEN}✓${NC} Linux executable: ${YELLOW}build/hubdoc-tool-linux${NC}"
|
|
89
|
-
fi
|
|
90
|
-
|
|
91
|
-
if [ -f "build/hubdoc-tool-macos" ]; then
|
|
92
|
-
echo -e " ${GREEN}✓${NC} macOS executable: ${YELLOW}build/hubdoc-tool-macos${NC}"
|
|
93
|
-
fi
|
|
94
|
-
|
|
95
|
-
echo ""
|
|
96
|
-
echo -e "${BLUE}🎯 Next Steps:${NC}"
|
|
97
|
-
echo -e " 1. Test the Windows executable: ${YELLOW}./build/hubdoc-tool-windows.exe --help${NC}"
|
|
98
|
-
echo -e " 2. For NSIS installer, install NSIS and run: ${YELLOW}makensis installer/hubdoc-tool.nsi${NC}"
|
|
99
|
-
echo -e " 3. Distribute the executable or installer to clients"
|
|
100
|
-
echo ""
|
|
101
|
-
echo -e "${BLUE}📚 Documentation:${NC}"
|
|
102
|
-
echo -e " • User Guide: ${YELLOW}docs/README.md${NC}"
|
|
103
|
-
echo -e " • Connector Docs: ${YELLOW}docs/connectors/${NC}"
|
|
104
|
-
echo -e " • Config Examples: ${YELLOW}config-examples/${NC}"
|
|
105
|
-
echo ""
|
|
106
|
-
echo -e "${GREEN}🎉 Ready for distribution!${NC}"
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Script de préparation pour la publication NPM
|
|
5
|
-
* Prépare le package.json pour la publication sous @sinoia/hubdoc-tools
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const fs = require('fs');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
const packagePath = path.join(__dirname, '..', 'package.json');
|
|
12
|
-
const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
|
|
13
|
-
|
|
14
|
-
console.log('🔧 Preparing package for publication...');
|
|
15
|
-
|
|
16
|
-
// Sauvegarder l'original
|
|
17
|
-
const backupPath = packagePath + '.backup';
|
|
18
|
-
fs.writeFileSync(backupPath, JSON.stringify(packageJson, null, 2));
|
|
19
|
-
console.log(`💾 Backup saved to ${backupPath}`);
|
|
20
|
-
|
|
21
|
-
// Modifier pour la publication
|
|
22
|
-
const publishPackage = {
|
|
23
|
-
...packageJson,
|
|
24
|
-
name: '@sinoia/hubdoc-tools',
|
|
25
|
-
publishConfig: {
|
|
26
|
-
access: 'public',
|
|
27
|
-
registry: 'https://registry.npmjs.org/'
|
|
28
|
-
},
|
|
29
|
-
// Ajouter des keywords pour la découverte
|
|
30
|
-
keywords: [
|
|
31
|
-
...packageJson.keywords,
|
|
32
|
-
'sinoia',
|
|
33
|
-
'corex',
|
|
34
|
-
'document-management',
|
|
35
|
-
'file-import',
|
|
36
|
-
'bulk-upload',
|
|
37
|
-
'cli-tool'
|
|
38
|
-
],
|
|
39
|
-
// S'assurer que le repository est correct
|
|
40
|
-
repository: {
|
|
41
|
-
type: 'git',
|
|
42
|
-
url: 'https://gitlab.com/sinoia/hubdoc-tools.git'
|
|
43
|
-
},
|
|
44
|
-
// Ajouter la page d'accueil
|
|
45
|
-
homepage: 'https://gitlab.com/sinoia/hubdoc-tools#readme',
|
|
46
|
-
// Informations sur les bugs
|
|
47
|
-
bugs: {
|
|
48
|
-
url: 'https://gitlab.com/sinoia/hubdoc-tools/-/issues'
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
// Écrire le package.json modifié
|
|
53
|
-
fs.writeFileSync(packagePath, JSON.stringify(publishPackage, null, 2));
|
|
54
|
-
|
|
55
|
-
console.log('✅ Package prepared for publication:');
|
|
56
|
-
console.log(` Name: ${publishPackage.name}`);
|
|
57
|
-
console.log(` Version: ${publishPackage.version}`);
|
|
58
|
-
console.log(` Registry: ${publishPackage.publishConfig.registry}`);
|
|
59
|
-
console.log(` Access: ${publishPackage.publishConfig.access}`);
|
|
60
|
-
|
|
61
|
-
console.log('\n📦 Ready for: npm publish');
|
|
62
|
-
console.log('🔄 To restore: node scripts/restore-package.js');
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Script de restauration du package.json original
|
|
5
|
-
* Restaure le package.json depuis la sauvegarde
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const fs = require('fs');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
const packagePath = path.join(__dirname, '..', 'package.json');
|
|
12
|
-
const backupPath = packagePath + '.backup';
|
|
13
|
-
|
|
14
|
-
console.log('🔄 Restoring original package.json...');
|
|
15
|
-
|
|
16
|
-
if (!fs.existsSync(backupPath)) {
|
|
17
|
-
console.error('❌ No backup found at', backupPath);
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Restaurer depuis la sauvegarde
|
|
22
|
-
const backup = fs.readFileSync(backupPath, 'utf8');
|
|
23
|
-
fs.writeFileSync(packagePath, backup);
|
|
24
|
-
|
|
25
|
-
// Supprimer la sauvegarde
|
|
26
|
-
fs.unlinkSync(backupPath);
|
|
27
|
-
|
|
28
|
-
console.log('✅ Original package.json restored');
|
|
29
|
-
console.log('🗑️ Backup removed');
|