@hcl-software/dxclient 221.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.
Files changed (48) hide show
  1. package/{README.txt → README.md} +2 -0
  2. package/dist/configuration/config.json +1 -0
  3. package/dist/configuration/versionConfigMap.json +2 -0
  4. package/dist/package.json +11 -11
  5. package/dist/packages/livesync/package-lock.json +7 -0
  6. package/dist/packages/livesync/package.json +2 -0
  7. package/dist/packages/livesync/src/commands/pullWcmDesignLibrary.d.ts +3 -1
  8. package/dist/packages/livesync/src/commands/pullWcmDesignLibrary.js +138 -33
  9. package/dist/packages/livesync/src/commands/pullWcmDesignLibrary.js.map +1 -1
  10. package/dist/packages/livesync/src/commands/pushWcmDesignLibrary.d.ts +18 -0
  11. package/dist/packages/livesync/src/commands/pushWcmDesignLibrary.js +570 -2
  12. package/dist/packages/livesync/src/commands/pushWcmDesignLibrary.js.map +1 -1
  13. package/dist/packages/livesync/src/errors/CommandLineMessages_en.json +43 -15
  14. package/dist/packages/livesync/src/messages/messages_en.json +12 -2
  15. package/dist/packages/livesync/src/services/EventsQueue.js.map +1 -1
  16. package/dist/packages/livesync/src/services/foldersWcmServices.js +27 -5
  17. package/dist/packages/livesync/src/services/foldersWcmServices.js.map +1 -1
  18. package/dist/packages/livesync/src/services/htmlComponentWcmServices.js +34 -6
  19. package/dist/packages/livesync/src/services/htmlComponentWcmServices.js.map +1 -1
  20. package/dist/packages/livesync/src/services/livesyncUtils.d.ts +4 -0
  21. package/dist/packages/livesync/src/services/livesyncUtils.js +17 -1
  22. package/dist/packages/livesync/src/services/livesyncUtils.js.map +1 -1
  23. package/dist/packages/livesync/src/services/metadataServices.d.ts +8 -2
  24. package/dist/packages/livesync/src/services/metadataServices.js +205 -61
  25. package/dist/packages/livesync/src/services/metadataServices.js.map +1 -1
  26. package/dist/packages/livesync/src/services/ongoingSyncServices.d.ts +6 -0
  27. package/dist/packages/livesync/src/services/ongoingSyncServices.js +414 -4
  28. package/dist/packages/livesync/src/services/ongoingSyncServices.js.map +1 -1
  29. package/dist/packages/livesync/src/services/wcmRestV2Services.js +9 -2
  30. package/dist/packages/livesync/src/services/wcmRestV2Services.js.map +1 -1
  31. package/dist/packages/livesync/src/types/EventQueueItem.type.d.ts +5 -1
  32. package/dist/packages/livesync/src/types/WCMDesignLibraryCache.type.d.ts +9 -0
  33. package/dist/packages/livesync/src/types/WCMDesignLibraryCache.type.js +3 -0
  34. package/dist/packages/livesync/src/types/WCMDesignLibraryCache.type.js.map +1 -0
  35. package/dist/packages/livesync/src/types/WcmRestApiV2.type.d.ts +11 -0
  36. package/dist/packages/livesync/src/types/index.d.ts +1 -0
  37. package/dist/packages/livesync/src/types/index.js +1 -0
  38. package/dist/packages/livesync/src/types/index.js.map +1 -1
  39. package/dist/src/index.js +39 -23
  40. package/dist/src/index.js.map +1 -1
  41. package/dist/src/utils/constants.d.ts +17 -2
  42. package/dist/src/utils/constants.js +26 -5
  43. package/dist/src/utils/constants.js.map +1 -1
  44. package/dist/src/utils/utils.js +2 -1
  45. package/dist/src/utils/utils.js.map +1 -1
  46. package/dist/src/utils/validateOptions.js +4 -4
  47. package/dist/src/utils/validateOptions.js.map +1 -1
  48. package/package.json +11 -11
@@ -15,18 +15,6 @@
15
15
  "ERROR_THEME_PULL_ZIP_SAVE_FAILED": "Failed to save received data while pulling {0}.",
16
16
  "ERROR_THEME_PULL_NO_DATA_RECEIVED": "No data was received while pulling {0}.",
17
17
  "ERROR_THEME_PULL_END": "LiveSync Pull Theme has failed. For details on this failure, please check the logger.log file for DXClient.",
18
- "ERROR_WCM_DESIGN_LIBRARY_PULL_NOT_FOUND": "{0} cannot be pulled because it does not exist in the Server.",
19
- "ERROR_WCM_DESIGN_LIBRARY_PULL_GENERIC": "An error occurred while pulling {0}. For details on this failure, please check the logger.log file for DXClient.\n\tError Message: {1}",
20
- "ERROR_WCM_DESIGN_LIBRARY_PULL_EBUSY": "Failed to empty the target directory, one or more resources are busy. Ensure that you are not executing the command inside the target directory.",
21
- "ERROR_WCM_DESIGN_LIBRARY_PULL_EMPTY_DIR": "Failed to empty the target directory.",
22
- "ERROR_WCM_DESIGN_LIBRARY_CREATE_METADATA": "Failed to create library metadata for {0}.",
23
- "ERROR_WCM_DESIGN_LIBRARY_PULL_PROCESS_FOLDER": "Failed to process folder {0} while pulling WCM Design Library. \n Error: {1}",
24
- "ERROR_WCM_DESIGN_LIBRARY_PULL_CREATE_FOLDER": "Failed to create folder {0} while pulling WCM Design Library. \n Error: {1}",
25
- "ERROR_WCM_DESIGN_LIBRARY_PULL_CREATE_PARENT_FOLDER": "Error creating folder {0} under parent {1}",
26
- "ERROR_WCM_DESIGN_LIBRARY_PULL_END": "LiveSync Pull WCM Design Library has failed. For details on this failure, please check the logger.log file for DXClient.",
27
- "ERROR_WCM_DESIGN_LIBRARY_PATH_NOT_EXISTED": "Library path {0} does not exist",
28
- "ERROR_WCM_DESIGN_LIBRARY_META_FILE_NOT_EXISTED": "Library metadata file path {0} does not exist",
29
- "ERROR_WCM_DESIGN_FOLDER_META_FILE_NOT_EXISTED": "Folder metadata file {0} does not exist",
30
18
  "ERROR_FILE_UPLOAD_NO_CONTENT": "[ERROR] File Upload Request has no content. Ensure that the {0} exists in theme folder.",
