Skip to content

Commit

Permalink
feat(codegen): upgrade fast-xml-parser to 4.0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP committed Sep 29, 2022
1 parent d6d169a commit 1e6bb7e
Show file tree
Hide file tree
Showing 50 changed files with 207 additions and 126 deletions.
1 change: 0 additions & 1 deletion clients/client-auto-scaling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@aws-sdk/util-utf8-browser": "*",
"@aws-sdk/util-utf8-node": "*",
"@aws-sdk/util-waiter": "*",
"entities": "2.2.0",
"fast-xml-parser": "4.0.10",
"tslib": "^2.3.1"
},
Expand Down
12 changes: 8 additions & 4 deletions clients/client-auto-scaling/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
ResponseMetadata as __ResponseMetadata,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";
import { decodeHTML } from "entities";
import { XMLParser } from "fast-xml-parser";

import { AttachInstancesCommandInput, AttachInstancesCommandOutput } from "../commands/AttachInstancesCommand";
Expand Down Expand Up @@ -9837,13 +9836,18 @@ const buildHttpRpcRequest = async (
const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
const parsedObj = new XMLParser({
const parser = new XMLParser({
attributeNamePrefix: "",
htmlEntities: true,
ignoreAttributes: false,
ignoreDeclaration: true,
parseTagValue: false,
trimValues: false,
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
}).parse(encoded);
tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
});
parser.addEntity("#xD", "\r");
parser.addEntity("#10", "\n");
const parsedObj = parser.parse(encoded);
const textNodeName = "#text";
const key = Object.keys(parsedObj)[0];
const parsedObjToReturn = parsedObj[key];
Expand Down
1 change: 0 additions & 1 deletion clients/client-cloudformation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@aws-sdk/util-utf8-browser": "*",
"@aws-sdk/util-utf8-node": "*",
"@aws-sdk/util-waiter": "*",
"entities": "2.2.0",
"fast-xml-parser": "4.0.10",
"tslib": "^2.3.1",
"uuid": "^8.3.2"
Expand Down
12 changes: 8 additions & 4 deletions clients/client-cloudformation/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
ResponseMetadata as __ResponseMetadata,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";
import { decodeHTML } from "entities";
import { XMLParser } from "fast-xml-parser";
import { v4 as generateIdempotencyToken } from "uuid";

Expand Down Expand Up @@ -10247,13 +10246,18 @@ const buildHttpRpcRequest = async (
const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
const parsedObj = new XMLParser({
const parser = new XMLParser({
attributeNamePrefix: "",
htmlEntities: true,
ignoreAttributes: false,
ignoreDeclaration: true,
parseTagValue: false,
trimValues: false,
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
}).parse(encoded);
tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
});
parser.addEntity("#xD", "\r");
parser.addEntity("#10", "\n");
const parsedObj = parser.parse(encoded);
const textNodeName = "#text";
const key = Object.keys(parsedObj)[0];
const parsedObjToReturn = parsedObj[key];
Expand Down
1 change: 0 additions & 1 deletion clients/client-cloudfront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@aws-sdk/util-utf8-node": "*",
"@aws-sdk/util-waiter": "*",
"@aws-sdk/xml-builder": "*",
"entities": "2.2.0",
"fast-xml-parser": "4.0.10",
"tslib": "^2.3.1"
},
Expand Down
12 changes: 8 additions & 4 deletions clients/client-cloudfront/src/protocols/Aws_restXml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";
import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder";
import { decodeHTML } from "entities";
import { XMLParser } from "fast-xml-parser";

import { AssociateAliasCommandInput, AssociateAliasCommandOutput } from "../commands/AssociateAliasCommand";
Expand Down Expand Up @@ -17269,13 +17268,18 @@ const isSerializableHeaderValue = (value: any): boolean =>
const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
const parsedObj = new XMLParser({
const parser = new XMLParser({
attributeNamePrefix: "",
htmlEntities: true,
ignoreAttributes: false,
ignoreDeclaration: true,
parseTagValue: false,
trimValues: false,
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
}).parse(encoded);
tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
});
parser.addEntity("#xD", "\r");
parser.addEntity("#10", "\n");
const parsedObj = parser.parse(encoded);
const textNodeName = "#text";
const key = Object.keys(parsedObj)[0];
const parsedObjToReturn = parsedObj[key];
Expand Down
1 change: 0 additions & 1 deletion clients/client-cloudsearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"@aws-sdk/util-user-agent-node": "*",
"@aws-sdk/util-utf8-browser": "*",
"@aws-sdk/util-utf8-node": "*",
"entities": "2.2.0",
"fast-xml-parser": "4.0.10",
"tslib": "^2.3.1"
},
Expand Down
12 changes: 8 additions & 4 deletions clients/client-cloudsearch/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
ResponseMetadata as __ResponseMetadata,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";
import { decodeHTML } from "entities";
import { XMLParser } from "fast-xml-parser";

