@salesforce/plugin-omnistudio-migration-tool 1.4.1-dev.21 → 1.4.1-dev.23

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 (133) hide show
  1. package/README.md +19 -5
  2. package/lib/commands/omnistudio/migration/assess.d.ts +6 -0
  3. package/lib/commands/omnistudio/migration/assess.js +114 -31
  4. package/lib/commands/omnistudio/migration/assess.js.map +1 -1
  5. package/lib/commands/omnistudio/migration/info.d.ts +1 -0
  6. package/lib/commands/omnistudio/migration/info.js +13 -5
  7. package/lib/commands/omnistudio/migration/info.js.map +1 -1
  8. package/lib/commands/omnistudio/migration/migrate.d.ts +3 -1
  9. package/lib/commands/omnistudio/migration/migrate.js +99 -64
  10. package/lib/commands/omnistudio/migration/migrate.js.map +1 -1
  11. package/lib/migration/base.d.ts +12 -2
  12. package/lib/migration/base.js +23 -8
  13. package/lib/migration/base.js.map +1 -1
  14. package/lib/migration/dataraptor.js +30 -17
  15. package/lib/migration/dataraptor.js.map +1 -1
  16. package/lib/migration/flexcard.d.ts +3 -1
  17. package/lib/migration/flexcard.js +208 -22
  18. package/lib/migration/flexcard.js.map +1 -1
  19. package/lib/migration/omniscript.d.ts +2 -1
  20. package/lib/migration/omniscript.js +36 -13
  21. package/lib/migration/omniscript.js.map +1 -1
  22. package/lib/migration/related/ApexMigration.d.ts +8 -3
  23. package/lib/migration/related/ApexMigration.js +108 -30
  24. package/lib/migration/related/ApexMigration.js.map +1 -1
  25. package/lib/migration/related/LwcMigration.js +24 -9
  26. package/lib/migration/related/LwcMigration.js.map +1 -1
  27. package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.d.ts +12 -8
  28. package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.js +57 -65
  29. package/lib/migration/related/OmnistudioRelatedObjectMigrationFacade.js.map +1 -1
  30. package/lib/utils/apex/parser/apexparser.d.ts +2 -0
  31. package/lib/utils/apex/parser/apexparser.js +16 -0
  32. package/lib/utils/apex/parser/apexparser.js.map +1 -1
  33. package/lib/utils/constants/stringContants.d.ts +16 -0
  34. package/lib/utils/constants/stringContants.js +22 -0
  35. package/lib/utils/constants/stringContants.js.map +1 -0
  36. package/lib/utils/file/{fileutil.d.ts → fileUtil.d.ts} +14 -1
  37. package/lib/utils/file/{fileutil.js → fileUtil.js} +59 -12
  38. package/lib/utils/file/fileUtil.js.map +1 -0
  39. package/lib/utils/interfaces.d.ts +29 -1
  40. package/lib/utils/json/jsonutil.js +1 -0
  41. package/lib/utils/json/jsonutil.js.map +1 -1
  42. package/lib/utils/logger/fileLogger.d.ts +7 -0
  43. package/lib/utils/logger/fileLogger.js +82 -0
  44. package/lib/utils/logger/fileLogger.js.map +1 -0
  45. package/lib/utils/logger.d.ts +12 -1
  46. package/lib/utils/logger.js +67 -1
  47. package/lib/utils/logger.js.map +1 -1
  48. package/lib/utils/lwcparser/fileutils/FileDiffUtil.d.ts +4 -1
  49. package/lib/utils/lwcparser/fileutils/FileDiffUtil.js +63 -6
  50. package/lib/utils/lwcparser/fileutils/FileDiffUtil.js.map +1 -1
  51. package/lib/utils/lwcparser/fileutils/FileProcessorFactory.js +1 -1
  52. package/lib/utils/lwcparser/fileutils/FileProcessorFactory.js.map +1 -1
  53. package/lib/utils/lwcparser/fileutils/HtmlFileProcessor.d.ts +1 -1
  54. package/lib/utils/lwcparser/fileutils/HtmlFileProcessor.js +4 -4
  55. package/lib/utils/lwcparser/fileutils/HtmlFileProcessor.js.map +1 -1
  56. package/lib/utils/lwcparser/fileutils/JavascriptFileProcessor.d.ts +1 -1
  57. package/lib/utils/lwcparser/fileutils/JavascriptFileProcessor.js +3 -3
  58. package/lib/utils/lwcparser/fileutils/JavascriptFileProcessor.js.map +1 -1
  59. package/lib/utils/lwcparser/fileutils/XmlFileProcessor.d.ts +1 -1
  60. package/lib/utils/lwcparser/fileutils/XmlFileProcessor.js +3 -3
  61. package/lib/utils/lwcparser/fileutils/XmlFileProcessor.js.map +1 -1
  62. package/lib/utils/lwcparser/htmlParser/HTMLParser.js +2 -2
  63. package/lib/utils/lwcparser/htmlParser/HTMLParser.js.map +1 -1
  64. package/lib/utils/lwcparser/jsParser/JavaScriptParser.js +2 -2
  65. package/lib/utils/lwcparser/jsParser/JavaScriptParser.js.map +1 -1
  66. package/lib/utils/lwcparser/xmlParser/XmlParser.js +2 -2
  67. package/lib/utils/lwcparser/xmlParser/XmlParser.js.map +1 -1
  68. package/lib/utils/orgPreferences.d.ts +40 -0
  69. package/lib/utils/orgPreferences.js +70 -0
  70. package/lib/utils/orgPreferences.js.map +1 -0
  71. package/lib/utils/orgUtils/index.d.ts +14 -1
  72. package/lib/utils/orgUtils/index.js +34 -10
  73. package/lib/utils/orgUtils/index.js.map +1 -1
  74. package/lib/utils/reportGenerator/reportInterfaces.d.ts +63 -15
  75. package/lib/utils/reportGenerator/reportUtil.d.ts +5 -0
  76. package/lib/utils/reportGenerator/reportUtil.js +36 -0
  77. package/lib/utils/reportGenerator/reportUtil.js.map +1 -0
  78. package/lib/utils/resultsbuilder/ApexAssessmentReporter.d.ts +12 -0
  79. package/lib/utils/resultsbuilder/ApexAssessmentReporter.js +87 -0
  80. package/lib/utils/resultsbuilder/ApexAssessmentReporter.js.map +1 -0
  81. package/lib/utils/resultsbuilder/DRAssessmentReporter.d.ts +9 -2
  82. package/lib/utils/resultsbuilder/DRAssessmentReporter.js +106 -57
  83. package/lib/utils/resultsbuilder/DRAssessmentReporter.js.map +1 -1
  84. package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.d.ts +12 -0
  85. package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.js +104 -0
  86. package/lib/utils/resultsbuilder/FlexcardAssessmentReporter.js.map +1 -0
  87. package/lib/utils/resultsbuilder/IPAssessmentReporter.d.ts +9 -2
  88. package/lib/utils/resultsbuilder/IPAssessmentReporter.js +110 -61
  89. package/lib/utils/resultsbuilder/IPAssessmentReporter.js.map +1 -1
  90. package/lib/utils/resultsbuilder/LWCAssessmentReporter.js +141 -0
  91. package/lib/utils/resultsbuilder/LWCAssessmentReporter.js.map +1 -0
  92. package/lib/utils/resultsbuilder/OSAssessmentReporter.d.ts +10 -3
  93. package/lib/utils/resultsbuilder/OSAssessmentReporter.js +143 -83
  94. package/lib/utils/resultsbuilder/OSAssessmentReporter.js.map +1 -1
  95. package/lib/utils/resultsbuilder/assessmentReporter.d.ts +12 -11
  96. package/lib/utils/resultsbuilder/assessmentReporter.js +104 -263
  97. package/lib/utils/resultsbuilder/assessmentReporter.js.map +1 -1
  98. package/lib/utils/resultsbuilder/index.d.ts +11 -8
  99. package/lib/utils/resultsbuilder/index.js +251 -209
  100. package/lib/utils/resultsbuilder/index.js.map +1 -1
  101. package/lib/utils/sfcli/project/sfProject.d.ts +1 -0
  102. package/lib/utils/sfcli/project/sfProject.js +25 -7
  103. package/lib/utils/sfcli/project/sfProject.js.map +1 -1
  104. package/lib/utils/stringUtils.d.ts +9 -0
  105. package/lib/utils/stringUtils.js +25 -0
  106. package/lib/utils/stringUtils.js.map +1 -0
  107. package/lib/utils/templateParser/__tests__/test.d.ts +4 -0
  108. package/lib/utils/templateParser/__tests__/test.js +104 -0
  109. package/lib/utils/templateParser/__tests__/test.js.map +1 -0
  110. package/lib/utils/templateParser/generate.d.ts +17 -0
  111. package/lib/utils/templateParser/generate.js +30 -0
  112. package/lib/utils/templateParser/generate.js.map +1 -0
  113. package/lib/utils/templateParser/model/elementNode.d.ts +81 -0
  114. package/lib/utils/templateParser/model/elementNode.js +182 -0
  115. package/lib/utils/templateParser/model/elementNode.js.map +1 -0
  116. package/lib/utils/templateParser/model/nodeTypes.d.ts +6 -0
  117. package/lib/utils/templateParser/model/nodeTypes.js +11 -0
  118. package/lib/utils/templateParser/model/nodeTypes.js.map +1 -0
  119. package/lib/utils/templateParser/util.d.ts +133 -0
  120. package/lib/utils/templateParser/util.js +456 -0
  121. package/lib/utils/templateParser/util.js.map +1 -0
  122. package/messages/assess.json +62 -1
  123. package/messages/info.json +5 -1
  124. package/messages/migrate.json +51 -1
  125. package/oclif.manifest.json +1 -1
  126. package/package.json +3 -3
  127. package/lib/utils/file/fileutil.js.map +0 -1
  128. package/lib/utils/prototypes.js +0 -18
  129. package/lib/utils/prototypes.js.map +0 -1
  130. package/lib/utils/reportGenerator/reportGenerator.d.ts +0 -2
  131. package/lib/utils/reportGenerator/reportGenerator.js +0 -152
  132. package/lib/utils/reportGenerator/reportGenerator.js.map +0 -1
  133. /package/lib/utils/{prototypes.d.ts → resultsbuilder/LWCAssessmentReporter.d.ts} +0 -0
