@hcl-software/dxclient 228.0.0 → 230.0.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 +4 -0
- package/dist/configuration/config.json +1 -0
- package/dist/package.json +17 -17
- package/dist/packages/admintasks/package-lock.json +8623 -15409
- package/dist/packages/admintasks/package.json +10 -6
- package/dist/packages/admintasks/src/commands/createCredentialVault.d.ts +2 -2
- package/dist/packages/admintasks/src/commands/createCredentialVault.js +62 -74
- package/dist/packages/admintasks/src/commands/createCredentialVault.js.map +1 -1
- package/dist/packages/admintasks/src/commands/createSyndicationRelation.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/createSyndicationRelation.js +38 -49
- package/dist/packages/admintasks/src/commands/createSyndicationRelation.js.map +1 -1
- package/dist/packages/admintasks/src/commands/createVirtualPortal.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/createVirtualPortal.js +33 -44
- package/dist/packages/admintasks/src/commands/createVirtualPortal.js.map +1 -1
- package/dist/packages/admintasks/src/commands/differentialReport.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/differentialReport.js +107 -106
- package/dist/packages/admintasks/src/commands/differentialReport.js.map +1 -1
- package/dist/packages/admintasks/src/commands/exportVirtualPortal.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/exportVirtualPortal.js +35 -46
- package/dist/packages/admintasks/src/commands/exportVirtualPortal.js.map +1 -1
- package/dist/packages/admintasks/src/commands/exportWCMLibrary.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/exportWCMLibrary.js +104 -101
- package/dist/packages/admintasks/src/commands/exportWCMLibrary.js.map +1 -1
- package/dist/packages/admintasks/src/commands/importVirtualPortal.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/importVirtualPortal.js +40 -47
- package/dist/packages/admintasks/src/commands/importVirtualPortal.js.map +1 -1
- package/dist/packages/admintasks/src/commands/importWCMLibrary.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/importWCMLibrary.js +85 -82
- package/dist/packages/admintasks/src/commands/importWCMLibrary.js.map +1 -1
- package/dist/packages/admintasks/src/commands/listVirtualPortals.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/listVirtualPortals.js +26 -37
- package/dist/packages/admintasks/src/commands/listVirtualPortals.js.map +1 -1
- package/dist/packages/admintasks/src/commands/pznRulesExport.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/pznRulesExport.js +52 -63
- package/dist/packages/admintasks/src/commands/pznRulesExport.js.map +1 -1
- package/dist/packages/admintasks/src/commands/pznRulesImport.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/pznRulesImport.js +103 -100
- package/dist/packages/admintasks/src/commands/pznRulesImport.js.map +1 -1
- package/dist/packages/admintasks/src/commands/resEnvProviderActions.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/resEnvProviderActions.js +133 -130
- package/dist/packages/admintasks/src/commands/resEnvProviderActions.js.map +1 -1
- package/dist/packages/admintasks/src/commands/restartCorePods.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/restartCorePods.js +19 -30
- package/dist/packages/admintasks/src/commands/restartCorePods.js.map +1 -1
- package/dist/packages/admintasks/src/commands/restartDXCore.d.ts +1 -1
- package/dist/packages/admintasks/src/commands/restartDXCore.js +52 -50
- package/dist/packages/admintasks/src/commands/restartDXCore.js.map +1 -1
- package/dist/packages/admintasks/src/errors/CommandLineMessages_en.json +4 -2
- package/dist/packages/admintasks/src/services/createSyndicationRelationServices.js +6 -15
- package/dist/packages/admintasks/src/services/createSyndicationRelationServices.js.map +1 -1
- package/dist/packages/admintasks/src/services/differentialReportService.js +8 -17
- package/dist/packages/admintasks/src/services/differentialReportService.js.map +1 -1
- package/dist/packages/admintasks/src/services/resEnvProviderService.js +54 -64
- package/dist/packages/admintasks/src/services/resEnvProviderService.js.map +1 -1
- package/dist/packages/admintasks/src/services/restartCorePodsService.js +7 -16
- package/dist/packages/admintasks/src/services/restartCorePodsService.js.map +1 -1
- package/dist/packages/admintasks/src/services/restartDXCoreService.js +15 -24
- package/dist/packages/admintasks/src/services/restartDXCoreService.js.map +1 -1
- package/dist/packages/admintasks/src/services/virtualPortalServices.js +40 -49
- package/dist/packages/admintasks/src/services/virtualPortalServices.js.map +1 -1
- package/dist/packages/admintasks/src/utils/differential-report-utils.js +1042 -1055
- package/dist/packages/admintasks/src/utils/differential-report-utils.js.map +1 -1
- package/dist/packages/dam/package-lock.json +3417 -6718
- package/dist/packages/dam/package.json +12 -8
- package/dist/packages/dam/src/commands/createSecrets.d.ts +1 -1
- package/dist/packages/dam/src/commands/createSecrets.js +38 -45
- package/dist/packages/dam/src/commands/createSecrets.js.map +1 -1
- package/dist/packages/dam/src/commands/deleteDAMStagingMismatch.d.ts +1 -1
- package/dist/packages/dam/src/commands/deleteDAMStagingMismatch.js +22 -33
- package/dist/packages/dam/src/commands/deleteDAMStagingMismatch.js.map +1 -1
- package/dist/packages/dam/src/commands/deleteSchema.d.ts +1 -1
- package/dist/packages/dam/src/commands/deleteSchema.js +48 -59
- package/dist/packages/dam/src/commands/deleteSchema.js.map +1 -1
- package/dist/packages/dam/src/commands/exportAssets.d.ts +1 -1
- package/dist/packages/dam/src/commands/exportAssets.js +58 -69
- package/dist/packages/dam/src/commands/exportAssets.js.map +1 -1
- package/dist/packages/dam/src/commands/findDAMStagingMismatch.d.ts +1 -1
- package/dist/packages/dam/src/commands/findDAMStagingMismatch.js +25 -36
- package/dist/packages/dam/src/commands/findDAMStagingMismatch.js.map +1 -1
- package/dist/packages/dam/src/commands/importAssets.d.ts +1 -1
- package/dist/packages/dam/src/commands/importAssets.js +38 -49
- package/dist/packages/dam/src/commands/importAssets.js.map +1 -1
- package/dist/packages/dam/src/commands/listSchema.d.ts +1 -1
- package/dist/packages/dam/src/commands/listSchema.js +19 -30
- package/dist/packages/dam/src/commands/listSchema.js.map +1 -1
- package/dist/packages/dam/src/commands/stagingMismatchReport.d.ts +1 -1
- package/dist/packages/dam/src/commands/stagingMismatchReport.js +79 -76
- package/dist/packages/dam/src/commands/stagingMismatchReport.js.map +1 -1
- package/dist/packages/dam/src/commands/stagingResync.d.ts +1 -1
- package/dist/packages/dam/src/commands/stagingResync.js +25 -36
- package/dist/packages/dam/src/commands/stagingResync.js.map +1 -1
- package/dist/packages/dam/src/commands/subscriberDeRegistration.d.ts +1 -1
- package/dist/packages/dam/src/commands/subscriberDeRegistration.js +19 -30
- package/dist/packages/dam/src/commands/subscriberDeRegistration.js.map +1 -1
- package/dist/packages/dam/src/commands/subscriberDetails.d.ts +1 -1
- package/dist/packages/dam/src/commands/subscriberDetails.js +24 -35
- package/dist/packages/dam/src/commands/subscriberDetails.js.map +1 -1
- package/dist/packages/dam/src/commands/subscriberRegistration.d.ts +1 -1
- package/dist/packages/dam/src/commands/subscriberRegistration.js +34 -45
- package/dist/packages/dam/src/commands/subscriberRegistration.js.map +1 -1
- package/dist/packages/dam/src/commands/triggerDAMStaging.d.ts +1 -1
- package/dist/packages/dam/src/commands/triggerDAMStaging.js +19 -30
- package/dist/packages/dam/src/commands/triggerDAMStaging.js.map +1 -1
- package/dist/packages/dam/src/commands/triggerDamReindexing.d.ts +1 -1
- package/dist/packages/dam/src/commands/triggerDamReindexing.js +26 -38
- package/dist/packages/dam/src/commands/triggerDamReindexing.js.map +1 -1
- package/dist/packages/dam/src/commands/updateSecrets.d.ts +1 -1
- package/dist/packages/dam/src/commands/updateSecrets.js +36 -47
- package/dist/packages/dam/src/commands/updateSecrets.js.map +1 -1
- package/dist/packages/dam/src/commands/validateAssets.d.ts +1 -1
- package/dist/packages/dam/src/commands/validateAssets.js +29 -40
- package/dist/packages/dam/src/commands/validateAssets.js.map +1 -1
- package/dist/packages/dam/src/errors/CommandLineMessages_en.json +1 -1
- package/dist/packages/dam/src/export/collection.d.ts +8 -8
- package/dist/packages/dam/src/export/collection.js +71 -80
- package/dist/packages/dam/src/export/collection.js.map +1 -1
- package/dist/packages/dam/src/export/favorite.d.ts +1 -1
- package/dist/packages/dam/src/export/favorite.js +10 -19
- package/dist/packages/dam/src/export/favorite.js.map +1 -1
- package/dist/packages/dam/src/export/media-item.d.ts +4 -4
- package/dist/packages/dam/src/export/media-item.js +61 -56
- package/dist/packages/dam/src/export/media-item.js.map +1 -1
- package/dist/packages/dam/src/export/media-type-group.d.ts +1 -1
- package/dist/packages/dam/src/export/media-type-group.js +7 -16
- package/dist/packages/dam/src/export/media-type-group.js.map +1 -1
- package/dist/packages/dam/src/export/media-type.d.ts +1 -1
- package/dist/packages/dam/src/export/media-type.js +7 -16
- package/dist/packages/dam/src/export/media-type.js.map +1 -1
- package/dist/packages/dam/src/export/renditions.d.ts +6 -6
- package/dist/packages/dam/src/export/renditions.js +78 -73
- package/dist/packages/dam/src/export/renditions.js.map +1 -1
- package/dist/packages/dam/src/import/collection.d.ts +3 -3
- package/dist/packages/dam/src/import/collection.js +26 -35
- package/dist/packages/dam/src/import/collection.js.map +1 -1
- package/dist/packages/dam/src/import/favorite.d.ts +1 -1
- package/dist/packages/dam/src/import/favorite.js +8 -17
- package/dist/packages/dam/src/import/favorite.js.map +1 -1
- package/dist/packages/dam/src/import/media-items.d.ts +3 -3
- package/dist/packages/dam/src/import/media-items.js +46 -41
- package/dist/packages/dam/src/import/media-items.js.map +1 -1
- package/dist/packages/dam/src/import/media-type-group.d.ts +1 -1
- package/dist/packages/dam/src/import/media-type-group.js +13 -22
- package/dist/packages/dam/src/import/media-type-group.js.map +1 -1
- package/dist/packages/dam/src/import/media-type.d.ts +1 -1
- package/dist/packages/dam/src/import/media-type.js +12 -21
- package/dist/packages/dam/src/import/media-type.js.map +1 -1
- package/dist/packages/dam/src/import/permission.d.ts +3 -3
- package/dist/packages/dam/src/import/permission.js +21 -30
- package/dist/packages/dam/src/import/permission.js.map +1 -1
- package/dist/packages/dam/src/import/renditions.d.ts +6 -6
- package/dist/packages/dam/src/import/renditions.js +69 -64
- package/dist/packages/dam/src/import/renditions.js.map +1 -1
- package/dist/packages/dam/src/services/authService.d.ts +1 -1
- package/dist/packages/dam/src/services/authService.js +9 -18
- package/dist/packages/dam/src/services/authService.js.map +1 -1
- package/dist/packages/dam/src/services/stagingService.js +94 -85
- package/dist/packages/dam/src/services/stagingService.js.map +1 -1
- package/dist/packages/dam/src/services/tokenCache.d.ts +1 -1
- package/dist/packages/dam/src/services/tokenCache.js +30 -41
- package/dist/packages/dam/src/services/tokenCache.js.map +1 -1
- package/dist/packages/dam/src/utils/constants.js +3 -3
- package/dist/packages/dam/src/utils/constants.js.map +1 -1
- package/dist/packages/dam/src/utils/service.js +59 -70
- package/dist/packages/dam/src/utils/service.js.map +1 -1
- package/dist/packages/dam/src/validation/collection-list-validate.js +26 -35
- package/dist/packages/dam/src/validation/collection-list-validate.js.map +1 -1
- package/dist/packages/dam/src/validation/media-list-validate.js +44 -39
- package/dist/packages/dam/src/validation/media-list-validate.js.map +1 -1
- package/dist/packages/dam/src/validation/media-type-group-validate.js +5 -14
- package/dist/packages/dam/src/validation/media-type-group-validate.js.map +1 -1
- package/dist/packages/dam/src/validation/media-type-validate.js +5 -14
- package/dist/packages/dam/src/validation/media-type-validate.js.map +1 -1
- package/dist/packages/dam/src/validation/root-validate.js +10 -19
- package/dist/packages/dam/src/validation/root-validate.js.map +1 -1
- package/dist/packages/dam/src/validation/validate.rendition.js +17 -26
- package/dist/packages/dam/src/validation/validate.rendition.js.map +1 -1
- package/dist/packages/dam/src/validation/validate.versions.js +16 -25
- package/dist/packages/dam/src/validation/validate.versions.js.map +1 -1
- package/dist/packages/deployportlet/package-lock.json +9910 -12666
- package/dist/packages/deployportlet/package.json +20 -6
- package/dist/packages/deployportlet/src/commands/deployPortlet.d.ts +1 -1
- package/dist/packages/deployportlet/src/commands/deployPortlet.js +65 -62
- package/dist/packages/deployportlet/src/commands/deployPortlet.js.map +1 -1
- package/dist/packages/deployportlet/src/commands/undeployPortlet.d.ts +1 -1
- package/dist/packages/deployportlet/src/commands/undeployPortlet.js +80 -77
- package/dist/packages/deployportlet/src/commands/undeployPortlet.js.map +1 -1
- package/dist/packages/deployportlet/src/commands/xmlaccess.d.ts +1 -1
- package/dist/packages/deployportlet/src/commands/xmlaccess.js +18 -25
- package/dist/packages/deployportlet/src/commands/xmlaccess.js.map +1 -1
- package/dist/packages/deployportlet/src/messages/messages_en.json +1 -1
- package/dist/packages/deployportlet/src/services/undeployPortletServices.d.ts +1 -1
- package/dist/packages/deployportlet/src/services/undeployPortletServices.js +34 -43
- package/dist/packages/deployportlet/src/services/undeployPortletServices.js.map +1 -1
- package/dist/packages/deployscriptapplication/package-lock.json +6386 -12749
- package/dist/packages/deployscriptapplication/package.json +12 -5
- package/dist/packages/deployscriptapplication/src/commands/pull.d.ts +1 -2
- package/dist/packages/deployscriptapplication/src/commands/pull.js +146 -159
- package/dist/packages/deployscriptapplication/src/commands/pull.js.map +1 -1
- package/dist/packages/deployscriptapplication/src/commands/push.d.ts +3 -3
- package/dist/packages/deployscriptapplication/src/commands/push.js +149 -157
- package/dist/packages/deployscriptapplication/src/commands/push.js.map +1 -1
- package/dist/packages/deployscriptapplication/src/commands/restoreScriptApplication.d.ts +2 -2
- package/dist/packages/deployscriptapplication/src/commands/restoreScriptApplication.js +88 -101
- package/dist/packages/deployscriptapplication/src/commands/restoreScriptApplication.js.map +1 -1
- package/dist/packages/deployscriptapplication/src/commands/undeployScriptApplication.d.ts +2 -2
- package/dist/packages/deployscriptapplication/src/commands/undeployScriptApplication.js +118 -131
- package/dist/packages/deployscriptapplication/src/commands/undeployScriptApplication.js.map +1 -1
- package/dist/packages/deployscriptapplication/src/util/constants.js.map +1 -1
- package/dist/packages/deployscriptapplication/src/util/generic.js.map +1 -1
- package/dist/packages/deploytheme/package-lock.json +7434 -13135
- package/dist/packages/deploytheme/package.json +10 -7
- package/dist/packages/deploytheme/src/commands/deployApplication.d.ts +1 -1
- package/dist/packages/deploytheme/src/commands/deployApplication.js +87 -84
- package/dist/packages/deploytheme/src/commands/deployApplication.js.map +1 -1
- package/dist/packages/deploytheme/src/commands/deployTheme.d.ts +4 -4
- package/dist/packages/deploytheme/src/commands/deployTheme.js +223 -226
- package/dist/packages/deploytheme/src/commands/deployTheme.js.map +1 -1
- package/dist/packages/deploytheme/src/commands/undeployApplication.d.ts +1 -1
- package/dist/packages/deploytheme/src/commands/undeployApplication.js +21 -32
- package/dist/packages/deploytheme/src/commands/undeployApplication.js.map +1 -1
- package/dist/packages/deploytheme/src/commands/undeployTheme.d.ts +4 -4
- package/dist/packages/deploytheme/src/commands/undeployTheme.js +214 -223
- package/dist/packages/deploytheme/src/commands/undeployTheme.js.map +1 -1
- package/dist/packages/deploytheme/src/services/themeServices.js +97 -90
- package/dist/packages/deploytheme/src/services/themeServices.js.map +1 -1
- package/dist/packages/livesync/package-lock.json +2201 -3750
- package/dist/packages/livesync/package.json +10 -6
- package/dist/packages/livesync/src/commands/pullTheme.d.ts +2 -2
- package/dist/packages/livesync/src/commands/pullTheme.js +62 -75
- package/dist/packages/livesync/src/commands/pullTheme.js.map +1 -1
- package/dist/packages/livesync/src/commands/pullWcmDesignLibrary.d.ts +2 -1
- package/dist/packages/livesync/src/commands/pullWcmDesignLibrary.js +260 -286
- package/dist/packages/livesync/src/commands/pullWcmDesignLibrary.js.map +1 -1
- package/dist/packages/livesync/src/commands/pushTheme.d.ts +6 -6
- package/dist/packages/livesync/src/commands/pushTheme.js +125 -140
- package/dist/packages/livesync/src/commands/pushTheme.js.map +1 -1
- package/dist/packages/livesync/src/commands/pushWcmDesignLibrary.d.ts +4 -4
- package/dist/packages/livesync/src/commands/pushWcmDesignLibrary.js +554 -553
- package/dist/packages/livesync/src/commands/pushWcmDesignLibrary.js.map +1 -1
- package/dist/packages/livesync/src/errors/CommandLineMessages_en.json +7 -2
- package/dist/packages/livesync/src/messages/messages_en.json +1 -0
- package/dist/packages/livesync/src/services/EventsQueue.js +11 -24
- package/dist/packages/livesync/src/services/EventsQueue.js.map +1 -1
- package/dist/packages/livesync/src/services/foldersWcmServices.js +21 -30
- package/dist/packages/livesync/src/services/foldersWcmServices.js.map +1 -1
- package/dist/packages/livesync/src/services/htmlComponentWcmServices.js +19 -28
- package/dist/packages/livesync/src/services/htmlComponentWcmServices.js.map +1 -1
- package/dist/packages/livesync/src/services/initialSyncServices.js +65 -81
- package/dist/packages/livesync/src/services/initialSyncServices.js.map +1 -1
- package/dist/packages/livesync/src/services/livesyncUtils.js +54 -49
- package/dist/packages/livesync/src/services/livesyncUtils.js.map +1 -1
- package/dist/packages/livesync/src/services/metadataServices.js +113 -77
- package/dist/packages/livesync/src/services/metadataServices.js.map +1 -1
- package/dist/packages/livesync/src/services/ongoingSyncServices.js +188 -182
- package/dist/packages/livesync/src/services/ongoingSyncServices.js.map +1 -1
- package/dist/packages/livesync/src/services/presentationTemplateWcmServices.js +19 -28
- package/dist/packages/livesync/src/services/presentationTemplateWcmServices.js.map +1 -1
- package/dist/packages/livesync/src/services/styleSheetComponentWcmServices.js +18 -27
- package/dist/packages/livesync/src/services/styleSheetComponentWcmServices.js.map +1 -1
- package/dist/packages/livesync/src/services/wcmContext/initialSync.js +29 -23
- package/dist/packages/livesync/src/services/wcmContext/initialSync.js.map +1 -1
- package/dist/packages/livesync/src/services/wcmContext/stylesheetComponent.js +221 -225
- package/dist/packages/livesync/src/services/wcmContext/stylesheetComponent.js.map +1 -1
- package/dist/packages/livesync/src/services/wcmContext/wcmLibraryContext.js +4 -4
- package/dist/packages/livesync/src/services/wcmContext/wcmLibraryContext.js.map +1 -1
- package/dist/packages/livesync/src/services/wcmRestV2Services.js +20 -26
- package/dist/packages/livesync/src/services/wcmRestV2Services.js.map +1 -1
- package/dist/packages/livesync/src/types/EventHandler.type.d.ts +1 -1
- package/dist/packages/livesync/src/types/EventQueueItem.type.d.ts +2 -2
- package/dist/packages/livesync/src/types/OngoingSyncHooks.type.d.ts +1 -1
- package/dist/packages/livesync/src/types/WCMDesignLibraryCache.type.d.ts +1 -1
- package/dist/packages/livesync/src/types/WcmRestApiV2.type.d.ts +8 -8
- package/dist/packages/livesync/src/types/index.d.ts +15 -0
- package/dist/packages/livesync/src/types/index.js +5 -1
- package/dist/packages/livesync/src/types/index.js.map +1 -1
- package/dist/packages/mls_exim/package-lock.json +2910 -5990
- package/dist/packages/mls_exim/package.json +10 -6
- package/dist/packages/mls_exim/src/export/mlsExport.d.ts +2 -2
- package/dist/packages/mls_exim/src/export/mlsExport.js +81 -78
- package/dist/packages/mls_exim/src/export/mlsExport.js.map +1 -1
- package/dist/packages/mls_exim/src/export/mlsExport.ts +9 -9
- package/dist/packages/mls_exim/src/import/mlsImport.d.ts +1 -1
- package/dist/packages/mls_exim/src/import/mlsImport.js +36 -47
- package/dist/packages/mls_exim/src/import/mlsImport.js.map +1 -1
- package/dist/packages/mls_exim/src/import/mlsImport.ts +3 -3
- package/dist/packages/sharedlibrary/package-lock.json +6222 -12628
- package/dist/packages/sharedlibrary/package.json +9 -6
- package/dist/packages/sharedlibrary/src/commands/delete.d.ts +1 -1
- package/dist/packages/sharedlibrary/src/commands/delete.js +40 -37
- package/dist/packages/sharedlibrary/src/commands/delete.js.map +1 -1
- package/dist/packages/sharedlibrary/src/commands/upload.d.ts +1 -1
- package/dist/packages/sharedlibrary/src/commands/upload.js +73 -70
- package/dist/packages/sharedlibrary/src/commands/upload.js.map +1 -1
- package/dist/packages/sharedlibrary/src/errors/CommandLineMessages_en.json +1 -0
- package/dist/packages/sharedlibrary/src/services/sharedLibraryServices.js +29 -30
- package/dist/packages/sharedlibrary/src/services/sharedLibraryServices.js.map +1 -1
- package/dist/packages/syndication/package-lock.json +9912 -12668
- package/dist/packages/syndication/package.json +21 -7
- package/dist/packages/syndication/src/commands/subscriber.d.ts +1 -1
- package/dist/packages/syndication/src/commands/subscriber.js +43 -43
- package/dist/packages/syndication/src/commands/subscriber.js.map +1 -1
- package/dist/packages/syndication/src/commands/syndicator.d.ts +1 -1
- package/dist/packages/syndication/src/commands/syndicator.js +33 -44
- package/dist/packages/syndication/src/commands/syndicator.js.map +1 -1
- package/dist/packages/syndication/src/commands/syndicatorFailedItem.d.ts +1 -1
- package/dist/packages/syndication/src/commands/syndicatorFailedItem.js +81 -78
- package/dist/packages/syndication/src/commands/syndicatorFailedItem.js.map +1 -1
- package/dist/packages/syndication/src/errors/CommandLineMessages_en.json +3 -1
- package/dist/packages/syndication/src/services/syndicationService.d.ts +8 -8
- package/dist/packages/syndication/src/services/syndicationService.js +67 -48
- package/dist/packages/syndication/src/services/syndicationService.js.map +1 -1
- package/dist/src/errors/CommandLineMessages_en.json +6 -1
- package/dist/src/index.js +1113 -944
- package/dist/src/index.js.map +1 -1
- package/dist/src/services/apiServices.js +184 -177
- package/dist/src/services/apiServices.js.map +1 -1
- package/dist/src/services/filesServices.d.ts +1 -1
- package/dist/src/services/filesServices.js +28 -23
- package/dist/src/services/filesServices.js.map +1 -1
- package/dist/src/services/requestService.js +16 -22
- package/dist/src/services/requestService.js.map +1 -1
- package/dist/src/utils/constants.d.ts +1 -1
- package/dist/src/utils/constants.js +59 -59
- package/dist/src/utils/constants.js.map +1 -1
- package/dist/src/utils/helpFormatter.d.ts +6 -0
- package/dist/src/utils/helpFormatter.js +34 -0
- package/dist/src/utils/helpFormatter.js.map +1 -0
- package/dist/src/utils/logger.d.ts +1 -0
- package/dist/src/utils/logger.js +58 -61
- package/dist/src/utils/logger.js.map +1 -1
- package/dist/src/utils/utils.d.ts +7 -6
- package/dist/src/utils/utils.js +126 -113
- package/dist/src/utils/utils.js.map +1 -1
- package/dist/src/utils/validateOptions.d.ts +3 -3
- package/dist/src/utils/validateOptions.js +378 -333
- package/dist/src/utils/validateOptions.js.map +1 -1
- package/package.json +17 -17
package/dist/src/index.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -76,8 +67,9 @@ const stagingResync_1 = require("../packages/dam/src/commands/stagingResync");
|
|
|
76
67
|
const deleteDAMStagingMismatch_1 = require("../packages/dam/src/commands/deleteDAMStagingMismatch");
|
|
77
68
|
const wcmRestV2Services_1 = require("../packages/livesync/src/services/wcmRestV2Services");
|
|
78
69
|
const metadataServices_1 = require("../packages/livesync/src/services/metadataServices");
|
|
70
|
+
const helpFormatter_1 = require("./utils/helpFormatter");
|
|
79
71
|
const MaskData = require('maskdata');
|
|
80
|
-
const config = utils_1.getConfigJSON();
|
|
72
|
+
const config = (0, utils_1.getConfigJSON)();
|
|
81
73
|
const program = new commander_1.default.Command();
|
|
82
74
|
program.version(package_json_1.default.version || 'missing version info');
|
|
83
75
|
program.description(package_json_1.default.description || 'missing description');
|
|
@@ -93,6 +85,7 @@ program.on('--help', () => {
|
|
|
93
85
|
logger_1.logger.help(' $ dxclient deploy-theme');
|
|
94
86
|
logger_1.logger.help(' $ dxclient undeploy-theme');
|
|
95
87
|
logger_1.logger.help(' $ dxclient deploy-application');
|
|
88
|
+
logger_1.logger.help(' $ dxclient undeploy-application');
|
|
96
89
|
logger_1.logger.help(' $ dxclient mls-export');
|
|
97
90
|
logger_1.logger.help(' $ dxclient mls-import');
|
|
98
91
|
logger_1.logger.help(' $ dxclient manage-syndicator');
|
|
@@ -115,10 +108,10 @@ program.on('--help', () => {
|
|
|
115
108
|
logger_1.logger.help(' $ dxclient wcm-library-import');
|
|
116
109
|
logger_1.logger.help(' $ dxclient dx-core-configuration-reports summary-report');
|
|
117
110
|
logger_1.logger.help(' $ dxclient manage-dam-assets export-assets | import-assets | validate-assets');
|
|
118
|
-
if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
119
|
-
logger_1.logger.help(` $ dxclient livesync push-theme | pull-theme${utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC_WCM) ? ' | push-wcm-design-library | pull-wcm-design-library' : ''}`);
|
|
111
|
+
if ((0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
112
|
+
logger_1.logger.help(` $ dxclient livesync push-theme | pull-theme${(0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.LIVESYNC_WCM) ? ' | push-wcm-design-library | pull-wcm-design-library' : ''}`);
|
|
120
113
|
}
|
|
121
|
-
if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.DAM_REINDEXING)) {
|
|
114
|
+
if ((0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.DAM_REINDEXING)) {
|
|
122
115
|
logger_1.logger.help(' $ dxclient trigger-dam-reindexing');
|
|
123
116
|
}
|
|
124
117
|
logger_1.logger.help(' $ dxclient accept-license');
|
|
@@ -135,14 +128,15 @@ program.on('--help', () => {
|
|
|
135
128
|
}
|
|
136
129
|
});
|
|
137
130
|
program.command(constants_1.COMMANDS.VERSION_COMPAT)
|
|
138
|
-
.
|
|
139
|
-
.
|
|
140
|
-
.
|
|
141
|
-
.
|
|
142
|
-
.
|
|
131
|
+
.requiredOption('--hostname [value]', 'Host name of the DX Core server', config.hostname)
|
|
132
|
+
.requiredOption('--dxConnectPort [value]', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
133
|
+
.requiredOption('--dxConnectProtocol [value]', 'Protocol of the cw_profile', config.dxConnectProtocol.toString())
|
|
134
|
+
.requiredOption('--dxConnectUsername [value]', 'Username for the cw_profile', config.dxConnectUsername)
|
|
135
|
+
.requiredOption('--dxConnectPassword [value]', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
143
136
|
.description('- Show version compatibility details between DX Core and DXClient.')
|
|
144
|
-
.
|
|
145
|
-
|
|
137
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient version-compat --hostname localhost --dxConnectProtocol https --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'))
|
|
138
|
+
.action(async (cmdOptions) => {
|
|
139
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.VERSION_COMPAT);
|
|
146
140
|
try {
|
|
147
141
|
if (process.env.DXCLIENT_TYPE && process.env.DXCLIENT_TYPE === 'container') {
|
|
148
142
|
logger_1.logger.help('\n Note: This installation is a container-based version of DXClient.\n');
|
|
@@ -150,149 +144,169 @@ program.command(constants_1.COMMANDS.VERSION_COMPAT)
|
|
|
150
144
|
else {
|
|
151
145
|
logger_1.logger.help('\n Note: This installation is a node-based version of DXClient.\n');
|
|
152
146
|
}
|
|
153
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
154
|
-
|
|
147
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
148
|
+
await (0, utils_1.validateVersionMapping)(cmdOptions);
|
|
155
149
|
}
|
|
156
150
|
catch (error) {
|
|
157
151
|
logger_1.logger.error(error.message);
|
|
158
|
-
|
|
152
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
159
153
|
}
|
|
160
|
-
})
|
|
154
|
+
});
|
|
161
155
|
program
|
|
162
156
|
.command(constants_1.COMMANDS.DEPLOY_PORTLET)
|
|
163
|
-
.requiredOption('
|
|
164
|
-
.requiredOption('
|
|
165
|
-
.requiredOption('
|
|
166
|
-
.requiredOption('
|
|
167
|
-
.requiredOption('
|
|
168
|
-
.requiredOption('
|
|
169
|
-
.requiredOption('
|
|
170
|
-
.requiredOption('
|
|
171
|
-
.requiredOption('
|
|
172
|
-
.requiredOption('
|
|
173
|
-
.requiredOption('
|
|
157
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
158
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
159
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
160
|
+
.requiredOption('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
|
|
161
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
162
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
163
|
+
.requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
164
|
+
.requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
165
|
+
.requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
166
|
+
.requiredOption('--xmlFile <value>', 'Input xml file name with full path')
|
|
167
|
+
.requiredOption('--warFile <value>', 'War file name with full path ')
|
|
174
168
|
.description('- Deploys the portlet to the DX Core server')
|
|
175
|
-
.
|
|
176
|
-
|
|
169
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient deploy-portlet --dxProtocol https --hostname localhost --dxPort 10041 --xmlConfigPath /wps/config --dxUsername wpsadmin --dxPassword wpsadmin --dxConnectUsername wpsadmin'
|
|
170
|
+
+ ' --dxConnectPassword wpsadmin --dxConnectPort 10202 --xmlFile /user/deploy-portlet/test.xml --warFile /user/deploy-portlet/test.war'))
|
|
171
|
+
.action(async (cmdOptions) => {
|
|
172
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.DEPLOY_PORTLET);
|
|
177
173
|
logger_1.logger.debug('Deploy portlet execution started');
|
|
178
174
|
try {
|
|
179
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
180
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
175
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
176
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
181
177
|
}
|
|
182
178
|
catch (error) {
|
|
183
179
|
logger_1.logger.error(error.message);
|
|
184
|
-
|
|
180
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
185
181
|
}
|
|
186
182
|
const deployPortletObj = new deployPortlet_1.DeployPortlet();
|
|
187
183
|
try {
|
|
188
|
-
const responseCode =
|
|
184
|
+
const responseCode = await deployPortletObj.invoke(cmdOptions);
|
|
189
185
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
190
186
|
logger_1.logger.debug('Deploy portlet execution completed');
|
|
191
|
-
|
|
187
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
192
188
|
}
|
|
193
189
|
catch (error) {
|
|
194
190
|
logger_1.logger.debug('Exception in execution of deploy portlet : %o', error);
|
|
195
|
-
|
|
191
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
196
192
|
}
|
|
197
|
-
})
|
|
193
|
+
});
|
|
198
194
|
program
|
|
199
195
|
.command(constants_1.COMMANDS.UNDEPLOY_PORTLET)
|
|
200
|
-
.requiredOption('
|
|
201
|
-
.requiredOption('
|
|
202
|
-
.requiredOption('
|
|
203
|
-
.requiredOption('
|
|
204
|
-
.requiredOption('
|
|
205
|
-
.requiredOption('
|
|
206
|
-
.requiredOption('
|
|
207
|
-
.option('
|
|
208
|
-
.option('
|
|
209
|
-
.option('
|
|
210
|
-
.option('
|
|
211
|
-
.option('
|
|
212
|
-
.option('
|
|
213
|
-
.option('
|
|
196
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
197
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
198
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
199
|
+
.requiredOption('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
|
|
200
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
201
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
202
|
+
.requiredOption('--xmlFile <value>', 'XML file name with full path ')
|
|
203
|
+
.option('--enableBackup <value>', 'Set the flag to true to take backup of the Portlets that to be undeployed', config.enableBackup)
|
|
204
|
+
.option('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
205
|
+
.option('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
206
|
+
.option('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
207
|
+
.option('--dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
|
|
208
|
+
.option('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
|
|
209
|
+
.option('--dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
|
|
214
210
|
.description('- Undeploys the portlet from the DX Core server.')
|
|
215
|
-
.
|
|
216
|
-
|
|
211
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient undeploy-portlet --dxProtocol https --hostname localhost --dxPort 10041 --xmlConfigPath /wps/config --dxUsername wpsadmin'
|
|
212
|
+
+ ' --dxPassword wpsadmin --xmlFile /user/undeploy-portlet/test.xml --enableBackup false --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
|
|
213
|
+
+ ' --dxConnectPort 10202 --dxSoapPort 10033 --dxProfileName wp_profile --dxProfilePath /opt/HCL/wp_profile'))
|
|
214
|
+
.action(async (cmdOptions) => {
|
|
215
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.UNDEPLOY_PORTLET);
|
|
217
216
|
logger_1.logger.debug('undeploy portlet execution started');
|
|
218
217
|
try {
|
|
219
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
220
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
218
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
219
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
221
220
|
}
|
|
222
221
|
catch (error) {
|
|
223
222
|
logger_1.logger.error(error.message);
|
|
224
|
-
|
|
223
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
225
224
|
}
|
|
226
225
|
const undeployPortletObj = new undeployPortlet_1.UndeployPortlet();
|
|
227
226
|
try {
|
|
228
|
-
const responseCode =
|
|
227
|
+
const responseCode = await undeployPortletObj.invoke(cmdOptions);
|
|
229
228
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
230
229
|
logger_1.logger.debug('undeploy portlet execution completed');
|
|
231
|
-
|
|
230
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
232
231
|
}
|
|
233
232
|
catch (error) {
|
|
234
233
|
logger_1.logger.debug('Exception in execution of xml access : %o', error);
|
|
235
|
-
|
|
234
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
236
235
|
}
|
|
237
|
-
})
|
|
236
|
+
});
|
|
238
237
|
program
|
|
239
238
|
.command(constants_1.COMMANDS.XMLACCESS)
|
|
240
|
-
.requiredOption('
|
|
241
|
-
.requiredOption('
|
|
242
|
-
.requiredOption('
|
|
243
|
-
.requiredOption('
|
|
244
|
-
.requiredOption('
|
|
245
|
-
.requiredOption('
|
|
246
|
-
.requiredOption('
|
|
239
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
240
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
241
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
242
|
+
.requiredOption('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
|
|
243
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
244
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
245
|
+
.requiredOption('--xmlFile <value>', 'XML file name with full path ')
|
|
246
|
+
.option('--xmlAccessOutputFileName <value>', 'File name for the XML access output', config.xmlAccessOutputFileName)
|
|
247
247
|
.description('- Executes xml access tasks on the DX Core server.')
|
|
248
|
-
.
|
|
249
|
-
|
|
248
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient xmlaccess --dxProtocol https --hostname localhost --dxPort 10041 --xmlConfigPath /wps/config --dxUsername wpsadmin'
|
|
249
|
+
+ ' --dxPassword wpsadmin --xmlFile /user/xmlaccess/fullPageExport.xml --xmlAccessOutputFileName test.xml'))
|
|
250
|
+
.action(async (cmdOptions) => {
|
|
251
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.XMLACCESS);
|
|
250
252
|
logger_1.logger.debug('Xmlaccess execution started');
|
|
251
253
|
try {
|
|
252
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
253
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
254
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
255
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
254
256
|
}
|
|
255
257
|
catch (error) {
|
|
256
258
|
logger_1.logger.error(error.message);
|
|
257
|
-
|
|
259
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
258
260
|
}
|
|
259
261
|
try {
|
|
260
262
|
const xmlAccess = new xmlaccess_1.XmlAccess();
|
|
261
|
-
const responseCode =
|
|
263
|
+
const responseCode = await xmlAccess.invoke(cmdOptions);
|
|
262
264
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
263
265
|
logger_1.logger.debug('Xmlaccess execution completed');
|
|
264
|
-
|
|
266
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
265
267
|
}
|
|
266
268
|
catch (error) {
|
|
267
269
|
logger_1.logger.debug('Exception in execution of xml access : %o', error);
|
|
268
|
-
|
|
270
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
269
271
|
}
|
|
270
|
-
})
|
|
272
|
+
});
|
|
271
273
|
program
|
|
272
274
|
.command('deploy-scriptapplication [subCmd]')
|
|
273
|
-
.requiredOption('
|
|
274
|
-
.requiredOption('
|
|
275
|
-
.requiredOption('
|
|
276
|
-
.requiredOption('
|
|
277
|
-
.requiredOption('
|
|
278
|
-
.requiredOption('
|
|
279
|
-
.requiredOption('
|
|
280
|
-
.requiredOption('
|
|
281
|
-
.requiredOption('
|
|
282
|
-
.requiredOption('
|
|
283
|
-
.option('
|
|
284
|
-
.option('
|
|
285
|
-
.option('
|
|
286
|
-
.option('
|
|
287
|
-
.option('
|
|
288
|
-
.option('
|
|
275
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
276
|
+
.requiredOption('--hostname <value>', 'Hostname of the DX Core server', config.hostname)
|
|
277
|
+
.requiredOption('--dxPort <value>', 'Port number for DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
278
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
279
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
280
|
+
.requiredOption('--wcmSiteArea <value>', 'Web Content Manager site area in which Script Application instances are created', config.wcmSiteArea)
|
|
281
|
+
.requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
|
|
282
|
+
.requiredOption('--mainHtmlFile <value>', 'Path to the main .html file of the Script Application', '')
|
|
283
|
+
.requiredOption('--wcmContentId <value>', 'Web Content Manager content ID of an existing Script Application instance on a portal page', config.wcmContentId)
|
|
284
|
+
.requiredOption('--wcmContentTitle <value>', 'Sets or updates the title of the Script Application instance', '')
|
|
285
|
+
.option('--contentRoot <value>', 'Absolute or relative path to a directory on the workstation that contains the content to be pushed to the portal')
|
|
286
|
+
.option('--wcmContentPath <value>', 'Full Web Content Manager path, including library and site area', config.wcmContentPath)
|
|
287
|
+
.option('--wcmContentName <value>', 'Name of the Script Application instance to be created or updated', config.wcmContentName)
|
|
288
|
+
.option('--prebuiltZip <value>', 'Path to an existing compressed file that provides the content to be pushed to the portal')
|
|
289
|
+
.option('--virtualPortalContext <value>', 'Context of the virtual portal that contains the Script Application instance', config.virtualPortalContext)
|
|
290
|
+
.option('--projectContext <value>', 'Context of the portal project that manages the publication of changes to the Script Application content', config.projectContext)
|
|
289
291
|
.option('-h, --help')
|
|
290
292
|
.description('- creates or updates the content of a Script Application instance')
|
|
291
|
-
.action((subCmd, cmd) =>
|
|
292
|
-
if ((subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PULL || subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PUSH) && (
|
|
293
|
+
.action(async (subCmd, cmd) => {
|
|
294
|
+
if ((subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PULL || subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PUSH) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
293
295
|
logger_1.logger.help('\n This command allows user to create or update (push) or fetch (pull) the content in a Script Application in DX Core');
|
|
294
|
-
logger_1.logger.help('\n Usage: dxclient deploy-scriptapplication [options] [subCmd]');
|
|
295
|
-
logger_1.logger.help(
|
|
296
|
+
logger_1.logger.help('\n Usage: dxclient deploy-scriptapplication [options] [subCmd] \n');
|
|
297
|
+
logger_1.logger.help(`- Create or update the content of a Script Application instance for ${subCmd} \n`);
|
|
298
|
+
}
|
|
299
|
+
if (subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PULL) {
|
|
300
|
+
logger_1.logger.help(' \nExample : dxclient deploy-scriptapplication pull --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
301
|
+
+ ' --contenthandlerPath /wps/mycontenthandler --wcmContentId 987654356789\n');
|
|
302
|
+
}
|
|
303
|
+
if (subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PUSH) {
|
|
304
|
+
logger_1.logger.help(' \nExample : dxclient deploy-scriptapplication push --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
305
|
+
+ ' --contenthandlerPath /wps/mycontenthandler --prebuiltZip /temp/DemoScriptApplication.zip --wcmSiteArea "Script Application Library/Script Applications/" '
|
|
306
|
+
+ ' --wcmContentName DemoScriptApplication --mainHtmlFile /temp/DemoScriptApplication/index.html \n');
|
|
307
|
+
}
|
|
308
|
+
if ((subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PULL || subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PUSH) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
309
|
+
logger_1.logger.help('Options:\n');
|
|
296
310
|
logger_1.logger.help(` -dxProtocol, --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
|
|
297
311
|
logger_1.logger.help(` -hostname, --hostname <value> Hostname of the DX Core server (default: "${config.hostname}")`);
|
|
298
312
|
logger_1.logger.help(` -dxPort, --dxPort <value> Port number for DX Core server, for any Kubernetes Environment default port is 443 \
|
|
@@ -314,7 +328,7 @@ Script Application content (default: "${config.projectContext}")`);
|
|
|
314
328
|
logger_1.logger.help(` -wcmSiteArea, --wcmSiteArea <value> Web Content Manager site area in which Script Application instances are created (default: "${config.wcmSiteArea}")`);
|
|
315
329
|
logger_1.logger.help(` -contenthandlerPath, --contenthandlerPath <value> Alternate path for the portal context root or the content handler servlet \
|
|
316
330
|
(default: "${config.contenthandlerPath}")`);
|
|
317
|
-
logger_1.logger.help(' -mainHtmlFile, --mainHtmlFile <value> Path to the main .html file
|
|
331
|
+
logger_1.logger.help(' -mainHtmlFile, --mainHtmlFile <value> Path or relative path to the main .html file within the Script Application.');
|
|
318
332
|
logger_1.logger.help(` -wcmContentId, --wcmContentId <value> Web Content Manager content ID of an existing Script Application instance on a portal\
|
|
319
333
|
page (default: "${config.wcmContentId}")`);
|
|
320
334
|
logger_1.logger.help(' -wcmContentTitle, --wcmContentTitle <value> Sets or updates the title of the Script Application instance (default: "")');
|
|
@@ -336,565 +350,605 @@ Script Application content (default: "${config.projectContext}")`);
|
|
|
336
350
|
}
|
|
337
351
|
else {
|
|
338
352
|
const command = subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PULL ? constants_1.COMMANDS.SCRIPT_APPLICATION_PULL : constants_1.COMMANDS.SCRIPT_APPLICATION_PUSH;
|
|
339
|
-
commands_1.configureCommand(command);
|
|
340
|
-
cmd = utils_1.unmaskPasswords(cmd);
|
|
341
|
-
validateOptions_1.validateOptions(cmd);
|
|
353
|
+
(0, commands_1.configureCommand)(command);
|
|
354
|
+
cmd = (0, utils_1.unmaskPasswords)(cmd);
|
|
355
|
+
(0, validateOptions_1.validateOptions)(cmd);
|
|
342
356
|
}
|
|
343
357
|
}
|
|
344
358
|
catch (error) {
|
|
345
359
|
logger_1.logger.error(error.message);
|
|
346
|
-
|
|
360
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
347
361
|
}
|
|
348
362
|
if (subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PULL) {
|
|
349
363
|
logger_1.logger.debug('Deploy script application execution started');
|
|
350
364
|
const pull = new pull_1.Pull();
|
|
351
365
|
try {
|
|
352
|
-
const responseCode =
|
|
366
|
+
const responseCode = await pull.pullScriptApplication(cmd);
|
|
353
367
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
354
368
|
logger_1.logger.debug('Deploy script application execution completed');
|
|
355
|
-
|
|
369
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
356
370
|
}
|
|
357
371
|
catch (error) {
|
|
358
372
|
logger_1.logger.debug('Exception in execution of script application : %o', error);
|
|
359
|
-
|
|
373
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
360
374
|
}
|
|
361
375
|
}
|
|
362
376
|
else if (subCmd === constants_1.SUB_COMMANDS.SCRIPT_APPLICATION_PUSH) {
|
|
363
377
|
logger_1.logger.debug('Deploy script application execution started');
|
|
364
378
|
try {
|
|
365
379
|
const push = new push_1.PushSP();
|
|
366
|
-
const responseCode =
|
|
380
|
+
const responseCode = await push.pushScriptApplication(cmd);
|
|
367
381
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
368
382
|
logger_1.logger.debug('Deploy script application execution completed');
|
|
369
383
|
if (responseCode.results && responseCode.results.status === constants_1.ResponseStatus.SUCCESS) {
|
|
370
|
-
|
|
384
|
+
await (0, utils_1.flushLogAndExitProcess)(true);
|
|
371
385
|
}
|
|
372
386
|
else {
|
|
373
|
-
|
|
387
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
374
388
|
}
|
|
375
389
|
}
|
|
376
390
|
catch (error) {
|
|
377
391
|
logger_1.logger.debug('Exception in execution of script application : %o', error);
|
|
378
|
-
|
|
392
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
379
393
|
}
|
|
380
394
|
}
|
|
381
|
-
})
|
|
395
|
+
})
|
|
382
396
|
.helpOption(false);
|
|
383
397
|
program
|
|
384
398
|
.command(constants_1.COMMANDS.UNDEPLOY_SCRIPTAPPLICATION)
|
|
385
|
-
.requiredOption('
|
|
386
|
-
.requiredOption('
|
|
387
|
-
.requiredOption('
|
|
388
|
-
.requiredOption('
|
|
389
|
-
.requiredOption('
|
|
390
|
-
.requiredOption('
|
|
391
|
-
.requiredOption('
|
|
392
|
-
.option('
|
|
393
|
-
.option('
|
|
399
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
400
|
+
.requiredOption('--hostname <value>', 'Hostname of the DX Core server', config.hostname)
|
|
401
|
+
.requiredOption('--dxPort <value>', 'Port number for DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
402
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
403
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
404
|
+
.requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
|
|
405
|
+
.requiredOption('--wcmContentId <value>', 'Web Content Manager content ID of an existing Script Application instance on a portal page', config.wcmContentId)
|
|
406
|
+
.option('--virtualPortalContext <value>', 'Context of the virtual portal that contains the Script Application instance', config.virtualPortalContext)
|
|
407
|
+
.option('--projectContext <value>', 'Context of the portal project that manages the publication of changes to the Script Application content', config.projectContext)
|
|
394
408
|
.option('-f, --force', 'Delete the Script Application forcefully')
|
|
395
|
-
.option('
|
|
409
|
+
.option('--enableBackup <value>', 'Set the flag to true to take backup of the script application to be undeployed', config.enableBackup)
|
|
396
410
|
.description('- Undeploys the script application from the DX Core server')
|
|
397
|
-
.
|
|
398
|
-
|
|
411
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient undeploy-scriptapplication --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
412
|
+
+ ' --contenthandlerPath /wps/mycontenthandler --wcmContentId 89023456738239 --enableBackup false -f'))
|
|
413
|
+
.action(async (cmd) => {
|
|
414
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.UNDEPLOY_SCRIPTAPPLICATION);
|
|
399
415
|
try {
|
|
400
|
-
cmd = utils_1.unmaskPasswords(cmd);
|
|
401
|
-
validateOptions_1.validateOptions(cmd);
|
|
416
|
+
cmd = (0, utils_1.unmaskPasswords)(cmd);
|
|
417
|
+
(0, validateOptions_1.validateOptions)(cmd);
|
|
402
418
|
}
|
|
403
419
|
catch (error) {
|
|
404
420
|
logger_1.logger.error(error.message);
|
|
405
|
-
|
|
421
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
406
422
|
}
|
|
407
423
|
try {
|
|
408
424
|
const undeployScriptApplication = new undeployScriptApplication_1.UndeployScriptApplication();
|
|
409
425
|
logger_1.logger.debug('Undeploy scriptapplication execution started');
|
|
410
|
-
const responseCode =
|
|
426
|
+
const responseCode = await undeployScriptApplication.invoke(cmd);
|
|
411
427
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
412
428
|
logger_1.logger.debug('Undeploy scriptapplication execution completed');
|
|
413
|
-
|
|
429
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
414
430
|
}
|
|
415
431
|
catch (error) {
|
|
416
432
|
logger_1.logger.debug('Exception in execution of undeploy scriptapplication : %o', error);
|
|
417
|
-
|
|
433
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
418
434
|
}
|
|
419
|
-
})
|
|
435
|
+
});
|
|
420
436
|
program
|
|
421
437
|
.command(constants_1.COMMANDS.RESTORE_SCRIPTAPPLICATION)
|
|
422
|
-
.requiredOption('
|
|
423
|
-
.requiredOption('
|
|
424
|
-
.requiredOption('
|
|
425
|
-
.requiredOption('
|
|
426
|
-
.requiredOption('
|
|
427
|
-
.requiredOption('
|
|
428
|
-
.requiredOption('
|
|
429
|
-
.requiredOption('
|
|
430
|
-
.requiredOption('
|
|
431
|
-
.option('
|
|
432
|
-
.option('
|
|
438
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
439
|
+
.requiredOption('--hostname <value>', 'Hostname of the DX Core server', config.hostname)
|
|
440
|
+
.requiredOption('--dxPort <value>', 'Port number for DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
441
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
442
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
443
|
+
.requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
|
|
444
|
+
.requiredOption('--wcmContentId <value>', 'Web Content Manager content ID of an existing Script Application instance on a portal page', '')
|
|
445
|
+
.requiredOption('--versionName <value>', 'Name of the version that should become the current version of Script Application', '')
|
|
446
|
+
.requiredOption('--restoreAsPublished <value>', 'Restore as a draft or replace the published version of Script Application', config.restoreAsPublished)
|
|
447
|
+
.option('--virtualPortalContext <value>', 'Context of the virtual portal that contains the Script Application instance', config.virtualPortalContext)
|
|
448
|
+
.option('--projectContext <value>', 'Context of the portal project that manages the publication of changes to the Script Application content', config.projectContext)
|
|
433
449
|
.description('- Restores script application to version specified or if not, its previous by default')
|
|
434
|
-
.
|
|
435
|
-
|
|
450
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient restore-scriptapplication --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
451
|
+
+ ' --contenthandlerPath /wps/mycontenthandler --wcmContentID 89023456738239 --versionName 3 --restoreAsPublished false'))
|
|
452
|
+
.action(async (cmd) => {
|
|
453
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.RESTORE_SCRIPTAPPLICATION);
|
|
436
454
|
try {
|
|
437
|
-
cmd = utils_1.unmaskPasswords(cmd);
|
|
438
|
-
validateOptions_1.validateOptions(cmd);
|
|
455
|
+
cmd = (0, utils_1.unmaskPasswords)(cmd);
|
|
456
|
+
(0, validateOptions_1.validateOptions)(cmd);
|
|
439
457
|
}
|
|
440
458
|
catch (error) {
|
|
441
459
|
logger_1.logger.error(error.message);
|
|
442
|
-
|
|
460
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
443
461
|
}
|
|
444
462
|
const restoreScriptApplication = new restoreScriptApplication_1.RestoreScriptApplication();
|
|
445
463
|
logger_1.logger.debug('Restore scriptapplication execution started');
|
|
446
464
|
try {
|
|
447
|
-
const responseCode =
|
|
465
|
+
const responseCode = await restoreScriptApplication.invoke(cmd);
|
|
448
466
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
449
467
|
logger_1.logger.debug('Restore scriptapplication execution completed');
|
|
450
|
-
|
|
468
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
451
469
|
}
|
|
452
470
|
catch (error) {
|
|
453
471
|
logger_1.logger.debug('Exception in execution of Restore scriptapplication : %o', error);
|
|
454
|
-
|
|
472
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
455
473
|
}
|
|
456
|
-
})
|
|
474
|
+
});
|
|
457
475
|
program
|
|
458
476
|
.command(constants_1.COMMANDS.DEPLOY_THEME)
|
|
459
|
-
.requiredOption('
|
|
460
|
-
.requiredOption('
|
|
461
|
-
.requiredOption('
|
|
462
|
-
.requiredOption('
|
|
463
|
-
.requiredOption('
|
|
464
|
-
.requiredOption('
|
|
465
|
-
.requiredOption('
|
|
466
|
-
.requiredOption('
|
|
467
|
-
.requiredOption('
|
|
468
|
-
.option('
|
|
469
|
-
.requiredOption('
|
|
470
|
-
.requiredOption('
|
|
471
|
-
.requiredOption('
|
|
472
|
-
.option('
|
|
473
|
-
.option('
|
|
474
|
-
.option('
|
|
475
|
-
.option('
|
|
476
|
-
.option('
|
|
477
|
-
.option('
|
|
477
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
478
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
479
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
480
|
+
.requiredOption('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
|
|
481
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
482
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
483
|
+
.requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
|
|
484
|
+
.requiredOption('--dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
|
|
485
|
+
.requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
|
|
486
|
+
.option('--dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
|
|
487
|
+
.requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
488
|
+
.requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
489
|
+
.requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
490
|
+
.option('--xmlFile <value>', 'Input xml file name with full path')
|
|
491
|
+
.option('--applicationFile <value>', 'Application file name with full path')
|
|
492
|
+
.option('--applicationName <value>', 'Application name')
|
|
493
|
+
.option('--themeName <value>', 'Theme Collection name')
|
|
494
|
+
.option('--themePath <value>', 'Theme Path with zip or folder name')
|
|
495
|
+
.option('--requestId <value>', 'Unique Id of a previously triggered deploy theme request.')
|
|
478
496
|
.description('- Deploys the theme(EAR or WebDav packages) to the DX Core server')
|
|
479
|
-
.
|
|
480
|
-
|
|
497
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient deploy-theme --dxProtocol https --hostname localhost --dxPort 10041 --xmlConfigPath /wps/config --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
498
|
+
+ ' --contenthandlerPath /wps/mycontenthandler --dxSoapPort 10033 --dxProfileName wp_profile --dxProfilePath /opt/HCL/wp_profile --dxConnectUsername wpsadmin'
|
|
499
|
+
+ ' --dxConnectPassword wpsadmin --dxConnectPort 10202 --xmlFile /user/deploy-theme/test.xml --applicationFile /user/deploy-theme/application.xml'
|
|
500
|
+
+ ' --applicationName testApplication --themeName testTheme --themePath /user/deploy-theme/test.xml'))
|
|
501
|
+
.action(async (cmdOptions) => {
|
|
502
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.DEPLOY_THEME);
|
|
481
503
|
logger_1.logger.debug('Deploy theme execution started');
|
|
482
504
|
try {
|
|
483
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
484
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
505
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
506
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
485
507
|
}
|
|
486
508
|
catch (error) {
|
|
487
509
|
logger_1.logger.error(error.message);
|
|
488
|
-
|
|
510
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
489
511
|
}
|
|
490
512
|
try {
|
|
491
513
|
const deployThemeObj = new deployTheme_1.DeployTheme();
|
|
492
|
-
const responseCode =
|
|
514
|
+
const responseCode = await deployThemeObj.invoke(cmdOptions);
|
|
493
515
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
494
516
|
logger_1.logger.debug('Deploy theme execution completed');
|
|
495
|
-
|
|
517
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
496
518
|
}
|
|
497
519
|
catch (error) {
|
|
498
520
|
logger_1.logger.debug('Exception in execution : %o', error);
|
|
499
|
-
|
|
521
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
500
522
|
}
|
|
501
|
-
})
|
|
523
|
+
});
|
|
502
524
|
program
|
|
503
525
|
.command(constants_1.COMMANDS.UNDEPLOY_THEME)
|
|
504
|
-
.requiredOption('
|
|
505
|
-
.requiredOption('
|
|
506
|
-
.requiredOption('
|
|
507
|
-
.requiredOption('
|
|
508
|
-
.requiredOption('
|
|
509
|
-
.requiredOption('
|
|
510
|
-
.requiredOption('
|
|
511
|
-
.requiredOption('
|
|
512
|
-
.requiredOption('
|
|
513
|
-
.option('
|
|
514
|
-
.requiredOption('
|
|
515
|
-
.requiredOption('
|
|
516
|
-
.requiredOption('
|
|
517
|
-
.option('
|
|
518
|
-
.option('
|
|
519
|
-
.option('
|
|
520
|
-
.option('
|
|
526
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
527
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
528
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
529
|
+
.requiredOption('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
|
|
530
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
531
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
532
|
+
.requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
|
|
533
|
+
.requiredOption('--dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
|
|
534
|
+
.requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
|
|
535
|
+
.option('--dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
|
|
536
|
+
.requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
537
|
+
.requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
538
|
+
.requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
539
|
+
.option('--xmlFile <value>', 'Input xml file name with full path to unregister the theme')
|
|
540
|
+
.option('--applicationName <value>', 'Application name')
|
|
541
|
+
.option('--themeName <value>', 'Theme Collection name')
|
|
542
|
+
.option('--enableBackup <value>', 'Set the flag to true to take backup of the theme to be undeployed', config.enableBackup)
|
|
521
543
|
.description('- Undeploys the theme(EAR or WebDav packages) from the DX Core server')
|
|
522
|
-
.
|
|
523
|
-
|
|
544
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient undeploy-theme --dxProtocol https --hostname localhost --dxPort 10041 --xmlConfigPath /wps/config --dxUsername wpsadmin'
|
|
545
|
+
+ ' --dxPassword wpsadmin --contenthandlerPath /wps/mycontenthandler --dxSoapPort 10033 --dxProfileName wp_profile --dxProfilePath /opt/HCL/wp_profile --dxConnectUsername wpsadmin'
|
|
546
|
+
+ ' --dxConnectPassword wpsadmin --dxConnectPort 10202 --xmlFile /user/undeploy-theme/test.xml --applicationName test --themeName testTheme --enableBackup true'))
|
|
547
|
+
.action(async (cmdOptions) => {
|
|
548
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.UNDEPLOY_THEME);
|
|
524
549
|
logger_1.logger.debug('Undeploy theme execution started');
|
|
525
550
|
try {
|
|
526
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
527
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
551
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
552
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
528
553
|
}
|
|
529
554
|
catch (error) {
|
|
530
555
|
logger_1.logger.error(error.message);
|
|
531
|
-
|
|
556
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
532
557
|
}
|
|
533
558
|
try {
|
|
534
559
|
const undeployThemeObj = new undeployTheme_1.UndeployTheme();
|
|
535
|
-
const responseCode =
|
|
560
|
+
const responseCode = await undeployThemeObj.invoke(cmdOptions);
|
|
536
561
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
537
562
|
logger_1.logger.debug('Undeploy theme execution completed');
|
|
538
|
-
|
|
563
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
539
564
|
}
|
|
540
565
|
catch (error) {
|
|
541
566
|
logger_1.logger.debug('Exception in execution : %o', error);
|
|
542
|
-
|
|
567
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
543
568
|
}
|
|
544
|
-
})
|
|
569
|
+
});
|
|
545
570
|
program
|
|
546
571
|
.command(constants_1.COMMANDS.DEPLOY_APPLICATION)
|
|
547
|
-
.requiredOption('
|
|
548
|
-
.requiredOption('
|
|
549
|
-
.requiredOption('
|
|
550
|
-
.requiredOption('
|
|
551
|
-
.requiredOption('
|
|
552
|
-
.requiredOption('
|
|
553
|
-
.requiredOption('
|
|
554
|
-
.option('
|
|
555
|
-
.requiredOption('
|
|
556
|
-
.requiredOption('
|
|
557
|
-
.requiredOption('
|
|
558
|
-
.requiredOption('
|
|
559
|
-
.requiredOption('
|
|
560
|
-
.requiredOption('
|
|
561
|
-
.option('
|
|
572
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
573
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
574
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
575
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
576
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
577
|
+
.requiredOption('--dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
|
|
578
|
+
.requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
|
|
579
|
+
.option('--dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
|
|
580
|
+
.requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
581
|
+
.requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
582
|
+
.requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
583
|
+
.requiredOption('--dxConnectProtocol <value>', 'Protocol of the cw_profile', config.dxConnectProtocol.toString())
|
|
584
|
+
.requiredOption('--applicationFile <value>', 'Application file name with full path')
|
|
585
|
+
.requiredOption('--applicationName <value>', 'Application name')
|
|
586
|
+
.option('--requestId <value>', 'Unique Id of a previously triggered deploy application request.')
|
|
562
587
|
.description('- Deploys the application to the DX Core server')
|
|
563
|
-
.
|
|
564
|
-
|
|
588
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient deploy-application --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin --dxSoapPort 10033 --dxProfileName wp_profile'
|
|
589
|
+
+ ' --dxProfilePath /opt/HCL/wp_profile --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxConnectPort 10202 --dxConnectProtocol https'
|
|
590
|
+
+ ' --applicationFile /user/deploy-application/test.xml --applicationName test'))
|
|
591
|
+
.action(async (cmdOptions) => {
|
|
592
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.DEPLOY_APPLICATION);
|
|
565
593
|
logger_1.logger.debug('Deploy Application execution started');
|
|
566
594
|
try {
|
|
567
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
568
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
595
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
596
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
569
597
|
}
|
|
570
598
|
catch (error) {
|
|
571
599
|
logger_1.logger.error(error.message);
|
|
572
|
-
|
|
600
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
573
601
|
}
|
|
574
602
|
try {
|
|
575
603
|
const deployApplicationObj = new deployApplication_1.DeployApplication();
|
|
576
|
-
const responseCode =
|
|
604
|
+
const responseCode = await deployApplicationObj.invoke(cmdOptions);
|
|
577
605
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
578
606
|
logger_1.logger.debug('Deploy Application execution completed');
|
|
579
|
-
|
|
607
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
580
608
|
}
|
|
581
609
|
catch (error) {
|
|
582
610
|
logger_1.logger.debug('Exception in execution : %o', error);
|
|
583
|
-
|
|
611
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
584
612
|
}
|
|
585
|
-
})
|
|
613
|
+
});
|
|
586
614
|
program
|
|
587
615
|
.command(constants_1.COMMANDS.UNDEPLOY_APPLICATION)
|
|
588
|
-
.requiredOption('
|
|
589
|
-
.requiredOption('
|
|
590
|
-
.requiredOption('
|
|
591
|
-
.requiredOption('
|
|
592
|
-
.requiredOption('
|
|
593
|
-
.requiredOption('
|
|
594
|
-
.requiredOption('
|
|
595
|
-
.requiredOption('
|
|
596
|
-
.requiredOption('
|
|
597
|
-
.requiredOption('
|
|
598
|
-
.requiredOption('
|
|
599
|
-
.requiredOption('
|
|
600
|
-
.option('
|
|
616
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
617
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
618
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
619
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
620
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
621
|
+
.requiredOption('--dxSoapPort <value>', 'Soap Port number of the DX Core server ', config.dxSoapPort)
|
|
622
|
+
.requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
|
|
623
|
+
.requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
624
|
+
.requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
625
|
+
.requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
626
|
+
.requiredOption('--dxConnectProtocol <value>', 'Protocol of the cw_profile', config.dxConnectProtocol.toString())
|
|
627
|
+
.requiredOption('--applicationName <value>', 'Application name')
|
|
628
|
+
.option('--enableBackup <value>', 'Set the flag to true to take backup of the application to be undeployed', config.enableBackup)
|
|
601
629
|
.description('- Undeploys the application from the DX Core server')
|
|
602
|
-
.
|
|
603
|
-
|
|
630
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient undeploy-application --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
631
|
+
+ ' --dxSoapPort 10033 --dxProfileName wp_profile --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxConnectPort 10202 --dxConnectProtocol https'
|
|
632
|
+
+ ' --applicationName /user/undeploy-application/test.xml --enableBackup false'))
|
|
633
|
+
.action(async (cmdOptions) => {
|
|
634
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.UNDEPLOY_APPLICATION);
|
|
604
635
|
logger_1.logger.debug('Undeploy Application execution started');
|
|
605
636
|
try {
|
|
606
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
607
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
637
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
638
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
608
639
|
}
|
|
609
640
|
catch (error) {
|
|
610
641
|
logger_1.logger.error(error.message);
|
|
611
|
-
|
|
642
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
612
643
|
}
|
|
613
644
|
try {
|
|
614
645
|
const undeployApplicationObj = new undeployApplication_1.UndeployApplication();
|
|
615
|
-
const responseCode =
|
|
646
|
+
const responseCode = await undeployApplicationObj.invoke(cmdOptions);
|
|
616
647
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
617
648
|
logger_1.logger.debug('Undeploy Application execution completed');
|
|
618
|
-
|
|
649
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
619
650
|
}
|
|
620
651
|
catch (error) {
|
|
621
652
|
logger_1.logger.debug('Exception in execution : %o', error);
|
|
622
|
-
|
|
653
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
623
654
|
}
|
|
624
|
-
})
|
|
655
|
+
});
|
|
625
656
|
program
|
|
626
657
|
.command(constants_1.COMMANDS.MLS_EXPORT)
|
|
627
|
-
.requiredOption('
|
|
628
|
-
.requiredOption('
|
|
629
|
-
.requiredOption('
|
|
630
|
-
.requiredOption('
|
|
631
|
-
.requiredOption('
|
|
632
|
-
.requiredOption('
|
|
633
|
-
.option('
|
|
634
|
-
.option('
|
|
635
|
-
.option('
|
|
636
|
-
.option('
|
|
637
|
-
.option('
|
|
638
|
-
.option('
|
|
658
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
659
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
660
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
661
|
+
.requiredOption('--contenthandlerPath <value>', 'Alternate path to the contenthandler servlet on the DX Core server', config.contenthandlerPath)
|
|
662
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
663
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
664
|
+
.option('--wcmLibraryId <value>', 'WCM Library ID', config.wcmLibraryId)
|
|
665
|
+
.option('--wcmLibraryName <value>', 'WCM Library Name', config.wcmLibraryName)
|
|
666
|
+
.option('--lastModifiedAfter <value>', 'Last Modified After is in GMT Format', config.lastModifiedAfter)
|
|
667
|
+
.option('--wcmProjectName <value>', 'WCM project name to export the contents of the specified project', config.wcmProjectName)
|
|
668
|
+
.option('--exportPath <value>', 'Location of the file path to export')
|
|
669
|
+
.option('--virtualPortalContext <value>', 'Context of the virtual portal of the DX Core server', config.virtualPortalContext)
|
|
639
670
|
.description('- Exports the source contents from a library into a .csv file at the location specified')
|
|
640
|
-
.
|
|
641
|
-
|
|
671
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient mls-export --dxProtocol https --hostname localhost --dxPort 10041 --contenthandlerPath /wps/mycontenthandler --dxUsername wpsadmin'
|
|
672
|
+
+ ' --dxPassword wpsadmin --wcmLibraryId 97765345736538 --wcmLibraryName tetslib --exportPath /user/store/mls-export/'))
|
|
673
|
+
.action(async (cmdOptions) => {
|
|
674
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.MLS_EXPORT);
|
|
642
675
|
logger_1.logger.debug('Exports the source contents execution started');
|
|
643
676
|
try {
|
|
644
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
645
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
677
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
678
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
646
679
|
}
|
|
647
680
|
catch (error) {
|
|
648
681
|
logger_1.logger.error(error.message);
|
|
649
|
-
|
|
682
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
650
683
|
}
|
|
651
684
|
const mlsExportObj = new mlsExport_1.MLSExport();
|
|
652
685
|
try {
|
|
653
|
-
const responseCode =
|
|
686
|
+
const responseCode = await mlsExportObj.invoke(cmdOptions);
|
|
654
687
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
655
688
|
logger_1.logger.debug('Exporting the source contents execution completed');
|
|
656
|
-
|
|
689
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
657
690
|
}
|
|
658
691
|
catch (error) {
|
|
659
692
|
logger_1.logger.debug('Exception in execution of exporting the source contents : %o', error);
|
|
660
|
-
|
|
693
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
661
694
|
}
|
|
662
|
-
})
|
|
695
|
+
});
|
|
663
696
|
program
|
|
664
697
|
.command(constants_1.COMMANDS.MLS_IMPORT)
|
|
665
|
-
.requiredOption('
|
|
666
|
-
.requiredOption('
|
|
667
|
-
.requiredOption('
|
|
668
|
-
.requiredOption('
|
|
669
|
-
.requiredOption('
|
|
670
|
-
.requiredOption('
|
|
671
|
-
.requiredOption('
|
|
672
|
-
.option('
|
|
673
|
-
.option('
|
|
674
|
-
.option('
|
|
698
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
699
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
700
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
701
|
+
.requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
|
|
702
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
703
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
704
|
+
.requiredOption('--importPath <value>', 'Location of the file path(s) (separated by comma) to import')
|
|
705
|
+
.option('--wcmProjectName <value>', 'Project for which the contents to be imported', config.wcmProjectName)
|
|
706
|
+
.option('--forceImport <value>', 'Flag to forcefully import the content')
|
|
707
|
+
.option('--virtualPortalContext <value>', 'Context of the virtual portal of the DX Core server', config.virtualPortalContext)
|
|
675
708
|
.description('- Imports the source contents from a CSV file into DX at the location specified')
|
|
676
|
-
.
|
|
677
|
-
|
|
709
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient mls-import --dxProtocol https --hostname localhost --dxPort 443 --contenthandlerPath /wps/mycontenthandler --dxUsername wpsadmin'
|
|
710
|
+
+ ' --dxPassword wpsadmin --importPath /user/store/mls-export/test.xml'))
|
|
711
|
+
.action(async (cmdOptions) => {
|
|
712
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.MLS_IMPORT);
|
|
678
713
|
logger_1.logger.debug('Imports the source contents execution started');
|
|
679
714
|
try {
|
|
680
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
681
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
715
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
716
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
682
717
|
}
|
|
683
718
|
catch (error) {
|
|
684
719
|
logger_1.logger.error(error.message);
|
|
685
|
-
|
|
720
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
686
721
|
}
|
|
687
722
|
const mlsImportObj = new mlsImport_1.MLSImport();
|
|
688
723
|
try {
|
|
689
|
-
const responseCode =
|
|
724
|
+
const responseCode = await mlsImportObj.invoke(cmdOptions);
|
|
690
725
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
691
726
|
logger_1.logger.debug('Importing the source contents into DX execution completed');
|
|
692
|
-
|
|
727
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
693
728
|
}
|
|
694
729
|
catch (error) {
|
|
695
730
|
logger_1.logger.debug('Exception in execution of importation the source contents : %o', error);
|
|
696
|
-
|
|
731
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
697
732
|
}
|
|
698
|
-
})
|
|
733
|
+
});
|
|
699
734
|
program
|
|
700
735
|
.command(`${constants_1.COMMANDS.MANAGE_SYNDICATOR} [subCmd]`)
|
|
701
|
-
.requiredOption('
|
|
702
|
-
.requiredOption('
|
|
703
|
-
.requiredOption('
|
|
704
|
-
.requiredOption('
|
|
705
|
-
.requiredOption('
|
|
706
|
-
.requiredOption('
|
|
707
|
-
.requiredOption('
|
|
708
|
-
.option('
|
|
736
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
737
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
738
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
739
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
740
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
741
|
+
.requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
|
|
742
|
+
.requiredOption('--UUID <value>', 'UUID of the syndicator instance', '')
|
|
743
|
+
.option('--enable <value>', 'Use true or false to enable or disable the syndicator')
|
|
709
744
|
.option('-h, --help')
|
|
710
745
|
.description('- Manages the syndicator in DX Server (Enable/Disable or helps to get syndicator report)')
|
|
711
|
-
.action((subCmd, cmd) =>
|
|
712
|
-
if (
|
|
746
|
+
.action(async (subCmd, cmd, options) => {
|
|
747
|
+
if (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP)) {
|
|
713
748
|
logger_1.logger.help('Usage: dxclient manage-syndicator [options] [subCmd](get-syndication-report)\n');
|
|
714
749
|
logger_1.logger.help(' - Manages the syndicator in DX Server (Enable/Disable or helps to get syndicator report)\n');
|
|
715
|
-
logger_1.logger.help(
|
|
716
|
-
|
|
717
|
-
logger_1.logger.help(`
|
|
750
|
+
logger_1.logger.help(' \nExample : dxclient manage-syndicator get-syndication-report --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin'
|
|
751
|
+
+ ' --dxPassword wpsadmin --contenthandlerPath /wps/mycontenthandler --UUID 958476536576 \n');
|
|
752
|
+
logger_1.logger.help(` --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
|
|
753
|
+
logger_1.logger.help(` --hostname <value> Hostname of the DX Core server (default: "${config.hostname}")`);
|
|
754
|
+
logger_1.logger.help(` --dxPort <value> Port number for DX Core server, for any Kubernetes Environment default port is 443 \
|
|
718
755
|
(default: "${config.dxPort.toString()}")`);
|
|
719
|
-
logger_1.logger.help(`
|
|
720
|
-
logger_1.logger.help(`
|
|
721
|
-
logger_1.logger.help(`
|
|
722
|
-
logger_1.logger.help('
|
|
723
|
-
if (
|
|
724
|
-
logger_1.logger.help('
|
|
725
|
-
}
|
|
726
|
-
logger_1.logger.help('
|
|
756
|
+
logger_1.logger.help(` --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}")`);
|
|
757
|
+
logger_1.logger.help(` --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
|
|
758
|
+
logger_1.logger.help(` --contenthandlerPath <value> Alternate path for the portal context root or the content handler servlet (default: "${config.contenthandlerPath}")`);
|
|
759
|
+
logger_1.logger.help(' --UUID <value> UUID of the syndicator instance');
|
|
760
|
+
if (options.parent.args[0] === constants_1.COMMANDS.MANAGE_SYNDICATOR && !subCmd) {
|
|
761
|
+
logger_1.logger.help(' --enable <value> Use true or false to enable or disable the syndicator');
|
|
762
|
+
}
|
|
763
|
+
logger_1.logger.help(' -h, --help Display help for command');
|
|
727
764
|
process.exit(1);
|
|
728
765
|
}
|
|
729
766
|
try {
|
|
730
767
|
const command = subCmd ? constants_1.COMMANDS.GET_SYNDICATION_REPORT : constants_1.COMMANDS.MANAGE_SYNDICATOR;
|
|
731
|
-
commands_1.configureCommand(command);
|
|
768
|
+
(0, commands_1.configureCommand)(command);
|
|
732
769
|
logger_1.logger.debug('Manage syndicator execution started');
|
|
733
|
-
cmd = utils_1.unmaskPasswords(cmd);
|
|
734
|
-
validateOptions_1.validateOptions(cmd);
|
|
770
|
+
cmd = (0, utils_1.unmaskPasswords)(cmd);
|
|
771
|
+
(0, validateOptions_1.validateOptions)(cmd);
|
|
735
772
|
}
|
|
736
773
|
catch (error) {
|
|
737
774
|
logger_1.logger.error(error.message);
|
|
738
|
-
|
|
775
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
739
776
|
}
|
|
740
777
|
if (subCmd === constants_1.COMMANDS.GET_SYNDICATION_REPORT) {
|
|
741
778
|
const syndicatorFailedItems = new syndicatorFailedItem_1.SyndicatorFailedItem();
|
|
742
779
|
try {
|
|
743
|
-
const responseCode =
|
|
780
|
+
const responseCode = await syndicatorFailedItems.invoke(cmd);
|
|
744
781
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
745
782
|
logger_1.logger.debug('Syndication failed item execution completed');
|
|
746
|
-
|
|
783
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
747
784
|
}
|
|
748
785
|
catch (error) {
|
|
749
786
|
logger_1.logger.debug('Exception in Syndication failed item: %o', error);
|
|
750
|
-
|
|
787
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
751
788
|
}
|
|
752
789
|
}
|
|
753
790
|
else if (!subCmd && cmd._name === constants_1.COMMANDS.MANAGE_SYNDICATOR) {
|
|
754
791
|
const syndicator = new syndicator_1.Syndicator();
|
|
755
792
|
try {
|
|
756
|
-
const responseCode =
|
|
793
|
+
const responseCode = await syndicator.invoke(cmd);
|
|
757
794
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
758
795
|
logger_1.logger.debug('Manage syndicator execution completed');
|
|
759
|
-
|
|
796
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
760
797
|
}
|
|
761
798
|
catch (error) {
|
|
762
799
|
logger_1.logger.debug('Exception in manage syndicator: %o', error);
|
|
763
|
-
|
|
800
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
764
801
|
}
|
|
765
802
|
}
|
|
766
|
-
})
|
|
803
|
+
})
|
|
767
804
|
.helpOption(false);
|
|
768
805
|
program
|
|
769
806
|
.command(constants_1.COMMANDS.MANAGE_SUBSCRIBER)
|
|
770
|
-
.requiredOption('
|
|
771
|
-
.requiredOption('
|
|
772
|
-
.requiredOption('
|
|
773
|
-
.requiredOption('
|
|
774
|
-
.requiredOption('
|
|
775
|
-
.requiredOption('
|
|
776
|
-
.requiredOption('
|
|
777
|
-
.option('
|
|
807
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
808
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
809
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
810
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
811
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
812
|
+
.requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
|
|
813
|
+
.requiredOption('--UUID <value>', 'UUID of the subscriber instance', '')
|
|
814
|
+
.option('--enable <value>', 'Use true or false to enable or disable the subscriber')
|
|
778
815
|
.description('- Manages the subscriber in DX Server(Enable/Disable)')
|
|
779
|
-
.
|
|
780
|
-
|
|
816
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient manage-subscriber --dxProtocol https --hostname localhost --dxPort 443 --dxUsername wpsadmin'
|
|
817
|
+
+ ' --dxPassword wpsadmin --contenthandlerPath /wps/mycontenthandler --UUID 958476536576 -enable true '))
|
|
818
|
+
.action(async (cmdOptions) => {
|
|
819
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.MANAGE_SUBSCRIBER);
|
|
781
820
|
logger_1.logger.debug('Manage subscriber execution started');
|
|
782
821
|
try {
|
|
783
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
784
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
822
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
823
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
785
824
|
}
|
|
786
825
|
catch (error) {
|
|
787
826
|
logger_1.logger.error(error.message);
|
|
788
|
-
|
|
827
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
789
828
|
}
|
|
790
829
|
const subscriber = new subscriber_1.Subscriber();
|
|
791
830
|
try {
|
|
792
|
-
const responseCode =
|
|
831
|
+
const responseCode = await subscriber.invoke(cmdOptions);
|
|
793
832
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
794
833
|
logger_1.logger.debug('Manage subscriber execution completed');
|
|
795
|
-
|
|
834
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
796
835
|
}
|
|
797
836
|
catch (error) {
|
|
798
837
|
logger_1.logger.debug('Exception in manage subscriber: %o', error);
|
|
799
|
-
|
|
838
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
800
839
|
}
|
|
801
|
-
})
|
|
840
|
+
});
|
|
802
841
|
program
|
|
803
842
|
.command(constants_1.COMMANDS.RESTART_CORE_PODS)
|
|
804
|
-
.requiredOption('
|
|
805
|
-
.requiredOption('
|
|
806
|
-
.requiredOption('
|
|
807
|
-
.requiredOption('
|
|
843
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
844
|
+
.requiredOption('--hostname <value>', 'Host name of the DX server', config.hostname)
|
|
845
|
+
.requiredOption('--dxWASUsername <value>', 'Username of the DX WAS server', '')
|
|
846
|
+
.requiredOption('--dxWASPassword <value>', 'Password of the DX WAS server', '')
|
|
808
847
|
.description(`- Restarts the DX Core Pods in Kubernetes Deployment.
|
|
809
848
|
Note: Only the user set as wasAdmin in the Helm values is authorised to trigger this command.`)
|
|
810
|
-
.
|
|
811
|
-
|
|
849
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient restart-core-pods --dxProtocol https --hostname localhost --dxWASUsername wpsadmin --dxWASPassword wpsadmin'))
|
|
850
|
+
.action(async (cmdOptions) => {
|
|
851
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.RESTART_CORE_PODS);
|
|
812
852
|
logger_1.logger.debug('Sending DX Core Pods restart request.');
|
|
813
853
|
try {
|
|
814
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
854
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
815
855
|
}
|
|
816
856
|
catch (error) {
|
|
817
857
|
logger_1.logger.error(error.message);
|
|
818
|
-
|
|
858
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
819
859
|
}
|
|
820
860
|
try {
|
|
821
861
|
const restartDXCoreObject = new restartCorePods_1.RestartCorePods();
|
|
822
|
-
const responseCode =
|
|
862
|
+
const responseCode = await restartDXCoreObject.invoke(cmdOptions);
|
|
823
863
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
824
864
|
logger_1.logger.debug('Restart DX Core pods execution completed');
|
|
825
|
-
|
|
865
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
826
866
|
}
|
|
827
867
|
catch (error) {
|
|
828
868
|
logger_1.logger.debug('Exception in execution : %o', error);
|
|
829
|
-
|
|
869
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
830
870
|
}
|
|
831
|
-
})
|
|
871
|
+
});
|
|
832
872
|
program
|
|
833
873
|
.command(constants_1.COMMANDS.RESTART_DXCORE)
|
|
834
|
-
.requiredOption('
|
|
835
|
-
.requiredOption('
|
|
836
|
-
.requiredOption('
|
|
837
|
-
.requiredOption('
|
|
838
|
-
.option('
|
|
839
|
-
.requiredOption('
|
|
840
|
-
.requiredOption('
|
|
841
|
-
.requiredOption('
|
|
842
|
-
.option('
|
|
874
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
875
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
876
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
877
|
+
.requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
|
|
878
|
+
.option('--dxProfilePath <value>', 'Profile path of the DX Core server ', config.dxProfilePath)
|
|
879
|
+
.requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
880
|
+
.requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
881
|
+
.requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
882
|
+
.option('--requestId <value>', 'Unique Id of a previously triggered restart request.')
|
|
843
883
|
.description('- Restarts the DX Core server. This command works for single DX Server instances.')
|
|
844
|
-
.
|
|
845
|
-
|
|
884
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient restart-dx-core --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
885
|
+
+ ' --dxProfileName wp_profile --dxProfilePath /opt/HCL/wp_profile --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxConnectPort 10202'))
|
|
886
|
+
.action(async (cmdOptions) => {
|
|
887
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.RESTART_DXCORE);
|
|
846
888
|
logger_1.logger.debug('Restart DX Core execution started');
|
|
847
889
|
try {
|
|
848
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
849
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
890
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
891
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
850
892
|
}
|
|
851
893
|
catch (error) {
|
|
852
894
|
logger_1.logger.error(error.message);
|
|
853
|
-
|
|
895
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
854
896
|
}
|
|
855
897
|
try {
|
|
856
898
|
const restartDXCoreObject = new restartDXCore_1.RestartDXCore();
|
|
857
|
-
const responseCode =
|
|
899
|
+
const responseCode = await restartDXCoreObject.invoke(cmdOptions);
|
|
858
900
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
859
901
|
logger_1.logger.debug('Restart DX Core execution completed');
|
|
860
|
-
|
|
902
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
861
903
|
}
|
|
862
904
|
catch (error) {
|
|
863
905
|
logger_1.logger.debug('Exception in execution : %o', error);
|
|
864
|
-
|
|
906
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
865
907
|
}
|
|
866
|
-
})
|
|
908
|
+
});
|
|
867
909
|
program
|
|
868
910
|
.command(`${constants_1.COMMANDS.SHARED_LIBRARY} [subCmd]`)
|
|
869
|
-
.requiredOption('
|
|
870
|
-
.requiredOption('
|
|
871
|
-
.requiredOption('
|
|
872
|
-
.requiredOption('
|
|
873
|
-
.requiredOption('
|
|
874
|
-
.requiredOption('
|
|
875
|
-
.requiredOption('
|
|
876
|
-
.option('
|
|
877
|
-
.option('
|
|
911
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
912
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
913
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
914
|
+
.requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
|
|
915
|
+
.requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
916
|
+
.requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
917
|
+
.requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
918
|
+
.option('--libFilePath <value>', 'File/Folder path of the shared library jar files')
|
|
919
|
+
.option('--libFileNames <value>', 'File names of the shared library jar files')
|
|
878
920
|
.option('-h, --help')
|
|
879
921
|
.description('- manages the shared library files in the remote server')
|
|
880
|
-
.action((subCmd, cmd) =>
|
|
881
|
-
if (
|
|
922
|
+
.action(async (subCmd, cmd) => {
|
|
923
|
+
if (subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD) {
|
|
882
924
|
logger_1.logger.help(' Usage: dxclient shared-library [options] [subCmd](upload/delete)\n');
|
|
883
925
|
logger_1.logger.help(' - Uploads/Deletes files in default Shared Library location in DX Core (<dx-profile>/PortalServer/sharedLibrary/DXCLib)\n');
|
|
884
|
-
logger_1.logger.help(
|
|
885
|
-
|
|
886
|
-
|
|
926
|
+
logger_1.logger.help(' \nExample : dxclient shared-library upload --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin --dxProfileName wp_profile'
|
|
927
|
+
+ ' --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxConnectPort 10202 --libFilePath /user/store/output/test.jar \n');
|
|
928
|
+
}
|
|
929
|
+
if (subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_DELETE) {
|
|
930
|
+
logger_1.logger.help(' Usage: dxclient shared-library [options] [subCmd](upload/delete)\n');
|
|
931
|
+
logger_1.logger.help(' - Uploads/Deletes files in default Shared Library location in DX Core (<dx-profile>/PortalServer/sharedLibrary/DXCLib)\n');
|
|
932
|
+
logger_1.logger.help(' \nExample : dxclient shared-library delete --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin --dxProfileName wp_profile'
|
|
933
|
+
+ ' --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxConnectPort 10202 --libFileNames test.jar \n');
|
|
934
|
+
}
|
|
935
|
+
if ((subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD || subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_DELETE) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
936
|
+
logger_1.logger.help('Options:\n');
|
|
937
|
+
logger_1.logger.help(` --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
|
|
938
|
+
logger_1.logger.help(` --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}")`);
|
|
939
|
+
logger_1.logger.help(` --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
|
|
887
940
|
logger_1.logger.help(` -dxProfileName, --dxProfileName <value> Profile name in the DX core server (default: "${config.dxProfileName}")`);
|
|
888
|
-
logger_1.logger.help(`
|
|
889
|
-
logger_1.logger.help(`
|
|
890
|
-
logger_1.logger.help(`
|
|
941
|
+
logger_1.logger.help(` --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
|
|
942
|
+
logger_1.logger.help(` --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
|
|
943
|
+
logger_1.logger.help(` --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
|
|
891
944
|
if (subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD) {
|
|
892
|
-
logger_1.logger.help('
|
|
945
|
+
logger_1.logger.help(' --libFilePath <value> File/Folder path of the shared library files to be uploaded');
|
|
946
|
+
logger_1.logger.help(' -h, --help display help for command');
|
|
893
947
|
}
|
|
894
948
|
if (subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_DELETE) {
|
|
895
|
-
logger_1.logger.help('
|
|
949
|
+
logger_1.logger.help(' --libFileNames <value> File names of shared library files to be deleted');
|
|
950
|
+
logger_1.logger.help(' -h, --help display help for command');
|
|
896
951
|
}
|
|
897
|
-
logger_1.logger.help(' -h, --help display help for command');
|
|
898
952
|
process.exit(1);
|
|
899
953
|
}
|
|
900
954
|
try {
|
|
@@ -904,258 +958,291 @@ program
|
|
|
904
958
|
}
|
|
905
959
|
else {
|
|
906
960
|
const command = subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD ? constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD : constants_1.SUB_COMMANDS.SHARED_LIBRARY_DELETE;
|
|
907
|
-
commands_1.configureCommand(command);
|
|
961
|
+
(0, commands_1.configureCommand)(command);
|
|
908
962
|
logger_1.logger.debug('Manage shared library execution started');
|
|
909
|
-
cmd = utils_1.unmaskPasswords(cmd);
|
|
910
|
-
validateOptions_1.validateOptions(cmd);
|
|
963
|
+
cmd = (0, utils_1.unmaskPasswords)(cmd);
|
|
964
|
+
(0, validateOptions_1.validateOptions)(cmd);
|
|
911
965
|
}
|
|
912
966
|
}
|
|
913
967
|
catch (error) {
|
|
914
968
|
logger_1.logger.error(error.message);
|
|
915
|
-
|
|
969
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
916
970
|
}
|
|
917
971
|
if (subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_UPLOAD) {
|
|
918
972
|
const sharedLibraryUpload = new upload_1.SharedLibraryUpload();
|
|
919
973
|
try {
|
|
920
|
-
const responseCode =
|
|
974
|
+
const responseCode = await sharedLibraryUpload.invoke(cmd);
|
|
921
975
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
922
976
|
logger_1.logger.debug('Shared Library files upload execution completed');
|
|
923
|
-
|
|
977
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
924
978
|
}
|
|
925
979
|
catch (error) {
|
|
926
980
|
logger_1.logger.debug('Exception in Shared Library files upload: %o', error);
|
|
927
|
-
|
|
981
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
928
982
|
}
|
|
929
983
|
}
|
|
930
984
|
else if (subCmd === constants_1.SUB_COMMANDS.SHARED_LIBRARY_DELETE) {
|
|
931
985
|
const sharedLibraryDelete = new delete_1.SharedLibraryDelete();
|
|
932
986
|
try {
|
|
933
|
-
const responseCode =
|
|
987
|
+
const responseCode = await sharedLibraryDelete.invoke(cmd);
|
|
934
988
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
935
989
|
logger_1.logger.debug('Shared Library files delete execution completed');
|
|
936
|
-
|
|
990
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
937
991
|
}
|
|
938
992
|
catch (error) {
|
|
939
993
|
logger_1.logger.debug('Exception in Shared Library files delete: %o', error);
|
|
940
|
-
|
|
994
|
+
logger_1.logger.error(error.message);
|
|
995
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
941
996
|
}
|
|
942
997
|
}
|
|
943
|
-
})
|
|
998
|
+
})
|
|
944
999
|
.helpOption(false);
|
|
945
1000
|
program
|
|
946
1001
|
.command(constants_1.COMMANDS.PZN_EXPORT)
|
|
947
|
-
.requiredOption('
|
|
948
|
-
.requiredOption('
|
|
949
|
-
.requiredOption('
|
|
950
|
-
.requiredOption('
|
|
951
|
-
.requiredOption('
|
|
952
|
-
.option('
|
|
953
|
-
.option('
|
|
1002
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
1003
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
1004
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
1005
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
1006
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
1007
|
+
.option('--dxContextRoot <value>', 'Alternate path to the context root on the DX Core server', config.dxContextRoot)
|
|
1008
|
+
.option('--targetPath <value>', 'The location of the rule or folder containing the rules in the target workspace, which is the parent for the published nodes. '
|
|
954
1009
|
+ 'The target path must exist before publishing (default targetPath is "/")')
|
|
955
|
-
.option('
|
|
1010
|
+
.option('--targetWorkspace <value>', 'The name of the workspace containing the rules in DX Core server')
|
|
956
1011
|
.description('- Exports the personalization rules from the DX Core server')
|
|
957
|
-
.
|
|
958
|
-
|
|
1012
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient pzn-export --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin'
|
|
1013
|
+
+ ' --dxPassword wpsadmin --dxContextRoot /wps'))
|
|
1014
|
+
.action(async (cmdOptions) => {
|
|
1015
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.PZN_EXPORT);
|
|
959
1016
|
logger_1.logger.debug('Export of the PZN rule execution started');
|
|
960
1017
|
try {
|
|
961
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
962
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
1018
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
1019
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
963
1020
|
}
|
|
964
1021
|
catch (error) {
|
|
965
1022
|
logger_1.logger.error(error.message);
|
|
966
|
-
|
|
1023
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
967
1024
|
}
|
|
968
1025
|
const pznRulesExportObj = new pznRulesExport_1.PznRulesExport();
|
|
969
1026
|
try {
|
|
970
|
-
const responseCode =
|
|
1027
|
+
const responseCode = await pznRulesExportObj.invoke(cmdOptions);
|
|
971
1028
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
972
1029
|
logger_1.logger.debug('Export pzn rules execution completed');
|
|
973
|
-
|
|
1030
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
974
1031
|
}
|
|
975
1032
|
catch (error) {
|
|
976
1033
|
logger_1.logger.debug('Exception in execution of export pzn rules : %o', error);
|
|
977
|
-
|
|
1034
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
978
1035
|
}
|
|
979
|
-
})
|
|
1036
|
+
});
|
|
980
1037
|
program
|
|
981
1038
|
.command(constants_1.COMMANDS.PZN_IMPORT)
|
|
982
|
-
.option('
|
|
983
|
-
.option('
|
|
984
|
-
.option('
|
|
985
|
-
.requiredOption('
|
|
986
|
-
.requiredOption('
|
|
987
|
-
.requiredOption('
|
|
988
|
-
.requiredOption('
|
|
989
|
-
.requiredOption('
|
|
990
|
-
.requiredOption('
|
|
991
|
-
.option('
|
|
992
|
-
.option('
|
|
1039
|
+
.option('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
1040
|
+
.option('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
1041
|
+
.option('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
1042
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
1043
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
1044
|
+
.requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
1045
|
+
.requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
1046
|
+
.requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
1047
|
+
.requiredOption('--rulesFilePath <value>', 'Path to the file containing the rules to be imported')
|
|
1048
|
+
.option('--dxContextRoot <value>', 'Alternate path to the context root on the DX Core server', config.dxContextRoot)
|
|
1049
|
+
.option('--targetPath <value>', 'The location of the rule or folder containing the rules in the target workspace, which is the parent for the published nodes. '
|
|
993
1050
|
+ 'The target path must exist before publishing (default targetPath is "/")')
|
|
994
|
-
.option('
|
|
1051
|
+
.option('--targetWorkspace <value>', 'The name of the workspace containing the rules in DX Core server')
|
|
995
1052
|
.description('- Imports the personalization rules to the DX Core server')
|
|
996
|
-
.
|
|
997
|
-
|
|
1053
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient pzn-import --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1054
|
+
+ ' --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxConnectPort 10202 --rulesFilePath /user/store/pznrule/test.nodes --dxContextRoot /wps'))
|
|
1055
|
+
.action(async (cmdOptions) => {
|
|
1056
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.PZN_IMPORT);
|
|
998
1057
|
logger_1.logger.debug('Import of the PZN rule execution started');
|
|
999
1058
|
try {
|
|
1000
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
1001
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
1059
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
1060
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
1002
1061
|
}
|
|
1003
1062
|
catch (error) {
|
|
1004
1063
|
logger_1.logger.error(error.message);
|
|
1005
|
-
|
|
1064
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
1006
1065
|
}
|
|
1007
1066
|
const pznRulesImportObj = new pznRulesImport_1.PznRulesImport();
|
|
1008
1067
|
try {
|
|
1009
|
-
const responseCode =
|
|
1068
|
+
const responseCode = await pznRulesImportObj.invoke(cmdOptions);
|
|
1010
1069
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
1011
1070
|
logger_1.logger.debug('Import pzn rules execution completed');
|
|
1012
|
-
|
|
1071
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1013
1072
|
}
|
|
1014
1073
|
catch (error) {
|
|
1015
1074
|
logger_1.logger.debug('Exception in execution of Import pzn rules : %o', error);
|
|
1016
|
-
|
|
1075
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1017
1076
|
}
|
|
1018
|
-
})
|
|
1077
|
+
});
|
|
1019
1078
|
program
|
|
1020
1079
|
.command(constants_1.COMMANDS.DELETE_DAM_SCHEMA)
|
|
1021
|
-
.requiredOption('
|
|
1022
|
-
.requiredOption('
|
|
1023
|
-
.requiredOption('
|
|
1024
|
-
.requiredOption('
|
|
1025
|
-
.requiredOption('
|
|
1026
|
-
.requiredOption('
|
|
1027
|
-
.requiredOption('
|
|
1028
|
-
.requiredOption('
|
|
1029
|
-
.option('
|
|
1080
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
1081
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
1082
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
1083
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core', MaskData.maskPassword(config.dxPassword))
|
|
1084
|
+
.requiredOption('--damAPIPort <value>', 'Port number of the DAM server, for any Kubernetes Environment default port is 443', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
|
|
1085
|
+
.requiredOption('--ringAPIPort <value>', 'Port number of the DX Core API server, for any Kubernetes Environment default port is 443', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
|
|
1086
|
+
.requiredOption('--damAPIVersion <value>', 'API Version number of DAM, for any Kubernetes Environment default port is 443', config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion)
|
|
1087
|
+
.requiredOption('--ringAPIVersion <value>', 'API Version number of DX Core, for any Kubernetes Environment default port is 443', config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion)
|
|
1088
|
+
.option('--schemaVersion <value>', 'DAM Schema Version')
|
|
1030
1089
|
.description('- Deletes inactive DAM schema from persistence in DX')
|
|
1031
|
-
.
|
|
1032
|
-
|
|
1090
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient delete-dam-schema --dxProtocol https --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1091
|
+
+ ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --schemaVersion 3'))
|
|
1092
|
+
.action(async (cmdOptions) => {
|
|
1093
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.DELETE_DAM_SCHEMA);
|
|
1033
1094
|
logger_1.logger.debug('Delete DAM Schema started');
|
|
1034
1095
|
try {
|
|
1035
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
1036
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
1096
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
1097
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
1037
1098
|
}
|
|
1038
1099
|
catch (error) {
|
|
1039
1100
|
logger_1.logger.error(error.message);
|
|
1040
|
-
|
|
1101
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
1041
1102
|
}
|
|
1042
1103
|
try {
|
|
1043
1104
|
const deleteSchema = new deleteSchema_1.DeleteSchema();
|
|
1044
|
-
const responseCode =
|
|
1105
|
+
const responseCode = await deleteSchema.invoke(cmdOptions);
|
|
1045
1106
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
1046
1107
|
logger_1.logger.debug('Delete DAM Schema execution completed');
|
|
1047
|
-
|
|
1108
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1048
1109
|
}
|
|
1049
1110
|
catch (error) {
|
|
1050
1111
|
logger_1.logger.debug('Exception in execution : %o', error);
|
|
1051
|
-
|
|
1112
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1052
1113
|
}
|
|
1053
|
-
})
|
|
1114
|
+
});
|
|
1054
1115
|
program
|
|
1055
1116
|
.command(constants_1.COMMANDS.LIST_DAM_SCHEMA)
|
|
1056
|
-
.requiredOption('
|
|
1057
|
-
.requiredOption('
|
|
1058
|
-
.requiredOption('
|
|
1059
|
-
.requiredOption('
|
|
1060
|
-
.requiredOption('
|
|
1061
|
-
.requiredOption('
|
|
1062
|
-
.requiredOption('
|
|
1063
|
-
.requiredOption('
|
|
1117
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
1118
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
1119
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
1120
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core', MaskData.maskPassword(config.dxPassword))
|
|
1121
|
+
.requiredOption('--damAPIPort <value>', 'Port number of the DAM server, for any Kubernetes Environment default port is 443', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
|
|
1122
|
+
.requiredOption('--ringAPIPort <value>', 'Port number of the DX Core API server, for any Kubernetes Environment default port is 443', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
|
|
1123
|
+
.requiredOption('--damAPIVersion <value>', 'API Version number of DAM, for any Kubernetes Environment default port is 443', config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion)
|
|
1124
|
+
.requiredOption('--ringAPIVersion <value>', 'API Version number of DX Core, for any Kubernetes Environment default port is 443', config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion)
|
|
1064
1125
|
.description('- Lists all DAM schemas in DX.')
|
|
1065
|
-
.
|
|
1066
|
-
|
|
1126
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient list-dam-schemas --dxProtocol https --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1127
|
+
+ ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1'))
|
|
1128
|
+
.action(async (cmdOptions) => {
|
|
1129
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.LIST_DAM_SCHEMA);
|
|
1067
1130
|
logger_1.logger.debug('List DAM Schema started');
|
|
1068
1131
|
try {
|
|
1069
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
1070
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
1132
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
1133
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
1071
1134
|
}
|
|
1072
1135
|
catch (error) {
|
|
1073
1136
|
logger_1.logger.error(error.message);
|
|
1074
|
-
|
|
1137
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
1075
1138
|
}
|
|
1076
1139
|
try {
|
|
1077
1140
|
const listSchema = new listSchema_1.ListSchema();
|
|
1078
|
-
const responseCode =
|
|
1141
|
+
const responseCode = await listSchema.invoke(cmdOptions);
|
|
1079
1142
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
1080
1143
|
logger_1.logger.debug('List DAM Schema execution completed');
|
|
1081
|
-
|
|
1144
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1082
1145
|
}
|
|
1083
1146
|
catch (error) {
|
|
1084
1147
|
logger_1.logger.debug('Exception in execution : %o', error);
|
|
1085
|
-
|
|
1148
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1086
1149
|
}
|
|
1087
|
-
})
|
|
1150
|
+
});
|
|
1088
1151
|
program
|
|
1089
1152
|
.command(`${constants_1.COMMANDS.MANAGE_VIRTUAL_PORTAL} [subCmd]`)
|
|
1090
|
-
.requiredOption('
|
|
1091
|
-
.requiredOption('
|
|
1092
|
-
.option('
|
|
1093
|
-
.option('
|
|
1094
|
-
.option('
|
|
1095
|
-
.option('
|
|
1096
|
-
.option('
|
|
1097
|
-
.option('
|
|
1098
|
-
.option('
|
|
1099
|
-
.option('
|
|
1100
|
-
.option('
|
|
1101
|
-
.option('
|
|
1102
|
-
.option('
|
|
1103
|
-
.option('
|
|
1104
|
-
.requiredOption('
|
|
1105
|
-
.option('
|
|
1106
|
-
.option('
|
|
1107
|
-
.option('
|
|
1108
|
-
.option('
|
|
1153
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
1154
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
1155
|
+
.option('--dxConnectPort <value>', 'Port number of the cw_profile, for any Kubernetes Environment default port is 443', config.dxConnectPort.toString())
|
|
1156
|
+
.option('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
|
|
1157
|
+
.option('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
1158
|
+
.option('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
1159
|
+
.option('--dxWASUsername <value>', 'Username of the DX WAS server', config.dxWASUsername)
|
|
1160
|
+
.option('--dxWASPassword <value>', 'Password of the DX WAS server', MaskData.maskPassword(config.dxWASPassword))
|
|
1161
|
+
.option('--vpTitle <value>', 'Virtual portal Title')
|
|
1162
|
+
.option('--vpRealm <value>', 'Virtual portal Realm')
|
|
1163
|
+
.option('--vpAdminGroup <value>', 'Virtual portal AdminGroup')
|
|
1164
|
+
.option('--vpHostname <value>', 'Virtual portal Hostname')
|
|
1165
|
+
.option('--vpContext <value>', 'Virtual portal Context')
|
|
1166
|
+
.option('--dxProtocol <value>', 'protocol of the DX Core server', config.dxProtocol)
|
|
1167
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
1168
|
+
.option('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
1169
|
+
.option('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
|
|
1170
|
+
.option('--xmlFile <value>', 'XML file name with full path')
|
|
1171
|
+
.option('--requestId <value>', 'Unique Id of a previously triggered create virtual portal request')
|
|
1109
1172
|
.option('-h, --help')
|
|
1110
1173
|
.description('- Manages list,create,import or export of virtual portal in the DX Core server')
|
|
1111
|
-
.action((subCmd, cmd) =>
|
|
1174
|
+
.action(async (subCmd, cmd) => {
|
|
1112
1175
|
if ((subCmd === constants_1.SUB_COMMANDS.LIST_VIRTUAL_PORTALS || subCmd === constants_1.SUB_COMMANDS.CREATE_VIRTUAL_PORTAL || subCmd === constants_1.SUB_COMMANDS.IMPORT_VIRTUAL_PORTAL
|
|
1113
|
-
|| subCmd === constants_1.SUB_COMMANDS.EXPORT_VIRTUAL_PORTAL) && (
|
|
1176
|
+
|| subCmd === constants_1.SUB_COMMANDS.EXPORT_VIRTUAL_PORTAL) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
1114
1177
|
logger_1.logger.help('Usage: dxclient manage-virtual-portal [options] [subCmd](list/create/import/export)\n');
|
|
1115
1178
|
logger_1.logger.help('Lists,create,import or export a virtual portal in the DX Core server\n');
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
logger_1.logger.help(
|
|
1179
|
+
}
|
|
1180
|
+
if (subCmd === constants_1.SUB_COMMANDS.LIST_VIRTUAL_PORTALS) {
|
|
1181
|
+
logger_1.logger.help(' \nExample : dxclient manage-virtual-portal list --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin --dxConnectPort 10202 --dxProfileName wp_profile'
|
|
1182
|
+
+ ' --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxWASUsername wpsadmin --dxWASPassword wpsadmin \n');
|
|
1183
|
+
}
|
|
1184
|
+
if (subCmd === constants_1.SUB_COMMANDS.CREATE_VIRTUAL_PORTAL) {
|
|
1185
|
+
logger_1.logger.help(' \nExample : dxclient manage-virtual-portal create --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin --dxConnectPort 10202 --dxProfileName wp_profile'
|
|
1186
|
+
+ ' --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxWASUsername wpsadmin --dxWASPassword wpsadmin --vpTitle test_vp -vpRealm defaultWIMFileBasedRealm'
|
|
1187
|
+
+ ' -vpAdminGroup wpsadmins -vpContext test_Context \n');
|
|
1188
|
+
}
|
|
1189
|
+
if (subCmd === constants_1.SUB_COMMANDS.IMPORT_VIRTUAL_PORTAL) {
|
|
1190
|
+
logger_1.logger.help(' \nExample : dxclient manage-virtual-portal import --dxProtocol https --hostname localhost --dxPort 10041 --xmlConfigPath /wps/config --dxUsernam wpsadmin --dxPassword wpsadmin'
|
|
1191
|
+
+ ' --xmlFile /user/store/output/test.xml --vpContext test_Context \n');
|
|
1192
|
+
}
|
|
1193
|
+
if (subCmd === constants_1.SUB_COMMANDS.EXPORT_VIRTUAL_PORTAL) {
|
|
1194
|
+
logger_1.logger.help(' \nExample : dxclient manage-virtual-portal export --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin --dxProtocol https --dxPort 10041'
|
|
1195
|
+
+ ' --xmlConfigPath /wps/config --vpTitle test --vpContext test_Context --xmlFile /user/store/output/test.xml \n');
|
|
1196
|
+
}
|
|
1197
|
+
if ((subCmd === constants_1.SUB_COMMANDS.LIST_VIRTUAL_PORTALS || subCmd === constants_1.SUB_COMMANDS.CREATE_VIRTUAL_PORTAL || subCmd === constants_1.SUB_COMMANDS.IMPORT_VIRTUAL_PORTAL
|
|
1198
|
+
|| subCmd === constants_1.SUB_COMMANDS.EXPORT_VIRTUAL_PORTAL) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
1199
|
+
logger_1.logger.help('Options:\n');
|
|
1200
|
+
logger_1.logger.help(` --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
|
|
1201
|
+
logger_1.logger.help(` --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}")`);
|
|
1202
|
+
logger_1.logger.help(` --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
|
|
1119
1203
|
if (subCmd === constants_1.SUB_COMMANDS.LIST_VIRTUAL_PORTALS) {
|
|
1120
|
-
logger_1.logger.help(`
|
|
1204
|
+
logger_1.logger.help(` --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
|
|
1121
1205
|
logger_1.logger.help(` -dxProfileName, --dxProfileName <value> Profile name in the DX core server (default: "${config.dxProfileName}")`);
|
|
1122
|
-
logger_1.logger.help(`
|
|
1123
|
-
logger_1.logger.help(`
|
|
1124
|
-
logger_1.logger.help(`
|
|
1125
|
-
logger_1.logger.help(`
|
|
1206
|
+
logger_1.logger.help(` --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
|
|
1207
|
+
logger_1.logger.help(` --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
|
|
1208
|
+
logger_1.logger.help(` --dxWASUsername <value> Username of the DX WAS server (default: "${config.dxWASUsername}")`);
|
|
1209
|
+
logger_1.logger.help(` --dxWASPassword <value> Password of the DX WAS server (default: "${MaskData.maskPassword(config.dxWASPassword)}")`);
|
|
1210
|
+
logger_1.logger.help(' -h, --help display help for command');
|
|
1126
1211
|
}
|
|
1127
1212
|
if (subCmd === constants_1.SUB_COMMANDS.CREATE_VIRTUAL_PORTAL) {
|
|
1128
|
-
logger_1.logger.help(`
|
|
1213
|
+
logger_1.logger.help(` --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
|
|
1129
1214
|
logger_1.logger.help(` -dxProfileName, --dxProfileName <value> Profile name in the DX core server (default: "${config.dxProfileName}")`);
|
|
1130
|
-
logger_1.logger.help(`
|
|
1131
|
-
logger_1.logger.help(`
|
|
1132
|
-
logger_1.logger.help(`
|
|
1133
|
-
logger_1.logger.help(`
|
|
1134
|
-
logger_1.logger.help('
|
|
1135
|
-
logger_1.logger.help('
|
|
1136
|
-
logger_1.logger.help('
|
|
1137
|
-
logger_1.logger.help('
|
|
1138
|
-
logger_1.logger.help('
|
|
1139
|
-
logger_1.logger.help('
|
|
1215
|
+
logger_1.logger.help(` --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
|
|
1216
|
+
logger_1.logger.help(` --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
|
|
1217
|
+
logger_1.logger.help(` --dxWASUsername <value> Username of the DX WAS server (default: "${config.dxWASUsername}")`);
|
|
1218
|
+
logger_1.logger.help(` --dxWASPassword <value> Password of the DX WAS server (default: "${MaskData.maskPassword(config.dxWASPassword)}")`);
|
|
1219
|
+
logger_1.logger.help(' --vpTitle <value> Virtual portal Title');
|
|
1220
|
+
logger_1.logger.help(' --vpRealm <value> Virtual portal Realm');
|
|
1221
|
+
logger_1.logger.help(' --vpAdminGroup <value> Virtual portal AdminGroup');
|
|
1222
|
+
logger_1.logger.help(' --vpHostname <value> Virtual portal Hostname');
|
|
1223
|
+
logger_1.logger.help(' --vpContext <value> Virtual portal Context');
|
|
1224
|
+
logger_1.logger.help(' --requestId <value> Unique Id of a previously triggered create virtual portal request');
|
|
1225
|
+
logger_1.logger.help(' -h, --help display help for command');
|
|
1140
1226
|
}
|
|
1141
1227
|
if (subCmd === constants_1.SUB_COMMANDS.IMPORT_VIRTUAL_PORTAL) {
|
|
1142
|
-
logger_1.logger.help(`
|
|
1143
|
-
logger_1.logger.help(`
|
|
1228
|
+
logger_1.logger.help(` --dxProtocol <value> protocol of the DX Core server (default: "${config.dxProtocol}")`);
|
|
1229
|
+
logger_1.logger.help(` --dxPort <value> Port number for DX Core server, for any Kubernetes Environment \
|
|
1144
1230
|
default port is 443 (default: "${config.dxPort.toString()}")`);
|
|
1145
|
-
logger_1.logger.help(`
|
|
1146
|
-
logger_1.logger.help('
|
|
1147
|
-
logger_1.logger.help('
|
|
1231
|
+
logger_1.logger.help(` --xmlConfigPath <value> Path to DX configuration endpoint (default: "${config.xmlConfigPath}")`);
|
|
1232
|
+
logger_1.logger.help(' --vpContext <value> Virtual portal Context');
|
|
1233
|
+
logger_1.logger.help(' --xmlFile <value> XML file name with full path');
|
|
1234
|
+
logger_1.logger.help(' -h, --help display help for command');
|
|
1148
1235
|
}
|
|
1149
1236
|
if (subCmd === constants_1.SUB_COMMANDS.EXPORT_VIRTUAL_PORTAL) {
|
|
1150
|
-
logger_1.logger.help(`
|
|
1151
|
-
logger_1.logger.help(`
|
|
1237
|
+
logger_1.logger.help(` --dxProtocol <value> protocol of the DX Core server (default: "${config.dxProtocol}")`);
|
|
1238
|
+
logger_1.logger.help(` --dxPort <value> Port number of the DX Core server, for any Kubernetes Environment default port is 443,
|
|
1152
1239
|
(default: "${config.dxPort ? config.dxPort.toString() : config.dxPort}")`);
|
|
1153
|
-
logger_1.logger.help(`
|
|
1154
|
-
logger_1.logger.help('
|
|
1155
|
-
logger_1.logger.help('
|
|
1156
|
-
logger_1.logger.help('
|
|
1240
|
+
logger_1.logger.help(` --xmlConfigPath <value> Path to DX configuration endpoint (default: "${config.xmlConfigPath}")`);
|
|
1241
|
+
logger_1.logger.help(' --vpContext <value> Path to virtual portal context');
|
|
1242
|
+
logger_1.logger.help(' --vpTitle <value> Virtual portal name');
|
|
1243
|
+
logger_1.logger.help(' --xmlFile <value> XML file name with full path');
|
|
1244
|
+
logger_1.logger.help(' -h, --help display help for command');
|
|
1157
1245
|
}
|
|
1158
|
-
logger_1.logger.help(' -h, --help display help for command');
|
|
1159
1246
|
process.exit(1);
|
|
1160
1247
|
}
|
|
1161
1248
|
if (!subCmd || (subCmd !== constants_1.SUB_COMMANDS.LIST_VIRTUAL_PORTALS && subCmd !== constants_1.SUB_COMMANDS.CREATE_VIRTUAL_PORTAL
|
|
@@ -1167,121 +1254,149 @@ program
|
|
|
1167
1254
|
process.exit(1);
|
|
1168
1255
|
}
|
|
1169
1256
|
try {
|
|
1170
|
-
commands_1.configureCommand(subCmd);
|
|
1257
|
+
(0, commands_1.configureCommand)(subCmd);
|
|
1171
1258
|
logger_1.logger.debug('Manage virtual portal execution started');
|
|
1172
|
-
cmd = utils_1.unmaskPasswords(cmd);
|
|
1173
|
-
validateOptions_1.validateOptions(cmd);
|
|
1259
|
+
cmd = (0, utils_1.unmaskPasswords)(cmd);
|
|
1260
|
+
(0, validateOptions_1.validateOptions)(cmd);
|
|
1174
1261
|
}
|
|
1175
1262
|
catch (error) {
|
|
1176
1263
|
logger_1.logger.error(error.message);
|
|
1177
|
-
|
|
1264
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
1178
1265
|
}
|
|
1179
1266
|
if (subCmd === constants_1.SUB_COMMANDS.LIST_VIRTUAL_PORTALS) {
|
|
1180
1267
|
const listVirtualPortals = new listVirtualPortals_1.ListVirtualPortals();
|
|
1181
1268
|
try {
|
|
1182
|
-
const responseCode =
|
|
1269
|
+
const responseCode = await listVirtualPortals.invoke(cmd);
|
|
1183
1270
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
1184
1271
|
logger_1.logger.debug('List virtual portal execution successful');
|
|
1185
|
-
|
|
1272
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1186
1273
|
}
|
|
1187
1274
|
catch (error) {
|
|
1188
1275
|
logger_1.logger.debug('Exception in execution of list virtual portal : %o', error);
|
|
1189
|
-
|
|
1276
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1190
1277
|
}
|
|
1191
1278
|
}
|
|
1192
1279
|
else if (subCmd === constants_1.SUB_COMMANDS.CREATE_VIRTUAL_PORTAL) {
|
|
1193
1280
|
const createVirtualPortal = new createVirtualPortal_1.CreateVirtualPortal();
|
|
1194
1281
|
try {
|
|
1195
|
-
const responseCode =
|
|
1282
|
+
const responseCode = await createVirtualPortal.invoke(cmd);
|
|
1196
1283
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
1197
1284
|
logger_1.logger.debug('create virtual portal execution successful');
|
|
1198
|
-
|
|
1285
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1199
1286
|
}
|
|
1200
1287
|
catch (error) {
|
|
1201
1288
|
logger_1.logger.debug('Exception in execution of import virtual portal : %o', error);
|
|
1202
|
-
|
|
1289
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1203
1290
|
}
|
|
1204
1291
|
}
|
|
1205
1292
|
else if (subCmd === constants_1.SUB_COMMANDS.IMPORT_VIRTUAL_PORTAL) {
|
|
1206
1293
|
const importVirtualPortal = new importVirtualPortal_1.ImportVirtualPortal();
|
|
1207
1294
|
try {
|
|
1208
|
-
const responseCode =
|
|
1295
|
+
const responseCode = await importVirtualPortal.invoke(cmd);
|
|
1209
1296
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
1210
1297
|
logger_1.logger.debug('Import virtual portal execution successful');
|
|
1211
|
-
|
|
1298
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1212
1299
|
}
|
|
1213
1300
|
catch (error) {
|
|
1214
1301
|
logger_1.logger.debug('Exception in execution of import virtual portal : %o', error);
|
|
1215
|
-
|
|
1302
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1216
1303
|
}
|
|
1217
1304
|
}
|
|
1218
1305
|
else if (subCmd === constants_1.SUB_COMMANDS.EXPORT_VIRTUAL_PORTAL) {
|
|
1219
1306
|
const exportVirtualPortal = new exportVirtualPortal_1.ExportVirtualPortal();
|
|
1220
1307
|
try {
|
|
1221
|
-
const responseCode =
|
|
1308
|
+
const responseCode = await exportVirtualPortal.invoke(cmd);
|
|
1222
1309
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
1223
1310
|
logger_1.logger.debug('List virtual portal execution successful');
|
|
1224
|
-
|
|
1311
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1225
1312
|
}
|
|
1226
1313
|
catch (error) {
|
|
1227
1314
|
logger_1.logger.debug('Exception in execution of list virtual portal : %o', error);
|
|
1228
|
-
|
|
1315
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1229
1316
|
}
|
|
1230
1317
|
}
|
|
1231
|
-
})
|
|
1318
|
+
})
|
|
1232
1319
|
.helpOption(false);
|
|
1233
1320
|
program
|
|
1234
1321
|
.command(`${constants_1.COMMANDS.RESOURCE_ENVIRONMENT_PROVIDER} [subCmd]`)
|
|
1235
|
-
.requiredOption('
|
|
1236
|
-
.requiredOption('
|
|
1237
|
-
.requiredOption('
|
|
1238
|
-
.requiredOption('
|
|
1239
|
-
.requiredOption('
|
|
1240
|
-
.requiredOption('
|
|
1241
|
-
.requiredOption('
|
|
1242
|
-
.requiredOption('
|
|
1243
|
-
.requiredOption('
|
|
1244
|
-
.requiredOption('
|
|
1245
|
-
.requiredOption('
|
|
1246
|
-
.option('
|
|
1247
|
-
.option('
|
|
1248
|
-
.option('
|
|
1249
|
-
.option('
|
|
1250
|
-
.option('
|
|
1322
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
1323
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
1324
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
1325
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
1326
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
1327
|
+
.requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
1328
|
+
.requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
1329
|
+
.requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
1330
|
+
.requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
|
|
1331
|
+
.requiredOption('--dxWASUsername <value>', 'Username of the DX WAS server', config.dxWASUsername)
|
|
1332
|
+
.requiredOption('--dxWASPassword <value>', 'Password of the DX WAS server', MaskData.maskPassword(config.dxWASPassword))
|
|
1333
|
+
.option('--providerName <value>', 'Name of the Resource Environment Provider ')
|
|
1334
|
+
.option('--propertyName <value>', 'Name of the Custom Property ')
|
|
1335
|
+
.option('--propertyValue <value>', 'Value of the Custom Property ')
|
|
1336
|
+
.option('--propertyDesc <value>', 'Description of the Custom Property ')
|
|
1337
|
+
.option('--filePath <value>', 'File path of the import Resource Environment Provider files')
|
|
1251
1338
|
.option('-h, --help')
|
|
1252
1339
|
.description('- Creates, Updates, Deletes,Import,Retrieves or Exports a custom property')
|
|
1253
|
-
.action((subCommand, commands) =>
|
|
1340
|
+
.action(async (subCommand, commands) => {
|
|
1254
1341
|
logger_1.logger.debug('Resource Environment provider process started.');
|
|
1255
1342
|
if ((subCommand === constants_1.SUB_COMMANDS.CREATE_PROPERTY || subCommand === constants_1.SUB_COMMANDS.UPDATE_PROPERTY || subCommand === constants_1.SUB_COMMANDS.DELETE_PROPERTY
|
|
1256
1343
|
|| subCommand === constants_1.SUB_COMMANDS.EXPORT_PROPERTIES || subCommand === constants_1.SUB_COMMANDS.IMPORT_PROPERTIES || subCommand === constants_1.SUB_COMMANDS.RETRIEVE_PROPERTY)
|
|
1257
|
-
&& (
|
|
1344
|
+
&& (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
1258
1345
|
logger_1.logger.help('Usage: dxclient resource-env-provider [options] [subCmd](create-property/update-property/delete-property/export-properties/import-properties/retrieve-property)\n');
|
|
1259
1346
|
logger_1.logger.help('- Creates, Retrieves, Updates, Deletes, Import or Exports custom properties.\n');
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
logger_1.logger.help(
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1347
|
+
}
|
|
1348
|
+
if (subCommand === constants_1.SUB_COMMANDS.CREATE_PROPERTY) {
|
|
1349
|
+
logger_1.logger.help(' \nExample : dxclient resource-env-provider create-property --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
|
|
1350
|
+
+ ' --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile --providerName testprovider --propertyName test --propertyValue test \n');
|
|
1351
|
+
}
|
|
1352
|
+
if (subCommand === constants_1.SUB_COMMANDS.UPDATE_PROPERTY) {
|
|
1353
|
+
logger_1.logger.help(' \nExample : dxclient resource-env-provider update-property --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
|
|
1354
|
+
+ ' --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile --providerName testprovider --propertyName test --propertyValue test \n');
|
|
1355
|
+
}
|
|
1356
|
+
if (subCommand === constants_1.SUB_COMMANDS.DELETE_PROPERTY) {
|
|
1357
|
+
logger_1.logger.help(' \nExample : dxclient resource-env-provider delete-property --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
|
|
1358
|
+
+ ' --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile --providerName testprovider --propertyName test \n');
|
|
1359
|
+
}
|
|
1360
|
+
if (subCommand === constants_1.SUB_COMMANDS.EXPORT_PROPERTIES) {
|
|
1361
|
+
logger_1.logger.help(' \nExample : dxclient resource-env-provider export-properties --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
|
|
1362
|
+
+ ' --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile \n');
|
|
1363
|
+
}
|
|
1364
|
+
if (subCommand === constants_1.SUB_COMMANDS.IMPORT_PROPERTIES) {
|
|
1365
|
+
logger_1.logger.help(' \nExample : dxclient resource-env-provider import-properties --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
|
|
1366
|
+
+ ' --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile --filePath /user/store/output/resourceenv/test.xml \n');
|
|
1367
|
+
}
|
|
1368
|
+
if (subCommand === constants_1.SUB_COMMANDS.RETRIEVE_PROPERTY) {
|
|
1369
|
+
logger_1.logger.help(' \nExample : dxclient resource-env-provider retrieve-property --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
|
|
1370
|
+
+ ' --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile --providerName testprovider --propertyName test \n');
|
|
1371
|
+
}
|
|
1372
|
+
if ((subCommand === constants_1.SUB_COMMANDS.CREATE_PROPERTY || subCommand === constants_1.SUB_COMMANDS.UPDATE_PROPERTY || subCommand === constants_1.SUB_COMMANDS.DELETE_PROPERTY
|
|
1373
|
+
|| subCommand === constants_1.SUB_COMMANDS.EXPORT_PROPERTIES || subCommand === constants_1.SUB_COMMANDS.IMPORT_PROPERTIES || subCommand === constants_1.SUB_COMMANDS.RETRIEVE_PROPERTY)
|
|
1374
|
+
&& (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
1375
|
+
logger_1.logger.help(` --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
|
|
1376
|
+
logger_1.logger.help(` --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
|
|
1377
|
+
logger_1.logger.help(` --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
|
|
1378
|
+
logger_1.logger.help(` --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
|
|
1379
|
+
logger_1.logger.help(` --dxWASUsername <value> Username of the DX WAS server (default: "${config.dxWASUsername}")`);
|
|
1380
|
+
logger_1.logger.help(` --dxWASPassword <value> Password of the DX WAS server (default: "${MaskData.maskPassword(config.dxWASPassword)}")`);
|
|
1266
1381
|
logger_1.logger.help(` -dxProfileName, --dxProfileName <value> Profile name in the DX core server (default: "${config.dxProfileName}")`);
|
|
1267
1382
|
if (subCommand === constants_1.SUB_COMMANDS.CREATE_PROPERTY || subCommand === constants_1.SUB_COMMANDS.UPDATE_PROPERTY) {
|
|
1268
|
-
logger_1.logger.help('
|
|
1269
|
-
logger_1.logger.help('
|
|
1270
|
-
logger_1.logger.help('
|
|
1271
|
-
logger_1.logger.help('
|
|
1383
|
+
logger_1.logger.help(' --providerName <value> Name of the Resource Environment Provider');
|
|
1384
|
+
logger_1.logger.help(' --propertyName <value> Name of the Custom Property');
|
|
1385
|
+
logger_1.logger.help(' --propertyValue <value> Value of the Custom Property');
|
|
1386
|
+
logger_1.logger.help(' --propertyDesc <value> Description of the Custom Property');
|
|
1272
1387
|
}
|
|
1273
1388
|
if (subCommand === constants_1.SUB_COMMANDS.DELETE_PROPERTY) {
|
|
1274
|
-
logger_1.logger.help('
|
|
1275
|
-
logger_1.logger.help('
|
|
1389
|
+
logger_1.logger.help(' --providerName <value> Name of the Resource Environment Provider');
|
|
1390
|
+
logger_1.logger.help(' --propertyName <value> Name of the Custom Property');
|
|
1276
1391
|
}
|
|
1277
1392
|
if (subCommand === constants_1.SUB_COMMANDS.IMPORT_PROPERTIES) {
|
|
1278
|
-
logger_1.logger.help('
|
|
1393
|
+
logger_1.logger.help(' --filePath <value> File path of the import Resource Environment Provider files');
|
|
1279
1394
|
}
|
|
1280
1395
|
if (subCommand === constants_1.SUB_COMMANDS.RETRIEVE_PROPERTY) {
|
|
1281
|
-
logger_1.logger.help('
|
|
1282
|
-
logger_1.logger.help('
|
|
1396
|
+
logger_1.logger.help(' --providerName <value> Name of the Resource Environment Provider');
|
|
1397
|
+
logger_1.logger.help(' --propertyName <value> Name of the Custom Property');
|
|
1283
1398
|
}
|
|
1284
|
-
logger_1.logger.help(' -h, --help
|
|
1399
|
+
logger_1.logger.help(' -h, --help display help for command');
|
|
1285
1400
|
process.exit(1);
|
|
1286
1401
|
}
|
|
1287
1402
|
if (!subCommand || (subCommand !== constants_1.SUB_COMMANDS.CREATE_PROPERTY && subCommand !== constants_1.SUB_COMMANDS.UPDATE_PROPERTY && subCommand !== constants_1.SUB_COMMANDS.DELETE_PROPERTY
|
|
@@ -1296,160 +1411,182 @@ program
|
|
|
1296
1411
|
}
|
|
1297
1412
|
else {
|
|
1298
1413
|
try {
|
|
1299
|
-
commands_1.configureCommand(subCommand);
|
|
1300
|
-
commands = utils_1.unmaskPasswords(commands);
|
|
1301
|
-
validateOptions_1.validateOptions(commands);
|
|
1414
|
+
(0, commands_1.configureCommand)(subCommand);
|
|
1415
|
+
commands = (0, utils_1.unmaskPasswords)(commands);
|
|
1416
|
+
(0, validateOptions_1.validateOptions)(commands);
|
|
1302
1417
|
}
|
|
1303
1418
|
catch (error) {
|
|
1304
1419
|
logger_1.logger.error(error.message);
|
|
1305
|
-
|
|
1420
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
1306
1421
|
}
|
|
1307
1422
|
}
|
|
1308
1423
|
const repActions = new resEnvProviderActions_1.ResourceEnvironmentProviderActions();
|
|
1309
1424
|
try {
|
|
1310
|
-
const responseCode =
|
|
1311
|
-
|
|
1425
|
+
const responseCode = await repActions.invoke(subCommand, commands);
|
|
1426
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1312
1427
|
}
|
|
1313
1428
|
catch (error) {
|
|
1314
1429
|
logger_1.logger.debug('Exception in execution of Resource Environment Provider Process : %o', error);
|
|
1315
|
-
|
|
1430
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1316
1431
|
}
|
|
1317
|
-
})
|
|
1432
|
+
})
|
|
1318
1433
|
.helpOption(false);
|
|
1319
1434
|
program
|
|
1320
1435
|
.command(constants_1.COMMANDS.CREATE_SYNDICATION_RELATION)
|
|
1321
|
-
.requiredOption('
|
|
1322
|
-
.requiredOption('
|
|
1323
|
-
.requiredOption('
|
|
1324
|
-
.requiredOption('
|
|
1325
|
-
.requiredOption('
|
|
1326
|
-
.requiredOption('
|
|
1327
|
-
.requiredOption('
|
|
1328
|
-
.requiredOption('
|
|
1329
|
-
.requiredOption('
|
|
1330
|
-
.requiredOption('
|
|
1331
|
-
.requiredOption('
|
|
1332
|
-
.option('
|
|
1333
|
-
.option('
|
|
1334
|
-
.option('
|
|
1335
|
-
.option('
|
|
1336
|
-
.option('
|
|
1337
|
-
.option('
|
|
1338
|
-
.option('
|
|
1339
|
-
.option('
|
|
1436
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
1437
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
1438
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
1439
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
1440
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
1441
|
+
.requiredOption('--contenthandlerPath <value>', 'Alternate path to the contenthandler servlet on the DX Core server', config.contenthandlerPath)
|
|
1442
|
+
.requiredOption('--syndicatorUrl <value>', 'Syndicator URL e.g http(s)://host:port/wps/wcm')
|
|
1443
|
+
.requiredOption('--syndicatorName <value>', 'New syndicator name: syndicatorName')
|
|
1444
|
+
.requiredOption('--subscriberName <value>', 'New subscriber name: subscriberName')
|
|
1445
|
+
.requiredOption('--vaultSlotName <value>', 'Credential Vault Name: vaultSlotName')
|
|
1446
|
+
.requiredOption('--dxContextRoot <value>', 'Alternate path to the context root on the DX Core server', config.dxContextRoot)
|
|
1447
|
+
.option('--isEnabled <value>', 'Whether the syndicator/subscriber pair is enabled on creation: isEnabled (default is true)', true)
|
|
1448
|
+
.option('--updateAfterCreation <value>', 'Whether the syndicator/subscriber pair is updateAfterCreation : updateAfterCreation (default is true)', true)
|
|
1449
|
+
.option('--syndicationType <value>', 'The libraries to syndicate eg. all-items,liveItems,liveProjectsItem,all-items,published-items and all-items-and-versions')
|
|
1450
|
+
.option('--webContentLibraries <value>', ' Libraries Name: webContentLibraries')
|
|
1451
|
+
.option('--subscriberURL <value>', 'Subscriber URL e.g http(s)://host:port/wps/wcm')
|
|
1452
|
+
.option('--mode <value>', 'Syndicator/subscriber mode')
|
|
1453
|
+
.option('--syndicatorVaultSlotName <value>', 'Credential Vault Name: syndicatorVaultSlotName')
|
|
1454
|
+
.option('--virtualPortalContext <value>', 'Virtual portal Context', config.virtualPortalContext)
|
|
1340
1455
|
.description('- Creates a syndication relation between syndicator and subscriber in the DX server.')
|
|
1341
|
-
.
|
|
1342
|
-
|
|
1456
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient create-syndication-relation --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1457
|
+
+ ' --contenthandlerPath /wps/mycontenthandler --syndicatorUrl http(s)://localhost:10041/wps/wcm --syndicatorName testsyn --subscriberName testsub --vaultSlotName test_solt --dxContextRoot /wps'
|
|
1458
|
+
+ ' --syndicationType all-items --webContentLibraries "Portal Sit" '))
|
|
1459
|
+
.action(async (cmdOptions) => {
|
|
1460
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.CREATE_SYNDICATION_RELATION);
|
|
1343
1461
|
logger_1.logger.debug('Create syndication relation execution started');
|
|
1344
1462
|
try {
|
|
1345
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
1346
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
1463
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
1464
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
1347
1465
|
}
|
|
1348
1466
|
catch (error) {
|
|
1349
1467
|
logger_1.logger.error(error.message);
|
|
1350
|
-
|
|
1468
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
1351
1469
|
}
|
|
1352
1470
|
try {
|
|
1353
1471
|
const createSyndication = new createSyndicationRelation_1.CreateSyndicationRelation();
|
|
1354
|
-
const responseCode =
|
|
1472
|
+
const responseCode = await createSyndication.invoke(cmdOptions);
|
|
1355
1473
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
1356
1474
|
logger_1.logger.debug('Create syndication relation execution completed');
|
|
1357
|
-
|
|
1475
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1358
1476
|
}
|
|
1359
1477
|
catch (error) {
|
|
1360
1478
|
logger_1.logger.debug('Exception in execution : %o', error);
|
|
1361
|
-
|
|
1479
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1362
1480
|
}
|
|
1363
|
-
})
|
|
1481
|
+
});
|
|
1364
1482
|
program
|
|
1365
1483
|
.command(`${constants_1.COMMANDS.MANAGE_DAM_STAGING} [subCommand]`)
|
|
1366
|
-
.requiredOption('
|
|
1367
|
-
.requiredOption('
|
|
1368
|
-
.requiredOption('
|
|
1369
|
-
.requiredOption('
|
|
1370
|
-
.requiredOption('
|
|
1371
|
-
.option('
|
|
1372
|
-
.option('
|
|
1373
|
-
.requiredOption('
|
|
1374
|
-
.requiredOption('
|
|
1375
|
-
.requiredOption('
|
|
1376
|
-
.requiredOption('
|
|
1377
|
-
.option('
|
|
1378
|
-
.option('
|
|
1379
|
-
.option('
|
|
1380
|
-
.option('
|
|
1381
|
-
.option('
|
|
1382
|
-
.option('
|
|
1383
|
-
.option('
|
|
1384
|
-
.option('
|
|
1385
|
-
.option('
|
|
1386
|
-
.option('
|
|
1387
|
-
.option('
|
|
1388
|
-
.option('
|
|
1484
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server of the publisher', config.dxProtocol)
|
|
1485
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server of the publisher', config.hostname)
|
|
1486
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server of the publisher', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
1487
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server of the publisher', config.dxUsername)
|
|
1488
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server of the publisher', MaskData.maskPassword(config.dxPassword))
|
|
1489
|
+
.option('--targetServerUsername <value>', 'Username of the DX Core server of the subscriber')
|
|
1490
|
+
.option('--targetServerPassword <value>', 'Password of the DX Core server of the subscriber')
|
|
1491
|
+
.requiredOption('--damAPIPort <value>', 'Port number of the DAM API server of the publisher', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
|
|
1492
|
+
.requiredOption('--ringAPIPort <value>', 'Port number of the DX Core API server of the publisher', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
|
|
1493
|
+
.requiredOption('--damAPIVersion <value>', 'API Version number of DAM of the publisher', config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion)
|
|
1494
|
+
.requiredOption('--ringAPIVersion <value>', 'API Version number of DX Core of the publisher', config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion)
|
|
1495
|
+
.option('--ltpaTokenRefreshTime <value>', 'LTPA Token refresh time in minutes', constants_2.LTPA_TOKEN_REFRESH_TIME)
|
|
1496
|
+
.option('--subscriberId <value>', 'Subscriber id of the target environment of the subscriber')
|
|
1497
|
+
.option('--targetHostname <value>', 'Host name of the target environment of the subscriber', config.targetHostname)
|
|
1498
|
+
.option('--interval <value>', 'Interval between two sync cycles. The unit of interval is minute. Default value of interval is 2 minutes.')
|
|
1499
|
+
.option('--recordType <value>', 'Type of the mismatch record')
|
|
1500
|
+
.option('--recordAction <value>', 'Action of the mismatch record')
|
|
1501
|
+
.option('--reportPath <value>', 'Location of the file path to download report')
|
|
1502
|
+
.option('--forceDownload <value>', 'Force download the report', 'false')
|
|
1503
|
+
.option('--dxWASUsername <value>', 'Username of the DX WAS server of the publisher', '')
|
|
1504
|
+
.option('--dxWASPassword <value>', 'Password of the DX WAS server of the publisher', '')
|
|
1505
|
+
.option('--targetServerWASUsername <value>', 'Username of the DX WAS server of the subscriber', '')
|
|
1506
|
+
.option('--targetServerWASPassword <value>', 'Password of the DX WAS server of the subscriber', '')
|
|
1389
1507
|
.option('-h, --help')
|
|
1390
1508
|
.description(`- Registration/Deregistration of the subscriber, trigger the dam staging, get all the subscriber details,
|
|
1391
1509
|
get staging mismatch report, find the dam staging mismatch, start staging resync or delete staging mismatch logs`)
|
|
1392
|
-
.action((subCommand, commands) =>
|
|
1510
|
+
.action(async (subCommand, commands) => {
|
|
1393
1511
|
if ((subCommand === constants_1.SUB_COMMANDS.DAM_REGISTER_SUBSCRIBER
|
|
1394
1512
|
|| subCommand === constants_1.SUB_COMMANDS.DAM_DEREGISTER_SUBSCRIBER
|
|
1395
1513
|
|| subCommand === constants_1.SUB_COMMANDS.DAM_TRIGGER_STAGING
|
|
1396
1514
|
|| subCommand === constants_1.SUB_COMMANDS.DAM_GET_ALL_SUBSCRIBERS
|
|
1397
1515
|
|| subCommand === constants_1.SUB_COMMANDS.UPDATE_SECRETS
|
|
1398
|
-
|| (subCommand === constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT && utils_1.isFeatureEnabled(constants_1.FeaturesEnum.DAM_GET_STAGING_MISMATCH_REPORT))
|
|
1516
|
+
|| (subCommand === constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT && (0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.DAM_GET_STAGING_MISMATCH_REPORT))
|
|
1399
1517
|
|| subCommand === constants_1.SUB_COMMANDS.DAM_FIND_STAGING_MISMATCH
|
|
1400
1518
|
|| subCommand === constants_1.SUB_COMMANDS.DAM_START_STAGING_RESYNC
|
|
1401
|
-
|| subCommand === constants_1.SUB_COMMANDS.DAM_DELETE_STAGING_MISMATCH) && (
|
|
1519
|
+
|| subCommand === constants_1.SUB_COMMANDS.DAM_DELETE_STAGING_MISMATCH) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
1402
1520
|
logger_1.logger.help('Usage: dxclient Manage DAM staging [options] [subCmd]\n');
|
|
1403
1521
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_REGISTER_SUBSCRIBER) {
|
|
1404
1522
|
logger_1.logger.help(' Registration of the subscriber\n');
|
|
1523
|
+
logger_1.logger.help(' \nExample : dxclient manage-dam-staging register-dam-subscriber --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin'
|
|
1524
|
+
+ ' --dxPassword wpsadmin --targetServerUsername wpsadmin --targetServerPassword wpsadmin --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1'
|
|
1525
|
+
+ ' --targetHostname localhost --interval 2 \n');
|
|
1405
1526
|
}
|
|
1406
1527
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_DEREGISTER_SUBSCRIBER) {
|
|
1407
1528
|
logger_1.logger.help(' Deregistration of the subscriber\n');
|
|
1529
|
+
logger_1.logger.help(' \nExample : dxclient manage-dam-staging deregister-dam-subscriber --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin'
|
|
1530
|
+
+ ' --dxPassword wpsadmin --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --subscriberId 9845465764 \n');
|
|
1408
1531
|
}
|
|
1409
1532
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_TRIGGER_STAGING) {
|
|
1410
1533
|
logger_1.logger.help(' Trigger the dam staging\n');
|
|
1534
|
+
logger_1.logger.help(' \nExample : dxclient manage-dam-staging trigger-staging --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1535
|
+
+ ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --targetHostname localhost \n');
|
|
1411
1536
|
}
|
|
1412
1537
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_GET_ALL_SUBSCRIBERS) {
|
|
1413
1538
|
logger_1.logger.help(' Get all the subscriber details\n');
|
|
1539
|
+
logger_1.logger.help(' \nExample : dxclient manage-dam-staging get-all-subscribers --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1540
|
+
+ ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 \n');
|
|
1414
1541
|
}
|
|
1415
1542
|
if (subCommand === constants_1.SUB_COMMANDS.UPDATE_SECRETS) {
|
|
1416
1543
|
logger_1.logger.help(' Update secrets of the publisher & subscriber\n');
|
|
1544
|
+
logger_1.logger.help(' \nExample : dxclient manage-dam-staging update-secrets --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1545
|
+
+ ' --targetServerUsername wpsadmin --targetServerPassword wpsadmin --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --targetHostname localhost \n');
|
|
1417
1546
|
}
|
|
1418
1547
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT) {
|
|
1419
1548
|
logger_1.logger.help(' Get staging mismatch records from publisher\n');
|
|
1549
|
+
logger_1.logger.help(' \nExample : dxclient manage-dam-staging get-staging-mismatch-report --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1550
|
+
+ ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 \n');
|
|
1420
1551
|
}
|
|
1421
1552
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_FIND_STAGING_MISMATCH) {
|
|
1422
1553
|
logger_1.logger.help(' Find dam staging mismatch\n');
|
|
1554
|
+
logger_1.logger.help(' \nExample : dxclient manage-dam-staging find-staging-mismatch --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1555
|
+
+ ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --subscriberId 87654678658 \n');
|
|
1423
1556
|
}
|
|
1424
1557
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_START_STAGING_RESYNC) {
|
|
1425
1558
|
logger_1.logger.help(' Start dam staging resync\n');
|
|
1559
|
+
logger_1.logger.help(' \nExample : dxclient manage-dam-staging start-staging-resync --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1560
|
+
+ ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --subscriberId 9876543256789 \n');
|
|
1426
1561
|
}
|
|
1427
1562
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_DELETE_STAGING_MISMATCH) {
|
|
1428
1563
|
logger_1.logger.help(' Delete dam staging mismatch logs\n');
|
|
1564
|
+
logger_1.logger.help(' \nExample : dxclient manage-dam-staging delete-staging-mismatch --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1565
|
+
+ ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1 --subscriberId 9876543256789 \n');
|
|
1429
1566
|
}
|
|
1430
|
-
logger_1.logger.help(`
|
|
1431
|
-
logger_1.logger.help(`
|
|
1432
|
-
logger_1.logger.help(`
|
|
1567
|
+
logger_1.logger.help(` --dxProtocol <value> Protocol of the DX Core server of the publisher (default: "${config.dxProtocol}")`);
|
|
1568
|
+
logger_1.logger.help(` --hostname <value> Host name of the DX Core server of the publisher (default: "${config.hostname}")`);
|
|
1569
|
+
logger_1.logger.help(` --dxPort <value> Port number of the DX Core server, \
|
|
1433
1570
|
for any Kubernetes Environment default port is 443 (default: "${config.dxPort ? config.dxPort.toString() : config.dxPort}")`);
|
|
1434
|
-
logger_1.logger.help(`
|
|
1435
|
-
logger_1.logger.help(`
|
|
1436
|
-
logger_1.logger.help(`
|
|
1571
|
+
logger_1.logger.help(` --dxUsername <value> Username of the DX Core server of the publisher (default: "${config.dxUsername}")`);
|
|
1572
|
+
logger_1.logger.help(` --dxPassword <value> Password of the DX Core server of the publisher (default: "${MaskData.maskPassword(config.dxPassword)}")`);
|
|
1573
|
+
logger_1.logger.help(` --damAPIPort <value> Port number of the DAM API server of the publisher (default: "${config.damAPIPort
|
|
1437
1574
|
? config.damAPIPort.toString() : config.damAPIPort}")`);
|
|
1438
|
-
logger_1.logger.help(`
|
|
1575
|
+
logger_1.logger.help(` --ringAPIPort <value> Port number of the DX Core API server of the publisher (default: "${config.ringAPIPort
|
|
1439
1576
|
? config.ringAPIPort.toString() : config.ringAPIPort}")`);
|
|
1440
|
-
logger_1.logger.help(`
|
|
1577
|
+
logger_1.logger.help(` --damAPIVersion <value> API Version number of DAM API server of the publisher \
|
|
1441
1578
|
(default: "${config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion}")`);
|
|
1442
|
-
logger_1.logger.help(`
|
|
1579
|
+
logger_1.logger.help(` --ringAPIVersion <value> API Version number of DX Core API server of the publisher \
|
|
1443
1580
|
(default: "${config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion}")`);
|
|
1444
1581
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_REGISTER_SUBSCRIBER) {
|
|
1445
|
-
logger_1.logger.help(`
|
|
1582
|
+
logger_1.logger.help(` --targetHostname <value> Host name of the target environment of the subscriber (default: "${config.targetHostname}")`);
|
|
1446
1583
|
logger_1.logger.help(' -interval,--interval <value> Interval between two sync cycles.The unit of interval is in minutes.Default value of interval is 2 minutes.');
|
|
1447
1584
|
}
|
|
1448
1585
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_DEREGISTER_SUBSCRIBER) {
|
|
1449
1586
|
logger_1.logger.help(' -subscriberId, --subscriberId <value> Subscriber id of the target environment of the subscriber');
|
|
1450
1587
|
}
|
|
1451
1588
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_TRIGGER_STAGING) {
|
|
1452
|
-
logger_1.logger.help(`
|
|
1589
|
+
logger_1.logger.help(` --targetHostname <value> Host name of the target environment of the subscriber (default: "${config.targetHostname}")`);
|
|
1453
1590
|
}
|
|
1454
1591
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT) {
|
|
1455
1592
|
logger_1.logger.help(` -ltpaTokenRefreshTime, --ltpaTokenRefreshTime <value> LTPA Token Refresh time in minutes (default: ${constants_2.LTPA_TOKEN_REFRESH_TIME})`);
|
|
@@ -1469,6 +1606,7 @@ for any Kubernetes Environment default port is 443 (default: "${config.dxPort ?
|
|
|
1469
1606
|
logger_1.logger.help(' -subscriberId, --subscriberId <value> Subscriber id of the target environment of the subscriber');
|
|
1470
1607
|
}
|
|
1471
1608
|
if ([constants_1.SUB_COMMANDS.DAM_REGISTER_SUBSCRIBER, constants_1.SUB_COMMANDS.UPDATE_SECRETS].includes(subCommand)) {
|
|
1609
|
+
logger_1.logger.help(` --targetHostname <value> Host name of the target environment of the subscriber (default: "${config.targetHostname}")`);
|
|
1472
1610
|
logger_1.logger.help(' -targetServerUsername, --targetServerUsername <value> Username of the DX Core server of the subscriber (default: "")');
|
|
1473
1611
|
logger_1.logger.help(' -targetServerPassword, --targetServerPassword <value> Password of the DX Core server of the subscriber (default: "")');
|
|
1474
1612
|
}
|
|
@@ -1492,208 +1630,212 @@ for any Kubernetes Environment default port is 443 (default: "${config.dxPort ?
|
|
|
1492
1630
|
logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.DAM_FIND_STAGING_MISMATCH}: use "${constants_1.COMMANDS.MANAGE_DAM_STAGING} ${constants_1.SUB_COMMANDS.DAM_FIND_STAGING_MISMATCH} -h" for more details`);
|
|
1493
1631
|
logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.DAM_START_STAGING_RESYNC}: use "${constants_1.COMMANDS.MANAGE_DAM_STAGING} ${constants_1.SUB_COMMANDS.DAM_START_STAGING_RESYNC} -h" for more details`);
|
|
1494
1632
|
logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.DAM_DELETE_STAGING_MISMATCH}: use "${constants_1.COMMANDS.MANAGE_DAM_STAGING} ${constants_1.SUB_COMMANDS.DAM_DELETE_STAGING_MISMATCH} -h" for more details`);
|
|
1495
|
-
if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.DAM_GET_STAGING_MISMATCH_REPORT)) {
|
|
1633
|
+
if ((0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.DAM_GET_STAGING_MISMATCH_REPORT)) {
|
|
1496
1634
|
logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT}: use "${constants_1.COMMANDS.MANAGE_DAM_STAGING} ${constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT} -h" for more details`);
|
|
1497
1635
|
}
|
|
1498
1636
|
}
|
|
1499
1637
|
else {
|
|
1500
1638
|
logger_1.logger.debug('Manage DAM staging started');
|
|
1501
1639
|
try {
|
|
1502
|
-
commands_1.configureCommand(subCommand);
|
|
1503
|
-
commands = utils_1.unmaskPasswords(commands);
|
|
1504
|
-
validateOptions_1.validateOptions(commands);
|
|
1640
|
+
(0, commands_1.configureCommand)(subCommand);
|
|
1641
|
+
commands = (0, utils_1.unmaskPasswords)(commands);
|
|
1642
|
+
(0, validateOptions_1.validateOptions)(commands);
|
|
1505
1643
|
}
|
|
1506
1644
|
catch (error) {
|
|
1507
1645
|
logger_1.logger.error(error.message);
|
|
1508
|
-
|
|
1646
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
1509
1647
|
}
|
|
1510
1648
|
}
|
|
1511
1649
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_DEREGISTER_SUBSCRIBER) {
|
|
1512
1650
|
try {
|
|
1513
1651
|
logger_1.logger.debug('DAM subscriber de registration started');
|
|
1514
1652
|
const subscriberUnRegistration = new subscriberDeRegistration_1.SubscriberDeRegistration();
|
|
1515
|
-
const responseCode =
|
|
1653
|
+
const responseCode = await subscriberUnRegistration.invoke(commands);
|
|
1516
1654
|
logger_1.logger.debug('Subscriber deregister completed');
|
|
1517
|
-
|
|
1655
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1518
1656
|
}
|
|
1519
1657
|
catch (error) {
|
|
1520
1658
|
logger_1.logger.error('Exception in execution deregister: %o', error);
|
|
1521
|
-
|
|
1659
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1522
1660
|
}
|
|
1523
1661
|
}
|
|
1524
1662
|
else if (subCommand === constants_1.SUB_COMMANDS.DAM_TRIGGER_STAGING) {
|
|
1525
1663
|
try {
|
|
1526
1664
|
logger_1.logger.debug('DAM staging sync triggered');
|
|
1527
1665
|
const triggerManualStaging = new triggerDAMStaging_1.TriggerStaging();
|
|
1528
|
-
const responseCode =
|
|
1666
|
+
const responseCode = await triggerManualStaging.invoke(commands);
|
|
1529
1667
|
logger_1.logger.debug('DAM staging sync completed');
|
|
1530
|
-
|
|
1668
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1531
1669
|
}
|
|
1532
1670
|
catch (error) {
|
|
1533
1671
|
logger_1.logger.error('Exception in execution trigger staging: %o', error);
|
|
1534
|
-
|
|
1672
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1535
1673
|
}
|
|
1536
1674
|
}
|
|
1537
1675
|
else if (subCommand === constants_1.SUB_COMMANDS.DAM_REGISTER_SUBSCRIBER) {
|
|
1538
1676
|
try {
|
|
1539
1677
|
logger_1.logger.debug('DAM subscriber registration started');
|
|
1540
1678
|
const subscriberRegistration = new subscriberRegistration_1.SubscriberRegistration();
|
|
1541
|
-
commands = utils_1.getTrimmedArguments(commands);
|
|
1542
|
-
const responseCode =
|
|
1679
|
+
commands = (0, utils_1.getTrimmedArguments)(commands);
|
|
1680
|
+
const responseCode = await subscriberRegistration.invoke(commands);
|
|
1543
1681
|
logger_1.logger.debug('Subscriber Registration completed');
|
|
1544
|
-
|
|
1682
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1545
1683
|
}
|
|
1546
1684
|
catch (error) {
|
|
1547
1685
|
logger_1.logger.debug('Exception in execution subscriber registration: %o', error);
|
|
1548
|
-
|
|
1686
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1549
1687
|
}
|
|
1550
1688
|
}
|
|
1551
1689
|
else if (subCommand === constants_1.SUB_COMMANDS.DAM_GET_ALL_SUBSCRIBERS) {
|
|
1552
1690
|
try {
|
|
1553
1691
|
logger_1.logger.debug('DAM get all subscribers execution started');
|
|
1554
1692
|
const subscriberDetails = new subscriberDetails_1.SubscriberDetails();
|
|
1555
|
-
const responseCode =
|
|
1693
|
+
const responseCode = await subscriberDetails.invoke(commands);
|
|
1556
1694
|
logger_1.logger.debug('DAM get all subscribers command execution completed');
|
|
1557
|
-
|
|
1695
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1558
1696
|
}
|
|
1559
1697
|
catch (error) {
|
|
1560
1698
|
logger_1.logger.debug('Exception in execution get all subscribers command: %o', error);
|
|
1561
|
-
|
|
1699
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1562
1700
|
}
|
|
1563
1701
|
}
|
|
1564
1702
|
else if (subCommand === constants_1.SUB_COMMANDS.UPDATE_SECRETS) {
|
|
1565
1703
|
try {
|
|
1566
1704
|
logger_1.logger.debug('DAM update secrets execution started');
|
|
1567
1705
|
const updateSecrets = new updateSecrets_1.UpdateSecrets();
|
|
1568
|
-
commands = utils_1.getTrimmedArguments(commands);
|
|
1569
|
-
const responseCode =
|
|
1706
|
+
commands = (0, utils_1.getTrimmedArguments)(commands);
|
|
1707
|
+
const responseCode = await updateSecrets.invoke(commands);
|
|
1570
1708
|
logger_1.logger.debug('DAM update secrets command execution completed');
|
|
1571
|
-
|
|
1709
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1572
1710
|
}
|
|
1573
1711
|
catch (error) {
|
|
1574
1712
|
logger_1.logger.debug('Exception in execution update secrets command: %o', error);
|
|
1575
|
-
|
|
1713
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1576
1714
|
}
|
|
1577
1715
|
}
|
|
1578
|
-
else if (subCommand === constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT && utils_1.isFeatureEnabled(constants_1.FeaturesEnum.DAM_GET_STAGING_MISMATCH_REPORT)) {
|
|
1716
|
+
else if (subCommand === constants_1.SUB_COMMANDS.DAM_GET_STAGING_MISMATCH_REPORT && (0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.DAM_GET_STAGING_MISMATCH_REPORT)) {
|
|
1579
1717
|
try {
|
|
1580
1718
|
logger_1.logger.debug('DAM Get staging mismatch report started');
|
|
1581
1719
|
const stagingMismatchReport = new stagingMismatchReport_1.StagingMismatchReport();
|
|
1582
|
-
const responseCode =
|
|
1720
|
+
const responseCode = await stagingMismatchReport.invoke(commands);
|
|
1583
1721
|
logger_1.logger.debug('DAM Get staging mismatch report command execution completed');
|
|
1584
|
-
|
|
1722
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1585
1723
|
}
|
|
1586
1724
|
catch (error) {
|
|
1587
1725
|
logger_1.logger.debug('Exception in execution get staging mismatch report command: %o', error);
|
|
1588
|
-
|
|
1726
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1589
1727
|
}
|
|
1590
1728
|
}
|
|
1591
1729
|
else if (subCommand === constants_1.SUB_COMMANDS.DAM_FIND_STAGING_MISMATCH) {
|
|
1592
1730
|
try {
|
|
1593
1731
|
logger_1.logger.debug('DAM find staging mismatch started');
|
|
1594
1732
|
const findStagingMismatch = new findDAMStagingMismatch_1.FindStagingMismatch();
|
|
1595
|
-
const responseCode =
|
|
1596
|
-
|
|
1733
|
+
const responseCode = await findStagingMismatch.invoke(commands);
|
|
1734
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1597
1735
|
}
|
|
1598
1736
|
catch (error) {
|
|
1599
1737
|
logger_1.logger.error('Exception in execution find staging mismatch log: %o', error);
|
|
1600
|
-
|
|
1738
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1601
1739
|
}
|
|
1602
1740
|
}
|
|
1603
1741
|
else if (subCommand === constants_1.SUB_COMMANDS.DAM_START_STAGING_RESYNC) {
|
|
1604
1742
|
try {
|
|
1605
1743
|
logger_1.logger.debug('DAM staging resync started');
|
|
1606
1744
|
const startStagingResync = new stagingResync_1.StagingResync();
|
|
1607
|
-
const responseCode =
|
|
1745
|
+
const responseCode = await startStagingResync.invoke(commands);
|
|
1608
1746
|
logger_1.logger.debug('DAM staging resync completed');
|
|
1609
|
-
|
|
1747
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1610
1748
|
}
|
|
1611
1749
|
catch (error) {
|
|
1612
1750
|
logger_1.logger.error('Exception in execution staging resync: %o', error);
|
|
1613
|
-
|
|
1751
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1614
1752
|
}
|
|
1615
1753
|
}
|
|
1616
1754
|
else if (subCommand === constants_1.SUB_COMMANDS.DAM_DELETE_STAGING_MISMATCH) {
|
|
1617
1755
|
try {
|
|
1618
1756
|
logger_1.logger.debug('DAM delete staging mismatch started');
|
|
1619
1757
|
const DeleteStagingMismatches = new deleteDAMStagingMismatch_1.DeleteStagingMismatch();
|
|
1620
|
-
const responseCode =
|
|
1758
|
+
const responseCode = await DeleteStagingMismatches.invoke(commands);
|
|
1621
1759
|
logger_1.logger.debug('DAM delete staging mismatch completed');
|
|
1622
|
-
|
|
1760
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1623
1761
|
}
|
|
1624
1762
|
catch (error) {
|
|
1625
1763
|
logger_1.logger.error('Exception in execution delete staging mismatch: %o', error);
|
|
1626
|
-
|
|
1764
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1627
1765
|
}
|
|
1628
1766
|
}
|
|
1629
|
-
})
|
|
1767
|
+
});
|
|
1630
1768
|
program
|
|
1631
1769
|
.command(constants_1.COMMANDS.CREATE_CREDENTIAL_VAULT)
|
|
1632
|
-
.requiredOption('
|
|
1633
|
-
.requiredOption('
|
|
1634
|
-
.requiredOption('
|
|
1635
|
-
.requiredOption('
|
|
1636
|
-
.requiredOption('
|
|
1637
|
-
.requiredOption('
|
|
1638
|
-
.requiredOption('
|
|
1639
|
-
.requiredOption('
|
|
1640
|
-
.requiredOption('
|
|
1641
|
-
.option('
|
|
1642
|
-
.option('
|
|
1643
|
-
.option('
|
|
1770
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
1771
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
1772
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
1773
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
1774
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
1775
|
+
.requiredOption('--xmlConfigPath <value>', 'Path to DX configuration endpoint', config.xmlConfigPath)
|
|
1776
|
+
.requiredOption('--vaultUsername <value>', 'The name of the shared vaultUsername', config.vaultUsername)
|
|
1777
|
+
.requiredOption('--vaultPassword <value>', 'The password for the shared userid', MaskData.maskPassword(config.vaultPassword))
|
|
1778
|
+
.requiredOption('--credentialSlotName <value>', 'The name of a credential vault slot')
|
|
1779
|
+
.option('--vaultUserGroup <value>', 'Credential vault portal UserGroup')
|
|
1780
|
+
.option('--vaultSegmentName <value>', 'The name of a new vault segment ')
|
|
1781
|
+
.option('--vaultDescription <value>', 'Description for the credential segment ')
|
|
1644
1782
|
.description('- Creates credential vault in DX Core server before registering a subscriber')
|
|
1645
|
-
.
|
|
1646
|
-
|
|
1783
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient create-credential-vault --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1784
|
+
+ ' --xmlConfigPath /wps/config --vaultUsername wpsadmin --vaultPassword wpsadmin --credentialSlotName test_solt'))
|
|
1785
|
+
.action(async (cmdOptions) => {
|
|
1786
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.CREATE_CREDENTIAL_VAULT);
|
|
1647
1787
|
logger_1.logger.debug('Creates credential vault slot in the DX Core server before registering a subscriber');
|
|
1648
1788
|
try {
|
|
1649
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
1650
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
1789
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
1790
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
1651
1791
|
}
|
|
1652
1792
|
catch (error) {
|
|
1653
1793
|
logger_1.logger.error(error.message);
|
|
1654
|
-
|
|
1794
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
1655
1795
|
}
|
|
1656
1796
|
try {
|
|
1657
1797
|
logger_1.logger.debug('Create credential vault execution started');
|
|
1658
1798
|
const createCredentialVault = new createCredentialVault_1.CreateCredentialVault();
|
|
1659
|
-
const responseCode =
|
|
1799
|
+
const responseCode = await createCredentialVault.invoke(cmdOptions);
|
|
1660
1800
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
1661
1801
|
logger_1.logger.debug('Create credential vault execution completed');
|
|
1662
|
-
|
|
1802
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1663
1803
|
}
|
|
1664
1804
|
catch (error) {
|
|
1665
1805
|
logger_1.logger.debug('Exception in execution : %o', error);
|
|
1666
|
-
|
|
1806
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1667
1807
|
}
|
|
1668
|
-
})
|
|
1808
|
+
});
|
|
1669
1809
|
program
|
|
1670
1810
|
.command(`${constants_1.COMMANDS.DIFFERENTIAL_REPORT} [subCmd]`)
|
|
1671
|
-
.option('
|
|
1672
|
-
.requiredOption('
|
|
1673
|
-
.requiredOption('
|
|
1674
|
-
.requiredOption('
|
|
1675
|
-
.requiredOption('
|
|
1676
|
-
.option('
|
|
1677
|
-
.option('
|
|
1678
|
-
.option('
|
|
1679
|
-
.option('
|
|
1680
|
-
.option('
|
|
1811
|
+
.option('--hostname <value>', 'Host name of the DX core server', config.hostname)
|
|
1812
|
+
.requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
1813
|
+
.requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
1814
|
+
.requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
1815
|
+
.requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
|
|
1816
|
+
.option('--targetHostname <value>', 'Host name of the target DX core server', config.targetHostname)
|
|
1817
|
+
.option('--targetDxConnectPort <value>', 'Port number of the target server', config.targetDxConnectPort ? config.targetDxConnectPort.toString() : config.targetDxConnectPort)
|
|
1818
|
+
.option('--targetDxConnectUsername <value>', 'Username for the target server', config.targetDxConnectUsername)
|
|
1819
|
+
.option('--targetDxConnectPassword <value>', 'Password for the target server', MaskData.maskPassword(config.targetDxConnectPassword))
|
|
1820
|
+
.option('--targetDxProfileName <value>', 'Profile name of the target DX core server ', config.targetDxProfileName)
|
|
1681
1821
|
.option('-h, --help')
|
|
1682
1822
|
.description('- generates dx-core-configuration-reports')
|
|
1683
|
-
.action((subCmd, cmdOptions) =>
|
|
1684
|
-
if ((subCmd === constants_1.SUB_COMMANDS.SUMMARY_REPORT || constants_1.SUB_COMMANDS.RESOURCE_REPORT) && (
|
|
1823
|
+
.action(async (subCmd, cmdOptions) => {
|
|
1824
|
+
if ((subCmd === constants_1.SUB_COMMANDS.SUMMARY_REPORT || constants_1.SUB_COMMANDS.RESOURCE_REPORT) && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
1685
1825
|
logger_1.logger.help(' Usage: dxclient dx-core-configuration-reports [options] [subCmd]\n');
|
|
1686
1826
|
logger_1.logger.help(' - The dx-core-configuration-reports command shows the summary of the configurations of a single DX server or both source and target DX servers, which users can use to compare.\n');
|
|
1687
|
-
logger_1.logger.help(
|
|
1688
|
-
|
|
1689
|
-
logger_1.logger.help(`
|
|
1690
|
-
logger_1.logger.help(`
|
|
1827
|
+
logger_1.logger.help('\nExample : dxclient dx-core-configuration-reports summary-report --hostname localhost --dxConnectPort 10202 --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin'
|
|
1828
|
+
+ ' --dxProfileName wp_profile --targetHostname localhost --targetDxConnectPort 10202 --targetDxConnectUsername wpsadmin --targetDxConnectPassword wpsadmin --targetDxProfileName wp_profile \n');
|
|
1829
|
+
logger_1.logger.help(` --hostname <value> Host name of the DX core server(default: "${config.hostname}")`);
|
|
1830
|
+
logger_1.logger.help(` --dxConnectPort <value> Port number of the cw_profile (default: "${config.dxConnectPort}")`);
|
|
1831
|
+
logger_1.logger.help(` --dxConnectUsername <value> Username for the cw_profile (default: "${config.dxConnectUsername}")`);
|
|
1832
|
+
logger_1.logger.help(` --dxConnectPassword <value> Password for the cw_profile (default: "${MaskData.maskPassword(config.dxConnectPassword)}")`);
|
|
1691
1833
|
logger_1.logger.help(` -dxProfileName, --dxProfileName <value> Profile name in the DX core server (default: "${config.dxProfileName}")`);
|
|
1692
|
-
logger_1.logger.help(`
|
|
1693
|
-
logger_1.logger.help(`
|
|
1694
|
-
logger_1.logger.help(`
|
|
1695
|
-
logger_1.logger.help(`
|
|
1696
|
-
logger_1.logger.help(`
|
|
1834
|
+
logger_1.logger.help(` --targetHostname <value> Host name of the target DX core server (default: "${config.targetHostname}")`);
|
|
1835
|
+
logger_1.logger.help(` --targetDxConnectPort <value> Port number of the target server (default: "${config.targetDxConnectPort}")`);
|
|
1836
|
+
logger_1.logger.help(` --targetDxConnectUsername <value> Username for the target server (default: "${config.targetDxConnectUsername}")`);
|
|
1837
|
+
logger_1.logger.help(` --targetDxConnectPassword <value> Password for the target server (default: "${MaskData.maskPassword(config.targetDxConnectPassword)}")`);
|
|
1838
|
+
logger_1.logger.help(` --targetDxProfileName <value> Profile name of the target DX core server(default: "${config.targetDxProfileName}")`);
|
|
1697
1839
|
logger_1.logger.help(' -h, --help display help for command');
|
|
1698
1840
|
process.exit(1);
|
|
1699
1841
|
}
|
|
@@ -1701,155 +1843,164 @@ program
|
|
|
1701
1843
|
logger_1.logger.help(' Required (sub)command summary-report: use "dx-core-configuration-reports summary-report -h" for more details');
|
|
1702
1844
|
process.exit(1);
|
|
1703
1845
|
}
|
|
1704
|
-
commands_1.configureCommand(subCmd);
|
|
1846
|
+
(0, commands_1.configureCommand)(subCmd);
|
|
1705
1847
|
logger_1.logger.debug('Differential report execution started');
|
|
1706
1848
|
try {
|
|
1707
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
1708
|
-
validateOptions_1.validateOptionsInConfigReports(cmdOptions);
|
|
1849
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
1850
|
+
(0, validateOptions_1.validateOptionsInConfigReports)(cmdOptions);
|
|
1709
1851
|
}
|
|
1710
1852
|
catch (error) {
|
|
1711
1853
|
logger_1.logger.error(error.message);
|
|
1712
|
-
|
|
1854
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
1713
1855
|
}
|
|
1714
1856
|
try {
|
|
1715
1857
|
const differentialReport = new differentialReport_1.DifferentialReport();
|
|
1716
|
-
const responseCode =
|
|
1858
|
+
const responseCode = await differentialReport.invoke(cmdOptions);
|
|
1717
1859
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
1718
1860
|
logger_1.logger.debug('Differential report execution completed');
|
|
1719
|
-
|
|
1861
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1720
1862
|
}
|
|
1721
1863
|
catch (error) {
|
|
1722
1864
|
logger_1.logger.debug('Exception in execution : %o', error);
|
|
1723
|
-
|
|
1865
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1724
1866
|
}
|
|
1725
|
-
})
|
|
1867
|
+
})
|
|
1726
1868
|
.helpOption(false);
|
|
1727
1869
|
program
|
|
1728
1870
|
.command(constants_1.COMMANDS.WCM_LIBRARY_EXPORT)
|
|
1729
|
-
.option('
|
|
1730
|
-
.requiredOption('
|
|
1731
|
-
.requiredOption('
|
|
1732
|
-
.requiredOption('
|
|
1733
|
-
.requiredOption('
|
|
1734
|
-
.requiredOption('
|
|
1735
|
-
.requiredOption('
|
|
1736
|
-
.requiredOption('
|
|
1737
|
-
.requiredOption('
|
|
1738
|
-
.option('
|
|
1739
|
-
.option('
|
|
1740
|
-
.option('
|
|
1871
|
+
.option('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
1872
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
1873
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
1874
|
+
.requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
1875
|
+
.requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
1876
|
+
.requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
1877
|
+
.requiredOption('--dxWASUsername <value>', 'Username of the DX WAS server', config.dxWASUsername)
|
|
1878
|
+
.requiredOption('--dxWASPassword <value>', 'Password of the DX WAS server', MaskData.maskPassword(config.dxWASPassword))
|
|
1879
|
+
.requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
|
|
1880
|
+
.option('--librariesName <value>', 'Name of the wcm library')
|
|
1881
|
+
.option('--exportAllLibraries <value>', 'Enable this parameter if you export all wcm library')
|
|
1882
|
+
.option('--virtualPortalContext <value>', 'Context of the virtual portal from which need to export the WCM Library', config.virtualPortalContext)
|
|
1741
1883
|
.description('- Exports single, multiple or all WCM libraries from the DX Core server')
|
|
1742
|
-
.
|
|
1743
|
-
|
|
1884
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient wcm-library-export --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin --dxConnectUsername wpsadmin'
|
|
1885
|
+
+ ' --dxConnectPassword wpsadmin --dxConnectPort 10202 --dxWASUsername wpsadmin --dxWASPassword wpsadmin --dxProfileName wp_profile --exportAllLibraries true'))
|
|
1886
|
+
.action(async (cmdOptions) => {
|
|
1887
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.WCM_LIBRARY_EXPORT);
|
|
1744
1888
|
logger_1.logger.debug('export of the wcm libraries execution started');
|
|
1745
1889
|
try {
|
|
1746
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
1747
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
1890
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
1891
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
1748
1892
|
}
|
|
1749
1893
|
catch (error) {
|
|
1750
1894
|
logger_1.logger.error(error.message);
|
|
1751
|
-
|
|
1895
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
1752
1896
|
}
|
|
1753
1897
|
const exportWCMLibraryObj = new exportWCMLibrary_1.ExportWCMLibrary();
|
|
1754
1898
|
try {
|
|
1755
|
-
const responseCode =
|
|
1899
|
+
const responseCode = await exportWCMLibraryObj.invoke(cmdOptions);
|
|
1756
1900
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
1757
1901
|
logger_1.logger.debug('export wcm libraries execution successful');
|
|
1758
|
-
|
|
1902
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1759
1903
|
}
|
|
1760
1904
|
catch (error) {
|
|
1761
1905
|
logger_1.logger.debug('Exception in execution of export wcm libraries : %o', error);
|
|
1762
|
-
|
|
1906
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1763
1907
|
}
|
|
1764
|
-
})
|
|
1908
|
+
});
|
|
1765
1909
|
program
|
|
1766
1910
|
.command(constants_1.COMMANDS.WCM_LIBRARY_IMPORT)
|
|
1767
|
-
.option('
|
|
1768
|
-
.requiredOption('
|
|
1769
|
-
.requiredOption('
|
|
1770
|
-
.requiredOption('
|
|
1771
|
-
.requiredOption('
|
|
1772
|
-
.requiredOption('
|
|
1773
|
-
.requiredOption('
|
|
1774
|
-
.requiredOption('
|
|
1775
|
-
.requiredOption('
|
|
1776
|
-
.option('
|
|
1777
|
-
.option('
|
|
1911
|
+
.option('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
1912
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
1913
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
1914
|
+
.requiredOption('--dxConnectUsername <value>', 'Username for the cw_profile', config.dxConnectUsername)
|
|
1915
|
+
.requiredOption('--dxConnectPassword <value>', 'Password for the cw_profile', MaskData.maskPassword(config.dxConnectPassword))
|
|
1916
|
+
.requiredOption('--dxConnectPort <value>', 'Port number of the cw_profile', config.dxConnectPort ? config.dxConnectPort.toString() : config.dxConnectPort)
|
|
1917
|
+
.requiredOption('--dxWASUsername <value>', 'Username of the DX WAS server', config.dxWASUsername)
|
|
1918
|
+
.requiredOption('--dxWASPassword <value>', 'Password of the DX WAS server', MaskData.maskPassword(config.dxWASPassword))
|
|
1919
|
+
.requiredOption('--dxProfileName <value>', 'Profile name in the DX core server ', config.dxProfileName)
|
|
1920
|
+
.option('--libFilePath <value>', 'Path to the file containing the wcm libraries to be imported')
|
|
1921
|
+
.option('--virtualPortalContext <value>', 'Context of the virtual portal to which need to import the WCM Library', config.virtualPortalContext)
|
|
1778
1922
|
.description('- Imports single or multiple WCM libraries into the DX Core server')
|
|
1779
|
-
.
|
|
1780
|
-
|
|
1923
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient wcm-library-import --dxProtocol https --hostname localhost --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
1924
|
+
+ ' --dxConnectUsername wpsadmin --dxConnectPassword wpsadmin --dxWASUsername wpsadmin --dxProfileName wp_profile --libFilePath /user/output/store/wcmlib/test.xml'))
|
|
1925
|
+
.action(async (cmdOptions) => {
|
|
1926
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.WCM_LIBRARY_IMPORT);
|
|
1781
1927
|
logger_1.logger.debug('import of the wcm libraries execution started');
|
|
1782
1928
|
try {
|
|
1783
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
1784
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
1929
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
1930
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
1785
1931
|
}
|
|
1786
1932
|
catch (error) {
|
|
1787
1933
|
logger_1.logger.error(error.message);
|
|
1788
|
-
|
|
1934
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
1789
1935
|
}
|
|
1790
1936
|
const importWCMLibraryObj = new importWCMLibrary_1.ImportWCMLibrary();
|
|
1791
1937
|
try {
|
|
1792
|
-
const responseCode =
|
|
1938
|
+
const responseCode = await importWCMLibraryObj.invoke(cmdOptions);
|
|
1793
1939
|
logger_1.logger.debug('Response code from the invoke function: %s', responseCode);
|
|
1794
1940
|
logger_1.logger.debug('import wcm libraries execution successful');
|
|
1795
|
-
|
|
1941
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1796
1942
|
}
|
|
1797
1943
|
catch (error) {
|
|
1798
1944
|
logger_1.logger.debug('Exception in execution of export wcm libraries : %o', error);
|
|
1799
|
-
|
|
1945
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1800
1946
|
}
|
|
1801
|
-
})
|
|
1947
|
+
});
|
|
1802
1948
|
program
|
|
1803
1949
|
.command(`${constants_1.COMMANDS.MANAGE_DAM_ASSETS} [subCommand]`)
|
|
1804
|
-
.requiredOption('
|
|
1805
|
-
.requiredOption('
|
|
1806
|
-
.requiredOption('
|
|
1807
|
-
.requiredOption('
|
|
1808
|
-
.requiredOption('
|
|
1809
|
-
.requiredOption('
|
|
1810
|
-
.requiredOption('
|
|
1811
|
-
.option('
|
|
1812
|
-
.option('
|
|
1813
|
-
.option('
|
|
1814
|
-
.option('
|
|
1950
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
1951
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
1952
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
1953
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
1954
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
1955
|
+
.requiredOption('--damAPIPort <value>', 'Port number of the DAM server, for any Kubernetes Environment default port is 443', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
|
|
1956
|
+
.requiredOption('--ringAPIPort <value>', 'Port number of the DX Core API server, for any Kubernetes Environment default port is 443', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
|
|
1957
|
+
.option('--exportPath <value>', 'Location of the file path to export')
|
|
1958
|
+
.option('--ltpaTokenRefreshTime <value>', 'LTPA Token refresh time in minutes', constants_2.LTPA_TOKEN_REFRESH_TIME)
|
|
1959
|
+
.option('--exportBinary <value>', 'Use true or false to include or exclude binary as part of export')
|
|
1960
|
+
.option('--importBinary <value>', 'Use true or false to include or exclude binary as part of import')
|
|
1815
1961
|
.option('-h, --help')
|
|
1816
1962
|
.description('- Export or Import or Validate the DAM assets')
|
|
1817
|
-
.action((subCommand, commands) =>
|
|
1963
|
+
.action(async (subCommand, commands) => {
|
|
1818
1964
|
if ((subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_EXPORT || subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_IMPORT)
|
|
1819
|
-
&& (
|
|
1965
|
+
&& (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
1820
1966
|
logger_1.logger.help('Usage: dxclient Manage DAM staging [options] [subCmd]');
|
|
1821
1967
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_EXPORT) {
|
|
1822
1968
|
logger_1.logger.help(' -Export the DAM assets from DX.\n');
|
|
1969
|
+
logger_1.logger.help(' \nExample : dxclient manage-dam-assets export-assets --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin'
|
|
1970
|
+
+ ' --dxPassword wpsadmin --damAPIPort 3001 --ringAPIPort 4000 --exportPath store/outputFiles/dam-export-assets/ --exportBinary true \n');
|
|
1823
1971
|
}
|
|
1824
1972
|
else if (subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_IMPORT) {
|
|
1825
1973
|
logger_1.logger.help(' -Import the DAM assets from DX.\n');
|
|
1974
|
+
logger_1.logger.help(' \nExample : dxclient manage-dam-assets import-assets --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin'
|
|
1975
|
+
+ ' --dxPassword wpsadmin --damAPIPort 3001 --ringAPIPort 4000 --exportPath store/outputFiles/dam-export-assets/ --importBinary true \n');
|
|
1826
1976
|
}
|
|
1827
|
-
logger_1.logger.help(`
|
|
1828
|
-
logger_1.logger.help(`
|
|
1829
|
-
logger_1.logger.help(`
|
|
1977
|
+
logger_1.logger.help(` --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
|
|
1978
|
+
logger_1.logger.help(` --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
|
|
1979
|
+
logger_1.logger.help(` --dxPort <value> Port number of the DX Core server, for any Kubernetes Environment default is 443 \
|
|
1830
1980
|
(default: "${config.dxPort ? config.dxPort.toString() : config.dxPort}")`);
|
|
1831
|
-
logger_1.logger.help(`
|
|
1832
|
-
logger_1.logger.help(`
|
|
1833
|
-
logger_1.logger.help(`
|
|
1981
|
+
logger_1.logger.help(` --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}"`);
|
|
1982
|
+
logger_1.logger.help(` --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
|
|
1983
|
+
logger_1.logger.help(` --damAPIPort <value> Port number of the DAM server, for any Kubernetes Environment default port is 443 \
|
|
1834
1984
|
(default: "${config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort}")`);
|
|
1835
|
-
logger_1.logger.help(`
|
|
1985
|
+
logger_1.logger.help(` --ringAPIPort <value> Port number of the DX Core API server, for any Kubernetes Environment default is 443 \
|
|
1836
1986
|
(default: "${config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort}")`);
|
|
1837
|
-
logger_1.logger.help(`
|
|
1987
|
+
logger_1.logger.help(` --ltpaTokenRefreshTime <value> LTPA Token Refresh time in minutes (default: ${constants_2.LTPA_TOKEN_REFRESH_TIME})`);
|
|
1838
1988
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_EXPORT) {
|
|
1839
|
-
logger_1.logger.help('
|
|
1840
|
-
logger_1.logger.help('
|
|
1989
|
+
logger_1.logger.help(' --exportPath <value> Location of the file path to export(default is store/outputFiles/dam-export-assets/)');
|
|
1990
|
+
logger_1.logger.help(' --exportBinary <value> Use true or false to include or exclude binary as part of export(default is true)');
|
|
1841
1991
|
}
|
|
1842
1992
|
else if (subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_IMPORT) {
|
|
1843
|
-
logger_1.logger.help('
|
|
1844
|
-
logger_1.logger.help('
|
|
1993
|
+
logger_1.logger.help(' --exportPath <value> Location of the file path to import(default is store/outputFiles/dam-export-assets/)');
|
|
1994
|
+
logger_1.logger.help(' --importBinary <value> Use true or false to include or exclude binary as part of import(default is true)');
|
|
1845
1995
|
}
|
|
1846
1996
|
logger_1.logger.help(' -h, --help display help for command');
|
|
1847
1997
|
process.exit(1);
|
|
1848
1998
|
}
|
|
1849
|
-
else if (subCommand === constants_1.SUB_COMMANDS.DAM_EXPORT_VALIDATE && (
|
|
1999
|
+
else if (subCommand === constants_1.SUB_COMMANDS.DAM_EXPORT_VALIDATE && (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
1850
2000
|
logger_1.logger.help(' -Validate the exported DAM assets in your local.');
|
|
1851
|
-
logger_1.logger.help('
|
|
1852
|
-
logger_1.logger.help('
|
|
2001
|
+
logger_1.logger.help(' \nExample : dxclient manage-dam-assets validate-assets --exportPath store/outputFiles/dam-export-assets/ --importBinary true \n');
|
|
2002
|
+
logger_1.logger.help(' --exportPath <value> Location of the exported file path(default is store/outputFiles/dam-export-assets/)');
|
|
2003
|
+
logger_1.logger.help(' --importBinary <value> Use true or false to validate binary as part of validation(default is true)');
|
|
1853
2004
|
logger_1.logger.help(' -h, --help display help for command');
|
|
1854
2005
|
process.exit(1);
|
|
1855
2006
|
}
|
|
@@ -1861,149 +2012,157 @@ program
|
|
|
1861
2012
|
else {
|
|
1862
2013
|
logger_1.logger.debug('Manage DAM assets started');
|
|
1863
2014
|
try {
|
|
1864
|
-
commands_1.configureCommand(subCommand);
|
|
1865
|
-
commands = utils_1.unmaskPasswords(commands);
|
|
1866
|
-
validateOptions_1.validateOptions(commands);
|
|
2015
|
+
(0, commands_1.configureCommand)(subCommand);
|
|
2016
|
+
commands = (0, utils_1.unmaskPasswords)(commands);
|
|
2017
|
+
(0, validateOptions_1.validateOptions)(commands);
|
|
1867
2018
|
}
|
|
1868
2019
|
catch (error) {
|
|
1869
2020
|
logger_1.logger.error(error.message);
|
|
1870
|
-
|
|
2021
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
1871
2022
|
}
|
|
1872
2023
|
}
|
|
1873
2024
|
if (subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_EXPORT) {
|
|
1874
2025
|
try {
|
|
1875
2026
|
logger_1.logger.debug('DAM assets export started');
|
|
1876
2027
|
const exportAssets = new exportAssets_1.ExportAssets();
|
|
1877
|
-
const responseCode =
|
|
2028
|
+
const responseCode = await exportAssets.invoke(commands);
|
|
1878
2029
|
logger_1.logger.debug('DAM assets export completed');
|
|
1879
|
-
|
|
2030
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1880
2031
|
}
|
|
1881
2032
|
catch (error) {
|
|
1882
2033
|
logger_1.logger.debug('Exception in execution of DAM assets export: %o', error);
|
|
1883
|
-
|
|
2034
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1884
2035
|
}
|
|
1885
2036
|
}
|
|
1886
2037
|
else if (subCommand === constants_1.SUB_COMMANDS.DAM_ASSETS_IMPORT) {
|
|
1887
2038
|
try {
|
|
1888
2039
|
logger_1.logger.debug('DAM assets validation started');
|
|
1889
2040
|
const validateAssets = new validateAssets_1.ValidateAssets();
|
|
1890
|
-
const validateResponseCode =
|
|
2041
|
+
const validateResponseCode = await validateAssets.invoke(commands);
|
|
1891
2042
|
if (!validateResponseCode) {
|
|
1892
2043
|
logger_1.logger.debug('DAM assets validation failed');
|
|
1893
|
-
|
|
2044
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1894
2045
|
}
|
|
1895
2046
|
logger_1.logger.debug('DAM assets validation completed');
|
|
1896
2047
|
logger_1.logger.debug('DAM assets import started');
|
|
1897
2048
|
const importAssets = new importAssets_1.ImportAssets();
|
|
1898
|
-
const responseCode =
|
|
2049
|
+
const responseCode = await importAssets.invoke(commands);
|
|
1899
2050
|
logger_1.logger.debug('DAM assets import completed');
|
|
1900
|
-
|
|
2051
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1901
2052
|
}
|
|
1902
2053
|
catch (error) {
|
|
1903
2054
|
logger_1.logger.debug('Exception in execution of DAM assets import: %o', error);
|
|
1904
|
-
|
|
2055
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1905
2056
|
}
|
|
1906
2057
|
}
|
|
1907
2058
|
else if (subCommand === constants_1.SUB_COMMANDS.DAM_EXPORT_VALIDATE) {
|
|
1908
2059
|
try {
|
|
1909
2060
|
logger_1.logger.debug('DAM assets validation started');
|
|
1910
2061
|
const validateAssets = new validateAssets_1.ValidateAssets();
|
|
1911
|
-
const responseCode =
|
|
2062
|
+
const responseCode = await validateAssets.invoke(commands);
|
|
1912
2063
|
logger_1.logger.debug('DAM assets validation completed');
|
|
1913
|
-
|
|
2064
|
+
await (0, utils_1.flushLogAndExitProcess)(responseCode);
|
|
1914
2065
|
}
|
|
1915
2066
|
catch (error) {
|
|
1916
2067
|
logger_1.logger.debug('Exception in execution of DAM assets validation: %o', error);
|
|
1917
|
-
|
|
2068
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
1918
2069
|
}
|
|
1919
2070
|
}
|
|
1920
|
-
})
|
|
1921
|
-
if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
2071
|
+
});
|
|
2072
|
+
if ((0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
1922
2073
|
program
|
|
1923
2074
|
.command(`${constants_1.COMMANDS.LIVESYNC} [subCommand]`)
|
|
1924
|
-
.requiredOption('
|
|
1925
|
-
.requiredOption('
|
|
1926
|
-
.requiredOption('
|
|
1927
|
-
.requiredOption('
|
|
1928
|
-
.requiredOption('
|
|
1929
|
-
.requiredOption('
|
|
1930
|
-
.option('
|
|
1931
|
-
.option('
|
|
1932
|
-
.option('
|
|
1933
|
-
.option('
|
|
1934
|
-
.option('
|
|
1935
|
-
.option('
|
|
1936
|
-
.option('
|
|
1937
|
-
.option('
|
|
2075
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Server', config.dxProtocol)
|
|
2076
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Server', config.hostname)
|
|
2077
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Server, for any Kubernetes Environment default port is 443', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
2078
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core Server', config.dxUsername)
|
|
2079
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core Server', MaskData.maskPassword(config.dxPassword))
|
|
2080
|
+
.requiredOption('--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
|
|
2081
|
+
.option('--themeName <value>', 'Theme System Name (or Theme Title)')
|
|
2082
|
+
.option('--themePath <value>', 'Local path to the Theme folder')
|
|
2083
|
+
.option('--wcmLibraryName <value>', 'WCM Design Library Name', config.wcmLibraryName)
|
|
2084
|
+
.option('--wcmLibraryId <value>', 'UUID of the WCM Design Library', config.wcmLibraryId)
|
|
2085
|
+
.option('--wcmLibraryPath <value>', 'Local path to the Library folder', config.wcmLibraryPath)
|
|
2086
|
+
.option('--wcmProjectName <value>', 'Name of the WCM Project', config.wcmProjectName)
|
|
2087
|
+
.option('--virtualPortalContext <value>', 'Context of the virtual portal of the DX Core server')
|
|
2088
|
+
.option('--disablePrompt <value>', 'Disables the confirmation prompt for overwriting local and server files.', config.disablePrompt)
|
|
1938
2089
|
.option('-h, --help')
|
|
1939
2090
|
.description('- Syncs theme files in WebDAV Server and Local')
|
|
1940
2091
|
.helpOption(false)
|
|
1941
|
-
.action((subCommand, cmdOptions) =>
|
|
2092
|
+
.action(async (subCommand, cmdOptions) => {
|
|
1942
2093
|
if ((constants_1.LIVESYNC_THEME_SUB_CMDS.includes(subCommand))
|
|
1943
|
-
&& (
|
|
2094
|
+
&& (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
1944
2095
|
if (subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME) {
|
|
1945
2096
|
logger_1.logger.help(`Usage: dxclient ${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME} [options]\n`);
|
|
1946
2097
|
logger_1.logger.help('- Pulls theme files from WebDAV Server into local themePath.\n');
|
|
2098
|
+
logger_1.logger.help(' \nExample : dxclient livesync pull-theme --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
2099
|
+
+ ' --contenthandlerPath /wps/mycontenthandler --themePath "/Users/path/to/theme" --themeName "Portal8.5SyncTest" --disablePrompt true \n');
|
|
1947
2100
|
}
|
|
1948
2101
|
else if (subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME) {
|
|
1949
2102
|
logger_1.logger.help(`Usage: dxclient ${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME} [options]\n`);
|
|
1950
2103
|
logger_1.logger.help('- Pushes theme files to WebDAV Server, then continuously watches and syncs succeeding local changes into WebDav Server. "Press (Ctrl + C) to stop watching."\n');
|
|
2104
|
+
logger_1.logger.help(' \nExample : dxclient livesync push-theme --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
2105
|
+
+ ' --contenthandlerPath /wps/mycontenthandler --themePath "/Users/path/to/theme" --themeName "Portal8.5SyncTest" --disablePrompt true \n');
|
|
1951
2106
|
}
|
|
1952
2107
|
logger_1.logger.help('Options:\n');
|
|
1953
|
-
logger_1.logger.help(`
|
|
1954
|
-
logger_1.logger.help(`
|
|
1955
|
-
logger_1.logger.help(`
|
|
2108
|
+
logger_1.logger.help(` --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
|
|
2109
|
+
logger_1.logger.help(` --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
|
|
2110
|
+
logger_1.logger.help(` --dxPort <value> Port number of the DX Core server, for any Kubernetes Environment default is 443 \
|
|
1956
2111
|
(default: "${config.dxPort ? config.dxPort.toString() : config.dxPort}")`);
|
|
1957
|
-
logger_1.logger.help(`
|
|
1958
|
-
logger_1.logger.help(`
|
|
1959
|
-
logger_1.logger.help(`
|
|
2112
|
+
logger_1.logger.help(` --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}"`);
|
|
2113
|
+
logger_1.logger.help(` --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
|
|
2114
|
+
logger_1.logger.help(` --contenthandlerPath <value> Alternate path for the portal context root or the content handler servlet \
|
|
1960
2115
|
(default: "${config.contenthandlerPath}")`);
|
|
1961
2116
|
if (subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME) {
|
|
1962
|
-
logger_1.logger.help('
|
|
1963
|
-
logger_1.logger.help('
|
|
2117
|
+
logger_1.logger.help(' --themeName <value> Theme System Name (or Theme Title)');
|
|
2118
|
+
logger_1.logger.help(' --themePath <value> Local path to the Theme folder');
|
|
1964
2119
|
}
|
|
1965
2120
|
else if (subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME) {
|
|
1966
|
-
logger_1.logger.help('
|
|
1967
|
-
logger_1.logger.help('
|
|
2121
|
+
logger_1.logger.help(' --themeName <value> Theme System Name (or Theme Title)');
|
|
2122
|
+
logger_1.logger.help(' --themePath <value> Local path to the Theme folder');
|
|
1968
2123
|
}
|
|
1969
|
-
logger_1.logger.help('
|
|
2124
|
+
logger_1.logger.help(' --disablePrompt <value> Disable the confirmation prompt for overwriting local and server files.');
|
|
1970
2125
|
logger_1.logger.help(' -h, --help Display help for command');
|
|
1971
2126
|
process.exit(1);
|
|
1972
2127
|
}
|
|
1973
|
-
else if ((constants_1.LIVESYNC_WCM_DESIGN_LIBRARY_SUB_CMDS.includes(subCommand) && utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC_WCM))
|
|
1974
|
-
&& (
|
|
2128
|
+
else if ((constants_1.LIVESYNC_WCM_DESIGN_LIBRARY_SUB_CMDS.includes(subCommand) && (0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.LIVESYNC_WCM))
|
|
2129
|
+
&& (process.argv.includes(constants_1.COMMANDS.H) || process.argv.includes(constants_1.COMMANDS.HELP))) {
|
|
1975
2130
|
if (subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PULL_WCM_DESIGN_LIBRARY) {
|
|
1976
2131
|
logger_1.logger.help(`Usage: dxclient ${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PULL_WCM_DESIGN_LIBRARY} [options]\n`);
|
|
1977
2132
|
logger_1.logger.help('- Pulls wcm design library files from dx Server into local target libraryPath directory.\n');
|
|
2133
|
+
logger_1.logger.help(' \nExample : dxclient livesync pull-wcm-design-library --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
2134
|
+
+ ' --contenthandlerPath /wps/mycontenthandler --wcmLibraryName "portal site" --wcmLibraryPath "/Users/path/to/library" --disablePrompt true \n');
|
|
1978
2135
|
}
|
|
1979
2136
|
else if (subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY) {
|
|
1980
2137
|
logger_1.logger.help(`Usage: dxclient ${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY} [options]\n`);
|
|
1981
2138
|
logger_1.logger.help('- Pushes updated wcm design library files to dx Server, then continuously watches and syncs succeeding local changes into dx Server. "Press (Ctrl + C) to stop watching."\n');
|
|
2139
|
+
logger_1.logger.help(' \nExample : dxclient livesync push-wcm-design-library --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
2140
|
+
+ ' --contenthandlerPath /wps/mycontenthandler --wcmLibraryName "portal site" --wcmLibraryPath "/Users/path/to/library" --disablePrompt true \n');
|
|
1982
2141
|
}
|
|
1983
2142
|
logger_1.logger.help('Options:\n');
|
|
1984
|
-
logger_1.logger.help(`
|
|
1985
|
-
logger_1.logger.help(`
|
|
1986
|
-
logger_1.logger.help(`
|
|
2143
|
+
logger_1.logger.help(` --dxProtocol <value> Protocol of the DX Core server (default: "${config.dxProtocol}")`);
|
|
2144
|
+
logger_1.logger.help(` --hostname <value> Host name of the DX Core server (default: "${config.hostname}")`);
|
|
2145
|
+
logger_1.logger.help(` --dxPort <value> Port number of the DX Core server, for any Kubernetes Environment default is 443 \
|
|
1987
2146
|
(default: "${config.dxPort ? config.dxPort.toString() : config.dxPort}")`);
|
|
1988
|
-
logger_1.logger.help(`
|
|
1989
|
-
logger_1.logger.help(`
|
|
1990
|
-
logger_1.logger.help(`
|
|
2147
|
+
logger_1.logger.help(` --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}"`);
|
|
2148
|
+
logger_1.logger.help(` --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
|
|
2149
|
+
logger_1.logger.help(` --contenthandlerPath <value> Alternate path for the portal context root or the content handler servlet \
|
|
1991
2150
|
(default: "${config.contenthandlerPath}")`);
|
|
1992
|
-
logger_1.logger.help('
|
|
1993
|
-
logger_1.logger.help('
|
|
1994
|
-
logger_1.logger.help('
|
|
1995
|
-
logger_1.logger.help('
|
|
1996
|
-
logger_1.logger.help('
|
|
1997
|
-
logger_1.logger.help('
|
|
2151
|
+
logger_1.logger.help(' --wcmLibraryName <value> WCM Design Library Name');
|
|
2152
|
+
logger_1.logger.help(' --wcmLibraryId <value> UUID of the WCM Design Library');
|
|
2153
|
+
logger_1.logger.help(' --wcmLibraryPath <value> Local path to the Library folder');
|
|
2154
|
+
logger_1.logger.help(' --wcmProjectName <value> Name of the WCM Project');
|
|
2155
|
+
logger_1.logger.help(' --virtualPortalContext <value> Context of the virtual portal of the DX Core server');
|
|
2156
|
+
logger_1.logger.help(' --disablePrompt <value> Disable the confirmation prompt for overwriting local and server files.');
|
|
1998
2157
|
logger_1.logger.help(' -h, --help Display help for command');
|
|
1999
2158
|
process.exit(1);
|
|
2000
2159
|
}
|
|
2001
2160
|
if (!subCommand
|
|
2002
|
-
|| (constants_1.LIVESYNC_WCM_DESIGN_LIBRARY_SUB_CMDS.includes(subCommand) && !utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC_WCM))
|
|
2161
|
+
|| (constants_1.LIVESYNC_WCM_DESIGN_LIBRARY_SUB_CMDS.includes(subCommand) && !(0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.LIVESYNC_WCM))
|
|
2003
2162
|
|| (!constants_1.LIVESYNC_SUB_CMDS.includes(subCommand))) {
|
|
2004
2163
|
logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME}: use "${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME} -h" for more details`);
|
|
2005
2164
|
logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME}: use "${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME} -h" for more details`);
|
|
2006
|
-
if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC_WCM)) {
|
|
2165
|
+
if ((0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.LIVESYNC_WCM)) {
|
|
2007
2166
|
logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.LIVESYNC_PULL_WCM_DESIGN_LIBRARY}: use "${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PULL_WCM_DESIGN_LIBRARY} -h" for more details`);
|
|
2008
2167
|
logger_1.logger.help(` Required (sub)command ${constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY}: use "${constants_1.COMMANDS.LIVESYNC} ${constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY} -h" for more details`);
|
|
2009
2168
|
}
|
|
@@ -2011,23 +2170,23 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2011
2170
|
}
|
|
2012
2171
|
else {
|
|
2013
2172
|
logger_1.logger.debug('LiveSync execution started');
|
|
2014
|
-
commands_1.configureCommand(constants_1.COMMANDS.LIVESYNC);
|
|
2173
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.LIVESYNC);
|
|
2015
2174
|
try {
|
|
2016
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
2017
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
2175
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
2176
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
2018
2177
|
}
|
|
2019
2178
|
catch (error) {
|
|
2020
2179
|
logger_1.logger.error(error.message);
|
|
2021
|
-
|
|
2180
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
2022
2181
|
}
|
|
2023
2182
|
}
|
|
2024
2183
|
if (constants_1.LIVESYNC_THEME_SUB_CMDS.includes(subCommand) && !cmdOptions.themeName) {
|
|
2025
2184
|
const baseUrl = `${cmdOptions.dxProtocol}://${cmdOptions.hostname}:${cmdOptions.dxPort}`;
|
|
2026
2185
|
const themePath = `${cmdOptions.contenthandlerPath}${constants_1.URL_PATH.webDavTheme}`;
|
|
2027
2186
|
try {
|
|
2028
|
-
const themeOptions =
|
|
2187
|
+
const themeOptions = await themeServices_1.themeServices.getAvailableThemes(baseUrl, themePath, cmdOptions.dxUsername, cmdOptions.dxPassword);
|
|
2029
2188
|
logger_1.logger.info('Please select a Theme name');
|
|
2030
|
-
|
|
2189
|
+
await (0, cli_select_1.default)({ values: themeOptions, valueRenderer: (value, selected) => { return `[${value}]`; } }).then((response) => {
|
|
2031
2190
|
logger_1.logger.info('Theme "%s" has been selected.', response.value);
|
|
2032
2191
|
cmdOptions.themeName = response.value;
|
|
2033
2192
|
}).catch(() => {
|
|
@@ -2035,27 +2194,27 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2035
2194
|
});
|
|
2036
2195
|
if (!cmdOptions.themeName) {
|
|
2037
2196
|
logger_1.logger.info('Unable to find a valid themeName, exiting DXCLient.');
|
|
2038
|
-
|
|
2197
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
2039
2198
|
}
|
|
2040
2199
|
}
|
|
2041
2200
|
catch (error) {
|
|
2042
2201
|
logger_1.logger.error('An error occurred during theme selection: %o', error.message ? error.message : error);
|
|
2043
|
-
|
|
2202
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
2044
2203
|
}
|
|
2045
2204
|
}
|
|
2046
2205
|
if (constants_1.LIVESYNC_WCM_DESIGN_LIBRARY_SUB_CMDS.includes(subCommand) && !(cmdOptions.wcmLibraryId || cmdOptions.wcmLibraryName)) {
|
|
2047
2206
|
try {
|
|
2048
|
-
const mappedLibraryPath = utils_1.mapToHostPath(cmdOptions.wcmLibraryPath, []);
|
|
2207
|
+
const mappedLibraryPath = (0, utils_1.mapToHostPath)(cmdOptions.wcmLibraryPath, []);
|
|
2049
2208
|
logger_1.logger.info(`Checking for saved WCM Design Library in ${mappedLibraryPath}`);
|
|
2050
|
-
const savedMetadata = metadataServices_1.getLibraryMetadata(cmdOptions.wcmLibraryPath);
|
|
2209
|
+
const savedMetadata = (0, metadataServices_1.getLibraryMetadata)(cmdOptions.wcmLibraryPath);
|
|
2051
2210
|
if (savedMetadata) {
|
|
2052
2211
|
if (savedMetadata.type !== 'Library') {
|
|
2053
2212
|
logger_1.logger.error('DXClient exiting due to invalid metadata. Error: Metadata not for Library.');
|
|
2054
|
-
|
|
2213
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
2055
2214
|
}
|
|
2056
2215
|
else if (!savedMetadata.id) {
|
|
2057
2216
|
logger_1.logger.error('DXClient exiting due to invalid metadata. Error: Missing Library ID.');
|
|
2058
|
-
|
|
2217
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
2059
2218
|
}
|
|
2060
2219
|
cmdOptions.wcmLibraryId = savedMetadata.id;
|
|
2061
2220
|
cmdOptions.wcmLibraryName = savedMetadata.displayTitle;
|
|
@@ -2075,46 +2234,53 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2075
2234
|
virtualPortalContext: cmdOptions.virtualPortalContext,
|
|
2076
2235
|
wcmProjectName: cmdOptions.wcmProjectName,
|
|
2077
2236
|
};
|
|
2078
|
-
const wcmlibraryResp =
|
|
2237
|
+
const wcmlibraryResp = await (0, wcmRestV2Services_1.libraries)(apiOptions);
|
|
2079
2238
|
const wcmlibraryOptions = wcmlibraryResp.data['library-entries'];
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2239
|
+
const firstHref = wcmlibraryResp.data['library-entries'][0].links[0].href;
|
|
2240
|
+
if (!firstHref.includes(cmdOptions.virtualPortalContext) && cmdOptions.virtualPortalContext) {
|
|
2241
|
+
logger_1.logger.info(`The virtualPortalContext' '${cmdOptions.virtualPortalContext}' does not exits, please enter valide virtualPortalContext.`);
|
|
2242
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
2243
|
+
}
|
|
2244
|
+
else {
|
|
2245
|
+
await (0, cli_select_1.default)({
|
|
2246
|
+
values: wcmlibraryOptions,
|
|
2247
|
+
valueRenderer: (value, selected) => {
|
|
2248
|
+
let { displayTitle } = value;
|
|
2249
|
+
if (!displayTitle && typeof value.title === 'string') {
|
|
2250
|
+
displayTitle = value.title;
|
|
2251
|
+
}
|
|
2252
|
+
else if (typeof value.title === 'object') {
|
|
2253
|
+
displayTitle = value.title.value;
|
|
2254
|
+
}
|
|
2255
|
+
else {
|
|
2256
|
+
displayTitle = value.name;
|
|
2257
|
+
}
|
|
2258
|
+
return `[Library Name: ${value.name}, Display Title: ${displayTitle}, ID: ${value.id}]`;
|
|
2259
|
+
},
|
|
2260
|
+
}).then((response) => {
|
|
2261
|
+
logger_1.logger.info('Library "%s" has been selected.', response.value.name || response.value.id);
|
|
2262
|
+
cmdOptions.wcmLibraryId = response.value.id;
|
|
2263
|
+
cmdOptions.libraryMetadata = response.value;
|
|
2264
|
+
}).catch(() => {
|
|
2265
|
+
logger_1.logger.info('Library selection has been cancelled.');
|
|
2266
|
+
});
|
|
2267
|
+
if (!cmdOptions.wcmLibraryId) {
|
|
2268
|
+
logger_1.logger.info('Unable to find a valid WCM Design Library, exiting DXCLient.');
|
|
2269
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
2270
|
+
}
|
|
2105
2271
|
}
|
|
2106
2272
|
}
|
|
2107
2273
|
}
|
|
2108
2274
|
catch (error) {
|
|
2109
2275
|
logger_1.logger.error('An error occurred during Library selection: %o', error.message ? error.message : error);
|
|
2110
|
-
|
|
2276
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
2111
2277
|
}
|
|
2112
2278
|
}
|
|
2113
2279
|
if (cmdOptions.disablePrompt === 'false') {
|
|
2114
2280
|
let isOverwritePermitted = true;
|
|
2115
2281
|
if ([constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME, constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY].includes(subCommand)) {
|
|
2116
2282
|
const diffSyncMsg = subCommand === constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY ? ' using updated local files' : '';
|
|
2117
|
-
const prompt =
|
|
2283
|
+
const prompt = await (0, prompts_1.default)([{
|
|
2118
2284
|
type: 'text',
|
|
2119
2285
|
name: 'confirmation',
|
|
2120
2286
|
message: `This command will overwrite existing files in your DX Server${diffSyncMsg}. Enter 'OVERWRITE-SERVER' to proceed:`,
|
|
@@ -2123,7 +2289,7 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2123
2289
|
isOverwritePermitted = prompt.confirmation === 'OVERWRITE-SERVER';
|
|
2124
2290
|
}
|
|
2125
2291
|
else if ([constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME, constants_1.SUB_COMMANDS.LIVESYNC_PULL_WCM_DESIGN_LIBRARY].includes(subCommand)) {
|
|
2126
|
-
const prompt =
|
|
2292
|
+
const prompt = await (0, prompts_1.default)([{
|
|
2127
2293
|
type: 'text',
|
|
2128
2294
|
name: 'confirmation',
|
|
2129
2295
|
message: 'This command will overwrite existing files in your local workspace. Enter \'OVERWRITE-LOCAL\' to proceed:',
|
|
@@ -2133,7 +2299,7 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2133
2299
|
}
|
|
2134
2300
|
if (isOverwritePermitted === false) {
|
|
2135
2301
|
logger_1.logger.info('LiveSync overwrite confirmation not validated, exiting DXClient.');
|
|
2136
|
-
|
|
2302
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
2137
2303
|
}
|
|
2138
2304
|
}
|
|
2139
2305
|
const liveSyncSubCommands = [
|
|
@@ -2144,69 +2310,72 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2144
2310
|
];
|
|
2145
2311
|
logger_1.logger.info('LiveSync %s execution started.', liveSyncSubCommands.find((subCmd) => { return subCmd.key === subCommand; }).label);
|
|
2146
2312
|
try {
|
|
2147
|
-
const response =
|
|
2148
|
-
|
|
2313
|
+
const response = await liveSyncSubCommands.find((subCmd) => { return subCmd.key === subCommand; }).value.invoke(cmdOptions);
|
|
2314
|
+
await (0, utils_1.flushLogAndExitProcess)(response);
|
|
2149
2315
|
}
|
|
2150
2316
|
catch (error) {
|
|
2151
2317
|
logger_1.logger.debug('Exception in execution : %o', error);
|
|
2152
|
-
|
|
2318
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
2153
2319
|
}
|
|
2154
|
-
})
|
|
2320
|
+
});
|
|
2155
2321
|
}
|
|
2156
|
-
if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.DAM_REINDEXING)) {
|
|
2322
|
+
if ((0, utils_1.isFeatureEnabled)(constants_1.FeaturesEnum.DAM_REINDEXING)) {
|
|
2157
2323
|
program
|
|
2158
2324
|
.command(constants_1.COMMANDS.DAM_TRIGGER_REINDEXING)
|
|
2159
2325
|
.description('- Trigger Search content-source reindexing')
|
|
2160
|
-
.requiredOption('
|
|
2161
|
-
.requiredOption('
|
|
2162
|
-
.requiredOption('
|
|
2163
|
-
.requiredOption('
|
|
2164
|
-
.requiredOption('
|
|
2165
|
-
.requiredOption('
|
|
2166
|
-
.requiredOption('
|
|
2167
|
-
.requiredOption('
|
|
2168
|
-
.requiredOption('
|
|
2169
|
-
.option('
|
|
2170
|
-
.option('
|
|
2326
|
+
.requiredOption('--dxProtocol <value>', 'Protocol of the DX Core server', config.dxProtocol)
|
|
2327
|
+
.requiredOption('--hostname <value>', 'Host name of the DX Core server', config.hostname)
|
|
2328
|
+
.requiredOption('--dxPort <value>', 'Port number of the DX Core server', config.dxPort ? config.dxPort.toString() : config.dxPort)
|
|
2329
|
+
.requiredOption('--dxUsername <value>', 'Username of the DX Core server', config.dxUsername)
|
|
2330
|
+
.requiredOption('--dxPassword <value>', 'Password of the DX Core server', MaskData.maskPassword(config.dxPassword))
|
|
2331
|
+
.requiredOption('--damAPIPort <value>', 'Port number of the DAM API server', config.damAPIPort ? config.damAPIPort.toString() : config.damAPIPort)
|
|
2332
|
+
.requiredOption('--ringAPIPort <value>', 'Port number of the DX Core API server', config.ringAPIPort ? config.ringAPIPort.toString() : config.ringAPIPort)
|
|
2333
|
+
.requiredOption('--damAPIVersion <value>', 'API Version number of DAM', config.damAPIVersion ? config.damAPIVersion.toString() : config.damAPIVersion)
|
|
2334
|
+
.requiredOption('--ringAPIVersion <value>', 'API Version number of DX Core', config.ringAPIVersion ? config.ringAPIVersion.toString() : config.ringAPIVersion)
|
|
2335
|
+
.option('--ltpaTokenRefreshTime <value>', 'LTPA Token refresh time in minutes', constants_2.LTPA_TOKEN_REFRESH_TIME)
|
|
2336
|
+
.option('--reportPath <value>', 'Location of the file path to download report')
|
|
2171
2337
|
.option('-h, --help')
|
|
2172
|
-
.
|
|
2173
|
-
|
|
2338
|
+
.configureHelp(helpFormatter_1.HelpFormatter.withExample('dxclient --dxProtocol https --hostname localhost --dxPort 10041 --dxUsername wpsadmin --dxPassword wpsadmin'
|
|
2339
|
+
+ ' --damAPIPort 3001 --ringAPIPort 4000 --damAPIVersion v1 --ringAPIVersion v1'))
|
|
2340
|
+
.action(async (cmdOptions) => {
|
|
2341
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.DAM_TRIGGER_REINDEXING);
|
|
2174
2342
|
try {
|
|
2175
|
-
cmdOptions = utils_1.unmaskPasswords(cmdOptions);
|
|
2176
|
-
validateOptions_1.validateOptions(cmdOptions);
|
|
2343
|
+
cmdOptions = (0, utils_1.unmaskPasswords)(cmdOptions);
|
|
2344
|
+
(0, validateOptions_1.validateOptions)(cmdOptions);
|
|
2177
2345
|
}
|
|
2178
2346
|
catch (error) {
|
|
2179
2347
|
logger_1.logger.error(error.message);
|
|
2180
|
-
|
|
2348
|
+
await (0, utils_1.flushLogAndExitProcess)(false, true);
|
|
2181
2349
|
}
|
|
2182
2350
|
try {
|
|
2183
2351
|
const triggerDamReindexing = new triggerDamReindexing_1.TriggerDamReindexing();
|
|
2184
|
-
const res =
|
|
2185
|
-
|
|
2352
|
+
const res = await triggerDamReindexing.invoke(cmdOptions);
|
|
2353
|
+
await (0, utils_1.flushLogAndExitProcess)(res);
|
|
2186
2354
|
}
|
|
2187
2355
|
catch (error) {
|
|
2188
|
-
|
|
2356
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
2189
2357
|
}
|
|
2190
|
-
})
|
|
2358
|
+
});
|
|
2191
2359
|
}
|
|
2192
2360
|
program
|
|
2193
2361
|
.command(constants_1.COMMANDS.ACCEPT_LICENSE)
|
|
2194
2362
|
.description('- accept-license.')
|
|
2195
|
-
.action(() =>
|
|
2363
|
+
.action(async () => {
|
|
2196
2364
|
logger_1.logger.debug('accept-license.');
|
|
2197
|
-
commands_1.configureCommand(constants_1.COMMANDS.ACCEPT_LICENSE);
|
|
2365
|
+
(0, commands_1.configureCommand)(constants_1.COMMANDS.ACCEPT_LICENSE);
|
|
2198
2366
|
try {
|
|
2199
|
-
|
|
2367
|
+
await (0, logger_1.flushLogs)(true);
|
|
2200
2368
|
process.exit(0);
|
|
2201
2369
|
}
|
|
2202
2370
|
catch (error) {
|
|
2203
2371
|
logger_1.logger.error(error.message);
|
|
2204
|
-
|
|
2372
|
+
await (0, utils_1.flushLogAndExitProcess)(false);
|
|
2205
2373
|
}
|
|
2206
|
-
})
|
|
2207
|
-
(() =>
|
|
2208
|
-
|
|
2209
|
-
|
|
2374
|
+
});
|
|
2375
|
+
(async () => { await (0, utils_1.checkLicense)(process.argv[2]); })().then(async () => {
|
|
2376
|
+
const commandArgs = await (0, utils_1.convertSingleToDoubleHyphen)(process.argv);
|
|
2377
|
+
program.parse(commandArgs);
|
|
2378
|
+
}).catch((error) => {
|
|
2210
2379
|
logger_1.logger.error(error.message);
|
|
2211
2380
|
process.exit(1);
|
|
2212
2381
|
});
|