@sap/artifact-management 1.25.0 → 1.26.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 (42) hide show
  1. package/dist/projectapi.js +1 -1
  2. package/dist/projectapi.js.LICENSE.txt +139 -0
  3. package/dist/src/cp/CFProjectBuilder.js +20 -6
  4. package/dist/src/cp/CFProjectBuilder.js.map +1 -1
  5. package/dist/src/cp/templates/launchpad-ui5-app-template/package.json +1 -1
  6. package/dist/src/plugins/cap/generators/CapDestinationModuleGenerator.js +1 -0
  7. package/dist/src/plugins/cap/generators/CapDestinationModuleGenerator.js.map +1 -1
  8. package/dist/src/plugins/cap/generators/CapProjectGenerator.js +15 -0
  9. package/dist/src/plugins/cap/generators/CapProjectGenerator.js.map +1 -1
  10. package/dist/src/plugins/cap/readers/CapModuleReader.js +9 -1
  11. package/dist/src/plugins/cap/readers/CapModuleReader.js.map +1 -1
  12. package/dist/src/plugins/cap/readers/calculation-view/CalculationViewItemReader.js +446 -0
  13. package/dist/src/plugins/cap/readers/calculation-view/CalculationViewItemReader.js.map +1 -0
  14. package/dist/src/plugins/cap/readers/calculation-view/model/XmlReader.js +406 -0
  15. package/dist/src/plugins/cap/readers/calculation-view/model/XmlReader.js.map +1 -0
  16. package/dist/src/plugins/cap/readers/calculation-view/model/common.js +101 -0
  17. package/dist/src/plugins/cap/readers/calculation-view/model/common.js.map +1 -0
  18. package/dist/src/plugins/cap/readers/calculation-view/model/model.js +858 -0
  19. package/dist/src/plugins/cap/readers/calculation-view/model/model.js.map +1 -0
  20. package/dist/src/plugins/cap/readers/calculation-view/model/modelbase.js +387 -0
  21. package/dist/src/plugins/cap/readers/calculation-view/model/modelbase.js.map +1 -0
  22. package/dist/src/plugins/cap/readers/calculation-view/model/sharedmodel.js +96 -0
  23. package/dist/src/plugins/cap/readers/calculation-view/model/sharedmodel.js.map +1 -0
  24. package/dist/src/plugins/cap/readers/calculation-view/viewmodel/CalculationViewXmlParser.js +2278 -0
  25. package/dist/src/plugins/cap/readers/calculation-view/viewmodel/CalculationViewXmlParser.js.map +1 -0
  26. package/dist/src/plugins/cap/readers/calculation-view/viewmodel/CalculationViewXmlParserHelper.js +194 -0
  27. package/dist/src/plugins/cap/readers/calculation-view/viewmodel/CalculationViewXmlParserHelper.js.map +1 -0
  28. package/dist/src/project-api/ProjectImpl.js +37 -2
  29. package/dist/src/project-api/ProjectImpl.js.map +1 -1
  30. package/dist/templates/launchpad-ui5-app-template/package.json +1 -1
  31. package/dist/tsconfig.tsbuildinfo +115 -29
  32. package/dist/types/src/cp/CFProjectBuilder.d.ts +1 -1
  33. package/dist/types/src/plugins/cap/readers/calculation-view/CalculationViewItemReader.d.ts +33 -0
  34. package/dist/types/src/plugins/cap/readers/calculation-view/model/XmlReader.d.ts +38 -0
  35. package/dist/types/src/plugins/cap/readers/calculation-view/model/common.d.ts +44 -0
  36. package/dist/types/src/plugins/cap/readers/calculation-view/model/model.d.ts +401 -0
  37. package/dist/types/src/plugins/cap/readers/calculation-view/model/modelbase.d.ts +105 -0
  38. package/dist/types/src/plugins/cap/readers/calculation-view/model/sharedmodel.d.ts +33 -0
  39. package/dist/types/src/plugins/cap/readers/calculation-view/viewmodel/CalculationViewXmlParser.d.ts +62 -0
  40. package/dist/types/src/plugins/cap/readers/calculation-view/viewmodel/CalculationViewXmlParserHelper.d.ts +14 -0
  41. package/dist/types/src/project-api/ProjectImpl.d.ts +2 -0
  42. package/package.json +6 -5