@@ -0,0 +1,456 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
4
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TemplateParserUtil = void 0;
7
+ const elementNode_1 = require("./model/elementNode");
8
+ const nodeTypes_1 = require("./model/nodeTypes");
9
+ /**
10
+ * Utility class for parsing HTML templates and converting them to ElementNode structures.
11
+ * Handles template syntax including conditionals, loops, placeholders, and native HTML elements.
12
+ */
13
+ class TemplateParserUtil {
14
+ /**
15
+ * Flattens a nested object structure into a key-value map with dot notation.
16
+ * Handles arrays by adding length properties and recursively processes nested objects.
17
+ *
18
+ * @param data - The object to flatten
19
+ * @param prefix - Optional prefix to prepend to all keys
20
+ * @returns Map containing flattened key-value pairs
21
+ */
22
+ static parseKeyPair(data, prefix) {
23
+ prefix = prefix ? prefix + '.' : '';
24
+ const keypair = new Map();
25
+ for (const key of Object.keys(data)) {
26
+ if (Array.isArray(data[key])) {
27
+ keypair.set(`${prefix}${key}.length`, data[key].length.toString());
28
+ keypair.set(`${prefix}${key}`, data[key]);
29
+ }
30
+ else if (data[key] instanceof Object) {
31
+ this.parseKeyPair(data[key], `${prefix}${key}`).forEach((pairValue, pairKey) => {
32
+ keypair.set(`${prefix}${pairKey}`, pairValue);
33
+ });
34
+ }
35
+ else {
36
+ keypair.set(`${prefix}${key}`, data[key]);
37
+ }
38
+ }
39
+ return keypair;
40
+ }
41
+ /**
42
+ * Parses HTML template string and converts it to an ElementNode structure.
43
+ * Recognizes and handles different template syntaxes: conditionals, loops, placeholders, and native HTML.
44
+ *
45
+ * @param html - The HTML template string to parse
46
+ * @returns ElementNode representing the parsed template structure
47
+ */
48
+ static parseHtmlToNode(html) {
49
+ // Remove leading/trailing whitespace
50
+ html = html.trim();
51
+ // Check for if condition using <c:if exp={js exp}></c:if> syntax
52
+ const ifMatch = /^<c:if\s+exp=\{([^}]+)\}>(.*?)<\/c:if>$/s.exec(html);
53
+ if (ifMatch) {
54
+ const [, expression, content] = ifMatch;
55
+ const children = this.parseChildren(content);
56
+ return new elementNode_1.ElementNode(nodeTypes_1.NodeType.IF, expression.trim(), new Map(), children);
57
+ }
58
+ // Check for for loop using <c:for items=(itemsName) var="varName" index="indexName"></c:for> syntax
59
+ const forLoopMatch = /^<c:for\s+items=\(([^)]+)\)([^>]*)>(.*?)<\/c:for>$/s.exec(html);
60
+ if (forLoopMatch) {
61
+ const [, itemsName, attributesStr, content] = forLoopMatch;
62
+ const properties = this.parseForLoopAttributes(attributesStr);
63
+ const children = this.parseChildren(content);
64
+ return new elementNode_1.ElementNode(nodeTypes_1.NodeType.FOR_LOOP, itemsName, properties, children);
65
+ }
66
+ // Check for placeholder using {{name}} syntax
67
+ const placeholderMatch = /^\{\{([^}]+)\}\}$/.exec(html);
68
+ if (placeholderMatch) {
69
+ const [, name] = placeholderMatch;
70
+ return new elementNode_1.ElementNode(nodeTypes_1.NodeType.PLACEHOLDER, name.trim(), new Map(), []);
71
+ }
72
+ // Check if it's a c:for tag that wasn't caught by the full pattern
73
+ const cForMatch = /^<c:for([^>]*)>(.*?)<\/c:for>$/s.exec(html);
74
+ if (cForMatch) {
75
+ const [, attributesStr, content] = cForMatch;
76
+ // Extract items name from attributes
77
+ const itemsMatch = /items=\(([^)]+)\)/.exec(attributesStr);
78
+ const itemsName = itemsMatch ? itemsMatch[1] : 'items';
79
+ const properties = this.parseForLoopAttributes(attributesStr);
80
+ const children = this.parseChildren(content);
81
+ return new elementNode_1.ElementNode(nodeTypes_1.NodeType.FOR_LOOP, itemsName, properties, children);
82
+ }
83
+ // Check if it's a c:if tag that wasn't caught by the full pattern
84
+ const cIfMatch = /^<c:if([^>]*)>(.*?)<\/c:if>$/s.exec(html);
85
+ if (cIfMatch) {
86
+ const [, attributesStr, content] = cIfMatch;
87
+ // Extract expression from attributes
88
+ const expMatch = /exp=\{([^}]+)\}/.exec(attributesStr);
89
+ const expression = expMatch ? expMatch[1] : 'true';
90
+ const children = this.parseChildren(content);
91
+ return new elementNode_1.ElementNode(nodeTypes_1.NodeType.IF, expression.trim(), new Map(), children);
92
+ }
93
+ // Parse as native HTML element
94
+ return this.parseNativeElement(html);
95
+ }
96
+ /**
97
+ * Parses a native HTML element string into an ElementNode.
98
+ * Handles opening tags, attributes, self-closing tags, and nested content.
99
+ *
100
+ * @param html - The HTML element string to parse
101
+ * @returns ElementNode representing the native HTML element
102
+ */
103
+ static parseNativeElement(html) {
104
+ // Find the first opening tag - updated to handle custom tags with colons
105
+ const tagMatch = /^<([\w:]+)([^>]*)>/.exec(html);
106
+ if (!tagMatch) {
107
+ // If no tag found, treat as text content
108
+ return new elementNode_1.ElementNode(nodeTypes_1.NodeType.NATIVE, 'text', new Map([['content', html]]), []);
109
+ }
110
+ const [, tagName, attributesStr] = tagMatch;
111
+ const properties = this.parseAttributes(attributesStr);
112
+ // Check if it's a self-closing tag - updated to handle custom tags with colons
113
+ if (/^<([\w:]+)([^>]*)\/>/.exec(html)) {
114
+ return new elementNode_1.ElementNode(nodeTypes_1.NodeType.NATIVE, tagName, properties, []);
115
+ }
116
+ // Find the closing tag
117
+ const closingTag = `</${tagName}>`;
118
+ const closingIndex = html.lastIndexOf(closingTag);
119
+ if (closingIndex === -1) {
120
+ // No closing tag found, treat as self-closing
121
+ return new elementNode_1.ElementNode(nodeTypes_1.NodeType.NATIVE, tagName, properties, []);
122
+ }
123
+ // Extract content between opening and closing tags
124
+ const contentStart = tagMatch[0].length;
125
+ const content = html.substring(contentStart, closingIndex);
126
+ // Parse children
127
+ const children = this.parseChildren(content);
128
+ return new elementNode_1.ElementNode(nodeTypes_1.NodeType.NATIVE, tagName, properties, children);
129
+ }
130
+ /**
131
+ * Parses HTML attributes string into a key-value map.
132
+ * Handles quoted values, unquoted values, and boolean attributes.
133
+ *
134
+ * @param attributesStr - The attributes string to parse
135
+ * @returns Map containing attribute name-value pairs
136
+ */
137
+ static parseAttributes(attributesStr) {
138
+ const properties = new Map();
139
+ if (!attributesStr.trim()) {
140
+ return properties;
141
+ }
142
+ // Comprehensive regex to match all possible HTML attributes:
143
+ // 1. name="value" or name='value' (quoted values)
144
+ // 2. name=value (unquoted values)
145
+ // 3. name (boolean attributes without values)
146
+ // const attrRegex = /(\w+)\s*=\s*["]([^"]*)["]|(\w+)\s*=\s*([^\s>]+)|(\w+)(?=\s|$)/g;
147
+ // const attrRegex = /(\w+)\s*=\s*(["'])([\s\S]*?)\2|(\w+)\s*=\s*([^\s>]+)|(\w+)(?=\s|$)/g;
148
+ const attrRegex = /([a-zA-Z0-9_-]+)\s*=\s*["]([^"]*)["]|([a-zA-Z0-9_-]+)\s*=\s*([^\s>]+)|([a-zA-Z0-9_-]+)(?=\s|$)/g;
149
+ let match;
150
+ while ((match = attrRegex.exec(attributesStr)) !== null) {
151
+ let name;
152
+ let value;
153
+ if (match[1] && match[2] !== undefined) {
154
+ // Quoted attribute: name="value" or name='value'
155
+ name = match[1];
156
+ value = match[2];
157
+ }
158
+ else if (match[3] && match[4] !== undefined) {
159
+ // Unquoted attribute: name=value
160
+ name = match[3];
161
+ value = match[4];
162
+ }
163
+ else if (match[5]) {
164
+ // Boolean attribute: name (without value)
165
+ name = match[5];
166
+ value = null;
167
+ }
168
+ else {
169
+ continue; // Skip invalid matches
170
+ }
171
+ // Store the attribute in properties
172
+ properties.set(name, value);
173
+ }
174
+ return properties;
175
+ }
176
+ /**
177
+ * Parses the content between HTML tags into an array of child ElementNodes.
178
+ * Splits content by template tags and HTML elements, then parses each part.
179
+ *
180
+ * @param content - The content string to parse
181
+ * @returns Array of ElementNode children
182
+ */
183
+ static parseChildren(content) {
184
+ const children = [];
185
+ if (!content.trim()) {
186
+ return children;
187
+ }
188
+ // Split content by template tags and HTML tags
189
+ const parts = this.splitContent(content);
190
+ for (const part of parts) {
191
+ if (part.trim()) {
192
+ children.push(this.parseHtmlToNode(part));
193
+ }
194
+ }
195
+ return children;
196
+ }
197
+ /**
198
+ * Splits content into parts based on template syntax and HTML elements.
199
+ * Handles placeholders, template tags, and HTML elements while preserving text content.
200
+ *
201
+ * @param content - The content string to split
202
+ * @returns Array of content parts that can be individually parsed
203
+ */
204
+ static splitContent(content) {
205
+ const parts = [];
206
+ let current = '';
207
+ let i = 0;
208
+ while (i < content.length) {
209
+ // Check for placeholder tags first
210
+ if (this.isPlaceholderStart(content, i)) {
211
+ const placeholderPart = this.extractPlaceholder(content, i);
212
+ if (placeholderPart) {
213
+ if (current.trim()) {
214
+ parts.push(current);
215
+ current = '';
216
+ }
217
+ parts.push(placeholderPart.content);
218
+ i = placeholderPart.endIndex;
219
+ continue;
220
+ }
221
+ }
222
+ // Check for template tags
223
+ if (this.isTemplateTagStart(content, i)) {
224
+ const templatePart = this.extractTemplateTag(content, i);
225
+ if (templatePart) {
226
+ if (current.trim()) {
227
+ parts.push(current);
228
+ current = '';
229
+ }
230
+ parts.push(templatePart.content);
231
+ i = templatePart.endIndex;
232
+ continue;
233
+ }
234
+ }
235
+ // Check for HTML tags
236
+ if (content[i] === '<') {
237
+ const htmlPart = this.extractHtmlElement(content, i);
238
+ if (htmlPart) {
239
+ if (current.trim()) {
240
+ parts.push(current);
241
+ current = '';
242
+ }
243
+ parts.push(htmlPart.content);
244
+ i = htmlPart.endIndex;
245
+ continue;
246
+ }
247
+ }
248
+ // Regular text content
249
+ current += content[i];
250
+ i++;
251
+ }
252
+ if (current.trim()) {
253
+ parts.push(current);
254
+ }
255
+ return parts;
256
+ }
257
+ /**
258
+ * Checks if the content at the given index starts a placeholder tag.
259
+ *
260
+ * @param content - The content string to check
261
+ * @param index - The index to check from
262
+ * @returns True if a placeholder starts at the given index
263
+ */
264
+ static isPlaceholderStart(content, index) {
265
+ return content.substring(index, index + 2) === '{{';
266
+ }
267
+ /**
268
+ * Extracts a complete placeholder tag from the content.
269
+ *
270
+ * @param content - The content string to extract from
271
+ * @param startIndex - The starting index of the placeholder
272
+ * @returns Object containing the placeholder content and end index, or null if malformed
273
+ */
274
+ static extractPlaceholder(content, startIndex) {
275
+ const endIndex = content.indexOf('}}', startIndex);
276
+ if (endIndex === -1) {
277
+ return null; // Malformed placeholder
278
+ }
279
+ return {
280
+ content: content.substring(startIndex, endIndex + 2),
281
+ endIndex: endIndex + 2,
282
+ };
283
+ }
284
+ /**
285
+ * Checks if the content at the given index starts a template tag (c:for or c:if).
286
+ *
287
+ * @param content - The content string to check
288
+ * @param index - The index to check from
289
+ * @returns True if a template tag starts at the given index
290
+ */
291
+ static isTemplateTagStart(content, index) {
292
+ return content.substring(index, index + 4) === '<c:for' || content.substring(index, index + 4) === '<c:if';
293
+ }
294
+ /**
295
+ * Extracts a complete template tag (c:for or c:if) from the content.
296
+ *
297
+ * @param content - The content string to extract from
298
+ * @param startIndex - The starting index of the template tag
299
+ * @returns Object containing the template tag content and end index, or null if malformed
300
+ */
301
+ static extractTemplateTag(content, startIndex) {
302
+ const tagType = content.substring(startIndex, startIndex + 4);
303
+ const closingTag = tagType === '<c:for' ? '</c:for>' : '</c:if>';
304
+ const endIndex = content.indexOf(closingTag, startIndex);
305
+ if (endIndex === -1) {
306
+ return null; // Malformed template tag
307
+ }
308
+ return {
309
+ content: content.substring(startIndex, endIndex + closingTag.length),
310
+ endIndex: endIndex + closingTag.length,
311
+ };
312
+ }
313
+ /**
314
+ * Extracts a complete HTML element from the content.
315
+ * Handles self-closing tags, closing tags, and opening tags with nested content.
316
+ *
317
+ * @param content - The content string to extract from
318
+ * @param startIndex - The starting index of the HTML element
319
+ * @returns Object containing the HTML element content and end index, or null if malformed
320
+ */
321
+ static extractHtmlElement(content, startIndex) {
322
+ // Check for self-closing tags
323
+ const selfClosingMatch = /^<([\w:]+)([^>]*)\/>/.exec(content.substring(startIndex));
324
+ if (selfClosingMatch) {
325
+ return {
326
+ content: selfClosingMatch[0],
327
+ endIndex: startIndex + selfClosingMatch[0].length,
328
+ };
329
+ }
330
+ // Check for closing tags
331
+ if (content.substring(startIndex, startIndex + 2) === '</') {
332
+ return this.extractClosingTag(content, startIndex);
333
+ }
334
+ // Handle opening tags
335
+ return this.extractOpeningTag(content, startIndex);
336
+ }
337
+ /**
338
+ * Extracts a closing HTML tag from the content.
339
+ *
340
+ * @param content - The content string to extract from
341
+ * @param startIndex - The starting index of the closing tag
342
+ * @returns Object containing the closing tag content and end index, or null if malformed
343
+ */
344
+ static extractClosingTag(content, startIndex) {
345
+ const endIndex = content.indexOf('>', startIndex);
346
+ if (endIndex === -1) {
347
+ return null; // Malformed closing tag
348
+ }
349
+ return {
350
+ content: content.substring(startIndex, endIndex + 1),
351
+ endIndex: endIndex + 1,
352
+ };
353
+ }
354
+ /**
355
+ * Extracts an opening HTML tag and its complete element (including nested content).
356
+ * Handles nested elements of the same type by tracking opening and closing tags.
357
+ *
358
+ * @param content - The content string to extract from
359
+ * @param startIndex - The starting index of the opening tag
360
+ * @returns Object containing the complete HTML element content and end index, or null if malformed
361
+ */
362
+ static extractOpeningTag(content, startIndex) {
363
+ const tagMatch = /^<([\w:]+)([^>]*)>/.exec(content.substring(startIndex));
364
+ if (!tagMatch) {
365
+ return null; // Malformed opening tag
366
+ }
367
+ const tagName = tagMatch[1];
368
+ const fullTag = tagMatch[0];
369
+ const closingTag = `</${tagName}>`;
370
+ // Look for the closing tag
371
+ const endIndex = content.indexOf(closingTag, startIndex + fullTag.length);
372
+ if (endIndex === -1) {
373
+ // No closing tag found, treat as self-closing
374
+ return {
375
+ content: fullTag,
376
+ endIndex: startIndex + fullTag.length,
377
+ };
378
+ }
379
+ // Handle nested elements
380
+ const nestedEndIndex = this.findNestedElementEnd(content, startIndex, tagName, closingTag);
381
+ return {
382
+ content: content.substring(startIndex, nestedEndIndex),
383
+ endIndex: nestedEndIndex,
384
+ };
385
+ }
386
+ /**
387
+ * Finds the end index of an HTML element that may contain nested elements of the same type.
388
+ * Tracks opening and closing tags to handle proper nesting.
389
+ *
390
+ * @param content - The content string to search in
391
+ * @param startIndex - The starting index of the element
392
+ * @param tagName - The name of the HTML tag
393
+ * @param closingTag - The closing tag string to look for
394
+ * @returns The end index of the complete element including nested content
395
+ */
396
+ static findNestedElementEnd(content, startIndex, tagName, closingTag) {
397
+ let nestedDepth = 0;
398
+ let searchIndex = startIndex + 1;
399
+ let endIndex = content.indexOf(closingTag, startIndex);
400
+ while (searchIndex < content.length) {
401
+ const nextOpenIndex = content.indexOf(`<${tagName}`, searchIndex);
402
+ const nextCloseIndex = content.indexOf(closingTag, searchIndex);
403
+ if (nextOpenIndex !== -1 && nextOpenIndex < nextCloseIndex) {
404
+ // Found nested opening tag
405
+ nestedDepth++;
406
+ searchIndex = nextOpenIndex + 1;
407
+ }
408
+ else if (nextCloseIndex !== -1) {
409
+ if (nestedDepth === 0) {
410
+ // Found the matching closing tag
411
+ endIndex = nextCloseIndex + closingTag.length;
412
+ break;
413
+ }
414
+ else {
415
+ // Found closing tag for nested element
416
+ nestedDepth--;
417
+ searchIndex = nextCloseIndex + 1;
418
+ }
419
+ }
420
+ else {
421
+ // No more tags found
422
+ break;
423
+ }
424
+ }
425
+ return endIndex;
426
+ }
427
+ /**
428
+ * Parses attributes from a c:for loop tag to extract variable and index names.
429
+ * Sets default values for item and index if not specified in attributes.
430
+ *
431
+ * @param attributesStr - The attributes string from the c:for tag
432
+ * @returns Map containing the item and index variable names
433
+ */
434
+ static parseForLoopAttributes(attributesStr) {
435
+ const properties = new Map();
436
+ // Default values
437
+ properties.set('item', 'item');
438
+ properties.set('index', 'index');
439
+ if (!attributesStr.trim()) {
440
+ return properties;
441
+ }
442
+ // Parse var attribute
443
+ const varMatch = /var\s*=\s*["']([^"']*)["']/.exec(attributesStr);
444
+ if (varMatch) {
445
+ properties.set('item', varMatch[1]);
446
+ }
447
+ // Parse index attribute
448
+ const indexMatch = /index\s*=\s*["']([^"']*)["']/.exec(attributesStr);
449
+ if (indexMatch) {
450
+ properties.set('index', indexMatch[1]);
451
+ }
452
+ return properties;
453
+ }
454
+ }
455
+ exports.TemplateParserUtil = TemplateParserUtil;
456
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/utils/templateParser/util.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,+DAA+D;AAC/D,sEAAsE;;;AAEtE,qDAAkD;AAClD,iDAA6C;AAE7C;;;GAGG;AACH,MAAa,kBAAkB;IAC7B;;;;;;;OAOG;IACI,MAAM,CAAC,YAAY,CAAC,IAAS,EAAE,MAAe;QACnD,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAe,CAAC;QACvC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACnC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;gBAC5B,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,GAAG,SAAS,EAAG,IAAI,CAAC,GAAG,CAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAC9E,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,GAAG,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;aAC3C;iBAAM,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,MAAM,EAAE;gB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ED,sBAAsB;QACtB,MAAM,QAAQ,GAAG,4BAA4B,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAClE,IAAI,QAAQ,EAAE;YACZ,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;SACrC;QAED,wBAAwB;QACxB,MAAM,UAAU,GAAG,8BAA8B,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACtE,IAAI,UAAU,EAAE;YACd,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;SACxC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAnfD,gDAmfC"}
@@ -29,5 +29,66 @@
29
29
  "allVersionsDescription": "Migrate all versions of a component",
