@cdklabs/cdk-ssm-documents 0.0.66 → 0.0.67

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 (358) hide show
  1. package/.jsii +13 -13
  2. package/lib/construct/synth-utils.js +1 -1
  3. package/lib/document/automation-document.js +1 -1
  4. package/lib/document/command-document.js +1 -1
  5. package/lib/document/document-builder.js +2 -2
  6. package/lib/document/ssm-document.js +1 -1
  7. package/lib/domain/aws-service.js +1 -1
  8. package/lib/domain/choice.js +1 -1
  9. package/lib/domain/data-type.js +1 -1
  10. package/lib/domain/enum/install-action.js +2 -2
  11. package/lib/domain/enum/install-uninstall-repair.js +2 -2
  12. package/lib/domain/enum/installation-type.js +2 -2
  13. package/lib/domain/enum/package-name.js +2 -2
  14. package/lib/domain/input.js +1 -1
  15. package/lib/domain/operation.js +1 -1
  16. package/lib/domain/platform.js +1 -1
  17. package/lib/domain/precondition.js +1 -1
  18. package/lib/incident-response/incident-response.js +3 -3
  19. package/lib/interface/approve-hook.js +2 -2
  20. package/lib/interface/auth-method.js +3 -3
  21. package/lib/interface/aws-invoker.js +2 -2
  22. package/lib/interface/downloadable-content.js +8 -8
  23. package/lib/interface/environment.js +3 -3
  24. package/lib/interface/execute-automation-hook/api-execute-automation-hook.js +1 -1
  25. package/lib/interface/observer.js +1 -1
  26. package/lib/interface/on-failure.js +6 -6
  27. package/lib/interface/pause-hook.js +2 -2
  28. package/lib/interface/run-command-hook/api-run-command-hook.js +1 -1
  29. package/lib/interface/run-document-location.js +2 -2
  30. package/lib/interface/sleep-hook.js +2 -2
  31. package/lib/interface/step-ref.js +1 -1
  32. package/lib/interface/variables/boolean-variable.js +2 -2
  33. package/lib/interface/variables/map-list-variable.js +2 -2
  34. package/lib/interface/variables/number-variable.js +2 -2
  35. package/lib/interface/variables/secure-string-variable.js +4 -4
  36. package/lib/interface/variables/string-list-variable.js +2 -2
  37. package/lib/interface/variables/string-map-variable.js +2 -2
  38. package/lib/interface/variables/string-variable.js +4 -4
  39. package/lib/interface/variables/variable.js +2 -2
  40. package/lib/interface/webhook.js +1 -1
  41. package/lib/parent-steps/automation/approve-step.js +1 -1
  42. package/lib/parent-steps/automation/assert-aws-resource-step.js +1 -1
  43. package/lib/parent-steps/automation/aws-api-step.js +1 -1
  44. package/lib/parent-steps/automation/branch-step.js +1 -1
  45. package/lib/parent-steps/automation/change-instance-state-step.js +3 -3
  46. package/lib/parent-steps/automation/copy-image-step.js +1 -1
  47. package/lib/parent-steps/automation/create-image-step.js +1 -1
  48. package/lib/parent-steps/automation/create-stack-step.js +3 -3
  49. package/lib/parent-steps/automation/create-tags-step.js +3 -3
  50. package/lib/parent-steps/automation/delete-image-step.js +1 -1
  51. package/lib/parent-steps/automation/delete-stack-step.js +1 -1
  52. package/lib/parent-steps/automation/execute-automation-step.js +1 -1
  53. package/lib/parent-steps/automation/execute-script-step.js +5 -5
  54. package/lib/parent-steps/automation/execute-state-machine-step.js +1 -1
  55. package/lib/parent-steps/automation/invoke-lambda-function-step.js +1 -1
  56. package/lib/parent-steps/automation/invoke-webhook-step.js +1 -1
  57. package/lib/parent-steps/automation/pause-step.js +1 -1
  58. package/lib/parent-steps/automation/run-command-step.js +3 -3
  59. package/lib/parent-steps/automation/run-instance-step.js +1 -1
  60. package/lib/parent-steps/automation/sleep-step.js +1 -1
  61. package/lib/parent-steps/automation/update-variable.js +1 -1
  62. package/lib/parent-steps/automation/wait-for-resource-step.js +1 -1
  63. package/lib/parent-steps/automation-step.js +1 -1
  64. package/lib/parent-steps/command/applications-step.js +1 -1
  65. package/lib/parent-steps/command/configure-docker-step.js +1 -1
  66. package/lib/parent-steps/command/configure-package-step.js +1 -1
  67. package/lib/parent-steps/command/domain-join-step.js +1 -1
  68. package/lib/parent-steps/command/download-content-step.js +1 -1
  69. package/lib/parent-steps/command/ps-module-step.js +1 -1
  70. package/lib/parent-steps/command/run-docker-action-step.js +1 -1
  71. package/lib/parent-steps/command/run-document-step.js +1 -1
  72. package/lib/parent-steps/command/run-powershell-script-step.js +1 -1
  73. package/lib/parent-steps/command/run-shell-script-step.js +1 -1
  74. package/lib/parent-steps/command/software-inventory-step.js +1 -1
  75. package/lib/parent-steps/command/update-agent-step.js +1 -1
  76. package/lib/parent-steps/command/update-ssm-agent-step.js +1 -1
  77. package/lib/parent-steps/command-step.js +1 -1
  78. package/lib/parent-steps/step.js +1 -1
  79. package/lib/patterns/automation/composite-step.js +2 -2
  80. package/lib/patterns/automation/reboot-instance-and-wait.js +1 -1
  81. package/lib/patterns/automation/string-step.js +1 -1
  82. package/lib/patterns/document/string-document.js +1 -1
  83. package/lib/patterns/document/timed-document.js +1 -1
  84. package/lib/samples/hello-world.js +1 -1
  85. package/lib/simulation/automation/approve-simulation.js +1 -1
  86. package/lib/simulation/automation/assert-aws-resource-simulation.js +1 -1
  87. package/lib/simulation/automation/automation-simulation-base.js +1 -1
  88. package/lib/simulation/automation/aws-api-simulation.js +1 -1
  89. package/lib/simulation/automation/branch-simulation.js +1 -1
  90. package/lib/simulation/automation/change-instance-state-simulation.js +1 -1
  91. package/lib/simulation/automation/copy-image-simulation.js +1 -1
  92. package/lib/simulation/automation/create-image-simulation.js +1 -1
  93. package/lib/simulation/automation/create-stack-simulation.js +1 -1
  94. package/lib/simulation/automation/create-tags-simulation.js +1 -1
  95. package/lib/simulation/automation/delete-image-simulation.js +1 -1
  96. package/lib/simulation/automation/delete-stack-simulation.js +1 -1
  97. package/lib/simulation/automation/execute-script-simulation.js +1 -1
  98. package/lib/simulation/automation/execute-state-machine-simulation.js +1 -1
  99. package/lib/simulation/automation/invoke-lambda-function-simulation.js +1 -1
  100. package/lib/simulation/automation/invoke-webhook-simulation.js +1 -1
  101. package/lib/simulation/automation/pause-simulation.js +1 -1
  102. package/lib/simulation/automation/run-command-simulation.js +1 -1
  103. package/lib/simulation/automation/run-instance-simulation.js +1 -1
  104. package/lib/simulation/automation/sleep-simulation.js +1 -1
  105. package/lib/simulation/automation/update-variable-simulation.js +1 -1
  106. package/lib/simulation/automation/wait-for-resource-simulation.js +1 -1
  107. package/lib/simulation/automation-step-simulation.js +1 -1
  108. package/lib/simulation/command/command-simulation-base.js +1 -1
  109. package/lib/simulation/command/ps-module-simulation.js +1 -1
  110. package/lib/simulation/command/run-powershell-script-simulation.js +1 -1
  111. package/lib/simulation/command/run-shell-script-simulation.js +1 -1
  112. package/lib/simulation/command-step-simulation.js +1 -1
  113. package/lib/simulation/document/automation-simulation.js +1 -1
  114. package/lib/simulation/document/command-simulation.js +1 -1
  115. package/lib/simulation/simulation.js +1 -1
  116. package/node_modules/@aws-sdk/checksums/package.json +2 -2
  117. package/node_modules/@aws-sdk/client-cloudformation/package.json +3 -3
  118. package/node_modules/@aws-sdk/client-cloudwatch/package.json +3 -3
  119. package/node_modules/@aws-sdk/client-ec2/dist-cjs/schemas/schemas_0.js +37 -4
  120. package/node_modules/@aws-sdk/client-ec2/dist-es/schemas/schemas_0.js +35 -4
  121. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/AttachImageWatermarkCommand.d.ts +2 -3
  122. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/CancelCapacityReservationCommand.d.ts +10 -16
  123. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetAllowedImagesSettingsCommand.d.ts +8 -0
  124. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetAwsNetworkPerformanceDataCommand.d.ts +2 -1
  125. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ModifyIpamScopeCommand.d.ts +1 -2
  126. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ReplaceImageCriteriaInAllowedImagesSettingsCommand.d.ts +15 -0
  127. package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_5.d.ts +42 -15
  128. package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_6.d.ts +17 -35
  129. package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_7.d.ts +86 -1
  130. package/node_modules/@aws-sdk/client-ec2/dist-types/schemas/schemas_0.d.ts +2 -0
  131. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetAwsNetworkPerformanceDataCommand.d.ts +2 -4
  132. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/ModifyIpamScopeCommand.d.ts +4 -2
  133. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_5.d.ts +7 -4
  134. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_6.d.ts +5 -9
  135. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_7.d.ts +15 -0
  136. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/schemas/schemas_0.d.ts +2 -0
  137. package/node_modules/@aws-sdk/client-ec2/package.json +4 -4
  138. package/node_modules/@aws-sdk/client-iam/package.json +3 -3
  139. package/node_modules/@aws-sdk/client-lambda/dist-types/commands/GetProvisionedConcurrencyConfigCommand.d.ts +4 -4
  140. package/node_modules/@aws-sdk/client-lambda/package.json +3 -3
  141. package/node_modules/@aws-sdk/client-s3/package.json +6 -6
  142. package/node_modules/@aws-sdk/client-sns/package.json +3 -3
  143. package/node_modules/@aws-sdk/client-sqs/package.json +3 -3
  144. package/node_modules/@aws-sdk/client-ssm/package.json +3 -3
  145. package/node_modules/@aws-sdk/core/package.json +2 -2
  146. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  147. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  148. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  149. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  150. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  151. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  152. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  153. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  154. package/node_modules/@aws-sdk/middleware-flexible-checksums/package.json +2 -2
  155. package/node_modules/@aws-sdk/middleware-sdk-ec2/package.json +2 -2
  156. package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +2 -2
  157. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  158. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  159. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  160. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  161. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  162. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  163. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  164. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.browser.js +1 -1
  165. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +233 -43
  166. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.browser.js +1 -1
  167. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +233 -43
  168. package/node_modules/@aws-sdk/xml-builder/dist-types/ts3.4/xml-parser.d.ts +1 -1
  169. package/node_modules/@aws-sdk/xml-builder/dist-types/xml-parser.d.ts +2 -1
  170. package/node_modules/@aws-sdk/xml-builder/package.json +4 -4
  171. package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.browser.js +355 -145
  172. package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.js +456 -142
  173. package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.native.js +355 -145
  174. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +5 -2
  175. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +30 -36
  176. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +54 -110
  177. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +30 -36
  178. package/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Js.js +27 -0
  179. package/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Node.js +21 -0
  180. package/node_modules/@smithy/core/dist-es/submodules/checksum/index.browser.js +7 -1
  181. package/node_modules/@smithy/core/dist-es/submodules/checksum/index.js +7 -1
  182. package/node_modules/@smithy/core/dist-es/submodules/checksum/index.native.js +7 -1
  183. package/node_modules/@smithy/core/dist-es/submodules/checksum/md5/Md5Js.js +92 -0
  184. package/node_modules/@smithy/core/dist-es/submodules/checksum/md5/Md5Node.js +29 -0
  185. package/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Js.js +179 -0
  186. package/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Node.js +59 -0
  187. package/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256WebCrypto.js +71 -0
  188. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +4 -1
  189. package/node_modules/@smithy/core/dist-es/submodules/serde/concatBytes.js +15 -0
  190. package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +2 -0
  191. package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +2 -0
  192. package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +2 -0
  193. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/checksum/ChecksumStream.js +4 -0
  194. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/headStream.js +2 -1
  195. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.browser.js +12 -38
  196. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.js +18 -33
  197. package/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.browser.js +3 -0
  198. package/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.js +3 -0
  199. package/node_modules/@smithy/core/dist-types/submodules/checksum/crc32/Crc32Js.d.ts +13 -0
  200. package/node_modules/@smithy/core/dist-types/submodules/checksum/crc32/Crc32Node.d.ts +13 -0
  201. package/node_modules/@smithy/core/dist-types/submodules/checksum/index.browser.d.ts +7 -1
  202. package/node_modules/@smithy/core/dist-types/submodules/checksum/index.d.ts +7 -1
  203. package/node_modules/@smithy/core/dist-types/submodules/checksum/index.native.d.ts +7 -1
  204. package/node_modules/@smithy/core/dist-types/submodules/checksum/md5/Md5Js.d.ts +19 -0
  205. package/node_modules/@smithy/core/dist-types/submodules/checksum/md5/Md5Node.d.ts +17 -0
  206. package/node_modules/@smithy/core/dist-types/submodules/checksum/sha256/Sha256Js.d.ts +28 -0
  207. package/node_modules/@smithy/core/dist-types/submodules/checksum/sha256/Sha256Node.d.ts +13 -0
  208. package/node_modules/@smithy/core/dist-types/submodules/checksum/sha256/Sha256WebCrypto.d.ts +22 -0
  209. package/node_modules/@smithy/core/dist-types/submodules/serde/concatBytes.d.ts +6 -0
  210. package/node_modules/@smithy/core/dist-types/submodules/serde/index.browser.d.ts +2 -0
  211. package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +2 -0
  212. package/node_modules/@smithy/core/dist-types/submodules/serde/index.native.d.ts +2 -0
  213. package/node_modules/@smithy/core/dist-types/submodules/serde/util-stream/checksum/ChecksumStream.d.ts +9 -0
  214. package/node_modules/@smithy/core/dist-types/submodules/serde/util-stream/stream-collector.browser.d.ts +8 -2
  215. package/node_modules/@smithy/core/dist-types/submodules/serde/util-stream/stream-collector.d.ts +4 -1
  216. package/node_modules/@smithy/core/package.json +4 -3
  217. package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
  218. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +2 -55
  219. package/node_modules/@smithy/fetch-http-handler/dist-es/index.js +2 -2
  220. package/node_modules/@smithy/fetch-http-handler/dist-types/index.d.ts +2 -2
  221. package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
  222. package/node_modules/@smithy/middleware-compression/package.json +2 -2
  223. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +3 -51
  224. package/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -3
  225. package/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -3
  226. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  227. package/node_modules/@smithy/signature-v4/package.json +2 -2
  228. package/node_modules/immutable/dist/immutable.es.js +161 -15
  229. package/node_modules/immutable/dist/immutable.js +161 -15
  230. package/node_modules/immutable/dist/immutable.min.js +33 -32
  231. package/node_modules/immutable/package.json +1 -1
  232. package/node_modules/js-yaml/README.md +5 -3
  233. package/node_modules/js-yaml/dist/js-yaml.js +3009 -2402
  234. package/node_modules/js-yaml/dist/js-yaml.js.map +1 -1
  235. package/node_modules/js-yaml/dist/js-yaml.min.js +2 -33
  236. package/node_modules/js-yaml/dist/js-yaml.min.js.map +1 -1
  237. package/node_modules/js-yaml/dist/js-yaml.mjs +3073 -2381
  238. package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -1
  239. package/node_modules/js-yaml/lib/loader.js +7 -11
  240. package/node_modules/js-yaml/lib/type/float.js +1 -1
  241. package/node_modules/js-yaml/lib/type/int.js +4 -4
  242. package/node_modules/js-yaml/package.json +10 -4
  243. package/package.json +12 -12
  244. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-external/nodable_entities.js +0 -333
  245. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-external/nodable_entities.js +0 -332
  246. package/node_modules/@aws-sdk/xml-builder/dist-types/ts3.4/xml-external/nodable_entities.d.ts +0 -66
  247. package/node_modules/@aws-sdk/xml-builder/dist-types/xml-external/nodable_entities.d.ts +0 -65
  248. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/CHANGELOG.md +0 -827
  249. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/LICENSE +0 -21
  250. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/README.md +0 -202
  251. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js +0 -2
  252. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +0 -1
  253. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.cjs +0 -1
  254. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.d.cts +0 -770
  255. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js +0 -2
  256. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js.map +0 -1
  257. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js +0 -2
  258. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js.map +0 -1
  259. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxvalidator.min.js +0 -2
  260. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +0 -1
  261. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/package.json +0 -93
  262. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/cli/cli.js +0 -97
  263. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/cli/man.js +0 -17
  264. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/cli/read.js +0 -43
  265. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/fxp.d.ts +0 -739
  266. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/fxp.js +0 -14
  267. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/ignoreAttributes.js +0 -18
  268. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/util.js +0 -61
  269. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +0 -16
  270. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +0 -106
  271. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +0 -61
  272. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +0 -69
  273. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +0 -103
  274. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +0 -100
  275. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +0 -154
  276. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +0 -94
  277. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
  278. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/TagPath.js +0 -81
  279. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +0 -13
  280. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/XMLParser.js +0 -83
  281. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +0 -235
  282. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +0 -210
  283. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +0 -111
  284. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +0 -116
  285. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +0 -121
  286. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +0 -105
  287. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +0 -22
  288. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +0 -19
  289. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +0 -38
  290. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +0 -13
  291. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +0 -14
  292. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +0 -6
  293. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/validator.js +0 -425
  294. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +0 -6
  295. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +0 -407
  296. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +0 -163
  297. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +0 -840
  298. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +0 -71
  299. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/node2json.js +0 -177
  300. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +0 -40
  301. package/node_modules/@aws-sdk/xml-builder/node_modules/strnum/CHANGELOG.md +0 -51
  302. package/node_modules/@aws-sdk/xml-builder/node_modules/strnum/LICENSE +0 -21
  303. package/node_modules/@aws-sdk/xml-builder/node_modules/strnum/README.md +0 -113
  304. package/node_modules/@aws-sdk/xml-builder/node_modules/strnum/package.json +0 -36
  305. package/node_modules/@aws-sdk/xml-builder/node_modules/strnum/strnum.js +0 -171
  306. package/node_modules/@nodable/entities/README.md +0 -41
  307. package/node_modules/@nodable/entities/package.json +0 -57
  308. package/node_modules/@nodable/entities/src/EntityDecoder.js +0 -644
  309. package/node_modules/@nodable/entities/src/EntityEncoder.js +0 -194
  310. package/node_modules/@nodable/entities/src/entities.js +0 -1159
  311. package/node_modules/@nodable/entities/src/entityTries.js +0 -49
  312. package/node_modules/@nodable/entities/src/index.d.ts +0 -341
  313. package/node_modules/@nodable/entities/src/index.js +0 -29
  314. package/node_modules/@smithy/core/dist-es/submodules/checksum/md5-js/constants.js +0 -3
  315. package/node_modules/@smithy/core/dist-es/submodules/checksum/md5-js/md5.js +0 -168
  316. package/node_modules/@smithy/core/dist-types/submodules/checksum/md5-js/constants.d.ts +0 -12
  317. package/node_modules/@smithy/core/dist-types/submodules/checksum/md5-js/md5.d.ts +0 -16
  318. package/node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js +0 -53
  319. package/node_modules/@smithy/fetch-http-handler/dist-types/stream-collector.d.ts +0 -2
  320. package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +0 -8
  321. package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +0 -41
  322. package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -5
  323. package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +0 -7
  324. package/node_modules/anynum/LICENSE +0 -21
  325. package/node_modules/anynum/README.md +0 -142
  326. package/node_modules/anynum/anynum.js +0 -135
  327. package/node_modules/anynum/digitTable.js +0 -116
  328. package/node_modules/anynum/package.json +0 -42
  329. package/node_modules/fast-xml-builder/CHANGELOG.md +0 -40
  330. package/node_modules/fast-xml-builder/LICENSE +0 -21
  331. package/node_modules/fast-xml-builder/README.md +0 -74
  332. package/node_modules/fast-xml-builder/lib/fxb.cjs +0 -1
  333. package/node_modules/fast-xml-builder/lib/fxb.d.cts +0 -270
  334. package/node_modules/fast-xml-builder/lib/fxb.min.js +0 -2
  335. package/node_modules/fast-xml-builder/lib/fxb.min.js.map +0 -1
  336. package/node_modules/fast-xml-builder/package.json +0 -81
  337. package/node_modules/fast-xml-builder/src/fxb.d.ts +0 -270
  338. package/node_modules/fast-xml-builder/src/fxb.js +0 -599
  339. package/node_modules/fast-xml-builder/src/ignoreAttributes.js +0 -18
  340. package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +0 -359
  341. package/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
  342. package/node_modules/fast-xml-builder/src/util.js +0 -16
  343. package/node_modules/path-expression-matcher/LICENSE +0 -21
  344. package/node_modules/path-expression-matcher/README.md +0 -947
  345. package/node_modules/path-expression-matcher/lib/pem.cjs +0 -1
  346. package/node_modules/path-expression-matcher/lib/pem.d.cts +0 -715
  347. package/node_modules/path-expression-matcher/lib/pem.min.js +0 -2
  348. package/node_modules/path-expression-matcher/lib/pem.min.js.map +0 -1
  349. package/node_modules/path-expression-matcher/package.json +0 -79
  350. package/node_modules/path-expression-matcher/src/Expression.js +0 -232
  351. package/node_modules/path-expression-matcher/src/ExpressionSet.js +0 -225
  352. package/node_modules/path-expression-matcher/src/Matcher.js +0 -660
  353. package/node_modules/path-expression-matcher/src/index.d.ts +0 -589
  354. package/node_modules/path-expression-matcher/src/index.js +0 -29
  355. package/node_modules/xml-naming/README.md +0 -189
  356. package/node_modules/xml-naming/package.json +0 -54
  357. package/node_modules/xml-naming/src/index.d.ts +0 -74
  358. package/node_modules/xml-naming/src/index.js +0 -270