31
19
  "ERROR_FILE_UPLOAD_UNAUTHORIZED": "[ERROR] File Upload Request is unauthorized. Ensure that dxUsername and dxPassword is correct.",
32
20
  "ERROR_FILE_UPLOAD_CONFLICT": "[INFO] Skipping file upload for {0} because it is conflicting with the WebDAV Server file of the same name.",
@@ -46,7 +34,47 @@
46
34
  "ERROR_FOLDER_UPLOAD_UNKNOWN": "[ERROR] An error occurred while uploading folder: {0}. For details on this failure, please check the logger.log file for DXClient.",
47
35
  "ERROR_FOLDER_DELETE_UNAUTHORIZED": "[ERROR] Folder Delete Request is unauthorized. Ensure that dxUsername and dxPassword is correct.",
48
36
  "ERROR_FOLDER_DELETE_NOT_FOUND": "[ERROR] Folder delete request did not succeed because it does not exist in the server.",
49
- "ERROR_LIVESYNC_WCM_LIBRARY_META_FOLDER_PATH": "[ERROR] Library path {0} does not exist.",
50
- "ERROR_READ_JSON_FILE": "Error reading the JSON file : {0}.",
51
- "ERROR_WCM_DESIGN_LIBRARY_PULL_HTML_COMPONENT_END": "Pull WCM Design Library has failed. For details on this failure, please check the logger.log file for DXClient."
37
+ "ERROR_PROJECT_NOT_FOUND": "The project-{0} does not exist in the Server.",
38
+ "ERROR_WCM_DESIGN_LIBRARY_PULL_NOT_FOUND": "{0} cannot be pulled because it does not exist in the Server.",
39
+ "ERROR_WCM_DESIGN_LIBRARY_PULL_GENERIC": "An error occurred while pulling {0}. For details on this failure, please check the logger.log file for DXClient.\n\tError Message: {1}",
40
+ "ERROR_WCM_DESIGN_LIBRARY_PULL_EBUSY": "An error occurred while emptying the target directory, one or more resources are busy. Ensure that you are not executing the command inside the target directory.",
41
+ "ERROR_WCM_DESIGN_LIBRARY_PULL_EMPTY_DIR": "An error occurred while emptying the target directory. Ensure that you are using the correct directory",
42
+ "ERROR_WCM_DESIGN_LIBRARY_CREATE_METADATA": "An error occurred while creating library metadata for {0}, please check the logger.log file for DXClient.",
43
+ "ERROR_WCM_DESIGN_LIBRARY_PULL_PROCESS_FOLDER": "An error occurred while processing folder {0} while pulling WCM Design Library. \n Error: {1}",
44
+ "ERROR_WCM_DESIGN_LIBRARY_PULL_CREATE_FOLDER": "An error occurred while creating folder {0} while pulling WCM Design Library. \n Error: {1}",
45
+ "ERROR_WCM_DESIGN_LIBRARY_PULL_CREATE_PARENT_FOLDER": "Error creating folder {0} under parent {1}",
46
+ "ERROR_WCM_DESIGN_LIBRARY_PULL_END": "LiveSync Pull WCM Design Library has failed. For details on this failure, please check the logger.log file for DXClient.",
47
+ "ERROR_WCM_DESIGN_LIBRARY_PATH_NOT_EXIST": "Library path {0} does not exist. Retry the command with a valid path.",
48
+ "ERROR_WCM_DESIGN_LIBRARY_META_FILE_NOT_EXIST": "Metadata of the library {0} does not exist. Ensure you are using a valid directory.",
49
+ "ERROR_WCM_DESIGN_FOLDER_META_FILE_NOT_EXIST": "Metadata of folder {0} does not exist. Ensure you are using a valid directory.",
50
+ "ERROR_WCM_DESIGN_COMPONENT_META_FILE_NOT_EXIST": "Metadata of component {0} does not exist. Ensure you are using a valid directory.",
51
+ "ERROR_WCM_DESIGN_LIBRARY_PUSH_GENERIC": "[ERROR] An error occurred while pushing {0}. For details on this failure, please check the logger.log file for DXClient.\n\tError Message: {1}",
52
+ "ERROR_WCM_DESIGN_LIBRARY_ONGOING_PUSH": "[ERROR] An error occurred during the ongoing push of {0}. For details on this failure, please check the logger.log file for DXClient.",
53
+ "ERROR_WCM_DESIGN_LIBRARY_PULL_HTML_COMPONENT_END": "[ERROR] An error occurred while executing Pull WCM Design Library. For details on this failure, please check the logger.log file for DXClient.",
54
+ "ERROR_METADATA_LOAD": "[ERROR] An error occurred while loading saved metadata. \n Error: {0}, Retry using a new directory or emptying the target directory.",
55
+ "ERROR_LIVESYNC_PUSH_WCM_NO_METADATA": "[ERROR] An error occurred while loading saved metadata. \n Error: Missing local WCM Design Library metadata. Please first pull an existing library or check if the target directory specified in 'libraryPath' is correct.",
56
+ "ERROR_LIVESYNC_PUSH_WCM_CREATE_FOLDER_DEFAULT": "[ERROR] An error occurred while creating {0} folder. \n Error: {1}. For details on this failure, please check the logger.log file for DXClient.",
57
+ "ERROR_LIVESYNC_PUSH_WCM_CREATE_FOLDER_UNAUTHORIZED": "[ERROR] An error occurred while creating {0} folder. \n Error: Unauthorized. Ensure that dxUsername and dxPassword is correct.",
58
+ "ERROR_LIVESYNC_PUSH_WCM_CREATE_FOLDER_CONFLICT": "[ERROR] An error occurred while creating {0} folder. \n Error: Conflict. This already exists or has been modified by someone else in the server.",
59
+ "ERROR_LIVESYNC_PUSH_WCM_CREATE_HTML_UNAUTHORIZED": "[ERROR] An error occurred while creating {0} html component. \n Error: Unauthorized. Ensure that dxUsername and dxPassword is correct.",
60
+ "ERROR_LIVESYNC_PUSH_WCM_CREATE_HTML_CONFLICT": "[ERROR] An error occurred while creating {0} html component. \n Error: Conflict. This already exists or has been modified by someone else in the server.",
61
+ "ERROR_LIVESYNC_PUSH_WCM_CREATE_HTML_DEFAULT": "[ERROR] An error occurred while creating {0} html component. \n Error: {1}. For details on this failure, please check the logger.log file for DXClient.",
62
+ "ERROR_LIVESYNC_PUSH_WCM_UPDATE_FOLDER_NOTFOUND": "[ERROR] An error occurred while updating {0} folder. \n Error: Not Found. Ensure that the folder exists in the server.",
63
+ "ERROR_LIVESYNC_PUSH_WCM_UPDATE_FOLDER_UNAUTHORIZED": "[ERROR] An error occurred while updating {0} folder. \n Error: Unauthorized. Ensure that dxUsername and dxPassword is correct.",
64
+ "ERROR_LIVESYNC_PUSH_WCM_UPDATE_FOLDER_DEFAULT": "[ERROR] An error occurred while updating {0} folder. \n Error: {1}. For details on this failure, please check the logger.log file for DXClient.",
65
+ "ERROR_LIVESYNC_PUSH_WCM_UPDATE_HTML_NOTFOUND": "[ERROR] An error occurred while updating {0} html component. \n Error: Not Found. Please make sure that the component exists on the server.",
66
+ "ERROR_LIVESYNC_PUSH_WCM_UPDATE_HTML_UNAUTHORIZED": "[ERROR] An error occurred while updating {0} html component. \n Error: Unauthorized. Ensure that dxUsername and dxPassword is correct.",
67
+ "ERROR_LIVESYNC_PUSH_WCM_UPDATE_HTML_DEFAULT": "[ERROR] An error occurred while updating {0} html component. \n Error: {1}. For details on this failure, please check the logger.log file for DXClient.",
68
+ "ERROR_LIVESYNC_PUSH_WCM_DELETE_HTML_UNAUTHORIZED": "[ERROR] An error occurred while deleting {0} html component. \n Error: Unauthorized. Ensure that dxUsername and dxPassword is correct.",
69
+ "ERROR_LIVESYNC_PUSH_WCM_DELETE_HTML_NOTFOUND": "[ERROR] An error occurred while deleting {0} html component. \n Error: Not Found. Please make sure that the component exists on the server.",
70
+ "ERROR_LIVESYNC_PUSH_WCM_DELETE_HTML_DEFAULT": "[ERROR] An error occurred while deleting {0} html component. \n Error: {1}. For details on this failure, please check the logger.log file for DXClient.",
71
+ "ERROR_LIVESYNC_PUSH_WCM_DELETE_FOLDER_DEFAULT": "[ERROR] An error occurred while deleting {0} folder. \n Error: {1}. For details on this failure, please check the logger.log file for DXClient.",
72
+ "ERROR_LIVESYNC_PUSH_WCM_DELETE_FOLDER_DISABLED": "[ERROR] An error occurred while deleting {0} folder. \n Error: Delete Folder is not supported by this feature, please delete the folder manually in the server.",
73
+ "ERROR_LIVESYNC_PUSH_WCM_DELETE_FOLDER_UNAUTHORIZED": "[ERROR] An error occurred while deleting {0} folder. \n Error: Unauthorized. Ensure that dxUsername and dxPassword is correct.",
74
+ "ERROR_LIVESYNC_PUSH_WCM_DELETE_FOLDER_NOTFOUND": "[ERROR] An error occurred while deleting {0} folder. \n Error: Not Found. Ensure that the component exists in the server.",
75
+ "ERROR_LIVESYNC_PUSH_WCM_INVALID_FILENAME" : "[ERROR] An error occurred while creating {0} html component. \n Error: invalid filename . Please check the filename.",
76
+ "ERROR_LIVESYNC_WCM_LIB_AUTHORISATION": "LiveSync failed due to authorization failure. Ensure that dxUsername and dxPassword are correct.",
77
+ "ERROR_LIVESYNC_PUSH_WCM_HTML_CONFLICT": "[ERROR] An error occurred while delete {0} html component. \n Error: Conflict. Item is referenced by other item(s) in the server."
78
+
79
+
52
80
  }
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "LIVESYNC_PUSH_THEME_START": "LiveSync Push Theme started using this path: {0}",
3
3
  "LIVESYNC_PUSH_THEME_END_SUCCESS": "LiveSync Push Theme finished successfully.",
