@hcl-software/dxclient 222.0.0 → 223.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 +1 -0
- package/dist/configuration/config.json +1 -0
- package/dist/configuration/versionConfigMap.json +1 -0
- package/dist/package.json +10 -10
- package/dist/packages/livesync/src/commands/pullWcmDesignLibrary.d.ts +3 -1
- package/dist/packages/livesync/src/commands/pullWcmDesignLibrary.js +135 -30
- package/dist/packages/livesync/src/commands/pullWcmDesignLibrary.js.map +1 -1
- package/dist/packages/livesync/src/commands/pushWcmDesignLibrary.d.ts +4 -2
- package/dist/packages/livesync/src/commands/pushWcmDesignLibrary.js +239 -119
- package/dist/packages/livesync/src/commands/pushWcmDesignLibrary.js.map +1 -1
- package/dist/packages/livesync/src/errors/CommandLineMessages_en.json +43 -42
- package/dist/packages/livesync/src/messages/messages_en.json +8 -7
- package/dist/packages/livesync/src/services/foldersWcmServices.js +27 -5
- package/dist/packages/livesync/src/services/foldersWcmServices.js.map +1 -1
- package/dist/packages/livesync/src/services/htmlComponentWcmServices.js +34 -6
- package/dist/packages/livesync/src/services/htmlComponentWcmServices.js.map +1 -1
- package/dist/packages/livesync/src/services/livesyncUtils.d.ts +3 -1
- package/dist/packages/livesync/src/services/livesyncUtils.js +9 -1
- package/dist/packages/livesync/src/services/livesyncUtils.js.map +1 -1
- package/dist/packages/livesync/src/services/metadataServices.d.ts +5 -4
- package/dist/packages/livesync/src/services/metadataServices.js +175 -71
- package/dist/packages/livesync/src/services/metadataServices.js.map +1 -1
- package/dist/packages/livesync/src/services/ongoingSyncServices.js +130 -101
- package/dist/packages/livesync/src/services/ongoingSyncServices.js.map +1 -1
- package/dist/packages/livesync/src/services/wcmRestV2Services.js +9 -2
- package/dist/packages/livesync/src/services/wcmRestV2Services.js.map +1 -1
- package/dist/packages/livesync/src/types/EventQueueItem.type.d.ts +1 -1
- package/dist/packages/livesync/src/types/WCMDesignLibraryCache.type.d.ts +9 -0
- package/dist/packages/livesync/src/types/WCMDesignLibraryCache.type.js +3 -0
- package/dist/packages/livesync/src/types/WCMDesignLibraryCache.type.js.map +1 -0
- package/dist/packages/livesync/src/types/WcmRestApiV2.type.d.ts +10 -0
- package/dist/packages/livesync/src/types/index.d.ts +1 -0
- package/dist/packages/livesync/src/types/index.js +1 -0
- package/dist/packages/livesync/src/types/index.js.map +1 -1
- package/dist/src/index.js +26 -22
- package/dist/src/index.js.map +1 -1
- package/dist/src/utils/constants.d.ts +5 -2
- package/dist/src/utils/constants.js +10 -5
- package/dist/src/utils/constants.js.map +1 -1
- package/dist/src/utils/validateOptions.js +4 -4
- package/dist/src/utils/validateOptions.js.map +1 -1
- package/package.json +10 -10
|
@@ -14,6 +14,7 @@ const requestService_1 = require("../../../../src/services/requestService");
|
|
|
14
14
|
const utils_1 = require("../../../../src/utils/utils");
|
|
15
15
|
const logger_1 = require("../../../../src/utils/logger");
|
|
16
16
|
const constants_1 = require("../../../../src/utils/constants");
|
|
17
|
+
const livesyncUtils_1 = require("./livesyncUtils");
|
|
17
18
|
const sendWcmRequest = (options, limit) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
19
|
if (limit) {
|
|
19
20
|
options.url = `${options.url}${constants_1.URL_PARAMS.wcmV2Limit}${limit}`;
|
|
@@ -36,8 +37,9 @@ const sendWcmRequest = (options, limit) => __awaiter(void 0, void 0, void 0, fun
|
|
|
36
37
|
exports.sendWcmRequest = sendWcmRequest;
|
|
37
38
|
const libraries = (apiOptions, libraryId = '') => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
39
|
try {
|
|
39
|
-
const baseUrl =
|
|
40
|
+
const baseUrl = livesyncUtils_1.getBaseDXApiUrlFromCommand(apiOptions);
|
|
40
41
|
const url = `${baseUrl}${constants_1.URL_PATH.wcmV2Libraries}/${libraryId}`;
|
|
42
|
+
logger_1.logger.debug('Get Libraries URL: %o', url);
|
|
41
43
|
const options = {
|
|
42
44
|
method: 'GET',
|
|
43
45
|
url,
|
|
@@ -47,6 +49,10 @@ const libraries = (apiOptions, libraryId = '') => __awaiter(void 0, void 0, void
|
|
|
47
49
|
if (libraryId === '') {
|
|
48
50
|
const limit = 999999;
|
|
49
51
|
let response = yield exports.sendWcmRequest(options, limit);
|
|
52
|
+
if (response.status === constants_1.HttpStatus.UNAUTHORIZED) {
|
|
53
|
+
logger_1.logger.debug(utils_1.errorMessage('ERROR_LIVESYNC_WCM_LIB_AUTHORISATION'));
|
|
54
|
+
throw new Error(utils_1.errorMessage('ERROR_LIVESYNC_WCM_LIB_AUTHORISATION'));
|
|
55
|
+
}
|
|
50
56
|
const total = Number.parseInt(response.data.total, 10);
|
|
51
57
|
if (response.data && response.data.total && total > limit) {
|
|
52
58
|
response = yield exports.sendWcmRequest(options, total + 1);
|
|
@@ -66,8 +72,9 @@ const search = (apiOptions, searchOptions) => __awaiter(void 0, void 0, void 0,
|
|
|
66
72
|
const searchOptionsRecord = JSON.parse(jsonSearchOptions);
|
|
67
73
|
try {
|
|
68
74
|
const query = new URLSearchParams(searchOptionsRecord);
|
|
69
|
-
const baseUrl =
|
|
75
|
+
const baseUrl = livesyncUtils_1.getBaseDXApiUrlFromCommand(apiOptions);
|
|
70
76
|
const url = `${encodeURI(`${baseUrl}${constants_1.URL_PATH.wcmV2Search}`)}${query.toString()}`;
|
|
77
|
+
logger_1.logger.debug('Search URL: %o', url);
|
|
71
78
|
const options = {
|
|
72
79
|
method: 'GET',
|
|
73
80
|
url,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wcmRestV2Services.js","sourceRoot":"","sources":["../../../../../packages/livesync/src/services/wcmRestV2Services.ts"],"names":[],"mappings":";;;;;;;;;;;;AAaA,4EAAyE;AACzE,
|
|
1
|
+
{"version":3,"file":"wcmRestV2Services.js","sourceRoot":"","sources":["../../../../../packages/livesync/src/services/wcmRestV2Services.ts"],"names":[],"mappings":";;;;;;;;;;;;AAaA,4EAAyE;AACzE,uDAAuE;AAEvE,yDAAsD;AAC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5
5
|
cmdArgs: commander.Command;
|
|
6
|
-
chokidarEvent: ChokidarEvent.ADD | ChokidarEvent.ADD_HTML | ChokidarEvent.ADD_DIR | ChokidarEvent.CHANGE | ChokidarEvent.CHANGE_HTML | ChokidarEvent.CHANGE_DIR | ChokidarEvent.UNLINK | ChokidarEvent.UNLINK_DIR;
|
|
6
|
+
chokidarEvent: ChokidarEvent.ADD | ChokidarEvent.ADD_HTML | ChokidarEvent.ADD_DIR | ChokidarEvent.CHANGE | ChokidarEvent.CHANGE_HTML | ChokidarEvent.CHANGE_DIR | ChokidarEvent.UNLINK | ChokidarEvent.UNLINK_HTML | ChokidarEvent.UNLINK_DIR;
|
|
7
7
|
chokidarPath: string;
|
|
8
8
|
options?: {
|
|
9
9
|
library?: Library;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WCMDesignLibraryCache.type.js","sourceRoot":"","sources":["../../../../../packages/livesync/src/types/WCMDesignLibraryCache.type.ts"],"names":[],"mappings":""}
|
|
@@ -36,6 +36,7 @@ export declare type WcmLibraryComponent = {
|
|
|
36
36
|
type: string;
|
|
37
37
|
name?: string;
|
|
38
38
|
localPath?: string;
|
|
39
|
+
link?: WCMLibraryLink[];
|
|
39
40
|
};
|
|
40
41
|
export declare type Folder = {
|
|
41
42
|
id: string;
|
|
@@ -51,6 +52,8 @@ export declare type WcmRestApiConfig = {
|
|
|
51
52
|
contenthandlerPath: string;
|
|
52
53
|
dxUsername: string;
|
|
53
54
|
dxPassword: string;
|
|
55
|
+
virtualPortalContext?: string;
|
|
56
|
+
wcmProjectName?: string;
|
|
54
57
|
};
|
|
55
58
|
export declare type WcmRestV2RequestOptions = {
|
|
56
59
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'get' | 'post' | 'put' | 'delete';
|
|
@@ -98,3 +101,10 @@ export declare type SearchOption = {
|
|
|
98
101
|
offset?: string;
|
|
99
102
|
limit?: string;
|
|
100
103
|
};
|
|
104
|
+
export declare type WCMLibraryLink = {
|
|
105
|
+
rel: string;
|
|
106
|
+
href: string;
|
|
107
|
+
lang?: string;
|
|
108
|
+
label?: string;
|
|
109
|
+
type?: string;
|
|
110
|
+
};
|
|
@@ -14,4 +14,5 @@ __exportStar(require("./EventQueueItem.type"), exports);
|
|
|
14
14
|
__exportStar(require("./EventHandler.type"), exports);
|
|
15
15
|
__exportStar(require("./OngoingSyncHooks.type"), exports);
|
|
16
16
|
__exportStar(require("./WcmRestApiV2.type"), exports);
|
|
17
|
+
__exportStar(require("./WCMDesignLibraryCache.type"), exports);
|
|
17
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/livesync/src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAYA,wDAAsC;AACtC,sDAAoC;AACpC,0DAAwC;AACxC,sDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/livesync/src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAYA,wDAAsC;AACtC,sDAAoC;AACpC,0DAAwC;AACxC,sDAAoC;AACpC,+DAA6C"}
|
package/dist/src/index.js
CHANGED
|
@@ -131,10 +131,10 @@ program.on('--help', () => {
|
|
|
131
131
|
logger_1.logger.help(' $ dxclient create-syndication-relation');
|
|
132
132
|
logger_1.logger.help(' $ dxclient wcm-library-export');
|
|
133
133
|
logger_1.logger.help(' $ dxclient wcm-library-import');
|
|
134
|
-
logger_1.logger.help(' $ dxclient dx-core-configuration-reports');
|
|
134
|
+
logger_1.logger.help(' $ dxclient dx-core-configuration-reports summary-report');
|
|
135
135
|
logger_1.logger.help(' $ dxclient manage-dam-assets export-assets | import-assets | validate-assets');
|
|
136
136
|
if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
137
|
-
logger_1.logger.help(
|
|
137
|
+
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' : ''}`);
|
|
138
138
|
}
|
|
139
139
|
if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.DAM_REINDEXING)) {
|
|
140
140
|
logger_1.logger.help(' $ dxclient trigger-dam-reindexing');
|
|
@@ -1942,10 +1942,10 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
1942
1942
|
.requiredOption('-contenthandlerPath,--contenthandlerPath <value>', 'Alternate path for the portal context root or the content handler servlet', config.contenthandlerPath)
|
|
1943
1943
|
.option('-themeName, --themeName <value>', 'Theme System Name (or Theme Title)')
|
|
1944
1944
|
.option('-themePath, --themePath <value>', 'Local path to the Theme folder')
|
|
1945
|
-
.option('-
|
|
1946
|
-
.option('-
|
|
1947
|
-
.option('-
|
|
1948
|
-
.option('-wcmProjectName, --wcmProjectName <value>', 'Name of the WCM Project')
|
|
1945
|
+
.option('-wcmLibraryName, --wcmLibraryName <value>', 'WCM Design Library Name', config.wcmLibraryName)
|
|
1946
|
+
.option('-wcmLibraryId, --wcmLibraryId <value>', 'WCM Design Library ID', config.wcmLibraryId)
|
|
1947
|
+
.option('-wcmLibraryPath, --wcmLibraryPath <value>', 'Local path to the Library folder', config.wcmLibraryPath)
|
|
1948
|
+
.option('-wcmProjectName, --wcmProjectName <value>', 'Name of the WCM Project', config.wcmProjectName)
|
|
1949
1949
|
.option('-virtualPortalContext, --virtualPortalContext <value>', 'Context of the virtual portal of the DX Core server')
|
|
1950
1950
|
.option('-disablePrompt, --disablePrompt <value>', 'Disables the confirmation prompt for overwriting local and server files.', config.disablePrompt)
|
|
1951
1951
|
.option('-h, --help')
|
|
@@ -2000,9 +2000,11 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2000
2000
|
(default: "${config.dxPort ? config.dxPort.toString() : config.dxPort}")`);
|
|
2001
2001
|
logger_1.logger.help(` -dxUsername, --dxUsername <value> Username of the DX Core server (default: "${config.dxUsername}"`);
|
|
2002
2002
|
logger_1.logger.help(` -dxPassword, --dxPassword <value> Password of the DX Core server (default: "${MaskData.maskPassword(config.dxPassword)}")`);
|
|
2003
|
-
logger_1.logger.help(
|
|
2004
|
-
|
|
2005
|
-
logger_1.logger.help(' -
|
|
2003
|
+
logger_1.logger.help(` -contenthandlerPath,--contenthandlerPath <value> Alternate path for the portal context root or the content handler servlet \
|
|
2004
|
+
(default: "${config.contenthandlerPath}")`);
|
|
2005
|
+
logger_1.logger.help(' -wcmLibraryName, --wcmLibraryName <value> WCM Design Library Name');
|
|
2006
|
+
logger_1.logger.help(' -wcmLibraryId, --wcmLibraryId <value> WCM Design Library ID');
|
|
2007
|
+
logger_1.logger.help(' -wcmLibraryPath, --wcmLibraryPath <value> Local path to the Library folder');
|
|
2006
2008
|
logger_1.logger.help(' -wcmProjectName, --wcmProjectName <value> Name of the WCM Project');
|
|
2007
2009
|
logger_1.logger.help(' -virtualPortalContext, --virtualPortalContext <value> Context of the virtual portal of the DX Core server');
|
|
2008
2010
|
logger_1.logger.help(' -disablePrompt, --disablePrompt <value> Disable the confirmation prompt for overwriting local and server files.');
|
|
@@ -2054,10 +2056,10 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2054
2056
|
yield utils_1.flushLogAndExitProcess(false);
|
|
2055
2057
|
}
|
|
2056
2058
|
}
|
|
2057
|
-
if (constants_1.LIVESYNC_WCM_DESIGN_LIBRARY_SUB_CMDS.includes(subCommand) && !(cmdOptions.
|
|
2059
|
+
if (constants_1.LIVESYNC_WCM_DESIGN_LIBRARY_SUB_CMDS.includes(subCommand) && !(cmdOptions.wcmLibraryId || cmdOptions.wcmLibraryName)) {
|
|
2058
2060
|
try {
|
|
2059
|
-
logger_1.logger.info(`Checking for saved WCM Design Library in ${cmdOptions.
|
|
2060
|
-
const savedMetadata = metadataServices_1.getLibraryMetadata(cmdOptions.
|
|
2061
|
+
logger_1.logger.info(`Checking for saved WCM Design Library in ${cmdOptions.wcmLibraryPath}`);
|
|
2062
|
+
const savedMetadata = metadataServices_1.getLibraryMetadata(cmdOptions.wcmLibraryPath);
|
|
2061
2063
|
if (savedMetadata) {
|
|
2062
2064
|
if (savedMetadata.type !== 'Library') {
|
|
2063
2065
|
logger_1.logger.error('DXClient exiting due to invalid metadata. Error: Metadata not for Library.');
|
|
@@ -2067,9 +2069,9 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2067
2069
|
logger_1.logger.error('DXClient exiting due to invalid metadata. Error: Missing Library ID.');
|
|
2068
2070
|
yield utils_1.flushLogAndExitProcess(false, true);
|
|
2069
2071
|
}
|
|
2070
|
-
cmdOptions.
|
|
2071
|
-
cmdOptions.
|
|
2072
|
-
logger_1.logger.info(`Loading saved WCM Design Library "${cmdOptions.
|
|
2072
|
+
cmdOptions.wcmLibraryId = savedMetadata.id;
|
|
2073
|
+
cmdOptions.wcmLibraryName = savedMetadata.displayTitle;
|
|
2074
|
+
logger_1.logger.info(`Loading saved WCM Design Library "${cmdOptions.wcmLibraryName || cmdOptions.wcmLibraryId}".`);
|
|
2073
2075
|
}
|
|
2074
2076
|
else {
|
|
2075
2077
|
logger_1.logger.debug('Get WCM Library Selection from the DX Server');
|
|
@@ -2081,6 +2083,8 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2081
2083
|
contenthandlerPath: cmdOptions.contenthandlerPath,
|
|
2082
2084
|
dxUsername: cmdOptions.dxUsername,
|
|
2083
2085
|
dxPassword: cmdOptions.dxPassword,
|
|
2086
|
+
virtualPortalContext: cmdOptions.virtualPortalContext,
|
|
2087
|
+
wcmProjectName: cmdOptions.wcmProjectName,
|
|
2084
2088
|
};
|
|
2085
2089
|
const wcmlibraryResp = yield wcmRestV2Services_1.libraries(apiOptions);
|
|
2086
2090
|
const wcmlibraryOptions = wcmlibraryResp.data['library-entries'];
|
|
@@ -2101,12 +2105,12 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2101
2105
|
},
|
|
2102
2106
|
}).then((response) => {
|
|
2103
2107
|
logger_1.logger.info('Library "%s" has been selected.', response.value.name || response.value.id);
|
|
2104
|
-
cmdOptions.
|
|
2108
|
+
cmdOptions.wcmLibraryId = response.value.id;
|
|
2105
2109
|
cmdOptions.libraryMetadata = response.value;
|
|
2106
2110
|
}).catch(() => {
|
|
2107
2111
|
logger_1.logger.info('Library selection has been cancelled.');
|
|
2108
2112
|
});
|
|
2109
|
-
if (!cmdOptions.
|
|
2113
|
+
if (!cmdOptions.wcmLibraryId) {
|
|
2110
2114
|
logger_1.logger.info('Unable to find a valid WCM Design Library, exiting DXCLient.');
|
|
2111
2115
|
yield utils_1.flushLogAndExitProcess(false);
|
|
2112
2116
|
}
|
|
@@ -2119,20 +2123,20 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2119
2123
|
}
|
|
2120
2124
|
if (cmdOptions.disablePrompt === 'false') {
|
|
2121
2125
|
let isOverwritePermitted = true;
|
|
2122
|
-
if (
|
|
2126
|
+
if ([constants_1.SUB_COMMANDS.LIVESYNC_PUSH_THEME, constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY].includes(subCommand)) {
|
|
2123
2127
|
const prompt = yield prompts_1.default([{
|
|
2124
2128
|
type: 'text',
|
|
2125
2129
|
name: 'confirmation',
|
|
2126
|
-
message: 'This command will overwrite
|
|
2130
|
+
message: 'This command will overwrite existing files in your DX Server. Enter \'OVERWRITE-SERVER\' to proceed:',
|
|
2127
2131
|
initial: false,
|
|
2128
2132
|
}]);
|
|
2129
2133
|
isOverwritePermitted = prompt.confirmation === 'OVERWRITE-SERVER';
|
|
2130
2134
|
}
|
|
2131
|
-
else if (
|
|
2135
|
+
else if ([constants_1.SUB_COMMANDS.LIVESYNC_PULL_THEME, constants_1.SUB_COMMANDS.LIVESYNC_PULL_WCM_DESIGN_LIBRARY].includes(subCommand)) {
|
|
2132
2136
|
const prompt = yield prompts_1.default([{
|
|
2133
2137
|
type: 'text',
|
|
2134
2138
|
name: 'confirmation',
|
|
2135
|
-
message: 'This command will overwrite
|
|
2139
|
+
message: 'This command will overwrite existing files in your local workspace. Enter \'OVERWRITE-LOCAL\' to proceed:',
|
|
2136
2140
|
initial: false,
|
|
2137
2141
|
}]);
|
|
2138
2142
|
isOverwritePermitted = prompt.confirmation === 'OVERWRITE-LOCAL';
|
|
@@ -2148,7 +2152,7 @@ if (utils_1.isFeatureEnabled(constants_1.FeaturesEnum.LIVESYNC)) {
|
|
|
2148
2152
|
{ key: constants_1.SUB_COMMANDS.LIVESYNC_PULL_WCM_DESIGN_LIBRARY, value: new pullWcmDesignLibrary_1.PullWcmDesignLibrary(), label: 'Pull WCM Design Library' },
|
|
2149
2153
|
{ key: constants_1.SUB_COMMANDS.LIVESYNC_PUSH_WCM_DESIGN_LIBRARY, value: new pushWcmDesignLibrary_1.PushWcmDesignLibrary(), label: 'Push WCM Design Library' },
|
|
2150
2154
|
];
|
|
2151
|
-
logger_1.logger.info('LiveSync %s
|
|
2155
|
+
logger_1.logger.info('LiveSync %s execution started.', liveSyncSubCommands.find((subCmd) => { return subCmd.key === subCommand; }).label);
|
|
2152
2156
|
try {
|
|
2153
2157
|
const response = yield liveSyncSubCommands.find((subCmd) => { return subCmd.key === subCommand; }).value.invoke(cmdOptions);
|
|
2154
2158
|
yield utils_1.flushLogAndExitProcess(response);
|