@cdklabs/cdk-construct-connect-datalake 0.0.0 → 0.0.2
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.
- package/.jsii +10 -10
- package/.jsii.tabl.json +1 -1
- package/lib/index.js +1 -1
- package/node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js +2 -2
- package/node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js +2 -2
- package/node_modules/@aws/lambda-invoke-store/dist-types/invoke-store.d.ts +1 -1
- package/node_modules/@aws/lambda-invoke-store/package.json +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/README.md +26 -46
- package/node_modules/@aws-sdk/client-cloudformation/package.json +39 -39
- package/node_modules/@aws-sdk/client-connect/README.md +47 -46
- package/node_modules/@aws-sdk/client-connect/dist-cjs/index.js +43 -0
- package/node_modules/@aws-sdk/client-connect/dist-cjs/schemas/schemas_0.js +109 -41
- package/node_modules/@aws-sdk/client-connect/dist-es/Connect.js +6 -0
- package/node_modules/@aws-sdk/client-connect/dist-es/commands/AssociateQueueEmailAddressesCommand.js +16 -0
- package/node_modules/@aws-sdk/client-connect/dist-es/commands/DisassociateQueueEmailAddressesCommand.js +16 -0
- package/node_modules/@aws-sdk/client-connect/dist-es/commands/ListQueueEmailAddressesCommand.js +16 -0
- package/node_modules/@aws-sdk/client-connect/dist-es/commands/index.js +3 -0
- package/node_modules/@aws-sdk/client-connect/dist-es/models/enums.js +1 -0
- package/node_modules/@aws-sdk/client-connect/dist-es/schemas/schemas_0.js +78 -10
- package/node_modules/@aws-sdk/client-connect/dist-types/Connect.d.ts +21 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/ConnectClient.d.ts +5 -2
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/AssociateQueueEmailAddressesCommand.d.ts +120 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/CreateQueueCommand.d.ts +5 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/CreateTestCaseCommand.d.ts +4 -1
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/DescribeContactEvaluationCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/DescribeTestCaseCommand.d.ts +4 -1
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/DisassociateQueueEmailAddressesCommand.d.ts +109 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/GetTestCaseExecutionSummaryCommand.d.ts +2 -1
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/GetTrafficDistributionCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/ListQueueEmailAddressesCommand.d.ts +121 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/SearchContactEvaluationsCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/SearchRoutingProfilesCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/SearchSecurityProfilesCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/SearchTestCasesCommand.d.ts +5 -3
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/UpdateTestCaseCommand.d.ts +4 -1
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/index.d.ts +3 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/models/enums.d.ts +1 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/models/models_0.d.ts +62 -88
- package/node_modules/@aws-sdk/client-connect/dist-types/models/models_1.d.ts +137 -81
- package/node_modules/@aws-sdk/client-connect/dist-types/models/models_2.d.ts +147 -148
- package/node_modules/@aws-sdk/client-connect/dist-types/models/models_3.d.ts +150 -3
- package/node_modules/@aws-sdk/client-connect/dist-types/schemas/schemas_0.d.ts +10 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/Connect.d.ts +51 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/ConnectClient.d.ts +18 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/commands/AssociateQueueEmailAddressesCommand.d.ts +47 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/commands/DisassociateQueueEmailAddressesCommand.d.ts +47 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/commands/GetTestCaseExecutionSummaryCommand.d.ts +2 -4
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/commands/GetTrafficDistributionCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/commands/ListQueueEmailAddressesCommand.d.ts +51 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/commands/SearchRoutingProfilesCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/commands/SearchSecurityProfilesCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/commands/SearchTestCasesCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/commands/index.d.ts +3 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/models/enums.d.ts +1 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/models/models_0.d.ts +14 -20
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/models/models_1.d.ts +30 -24
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/models/models_2.d.ts +35 -35
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/models/models_3.d.ts +34 -3
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/schemas/schemas_0.d.ts +10 -0
- package/node_modules/@aws-sdk/client-connect/package.json +38 -38
- package/node_modules/@aws-sdk/client-glue/README.md +26 -46
- package/node_modules/@aws-sdk/client-glue/dist-cjs/index.js +5 -0
- package/node_modules/@aws-sdk/client-glue/dist-cjs/schemas/schemas_0.js +5 -4
- package/node_modules/@aws-sdk/client-glue/dist-es/models/enums.js +4 -0
- package/node_modules/@aws-sdk/client-glue/dist-es/schemas/schemas_0.js +5 -4
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/BatchGetPartitionCommand.d.ts +16 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/CreateCatalogCommand.d.ts +1 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/CreateDataQualityRulesetCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/UpdateCatalogCommand.d.ts +1 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/models/enums.d.ts +12 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/models/models_0.d.ts +50 -43
- package/node_modules/@aws-sdk/client-glue/dist-types/models/models_1.d.ts +41 -21
- package/node_modules/@aws-sdk/client-glue/dist-types/models/models_2.d.ts +23 -33
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/CreateDataQualityRulesetCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/enums.d.ts +6 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/models_0.d.ts +13 -9
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/models_1.d.ts +9 -5
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/models_2.d.ts +6 -8
- package/node_modules/@aws-sdk/client-glue/package.json +38 -38
- package/node_modules/@aws-sdk/client-lakeformation/README.md +26 -46
- package/node_modules/@aws-sdk/client-lakeformation/package.json +39 -39
- package/node_modules/@aws-sdk/client-ram/README.md +26 -46
- package/node_modules/@aws-sdk/client-ram/dist-cjs/schemas/schemas_0.js +14 -6
- package/node_modules/@aws-sdk/client-ram/dist-es/schemas/schemas_0.js +12 -4
- package/node_modules/@aws-sdk/client-ram/dist-types/commands/CreateResourceShareCommand.d.ts +6 -0
- package/node_modules/@aws-sdk/client-ram/dist-types/commands/GetResourceSharesCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-ram/dist-types/commands/UpdateResourceShareCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-ram/dist-types/models/models_0.d.ts +21 -0
- package/node_modules/@aws-sdk/client-ram/dist-types/schemas/schemas_0.d.ts +1 -0
- package/node_modules/@aws-sdk/client-ram/dist-types/ts3.4/models/models_0.d.ts +5 -0
- package/node_modules/@aws-sdk/client-ram/dist-types/ts3.4/schemas/schemas_0.d.ts +1 -0
- package/node_modules/@aws-sdk/client-ram/package.json +38 -38
- package/node_modules/@aws-sdk/client-sts/README.md +26 -46
- package/node_modules/@aws-sdk/client-sts/package.json +43 -39
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +11 -15
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +11 -15
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +2 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +2 -8
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js +5 -7
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/QuerySerializerSettings.d.ts +3 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +14 -14
- package/node_modules/@aws-sdk/credential-provider-env/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-http/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +15 -15
- package/node_modules/@aws-sdk/credential-provider-login/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-node/package.json +13 -13
- package/node_modules/@aws-sdk/credential-provider-process/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +8 -8
- package/node_modules/@aws-sdk/middleware-host-header/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-logger/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +9 -9
- package/node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js +9 -9
- package/node_modules/@aws-sdk/middleware-user-agent/dist-types/check-features.d.ts +4 -2
- package/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/check-features.d.ts +3 -3
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +9 -8
- package/node_modules/@aws-sdk/nested-clients/package.json +39 -37
- package/node_modules/@aws-sdk/region-config-resolver/package.json +6 -6
- package/node_modules/@aws-sdk/token-providers/package.json +8 -8
- package/node_modules/@aws-sdk/types/package.json +3 -3
- package/node_modules/@aws-sdk/util-endpoints/package.json +6 -6
- package/node_modules/@aws-sdk/util-locate-window/package.json +2 -2
- package/node_modules/@aws-sdk/util-user-agent-browser/package.json +4 -4
- package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +87 -14
- package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getNodeModulesParentDirs.js +15 -0
- package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedDevTypeScriptVersion.js +14 -0
- package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedTypeScriptVersion.js +9 -0
- package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js +59 -8
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/getNodeModulesParentDirs.d.ts +10 -0
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/getSanitizedDevTypeScriptVersion.d.ts +8 -0
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/getSanitizedTypeScriptVersion.d.ts +8 -0
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getNodeModulesParentDirs.d.ts +1 -0
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getSanitizedDevTypeScriptVersion.d.ts +3 -0
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getSanitizedTypeScriptVersion.d.ts +3 -0
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +7 -6
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +21 -11
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +5 -0
- package/node_modules/@aws-sdk/xml-builder/dist-es/escape-attribute.js +8 -1
- package/node_modules/@aws-sdk/xml-builder/dist-es/escape-element.js +13 -10
- package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +5 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/CHANGELOG.md +59 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/README.md +8 -7
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js +1 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.cjs +1 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.d.cts +97 -21
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js +1 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js +1 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxvalidator.min.js +1 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/pem.d.cts +148 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/package.json +5 -3
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/fxp.d.ts +91 -19
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/fxp.js +1 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/pem.d.ts +135 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/util.js +18 -25
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +87 -87
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +10 -10
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +23 -23
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +29 -29
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +39 -39
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +17 -17
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/XMLParser.js +22 -22
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +85 -85
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/validator.js +34 -34
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +5 -284
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +37 -18
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +78 -5
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +317 -113
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +23 -23
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/node2json.js +96 -42
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +10 -10
- package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/CHANGELOG.md +9 -2
- package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/README.md +1 -0
- package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/package.json +3 -3
- package/node_modules/@aws-sdk/xml-builder/node_modules/strnum/strnum.js +161 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/strnum/tests/infinity_test.js +18 -0
- package/node_modules/{strnum/strnum.test.js → @aws-sdk/xml-builder/node_modules/strnum/tests/strnum_test.js} +70 -68
- package/node_modules/@aws-sdk/xml-builder/node_modules/strnum/tests/temp.js +8 -0
- package/node_modules/@aws-sdk/xml-builder/package.json +4 -4
- package/node_modules/@smithy/abort-controller/package.json +3 -3
- package/node_modules/@smithy/config-resolver/dist-cjs/index.js +12 -0
- package/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js +5 -0
- package/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js +5 -0
- package/node_modules/@smithy/config-resolver/dist-types/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts +6 -0
- package/node_modules/@smithy/config-resolver/dist-types/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts +6 -0
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts +6 -0
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts +6 -0
- package/node_modules/@smithy/config-resolver/package.json +7 -7
- package/node_modules/@smithy/core/dist-cjs/index.js +1 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +9 -9
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +22 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +11 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +42 -5
- package/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +1 -2
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +2 -8
- package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +7 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js +17 -0
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +10 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js +3 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +31 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js +5 -1
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/toEndpointV1.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +11 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/translateTraits.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/toEndpointV1.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +11 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/translateTraits.d.ts +6 -0
- package/node_modules/@smithy/core/endpoints.d.ts +7 -0
- package/node_modules/@smithy/core/endpoints.js +6 -0
- package/node_modules/@smithy/core/package.json +21 -12
- package/node_modules/@smithy/credential-provider-imds/package.json +6 -6
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +21 -4
- package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +21 -4
- package/node_modules/@smithy/fetch-http-handler/package.json +7 -7
- package/node_modules/@smithy/hash-node/package.json +5 -5
- package/node_modules/@smithy/invalid-dependency/package.json +3 -3
- package/node_modules/@smithy/is-array-buffer/package.json +2 -2
- package/node_modules/@smithy/middleware-content-length/package.json +4 -4
- package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +17 -1
- package/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js +9 -0
- package/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js +8 -1
- package/node_modules/@smithy/middleware-endpoint/dist-types/adaptors/toEndpointV1.d.ts +1 -0
- package/node_modules/@smithy/middleware-endpoint/dist-types/resolveEndpointConfig.d.ts +2 -2
- package/node_modules/@smithy/middleware-endpoint/dist-types/ts3.4/adaptors/toEndpointV1.d.ts +1 -0
- package/node_modules/@smithy/middleware-endpoint/dist-types/ts3.4/resolveEndpointConfig.d.ts +2 -2
- package/node_modules/@smithy/middleware-endpoint/package.json +9 -9
- package/node_modules/@smithy/middleware-retry/dist-cjs/index.js +9 -12
- package/node_modules/@smithy/middleware-retry/dist-es/configurations.js +9 -12
- package/node_modules/@smithy/middleware-retry/package.json +10 -10
- package/node_modules/@smithy/middleware-serde/dist-cjs/index.js +3 -2
- package/node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js +3 -2
- package/node_modules/@smithy/middleware-serde/package.json +5 -4
- package/node_modules/@smithy/middleware-stack/package.json +3 -3
- package/node_modules/@smithy/node-config-provider/package.json +5 -5
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +68 -45
- package/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +19 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +41 -35
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +4 -5
- package/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +6 -6
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +10 -0
- package/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +4 -4
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +2 -2
- package/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +3 -3
- package/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +2 -2
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +10 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +4 -4
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +2 -2
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +3 -3
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +2 -2
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +2 -2
- package/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +2 -2
- package/node_modules/@smithy/node-http-handler/package.json +6 -6
- package/node_modules/@smithy/property-provider/package.json +3 -3
- package/node_modules/@smithy/protocol-http/package.json +3 -3
- package/node_modules/@smithy/querystring-builder/package.json +4 -4
- package/node_modules/@smithy/querystring-parser/package.json +3 -3
- package/node_modules/@smithy/service-error-classification/package.json +3 -3
- package/node_modules/@smithy/shared-ini-file-loader/package.json +3 -3
- package/node_modules/@smithy/signature-v4/package.json +9 -9
- package/node_modules/@smithy/smithy-client/package.json +8 -8
- package/node_modules/@smithy/types/dist-types/http.d.ts +1 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/http.d.ts +1 -0
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@smithy/url-parser/package.json +4 -4
- package/node_modules/@smithy/util-base64/package.json +4 -4
- package/node_modules/@smithy/util-body-length-browser/package.json +2 -2
- package/node_modules/@smithy/util-body-length-node/package.json +2 -2
- package/node_modules/@smithy/util-buffer-from/package.json +3 -3
- package/node_modules/@smithy/util-config-provider/package.json +2 -2
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +5 -5
- package/node_modules/@smithy/util-defaults-mode-node/package.json +8 -8
- package/node_modules/@smithy/util-endpoints/package.json +4 -4
- package/node_modules/@smithy/util-hex-encoding/package.json +2 -2
- package/node_modules/@smithy/util-middleware/package.json +3 -3
- package/node_modules/@smithy/util-retry/package.json +4 -4
- package/node_modules/@smithy/util-stream/package.json +9 -9
- package/node_modules/@smithy/util-uri-escape/package.json +2 -2
- package/node_modules/@smithy/util-utf8/package.json +3 -3
- package/node_modules/@smithy/util-waiter/dist-cjs/index.js +1 -1
- package/node_modules/@smithy/util-waiter/dist-es/poller.js +1 -1
- package/node_modules/@smithy/util-waiter/package.json +4 -4
- package/node_modules/@smithy/uuid/package.json +2 -2
- package/node_modules/fast-xml-builder/CHANGELOG.md +16 -0
- package/node_modules/fast-xml-builder/LICENSE +21 -0
- package/node_modules/fast-xml-builder/README.md +23 -0
- package/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
- package/node_modules/fast-xml-builder/lib/fxb.d.cts +180 -0
- package/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
- package/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
- package/node_modules/fast-xml-builder/package.json +80 -0
- package/node_modules/fast-xml-builder/src/fxb.d.ts +180 -0
- package/node_modules/fast-xml-builder/src/fxb.js +529 -0
- package/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +292 -0
- package/node_modules/path-expression-matcher/LICENSE +21 -0
- package/node_modules/path-expression-matcher/README.md +720 -0
- package/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
- package/node_modules/path-expression-matcher/lib/pem.d.cts +523 -0
- package/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
- package/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
- package/node_modules/path-expression-matcher/package.json +78 -0
- package/node_modules/path-expression-matcher/src/Expression.js +232 -0
- package/node_modules/path-expression-matcher/src/Matcher.js +498 -0
- package/node_modules/path-expression-matcher/src/index.d.ts +518 -0
- package/node_modules/path-expression-matcher/src/index.js +28 -0
- package/node_modules/xml2js/node_modules/sax/lib/sax.js +151 -7
- package/node_modules/xml2js/node_modules/sax/package.json +5 -2
- package/package.json +10 -10
- package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptPackageJsonPath.js +0 -14
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/getTypeScriptPackageJsonPath.d.ts +0 -9
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getTypeScriptPackageJsonPath.d.ts +0 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +0 -134
- package/node_modules/strnum/strnum.js +0 -129
- package/node_modules/strnum/test.js +0 -9
- /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/.github/SECURITY.md +0 -0
- /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/.vscode/launch.json +0 -0
- /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/LICENSE +0 -0
- /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/algo.stflow +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlbuilder → fast-xml-builder/src}/prettifyJs2Xml.js +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
///@ts-check
|
|
3
3
|
|
|
4
|
-
import { getAllMatches, isExist } from '../util.js';
|
|
4
|
+
import { getAllMatches, isExist, DANGEROUS_PROPERTY_NAMES, criticalProperties } from '../util.js';
|
|
5
5
|
import xmlNode from './xmlNode.js';
|
|
6
6
|
import DocTypeReader from './DocTypeReader.js';
|
|
7
7
|
import toNumber from "strnum";
|
|
8
8
|
import getIgnoreAttributesFn from "../ignoreAttributes.js";
|
|
9
|
+
import { Expression, Matcher } from 'path-expression-matcher';
|
|
9
10
|
|
|
10
11
|
// const regx =
|
|
11
12
|
// '<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)'
|
|
@@ -14,6 +15,57 @@ import getIgnoreAttributesFn from "../ignoreAttributes.js";
|
|
|
14
15
|
//const tagsRegx = new RegExp("<(\\/?[\\w:\\-\._]+)([^>]*)>(\\s*"+cdataRegx+")*([^<]+)?","g");
|
|
15
16
|
//const tagsRegx = new RegExp("<(\\/?)((\\w*:)?([\\w:\\-\._]+))([^>]*)>([^<]*)("+cdataRegx+"([^<]*))*([^<]+)?","g");
|
|
16
17
|
|
|
18
|
+
// Helper functions for attribute and namespace handling
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Extract raw attributes (without prefix) from prefixed attribute map
|
|
22
|
+
* @param {object} prefixedAttrs - Attributes with prefix from buildAttributesMap
|
|
23
|
+
* @param {object} options - Parser options containing attributeNamePrefix
|
|
24
|
+
* @returns {object} Raw attributes for matcher
|
|
25
|
+
*/
|
|
26
|
+
function extractRawAttributes(prefixedAttrs, options) {
|
|
27
|
+
if (!prefixedAttrs) return {};
|
|
28
|
+
|
|
29
|
+
// Handle attributesGroupName option
|
|
30
|
+
const attrs = options.attributesGroupName
|
|
31
|
+
? prefixedAttrs[options.attributesGroupName]
|
|
32
|
+
: prefixedAttrs;
|
|
33
|
+
|
|
34
|
+
if (!attrs) return {};
|
|
35
|
+
|
|
36
|
+
const rawAttrs = {};
|
|
37
|
+
for (const key in attrs) {
|
|
38
|
+
// Remove the attribute prefix to get raw name
|
|
39
|
+
if (key.startsWith(options.attributeNamePrefix)) {
|
|
40
|
+
const rawName = key.substring(options.attributeNamePrefix.length);
|
|
41
|
+
rawAttrs[rawName] = attrs[key];
|
|
42
|
+
} else {
|
|
43
|
+
// Attribute without prefix (shouldn't normally happen, but be safe)
|
|
44
|
+
rawAttrs[key] = attrs[key];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return rawAttrs;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Extract namespace from raw tag name
|
|
52
|
+
* @param {string} rawTagName - Tag name possibly with namespace (e.g., "soap:Envelope")
|
|
53
|
+
* @returns {string|undefined} Namespace or undefined
|
|
54
|
+
*/
|
|
55
|
+
function extractNamespace(rawTagName) {
|
|
56
|
+
if (!rawTagName || typeof rawTagName !== 'string') return undefined;
|
|
57
|
+
|
|
58
|
+
const colonIndex = rawTagName.indexOf(':');
|
|
59
|
+
if (colonIndex !== -1 && colonIndex > 0) {
|
|
60
|
+
const ns = rawTagName.substring(0, colonIndex);
|
|
61
|
+
// Don't treat xmlns as a namespace
|
|
62
|
+
if (ns !== 'xmlns') {
|
|
63
|
+
return ns;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
17
69
|
export default class OrderedObjParser {
|
|
18
70
|
constructor(options) {
|
|
19
71
|
this.options = options;
|
|
@@ -58,16 +110,27 @@ export default class OrderedObjParser {
|
|
|
58
110
|
this.entityExpansionCount = 0;
|
|
59
111
|
this.currentExpandedLength = 0;
|
|
60
112
|
|
|
113
|
+
// Initialize path matcher for path-expression-matcher
|
|
114
|
+
this.matcher = new Matcher();
|
|
115
|
+
|
|
116
|
+
// Live read-only proxy of matcher — PEM creates and caches this internally.
|
|
117
|
+
// All user callbacks receive this instead of the mutable matcher.
|
|
118
|
+
this.readonlyMatcher = this.matcher.readOnly();
|
|
119
|
+
|
|
120
|
+
// Flag to track if current node is a stop node (optimization)
|
|
121
|
+
this.isCurrentNodeStopNode = false;
|
|
122
|
+
|
|
123
|
+
// Pre-compile stopNodes expressions
|
|
61
124
|
if (this.options.stopNodes && this.options.stopNodes.length > 0) {
|
|
62
|
-
this.
|
|
63
|
-
this.stopNodesWildcard = new Set();
|
|
125
|
+
this.stopNodeExpressions = [];
|
|
64
126
|
for (let i = 0; i < this.options.stopNodes.length; i++) {
|
|
65
127
|
const stopNodeExp = this.options.stopNodes[i];
|
|
66
|
-
if (typeof stopNodeExp
|
|
67
|
-
|
|
68
|
-
this.
|
|
69
|
-
} else {
|
|
70
|
-
|
|
128
|
+
if (typeof stopNodeExp === 'string') {
|
|
129
|
+
// Convert string to Expression object
|
|
130
|
+
this.stopNodeExpressions.push(new Expression(stopNodeExp));
|
|
131
|
+
} else if (stopNodeExp instanceof Expression) {
|
|
132
|
+
// Already an Expression object
|
|
133
|
+
this.stopNodeExpressions.push(stopNodeExp);
|
|
71
134
|
}
|
|
72
135
|
}
|
|
73
136
|
}
|
|
@@ -90,7 +153,7 @@ function addExternalEntities(externalEntities) {
|
|
|
90
153
|
/**
|
|
91
154
|
* @param {string} val
|
|
92
155
|
* @param {string} tagName
|
|
93
|
-
* @param {string} jPath
|
|
156
|
+
* @param {string|Matcher} jPath - jPath string or Matcher instance based on options.jPath
|
|
94
157
|
* @param {boolean} dontTrim
|
|
95
158
|
* @param {boolean} hasAttributes
|
|
96
159
|
* @param {boolean} isLeafNode
|
|
@@ -104,7 +167,9 @@ function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode,
|
|
|
104
167
|
if (val.length > 0) {
|
|
105
168
|
if (!escapeEntities) val = this.replaceEntitiesValue(val, tagName, jPath);
|
|
106
169
|
|
|
107
|
-
|
|
170
|
+
// Pass jPath string or matcher based on options.jPath setting
|
|
171
|
+
const jPathOrMatcher = this.options.jPath ? jPath.toString() : jPath;
|
|
172
|
+
const newval = this.options.tagValueProcessor(tagName, val, jPathOrMatcher, hasAttributes, isLeafNode);
|
|
108
173
|
if (newval === null || newval === undefined) {
|
|
109
174
|
//don't parse
|
|
110
175
|
return val;
|
|
@@ -151,24 +216,58 @@ function buildAttributesMap(attrStr, jPath, tagName) {
|
|
|
151
216
|
const matches = getAllMatches(attrStr, attrsRegx);
|
|
152
217
|
const len = matches.length; //don't make it inline
|
|
153
218
|
const attrs = {};
|
|
219
|
+
|
|
220
|
+
// First pass: parse all attributes and update matcher with raw values
|
|
221
|
+
// This ensures the matcher has all attribute values when processors run
|
|
222
|
+
const rawAttrsForMatcher = {};
|
|
223
|
+
for (let i = 0; i < len; i++) {
|
|
224
|
+
const attrName = this.resolveNameSpace(matches[i][1]);
|
|
225
|
+
const oldVal = matches[i][4];
|
|
226
|
+
|
|
227
|
+
if (attrName.length && oldVal !== undefined) {
|
|
228
|
+
let parsedVal = oldVal;
|
|
229
|
+
if (this.options.trimValues) {
|
|
230
|
+
parsedVal = parsedVal.trim();
|
|
231
|
+
}
|
|
232
|
+
parsedVal = this.replaceEntitiesValue(parsedVal, tagName, this.readonlyMatcher);
|
|
233
|
+
rawAttrsForMatcher[attrName] = parsedVal;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Update matcher with raw attribute values BEFORE running processors
|
|
238
|
+
if (Object.keys(rawAttrsForMatcher).length > 0 && typeof jPath === 'object' && jPath.updateCurrent) {
|
|
239
|
+
jPath.updateCurrent(rawAttrsForMatcher);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Second pass: now process attributes with matcher having full attribute context
|
|
154
243
|
for (let i = 0; i < len; i++) {
|
|
155
244
|
const attrName = this.resolveNameSpace(matches[i][1]);
|
|
156
|
-
|
|
245
|
+
|
|
246
|
+
// Convert jPath to string if needed for ignoreAttributesFn
|
|
247
|
+
const jPathStr = this.options.jPath ? jPath.toString() : this.readonlyMatcher;
|
|
248
|
+
if (this.ignoreAttributesFn(attrName, jPathStr)) {
|
|
157
249
|
continue
|
|
158
250
|
}
|
|
251
|
+
|
|
159
252
|
let oldVal = matches[i][4];
|
|
160
253
|
let aName = this.options.attributeNamePrefix + attrName;
|
|
254
|
+
|
|
161
255
|
if (attrName.length) {
|
|
162
256
|
if (this.options.transformAttributeName) {
|
|
163
257
|
aName = this.options.transformAttributeName(aName);
|
|
164
258
|
}
|
|
165
|
-
if (aName === "__proto__") aName = "#__proto__";
|
|
259
|
+
//if (aName === "__proto__") aName = "#__proto__";
|
|
260
|
+
aName = sanitizeName(aName, this.options);
|
|
261
|
+
|
|
166
262
|
if (oldVal !== undefined) {
|
|
167
263
|
if (this.options.trimValues) {
|
|
168
264
|
oldVal = oldVal.trim();
|
|
169
265
|
}
|
|
170
|
-
oldVal = this.replaceEntitiesValue(oldVal, tagName,
|
|
171
|
-
|
|
266
|
+
oldVal = this.replaceEntitiesValue(oldVal, tagName, this.readonlyMatcher);
|
|
267
|
+
|
|
268
|
+
// Pass jPath string or readonlyMatcher based on options.jPath setting
|
|
269
|
+
const jPathOrMatcher = this.options.jPath ? jPath.toString() : this.readonlyMatcher;
|
|
270
|
+
const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPathOrMatcher);
|
|
172
271
|
if (newVal === null || newVal === undefined) {
|
|
173
272
|
//don't parse
|
|
174
273
|
attrs[aName] = oldVal;
|
|
@@ -188,6 +287,7 @@ function buildAttributesMap(attrStr, jPath, tagName) {
|
|
|
188
287
|
}
|
|
189
288
|
}
|
|
190
289
|
}
|
|
290
|
+
|
|
191
291
|
if (!Object.keys(attrs).length) {
|
|
192
292
|
return;
|
|
193
293
|
}
|
|
@@ -205,7 +305,9 @@ const parseXml = function (xmlData) {
|
|
|
205
305
|
const xmlObj = new xmlNode('!xml');
|
|
206
306
|
let currentNode = xmlObj;
|
|
207
307
|
let textData = "";
|
|
208
|
-
|
|
308
|
+
|
|
309
|
+
// Reset matcher for new document
|
|
310
|
+
this.matcher.reset();
|
|
209
311
|
|
|
210
312
|
// Reset entity expansion counters for this document
|
|
211
313
|
this.entityExpansionCount = 0;
|
|
@@ -228,27 +330,25 @@ const parseXml = function (xmlData) {
|
|
|
228
330
|
}
|
|
229
331
|
}
|
|
230
332
|
|
|
231
|
-
|
|
232
|
-
tagName = this.options.transformTagName(tagName);
|
|
233
|
-
}
|
|
333
|
+
tagName = transformTagName(this.options.transformTagName, tagName, "", this.options).tagName;
|
|
234
334
|
|
|
235
335
|
if (currentNode) {
|
|
236
|
-
textData = this.saveTextToParentTag(textData, currentNode,
|
|
336
|
+
textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
|
|
237
337
|
}
|
|
238
338
|
|
|
239
339
|
//check if last tag of nested tag was unpaired tag
|
|
240
|
-
const lastTagName =
|
|
340
|
+
const lastTagName = this.matcher.getCurrentTag();
|
|
241
341
|
if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) {
|
|
242
342
|
throw new Error(`Unpaired tag can not be used as closing tag: </${tagName}>`);
|
|
243
343
|
}
|
|
244
|
-
let propIndex = 0
|
|
245
344
|
if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) {
|
|
246
|
-
|
|
345
|
+
// Pop the unpaired tag
|
|
346
|
+
this.matcher.pop();
|
|
247
347
|
this.tagsNodeStack.pop();
|
|
248
|
-
} else {
|
|
249
|
-
propIndex = jPath.lastIndexOf(".");
|
|
250
348
|
}
|
|
251
|
-
|
|
349
|
+
// Pop the closing tag
|
|
350
|
+
this.matcher.pop();
|
|
351
|
+
this.isCurrentNodeStopNode = false; // Reset flag when closing tag
|
|
252
352
|
|
|
253
353
|
currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope
|
|
254
354
|
textData = "";
|
|
@@ -258,7 +358,7 @@ const parseXml = function (xmlData) {
|
|
|
258
358
|
let tagData = readTagExp(xmlData, i, false, "?>");
|
|
259
359
|
if (!tagData) throw new Error("Pi Tag is not closed.");
|
|
260
360
|
|
|
261
|
-
textData = this.saveTextToParentTag(textData, currentNode,
|
|
361
|
+
textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
|
|
262
362
|
if ((this.options.ignoreDeclaration && tagData.tagName === "?xml") || this.options.ignorePiTags) {
|
|
263
363
|
//do nothing
|
|
264
364
|
} else {
|
|
@@ -267,9 +367,9 @@ const parseXml = function (xmlData) {
|
|
|
267
367
|
childNode.add(this.options.textNodeName, "");
|
|
268
368
|
|
|
269
369
|
if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) {
|
|
270
|
-
childNode[":@"] = this.buildAttributesMap(tagData.tagExp,
|
|
370
|
+
childNode[":@"] = this.buildAttributesMap(tagData.tagExp, this.matcher, tagData.tagName);
|
|
271
371
|
}
|
|
272
|
-
this.addChild(currentNode, childNode,
|
|
372
|
+
this.addChild(currentNode, childNode, this.readonlyMatcher, i);
|
|
273
373
|
}
|
|
274
374
|
|
|
275
375
|
|
|
@@ -279,7 +379,7 @@ const parseXml = function (xmlData) {
|
|
|
279
379
|
if (this.options.commentPropName) {
|
|
280
380
|
const comment = xmlData.substring(i + 4, endIndex - 2);
|
|
281
381
|
|
|
282
|
-
textData = this.saveTextToParentTag(textData, currentNode,
|
|
382
|
+
textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
|
|
283
383
|
|
|
284
384
|
currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]);
|
|
285
385
|
}
|
|
@@ -292,9 +392,9 @@ const parseXml = function (xmlData) {
|
|
|
292
392
|
const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2;
|
|
293
393
|
const tagExp = xmlData.substring(i + 9, closeIndex);
|
|
294
394
|
|
|
295
|
-
textData = this.saveTextToParentTag(textData, currentNode,
|
|
395
|
+
textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
|
|
296
396
|
|
|
297
|
-
let val = this.parseTextData(tagExp, currentNode.tagname,
|
|
397
|
+
let val = this.parseTextData(tagExp, currentNode.tagname, this.readonlyMatcher, true, false, true, true);
|
|
298
398
|
if (val == undefined) val = "";
|
|
299
399
|
|
|
300
400
|
//cdata should be set even if it is 0 length string
|
|
@@ -307,26 +407,36 @@ const parseXml = function (xmlData) {
|
|
|
307
407
|
i = closeIndex + 2;
|
|
308
408
|
} else {//Opening tag
|
|
309
409
|
let result = readTagExp(xmlData, i, this.options.removeNSPrefix);
|
|
410
|
+
|
|
411
|
+
// Safety check: readTagExp can return undefined
|
|
412
|
+
if (!result) {
|
|
413
|
+
// Log context for debugging
|
|
414
|
+
const context = xmlData.substring(Math.max(0, i - 50), Math.min(xmlData.length, i + 50));
|
|
415
|
+
throw new Error(`readTagExp returned undefined at position ${i}. Context: "${context}"`);
|
|
416
|
+
}
|
|
417
|
+
|
|
310
418
|
let tagName = result.tagName;
|
|
311
419
|
const rawTagName = result.rawTagName;
|
|
312
420
|
let tagExp = result.tagExp;
|
|
313
421
|
let attrExpPresent = result.attrExpPresent;
|
|
314
422
|
let closeIndex = result.closeIndex;
|
|
315
423
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
424
|
+
({ tagName, tagExp } = transformTagName(this.options.transformTagName, tagName, tagExp, this.options));
|
|
425
|
+
|
|
426
|
+
if (this.options.strictReservedNames &&
|
|
427
|
+
(tagName === this.options.commentPropName
|
|
428
|
+
|| tagName === this.options.cdataPropName
|
|
429
|
+
|| tagName === this.options.textNodeName
|
|
430
|
+
|| tagName === this.options.attributesGroupName
|
|
431
|
+
)) {
|
|
432
|
+
throw new Error(`Invalid tag name: ${tagName}`);
|
|
323
433
|
}
|
|
324
434
|
|
|
325
435
|
//save text as child node
|
|
326
436
|
if (currentNode && textData) {
|
|
327
437
|
if (currentNode.tagname !== '!xml') {
|
|
328
438
|
//when nested tag is found
|
|
329
|
-
textData = this.saveTextToParentTag(textData, currentNode,
|
|
439
|
+
textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher, false);
|
|
330
440
|
}
|
|
331
441
|
}
|
|
332
442
|
|
|
@@ -334,28 +444,65 @@ const parseXml = function (xmlData) {
|
|
|
334
444
|
const lastTag = currentNode;
|
|
335
445
|
if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) {
|
|
336
446
|
currentNode = this.tagsNodeStack.pop();
|
|
337
|
-
|
|
447
|
+
this.matcher.pop();
|
|
338
448
|
}
|
|
449
|
+
|
|
450
|
+
// Clean up self-closing syntax BEFORE processing attributes
|
|
451
|
+
// This is where tagExp gets the trailing / removed
|
|
452
|
+
let isSelfClosing = false;
|
|
453
|
+
if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) {
|
|
454
|
+
isSelfClosing = true;
|
|
455
|
+
if (tagName[tagName.length - 1] === "/") {
|
|
456
|
+
tagName = tagName.substr(0, tagName.length - 1);
|
|
457
|
+
tagExp = tagName;
|
|
458
|
+
} else {
|
|
459
|
+
tagExp = tagExp.substr(0, tagExp.length - 1);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// Re-check attrExpPresent after cleaning
|
|
463
|
+
attrExpPresent = (tagName !== tagExp);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// Now process attributes with CLEAN tagExp (no trailing /)
|
|
467
|
+
let prefixedAttrs = null;
|
|
468
|
+
let rawAttrs = {};
|
|
469
|
+
let namespace = undefined;
|
|
470
|
+
|
|
471
|
+
// Extract namespace from rawTagName
|
|
472
|
+
namespace = extractNamespace(rawTagName);
|
|
473
|
+
|
|
474
|
+
// Push tag to matcher FIRST (with empty attrs for now) so callbacks see correct path
|
|
339
475
|
if (tagName !== xmlObj.tagname) {
|
|
340
|
-
|
|
476
|
+
this.matcher.push(tagName, {}, namespace);
|
|
341
477
|
}
|
|
478
|
+
|
|
479
|
+
// Now build attributes - callbacks will see correct matcher state
|
|
480
|
+
if (tagName !== tagExp && attrExpPresent) {
|
|
481
|
+
// Build attributes (returns prefixed attributes for the tree)
|
|
482
|
+
// Note: buildAttributesMap now internally updates the matcher with raw attributes
|
|
483
|
+
prefixedAttrs = this.buildAttributesMap(tagExp, this.matcher, tagName);
|
|
484
|
+
|
|
485
|
+
if (prefixedAttrs) {
|
|
486
|
+
// Extract raw attributes (without prefix) for our use
|
|
487
|
+
rawAttrs = extractRawAttributes(prefixedAttrs, this.options);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// Now check if this is a stop node (after attributes are set)
|
|
492
|
+
if (tagName !== xmlObj.tagname) {
|
|
493
|
+
this.isCurrentNodeStopNode = this.isItStopNode(this.stopNodeExpressions, this.matcher);
|
|
494
|
+
}
|
|
495
|
+
|
|
342
496
|
const startIndex = i;
|
|
343
|
-
if (this.
|
|
497
|
+
if (this.isCurrentNodeStopNode) {
|
|
344
498
|
let tagContent = "";
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
tagName = tagName.substr(0, tagName.length - 1);
|
|
349
|
-
jPath = jPath.substr(0, jPath.length - 1);
|
|
350
|
-
tagExp = tagName;
|
|
351
|
-
} else {
|
|
352
|
-
tagExp = tagExp.substr(0, tagExp.length - 1);
|
|
353
|
-
}
|
|
499
|
+
|
|
500
|
+
// For self-closing tags, content is empty
|
|
501
|
+
if (isSelfClosing) {
|
|
354
502
|
i = result.closeIndex;
|
|
355
503
|
}
|
|
356
504
|
//unpaired tag
|
|
357
505
|
else if (this.options.unpairedTags.indexOf(tagName) !== -1) {
|
|
358
|
-
|
|
359
506
|
i = result.closeIndex;
|
|
360
507
|
}
|
|
361
508
|
//normal tag
|
|
@@ -369,52 +516,54 @@ const parseXml = function (xmlData) {
|
|
|
369
516
|
|
|
370
517
|
const childNode = new xmlNode(tagName);
|
|
371
518
|
|
|
372
|
-
if (
|
|
373
|
-
childNode[":@"] =
|
|
374
|
-
}
|
|
375
|
-
if (tagContent) {
|
|
376
|
-
tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true);
|
|
519
|
+
if (prefixedAttrs) {
|
|
520
|
+
childNode[":@"] = prefixedAttrs;
|
|
377
521
|
}
|
|
378
522
|
|
|
379
|
-
|
|
523
|
+
// For stop nodes, store raw content as-is without any processing
|
|
380
524
|
childNode.add(this.options.textNodeName, tagContent);
|
|
381
525
|
|
|
382
|
-
this.
|
|
526
|
+
this.matcher.pop(); // Pop the stop node tag
|
|
527
|
+
this.isCurrentNodeStopNode = false; // Reset flag
|
|
528
|
+
|
|
529
|
+
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
|
383
530
|
} else {
|
|
384
531
|
//selfClosing tag
|
|
385
|
-
if (
|
|
386
|
-
|
|
387
|
-
tagName = tagName.substr(0, tagName.length - 1);
|
|
388
|
-
jPath = jPath.substr(0, jPath.length - 1);
|
|
389
|
-
tagExp = tagName;
|
|
390
|
-
} else {
|
|
391
|
-
tagExp = tagExp.substr(0, tagExp.length - 1);
|
|
392
|
-
}
|
|
532
|
+
if (isSelfClosing) {
|
|
533
|
+
({ tagName, tagExp } = transformTagName(this.options.transformTagName, tagName, tagExp, this.options));
|
|
393
534
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
tagExp = newTagName
|
|
398
|
-
}
|
|
399
|
-
tagName = newTagName;
|
|
535
|
+
const childNode = new xmlNode(tagName);
|
|
536
|
+
if (prefixedAttrs) {
|
|
537
|
+
childNode[":@"] = prefixedAttrs;
|
|
400
538
|
}
|
|
401
|
-
|
|
539
|
+
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
|
540
|
+
this.matcher.pop(); // Pop self-closing tag
|
|
541
|
+
this.isCurrentNodeStopNode = false; // Reset flag
|
|
542
|
+
}
|
|
543
|
+
else if (this.options.unpairedTags.indexOf(tagName) !== -1) {//unpaired tag
|
|
402
544
|
const childNode = new xmlNode(tagName);
|
|
403
|
-
if (
|
|
404
|
-
childNode[":@"] =
|
|
545
|
+
if (prefixedAttrs) {
|
|
546
|
+
childNode[":@"] = prefixedAttrs;
|
|
405
547
|
}
|
|
406
|
-
this.addChild(currentNode, childNode,
|
|
407
|
-
|
|
548
|
+
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
|
549
|
+
this.matcher.pop(); // Pop unpaired tag
|
|
550
|
+
this.isCurrentNodeStopNode = false; // Reset flag
|
|
551
|
+
i = result.closeIndex;
|
|
552
|
+
// Continue to next iteration without changing currentNode
|
|
553
|
+
continue;
|
|
408
554
|
}
|
|
409
555
|
//opening tag
|
|
410
556
|
else {
|
|
411
557
|
const childNode = new xmlNode(tagName);
|
|
558
|
+
if (this.tagsNodeStack.length > this.options.maxNestedTags) {
|
|
559
|
+
throw new Error("Maximum nested tags exceeded");
|
|
560
|
+
}
|
|
412
561
|
this.tagsNodeStack.push(currentNode);
|
|
413
562
|
|
|
414
|
-
if (
|
|
415
|
-
childNode[":@"] =
|
|
563
|
+
if (prefixedAttrs) {
|
|
564
|
+
childNode[":@"] = prefixedAttrs;
|
|
416
565
|
}
|
|
417
|
-
this.addChild(currentNode, childNode,
|
|
566
|
+
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
|
418
567
|
currentNode = childNode;
|
|
419
568
|
}
|
|
420
569
|
textData = "";
|
|
@@ -428,10 +577,13 @@ const parseXml = function (xmlData) {
|
|
|
428
577
|
return xmlObj.child;
|
|
429
578
|
}
|
|
430
579
|
|
|
431
|
-
function addChild(currentNode, childNode,
|
|
580
|
+
function addChild(currentNode, childNode, matcher, startIndex) {
|
|
432
581
|
// unset startIndex if not requested
|
|
433
582
|
if (!this.options.captureMetaData) startIndex = undefined;
|
|
434
|
-
|
|
583
|
+
|
|
584
|
+
// Pass jPath string or matcher based on options.jPath setting
|
|
585
|
+
const jPathOrMatcher = this.options.jPath ? matcher.toString() : matcher;
|
|
586
|
+
const result = this.options.updateTag(childNode.tagname, jPathOrMatcher, childNode[":@"])
|
|
435
587
|
if (result === false) {
|
|
436
588
|
//do nothing
|
|
437
589
|
} else if (typeof result === "string") {
|
|
@@ -442,33 +594,40 @@ function addChild(currentNode, childNode, jPath, startIndex) {
|
|
|
442
594
|
}
|
|
443
595
|
}
|
|
444
596
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
597
|
+
/**
|
|
598
|
+
* @param {object} val - Entity object with regex and val properties
|
|
599
|
+
* @param {string} tagName - Tag name
|
|
600
|
+
* @param {string|Matcher} jPath - jPath string or Matcher instance based on options.jPath
|
|
601
|
+
*/
|
|
602
|
+
function replaceEntitiesValue(val, tagName, jPath) {
|
|
451
603
|
const entityConfig = this.options.processEntities;
|
|
452
604
|
|
|
453
|
-
if (!entityConfig.enabled) {
|
|
605
|
+
if (!entityConfig || !entityConfig.enabled) {
|
|
454
606
|
return val;
|
|
455
607
|
}
|
|
456
608
|
|
|
457
|
-
// Check tag
|
|
609
|
+
// Check if tag is allowed to contain entities
|
|
458
610
|
if (entityConfig.allowedTags) {
|
|
459
|
-
|
|
460
|
-
|
|
611
|
+
const jPathOrMatcher = this.options.jPath ? jPath.toString() : jPath;
|
|
612
|
+
const allowed = Array.isArray(entityConfig.allowedTags)
|
|
613
|
+
? entityConfig.allowedTags.includes(tagName)
|
|
614
|
+
: entityConfig.allowedTags(tagName, jPathOrMatcher);
|
|
615
|
+
|
|
616
|
+
if (!allowed) {
|
|
617
|
+
return val;
|
|
461
618
|
}
|
|
462
619
|
}
|
|
463
620
|
|
|
621
|
+
// Apply custom tag filter if provided
|
|
464
622
|
if (entityConfig.tagFilter) {
|
|
465
|
-
|
|
623
|
+
const jPathOrMatcher = this.options.jPath ? jPath.toString() : jPath;
|
|
624
|
+
if (!entityConfig.tagFilter(tagName, jPathOrMatcher)) {
|
|
466
625
|
return val; // Skip based on custom filter
|
|
467
626
|
}
|
|
468
627
|
}
|
|
469
628
|
|
|
470
629
|
// Replace DOCTYPE entities
|
|
471
|
-
for (
|
|
630
|
+
for (const entityName of Object.keys(this.docTypeEntities)) {
|
|
472
631
|
const entity = this.docTypeEntities[entityName];
|
|
473
632
|
const matches = val.match(entity.regx);
|
|
474
633
|
|
|
@@ -500,19 +659,38 @@ const replaceEntitiesValue = function (val, tagName, jPath) {
|
|
|
500
659
|
}
|
|
501
660
|
}
|
|
502
661
|
}
|
|
503
|
-
if (val.indexOf('&') === -1) return val; // Early exit
|
|
504
|
-
|
|
505
662
|
// Replace standard entities
|
|
506
|
-
for (
|
|
663
|
+
for (const entityName of Object.keys(this.lastEntities)) {
|
|
507
664
|
const entity = this.lastEntities[entityName];
|
|
665
|
+
const matches = val.match(entity.regex);
|
|
666
|
+
if (matches) {
|
|
667
|
+
this.entityExpansionCount += matches.length;
|
|
668
|
+
if (entityConfig.maxTotalExpansions &&
|
|
669
|
+
this.entityExpansionCount > entityConfig.maxTotalExpansions) {
|
|
670
|
+
throw new Error(
|
|
671
|
+
`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${entityConfig.maxTotalExpansions}`
|
|
672
|
+
);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
508
675
|
val = val.replace(entity.regex, entity.val);
|
|
509
676
|
}
|
|
510
|
-
if (val.indexOf('&') === -1) return val;
|
|
677
|
+
if (val.indexOf('&') === -1) return val;
|
|
511
678
|
|
|
512
679
|
// Replace HTML entities if enabled
|
|
513
680
|
if (this.options.htmlEntities) {
|
|
514
|
-
for (
|
|
681
|
+
for (const entityName of Object.keys(this.htmlEntities)) {
|
|
515
682
|
const entity = this.htmlEntities[entityName];
|
|
683
|
+
const matches = val.match(entity.regex);
|
|
684
|
+
if (matches) {
|
|
685
|
+
//console.log(matches);
|
|
686
|
+
this.entityExpansionCount += matches.length;
|
|
687
|
+
if (entityConfig.maxTotalExpansions &&
|
|
688
|
+
this.entityExpansionCount > entityConfig.maxTotalExpansions) {
|
|
689
|
+
throw new Error(
|
|
690
|
+
`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${entityConfig.maxTotalExpansions}`
|
|
691
|
+
);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
516
694
|
val = val.replace(entity.regex, entity.val);
|
|
517
695
|
}
|
|
518
696
|
}
|
|
@@ -524,19 +702,19 @@ const replaceEntitiesValue = function (val, tagName, jPath) {
|
|
|
524
702
|
}
|
|
525
703
|
|
|
526
704
|
|
|
527
|
-
function saveTextToParentTag(textData,
|
|
705
|
+
function saveTextToParentTag(textData, parentNode, matcher, isLeafNode) {
|
|
528
706
|
if (textData) { //store previously collected data as textNode
|
|
529
|
-
if (isLeafNode === undefined) isLeafNode =
|
|
707
|
+
if (isLeafNode === undefined) isLeafNode = parentNode.child.length === 0
|
|
530
708
|
|
|
531
709
|
textData = this.parseTextData(textData,
|
|
532
|
-
|
|
533
|
-
|
|
710
|
+
parentNode.tagname,
|
|
711
|
+
matcher,
|
|
534
712
|
false,
|
|
535
|
-
|
|
713
|
+
parentNode[":@"] ? Object.keys(parentNode[":@"]).length !== 0 : false,
|
|
536
714
|
isLeafNode);
|
|
537
715
|
|
|
538
716
|
if (textData !== undefined && textData !== "")
|
|
539
|
-
|
|
717
|
+
parentNode.add(this.options.textNodeName, textData);
|
|
540
718
|
textData = "";
|
|
541
719
|
}
|
|
542
720
|
return textData;
|
|
@@ -544,14 +722,17 @@ function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {
|
|
|
544
722
|
|
|
545
723
|
//TODO: use jPath to simplify the logic
|
|
546
724
|
/**
|
|
547
|
-
* @param {
|
|
548
|
-
* @param {
|
|
549
|
-
* @param {string} jPath
|
|
550
|
-
* @param {string} currentTagName
|
|
725
|
+
* @param {Array<Expression>} stopNodeExpressions - Array of compiled Expression objects
|
|
726
|
+
* @param {Matcher} matcher - Current path matcher
|
|
551
727
|
*/
|
|
552
|
-
function isItStopNode(
|
|
553
|
-
if (
|
|
554
|
-
|
|
728
|
+
function isItStopNode(stopNodeExpressions, matcher) {
|
|
729
|
+
if (!stopNodeExpressions || stopNodeExpressions.length === 0) return false;
|
|
730
|
+
|
|
731
|
+
for (let i = 0; i < stopNodeExpressions.length; i++) {
|
|
732
|
+
if (matcher.matches(stopNodeExpressions[i])) {
|
|
733
|
+
return true;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
555
736
|
return false;
|
|
556
737
|
}
|
|
557
738
|
|
|
@@ -704,4 +885,27 @@ function fromCodePoint(str, base, prefix) {
|
|
|
704
885
|
} else {
|
|
705
886
|
return prefix + str + ";";
|
|
706
887
|
}
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
function transformTagName(fn, tagName, tagExp, options) {
|
|
891
|
+
if (fn) {
|
|
892
|
+
const newTagName = fn(tagName);
|
|
893
|
+
if (tagExp === tagName) {
|
|
894
|
+
tagExp = newTagName
|
|
895
|
+
}
|
|
896
|
+
tagName = newTagName;
|
|
897
|
+
}
|
|
898
|
+
tagName = sanitizeName(tagName, options);
|
|
899
|
+
return { tagName, tagExp };
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
function sanitizeName(name, options) {
|
|
905
|
+
if (criticalProperties.includes(name)) {
|
|
906
|
+
throw new Error(`[SECURITY] Invalid name: "${name}" is a reserved JavaScript keyword that could cause prototype pollution`);
|
|
907
|
+
} else if (DANGEROUS_PROPERTY_NAMES.includes(name)) {
|
|
908
|
+
return options.onDangerousProperty(name);
|
|
909
|
+
}
|
|
910
|
+
return name;
|
|
707
911
|
}
|