Skip to content

Commit ebc6630

Browse files
trivikrAllanZhengYP
authored andcommitted
chore(clients): use fast-xml-parser API from 4.x
1 parent 755a0a4 commit ebc6630

File tree

27 files changed

+147
-103
lines changed

27 files changed

+147
-103
lines changed

clients/client-auto-scaling/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
SerdeContext as __SerdeContext,
2222
} from "@aws-sdk/types";
2323
import { decodeHTML } from "entities";
24-
import { parse as xmlParse } from "fast-xml-parser";
24+
import { XMLParser } from "fast-xml-parser";
2525

2626
import { AttachInstancesCommandInput, AttachInstancesCommandOutput } from "../commands/AttachInstancesCommand";
2727
import {
@@ -9837,13 +9837,13 @@ const buildHttpRpcRequest = async (
98379837
const parseBody = (streamBody: any, context: __SerdeContext): any =>
98389838
collectBodyString(streamBody, context).then((encoded) => {
98399839
if (encoded.length) {
9840-
const parsedObj = xmlParse(encoded, {
9840+
const parsedObj = new XMLParser({
98419841
attributeNamePrefix: "",
98429842
ignoreAttributes: false,
9843-
parseNodeValue: false,
9843+
parseTagValue: false,
98449844
trimValues: false,
98459845
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
9846-
});
9846+
}).parse(encoded);
98479847
const textNodeName = "#text";
98489848
const key = Object.keys(parsedObj)[0];
98499849
const parsedObjToReturn = parsedObj[key];

clients/client-cloudformation/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
SerdeContext as __SerdeContext,
2020
} from "@aws-sdk/types";
2121
import { decodeHTML } from "entities";
22-
import { parse as xmlParse } from "fast-xml-parser";
22+
import { XMLParser } from "fast-xml-parser";
2323
import { v4 as generateIdempotencyToken } from "uuid";
2424

2525
import { ActivateTypeCommandInput, ActivateTypeCommandOutput } from "../commands/ActivateTypeCommand";
@@ -10247,13 +10247,13 @@ const buildHttpRpcRequest = async (
1024710247
const parseBody = (streamBody: any, context: __SerdeContext): any =>
1024810248
collectBodyString(streamBody, context).then((encoded) => {
1024910249
if (encoded.length) {
10250-
const parsedObj = xmlParse(encoded, {
10250+
const parsedObj = new XMLParser({
1025110251
attributeNamePrefix: "",
1025210252
ignoreAttributes: false,
10253-
parseNodeValue: false,
10253+
parseTagValue: false,
1025410254
trimValues: false,
1025510255
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
10256-
});
10256+
}).parse(encoded);
1025710257
const textNodeName = "#text";
1025810258
const key = Object.keys(parsedObj)[0];
1025910259
const parsedObjToReturn = parsedObj[key];

clients/client-cloudfront/src/protocols/Aws_restXml.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
} from "@aws-sdk/types";
2525
import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder";
2626
import { decodeHTML } from "entities";
27-
import { parse as xmlParse } from "fast-xml-parser";
27+
import { XMLParser } from "fast-xml-parser";
2828

2929
import { AssociateAliasCommandInput, AssociateAliasCommandOutput } from "../commands/AssociateAliasCommand";
3030
import { CreateCachePolicyCommandInput, CreateCachePolicyCommandOutput } from "../commands/CreateCachePolicyCommand";
@@ -17269,13 +17269,13 @@ const isSerializableHeaderValue = (value: any): boolean =>
1726917269
const parseBody = (streamBody: any, context: __SerdeContext): any =>
1727017270
collectBodyString(streamBody, context).then((encoded) => {
1727117271
if (encoded.length) {
17272-
const parsedObj = xmlParse(encoded, {
17272+
const parsedObj = new XMLParser({
1727317273
attributeNamePrefix: "",
1727417274
ignoreAttributes: false,
17275-
parseNodeValue: false,
17275+
parseTagValue: false,
1727617276
trimValues: false,
1727717277
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
17278-
});
17278+
}).parse(encoded);
1727917279
const textNodeName = "#text";
1728017280
const key = Object.keys(parsedObj)[0];
1728117281
const parsedObjToReturn = parsedObj[key];

clients/client-cloudsearch/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
SerdeContext as __SerdeContext,
2323
} from "@aws-sdk/types";
2424
import { decodeHTML } from "entities";
25-
import { parse as xmlParse } from "fast-xml-parser";
25+
import { XMLParser } from "fast-xml-parser";
2626

2727
import { BuildSuggestersCommandInput, BuildSuggestersCommandOutput } from "../commands/BuildSuggestersCommand";
2828
import { CreateDomainCommandInput, CreateDomainCommandOutput } from "../commands/CreateDomainCommand";
@@ -4185,13 +4185,13 @@ const buildHttpRpcRequest = async (
41854185
const parseBody = (streamBody: any, context: __SerdeContext): any =>
41864186
collectBodyString(streamBody, context).then((encoded) => {
41874187
if (encoded.length) {
4188-
const parsedObj = xmlParse(encoded, {
4188+
const parsedObj = new XMLParser({
41894189
attributeNamePrefix: "",
41904190
ignoreAttributes: false,
4191-
parseNodeValue: false,
4191+
parseTagValue: false,
41924192
trimValues: false,
41934193
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
4194-
});
4194+
}).parse(encoded);
41954195
const textNodeName = "#text";
41964196
const key = Object.keys(parsedObj)[0];
41974197
const parsedObjToReturn = parsedObj[key];

clients/client-cloudwatch/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
SerdeContext as __SerdeContext,
2323
} from "@aws-sdk/types";
2424
import { decodeHTML } from "entities";
25-
import { parse as xmlParse } from "fast-xml-parser";
25+
import { XMLParser } from "fast-xml-parser";
2626

2727
import { DeleteAlarmsCommandInput, DeleteAlarmsCommandOutput } from "../commands/DeleteAlarmsCommand";
2828
import {
@@ -6188,13 +6188,13 @@ const buildHttpRpcRequest = async (
61886188
const parseBody = (streamBody: any, context: __SerdeContext): any =>
61896189
collectBodyString(streamBody, context).then((encoded) => {
61906190
if (encoded.length) {
6191-
const parsedObj = xmlParse(encoded, {
6191+
const parsedObj = new XMLParser({
61926192
attributeNamePrefix: "",
61936193
ignoreAttributes: false,
6194-
parseNodeValue: false,
6194+
parseTagValue: false,
61956195
trimValues: false,
61966196
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
6197-
});
6197+
}).parse(encoded);
61986198
const textNodeName = "#text";
61996199
const key = Object.keys(parsedObj)[0];
62006200
const parsedObjToReturn = parsedObj[key];

clients/client-docdb/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
SerdeContext as __SerdeContext,
2020
} from "@aws-sdk/types";
2121
import { decodeHTML } from "entities";
22-
import { parse as xmlParse } from "fast-xml-parser";
22+
import { XMLParser } from "fast-xml-parser";
2323

2424
import {
2525
AddSourceIdentifierToSubscriptionCommandInput,
@@ -9081,13 +9081,13 @@ const buildHttpRpcRequest = async (
90819081
const parseBody = (streamBody: any, context: __SerdeContext): any =>
90829082
collectBodyString(streamBody, context).then((encoded) => {
90839083
if (encoded.length) {
9084-
const parsedObj = xmlParse(encoded, {
9084+
const parsedObj = new XMLParser({
90859085
attributeNamePrefix: "",
90869086
ignoreAttributes: false,
9087-
parseNodeValue: false,
9087+
parseTagValue: false,
90889088
trimValues: false,
90899089
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
9090-
});
9090+
}).parse(encoded);
90919091
const textNodeName = "#text";
90929092
const key = Object.keys(parsedObj)[0];
90939093
const parsedObjToReturn = parsedObj[key];

clients/client-ec2/src/protocols/Aws_ec2.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
SerdeContext as __SerdeContext,
2222
} from "@aws-sdk/types";
2323
import { decodeHTML } from "entities";
24-
import { parse as xmlParse } from "fast-xml-parser";
24+
import { XMLParser } from "fast-xml-parser";
2525
import { v4 as generateIdempotencyToken } from "uuid";
2626

2727
import {
@@ -80327,13 +80327,13 @@ const buildHttpRpcRequest = async (
8032780327
const parseBody = (streamBody: any, context: __SerdeContext): any =>
8032880328
collectBodyString(streamBody, context).then((encoded) => {
8032980329
if (encoded.length) {
80330-
const parsedObj = xmlParse(encoded, {
80330+
const parsedObj = new XMLParser({
8033180331
attributeNamePrefix: "",
8033280332
ignoreAttributes: false,
80333-
parseNodeValue: false,
80333+
parseTagValue: false,
8033480334
trimValues: false,
8033580335
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
80336-
});
80336+
}).parse(encoded);
8033780337
const textNodeName = "#text";
8033880338
const key = Object.keys(parsedObj)[0];
8033980339
const parsedObjToReturn = parsedObj[key];

clients/client-elastic-beanstalk/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
SerdeContext as __SerdeContext,
2222
} from "@aws-sdk/types";
2323
import { decodeHTML } from "entities";
24-
import { parse as xmlParse } from "fast-xml-parser";
24+
import { XMLParser } from "fast-xml-parser";
2525

2626
import {
2727
AbortEnvironmentUpdateCommandInput,
@@ -7278,13 +7278,13 @@ const buildHttpRpcRequest = async (
72787278
const parseBody = (streamBody: any, context: __SerdeContext): any =>
72797279
collectBodyString(streamBody, context).then((encoded) => {
72807280
if (encoded.length) {
7281-
const parsedObj = xmlParse(encoded, {
7281+
const parsedObj = new XMLParser({
72827282
attributeNamePrefix: "",
72837283
ignoreAttributes: false,
7284-
parseNodeValue: false,
7284+
parseTagValue: false,
72857285
trimValues: false,
72867286
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
7287-
});
7287+
}).parse(encoded);
72887288
const textNodeName = "#text";
72897289
const key = Object.keys(parsedObj)[0];
72907290
const parsedObjToReturn = parsedObj[key];

clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
SerdeContext as __SerdeContext,
2121
} from "@aws-sdk/types";
2222
import { decodeHTML } from "entities";
23-
import { parse as xmlParse } from "fast-xml-parser";
23+
import { XMLParser } from "fast-xml-parser";
2424

2525
import {
2626
AddListenerCertificatesCommandInput,
@@ -6702,13 +6702,13 @@ const buildHttpRpcRequest = async (
67026702
const parseBody = (streamBody: any, context: __SerdeContext): any =>
67036703
collectBodyString(streamBody, context).then((encoded) => {
67046704
if (encoded.length) {
6705-
const parsedObj = xmlParse(encoded, {
6705+
const parsedObj = new XMLParser({
67066706
attributeNamePrefix: "",
67076707
ignoreAttributes: false,
6708-
parseNodeValue: false,
6708+
parseTagValue: false,
67096709
trimValues: false,
67106710
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
6711-
});
6711+
}).parse(encoded);
67126712
const textNodeName = "#text";
67136713
const key = Object.keys(parsedObj)[0];
67146714
const parsedObjToReturn = parsedObj[key];

clients/client-elastic-load-balancing/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
SerdeContext as __SerdeContext,
2121
} from "@aws-sdk/types";
2222
import { decodeHTML } from "entities";
23-
import { parse as xmlParse } from "fast-xml-parser";
23+
import { XMLParser } from "fast-xml-parser";
2424

2525
import { AddTagsCommandInput, AddTagsCommandOutput } from "../commands/AddTagsCommand";
2626
import {
@@ -4656,13 +4656,13 @@ const buildHttpRpcRequest = async (
46564656
const parseBody = (streamBody: any, context: __SerdeContext): any =>
46574657
collectBodyString(streamBody, context).then((encoded) => {
46584658
if (encoded.length) {
4659-
const parsedObj = xmlParse(encoded, {
4659+
const parsedObj = new XMLParser({
46604660
attributeNamePrefix: "",
46614661
ignoreAttributes: false,
4662-
parseNodeValue: false,
4662+
parseTagValue: false,
46634663
trimValues: false,
46644664
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
4665-
});
4665+
}).parse(encoded);
46664666
const textNodeName = "#text";
46674667
const key = Object.keys(parsedObj)[0];
46684668
const parsedObjToReturn = parsedObj[key];

clients/client-elasticache/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
SerdeContext as __SerdeContext,
2121
} from "@aws-sdk/types";
2222
import { decodeHTML } from "entities";
23-
import { parse as xmlParse } from "fast-xml-parser";
23+
import { XMLParser } from "fast-xml-parser";
2424

2525
import { AddTagsToResourceCommandInput, AddTagsToResourceCommandOutput } from "../commands/AddTagsToResourceCommand";
2626
import {
@@ -12497,13 +12497,13 @@ const buildHttpRpcRequest = async (
1249712497
const parseBody = (streamBody: any, context: __SerdeContext): any =>
1249812498
collectBodyString(streamBody, context).then((encoded) => {
1249912499
if (encoded.length) {
12500-
const parsedObj = xmlParse(encoded, {
12500+
const parsedObj = new XMLParser({
1250112501
attributeNamePrefix: "",
1250212502
ignoreAttributes: false,
12503-
parseNodeValue: false,
12503+
parseTagValue: false,
1250412504
trimValues: false,
1250512505
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
12506-
});
12506+
}).parse(encoded);
1250712507
const textNodeName = "#text";
1250812508
const key = Object.keys(parsedObj)[0];
1250912509
const parsedObjToReturn = parsedObj[key];

clients/client-iam/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
SerdeContext as __SerdeContext,
2020
} from "@aws-sdk/types";
2121
import { decodeHTML } from "entities";
22-
import { parse as xmlParse } from "fast-xml-parser";
22+
import { XMLParser } from "fast-xml-parser";
2323

2424
import {
2525
AddClientIDToOpenIDConnectProviderCommandInput,
@@ -17374,13 +17374,13 @@ const buildHttpRpcRequest = async (
1737417374
const parseBody = (streamBody: any, context: __SerdeContext): any =>
1737517375
collectBodyString(streamBody, context).then((encoded) => {
1737617376
if (encoded.length) {
17377-
const parsedObj = xmlParse(encoded, {
17377+
const parsedObj = new XMLParser({
1737817378
attributeNamePrefix: "",
1737917379
ignoreAttributes: false,
17380-
parseNodeValue: false,
17380+
parseTagValue: false,
1738117381
trimValues: false,
1738217382
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
17383-
});
17383+
}).parse(encoded);
1738417384
const textNodeName = "#text";
1738517385
const key = Object.keys(parsedObj)[0];
1738617386
const parsedObjToReturn = parsedObj[key];

clients/client-neptune/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
SerdeContext as __SerdeContext,
2121
} from "@aws-sdk/types";
2222
import { decodeHTML } from "entities";
23-
import { parse as xmlParse } from "fast-xml-parser";
23+
import { XMLParser } from "fast-xml-parser";
2424

2525
import { AddRoleToDBClusterCommandInput, AddRoleToDBClusterCommandOutput } from "../commands/AddRoleToDBClusterCommand";
2626
import {
@@ -12050,13 +12050,13 @@ const buildHttpRpcRequest = async (
1205012050
const parseBody = (streamBody: any, context: __SerdeContext): any =>
1205112051
collectBodyString(streamBody, context).then((encoded) => {
1205212052
if (encoded.length) {
12053-
const parsedObj = xmlParse(encoded, {
12053+
const parsedObj = new XMLParser({
1205412054
attributeNamePrefix: "",
1205512055
ignoreAttributes: false,
12056-
parseNodeValue: false,
12056+
parseTagValue: false,
1205712057
trimValues: false,
1205812058
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
12059-
});
12059+
}).parse(encoded);
1206012060
const textNodeName = "#text";
1206112061
const key = Object.keys(parsedObj)[0];
1206212062
const parsedObjToReturn = parsedObj[key];

clients/client-rds/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
SerdeContext as __SerdeContext,
2323
} from "@aws-sdk/types";
2424
import { decodeHTML } from "entities";
25-
import { parse as xmlParse } from "fast-xml-parser";
25+
import { XMLParser } from "fast-xml-parser";
2626

2727
import { AddRoleToDBClusterCommandInput, AddRoleToDBClusterCommandOutput } from "../commands/AddRoleToDBClusterCommand";
2828
import {
@@ -24101,13 +24101,13 @@ const buildHttpRpcRequest = async (
2410124101
const parseBody = (streamBody: any, context: __SerdeContext): any =>
2410224102
collectBodyString(streamBody, context).then((encoded) => {
2410324103
if (encoded.length) {
24104-
const parsedObj = xmlParse(encoded, {
24104+
const parsedObj = new XMLParser({
2410524105
attributeNamePrefix: "",
2410624106
ignoreAttributes: false,
24107-
parseNodeValue: false,
24107+
parseTagValue: false,
2410824108
trimValues: false,
2410924109
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
24110-
});
24110+
}).parse(encoded);
2411124111
const textNodeName = "#text";
2411224112
const key = Object.keys(parsedObj)[0];
2411324113
const parsedObjToReturn = parsedObj[key];

clients/client-redshift/src/protocols/Aws_query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
SerdeContext as __SerdeContext,
2222
} from "@aws-sdk/types";
2323
import { decodeHTML } from "entities";
24-
import { parse as xmlParse } from "fast-xml-parser";
24+
import { XMLParser } from "fast-xml-parser";
2525

2626
import {
2727
AcceptReservedNodeExchangeCommandInput,
@@ -19394,13 +19394,13 @@ const buildHttpRpcRequest = async (
1939419394
const parseBody = (streamBody: any, context: __SerdeContext): any =>
1939519395
collectBodyString(streamBody, context).then((encoded) => {
1939619396
if (encoded.length) {
19397-
const parsedObj = xmlParse(encoded, {
19397+
const parsedObj = new XMLParser({
1939819398
attributeNamePrefix: "",
1939919399
ignoreAttributes: false,
19400-
parseNodeValue: false,
19400+
parseTagValue: false,
1940119401
trimValues: false,
1940219402
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
19403-
});
19403+
}).parse(encoded);
1940419404
const textNodeName = "#text";
1940519405
const key = Object.keys(parsedObj)[0];
1940619406
const parsedObjToReturn = parsedObj[key];

0 commit comments

Comments
 (0)