sfdx-easy-sources 0.9.0 → 0.9.1-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/lib/commands/easysources/allmeta/minify.d.ts +1 -0
  2. package/lib/commands/easysources/allmeta/minify.js +17 -2
  3. package/lib/commands/easysources/allmeta/minify.js.map +1 -1
  4. package/lib/commands/easysources/objecttranslations/merge.d.ts +1 -3
  5. package/lib/commands/easysources/objecttranslations/merge.js +46 -17
  6. package/lib/commands/easysources/objecttranslations/merge.js.map +1 -1
  7. package/lib/commands/easysources/objecttranslations/minify.d.ts +1 -3
  8. package/lib/commands/easysources/objecttranslations/minify.js +50 -29
  9. package/lib/commands/easysources/objecttranslations/minify.js.map +1 -1
  10. package/lib/commands/easysources/objecttranslations/split.js +76 -52
  11. package/lib/commands/easysources/objecttranslations/split.js.map +1 -1
  12. package/lib/commands/easysources/objecttranslations/upsert.d.ts +1 -3
  13. package/lib/commands/easysources/objecttranslations/upsert.js +107 -75
  14. package/lib/commands/easysources/objecttranslations/upsert.js.map +1 -1
  15. package/lib/commands/easysources/permissionsets/minify.js +50 -29
  16. package/lib/commands/easysources/permissionsets/minify.js.map +1 -1
  17. package/lib/commands/easysources/profiles/minify.js +50 -29
  18. package/lib/commands/easysources/profiles/minify.js.map +1 -1
  19. package/lib/commands/easysources/profiles/split.js +1 -2
  20. package/lib/commands/easysources/profiles/split.js.map +1 -1
  21. package/lib/commands/easysources/recordtypes/merge.js +24 -9
  22. package/lib/commands/easysources/recordtypes/merge.js.map +1 -1
  23. package/lib/commands/easysources/recordtypes/split.js +56 -40
  24. package/lib/commands/easysources/recordtypes/split.js.map +1 -1
  25. package/lib/commands/easysources/recordtypes/updatekey.js +36 -20
  26. package/lib/commands/easysources/recordtypes/updatekey.js.map +1 -1
  27. package/lib/commands/easysources/recordtypes/upsert.js +88 -65
  28. package/lib/commands/easysources/recordtypes/upsert.js.map +1 -1
  29. package/lib/commands/easysources/translations/minify.js +51 -29
  30. package/lib/commands/easysources/translations/minify.js.map +1 -1
  31. package/lib/utils/commands/keyupdater.d.ts +5 -1
  32. package/lib/utils/commands/keyupdater.js +35 -20
  33. package/lib/utils/commands/keyupdater.js.map +1 -1
  34. package/lib/utils/commands/merger.d.ts +4 -0
  35. package/lib/utils/commands/merger.js +11 -5
  36. package/lib/utils/commands/merger.js.map +1 -1
  37. package/lib/utils/commands/splitter.d.ts +5 -1
  38. package/lib/utils/commands/splitter.js +60 -46
  39. package/lib/utils/commands/splitter.js.map +1 -1
  40. package/lib/utils/commands/upserter.d.ts +3 -3
  41. package/lib/utils/commands/upserter.js +126 -103
  42. package/lib/utils/commands/upserter.js.map +1 -1
  43. package/lib/utils/commands/utils.d.ts +4 -0
  44. package/lib/utils/commands/utils.js +9 -1
  45. package/lib/utils/commands/utils.js.map +1 -1
  46. package/oclif.manifest.json +1 -1
  47. package/package.json +1 -1
@@ -18,6 +18,7 @@ const filesUtils_1 = require("../../../utils/filesUtils");
18
18
  const utils_1 = require("../../../utils/utils");
19
19
  const constants_1 = require("../../../utils/constants/constants");
20
20
  const localSettings_1 = require("../../../utils/localSettings");
