@amazon/vinyl-xml 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +976 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.js +986 -0
- package/dist/index.js.map +7 -0
- package/dist/types/current/index.d.ts +14 -0
- package/dist/types/current/index.d.ts.map +1 -0
- package/dist/types/current/index.js +13 -0
- package/dist/types/current/tsconfig.tsbuildinfo +1 -0
- package/dist/types/current/xlink/actuateValidator.d.ts +3 -0
- package/dist/types/current/xlink/actuateValidator.d.ts.map +1 -0
- package/dist/types/current/xlink/actuateValidator.js +11 -0
- package/dist/types/current/xml/ParseXmlHandler.d.ts +56 -0
- package/dist/types/current/xml/ParseXmlHandler.d.ts.map +1 -0
- package/dist/types/current/xml/ParseXmlHandler.js +5 -0
- package/dist/types/current/xml/ParseXmlHandlerImpl.d.ts +49 -0
- package/dist/types/current/xml/ParseXmlHandlerImpl.d.ts.map +1 -0
- package/dist/types/current/xml/ParseXmlHandlerImpl.js +198 -0
- package/dist/types/current/xml/QName.d.ts +33 -0
- package/dist/types/current/xml/QName.d.ts.map +1 -0
- package/dist/types/current/xml/QName.js +19 -0
- package/dist/types/current/xml/XmlSchemaError.d.ts +15 -0
- package/dist/types/current/xml/XmlSchemaError.d.ts.map +1 -0
- package/dist/types/current/xml/XmlSchemaError.js +23 -0
- package/dist/types/current/xml/mappedXmlRules.d.ts +118 -0
- package/dist/types/current/xml/mappedXmlRules.d.ts.map +1 -0
- package/dist/types/current/xml/mappedXmlRules.js +122 -0
- package/dist/types/current/xml/mergeXmlRules.d.ts +62 -0
- package/dist/types/current/xml/mergeXmlRules.d.ts.map +1 -0
- package/dist/types/current/xml/mergeXmlRules.js +89 -0
- package/dist/types/current/xml/parseXml.d.ts +76 -0
- package/dist/types/current/xml/parseXml.d.ts.map +1 -0
- package/dist/types/current/xml/parseXml.js +305 -0
- package/dist/types/current/xml/stringifyXml.d.ts +67 -0
- package/dist/types/current/xml/stringifyXml.d.ts.map +1 -0
- package/dist/types/current/xml/stringifyXml.js +225 -0
- package/dist/types/current/xml/xmlRules.d.ts +207 -0
- package/dist/types/current/xml/xmlRules.d.ts.map +1 -0
- package/dist/types/current/xml/xmlRules.js +134 -0
- package/dist/types/current/xmlns/org/w3/1999/xlink.d.ts +7 -0
- package/dist/types/current/xmlns/org/w3/1999/xlink.d.ts.map +1 -0
- package/dist/types/current/xmlns/org/w3/1999/xlink.js +5 -0
- package/dist/types/current/xmlns/org/w3/2001/XmlSchema.d.ts +17 -0
- package/dist/types/current/xmlns/org/w3/2001/XmlSchema.d.ts.map +1 -0
- package/dist/types/current/xmlns/org/w3/2001/XmlSchema.js +5 -0
- package/dist/types/ts3.7/index.d.ts +14 -0
- package/dist/types/ts3.7/xlink/actuateValidator.d.ts +3 -0
- package/dist/types/ts3.7/xml/ParseXmlHandler.d.ts +56 -0
- package/dist/types/ts3.7/xml/ParseXmlHandlerImpl.d.ts +49 -0
- package/dist/types/ts3.7/xml/QName.d.ts +33 -0
- package/dist/types/ts3.7/xml/XmlSchemaError.d.ts +15 -0
- package/dist/types/ts3.7/xml/mappedXmlRules.d.ts +118 -0
- package/dist/types/ts3.7/xml/mergeXmlRules.d.ts +118 -0
- package/dist/types/ts3.7/xml/parseXml.d.ts +76 -0
- package/dist/types/ts3.7/xml/stringifyXml.d.ts +67 -0
- package/dist/types/ts3.7/xml/xmlRules.d.ts +207 -0
- package/dist/types/ts3.7/xmlns/org/w3/1999/xlink.d.ts +7 -0
- package/dist/types/ts3.7/xmlns/org/w3/2001/XmlSchema.d.ts +17 -0
- package/dist/types/ts4.1/index.d.ts +14 -0
- package/dist/types/ts4.1/xlink/actuateValidator.d.ts +3 -0
- package/dist/types/ts4.1/xml/ParseXmlHandler.d.ts +56 -0
- package/dist/types/ts4.1/xml/ParseXmlHandlerImpl.d.ts +49 -0
- package/dist/types/ts4.1/xml/QName.d.ts +33 -0
- package/dist/types/ts4.1/xml/XmlSchemaError.d.ts +15 -0
- package/dist/types/ts4.1/xml/mappedXmlRules.d.ts +118 -0
- package/dist/types/ts4.1/xml/mergeXmlRules.d.ts +118 -0
- package/dist/types/ts4.1/xml/parseXml.d.ts +77 -0
- package/dist/types/ts4.1/xml/stringifyXml.d.ts +67 -0
- package/dist/types/ts4.1/xml/xmlRules.d.ts +207 -0
- package/dist/types/ts4.1/xmlns/org/w3/1999/xlink.d.ts +7 -0
- package/dist/types/ts4.1/xmlns/org/w3/2001/XmlSchema.d.ts +17 -0
- package/dist/types/ts4.7/index.d.ts +14 -0
- package/dist/types/ts4.7/xlink/actuateValidator.d.ts +3 -0
- package/dist/types/ts4.7/xml/ParseXmlHandler.d.ts +56 -0
- package/dist/types/ts4.7/xml/ParseXmlHandlerImpl.d.ts +49 -0
- package/dist/types/ts4.7/xml/QName.d.ts +33 -0
- package/dist/types/ts4.7/xml/XmlSchemaError.d.ts +15 -0
- package/dist/types/ts4.7/xml/mappedXmlRules.d.ts +118 -0
- package/dist/types/ts4.7/xml/mergeXmlRules.d.ts +118 -0
- package/dist/types/ts4.7/xml/parseXml.d.ts +76 -0
- package/dist/types/ts4.7/xml/stringifyXml.d.ts +67 -0
- package/dist/types/ts4.7/xml/xmlRules.d.ts +207 -0
- package/dist/types/ts4.7/xmlns/org/w3/1999/xlink.d.ts +7 -0
- package/dist/types/ts4.7/xmlns/org/w3/2001/XmlSchema.d.ts +17 -0
- package/docs/XML_PARSING.md +210 -0
- package/package.json +82 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { clone, decodeEntities, IllegalStateError, last, substitute, toJson, } from '@amazon/vinyl-util';
|
|
6
|
+
import { EmptyRules, mapXmlRules, xmlRuleKey } from './mappedXmlRules';
|
|
7
|
+
import { XmlSchemaError, xmlSchemaErrorLocale } from './XmlSchemaError';
|
|
8
|
+
/**
|
|
9
|
+
* Choose the rule using namespaces first, if there is no match, query the wildcard namespace rules.
|
|
10
|
+
*/
|
|
11
|
+
function getRule(name, rules) {
|
|
12
|
+
return rules.get(xmlRuleKey(name.localPart, name.namespaceUri));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A {@link ParseXmlHandler} implementation that follows {@link XmlRules}, building an object of
|
|
16
|
+
* the parameterized type.
|
|
17
|
+
*/
|
|
18
|
+
export class ParseXmlHandlerImpl {
|
|
19
|
+
rules;
|
|
20
|
+
stack = [];
|
|
21
|
+
options;
|
|
22
|
+
busy = false;
|
|
23
|
+
constructor(rules, options) {
|
|
24
|
+
this.rules = rules;
|
|
25
|
+
this.options = { validateRules: true, ...options };
|
|
26
|
+
}
|
|
27
|
+
startDocument() {
|
|
28
|
+
if (this.busy)
|
|
29
|
+
throw new IllegalStateError('XML content handler is busy');
|
|
30
|
+
this.busy = true;
|
|
31
|
+
const rules = this.rules;
|
|
32
|
+
this.stack.push({
|
|
33
|
+
element: new XmlElementImpl(),
|
|
34
|
+
rules,
|
|
35
|
+
characters: '',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
startElement(name, attributes) {
|
|
39
|
+
const parent = last(this.stack);
|
|
40
|
+
let element = null;
|
|
41
|
+
const elementRule = getRule(name, parent.rules.elements);
|
|
42
|
+
const rules = elementRule?.rules() ?? EmptyRules;
|
|
43
|
+
if (elementRule) {
|
|
44
|
+
const prop = elementRule.property;
|
|
45
|
+
element = new XmlElementImpl(parent.element);
|
|
46
|
+
if (elementRule.array) {
|
|
47
|
+
const arr = parent.element[prop];
|
|
48
|
+
if (Array.isArray(arr)) {
|
|
49
|
+
arr.push(element);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
parent.element[prop] = [element];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
if (parent.element[prop]) {
|
|
57
|
+
throw new XmlSchemaError(`Expected single element with name ${name.qName}`);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
parent.element[prop] = element;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const attributeRules = rules.attributes;
|
|
64
|
+
for (const k in attributes) {
|
|
65
|
+
const attribute = attributes[k];
|
|
66
|
+
const name = attribute.name;
|
|
67
|
+
const attributeRule = getRule(name, attributeRules);
|
|
68
|
+
if (attributeRule) {
|
|
69
|
+
element[attributeRule.property] = attributeRule.parse(attribute.value);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Set attribute defaults:
|
|
73
|
+
attributeRules.forEach((_value, key) => {
|
|
74
|
+
const rule = attributeRules.get(key);
|
|
75
|
+
if (!(rule.property in element)) {
|
|
76
|
+
if (rule.default != null) {
|
|
77
|
+
element[rule.property] = rule.default;
|
|
78
|
+
}
|
|
79
|
+
else if (this.options.validateRules && rule.required) {
|
|
80
|
+
throw new XmlSchemaError(substitute(xmlSchemaErrorLocale.requiredAttribute, {
|
|
81
|
+
property: rule.property,
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
this.stack.push({
|
|
88
|
+
element,
|
|
89
|
+
rules,
|
|
90
|
+
characters: '',
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
textNode(str) {
|
|
94
|
+
const current = last(this.stack);
|
|
95
|
+
if (!current.rules.characters)
|
|
96
|
+
return;
|
|
97
|
+
current.characters += decodeEntities(str.trim());
|
|
98
|
+
}
|
|
99
|
+
cDataNode(str) {
|
|
100
|
+
const current = last(this.stack);
|
|
101
|
+
if (!current.rules.characters)
|
|
102
|
+
return;
|
|
103
|
+
current.characters += str;
|
|
104
|
+
}
|
|
105
|
+
endElement() {
|
|
106
|
+
const lastEl = this.stack.pop();
|
|
107
|
+
const charactersRule = lastEl.rules.characters;
|
|
108
|
+
if (charactersRule)
|
|
109
|
+
lastEl.element[charactersRule.property] = charactersRule.parse(lastEl.characters);
|
|
110
|
+
lastEl.rules.elements.forEach((rule) => {
|
|
111
|
+
if (rule.array && !(rule.property in lastEl.element)) {
|
|
112
|
+
if (rule.useEmptyArrays) {
|
|
113
|
+
lastEl.element[rule.property] = [];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
this.validate(lastEl);
|
|
118
|
+
}
|
|
119
|
+
endDocument() {
|
|
120
|
+
this.busy = false;
|
|
121
|
+
const last = this.stack.pop();
|
|
122
|
+
this.validate(last);
|
|
123
|
+
return last.element;
|
|
124
|
+
}
|
|
125
|
+
validate(current) {
|
|
126
|
+
if (!this.options.validateRules)
|
|
127
|
+
return;
|
|
128
|
+
current.rules.elements.forEach((rule) => {
|
|
129
|
+
const length = rule.array
|
|
130
|
+
? (current.element[rule.property]?.length ?? 0)
|
|
131
|
+
: current.element[rule.property]
|
|
132
|
+
? 1
|
|
133
|
+
: 0;
|
|
134
|
+
if (length < rule.minOccurs) {
|
|
135
|
+
throw new XmlSchemaError(substitute(xmlSchemaErrorLocale.atLeastElements, {
|
|
136
|
+
property: rule.property,
|
|
137
|
+
expected: rule.minOccurs,
|
|
138
|
+
actual: length,
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
if (rule.maxOccurs != null && length > rule.maxOccurs) {
|
|
142
|
+
throw new XmlSchemaError(substitute(xmlSchemaErrorLocale.atMostElements, {
|
|
143
|
+
property: rule.property,
|
|
144
|
+
expected: rule.maxOccurs,
|
|
145
|
+
actual: length,
|
|
146
|
+
}));
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Creates an XML content handler for the given parsing rules.
|
|
153
|
+
*
|
|
154
|
+
* @param rules
|
|
155
|
+
* @param options
|
|
156
|
+
*/
|
|
157
|
+
export function parseXmlHandler(rules, options) {
|
|
158
|
+
return new ParseXmlHandlerImpl(mapXmlRules(rules), options);
|
|
159
|
+
}
|
|
160
|
+
// Use a symbol to prevent parent from inclusion in property enumeration.
|
|
161
|
+
const parentSymbol = Symbol('parent');
|
|
162
|
+
export class XmlElementImpl {
|
|
163
|
+
[parentSymbol];
|
|
164
|
+
constructor(parent = null) {
|
|
165
|
+
this[parentSymbol] = parent;
|
|
166
|
+
}
|
|
167
|
+
get parent() {
|
|
168
|
+
return this[parentSymbol];
|
|
169
|
+
}
|
|
170
|
+
set parent(value) {
|
|
171
|
+
this[parentSymbol] = value;
|
|
172
|
+
}
|
|
173
|
+
clone() {
|
|
174
|
+
const out = new XmlElementImpl(this.parent);
|
|
175
|
+
for (const key in this) {
|
|
176
|
+
// Clone all children, setting their parent references to the new cloned parent.
|
|
177
|
+
const child = clone(this[key]);
|
|
178
|
+
if (Array.isArray(child)) {
|
|
179
|
+
for (const e of child) {
|
|
180
|
+
if (typeof e === 'object' && 'parent' in e)
|
|
181
|
+
e.parent = out;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else if (typeof child === 'object' && 'parent' in child) {
|
|
185
|
+
child.parent = out;
|
|
186
|
+
}
|
|
187
|
+
out[key] = child;
|
|
188
|
+
}
|
|
189
|
+
return out;
|
|
190
|
+
}
|
|
191
|
+
toJSON() {
|
|
192
|
+
const out = {};
|
|
193
|
+
for (const key in this) {
|
|
194
|
+
out[key] = toJson(this[key]);
|
|
195
|
+
}
|
|
196
|
+
return out;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Uri } from '../xmlns/org/w3/2001/XmlSchema';
|
|
2
|
+
/**
|
|
3
|
+
* An XML name for an element or attribute.
|
|
4
|
+
*/
|
|
5
|
+
export interface QName {
|
|
6
|
+
/**
|
|
7
|
+
* The fully qualified name.
|
|
8
|
+
* This will be the prefixed name or the unprefixed name if the prefix is empty.
|
|
9
|
+
* The prefixed name will be `prefix ':' localPart`
|
|
10
|
+
*/
|
|
11
|
+
readonly qName: string;
|
|
12
|
+
/**
|
|
13
|
+
* The xmlns prefix.
|
|
14
|
+
*/
|
|
15
|
+
readonly prefix: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* The local part of this name.
|
|
18
|
+
*/
|
|
19
|
+
readonly localPart: string;
|
|
20
|
+
/**
|
|
21
|
+
* The resolved xmlns uri for the associated prefix.
|
|
22
|
+
*/
|
|
23
|
+
readonly namespaceUri: Uri | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new {@link QName} object.
|
|
27
|
+
*
|
|
28
|
+
* @param localPart
|
|
29
|
+
* @param prefix
|
|
30
|
+
* @param namespaceUri
|
|
31
|
+
*/
|
|
32
|
+
export declare function qName(localPart: string, prefix?: string | null, namespaceUri?: Uri | null): QName;
|
|
33
|
+
//# sourceMappingURL=QName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QName.d.ts","sourceRoot":"","sources":["../../../../src/xml/QName.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAExD;;GAEG;AACH,MAAM,WAAW,KAAK;IAClB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAE9B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,GAAG,GAAG,IAAI,CAAA;CACpC;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CACjB,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,MAAM,GAAG,IAAW,EAC5B,YAAY,GAAE,GAAG,GAAG,IAAW,GAChC,KAAK,CAOP"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new {@link QName} object.
|
|
7
|
+
*
|
|
8
|
+
* @param localPart
|
|
9
|
+
* @param prefix
|
|
10
|
+
* @param namespaceUri
|
|
11
|
+
*/
|
|
12
|
+
export function qName(localPart, prefix = null, namespaceUri = null) {
|
|
13
|
+
return {
|
|
14
|
+
localPart,
|
|
15
|
+
prefix,
|
|
16
|
+
namespaceUri,
|
|
17
|
+
qName: prefix ? `${prefix}:${localPart}` : localPart,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReportableError } from '@amazon/vinyl-util';
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
*/
|
|
5
|
+
export declare const xmlSchemaErrorLocale: {
|
|
6
|
+
readonly atLeastElements: "Expected at least {expected} occurrences of {property} but was {actual}";
|
|
7
|
+
readonly atMostElements: "Expected at most {expected} occurrences of {property} but was {actual}";
|
|
8
|
+
readonly cyclicReferences: "Cyclic reference detected";
|
|
9
|
+
readonly requiredAttribute: "Attribute '{property}' is required";
|
|
10
|
+
};
|
|
11
|
+
export declare class XmlSchemaError extends ReportableError {
|
|
12
|
+
get [Symbol.toStringTag](): string;
|
|
13
|
+
constructor(message: string);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=XmlSchemaError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XmlSchemaError.d.ts","sourceRoot":"","sources":["../../../../src/xml/XmlSchemaError.ts"],"names":[],"mappings":"AAKA,OAAO,EAAe,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEjE;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;CAOvB,CAAA;AAEV,qBAAa,cAAe,SAAQ,eAAe;IAC/C,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;gBAEW,OAAO,EAAE,MAAM;CAI9B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { ErrorOrigin, ReportableError } from '@amazon/vinyl-util';
|
|
6
|
+
/**
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
export const xmlSchemaErrorLocale = {
|
|
10
|
+
atLeastElements: 'Expected at least {expected} occurrences of {property} but was {actual}',
|
|
11
|
+
atMostElements: 'Expected at most {expected} occurrences of {property} but was {actual}',
|
|
12
|
+
cyclicReferences: 'Cyclic reference detected',
|
|
13
|
+
requiredAttribute: `Attribute '{property}' is required`,
|
|
14
|
+
};
|
|
15
|
+
export class XmlSchemaError extends ReportableError {
|
|
16
|
+
get [Symbol.toStringTag]() {
|
|
17
|
+
return 'XmlSchemaError';
|
|
18
|
+
}
|
|
19
|
+
constructor(message) {
|
|
20
|
+
super(message, ErrorOrigin.PARSING);
|
|
21
|
+
Object.setPrototypeOf(this, XmlSchemaError.prototype);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { type AnyRecord, type Invariant } from '@amazon/vinyl-util';
|
|
2
|
+
import type { XmlRules } from './xmlRules';
|
|
3
|
+
import type { Uri } from '../xmlns/org/w3/2001/XmlSchema';
|
|
4
|
+
/**
|
|
5
|
+
* A machine-readable representation of parse rules for random access based on qualified namespace
|
|
6
|
+
* keys.
|
|
7
|
+
*
|
|
8
|
+
* Rule keys will either be `namespaceUri:localPart` or just `localPart` for wildcard rules if
|
|
9
|
+
* namespaceUri is not defined in the handler.
|
|
10
|
+
*/
|
|
11
|
+
export interface MappedXmlRules<T> {
|
|
12
|
+
/**
|
|
13
|
+
* Enforces that this rule set can only be used to parse the expected type T.
|
|
14
|
+
*/
|
|
15
|
+
readonly __type: Invariant<T>;
|
|
16
|
+
readonly attributes: ReadonlyMap<string, MappedAttributeRule>;
|
|
17
|
+
readonly elements: ReadonlyMap<string, MappedElementsRule>;
|
|
18
|
+
readonly characters: MappedCharactersRule | undefined;
|
|
19
|
+
}
|
|
20
|
+
export interface MappedAttributeRule {
|
|
21
|
+
/**
|
|
22
|
+
* The property name.
|
|
23
|
+
*/
|
|
24
|
+
readonly property: keyof any;
|
|
25
|
+
/**
|
|
26
|
+
* If true, a parsing error will be thrown if the value is undefined.
|
|
27
|
+
*/
|
|
28
|
+
readonly required: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* If the current element has no matching attribute, default will be used.
|
|
31
|
+
*/
|
|
32
|
+
readonly default: any;
|
|
33
|
+
/**
|
|
34
|
+
* Parses the attribute value.
|
|
35
|
+
*/
|
|
36
|
+
readonly parse: (value: string) => any;
|
|
37
|
+
/**
|
|
38
|
+
* Converts the attribute value to a string.
|
|
39
|
+
*/
|
|
40
|
+
readonly stringify: (value: any) => string;
|
|
41
|
+
/**
|
|
42
|
+
* The local part of the QName.
|
|
43
|
+
*/
|
|
44
|
+
readonly localPart: string;
|
|
45
|
+
/**
|
|
46
|
+
* The namespace uri that must match.
|
|
47
|
+
*/
|
|
48
|
+
readonly namespaceUri: Uri | null;
|
|
49
|
+
}
|
|
50
|
+
export interface MappedElementsRule {
|
|
51
|
+
/**
|
|
52
|
+
* The name of the property to set on the parent element.
|
|
53
|
+
*/
|
|
54
|
+
readonly property: keyof any;
|
|
55
|
+
/**
|
|
56
|
+
* True if the parsed elements should populate into an array.
|
|
57
|
+
*/
|
|
58
|
+
readonly array: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* The minimum number of elements.
|
|
61
|
+
*/
|
|
62
|
+
readonly minOccurs: number;
|
|
63
|
+
/**
|
|
64
|
+
* The maximum number of elements. Use null for unbounded.
|
|
65
|
+
*/
|
|
66
|
+
readonly maxOccurs: number | null;
|
|
67
|
+
/**
|
|
68
|
+
* If true and there are 0 occurrences of the element, the parsed value will be an empty array
|
|
69
|
+
* instead of undefined.
|
|
70
|
+
*/
|
|
71
|
+
readonly useEmptyArrays: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the mappings for matched element(s).
|
|
74
|
+
*/
|
|
75
|
+
readonly rules: () => MappedXmlRules<any>;
|
|
76
|
+
/**
|
|
77
|
+
* The local part of the QName.
|
|
78
|
+
*/
|
|
79
|
+
readonly localPart: string;
|
|
80
|
+
/**
|
|
81
|
+
* The namespace uri that must match.
|
|
82
|
+
*/
|
|
83
|
+
readonly namespaceUri: Uri | null;
|
|
84
|
+
}
|
|
85
|
+
export interface MappedCharactersRule {
|
|
86
|
+
readonly property: keyof any;
|
|
87
|
+
/**
|
|
88
|
+
* Parses the unescaped/processed characters.
|
|
89
|
+
* This will always be called, but characters may be an empty string if the element has no
|
|
90
|
+
* text content.
|
|
91
|
+
*/
|
|
92
|
+
readonly parse: (characters: string) => any;
|
|
93
|
+
/**
|
|
94
|
+
* Converts the value to a string.
|
|
95
|
+
*/
|
|
96
|
+
readonly stringify: (value: any) => string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* An empty rules map, used when there was no match for the started element.
|
|
100
|
+
* @private
|
|
101
|
+
*/
|
|
102
|
+
export declare const EmptyRules: MappedXmlRules<AnyRecord>;
|
|
103
|
+
/**
|
|
104
|
+
* Creates machine-friendly content handler rules from the given {@link XmlRules}.
|
|
105
|
+
*
|
|
106
|
+
* @param rules The {@link XmlRules} to convert.
|
|
107
|
+
* @param parentNamespaceUri
|
|
108
|
+
*/
|
|
109
|
+
export declare function mapXmlRules<T extends object>(rules: XmlRules<T>, parentNamespaceUri?: Uri | null): MappedXmlRules<T>;
|
|
110
|
+
/**
|
|
111
|
+
* Creates a rule key for mapped xml rules.
|
|
112
|
+
*
|
|
113
|
+
* @private
|
|
114
|
+
* @param localPart The {@link QName.localPart}
|
|
115
|
+
* @param namespaceUri The `namespaceUri` of the element.
|
|
116
|
+
*/
|
|
117
|
+
export declare function xmlRuleKey(localPart: string, namespaceUri?: Uri | null): string;
|
|
118
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|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { IllegalArgumentError, invariant, memoize, } from '@amazon/vinyl-util';
|
|
6
|
+
import { XmlRuleType } from './xmlRules';
|
|
7
|
+
/**
|
|
8
|
+
* An empty rules map, used when there was no match for the started element.
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
export const EmptyRules = {
|
|
12
|
+
__type: invariant(),
|
|
13
|
+
attributes: new Map(),
|
|
14
|
+
elements: new Map(),
|
|
15
|
+
characters: undefined,
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Creates machine-friendly content handler rules from the given {@link XmlRules}.
|
|
19
|
+
*
|
|
20
|
+
* @param rules The {@link XmlRules} to convert.
|
|
21
|
+
* @param parentNamespaceUri
|
|
22
|
+
*/
|
|
23
|
+
export function mapXmlRules(rules, parentNamespaceUri = null) {
|
|
24
|
+
const attributeRules = new Map();
|
|
25
|
+
const elementRules = new Map();
|
|
26
|
+
let charactersRule = undefined;
|
|
27
|
+
for (const property in rules) {
|
|
28
|
+
const handlerOrFunction = rules[property];
|
|
29
|
+
let handler;
|
|
30
|
+
if (typeof handlerOrFunction === 'function') {
|
|
31
|
+
handler = handlerOrFunction();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
handler = handlerOrFunction;
|
|
35
|
+
}
|
|
36
|
+
let key;
|
|
37
|
+
switch (handler.type) {
|
|
38
|
+
case XmlRuleType.CHARACTERS:
|
|
39
|
+
if (charactersRule !== undefined)
|
|
40
|
+
throw new IllegalArgumentError('characters handler already defined');
|
|
41
|
+
charactersRule = {
|
|
42
|
+
property,
|
|
43
|
+
parse: handler.parse,
|
|
44
|
+
stringify: handler.stringify,
|
|
45
|
+
};
|
|
46
|
+
break;
|
|
47
|
+
case XmlRuleType.ELEMENT:
|
|
48
|
+
case XmlRuleType.ELEMENTS: {
|
|
49
|
+
const localPart = handler.localPart ?? property;
|
|
50
|
+
const namespaceUri = handler.namespaceUri === undefined
|
|
51
|
+
? parentNamespaceUri
|
|
52
|
+
: handler.namespaceUri;
|
|
53
|
+
key = xmlRuleKey(localPart, namespaceUri);
|
|
54
|
+
if (elementRules.has(key)) {
|
|
55
|
+
throw new IllegalArgumentError(`Multiple element rules for ${key}`);
|
|
56
|
+
}
|
|
57
|
+
if (handler.type === XmlRuleType.ELEMENT) {
|
|
58
|
+
const rules = handler.rules;
|
|
59
|
+
elementRules.set(key, {
|
|
60
|
+
array: false,
|
|
61
|
+
property,
|
|
62
|
+
minOccurs: handler.required ? 1 : 0,
|
|
63
|
+
maxOccurs: 1,
|
|
64
|
+
rules: memoize(() => mapXmlRules(rules, namespaceUri)),
|
|
65
|
+
useEmptyArrays: false,
|
|
66
|
+
localPart,
|
|
67
|
+
namespaceUri,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const rules = handler.rules;
|
|
72
|
+
elementRules.set(key, {
|
|
73
|
+
array: true,
|
|
74
|
+
property,
|
|
75
|
+
maxOccurs: handler.maxOccurs,
|
|
76
|
+
minOccurs: handler.minOccurs,
|
|
77
|
+
rules: memoize(() => mapXmlRules(rules, namespaceUri)),
|
|
78
|
+
useEmptyArrays: handler.useEmptyArrays,
|
|
79
|
+
localPart,
|
|
80
|
+
namespaceUri,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
case XmlRuleType.ATTRIBUTE: {
|
|
86
|
+
// Attributes should not inherit the namespace of the parent element.
|
|
87
|
+
const namespaceUri = handler.namespaceUri;
|
|
88
|
+
const localPart = handler.localPart ?? property;
|
|
89
|
+
key = xmlRuleKey(localPart, namespaceUri);
|
|
90
|
+
if (attributeRules.has(key)) {
|
|
91
|
+
throw new IllegalArgumentError(`Multiple attribute rules for ${key}`);
|
|
92
|
+
}
|
|
93
|
+
attributeRules.set(key, {
|
|
94
|
+
property,
|
|
95
|
+
default: handler.default,
|
|
96
|
+
parse: handler.parse,
|
|
97
|
+
stringify: handler.stringify,
|
|
98
|
+
required: handler.required,
|
|
99
|
+
localPart,
|
|
100
|
+
namespaceUri: handler.namespaceUri ?? null,
|
|
101
|
+
});
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
__type: invariant(),
|
|
108
|
+
attributes: attributeRules,
|
|
109
|
+
elements: elementRules,
|
|
110
|
+
characters: charactersRule,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Creates a rule key for mapped xml rules.
|
|
115
|
+
*
|
|
116
|
+
* @private
|
|
117
|
+
* @param localPart The {@link QName.localPart}
|
|
118
|
+
* @param namespaceUri The `namespaceUri` of the element.
|
|
119
|
+
*/
|
|
120
|
+
export function xmlRuleKey(localPart, namespaceUri = null) {
|
|
121
|
+
return `${namespaceUri ?? ''}:${localPart}`;
|
|
122
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type Fun } from '@amazon/vinyl-util';
|
|
2
|
+
import { type XmlRules } from '../xml/xmlRules';
|
|
3
|
+
/**
|
|
4
|
+
* Recursively merges array types so that S[] & T[] becomes (S & T)[]
|
|
5
|
+
* When two array elements parsing rules are merged, the result is an array with intersected
|
|
6
|
+
* element types.
|
|
7
|
+
*/
|
|
8
|
+
export type Merged<T> = T extends readonly any[] ? MergedTupleOrArray<T> : T extends Fun ? T : T extends object ? {
|
|
9
|
+
[P in keyof T]: Merged<T[P]>;
|
|
10
|
+
} : T;
|
|
11
|
+
/**
|
|
12
|
+
* `[S0, T0] & [S1, T1]` cannot be converted to `[S0 & S1, T0 & T1]`, but we can at least preserve
|
|
13
|
+
* the tuple when not intersected.
|
|
14
|
+
*
|
|
15
|
+
* Intersected tuples become arrays. E.g. `[S0, T0] & [S1, T1]` becomes `Array<S0 | S1 | T0 | T1>`
|
|
16
|
+
*/
|
|
17
|
+
export type MergedTupleOrArray<T extends readonly any[]> = T extends [infer V0] ? [
|
|
18
|
+
Merged<V0>
|
|
19
|
+
] : T extends [infer V0, infer V1] ? [Merged<V0>, Merged<V1>] : T extends [infer V0, infer V1, infer V2] ? [Merged<V0>, Merged<V1>, Merged<V2>] : T extends [infer V0, infer V1, infer V2, infer V3] ? [Merged<V0>, Merged<V1>, Merged<V2>, Merged<V3>] : T extends [infer V0, infer V1, infer V2, infer V3, infer V4] ? [Merged<V0>, Merged<V1>, Merged<V2>, Merged<V3>, Merged<V4>] : T extends any[] ? Array<Merged<T[number]>> : T extends readonly [infer V0] ? readonly [Merged<V0>] : T extends readonly [infer V0, infer V1] ? readonly [Merged<V0>, Merged<V1>] : T extends readonly [infer V0, infer V1, infer V2] ? readonly [Merged<V0>, Merged<V1>, Merged<V2>] : T extends readonly [
|
|
20
|
+
infer V0,
|
|
21
|
+
infer V1,
|
|
22
|
+
infer V2,
|
|
23
|
+
infer V3
|
|
24
|
+
] ? readonly [
|
|
25
|
+
Merged<V0>,
|
|
26
|
+
Merged<V1>,
|
|
27
|
+
Merged<V2>,
|
|
28
|
+
Merged<V3>
|
|
29
|
+
] : T extends readonly [
|
|
30
|
+
infer V0,
|
|
31
|
+
infer V1,
|
|
32
|
+
infer V2,
|
|
33
|
+
infer V3,
|
|
34
|
+
infer V4
|
|
35
|
+
] ? readonly [
|
|
36
|
+
Merged<V0>,
|
|
37
|
+
Merged<V1>,
|
|
38
|
+
Merged<V2>,
|
|
39
|
+
Merged<V3>,
|
|
40
|
+
Merged<V4>
|
|
41
|
+
] : ReadonlyArray<Merged<T[number]>>;
|
|
42
|
+
/**
|
|
43
|
+
* Merges the given two xml rule sets into one.
|
|
44
|
+
*/
|
|
45
|
+
export declare function mergeXmlRules<A extends object, B extends object>(a: XmlRules<A>, b: XmlRules<B>): XmlRules<Merged<A & B>>;
|
|
46
|
+
/**
|
|
47
|
+
* Merges the given three xml rule sets into one.
|
|
48
|
+
*/
|
|
49
|
+
export declare function mergeXmlRules<A extends object, B extends object, C extends object>(a: XmlRules<A>, b: XmlRules<B>, c: XmlRules<C>): XmlRules<Merged<A & B & C>>;
|
|
50
|
+
/**
|
|
51
|
+
* Merges the given four xml rule sets into one.
|
|
52
|
+
*/
|
|
53
|
+
export declare function mergeXmlRules<A extends object, B extends object, C extends object, D extends object>(a: XmlRules<A>, b: XmlRules<B>, c: XmlRules<C>, d: XmlRules<D>): XmlRules<Merged<A & B & C & D>>;
|
|
54
|
+
/**
|
|
55
|
+
* Merges the given five xml rule sets into one.
|
|
56
|
+
*/
|
|
57
|
+
export declare function mergeXmlRules<A extends object, B extends object, C extends object, D extends object, E extends object>(a: XmlRules<A>, b: XmlRules<B>, c: XmlRules<C>, d: XmlRules<D>, e: XmlRules<E>): XmlRules<Merged<A & B & C & D & E>>;
|
|
58
|
+
/**
|
|
59
|
+
* Merges the given six xml rule sets into one.
|
|
60
|
+
*/
|
|
61
|
+
export declare function mergeXmlRules<A extends object, B extends object, C extends object, D extends object, E extends object, F extends object>(a: XmlRules<A>, b: XmlRules<B>, c: XmlRules<C>, d: XmlRules<D>, e: XmlRules<E>, f: XmlRules<F>): XmlRules<Merged<A & B & C & D & E & F>>;
|
|
62
|
+
//# sourceMappingURL=mergeXmlRules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeXmlRules.d.ts","sourceRoot":"","sources":["../../../../src/xml/mergeXmlRules.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,GAAG,EAIX,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAMH,KAAK,QAAQ,EAEhB,MAAM,gBAAgB,CAAA;AASvB;;;;GAIG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,EAAE,GAC1C,kBAAkB,CAAC,CAAC,CAAC,GACrB,CAAC,SAAS,GAAG,GACX,CAAC,GACD,CAAC,SAAS,MAAM,GACd;KACK,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,C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