import { BuildSuggestersCommandInput, BuildSuggestersCommandOutput } from "../commands/BuildSuggestersCommand";
Expand Down Expand Up @@ -4185,13 +4184,18 @@ const buildHttpRpcRequest = async (
const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
const parsedObj = new XMLParser({
const parser = new XMLParser({
attributeNamePrefix: "",
htmlEntities: true,
ignoreAttributes: false,
ignoreDeclaration: true,
parseTagValue: false,
trimValues: false,
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
}).parse(encoded);
tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
});
parser.addEntity("#xD", "\r");
parser.addEntity("#10", "\n");
const parsedObj = parser.parse(encoded);
const textNodeName = "#text";
const key = Object.keys(parsedObj)[0];
const parsedObjToReturn = parsedObj[key];
Expand Down
1 change: 0 additions & 1 deletion clients/client-cloudwatch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@aws-sdk/util-utf8-browser": "*",
"@aws-sdk/util-utf8-node": "*",
"@aws-sdk/util-waiter": "*",
"entities": "2.2.0",
"fast-xml-parser": "4.0.10",
"tslib": "^2.3.1"
},
Expand Down
12 changes: 8 additions & 4 deletions clients/client-cloudwatch/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
ResponseMetadata as __ResponseMetadata,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";
import { decodeHTML } from "entities";
import { XMLParser } from "fast-xml-parser";

import { DeleteAlarmsCommandInput, DeleteAlarmsCommandOutput } from "../commands/DeleteAlarmsCommand";
Expand Down Expand Up @@ -6188,13 +6187,18 @@ const buildHttpRpcRequest = async (
const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
const parsedObj = new XMLParser({
const parser = new XMLParser({
attributeNamePrefix: "",
htmlEntities: true,
ignoreAttributes: false,
ignoreDeclaration: true,
parseTagValue: false,
trimValues: false,
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
}).parse(encoded);
tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
});
parser.addEntity("#xD", "\r");
parser.addEntity("#10", "\n");
const parsedObj = parser.parse(encoded);
const textNodeName = "#text";
const key = Object.keys(parsedObj)[0];
const parsedObjToReturn = parsedObj[key];
Expand Down
1 change: 0 additions & 1 deletion clients/client-docdb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@aws-sdk/util-utf8-browser": "*",
"@aws-sdk/util-utf8-node": "*",
"@aws-sdk/util-waiter": "*",
"entities": "2.2.0",
"fast-xml-parser": "4.0.10",
"tslib": "^2.3.1"
},
Expand Down
12 changes: 8 additions & 4 deletions clients/client-docdb/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
ResponseMetadata as __ResponseMetadata,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";
import { decodeHTML } from "entities";
import { XMLParser } from "fast-xml-parser";

