@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,715 +0,0 @@
1
- /**
2
- * TypeScript definitions for path-expression-matcher (CommonJS)
3
- */
4
-
5
- /**
6
- * Options for creating an Expression
7
- */
8
- declare interface ExpressionOptions {
9
- /**
10
- * Path separator character
11
- * @default '.'
12
- */
13
- separator?: string;
14
- }
15
-
16
- /**
17
- * Parsed segment from an expression pattern
18
- */
19
- declare interface Segment {
20
- /**
21
- * Type of segment
22
- */
23
- type: 'tag' | 'deep-wildcard';
24
-
25
- /**
26
- * Tag name (e.g., "user", "*" for wildcard)
27
- * Only present when type is 'tag'
28
- */
29
- tag?: string;
30
-
31
- /**
32
- * Namespace prefix (e.g., "ns" in "ns::user")
33
- * Only present when namespace is specified
34
- */
35
- namespace?: string;
36
-
37
- /**
38
- * Attribute name to match (e.g., "id" in "user[id]")
39
- * Only present when attribute condition exists
40
- */
41
- attrName?: string;
42
-
43
- /**
44
- * Attribute value to match (e.g., "123" in "user[id=123]")
45
- * Only present when attribute value is specified
46
- */
47
- attrValue?: string;
48
-
49
- /**
50
- * Position selector type
51
- * Only present when position selector exists
52
- */
53
- position?: 'first' | 'last' | 'odd' | 'even' | 'nth';
54
-
55
- /**
56
- * Numeric value for nth() selector
57
- * Only present when position is 'nth'
58
- */
59
- positionValue?: number;
60
- }
61
-
62
- /**
63
- * Expression - Parses and stores a tag pattern expression
64
- *
65
- * Patterns are parsed once and stored in an optimized structure for fast matching.
66
- *
67
- * @example
68
- * ```javascript
69
- * const { Expression } = require('path-expression-matcher');
70
- * const expr = new Expression("root.users.user");
71
- * const expr2 = new Expression("..user[id]:first");
72
- * const expr3 = new Expression("root/users/user", { separator: '/' });
73
- * ```
74
- *
75
- * Pattern Syntax:
76
- * - `root.users.user` - Match exact path
77
- * - `..user` - Match "user" at any depth (deep wildcard)
78
- * - `user[id]` - Match user tag with "id" attribute
79
- * - `user[id=123]` - Match user tag where id="123"
80
- * - `user:first` - Match first occurrence of user tag
81
- * - `ns::user` - Match user tag with namespace "ns"
82
- * - `ns::user[id]:first` - Combine namespace, attribute, and position
83
- * ```
84
- */
85
- declare class Expression {
86
- /**
87
- * Original pattern string
88
- */
89
- readonly pattern: string;
90
-
91
- /**
92
- * Path separator character
93
- */
94
- readonly separator: string;
95
-
96
- /**
97
- * Parsed segments
98
- */
99
- readonly segments: Segment[];
100
-
101
- /**
102
- * Create a new Expression
103
- * @param pattern - Pattern string (e.g., "root.users.user", "..user[id]")
104
- * @param options - Configuration options
105
- */
106
- constructor(pattern: string, options?: ExpressionOptions);
107
-
108
- /**
109
- * Get the number of segments
110
- */
111
- get length(): number;
112
-
113
- /**
114
- * Check if expression contains deep wildcard (..)
115
- */
116
- hasDeepWildcard(): boolean;
117
-
118
- /**
119
- * Check if expression has attribute conditions
120
- */
121
- hasAttributeCondition(): boolean;
122
-
123
- /**
124
- * Check if expression has position selectors
125
- */
126
- hasPositionSelector(): boolean;
127
-
128
- /**
129
- * Get string representation
130
- */
131
- toString(): string;
132
- }
133
-
134
- /**
135
- * Options for creating a Matcher
136
- */
137
- declare interface MatcherOptions {
138
- /**
139
- * Default path separator
140
- * @default '.'
141
- */
142
- separator?: string;
143
- }
144
-
145
- /**
146
- * Internal node structure in the path stack
147
- */
148
- declare interface PathNode {
149
- /**
150
- * Tag name
151
- */
152
- tag: string;
153
-
154
- /**
155
- * Namespace (if present)
156
- */
157
- namespace?: string;
158
-
159
- /**
160
- * Position in sibling list (child index in parent)
161
- */
162
- position: number;
163
-
164
- /**
165
- * Counter (occurrence count of this tag name)
166
- */
167
- counter: number;
168
-
169
- /**
170
- * Attribute key-value pairs
171
- * Only present for the current (last) node in path
172
- */
173
- values?: Record<string, any>;
174
- }
175
-
176
- /**
177
- * Snapshot of matcher state
178
- */
179
- declare interface MatcherSnapshot {
180
- /**
181
- * Copy of the path stack
182
- */
183
- path: PathNode[];
184
-
185
- /**
186
- * Copy of sibling tracking maps
187
- */
188
- siblingStacks: Map<string, number>[];
189
-
190
- /**
191
- * Copy of the kept-attrs stack (see {@link PushOptions.keep})
192
- */
193
- keptAttrs: KeptAttrEntry[];
194
- }
195
-
196
- /**
197
- * A single entry in the matcher's kept-attrs stack — an attribute value
198
- * explicitly retained at push time via `{ keep: [...] }` so it remains
199
- * reachable from descendants after the owning node is no longer current.
200
- */
201
- declare interface KeptAttrEntry {
202
- /** Path depth (1-based) of the node that declared this kept attribute */
203
- depth: number;
204
- /** Attribute name */
205
- name: string;
206
- /** Attribute value at push time */
207
- value: any;
208
- }
209
-
210
- /**
211
- * Options for {@link Matcher.push}
212
- */
213
- declare interface PushOptions {
214
- /**
215
- * Names of attributes (from `attrValues`) to retain for ancestor lookup
216
- * (`getAnyParentAttr` / `hasAnyParentAttr`) even after this node is no
217
- * longer the current node.
218
- *
219
- * Use sparingly — this is for attributes you know you'll need much deeper
220
- * in the tree (e.g. `xml:space`, a SOAP envelope's `version`), not a
221
- * general substitute for `getAttrValue()`. Cost is proportional to
222
- * `keep.length`, independent of path depth.
223
- */
224
- keep?: string[];
225
- }
226
-
227
- /**
228
- * ReadOnlyMatcher - A safe, read-only view over a {@link Matcher} instance.
229
- *
230
- * Returned by {@link Matcher.readOnly}. Exposes all query and inspection
231
- * methods but **throws a `TypeError`** if any state-mutating method is called
232
- * (`push`, `pop`, `reset`, `updateCurrent`, `restore`). Direct property
233
- * writes are also blocked.
234
- *
235
- * Pass this to consumers that only need to inspect or match the current path
236
- * so they cannot accidentally corrupt the parser state.
237
- *
238
- * @example
239
- * ```javascript
240
- * const matcher = new Matcher();
241
- * matcher.push("root", {});
242
- * matcher.push("users", {});
243
- * matcher.push("user", { id: "123" });
244
- *
245
- * const ro: ReadOnlyMatcher = matcher.readOnly();
246
- *
247
- * ro.matches(expr); // ✓ works
248
- * ro.getCurrentTag(); // ✓ "user"
249
- * ro.getDepth(); // ✓ 3
250
- * ro.push("child", {}); // ✗ TypeError: Cannot call 'push' on a read-only Matcher
251
- * ro.reset(); // ✗ TypeError: Cannot call 'reset' on a read-only Matcher
252
- * ```
253
- */
254
- declare interface ReadOnlyMatcher {
255
- /**
256
- * Default path separator (read-only)
257
- */
258
- readonly separator: string;
259
-
260
- /**
261
- * Current path stack (each node is a frozen copy)
262
- */
263
- readonly path: ReadonlyArray<Readonly<PathNode>>;
264
-
265
- // ── Query methods ───────────────────────────────────────────────────────────
266
-
267
- /**
268
- * Get current tag name
269
- * @returns Current tag name or undefined if path is empty
270
- */
271
- getCurrentTag(): string | undefined;
272
-
273
- /**
274
- * Get current namespace
275
- * @returns Current namespace or undefined if not present or path is empty
276
- */
277
- getCurrentNamespace(): string | undefined;
278
-
279
- /**
280
- * Get current node's attribute value
281
- * @param attrName - Attribute name
282
- * @returns Attribute value or undefined
283
- */
284
- getAttrValue(attrName: string): any;
285
-
286
- /**
287
- * Check if current node has an attribute
288
- * @param attrName - Attribute name
289
- */
290
- hasAttr(attrName: string): boolean;
291
-
292
- /**
293
- * Get the value of a "kept" attribute from the nearest ancestor (or
294
- * current node) that declared it via `push(tag, attrs, ns, { keep: [...] })`.
295
- * Unlike `getAttrValue()`, this works regardless of how deep the path has
296
- * gone since the attribute was pushed — but only for attribute names that
297
- * were explicitly marked with `keep` at push time.
298
- * @param attrName - Attribute name
299
- * @returns The kept value, or undefined if no ancestor kept this attribute
300
- */
301
- getAnyParentAttr(attrName: string): any;
302
-
303
- /**
304
- * Check whether any ancestor (or the current node) kept the given
305
- * attribute via `push(tag, attrs, ns, { keep: [...] })`.
306
- * @param attrName - Attribute name
307
- */
308
- hasAnyParentAttr(attrName: string): boolean;
309
-
310
- /**
311
- * Get current node's sibling position (child index in parent)
312
- * @returns Position index or -1 if path is empty
313
- */
314
- getPosition(): number;
315
-
316
- /**
317
- * Get current node's repeat counter (occurrence count of this tag name)
318
- * @returns Counter value or -1 if path is empty
319
- */
320
- getCounter(): number;
321
-
322
- /**
323
- * Get current node's sibling index (alias for getPosition for backward compatibility)
324
- * @returns Index or -1 if path is empty
325
- * @deprecated Use getPosition() or getCounter() instead
326
- */
327
- getIndex(): number;
328
-
329
- /**
330
- * Get current path depth
331
- * @returns Number of nodes in the path
332
- */
333
- getDepth(): number;
334
-
335
- /**
336
- * Get path as string
337
- * @param separator - Optional separator (uses default if not provided)
338
- * @param includeNamespace - Whether to include namespace in output
339
- * @returns Path string (e.g., "root.users.user" or "ns:root.ns:users.user")
340
- */
341
- toString(separator?: string, includeNamespace?: boolean): string;
342
-
343
- /**
344
- * Get path as array of tag names
345
- * @returns Array of tag names
346
- */
347
- toArray(): string[];
348
-
349
- /**
350
- * Match current path against an Expression
351
- * @param expression - The expression to match against
352
- * @returns True if current path matches the expression
353
- */
354
- matches(expression: Expression): boolean;
355
-
356
- /**
357
- * Test whether the matcher's current path matches **any** expression in the set.
358
- *
359
- * @param exprSet - A `ExpressionSet` instance
360
- * @returns `true` if at least one expression matches the current path
361
- */
362
- matchesAny(exprSet: ExpressionSet): boolean;
363
- /**
364
- * Create a snapshot of current state
365
- * @returns State snapshot that can be restored later
366
- */
367
- snapshot(): MatcherSnapshot;
368
-
369
- // ── Blocked mutating methods ────────────────────────────────────────────────
370
- // These are present in the type so callers get a compile-time error with a
371
- // helpful message instead of a silent "property does not exist" error.
372
-
373
- /**
374
- * @throws {TypeError} Always – mutation is not allowed on a read-only view.
375
- */
376
- push(tagName: string, attrValues?: Record<string, any> | null, namespace?: string | null): never;
377
-
378
- /**
379
- * @throws {TypeError} Always – mutation is not allowed on a read-only view.
380
- */
381
- pop(): never;
382
-
383
- /**
384
- * @throws {TypeError} Always – mutation is not allowed on a read-only view.
385
- */
386
- updateCurrent(attrValues: Record<string, any>): never;
387
-
388
- /**
389
- * @throws {TypeError} Always – mutation is not allowed on a read-only view.
390
- */
391
- reset(): never;
392
-
393
- /**
394
- * @throws {TypeError} Always – mutation is not allowed on a read-only view.
395
- */
396
- restore(snapshot: MatcherSnapshot): never;
397
- }
398
-
399
- /**
400
- * Matcher - Tracks current path in XML/JSON tree and matches against Expressions
401
- *
402
- * The matcher maintains a stack of nodes representing the current path from root to
403
- * current tag. It only stores attribute values for the current (top) node to minimize
404
- * memory usage.
405
- *
406
- * @example
407
- * ```javascript
408
- * const { Matcher } = require('path-expression-matcher');
409
- * const matcher = new Matcher();
410
- * matcher.push("root", {});
411
- * matcher.push("users", {});
412
- * matcher.push("user", { id: "123", type: "admin" });
413
- *
414
- * const expr = new Expression("root.users.user");
415
- * matcher.matches(expr); // true
416
- *
417
- * matcher.pop();
418
- * matcher.matches(expr); // false
419
- * ```
420
- */
421
- declare class Matcher {
422
- /**
423
- * Default path separator
424
- */
425
- readonly separator: string;
426
-
427
- /**
428
- * Current path stack
429
- */
430
- readonly path: PathNode[];
431
-
432
- /**
433
- * Create a new Matcher
434
- * @param options - Configuration options
435
- */
436
- constructor(options?: MatcherOptions);
437
-
438
- /**
439
- * Push a new tag onto the path
440
- * @param tagName - Name of the tag
441
- * @param attrValues - Attribute key-value pairs for current node (optional)
442
- * @param namespace - Namespace for the tag (optional)
443
- * @param options - Push options, e.g. `{ keep: ['version'] }` to retain
444
- * specific attributes for ancestor lookup after this node stops being current
445
- *
446
- * @example
447
- * ```javascript
448
- * matcher.push("user", { id: "123", type: "admin" });
449
- * matcher.push("user", { id: "456" }, "ns");
450
- * matcher.push("container", null);
451
- * matcher.push("Body", { version: "1.1" }, "soap", { keep: ["version"] });
452
- * ```
453
- */
454
- push(
455
- tagName: string,
456
- attrValues?: Record<string, any> | null,
457
- namespace?: string | null,
458
- options?: PushOptions | null
459
- ): void;
460
-
461
- /**
462
- * Pop the last tag from the path
463
- * @returns The popped node or undefined if path is empty
464
- */
465
- pop(): PathNode | undefined;
466
-
467
- /**
468
- * Update current node's attribute values
469
- * Useful when attributes are parsed after push
470
- * @param attrValues - Attribute values
471
- */
472
- updateCurrent(attrValues: Record<string, any>): void;
473
-
474
- /**
475
- * Get current tag name
476
- * @returns Current tag name or undefined if path is empty
477
- */
478
- getCurrentTag(): string | undefined;
479
-
480
- /**
481
- * Get current namespace
482
- * @returns Current namespace or undefined if not present or path is empty
483
- */
484
- getCurrentNamespace(): string | undefined;
485
-
486
- /**
487
- * Get current node's attribute value
488
- * @param attrName - Attribute name
489
- * @returns Attribute value or undefined
490
- */
491
- getAttrValue(attrName: string): any;
492
-
493
- /**
494
- * Check if current node has an attribute
495
- * @param attrName - Attribute name
496
- */
497
- hasAttr(attrName: string): boolean;
498
-
499
- /**
500
- * Get the value of a "kept" attribute from the nearest ancestor (or current
501
- * node) that declared it via `push(tag, attrs, ns, { keep: [...] })`.
502
- * Cost is proportional to the number of currently-kept attributes, not
503
- * path depth.
504
- * @param attrName - Attribute name
505
- * @returns The kept value, or undefined if no ancestor kept this attribute
506
- */
507
- getAnyParentAttr(attrName: string): any;
508
-
509
- /**
510
- * Check whether any ancestor (or the current node) kept the given
511
- * attribute via `push(tag, attrs, ns, { keep: [...] })`.
512
- * @param attrName - Attribute name
513
- */
514
- hasAnyParentAttr(attrName: string): boolean;
515
-
516
- /**
517
- * Get current node's sibling position (child index in parent)
518
- * @returns Position index or -1 if path is empty
519
- */
520
- getPosition(): number;
521
-
522
- /**
523
- * Get current node's repeat counter (occurrence count of this tag name)
524
- * @returns Counter value or -1 if path is empty
525
- */
526
- getCounter(): number;
527
-
528
- /**
529
- * Get current node's sibling index (alias for getPosition for backward compatibility)
530
- * @returns Index or -1 if path is empty
531
- * @deprecated Use getPosition() or getCounter() instead
532
- */
533
- getIndex(): number;
534
-
535
- /**
536
- * Get current path depth
537
- * @returns Number of nodes in the path
538
- */
539
- getDepth(): number;
540
-
541
- /**
542
- * Get path as string
543
- * @param separator - Optional separator (uses default if not provided)
544
- * @param includeNamespace - Whether to include namespace in output
545
- * @returns Path string (e.g., "root.users.user" or "ns:root.ns:users.user")
546
- */
547
- toString(separator?: string, includeNamespace?: boolean): string;
548
-
549
- /**
550
- * Get path as array of tag names
551
- * @returns Array of tag names
552
- */
553
- toArray(): string[];
554
-
555
- /**
556
- * Reset the path to empty
557
- */
558
- reset(): void;
559
-
560
- /**
561
- * Match current path against an Expression
562
- * @param expression - The expression to match against
563
- * @returns True if current path matches the expression
564
- *
565
- * @example
566
- * ```javascript
567
- * const expr = new Expression("root.users.user[id]");
568
- * const matcher = new Matcher();
569
- *
570
- * matcher.push("root");
571
- * matcher.push("users");
572
- * matcher.push("user", { id: "123" });
573
- *
574
- * matcher.matches(expr); // true
575
- * ```
576
- */
577
- matches(expression: Expression): boolean;
578
-
579
-
580
- /**
581
- * Test whether the matcher's current path matches **any** expression in the set.
582
- *
583
- * Uses the pre-built index to evaluate only the relevant bucket(s):
584
- * 1. Exact depth + tag — O(1) lookup
585
- * 2. Depth-matched wildcard tag — O(1) lookup
586
- * 3. Deep-wildcard expressions — always scanned (typically a small list)
587
- *
588
- * @param exprSet - A `ExpressionSet` instance
589
- * @returns `true` if at least one expression matches the current path
590
- *
591
- * @example
592
- * ```typescript
593
- * // Replaces:
594
- * // for (const expr of stopNodeExpressions) {
595
- * // if (matcher.matches(expr)) return true;
596
- * // }
597
- *
598
- * if (matcher.matchesAny(stopNodes)) {
599
- * // current tag is a stop node
600
- * }
601
- * ```
602
- */
603
- matchesAny(exprSet: ExpressionSet): boolean;
604
- /**
605
- * Create a snapshot of current state
606
- * @returns State snapshot that can be restored later
607
- */
608
- snapshot(): MatcherSnapshot;
609
-
610
- /**
611
- * Restore state from snapshot
612
- * @param snapshot - State snapshot from previous snapshot() call
613
- */
614
- restore(snapshot: MatcherSnapshot): void;
615
-
616
- /**
617
- * Return a read-only view of this matcher.
618
- */
619
- readOnly(): ReadOnlyMatcher;
620
- }
621
-
622
- /**
623
- * ExpressionSet - An indexed collection of Expressions for efficient bulk matching
624
- *
625
- * Pre-indexes expressions at insertion time by depth and terminal tag name so
626
- * that `matchesAny()` performs an O(1) bucket lookup rather than a full O(E)
627
- * linear scan on every tag.
628
- *
629
- * @example
630
- * ```javascript
631
- * const { Expression, ExpressionSet, Matcher } = require('path-expression-matcher');
632
- *
633
- * // Build once at config time
634
- * const stopNodes = new ExpressionSet();
635
- * stopNodes
636
- * .add(new Expression('root.users.user'))
637
- * .add(new Expression('root.config.*'))
638
- * .add(new Expression('..script'))
639
- * .seal();
640
- *
641
- * // Per-tag — hot path
642
- * if (stopNodes.matchesAny(matcher)) { ... }
643
- * ```
644
- */
645
- declare class ExpressionSet {
646
- constructor();
647
-
648
- /** Number of expressions currently in the set. */
649
- readonly size: number;
650
-
651
- /** Whether the set has been sealed against further modifications. */
652
- readonly isSealed: boolean;
653
-
654
- /**
655
- * Add a single Expression. Duplicate patterns are silently ignored.
656
- * @throws {TypeError} if the set has been sealed
657
- */
658
- add(expression: Expression): this;
659
-
660
- /**
661
- * Add multiple expressions at once.
662
- * @throws {TypeError} if the set has been sealed
663
- */
664
- addAll(expressions: Expression[]): this;
665
-
666
- /** Check whether an expression with the same pattern is already present. */
667
- has(expression: Expression): boolean;
668
-
669
- /**
670
- * Seal the set against further modifications.
671
- * Any subsequent call to add() or addAll() will throw a TypeError.
672
- */
673
- seal(): this;
674
-
675
- /**
676
- * Test whether the matcher's current path matches any expression in the set.
677
- * Accepts both a Matcher instance and a ReadOnlyMatcher view.
678
- *
679
- *
680
- * @param matcher - A `Matcher` instance or a `ReadOnlyMatcher` view
681
- * @returns Expression if at least one expression matches the current path
682
- */
683
- matchesAny(matcher: Matcher | ReadOnlyMatcher): boolean;
684
-
685
- /**
686
- * Find the first expression in the set that matches the matcher's current path.
687
-
688
- *
689
- * @param matcher - A `Matcher` instance or a `ReadOnlyMatcher` view
690
- * @returns Expression if at least one expression matches the current path
691
- *
692
- * @example
693
- * ```typescript
694
- * const node = stopNodes.findMatch(matcher);
695
- * ```
696
- */
697
- findMatch(matcher: Matcher | ReadOnlyMatcher): Expression;
698
- }
699
-
700
- declare namespace pathExpressionMatcher {
701
- export {
702
- Expression,
703
- Matcher,
704
- ExpressionSet,
705
- ExpressionOptions,
706
- MatcherOptions,
707
- Segment,
708
- PathNode,
709
- MatcherSnapshot,
710
- KeptAttrEntry,
711
- PushOptions,
712
- };
713
- }
714
-
715
- export = pathExpressionMatcher;