30
30
  "changeMessage": " %s will be changed from %s to %s",
31
31
  "angularOSWarning": " Angular OmniScript will not be migrated, please convert this to LWC based Omniscript",
32
- "apexLwc": "Please select the type of components to migrate: 'apex' for Apex classes, 'lwc' for Lightning Web Components, or 'apex,lwc' if you want to include both types."
32
+ "apexLwc": "Please select the type of components to assess: 'apex' for Apex classes, 'lwc' for Lightning Web Components, or 'apex,lwc' if you want to include both types.",
33
+ "invalidNamespace": "The namespace you have passed is not valid namespace, the valid namespace of your org is ",
34
+ "noPackageInstalled": "No package installed on given org.",
35
+ "alreadyStandardModel": "The org is already on standard data model.",
36
+ "invalidRelatedObjectsOption": "Invalid option provided for -r: %s. Valid options are apex, lwc.",
37
+ "formulaSyntaxError": "There was some problem while updating the formula syntax, please check the all the formula's syntax once : %s",
38
+ "errorDuringFlexCardAssessment": "Error during FlexCard assessment",
39
+ "errorDuringOmniScriptAssessment": "Error during OmniScript assessment",
40
+ "processingFlexCard": "Processing FlexCard: %s",
41
+ "processingDataRaptor": "Processing DataRaptor: %s",
42
+ "processingOmniScript": "Processing OmniScript: %s",
43
+ "foundDataRaptorsToAssess": "Found %s DataRaptors to assess",
44
+ "foundOmniScriptsToAssess": "Found %s OmniScripts and Integration Procedures to assess",
45
+ "startingDataRaptorAssessment": "Starting DataRaptor assessment",
46
+ "startingOmniScriptAssessment": "Starting OmniScript assessment",
47
+ "allVersionsInfo": "allVersions : %s",
48
+ "assessmentInitialization": "Assessment Initialization: Using namespace: %s",
49
+ "apiVersionInfo": "API Version: %s",
50
+ "assessmentTargets": "Assessment targets: %s",
51
+ "relatedObjectsInfo": "Related objects: %s",
52
+ "allVersionsFlagInfo": "All versions: %s",
53
+ "assessedDataRaptorsCount": "Assessed %s DataRaptors",
54
+ "dataRaptorAssessmentCompleted": "DataRaptor assessment completed",
55
+ "flexCardAssessment": "FlexCard Assessment",
56
+ "assessedFlexCardsCount": "Assessed %s FlexCards",
57
+ "flexCardAssessmentCompleted": "FlexCard assessment completed",
58
+ "omniScriptAssessment": "OmniScript and Integration Procedure Assessment",
59
+ "assessedOmniScriptsCount": "Assessed %s OmniScripts",
60
+ "assessedIntegrationProceduresCount": "Assessed %s Integration Procedures",
61
+ "omniScriptAssessmentCompleted": "OmniScript and Integration Procedure assessment completed",
62
+ "startingFlexCardAssessment": "Starting FlexCard assessment",
63
+ "foundFlexCardsToAssess": "Found %s FlexCards to assess",
64
+ "startingApexAssessment": "Starting Apex assessment in project path: %s",
65
+ "processingApexFilesForAssessment": "Processing Apex files for assessment",
66
+ "successfullyProcessedApexFilesForAssessment": "Successfully processed %s Apex files for assessment",
67
+ "apexAssessmentResults": "Apex assessment results: %s",
68
+ "foundApexFilesInDirectory": "Found %s Apex files in directory: %s",
69
+ "skippingNonApexFile": "Skipping non-Apex file: %s",
70
+ "processingApexFile": "Processing Apex file: %s",
71
+ "skippingApexFileFewChanges": "Skipping Apex file: %s as it has less than 3 changes",
72
+ "successfullyProcessedApexFile": "Successfully processed Apex file: %s",
73
+ "fileNoOmnistudioCalls": "File %s does not have any omnistudio calls or remote calls. No changes will be applied.",
74
+ "fileAlreadyImplementsCallable": "file %s already implements callable no changes will be applied",
75
+ "inApexDrNameWillBeUpdated": "In Apex %s DR name %s will be updated to %s",
76
+ "startingLwcAssessment": "Starting LWC assessment in project path: %s",
77
+ "processingLwcsForAssessment": "Processing LWCs for assessment",
78
+ "successfullyProcessedLwcsForAssessment": "Successfully processed %s LWCs for assessment",
79
+ "lwcAssessmentResults": "LWC assessment results: %s",
80
+ "errorReadingFiles": "Error in reading files: %s",
81
+ "errorProcessingFiles": "Error in processing files: %s",
82
+ "startingProcessRelatedObjects": "Starting processRelatedObjects for %s in project path: %s",
83
+ "errorProcessingApexFile": "Error processing Apex file: %s",
84
+ "fileUpdatedToAllowRemoteCalls": "File updated to allow remote calls",
85
+ "fileUpdatedToAllowCalls": "File updated to allow calls",
86
+ "fileImplementsVlocityOpenInterface": "file %s implements VlocityOpenInterface no changes will be applied",
87
+ "methodCallBundleNameUpdated": "Method call bundle name will be updated in %s for class %s method %s",
88
+ "cardNameChangeMessage": "Card name will be changed from {0} to {1} to follow API naming standards",
89
+ "authordNameChangeMessage": "Author name will be changed from {0} to {1} to follow API naming standards",
90
+ "omniScriptNameChangeMessage": "OmniScript reference part {0} will be changed to {1} during migration.",
91
+ "dataRaptorNameChangeMessage": "DataRaptor reference {0} will be changed to {1} during migration.",
92
+ "integrationProcedureNameChangeMessage": "Integration Procedure reference {0} will be changed to {1} during migration.",
93
+ "integrationProcedureManualUpdateMessage": "Integration Procedure reference {0} may need manual updates after migration."
33
94
  }
