@cdk8s/awscdk-resolver 0.0.609 → 0.0.611

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 (145) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/package.json +3 -3
  4. package/node_modules/@aws-sdk/core/package.json +2 -2
  5. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  6. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  7. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  8. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  9. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  10. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  11. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  12. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  13. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  14. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  15. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  16. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  17. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  18. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  19. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  20. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.browser.js +1 -1
  21. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +233 -43
  22. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.browser.js +1 -1
  23. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +233 -43
  24. package/node_modules/@aws-sdk/xml-builder/dist-types/ts3.4/xml-parser.d.ts +1 -1
  25. package/node_modules/@aws-sdk/xml-builder/dist-types/xml-parser.d.ts +2 -1
  26. package/node_modules/@aws-sdk/xml-builder/package.json +4 -4
  27. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +518 -371
  28. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +1 -1
  29. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js +326 -269
  30. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +192 -103
  31. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor.js +4 -2
  32. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +1 -1
  33. package/node_modules/@smithy/core/dist-types/submodules/cbor/cbor-decode.d.ts +4 -0
  34. package/node_modules/@smithy/core/dist-types/submodules/cbor/cbor-encode.d.ts +8 -4
  35. package/node_modules/@smithy/core/package.json +1 -1
  36. package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
  37. package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
  38. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  39. package/node_modules/@smithy/signature-v4/package.json +2 -2
  40. package/package.json +9 -9
  41. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-external/nodable_entities.js +0 -333
  42. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-external/nodable_entities.js +0 -332
  43. package/node_modules/@aws-sdk/xml-builder/dist-types/ts3.4/xml-external/nodable_entities.d.ts +0 -66
  44. package/node_modules/@aws-sdk/xml-builder/dist-types/xml-external/nodable_entities.d.ts +0 -65
  45. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/CHANGELOG.md +0 -827
  46. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/LICENSE +0 -21
  47. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/README.md +0 -202
  48. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js +0 -2
  49. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +0 -1
  50. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.cjs +0 -1
  51. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.d.cts +0 -770
  52. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js +0 -2
  53. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js.map +0 -1
  54. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js +0 -2
  55. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js.map +0 -1
  56. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxvalidator.min.js +0 -2
  57. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +0 -1
  58. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/package.json +0 -93
  59. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/cli/cli.js +0 -97
  60. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/cli/man.js +0 -17
  61. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/cli/read.js +0 -43
  62. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/fxp.d.ts +0 -739
  63. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/fxp.js +0 -14
  64. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/ignoreAttributes.js +0 -18
  65. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/util.js +0 -61
  66. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +0 -16
  67. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +0 -106
  68. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +0 -61
  69. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +0 -69
  70. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +0 -103
  71. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +0 -100
  72. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +0 -154
  73. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +0 -94
  74. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
  75. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/TagPath.js +0 -81
  76. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +0 -13
  77. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/XMLParser.js +0 -83
  78. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +0 -235
  79. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +0 -210
  80. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +0 -111
  81. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +0 -116
  82. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +0 -121
  83. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +0 -105
  84. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +0 -22
  85. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +0 -19
  86. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +0 -38
  87. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +0 -13
  88. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +0 -14
  89. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +0 -6
  90. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/validator.js +0 -425
  91. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +0 -6
  92. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +0 -407
  93. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +0 -163
  94. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +0 -840
  95. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +0 -71
  96. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/node2json.js +0 -177
  97. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +0 -40
  98. package/node_modules/@nodable/entities/README.md +0 -41
  99. package/node_modules/@nodable/entities/package.json +0 -57
  100. package/node_modules/@nodable/entities/src/EntityDecoder.js +0 -644
  101. package/node_modules/@nodable/entities/src/EntityEncoder.js +0 -194
  102. package/node_modules/@nodable/entities/src/entities.js +0 -1159
  103. package/node_modules/@nodable/entities/src/entityTries.js +0 -49
  104. package/node_modules/@nodable/entities/src/index.d.ts +0 -341
  105. package/node_modules/@nodable/entities/src/index.js +0 -29
  106. package/node_modules/anynum/LICENSE +0 -21
  107. package/node_modules/anynum/README.md +0 -142
  108. package/node_modules/anynum/anynum.js +0 -135
  109. package/node_modules/anynum/digitTable.js +0 -116
  110. package/node_modules/anynum/package.json +0 -42
  111. package/node_modules/fast-xml-builder/CHANGELOG.md +0 -40
  112. package/node_modules/fast-xml-builder/LICENSE +0 -21
  113. package/node_modules/fast-xml-builder/README.md +0 -74
  114. package/node_modules/fast-xml-builder/lib/fxb.cjs +0 -1
  115. package/node_modules/fast-xml-builder/lib/fxb.d.cts +0 -270
  116. package/node_modules/fast-xml-builder/lib/fxb.min.js +0 -2
  117. package/node_modules/fast-xml-builder/lib/fxb.min.js.map +0 -1
  118. package/node_modules/fast-xml-builder/package.json +0 -81
  119. package/node_modules/fast-xml-builder/src/fxb.d.ts +0 -270
  120. package/node_modules/fast-xml-builder/src/fxb.js +0 -599
  121. package/node_modules/fast-xml-builder/src/ignoreAttributes.js +0 -18
  122. package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +0 -359
  123. package/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
  124. package/node_modules/fast-xml-builder/src/util.js +0 -16
  125. package/node_modules/path-expression-matcher/LICENSE +0 -21
  126. package/node_modules/path-expression-matcher/README.md +0 -947
  127. package/node_modules/path-expression-matcher/lib/pem.cjs +0 -1
  128. package/node_modules/path-expression-matcher/lib/pem.d.cts +0 -715
  129. package/node_modules/path-expression-matcher/lib/pem.min.js +0 -2
  130. package/node_modules/path-expression-matcher/lib/pem.min.js.map +0 -1
  131. package/node_modules/path-expression-matcher/package.json +0 -79
  132. package/node_modules/path-expression-matcher/src/Expression.js +0 -232
  133. package/node_modules/path-expression-matcher/src/ExpressionSet.js +0 -225
  134. package/node_modules/path-expression-matcher/src/Matcher.js +0 -660
  135. package/node_modules/path-expression-matcher/src/index.d.ts +0 -589
  136. package/node_modules/path-expression-matcher/src/index.js +0 -29
  137. package/node_modules/strnum/CHANGELOG.md +0 -51
  138. package/node_modules/strnum/LICENSE +0 -21
  139. package/node_modules/strnum/README.md +0 -113
  140. package/node_modules/strnum/package.json +0 -36
  141. package/node_modules/strnum/strnum.js +0 -171
  142. package/node_modules/xml-naming/README.md +0 -189
  143. package/node_modules/xml-naming/package.json +0 -54
  144. package/node_modules/xml-naming/src/index.d.ts +0 -74
  145. package/node_modules/xml-naming/src/index.js +0 -270