4
+ "LIVESYNC_PUSH_WCM_DESIGN_LIBRARY_END_SUCCESS": "LiveSync Push Wcm Design Library finished successfully.",
4
5
  "LIVESYNC_PUSH_THEME_END_FAILED": "LiveSync Push Theme failed.",
6
+ "LIVESYNC_PUSH_WCM_DESIGN_LIBRARY_END_FAILED": "LiveSync Push Wcm Design Library failed.",
5
7
  "LIVESYNC_PULL_THEME_START": "LiveSync Pull Theme started using this path: {0}",
6
8
  "LIVESYNC_PULL_THEME_DOWNLOAD_START": "Downloading Theme named {0}...",
7
9
  "LIVESYNC_PULL_THEME_END": "LiveSync Pull Theme finished successfully.",
8
- "LIVESYNC_PULL_WCM_LIBRARY_START": "Starting to pull {0} into this path: {1}",
10
+ "LIVESYNC_PULL_WCM_DESIGN_LIBRARY_START": "Started pulling the {0} library to this path: {1}",
11
+ "LIVESYNC_PULL_WCM_DESIGN_LIBRARY_END": "Completed pull of the {0} library into this path: {1}",
9
12
  "CREATE_THEME_TEMP_DIR_WEBDAV_SUCCESS": "Created {0} temporary folder in WebDAV Server successfully.",
