@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
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- import { validate } from './validator.js';
4
- import XMLParser from './xmlparser/XMLParser.js';
5
- import XMLBuilder from './xmlbuilder/json2xml.js';
6
-
7
- const XMLValidator = {
8
- validate: validate
9
- }
10
- export {
11
- XMLParser,
12
- XMLValidator,
13
- XMLBuilder
14
- };
@@ -1,18 +0,0 @@
1
- export default function getIgnoreAttributesFn(ignoreAttributes) {
2
- if (typeof ignoreAttributes === 'function') {
3
- return ignoreAttributes
4
- }
5
- if (Array.isArray(ignoreAttributes)) {
6
- return (attrName) => {
7
- for (const pattern of ignoreAttributes) {
8
- if (typeof pattern === 'string' && attrName === pattern) {
9
- return true
10
- }
11
- if (pattern instanceof RegExp && pattern.test(attrName)) {
12
- return true
13
- }
14
- }
15
- }
16
- }
17
- return () => false
18
- }
@@ -1,61 +0,0 @@
1
- 'use strict';
2
-
3
- const nameStartChar = ':A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
4
- const nameChar = nameStartChar + '\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
5
- export const nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*';
6
- const regexName = new RegExp('^' + nameRegexp + '$');
7
-
8
- export function getAllMatches(string, regex) {
9
- const matches = [];
10
- let match = regex.exec(string);
11
- while (match) {
12
- const allmatches = [];
13
- allmatches.startIndex = regex.lastIndex - match[0].length;
14
- const len = match.length;
15
- for (let index = 0; index < len; index++) {
16
- allmatches.push(match[index]);
17
- }
18
- matches.push(allmatches);
19
- match = regex.exec(string);
20
- }
21
- return matches;
22
- }
23
-
24
- export const isName = function (string) {
25
- const match = regexName.exec(string);
26
- return !(match === null || typeof match === 'undefined');
27
- }
28
-
29
- export function isExist(v) {
30
- return typeof v !== 'undefined';
31
- }
32
-
33
- export function isEmptyObject(obj) {
34
- return Object.keys(obj).length === 0;
35
- }
36
-
37
- export function getValue(v) {
38
- if (exports.isExist(v)) {
39
- return v;
40
- } else {
41
- return '';
42
- }
43
- }
44
-
45
- /**
46
- * Dangerous property names that could lead to prototype pollution or security issues
47
- */
48
- export const DANGEROUS_PROPERTY_NAMES = [
49
- // '__proto__',
50
- // 'constructor',
51
- // 'prototype',
52
- 'hasOwnProperty',
53
- 'toString',
54
- 'valueOf',
55
- '__defineGetter__',
56
- '__defineSetter__',
57
- '__lookupGetter__',
58
- '__lookupSetter__'
59
- ];
60
-
61
- export const criticalProperties = ["__proto__", "constructor", "prototype"];
@@ -1,16 +0,0 @@
1
- export default {
2
- "<" : "<", //tag start
3
- ">" : ">", //tag end
4
- "/" : "/", //close tag
5
- "!" : "!", //comment or docttype
6
- "!--" : "!--", //comment
7
- "-->" : "-->", //comment end
8
- "?" : "?", //pi
9
- "?>" : "?>", //pi end
10
- "?xml" : "?xml", //pi end
11
- "![" : "![", //cdata
12
- "]]>" : "]]>", //cdata end
13
- "[" : "[",
14
- "-" : "-",
15
- "D" : "D",
16
- }
@@ -1,106 +0,0 @@
1
- const ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" };
2
- const htmlEntities = {
3
- "space": { regex: /&(nbsp|#160);/g, val: " " },
4
- // "lt" : { regex: /&(lt|#60);/g, val: "<" },
5
- // "gt" : { regex: /&(gt|#62);/g, val: ">" },
6
- // "amp" : { regex: /&(amp|#38);/g, val: "&" },
7
- // "quot" : { regex: /&(quot|#34);/g, val: "\"" },
8
- // "apos" : { regex: /&(apos|#39);/g, val: "'" },
9
- "cent": { regex: /&(cent|#162);/g, val: "¢" },
10
- "pound": { regex: /&(pound|#163);/g, val: "£" },
11
- "yen": { regex: /&(yen|#165);/g, val: "¥" },
12
- "euro": { regex: /&(euro|#8364);/g, val: "€" },
13
- "copyright": { regex: /&(copy|#169);/g, val: "©" },
14
- "reg": { regex: /&(reg|#174);/g, val: "®" },
15
- "inr": { regex: /&(inr|#8377);/g, val: "₹" },
16
- "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str) => String.fromCodePoint(Number.parseInt(str, 10)) },
17
- "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str) => String.fromCodePoint(Number.parseInt(str, 16)) },
18
- };
19
- export default class EntitiesParser {
20
- constructor(replaceHtmlEntities) {
21
- this.replaceHtmlEntities = replaceHtmlEntities;
22
- this.docTypeEntities = {};
23
- this.lastEntities = {
24
- "apos": { regex: /&(apos|#39|#x27);/g, val: "'" },
25
- "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" },
26
- "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" },
27
- "quot": { regex: /&(quot|#34|#x22);/g, val: "\"" },
28
- };
29
- }
30
-
31
- addExternalEntities(externalEntities) {
32
- const entKeys = Object.keys(externalEntities);
33
- for (let i = 0; i < entKeys.length; i++) {
34
- const ent = entKeys[i];
35
- this.addExternalEntity(ent, externalEntities[ent])
36
- }
37
- }
38
- addExternalEntity(key, val) {
39
- validateEntityName(key);
40
- const escaped = key.replace(/[.\-+*:]/g, '\\.');
41
- if (val.indexOf("&") !== -1) {
42
- reportWarning(`Entity ${key} is not added as '&' is found in value;`)
43
- return;
44
- } else {
45
- this.lastEntities[key] = {
46
- regex: new RegExp("&" + escaped + ";", "g"),
47
- val: val
48
- }
49
- }
50
- }
51
-
52
- addDocTypeEntities(entities) {
53
- const entKeys = Object.keys(entities);
54
- for (let i = 0; i < entKeys.length; i++) {
55
- const ent = entKeys[i];
56
- const escaped = ent.replace(/[.\-+*:]/g, '\\.');
57
- this.docTypeEntities[ent] = {
58
- regex: new RegExp("&" + escaped + ";", "g"),
59
- val: entities[ent]
60
- }
61
- }
62
- }
63
-
64
- parse(val) {
65
- return this.replaceEntitiesValue(val)
66
- }
67
-
68
- /**
69
- * 1. Replace DOCTYPE entities
70
- * 2. Replace external entities
71
- * 3. Replace HTML entities if asked
72
- * @param {string} val
73
- */
74
- replaceEntitiesValue(val) {
75
- if (typeof val === "string" && val.length > 0) {
76
- for (let entityName in this.docTypeEntities) {
77
- const entity = this.docTypeEntities[entityName];
78
- val = val.replace(entity.regx, entity.val);
79
- }
80
- for (let entityName in this.lastEntities) {
81
- const entity = this.lastEntities[entityName];
82
- val = val.replace(entity.regex, entity.val);
83
- }
84
- if (this.replaceHtmlEntities) {
85
- for (let entityName in htmlEntities) {
86
- const entity = htmlEntities[entityName];
87
- val = val.replace(entity.regex, entity.val);
88
- }
89
- }
90
- val = val.replace(ampEntity.regex, ampEntity.val);
91
- }
92
- return val;
93
- }
94
- }
95
-
96
- //an entity name should not contains special characters that may be used in regex
97
- //Eg !?\\\/[]$%{}^&*()<>
98
- const specialChar = "!?\\/[]$%{}^&*()<>|+";
99
-
100
- function validateEntityName(name) {
101
- for (let i = 0; i < specialChar.length; i++) {
102
- const ch = specialChar[i];
103
- if (name.indexOf(ch) !== -1) throw new Error(`Invalid character ${ch} in entity name`);
104
- }
105
- return name;
106
- }
@@ -1,61 +0,0 @@
1
-
2
- import { JsObjOutputBuilder } from './OutputBuilders/JsObjBuilder.js';
3
-
4
- export const defaultOptions = {
5
- preserveOrder: false,
6
- removeNSPrefix: false, // remove NS from tag name or attribute name if true
7
- //ignoreRootElement : false,
8
- stopNodes: [], //nested tags will not be parsed even for errors
9
- // isArray: () => false, //User will set it
10
- htmlEntities: false,
11
- // skipEmptyListItem: false
12
- tags: {
13
- unpaired: [],
14
- nameFor: {
15
- cdata: false,
16
- comment: false,
17
- text: '#text'
18
- },
19
- separateTextProperty: false,
20
- },
21
- attributes: {
22
- ignore: false,
23
- booleanType: true,
24
- entities: true,
25
- },
26
-
27
- // select: ["img[src]"],
28
- // stop: ["anim", "[ads]"]
29
- only: [], // rest tags will be skipped. It will result in flat array
30
- hierarchy: false, //will be used when a particular tag is set to be parsed.
31
- skip: [], // will be skipped from parse result. on('skip') will be triggered
32
-
33
- select: [], // on('select', tag => tag ) will be called if match
34
- stop: [], //given tagPath will not be parsed. innerXML will be set as string value
35
- OutputBuilder: new JsObjOutputBuilder(),
36
- };
37
-
38
- export const buildOptions = function (options) {
39
- const finalOptions = { ...defaultOptions };
40
- copyProperties(finalOptions, options)
41
- return finalOptions;
42
- };
43
-
44
- function copyProperties(target, source) {
45
- for (let key in source) {
46
- if (Object.prototype.hasOwnProperty.call(source, key)) {
47
- if (key === 'OutputBuilder') {
48
- target[key] = source[key];
49
- } else if (typeof source[key] === 'object' && !Array.isArray(source[key])) {
50
- // Recursively copy nested properties
51
- if (typeof target[key] === 'undefined') {
52
- target[key] = {};
53
- }
54
- copyProperties(target[key], source[key]);
55
- } else {
56
- // Copy non-nested properties
57
- target[key] = source[key];
58
- }
59
- }
60
- }
61
- }
@@ -1,69 +0,0 @@
1
- export default class BaseOutputBuilder {
2
- constructor() {
3
- // this.attributes = {};
4
- }
5
-
6
- addAttribute(name, value) {
7
- if (this.options.onAttribute) {
8
- //TODO: better to pass tag path
9
- const v = this.options.onAttribute(name, value, this.tagName);
10
- if (v) this.attributes[v.name] = v.value;
11
- } else {
12
- name = this.options.attributes.prefix + name + this.options.attributes.suffix;
13
- this.attributes[name] = this.parseValue(value, this.options.attributes.valueParsers);
14
- }
15
- }
16
-
17
- /**
18
- * parse value by chain of parsers
19
- * @param {string} val
20
- * @returns {any} parsed value if matching parser found
21
- */
22
- parseValue = function (val, valParsers) {
23
- for (let i = 0; i < valParsers.length; i++) {
24
- let valParser = valParsers[i];
25
- if (typeof valParser === "string") {
26
- valParser = this.registeredParsers[valParser];
27
- }
28
- if (valParser) {
29
- val = valParser.parse(val);
30
- }
31
- }
32
- return val;
33
- }
34
-
35
- /**
36
- * To add a nested empty tag.
37
- * @param {string} key
38
- * @param {any} val
39
- */
40
- _addChild(key, val) { }
41
-
42
- /**
43
- * skip the comment if property is not set
44
- */
45
- addComment(text) {
46
- if (this.options.nameFor.comment)
47
- this._addChild(this.options.nameFor.comment, text);
48
- }
49
-
50
- //store CDATA separately if property is set
51
- //otherwise add to tag's value
52
- addCdata(text) {
53
- if (this.options.nameFor.cdata) {
54
- this._addChild(this.options.nameFor.cdata, text);
55
- } else {
56
- this.addRawValue(text || "");
57
- }
58
- }
59
-
60
- addRawValue = text => this.addValue(text);
61
-
62
- addDeclaration() {
63
- if (!this.options.declaration) {
64
- } else {
65
- this.addPi("?xml");
66
- }
67
- this.attributes = {}
68
- }
69
- }
@@ -1,103 +0,0 @@
1
- import { buildOptions, registerCommonValueParsers } from './ParserOptionsBuilder.js';
2
-
3
- export default class OutputBuilder {
4
- constructor(options) {
5
- this.options = buildOptions(options);
6
- this.registeredParsers = registerCommonValueParsers(this.options);
7
- }
8
-
9
- registerValueParser(name, parserInstance) {//existing name will override the parser without warning
10
- this.registeredParsers[name] = parserInstance;
11
- }
12
-
13
- getInstance(parserOptions) {
14
- return new JsArrBuilder(parserOptions, this.options, this.registeredParsers);
15
- }
16
- }
17
-
18
- const rootName = '!js_arr';
19
- import BaseOutputBuilder from './BaseOutputBuilder.js';
20
-
21
- class JsArrBuilder extends BaseOutputBuilder {
22
-
23
- constructor(parserOptions, options, registeredParsers) {
24
- super();
25
- this.tagsStack = [];
26
- this.parserOptions = parserOptions;
27
- this.options = options;
28
- this.registeredParsers = registeredParsers;
29
-
30
- this.root = new Node(rootName);
31
- this.currentNode = this.root;
32
- this.attributes = {};
33
- }
34
-
35
- addTag(tag) {
36
- //when a new tag is added, it should be added as child of current node
37
- //TODO: shift this check to the parser
38
- if (tag.name === "__proto__") tag.name = "#__proto__";
39
-
40
- this.tagsStack.push(this.currentNode);
41
- this.currentNode = new Node(tag.name, this.attributes);
42
- this.attributes = {};
43
- }
44
-
45
- /**
46
- * Check if the node should be added by checking user's preference
47
- * @param {Node} node
48
- * @returns boolean: true if the node should not be added
49
- */
50
- closeTag() {
51
- const node = this.currentNode;
52
- this.currentNode = this.tagsStack.pop(); //set parent node in scope
53
- if (this.options.onClose !== undefined) {
54
- //TODO TagPathMatcher
55
- const resultTag = this.options.onClose(node,
56
- new TagPathMatcher(this.tagsStack, node));
57
-
58
- if (resultTag) return;
59
- }
60
- this.currentNode.child.push(node); //to parent node
61
- }
62
-
63
- //Called by parent class methods
64
- _addChild(key, val) {
65
- // if(key === "__proto__") tagName = "#__proto__";
66
- this.currentNode.child.push({ [key]: val });
67
- // this.currentNode.leafType = false;
68
- }
69
-
70
- /**
71
- * Add text value child node
72
- * @param {string} text
73
- */
74
- addValue(text) {
75
- this.currentNode.child.push({ [this.options.nameFor.text]: this.parseValue(text, this.options.tags.valueParsers) });
76
- }
77
-
78
- addPi(name) {
79
- //TODO: set pi flag
80
- if (!this.options.ignorePiTags) {
81
- const node = new Node(name, this.attributes);
82
- this.currentNode[":@"] = this.attributes;
83
- this.currentNode.child.push(node);
84
- }
85
- this.attributes = {};
86
- }
87
- getOutput() {
88
- return this.root.child[0];
89
- }
90
- }
91
-
92
-
93
-
94
- class Node {
95
- constructor(tagname, attributes) {
96
- this.tagname = tagname;
97
- this.child = []; //nested tags, text, cdata, comments
98
- if (attributes && Object.keys(attributes).length > 0)
99
- this[":@"] = attributes;
100
- }
101
- }
102
-
103
- module.exports = OutputBuilder;
@@ -1,100 +0,0 @@
1
- import {buildOptions,registerCommonValueParsers} from"./ParserOptionsBuilder.js";
2
-
3
- export default class OutputBuilder{
4
- constructor(options){
5
- this.options = buildOptions(options);
6
- this.registeredParsers = registerCommonValueParsers(this.options);
7
- }
8
-
9
- registerValueParser(name,parserInstance){//existing name will override the parser without warning
10
- this.registeredParsers[name] = parserInstance;
11
- }
12
-
13
- getInstance(parserOptions){
14
- return new JsMinArrBuilder(parserOptions, this.options, this.registeredParsers);
15
- }
16
- }
17
-
18
- import BaseOutputBuilder from "./BaseOutputBuilder.js";
19
- const rootName = '^';
20
-
21
- class JsMinArrBuilder extends BaseOutputBuilder{
22
-
23
- constructor(parserOptions, options,registeredParsers) {
24
- super();
25
- this.tagsStack = [];
26
- this.parserOptions = parserOptions;
27
- this.options = options;
28
- this.registeredParsers = registeredParsers;
29
-
30
- this.root = {[rootName]: []};
31
- this.currentNode = this.root;
32
- this.currentNodeTagName = rootName;
33
- this.attributes = {};
34
- }
35
-
36
- addTag(tag){
37
- //when a new tag is added, it should be added as child of current node
38
- //TODO: shift this check to the parser
39
- if(tag.name === "__proto__") tag.name = "#__proto__";
40
-
41
- this.tagsStack.push([this.currentNodeTagName,this.currentNode]); //this.currentNode is parent node here
42
- this.currentNodeTagName = tag.name;
43
- this.currentNode = { [tag.name]:[]}
44
- if(Object.keys(this.attributes).length > 0){
45
- this.currentNode[":@"] = this.attributes;
46
- this.attributes = {};
47
- }
48
- }
49
-
50
- /**
51
- * Check if the node should be added by checking user's preference
52
- * @param {Node} node
53
- * @returns boolean: true if the node should not be added
54
- */
55
- closeTag(){
56
- const node = this.currentNode;
57
- const nodeName = this.currentNodeTagName;
58
- const arr = this.tagsStack.pop(); //set parent node in scope
59
- this.currentNodeTagName = arr[0];
60
- this.currentNode = arr[1];
61
-
62
- if(this.options.onClose !== undefined){
63
- //TODO TagPathMatcher
64
- const resultTag = this.options.onClose(node,
65
- new TagPathMatcher(this.tagsStack,node));
66
-
67
- if(resultTag) return;
68
- }
69
- this.currentNode[this.currentNodeTagName].push(node); //to parent node
70
- }
71
-
72
- //Called by parent class methods
73
- _addChild(key, val){
74
- // if(key === "__proto__") tagName = "#__proto__";
75
- this.currentNode.push( {[key]: val });
76
- // this.currentNode.leafType = false;
77
- }
78
-
79
- /**
80
- * Add text value child node
81
- * @param {string} text
82
- */
83
- addValue(text){
84
- this.currentNode[this.currentNodeTagName].push( {[this.options.nameFor.text]: this.parseValue(text, this.options.tags.valueParsers) });
85
- }
86
-
87
- addPi(name){
88
- if(!this.options.ignorePiTags){
89
- const node = { [name]:[]}
90
- if(this.attributes){
91
- node[":@"] = this.attributes;
92
- }
93
- this.currentNode.push(node);
94
- }
95
- this.attributes = {};
96
- }
97
- getOutput(){
98
- return this.root[rootName];
99
- }
100
- }