@@ -1,739 +0,0 @@
1
- /**
2
- * Types copied from path-expression-matcher
3
- * @version <version>
4
- * @updated <date>
5
- *
6
- * Update this file when path-expression-matcher releases a new version.
7
- * Source: https://github.com/NaturalIntelligence/path-expression-matcher
8
- */
9
-
10
- /**
11
- * Options for creating an Expression
12
- */
13
- export interface ExpressionOptions {
14
- /**
15
- * Path separator character
16
- * @default '.'
17
- */
18
- separator?: string;
19
- }
20
-
21
- /**
22
- * Parsed segment from an expression pattern
23
- */
24
- export interface Segment {
25
- type: 'tag' | 'deep-wildcard';
26
- tag?: string;
27
- namespace?: string;
28
- attrName?: string;
29
- attrValue?: string;
30
- position?: 'first' | 'last' | 'odd' | 'even' | 'nth';
31
- positionValue?: number;
32
- }
33
-
34
- /**
35
- * Expression - Parses and stores a tag pattern expression.
36
- * Patterns are parsed once and stored in an optimized structure for fast matching.
37
- *
38
- * @example
39
- * ```typescript
40
- * const expr = new Expression("root.users.user");
41
- * const expr2 = new Expression("..user[id]:first");
42
- * const expr3 = new Expression("root/users/user", { separator: '/' });
43
- * ```
44
- *
45
- * Pattern Syntax:
46
- * - `root.users.user` — Match exact path
47
- * - `..user` — Match "user" at any depth (deep wildcard)
48
- * - `user[id]` — Match user tag with "id" attribute
49
- * - `user[id=123]` — Match user tag where id="123"
50
- * - `user:first` — Match first occurrence of user tag
51
- * - `ns::user` — Match user tag with namespace "ns"
52
- * - `ns::user[id]:first` — Combine namespace, attribute, and position
53
- */
54
- export class Expression {
55
- readonly pattern: string;
56
- readonly separator: string;
57
- readonly segments: Segment[];
58
-
59
- constructor(pattern: string, options?: ExpressionOptions);
60
-
61
- get length(): number;
62
- hasDeepWildcard(): boolean;
63
- hasAttributeCondition(): boolean;
64
- hasPositionSelector(): boolean;
65
- toString(): string;
66
- }
67
-
68
- // ---------------------------------------------------------------------------
69
- // MatcherView
70
- // ---------------------------------------------------------------------------
71
-
72
- /**
73
- * A lightweight, live read-only view of a Matcher instance.
74
- *
75
- * Returned by `Matcher.readOnly()`. The same instance is reused across every
76
- * callback invocation — no allocation overhead per call. Reads directly from
77
- * the parent Matcher's internal state so it always reflects the current parser
78
- * position with no copying or freezing.
79
- *
80
- * Mutation methods (`push`, `pop`, `reset`, `updateCurrent`, `restore`) are
81
- * simply absent — misuse is caught at compile time by TypeScript.
82
- *
83
- * This is the type received by all FXP user callbacks when `jPath: false`.
84
- */
85
- export class MatcherView {
86
- readonly separator: string;
87
-
88
- /** Check if current path matches an Expression. */
89
- matches(expression: Expression): boolean;
90
-
91
- /** Get current tag name, or `undefined` if path is empty. */
92
- getCurrentTag(): string | undefined;
93
-
94
- /** Get current namespace, or `undefined` if not present. */
95
- getCurrentNamespace(): string | undefined;
96
-
97
- /** Get attribute value of the current node. */
98
- getAttrValue(attrName: string): any;
99
-
100
- /** Check if the current node has a given attribute. */
101
- hasAttr(attrName: string): boolean;
102
-
103
- /** Sibling position of the current node (child index in parent). */
104
- getPosition(): number;
105
-
106
- /** Occurrence counter of the current tag name at this level. */
107
- getCounter(): number;
108
-
109
- /** Number of nodes in the current path. */
110
- getDepth(): number;
111
-
112
- /** Current path as a string (e.g. `"root.users.user"`). */
113
- toString(separator?: string, includeNamespace?: boolean): string;
114
-
115
- /** Current path as an array of tag names. */
116
- toArray(): string[];
117
- }
118
-
119
- /**
120
- * @deprecated Use {@link MatcherView} instead.
121
- * Alias kept for backward compatibility.
122
- */
123
- export type ReadonlyMatcher = MatcherView;
124
-
125
- /** Internal node structure — exposed via snapshot only. */
126
- export interface PathNode {
127
- tag: string;
128
- namespace?: string;
129
- position: number;
130
- counter: number;
131
- values?: Record<string, any>;
132
- }
133
-
134
- /** Snapshot of matcher state returned by `snapshot()` and `readOnly().snapshot()`. */
135
- export interface MatcherSnapshot {
136
- path: PathNode[];
137
- siblingStacks: Map<string, number>[];
138
- }
139
-
140
- /**********************************************************************
141
- *
142
- * END of path-expression-matcher relevant typings
143
- *
144
- **********************************************************************/
145
-
146
- // jPath: true → string
147
- // jPath: false → MatcherView
148
- type JPathOrMatcher = string | MatcherView;
149
- type JPathOrExpression = string | Expression;
150
-
151
- export type ProcessEntitiesOptions = {
152
- /**
153
- * Whether to enable entity processing
154
- *
155
- * Defaults to `true`
156
- */
157
- enabled?: boolean;
158
-
159
- /**
160
- * Maximum size in characters for a single entity definition
161
- *
162
- * Defaults to `10000`
163
- */
164
- maxEntitySize?: number;
165
-
166
- /**
167
- * Maximum depth for nested entity references (reserved for future use)
168
- *
169
- * Defaults to `10`
170
- */
171
- maxExpansionDepth?: number;
172
-
173
- /**
174
- * Maximum total number of entity expansions allowed
175
- *
176
- * Defaults to `1000`
177
- */
178
- maxTotalExpansions?: number;
179
-
180
- /**
181
- * Maximum total expanded content length in characters
182
- *
183
- * Defaults to `100000`
184
- */
185
- maxExpandedLength?: number;
186
-
187
- /**
188
- * Maximum number of entities allowed in the XML
189
- *
190
- * Defaults to `100`
191
- */
192
- maxEntityCount?: number;
193
-
194
- /**
195
- * Array of tag names where entity replacement is allowed.
196
- * If null, entities are replaced in all tags.
197
- *
198
- * Defaults to `null`
199
- */
200
- allowedTags?: string[] | null;
201
-
202
- /**
203
- * Custom filter function to determine if entities should be replaced in a tag
204
- *
205
- * @param tagName - The name of the current tag
206
- * @param jPathOrMatcher - The jPath string (if jPath: true) or Matcher instance (if jPath: false)
207
- * @returns `true` to allow entity replacement, `false` to skip
208
- *
209
- * Defaults to `null`
210
- */
211
- tagFilter?: ((tagName: string, jPathOrMatcher: JPathOrMatcher) => boolean) | null;
212
- };
213
-
214
- export type EntityDecoderOptions = {
215
- setExternalEntities: (entities: Record<string, string>) => void;
216
- addInputEntities: (entities: Record<string, string>) => void;
217
- reset: () => void;
218
- decode: (text: string) => string;
219
- setXmlVersion: (version: string) => void;
220
- }
221
-
222
- export type X2jOptions = {
223
- /**
224
- * Preserve the order of tags in resulting JS object
225
- *
226
- * Defaults to `false`
227
- */
228
- preserveOrder?: boolean;
229
-
230
- /**
231
- * Give a prefix to the attribute name in the resulting JS object
232
- *
233
- * Defaults to '@_'
234
- */
235
- attributeNamePrefix?: string;
236
-
237
- /**
238
- * A name to group all attributes of a tag under, or `false` to disable
239
- *
240
- * Defaults to `false`
241
- */
242
- attributesGroupName?: false | string;
243
-
244
- /**
245
- * The name of the next node in the resulting JS
246
- *
247
- * Defaults to `#text`
248
- */
249
- textNodeName?: string;
250
-
251
- /**
252
- * Whether to ignore attributes when parsing
253
- *
254
- * When `true` - ignores all the attributes
255
- *
256
- * When `false` - parses all the attributes
257
- *
258
- * When `Array<string | RegExp>` - filters out attributes that match provided patterns
259
- *
260
- * When `Function` - calls the function for each attribute and filters out those for which the function returned `true`
261
- *
262
- * Defaults to `true`
263
- */
264
- ignoreAttributes?: boolean | (string | RegExp)[] | ((attrName: string, jPathOrMatcher: JPathOrMatcher) => boolean);
265
-
266
- /**
267
- * Whether to remove namespace string from tag and attribute names
268
- *
269
- * Defaults to `false`
270
- */
271
- removeNSPrefix?: boolean;
272
-
273
- /**
274
- * Whether to allow attributes without value
275
- *
276
- * Defaults to `false`
277
- */
278
- allowBooleanAttributes?: boolean;
279
-
280
- /**
281
- * Whether to parse tag value with `strnum` package
282
- *
283
- * Defaults to `true`
284
- */
285
- parseTagValue?: boolean;
286
-
287
- /**
288
- * Whether to parse attribute value with `strnum` package
289
- *
290
- * Defaults to `false`
291
- */
292
- parseAttributeValue?: boolean;
293
-
294
- /**
295
- * Whether to remove surrounding whitespace from tag or attribute value
296
- *
297
- * Defaults to `true`
298
- */
299
- trimValues?: boolean;
300
-
301
- /**
302
- * Give a property name to set CDATA values to instead of merging to tag's text value
303
- *
304
- * Defaults to `false`
305
- */
306
- cdataPropName?: false | string;
307
-
308
- /**
309
- * If set, parse comments and set as this property
310
- *
311
- * Defaults to `false`
312
- */
313
- commentPropName?: false | string;
314
-
315
- /**
316
- * Control how tag value should be parsed. Called only if tag value is not empty
317
- *
318
- * @param tagName - The name of the tag
319
- * @param tagValue - The value of the tag
320
- * @param jPathOrMatcher - The jPath string (if jPath: true) or Matcher instance (if jPath: false)
321
- * @param hasAttributes - Whether the tag has attributes
322
- * @param isLeafNode - Whether the tag is a leaf node
323
- * @returns {undefined|null} `undefined` or `null` to set original value.
324
- * @returns {unknown}
325
- *
326
- * 1. Different value or value with different data type to set new value.
327
- * 2. Same value to set parsed value if `parseTagValue: true`.
328
- *
329
- * Defaults to `(tagName, val, jPathOrMatcher, hasAttributes, isLeafNode) => val`
330
- */
331
- tagValueProcessor?: (tagName: string, tagValue: string, jPathOrMatcher: JPathOrMatcher, hasAttributes: boolean, isLeafNode: boolean) => unknown;
332
-
333
- /**
334
- * Control how attribute value should be parsed
335
- *
336
- * @param attrName - The name of the attribute
337
- * @param attrValue - The value of the attribute
338
- * @param jPathOrMatcher - The jPath string (if jPath: true) or Matcher instance (if jPath: false)
339
- * @returns {undefined|null} `undefined` or `null` to set original value
340
- * @returns {unknown}
341
- *
342
- * Defaults to `(attrName, val, jPathOrMatcher) => val`
343
- */
344
- attributeValueProcessor?: (attrName: string, attrValue: string, jPathOrMatcher: JPathOrMatcher) => unknown;
345
-
346
- /**
347
- * Options to pass to `strnum` for parsing numbers
348
- *
349
- * Defaults to `{ hex: true, leadingZeros: true, eNotation: true }`
350
- */
351
- numberParseOptions?: strnumOptions;
352
-
353
- /**
354
- * Nodes to stop parsing at
355
- *
356
- * Accepts string patterns or Expression objects from path-expression-matcher
357
- *
358
- * String patterns starting with "*." are automatically converted to ".." for backward compatibility
359
- *
360
- * Defaults to `[]`
361
- */
362
- stopNodes?: JPathOrExpression[];
363
-
364
- /**
365
- * List of tags without closing tags
366
- *
367
- * Defaults to `[]`
368
- */
369
- unpairedTags?: string[];
370
-
371
- /**
372
- * Whether to always create a text node
373
- *
374
- * Defaults to `false`
375
- */
376
- alwaysCreateTextNode?: boolean;
377
-
378
- /**
379
- * Determine whether a tag should be parsed as an array
380
- *
381
- * @param tagName - The name of the tag
382
- * @param jPathOrMatcher - The jPath string (if jPath: true) or Matcher instance (if jPath: false)
383
- * @param isLeafNode - Whether the tag is a leaf node
384
- * @param isAttribute - Whether this is an attribute
385
- * @returns {boolean}
386
- *
387
- * Defaults to `() => false`
388
- */
389
- isArray?: (tagName: string, jPathOrMatcher: JPathOrMatcher, isLeafNode: boolean, isAttribute: boolean) => boolean;
390
-
391
- /**
392
- * Whether to process default and DOCTYPE entities
393
- *
394
- * When `true` - enables entity processing with default limits
395
- *
396
- * When `false` - disables all entity processing
397
- *
398
- * When `ProcessEntitiesOptions` - enables entity processing with custom configuration
399
- *
400
- * Defaults to `true`
401
- */
402
- processEntities?: boolean | ProcessEntitiesOptions;
403
-
404
- /**
405
- * Whether to process HTML entities
406
- *
407
- * Defaults to `false`
408
- * @deprecated Use `entityDecoder` instead
409
- */
410
- htmlEntities?: boolean;
411
-
412
- /**
413
- * Custom entity decoder
414
- */
415
- entityDecoder?: EntityDecoderOptions;
416
- /**
417
- * Whether to ignore the declaration tag from output
418
- *
419
- * Defaults to `false`
420
- */
421
- ignoreDeclaration?: boolean;
422
-
423
- /**
424
- * Whether to ignore Pi tags
425
- *
426
- * Defaults to `false`
427
- */
428
- ignorePiTags?: boolean;
429
-
430
- /**
431
- * Transform tag names
432
- *
433
- * Defaults to `false`
434
- */
435
- transformTagName?: ((tagName: string) => string) | false;
436
-
437
- /**
438
- * Transform attribute names
439
- *
440
- * Defaults to `false`
441
- */
442
- transformAttributeName?: ((attributeName: string) => string) | false;
443
-
444
- /**
445
- * Change the tag name when a different name is returned. Skip the tag from parsed result when false is returned.
446
- * Modify `attrs` object to control attributes for the given tag.
447
- *
448
- * @param tagName - The name of the tag
449
- * @param jPathOrMatcher - The jPath string (if jPath: true) or Matcher instance (if jPath: false)
450
- * @param attrs - The attributes object
451
- * @returns {string} new tag name.
452
- * @returns false to skip the tag
453
- *
454
- * Defaults to `(tagName, jPathOrMatcher, attrs) => tagName`
455
- */
456
- updateTag?: (tagName: string, jPathOrMatcher: JPathOrMatcher, attrs: { [k: string]: string }) => string | boolean;
457
-
458
- /**
459
- * If true, adds a Symbol to all object nodes, accessible by {@link XMLParser.getMetaDataSymbol} with
460
- * metadata about each the node in the XML file.
461
- */
462
- captureMetaData?: boolean;
463
-
464
- /**
465
- * Maximum number of nested tags
466
- *
467
- * Defaults to `100`
468
- */
469
- maxNestedTags?: number;
470
-
471
- /**
472
- * Whether to strictly validate tag names
473
- *
474
- * Defaults to `true`
475
- */
476
- strictReservedNames?: boolean;
477
-
478
- /**
479
- * Controls whether callbacks receive jPath as string or Matcher instance
480
- *
481
- * When `true` - callbacks receive jPath as string (backward compatible)
482
- *
483
- * When `false` - callbacks receive Matcher instance for advanced pattern matching
484
- *
485
- * Defaults to `true`
486
- */
487
- jPath?: boolean;
488
-
489
- /**
490
- * Function to sanitize dangerous property names
491
- *
492
- * @param name - The name of the property
493
- * @returns {string} The sanitized name
494
- *
495
- * Defaults to `(name) => __name`
496
- */
497
- onDangerousProperty?: (name: string) => string;
498
- };
499
-
500
-
501
-
502
- export type strnumOptions = {
503
- hex: boolean;
504
- leadingZeros: boolean,
505
- skipLike?: RegExp,
506
- eNotation?: boolean
507
- }
508
-
509
- export type validationOptions = {
510
- /**
511
- * Whether to allow attributes without value
512
- *
513
- * Defaults to `false`
514
- */
515
- allowBooleanAttributes?: boolean;
516
-
517
- /**
518
- * List of tags without closing tags
519
- *
520
- * Defaults to `[]`
521
- */
522
- unpairedTags?: string[];
523
- };
524
-
525
- export type XmlBuilderOptions = {
526
- /**
527
- * Give a prefix to the attribute name in the resulting JS object
528
- *
529
- * Defaults to '@_'
530
- */
531
- attributeNamePrefix?: string;
532
-
533
- /**
534
- * A name to group all attributes of a tag under, or `false` to disable
535
- *
536
- * Defaults to `false`
537
- */
538
- attributesGroupName?: false | string;
539
-
540
- /**
541
- * The name of the next node in the resulting JS
542
- *
543
- * Defaults to `#text`
544
- */
545
- textNodeName?: string;
546
-
547
- /**
548
- * Whether to ignore attributes when building
549
- *
550
- * When `true` - ignores all the attributes
551
- *
552
- * When `false` - builds all the attributes
553
- *
554
- * When `Array<string | RegExp>` - filters out attributes that match provided patterns
555
- *
556
- * When `Function` - calls the function for each attribute and filters out those for which the function returned `true`
557
- *
558
- * Defaults to `true`
559
- */
560
- ignoreAttributes?: boolean | (string | RegExp)[] | ((attrName: string, jPath: string) => boolean);
561
-
562
- /**
563
- * Give a property name to set CDATA values to instead of merging to tag's text value
564
- *
565
- * Defaults to `false`
566
- */
567
- cdataPropName?: false | string;
568
-
569
- /**
570
- * If set, parse comments and set as this property
571
- *
572
- * Defaults to `false`
573
- */
574
- commentPropName?: false | string;
575
-
576
- /**
577
- * Whether to make output pretty instead of single line
578
- *
579
- * Defaults to `false`
580
- */
581
- format?: boolean;
582
-
583
-
584
- /**
585
- * If `format` is set to `true`, sets the indent string
586
- *
587
- * Defaults to ` `
588
- */
589
- indentBy?: string;
590
-
591
- /**
592
- * Give a name to a top-level array
593
- *
594
- * Defaults to `undefined`
595
- */
596
- arrayNodeName?: string;
597
-
598
- /**
599
- * Create empty tags for tags with no text value
600
- *
601
- * Defaults to `false`
602
- */
603
- suppressEmptyNode?: boolean;
604
-
605
- /**
606
- * Suppress an unpaired tag
607
- *
608
- * Defaults to `true`
609
- */
610
- suppressUnpairedNode?: boolean;
611
-
612
- /**
613
- * Don't put a value for boolean attributes
614
- *
615
- * Defaults to `true`
616
- */
617
- suppressBooleanAttributes?: boolean;
618
-
619
- /**
620
- * Preserve the order of tags in resulting JS object
621
- *
622
- * Defaults to `false`
623
- */
624
- preserveOrder?: boolean;
625
-
626
- /**
627
- * List of tags without closing tags
628
- *
629
- * Defaults to `[]`
630
- */
631
- unpairedTags?: string[];
632
-
633
- /**
634
- * Nodes to stop parsing at
635
- *
636
- * Accepts string patterns or Expression objects from path-expression-matcher
637
- *
638
- * Defaults to `[]`
639
- */
640
- stopNodes?: JPathOrExpression[];
641
-
642
- /**
643
- * Control how tag value should be parsed. Called only if tag value is not empty
644
- *
645
- * @returns {undefined|null} `undefined` or `null` to set original value.
646
- * @returns {unknown}
647
- *
648
- * 1. Different value or value with different data type to set new value.
649
- * 2. Same value to set parsed value if `parseTagValue: true`.
650
- *
651
- * Defaults to `(tagName, val, jPath, hasAttributes, isLeafNode) => val`
652
- */
653
- tagValueProcessor?: (name: string, value: unknown) => unknown;
654
-
655
- /**
656
- * Control how attribute value should be parsed
657
- *
658
- * @param attrName
659
- * @param attrValue
660
- * @param jPath
661
- * @returns {undefined|null} `undefined` or `null` to set original value
662
- * @returns {unknown}
663
- *
664
- * Defaults to `(attrName, val, jPath) => val`
665
- */
666
- attributeValueProcessor?: (name: string, value: unknown) => unknown;
667
-
668
- /**
669
- * Whether to process default and DOCTYPE entities
670
- *
671
- * Defaults to `true`
672
- */
673
- processEntities?: boolean;
674
-
675
-
676
- oneListGroup?: boolean;
677
-
678
- /**
679
- * Maximum number of nested tags
680
- *
681
- * Defaults to `100`
682
- */
683
- maxNestedTags?: number;
684
- };
685
-
686
- type ESchema = string | object | Array<string | object>;
687
-
688
- export type ValidationError = {
689
- err: {
690
- code: string;
691
- msg: string,
692
- line: number,
693
- col: number
694
- };
695
- };
696
-
697
- export class XMLParser {
698
- constructor(options?: X2jOptions);
699
- parse(xmlData: string | Uint8Array, validationOptions?: validationOptions | boolean): any;
700
- /**
701
- * Add Entity which is not by default supported by this library
702
- * @param entityIdentifier {string} Eg: 'ent' for &ent;
703
- * @param entityValue {string} Eg: '\r'
704
- * @deprecated Use `entityDecoder` instead
705
- */
706
- addEntity(entityIdentifier: string, entityValue: string): void;
707
-
708
- /**
709
- * Returns a Symbol that can be used to access the {@link XMLMetaData}
710
- * property on a node.
711
- *
712
- * If Symbol is not available in the environment, an ordinary property is used
713
- * and the name of the property is here returned.
714
- *
715
- * The XMLMetaData property is only present when {@link X2jOptions.captureMetaData}
716
- * is true in the options.
717
- */
718
- static getMetaDataSymbol(): Symbol;
719
- }
720
-
721
- export class XMLValidator {
722
- static validate(xmlData: string, options?: validationOptions): true | ValidationError;
723
- }
724
- /**
725
- * @deprecated Use npm package 'fast-xml-builder' instead
726
- */
727
- export class XMLBuilder {
728
- constructor(options?: XmlBuilderOptions);
729
- build(jObj: any): string;
730
- }
731
-
732
- /**
733
- * This object is available on nodes via the symbol {@link XMLParser.getMetaDataSymbol}
734
- * when {@link X2jOptions.captureMetaData} is true.
735
- */
736
- export interface XMLMetaData {
737
- /** The index, if available, of the character where the XML node began in the input stream. */
738
- startIndex?: number;
739
- }