@sap-ux/xml-odata-annotation-converter 0.1.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.
- package/LICENSE +201 -0
- package/README.md +55 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/attribute-getters.d.ts +18 -0
- package/dist/parser/attribute-getters.d.ts.map +1 -0
- package/dist/parser/attribute-getters.js +28 -0
- package/dist/parser/attribute-getters.js.map +1 -0
- package/dist/parser/document.d.ts +11 -0
- package/dist/parser/document.d.ts.map +1 -0
- package/dist/parser/document.js +325 -0
- package/dist/parser/document.js.map +1 -0
- package/dist/parser/element-getters.d.ts +10 -0
- package/dist/parser/element-getters.d.ts.map +1 -0
- package/dist/parser/element-getters.js +15 -0
- package/dist/parser/element-getters.js.map +1 -0
- package/dist/parser/escaping.d.ts +8 -0
- package/dist/parser/escaping.d.ts.map +1 -0
- package/dist/parser/escaping.js +21 -0
- package/dist/parser/escaping.js.map +1 -0
- package/dist/parser/index.d.ts +4 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +10 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/metadata.d.ts +11 -0
- package/dist/parser/metadata.d.ts.map +1 -0
- package/dist/parser/metadata.js +515 -0
- package/dist/parser/metadata.js.map +1 -0
- package/dist/parser/range.d.ts +37 -0
- package/dist/parser/range.d.ts.map +1 -0
- package/dist/parser/range.js +67 -0
- package/dist/parser/range.js.map +1 -0
- package/dist/printer/builders.d.ts +49 -0
- package/dist/printer/builders.d.ts.map +1 -0
- package/dist/printer/builders.js +138 -0
- package/dist/printer/builders.js.map +1 -0
- package/dist/printer/csdl-to-xml.d.ts +23 -0
- package/dist/printer/csdl-to-xml.d.ts.map +1 -0
- package/dist/printer/csdl-to-xml.js +160 -0
- package/dist/printer/csdl-to-xml.js.map +1 -0
- package/dist/printer/document-modifier.d.ts +6 -0
- package/dist/printer/document-modifier.d.ts.map +1 -0
- package/dist/printer/document-modifier.js +47 -0
- package/dist/printer/document-modifier.js.map +1 -0
- package/dist/printer/index.d.ts +5 -0
- package/dist/printer/index.d.ts.map +1 -0
- package/dist/printer/index.js +31 -0
- package/dist/printer/index.js.map +1 -0
- package/dist/printer/namespaces.d.ts +3 -0
- package/dist/printer/namespaces.d.ts.map +1 -0
- package/dist/printer/namespaces.js +6 -0
- package/dist/printer/namespaces.js.map +1 -0
- package/dist/printer/serializer-edmx.d.ts +46 -0
- package/dist/printer/serializer-edmx.d.ts.map +1 -0
- package/dist/printer/serializer-edmx.js +214 -0
- package/dist/printer/serializer-edmx.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertDocument = void 0;
|
|
4
|
+
const odata_annotation_core_1 = require("@sap-ux/odata-annotation-core");
|
|
5
|
+
const range_1 = require("./range");
|
|
6
|
+
const element_getters_1 = require("./element-getters");
|
|
7
|
+
const attribute_getters_1 = require("./attribute-getters");
|
|
8
|
+
const escaping_1 = require("./escaping");
|
|
9
|
+
/**
|
|
10
|
+
* Convert AST of an XML document to annotation document.
|
|
11
|
+
*
|
|
12
|
+
* @param uri Uri of the document.
|
|
13
|
+
* @param ast XML document containing annotations.
|
|
14
|
+
* @returns annotation file.
|
|
15
|
+
*/
|
|
16
|
+
function convertDocument(uri, ast) {
|
|
17
|
+
if (ast.rootElement) {
|
|
18
|
+
const dataServices = (0, element_getters_1.getElementsWithName)('DataServices', ast.rootElement);
|
|
19
|
+
const schemas = dataServices.length ? (0, element_getters_1.getElementsWithName)('Schema', dataServices[0]) : [];
|
|
20
|
+
const targets = schemas.reduce((acc, schema) => [...acc, ...convertSchema(schema)], []);
|
|
21
|
+
const range = (0, range_1.transformElementRange)(ast.rootElement.position, ast.rootElement);
|
|
22
|
+
const contentRange = (0, range_1.getGapRangeBetween)(ast.rootElement.syntax.openBody, ast.rootElement.syntax.closeName);
|
|
23
|
+
const references = convertReferences(ast.rootElement);
|
|
24
|
+
if (range) {
|
|
25
|
+
const namespace = createNamespace(schemas[0]);
|
|
26
|
+
const file = {
|
|
27
|
+
type: 'annotation-file',
|
|
28
|
+
uri,
|
|
29
|
+
range,
|
|
30
|
+
references,
|
|
31
|
+
targets
|
|
32
|
+
};
|
|
33
|
+
if (contentRange) {
|
|
34
|
+
file.contentRange = contentRange;
|
|
35
|
+
}
|
|
36
|
+
if (namespace) {
|
|
37
|
+
file.namespace = namespace;
|
|
38
|
+
}
|
|
39
|
+
return file;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
type: 'annotation-file',
|
|
44
|
+
uri,
|
|
45
|
+
range: undefined,
|
|
46
|
+
contentRange: undefined,
|
|
47
|
+
references: [],
|
|
48
|
+
targets: []
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
exports.convertDocument = convertDocument;
|
|
52
|
+
/**
|
|
53
|
+
* Creates namespace object.
|
|
54
|
+
*
|
|
55
|
+
* @param schema schema XML element
|
|
56
|
+
* @returns Namespace object
|
|
57
|
+
*/
|
|
58
|
+
function createNamespace(schema) {
|
|
59
|
+
var _a;
|
|
60
|
+
if (!schema) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const namespace = (0, attribute_getters_1.getElementAttributeByName)('Namespace', schema);
|
|
64
|
+
const alias = (0, attribute_getters_1.getElementAttributeByName)('Alias', schema);
|
|
65
|
+
if (!(namespace === null || namespace === void 0 ? void 0 : namespace.value)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const currentNamespace = {
|
|
69
|
+
type: 'namespace',
|
|
70
|
+
name: namespace.value,
|
|
71
|
+
range: (0, range_1.transformElementRange)(schema.position, schema),
|
|
72
|
+
nameRange: (0, range_1.transformRange)(namespace.syntax.value)
|
|
73
|
+
};
|
|
74
|
+
const contentRange = schema.syntax.openBody && schema.syntax.closeName
|
|
75
|
+
? (0, range_1.getGapRangeBetween)(schema.syntax.openBody, schema.syntax.closeName)
|
|
76
|
+
: undefined;
|
|
77
|
+
if (contentRange) {
|
|
78
|
+
currentNamespace.contentRange = contentRange;
|
|
79
|
+
}
|
|
80
|
+
if (currentNamespace.nameRange) {
|
|
81
|
+
(0, range_1.adjustRange)(currentNamespace.nameRange, 1, -1);
|
|
82
|
+
}
|
|
83
|
+
if (alias) {
|
|
84
|
+
currentNamespace.alias = (_a = alias.value) !== null && _a !== void 0 ? _a : '';
|
|
85
|
+
currentNamespace.aliasRange = (0, range_1.transformRange)(alias.syntax.value);
|
|
86
|
+
if (currentNamespace.aliasRange) {
|
|
87
|
+
(0, range_1.adjustRange)(currentNamespace.aliasRange, 1, -1);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return currentNamespace;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Creates reference object from XML element.
|
|
94
|
+
*
|
|
95
|
+
* @param element EDMX XML Element
|
|
96
|
+
* @returns references contained in the XML element
|
|
97
|
+
*/
|
|
98
|
+
function convertReferences(element) {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
const referenceElements = (0, element_getters_1.getElementsWithName)('Reference', element);
|
|
101
|
+
const references = [];
|
|
102
|
+
for (const referenceElement of referenceElements) {
|
|
103
|
+
const uri = (_b = (_a = (0, attribute_getters_1.getElementAttributeByName)('Uri', referenceElement)) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : undefined;
|
|
104
|
+
const refRange = (0, range_1.transformRange)(referenceElement.position);
|
|
105
|
+
for (const namespaceElement of (0, element_getters_1.getElementsWithName)('Include', referenceElement)) {
|
|
106
|
+
const reference = createReference(namespaceElement, refRange, uri);
|
|
107
|
+
if (reference) {
|
|
108
|
+
references.push(reference);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return references;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Creates referece.
|
|
116
|
+
*
|
|
117
|
+
* @param namespaceElement namespace XML element
|
|
118
|
+
* @param range reference element range
|
|
119
|
+
* @param uri reference uri
|
|
120
|
+
* @returns reference object or undefined if namespace is not provided in the corresponding attribute
|
|
121
|
+
*/
|
|
122
|
+
function createReference(namespaceElement, range, uri) {
|
|
123
|
+
var _a;
|
|
124
|
+
const namespace = (0, attribute_getters_1.getElementAttributeByName)('Namespace', namespaceElement);
|
|
125
|
+
const alias = (0, attribute_getters_1.getElementAttributeByName)('Alias', namespaceElement);
|
|
126
|
+
if (!(namespace === null || namespace === void 0 ? void 0 : namespace.value)) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const reference = {
|
|
130
|
+
type: 'reference',
|
|
131
|
+
name: namespace.value,
|
|
132
|
+
nameRange: (0, range_1.transformRange)(namespace.syntax.value),
|
|
133
|
+
range,
|
|
134
|
+
uri
|
|
135
|
+
};
|
|
136
|
+
if (reference.nameRange) {
|
|
137
|
+
(0, range_1.adjustRange)(reference.nameRange, 1, -1);
|
|
138
|
+
}
|
|
139
|
+
if (alias) {
|
|
140
|
+
reference.alias = (_a = alias.value) !== null && _a !== void 0 ? _a : '';
|
|
141
|
+
reference.aliasRange = (0, range_1.transformRange)(alias.syntax.value);
|
|
142
|
+
if (reference.aliasRange) {
|
|
143
|
+
(0, range_1.adjustRange)(reference.aliasRange, 1, -1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return reference;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Converts schema.
|
|
150
|
+
*
|
|
151
|
+
* @param schema Schema XML Element
|
|
152
|
+
* @returns targets contained in the XML element
|
|
153
|
+
*/
|
|
154
|
+
function convertSchema(schema) {
|
|
155
|
+
var _a;
|
|
156
|
+
const targets = [];
|
|
157
|
+
const annotationsElements = (0, element_getters_1.getElementsWithName)("Annotations" /* Edm.Annotations */, schema);
|
|
158
|
+
for (const annotations of annotationsElements) {
|
|
159
|
+
const targetAttribute = (0, attribute_getters_1.getElementAttributeByName)('Target', annotations);
|
|
160
|
+
if (targetAttribute) {
|
|
161
|
+
const targetName = (_a = targetAttribute.value) !== null && _a !== void 0 ? _a : '';
|
|
162
|
+
const targetNamePosition = (0, range_1.transformRange)(targetAttribute.syntax.value);
|
|
163
|
+
if (targetNamePosition) {
|
|
164
|
+
(0, range_1.adjustRange)(targetNamePosition, 1, -1);
|
|
165
|
+
const terms = (0, element_getters_1.getElementsWithName)("Annotation" /* Edm.Annotation */, annotations)
|
|
166
|
+
.map(convertElement)
|
|
167
|
+
.filter((node) => (node === null || node === void 0 ? void 0 : node.type) === odata_annotation_core_1.ELEMENT_TYPE);
|
|
168
|
+
const termsRange = annotations.syntax.closeName
|
|
169
|
+
? (0, range_1.getGapRangeBetween)(annotations.syntax.openBody, annotations.syntax.closeName)
|
|
170
|
+
: undefined;
|
|
171
|
+
const range = (0, range_1.transformElementRange)(annotations.position, annotations);
|
|
172
|
+
const target = {
|
|
173
|
+
type: 'target',
|
|
174
|
+
name: targetName,
|
|
175
|
+
nameRange: targetNamePosition,
|
|
176
|
+
terms,
|
|
177
|
+
range,
|
|
178
|
+
termsRange
|
|
179
|
+
};
|
|
180
|
+
targets.push(target);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return targets;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Returns namespace details.
|
|
188
|
+
*
|
|
189
|
+
* @param element XML element
|
|
190
|
+
* @returns element default namespace if it exists
|
|
191
|
+
*/
|
|
192
|
+
function getNamespace(element) {
|
|
193
|
+
if (element.ns) {
|
|
194
|
+
const namespace = element.namespaces[element.ns];
|
|
195
|
+
if (namespace) {
|
|
196
|
+
return {
|
|
197
|
+
alias: element.ns,
|
|
198
|
+
uri: namespace
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return undefined;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Converts element.
|
|
206
|
+
*
|
|
207
|
+
* @param element XMLElement
|
|
208
|
+
* @returns generic annotation file Element
|
|
209
|
+
*/
|
|
210
|
+
function convertElement(element) {
|
|
211
|
+
var _a, _b, _c;
|
|
212
|
+
const range = (0, range_1.transformElementRange)(element.position, element);
|
|
213
|
+
const nameRange = getElementNameRange(element);
|
|
214
|
+
const contentRange = element.syntax.openBody && element.syntax.closeName
|
|
215
|
+
? (0, range_1.getGapRangeBetween)(element.syntax.openBody, element.syntax.closeName)
|
|
216
|
+
: undefined;
|
|
217
|
+
const namespace = getNamespace(element);
|
|
218
|
+
const textNodes = (_a = element.textContents) !== null && _a !== void 0 ? _a : [];
|
|
219
|
+
const elementNodes = (_b = element.subElements) !== null && _b !== void 0 ? _b : [];
|
|
220
|
+
const sortedContentNodes = [...textNodes, ...elementNodes].sort((a, b) => a.position.startOffset - b.position.endOffset);
|
|
221
|
+
// merge adjacent text fragments into solid text node
|
|
222
|
+
const children = mergeContentNodes(sortedContentNodes);
|
|
223
|
+
const attributes = element.attributes.reduce((acc, attribute) => {
|
|
224
|
+
if (!attribute.key) {
|
|
225
|
+
return acc;
|
|
226
|
+
}
|
|
227
|
+
const value = attribute.value ? (0, escaping_1.removeEscapeSequences)(attribute.value) : '';
|
|
228
|
+
const attributeNode = (0, odata_annotation_core_1.createAttributeNode)(attribute.key, value, (0, range_1.transformRange)(attribute.syntax.key), (0, range_1.transformRange)(attribute.syntax.value));
|
|
229
|
+
if (attributeNode.valueRange) {
|
|
230
|
+
(0, range_1.adjustRange)(attributeNode.valueRange, 1, -1);
|
|
231
|
+
}
|
|
232
|
+
acc[attribute.key] = attributeNode;
|
|
233
|
+
return acc;
|
|
234
|
+
}, {});
|
|
235
|
+
return (0, odata_annotation_core_1.createElementNode)({
|
|
236
|
+
name: (_c = element.name) !== null && _c !== void 0 ? _c : '',
|
|
237
|
+
range,
|
|
238
|
+
nameRange,
|
|
239
|
+
attributes,
|
|
240
|
+
content: children.nodes,
|
|
241
|
+
contentRange,
|
|
242
|
+
namespace: namespace === null || namespace === void 0 ? void 0 : namespace.uri,
|
|
243
|
+
namespaceAlias: namespace === null || namespace === void 0 ? void 0 : namespace.alias
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Returns element name range.
|
|
248
|
+
*
|
|
249
|
+
* @param element XML element
|
|
250
|
+
* @returns range
|
|
251
|
+
*/
|
|
252
|
+
function getElementNameRange(element) {
|
|
253
|
+
if (element.syntax.openName) {
|
|
254
|
+
return (0, range_1.transformRange)(element.syntax.openName);
|
|
255
|
+
}
|
|
256
|
+
if (element.name === null) {
|
|
257
|
+
if (element.syntax.openBody) {
|
|
258
|
+
// element name is missing: "< ></>"
|
|
259
|
+
const range = (0, range_1.transformRange)(element.syntax.openBody);
|
|
260
|
+
if (!range) {
|
|
261
|
+
return undefined;
|
|
262
|
+
}
|
|
263
|
+
// element name starts 1 character after "<"
|
|
264
|
+
range.start.character += 1;
|
|
265
|
+
// element name range should cover only the single character after "<"
|
|
266
|
+
range.end = odata_annotation_core_1.Position.create(range.start.line, range.start.character);
|
|
267
|
+
return range;
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
// closing bracket is missing: "<"
|
|
271
|
+
const range = (0, range_1.transformRange)(element.position);
|
|
272
|
+
if (!range) {
|
|
273
|
+
return undefined;
|
|
274
|
+
}
|
|
275
|
+
// name range should start after <, so we need to increment elements start range by 1
|
|
276
|
+
range.start.character++;
|
|
277
|
+
return range;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return undefined;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Converts text node.
|
|
284
|
+
*
|
|
285
|
+
* @param textNode XML text node
|
|
286
|
+
* @returns annotation file TextNode
|
|
287
|
+
*/
|
|
288
|
+
function convertTextNode(textNode) {
|
|
289
|
+
var _a;
|
|
290
|
+
const range = (0, range_1.transformRange)(textNode.position);
|
|
291
|
+
return (0, odata_annotation_core_1.createTextNode)((_a = textNode.text) !== null && _a !== void 0 ? _a : '', range);
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Merges content nodes.
|
|
295
|
+
*
|
|
296
|
+
* @param sortedContentNodes
|
|
297
|
+
* @returns merged nodes data
|
|
298
|
+
*/
|
|
299
|
+
function mergeContentNodes(sortedContentNodes) {
|
|
300
|
+
return sortedContentNodes.reduce((acc, child, index, array) => {
|
|
301
|
+
if (child.type === 'XMLTextContent') {
|
|
302
|
+
if (index + 1 < array.length && array[index + 1].type === 'XMLTextContent') {
|
|
303
|
+
acc.textNodes.push(child);
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
const [first, ...textNodes] = [...acc.textNodes, child];
|
|
307
|
+
const concatenatedTextNode = textNodes.reduce((accTextNode, textNode) => {
|
|
308
|
+
var _a, _b;
|
|
309
|
+
return Object.assign(Object.assign({}, accTextNode), { text: ((_a = accTextNode.text) !== null && _a !== void 0 ? _a : '') + ((_b = textNode.text) !== null && _b !== void 0 ? _b : ''), position: Object.assign(Object.assign({}, accTextNode.position), { endColumn: textNode.position.endColumn, endLine: textNode.position.endLine, endOffset: textNode.position.endOffset }) });
|
|
310
|
+
}, first);
|
|
311
|
+
acc.nodes.push(convertTextNode(concatenatedTextNode));
|
|
312
|
+
acc.textNodes = [];
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
else if (child.type === 'XMLElement') {
|
|
316
|
+
acc.nodes.push(convertElement(child));
|
|
317
|
+
}
|
|
318
|
+
return acc;
|
|
319
|
+
}, {
|
|
320
|
+
textNodes: [],
|
|
321
|
+
nodes: [],
|
|
322
|
+
diagnostics: []
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
//# sourceMappingURL=document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../src/parser/document.ts"],"names":[],"mappings":";;;AAcA,yEAOuC;AAEvC,mCAAiG;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GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;gBAExD,MAAM,oBAAoB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAkB,EAAE;;oBACpF,uCACO,WAAW,KACd,IAAI,EAAE,CAAC,MAAA,WAAW,CAAC,IAAI,mCAAI,EAAE,CAAC,GAAG,CAAC,MAAA,QAAQ,CAAC,IAAI,mCAAI,EAAE,CAAC,EACtD,QAAQ,kCACD,WAAW,CAAC,QAAQ,KACvB,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,SAAS,EACtC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAClC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,SAAS,OAE5C;gBACN,CAAC,EAAE,KAAK,CAAC,CAAC;gBAEV,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC;gBAEtD,GAAG,CAAC,SAAS,GAAG,EAAE,CAAC;aACtB;SACJ;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE;YACpC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;SACzC;QACD,OAAO,GAAG,CAAC;IACf,CAAC,EACD;QACI,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,EAAE;KAKlB,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { XMLElement } from '@xml-tools/ast';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a subset of elements children based on their name.
|
|
4
|
+
*
|
|
5
|
+
* @param name Name of the element
|
|
6
|
+
* @param element Element which sub-elements will be checked
|
|
7
|
+
* @returns An array with matching elements
|
|
8
|
+
*/
|
|
9
|
+
export declare function getElementsWithName(name: string, element: XMLElement): XMLElement[];
|
|
10
|
+
//# sourceMappingURL=element-getters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-getters.d.ts","sourceRoot":"","sources":["../../src/parser/element-getters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,EAAE,CAEnF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getElementsWithName = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Returns a subset of elements children based on their name.
|
|
6
|
+
*
|
|
7
|
+
* @param name Name of the element
|
|
8
|
+
* @param element Element which sub-elements will be checked
|
|
9
|
+
* @returns An array with matching elements
|
|
10
|
+
*/
|
|
11
|
+
function getElementsWithName(name, element) {
|
|
12
|
+
return element.subElements ? element.subElements.filter((subElement) => subElement.name === name) : [];
|
|
13
|
+
}
|
|
14
|
+
exports.getElementsWithName = getElementsWithName;
|
|
15
|
+
//# sourceMappingURL=element-getters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-getters.js","sourceRoot":"","sources":["../../src/parser/element-getters.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,IAAY,EAAE,OAAmB;IACjE,OAAO,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvH,CAAC;AAFD,kDAEC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replaces XML escape sequences with their matching special characters.
|
|
3
|
+
*
|
|
4
|
+
* @param input text with escape sequences
|
|
5
|
+
* @returns text with special characters
|
|
6
|
+
*/
|
|
7
|
+
export declare function removeEscapeSequences(input: string): string;
|
|
8
|
+
//# sourceMappingURL=escaping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escaping.d.ts","sourceRoot":"","sources":["../../src/parser/escaping.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeEscapeSequences = void 0;
|
|
4
|
+
const ESCAPE_MAPPINGS = {
|
|
5
|
+
''': "'",
|
|
6
|
+
'>': '>',
|
|
7
|
+
'<': '<',
|
|
8
|
+
'&': '&',
|
|
9
|
+
'"': '"'
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Replaces XML escape sequences with their matching special characters.
|
|
13
|
+
*
|
|
14
|
+
* @param input text with escape sequences
|
|
15
|
+
* @returns text with special characters
|
|
16
|
+
*/
|
|
17
|
+
function removeEscapeSequences(input) {
|
|
18
|
+
return input.replace(/('|<|>|&|")/g, (_str, item) => ESCAPE_MAPPINGS[item]);
|
|
19
|
+
}
|
|
20
|
+
exports.removeEscapeSequences = removeEscapeSequences;
|
|
21
|
+
//# sourceMappingURL=escaping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escaping.js","sourceRoot":"","sources":["../../src/parser/escaping.ts"],"names":[],"mappings":";;;AAAA,MAAM,eAAe,GAA2B;IAC5C,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,GAAG;CAChB,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,KAAa;IAC/C,OAAO,KAAK,CAAC,OAAO,CAAC,kCAAkC,EAAE,CAAC,IAAI,EAAE,IAAY,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5G,CAAC;AAFD,sDAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertMetadataDocument = exports.transformRange = exports.convertDocument = void 0;
|
|
4
|
+
var document_1 = require("./document");
|
|
5
|
+
Object.defineProperty(exports, "convertDocument", { enumerable: true, get: function () { return document_1.convertDocument; } });
|
|
6
|
+
var range_1 = require("./range");
|
|
7
|
+
Object.defineProperty(exports, "transformRange", { enumerable: true, get: function () { return range_1.transformRange; } });
|
|
8
|
+
var metadata_1 = require("./metadata");
|
|
9
|
+
Object.defineProperty(exports, "convertMetadataDocument", { enumerable: true, get: function () { return metadata_1.convertMetadataDocument; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAApC,2GAAA,eAAe,OAAA;AACxB,iCAAyC;AAAhC,uGAAA,cAAc,OAAA;AACvB,uCAAqD;AAA5C,mHAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { XMLDocument } from '@xml-tools/ast';
|
|
2
|
+
import type { MetadataElement } from '@sap-ux/odata-annotation-core-types';
|
|
3
|
+
/**
|
|
4
|
+
* Traverses the XML document and collects metadata element definitions.
|
|
5
|
+
*
|
|
6
|
+
* @param uri Uri of the document.
|
|
7
|
+
* @param document XML document containing metadata.
|
|
8
|
+
* @returns an array of MetadataElements extracted from the XML document.
|
|
9
|
+
*/
|
|
10
|
+
export declare function convertMetadataDocument(uri: string, document: XMLDocument): MetadataElement[];
|
|
11
|
+
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/parser/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAE9D,OAAO,KAAK,EAA6B,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAkEtG;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,eAAe,EAAE,CAa7F"}
|