@cdklabs/cdk-ecs-codedeploy 0.0.432 → 0.0.434

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 (274) hide show
  1. package/.jsii +3 -3
  2. package/.jsii.tabl.json +1 -1
  3. package/lib/api-canary/index.js +1 -1
  4. package/lib/ecs-appspec/index.js +1 -1
  5. package/lib/ecs-deployment/index.js +1 -1
  6. package/lib/ecs-patterns/application-load-balanced-codedeployed-fargate-service.js +1 -1
  7. package/node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js +2 -2
  8. package/node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js +2 -2
  9. package/node_modules/@aws/lambda-invoke-store/dist-types/invoke-store.d.ts +1 -1
  10. package/node_modules/@aws/lambda-invoke-store/package.json +1 -1
  11. package/node_modules/@aws-sdk/client-codedeploy/README.md +26 -46
  12. package/node_modules/@aws-sdk/client-codedeploy/package.json +34 -34
  13. package/node_modules/@aws-sdk/core/dist-cjs/index.js +4 -0
  14. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +4 -0
  15. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +2 -0
  16. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js +3 -0
  17. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +2 -0
  18. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +4 -0
  19. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/QuerySerializerSettings.d.ts +3 -0
  20. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +2 -0
  21. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +1 -0
  22. package/node_modules/@aws-sdk/core/package.json +11 -11
  23. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  24. package/node_modules/@aws-sdk/credential-provider-http/package.json +10 -10
  25. package/node_modules/@aws-sdk/credential-provider-ini/package.json +14 -14
  26. package/node_modules/@aws-sdk/credential-provider-login/package.json +8 -8
  27. package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
  28. package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
  29. package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
  30. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
  31. package/node_modules/@aws-sdk/middleware-host-header/package.json +4 -4
  32. package/node_modules/@aws-sdk/middleware-logger/package.json +3 -3
  33. package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +4 -4
  34. package/node_modules/@aws-sdk/middleware-user-agent/package.json +8 -8
  35. package/node_modules/@aws-sdk/nested-clients/package.json +32 -32
  36. package/node_modules/@aws-sdk/region-config-resolver/package.json +5 -5
  37. package/node_modules/@aws-sdk/token-providers/package.json +7 -7
  38. package/node_modules/@aws-sdk/types/package.json +2 -2
  39. package/node_modules/@aws-sdk/util-endpoints/package.json +5 -5
  40. package/node_modules/@aws-sdk/util-user-agent-browser/package.json +3 -3
  41. package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +75 -19
  42. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getNodeModulesParentDirs.js +15 -0
  43. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedDevTypeScriptVersion.js +14 -0
  44. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js +53 -7
  45. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/{getTypeScriptPackageJsonPaths.d.ts → getNodeModulesParentDirs.d.ts} +2 -2
  46. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/getSanitizedDevTypeScriptVersion.d.ts +8 -0
  47. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getNodeModulesParentDirs.d.ts +1 -0
  48. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getSanitizedDevTypeScriptVersion.d.ts +3 -0
  49. package/node_modules/@aws-sdk/util-user-agent-node/package.json +6 -5
  50. package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +21 -11
  51. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +5 -1
  52. package/node_modules/@aws-sdk/xml-builder/dist-es/escape-attribute.js +8 -1
  53. package/node_modules/@aws-sdk/xml-builder/dist-es/escape-element.js +13 -10
  54. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +5 -1
  55. package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/CHANGELOG.md +40 -4
  56. package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/README.md +8 -7
  57. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
  58. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
  59. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
  60. package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxp.d.cts +82 -20
  61. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
  62. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
  63. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
  64. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
  65. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
  66. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/pem.d.cts +148 -0
  67. package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/package.json +4 -3
  68. package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/fxp.d.ts +75 -19
  69. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/pem.d.ts +135 -0
  70. package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/util.js +18 -0
  71. package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/DocTypeReader.js +37 -18
  72. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +159 -0
  73. package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/OrderedObjParser.js +298 -116
  74. package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/XMLParser.js +2 -2
  75. package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/node2json.js +65 -15
  76. package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/CHANGELOG.md +9 -2
  77. package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/package.json +1 -1
  78. package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/strnum.js +12 -6
  79. package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/tests/strnum_test.js +3 -0
  80. package/node_modules/@aws-sdk/xml-builder/node_modules/strnum/tests/temp.js +8 -0
  81. package/node_modules/@aws-sdk/xml-builder/package.json +3 -3
  82. package/node_modules/@smithy/abort-controller/package.json +2 -2
  83. package/node_modules/@smithy/config-resolver/dist-cjs/index.js +12 -0
  84. package/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js +5 -0
  85. package/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js +5 -0
  86. package/node_modules/@smithy/config-resolver/dist-types/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts +6 -0
  87. package/node_modules/@smithy/config-resolver/dist-types/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts +6 -0
  88. package/node_modules/@smithy/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts +6 -0
  89. package/node_modules/@smithy/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts +6 -0
  90. package/node_modules/@smithy/config-resolver/package.json +5 -5
  91. package/node_modules/@smithy/core/dist-cjs/index.js +1 -2
  92. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +7 -1
  93. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +22 -0
  94. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +11 -1
  95. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +41 -4
  96. package/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +1 -2
  97. package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +7 -1
  98. package/node_modules/@smithy/core/dist-es/submodules/endpoints/index.js +1 -0
  99. package/node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js +17 -0
  100. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +10 -0
  101. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +1 -1
  102. package/node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js +3 -2
  103. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +30 -1
  104. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js +5 -1
  105. package/node_modules/@smithy/core/dist-types/submodules/endpoints/index.d.ts +1 -0
  106. package/node_modules/@smithy/core/dist-types/submodules/endpoints/toEndpointV1.d.ts +6 -0
  107. package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +11 -0
  108. package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/translateTraits.d.ts +6 -0
  109. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/index.d.ts +1 -0
  110. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/toEndpointV1.d.ts +6 -0
  111. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +11 -0
  112. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/translateTraits.d.ts +6 -0
  113. package/node_modules/@smithy/core/endpoints.d.ts +7 -0
  114. package/node_modules/@smithy/core/endpoints.js +6 -0
  115. package/node_modules/@smithy/core/package.json +16 -7
  116. package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
  117. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +4 -1
  118. package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +4 -1
  119. package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
  120. package/node_modules/@smithy/hash-node/package.json +2 -2
  121. package/node_modules/@smithy/invalid-dependency/package.json +2 -2
  122. package/node_modules/@smithy/middleware-content-length/package.json +3 -3
  123. package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +17 -1
  124. package/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js +9 -0
  125. package/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js +8 -1
  126. package/node_modules/@smithy/middleware-endpoint/dist-types/adaptors/toEndpointV1.d.ts +1 -0
  127. package/node_modules/@smithy/middleware-endpoint/dist-types/resolveEndpointConfig.d.ts +2 -2
  128. package/node_modules/@smithy/middleware-endpoint/dist-types/ts3.4/adaptors/toEndpointV1.d.ts +1 -0
  129. package/node_modules/@smithy/middleware-endpoint/dist-types/ts3.4/resolveEndpointConfig.d.ts +2 -2
  130. package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
  131. package/node_modules/@smithy/middleware-retry/dist-cjs/index.js +9 -12
  132. package/node_modules/@smithy/middleware-retry/dist-es/configurations.js +9 -12
  133. package/node_modules/@smithy/middleware-retry/package.json +8 -8
  134. package/node_modules/@smithy/middleware-serde/dist-cjs/index.js +3 -2
  135. package/node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js +3 -2
  136. package/node_modules/@smithy/middleware-serde/package.json +4 -3
  137. package/node_modules/@smithy/middleware-stack/package.json +2 -2
  138. package/node_modules/@smithy/node-config-provider/package.json +4 -4
  139. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +48 -38
  140. package/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +4 -1
  141. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +38 -31
  142. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +1 -1
  143. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +1 -1
  144. package/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +1 -1
  145. package/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +6 -6
  146. package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +1 -1
  147. package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +1 -1
  148. package/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +1 -1
  149. package/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +4 -3
  150. package/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +1 -1
  151. package/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +4 -4
  152. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +1 -1
  153. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +1 -1
  154. package/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +2 -2
  155. package/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +3 -3
  156. package/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +1 -1
  157. package/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +1 -1
  158. package/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +1 -1
  159. package/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +1 -1
  160. package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +1 -1
  161. package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +2 -2
  162. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +4 -3
  163. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +1 -1
  164. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +4 -4
  165. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +1 -1
  166. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +1 -1
  167. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +2 -2
  168. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +3 -3
  169. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +1 -1
  170. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +1 -1
  171. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +1 -1
  172. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +1 -1
  173. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +1 -1
  174. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +2 -2
  175. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +2 -2
  176. package/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +2 -2
  177. package/node_modules/@smithy/node-http-handler/package.json +5 -5
  178. package/node_modules/@smithy/property-provider/package.json +2 -2
  179. package/node_modules/@smithy/protocol-http/package.json +2 -2
  180. package/node_modules/@smithy/querystring-builder/package.json +2 -2
  181. package/node_modules/@smithy/querystring-parser/package.json +2 -2
  182. package/node_modules/@smithy/service-error-classification/package.json +2 -2
  183. package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
  184. package/node_modules/@smithy/signature-v4/package.json +4 -4
  185. package/node_modules/@smithy/smithy-client/package.json +7 -7
  186. package/node_modules/@smithy/types/dist-types/http.d.ts +1 -0
  187. package/node_modules/@smithy/types/dist-types/ts3.4/http.d.ts +1 -0
  188. package/node_modules/@smithy/types/package.json +1 -1
  189. package/node_modules/@smithy/url-parser/package.json +3 -3
  190. package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
  191. package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
  192. package/node_modules/@smithy/util-endpoints/package.json +3 -3
  193. package/node_modules/@smithy/util-middleware/package.json +2 -2
  194. package/node_modules/@smithy/util-retry/package.json +3 -3
  195. package/node_modules/@smithy/util-stream/package.json +4 -4
  196. package/node_modules/@smithy/util-waiter/dist-cjs/index.js +1 -1
  197. package/node_modules/@smithy/util-waiter/dist-es/poller.js +1 -1
  198. package/node_modules/@smithy/util-waiter/package.json +3 -3
  199. package/node_modules/fast-xml-builder/CHANGELOG.md +16 -0
  200. package/node_modules/fast-xml-builder/README.md +1 -1
  201. package/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
  202. package/node_modules/fast-xml-builder/lib/fxb.d.cts +22 -9
  203. package/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
  204. package/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
  205. package/node_modules/fast-xml-builder/package.json +7 -5
  206. package/node_modules/fast-xml-builder/src/fxb.d.ts +27 -3
  207. package/node_modules/fast-xml-builder/src/fxb.js +265 -21
  208. package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +165 -18
  209. package/node_modules/path-expression-matcher/LICENSE +21 -0
  210. package/node_modules/path-expression-matcher/README.md +720 -0
  211. package/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
  212. package/node_modules/path-expression-matcher/lib/pem.d.cts +523 -0
  213. package/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
  214. package/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
  215. package/node_modules/path-expression-matcher/package.json +78 -0
  216. package/node_modules/path-expression-matcher/src/Expression.js +232 -0
  217. package/node_modules/path-expression-matcher/src/Matcher.js +498 -0
  218. package/node_modules/path-expression-matcher/src/index.d.ts +518 -0
  219. package/node_modules/path-expression-matcher/src/index.js +28 -0
  220. package/package.json +4 -4
  221. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptPackageJsonPaths.js +0 -17
  222. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getTypeScriptPackageJsonPaths.d.ts +0 -3
  223. package/node_modules/fast-xml-builder/lib/builder.cjs +0 -1
  224. package/node_modules/fast-xml-builder/lib/builder.min.js +0 -2
  225. package/node_modules/fast-xml-builder/lib/builder.min.js.map +0 -1
  226. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +0 -2
  227. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +0 -1
  228. package/node_modules/fast-xml-parser/lib/fxp.cjs +0 -1
  229. package/node_modules/fast-xml-parser/lib/fxp.min.js +0 -2
  230. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +0 -1
  231. package/node_modules/fast-xml-parser/lib/fxparser.min.js +0 -2
  232. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +0 -1
  233. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +0 -1
  234. package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +0 -88
  235. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/LICENSE +0 -0
  236. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxvalidator.min.js +0 -0
  237. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/cli/cli.js +0 -0
  238. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/cli/man.js +0 -0
  239. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/cli/read.js +0 -0
  240. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/fxp.js +0 -0
  241. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/ignoreAttributes.js +0 -0
  242. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/CharsSymbol.js +0 -0
  243. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/EntitiesParser.js +0 -0
  244. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OptionsBuilder.js +0 -0
  245. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/BaseOutputBuilder.js +0 -0
  246. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/JsArrBuilder.js +0 -0
  247. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/JsMinArrBuilder.js +0 -0
  248. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/JsObjBuilder.js +0 -0
  249. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/ParserOptionsBuilder.js +0 -0
  250. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/Report.js +0 -0
  251. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/TagPath.js +0 -0
  252. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/TagPathMatcher.js +0 -0
  253. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/XMLParser.js +0 -0
  254. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/Xml2JsParser.js +0 -0
  255. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/XmlPartReader.js +0 -0
  256. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/XmlSpecialTagsReader.js +0 -0
  257. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/inputSource/BufferSource.js +0 -0
  258. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/inputSource/StringSource.js +0 -0
  259. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/EntitiesParser.js +0 -0
  260. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/booleanParser.js +0 -0
  261. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/booleanParserExt.js +0 -0
  262. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/currency.js +0 -0
  263. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/join.js +0 -0
  264. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/number.js +0 -0
  265. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/trim.js +0 -0
  266. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/validator.js +0 -0
  267. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlbuilder/json2xml.js +0 -0
  268. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/xmlNode.js +0 -0
  269. /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/.github/SECURITY.md +0 -0
  270. /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/.vscode/launch.json +0 -0
  271. /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/LICENSE +0 -0
  272. /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/README.md +0 -0
  273. /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/algo.stflow +0 -0
  274. /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/tests/infinity_test.js +0 -0
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={d:(e,s)=>{for(var n in s)t.o(s,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:s[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Expression:()=>s,Matcher:()=>i,default:()=>r});class s{constructor(t,e={}){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let s=0,n="";for(;s<t.length;)t[s]===this.separator?s+1<t.length&&t[s+1]===this.separator?(n.trim()&&(e.push(this._parseSegment(n.trim())),n=""),e.push({type:"deep-wildcard"}),s+=2):(n.trim()&&e.push(this._parseSegment(n.trim())),n="",s++):(n+=t[s],s++);return n.trim()&&e.push(this._parseSegment(n.trim())),e}_parseSegment(t){const e={type:"tag"};let s=null,n=t;const i=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(i&&(n=i[1]+i[3],i[2])){const t=i[2].slice(1,-1);t&&(s=t)}let r,a,h=n;if(n.includes("::")){const e=n.indexOf("::");if(r=n.substring(0,e).trim(),h=n.substring(e+2).trim(),!r)throw new Error(`Invalid namespace in pattern: ${t}`)}let o=null;if(h.includes(":")){const t=h.lastIndexOf(":"),e=h.substring(0,t).trim(),s=h.substring(t+1).trim();["first","last","odd","even"].includes(s)||/^nth\(\d+\)$/.test(s)?(a=e,o=s):a=h}else a=h;if(!a)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=a,r&&(e.namespace=r),s)if(s.includes("=")){const t=s.indexOf("=");e.attrName=s.substring(0,t).trim(),e.attrValue=s.substring(t+1).trim()}else e.attrName=s.trim();if(o){const t=o.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=o}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}const n=new Set(["push","pop","reset","updateCurrent","restore"]);class i{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[]}push(t,e=null,s=null){this.path.length>0&&(this.path[this.path.length-1].values=void 0);const n=this.path.length;this.siblingStacks[n]||(this.siblingStacks[n]=new Map);const i=this.siblingStacks[n],r=s?`${s}:${t}`:t,a=i.get(r)||0;let h=0;for(const t of i.values())h+=t;i.set(r,a+1);const o={tag:t,position:h,counter:a};null!=s&&(o.namespace=s),null!=e&&(o.values=e),this.path.push(o)}pop(){if(0===this.path.length)return;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0===this.path.length)return;const e=this.path[this.path.length-1];return e.values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const s=t||this.separator;return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(s)}toArray(){return this.path.map(t=>t.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++){const s=t[e],n=this.path[e],i=e===this.path.length-1;if(!this._matchSegment(s,n,i))return!1}return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,s=t.length-1;for(;s>=0&&e>=0;){const n=t[s];if("deep-wildcard"===n.type){if(s--,s<0)return!0;const n=t[s];let i=!1;for(let t=e;t>=0;t--){const r=t===this.path.length-1;if(this._matchSegment(n,this.path[t],r)){e=t-1,s--,i=!0;break}}if(!i)return!1}else{const t=e===this.path.length-1;if(!this._matchSegment(n,this.path[e],t))return!1;e--,s--}}return s<0}_matchSegment(t,e,s){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!s)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue){const s=e.values[t.attrName];if(String(s)!==String(t.attrValue))return!1}}if(void 0!==t.position){if(!s)return!1;const n=e.counter??0;if("first"===t.position&&0!==n)return!1;if("odd"===t.position&&n%2!=1)return!1;if("even"===t.position&&n%2!=0)return!1;if("nth"===t.position&&n!==t.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return new Proxy(this,{get(t,e,s){if(n.has(e))return()=>{throw new TypeError(`Cannot call '${e}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};const i=Reflect.get(t,e,s);return"path"===e||"siblingStacks"===e?Object.freeze(Array.isArray(i)?i.map(t=>t instanceof Map?Object.freeze(new Map(t)):Object.freeze({...t})):i):"function"==typeof i?i.bind(t):i},set(t,e){throw new TypeError(`Cannot set property '${String(e)}' on a read-only Matcher.`)},deleteProperty(t,e){throw new TypeError(`Cannot delete property '${String(e)}' from a read-only Matcher.`)}})}}const r={Expression:s,Matcher:i};module.exports=e})();
@@ -0,0 +1,523 @@
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
+ /**
192
+ * ReadOnlyMatcher - A safe, read-only view over a {@link Matcher} instance.
193
+ *
194
+ * Returned by {@link Matcher.readOnly}. Exposes all query and inspection
195
+ * methods but **throws a `TypeError`** if any state-mutating method is called
196
+ * (`push`, `pop`, `reset`, `updateCurrent`, `restore`). Direct property
197
+ * writes are also blocked.
198
+ *
199
+ * Pass this to consumers that only need to inspect or match the current path
200
+ * so they cannot accidentally corrupt the parser state.
201
+ *
202
+ * @example
203
+ * ```javascript
204
+ * const matcher = new Matcher();
205
+ * matcher.push("root", {});
206
+ * matcher.push("users", {});
207
+ * matcher.push("user", { id: "123" });
208
+ *
209
+ * const ro: ReadOnlyMatcher = matcher.readOnly();
210
+ *
211
+ * ro.matches(expr); // ✓ works
212
+ * ro.getCurrentTag(); // ✓ "user"
213
+ * ro.getDepth(); // ✓ 3
214
+ * ro.push("child", {}); // ✗ TypeError: Cannot call 'push' on a read-only Matcher
215
+ * ro.reset(); // ✗ TypeError: Cannot call 'reset' on a read-only Matcher
216
+ * ```
217
+ */
218
+ declare interface ReadOnlyMatcher {
219
+ /**
220
+ * Default path separator (read-only)
221
+ */
222
+ readonly separator: string;
223
+
224
+ /**
225
+ * Current path stack (each node is a frozen copy)
226
+ */
227
+ readonly path: ReadonlyArray<Readonly<PathNode>>;
228
+
229
+ // ── Query methods ───────────────────────────────────────────────────────────
230
+
231
+ /**
232
+ * Get current tag name
233
+ * @returns Current tag name or undefined if path is empty
234
+ */
235
+ getCurrentTag(): string | undefined;
236
+
237
+ /**
238
+ * Get current namespace
239
+ * @returns Current namespace or undefined if not present or path is empty
240
+ */
241
+ getCurrentNamespace(): string | undefined;
242
+
243
+ /**
244
+ * Get current node's attribute value
245
+ * @param attrName - Attribute name
246
+ * @returns Attribute value or undefined
247
+ */
248
+ getAttrValue(attrName: string): any;
249
+
250
+ /**
251
+ * Check if current node has an attribute
252
+ * @param attrName - Attribute name
253
+ */
254
+ hasAttr(attrName: string): boolean;
255
+
256
+ /**
257
+ * Get current node's sibling position (child index in parent)
258
+ * @returns Position index or -1 if path is empty
259
+ */
260
+ getPosition(): number;
261
+
262
+ /**
263
+ * Get current node's repeat counter (occurrence count of this tag name)
264
+ * @returns Counter value or -1 if path is empty
265
+ */
266
+ getCounter(): number;
267
+
268
+ /**
269
+ * Get current node's sibling index (alias for getPosition for backward compatibility)
270
+ * @returns Index or -1 if path is empty
271
+ * @deprecated Use getPosition() or getCounter() instead
272
+ */
273
+ getIndex(): number;
274
+
275
+ /**
276
+ * Get current path depth
277
+ * @returns Number of nodes in the path
278
+ */
279
+ getDepth(): number;
280
+
281
+ /**
282
+ * Get path as string
283
+ * @param separator - Optional separator (uses default if not provided)
284
+ * @param includeNamespace - Whether to include namespace in output
285
+ * @returns Path string (e.g., "root.users.user" or "ns:root.ns:users.user")
286
+ */
287
+ toString(separator?: string, includeNamespace?: boolean): string;
288
+
289
+ /**
290
+ * Get path as array of tag names
291
+ * @returns Array of tag names
292
+ */
293
+ toArray(): string[];
294
+
295
+ /**
296
+ * Match current path against an Expression
297
+ * @param expression - The expression to match against
298
+ * @returns True if current path matches the expression
299
+ */
300
+ matches(expression: Expression): boolean;
301
+
302
+ /**
303
+ * Create a snapshot of current state
304
+ * @returns State snapshot that can be restored later
305
+ */
306
+ snapshot(): MatcherSnapshot;
307
+
308
+ // ── Blocked mutating methods ────────────────────────────────────────────────
309
+ // These are present in the type so callers get a compile-time error with a
310
+ // helpful message instead of a silent "property does not exist" error.
311
+
312
+ /**
313
+ * @throws {TypeError} Always – mutation is not allowed on a read-only view.
314
+ */
315
+ push(tagName: string, attrValues?: Record<string, any> | null, namespace?: string | null): never;
316
+
317
+ /**
318
+ * @throws {TypeError} Always – mutation is not allowed on a read-only view.
319
+ */
320
+ pop(): never;
321
+
322
+ /**
323
+ * @throws {TypeError} Always – mutation is not allowed on a read-only view.
324
+ */
325
+ updateCurrent(attrValues: Record<string, any>): never;
326
+
327
+ /**
328
+ * @throws {TypeError} Always – mutation is not allowed on a read-only view.
329
+ */
330
+ reset(): never;
331
+
332
+ /**
333
+ * @throws {TypeError} Always – mutation is not allowed on a read-only view.
334
+ */
335
+ restore(snapshot: MatcherSnapshot): never;
336
+ }
337
+
338
+ /**
339
+ * Matcher - Tracks current path in XML/JSON tree and matches against Expressions
340
+ *
341
+ * The matcher maintains a stack of nodes representing the current path from root to
342
+ * current tag. It only stores attribute values for the current (top) node to minimize
343
+ * memory usage.
344
+ *
345
+ * @example
346
+ * ```javascript
347
+ * const { Matcher } = require('path-expression-matcher');
348
+ * const matcher = new Matcher();
349
+ * matcher.push("root", {});
350
+ * matcher.push("users", {});
351
+ * matcher.push("user", { id: "123", type: "admin" });
352
+ *
353
+ * const expr = new Expression("root.users.user");
354
+ * matcher.matches(expr); // true
355
+ *
356
+ * matcher.pop();
357
+ * matcher.matches(expr); // false
358
+ * ```
359
+ */
360
+ declare class Matcher {
361
+ /**
362
+ * Default path separator
363
+ */
364
+ readonly separator: string;
365
+
366
+ /**
367
+ * Current path stack
368
+ */
369
+ readonly path: PathNode[];
370
+
371
+ /**
372
+ * Create a new Matcher
373
+ * @param options - Configuration options
374
+ */
375
+ constructor(options?: MatcherOptions);
376
+
377
+ /**
378
+ * Push a new tag onto the path
379
+ * @param tagName - Name of the tag
380
+ * @param attrValues - Attribute key-value pairs for current node (optional)
381
+ * @param namespace - Namespace for the tag (optional)
382
+ *
383
+ * @example
384
+ * ```javascript
385
+ * matcher.push("user", { id: "123", type: "admin" });
386
+ * matcher.push("user", { id: "456" }, "ns");
387
+ * matcher.push("container", null);
388
+ * ```
389
+ */
390
+ push(tagName: string, attrValues?: Record<string, any> | null, namespace?: string | null): void;
391
+
392
+ /**
393
+ * Pop the last tag from the path
394
+ * @returns The popped node or undefined if path is empty
395
+ */
396
+ pop(): PathNode | undefined;
397
+
398
+ /**
399
+ * Update current node's attribute values
400
+ * Useful when attributes are parsed after push
401
+ * @param attrValues - Attribute values
402
+ */
403
+ updateCurrent(attrValues: Record<string, any>): void;
404
+
405
+ /**
406
+ * Get current tag name
407
+ * @returns Current tag name or undefined if path is empty
408
+ */
409
+ getCurrentTag(): string | undefined;
410
+
411
+ /**
412
+ * Get current namespace
413
+ * @returns Current namespace or undefined if not present or path is empty
414
+ */
415
+ getCurrentNamespace(): string | undefined;
416
+
417
+ /**
418
+ * Get current node's attribute value
419
+ * @param attrName - Attribute name
420
+ * @returns Attribute value or undefined
421
+ */
422
+ getAttrValue(attrName: string): any;
423
+
424
+ /**
425
+ * Check if current node has an attribute
426
+ * @param attrName - Attribute name
427
+ */
428
+ hasAttr(attrName: string): boolean;
429
+
430
+ /**
431
+ * Get current node's sibling position (child index in parent)
432
+ * @returns Position index or -1 if path is empty
433
+ */
434
+ getPosition(): number;
435
+
436
+ /**
437
+ * Get current node's repeat counter (occurrence count of this tag name)
438
+ * @returns Counter value or -1 if path is empty
439
+ */
440
+ getCounter(): number;
441
+
442
+ /**
443
+ * Get current node's sibling index (alias for getPosition for backward compatibility)
444
+ * @returns Index or -1 if path is empty
445
+ * @deprecated Use getPosition() or getCounter() instead
446
+ */
447
+ getIndex(): number;
448
+
449
+ /**
450
+ * Get current path depth
451
+ * @returns Number of nodes in the path
452
+ */
453
+ getDepth(): number;
454
+
455
+ /**
456
+ * Get path as string
457
+ * @param separator - Optional separator (uses default if not provided)
458
+ * @param includeNamespace - Whether to include namespace in output
459
+ * @returns Path string (e.g., "root.users.user" or "ns:root.ns:users.user")
460
+ */
461
+ toString(separator?: string, includeNamespace?: boolean): string;
462
+
463
+ /**
464
+ * Get path as array of tag names
465
+ * @returns Array of tag names
466
+ */
467
+ toArray(): string[];
468
+
469
+ /**
470
+ * Reset the path to empty
471
+ */
472
+ reset(): void;
473
+
474
+ /**
475
+ * Match current path against an Expression
476
+ * @param expression - The expression to match against
477
+ * @returns True if current path matches the expression
478
+ *
479
+ * @example
480
+ * ```javascript
481
+ * const expr = new Expression("root.users.user[id]");
482
+ * const matcher = new Matcher();
483
+ *
484
+ * matcher.push("root");
485
+ * matcher.push("users");
486
+ * matcher.push("user", { id: "123" });
487
+ *
488
+ * matcher.matches(expr); // true
489
+ * ```
490
+ */
491
+ matches(expression: Expression): boolean;
492
+
493
+ /**
494
+ * Create a snapshot of current state
495
+ * @returns State snapshot that can be restored later
496
+ */
497
+ snapshot(): MatcherSnapshot;
498
+
499
+ /**
500
+ * Restore state from snapshot
501
+ * @param snapshot - State snapshot from previous snapshot() call
502
+ */
503
+ restore(snapshot: MatcherSnapshot): void;
504
+
505
+ /**
506
+ * Return a read-only view of this matcher.
507
+ */
508
+ readOnly(): ReadOnlyMatcher;
509
+ }
510
+
511
+ declare namespace pathExpressionMatcher {
512
+ export {
513
+ Expression,
514
+ Matcher,
515
+ ExpressionOptions,
516
+ MatcherOptions,
517
+ Segment,
518
+ PathNode,
519
+ MatcherSnapshot,
520
+ };
521
+ }
522
+
523
+ export = pathExpressionMatcher;
@@ -0,0 +1,2 @@
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.pem=e():t.pem=e()}(this,()=>(()=>{"use strict";var t={d:(e,s)=>{for(var n in s)t.o(s,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:s[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Expression:()=>s,Matcher:()=>i,default:()=>r});class s{constructor(t,e={}){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let s=0,n="";for(;s<t.length;)t[s]===this.separator?s+1<t.length&&t[s+1]===this.separator?(n.trim()&&(e.push(this._parseSegment(n.trim())),n=""),e.push({type:"deep-wildcard"}),s+=2):(n.trim()&&e.push(this._parseSegment(n.trim())),n="",s++):(n+=t[s],s++);return n.trim()&&e.push(this._parseSegment(n.trim())),e}_parseSegment(t){const e={type:"tag"};let s=null,n=t;const i=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(i&&(n=i[1]+i[3],i[2])){const t=i[2].slice(1,-1);t&&(s=t)}let r,a,h=n;if(n.includes("::")){const e=n.indexOf("::");if(r=n.substring(0,e).trim(),h=n.substring(e+2).trim(),!r)throw new Error(`Invalid namespace in pattern: ${t}`)}let o=null;if(h.includes(":")){const t=h.lastIndexOf(":"),e=h.substring(0,t).trim(),s=h.substring(t+1).trim();["first","last","odd","even"].includes(s)||/^nth\(\d+\)$/.test(s)?(a=e,o=s):a=h}else a=h;if(!a)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=a,r&&(e.namespace=r),s)if(s.includes("=")){const t=s.indexOf("=");e.attrName=s.substring(0,t).trim(),e.attrValue=s.substring(t+1).trim()}else e.attrName=s.trim();if(o){const t=o.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=o}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}const n=new Set(["push","pop","reset","updateCurrent","restore"]);class i{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[]}push(t,e=null,s=null){this.path.length>0&&(this.path[this.path.length-1].values=void 0);const n=this.path.length;this.siblingStacks[n]||(this.siblingStacks[n]=new Map);const i=this.siblingStacks[n],r=s?`${s}:${t}`:t,a=i.get(r)||0;let h=0;for(const t of i.values())h+=t;i.set(r,a+1);const o={tag:t,position:h,counter:a};null!=s&&(o.namespace=s),null!=e&&(o.values=e),this.path.push(o)}pop(){if(0===this.path.length)return;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0===this.path.length)return;const e=this.path[this.path.length-1];return e.values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const s=t||this.separator;return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(s)}toArray(){return this.path.map(t=>t.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++){const s=t[e],n=this.path[e],i=e===this.path.length-1;if(!this._matchSegment(s,n,i))return!1}return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,s=t.length-1;for(;s>=0&&e>=0;){const n=t[s];if("deep-wildcard"===n.type){if(s--,s<0)return!0;const n=t[s];let i=!1;for(let t=e;t>=0;t--){const r=t===this.path.length-1;if(this._matchSegment(n,this.path[t],r)){e=t-1,s--,i=!0;break}}if(!i)return!1}else{const t=e===this.path.length-1;if(!this._matchSegment(n,this.path[e],t))return!1;e--,s--}}return s<0}_matchSegment(t,e,s){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!s)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue){const s=e.values[t.attrName];if(String(s)!==String(t.attrValue))return!1}}if(void 0!==t.position){if(!s)return!1;const n=e.counter??0;if("first"===t.position&&0!==n)return!1;if("odd"===t.position&&n%2!=1)return!1;if("even"===t.position&&n%2!=0)return!1;if("nth"===t.position&&n!==t.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return new Proxy(this,{get(t,e,s){if(n.has(e))return()=>{throw new TypeError(`Cannot call '${e}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};const i=Reflect.get(t,e,s);return"path"===e||"siblingStacks"===e?Object.freeze(Array.isArray(i)?i.map(t=>t instanceof Map?Object.freeze(new Map(t)):Object.freeze({...t})):i):"function"==typeof i?i.bind(t):i},set(t,e){throw new TypeError(`Cannot set property '${String(e)}' on a read-only Matcher.`)},deleteProperty(t,e){throw new TypeError(`Cannot delete property '${String(e)}' from a read-only Matcher.`)}})}}const r={Expression:s,Matcher:i};return e})());
2
+ //# sourceMappingURL=pem.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"./lib/pem.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAa,IAAID,IAEjBD,EAAU,IAAIC,GACf,CATD,CASGK,KAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,M,kECKxC,MAAMC,EAOnBC,WAAAA,CAAYC,EAASC,EAAU,CAAC,GAC9BpB,KAAKmB,QAAUA,EACfnB,KAAKqB,UAAYD,EAAQC,WAAa,IACtCrB,KAAKsB,SAAWtB,KAAKuB,OAAOJ,GAG5BnB,KAAKwB,iBAAmBxB,KAAKsB,SAASG,KAAKC,GAAoB,kBAAbA,EAAIC,MACtD3B,KAAK4B,uBAAyB5B,KAAKsB,SAAS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a,SAAT/G,GAA4B,kBAATA,EACdL,OAAOwH,OACZC,MAAMC,QAAQ/G,GACVA,EAAMmF,IAAI6B,GACVA,aAAgBjD,IACZ1E,OAAOwH,OAAO,IAAI9C,IAAIiD,IACtB3H,OAAOwH,OAAO,IAAKG,KAEvBhH,GAKa,mBAAVA,EACFA,EAAMiH,KAAKT,GAGbxG,CACT,EAGAoE,GAAAA,CAAI8C,EAASxH,GACX,MAAM,IAAIiH,UACR,wBAAwBR,OAAOzG,8BAEnC,EAGAyH,cAAAA,CAAeD,EAASxH,GACtB,MAAM,IAAIiH,UACR,2BAA2BR,OAAOzG,gCAEtC,GAEJ,ECrdF,SAAiBO,WAAU,EAAEuD,QAAOA,G","sources":["webpack://pem/webpack/universalModuleDefinition","webpack://pem/webpack/bootstrap","webpack://pem/webpack/runtime/define property getters","webpack://pem/webpack/runtime/hasOwnProperty shorthand","webpack://pem/webpack/runtime/make namespace object","webpack://pem/./src/Expression.js","webpack://pem/./src/Matcher.js","webpack://pem/./src/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pem\"] = factory();\n\telse\n\t\troot[\"pem\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Expression - Parses and stores a tag pattern expression\n * \n * Patterns are parsed once and stored in an optimized structure for fast matching.\n * \n * @example\n * const expr = new Expression(\"root.users.user\");\n * const expr2 = new Expression(\"..user[id]:first\");\n * const expr3 = new Expression(\"root/users/user\", { separator: '/' });\n */\nexport default class Expression {\n /**\n * Create a new Expression\n * @param {string} pattern - Pattern string (e.g., \"root.users.user\", \"..user[id]\")\n * @param {Object} options - Configuration options\n * @param {string} options.separator - Path separator (default: '.')\n */\n constructor(pattern, options = {}) {\n this.pattern = pattern;\n this.separator = options.separator || '.';\n this.segments = this._parse(pattern);\n\n // Cache expensive checks for performance (O(1) instead of O(n))\n this._hasDeepWildcard = this.segments.some(seg => seg.type === 'deep-wildcard');\n this._hasAttributeCondition = this.segments.some(seg => seg.attrName !== undefined);\n this._hasPositionSelector = this.segments.some(seg => seg.position !== undefined);\n }\n\n /**\n * Parse pattern string into segments\n * @private\n * @param {string} pattern - Pattern to parse\n * @returns {Array} Array of segment objects\n */\n _parse(pattern) {\n const segments = [];\n\n // Split by separator but handle \"..\" specially\n let i = 0;\n let currentPart = '';\n\n while (i < pattern.length) {\n if (pattern[i] === this.separator) {\n // Check if next char is also separator (deep wildcard)\n if (i + 1 < pattern.length && pattern[i + 1] === this.separator) {\n // Flush current part if any\n if (currentPart.trim()) {\n segments.push(this._parseSegment(currentPart.trim()));\n currentPart = '';\n }\n // Add deep wildcard\n segments.push({ type: 'deep-wildcard' });\n i += 2; // Skip both separators\n } else {\n // Regular separator\n if (currentPart.trim()) {\n segments.push(this._parseSegment(currentPart.trim()));\n }\n currentPart = '';\n i++;\n }\n } else {\n currentPart += pattern[i];\n i++;\n }\n }\n\n // Flush remaining part\n if (currentPart.trim()) {\n segments.push(this._parseSegment(currentPart.trim()));\n }\n\n return segments;\n }\n\n /**\n * Parse a single segment\n * @private\n * @param {string} part - Segment string (e.g., \"user\", \"ns::user\", \"user[id]\", \"ns::user:first\")\n * @returns {Object} Segment object\n */\n _parseSegment(part) {\n const segment = { type: 'tag' };\n\n // NEW NAMESPACE SYNTAX (v2.0):\n // ============================\n // Namespace uses DOUBLE colon (::)\n // Position uses SINGLE colon (:)\n // \n // Examples:\n // \"user\" → tag\n // \"user:first\" → tag + position\n // \"user[id]\" → tag + attribute\n // \"user[id]:first\" → tag + attribute + position\n // \"ns::user\" → namespace + tag\n // \"ns::user:first\" → namespace + tag + position\n // \"ns::user[id]\" → namespace + tag + attribute\n // \"ns::user[id]:first\" → namespace + tag + attribute + position\n // \"ns::first\" → namespace + tag named \"first\" (NO ambiguity!)\n //\n // This eliminates all ambiguity:\n // :: = namespace separator\n // : = position selector\n // [] = attributes\n\n // Step 1: Extract brackets [attr] or [attr=value]\n let bracketContent = null;\n let withoutBrackets = part;\n\n const bracketMatch = part.match(/^([^\\[]+)(\\[[^\\]]*\\])(.*)$/);\n if (bracketMatch) {\n withoutBrackets = bracketMatch[1] + bracketMatch[3];\n if (bracketMatch[2]) {\n const content = bracketMatch[2].slice(1, -1);\n if (content) {\n bracketContent = content;\n }\n }\n }\n\n // Step 2: Check for namespace (double colon ::)\n let namespace = undefined;\n let tagAndPosition = withoutBrackets;\n\n if (withoutBrackets.includes('::')) {\n const nsIndex = withoutBrackets.indexOf('::');\n namespace = withoutBrackets.substring(0, nsIndex).trim();\n tagAndPosition = withoutBrackets.substring(nsIndex + 2).trim(); // Skip ::\n\n if (!namespace) {\n throw new Error(`Invalid namespace in pattern: ${part}`);\n }\n }\n\n // Step 3: Parse tag and position (single colon :)\n let tag = undefined;\n let positionMatch = null;\n\n if (tagAndPosition.includes(':')) {\n const colonIndex = tagAndPosition.lastIndexOf(':'); // Use last colon for position\n const tagPart = tagAndPosition.substring(0, colonIndex).trim();\n const posPart = tagAndPosition.substring(colonIndex + 1).trim();\n\n // Verify position is a valid keyword\n const isPositionKeyword = ['first', 'last', 'odd', 'even'].includes(posPart) ||\n /^nth\\(\\d+\\)$/.test(posPart);\n\n if (isPositionKeyword) {\n tag = tagPart;\n positionMatch = posPart;\n } else {\n // Not a valid position keyword, treat whole thing as tag\n tag = tagAndPosition;\n }\n } else {\n tag = tagAndPosition;\n }\n\n if (!tag) {\n throw new Error(`Invalid segment pattern: ${part}`);\n }\n\n segment.tag = tag;\n if (namespace) {\n segment.namespace = namespace;\n }\n\n // Step 4: Parse attributes\n if (bracketContent) {\n if (bracketContent.includes('=')) {\n const eqIndex = bracketContent.indexOf('=');\n segment.attrName = bracketContent.substring(0, eqIndex).trim();\n segment.attrValue = bracketContent.substring(eqIndex + 1).trim();\n } else {\n segment.attrName = bracketContent.trim();\n }\n }\n\n // Step 5: Parse position selector\n if (positionMatch) {\n const nthMatch = positionMatch.match(/^nth\\((\\d+)\\)$/);\n if (nthMatch) {\n segment.position = 'nth';\n segment.positionValue = parseInt(nthMatch[1], 10);\n } else {\n segment.position = positionMatch;\n }\n }\n\n return segment;\n }\n\n /**\n * Get the number of segments\n * @returns {number}\n */\n get length() {\n return this.segments.length;\n }\n\n /**\n * Check if expression contains deep wildcard\n * @returns {boolean}\n */\n hasDeepWildcard() {\n return this._hasDeepWildcard;\n }\n\n /**\n * Check if expression has attribute conditions\n * @returns {boolean}\n */\n hasAttributeCondition() {\n return this._hasAttributeCondition;\n }\n\n /**\n * Check if expression has position selectors\n * @returns {boolean}\n */\n hasPositionSelector() {\n return this._hasPositionSelector;\n }\n\n /**\n * Get string representation\n * @returns {string}\n */\n toString() {\n return this.pattern;\n }\n}","/**\n * Matcher - Tracks current path in XML/JSON tree and matches against Expressions\n * \n * The matcher maintains a stack of nodes representing the current path from root to\n * current tag. It only stores attribute values for the current (top) node to minimize\n * memory usage. Sibling tracking is used to auto-calculate position and counter.\n * \n * @example\n * const matcher = new Matcher();\n * matcher.push(\"root\", {});\n * matcher.push(\"users\", {});\n * matcher.push(\"user\", { id: \"123\", type: \"admin\" });\n * \n * const expr = new Expression(\"root.users.user\");\n * matcher.matches(expr); // true\n */\n\n/**\n * Names of methods that mutate Matcher state.\n * Any attempt to call these on a read-only view throws a TypeError.\n * @type {Set<string>}\n */\nconst MUTATING_METHODS = new Set(['push', 'pop', 'reset', 'updateCurrent', 'restore']);\n\nexport default class Matcher {\n /**\n * Create a new Matcher\n * @param {Object} options - Configuration options\n * @param {string} options.separator - Default path separator (default: '.')\n */\n constructor(options = {}) {\n this.separator = options.separator || '.';\n this.path = [];\n this.siblingStacks = [];\n // Each path node: { tag: string, values: object, position: number, counter: number }\n // values only present for current (last) node\n // Each siblingStacks entry: Map<tagName, count> tracking occurrences at each level\n }\n\n /**\n * Push a new tag onto the path\n * @param {string} tagName - Name of the tag\n * @param {Object} attrValues - Attribute key-value pairs for current node (optional)\n * @param {string} namespace - Namespace for the tag (optional)\n */\n push(tagName, attrValues = null, namespace = null) {\n // Remove values from previous current node (now becoming ancestor)\n if (this.path.length > 0) {\n const prev = this.path[this.path.length - 1];\n prev.values = undefined;\n }\n\n // Get or create sibling tracking for current level\n const currentLevel = this.path.length;\n if (!this.siblingStacks[currentLevel]) {\n this.siblingStacks[currentLevel] = new Map();\n }\n\n const siblings = this.siblingStacks[currentLevel];\n\n // Create a unique key for sibling tracking that includes namespace\n const siblingKey = namespace ? `${namespace}:${tagName}` : tagName;\n\n // Calculate counter (how many times this tag appeared at this level)\n const counter = siblings.get(siblingKey) || 0;\n\n // Calculate position (total children at this level so far)\n let position = 0;\n for (const count of siblings.values()) {\n position += count;\n }\n\n // Update sibling count for this tag\n siblings.set(siblingKey, counter + 1);\n\n // Create new node\n const node = {\n tag: tagName,\n position: position,\n counter: counter\n };\n\n // Store namespace if provided\n if (namespace !== null && namespace !== undefined) {\n node.namespace = namespace;\n }\n\n // Store values only for current node\n if (attrValues !== null && attrValues !== undefined) {\n node.values = attrValues;\n }\n\n this.path.push(node);\n }\n\n /**\n * Pop the last tag from the path\n * @returns {Object|undefined} The popped node\n */\n pop() {\n if (this.path.length === 0) {\n return undefined;\n }\n\n const node = this.path.pop();\n\n // Clean up sibling tracking for levels deeper than current\n // After pop, path.length is the new depth\n // We need to clean up siblingStacks[path.length + 1] and beyond\n if (this.siblingStacks.length > this.path.length + 1) {\n this.siblingStacks.length = this.path.length + 1;\n }\n\n return node;\n }\n\n /**\n * Update current node's attribute values\n * Useful when attributes are parsed after push\n * @param {Object} attrValues - Attribute values\n */\n updateCurrent(attrValues) {\n if (this.path.length > 0) {\n const current = this.path[this.path.length - 1];\n if (attrValues !== null && attrValues !== undefined) {\n current.values = attrValues;\n }\n }\n }\n\n /**\n * Get current tag name\n * @returns {string|undefined}\n */\n getCurrentTag() {\n return this.path.length > 0 ? this.path[this.path.length - 1].tag : undefined;\n }\n\n /**\n * Get current namespace\n * @returns {string|undefined}\n */\n getCurrentNamespace() {\n return this.path.length > 0 ? this.path[this.path.length - 1].namespace : undefined;\n }\n\n /**\n * Get current node's attribute value\n * @param {string} attrName - Attribute name\n * @returns {*} Attribute value or undefined\n */\n getAttrValue(attrName) {\n if (this.path.length === 0) return undefined;\n const current = this.path[this.path.length - 1];\n return current.values?.[attrName];\n }\n\n /**\n * Check if current node has an attribute\n * @param {string} attrName - Attribute name\n * @returns {boolean}\n */\n hasAttr(attrName) {\n if (this.path.length === 0) return false;\n const current = this.path[this.path.length - 1];\n return current.values !== undefined && attrName in current.values;\n }\n\n /**\n * Get current node's sibling position (child index in parent)\n * @returns {number}\n */\n getPosition() {\n if (this.path.length === 0) return -1;\n return this.path[this.path.length - 1].position ?? 0;\n }\n\n /**\n * Get current node's repeat counter (occurrence count of this tag name)\n * @returns {number}\n */\n getCounter() {\n if (this.path.length === 0) return -1;\n return this.path[this.path.length - 1].counter ?? 0;\n }\n\n /**\n * Get current node's sibling index (alias for getPosition for backward compatibility)\n * @returns {number}\n * @deprecated Use getPosition() or getCounter() instead\n */\n getIndex() {\n return this.getPosition();\n }\n\n /**\n * Get current path depth\n * @returns {number}\n */\n getDepth() {\n return this.path.length;\n }\n\n /**\n * Get path as string\n * @param {string} separator - Optional separator (uses default if not provided)\n * @param {boolean} includeNamespace - Whether to include namespace in output (default: true)\n * @returns {string}\n */\n toString(separator, includeNamespace = true) {\n const sep = separator || this.separator;\n return this.path.map(n => {\n if (includeNamespace && n.namespace) {\n return `${n.namespace}:${n.tag}`;\n }\n return n.tag;\n }).join(sep);\n }\n\n /**\n * Get path as array of tag names\n * @returns {string[]}\n */\n toArray() {\n return this.path.map(n => n.tag);\n }\n\n /**\n * Reset the path to empty\n */\n reset() {\n this.path = [];\n this.siblingStacks = [];\n }\n\n /**\n * Match current path against an Expression\n * @param {Expression} expression - The expression to match against\n * @returns {boolean} True if current path matches the expression\n */\n matches(expression) {\n const segments = expression.segments;\n\n if (segments.length === 0) {\n return false;\n }\n\n // Handle deep wildcard patterns\n if (expression.hasDeepWildcard()) {\n return this._matchWithDeepWildcard(segments);\n }\n\n // Simple path matching (no deep wildcards)\n return this._matchSimple(segments);\n }\n\n /**\n * Match simple path (no deep wildcards)\n * @private\n */\n _matchSimple(segments) {\n // Path must be same length as segments\n if (this.path.length !== segments.length) {\n return false;\n }\n\n // Match each segment bottom-to-top\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const node = this.path[i];\n const isCurrentNode = (i === this.path.length - 1);\n\n if (!this._matchSegment(segment, node, isCurrentNode)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Match path with deep wildcards\n * @private\n */\n _matchWithDeepWildcard(segments) {\n let pathIdx = this.path.length - 1; // Start from current node (bottom)\n let segIdx = segments.length - 1; // Start from last segment\n\n while (segIdx >= 0 && pathIdx >= 0) {\n const segment = segments[segIdx];\n\n if (segment.type === 'deep-wildcard') {\n // \"..\" matches zero or more levels\n segIdx--;\n\n if (segIdx < 0) {\n // Pattern ends with \"..\", always matches\n return true;\n }\n\n // Find where next segment matches in the path\n const nextSeg = segments[segIdx];\n let found = false;\n\n for (let i = pathIdx; i >= 0; i--) {\n const isCurrentNode = (i === this.path.length - 1);\n if (this._matchSegment(nextSeg, this.path[i], isCurrentNode)) {\n pathIdx = i - 1;\n segIdx--;\n found = true;\n break;\n }\n }\n\n if (!found) {\n return false;\n }\n } else {\n // Regular segment\n const isCurrentNode = (pathIdx === this.path.length - 1);\n if (!this._matchSegment(segment, this.path[pathIdx], isCurrentNode)) {\n return false;\n }\n pathIdx--;\n segIdx--;\n }\n }\n\n // All segments must be consumed\n return segIdx < 0;\n }\n\n /**\n * Match a single segment against a node\n * @private\n * @param {Object} segment - Segment from Expression\n * @param {Object} node - Node from path\n * @param {boolean} isCurrentNode - Whether this is the current (last) node\n * @returns {boolean}\n */\n _matchSegment(segment, node, isCurrentNode) {\n // Match tag name (* is wildcard)\n if (segment.tag !== '*' && segment.tag !== node.tag) {\n return false;\n }\n\n // Match namespace if specified in segment\n if (segment.namespace !== undefined) {\n // Segment has namespace - node must match it\n if (segment.namespace !== '*' && segment.namespace !== node.namespace) {\n return false;\n }\n }\n // If segment has no namespace, it matches nodes with or without namespace\n\n // Match attribute name (check if node has this attribute)\n // Can only check for current node since ancestors don't have values\n if (segment.attrName !== undefined) {\n if (!isCurrentNode) {\n // Can't check attributes for ancestor nodes (values not stored)\n return false;\n }\n\n if (!node.values || !(segment.attrName in node.values)) {\n return false;\n }\n\n // Match attribute value (only possible for current node)\n if (segment.attrValue !== undefined) {\n const actualValue = node.values[segment.attrName];\n // Both should be strings\n if (String(actualValue) !== String(segment.attrValue)) {\n return false;\n }\n }\n }\n\n // Match position (only for current node)\n if (segment.position !== undefined) {\n if (!isCurrentNode) {\n // Can't check position for ancestor nodes\n return false;\n }\n\n const counter = node.counter ?? 0;\n\n if (segment.position === 'first' && counter !== 0) {\n return false;\n } else if (segment.position === 'odd' && counter % 2 !== 1) {\n return false;\n } else if (segment.position === 'even' && counter % 2 !== 0) {\n return false;\n } else if (segment.position === 'nth') {\n if (counter !== segment.positionValue) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n /**\n * Create a snapshot of current state\n * @returns {Object} State snapshot\n */\n snapshot() {\n return {\n path: this.path.map(node => ({ ...node })),\n siblingStacks: this.siblingStacks.map(map => new Map(map))\n };\n }\n\n /**\n * Restore state from snapshot\n * @param {Object} snapshot - State snapshot\n */\n restore(snapshot) {\n this.path = snapshot.path.map(node => ({ ...node }));\n this.siblingStacks = snapshot.siblingStacks.map(map => new Map(map));\n }\n\n /**\n * Return a read-only view of this matcher.\n *\n * The returned object exposes all query/inspection methods but throws a\n * TypeError if any state-mutating method is called (`push`, `pop`, `reset`,\n * `updateCurrent`, `restore`). Property reads (e.g. `.path`, `.separator`)\n * are allowed but the returned arrays/objects are frozen so callers cannot\n * mutate internal state through them either.\n *\n * @returns {ReadOnlyMatcher} A proxy that forwards read operations and blocks writes.\n *\n * @example\n * const matcher = new Matcher();\n * matcher.push(\"root\", {});\n *\n * const ro = matcher.readOnly();\n * ro.matches(expr); // ✓ works\n * ro.getCurrentTag(); // ✓ works\n * ro.push(\"child\", {}); // ✗ throws TypeError\n * ro.reset(); // ✗ throws TypeError\n */\n readOnly() {\n const self = this;\n\n return new Proxy(self, {\n get(target, prop, receiver) {\n // Block mutating methods\n if (MUTATING_METHODS.has(prop)) {\n return () => {\n throw new TypeError(\n `Cannot call '${prop}' on a read-only Matcher. ` +\n `Obtain a writable instance to mutate state.`\n );\n };\n }\n\n const value = Reflect.get(target, prop, receiver);\n\n // Freeze array/object properties so callers can't mutate internal\n // state through direct property access (e.g. matcher.path.push(...))\n if (prop === 'path' || prop === 'siblingStacks') {\n return Object.freeze(\n Array.isArray(value)\n ? value.map(item =>\n item instanceof Map\n ? Object.freeze(new Map(item)) // freeze a copy of each Map\n : Object.freeze({ ...item }) // freeze a copy of each node\n )\n : value\n );\n }\n\n // Bind methods so `this` inside them still refers to the real Matcher\n if (typeof value === 'function') {\n return value.bind(target);\n }\n\n return value;\n },\n\n // Prevent any property assignment on the read-only view\n set(_target, prop) {\n throw new TypeError(\n `Cannot set property '${String(prop)}' on a read-only Matcher.`\n );\n },\n\n // Prevent property deletion\n deleteProperty(_target, prop) {\n throw new TypeError(\n `Cannot delete property '${String(prop)}' from a read-only Matcher.`\n );\n }\n });\n }\n}","/**\n * fast-xml-tagger - XML/JSON path matching library\n * \n * Provides efficient path tracking and pattern matching for XML/JSON parsers.\n * \n * @example\n * import { Expression, Matcher } from 'fast-xml-tagger';\n * \n * // Create expression (parse once)\n * const expr = new Expression(\"root.users.user[id]\");\n * \n * // Create matcher (track path)\n * const matcher = new Matcher();\n * matcher.push(\"root\", [], {}, 0);\n * matcher.push(\"users\", [], {}, 0);\n * matcher.push(\"user\", [\"id\", \"type\"], { id: \"123\", type: \"admin\" }, 0);\n * \n * // Match\n * if (matcher.matches(expr)) {\n * console.log(\"Match found!\");\n * }\n */\n\nimport Expression from './Expression.js';\nimport Matcher from './Matcher.js';\n\nexport { Expression, Matcher };\nexport default { Expression, Matcher };\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","Expression","constructor","pattern","options","separator","segments","_parse","_hasDeepWildcard","some","seg","type","_hasAttributeCondition","undefined","attrName","_hasPositionSelector","position","i","currentPart","length","trim","push","_parseSegment","part","segment","bracketContent","withoutBrackets","bracketMatch","match","content","slice","namespace","tag","tagAndPosition","includes","nsIndex","indexOf","substring","Error","positionMatch","colonIndex","lastIndexOf","tagPart","posPart","test","eqIndex","attrValue","nthMatch","positionValue","parseInt","hasDeepWildcard","hasAttributeCondition","hasPositionSelector","toString","MUTATING_METHODS","Set","Matcher","path","siblingStacks","tagName","attrValues","values","currentLevel","Map","siblings","siblingKey","counter","count","set","node","pop","updateCurrent","current","getCurrentTag","getCurrentNamespace","getAttrValue","hasAttr","getPosition","getCounter","getIndex","getDepth","includeNamespace","sep","map","n","join","toArray","reset","matches","expression","_matchWithDeepWildcard","_matchSimple","isCurrentNode","_matchSegment","pathIdx","segIdx","nextSeg","found","actualValue","String","snapshot","restore","readOnly","Proxy","target","receiver","has","TypeError","Reflect","freeze","Array","isArray","item","bind","_target","deleteProperty"],"sourceRoot":""}