10
13
  "CREATE_TEMP_THEMES_FOLDER_SUCCESS": "Created {0} theme folder in WebDAV Themes successfully.",
11
14
  "BUNDLING_FILES_AND_UPLOAD_START": "Bundling files and uploading it to a temporary folder in WebDAV.",
@@ -29,5 +32,12 @@
29
32
  "LIVESYNC_END_CLEANUP_QUEUE": "The cleanup process is taking longer than expected to finish up. Suggesting to wait further or force kill the active terminal.",
30
33
  "CHECK_DIR_EXIST": "The directory {0} exists in the WebDAV server.",
31
34
  "CREATE_HTML_FILE": "Successfully downloaded HTML Component: {0}",
32
- "WCM_DESIGN_LIBRARY_PULL_HTML_COMPONENT_END": "Successfully finished pulling the WCM Design Library."
35
+ "LIVESYNC_PUSH_WCM_INITIAL_START": "Syncing initial files into WCM Library Server.",
36
+ "LIVESYNC_PUSH_WCM_INITIAL_END": "[SUCCESS] Completed initial sync of files into WCM Library Server.",
37
+ "LIVESYNC_PUSH_WCM_ONGOING_SYNC_CREATE_FOLDER": "[SUCCESS] Folder {0} created on \"{1}\" library.",
38
+ "LIVESYNC_PUSH_WCM_ONGOING_SYNC_CREATE_HTML_COMPONENT": "[SUCCESS] HTML Component {0} created on \"{1}\" library.",
39
+ "LIVESYNC_PUSH_WCM_ONGOING_SYNC_UPDATE_HTML_COMPONENT": "[SUCCESS] HTML Component {0} updated on \"{1}\" library.",
40
+ "LIVESYNC_PUSH_WCM_ONGOING_SYNC_UPDATE_FOLDER": "[SUCCESS] Folder {0} updated on \"{1}\" library.",
41
+ "LIVESYNC_PUSH_WCM_ONGOING_SYNC_DELETE_HTML_COMPONENT": "[SUCCESS] HTML Component {0} deleted on \"{1}\" library.",
42
+ "LIVESYNC_PUSH_WCM_ONGOING_SYNC_DELETE_FOLDER":"[SUCCESS] Folder {0} deleted on \"{1}\" library."
33
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EventsQueue.js","sourceRoot":"","sources":["../../../../../packages/livesync/src/services/EventsQueue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAYA,kDAA2C;AAC3C,yDAAsD;AAEtD,uDAAsD;AAEtD,MAAa,WAAW;IAWtB,YAAY,YAA0B;QAyC9B,gBAAW,GAAG,CAAO,cAA8B,EAAE,QAAoB,EAAiB,EAAE;YAClG,MAAM,EAAE,aAAa,EAAE,GAAG,cAAc,CAAC;YACzC,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;YAEjD,IAAI,CAAC,OAAO,EAAE;gBAEZ,eAAM,CAAC,KAAK,CAAC,GAAG,aAAa,iEAAiE,CAAC,CAAC;gBAChG,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;oBAC7B,eAAM,CAAC,IAAI,CAAC,eAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;iBACxC;gBACD,QAAQ,EAAE,CAAC;gBACX,OAAO;aACR;YAED,IAAI;gBACF,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;aAC/B;YAAC,OAAO,KAAK,EAAE;gBACd,eAAM,CAAC,KAAK,CAAC,kBAAkB,aAAa,YAAY,EAAE,KAAK,CAAC,CAAC;aAClE;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;gBAC7B,eAAM,CAAC,IAAI,CAAC,eAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;aACxC;YACD,QAAQ,EAAE,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;iBACxC;gBACD,QAAQ,EAAE,CAAC;gBACX,OAAO;aACR;YAED,IAAI;gBACF,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;aAC/B;YAAC,OAAO,KAAK,EAAE;gBACd,eAAM,CAAC,KAAK,CAAC,kBAAkB,aAAa,YAAY,EAAE,KAAK,CAAC,CAAC;aAClE;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;gBAC7B,eAAM,CAAC,IAAI,CAAC,eAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;aACxC;YACD,QAAQ,EAAE,CAAC;QACb,CAAC,CAAA,CAAA;QA9DC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAKM,UAAU;QACf,eAAM,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACnD,IAAI,CAAC,KAAK,GAAG,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAMM,IAAI,CAAC,cAA8B;QACxC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAClC,CAAC;IAKY,KAAK;;YAChB,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC3B,CAAC;KAAA;IAKY,IAAI;;YACf,eAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;YAC9C,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAClB,eAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACtC,CAAC;KAAA;CA8BF;AA3ED,kCA2EC"}
@@ -13,9 +13,15 @@ exports.updateFolder = exports.createFolder = exports.getFolder = exports.allFol
13
13
  const wcmRestV2Services_1 = require("./wcmRestV2Services");
14
14
  const constants_1 = require("../../../../src/utils/constants");
15
15
  const logger_1 = require("../../../../src/utils/logger");