@@ -0,0 +1,406 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //@ts-nocheck
7
+ const common_1 = __importDefault(require("./common"));
8
+ const common_2 = require("./common");
9
+ // let Element = require('xmldom').Element;
10
+ // import Element from 'xmldom';
11
+ const jsdom_1 = require("jsdom");
12
+ // import { Node } from 'jsdom/lib/jsdom/browser';
13
+ // const { JSDOM } = require('jsdom');
14
+ const { window } = new jsdom_1.JSDOM('<!doctype html><html><body></body></html>', {
15
+ url: 'http://localhost',
16
+ });
17
+ global.window = window;
18
+ global.document = window.document;
19
+ global.DOMParser = window.DOMParser;
20
+ global.Element = window.Element;
21
+ class XmlReader {
22
+ constructor(xmlDocument, fixMixedLineEndings, forceLineEndings) {
23
+ this.documentProperties = this.createDocumentProperties(xmlDocument);
24
+ if (typeof xmlDocument === 'string') {
25
+ if (fixMixedLineEndings && this.documentProperties.hasMixedLineEndings) {
26
+ xmlDocument = this.fixLineEndings(xmlDocument, forceLineEndings ? forceLineEndings : this.documentProperties.detectedLineEndings);
27
+ this.documentProperties.fixedContent = xmlDocument;
28
+ }
29
+ this._xmlDocument = this.parseDocument(xmlDocument);
30
+ }
31
+ else {
32
+ this._xmlDocument = xmlDocument;
33
+ }
34
+ this._hasMovedDown = false;
35
+ this._current = this._xmlDocument;
36
+ this.skippedNodes = new common_2.SkippedNodes();
37
+ this._skippedNodesStack = [];
38
+ this._removePrefixFunctions = {};
39
+ this._isRead = false;
40
+ this.context = {};
41
+ }
42
+ checkParserError(document) {
43
+ if (!document || !document.documentElement) {
44
+ throw new common_2.XmlReaderException(undefined, 'unknown parser error');
45
+ }
46
+ // Legacy IE
47
+ if (document.parseError && document.parseError.errorCode !== 0) {
48
+ throw new common_2.XmlReaderException(undefined, document.parseError);
49
+ }
50
+ // Firefox
51
+ if (document.documentElement.tagName === 'parsererror') {
52
+ throw new common_2.XmlReaderException(undefined, document.documentElement.firstChild.nodeValue);
53
+ }
54
+ // Chrome
55
+ if (document.getElementsByTagName('parsererror').length > 0) {
56
+ const errorElement = document.getElementsByTagName('parsererror')[0];
57
+ let errorMessage = errorElement.textContent + '\n';
58
+ if (errorElement.nextElementSibling) {
59
+ errorMessage += new XMLSerializer().serializeToString(errorElement.nextElementSibling);
60
+ }
61
+ throw new common_2.XmlReaderException(errorElement.parentElement, errorMessage);
62
+ }
63
+ }
64
+ parseDocument(content) {
65
+ // var DOMParser = require('xmldom').DOMParser;
66
+ const parser = new DOMParser();
67
+ let result;
68
+ try {
69
+ result = parser.parseFromString(content, 'text/xml');
70
+ }
71
+ catch (e) {
72
+ // IE9+
73
+ throw new common_2.XmlReaderException(undefined, e.toString());
74
+ }
75
+ this.checkParserError(result);
76
+ return result;
77
+ }
78
+ // Detect line endings based on the first occurrence
79
+ detectLineEndings(content, props) {
80
+ const cr = '\r';
81
+ const lf = '\n';
82
+ const crlf = '\r\n';
83
+ let pos = 0;
84
+ props.hasMixedLineEndings = true;
85
+ while (true) {
86
+ pos = content.indexOf(lf, pos);
87
+ if (pos < 0) {
88
+ props.hasMixedLineEndings = false;
89
+ return;
90
+ }
91
+ if (content.charAt(pos - 1) === cr) {
92
+ if (props.detectedLineEndings === lf) {
93
+ return;
94
+ }
95
+ else {
96
+ props.detectedLineEndings = crlf;
97
+ }
98
+ }
99
+ else {
100
+ if (props.detectedLineEndings === crlf) {
101
+ return;
102
+ }
103
+ else {
104
+ props.detectedLineEndings = lf;
105
+ }
106
+ }
107
+ pos++;
108
+ }
109
+ }
110
+ createDocumentProperties(content) {
111
+ const props = new common_2.DocumentProperties();
112
+ if (typeof content === 'string') {
113
+ this.detectLineEndings(content, props);
114
+ const spacesBefore = content.match(/\?>(\s+)/);
115
+ if (spacesBefore && spacesBefore.length === 2) {
116
+ props.spacesBeforeDocumentElement = spacesBefore[1];
117
+ }
118
+ const spacesAfter = content.match(/\s+$/);
119
+ if (spacesAfter && spacesAfter.length === 1) {
120
+ props.spacesAfterDocumentElement = spacesAfter[0];
121
+ }
122
+ }
123
+ return props;
124
+ }
125
+ fixLineEndings(content, targetEndings) {
126
+ return content.replace(/\r\n|\n/g, targetEndings);
127
+ }
128
+ _getParentSkippedNodes() {
129
+ return this._skippedNodesStack[this._skippedNodesStack.length - 1];
130
+ }
131
+ removePrefix(namespace, value) {
132
+ let func = this._removePrefixFunctions[namespace];
133
+ if (!func) {
134
+ func = (val) => {
135
+ const prefix = this._xmlDocument.lookupPrefix(namespace);
136
+ const regex = new RegExp(`^${prefix}:`);
137
+ return val.replace(regex, '');
138
+ };
139
+ this._removePrefixFunctions[namespace] = func;
140
+ }
141
+ return func(value);
142
+ }
143
+ _tryMoveTo(name, namespace, match, doConsume) {
144
+ if (this._isRead) {
145
+ return false;
146
+ }
147
+ let i = 0;
148
+ const qualifiedName = namespace ? `${this._xmlDocument.lookupPrefix(namespace)}:${name}` : name;
149
+ let nextNode = this._current;
150
+ const skippedDomNodes = [];
151
+ let found = false;
152
+ let parentSkippedNodes, skippedDomNode, attribute;
153
+ do {
154
+ if (nextNode instanceof Element && nextNode.nodeName === qualifiedName && (!match || match(nextNode))) {
155
+ if (nextNode !== this._current) {
156
+ this._hasMovedDown = false;
157
+ }
158
+ this._current = nextNode;
159
+ // Store skipped nodes only if target element was found
160
+ this.skippedNodes = new common_2.SkippedNodes(qualifiedName);
161
+ if (!doConsume) {
162
+ parentSkippedNodes = this._getParentSkippedNodes();
163
+ if (parentSkippedNodes.intermediateElements[qualifiedName]) {
164
+ throw new common_2.XmlReaderException(this._current, `intermediate child with same name already found in ${parentSkippedNodes.nodeName}`);
165
+ }
166
+ parentSkippedNodes.intermediateElements[qualifiedName] = this.skippedNodes;
167
+ }
168
+ for (const item of skippedDomNodes) {
169
+ if (item) {
170
+ skippedDomNode = item;
171
+ if (skippedDomNode.parentNode) {
172
+ skippedDomNode.parentNode.removeChild(skippedDomNode);
173
+ }
174
+ this.skippedNodes.nodesBefore.push(skippedDomNode);
175
+ }
176
+ }
177
+ if (this._current instanceof Element) {
178
+ for (i = 0; i < this._current.attributes.length; i++) {
179
+ attribute = this._current.attributes[i];
180
+ if (common_1.default.XMLNS_REGEX.test(attribute.name)) {
181
+ this.skippedNodes.xmlnsAttributes.push({
182
+ name: attribute.name,
183
+ value: attribute.value,
184
+ });
185
+ }
186
+ else {
187
+ this.skippedNodes.attributeNames.push(attribute.name);
188
+ }
189
+ }
190
+ }
191
+ if (common_1.default.isMSXML()) {
192
+ // IE stores attributes in reverse order
193
+ this.skippedNodes.attributeNames.reverse();
194
+ }
195
+ found = true;
196
+ }
197
+ else {
198
+ if (nextNode) {
199
+ skippedDomNodes.push(nextNode);
200
+ nextNode = nextNode.nextSibling;
201
+ }
202
+ }
203
+ } while (nextNode && !found);
204
+ return found;
205
+ }
206
+ tryMoveTo(name, namespace, match) {
207
+ return this._tryMoveTo(name, namespace || '', match, true);
208
+ }
209
+ tryMoveToIntermediate(name, namespace, match) {
210
+ return this._tryMoveTo(name, namespace || '', match, false);
211
+ }
212
+ moveToIntermediate(name, namespace, match) {
213
+ if (!this.tryMoveToIntermediate(name, namespace, match)) {
214
+ throw new common_2.XmlReaderException(this._current, `sibling element ${name} not found`);
215
+ }
216
+ return this;
217
+ }
218
+ moveTo(name, namespace, match) {
219
+ if (!this.tryMoveTo(name, namespace, match)) {
220
+ throw new common_2.XmlReaderException(this._current, `sibling element ${name} not found`);
221
+ }
222
+ return this;
223
+ }
224
+ tryMoveDown() {
225
+ if (this._isRead || !this._current || !this._current.firstChild) {
226
+ return false;
227
+ }
228
+ if (!this.skippedNodes) {
229
+ throw new common_2.XmlReaderException(this._current, 'cannot move down w/o visiting an element');
230
+ }
231
+ this._hasMovedDown = true;
232
+ this._current = this._current.firstChild;
233
+ this._skippedNodesStack.push(this.skippedNodes);
234
+ this.skippedNodes = undefined;
235
+ this._isRead = false;
236
+ return true;
237
+ }
238
+ moveUp() {
239
+ let parent;
240
+ if (this._current) {
241
+ parent = this._current.parentNode;
242
+ }
243
+ if (!parent) {
244
+ throw new common_2.XmlReaderException(this._current, 'cannot move up from this element');
245
+ }
246
+ const lastSkippedNodes = this.skippedNodes;
247
+ this.skippedNodes = this._skippedNodesStack.pop();
248
+ if (!this._isRead) {
249
+ const skippedNodes = lastSkippedNodes ? lastSkippedNodes.nodesAfter : this.skippedNodes.childNodes;
250
+ while (this._current) {
251
+ const nextSibling = this._current.nextSibling;
252
+ skippedNodes.push(this._current);
253
+ if (this._current.parentNode) {
254
+ this._current.parentNode.removeChild(this._current);
255
+ }
256
+ this._current = nextSibling;
257
+ }
258
+ }
259
+ this._hasMovedDown = true;
260
+ this._current = parent;
261
+ this._isRead = false;
262
+ return this;
263
+ }
264
+ moveDown() {
265
+ if (!this.tryMoveDown()) {
266
+ throw new common_2.XmlReaderException(this._current, 'cannot move down from this element');
267
+ }
268
+ return this;
269
+ }
270
+ skipChildren() {
271
+ if (this.tryMoveDown()) {
272
+ this.moveUp();
273
+ }
274
+ return this;
275
+ }
276
+ next() {
277
+ let nextChild, nextNextChild, nextSibling;
278
+ if (this._isRead) {
279
+ throw new common_2.XmlReaderException(this._current, 'cannot move from this element');
280
+ }
281
+ if (!this._hasMovedDown && this._current) {
282
+ nextChild = this._current.firstChild;
283
+ while (nextChild) {
284
+ nextNextChild = nextChild.nextSibling;
285
+ this._current.removeChild(nextChild);
286
+ this.skippedNodes.childNodes.push(nextChild);
287
+ nextChild = nextNextChild;
288
+ }
289
+ }
290
+ if (this._current) {
291
+ nextSibling = this._current.nextSibling;
292
+ }
293
+ if (nextSibling) {
294
+ this._hasMovedDown = false;
295
+ this._current = nextSibling;
296
+ }
297
+ else {
298
+ this._isRead = true;
299
+ }
300
+ return this;
301
+ }
302
+ buildAttributes(attributeMapping, existingProperties) {
303
+ if (this._isRead) {
304
+ throw new common_2.XmlReaderException(this._current, 'cannot build attributes, already moved away from current element');
305
+ }
306
+ if (!(this._current instanceof Element)) {
307
+ throw new common_2.XmlReaderException(this._current, 'cannot build attributes, current node is not an element node');
308
+ }
309
+ const node = this._current;
310
+ const skippedNodes = this.skippedNodes;
311
+ const properties = existingProperties ? existingProperties : {};
312
+ let attrValue = null;
313
+ for (const propName in attributeMapping) {
314
+ if (!attributeMapping.hasOwnProperty(propName)) {
315
+ continue;
316
+ }
317
+ const selectorObj = common_1.default.parseSelector(attributeMapping[propName]);
318
+ if (selectorObj.hasOwnProperty('value')) {
319
+ // Fixed value
320
+ attrValue = selectorObj.value;
321
+ }
322
+ else {
323
+ attrValue = undefined;
324
+ if (selectorObj.namespace) {
325
+ if (node.hasAttributeNS(selectorObj.namespace, selectorObj.name)) {
326
+ attrValue = node.getAttributeNS(selectorObj.namespace, selectorObj.name);
327
+ node.removeAttributeNS(selectorObj.namespace, selectorObj.name);
328
+ }
329
+ }
330
+ else {
331
+ if (node.hasAttribute(selectorObj.name)) {
332
+ attrValue = node.getAttribute(selectorObj.name);
333
+ node.removeAttribute(selectorObj.name);
334
+ }
335
+ }
336
+ if (typeof attrValue !== 'undefined' && selectorObj.valueMapper) {
337
+ attrValue = selectorObj.valueMapper(attrValue);
338
+ }
339
+ }
340
+ if (typeof attrValue !== 'undefined') {
341
+ properties[propName] = attrValue;
342
+ }
343
+ }
344
+ for (let i = 0; i < node.attributes.length; i++) {
345
+ const attribute = node.attributes.item(i);
346
+ if (attribute) {
347
+ if (!common_1.default.XMLNS_REGEX.test(attribute.name)) {
348
+ skippedNodes.attributes[attribute.name] = attribute.value;
349
+ }
350
+ }
351
+ }
352
+ return properties;
353
+ }
354
+ getAttribute(name, namespace) {
355
+ if (this._isRead) {
356
+ throw new common_2.XmlReaderException(this._current, 'cannot get attribute, already moved away from current element');
357
+ }
358
+ let val = null;
359
+ if (this._current instanceof Element) {
360
+ if (namespace) {
361
+ val = this._current.getAttributeNS(namespace, name);
362
+ }
363
+ else {
364
+ val = this._current.getAttribute(name);
365
+ }
366
+ }
367
+ return val;
368
+ }
369
+ consumeAttribute(name, namespace) {
370
+ if (this._isRead) {
371
+ throw new common_2.XmlReaderException(this._current, 'cannot consume attribute, already moved away from current element');
372
+ }
373
+ let val = null;
374
+ if (this._current instanceof Element) {
375
+ if (namespace) {
376
+ val = this._current.getAttributeNS(namespace, name);
377
+ this._current.removeAttributeNS(namespace, name);
378
+ }
379
+ else {
380
+ val = this._current.getAttribute(name);
381
+ this._current.removeAttribute(name);
382
+ }
383
+ }
384
+ return val;
385
+ }
386
+ getContent() {
387
+ if (this._isRead) {
388
+ throw new common_2.XmlReaderException(this._current, 'cannot get content, already moved away from current element');
389
+ }
390
+ if (this._current) {
391
+ return this._current.textContent;
392
+ }
393
+ }
394
+ consumeContent() {
395
+ if (this._isRead) {
396
+ throw new common_2.XmlReaderException(this._current, 'cannot consume content, already moved away from current element');
397
+ }
398
+ if (this._current) {
399
+ const result = this._current.textContent;
400
+ this._current.textContent = null;
401
+ return result;
402
+ }
403
+ }
404
+ }
405
+ exports.default = XmlReader;
406
+ //# sourceMappingURL=XmlReader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XmlReader.js","sourceRoot":"","sources":["../../../../../../../src/plugins/cap/readers/calculation-view/model/XmlReader.ts"],"names":[],"mappings":";;;;;AAAA,aAAa;AACb,sDAA4B;AAC5B,qCAA8E;AAE9E,2CAA2C;AAC3C,gCAAgC;AAChC,iCAA8B;AAC9B,kDAAkD;AAClD,sCAAsC;AAEtC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,aAAK,CAAC,2CAA2C,EAAE;IACtE,GAAG,EAAE,kBAAkB;CAC1B,CAAC,CAAC;AAEF,MAAc,CAAC,MAAM,GAAG,MAAM,CAAC;AAC/B,MAAc,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC1C,MAAc,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5C,MAAc,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AAOzC,MAAqB,SAAS;IA6Y1B,YAAY,WAA0B,EAAE,mBAA2B,EAAE,gBAAyB;QAC1F,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC;QACrE,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YACjC,IAAI,mBAAmB,IAAI,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,EAAE;gBACpE,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,C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aACnD;SACJ;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IAED,UAAU;QACN,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,MAAM,IAAI,2BAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,6DAA6D,CAAC,CAAC;SAC9G;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;SACpC;IACL,CAAC;IAED,cAAc;QACV,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,MAAM,IAAI,2BAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,iEAAiE,CAAC,CAAC;SAClH;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;YACzC,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC;YACjC,OAAO,MAAM,CAAC;SACjB;IACL,CAAC;CAqBJ;AAhaD,4BAgaC"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.XmlReaderException = exports.DocumentProperties = exports.SkippedNodes = void 0;
4
+ class Util {
5
+ static createSelectorNS(name, namespace, valueMapper) {
6
+ return {
7
+ name: name,
8
+ namespace: namespace ? namespace : undefined,
9
+ valueMapper: valueMapper ? valueMapper : undefined,
10
+ };
11
+ }
12
+ static isMSXML() {
13
+ try {
14
+ new ActiveXObject('Microsoft.XMLDOM');
15
+ return true;
16
+ }
17
+ catch (e) {
18
+ return false;
19
+ }
20
+ }
21
+ static parseInt(value) {
22
+ return parseInt(value, 10);
23
+ }
24
+ static parseBool(value) {
25
+ return value === 'true';
26
+ }
27
+ static createIntSelector(name) {
28
+ return this.createSelectorNS(name, '', this.parseInt);
29
+ }
30
+ static createBoolSelector(name) {
31
+ return this.createSelectorNS(name, '', this.parseBool);
32
+ }
33
+ static createSelector(name, valueMapper) {
34
+ return this.createSelectorNS(name, '', valueMapper);
35
+ }
36
+ static createXsiSelector(name, valueMapper) {
37
+ return this.createSelectorNS(name, this.XSI_NS, valueMapper);
38
+ }
39
+ static parseSelector(selector) {
40
+ let selectorObj = {};
41
+ switch (typeof selector) {
42
+ case 'object':
43
+ selectorObj = selector;
44
+ break;
45
+ case 'string':
46
+ const matches = Util.SELECTOR_REGEX.exec(selector);
47
+ if (!matches) {
48
+ // fixed value
49
+ selectorObj.value = selector;
50
+ }
51
+ else {
52
+ // attribute selector enclosed by {}
53
+ selectorObj.name = matches[1];
54
+ }
55
+ break;
56
+ default:
57
+ selectorObj.value = selector;
58
+ }
59
+ return selectorObj;
60
+ }
61
+ }
62
+ exports.default = Util;
63
+ Util.XSI_NS = 'http://www.w3.org/2001/XMLSchema-instance';
64
+ Util.XML_NS = 'http://www.w3.org/2000/xmlns/';
65
+ Util.XMLNS_PREFIX = 'xmlns:';
66
+ Util.XMLNS_REGEX = new RegExp('^xmlns:');
67
+ Util.SELECTOR_REGEX = new RegExp('^{(\\w+)}$');
68
+ class SkippedNodes {
69
+ constructor(nodeName) {
70
+ this.xmlnsAttributes = [];
71
+ this.attributes = {};
72
+ this.attributeNames = []; // Ensures stable order of attributes, includes also names of consumed attributes
73
+ this.nodesBefore = [];
74
+ this.childNodes = [];
75
+ this.nodesAfter = [];
76
+ this.intermediateElements = {};
77
+ this.nodeName = nodeName;
78
+ }
79
+ }
80
+ exports.SkippedNodes = SkippedNodes;
81
+ class DocumentProperties {
82
+ constructor() {
83
+ this.detectedLineEndings = '';
84
+ this.hasMixedLineEndings = false;
85
+ this.spacesBeforeDocumentElement = '';
86
+ this.spacesAfterDocumentElement = '';
87
+ }
88
+ }
89
+ exports.DocumentProperties = DocumentProperties;
90
+ class XmlReaderException extends Error {
91
+ constructor(node, message) {
92
+ super();
93
+ this.name = 'XmlReaderException';
94
+ this.message = node ? `${node.nodeName} - ${message}` : message;
95
+ }
96
+ toString() {
97
+ return `${this.name}: ${this.message}`;
98
+ }
99
+ }
100
+ exports.XmlReaderException = XmlReaderException;
101
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../../../src/plugins/cap/readers/calculation-view/model/common.ts"],"names":[],"mappings":";;;AAOA,MAA8B,IAAI;IAQtB,MAAM,CAAC,gBAAgB,CAAC,IAAY,EAAE,SAAiB,EAAE,WAAgB;QAC7E,OAAO;YACH,IAAI,EAAE,IAAI;YACV,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;YAC5C,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;SACrD,CAAC;IACN,CAAC;IAEM,MAAM,CAAC,OAAO;QACjB,IAAI;YACA,IAAI,aAAa,CAAE,kBAAkB,CAAE,CAAC;YACxC,OAAO,IAAI,CAAC;SACf;QAAC,OAAQ,CAAC,EAAG;YACV,OAAO,KAAK,CAAC;SAChB;IACL,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAa;QAChC,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,KAAa;QACjC,OAAO,KAAK,KAAK,MAAM,CAAC;IAC5B,CAAC;IAEM,MAAM,CAAC,iBAAiB,CAAC,IAAY;QACxC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1D,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAAC,IAAY;QACzC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAEM,MAAM,CAAC,cAAc,CAAC,IAAY,EAAE,WAAgB;QACvD,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,WAAW,CAAC,C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