21
+ const utils_2 = require("../../../utils/commands/utils");
21
22
  const csvWriter_1 = require("../../../utils/csvWriter");
22
23
  const settings = (0, localSettings_1.loadSettings)();
23
24
  // Initialize Messages with the current plugin directory
@@ -65,8 +66,16 @@ async function translationMinify(options = {}) {
65
66
  const csvDir = (0, path_1.join)((options["es-csv"] || settings['easysources-csv-path'] || constants_1.DEFAULT_ESCSV_PATH), constants_translations_1.TRANSLATIONS_SUBPATH);
66
67
  const xmlDir = (0, path_1.join)((options["sf-xml"] || settings['salesforce-xml-path'] || constants_1.DEFAULT_SFXML_PATH));
67
68
  const inputTranslation = (options.input);
68
- (0, filesUtils_1.checkDirOrErrorSync)(csvDir);
69
- (0, filesUtils_1.checkDirOrErrorSync)(xmlDir);
69
+ // Initialize result object
70
+ const result = { result: 'OK', items: {} };
71
+ try {
72
+ (0, filesUtils_1.checkDirOrErrorSync)(csvDir);
73
+ (0, filesUtils_1.checkDirOrErrorSync)(xmlDir);
74
+ }
75
+ catch (error) {
76
+ performance_1.default.getInstance().end();
77
+ return (0, utils_2.jsonAndPrintError)(error.message);
78
+ }
70
79
  var transationList = [];
71
80
  if (inputTranslation) {
72
81
  transationList = inputTranslation.split(',');
@@ -79,40 +88,53 @@ async function translationMinify(options = {}) {
79
88
  // translationName is the profile name without the extension
80
89
  for (const translationName of transationList) {
81
90
  console.log('Minifying on: ' + translationName);
82
- for (const tag_section in constants_translations_1.TRANSLATION_ITEMS) {
83
- // tag_section is a profile section (applicationVisibilities, classAccess ecc)
84
- const csvFilePath = (0, path_1.join)(csvDir, translationName, (0, filesUtils_1.calcCsvFilename)(translationName, tag_section));
85
- if (fs.existsSync(csvFilePath)) {
86
- // get the list of resources on the csv. eg. the list of apex classes
87
- var resListCsv = await (0, filesUtils_1.readCsvToJsonArray)(csvFilePath);
88
- resListCsv = resListCsv.filter(function (res) {
89
- // return true to persist, false to delete
90
- if (constants_translations_1.TRANSLAT_TAG_BOOL[tag_section] == null)
91
- return true;
92
- for (const boolName of (0, utils_1.toArray)(constants_translations_1.TRANSLAT_TAG_BOOL[tag_section])) {
93
- if (!(0, utils_1.isBlank)(res[boolName]))
91
+ try {
92
+ for (const tag_section in constants_translations_1.TRANSLATION_ITEMS) {
93
+ // tag_section is a profile section (applicationVisibilities, classAccess ecc)
94
+ const csvFilePath = (0, path_1.join)(csvDir, translationName, (0, filesUtils_1.calcCsvFilename)(translationName, tag_section));
95
+ if (fs.existsSync(csvFilePath)) {
96
+ // get the list of resources on the csv. eg. the list of apex classes
97
+ var resListCsv = await (0, filesUtils_1.readCsvToJsonArray)(csvFilePath);
98
+ resListCsv = resListCsv.filter(function (res) {
99
+ // return true to persist, false to delete
100
+ if (constants_translations_1.TRANSLAT_TAG_BOOL[tag_section] == null)
94
101
  return true;
102
+ for (const boolName of (0, utils_1.toArray)(constants_translations_1.TRANSLAT_TAG_BOOL[tag_section])) {
103
+ if (!(0, utils_1.isBlank)(res[boolName]))
104
+ return true;
105
+ }
106
+ return false;
107
+ });
108
+ // write the cleaned csv
109
+ const headers = constants_translations_1.TRANSLATION_ITEMS[tag_section].headers;
110
+ if (options.sort === 'true') {
111
+ resListCsv = (0, utils_1.sortByKey)(resListCsv);
112
+ }
113
+ try {
114
+ const csvContent = await csvWriter.toCsv(resListCsv, headers);
115
+ fs.writeFileSync(csvFilePath, csvContent, { flag: 'w+' });
116
+ // file written successfully
117
+ }
118
+ catch (err) {
119
+ console.error(err);
120
+ throw new Error(`Failed to write CSV file ${csvFilePath}: ${err.message}`);
95
121
  }
96
- return false;
97
- });
98
- // write the cleaned csv
99
- const headers = constants_translations_1.TRANSLATION_ITEMS[tag_section].headers;
100
- if (options.sort === 'true') {
101
- resListCsv = (0, utils_1.sortByKey)(resListCsv);
102
- }
103
- try {
104
- const csvContent = await csvWriter.toCsv(resListCsv, headers);
105
- fs.writeFileSync(csvFilePath, csvContent, { flag: 'w+' });
106
- // file written successfully
107
- }
108
- catch (err) {
109
- console.error(err);
110
122
  }
123
+ // Translation processed successfully
124
+ result.items[translationName] = { result: 'OK' };
111
125
  }
112
126
  }
127
+ catch (error) {
128
+ // Translation processing failed
129
+ console.error(`Error minifying translation ${translationName}:`, error);
130
+ result.items[translationName] = {
131
+ result: 'KO',
132
+ error: error.message || 'Unknown error occurred'
133
+ };
134
+ }
113
135
  }
114
136
  performance_1.default.getInstance().end();
115
- return { outputString: 'OK' };
137
+ return result;
116
138
  }
117
139
  exports.translationMinify = translationMinify;
118
140
  //# sourceMappingURL=minify.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"minify.js","sourceRoot":"","sources":["../../../../src/commands/easysources/translations/minify.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,iDAAyD;AACzD,2CAA4C;AAE5C,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;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,EAAE,CAAC,CAAC;qBAC9E;iBACJ;gBAED,qCAAqC;gBACrC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;aACpD;SAEJ;QAAC,OAAO,KAAK,EAAE;YACZ,gCAAgC;YAChC,OAAO,CAAC,KAAK,CAAC,+BAA+B,eAAe,GAAG,EAAE,KAAK,CAAC,CAAC;YACxE,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG;gBAC5B,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,KAAK,CAAC,OAAO,IAAI,wBAAwB;aACnD,CAAC;SACL;KACJ;IAED,qBAAW,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC;IAGhC,OAAO,MAAM,CAAC;AAClB,CAAC;AAvFD,8CAuFC"}
@@ -1,3 +1,7 @@
1
1
  export declare function updatekey(flags: any, file_subpath: any, file_items: any): Promise<{
2
- outputString: string;
2
+ error: string;
3
+ result: string;
4
+ } | {
5
+ result: string;
6
+ items: {};
3
7
  }>;
@@ -7,6 +7,7 @@ const utils_2 = require("../utils");
7
7
  const path_1 = require("path");
8
8
  const constants_1 = require("../constants/constants");
9
9
  const localSettings_1 = require("../localSettings");
10
+ const utils_3 = require("./utils");
10
11
  const csvWriter_1 = require("../csvWriter");
11
12
  const fs = require('fs-extra');
12
13
  const settings = (0, localSettings_1.loadSettings)();
@@ -15,9 +16,10 @@ async function updatekey(flags, file_subpath, file_items) {
15
16
  const baseInputDir = (0, path_1.join)((flags["es-csv"] || settings['easysources-csv-path'] || constants_1.DEFAULT_ESCSV_PATH), file_subpath);
16
17
  const inputFiles = (flags.input);
17
18
  if (!fs.existsSync(baseInputDir)) {
18
- console.log('Input folder ' + baseInputDir + ' does not exist!');
19
- return;
19
+ return (0, utils_3.jsonAndPrintError)(`Input folder ${baseInputDir} does not exist`);
20
20
  }
21
+ // Initialize result object
22
+ const result = { result: 'OK', items: {} };
21
23
  var dirList = [];
22
24
  if (inputFiles) {
23
25
  dirList = inputFiles.split(',');
@@ -30,28 +32,41 @@ async function updatekey(flags, file_subpath, file_items) {
30
32
  // dir is the file name without the extension
31
33
  for (const dir of dirList) {
32
34
  console.log('UpdateKey: ' + dir);
33
- // tag_Section is each file section (applicationVisibilities, classAccess ecc)
34
- for (const tag_section in file_items) {
35
- const csvFilePath = (0, path_1.join)(baseInputDir, dir, (0, filesUtils_1.calcCsvFilename)(dir, tag_section));
36
- if (fs.existsSync(csvFilePath)) {
37
- var jsonArray = await (0, filesUtils_1.readCsvToJsonArray)(csvFilePath);
38
- (0, utils_2.generateTagId)(jsonArray, file_items[tag_section].key, file_items[tag_section].headers);
39
- if (flags.sort === 'true') {
40
- jsonArray = (0, utils_1.sortByKey)(jsonArray);
41
- }
42
- const headers = file_items[tag_section].headers;
43
- try {
44
- const csvContent = await csvWriter.toCsv(jsonArray, headers);
45
- fs.writeFileSync(csvFilePath, csvContent, { flag: 'w+' });
46
- // file written successfully
47
- }
48
- catch (err) {
49
- console.error(err);
35
+ try {
36
+ // tag_Section is each file section (applicationVisibilities, classAccess ecc)
37
+ for (const tag_section in file_items) {
38
+ const csvFilePath = (0, path_1.join)(baseInputDir, dir, (0, filesUtils_1.calcCsvFilename)(dir, tag_section));
39
+ if (fs.existsSync(csvFilePath)) {
40
+ var jsonArray = await (0, filesUtils_1.readCsvToJsonArray)(csvFilePath);
41
+ (0, utils_2.generateTagId)(jsonArray, file_items[tag_section].key, file_items[tag_section].headers);
42
+ if (flags.sort === 'true') {
43
+ jsonArray = (0, utils_1.sortByKey)(jsonArray);
44
+ }
45
+ const headers = file_items[tag_section].headers;
46
+ try {
47
+ const csvContent = await csvWriter.toCsv(jsonArray, headers);
48
+ fs.writeFileSync(csvFilePath, csvContent, { flag: 'w+' });
49
+ // file written successfully
50
+ }
51
+ catch (err) {
52
+ console.error(err);
53
+ throw new Error(`Failed to write CSV file ${csvFilePath}: ${err.message}`);
54
+ }
50
55
  }
51
56
  }
57
+ // Directory processed successfully
58
+ result.items[dir] = { result: 'OK' };
59
+ }
60
+ catch (error) {
61
+ // Directory processing failed
62
+ console.error(`Error processing directory ${dir}:`, error);
63
+ result.items[dir] = {
64
+ result: 'KO',
65
+ error: error.message || 'Unknown error occurred'
66
+ };
52
67
  }
53
68
  }
54
- return { outputString: 'OK' };
69
+ return result;
55
70
  }
56
71
  exports.updatekey = updatekey;
57
72
  //# sourceMappingURL=keyupdater.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyupdater.js","sourceRoot":"","sources":["../../../src/utils/commands/keyupdater.ts"],"names":[],"mappings":";;;AAAA,8CAAmE;AACnE,oCAAoC;AACpC,oCAAwC;AACxC,+BAA4B;AAC5B,sDAA4D;AAC5D,oDAAgD;AAChD,4CAAqC;AACrC,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAE/B,MAAM,QAAQ,GAAG,IAAA,4BAAY,GAAE,CAAC;AAEzB,KAAK,UAAU,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU;IAC3D,MAAM,SAAS,GAAG,IAAI,mBAAS,EAAE,CAAC;IAElC,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,sBAAsB,CAAC,IAAI,8BAAkB,CAAC,EAAE,YAAY,CAAW,CAAC;IAC/H,MAAM,UAAU,GAAG,CAAC,KAAK,CAAC,KAAK,CAAW,CAAC;IAE3C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;QAC9B,OAAO,CAAC,GAAG,CAAC,eAAe,GAAG,YAAY,GAAG,kBAAkB,CAAC,CAAC;QACjE,OAAO;KACV;IAED,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,UAAU,EAAE;QACZ,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACnC;SAAM;QACH,OAAO,GAAG,EAAE,CAAC,WAAW,CAA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E,CAAC,CAAC;qBAE9E;iBACJ;aACJ;YAED,mCAAmC;YACnC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;SAExC;QAAC,OAAO,KAAK,EAAE;YACZ,8BAA8B;YAC9B,OAAO,CAAC,KAAK,CAAC,8BAA8B,GAAG,GAAG,EAAE,KAAK,CAAC,CAAC;YAC3D,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG;gBAChB,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,KAAK,CAAC,OAAO,IAAI,wBAAwB;aACnD,CAAC;SACL;KACJ;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AApED,8BAoEC"}
@@ -9,5 +9,9 @@
9
9
  */
10
10
  export declare function mergeItemFromCsv(itemName: string, csvDirPath: string, file_root_tag: string, file_items: any, flags: any): Promise<any>;
11
11
  export declare function merge(flags: any, file_subpath: any, file_extension: any, file_root_tag: any, file_items: any): Promise<{
12
+ error: string;
12
13
  result: string;
14
+ } | {
15
+ result: string;
16
+ items: {};
13
17
  }>;
@@ -8,6 +8,7 @@ const filesUtils_1 = require("../filesUtils");
8
8
  const utils_1 = require("../utils");
9
9
  const localSettings_1 = require("../localSettings");
10
10
  const flatArrayUtils_1 = require("../flatArrayUtils");
11
+ const utils_2 = require("./utils");
11
12
  const settings = (0, localSettings_1.loadSettings)();
12
13
  /**
13
14
  * Core merge logic that creates merged XML from CSV files in memory
@@ -54,9 +55,10 @@ async function merge(flags, file_subpath, file_extension, file_root_tag, file_it
54
55
  const baseOutputDir = (0, path_1.join)((flags["sf-xml"] || settings['salesforce-xml-path'] || constants_1.DEFAULT_SFXML_PATH), file_subpath);
55
56
  const inputProfile = (flags.input);
56
57
  if (!fs.existsSync(baseInputDir)) {
57
- console.log('Input folder ' + baseInputDir + ' does not exist!');
58
- return;
58
+ return (0, utils_2.jsonAndPrintError)(`Input folder ${baseInputDir} does not exist`);
59
59
  }
60
+ // Initialize result object
61
+ const result = { result: 'OK', items: {} };
60
62
  var dirList = [];
61
63
  if (inputProfile) {
62
64
  dirList = inputProfile.split(',');
@@ -77,14 +79,18 @@ async function merge(flags, file_subpath, file_extension, file_root_tag, file_it
77
79
  const mergedXml = await mergeItemFromCsv(dir, csvDirPath, file_root_tag, file_items, flags);
78
80
  const outputFile = (0, path_1.join)(baseOutputDir, dir + file_extension);
79
81
  (0, filesUtils_1.writeXmlToFile)(outputFile, mergedXml);
82
+ // Directory processed successfully
83
+ result.items[dir] = { result: 'OK' };
80
84
  }
81
85
  catch (error) {
82
86
  console.log(`Error merging ${dir}: ${error.message}. Skipping...`);
83
- continue;
87
+ result.items[dir] = {
88
+ result: 'KO',
89
+ error: error.message || 'Unknown error occurred'
90
+ };
84
91
  }
85
92
  }
86
- var result = 'OK';
87
- return { result };
93
+ return result;
88
94
  }
89
95
  exports.merge = merge;
90
96
  //# sourceMappingURL=merger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"merger.js","sourceRoot":"","sources":["../../../src/utils/commands/merger.ts"],"names":[],"mappings":";;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC/B,+BAA4B;AAC5B,sDAAmG;AACnG,8CAAoG;AACpG,oCAAoC;AACpC,oDAAgD;AAChD,sDAAgD;AAEhD,MAAM,QAAQ,GAAG,IAAA,4BAAY,GAAE,CAAC;AAEhC;;;;;;;;GAQG;AACI,KAAK,UAAU,gBAAgB,CAAC,QAAgB,EAAE,UAAkB,EAAE,aAAqB,EAAE,UAAe,EAAE,KAAU;IAC3H,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,UAAU,EAAE,QAAQ,CAAC,GAAG,8BAAkB,CAAC;IAEjE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,YAAY,CAAC,CAAC;KAC5C;IAED,MAAM,SAAS,GAAG,CAAC,MAAM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xC;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,KAAK,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;YACnE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG;gBAChB,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,KAAK,CAAC,OAAO,IAAI,wBAAwB;aACnD,CAAC;SACL;KACJ;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AA9CD,sBA8CC"}
@@ -1,3 +1,7 @@
1
1
  export declare function split(flags: any, file_subpath: any, file_extension: any, file_root_tag: any, file_items: any): Promise<{
2
- outputString: string;
2
+ error: string;
3
+ result: string;
4
+ } | {
5
+ result: string;
6
+ items: {};
3
7
  }>;
@@ -10,8 +10,9 @@ const constants_1 = require("../constants/constants");
10
10
  const constants_profiles_1 = require("../constants/constants_profiles");
11
11
  const localSettings_1 = require("../localSettings");
12
12
  const flatArrayUtils_1 = require("../flatArrayUtils");
13
- const csvWriter_1 = require("../csvWriter");
14
13
  const utils_3 = require("./utils");
14
+ const csvWriter_1 = require("../csvWriter");
15
+ const utils_4 = require("./utils");
15
16
  const settings = (0, localSettings_1.loadSettings)();
16
17
  async function split(flags, file_subpath, file_extension, file_root_tag, file_items) {
17
18
  const csvWriter = new csvWriter_1.default();
@@ -20,9 +21,10 @@ async function split(flags, file_subpath, file_extension, file_root_tag, file_it
20
21
  const ignoreUserPerm = (file_subpath === constants_profiles_1.PROFILES_SUBPATH && (flags.ignoreuserperm === 'true' || settings['ignore-user-permissions']) || false);
21
22
  const inputFiles = (flags.input);
22
23
  if (!fs.existsSync(baseInputDir)) {
23
- console.log('Input folder ' + baseInputDir + ' does not exist!');
24
- return;
24
+ return (0, utils_3.jsonAndPrintError)(`Input folder ${baseInputDir} does not exist`);
25
25
  }
26
+ // Initialize result object
27
+ const result = { result: 'OK', items: {} };
26
28
  var fileList = [];
27
29
  if (inputFiles) {
28
30
  fileList = inputFiles.split(',');
@@ -35,56 +37,68 @@ async function split(flags, file_subpath, file_extension, file_root_tag, file_it
35
37
  for (const filename of fileList) {
36
38
  const fullFilename = filename.endsWith(file_extension) ? filename : filename + file_extension;
37
39
  console.log('Splitting: ' + fullFilename);
38
- const inputFile = (0, path_1.join)(baseInputDir, fullFilename);
39
- const xmlFileContent = (await (0, filesUtils_1.readXmlFromFile)(inputFile)) ?? {};
40
- const fileProperties = xmlFileContent[file_root_tag] ?? {};
41
40
  const fileName = (0, filesUtils_1.removeExtension)(fullFilename);
42
- const outputDir = (0, path_1.join)(baseOutputDir, fileName);
43
- // Delete outputDir if it exists to ensure a clean split
44
- if (fs.existsSync(outputDir)) {
45
- fs.removeSync(outputDir);
46
- }
47
- for (const tag_section in file_items) {
48
- if (ignoreUserPerm && tag_section == constants_profiles_1.PROFILE_USERPERM_ROOT) {
49
- xmlFileContent[file_root_tag][tag_section] = null;
50
- continue;
41
+ try {
42
+ const inputFile = (0, path_1.join)(baseInputDir, fullFilename);
43
+ const xmlFileContent = (await (0, filesUtils_1.readXmlFromFile)(inputFile)) ?? {};
44
+ const fileProperties = xmlFileContent[file_root_tag] ?? {};
45
+ const outputDir = (0, path_1.join)(baseOutputDir, fileName);
46
+ // Delete outputDir if it exists to ensure a clean split
47
+ if (fs.existsSync(outputDir)) {
48
+ fs.removeSync(outputDir);
51
49
  }
52
- var myjson = fileProperties[tag_section];
53
- // skip when tag is not found in the xml
54
- if (myjson == undefined)
55
- continue;
56
- // fixes scenarios when the tag is one, since it would be read as object and not array
57
- if (!Array.isArray(myjson))
58
- myjson = [myjson];
59
- myjson = (0, flatArrayUtils_1.arrayToFlat)(myjson);
60
- // generate _tagId column
61
- (0, utils_1.generateTagId)(myjson, file_items[tag_section].key, file_items[tag_section].headers);
62
- // sorts array by _tagid. sorting is made as string
63
- if (flags.sort === 'true') {
64
- myjson = (0, utils_2.sortByKey)(myjson);
65
- }
66
- const headers = file_items[tag_section].headers;
67
- const outputFileCSV = (0, path_1.join)(outputDir, (0, filesUtils_1.calcCsvFilename)(fileName, tag_section));
68
- if (!fs.existsSync(outputDir)) {
69
- fs.mkdirSync(outputDir, { recursive: true });
70
- }
71
- try {
72
- const csvContent = await csvWriter.toCsv(myjson, headers);
73
- fs.writeFileSync(outputFileCSV, csvContent, { flag: 'w+' });
74
- // file written successfully
50
+ for (const tag_section in file_items) {
51
+ if (ignoreUserPerm && tag_section == constants_profiles_1.PROFILE_USERPERM_ROOT) {
52
+ xmlFileContent[file_root_tag][tag_section] = null;
53
+ continue;
54
+ }
55
+ var myjson = fileProperties[tag_section];
56
+ // skip when tag is not found in the xml
57
+ if (myjson == undefined)
58
+ continue;
59
+ // fixes scenarios when the tag is one, since it would be read as object and not array
60
+ if (!Array.isArray(myjson))
61
+ myjson = [myjson];
62
+ myjson = (0, flatArrayUtils_1.arrayToFlat)(myjson);
63
+ // generate _tagId column
64
+ (0, utils_1.generateTagId)(myjson, file_items[tag_section].key, file_items[tag_section].headers);
65
+ // sorts array by _tagid. sorting is made as string
66
+ if (flags.sort === 'true') {
67
+ myjson = (0, utils_2.sortByKey)(myjson);
68
+ }
69
+ const headers = file_items[tag_section].headers;
70
+ const outputFileCSV = (0, path_1.join)(outputDir, (0, filesUtils_1.calcCsvFilename)(fileName, tag_section));
71
+ if (!fs.existsSync(outputDir)) {
72
+ fs.mkdirSync(outputDir, { recursive: true });
73
+ }
74
+ try {
75
+ const csvContent = await csvWriter.toCsv(myjson, headers);
76
+ fs.writeFileSync(outputFileCSV, csvContent, { flag: 'w+' });
77
+ // file written successfully
78
+ }
79
+ catch (err) {
80
+ console.error(err);
81
+ }
82
+ xmlFileContent[file_root_tag][tag_section] = null;
75
83
  }
76
- catch (err) {
77
- console.error(err);
84
+ if (fs.existsSync(outputDir)) {
85
+ const outputFileXML = (0, path_1.join)(outputDir, fileName + constants_1.XML_PART_EXTENSION);
86
+ xmlFileContent[file_root_tag] = (0, utils_4.sortObjectKeys)(xmlFileContent[file_root_tag]);
87
+ (0, filesUtils_1.writeXmlToFile)(outputFileXML, xmlFileContent);
78
88
  }
79
- xmlFileContent[file_root_tag][tag_section] = null;
89
+ // File processed successfully
90
+ result.items[fileName] = { result: 'OK' };
80
91
  }
81
- if (fs.existsSync(outputDir)) {
82
- const outputFileXML = (0, path_1.join)(outputDir, fileName + constants_1.XML_PART_EXTENSION);
83
- xmlFileContent[file_root_tag] = (0, utils_3.sortObjectKeys)(xmlFileContent[file_root_tag]);
84
- (0, filesUtils_1.writeXmlToFile)(outputFileXML, xmlFileContent);
92
+ catch (error) {
93
+ // File processing failed
94
+ console.error(`Error processing file ${fullFilename}:`, error);
95
+ result.items[fileName] = {
96
+ result: 'KO',
97
+ error: error.message || 'Unknown error occurred'
98
+ };
85
99
  }
86
100
  }
87
- return { outputString: 'OK' };
101
+ return result;
88
102
  }
89
103
  exports.split = split;
90
104
  //# sourceMappingURL=splitter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"splitter.js","sourceRoot":"","sources":["../../../src/utils/commands/splitter.ts"],"names":[],"mappings":";;;AAAA,8CAAiG;AACjG,oCAAwC;AACxC,+BAA4B;AAC5B,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC/B,oCAAoC;AACpC,sDAAoG;AACpG,wEAA0F;AAC1F,oDAAgD;AAChD,sDAAgD;AAChD,4CAAqC;AACrC,mCAAyC;AAEzC,MAAM,QAAQ,GAAG,IAAA,4BAAY,GAAE,CAAC;AAIzB,KAAK,UAAU,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU;IACtF,MAAM,SAAS,GAAG,IAAI,mBAAS,EAAE,CAAC;IAElC,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,qBAAqB,CAAC,IAAI,8BAAkB,CAAC,EAAE,YAAY,CAAW,CAAC;IAC9H,MAAM,aAAa,GAAG,IAAA,WAAI,EAAC,CAAC,KAAK,CAA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G,IAAA,WAAI,EAAC,SAAS,EAAE,QAAQ,GAAG,8BAAkB,CAAC,CAAC;gBACrE,cAAc,CAAC,aAAa,CAAC,GAAG,IAAA,sBAAc,EAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;gBAC9E,IAAA,2BAAc,EAAC,aAAa,EAAE,cAAc,CAAC,CAAC;aACjD;YAED,8BAA8B;YAC9B,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;SAC7C;QAAC,OAAO,KAAK,EAAE;YACZ,yBAAyB;YACzB,OAAO,CAAC,KAAK,CAAC,yBAAyB,YAAY,GAAG,EAAE,KAAK,CAAC,CAAC;YAC/D,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG;gBACrB,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,KAAK,CAAC,OAAO,IAAI,wBAAwB;aACnD,CAAC;SACL;KACJ;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAnGD,sBAmGC"}
@@ -1,7 +1,7 @@
1
1
  export declare function upsert(flags: any, file_subpath: any, file_extension: any, file_root_tag: any, file_items: any): Promise<{
2
2
  error: string;
3
- outputString?: undefined;
3
+ result: string;
4
4
  } | {
5
- outputString: string;
6
- error?: undefined;
5
+ result: string;
6
+ items: {};
7
7
  }>;