@@ -8,5 +8,9 @@
8
8
  "sfdx omnistudio:migration:info --name myname --targetusername myOrg@example.com"
9
9
  ],
10
10
  "allVersionsDescription": "Migrate all versions of a component",
11
- "apexLwc": "Please select the type of components to migrate: 'apex' for Apex classes, 'lwc' for Lightning Web Components, or 'apex,lwc' if you want to include both types."
11
+ "apexLwc": "Please select the type of components to migrate: 'apex' for Apex classes, 'lwc' for Lightning Web Components, or 'apex,lwc' if you want to include both types.",
12
+ "greetingOrgInfo": "Hello %s! This is org: %s",
13
+ "greetingOrgInfoWithDate": "Hello %s! This is org: %s and I will be around until %s!",
14
+ "hubOrgId": "My hub org id is: %s",
15
+ "allVersionsAppended": " and all versions will be migrated"
12
16
  }
@@ -29,5 +29,55 @@
29
29
  "errorWhileUploadingCard": "An error ocurred while uploading Card: ",
30
30
  "errorWhileCreatingElements": "An error ocurred while saving OmniScript elements: ",
31
31
  "allVersionsDescription": "Migrate all versions of a component",
32
- "apexLwc": "Please select the type of components to migrate: 'apex' for Apex classes, 'lwc' for Lightning Web Components, or 'apex,lwc' if you want to include both types."
32
+ "apexLwc": "Please select the type of components to migrate: 'apex' for Apex classes, 'lwc' for Lightning Web Components, or 'apex,lwc' if you want to include both types.",
33
+ "invalidNamespace": "The namespace you have passed is not valid namespace, the valid namespace of your org is ",
34
+ "noPackageInstalled": "No package installed on given org.",
35
+ "alreadyStandardModel": "The org is already on standard data model.",
36
+ "invalidRelatedObjectsOption": "Invalid option provided for -r: %s. Valid options are apex, lwc.",
37
+ "userConsentMessage": "By proceeding further, you hereby consent to the use, accept changes to your custom code, and the accompanying terms and conditions associated with the use of the OmniStudio Migration Tool. Do you want to proceed? [y/n]",
38
+ "userDeclinedConsent": "User declined consent, will not process %s .",
39
+ "userConsentedToProceed": "User consented to proceed",
40
+ "projectPathConfirmation": "Do you have a sfdc project where %s files are already retrieved from org - y\nor you want tool to create a project omnistudio_migration in current directory for processing - n ? [y/n]",
41
+ "enterProjectPath": "Enter the project path for processing %s :",
42
+ "projectJsonNotFound": "Could not find any %s in %s.",
43
+ "usingProjectPath": "Using project path: %s",
44
+ "enterTargetNamespace": "Enter the target namespace to be used for calling package Apex classes",
45
+ "usingTargetNamespace": "Using target namespace: %s for calling package Apex classes",
46
+ "cleaningComponent": "Cleaning: %s",
47
+ "cleaningDone": "Cleaning Done: %s",
48
+ "migratingComponent": "Migrating: %s",
49
+ "migrationCompleted": "Migration completed: %s",
50
+ "formulaSyntaxError": "There was some problem while updating the formula syntax, please check the all the formula's syntax once : %s",
51
+ "foundDataRaptorsToMigrate": "Found %s DataRaptors to migrate",
52
+ "foundFlexCardsToMigrate": "Found %s FlexCards to migrate",
53
+ "foundOmniScriptsToMigrate": "Found %s OmniScripts and Integration Procedures to migrate",
54
+ "allVersionsInfo": "allVersions : %s",
55
+ "migrationInitialization": "Migration Initialization: Using namespace: %s",
56
+ "apiVersionInfo": "API Version: %s",
57
+ "migrationTargets": "Migration targets: %s",
58
+ "relatedObjectsInfo": "Related objects: %s",
59
+ "allVersionsFlagInfo": "All versions: %s",
60
+ "startingApexMigration": "Starting Apex migration in project path: %s",
61
+ "processingApexFilesForMigration": "Processing Apex files for migration",
62
+ "successfullyProcessedApexFilesForMigration": "Successfully processed %s Apex files for migration",
63
+ "apexMigrationResults": "Apex migration results: %s",
64
+ "startingLwcMigration": "Starting LWC migration in project path: %s",
65
+ "processingLwcsForMigration": "Processing LWCs for migration",
66
+ "successfullyProcessedLwcsForMigration": "Successfully processed %s LWCs for migration",
67
+ "lwcMigrationResults": "LWC migration results: %s",
68
+ "inApexDrNameWillBeUpdatedMigration": "In Apex %s DR name %s will be updated to %s",
69
+ "retrievingMetadata": "Retrieving metadata for %s in project path: %s",
70
+ "creatingProject": "Creating project %s",
71
+ "projectCreated": "Project %s created",
72
+ "metadataRetrieved": "Metadata %s retrieved from %s",
73
+ "deployingMetadata": "Deploying metadata %s to %s",
74
+ "metadataDeployed": "Metadata %s deployed to %s",
75
+ "sfProjectCommandError": "Error executing command: %s",
76
+ "dataRaptorNameChangeMessage": "DataRaptor reference {0} will be changed to {1} during migration.",
77
+ "integrationProcedureNameChangeMessage": "Integration Procedure reference {0} will be changed to {1} during migration.",
78
+ "integrationProcedureManualUpdateMessage": "Integration Procedure reference {0} may need manual updates after migration.",
79
+ "alreadyStandardModel": "The org is already on standard data model.",
80
+ "cardAuthorNameChangeMessage": "Card author name has been modified to fit naming rules: {0}",
81
+ "cardNameChangeMessage": "Card name has been modified to fit naming rules: {0}",
82
+ "duplicateCardNameMessage": "Potential duplicate: Another card has the same name {0} after name cleaning. This may cause conflicts during migration"
33
83
  }