import {
Expand Down Expand Up @@ -9081,13 +9080,18 @@ const buildHttpRpcRequest = async (
const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
const parsedObj = new XMLParser({
const parser = new XMLParser({
attributeNamePrefix: "",
htmlEntities: true,
ignoreAttributes: false,
ignoreDeclaration: true,
parseTagValue: false,
trimValues: false,
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
}).parse(encoded);
tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
});
parser.addEntity("#xD", "\r");
parser.addEntity("#10", "\n");
const parsedObj = parser.parse(encoded);
const textNodeName = "#text";
const key = Object.keys(parsedObj)[0];
const parsedObjToReturn = parsedObj[key];
Expand Down
1 change: 0 additions & 1 deletion clients/client-ec2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@aws-sdk/util-utf8-browser": "*",
"@aws-sdk/util-utf8-node": "*",
"@aws-sdk/util-waiter": "*",
"entities": "2.2.0",
"fast-xml-parser": "4.0.10",
"tslib": "^2.3.1",
"uuid": "^8.3.2"
Expand Down
12 changes: 8 additions & 4 deletions clients/client-ec2/src/protocols/Aws_ec2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
ResponseMetadata as __ResponseMetadata,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";
import { decodeHTML } from "entities";
import { XMLParser } from "fast-xml-parser";
import { v4 as generateIdempotencyToken } from "uuid";

Expand Down Expand Up @@ -80327,13 +80326,18 @@ const buildHttpRpcRequest = async (
const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
const parsedObj = new XMLParser({
const parser = new XMLParser({
attributeNamePrefix: "",
htmlEntities: true,
ignoreAttributes: false,
ignoreDeclaration: true,
parseTagValue: false,
trimValues: false,
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
}).parse(encoded);
tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
});
parser.addEntity("#xD", "\r");
parser.addEntity("#10", "\n");
const parsedObj = parser.parse(encoded);
const textNodeName = "#text";
const key = Object.keys(parsedObj)[0];
const parsedObjToReturn = parsedObj[key];
Expand Down
1 change: 0 additions & 1 deletion clients/client-elastic-beanstalk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@aws-sdk/util-utf8-browser": "*",
"@aws-sdk/util-utf8-node": "*",
"@aws-sdk/util-waiter": "*",
"entities": "2.2.0",
"fast-xml-parser": "4.0.10",
"tslib": "^2.3.1"
},
Expand Down
12 changes: 8 additions & 4 deletions clients/client-elastic-beanstalk/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
ResponseMetadata as __ResponseMetadata,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";
import { decodeHTML } from "entities";
import { XMLParser } from "fast-xml-parser";

import {
Expand Down Expand Up @@ -7278,13 +7277,18 @@ const buildHttpRpcRequest = async (
const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
const parsedObj = new XMLParser({
const parser = new XMLParser({
attributeNamePrefix: "",
htmlEntities: true,
ignoreAttributes: false,
ignoreDeclaration: true,
parseTagValue: false,
trimValues: false,
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
}).parse(encoded);
tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
});
parser.addEntity("#xD", "\r");
parser.addEntity("#10", "\n");
const parsedObj = parser.parse(encoded);
const textNodeName = "#text";
const key = Object.keys(parsedObj)[0];
const parsedObjToReturn = parsedObj[key];
Expand Down
1 change: 0 additions & 1 deletion clients/client-elastic-load-balancing-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@aws-sdk/util-utf8-browser": "*",
"@aws-sdk/util-utf8-node": "*",
"@aws-sdk/util-waiter": "*",
"entities": "2.2.0",
"fast-xml-parser": "4.0.10",
"tslib": "^2.3.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
ResponseMetadata as __ResponseMetadata,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";
import { decodeHTML } from "entities";
import { XMLParser } from "fast-xml-parser";

import {
Expand Down Expand Up @@ -6702,13 +6701,18 @@ const buildHttpRpcRequest = async (
const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
const parsedObj = new XMLParser({
const parser = new XMLParser({
attributeNamePrefix: "",
htmlEntities: true,
ignoreAttributes: false,
ignoreDeclaration: true,
parseTagValue: false,
trimValues: false,
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
}).parse(encoded);
tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
});
parser.addEntity("#xD", "\r");
parser.addEntity("#10", "\n");
const parsedObj = parser.parse(encoded);
const textNodeName = "#text";
const key = Object.keys(parsedObj)[0];
const parsedObjToReturn = parsedObj[key];
Expand Down
1 change: 0 additions & 1 deletion clients/client-elastic-load-balancing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@aws-sdk/util-utf8-browser": "*",
"@aws-sdk/util-utf8-node": "*",
"@aws-sdk/util-waiter": "*",
"entities": "2.2.0",
"fast-xml-parser": "4.0.10",
"tslib": "^2.3.1"
},
Expand Down
12 changes: 8 additions & 4 deletions clients/client-elastic-load-balancing/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
ResponseMetadata as __ResponseMetadata,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";
import { decodeHTML } from "entities";
import { XMLParser } from "fast-xml-parser";

import { AddTagsCommandInput, AddTagsCommandOutput } from "../commands/AddTagsCommand";
Expand Down Expand Up @@ -4656,13 +4655,18 @@ const buildHttpRpcRequest = async (
const parseBody = (streamBody: any, context: __SerdeContext): any =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
const parsedObj = new XMLParser({
const parser = new XMLParser({
attributeNamePrefix: "",
htmlEntities: true,
ignoreAttributes: false,
ignoreDeclaration: true,
parseTagValue: false,
trimValues: false,
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
}).parse(encoded);
tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
});
parser.addEntity("#xD", "\r");
parser.addEntity("#10", "\n");
const parsedObj = parser.parse(encoded);
const textNodeName = "#text";
const key = Object.keys(parsedObj)[0];
const parsedObjToReturn = parsedObj[key];
Expand Down
1 change: 0 additions & 1 deletion clients/client-elasticache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@aws-sdk/util-utf8-browser": "*",
"@aws-sdk/util-utf8-node": "*",
"@aws-sdk/util-waiter": "*",
"entities": "2.2.0",
"fast-xml-parser": "4.0.10",
"tslib": "^2.3.1"
},
Expand Down
Loading

0 comments on commit 1e6bb7e

Please sign in to comment.