16
+ const utils_1 = require("../../../../src/utils/utils");
17
+ const livesyncUtils_1 = require("./livesyncUtils");
16
18
  const deleteFolder = (apiOptions, folderId = '') => __awaiter(void 0, void 0, void 0, function* () {
17
19
  try {
18
- const baseUrl = `${apiOptions.dxProtocol}://${apiOptions.hostname}:${apiOptions.dxPort}${apiOptions.contenthandlerPath}`;
20
+ let baseUrl = livesyncUtils_1.getBaseDXApiUrlFromCommand(apiOptions);
21
+ if (apiOptions.wcmProjectName) {
22
+ baseUrl += `/$project/${apiOptions.wcmProjectName}`;
23
+ logger_1.logger.debug('baseUrl appended with project name - %s', baseUrl);
24
+ }
19
25
  const url = `${baseUrl}${constants_1.URL_PATH.wcmV2Folders}/${folderId}`;
20
26
  const options = {
21
27
  method: 'DELETE',
@@ -33,8 +39,9 @@ const deleteFolder = (apiOptions, folderId = '') => __awaiter(void 0, void 0, vo
33
39
  exports.deleteFolder = deleteFolder;
34
40
  const allFolders = (apiOptions, libraryId = '') => __awaiter(void 0, void 0, void 0, function* () {
35
41
  try {
36
- const baseUrl = `${apiOptions.dxProtocol}://${apiOptions.hostname}:${apiOptions.dxPort}${apiOptions.contenthandlerPath}`;
42
+ const baseUrl = livesyncUtils_1.getBaseDXApiUrlFromCommand(apiOptions);
37
43
  const url = `${baseUrl}${constants_1.URL_PATH.wcmV2Folders}/?libraryID=${libraryId}`;
44
+ logger_1.logger.debug('Get all folders of Libraries URL: %o', url);
38
45
  const options = {
39
46
  method: 'GET',
40
47
  url,
@@ -73,7 +80,11 @@ const getFolder = (apiOptions, folderId = '') => __awaiter(void 0, void 0, void
73
80
  exports.getFolder = getFolder;
74
81
  const createFolder = (apiOptions, libraryID = '', data) => __awaiter(void 0, void 0, void 0, function* () {
75
82
  try {
76
- const baseUrl = `${apiOptions.dxProtocol}://${apiOptions.hostname}:${apiOptions.dxPort}${apiOptions.contenthandlerPath}`;
83
+ let baseUrl = livesyncUtils_1.getBaseDXApiUrlFromCommand(apiOptions);
84
+ if (apiOptions.wcmProjectName) {
85
+ baseUrl += `/$project/${apiOptions.wcmProjectName}`;
86
+ logger_1.logger.debug('baseUrl appended with project name - %s', baseUrl);
87
+ }
77
88
  const url = `${baseUrl}${constants_1.URL_PATH.wcmV2Folders}${constants_1.URL_PARAMS.libraryid}${libraryID}`;
78
89
  const options = {
79
90
  method: 'POST',
@@ -86,7 +97,14 @@ const createFolder = (apiOptions, libraryID = '', data) => __awaiter(void 0, voi
86
97
  },
87
98
  data,
88
99
  };
89
- return yield wcmRestV2Services_1.sendWcmRequest(options);
100
+ const response = yield wcmRestV2Services_1.sendWcmRequest(options);
101
+ if (!response) {
102
+ logger_1.logger.debug('Response is undefined');
103
+ throw new Error(utils_1.errorMessage('ERROR_RESPONSE_UNDEFINED', {}, true));
104
+ }
105
+ else {
106
+ return response;
107
+ }
90
108
  }
91
109
  catch (error) {
92
110
  logger_1.logger.debug('Exception in execution HTTP request %o', error);
@@ -96,7 +114,11 @@ const createFolder = (apiOptions, libraryID = '', data) => __awaiter(void 0, voi
96
114
  exports.createFolder = createFolder;
97
115
  const updateFolder = (apiOptions, folderId = '', folderData) => __awaiter(void 0, void 0, void 0, function* () {
98
116
  try {
99
- const baseUrl = `${apiOptions.dxProtocol}://${apiOptions.hostname}:${apiOptions.dxPort}${apiOptions.contenthandlerPath}`;
117
+ let baseUrl = livesyncUtils_1.getBaseDXApiUrlFromCommand(apiOptions);
118
+ if (apiOptions.wcmProjectName) {
119
+ baseUrl += `/$project/${apiOptions.wcmProjectName}`;
120
+ logger_1.logger.debug('baseUrl appended with project name - %s', baseUrl);
121
+ }
100
122
  const url = `${baseUrl}${constants_1.URL_PATH.wcmV2Folders}/${folderId}`;
101
123
  const options = {
102
124
  method: 'PUT',
@@ -1 +1 @@
1
- {"version":3,"file":"foldersWcmServices.js","sourceRoot":"","sources":["../../../../../packages/livesync/src/services/foldersWcmServices.ts"],"names":[],"mappings":";;;;;;;;;;;;AAcA,2DAAqD;AACrD,+DAAuE;AACvE,yDAAsD;AAQ/C,MAAM,YAAY,GAAG,CAAO,UAA4B,EAAE,WAAmB,EAAE,EAA0B,EAA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AAA,YAAY,gBAoBvB"}
1
+ {"version":3,"file":"foldersWcmServices.js","sourceRoot":"","sources":["../../../../../packages/livesync/src/services/foldersWcmServices.ts"],"names":[],"mappings":";;;;;;;;;;;;AAcA,2DAAqD;AACrD,+DAAuE;AACvE,yDAAsD;AACtD,uDAA2D;AAC3D,mDAA6D;AAQtD,MAAM,YAAY,GAAG,CAAO,UAA4B,EAAE,WAAmB,EAAE,EAA0B,EAAE;IAChH,IAAI;QACF,IAAI,OAAO,GAAG,0CAA0B,CAAC,UAAU,CAAC,CAAC;QAErD,IAAI,UAAU,CAAC,cAAc,EAAE;YAC7B,OAAO,IAAI,aAAa,UAAU,CAAC,cAAc,EAAE,CAAC;YACpD,eAAM,CAAC,KAAK,CAAC,yCAAyC,EAAE,OAAO,CAAC,CAAC;SAClE;QACD,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,oBAAQ,CAAC,YAAY,IAAI,QAAQ,EAAE,CAAC;QAC7D,MAAM,OAAO,GAA4B;YACvC,MAAM,EAAE,QAAQ;YAChB,GAAG;YACH,UAAU,EAAE,UAAU,CAAC,UAAU;YACjC,UAAU,EAAE,UAAU,CAAC,UAAU;SAClC,CAAC;QACF,OAAO,MAAM,kCAAc,CAAC,OAAO,CAAC,CAAC;KACtC;IAAC,OAAO,KAAK,EAAE;QACd,eAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;QAC9D,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KACxB;AACH,CAAC,CAAA,CAAC;AApBW,QAAA,YAAY,gBAoBvB;AAQK,MAAM,UAAU,GAAG,CAAO,UAA4B,EAAE,YAAoB,EAAE,EAA0B,EAAE;IAC/G,IAAI;QACF,MAAM,OAAO,GAAG,0CAA0B,CAAC,UAAU,CAAC,CAAC;QACvD,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,oBAAQ,CAAC,YAAY,eAAe,SAAS,EAAE,CAAC;QACzE,eAAM,CAAC,KAAK,CA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,CAAC,CAAC;QAErD,IAAI,UAAU,CAAC,cAAc,EAAE;YAC7B,OAAO,IAAI,aAAa,UAAU,CAAC,cAAc,EAAE,CAAC;YACpD,eAAM,CAAC,KAAK,CAAC,yCAAyC,EAAE,OAAO,CAAC,CAAC;SAClE;QACD,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,oBAAQ,CAAC,YAAY,IAAI,QAAQ,EAAE,CAAC;QAC7D,MAAM,OAAO,GAA4B;YACvC,MAAM,EAAE,KAAK;YACb,GAAG;YACH,UAAU,EAAE,UAAU,CAAC,UAAU;YACjC,UAAU,EAAE,UAAU,CAAC,UAAU;YACjC,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,MAAM,EAAE,kBAAkB;aAC3B;SACF,CAAC;QACF,OAAO,MAAM,kCAAc,CAAC,OAAO,CAAC,CAAC;KACtC;IAAC,OAAO,KAAK,EAAE;QACd,eAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;QAC9D,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KACxB;AACH,CAAC,CAAA,CAAC;AAzBW,QAAA,YAAY,gBAyBvB"}
@@ -15,10 +15,16 @@ const utils_1 = require("../../../../src/utils/utils");
15
15
  const requestService_1 = require("../../../../src/services/requestService");
16
16
  const logger_1 = require("../../../../src/utils/logger");
17
17
  const wcmRestV2Services_1 = require("./wcmRestV2Services");
18
+ const livesyncUtils_1 = require("./livesyncUtils");
18
19
  const getHTMLComponent = (apiOptions, htmlId = '') => __awaiter(void 0, void 0, void 0, function* () {
19
20
  try {
20
- const baseUrl = `${apiOptions.dxProtocol}://${apiOptions.hostname}:${apiOptions.dxPort}${apiOptions.contenthandlerPath}`;
21
+ let baseUrl = livesyncUtils_1.getBaseDXApiUrlFromCommand(apiOptions);
22
+ if (apiOptions.wcmProjectName) {
23
+ baseUrl += `/$project/${apiOptions.wcmProjectName}`;
24
+ logger_1.logger.debug('baseUrl appended with project name - %s', baseUrl);
25
+ }
21
26
  const url = `${baseUrl}${constants_1.URL_PATH.wcmV2LibrariesHTMLComponent}/${htmlId}`;
27
+ logger_1.logger.debug('Get LibraryHTMLComponent URL: %o', url);
22
28
  const axiosConfig = {
23
29
  method: 'GET',
24
30
  url,
@@ -32,6 +38,7 @@ const getHTMLComponent = (apiOptions, htmlId = '') => __awaiter(void 0, void 0,
32
38
  throw new Error(utils_1.errorMessage('ERROR_RESPONSE_UNDEFINED', {}, true));
33
39
  }
34
40
  else {
41
+ logger_1.logger.debug('Response Data: %o', response.data);
35
42
  return response;
36
43
  }
37
44
  }
@@ -42,8 +49,13 @@ const getHTMLComponent = (apiOptions, htmlId = '') => __awaiter(void 0, void 0,
42
49
  });
43
50
  exports.getHTMLComponent = getHTMLComponent;
44
51
  const createHtmlComponent = (apiOptions, data) => __awaiter(void 0, void 0, void 0, function* () {
52
+ logger_1.logger.debug('Create HTML Component');
45
53
  try {
46
- const baseUrl = `${apiOptions.dxProtocol}://${apiOptions.hostname}:${apiOptions.dxPort}${apiOptions.contenthandlerPath}`;
54
+ let baseUrl = livesyncUtils_1.getBaseDXApiUrlFromCommand(apiOptions);
55
+ if (apiOptions.wcmProjectName) {
56
+ baseUrl += `/$project/${apiOptions.wcmProjectName}`;
57
+ logger_1.logger.debug('baseUrl appended with project name - %s', baseUrl);
58
+ }
47
59
  const url = `${baseUrl}${constants_1.URL_PATH.wcmV2LibrariesHTMLComponent}`;
48
60
  const options = {
49
61
  method: 'POST',
@@ -56,17 +68,29 @@ const createHtmlComponent = (apiOptions, data) => __awaiter(void 0, void 0, void
56
68
  },
57
69
  data,
58
70
  };
59
- return yield wcmRestV2Services_1.sendWcmRequest(options);
71
+ const response = yield wcmRestV2Services_1.sendWcmRequest(options);
72
+ if (!response) {
73
+ logger_1.logger.debug('Response is undefined');
74
+ throw new Error(utils_1.errorMessage('ERROR_RESPONSE_UNDEFINED', {}, true));
75
+ }
76
+ else {
77
+ return response;
78
+ }
60
79
  }
61
80
  catch (error) {
62
- logger_1.logger.debug('Exception in execution HTTP request %o', error);
81
+ logger_1.logger.debug('Error creating html file: %O', error);
63
82
  throw new Error(error);
64
83
  }
65
84
  });
66
85
  exports.createHtmlComponent = createHtmlComponent;
67
86
  const updateHtmlComponent = (apiOptions, htmlID, data) => __awaiter(void 0, void 0, void 0, function* () {
87
+ logger_1.logger.debug('Update HTML Component');
68
88
  try {
69
- const baseUrl = `${apiOptions.dxProtocol}://${apiOptions.hostname}:${apiOptions.dxPort}${apiOptions.contenthandlerPath}`;
89
+ let baseUrl = livesyncUtils_1.getBaseDXApiUrlFromCommand(apiOptions);
90
+ if (apiOptions.wcmProjectName) {
91
+ baseUrl += `/$project/${apiOptions.wcmProjectName}`;
92
+ logger_1.logger.debug('baseUrl appended with project name - %s', baseUrl);
93
+ }
70
94
  const url = `${baseUrl}${constants_1.URL_PATH.wcmV2LibrariesHTMLComponent}/${htmlID}`;
71
95
  const options = {
72
96
  method: 'PUT',
@@ -89,7 +113,11 @@ const updateHtmlComponent = (apiOptions, htmlID, data) => __awaiter(void 0, void
89
113
  exports.updateHtmlComponent = updateHtmlComponent;
90
114
  const deleteHtmlComponent = (apiOptions, htmlId = '') => __awaiter(void 0, void 0, void 0, function* () {
91
115
  try {
92
- const baseUrl = `${apiOptions.dxProtocol}://${apiOptions.hostname}:${apiOptions.dxPort}${apiOptions.contenthandlerPath}`;
116
+ let baseUrl = livesyncUtils_1.getBaseDXApiUrlFromCommand(apiOptions);
117
+ if (apiOptions.wcmProjectName) {
118
+ baseUrl += `/$project/${apiOptions.wcmProjectName}`;
119
+ logger_1.logger.debug('baseUrl appended with project name - %s', baseUrl);
120
+ }
93
121
  const url = `${baseUrl}${constants_1.URL_PATH.wcmV2LibrariesHTMLComponent}/${htmlId}`;
94
122
  const options = {
95
123
  method: 'DELETE',
@@ -1 +1 @@
1
- {"version":3,"file":"htmlComponentWcmServices.js","sourceRoot":"","sources":["../../../../../packages/livesync/src/services/ht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AAC,OAAO,KAAK,EAAE;QACd,eAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;QAC9D,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KACxB;AACH,CAAC,CAAA,CAAC;AApBW,QAAA,mBAAmB,uBAoB9B;AAQK,MAAM,mBAAmB,GAAG,CAAO,UAA4B,EAAE,SAAiB,EAAE,EAA0B,EAAE;IACrH,IAAI;QACF,MAAM,OAAO,GAAG,GAAG,UAAU,CAAC,UAAU,MAAM,UAAU,CAAC,QAAQ,IAAI,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC,kBAAkB,EAAE,CAAC;QACzH,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,oBAAQ,CAAC,2BAA2B,IAAI,MAAM,EAAE,CAAC;QAC1E,MAAM,OAAO,GAA4B;YACvC,MAAM,EAAE,QAAQ;YAChB,GAAG;YACH,UAAU,EAAE,UAAU,CAAC,UAAU;YACjC,UAAU,EAAE,UAAU,CAAC,UAAU;SAClC,CAAC;QACF,OAAO,MAAM,kCAAc,CAAC,OAAO,CAAC,CAAC;KACtC;IAAC,OAAO,KAAK,EAAE;QACd,eAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;QAC9D,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KACxB;AACH,CAAC,CAAA,CAAC;AAfW,QAAA,mBAAmB,uBAe9B"}
1
+ {"version":3,"file":"htmlComponentWcmServices.js","sourceRoot":"","sources":["../../../../../packages/livesync/src/services/htmlComponentWcmServices.ts"],"names":[],"mappings":";;;;;;;;;;;;AAcA,+DAA2D;AAC3D,uDAAuE;AACvE,4EAAyE;AACzE,yDAAsD;AACtD,2DAAqD;AACrD,mDAA6D;AAQtD,MAAM,gBAAgB,GAAG,CAAO,UAA4B,EAAE,SAAiB,EAAE,EAA0B,EAAE;IAClH,IAAI;QACF,IAAI,OAAO,GAAG,0CAA0B,CAAC,UAAU,CAAC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ACtC;IAAC,OAAO,KAAK,EAAE;QACd,eAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;QAC9D,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KACxB;AACH,CAAC,CAAA,CAAC;AApBW,QAAA,mBAAmB,uBAoB9B"}
@@ -1,2 +1,6 @@
1
+ import { ChokidarEvent } from '../../../../src/utils/constants';
2
+ import { WcmRestApiConfig } from '../types';
1
3
  export declare const emptyRoot: (dir: string, ignoredFiles: string[]) => boolean;
2
4
  export declare const createFolderUnderParent: (folderName: string, parentPath: string) => Promise<boolean>;
5
+ export declare const getEventByFileType: (filePath: string, event: string) => ChokidarEvent.ADD | ChokidarEvent.ADD_HTML | ChokidarEvent.ADD_DIR | ChokidarEvent.CHANGE | ChokidarEvent.CHANGE_HTML | ChokidarEvent.UNLINK | ChokidarEvent.UNLINK_HTML | ChokidarEvent.UNLINK_DIR | ChokidarEvent.CHANGE_DIR;
6
+ export declare function getBaseDXApiUrlFromCommand(apiOptions: WcmRestApiConfig): string;
@@ -12,12 +12,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.createFolderUnderParent = exports.emptyRoot = void 0;
15
+ exports.getBaseDXApiUrlFromCommand = exports.getEventByFileType = exports.createFolderUnderParent = exports.emptyRoot = void 0;
16
16
  const fs_extra_1 = require("fs-extra");
17
17
  const path_1 = __importDefault(require("path"));
18
18
  const fs_1 = __importDefault(require("fs"));
19
+ const mime_types_1 = __importDefault(require("mime-types"));
19
20
  const logger_1 = require("../../../../src/utils/logger");
20
21
  const utils_1 = require("../../../../src/utils/utils");
22
+ const constants_1 = require("../../../../src/utils/constants");
21
23
  const emptyRoot = (dir, ignoredFiles) => {
22
24
  fs_extra_1.readdirSync(dir).forEach((file) => {
23
25
  const filePath = path_1.default.join(dir, file);
@@ -56,4 +58,18 @@ const createFolderUnderParent = (folderName, parentPath) => __awaiter(void 0, vo
56
58
  return false;
57
59
  });
58
60
  exports.createFolderUnderParent = createFolderUnderParent;
61
+ const getEventByFileType = (filePath, event) => {
62
+ const mimeType = mime_types_1.default.lookup(filePath) || 'default';
63
+ const eventMap = constants_1.FileTypeEventMap[mimeType] || constants_1.FileTypeEventMap.default;
64
+ return eventMap[event];
65
+ };
66
+ exports.getEventByFileType = getEventByFileType;
67
+ function getBaseDXApiUrlFromCommand(apiOptions) {
68
+ let urlPath = `${apiOptions.dxProtocol}://${apiOptions.hostname}:${apiOptions.dxPort}${apiOptions.contenthandlerPath}`;
69
+ if (apiOptions.virtualPortalContext) {
70
+ urlPath += `/${apiOptions.virtualPortalContext}`;
71
+ }
72
+ return urlPath;
73
+ }
74
+ exports.getBaseDXApiUrlFromCommand = getBaseDXApiUrlFromCommand;
59
75
  //# sourceMappingURL=livesyncUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"livesyncUtils.js","sourceRoot":"","sources":["../../../../../packages/livesync/src/services/livesyncUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAWA,uCAEkB;AAClB,gDAAwB;AACxB,4CAAoB;AACpB,yDAAsD;AACtD,uDAA2D;AAQpD,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,YAAsB,EAAW,EAAE;IACxE,sBAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChC,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtC,IAAI,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YACnC,OAAO,KAAK,CAAC;SACd;QAAC,IAAI,mBAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,EAAE;YACtC,iBAAS,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YAClC,IAAI,sBAAW,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;gBACtC,qBAAU,CAAC,QAAQ,CAAC,CAAC;aACtB;YACD,OAAO,KAAK,CAAC;SACd;QACD,qBAAU,CAAC,QAAQ,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAhBW,QAAA,SAAS,aAgBpB;AAOK,MAAM,uBAAuB,GAAG,CAAO,UAAkB,EAAE,UAAkB,EAAoB,EAAE;IACxG,IAAI;QACF,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;YAC9B,eAAM,CAAC,KAAK,CAAC,eAAe,UAAU,iBAAiB,CAAC,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,eAAe,UAAU,iBAAiB,CAAC,CAAC;SAC7D;QACD,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;YAC9B,YAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACzB,OAAO,IAAI,CAAC;SACb;KACF;IAAC,OAAO,KAAK,EAAE;QACd,eAAM,CAAC,KAAK,CAAC,oBAAY,CAAC,oDAAoD,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;QACnH,OAAO,KAAK,CAAC;KACd;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAA,CAAC;AAhBW,QAAA,uBAAuB,2BAgBlC"}
1
+ {"version":3,"file":"livesyncUtils.js","sourceRoot":"","sources":["../../../../../packages/livesync/src/services/livesyncUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAWA,uCAEkB;AAClB,gDAAwB;AACxB,4CAAoB;AACpB,4DAA8B;AAC9B,yDAAsD;AACtD,uDAA2D;AAC3D,+DAAuG;AAShG,MAAM,SAAS,GAAG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AY,CAAC,oDAAoD,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;QACnH,OAAO,KAAK,CAAC;KACd;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAA,CAAC;AAhBW,QAAA,uBAAuB,2BAgBlC;AAQK,MAAM,kBAAkB,GAAG,CAAC,QAAgB,EAAE,KAAa,EASvC,EAAE;IAC3B,MAAM,QAAQ,GAAG,oBAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;IACpD,MAAM,QAAQ,GAAwB,4BAAgB,CAAC,QAAQ,CAAC,IAAI,4BAAgB,CAAC,OAAO,CAAC;IAC7F,OAAO,QAAQ,CAAC,KAAkC,CAAC,CAAC;AACtD,CAAC,CAAC;AAbW,QAAA,kBAAkB,sBAa7B;AAQF,SAAgB,0BAA0B,CAAC,UAA4B;IACrE,IAAI,OAAO,GAAG,GAAG,UAAU,CAAC,UAAU,MAAM,UAAU,CAAC,QAAQ,IAAI,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC,kBAAkB,EAAE,CAAC;IACvH,IAAI,UAAU,CAAC,oBAAoB,EAAE;QACnC,OAAO,IAAI,IAAI,UAAU,CAAC,oBAAoB,EAAE,CAAC;KAClD;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAND,gEAMC"}
@@ -1,10 +1,12 @@
1
- import { Folder, WcmLibraryComponent } from '../types';
1
+ import { Folder, FolderCache, WcmLibraryComponent } from '../types';
2
2
  export declare const createLibraryMetaFolder: (libraryPath: string, libraryData: object) => boolean;
3
3
  export declare const getLibraryMetadata: (libraryPath: string) => any;
4
4
  export declare const createFolderMeta: (libraryPath: string, folderData: Folder) => boolean;
5
5
  export declare const getFolderMeta: (libraryPath: string, folderId: string) => null | Folder;
6
- export declare const createComponentsMeta: (libraryPath: string, componentData: WcmLibraryComponent, parentID: string) => {
6
+ export declare const getComponentMeta: (libraryPath: string, componentID: string) => null | Folder;
7
+ export declare const createComponentsMeta: (libraryPath: string, componentData: WcmLibraryComponent, parentID: string, libraryId: string, overwrite?: boolean) => {
7
8
  parentID: string;
9
+ localPath: string;
8
10
  content?: {
9
11
  type: string;
10
12
  value: string;
@@ -12,5 +14,9 @@ export declare const createComponentsMeta: (libraryPath: string, componentData:
12
14
  id: string;
13
15
  type: string;
14
16
  name?: string;
17
+ link?: import("../types").WCMLibraryLink[];
15
18
  };
16
19
  export declare const createHtmlFile: (component: WcmLibraryComponent, libraryPath: string, libraryID: string) => boolean;
20
+ export declare const loadMetadata: (wcmLibraryPath: string) => FolderCache;
21
+ export declare const getSavedMetadata: (wcmLibraryPath: string, filePath: string, folderCache: FolderCache) => Folder | WcmLibraryComponent | undefined;
22
+ export declare const saveMetadata: (wcmLibraryPath: string, metaData: WcmLibraryComponent | Folder, folderCache: FolderCache, deleteMetadata?: boolean) => FolderCache;