Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@aws-sdk/xml-builder

Package Overview
Dependencies
Maintainers
2
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/xml-builder - npm Package Compare versions

Comparing version
3.972.21
to
3.972.22
+0
-5
dist-types/ts3.4/escape-attribute.d.ts

@@ -1,6 +0,1 @@

/**
* @internal
*
* Escapes characters that can not be in an XML attribute.
*/
export declare function escapeAttribute(value: string): string;

@@ -1,6 +0,1 @@

/**
* @internal
*
* Escapes characters that can not be in an XML element.
*/
export declare function escapeElement(value: string): string;

@@ -1,12 +0,3 @@

/**
* @internal
*/
export * from "./XmlNode";
/**
* @internal
*/
export * from "./XmlText";
/**
* @internal
*/
export { parseXML } from "./xml-parser";
+1
-4

@@ -1,6 +0,3 @@

/**
* @internal
*/
export interface Stringable {
toString(): string;
toString(): string;
}
+51
-50

@@ -1,65 +0,66 @@

/**
* Contains code from \@nodable/entities v2.1.0
* Copyright (c) Amit Gupta (https://solothought.com)
* https://github.com/nodable/val-parsers
*
* This file bundles the EntityDecoder class and the named-entity maps
* (XML, COMMON_HTML, CURRENCY).
*
* This is a temporary solution while using this particular custom
* EntityDecoder class. The module-only nature of the original version
* is incompatible with some of our users' applications.
*
* Given that our CJS dist must call `require` to bring in the module, and
* because the EntityDecoder class and object are inaccessible via the runtime object surface
* of the XMLParser, we must inline the package.
*
* Q: Why is this necessary given that fast-xml-parser itself uses \@nodable/entities?
* A: FXP only uses \@nodable/entities when imported in ESM mode. When importing FXP
* via require, a bundled version is used, unaffected by the module-only nature
* of the entities package.
*/
export declare const XML: Record<string, string>;
export declare const COMMON_HTML: Record<string, string>;
export declare const CURRENCY: Record<string, string>;
type EntityValFn = (match: string, captured: string, ...rest: unknown[]) => string;
type EntityValFn = (
match: string,
captured: string,
...rest: unknown[]
) => string;
type ApplyLimitsTo = "external" | "base" | "all" | Array<"external" | "base">;
interface EntityDecoderLimitOptions {
maxTotalExpansions?: number;
maxExpandedLength?: number;
applyLimitsTo?: ApplyLimitsTo;
maxTotalExpansions?: number;
maxExpandedLength?: number;
applyLimitsTo?: ApplyLimitsTo;
}
interface EntityDecoderNCROptions {
xmlVersion?: 1.0 | 1.1;
onNCR?: "allow" | "leave" | "remove" | "throw";
nullNCR?: "remove" | "throw";
xmlVersion?: 1.0 | 1.1;
onNCR?: "allow" | "leave" | "remove" | "throw";
nullNCR?: "remove" | "throw";
}
interface EntityDecoderOptions {
namedEntities?: Record<string, string | {
namedEntities?: Record<
string,
| string
| {
regex: RegExp;
val: string | EntityValFn;
}> | null;
postCheck?: ((resolved: string, original: string) => string) | null;
numericAllowed?: boolean;
leave?: string[];
remove?: string[];
limit?: EntityDecoderLimitOptions;
ncr?: EntityDecoderNCROptions;
}
> | null;
postCheck?: ((resolved: string, original: string) => string) | null;
numericAllowed?: boolean;
leave?: string[];
remove?: string[];
limit?: EntityDecoderLimitOptions;
ncr?: EntityDecoderNCROptions;
}
export interface EntityDecoder {
setExternalEntities(map: Record<string, string | {
regex: RegExp;
val: string | EntityValFn;
}>): void;
addExternalEntity(key: string, value: string): void;
addInputEntities(map: Record<string, string | {
regx?: RegExp;
regex?: RegExp;
val: string | EntityValFn;
}>): void;
reset(): this;
decode(str: string): string;
setXmlVersion(version: string): void;
setExternalEntities(
map: Record<
string,
| string
| {
regex: RegExp;
val: string | EntityValFn;
}
>
): void;
addExternalEntity(key: string, value: string): void;
addInputEntities(
map: Record<
string,
| string
| {
regx?: RegExp;
regex?: RegExp;
val: string | EntityValFn;
}
>
): void;
reset(): this;
decode(str: string): string;
setXmlVersion(version: string): void;
}
export declare const EntityDecoderImpl: new (options?: EntityDecoderOptions) => EntityDecoder;
export declare const EntityDecoderImpl: new (
options?: EntityDecoderOptions
) => EntityDecoder;
export {};

@@ -1,9 +0,1 @@

/**
* Cases where this differs from fast-xml-parser:
*
* 1. Mixing text with nested tags (does not occur in AWS REST XML).
* <mixed-text> hello, <bold>world</bold>, how are you?</mixed-text>
*
* @internal
*/
export declare function parseXML(xmlString: string): any;

@@ -1,4 +0,1 @@

/**
* @internal
*/
export declare function parseXML(xmlString: string): any;
import { Stringable } from "./stringable";
/**
* @internal
*
* Represents an XML node.
*/
export declare class XmlNode {
private name;
readonly children: Stringable[];
private attributes;
static of(name: string, childText?: string, withName?: string): XmlNode;
constructor(name: string, children?: Stringable[]);
withName(name: string): XmlNode;
addAttribute(name: string, value: any): XmlNode;
addChildNode(child: Stringable): XmlNode;
removeAttribute(name: string): XmlNode;
/**
* @internal
* Alias of {@link XmlNode#withName(string)} for codegen brevity.
*/
n(name: string): XmlNode;
/**
* @internal
* Alias of {@link XmlNode#addChildNode(string)} for codegen brevity.
*/
c(child: Stringable): XmlNode;
/**
* @internal
* Checked version of {@link XmlNode#addAttribute(string)} for codegen brevity.
*/
a(name: string, value: any): XmlNode;
/**
* Create a child node.
* Used in serialization of string fields.
* @internal
*/
cc(input: any, field: string, withName?: string): void;
/**
* Creates list child nodes.
* @internal
*/
l(input: any, listName: string, memberName: string, valueProvider: Function): void;
/**
* Creates list child nodes with container.
* @internal
*/
lc(input: any, listName: string, memberName: string, valueProvider: Function): void;
toString(): string;
private name;
readonly children: Stringable[];
private attributes;
static of(name: string, childText?: string, withName?: string): XmlNode;
constructor(name: string, children?: Stringable[]);
withName(name: string): XmlNode;
addAttribute(name: string, value: any): XmlNode;
addChildNode(child: Stringable): XmlNode;
removeAttribute(name: string): XmlNode;
n(name: string): XmlNode;
c(child: Stringable): XmlNode;
a(name: string, value: any): XmlNode;
cc(input: any, field: string, withName?: string): void;
l(
input: any,
listName: string,
memberName: string,
valueProvider: Function
): void;
lc(
input: any,
listName: string,
memberName: string,
valueProvider: Function
): void;
toString(): string;
}
import { Stringable } from "./stringable";
/**
* @internal
*
* Represents an XML text value.
*/
export declare class XmlText implements Stringable {
private value;
constructor(value: string);
toString(): string;
private value;
constructor(value: string);
toString(): string;
}
{
"name": "@aws-sdk/xml-builder",
"version": "3.972.21",
"version": "3.972.22",
"description": "XML utilities for the AWS SDK",

@@ -5,0 +5,0 @@ "dependencies": {