@cdk8s/awscdk-resolver 0.0.608 → 0.0.610

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 +6 -6
  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,770 +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
- 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
- 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
- declare 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
- interface 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
- * Create a snapshot of the current state.
120
- * The snapshot can be passed to the real Matcher.restore() if needed.
121
- */
122
- snapshot(): MatcherSnapshot;
123
- }
124
-
125
- /**
126
- * @deprecated Use {@link MatcherView} instead.
127
- * Alias kept for backward compatibility.
128
- */
129
- type ReadonlyMatcher = MatcherView;
130
-
131
- /** Internal node structure — exposed via snapshot only. */
132
- interface PathNode {
133
- tag: string;
134
- namespace?: string;
135
- position: number;
136
- counter: number;
137
- values?: Record<string, any>;
138
- }
139
-
140
- /** Snapshot of matcher state returned by `snapshot()` and `readOnly().snapshot()`. */
141
- interface MatcherSnapshot {
142
- path: PathNode[];
143
- siblingStacks: Map<string, number>[];
144
- }
145
-
146
- /**********************************************************************
147
- *
148
- * END of path-expression-matcher relevant typings
149
- *
150
- **********************************************************************/
151
-
152
-
153
-
154
- // jPath: true → string
155
- // jPath: false → MatcherView
156
- type JPathOrMatcher = string | MatcherView;
157
- type JPathOrExpression = string | Expression;
158
-
159
- type ProcessEntitiesOptions = {
160
- /**
161
- * Whether to enable entity processing
162
- *
163
- * Defaults to `true`
164
- */
165
- enabled?: boolean;
166
-
167
- /**
168
- * Maximum size in characters for a single entity definition
169
- *
170
- * Defaults to `10000`
171
- */
172
- maxEntitySize?: number;
173
-
174
- /**
175
- * Maximum depth for nested entity references (reserved for future use)
176
- *
177
- * Defaults to `10`
178
- */
179
- maxExpansionDepth?: number;
180
-
181
- /**
182
- * Maximum total number of entity expansions allowed
183
- *
184
- * Defaults to `1000`
185
- */
186
- maxTotalExpansions?: number;
187
-
188
- /**
189
- * Maximum total expanded content length in characters
190
- *
191
- * Defaults to `100000`
192
- */
193
- maxExpandedLength?: number;
194
-
195
- /**
196
- * Maximum number of entities allowed in the XML
197
- *
198
- * Defaults to `100`
199
- */
200
- maxEntityCount?: number;
201
-
202
- /**
203
- * Array of tag names where entity replacement is allowed.
204
- * If null, entities are replaced in all tags.
205
- *
206
- * Defaults to `null`
207
- */
208
- allowedTags?: string[] | null;
209
-
210
- /**
211
- * Custom filter function to determine if entities should be replaced in a tag
212
- *
213
- * @param tagName - The name of the current tag
214
- * @param jPathOrMatcher - The jPath string (if jPath: true) or Matcher instance (if jPath: false)
215
- * @returns `true` to allow entity replacement, `false` to skip
216
- *
217
- * Defaults to `null`
218
- */
219
- tagFilter?: ((tagName: string, jPathOrMatcher: JPathOrMatcher) => boolean) | null;
220
- };
221
-
222
- type EntityDecoderOptions = {
223
- setExternalEntities: (entities: Record<string, string>) => void;
224
- addInputEntities: (entities: Record<string, string>) => void;
225
- reset: () => void;
226
- decode: (text: string) => string;
227
- setXmlVersion: (version: string) => void;
228
- }
229
-
230
- type X2jOptions = {
231
- /**
232
- * Preserve the order of tags in resulting JS object
233
- *
234
- * Defaults to `false`
235
- */
236
- preserveOrder?: boolean;
237
-
238
- /**
239
- * Give a prefix to the attribute name in the resulting JS object
240
- *
241
- * Defaults to '@_'
242
- */
243
- attributeNamePrefix?: string;
244
-
245
- /**
246
- * A name to group all attributes of a tag under, or `false` to disable
247
- *
248
- * Defaults to `false`
249
- */
250
- attributesGroupName?: false | string;
251
-
252
- /**
253
- * The name of the next node in the resulting JS
254
- *
255
- * Defaults to `#text`
256
- */
257
- textNodeName?: string;
258
-
259
- /**
260
- * Whether to ignore attributes when parsing
261
- *
262
- * When `true` - ignores all the attributes
263
- *
264
- * When `false` - parses all the attributes
265
- *
266
- * When `Array<string | RegExp>` - filters out attributes that match provided patterns
267
- *
268
- * When `Function` - calls the function for each attribute and filters out those for which the function returned `true`
269
- *
270
- * Defaults to `true`
271
- */
272
- ignoreAttributes?: boolean | (string | RegExp)[] | ((attrName: string, jPathOrMatcher: JPathOrMatcher) => boolean);
273
-
274
- /**
275
- * Whether to remove namespace string from tag and attribute names
276
- *
277
- * Defaults to `false`
278
- */
279
- removeNSPrefix?: boolean;
280
-
281
- /**
282
- * Whether to allow attributes without value
283
- *
284
- * Defaults to `false`
285
- */
286
- allowBooleanAttributes?: boolean;
287
-
288
- /**
289
- * Whether to parse tag value with `strnum` package
290
- *
291
- * Defaults to `true`
292
- */
293
- parseTagValue?: boolean;
294
-
295
- /**
296
- * Whether to parse attribute value with `strnum` package
297
- *
298
- * Defaults to `false`
299
- */
300
- parseAttributeValue?: boolean;
301
-
302
- /**
303
- * Whether to remove surrounding whitespace from tag or attribute value
304
- *
305
- * Defaults to `true`
306
- */
307
- trimValues?: boolean;
308
-
309
- /**
310
- * Give a property name to set CDATA values to instead of merging to tag's text value
311
- *
312
- * Defaults to `false`
313
- */
314
- cdataPropName?: false | string;
315
-
316
- /**
317
- * If set, parse comments and set as this property
318
- *
319
- * Defaults to `false`
320
- */
321
- commentPropName?: false | string;
322
-
323
- /**
324
- * Control how tag value should be parsed. Called only if tag value is not empty
325
- *
326
- * @param tagName - The name of the tag
327
- * @param tagValue - The value of the tag
328
- * @param jPathOrMatcher - The jPath string (if jPath: true) or Matcher instance (if jPath: false)
329
- * @param hasAttributes - Whether the tag has attributes
330
- * @param isLeafNode - Whether the tag is a leaf node
331
- * @returns {undefined|null} `undefined` or `null` to set original value.
332
- * @returns {unknown}
333
- *
334
- * 1. Different value or value with different data type to set new value.
335
- * 2. Same value to set parsed value if `parseTagValue: true`.
336
- *
337
- * Defaults to `(tagName, val, jPathOrMatcher, hasAttributes, isLeafNode) => val`
338
- */
339
- tagValueProcessor?: (tagName: string, tagValue: string, jPathOrMatcher: JPathOrMatcher, hasAttributes: boolean, isLeafNode: boolean) => unknown;
340
-
341
- /**
342
- * Control how attribute value should be parsed
343
- *
344
- * @param attrName - The name of the attribute
345
- * @param attrValue - The value of the attribute
346
- * @param jPathOrMatcher - The jPath string (if jPath: true) or Matcher instance (if jPath: false)
347
- * @returns {undefined|null} `undefined` or `null` to set original value
348
- * @returns {unknown}
349
- *
350
- * Defaults to `(attrName, val, jPathOrMatcher) => val`
351
- */
352
- attributeValueProcessor?: (attrName: string, attrValue: string, jPathOrMatcher: JPathOrMatcher) => unknown;
353
-
354
- /**
355
- * Options to pass to `strnum` for parsing numbers
356
- *
357
- * Defaults to `{ hex: true, leadingZeros: true, eNotation: true }`
358
- */
359
- numberParseOptions?: strnumOptions;
360
-
361
- /**
362
- * Nodes to stop parsing at
363
- *
364
- * Accepts string patterns or Expression objects from path-expression-matcher
365
- *
366
- * String patterns starting with "*." are automatically converted to ".." for backward compatibility
367
- *
368
- * Defaults to `[]`
369
- */
370
- stopNodes?: JPathOrExpression[];
371
-
372
- /**
373
- * List of tags without closing tags
374
- *
375
- * Defaults to `[]`
376
- */
377
- unpairedTags?: string[];
378
-
379
- /**
380
- * Whether to always create a text node
381
- *
382
- * Defaults to `false`
383
- */
384
- alwaysCreateTextNode?: boolean;
385
-
386
- /**
387
- * Determine whether a tag should be parsed as an array
388
- *
389
- * @param tagName - The name of the tag
390
- * @param jPathOrMatcher - The jPath string (if jPath: true) or Matcher instance (if jPath: false)
391
- * @param isLeafNode - Whether the tag is a leaf node
392
- * @param isAttribute - Whether this is an attribute
393
- * @returns {boolean}
394
- *
395
- * Defaults to `() => false`
396
- */
397
- isArray?: (tagName: string, jPathOrMatcher: JPathOrMatcher, isLeafNode: boolean, isAttribute: boolean) => boolean;
398
-
399
- /**
400
- * Whether to process default and DOCTYPE entities
401
- *
402
- * When `true` - enables entity processing with default limits
403
- *
404
- * When `false` - disables all entity processing
405
- *
406
- * When `ProcessEntitiesOptions` - enables entity processing with custom configuration
407
- *
408
- * Defaults to `true`
409
- */
410
- processEntities?: boolean | ProcessEntitiesOptions;
411
-
412
- /**
413
- * Whether to process HTML entities
414
- *
415
- * Defaults to `false`
416
- * @deprecated Use `entityDecoder` instead
417
- */
418
- htmlEntities?: boolean;
419
-
420
- /**
421
- * Custom entity decoder
422
- */
423
- entityDecoder?: EntityDecoderOptions;
424
- /**
425
- * Whether to ignore the declaration tag from output
426
- *
427
- * Defaults to `false`
428
- */
429
- ignoreDeclaration?: boolean;
430
-
431
- /**
432
- * Whether to ignore Pi tags
433
- *
434
- * Defaults to `false`
435
- */
436
- ignorePiTags?: boolean;
437
-
438
- /**
439
- * Transform tag names
440
- *
441
- * Defaults to `false`
442
- */
443
- transformTagName?: ((tagName: string) => string) | false;
444
-
445
- /**
446
- * Transform attribute names
447
- *
448
- * Defaults to `false`
449
- */
450
- transformAttributeName?: ((attributeName: string) => string) | false;
451
-
452
- /**
453
- * Change the tag name when a different name is returned. Skip the tag from parsed result when false is returned.
454
- * Modify `attrs` object to control attributes for the given tag.
455
- *
456
- * @param tagName - The name of the tag
457
- * @param jPathOrMatcher - The jPath string (if jPath: true) or Matcher instance (if jPath: false)
458
- * @param attrs - The attributes object
459
- * @returns {string} new tag name.
460
- * @returns false to skip the tag
461
- *
462
- * Defaults to `(tagName, jPathOrMatcher, attrs) => tagName`
463
- */
464
- updateTag?: (tagName: string, jPathOrMatcher: JPathOrMatcher, attrs: { [k: string]: string }) => string | boolean;
465
-
466
- /**
467
- * If true, adds a Symbol to all object nodes, accessible by {@link XMLParser.getMetaDataSymbol} with
468
- * metadata about each the node in the XML file.
469
- */
470
- captureMetaData?: boolean;
471
-
472
- /**
473
- * Maximum number of nested tags
474
- *
475
- * Defaults to `100`
476
- */
477
- maxNestedTags?: number;
478
-
479
- /**
480
- * Whether to strictly validate tag names
481
- *
482
- * Defaults to `true`
483
- */
484
- strictReservedNames?: boolean;
485
-
486
- /**
487
- * Controls whether callbacks receive jPath as string or Matcher instance
488
- *
489
- * When `true` - callbacks receive jPath as string (backward compatible)
490
- *
491
- * When `false` - callbacks receive Matcher instance for advanced pattern matching
492
- *
493
- * Defaults to `true`
494
- */
495
- jPath?: boolean;
496
-
497
- /**
498
- * Function to sanitize dangerous property names
499
- *
500
- * @param name - The name of the property
501
- * @returns {string} The sanitized name
502
- *
503
- * Defaults to `(name) => __name`
504
- */
505
- onDangerousProperty?: (name: string) => string;
506
- };
507
-
508
- type strnumOptions = {
509
- hex: boolean;
510
- leadingZeros: boolean,
511
- skipLike?: RegExp,
512
- eNotation?: boolean
513
- }
514
-
515
- type validationOptions = {
516
- /**
517
- * Whether to allow attributes without value
518
- *
519
- * Defaults to `false`
520
- */
521
- allowBooleanAttributes?: boolean;
522
-
523
- /**
524
- * List of tags without closing tags
525
- *
526
- * Defaults to `[]`
527
- */
528
- unpairedTags?: string[];
529
- };
530
-
531
- type XmlBuilderOptions = {
532
- /**
533
- * Give a prefix to the attribute name in the resulting JS object
534
- *
535
- * Defaults to '@_'
536
- */
537
- attributeNamePrefix?: string;
538
-
539
- /**
540
- * A name to group all attributes of a tag under, or `false` to disable
541
- *
542
- * Defaults to `false`
543
- */
544
- attributesGroupName?: false | string;
545
-
546
- /**
547
- * The name of the next node in the resulting JS
548
- *
549
- * Defaults to `#text`
550
- */
551
- textNodeName?: string;
552
-
553
- /**
554
- * Whether to ignore attributes when building
555
- *
556
- * When `true` - ignores all the attributes
557
- *
558
- * When `false` - builds all the attributes
559
- *
560
- * When `Array<string | RegExp>` - filters out attributes that match provided patterns
561
- *
562
- * When `Function` - calls the function for each attribute and filters out those for which the function returned `true`
563
- *
564
- * Defaults to `true`
565
- */
566
- ignoreAttributes?: boolean | (string | RegExp)[] | ((attrName: string, jPath: string) => boolean);
567
-
568
- /**
569
- * Give a property name to set CDATA values to instead of merging to tag's text value
570
- *
571
- * Defaults to `false`
572
- */
573
- cdataPropName?: false | string;
574
-
575
- /**
576
- * If set, parse comments and set as this property
577
- *
578
- * Defaults to `false`
579
- */
580
- commentPropName?: false | string;
581
-
582
- /**
583
- * Whether to make output pretty instead of single line
584
- *
585
- * Defaults to `false`
586
- */
587
- format?: boolean;
588
-
589
-
590
- /**
591
- * If `format` is set to `true`, sets the indent string
592
- *
593
- * Defaults to ` `
594
- */
595
- indentBy?: string;
596
-
597
- /**
598
- * Give a name to a top-level array
599
- *
600
- * Defaults to `undefined`
601
- */
602
- arrayNodeName?: string;
603
-
604
- /**
605
- * Create empty tags for tags with no text value
606
- *
607
- * Defaults to `false`
608
- */
609
- suppressEmptyNode?: boolean;
610
-
611
- /**
612
- * Suppress an unpaired tag
613
- *
614
- * Defaults to `true`
615
- */
616
- suppressUnpairedNode?: boolean;
617
-
618
- /**
619
- * Don't put a value for boolean attributes
620
- *
621
- * Defaults to `true`
622
- */
623
- suppressBooleanAttributes?: boolean;
624
-
625
- /**
626
- * Preserve the order of tags in resulting JS object
627
- *
628
- * Defaults to `false`
629
- */
630
- preserveOrder?: boolean;
631
-
632
- /**
633
- * List of tags without closing tags
634
- *
635
- * Defaults to `[]`
636
- */
637
- unpairedTags?: string[];
638
-
639
- /**
640
- * Nodes to stop parsing at
641
- *
642
- * Accepts string patterns or Expression objects from path-expression-matcher
643
- *
644
- * Defaults to `[]`
645
- */
646
- stopNodes?: JPathOrExpression[];
647
-
648
- /**
649
- * Control how tag value should be parsed. Called only if tag value is not empty
650
- *
651
- * @returns {undefined|null} `undefined` or `null` to set original value.
652
- * @returns {unknown}
653
- *
654
- * 1. Different value or value with different data type to set new value.
655
- * 2. Same value to set parsed value if `parseTagValue: true`.
656
- *
657
- * Defaults to `(tagName, val, jPath, hasAttributes, isLeafNode) => val`
658
- */
659
- tagValueProcessor?: (name: string, value: unknown) => unknown;
660
-
661
- /**
662
- * Control how attribute value should be parsed
663
- *
664
- * @param attrName
665
- * @param attrValue
666
- * @param jPath
667
- * @returns {undefined|null} `undefined` or `null` to set original value
668
- * @returns {unknown}
669
- *
670
- * Defaults to `(attrName, val, jPath) => val`
671
- */
672
- attributeValueProcessor?: (name: string, value: unknown) => unknown;
673
-
674
- /**
675
- * Whether to process default and DOCTYPE entities
676
- *
677
- * Defaults to `true`
678
- */
679
- processEntities?: boolean;
680
-
681
-
682
- oneListGroup?: boolean;
683
-
684
- /**
685
- * Maximum number of nested tags
686
- *
687
- * Defaults to `100`
688
- */
689
- maxNestedTags?: number;
690
- };
691
-
692
- type ESchema = string | object | Array<string | object>;
693
-
694
- type ValidationError = {
695
- err: {
696
- code: string;
697
- msg: string,
698
- line: number,
699
- col: number
700
- };
701
- };
702
-
703
- declare class XMLParser {
704
- constructor(options?: X2jOptions);
705
- parse(xmlData: string | Uint8Array, validationOptions?: validationOptions | boolean): any;
706
- /**
707
- * Add Entity which is not by default supported by this library
708
- * @param entityIdentifier {string} Eg: 'ent' for &ent;
709
- * @param entityValue {string} Eg: '\r'
710
- * @deprecated Use `entityDecoder` instead
711
- */
712
- addEntity(entityIdentifier: string, entityValue: string): void;
713
-
714
- /**
715
- * Returns a Symbol that can be used to access the {@link XMLMetaData}
716
- * property on a node.
717
- *
718
- * If Symbol is not available in the environment, an ordinary property is used
719
- * and the name of the property is here returned.
720
- *
721
- * The XMLMetaData property is only present when {@link X2jOptions.captureMetaData}
722
- * is true in the options.
723
- */
724
- static getMetaDataSymbol(): Symbol;
725
- }
726
-
727
- declare class XMLValidator {
728
- static validate(xmlData: string, options?: validationOptions): true | ValidationError;
729
- }
730
- /**
731
- * @deprecated Use npm package 'fast-xml-builder' instead
732
- */
733
- declare class XMLBuilder {
734
- constructor(options?: XmlBuilderOptions);
735
- build(jObj: any): string;
736
- }
737
-
738
-
739
- /**
740
- * This object is available on nodes via the symbol {@link XMLParser.getMetaDataSymbol}
741
- * when {@link X2jOptions.captureMetaData} is true.
742
- */
743
- declare interface XMLMetaData {
744
- /** The index, if available, of the character where the XML node began in the input stream. */
745
- startIndex?: number;
746
- }
747
-
748
- declare namespace fxp {
749
- export {
750
- XMLParser,
751
- XMLValidator,
752
- XMLBuilder,
753
- XMLMetaData,
754
- XmlBuilderOptions,
755
- X2jOptions,
756
- ESchema,
757
- ValidationError,
758
- strnumOptions,
759
- validationOptions,
760
- ProcessEntitiesOptions,
761
- Expression,
762
- ReadonlyMatcher,
763
- MatcherView,
764
- JPathOrMatcher,
765
- JPathOrExpression,
766
- EntityDecoderOptions
767
- }
768
- }
769
-
770
- export = fxp;