@@ -152,7 +152,7 @@ function State (input, options) {
152
152
  this.json = options['json'] || false
153
153
  this.listener = options['listener'] || null
154
154
  this.maxDepth = typeof options['maxDepth'] === 'number' ? options['maxDepth'] : 100
155
- this.maxMergeSeqLength = typeof options['maxMergeSeqLength'] === 'number' ? options['maxMergeSeqLength'] : 20
155
+ this.maxTotalMergeKeys = typeof options['maxTotalMergeKeys'] === 'number' ? options['maxTotalMergeKeys'] : 10000
156
156
 
157
157
  this.implicitTypes = this.schema.compiledImplicit
158
158
  this.typeMap = this.schema.compiledTypeMap
@@ -163,6 +163,7 @@ function State (input, options) {
163
163
  this.lineStart = 0
164
164
  this.lineIndent = 0
165
165
  this.depth = 0
166
+ this.totalMergeKeys = 0
166
167
 
167
168
  // position of first leading tab in the current line,
168
169
  // used to make sure there are no tabs in the indentation
@@ -380,6 +381,10 @@ function mergeMappings (state, destination, source, overridableKeys) {
380
381
  for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
381
382
  const key = sourceKeys[index]
382
383
 
384
+ if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {
385
+ throwError(state, 'merge keys exceeded maxTotalMergeKeys (' + state.maxTotalMergeKeys + ')')
386
+ }
387
+
383
388
  if (!_hasOwnProperty.call(destination, key)) {
384
389
  setProperty(destination, key, source[key])
385
390
  overridableKeys[key] = true
@@ -421,17 +426,8 @@ function storeMappingPair (state, _result, overridableKeys, keyTag, keyNode, val
421
426
 
422
427
  if (keyTag === 'tag:yaml.org,2002:merge') {
423
428
  if (Array.isArray(valueNode)) {
424
- if (valueNode.length > state.maxMergeSeqLength) {
425
- throwError(state, 'merge sequence length exceeded maxMergeSeqLength (' + state.maxMergeSeqLength + ')')
426
- }
427
- const seen = new Set()
428
429
  for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {
429
- const src = valueNode[index]
430
- // Existing keys are not overridden on merge, so dedupe sources to
431
- // avoid redundant work on repeated aliases.
432
- if (seen.has(src)) continue
433
- seen.add(src)
434
- mergeMappings(state, _result, src, overridableKeys)
430
+ mergeMappings(state, _result, valueNode[index], overridableKeys)
435
431
  }
436
432
  } else {
437
433
  mergeMappings(state, _result, valueNode, overridableKeys)
@@ -28,7 +28,7 @@ function resolveYamlFloat (data) {
28
28
  return false
29
29
  }
30
30
 
31
- if (Number.isFinite(parseFloat(data, 10))) {
31
+ if (isFinite(parseFloat(data, 10))) {
32
32
  return true
33
33
  }
34
34
 
@@ -49,7 +49,7 @@ function resolveYamlInteger (data) {
49
49
  if (ch !== '0' && ch !== '1') return false
50
50
  hasDigits = true
51
51
  }
52
- return hasDigits && Number.isFinite(parseYamlInteger(data))
52
+ return hasDigits && isFinite(parseYamlInteger(data))
53
53
  }
54
54
 
55
55
  if (ch === 'x') {
@@ -60,7 +60,7 @@ function resolveYamlInteger (data) {
60
60
  if (!isHexCode(data.charCodeAt(index))) return false
61
61
  hasDigits = true
62
62
  }
63
- return hasDigits && Number.isFinite(parseYamlInteger(data))
63
+ return hasDigits && isFinite(parseYamlInteger(data))
64
64
  }
65
65
 
66
66
  if (ch === 'o') {
@@ -71,7 +71,7 @@ function resolveYamlInteger (data) {
71
71
  if (!isOctCode(data.charCodeAt(index))) return false
72
72
  hasDigits = true
73
73
  }
74
- return hasDigits && Number.isFinite(parseYamlInteger(data))
74
+ return hasDigits && isFinite(parseYamlInteger(data))
75
75
  }
76
76
  }
77
77
 
@@ -86,7 +86,7 @@ function resolveYamlInteger (data) {
86
86
 
87
87
  if (!hasDigits) return false
88
88
 
89
- return Number.isFinite(parseYamlInteger(data))
89
+ return isFinite(parseYamlInteger(data))
90
90
  }
91
91
 
92
92
  function parseYamlInteger (data) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-yaml",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "YAML 1.2 parser and serializer",
5
5
  "keywords": [
6
6
  "yaml",
@@ -32,6 +32,9 @@
32
32
  "bin/",
33
33
  "dist/"
34
34
  ],
35
+ "publishConfig": {
36
+ "tag": "v4-legacy"
37
+ },
35
38
  "bin": {
36
39
  "js-yaml": "bin/js-yaml.js"
37
40
  },
@@ -53,8 +56,7 @@
53
56
  "build": "node support/build-dist.mjs",
54
57
  "build:demo": "npm run lint && node support/build_demo.mjs",
55
58
  "gh-demo": "npm run build:demo && gh-pages -d demo -f",
56
- "prepack": "npm test && npm run build && npm run build:demo",
57
- "postpublish": "npm run gh-demo"
59
+ "prepack": "npm test && npm run build"
58
60
  },
59
61
  "unpkg": "dist/js-yaml.min.js",
60
62
  "jsdelivr": "dist/js-yaml.min.js",
@@ -62,6 +64,10 @@
62
64
  "argparse": "^2.0.1"
63
65
  },
64
66
  "devDependencies": {
67
+ "@babel/core": "8.0.1",
68
+ "@babel/preset-env": "8.0.1",
69
+ "@rollup/plugin-commonjs": "29.0.3",
70
+ "@rollup/plugin-terser": "0.4.4",
65
71
  "c8": "^11.0.0",
66
72
  "codemirror": "^5.65.21",
67
73
  "eslint": "^9.39.4",
@@ -69,7 +75,7 @@
69
75
  "gh-pages": "^6.3.0",
70
76
  "neostandard": "^0.13.0",
71
77
  "tinybench": "^6.0.2",
72
- "vite": "^8.0.14",
78
+ "vite": "7.3.6",
73
79
  "vite-plugin-node-polyfills": "^0.28.0",
74
80
  "vite-plugin-singlefile": "^2.3.3",
75
81
  "workerpool": "^10.0.2"
package/package.json CHANGED
@@ -74,17 +74,17 @@
74
74
  "constructs": "^10.5.1"
75
75
  },
76
76
  "dependencies": {
77
- "@aws-sdk/client-cloudformation": "^3.1073.0",
78
- "@aws-sdk/client-cloudwatch": "^3.1073.0",
79
- "@aws-sdk/client-ec2": "^3.1073.0",
80
- "@aws-sdk/client-iam": "^3.1073.0",
81
- "@aws-sdk/client-lambda": "^3.1073.0",
82
- "@aws-sdk/client-s3": "^3.1073.0",
83
- "@aws-sdk/client-sns": "^3.1073.0",
84
- "@aws-sdk/client-sqs": "^3.1073.0",
85
- "@aws-sdk/client-ssm": "^3.1073.0",
86
- "immutable": "^4.3.8",
87
- "js-yaml": "^4.2.0",
77
+ "@aws-sdk/client-cloudformation": "^3.1075.0",
78
+ "@aws-sdk/client-cloudwatch": "^3.1075.0",
79
+ "@aws-sdk/client-ec2": "^3.1075.0",
80
+ "@aws-sdk/client-iam": "^3.1075.0",
81
+ "@aws-sdk/client-lambda": "^3.1075.0",
82
+ "@aws-sdk/client-s3": "^3.1075.0",
83
+ "@aws-sdk/client-sns": "^3.1075.0",
84
+ "@aws-sdk/client-sqs": "^3.1075.0",
85
+ "@aws-sdk/client-ssm": "^3.1075.0",
86
+ "immutable": "^4.3.9",
87
+ "js-yaml": "^4.3.0",
88
88
  "jsonpath": "^1.3.0",
89
89
  "python-shell": "^3.0.1",
90
90
  "synchronized-promise": "^0.3.1"
@@ -116,7 +116,7 @@
116
116
  "publishConfig": {
117
117
  "access": "public"
118
118
  },
119
- "version": "0.0.66",
119
+ "version": "0.0.67",
120
120
  "jest": {
121
121
  "coverageProvider": "v8",
122
122
  "maxWorkers": 4,
@@ -1,333 +0,0 @@
1
- const XML = {
2
- amp: "&",
3
- apos: "'",
4
- gt: ">",
5
- lt: "<",
6
- quot: '"',
7
- };
8
- exports.XML = XML;
9
- exports.COMMON_HTML = {
10
- nbsp: "\u00a0",
11
- copy: "\u00a9",
12
- reg: "\u00ae",
13
- trade: "\u2122",
14
- mdash: "\u2014",
15
- ndash: "\u2013",
16
- hellip: "\u2026",
17
- laquo: "\u00ab",
18
- raquo: "\u00bb",
19
- lsquo: "\u2018",
20
- rsquo: "\u2019",
21
- ldquo: "\u201c",
22
- rdquo: "\u201d",
23
- bull: "\u2022",
24
- para: "\u00b6",
25
- sect: "\u00a7",
26
- deg: "\u00b0",
27
- frac12: "\u00bd",
28
- frac14: "\u00bc",
29
- frac34: "\u00be",
30
- };
31
- exports.CURRENCY = {
32
- cent: "\u00a2",
33
- pound: "\u00a3",
34
- curren: "\u00a4",
35
- yen: "\u00a5",
36
- euro: "\u20ac",
37
- dollar: "$",
38
- fnof: "\u0192",
39
- inr: "\u20b9",
40
- af: "\u060b",
41
- birr: "\u1265\u122d",
42
- peso: "\u20b1",
43
- rub: "\u20bd",
44
- won: "\u20a9",
45
- yuan: "\u00a5",
46
- cedil: "\u00b8",
47
- };
48
- const SPECIAL_CHARS = new Set("!?\\/[]$%{}^&*()<>|+");
49
- function validateEntityName(name) {
50
- if (name[0] === "#") {
51
- throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${name}"`);
52
- }
53
- for (const ch of name) {
54
- if (SPECIAL_CHARS.has(ch)) {
55
- throw new Error(`[EntityReplacer] Invalid character '${ch}' in entity name: "${name}"`);
56
- }
57
- }
58
- return name;
59
- }
60
- function mergeEntityMaps(...maps) {
61
- const out = Object.create(null);
62
- for (const map of maps) {
63
- if (!map) {
64
- continue;
65
- }
66
- for (const key of Object.keys(map)) {
67
- const raw = map[key];
68
- if (typeof raw === "string") {
69
- out[key] = raw;
70
- }
71
- else if (raw && typeof raw === "object" && raw.val !== undefined) {
72
- const val = raw.val;
73
- if (typeof val === "string") {
74
- out[key] = val;
75
- }
76
- }
77
- }
78
- }
79
- return out;
80
- }
81
- const LIMIT_TIER_EXTERNAL = "external";
82
- const LIMIT_TIER_BASE = "base";
83
- const LIMIT_TIER_ALL = "all";
84
- function parseLimitTiers(raw) {
85
- if (!raw || raw === LIMIT_TIER_EXTERNAL) {
86
- return new Set([LIMIT_TIER_EXTERNAL]);
87
- }
88
- if (raw === LIMIT_TIER_ALL) {
89
- return new Set([LIMIT_TIER_ALL]);
90
- }
91
- if (raw === LIMIT_TIER_BASE) {
92
- return new Set([LIMIT_TIER_BASE]);
93
- }
94
- if (Array.isArray(raw)) {
95
- return new Set(raw);
96
- }
97
- return new Set([LIMIT_TIER_EXTERNAL]);
98
- }
99
- const NCR_LEVEL = Object.freeze({ allow: 0, leave: 1, remove: 2, throw: 3 });
100
- const XML10_ALLOWED_C0 = new Set([0x09, 0x0a, 0x0d]);
101
- function parseNCRConfig(ncr) {
102
- if (!ncr) {
103
- return { xmlVersion: 1.0, onLevel: NCR_LEVEL.allow, nullLevel: NCR_LEVEL.remove };
104
- }
105
- const xmlVersion = ncr.xmlVersion === 1.1 ? 1.1 : 1.0;
106
- const onLevel = NCR_LEVEL[ncr.onNCR ?? "allow"] ?? NCR_LEVEL.allow;
107
- const nullLevel = NCR_LEVEL[ncr.nullNCR ?? "remove"] ?? NCR_LEVEL.remove;
108
- const clampedNull = Math.max(nullLevel, NCR_LEVEL.remove);
109
- return { xmlVersion, onLevel, nullLevel: clampedNull };
110
- }
111
- exports.EntityDecoderImpl = class EntityDecoderImpl {
112
- _limit;
113
- _maxTotalExpansions;
114
- _maxExpandedLength;
115
- _postCheck;
116
- _limitTiers;
117
- _numericAllowed;
118
- _baseMap;
119
- _externalMap;
120
- _inputMap;
121
- _totalExpansions;
122
- _expandedLength;
123
- _removeSet;
124
- _leaveSet;
125
- _ncrXmlVersion;
126
- _ncrOnLevel;
127
- _ncrNullLevel;
128
- constructor(options = {}) {
129
- this._limit = options.limit || {};
130
- this._maxTotalExpansions = this._limit.maxTotalExpansions || 0;
131
- this._maxExpandedLength = this._limit.maxExpandedLength || 0;
132
- this._postCheck = typeof options.postCheck === "function" ? options.postCheck : (r) => r;
133
- this._limitTiers = parseLimitTiers(this._limit.applyLimitsTo ?? LIMIT_TIER_EXTERNAL);
134
- this._numericAllowed = options.numericAllowed ?? true;
135
- this._baseMap = mergeEntityMaps(XML, options.namedEntities || null);
136
- this._externalMap = Object.create(null);
137
- this._inputMap = Object.create(null);
138
- this._totalExpansions = 0;
139
- this._expandedLength = 0;
140
- this._removeSet = new Set(options.remove && Array.isArray(options.remove) ? options.remove : []);
141
- this._leaveSet = new Set(options.leave && Array.isArray(options.leave) ? options.leave : []);
142
- const ncrCfg = parseNCRConfig(options.ncr);
143
- this._ncrXmlVersion = ncrCfg.xmlVersion;
144
- this._ncrOnLevel = ncrCfg.onLevel;
145
- this._ncrNullLevel = ncrCfg.nullLevel;
146
- }
147
- setExternalEntities(map) {
148
- if (map) {
149
- for (const key of Object.keys(map)) {
150
- validateEntityName(key);
151
- }
152
- }
153
- this._externalMap = mergeEntityMaps(map);
154
- }
155
- addExternalEntity(key, value) {
156
- validateEntityName(key);
157
- if (typeof value === "string" && value.indexOf("&") === -1) {
158
- this._externalMap[key] = value;
159
- }
160
- }
161
- addInputEntities(map) {
162
- this._totalExpansions = 0;
163
- this._expandedLength = 0;
164
- this._inputMap = mergeEntityMaps(map);
165
- }
166
- reset() {
167
- this._inputMap = Object.create(null);
168
- this._totalExpansions = 0;
169
- this._expandedLength = 0;
170
- return this;
171
- }
172
- setXmlVersion(version) {
173
- this._ncrXmlVersion = version === "1.1" || version === 1.1 ? 1.1 : 1.0;
174
- }
175
- decode(str) {
176
- if (typeof str !== "string" || str.length === 0) {
177
- return str;
178
- }
179
- const original = str;
180
- const chunks = [];
181
- const len = str.length;
182
- let last = 0;
183
- let i = 0;
184
- const limitExpansions = this._maxTotalExpansions > 0;
185
- const limitLength = this._maxExpandedLength > 0;
186
- const checkLimits = limitExpansions || limitLength;
187
- while (i < len) {
188
- if (str.charCodeAt(i) !== 38) {
189
- i++;
190
- continue;
191
- }
192
- let j = i + 1;
193
- while (j < len && str.charCodeAt(j) !== 59 && j - i <= 32) {
194
- j++;
195
- }
196
- if (j >= len || str.charCodeAt(j) !== 59) {
197
- i++;
198
- continue;
199
- }
200
- const token = str.slice(i + 1, j);
201
- if (token.length === 0) {
202
- i++;
203
- continue;
204
- }
205
- let replacement;
206
- let tier;
207
- if (this._removeSet.has(token)) {
208
- replacement = "";
209
- if (tier === undefined) {
210
- tier = LIMIT_TIER_EXTERNAL;
211
- }
212
- }
213
- else if (this._leaveSet.has(token)) {
214
- i++;
215
- continue;
216
- }
217
- else if (token.charCodeAt(0) === 35) {
218
- const ncrResult = this._resolveNCR(token);
219
- if (ncrResult === undefined) {
220
- i++;
221
- continue;
222
- }
223
- replacement = ncrResult;
224
- tier = LIMIT_TIER_BASE;
225
- }
226
- else {
227
- const resolved = this._resolveName(token);
228
- replacement = resolved?.value;
229
- tier = resolved?.tier;
230
- }
231
- if (replacement === undefined) {
232
- i++;
233
- continue;
234
- }
235
- if (i > last) {
236
- chunks.push(str.slice(last, i));
237
- }
238
- chunks.push(replacement);
239
- last = j + 1;
240
- i = last;
241
- if (checkLimits && this._tierCounts(tier)) {
242
- if (limitExpansions) {
243
- this._totalExpansions++;
244
- if (this._totalExpansions > this._maxTotalExpansions) {
245
- throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ` +
246
- `${this._totalExpansions} > ${this._maxTotalExpansions}`);
247
- }
248
- }
249
- if (limitLength) {
250
- const delta = replacement.length - (token.length + 2);
251
- if (delta > 0) {
252
- this._expandedLength += delta;
253
- if (this._expandedLength > this._maxExpandedLength) {
254
- throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ` +
255
- `${this._expandedLength} > ${this._maxExpandedLength}`);
256
- }
257
- }
258
- }
259
- }
260
- }
261
- if (last < len) {
262
- chunks.push(str.slice(last));
263
- }
264
- const result = chunks.length === 0 ? str : chunks.join("");
265
- return this._postCheck(result, original);
266
- }
267
- _tierCounts(tier) {
268
- if (this._limitTiers.has(LIMIT_TIER_ALL)) {
269
- return true;
270
- }
271
- return this._limitTiers.has(tier);
272
- }
273
- _resolveName(name) {
274
- if (name in this._inputMap) {
275
- return { value: this._inputMap[name], tier: LIMIT_TIER_EXTERNAL };
276
- }
277
- if (name in this._externalMap) {
278
- return { value: this._externalMap[name], tier: LIMIT_TIER_EXTERNAL };
279
- }
280
- if (name in this._baseMap) {
281
- return { value: this._baseMap[name], tier: LIMIT_TIER_BASE };
282
- }
283
- return undefined;
284
- }
285
- _classifyNCR(cp) {
286
- if (cp === 0) {
287
- return this._ncrNullLevel;
288
- }
289
- if (cp >= 0xd800 && cp <= 0xdfff) {
290
- return NCR_LEVEL.remove;
291
- }
292
- if (this._ncrXmlVersion === 1.0) {
293
- if (cp >= 0x01 && cp <= 0x1f && !XML10_ALLOWED_C0.has(cp)) {
294
- return NCR_LEVEL.remove;
295
- }
296
- }
297
- return -1;
298
- }
299
- _applyNCRAction(action, token, cp) {
300
- switch (action) {
301
- case NCR_LEVEL.allow:
302
- return String.fromCodePoint(cp);
303
- case NCR_LEVEL.remove:
304
- return "";
305
- case NCR_LEVEL.leave:
306
- return undefined;
307
- case NCR_LEVEL.throw:
308
- throw new Error(`[EntityDecoder] Prohibited numeric character reference ` +
309
- `&${token}; (U+${cp.toString(16).toUpperCase().padStart(4, "0")})`);
310
- default:
311
- return String.fromCodePoint(cp);
312
- }
313
- }
314
- _resolveNCR(token) {
315
- const second = token.charCodeAt(1);
316
- let cp;
317
- if (second === 120 || second === 88) {
318
- cp = parseInt(token.slice(2), 16);
319
- }
320
- else {
321
- cp = parseInt(token.slice(1), 10);
322
- }
323
- if (Number.isNaN(cp) || cp < 0 || cp > 0x10ffff) {
324
- return undefined;
325
- }
326
- const minimum = this._classifyNCR(cp);
327
- if (!this._numericAllowed && minimum < NCR_LEVEL.remove) {
328
- return undefined;
329
- }
330
- const effective = minimum === -1 ? this._ncrOnLevel : Math.max(this._ncrOnLevel, minimum);
331
- return this._applyNCRAction(effective, token, cp);
332
- }
333
- };