🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@aws-sdk/core

Package Overview
Dependencies
Maintainers
2
Versions
226
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/core - npm Package Compare versions

Comparing version
3.977.1
to
3.977.2
+160
dist-es/submodules.../json/codec-v1/JsonShapeDeserializer.js
import { determineTimestampFormat } from "@smithy/core/protocols";
import { NormalizedSchema } from "@smithy/core/schema";
import { LazyJsonString, NumericValue, parseEpochTimestamp, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, } from "@smithy/core/serde";
import { fromBase64 } from "@smithy/core/serde";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import { UnionSerde } from "../../UnionSerde";
import { jsonReviver } from "../jsonReviver";
import { needsReviver } from "../needsReviver";
import { parseJsonBody } from "../parseJsonBody";
import { writeKey } from "../../writeKey";
export class JsonShapeDeserializer extends SerdeContextConfig {
settings;
constructor(settings) {
super();
this.settings = settings;
}
async read(schema, data) {
const reviver = needsReviver(schema) ? jsonReviver : undefined;
return this._read(schema, typeof data === "string" ? JSON.parse(data, reviver) : await parseJsonBody(data, this.serdeContext, schema));
}
readObject(schema, data) {
return this._read(schema, data);
}
_read(schema, value) {
const isObject = value !== null && typeof value === "object";
const ns = NormalizedSchema.of(schema);
if (isObject) {
if (ns.isStructSchema()) {
const record = value;
const union = ns.isUnionSchema();
const out = {};
let nameMap = void 0;
const { jsonName } = this.settings;
if (jsonName) {
nameMap = {};
}
let unionSerde;
if (union) {
unionSerde = new UnionSerde(record, out);
}
for (const [memberName, memberSchema] of ns.structIterator()) {
let fromKey = memberName;
if (jsonName) {
fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
nameMap[fromKey] = memberName;
}
if (union) {
unionSerde.mark(fromKey);
}
if (record[fromKey] != null) {
out[memberName] = this._read(memberSchema, record[fromKey]);
}
}
if (union) {
unionSerde.writeUnknown();
}
else if (typeof record.__type === "string") {
for (const k in record) {
const v = record[k];
const t = jsonName ? (nameMap[k] ?? k) : k;
if (!(t in out)) {
out[t] = v;
}
}
}
return out;
}
if (Array.isArray(value) && ns.isListSchema()) {
const listMember = ns.getValueSchema();
const out = [];
for (const item of value) {
out.push(this._read(listMember, item));
}
return out;
}
if (ns.isMapSchema()) {
const mapMember = ns.getValueSchema();
const out = {};
for (const _k in value) {
if (_k === "__proto__") {
writeKey(out);
}
out[_k] = this._read(mapMember, value[_k]);
}
return out;
}
}
if (ns.isBlobSchema() && typeof value === "string") {
return fromBase64(value);
}
const mediaType = ns.getMergedTraits().mediaType;
if (ns.isStringSchema() && typeof value === "string" && mediaType) {
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
if (isJson) {
return LazyJsonString.from(value);
}
return value;
}
if (ns.isTimestampSchema() && value != null) {
const format = determineTimestampFormat(ns, this.settings);
switch (format) {
case 5:
return parseRfc3339DateTimeWithOffset(value);
case 6:
return parseRfc7231DateTime(value);
case 7:
return parseEpochTimestamp(value);
default:
console.warn("Missing timestamp format, parsing value with Date constructor:", value);
return new Date(value);
}
}
if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) {
return BigInt(value);
}
if (ns.isBigDecimalSchema() && value != undefined) {
if (value instanceof NumericValue) {
return value;
}
const untyped = value;
if (untyped.type === "bigDecimal" && "string" in untyped) {
return new NumericValue(untyped.string, untyped.type);
}
return new NumericValue(String(value), "bigDecimal");
}
if (ns.isNumericSchema() && typeof value === "string") {
switch (value) {
case "Infinity":
return Infinity;
case "-Infinity":
return -Infinity;
case "NaN":
return NaN;
}
return value;
}
if (ns.isDocumentSchema()) {
if (isObject) {
const out = Array.isArray(value) ? [] : {};
for (const k in value) {
if (k === "__proto__") {
writeKey(out);
}
const v = value[k];
if (v instanceof NumericValue) {
out[k] = v;
}
else {
out[k] = this._read(ns, v);
}
}
return out;
}
else {
return structuredClone(value);
}
}
return value;
}
}
import { determineTimestampFormat } from "@smithy/core/protocols";
import { NormalizedSchema } from "@smithy/core/schema";
import { dateToUtcString, generateIdempotencyToken, LazyJsonString, NumericValue, toBase64 } from "@smithy/core/serde";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import { JsonReplacer } from "../jsonReplacer";
import { writeKey } from "../../writeKey";
export class JsonShapeSerializer extends SerdeContextConfig {
settings;
buffer;
useReplacer = false;
rootSchema;
constructor(settings) {
super();
this.settings = settings;
}
write(schema, value) {
this.rootSchema = NormalizedSchema.of(schema);
this.buffer = this._write(this.rootSchema, value);
}
flush() {
const { rootSchema, useReplacer } = this;
this.rootSchema = undefined;
this.useReplacer = false;
if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) {
if (!useReplacer) {
return JSON.stringify(this.buffer);
}
const replacer = new JsonReplacer();
return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0));
}
return this.buffer;
}
writeDiscriminatedDocument(schema, value) {
this.write(schema, value);
if (typeof this.buffer === "object") {
this.buffer.__type = NormalizedSchema.of(schema).getName(true);
}
}
_write(schema, value, container) {
const isObject = value !== null && typeof value === "object";
const ns = NormalizedSchema.of(schema);
if (isObject) {
if (ns.isStructSchema()) {
const record = value;
const out = {};
const { jsonName } = this.settings;
let nameMap = void 0;
if (jsonName) {
nameMap = {};
}
let outCount = 0;
for (const [memberName, memberSchema] of ns.structIterator()) {
const serializableValue = this._write(memberSchema, record[memberName], ns);
if (serializableValue !== undefined) {
let targetKey = memberName;
if (jsonName) {
targetKey = memberSchema.getMergedTraits().jsonName ?? memberName;
nameMap[memberName] = targetKey;
}
out[targetKey] = serializableValue;
outCount++;
}
}
if (ns.isUnionSchema() && outCount === 0) {
const { $unknown } = record;
if (Array.isArray($unknown)) {
const [k, v] = $unknown;
if (k === "__proto__") {
writeKey(out);
}
out[k] = this._write(15, v);
}
}
else if (typeof record.__type === "string") {
for (const k in record) {
const v = record[k];
const targetKey = jsonName ? (nameMap[k] ?? k) : k;
if (!(targetKey in out)) {
out[targetKey] = this._write(15, v);
}
}
}
return out;
}
if (Array.isArray(value) && ns.isListSchema()) {
const listMember = ns.getValueSchema();
const out = [];
const sparse = !!ns.getMergedTraits().sparse;
for (const item of value) {
if (sparse || item != null) {
out.push(this._write(listMember, item));
}
}
return out;
}
if (ns.isMapSchema()) {
const mapMember = ns.getValueSchema();
const out = {};
const sparse = !!ns.getMergedTraits().sparse;
for (const _k in value) {
const _v = value[_k];
if (sparse || _v != null) {
if (_k === "__proto__") {
writeKey(out);
}
out[_k] = this._write(mapMember, _v);
}
}
return out;
}
if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) {
if (ns === this.rootSchema) {
return value;
}
return (this.serdeContext?.base64Encoder ?? toBase64)(value);
}
if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
const format = determineTimestampFormat(ns, this.settings);
switch (format) {
case 5:
return value.toISOString().replace(".000Z", "Z");
case 6:
return dateToUtcString(value);
case 7:
return value.getTime() / 1000;
default:
console.warn("Missing timestamp format, using epoch seconds", value);
return value.getTime() / 1000;
}
}
if (value instanceof NumericValue) {
this.useReplacer = true;
}
}
if (value === null && container?.isStructSchema()) {
return void 0;
}
if (ns.isStringSchema()) {
if (typeof value === "undefined" && ns.isIdempotencyToken()) {
return generateIdempotencyToken();
}
const mediaType = ns.getMergedTraits().mediaType;
if (value != null && mediaType) {
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
if (isJson) {
return LazyJsonString.from(value);
}
}
return value;
}
if (typeof value === "number" && ns.isNumericSchema()) {
if (Math.abs(value) === Infinity || isNaN(value)) {
return String(value);
}
return value;
}
if (typeof value === "string" && ns.isBlobSchema()) {
if (ns === this.rootSchema) {
return value;
}
return (this.serdeContext?.base64Encoder ?? toBase64)(value);
}
if (typeof value === "bigint") {
this.useReplacer = true;
}
if (ns.isDocumentSchema()) {
if (isObject) {
const out = Array.isArray(value) ? [] : {};
for (const k in value) {
const v = value[k];
if (k === "__proto__") {
writeKey(out);
}
if (v instanceof NumericValue) {
this.useReplacer = true;
out[k] = v;
}
else {
out[k] = this._write(ns, v);
}
}
return out;
}
else {
return structuredClone(value);
}
}
return value;
}
}
import { determineTimestampFormat } from "@smithy/core/protocols";
import { NormalizedSchema } from "@smithy/core/schema";
import { LazyJsonString, NumericValue, parseEpochTimestamp, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, } from "@smithy/core/serde";
import { fromBase64 } from "@smithy/core/serde";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import { UnionSerde } from "../../UnionSerde";
import { detectBufferParsing } from "../detectBufferParsing";
import { jsonReviver } from "../jsonReviver";
import { needsReviver } from "../needsReviver";
import { parseJsonBody } from "../parseJsonBody";
import { writeKey } from "../../writeKey";
export class BufferJsonShapeDeserializer extends SerdeContextConfig {
settings;
constructor(settings) {
super();
this.settings = settings;
}
async read(schema, data) {
const reviver = needsReviver(schema) ? jsonReviver : undefined;
let parsed;
if (typeof data === "string") {
parsed = JSON.parse(data, reviver);
}
else if (data instanceof Uint8Array && detectBufferParsing()) {
const buf = Buffer.isBuffer(data) ? data : Buffer.from(data.buffer, data.byteOffset, data.byteLength);
parsed = JSON.parse(buf, reviver);
}
else {
parsed = await parseJsonBody(data, this.serdeContext);
}
return this._read(schema, parsed);
}
readObject(schema, data) {
return this._read(schema, data);
}
_read(schema, value) {
const isObject = value !== null && typeof value === "object";
const ns = NormalizedSchema.of(schema);
if (isObject) {
if (ns.isStructSchema()) {
return this._readStruct(ns, value);
}
if (Array.isArray(value) && ns.isListSchema()) {
const listMember = ns.getValueSchema();
for (let i = 0; i < value.length; ++i) {
value[i] = this._read(listMember, value[i]);
}
return value;
}
if (ns.isMapSchema()) {
const mapMember = ns.getValueSchema();
const map = value;
for (const k in map) {
if (k === "__proto__") {
writeKey(map);
}
map[k] = this._read(mapMember, map[k]);
}
return map;
}
}
if (ns.isBlobSchema() && typeof value === "string") {
return fromBase64(value);
}
const mediaType = ns.getMergedTraits().mediaType;
if (ns.isStringSchema() && typeof value === "string" && mediaType) {
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
if (isJson) {
return LazyJsonString.from(value);
}
return value;
}
if (ns.isTimestampSchema() && value != null) {
const format = determineTimestampFormat(ns, this.settings);
switch (format) {
case 5:
return parseRfc3339DateTimeWithOffset(value);
case 6:
return parseRfc7231DateTime(value);
case 7:
return parseEpochTimestamp(value);
default:
console.warn("Missing timestamp format, parsing value with Date constructor:", value);
return new Date(value);
}
}
if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) {
return BigInt(value);
}
if (ns.isBigDecimalSchema() && value != undefined) {
if (value instanceof NumericValue) {
return value;
}
const untyped = value;
if (untyped.type === "bigDecimal" && "string" in untyped) {
return new NumericValue(untyped.string, untyped.type);
}
return new NumericValue(String(value), "bigDecimal");
}
if (ns.isNumericSchema() && typeof value === "string") {
switch (value) {
case "Infinity":
return Infinity;
case "-Infinity":
return -Infinity;
case "NaN":
return NaN;
}
return value;
}
if (ns.isDocumentSchema()) {
if (isObject) {
if (Array.isArray(value)) {
for (let i = 0; i < value.length; ++i) {
const v = value[i];
if (!(v instanceof NumericValue)) {
value[i] = this._read(ns, v);
}
}
}
else {
const doc = value;
for (const k in doc) {
if (k === "__proto__") {
writeKey(doc);
}
const v = doc[k];
if (!(v instanceof NumericValue)) {
doc[k] = this._read(ns, v);
}
}
}
return value;
}
else {
return value;
}
}
return value;
}
_readStruct(ns, record) {
const union = ns.isUnionSchema();
const out = {};
let nameMap = void 0;
const { jsonName } = this.settings;
if (jsonName) {
nameMap = {};
}
let unionSerde;
if (union) {
unionSerde = new UnionSerde(record, out);
}
for (const [memberName, memberSchema] of ns.structIterator()) {
let fromKey = memberName;
if (jsonName) {
fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
nameMap[fromKey] = memberName;
}
if (union) {
unionSerde.mark(fromKey);
}
if (record[fromKey] != null) {
out[memberName] = this._read(memberSchema, record[fromKey]);
}
}
if (union) {
unionSerde.writeUnknown();
}
else if (typeof record.__type === "string") {
for (const k in record) {
const v = record[k];
const t = jsonName ? (nameMap[k] ?? k) : k;
if (!(t in out)) {
out[t] = v;
}
}
}
return out;
}
}
import { determineTimestampFormat } from "@smithy/core/protocols";
import { NormalizedSchema } from "@smithy/core/schema";
import { dateToUtcString, generateIdempotencyToken, LazyJsonString, NumericValue, toBase64, toUtf8, } from "@smithy/core/serde";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import { writeKey } from "../../writeKey";
const encoder = new TextEncoder();
const OPEN_BRACE = 0x7b;
const CLOSE_BRACE = 0x7d;
const OPEN_BRACKET = 0x5b;
const CLOSE_BRACKET = 0x5d;
const QUOTE = 0x22;
const COLON = 0x3a;
const COMMA = 0x2c;
const BACKSLASH = 0x5c;
const TRUE = new Uint8Array([0x74, 0x72, 0x75, 0x65]);
const FALSE = new Uint8Array([0x66, 0x61, 0x6c, 0x73, 0x65]);
const NULL = new Uint8Array([0x6e, 0x75, 0x6c, 0x6c]);
const ESCAPE_TABLE = new Array(128).fill(null);
ESCAPE_TABLE[0x08] = "b";
ESCAPE_TABLE[0x09] = "t";
ESCAPE_TABLE[0x0a] = "n";
ESCAPE_TABLE[0x0c] = "f";
ESCAPE_TABLE[0x0d] = "r";
ESCAPE_TABLE[0x22] = '"';
ESCAPE_TABLE[0x5c] = "\\";
for (let i = 0; i < 0x20; i++) {
if (ESCAPE_TABLE[i] === null) {
ESCAPE_TABLE[i] = "u00" + i.toString(16).padStart(2, "0");
}
}
const INITIAL_BUFFER_SIZE = 2048;
function alloc(size) {
return typeof Buffer !== "undefined" ? Buffer.allocUnsafe(size) : new Uint8Array(size);
}
export class ByteJsonShapeSerializer extends SerdeContextConfig {
settings;
json;
i = 0;
rootSchema;
constructor(settings) {
super();
this.settings = settings;
this.json = alloc(INITIAL_BUFFER_SIZE);
}
write(schema, value) {
this.i = 0;
this.rootSchema = NormalizedSchema.of(schema);
this.writeValue(this.rootSchema, value, undefined);
}
writeDiscriminatedDocument(schema, value) {
this.i = 0;
this.rootSchema = NormalizedSchema.of(schema);
const ns = this.rootSchema;
if (ns.isStructSchema() && value != null && typeof value === "object") {
this.ensure(2);
this.json[this.i++] = OPEN_BRACE;
this.writeAsciiQuoted("__type");
this.json[this.i++] = COLON;
this.writeAsciiQuoted(ns.getName(true) ?? "Unknown");
let wroteAny = true;
const { jsonName } = this.settings;
for (const [memberName, memberSchema] of ns.structIterator()) {
const item = value[memberName];
if (item == null && !memberSchema.isIdempotencyToken()) {
continue;
}
if (wroteAny) {
this.ensure(1);
this.json[this.i++] = COMMA;
}
const targetKey = jsonName ? (memberSchema.getMergedTraits().jsonName ?? memberName) : memberName;
this.writeAsciiQuoted(targetKey);
this.json[this.i++] = COLON;
this.writeValue(memberSchema, item, ns);
wroteAny = true;
}
this.ensure(1);
this.json[this.i++] = CLOSE_BRACE;
}
else {
this.writeValue(ns, value, undefined);
}
}
flush() {
this.rootSchema = undefined;
const finalPosition = this.i;
this.i = 0;
const result = this.json.subarray(0, finalPosition);
this.json = alloc(INITIAL_BUFFER_SIZE);
return result;
}
ensure(byteCount) {
const { i, json } = this;
if (i + byteCount > json.length) {
let newSize = json.length * 2;
while (newSize < i + byteCount) {
newSize *= 2;
}
const next = alloc(newSize);
next.set(this.json);
this.json = next;
}
}
writeAscii(s) {
const z = s.length;
this.ensure(z);
let { i, json } = this;
for (let j = 0; j < z; ++j) {
json[i] = s.charCodeAt(j);
i += 1;
}
this.i = i;
}
writeAsciiQuoted(s) {
const z = s.length;
this.ensure(z + 4);
let { json, i } = this;
json[i++] = QUOTE;
for (let j = 0; j < z; ++j) {
json[i++] = s.charCodeAt(j);
}
json[i++] = QUOTE;
this.i = i;
}
writeJsonString(s) {
this.ensure(s.length * 2 + 2);
this.json[this.i++] = QUOTE;
const z = s.length;
for (let j = 0; j < z; ++j) {
const c = s.charCodeAt(j);
if (c > 0x22 && c < 0x5c) {
this.json[this.i++] = c;
}
else if (c < 0x80) {
const esc = ESCAPE_TABLE[c];
if (esc !== null) {
this.ensure(esc.length + 1);
this.json[this.i++] = BACKSLASH;
for (let k = 0; k < esc.length; k++) {
this.json[this.i++] = esc.charCodeAt(k);
}
}
else {
this.json[this.i++] = c;
}
}
else if (c >= 0xd800 && c <= 0xdbff) {
const next = j + 1 < z ? s.charCodeAt(j + 1) : 0;
if (next >= 0xdc00 && next <= 0xdfff) {
this.ensure(4);
const { written } = encoder.encodeInto(s.substring(j, j + 2), this.json.subarray(this.i));
this.i += written;
j++;
}
else {
this.ensure(6);
this.writeUnicodeEscape(c);
}
}
else if (c >= 0xdc00 && c <= 0xdfff) {
this.ensure(6);
this.writeUnicodeEscape(c);
}
else {
let { i, json } = this;
if (c < 0x800) {
json[i++] = 0xc0 | (c >> 6);
json[i++] = 0x80 | (c & 0x3f);
}
else {
json[i++] = 0xe0 | (c >> 12);
json[i++] = 0x80 | ((c >> 6) & 0x3f);
json[i++] = 0x80 | (c & 0x3f);
}
this.i = i;
}
}
this.json[this.i++] = QUOTE;
}
writeUnicodeEscape(code) {
let { json, i } = this;
json[i++] = BACKSLASH;
json[i++] = 0x75;
const hex = code.toString(16).padStart(4, "0");
for (let j = 0; j < 4; ++j) {
json[i++] = hex.charCodeAt(j);
}
this.i = i;
}
static B64 = (() => {
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const table = new Uint8Array(64);
for (let i = 0; i < 64; i++)
table[i] = chars.charCodeAt(i);
return table;
})();
writeBase64(data) {
const b64Len = Math.ceil(data.length / 3) * 4;
this.ensure(b64Len + 2);
const json = this.json;
const B64 = ByteJsonShapeSerializer.B64;
let i = this.i;
json[i++] = QUOTE;
const len = data.length;
const remainder = len % 3;
const mainLen = len - remainder;
for (let j = 0; j < mainLen; j += 3) {
const a = data[j];
const b = data[j + 1];
const c = data[j + 2];
json[i++] = B64[a >> 2];
json[i++] = B64[((a & 0x03) << 4) | (b >> 4)];
json[i++] = B64[((b & 0x0f) << 2) | (c >> 6)];
json[i++] = B64[c & 0x3f];
}
if (remainder === 2) {
const a = data[mainLen];
const b = data[mainLen + 1];
json[i++] = B64[a >> 2];
json[i++] = B64[((a & 0x03) << 4) | (b >> 4)];
json[i++] = B64[(b & 0x0f) << 2];
json[i++] = 0x3d;
}
else if (remainder === 1) {
const a = data[mainLen];
json[i++] = B64[a >> 2];
json[i++] = B64[(a & 0x03) << 4];
json[i++] = 0x3d;
json[i++] = 0x3d;
}
json[i++] = QUOTE;
this.i = i;
}
writeValue(schema, value, container) {
if (value == null) {
if (container?.isStructSchema()) {
if (value === undefined) {
const ns = NormalizedSchema.of(schema);
if (ns.isIdempotencyToken()) {
this.writeAsciiQuoted(generateIdempotencyToken());
return;
}
}
return;
}
this.ensure(4);
this.json.set(NULL, this.i);
this.i += 4;
return;
}
const ns = NormalizedSchema.of(schema);
const isObject = typeof value === "object";
if (isObject) {
if (ns.isStructSchema()) {
this.writeStruct(ns, value);
return;
}
if (Array.isArray(value) && (ns.isListSchema() || ns.isDocumentSchema())) {
this.writeList(ns, value, ns.isDocumentSchema());
return;
}
if (ns.isMapSchema()) {
this.writeMap(ns, value, false);
return;
}
if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) {
this.writeBase64(value);
return;
}
if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
this.writeTimestamp(ns, value);
return;
}
if (value instanceof NumericValue) {
this.writeAscii(value.string);
return;
}
if (ns.isDocumentSchema()) {
if (Array.isArray(value)) {
this.writeList(ns, value, true);
}
else {
this.writeMap(ns, value, true);
}
return;
}
const json = JSON.stringify(value);
this.writeAscii(json);
return;
}
if (typeof value === "string") {
if (ns.isStringSchema()) {
const mediaType = ns.getMergedTraits().mediaType;
if (mediaType) {
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
if (isJson) {
this.writeJsonString(LazyJsonString.from(value).toString());
return;
}
}
}
if (ns.isBlobSchema()) {
const b64 = (this.serdeContext?.base64Encoder ?? toBase64)(value);
this.writeAsciiQuoted(b64);
return;
}
this.writeJsonString(value);
return;
}
if (typeof value === "number") {
if (ns.isNumericSchema() && (Math.abs(value) === Infinity || isNaN(value))) {
this.writeAsciiQuoted(String(value));
return;
}
const numStr = String(value);
this.writeAscii(numStr);
return;
}
if (typeof value === "boolean") {
this.ensure(5);
if (value) {
this.json.set(TRUE, this.i);
this.i += 4;
}
else {
this.json.set(FALSE, this.i);
this.i += 5;
}
return;
}
if (typeof value === "bigint") {
this.writeAscii(value.toString());
return;
}
this.writeAscii(String(value));
}
writeStruct(ns, value) {
this.ensure(2);
this.json[this.i++] = OPEN_BRACE;
let first = true;
let wroteAny = false;
const hasType = typeof value.__type === "string";
let writtenKeys;
if (hasType) {
writtenKeys = new Set();
}
for (const [memberName, memberSchema] of ns.structIterator()) {
const item = value[memberName];
if (item == null && !memberSchema.isIdempotencyToken())
continue;
if (!first) {
this.ensure(1);
this.json[this.i++] = COMMA;
}
first = false;
wroteAny = true;
const targetKey = this.settings.jsonName ? (memberSchema.getMergedTraits().jsonName ?? memberName) : memberName;
if (writtenKeys) {
writtenKeys.add(memberName);
writtenKeys.add(targetKey);
}
this.writeAsciiQuoted(targetKey);
this.json[this.i++] = COLON;
this.writeValue(memberSchema, item, ns);
}
if (!wroteAny && ns.isUnionSchema()) {
const { $unknown } = value;
if (Array.isArray($unknown)) {
const [k, v] = $unknown;
this.writeAsciiQuoted(k);
this.ensure(1);
this.json[this.i++] = COLON;
this.writeValue(15, v, ns);
}
}
else if (hasType) {
for (const k in value) {
const targetKey = this.settings.jsonName ? (writtenKeys.has(k) ? k : k) : k;
if (writtenKeys.has(targetKey))
continue;
writtenKeys.add(targetKey);
const v = value[k];
if (!first) {
this.ensure(1);
this.json[this.i++] = COMMA;
}
first = false;
this.writeAsciiQuoted(targetKey);
this.ensure(1);
this.json[this.i++] = COLON;
this.writeValue(15, v, undefined);
}
}
this.ensure(1);
this.json[this.i++] = CLOSE_BRACE;
}
writeList(ns, value, isDocument) {
this.ensure(2);
this.json[this.i++] = OPEN_BRACKET;
const sparse = !!ns.getMergedTraits().sparse;
const valueSchema = ns.getValueSchema();
for (let i = 0; i < value.length; ++i) {
const item = value[i];
if (isDocument ? item === undefined : item == null && !sparse) {
continue;
}
if (i !== 0) {
this.ensure(1);
this.json[this.i++] = COMMA;
}
this.writeValue(valueSchema, item, undefined);
}
this.ensure(1);
this.json[this.i++] = CLOSE_BRACKET;
}
writeMap(ns, value, isDocument) {
const sparse = !!ns.getMergedTraits().sparse;
const valueSchema = ns.getValueSchema();
if (!isDocument) {
if (valueSchema.isStringSchema() || valueSchema.isNumericSchema() || valueSchema.isBooleanSchema()) {
let input = value;
if (sparse) {
input = {};
for (const k in value) {
if (k === "__proto__") {
writeKey(input);
}
input[k] = value[k] ?? null;
}
}
const json = JSON.stringify(input);
this.ensure(json.length * 3);
const { written } = encoder.encodeInto(json, this.json.subarray(this.i));
this.i += written;
return;
}
}
this.ensure(2);
this.json[this.i++] = OPEN_BRACE;
let first = true;
for (const k in value) {
const v = value[k];
if (isDocument ? v === undefined : v == null && !sparse) {
continue;
}
if (!first) {
this.ensure(1);
this.json[this.i++] = COMMA;
}
first = false;
this.writeJsonString(k);
this.ensure(1);
this.json[this.i++] = COLON;
this.writeValue(valueSchema, v, undefined);
}
this.ensure(1);
this.json[this.i++] = CLOSE_BRACE;
}
writeTimestamp(ns, value) {
const format = determineTimestampFormat(ns, this.settings);
switch (format) {
case 5: {
const iso = value.toISOString().replace(".000Z", "Z");
this.writeAsciiQuoted(iso);
return;
}
case 6: {
this.writeAsciiQuoted(dateToUtcString(value));
return;
}
case 7: {
const epochSecs = String(value.getTime() / 1000);
this.writeAscii(epochSecs);
return;
}
default: {
const epochSecs = String(value.getTime() / 1000);
this.writeAscii(epochSecs);
return;
}
}
}
}
export class StringJsonShapeSerializer extends SerdeContextConfig {
settings;
byteSerializer;
constructor(settings) {
super();
this.settings = settings;
this.byteSerializer = new ByteJsonShapeSerializer(settings);
}
write(schema, value) {
this.byteSerializer.write(schema, value);
}
writeDiscriminatedDocument(schema, value) {
this.byteSerializer.writeDiscriminatedDocument(schema, value);
}
flush() {
return (this.serdeContext?.utf8Encoder ?? toUtf8)(this.byteSerializer.flush());
}
}
import type { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import type { JsonSettings } from "../JsonCodec";
/**
* @public
*/
export declare class JsonShapeDeserializer extends SerdeContextConfig implements ShapeDeserializer<string> {
readonly settings: JsonSettings;
constructor(settings: JsonSettings);
read(schema: Schema, data: string | Uint8Array | unknown): Promise<any>;
readObject(schema: Schema, data: DocumentType): any;
protected _read(schema: Schema, value: unknown): any;
}
import { NormalizedSchema } from "@smithy/core/schema";
import type { Schema, ShapeSerializer } from "@smithy/types";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import type { JsonSettings } from "../JsonCodec";
/**
* @public
*/
export declare class JsonShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string> {
readonly settings: JsonSettings;
/**
* Write buffer. Reused per value serialization pass.
* In the initial implementation, this is not an incremental buffer.
*/
protected buffer: any;
protected useReplacer: boolean;
protected rootSchema: NormalizedSchema | undefined;
constructor(settings: JsonSettings);
write(schema: Schema, value: unknown): void;
flush(): string;
/**
* @internal
*/
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
/**
* Order if-statements by likelihood.
*/
protected _write(schema: Schema, value: unknown, container?: NormalizedSchema): any;
}
import type { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import type { JsonSettings } from "../JsonCodec";
/**
* Performance-optimized JSON deserializer.
*
* Skips UTF-8 decoding when the runtime supports JSON.parse(Buffer) (Node 22+).
*
* After JSON.parse, lists, maps, and document containers are mutated in place
* (element values are overwritten with their deserialized form) rather than
* copied into new arrays/objects. Structs allocate a fresh object because
* jsonName traits require key renaming, and building the output object
* incrementally lets V8 assign a stable hidden class rather than
* deoptimizing from repeated property deletion/addition on an existing shape.
*
* In-place mutation is safe here because the parsed tree is locally owned
* after JSON.parse with no external references, so rewriting values avoids
* redundant allocation and GC pressure.
*
* @internal
*/
export declare class BufferJsonShapeDeserializer extends SerdeContextConfig implements ShapeDeserializer<string> {
readonly settings: JsonSettings;
constructor(settings: JsonSettings);
read(schema: Schema, data: string | Uint8Array | unknown): Promise<any>;
readObject(schema: Schema, data: DocumentType): any;
protected _read(schema: Schema, value: unknown): any;
private _readStruct;
}
import type { Schema, ShapeSerializer } from "@smithy/types";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import type { JsonSettings } from "../JsonCodec";
/**
* Experimental single-pass JSON serializer that writes directly to a Uint8Array buffer.
* Fewer intermediate states as when compared to the initial multi-pass implementation.
*
* @internal
*/
export declare class ByteJsonShapeSerializer extends SerdeContextConfig implements ShapeSerializer<Uint8Array> {
readonly settings: JsonSettings;
private json;
private i;
private rootSchema;
constructor(settings: JsonSettings);
write(schema: Schema, value: unknown): void;
/**
* @internal
*/
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
/**
* Returns the serialized JSON as a Uint8Array (UTF-8 bytes).
* This is the primary output — pass directly to request.body.
*/
flush(): Uint8Array;
private ensure;
/**
* Write a raw ASCII string (no JSON escaping). Used for pre-validated content
* like numeric literals and pre-encoded base64.
*/
private writeAscii;
/**
* Write a quoted ASCII string with no escape checking.
* Used for struct member keys (jsonName or model names) which are
* guaranteed to be safe ASCII identifiers. No control chars, quotes,
* backslashes, or non-ASCII.
* Ensures extra room for surrounding structural chars (comma, colon).
*/
private writeAsciiQuoted;
/**
* Write a JSON-escaped string including the surrounding quotes.
* Fast-path for ASCII, falls back to TextEncoder for multi-byte.
*/
private writeJsonString;
private writeUnicodeEscape;
private static readonly B64;
/**
* Write a Uint8Array as a quoted base64 string directly into the buffer.
* No intermediate JS string, no escape checking (base64 alphabet is safe ASCII).
*/
private writeBase64;
private writeValue;
private writeStruct;
private writeList;
private writeMap;
private writeTimestamp;
}
/**
* A string adapter for the byte serializer, for backwards compatibility.
* @public
*/
export declare class StringJsonShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string> {
readonly settings: JsonSettings;
private byteSerializer;
constructor(settings: JsonSettings);
write(schema: Schema, value: unknown): void;
/**
* @internal
*/
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
flush(): string;
}
import { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import { JsonSettings } from "../JsonCodec";
export declare class JsonShapeDeserializer
extends SerdeContextConfig
implements ShapeDeserializer<string>
{
readonly settings: JsonSettings;
constructor(settings: JsonSettings);
read(schema: Schema, data: string | Uint8Array | unknown): Promise<any>;
readObject(schema: Schema, data: DocumentType): any;
protected _read(schema: Schema, value: unknown): any;
}
import { NormalizedSchema } from "@smithy/core/schema";
import { Schema, ShapeSerializer } from "@smithy/types";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import { JsonSettings } from "../JsonCodec";
export declare class JsonShapeSerializer
extends SerdeContextConfig
implements ShapeSerializer<string>
{
readonly settings: JsonSettings;
protected buffer: any;
protected useReplacer: boolean;
protected rootSchema: NormalizedSchema | undefined;
constructor(settings: JsonSettings);
write(schema: Schema, value: unknown): void;
flush(): string;
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
protected _write(schema: Schema, value: unknown, container?: NormalizedSchema): any;
}
import { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import { JsonSettings } from "../JsonCodec";
export declare class BufferJsonShapeDeserializer
extends SerdeContextConfig
implements ShapeDeserializer<string>
{
readonly settings: JsonSettings;
constructor(settings: JsonSettings);
read(schema: Schema, data: string | Uint8Array | unknown): Promise<any>;
readObject(schema: Schema, data: DocumentType): any;
protected _read(schema: Schema, value: unknown): any;
private _readStruct;
}
import { Schema, ShapeSerializer } from "@smithy/types";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import { JsonSettings } from "../JsonCodec";
export declare class ByteJsonShapeSerializer
extends SerdeContextConfig
implements ShapeSerializer<Uint8Array>
{
readonly settings: JsonSettings;
private json;
private i;
private rootSchema;
constructor(settings: JsonSettings);
write(schema: Schema, value: unknown): void;
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
flush(): Uint8Array;
private ensure;
private writeAscii;
private writeAsciiQuoted;
private writeJsonString;
private writeUnicodeEscape;
private static readonly B64;
private writeBase64;
private writeValue;
private writeStruct;
private writeList;
private writeMap;
private writeTimestamp;
}
export declare class StringJsonShapeSerializer
extends SerdeContextConfig
implements ShapeSerializer<string>
{
readonly settings: JsonSettings;
private byteSerializer;
constructor(settings: JsonSettings);
write(schema: Schema, value: unknown): void;
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
flush(): string;
}
+2
-2

@@ -8,4 +8,4 @@ export { AwsSmithyRpcV2CborProtocol } from "./cbor/AwsSmithyRpcV2CborProtocol";

export { JsonCodec } from "./json/JsonCodec";
export { JsonShapeDeserializer } from "./json/JsonShapeDeserializer";
export { JsonShapeSerializer } from "./json/JsonShapeSerializer";
export { JsonShapeDeserializer } from "./json/codec-v1/JsonShapeDeserializer";
export { JsonShapeSerializer } from "./json/codec-v1/JsonShapeSerializer";
export { awsExpectUnion } from "./json/awsExpectUnion";

@@ -12,0 +12,0 @@ export { parseJsonBody, parseJsonErrorBody, loadRestJsonErrorCode, loadJsonRpcErrorCode } from "./json/parseJsonBody";

import { SerdeContextConfig } from "../ConfigurableSerdeContext";
import { JsonShapeDeserializer } from "./JsonShapeDeserializer";
import { JsonShapeSerializer } from "./JsonShapeSerializer";
import { JsonShapeDeserializer } from "./codec-v1/JsonShapeDeserializer";
import { JsonShapeSerializer } from "./codec-v1/JsonShapeSerializer";
export class JsonCodec extends SerdeContextConfig {

@@ -5,0 +5,0 @@ settings;

@@ -9,4 +9,4 @@ export { AwsSmithyRpcV2CborProtocol } from "./cbor/AwsSmithyRpcV2CborProtocol";

export type { JsonSettings } from "./json/JsonCodec";
export { JsonShapeDeserializer } from "./json/JsonShapeDeserializer";
export { JsonShapeSerializer } from "./json/JsonShapeSerializer";
export { JsonShapeDeserializer } from "./json/codec-v1/JsonShapeDeserializer";
export { JsonShapeSerializer } from "./json/codec-v1/JsonShapeSerializer";
export { awsExpectUnion } from "./json/awsExpectUnion";

@@ -13,0 +13,0 @@ export { parseJsonBody, parseJsonErrorBody, loadRestJsonErrorCode, loadJsonRpcErrorCode } from "./json/parseJsonBody";

import type { Codec, CodecSettings } from "@smithy/types";
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
import { JsonShapeDeserializer } from "./JsonShapeDeserializer";
import { JsonShapeSerializer } from "./JsonShapeSerializer";
import { JsonShapeDeserializer } from "./codec-v1/JsonShapeDeserializer";
import { JsonShapeSerializer } from "./codec-v1/JsonShapeSerializer";
/**

@@ -6,0 +6,0 @@ * @public

@@ -5,4 +5,1 @@ export * from "./submodules/account-id-endpoint/index";

export * from "./submodules/protocols/index";
/**
* no need to export this.
*/

@@ -1,21 +0,61 @@

/**
* Exports here are from before the submodule system.
* They are exported from the package's root index to preserve backwards compatibility.
*
* New development should go in a proper submodule and not be exported from the root index.
* There is an eslint rule banning imports from `@aws-sdk/core` without a submodule e.g. `@aws-sdk/core/protocols`.
*
* CAUTION: Do not use export * here. Explicit named exports lock down the public API surface
* so that additions to submodules do not accidentally become part of the legacy root export.
*
* No additional exports are allowed.
*/
export { emitWarningIfUnsupportedVersion, getLongPollPlugin, setCredentialFeature, setFeature, setTokenFeature, state, } from "@aws-sdk/core/client";
export { AwsSdkSigV4ASigner, AwsSdkSigV4Signer, AwsSdkSigV4Signer as AWSSDKSigV4Signer, getBearerTokenEnvKey, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, NODE_SIGV4A_CONFIG_OPTIONS, resolveAwsSdkSigV4AConfig, resolveAwsSdkSigV4Config, resolveAwsSdkSigV4Config as resolveAWSSDKSigV4Config, validateSigningProperties, } from "@aws-sdk/core/httpAuthSchemes";
export { AwsSdkSigV4AAuthInputConfig, AwsSdkSigV4AAuthResolvedConfig, AwsSdkSigV4AAuthResolvedConfig as AwsSdkSigV4APreviouslyResolved, AwsSdkSigV4AuthInputConfig, AwsSdkSigV4AuthInputConfig as AWSSDKSigV4AuthInputConfig, AwsSdkSigV4AuthResolvedConfig, AwsSdkSigV4AuthResolvedConfig as AWSSDKSigV4AuthResolvedConfig, AwsSdkSigV4Memoized, AwsSdkSigV4AuthResolvedConfig as AwsSdkSigV4PreviouslyResolved, AwsSdkSigV4AuthResolvedConfig as AWSSDKSigV4PreviouslyResolved, } from "@aws-sdk/core/httpAuthSchemes";
export { _toBool, _toNum, _toStr, awsExpectUnion, AwsEc2QueryProtocol, AwsJson1_0Protocol, AwsJson1_1Protocol, AwsJsonRpcProtocol, AwsQueryProtocol, AwsRestJsonProtocol, AwsRestXmlProtocol, AwsSmithyRpcV2CborProtocol, JsonCodec, JsonShapeDeserializer, JsonShapeSerializer, loadJsonRpcErrorCode, loadRestJsonErrorCode, loadRestXmlErrorCode, parseJsonBody, parseJsonErrorBody, parseXmlBody, parseXmlErrorBody, QueryShapeSerializer, XmlCodec, XmlShapeDeserializer, XmlShapeSerializer, } from "@aws-sdk/core/protocols";
export {
emitWarningIfUnsupportedVersion,
getLongPollPlugin,
setCredentialFeature,
setFeature,
setTokenFeature,
state,
} from "@aws-sdk/core/client";
export {
AwsSdkSigV4ASigner,
AwsSdkSigV4Signer,
AwsSdkSigV4Signer as AWSSDKSigV4Signer,
getBearerTokenEnvKey,
NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,
NODE_SIGV4A_CONFIG_OPTIONS,
resolveAwsSdkSigV4AConfig,
resolveAwsSdkSigV4Config,
resolveAwsSdkSigV4Config as resolveAWSSDKSigV4Config,
validateSigningProperties,
} from "@aws-sdk/core/httpAuthSchemes";
export {
AwsSdkSigV4AAuthInputConfig,
AwsSdkSigV4AAuthResolvedConfig,
AwsSdkSigV4AAuthResolvedConfig as AwsSdkSigV4APreviouslyResolved,
AwsSdkSigV4AuthInputConfig,
AwsSdkSigV4AuthInputConfig as AWSSDKSigV4AuthInputConfig,
AwsSdkSigV4AuthResolvedConfig,
AwsSdkSigV4AuthResolvedConfig as AWSSDKSigV4AuthResolvedConfig,
AwsSdkSigV4Memoized,
AwsSdkSigV4AuthResolvedConfig as AwsSdkSigV4PreviouslyResolved,
AwsSdkSigV4AuthResolvedConfig as AWSSDKSigV4PreviouslyResolved,
} from "@aws-sdk/core/httpAuthSchemes";
export {
_toBool,
_toNum,
_toStr,
awsExpectUnion,
AwsEc2QueryProtocol,
AwsJson1_0Protocol,
AwsJson1_1Protocol,
AwsJsonRpcProtocol,
AwsQueryProtocol,
AwsRestJsonProtocol,
AwsRestXmlProtocol,
AwsSmithyRpcV2CborProtocol,
JsonCodec,
JsonShapeDeserializer,
JsonShapeSerializer,
loadJsonRpcErrorCode,
loadRestJsonErrorCode,
loadRestXmlErrorCode,
parseJsonBody,
parseJsonErrorBody,
parseXmlBody,
parseXmlErrorBody,
QueryShapeSerializer,
XmlCodec,
XmlShapeDeserializer,
XmlShapeSerializer,
} from "@aws-sdk/core/protocols";
export { JsonSettings, QuerySerializerSettings, XmlSettings } from "@aws-sdk/core/protocols";
/**
* WARNING: do not export any additional submodules from the root of this package. See readme.md for
* guide on developing submodules.
*/
import { Provider } from "@smithy/types";
import { AccountIdEndpointMode } from "./AccountIdEndpointModeConstants";
/**
* @public
*/
export interface AccountIdEndpointModeInputConfig {
/**
* The account ID endpoint mode to use.
*/
accountIdEndpointMode?: AccountIdEndpointMode | Provider<AccountIdEndpointMode>;
accountIdEndpointMode?: AccountIdEndpointMode | Provider<AccountIdEndpointMode>;
}
/**
* @internal
*/
interface PreviouslyResolved {
}
/**
* @internal
*/
interface PreviouslyResolved {}
export interface AccountIdEndpointModeResolvedConfig {
accountIdEndpointMode: Provider<AccountIdEndpointMode>;
accountIdEndpointMode: Provider<AccountIdEndpointMode>;
}
/**
* @internal
*/
export declare const resolveAccountIdEndpointModeConfig: <T>(input: T & AccountIdEndpointModeInputConfig & PreviouslyResolved) => T & AccountIdEndpointModeResolvedConfig;
export declare const resolveAccountIdEndpointModeConfig: <T>(
input: T & AccountIdEndpointModeInputConfig & PreviouslyResolved,
) => T & AccountIdEndpointModeResolvedConfig;
export {};

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

/**
* @public
*/
export type AccountIdEndpointMode = "disabled" | "preferred" | "required";
/**
* @internal
*/
export declare const DEFAULT_ACCOUNT_ID_ENDPOINT_MODE = "preferred";
/**
* @internal
*/
export declare const ACCOUNT_ID_ENDPOINT_MODE_VALUES: AccountIdEndpointMode[];
/**
* @internal
*/
export declare function validateAccountIdEndpointMode(value: any): value is AccountIdEndpointMode;
export { resolveAccountIdEndpointModeConfig } from "./AccountIdEndpointModeConfigResolver";
export { AccountIdEndpointModeInputConfig, AccountIdEndpointModeResolvedConfig, } from "./AccountIdEndpointModeConfigResolver";
export { DEFAULT_ACCOUNT_ID_ENDPOINT_MODE, ACCOUNT_ID_ENDPOINT_MODE_VALUES, validateAccountIdEndpointMode, } from "./AccountIdEndpointModeConstants";
export {
AccountIdEndpointModeInputConfig,
AccountIdEndpointModeResolvedConfig,
} from "./AccountIdEndpointModeConfigResolver";
export {
DEFAULT_ACCOUNT_ID_ENDPOINT_MODE,
ACCOUNT_ID_ENDPOINT_MODE_VALUES,
validateAccountIdEndpointMode,
} from "./AccountIdEndpointModeConstants";
export { AccountIdEndpointMode } from "./AccountIdEndpointModeConstants";
export { ENV_ACCOUNT_ID_ENDPOINT_MODE, CONFIG_ACCOUNT_ID_ENDPOINT_MODE, NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS, } from "./NodeAccountIdEndpointModeConfigOptions";
export {
ENV_ACCOUNT_ID_ENDPOINT_MODE,
CONFIG_ACCOUNT_ID_ENDPOINT_MODE,
NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS,
} from "./NodeAccountIdEndpointModeConfigOptions";
import { LoadedConfigSelectors } from "@smithy/core/config";
import { AccountIdEndpointMode } from "./AccountIdEndpointModeConstants";
/**
* @internal
*/
export declare const ENV_ACCOUNT_ID_ENDPOINT_MODE = "AWS_ACCOUNT_ID_ENDPOINT_MODE";
/**
* @internal
*/
export declare const CONFIG_ACCOUNT_ID_ENDPOINT_MODE = "account_id_endpoint_mode";
/**
* @internal
*/
export declare const NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS: LoadedConfigSelectors<AccountIdEndpointMode>;
export declare const state: {
warningEmitted: boolean;
warningEmitted: boolean;
};
/**
* Emits warning if the provided Node.js version string is
* pending deprecation by AWS SDK JSv3.
* @internal
*
* @param version - The Node.js version string.
*/
export declare const emitWarningIfUnsupportedVersion: (version: string) => void;

@@ -7,5 +7,17 @@ export declare const emitWarningIfUnsupportedVersion: symbol;

export { setTokenFeature } from "./setTokenFeature";
export { hostHeaderMiddleware, hostHeaderMiddlewareOptions, getHostHeaderPlugin, resolveHostHeaderConfig, } from "./middleware-host-header/hostHeaderMiddleware";
export { HostHeaderInputConfig, HostHeaderResolvedConfig } from "./middleware-host-header/hostHeaderMiddleware";
export { loggerMiddleware, loggerMiddlewareOptions, getLoggerPlugin } from "./middleware-logger/loggerMiddleware";
export {
hostHeaderMiddleware,
hostHeaderMiddlewareOptions,
getHostHeaderPlugin,
resolveHostHeaderConfig,
} from "./middleware-host-header/hostHeaderMiddleware";
export {
HostHeaderInputConfig,
HostHeaderResolvedConfig,
} from "./middleware-host-header/hostHeaderMiddleware";
export {
loggerMiddleware,
loggerMiddlewareOptions,
getLoggerPlugin,
} from "./middleware-logger/loggerMiddleware";
export { recursionDetectionMiddlewareOptions } from "./middleware-recursion-detection/configuration";

@@ -15,7 +27,21 @@ export { getRecursionDetectionPlugin } from "./middleware-recursion-detection/getRecursionDetectionPlugin.browser";

export { DEFAULT_UA_APP_ID, resolveUserAgentConfig } from "./middleware-user-agent/configurations";
export { UserAgentInputConfig, UserAgentResolvedConfig } from "./middleware-user-agent/configurations";
export { userAgentMiddleware, getUserAgentMiddlewareOptions, getUserAgentPlugin, } from "./middleware-user-agent/user-agent-middleware";
export { createDefaultUserAgentProvider, defaultUserAgent, fallback } from "./util-user-agent-browser/defaultUserAgent";
export {
UserAgentInputConfig,
UserAgentResolvedConfig,
} from "./middleware-user-agent/configurations";
export {
userAgentMiddleware,
getUserAgentMiddlewareOptions,
getUserAgentPlugin,
} from "./middleware-user-agent/user-agent-middleware";
export {
createDefaultUserAgentProvider,
defaultUserAgent,
fallback,
} from "./util-user-agent-browser/defaultUserAgent";
export declare const crtAvailability: symbol;
export { DefaultUserAgentOptions, PreviouslyResolved } from "./util-user-agent-node/defaultUserAgent";
export {
DefaultUserAgentOptions,
PreviouslyResolved,
} from "./util-user-agent-node/defaultUserAgent";
export declare const NODE_APP_ID_CONFIG_OPTIONS: symbol;

@@ -27,15 +53,46 @@ export declare const UA_APP_ID_ENV_NAME: symbol;

export { resolveEndpoint } from "./util-endpoints/resolveEndpoint";
export { resolveDefaultAwsRegionalEndpointsConfig, toEndpointV1, } from "./util-endpoints/resolveDefaultAwsRegionalEndpointsConfig";
export { DefaultAwsRegionalEndpointsInputConfig, DefaultAwsRegionalEndpointsResolvedConfig, } from "./util-endpoints/resolveDefaultAwsRegionalEndpointsConfig";
export {
resolveDefaultAwsRegionalEndpointsConfig,
toEndpointV1,
} from "./util-endpoints/resolveDefaultAwsRegionalEndpointsConfig";
export {
DefaultAwsRegionalEndpointsInputConfig,
DefaultAwsRegionalEndpointsResolvedConfig,
} from "./util-endpoints/resolveDefaultAwsRegionalEndpointsConfig";
export { isIpAddress } from "./util-endpoints/lib/isIpAddress";
export { isVirtualHostableS3Bucket } from "./util-endpoints/lib/aws/isVirtualHostableS3Bucket";
export { parseArn } from "./util-endpoints/lib/aws/parseArn";
export { partition, setPartitionInfo, useDefaultPartitionInfo, getUserAgentPrefix, } from "./util-endpoints/lib/aws/partition";
export {
partition,
setPartitionInfo,
useDefaultPartitionInfo,
getUserAgentPrefix,
} from "./util-endpoints/lib/aws/partition";
export { PartitionsInfo } from "./util-endpoints/lib/aws/partition";
export { EndpointError } from "./util-endpoints/types/EndpointError";
export { EndpointObjectProperties, EndpointObjectHeaders, EndpointObject, EndpointRuleObject, } from "./util-endpoints/types/EndpointRuleObject";
export {
EndpointObjectProperties,
EndpointObjectHeaders,
EndpointObject,
EndpointRuleObject,
} from "./util-endpoints/types/EndpointRuleObject";
export { ErrorRuleObject } from "./util-endpoints/types/ErrorRuleObject";
export { RuleSetRules, TreeRuleObject } from "./util-endpoints/types/TreeRuleObject";
export { DeprecatedObject, ParameterObject, RuleSetObject } from "./util-endpoints/types/RuleSetObject";
export { ReferenceObject, FunctionObject, FunctionArgv, FunctionReturn, ConditionObject, Expression, EndpointParams, EndpointResolverOptions, ReferenceRecord, EvaluateOptions, } from "./util-endpoints/types/shared";
export {
DeprecatedObject,
ParameterObject,
RuleSetObject,
} from "./util-endpoints/types/RuleSetObject";
export {
ReferenceObject,
FunctionObject,
FunctionArgv,
FunctionReturn,
ConditionObject,
Expression,
EndpointParams,
EndpointResolverOptions,
ReferenceRecord,
EvaluateOptions,
} from "./util-endpoints/types/shared";
export declare const REGION_ENV_NAME: symbol;

@@ -49,3 +106,6 @@ export declare const REGION_INI_NAME: symbol;

export declare const stsRegionWarning: symbol;
export { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "./region-config-resolver/extensions";
export {
getAwsRegionExtensionConfiguration,
resolveAwsRegionExtensionConfiguration,
} from "./region-config-resolver/extensions";
export { RegionExtensionRuntimeConfigType } from "./region-config-resolver/extensions";

@@ -6,5 +6,17 @@ export { emitWarningIfUnsupportedVersion, state } from "./emitWarningIfUnsupportedVersion";

export { setTokenFeature } from "./setTokenFeature";
export { hostHeaderMiddleware, hostHeaderMiddlewareOptions, getHostHeaderPlugin, resolveHostHeaderConfig, } from "./middleware-host-header/hostHeaderMiddleware";
export { HostHeaderInputConfig, HostHeaderResolvedConfig } from "./middleware-host-header/hostHeaderMiddleware";
export { loggerMiddleware, loggerMiddlewareOptions, getLoggerPlugin } from "./middleware-logger/loggerMiddleware";
export {
hostHeaderMiddleware,
hostHeaderMiddlewareOptions,
getHostHeaderPlugin,
resolveHostHeaderConfig,
} from "./middleware-host-header/hostHeaderMiddleware";
export {
HostHeaderInputConfig,
HostHeaderResolvedConfig,
} from "./middleware-host-header/hostHeaderMiddleware";
export {
loggerMiddleware,
loggerMiddlewareOptions,
getLoggerPlugin,
} from "./middleware-logger/loggerMiddleware";
export { recursionDetectionMiddlewareOptions } from "./middleware-recursion-detection/configuration";

@@ -14,7 +26,25 @@ export { getRecursionDetectionPlugin } from "./middleware-recursion-detection/getRecursionDetectionPlugin";

export { DEFAULT_UA_APP_ID, resolveUserAgentConfig } from "./middleware-user-agent/configurations";
export { UserAgentInputConfig, UserAgentResolvedConfig } from "./middleware-user-agent/configurations";
export { userAgentMiddleware, getUserAgentMiddlewareOptions, getUserAgentPlugin, } from "./middleware-user-agent/user-agent-middleware";
export { createDefaultUserAgentProvider, defaultUserAgent, crtAvailability, } from "./util-user-agent-node/defaultUserAgent";
export { DefaultUserAgentOptions, PreviouslyResolved } from "./util-user-agent-node/defaultUserAgent";
export { NODE_APP_ID_CONFIG_OPTIONS, UA_APP_ID_ENV_NAME, UA_APP_ID_INI_NAME, } from "./util-user-agent-node/nodeAppIdConfigOptions";
export {
UserAgentInputConfig,
UserAgentResolvedConfig,
} from "./middleware-user-agent/configurations";
export {
userAgentMiddleware,
getUserAgentMiddlewareOptions,
getUserAgentPlugin,
} from "./middleware-user-agent/user-agent-middleware";
export {
createDefaultUserAgentProvider,
defaultUserAgent,
crtAvailability,
} from "./util-user-agent-node/defaultUserAgent";
export {
DefaultUserAgentOptions,
PreviouslyResolved,
} from "./util-user-agent-node/defaultUserAgent";
export {
NODE_APP_ID_CONFIG_OPTIONS,
UA_APP_ID_ENV_NAME,
UA_APP_ID_INI_NAME,
} from "./util-user-agent-node/nodeAppIdConfigOptions";
export { fallback } from "./util-user-agent-browser/defaultUserAgent";

@@ -24,19 +54,62 @@ export { createUserAgentStringParsingProvider } from "./util-user-agent-browser/createUserAgentStringParsingProvider";

export { resolveEndpoint } from "./util-endpoints/resolveEndpoint";
export { resolveDefaultAwsRegionalEndpointsConfig, toEndpointV1, } from "./util-endpoints/resolveDefaultAwsRegionalEndpointsConfig";
export { DefaultAwsRegionalEndpointsInputConfig, DefaultAwsRegionalEndpointsResolvedConfig, } from "./util-endpoints/resolveDefaultAwsRegionalEndpointsConfig";
export {
resolveDefaultAwsRegionalEndpointsConfig,
toEndpointV1,
} from "./util-endpoints/resolveDefaultAwsRegionalEndpointsConfig";
export {
DefaultAwsRegionalEndpointsInputConfig,
DefaultAwsRegionalEndpointsResolvedConfig,
} from "./util-endpoints/resolveDefaultAwsRegionalEndpointsConfig";
export { isIpAddress } from "./util-endpoints/lib/isIpAddress";
export { isVirtualHostableS3Bucket } from "./util-endpoints/lib/aws/isVirtualHostableS3Bucket";
export { parseArn } from "./util-endpoints/lib/aws/parseArn";
export { partition, setPartitionInfo, useDefaultPartitionInfo, getUserAgentPrefix, } from "./util-endpoints/lib/aws/partition";
export {
partition,
setPartitionInfo,
useDefaultPartitionInfo,
getUserAgentPrefix,
} from "./util-endpoints/lib/aws/partition";
export { PartitionsInfo } from "./util-endpoints/lib/aws/partition";
export { EndpointError } from "./util-endpoints/types/EndpointError";
export { EndpointObjectProperties, EndpointObjectHeaders, EndpointObject, EndpointRuleObject, } from "./util-endpoints/types/EndpointRuleObject";
export {
EndpointObjectProperties,
EndpointObjectHeaders,
EndpointObject,
EndpointRuleObject,
} from "./util-endpoints/types/EndpointRuleObject";
export { ErrorRuleObject } from "./util-endpoints/types/ErrorRuleObject";
export { RuleSetRules, TreeRuleObject } from "./util-endpoints/types/TreeRuleObject";
export { DeprecatedObject, ParameterObject, RuleSetObject } from "./util-endpoints/types/RuleSetObject";
export { ReferenceObject, FunctionObject, FunctionArgv, FunctionReturn, ConditionObject, Expression, EndpointParams, EndpointResolverOptions, ReferenceRecord, EvaluateOptions, } from "./util-endpoints/types/shared";
export { REGION_ENV_NAME, REGION_INI_NAME, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, resolveRegionConfig, } from "./region-config-resolver/awsRegionConfig";
export {
DeprecatedObject,
ParameterObject,
RuleSetObject,
} from "./util-endpoints/types/RuleSetObject";
export {
ReferenceObject,
FunctionObject,
FunctionArgv,
FunctionReturn,
ConditionObject,
Expression,
EndpointParams,
EndpointResolverOptions,
ReferenceRecord,
EvaluateOptions,
} from "./util-endpoints/types/shared";
export {
REGION_ENV_NAME,
REGION_INI_NAME,
NODE_REGION_CONFIG_OPTIONS,
NODE_REGION_CONFIG_FILE_OPTIONS,
resolveRegionConfig,
} from "./region-config-resolver/awsRegionConfig";
export { RegionInputConfig, RegionResolvedConfig } from "./region-config-resolver/awsRegionConfig";
export { stsRegionDefaultResolver, warning as stsRegionWarning, } from "./region-config-resolver/stsRegionDefaultResolver";
export { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "./region-config-resolver/extensions";
export {
stsRegionDefaultResolver,
warning as stsRegionWarning,
} from "./region-config-resolver/stsRegionDefaultResolver";
export {
getAwsRegionExtensionConfiguration,
resolveAwsRegionExtensionConfiguration,
} from "./region-config-resolver/extensions";
export { RegionExtensionRuntimeConfigType } from "./region-config-resolver/extensions";

@@ -7,5 +7,17 @@ export declare const emitWarningIfUnsupportedVersion: symbol;

export { setTokenFeature } from "./setTokenFeature";
export { hostHeaderMiddleware, hostHeaderMiddlewareOptions, getHostHeaderPlugin, resolveHostHeaderConfig, } from "./middleware-host-header/hostHeaderMiddleware";
export { HostHeaderInputConfig, HostHeaderResolvedConfig } from "./middleware-host-header/hostHeaderMiddleware";
export { loggerMiddleware, loggerMiddlewareOptions, getLoggerPlugin } from "./middleware-logger/loggerMiddleware";
export {
hostHeaderMiddleware,
hostHeaderMiddlewareOptions,
getHostHeaderPlugin,
resolveHostHeaderConfig,
} from "./middleware-host-header/hostHeaderMiddleware";
export {
HostHeaderInputConfig,
HostHeaderResolvedConfig,
} from "./middleware-host-header/hostHeaderMiddleware";
export {
loggerMiddleware,
loggerMiddlewareOptions,
getLoggerPlugin,
} from "./middleware-logger/loggerMiddleware";
export { recursionDetectionMiddlewareOptions } from "./middleware-recursion-detection/configuration";

@@ -15,7 +27,20 @@ export { getRecursionDetectionPlugin } from "./middleware-recursion-detection/getRecursionDetectionPlugin.browser";

export { DEFAULT_UA_APP_ID, resolveUserAgentConfig } from "./middleware-user-agent/configurations";
export { UserAgentInputConfig, UserAgentResolvedConfig } from "./middleware-user-agent/configurations";
export { userAgentMiddleware, getUserAgentMiddlewareOptions, getUserAgentPlugin, } from "./middleware-user-agent/user-agent-middleware";
export { createDefaultUserAgentProvider, defaultUserAgent } from "./util-user-agent-browser/defaultUserAgent.native";
export {
UserAgentInputConfig,
UserAgentResolvedConfig,
} from "./middleware-user-agent/configurations";
export {
userAgentMiddleware,
getUserAgentMiddlewareOptions,
getUserAgentPlugin,
} from "./middleware-user-agent/user-agent-middleware";
export {
createDefaultUserAgentProvider,
defaultUserAgent,
} from "./util-user-agent-browser/defaultUserAgent.native";
export declare const crtAvailability: symbol;
export { DefaultUserAgentOptions, PreviouslyResolved } from "./util-user-agent-node/defaultUserAgent";
export {
DefaultUserAgentOptions,
PreviouslyResolved,
} from "./util-user-agent-node/defaultUserAgent";
export declare const NODE_APP_ID_CONFIG_OPTIONS: symbol;

@@ -28,15 +53,46 @@ export declare const UA_APP_ID_ENV_NAME: symbol;

export { resolveEndpoint } from "./util-endpoints/resolveEndpoint";
export { resolveDefaultAwsRegionalEndpointsConfig, toEndpointV1, } from "./util-endpoints/resolveDefaultAwsRegionalEndpointsConfig";
export { DefaultAwsRegionalEndpointsInputConfig, DefaultAwsRegionalEndpointsResolvedConfig, } from "./util-endpoints/resolveDefaultAwsRegionalEndpointsConfig";
export {
resolveDefaultAwsRegionalEndpointsConfig,
toEndpointV1,
} from "./util-endpoints/resolveDefaultAwsRegionalEndpointsConfig";
export {
DefaultAwsRegionalEndpointsInputConfig,
DefaultAwsRegionalEndpointsResolvedConfig,
} from "./util-endpoints/resolveDefaultAwsRegionalEndpointsConfig";
export { isIpAddress } from "./util-endpoints/lib/isIpAddress";
export { isVirtualHostableS3Bucket } from "./util-endpoints/lib/aws/isVirtualHostableS3Bucket";
export { parseArn } from "./util-endpoints/lib/aws/parseArn";
export { partition, setPartitionInfo, useDefaultPartitionInfo, getUserAgentPrefix, } from "./util-endpoints/lib/aws/partition";
export {
partition,
setPartitionInfo,
useDefaultPartitionInfo,
getUserAgentPrefix,
} from "./util-endpoints/lib/aws/partition";
export { PartitionsInfo } from "./util-endpoints/lib/aws/partition";
export { EndpointError } from "./util-endpoints/types/EndpointError";
export { EndpointObjectProperties, EndpointObjectHeaders, EndpointObject, EndpointRuleObject, } from "./util-endpoints/types/EndpointRuleObject";
export {
EndpointObjectProperties,
EndpointObjectHeaders,
EndpointObject,
EndpointRuleObject,
} from "./util-endpoints/types/EndpointRuleObject";
export { ErrorRuleObject } from "./util-endpoints/types/ErrorRuleObject";
export { RuleSetRules, TreeRuleObject } from "./util-endpoints/types/TreeRuleObject";
export { DeprecatedObject, ParameterObject, RuleSetObject } from "./util-endpoints/types/RuleSetObject";
export { ReferenceObject, FunctionObject, FunctionArgv, FunctionReturn, ConditionObject, Expression, EndpointParams, EndpointResolverOptions, ReferenceRecord, EvaluateOptions, } from "./util-endpoints/types/shared";
export {
DeprecatedObject,
ParameterObject,
RuleSetObject,
} from "./util-endpoints/types/RuleSetObject";
export {
ReferenceObject,
FunctionObject,
FunctionArgv,
FunctionReturn,
ConditionObject,
Expression,
EndpointParams,
EndpointResolverOptions,
ReferenceRecord,
EvaluateOptions,
} from "./util-endpoints/types/shared";
export declare const REGION_ENV_NAME: symbol;

@@ -50,3 +106,6 @@ export declare const REGION_INI_NAME: symbol;

export declare const stsRegionWarning: symbol;
export { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "./region-config-resolver/extensions";
export {
getAwsRegionExtensionConfiguration,
resolveAwsRegionExtensionConfiguration,
} from "./region-config-resolver/extensions";
export { RegionExtensionRuntimeConfigType } from "./region-config-resolver/extensions";

@@ -1,14 +0,13 @@

import { HandlerExecutionContext, InitializeHandler, InitializeHandlerOptions, MetadataBearer, Pluggable } from "@smithy/types";
/**
* This middleware is attached to operations designated as long-polling.
* @internal
*/
export declare const longPollMiddleware: () => <Output extends MetadataBearer = MetadataBearer>(next: InitializeHandler<any, Output>, context: HandlerExecutionContext) => InitializeHandler<any, Output>;
/**
* @internal
*/
import {
HandlerExecutionContext,
InitializeHandler,
InitializeHandlerOptions,
MetadataBearer,
Pluggable,
} from "@smithy/types";
export declare const longPollMiddleware: () => <Output extends MetadataBearer = MetadataBearer>(
next: InitializeHandler<any, Output>,
context: HandlerExecutionContext,
) => InitializeHandler<any, Output>;
export declare const longPollMiddlewareOptions: InitializeHandlerOptions;
/**
* @internal
*/
export declare const getLongPollPlugin: (options: {}) => Pluggable<any, any>;

@@ -1,35 +0,25 @@

import { AbsoluteLocation, BuildHandlerOptions, BuildMiddleware, Pluggable, RequestHandler } from "@smithy/types";
/**
* @public
*/
export interface HostHeaderInputConfig {
}
import {
AbsoluteLocation,
BuildHandlerOptions,
BuildMiddleware,
Pluggable,
RequestHandler,
} from "@smithy/types";
export interface HostHeaderInputConfig {}
interface PreviouslyResolved {
requestHandler: RequestHandler<any, any>;
requestHandler: RequestHandler<any, any>;
}
/**
* @internal
*/
export interface HostHeaderResolvedConfig {
/**
* The HTTP handler to use. Fetch in browser and Https in Nodejs.
*/
requestHandler: RequestHandler<any, any>;
requestHandler: RequestHandler<any, any>;
}
/**
* @internal
*/
export declare function resolveHostHeaderConfig<T>(input: T & PreviouslyResolved & HostHeaderInputConfig): T & HostHeaderResolvedConfig;
/**
* @internal
*/
export declare const hostHeaderMiddleware: <Input extends object, Output extends object>(options: HostHeaderResolvedConfig) => BuildMiddleware<Input, Output>;
/**
* @internal
*/
export declare function resolveHostHeaderConfig<T>(
input: T & PreviouslyResolved & HostHeaderInputConfig,
): T & HostHeaderResolvedConfig;
export declare const hostHeaderMiddleware: <Input extends object, Output extends object>(
options: HostHeaderResolvedConfig,
) => BuildMiddleware<Input, Output>;
export declare const hostHeaderMiddlewareOptions: BuildHandlerOptions & AbsoluteLocation;
/**
* @internal
*/
export declare const getHostHeaderPlugin: (options: HostHeaderResolvedConfig) => Pluggable<any, any>;
export declare const getHostHeaderPlugin: (
options: HostHeaderResolvedConfig,
) => Pluggable<any, any>;
export {};

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

import { AbsoluteLocation, HandlerExecutionContext, InitializeHandler, InitializeHandlerOptions, MetadataBearer, Pluggable } from "@smithy/types";
export declare const loggerMiddleware: () => <Output extends MetadataBearer = MetadataBearer>(next: InitializeHandler<any, Output>, context: HandlerExecutionContext) => InitializeHandler<any, Output>;
import {
AbsoluteLocation,
HandlerExecutionContext,
InitializeHandler,
InitializeHandlerOptions,
MetadataBearer,
Pluggable,
} from "@smithy/types";
export declare const loggerMiddleware: () => <Output extends MetadataBearer = MetadataBearer>(
next: InitializeHandler<any, Output>,
context: HandlerExecutionContext,
) => InitializeHandler<any, Output>;
export declare const loggerMiddlewareOptions: InitializeHandlerOptions & AbsoluteLocation;
export declare const getLoggerPlugin: (options: any) => Pluggable<any, any>;
import { AbsoluteLocation, BuildHandlerOptions } from "@smithy/types";
/**
* Used in conjunction with Lambda invoke store.
* @internal
*/
export declare const recursionDetectionMiddlewareOptions: BuildHandlerOptions & AbsoluteLocation;
import { Pluggable } from "@smithy/types";
/**
* @internal
*/
export declare const getRecursionDetectionPlugin: (options: any) => Pluggable<any, any>;
import { Pluggable } from "@smithy/types";
/**
* @internal
*/
export declare const getRecursionDetectionPlugin: (options: any) => Pluggable<any, any>;
import { BuildMiddleware } from "@smithy/types";
/**
* No-op middleware for runtimes outside of Node.js
* @internal
*/
export declare const recursionDetectionMiddleware: () => BuildMiddleware<any, any>;
import { BuildMiddleware } from "@smithy/types";
/**
* Used for two Lambda-related responsibilities:
* - Inject to trace ID to request header to detect recursion invocation in Lambda.
* - Propagate W3C trace context headers from
* the Lambda InvokeStore onto outbound requests, enabling distributed trace
* context to flow to downstream calls without creating any spans.
* @internal
*/
export declare const recursionDetectionMiddleware: () => BuildMiddleware<any, any>;
import { BuildMiddleware } from "@smithy/types";
/**
* No-op middleware for runtimes outside of Node.js
* @internal
*/
export declare const recursionDetectionMiddleware: () => BuildMiddleware<any, any>;
import { AccountIdEndpointMode } from "@aws-sdk/core/account-id-endpoint";
import { AwsHandlerExecutionContext } from "@aws-sdk/types";
import { AwsCredentialIdentityProvider, BuildHandlerArguments, Provider } from "@smithy/types";
/**
* @internal
*/
type PreviouslyResolved = Partial<{
credentials?: AwsCredentialIdentityProvider;
accountIdEndpointMode?: Provider<AccountIdEndpointMode>;
retryStrategy?: Provider<{
mode?: string;
}>;
credentials?: AwsCredentialIdentityProvider;
accountIdEndpointMode?: Provider<AccountIdEndpointMode>;
retryStrategy?: Provider<{
mode?: string;
}>;
}>;
/**
* @internal
* Check for features that don't have a middleware activation site but
* may be detected on the context, client config, or request.
*/
export declare function checkFeatures(context: AwsHandlerExecutionContext, config: PreviouslyResolved, args: BuildHandlerArguments<any>): Promise<void>;
export declare function checkFeatures(
context: AwsHandlerExecutionContext,
config: PreviouslyResolved,
args: BuildHandlerArguments<any>,
): Promise<void>;
export {};
import { Logger, Provider, UserAgent } from "@smithy/types";
/**
* @internal
*/
export declare const DEFAULT_UA_APP_ID: undefined;
/**
* @public
*/
export interface UserAgentInputConfig {
/**
* The custom user agent header that would be appended to default one
*/
customUserAgent?: string | UserAgent;
/**
* The application ID used to identify the application.
*/
userAgentAppId?: string | undefined | Provider<string | undefined>;
customUserAgent?: string | UserAgent;
userAgentAppId?: string | undefined | Provider<string | undefined>;
}
interface PreviouslyResolved {
defaultUserAgentProvider: Provider<UserAgent>;
runtime: string;
logger?: Logger;
defaultUserAgentProvider: Provider<UserAgent>;
runtime: string;
logger?: Logger;
}
export interface UserAgentResolvedConfig {
/**
* The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header.
* @internal
*/
defaultUserAgentProvider: Provider<UserAgent>;
/**
* The custom user agent header that would be appended to default one
*/
customUserAgent?: UserAgent;
/**
* The runtime environment
*/
runtime: string;
/**
* Resolved value for input config {config.userAgentAppId}
*/
userAgentAppId: Provider<string | undefined>;
defaultUserAgentProvider: Provider<UserAgent>;
customUserAgent?: UserAgent;
runtime: string;
userAgentAppId: Provider<string | undefined>;
}
export declare function resolveUserAgentConfig<T>(input: T & PreviouslyResolved & UserAgentInputConfig): T & UserAgentResolvedConfig;
export declare function resolveUserAgentConfig<T>(
input: T & PreviouslyResolved & UserAgentInputConfig,
): T & UserAgentResolvedConfig;
export {};
import { AwsSdkFeatures } from "@aws-sdk/types";
/**
* @internal
*/
export declare function encodeFeatures(features: AwsSdkFeatures): string;
import { AwsHandlerExecutionContext } from "@aws-sdk/types";
import { AbsoluteLocation, BuildHandler, BuildHandlerOptions, HandlerExecutionContext, MetadataBearer, Pluggable } from "@smithy/types";
import {
AbsoluteLocation,
BuildHandler,
BuildHandlerOptions,
HandlerExecutionContext,
MetadataBearer,
Pluggable,
} from "@smithy/types";
import { UserAgentResolvedConfig } from "./configurations";
/**
* Build user agent header sections from:
* 1. runtime-specific default user agent provider;
* 2. custom user agent from `customUserAgent` client config;
* 3. handler execution context set by internal SDK components;
* The built user agent will be set to `x-amz-user-agent` header for ALL the
* runtimes.
* Please note that any override to the `user-agent` or `x-amz-user-agent` header
* in the HTTP request is discouraged. Please use `customUserAgent` client
* config or middleware setting the `userAgent` context to generate desired user
* agent.
*/
export declare const userAgentMiddleware: (options: UserAgentResolvedConfig) => <Output extends MetadataBearer>(next: BuildHandler<any, any>, context: HandlerExecutionContext | AwsHandlerExecutionContext) => BuildHandler<any, any>;
export declare const userAgentMiddleware: (
options: UserAgentResolvedConfig,
) => <Output extends MetadataBearer>(
next: BuildHandler<any, any>,
context: HandlerExecutionContext | AwsHandlerExecutionContext,
) => BuildHandler<any, any>;
export declare const getUserAgentMiddlewareOptions: BuildHandlerOptions & AbsoluteLocation;
export declare const getUserAgentPlugin: (config: UserAgentResolvedConfig) => Pluggable<any, any>;

@@ -1,11 +0,8 @@

/**
* Backward compatibility re-export alias.
* @internal
*/
export { REGION_ENV_NAME, REGION_INI_NAME, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, } from "@smithy/core/config";
export {
REGION_ENV_NAME,
REGION_INI_NAME,
NODE_REGION_CONFIG_OPTIONS,
NODE_REGION_CONFIG_FILE_OPTIONS,
} from "@smithy/core/config";
export { RegionInputConfig, RegionResolvedConfig } from "@smithy/core/config";
/**
* Backward compatibility re-export alias.
* @internal
*/
export { resolveRegionConfig } from "@smithy/core/config";
import { AwsRegionExtensionConfiguration } from "@aws-sdk/types";
import { Provider } from "@smithy/types";
export type RegionExtensionRuntimeConfigType = Partial<{
region: string | Provider<string>;
region: string | Provider<string>;
}>;
/**
* @internal
*/
export declare const getAwsRegionExtensionConfiguration: (runtimeConfig: RegionExtensionRuntimeConfigType) => {
setRegion(region: Provider<string>): void;
region(): Provider<string>;
export declare const getAwsRegionExtensionConfiguration: (
runtimeConfig: RegionExtensionRuntimeConfigType,
) => {
setRegion(region: Provider<string>): void;
region(): Provider<string>;
};
/**
* @internal
*/
export declare const resolveAwsRegionExtensionConfiguration: (awsRegionExtensionConfiguration: AwsRegionExtensionConfiguration) => RegionExtensionRuntimeConfigType;
export declare const resolveAwsRegionExtensionConfiguration: (
awsRegionExtensionConfiguration: AwsRegionExtensionConfiguration,
) => RegionExtensionRuntimeConfigType;

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

/**
* @internal
*/
export declare function stsRegionDefaultResolver(): () => Promise<string>;
import { LocalConfigOptions } from "@smithy/core/config";
/**
* Default region provider for STS when used as an inner client.
* Differs from the default region resolver in that us-east-1 is the fallback instead of throwing an error.
*
* @internal
*/
export declare function stsRegionDefaultResolver(loaderConfig?: LocalConfigOptions): import("@smithy/types").Provider<string>;
/**
* @internal
*/
export declare function stsRegionDefaultResolver(
loaderConfig?: LocalConfigOptions,
): import("@smithy/types").Provider<string>;
export declare const warning: {
silence: boolean;
silence: boolean;
};

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

/**
* @internal
*/
export declare function stsRegionDefaultResolver(): () => Promise<string>;
import { AttributedAwsCredentialIdentity, AwsSdkCredentialsFeatures } from "@aws-sdk/types";
/**
* @internal
*
* @returns the credentials with source feature attribution.
*/
export declare function setCredentialFeature<F extends keyof AwsSdkCredentialsFeatures>(credentials: AttributedAwsCredentialIdentity, feature: F, value: AwsSdkCredentialsFeatures[F]): AttributedAwsCredentialIdentity;
export declare function setCredentialFeature<F extends keyof AwsSdkCredentialsFeatures>(
credentials: AttributedAwsCredentialIdentity,
feature: F,
value: AwsSdkCredentialsFeatures[F],
): AttributedAwsCredentialIdentity;
import { AwsHandlerExecutionContext, AwsSdkFeatures } from "@aws-sdk/types";
/**
* Indicates to the request context that a given feature is active.
* @internal
*
* @param context - handler execution context.
* @param feature - readable name of feature.
* @param value - encoding value of feature. This is required because the
* specification asks the SDK not to include a runtime lookup of all
* the feature identifiers.
*/
export declare function setFeature<F extends keyof AwsSdkFeatures>(context: AwsHandlerExecutionContext, feature: F, value: AwsSdkFeatures[F]): void;
export declare function setFeature<F extends keyof AwsSdkFeatures>(
context: AwsHandlerExecutionContext,
feature: F,
value: AwsSdkFeatures[F],
): void;
import { AttributedTokenIdentity, AwsSdkTokenFeatures } from "@aws-sdk/types";
/**
* @internal
*
* @returns the token with source feature attribution.
*/
export declare function setTokenFeature<F extends keyof AwsSdkTokenFeatures>(token: AttributedTokenIdentity, feature: F, value: AwsSdkTokenFeatures[F]): AttributedTokenIdentity;
export declare function setTokenFeature<F extends keyof AwsSdkTokenFeatures>(
token: AttributedTokenIdentity,
feature: F,
value: AwsSdkTokenFeatures[F],
): AttributedTokenIdentity;

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

/**
* Evaluates whether a string is a DNS compatible bucket name and can be used with
* virtual hosted style addressing.
*/
export declare const isVirtualHostableS3Bucket: (value: string, allowSubDomains?: boolean) => boolean;
export declare const isVirtualHostableS3Bucket: (
value: string,
allowSubDomains?: boolean,
) => boolean;
import { EndpointARN } from "@smithy/types";
/**
* Evaluates a single string argument value, and returns an object containing
* details about the parsed ARN.
* If the input was not a valid ARN, the function returns null.
*/
export declare const parseArn: (value: string) => EndpointARN | null;
import { EndpointPartition } from "@smithy/types";
export type PartitionsInfo = {
partitions: Array<{
id: string;
outputs: {
dnsSuffix: string;
dualStackDnsSuffix: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
};
regionRegex: string;
regions: Record<string, {
description?: string;
} | undefined>;
}>;
partitions: Array<{
id: string;
outputs: {
dnsSuffix: string;
dualStackDnsSuffix: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
};
regionRegex: string;
regions: Record<
string,
| {
description?: string;
}
| undefined
>;
}>;
};
/**
* Evaluates a single string argument value as a region, and matches the
* string value to an AWS partition.
* The matcher MUST always return a successful object describing the partition
* that the region has been determined to be a part of.
*/
export declare const partition: (value: string) => EndpointPartition;
/**
* Set custom partitions.json data.
* @internal
*/
export declare const setPartitionInfo: (partitionsInfo: PartitionsInfo, userAgentPrefix?: string) => void;
/**
* Reset to the default partitions.json data.
* @internal
*/
export declare const setPartitionInfo: (
partitionsInfo: PartitionsInfo,
userAgentPrefix?: string,
) => void;
export declare const useDefaultPartitionInfo: () => void;
/**
* @internal
*/
export declare const getUserAgentPrefix: () => string;
export declare const partitionsInfo: {
partitions: ({
partitions: (
| {
id: string;
outputs: {
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
};
regionRegex: string;
regions: {
"af-south-1": {
description: string;
};
"ap-east-1": {
description: string;
};
"ap-east-2": {
description: string;
};
"ap-northeast-1": {
description: string;
};
"ap-northeast-2": {
description: string;
};
"ap-northeast-3": {
description: string;
};
"ap-south-1": {
description: string;
};
"ap-south-2": {
description: string;
};
"ap-southeast-1": {
description: string;
};
"ap-southeast-2": {
description: string;
};
"ap-southeast-3": {
description: string;
};
"ap-southeast-4": {
description: string;
};
"ap-southeast-5": {
description: string;
};
"ap-southeast-6": {
description: string;
};
"ap-southeast-7": {
description: string;
};
"aws-global": {
description: string;
};
"ca-central-1": {
description: string;
};
"ca-west-1": {
description: string;
};
"eu-central-1": {
description: string;
};
"eu-central-2": {
description: string;
};
"eu-north-1": {
description: string;
};
"eu-south-1": {
description: string;
};
"eu-south-2": {
description: string;
};
"eu-west-1": {
description: string;
};
"eu-west-2": {
description: string;
};
"eu-west-3": {
description: string;
};
"il-central-1": {
description: string;
};
"me-central-1": {
description: string;
};
"me-south-1": {
description: string;
};
"mx-central-1": {
description: string;
};
"sa-east-1": {
description: string;
};
"us-east-1": {
description: string;
};
"us-east-2": {
description: string;
};
"us-west-1": {
description: string;
};
"us-west-2": {
description: string;
};
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
"af-south-1": {
description: string;
};
"ap-east-1": {
description: string;
};
"ap-east-2": {
description: string;
};
"ap-northeast-1": {
description: string;
};
"ap-northeast-2": {
description: string;
};
"ap-northeast-3": {
description: string;
};
"ap-south-1": {
description: string;
};
"ap-south-2": {
description: string;
};
"ap-southeast-1": {
description: string;
};
"ap-southeast-2": {
description: string;
};
"ap-southeast-3": {
description: string;
};
"ap-southeast-4": {
description: string;
};
"ap-southeast-5": {
description: string;
};
"ap-southeast-6": {
description: string;
};
"ap-southeast-7": {
description: string;
};
"aws-global": {
description: string;
};
"ca-central-1": {
description: string;
};
"ca-west-1": {
description: string;
};
"eu-central-1": {
description: string;
};
"eu-central-2": {
description: string;
};
"eu-north-1": {
description: string;
};
"eu-south-1": {
description: string;
};
"eu-south-2": {
description: string;
};
"eu-west-1": {
description: string;
};
"eu-west-2": {
description: string;
};
"eu-west-3": {
description: string;
};
"il-central-1": {
description: string;
};
"me-central-1": {
description: string;
};
"me-south-1": {
description: string;
};
"mx-central-1": {
description: string;
};
"sa-east-1": {
description: string;
};
"us-east-1": {
description: string;
};
"us-east-2": {
description: string;
};
"us-west-1": {
description: string;
};
"us-west-2": {
description: string;
};
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
};
} | {
}
| {
id: string;
outputs: {
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
};
regionRegex: string;
regions: {
"aws-cn-global": {
description: string;
};
"cn-north-1": {
description: string;
};
"cn-northwest-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
"aws-cn-global": {
description: string;
};
"cn-north-1": {
description: string;
};
"cn-northwest-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
};
} | {
}
| {
id: string;
outputs: {
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
};
regionRegex: string;
regions: {
"eusc-de-east-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
"eusc-de-east-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
};
} | {
}
| {
id: string;
outputs: {
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
};
regionRegex: string;
regions: {
"aws-iso-global": {
description: string;
};
"us-iso-east-1": {
description: string;
};
"us-iso-west-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
"aws-iso-global": {
description: string;
};
"us-iso-east-1": {
description: string;
};
"us-iso-west-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
};
} | {
}
| {
id: string;
outputs: {
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
};
regionRegex: string;
regions: {
"aws-iso-b-global": {
description: string;
};
"us-isob-east-1": {
description: string;
};
"us-isob-west-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
"aws-iso-b-global": {
description: string;
};
"us-isob-east-1": {
description: string;
};
"us-isob-west-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
};
} | {
}
| {
id: string;
outputs: {
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
};
regionRegex: string;
regions: {
"aws-iso-e-global": {
description: string;
};
"eu-isoe-west-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
"aws-iso-e-global": {
description: string;
};
"eu-isoe-west-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
};
} | {
}
| {
id: string;
outputs: {
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
};
regionRegex: string;
regions: {
"aws-iso-f-global": {
description: string;
};
"us-isof-east-1": {
description: string;
};
"us-isof-south-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
"aws-iso-f-global": {
description: string;
};
"us-isof-east-1": {
description: string;
};
"us-isof-south-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-us-gov-global"?: undefined;
"us-gov-east-1"?: undefined;
"us-gov-west-1"?: undefined;
};
} | {
}
| {
id: string;
outputs: {
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
dnsSuffix: string;
dualStackDnsSuffix: string;
implicitGlobalRegion: string;
name: string;
supportsDualStack: boolean;
supportsFIPS: boolean;
};
regionRegex: string;
regions: {
"aws-us-gov-global": {
description: string;
};
"us-gov-east-1": {
description: string;
};
"us-gov-west-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
"aws-us-gov-global": {
description: string;
};
"us-gov-east-1": {
description: string;
};
"us-gov-west-1": {
description: string;
};
"af-south-1"?: undefined;
"ap-east-1"?: undefined;
"ap-east-2"?: undefined;
"ap-northeast-1"?: undefined;
"ap-northeast-2"?: undefined;
"ap-northeast-3"?: undefined;
"ap-south-1"?: undefined;
"ap-south-2"?: undefined;
"ap-southeast-1"?: undefined;
"ap-southeast-2"?: undefined;
"ap-southeast-3"?: undefined;
"ap-southeast-4"?: undefined;
"ap-southeast-5"?: undefined;
"ap-southeast-6"?: undefined;
"ap-southeast-7"?: undefined;
"aws-global"?: undefined;
"ca-central-1"?: undefined;
"ca-west-1"?: undefined;
"eu-central-1"?: undefined;
"eu-central-2"?: undefined;
"eu-north-1"?: undefined;
"eu-south-1"?: undefined;
"eu-south-2"?: undefined;
"eu-west-1"?: undefined;
"eu-west-2"?: undefined;
"eu-west-3"?: undefined;
"il-central-1"?: undefined;
"me-central-1"?: undefined;
"me-south-1"?: undefined;
"mx-central-1"?: undefined;
"sa-east-1"?: undefined;
"us-east-1"?: undefined;
"us-east-2"?: undefined;
"us-west-1"?: undefined;
"us-west-2"?: undefined;
"aws-cn-global"?: undefined;
"cn-north-1"?: undefined;
"cn-northwest-1"?: undefined;
"eusc-de-east-1"?: undefined;
"aws-iso-global"?: undefined;
"us-iso-east-1"?: undefined;
"us-iso-west-1"?: undefined;
"aws-iso-b-global"?: undefined;
"us-isob-east-1"?: undefined;
"us-isob-west-1"?: undefined;
"aws-iso-e-global"?: undefined;
"eu-isoe-west-1"?: undefined;
"aws-iso-f-global"?: undefined;
"us-isof-east-1"?: undefined;
"us-isof-south-1"?: undefined;
};
})[];
version: string;
}
)[];
version: string;
};
import { Endpoint, EndpointParameters, EndpointV2, Logger, Provider } from "@smithy/types";
/**
* This is an additional config resolver layer for clients using the default
* AWS regional endpoints ruleset. It makes the *resolved* config guarantee the presence of an
* endpoint provider function. This differs from the base behavior of the Endpoint
* config resolver, which only normalizes config.endpoint IFF one is provided by the caller.
*
* This is not used by AWS SDK clients, but rather
* generated clients that have the aws.api#service trait. This includes protocol tests
* and other customers.
*
* This resolver is MUTUALLY EXCLUSIVE with the EndpointRequired config resolver from
* |@smithy/middleware-endpoint.
*
* It must be placed after the `resolveEndpointConfig`
* resolver. This replaces the endpoints.json-based default endpoint provider.
*
* @public
*/
export type DefaultAwsRegionalEndpointsInputConfig = {
endpoint?: unknown;
endpoint?: unknown;
};
type PreviouslyResolved = {
logger?: Logger;
region?: undefined | string | Provider<string | undefined>;
useFipsEndpoint?: undefined | boolean | Provider<string | boolean>;
useDualstackEndpoint?: undefined | boolean | Provider<string | boolean>;
endpointProvider: (endpointParams: EndpointParameters | DefaultRegionalEndpointParameters, context?: {
logger?: Logger;
}) => EndpointV2;
logger?: Logger;
region?: undefined | string | Provider<string | undefined>;
useFipsEndpoint?: undefined | boolean | Provider<string | boolean>;
useDualstackEndpoint?: undefined | boolean | Provider<string | boolean>;
endpointProvider: (
endpointParams: EndpointParameters | DefaultRegionalEndpointParameters,
context?: {
logger?: Logger;
},
) => EndpointV2;
};
/**
* @internal
*/
type DefaultRegionalEndpointParameters = {
Region?: string | undefined;
UseDualStack?: boolean | undefined;
UseFIPS?: boolean | undefined;
Region?: string | undefined;
UseDualStack?: boolean | undefined;
UseFIPS?: boolean | undefined;
};
/**
* @internal
*/
export interface DefaultAwsRegionalEndpointsResolvedConfig {
endpoint: Provider<Endpoint>;
endpoint: Provider<Endpoint>;
}
/**
* MUST resolve after `\@smithy/middleware-endpoint`::`resolveEndpointConfig`.
*
* @internal
*/
export declare const resolveDefaultAwsRegionalEndpointsConfig: <T>(input: T & DefaultAwsRegionalEndpointsInputConfig & PreviouslyResolved) => T & DefaultAwsRegionalEndpointsResolvedConfig;
/**
* @internal
*/
export declare const resolveDefaultAwsRegionalEndpointsConfig: <T>(
input: T & DefaultAwsRegionalEndpointsInputConfig & PreviouslyResolved,
) => T & DefaultAwsRegionalEndpointsResolvedConfig;
export declare const toEndpointV1: (endpoint: EndpointV2) => Endpoint;
export {};

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

export { EndpointObjectProperties, EndpointObjectHeaders, EndpointObject, EndpointRuleObject, } from "@smithy/core/endpoints";
export {
EndpointObjectProperties,
EndpointObjectHeaders,
EndpointObject,
EndpointRuleObject,
} from "@smithy/core/endpoints";

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

export { ReferenceObject, FunctionObject, FunctionArgv, FunctionReturn, ConditionObject, Expression, EndpointParams, EndpointResolverOptions, ReferenceRecord, EvaluateOptions, } from "@smithy/core/endpoints";
export {
ReferenceObject,
FunctionObject,
FunctionArgv,
FunctionReturn,
ConditionObject,
Expression,
EndpointParams,
EndpointResolverOptions,
ReferenceRecord,
EvaluateOptions,
} from "@smithy/core/endpoints";

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

/**
* @internal
*/
export interface DefaultUserAgentOptions {
serviceId?: string;
clientVersion: string;
serviceId?: string;
clientVersion: string;
}
import { UserAgent } from "@smithy/types";
import { DefaultUserAgentOptions } from "./configurations";
import { PreviouslyResolved } from "./defaultUserAgent";
/**
* This is an alternative to the default user agent provider that uses the bowser
* library to parse the user agent string.
*
* Use this with your client's `defaultUserAgentProvider` constructor object field
* to use the legacy behavior.
*
* @deprecated use the default provider unless you need the older UA-parsing functionality.
* @public
*/
export declare const createUserAgentStringParsingProvider: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => ((config?: PreviouslyResolved) => Promise<UserAgent>);
export declare const createUserAgentStringParsingProvider: ({
serviceId,
clientVersion,
}: DefaultUserAgentOptions) => (config?: PreviouslyResolved) => Promise<UserAgent>;

@@ -1,2 +0,7 @@

export { createUserAgentStringParsingProvider, createDefaultUserAgentProvider, fallback, defaultUserAgent, } from "./defaultUserAgent";
export {
createUserAgentStringParsingProvider,
createDefaultUserAgentProvider,
fallback,
defaultUserAgent,
} from "./defaultUserAgent";
export { PreviouslyResolved } from "./defaultUserAgent";
import { Provider, UserAgent } from "@smithy/types";
import { DefaultUserAgentOptions } from "./configurations";
export { createUserAgentStringParsingProvider } from "./createUserAgentStringParsingProvider";
/**
* @internal
*/
export interface PreviouslyResolved {
userAgentAppId: Provider<string | undefined>;
userAgentAppId: Provider<string | undefined>;
}
/**
* Default provider of the AWS SDK user agent string in react-native.
* @internal
*/
export declare const createDefaultUserAgentProvider: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => ((config?: PreviouslyResolved) => Promise<UserAgent>);
/**
* Rudimentary UA string parsing as a fallback.
* @internal
*/
export declare const createDefaultUserAgentProvider: ({
serviceId,
clientVersion,
}: DefaultUserAgentOptions) => (config?: PreviouslyResolved) => Promise<UserAgent>;
export declare const fallback: {
os(ua: string): string | undefined;
browser(ua: string): string | undefined;
os(ua: string): string | undefined;
browser(ua: string): string | undefined;
};
/**
* @internal
* @deprecated use createDefaultUserAgentProvider
*/
export declare const defaultUserAgent: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => ((config?: PreviouslyResolved) => Promise<UserAgent>);
export declare const defaultUserAgent: ({
serviceId,
clientVersion,
}: DefaultUserAgentOptions) => (config?: PreviouslyResolved) => Promise<UserAgent>;
import { Provider, UserAgent } from "@smithy/types";
import { DefaultUserAgentOptions } from "./configurations";
/**
* @internal
*/
export interface PreviouslyResolved {
userAgentAppId: Provider<string | undefined>;
userAgentAppId: Provider<string | undefined>;
}
/**
* Default provider to the user agent in ReactNative.
* @internal
*/
export declare const createDefaultUserAgentProvider: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => ((config?: PreviouslyResolved) => Promise<UserAgent>);
/**
* @internal
* @deprecated use createDefaultUserAgentProvider
*/
export declare const defaultUserAgent: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => ((config?: PreviouslyResolved) => Promise<UserAgent>);
export declare const createDefaultUserAgentProvider: ({
serviceId,
clientVersion,
}: DefaultUserAgentOptions) => (config?: PreviouslyResolved) => Promise<UserAgent>;
export declare const defaultUserAgent: ({
serviceId,
clientVersion,
}: DefaultUserAgentOptions) => (config?: PreviouslyResolved) => Promise<UserAgent>;

@@ -1,8 +0,3 @@

/**
* If \@aws-sdk/signature-v4-crt is installed and loaded, it will register
* this value to true.
* @internal
*/
export declare const crtAvailability: {
isCrtAvailable: boolean;
isCrtAvailable: boolean;
};
import { Provider, UserAgent } from "@smithy/types";
/**
* @internal
*/
export { crtAvailability } from "./crt-availability";
/**
* @internal
*/
export interface DefaultUserAgentOptions {
serviceId?: string;
clientVersion: string;
serviceId?: string;
clientVersion: string;
}
/**
* @internal
*/
export interface PreviouslyResolved {
userAgentAppId: Provider<string | undefined>;
userAgentAppId: Provider<string | undefined>;
}
/**
* Collect metrics from runtime to put into user agent.
* @internal
*/
export declare const createDefaultUserAgentProvider: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => (config?: PreviouslyResolved) => Promise<UserAgent>;
/**
* @internal
* @deprecated use createDefaultUserAgentProvider
*/
export declare const defaultUserAgent: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => (config?: PreviouslyResolved) => Promise<UserAgent>;
export declare const createDefaultUserAgentProvider: ({
serviceId,
clientVersion,
}: DefaultUserAgentOptions) => (config?: PreviouslyResolved) => Promise<UserAgent>;
export declare const defaultUserAgent: ({
serviceId,
clientVersion,
}: DefaultUserAgentOptions) => (config?: PreviouslyResolved) => Promise<UserAgent>;
import { UserAgentPair } from "@smithy/types";
/**
* Returns the runtime name and version as a user agent pair.
* @internal
*/
export declare const getRuntimeUserAgentPair: () => UserAgentPair;
import { UserAgentPair } from "@smithy/types";
/**
* @internal
*/
export declare const isCrtAvailable: () => UserAgentPair | null;
import { LoadedConfigSelectors } from "@smithy/core/config";
/**
* @internal
*/
export declare const UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
/**
* @internal
*/
export declare const UA_APP_ID_INI_NAME = "sdk_ua_app_id";
/**
* @internal
*/
export declare const NODE_APP_ID_CONFIG_OPTIONS: LoadedConfigSelectors<string | undefined>;
import { AwsCredentialIdentity, HttpRequest as IHttpRequest } from "@smithy/types";
import { AwsSdkSigV4Signer } from "./AwsSdkSigV4Signer";
/**
* @internal
* Note: this is not a signing algorithm implementation. The sign method
* accepts the real signer as an input parameter.
*/
export declare class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {
sign(httpRequest: IHttpRequest, identity: AwsCredentialIdentity, signingProperties: Record<string, unknown>): Promise<IHttpRequest>;
sign(
httpRequest: IHttpRequest,
identity: AwsCredentialIdentity,
signingProperties: Record<string, unknown>,
): Promise<IHttpRequest>;
}

@@ -1,44 +0,39 @@

import { AuthScheme, AwsCredentialIdentity, HttpRequest as IHttpRequest, HttpResponse, HttpSigner, Provider, RequestSigner } from "@smithy/types";
import {
AuthScheme,
AwsCredentialIdentity,
HttpRequest as IHttpRequest,
HttpResponse,
HttpSigner,
Provider,
RequestSigner,
} from "@smithy/types";
import { AwsSdkSigV4AAuthResolvedConfig } from "./resolveAwsSdkSigV4AConfig";
/**
* @internal
*/
interface AwsSdkSigV4Config extends AwsSdkSigV4AAuthResolvedConfig {
systemClockOffset: number;
signer: (authScheme?: AuthScheme) => Promise<RequestSigner>;
disableClockSkewCorrection?: Provider<boolean>;
systemClockOffset: number;
signer: (authScheme?: AuthScheme) => Promise<RequestSigner>;
disableClockSkewCorrection?: Provider<boolean>;
}
/**
* @internal
*/
interface AwsSdkSigV4AuthSigningProperties {
config: AwsSdkSigV4Config;
signer: RequestSigner;
signingRegion?: string;
signingRegionSet?: string[];
signingName?: string;
config: AwsSdkSigV4Config;
signer: RequestSigner;
signingRegion?: string;
signingRegionSet?: string[];
signingName?: string;
}
/**
* @internal
*/
export declare const validateSigningProperties: (signingProperties: Record<string, unknown>) => Promise<AwsSdkSigV4AuthSigningProperties>;
/**
* Note: this is not a signing algorithm implementation. The sign method
* accepts the real signer as an input parameter.
* @internal
*/
export declare const validateSigningProperties: (
signingProperties: Record<string, unknown>,
) => Promise<AwsSdkSigV4AuthSigningProperties>;
export declare class AwsSdkSigV4Signer implements HttpSigner {
sign(httpRequest: IHttpRequest,
/**
* `identity` is bound in {@link resolveAWSSDKSigV4Config}
*/
identity: AwsCredentialIdentity, signingProperties: Record<string, unknown>): Promise<IHttpRequest>;
errorHandler(signingProperties: Record<string, unknown>): (error: Error) => never;
successHandler(httpResponse: HttpResponse | unknown, signingProperties: Record<string, unknown>): void;
sign(
httpRequest: IHttpRequest,
identity: AwsCredentialIdentity,
signingProperties: Record<string, unknown>,
): Promise<IHttpRequest>;
errorHandler(signingProperties: Record<string, unknown>): (error: Error) => never;
successHandler(
httpResponse: HttpResponse | unknown,
signingProperties: Record<string, unknown>,
): void;
}
/**
* @internal
* @deprecated renamed to {@link AwsSdkSigV4Signer}
*/
export declare const AWSSDKSigV4Signer: typeof AwsSdkSigV4Signer;
export {};

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

/**
* Browser default: clock skew correction enabled.
*
* @internal
*/
export declare const DEFAULT_DISABLE_CLOCK_SKEW_CORRECTION = false;

@@ -1,7 +0,1 @@

/**
* Node.js default: lazily reads from env var / shared config file.
* Browser counterpart (via index binding) exports `false`.
*
* @internal
*/
export declare const DEFAULT_DISABLE_CLOCK_SKEW_CORRECTION: import("@smithy/types").Provider<boolean>;
import { LoadedConfigSelectors } from "@smithy/core/config";
/**
* @internal
*/
export declare const ENV_DISABLE_CLOCK_SKEW_CORRECTION = "AWS_DISABLE_CLOCK_SKEW_CORRECTION";
/**
* @internal
*/
export declare const CONFIG_DISABLE_CLOCK_SKEW_CORRECTION = "disable_clock_skew_correction";
/**
* @internal
*/
export declare const NODE_DISABLE_CLOCK_SKEW_CORRECTION_CONFIG_OPTIONS: LoadedConfigSelectors<boolean>;

@@ -1,7 +0,23 @@

export { AwsSdkSigV4Signer, AWSSDKSigV4Signer, validateSigningProperties } from "./AwsSdkSigV4Signer";
export {
AwsSdkSigV4Signer,
AWSSDKSigV4Signer,
validateSigningProperties,
} from "./AwsSdkSigV4Signer";
export { AwsSdkSigV4ASigner } from "./AwsSdkSigV4ASigner";
export { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } from "./NODE_AUTH_SCHEME_PREFERENCE_OPTIONS";
export { resolveAwsSdkSigV4AConfig, NODE_SIGV4A_CONFIG_OPTIONS } from "./resolveAwsSdkSigV4AConfig";
export { AwsSdkSigV4AAuthInputConfig, AwsSdkSigV4APreviouslyResolved, AwsSdkSigV4AAuthResolvedConfig, } from "./resolveAwsSdkSigV4AConfig";
export {
AwsSdkSigV4AAuthInputConfig,
AwsSdkSigV4APreviouslyResolved,
AwsSdkSigV4AAuthResolvedConfig,
} from "./resolveAwsSdkSigV4AConfig";
export { bindResolveAwsSdkSigV4Config } from "./resolveAwsSdkSigV4Config";
export { AwsSdkSigV4AuthInputConfig, AwsSdkSigV4Memoized, AwsSdkSigV4PreviouslyResolved, AwsSdkSigV4AuthResolvedConfig, AWSSDKSigV4AuthInputConfig, AWSSDKSigV4PreviouslyResolved, AWSSDKSigV4AuthResolvedConfig, } from "./resolveAwsSdkSigV4Config";
export {
AwsSdkSigV4AuthInputConfig,
AwsSdkSigV4Memoized,
AwsSdkSigV4PreviouslyResolved,
AwsSdkSigV4AuthResolvedConfig,
AWSSDKSigV4AuthInputConfig,
AWSSDKSigV4PreviouslyResolved,
AWSSDKSigV4AuthResolvedConfig,
} from "./resolveAwsSdkSigV4Config";
import { LoadedConfigSelectors } from "@smithy/core/config";
/**
* @public
*/
export declare const NODE_AUTH_SCHEME_PREFERENCE_OPTIONS: LoadedConfigSelectors<string[]>;
import { LoadedConfigSelectors } from "@smithy/core/config";
import { Provider } from "@smithy/types";
/**
* @public
*/
export interface AwsSdkSigV4AAuthInputConfig {
/**
* This option will override the AWS sigv4a
* signing regionSet from any other source.
*
* The lookup order is:
* 1. this value
* 2. configuration file value of sigv4a_signing_region_set.
* 3. environment value of AWS_SIGV4A_SIGNING_REGION_SET.
* 4. signingRegionSet given by endpoint resolution.
* 5. the singular region of the SDK client.
*/
sigv4aSigningRegionSet?: string[] | undefined | Provider<string[] | undefined>;
sigv4aSigningRegionSet?: string[] | undefined | Provider<string[] | undefined>;
}
/**
* @internal
*/
export interface AwsSdkSigV4APreviouslyResolved {
}
/**
* @internal
*/
export interface AwsSdkSigV4APreviouslyResolved {}
export interface AwsSdkSigV4AAuthResolvedConfig {
sigv4aSigningRegionSet: Provider<string[] | undefined>;
sigv4aSigningRegionSet: Provider<string[] | undefined>;
}
/**
* @internal
*/
export declare const resolveAwsSdkSigV4AConfig: <T>(config: T & AwsSdkSigV4AAuthInputConfig & AwsSdkSigV4APreviouslyResolved) => T & AwsSdkSigV4AAuthResolvedConfig;
/**
* @internal
*/
export declare const resolveAwsSdkSigV4AConfig: <T>(
config: T & AwsSdkSigV4AAuthInputConfig & AwsSdkSigV4APreviouslyResolved,
) => T & AwsSdkSigV4AAuthResolvedConfig;
export declare const NODE_SIGV4A_CONFIG_OPTIONS: LoadedConfigSelectors<string[] | undefined>;
import { MergeFunctions } from "@aws-sdk/types";
import { SignatureV4CryptoInit, SignatureV4Init } from "@smithy/signature-v4";
import { AuthScheme, AwsCredentialIdentity, AwsCredentialIdentityProvider, ChecksumConstructor, HashConstructor, MemoizedProvider, Provider, RegionInfoProvider, RequestSigner } from "@smithy/types";
/**
* @public
*/
import {
AuthScheme,
AwsCredentialIdentity,
AwsCredentialIdentityProvider,
ChecksumConstructor,
HashConstructor,
MemoizedProvider,
Provider,
RegionInfoProvider,
RequestSigner,
} from "@smithy/types";
export interface AwsSdkSigV4AuthInputConfig {
/**
* The credentials used to sign requests.
*/
credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider;
/**
* The signer to use when signing requests.
*/
signer?: RequestSigner | ((authScheme?: AuthScheme) => Promise<RequestSigner>);
/**
* Whether to escape request path when signing the request.
*/
signingEscapePath?: boolean;
/**
* An offset value in milliseconds to apply to all signing times.
*/
systemClockOffset?: number;
/**
* The region where you want to sign your request against. This
* can be different to the region in the endpoint.
*/
signingRegion?: string;
/**
* The injectable SigV4-compatible signer class constructor. If not supplied,
* regular SignatureV4 constructor will be used.
*
* @internal
*/
signerConstructor?: new (options: SignatureV4Init & SignatureV4CryptoInit) => RequestSigner;
/**
* Whether to disable clock skew correction. When true, the SDK will not adjust
* the signing timestamp, will not update the client clock offset from response
* headers, and will not retry clock skew errors.
*
* Defaults to false (correction enabled).
*/
disableClockSkewCorrection?: boolean | Provider<boolean>;
credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider;
signer?: RequestSigner | ((authScheme?: AuthScheme) => Promise<RequestSigner>);
signingEscapePath?: boolean;
systemClockOffset?: number;
signingRegion?: string;
signerConstructor?: new (options: SignatureV4Init & SignatureV4CryptoInit) => RequestSigner;
disableClockSkewCorrection?: boolean | Provider<boolean>;
}
/**
* Used to indicate whether a credential provider function was memoized by this resolver.
* @public
*/
export type AwsSdkSigV4Memoized = {
/**
* The credential provider has been memoized by the AWS SDK SigV4 config resolver.
*/
memoized?: boolean;
/**
* The credential provider has the caller client config object bound to its arguments.
*/
configBound?: boolean;
/**
* Function is wrapped with attribution transform.
*/
attributed?: boolean;
memoized?: boolean;
configBound?: boolean;
attributed?: boolean;
};
/**
* @internal
*/
export interface AwsSdkSigV4PreviouslyResolved {
credentialDefaultProvider?: (input: any) => MemoizedProvider<AwsCredentialIdentity>;
region: string | Provider<string>;
sha256: ChecksumConstructor | HashConstructor;
signingName?: string;
regionInfoProvider?: RegionInfoProvider;
defaultSigningName?: string;
serviceId: string;
useFipsEndpoint: Provider<boolean>;
useDualstackEndpoint: Provider<boolean>;
credentialDefaultProvider?: (input: any) => MemoizedProvider<AwsCredentialIdentity>;
region: string | Provider<string>;
sha256: ChecksumConstructor | HashConstructor;
signingName?: string;
regionInfoProvider?: RegionInfoProvider;
defaultSigningName?: string;
serviceId: string;
useFipsEndpoint: Provider<boolean>;
useDualstackEndpoint: Provider<boolean>;
}
/**
* @internal
*/
export interface AwsSdkSigV4AuthResolvedConfig {
/**
* Resolved value for input config {@link AwsSdkSigV4AuthInputConfig.credentials}
* This provider MAY memoize the loaded credentials for certain period.
*/
credentials: MergeFunctions<AwsCredentialIdentityProvider, MemoizedProvider<AwsCredentialIdentity>> & AwsSdkSigV4Memoized;
/**
* Resolved value for input config {@link AwsSdkSigV4AuthInputConfig.signer}
*/
signer: (authScheme?: AuthScheme) => Promise<RequestSigner>;
/**
* Resolved value for input config {@link AwsSdkSigV4AuthInputConfig.signingEscapePath}
*/
signingEscapePath: boolean;
/**
* Resolved value for input config {@link AwsSdkSigV4AuthInputConfig.systemClockOffset}
*/
systemClockOffset: number;
/**
* Resolved value for input config {@link AwsSdkSigV4AuthInputConfig.disableClockSkewCorrection}
*/
disableClockSkewCorrection: Provider<boolean>;
credentials: MergeFunctions<
AwsCredentialIdentityProvider,
MemoizedProvider<AwsCredentialIdentity>
> &
AwsSdkSigV4Memoized;
signer: (authScheme?: AuthScheme) => Promise<RequestSigner>;
signingEscapePath: boolean;
systemClockOffset: number;
disableClockSkewCorrection: Provider<boolean>;
}
/**
* Combined input config type used internally by the resolver and helper functions.
* @internal
*/
type AwsSdkSigV4ConfigInput = AwsSdkSigV4AuthInputConfig & AwsSdkSigV4PreviouslyResolved;
/**
* Accepts a platform-specific default for disableClockSkewCorrection and
* returns the resolver function. Called from the index (node vs browser).
*
* @internal
*/
export declare const bindResolveAwsSdkSigV4Config: (defaultDisableClockSkewCorrection: boolean | Provider<boolean>) => <T>(config: T & AwsSdkSigV4ConfigInput) => T & AwsSdkSigV4AuthResolvedConfig;
/**
* @internal
* @deprecated renamed to {@link AwsSdkSigV4AuthInputConfig}
*/
export interface AWSSDKSigV4AuthInputConfig extends AwsSdkSigV4AuthInputConfig {
}
/**
* @internal
* @deprecated renamed to {@link AwsSdkSigV4PreviouslyResolved}
*/
export interface AWSSDKSigV4PreviouslyResolved extends AwsSdkSigV4PreviouslyResolved {
}
/**
* @internal
* @deprecated renamed to {@link AwsSdkSigV4AuthResolvedConfig}
*/
export interface AWSSDKSigV4AuthResolvedConfig extends AwsSdkSigV4AuthResolvedConfig {
}
export declare const bindResolveAwsSdkSigV4Config: (
defaultDisableClockSkewCorrection: boolean | Provider<boolean>,
) => <T>(config: T & AwsSdkSigV4ConfigInput) => T & AwsSdkSigV4AuthResolvedConfig;
export interface AWSSDKSigV4AuthInputConfig extends AwsSdkSigV4AuthInputConfig {}
export interface AWSSDKSigV4PreviouslyResolved extends AwsSdkSigV4PreviouslyResolved {}
export interface AWSSDKSigV4AuthResolvedConfig extends AwsSdkSigV4AuthResolvedConfig {}
export {};

@@ -1,11 +0,32 @@

export { AwsSdkSigV4Signer, AWSSDKSigV4Signer, validateSigningProperties, AwsSdkSigV4ASigner, resolveAwsSdkSigV4AConfig, } from "./aws_sdk";
export { AwsSdkSigV4AAuthInputConfig, AwsSdkSigV4APreviouslyResolved, AwsSdkSigV4AAuthResolvedConfig, AwsSdkSigV4AuthInputConfig, AwsSdkSigV4Memoized, AwsSdkSigV4PreviouslyResolved, AwsSdkSigV4AuthResolvedConfig, AWSSDKSigV4AuthInputConfig, AWSSDKSigV4PreviouslyResolved, AWSSDKSigV4AuthResolvedConfig, } from "./aws_sdk";
export {
AwsSdkSigV4Signer,
AWSSDKSigV4Signer,
validateSigningProperties,
AwsSdkSigV4ASigner,
resolveAwsSdkSigV4AConfig,
} from "./aws_sdk";
export {
AwsSdkSigV4AAuthInputConfig,
AwsSdkSigV4APreviouslyResolved,
AwsSdkSigV4AAuthResolvedConfig,
AwsSdkSigV4AuthInputConfig,
AwsSdkSigV4Memoized,
AwsSdkSigV4PreviouslyResolved,
AwsSdkSigV4AuthResolvedConfig,
AWSSDKSigV4AuthInputConfig,
AWSSDKSigV4PreviouslyResolved,
AWSSDKSigV4AuthResolvedConfig,
} from "./aws_sdk";
export { getBearerTokenEnvKey } from "./utils/getBearerTokenEnvKey";
export declare const NODE_AUTH_SCHEME_PREFERENCE_OPTIONS: symbol;
export declare const NODE_SIGV4A_CONFIG_OPTIONS: symbol;
export declare const resolveAwsSdkSigV4Config: <T>(config: T & (import("./aws_sdk").AwsSdkSigV4AuthInputConfig & import("./aws_sdk").AwsSdkSigV4PreviouslyResolved)) => T & import("./aws_sdk").AwsSdkSigV4AuthResolvedConfig;
/**
* @internal
* @deprecated renamed to {@link resolveAwsSdkSigV4Config}
*/
export declare const resolveAWSSDKSigV4Config: <T>(config: T & (import("./aws_sdk").AwsSdkSigV4AuthInputConfig & import("./aws_sdk").AwsSdkSigV4PreviouslyResolved)) => T & import("./aws_sdk").AwsSdkSigV4AuthResolvedConfig;
export declare const resolveAwsSdkSigV4Config: <T>(
config: T &
(import("./aws_sdk").AwsSdkSigV4AuthInputConfig &
import("./aws_sdk").AwsSdkSigV4PreviouslyResolved),
) => T & import("./aws_sdk").AwsSdkSigV4AuthResolvedConfig;
export declare const resolveAWSSDKSigV4Config: <T>(
config: T &
(import("./aws_sdk").AwsSdkSigV4AuthInputConfig &
import("./aws_sdk").AwsSdkSigV4PreviouslyResolved),
) => T & import("./aws_sdk").AwsSdkSigV4AuthResolvedConfig;

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

export { AwsSdkSigV4Signer, AWSSDKSigV4Signer, validateSigningProperties, AwsSdkSigV4ASigner, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, resolveAwsSdkSigV4AConfig, NODE_SIGV4A_CONFIG_OPTIONS, } from "./aws_sdk";
export { AwsSdkSigV4AAuthInputConfig, AwsSdkSigV4APreviouslyResolved, AwsSdkSigV4AAuthResolvedConfig, AwsSdkSigV4AuthInputConfig, AwsSdkSigV4Memoized, AwsSdkSigV4PreviouslyResolved, AwsSdkSigV4AuthResolvedConfig, AWSSDKSigV4AuthInputConfig, AWSSDKSigV4PreviouslyResolved, AWSSDKSigV4AuthResolvedConfig, } from "./aws_sdk";
export {
AwsSdkSigV4Signer,
AWSSDKSigV4Signer,
validateSigningProperties,
AwsSdkSigV4ASigner,
NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,
resolveAwsSdkSigV4AConfig,
NODE_SIGV4A_CONFIG_OPTIONS,
} from "./aws_sdk";
export {
AwsSdkSigV4AAuthInputConfig,
AwsSdkSigV4APreviouslyResolved,
AwsSdkSigV4AAuthResolvedConfig,
AwsSdkSigV4AuthInputConfig,
AwsSdkSigV4Memoized,
AwsSdkSigV4PreviouslyResolved,
AwsSdkSigV4AuthResolvedConfig,
AWSSDKSigV4AuthInputConfig,
AWSSDKSigV4PreviouslyResolved,
AWSSDKSigV4AuthResolvedConfig,
} from "./aws_sdk";
export { getBearerTokenEnvKey } from "./utils/getBearerTokenEnvKey";
export declare const resolveAwsSdkSigV4Config: <T>(config: T & (import("./aws_sdk").AwsSdkSigV4AuthInputConfig & import("./aws_sdk").AwsSdkSigV4PreviouslyResolved)) => T & import("./aws_sdk").AwsSdkSigV4AuthResolvedConfig;
/**
* @internal
* @deprecated renamed to {@link resolveAwsSdkSigV4Config}
*/
export declare const resolveAWSSDKSigV4Config: <T>(config: T & (import("./aws_sdk").AwsSdkSigV4AuthInputConfig & import("./aws_sdk").AwsSdkSigV4PreviouslyResolved)) => T & import("./aws_sdk").AwsSdkSigV4AuthResolvedConfig;
export declare const resolveAwsSdkSigV4Config: <T>(
config: T &
(import("./aws_sdk").AwsSdkSigV4AuthInputConfig &
import("./aws_sdk").AwsSdkSigV4PreviouslyResolved),
) => T & import("./aws_sdk").AwsSdkSigV4AuthResolvedConfig;
export declare const resolveAWSSDKSigV4Config: <T>(
config: T &
(import("./aws_sdk").AwsSdkSigV4AuthInputConfig &
import("./aws_sdk").AwsSdkSigV4PreviouslyResolved),
) => T & import("./aws_sdk").AwsSdkSigV4AuthResolvedConfig;

@@ -1,8 +0,1 @@

/**
* Converts a comma-separated string into an array of trimmed strings
* @param str The comma-separated input string to split
* @returns Array of trimmed strings split from the input
*
* @internal
*/
export declare const getArrayForCommaSeparatedString: (str: string) => string[];

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

/**
* Returns an environment variable key base on signing name.
* @param signingName - The signing name to use in the key
* @returns The environment variable key in format AWS_BEARER_TOKEN_<SIGNING_NAME>
*/
export declare const getBearerTokenEnvKey: (signingName: string) => string;

@@ -1,8 +0,2 @@

/**
* @internal
*/
export declare const getDateHeader: (response: unknown) => string | undefined;
/**
* @internal
*/
export declare const getAgeHeader: (response: unknown) => string | undefined;

@@ -1,8 +0,1 @@

/**
* @internal
*
* Returns a date that is corrected for clock skew.
*
* @param systemClockOffset The offset of the system clock in milliseconds.
*/
export declare const getSkewCorrectedDate: (systemClockOffset: number) => Date;

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

/**
* Computes an updated system clock offset from a server Date header.
*
* When `timeRequestSent` is provided, uses the midpoint formula:
* elapsed = timeResponseReceived - timeRequestSent
* midpoint = (timeRequestSent + timeResponseReceived) / 2
* candidateSkew = serverTime - midpoint
*
* When `timeRequestSent` is absent (legacy callers), falls back to:
* candidateSkew = serverTime - timeResponseReceived
*
* The candidate is discarded if:
* - An Age header is present
* - elapsed > 15 minutes
*
* The candidate is recorded unconditionally when not
* discarded. The detection threshold (4 min) is only used for retry decisions,
* not for whether to update the offset.
*
* @internal
* @param clockTime The string value of the Date response header.
* @param currentSystemClockOffset The current system clock offset in milliseconds.
* @param timeRequestSent The raw client time (ms) at which the request was sent.
* @param ageHeader The value of the Age response header, if present.
*/
export declare const getUpdatedSystemClockOffset: (clockTime: string, currentSystemClockOffset: number, timeRequestSent?: number, ageHeader?: string) => number;
export declare const getUpdatedSystemClockOffset: (
clockTime: string,
currentSystemClockOffset: number,
timeRequestSent?: number,
ageHeader?: string,
) => number;

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

/**
* @internal
*
* Checks if the provided date is within the skew window of 300000ms.
*
* @param clockTime - The time to check for skew in milliseconds.
* @param systemClockOffset - The offset of the system clock in milliseconds.
*/
export declare const isClockSkewed: (clockTime: number, systemClockOffset: number) => boolean;
import { SmithyRpcV2CborProtocol } from "@smithy/core/cbor";
import { TypeRegistry } from "@smithy/core/schema";
import { EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse, OperationSchema, ResponseMetadata, SerdeFunctions } from "@smithy/types";
/**
* Extends the Smithy implementation to add AwsQueryCompatibility support.
*
* @public
*/
import {
EndpointBearer,
HandlerExecutionContext,
HttpRequest,
HttpResponse,
OperationSchema,
ResponseMetadata,
SerdeFunctions,
} from "@smithy/types";
export declare class AwsSmithyRpcV2CborProtocol extends SmithyRpcV2CborProtocol {
private readonly awsQueryCompatible;
private readonly mixin;
constructor({ defaultNamespace, errorTypeRegistries, awsQueryCompatible, }: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
awsQueryCompatible?: boolean;
});
/**
* @override
*/
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<HttpRequest>;
/**
* @override
*/
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: HttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
private readonly awsQueryCompatible;
private readonly mixin;
constructor({
defaultNamespace,
errorTypeRegistries,
awsQueryCompatible,
}: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
awsQueryCompatible?: boolean;
});
serializeRequest<Input extends object>(
operationSchema: OperationSchema,
input: Input,
context: HandlerExecutionContext & SerdeFunctions & EndpointBearer,
): Promise<HttpRequest>;
protected handleError(
operationSchema: OperationSchema,
context: HandlerExecutionContext & SerdeFunctions,
response: HttpResponse,
dataObject: any,
metadata: ResponseMetadata,
): Promise<never>;
}

@@ -1,18 +0,3 @@

/**
* @internal
*
* Used for awsQueryCompatibility trait.
*/
export declare const _toStr: (val: unknown) => string | undefined;
/**
* @internal
*
* Used for awsQueryCompatibility trait.
*/
export declare const _toBool: (val: unknown) => boolean | undefined;
/**
* @internal
*
* Used for awsQueryCompatibility trait.
*/
export declare const _toNum: (val: unknown) => number | undefined;
import { SerdeFunctions } from "@smithy/types";
export declare const collectBodyString: (streamBody: any, context: SerdeFunctions) => Promise<string>;
export declare const collectBodyString: (
streamBody: any,
context: SerdeFunctions,
) => Promise<string>;
import { ConfigurableSerdeContext, SerdeFunctions } from "@smithy/types";
/**
* @internal
*/
export declare class SerdeContextConfig implements ConfigurableSerdeContext {
protected serdeContext?: SerdeFunctions;
setSerdeContext(serdeContext: SerdeFunctions): void;
protected serdeContext?: SerdeFunctions;
setSerdeContext(serdeContext: SerdeFunctions): void;
}

@@ -9,6 +9,11 @@ export { AwsSmithyRpcV2CborProtocol } from "./cbor/AwsSmithyRpcV2CborProtocol";

export { JsonSettings } from "./json/JsonCodec";
export { JsonShapeDeserializer } from "./json/JsonShapeDeserializer";
export { JsonShapeSerializer } from "./json/JsonShapeSerializer";
export { JsonShapeDeserializer } from "./json/codec-v1/JsonShapeDeserializer";
export { JsonShapeSerializer } from "./json/codec-v1/JsonShapeSerializer";
export { awsExpectUnion } from "./json/awsExpectUnion";
export { parseJsonBody, parseJsonErrorBody, loadRestJsonErrorCode, loadJsonRpcErrorCode } from "./json/parseJsonBody";
export {
parseJsonBody,
parseJsonErrorBody,
loadRestJsonErrorCode,
loadJsonRpcErrorCode,
} from "./json/parseJsonBody";
export { AwsEc2QueryProtocol } from "./query/AwsEc2QueryProtocol";

@@ -15,0 +20,0 @@ export { AwsQueryProtocol } from "./query/AwsQueryProtocol";

@@ -1,7 +0,1 @@

/**
* @internal
*
* Forwards to Smithy's expectUnion function, but also ignores
* the `__type` field if it is present.
*/
export declare const awsExpectUnion: (value: unknown) => Record<string, any> | undefined;
import { TypeRegistry } from "@smithy/core/schema";
import { AwsJsonRpcProtocol } from "./AwsJsonRpcProtocol";
import { JsonCodec } from "./JsonCodec";
/**
* @public
* @see https://smithy.io/2.0/aws/protocols/aws-json-1_1-protocol.html#differences-between-awsjson1-0-and-awsjson1-1
*/
export declare class AwsJson1_0Protocol extends AwsJsonRpcProtocol {
constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
serviceTarget: string;
awsQueryCompatible?: boolean;
jsonCodec?: JsonCodec;
});
getShapeId(): string;
protected getJsonRpcVersion(): "1.0";
/**
* @override
*/
protected getDefaultContentType(): string;
constructor({
defaultNamespace,
errorTypeRegistries,
serviceTarget,
awsQueryCompatible,
jsonCodec,
}: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
serviceTarget: string;
awsQueryCompatible?: boolean;
jsonCodec?: JsonCodec;
});
getShapeId(): string;
protected getJsonRpcVersion(): "1.0";
protected getDefaultContentType(): string;
}
import { TypeRegistry } from "@smithy/core/schema";
import { AwsJsonRpcProtocol } from "./AwsJsonRpcProtocol";
import { JsonCodec } from "./JsonCodec";
/**
* @public
* @see https://smithy.io/2.0/aws/protocols/aws-json-1_1-protocol.html#differences-between-awsjson1-0-and-awsjson1-1
*/
export declare class AwsJson1_1Protocol extends AwsJsonRpcProtocol {
constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
serviceTarget: string;
awsQueryCompatible?: boolean;
jsonCodec?: JsonCodec;
});
getShapeId(): string;
protected getJsonRpcVersion(): "1.1";
/**
* @override
*/
protected getDefaultContentType(): string;
constructor({
defaultNamespace,
errorTypeRegistries,
serviceTarget,
awsQueryCompatible,
jsonCodec,
}: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
serviceTarget: string;
awsQueryCompatible?: boolean;
jsonCodec?: JsonCodec;
});
getShapeId(): string;
protected getJsonRpcVersion(): "1.1";
protected getDefaultContentType(): string;
}
import { RpcProtocol } from "@smithy/core/protocols";
import { TypeRegistry } from "@smithy/core/schema";
import { EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
import {
EndpointBearer,
HandlerExecutionContext,
HttpRequest,
HttpResponse,
OperationSchema,
ResponseMetadata,
SerdeFunctions,
ShapeDeserializer,
ShapeSerializer,
} from "@smithy/types";
import { JsonCodec } from "./JsonCodec";
/**
* @public
*/
export declare abstract class AwsJsonRpcProtocol extends RpcProtocol {
protected serializer: ShapeSerializer<string | Uint8Array>;
protected deserializer: ShapeDeserializer<string | Uint8Array>;
protected serviceTarget: string;
private readonly codec;
private readonly mixin;
private readonly awsQueryCompatible;
protected constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
serviceTarget: string;
awsQueryCompatible?: boolean;
jsonCodec?: JsonCodec;
});
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<HttpRequest>;
getPayloadCodec(): JsonCodec;
protected abstract getJsonRpcVersion(): "1.1" | "1.0";
/**
* @override
*/
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: HttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
protected serializer: ShapeSerializer<string | Uint8Array>;
protected deserializer: ShapeDeserializer<string | Uint8Array>;
protected serviceTarget: string;
private readonly codec;
private readonly mixin;
private readonly awsQueryCompatible;
protected constructor({
defaultNamespace,
errorTypeRegistries,
serviceTarget,
awsQueryCompatible,
jsonCodec,
}: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
serviceTarget: string;
awsQueryCompatible?: boolean;
jsonCodec?: JsonCodec;
});
serializeRequest<Input extends object>(
operationSchema: OperationSchema,
input: Input,
context: HandlerExecutionContext & SerdeFunctions & EndpointBearer,
): Promise<HttpRequest>;
getPayloadCodec(): JsonCodec;
protected abstract getJsonRpcVersion(): "1.1" | "1.0";
protected handleError(
operationSchema: OperationSchema,
context: HandlerExecutionContext & SerdeFunctions,
response: HttpResponse,
dataObject: any,
metadata: ResponseMetadata,
): Promise<never>;
}
import { HttpBindingProtocol } from "@smithy/core/protocols";
import { TypeRegistry } from "@smithy/core/schema";
import { EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
import {
EndpointBearer,
HandlerExecutionContext,
HttpRequest,
HttpResponse,
MetadataBearer,
OperationSchema,
ResponseMetadata,
SerdeFunctions,
ShapeDeserializer,
ShapeSerializer,
} from "@smithy/types";
import { JsonCodec } from "./JsonCodec";
/**
* @public
*/
export declare class AwsRestJsonProtocol extends HttpBindingProtocol {
protected serializer: ShapeSerializer<string | Uint8Array>;
protected deserializer: ShapeDeserializer<string | Uint8Array>;
private readonly codec;
private readonly mixin;
constructor({ defaultNamespace, errorTypeRegistries, }: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
});
getShapeId(): string;
getPayloadCodec(): JsonCodec;
setSerdeContext(serdeContext: SerdeFunctions): void;
/**
* @override
*/
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<HttpRequest>;
/**
* @override
*/
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: HttpResponse): Promise<Output>;
/**
* @override
*/
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: HttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
/**
* @override
*/
protected getDefaultContentType(): string;
protected serializer: ShapeSerializer<string | Uint8Array>;
protected deserializer: ShapeDeserializer<string | Uint8Array>;
private readonly codec;
private readonly mixin;
constructor({
defaultNamespace,
errorTypeRegistries,
}: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
});
getShapeId(): string;
getPayloadCodec(): JsonCodec;
setSerdeContext(serdeContext: SerdeFunctions): void;
serializeRequest<Input extends object>(
operationSchema: OperationSchema,
input: Input,
context: HandlerExecutionContext & SerdeFunctions & EndpointBearer,
): Promise<HttpRequest>;
deserializeResponse<Output extends MetadataBearer>(
operationSchema: OperationSchema,
context: HandlerExecutionContext & SerdeFunctions,
response: HttpResponse,
): Promise<Output>;
protected handleError(
operationSchema: OperationSchema,
context: HandlerExecutionContext & SerdeFunctions,
response: HttpResponse,
dataObject: any,
metadata: ResponseMetadata,
): Promise<never>;
protected getDefaultContentType(): string;
}
import { Codec, CodecSettings } from "@smithy/types";
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
import { JsonShapeDeserializer } from "./JsonShapeDeserializer";
import { JsonShapeSerializer } from "./JsonShapeSerializer";
/**
* @public
*/
import { JsonShapeDeserializer } from "./codec-v1/JsonShapeDeserializer";
import { JsonShapeSerializer } from "./codec-v1/JsonShapeSerializer";
export type JsonSettings = CodecSettings & {
jsonName: boolean;
jsonName: boolean;
};
/**
* @public
*/
export declare class JsonCodec extends SerdeContextConfig implements Codec<string, string> {
readonly settings: JsonSettings;
constructor(settings: JsonSettings);
createSerializer(): JsonShapeSerializer;
createDeserializer(): JsonShapeDeserializer;
readonly settings: JsonSettings;
constructor(settings: JsonSettings);
createSerializer(): JsonShapeSerializer;
createDeserializer(): JsonShapeDeserializer;
}

@@ -1,21 +0,7 @@

/**
* Serializes BigInt and NumericValue to JSON-number.
* @internal
*/
export declare class JsonReplacer {
/**
* Stores placeholder key to true serialized value lookup.
*/
private readonly values;
private counter;
private stage;
/**
* Creates a jsonReplacer function that reserves big integer and big decimal values
* for later replacement.
*/
createReplacer(): (key: string, value: unknown) => unknown;
/**
* Replaces placeholder keys with their true values.
*/
replaceInJson(json: string): string;
private readonly values;
private counter;
private stage;
createReplacer(): (key: string, value: unknown) => unknown;
replaceInJson(json: string): string;
}

@@ -1,15 +0,7 @@

/**
* @param key - JSON object key.
* @param value - parsed value.
* @param context - original JSON string for reference. Not available until Node.js 21 and unavailable in Safari as
* of April 2025.
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#browser_compatibility
*
* @internal
*
* @returns transformed value.
*/
export declare function jsonReviver(key: string, value: any, context?: {
export declare function jsonReviver(
key: string,
value: any,
context?: {
source?: string;
}): any;
},
): any;
import { Schema } from "@smithy/types";
/**
* Determines whether a schema tree contains BigInteger or BigDecimal members,
* which require a JSON.parse reviver to preserve numeric precision.
*
* The result is cached on the root static schema array (struct schemas) via a Symbol key,
* so subsequent calls for the same schema are O(1).
*
* @internal
*/
export declare function needsReviver(schema: Schema): boolean;
import { HttpResponse, Schema, SerdeFunctions } from "@smithy/types";
/**
* @deprecated new calls to parseJsonBody must pass schema.
* @internal
*/
export declare function parseJsonBody(streamBody: any, context: SerdeFunctions): Promise<any>;
/**
* @internal
*/
export declare function parseJsonBody(streamBody: any, context: SerdeFunctions, schema: Schema): Promise<any>;
/**
* @internal
*/
export declare function parseJsonBody(
streamBody: any,
context: SerdeFunctions,
schema: Schema,
): Promise<any>;
export declare const parseJsonErrorBody: (errorBody: any, context: SerdeFunctions) => Promise<any>;
/**
* @internal
*/
export declare const loadRestJsonErrorCode: (output: HttpResponse, data: any) => string | undefined;
/**
* @internal
*/
export declare const loadJsonRpcErrorCode: (output: HttpResponse, data: any, queryCompat?: boolean) => string | undefined;
export declare const loadJsonRpcErrorCode: (
output: HttpResponse,
data: any,
queryCompat?: boolean,
) => string | undefined;
import { ServiceException as SDKBaseServiceException } from "@smithy/core/client";
import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
import { HttpResponse as IHttpResponse, MetadataBearer, ResponseMetadata, StaticErrorSchema } from "@smithy/types";
/**
* @internal
*/
import {
HttpResponse as IHttpResponse,
MetadataBearer,
ResponseMetadata,
StaticErrorSchema,
} from "@smithy/types";
type ErrorMetadataBearer = MetadataBearer & {
$fault: "client" | "server";
$fault: "client" | "server";
};
/**
* Shared code for Protocols.
*
* @internal
*/
export declare class ProtocolLib {
private queryCompat;
private errorRegistry?;
constructor(queryCompat?: boolean);
/**
* This is only for REST protocols.
*
* @param defaultContentType - of the protocol.
* @param inputSchema - schema for which to determine content type.
*
* @returns content-type header value or undefined when not applicable.
*/
resolveRestContentType(defaultContentType: string, inputSchema: NormalizedSchema): string | undefined;
/**
* Shared code for finding error schema or throwing an unmodeled base error.
* @returns error schema and error metadata.
*
* @throws ServiceBaseException or generic Error if no error schema could be found.
*/
getErrorSchemaOrThrowBaseException(errorIdentifier: string, defaultNamespace: string, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata, getErrorSchema?: (registry: TypeRegistry, errorName: string) => StaticErrorSchema): Promise<{
errorSchema: StaticErrorSchema;
errorMetadata: ErrorMetadataBearer;
}>;
/**
* This method exists because in older clients, no `errorTypeRegistries` array is provided to the Protocol
* implementation. This means that the TypeRegistry queried by the error's namespace or the service's defaultNamespace
* must be composed into the possibly-empty local compositeErrorRegistry.
*
*
* @param composite - TypeRegistry instance local to instances of HttpProtocol. In newer clients, this instance directly
* receives the error registries exported by the client.
* @param errorIdentifier - parsed from the response, used to look up the error schema within the registry.
* @param defaultNamespace - property of the Protocol implementation pointing to a specific service.
*/
compose(composite: TypeRegistry, errorIdentifier: string, defaultNamespace: string): void;
/**
* Assigns additions onto exception if not already present.
*/
decorateServiceException<E extends SDKBaseServiceException>(exception: E, additions?: Record<string, any>): E;
/**
* Reads the x-amzn-query-error header for awsQuery compatibility.
*
* @param output - values that will be assigned to an error object.
* @param response - from which to read awsQueryError headers.
*/
setQueryCompatError(output: Record<string, any>, response: IHttpResponse): void;
/**
* Assigns Error, Type, Code from the awsQuery error object to the output error object.
* @param queryCompatErrorData - query compat error object.
* @param errorData - canonical error object returned to the caller.
*/
queryCompatOutput(queryCompatErrorData: any, errorData: any): void;
/**
* Finds the canonical modeled error using the awsQueryError alias.
* @param registry - service error registry.
* @param errorName - awsQueryError name or regular qualified shapeId.
*/
findQueryCompatibleError(registry: TypeRegistry, errorName: string): StaticErrorSchema;
private queryCompat;
private errorRegistry?;
constructor(queryCompat?: boolean);
resolveRestContentType(
defaultContentType: string,
inputSchema: NormalizedSchema,
): string | undefined;
getErrorSchemaOrThrowBaseException(
errorIdentifier: string,
defaultNamespace: string,
response: IHttpResponse,
dataObject: any,
metadata: ResponseMetadata,
getErrorSchema?: (registry: TypeRegistry, errorName: string) => StaticErrorSchema,
): Promise<{
errorSchema: StaticErrorSchema;
errorMetadata: ErrorMetadataBearer;
}>;
compose(composite: TypeRegistry, errorIdentifier: string, defaultNamespace: string): void;
decorateServiceException<E extends SDKBaseServiceException>(
exception: E,
additions?: Record<string, any>,
): E;
setQueryCompatError(output: Record<string, any>, response: IHttpResponse): void;
queryCompatOutput(queryCompatErrorData: any, errorData: any): void;
findQueryCompatibleError(registry: TypeRegistry, errorName: string): StaticErrorSchema;
}
export {};
import { TypeRegistry } from "@smithy/core/schema";
import { AwsQueryProtocol } from "./AwsQueryProtocol";
/**
* @public
*/
export declare class AwsEc2QueryProtocol extends AwsQueryProtocol {
options: {
defaultNamespace: string;
xmlNamespace: string;
version: string;
errorTypeRegistries?: TypeRegistry[];
};
constructor(options: {
defaultNamespace: string;
xmlNamespace: string;
version: string;
errorTypeRegistries?: TypeRegistry[];
});
/**
* @override
*/
getShapeId(): string;
/**
* EC2 Query reads XResponse.XResult instead of XResponse directly.
*/
protected useNestedResult(): boolean;
options: {
defaultNamespace: string;
xmlNamespace: string;
version: string;
errorTypeRegistries?: TypeRegistry[];
};
constructor(options: {
defaultNamespace: string;
xmlNamespace: string;
version: string;
errorTypeRegistries?: TypeRegistry[];
});
getShapeId(): string;
protected useNestedResult(): boolean;
}
import { RpcProtocol } from "@smithy/core/protocols";
import { TypeRegistry } from "@smithy/core/schema";
import { Codec, EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, SerdeFunctions } from "@smithy/types";
import {
Codec,
EndpointBearer,
HandlerExecutionContext,
HttpRequest,
HttpResponse as IHttpResponse,
MetadataBearer,
OperationSchema,
ResponseMetadata,
SerdeFunctions,
} from "@smithy/types";
import { XmlShapeDeserializer } from "../xml/XmlShapeDeserializer";
import { QueryShapeSerializer } from "./QueryShapeSerializer";
/**
* @public
*/
export declare class AwsQueryProtocol extends RpcProtocol {
options: {
defaultNamespace: string;
xmlNamespace: string;
version: string;
errorTypeRegistries?: TypeRegistry[];
};
protected serializer: QueryShapeSerializer;
protected deserializer: XmlShapeDeserializer;
private readonly mixin;
constructor(options: {
defaultNamespace: string;
xmlNamespace: string;
version: string;
errorTypeRegistries?: TypeRegistry[];
});
getShapeId(): string;
setSerdeContext(serdeContext: SerdeFunctions): void;
getPayloadCodec(): Codec<any, any>;
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<HttpRequest>;
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
/**
* EC2 Query overrides this.
*/
protected useNestedResult(): boolean;
/**
* override
*/
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
/**
* The variations in the error and error message locations are attributed to
* divergence between AWS Query and EC2 Query behavior.
*/
protected loadQueryErrorCode(output: IHttpResponse, data: any): string | undefined;
protected loadQueryError(data: any): any | undefined;
protected loadQueryErrorMessage(data: any): string;
/**
* @override
*/
protected getDefaultContentType(): string;
options: {
defaultNamespace: string;
xmlNamespace: string;
version: string;
errorTypeRegistries?: TypeRegistry[];
};
protected serializer: QueryShapeSerializer;
protected deserializer: XmlShapeDeserializer;
private readonly mixin;
constructor(options: {
defaultNamespace: string;
xmlNamespace: string;
version: string;
errorTypeRegistries?: TypeRegistry[];
});
getShapeId(): string;
setSerdeContext(serdeContext: SerdeFunctions): void;
getPayloadCodec(): Codec<any, any>;
serializeRequest<Input extends object>(
operationSchema: OperationSchema,
input: Input,
context: HandlerExecutionContext & SerdeFunctions & EndpointBearer,
): Promise<HttpRequest>;
deserializeResponse<Output extends MetadataBearer>(
operationSchema: OperationSchema,
context: HandlerExecutionContext & SerdeFunctions,
response: IHttpResponse,
): Promise<Output>;
protected useNestedResult(): boolean;
protected handleError(
operationSchema: OperationSchema,
context: HandlerExecutionContext & SerdeFunctions,
response: IHttpResponse,
dataObject: any,
metadata: ResponseMetadata,
): Promise<never>;
protected loadQueryErrorCode(output: IHttpResponse, data: any): string | undefined;
protected loadQueryError(data: any): any | undefined;
protected loadQueryErrorMessage(data: any): string;
protected getDefaultContentType(): string;
}
import { CodecSettings } from "@smithy/types";
/**
* @internal
*/
export type QuerySerializerSettings = CodecSettings & {
capitalizeKeys?: boolean;
flattenLists?: boolean;
serializeEmptyLists?: boolean;
/**
* Whether to read from ec2QueryName before xmlName.
*/
ec2?: boolean;
capitalizeKeys?: boolean;
flattenLists?: boolean;
serializeEmptyLists?: boolean;
ec2?: boolean;
};
import { Schema, ShapeSerializer } from "@smithy/types";
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
import { QuerySerializerSettings } from "./QuerySerializerSettings";
/**
* @public
*/
export declare class QueryShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string | Uint8Array> {
readonly settings: QuerySerializerSettings;
private buffer;
constructor(settings: QuerySerializerSettings);
write(schema: Schema, value: unknown, prefix?: string): void;
flush(): string | Uint8Array;
protected getKey(memberName: string, xmlName?: string, ec2QueryName?: unknown, keySource?: string): string;
protected writeKey(key: string): void;
protected writeValue(value: string): void;
export declare class QueryShapeSerializer
extends SerdeContextConfig
implements ShapeSerializer<string | Uint8Array>
{
readonly settings: QuerySerializerSettings;
private buffer;
constructor(settings: QuerySerializerSettings);
write(schema: Schema, value: unknown, prefix?: string): void;
flush(): string | Uint8Array;
protected getKey(
memberName: string,
xmlName?: string,
ec2QueryName?: unknown,
keySource?: string,
): string;
protected writeKey(key: string): void;
protected writeValue(value: string): void;
}

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

/**
* Helper for identifying unknown union members during deserialization.
*/
export declare class UnionSerde {
private from;
private to;
private keys;
constructor(from: any, to: any);
/**
* Marks the key as being a known member.
* @param key - to mark.
*/
mark(key: string): void;
/**
* @returns whether only one key remains unmarked and nothing has been written,
* implying the object is a union.
*/
hasUnknown(): boolean;
/**
* Writes the unknown key-value pair, if present, into the $unknown property
* of the union object.
*/
writeUnknown(): void;
private from;
private to;
private keys;
constructor(from: any, to: any);
mark(key: string): void;
hasUnknown(): boolean;
writeUnknown(): void;
}

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

/**
* Makes __proto__ writable on a given object.
*/
export declare function writeKey(obj: object | Record<string, unknown> | any): void;
import { HttpBindingProtocol } from "@smithy/core/protocols";
import { TypeRegistry } from "@smithy/core/schema";
import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
import {
EndpointBearer,
HandlerExecutionContext,
HttpRequest as IHttpRequest,
HttpResponse as IHttpResponse,
MetadataBearer,
OperationSchema,
ResponseMetadata,
SerdeFunctions,
ShapeDeserializer,
ShapeSerializer,
} from "@smithy/types";
import { XmlCodec } from "./XmlCodec";
/**
* @public
*/
export declare class AwsRestXmlProtocol extends HttpBindingProtocol {
private readonly codec;
protected serializer: ShapeSerializer<string | Uint8Array>;
protected deserializer: ShapeDeserializer<string | Uint8Array>;
private readonly mixin;
constructor(options: {
defaultNamespace: string;
xmlNamespace: string;
errorTypeRegistries?: TypeRegistry[];
});
getPayloadCodec(): XmlCodec;
getShapeId(): string;
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
/**
* @override
*/
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
/**
* @override
*/
protected getDefaultContentType(): string;
private hasUnstructuredPayloadBinding;
private readonly codec;
protected serializer: ShapeSerializer<string | Uint8Array>;
protected deserializer: ShapeDeserializer<string | Uint8Array>;
private readonly mixin;
constructor(options: {
defaultNamespace: string;
xmlNamespace: string;
errorTypeRegistries?: TypeRegistry[];
});
getPayloadCodec(): XmlCodec;
getShapeId(): string;
serializeRequest<Input extends object>(
operationSchema: OperationSchema,
input: Input,
context: HandlerExecutionContext & SerdeFunctions & EndpointBearer,
): Promise<IHttpRequest>;
deserializeResponse<Output extends MetadataBearer>(
operationSchema: OperationSchema,
context: HandlerExecutionContext & SerdeFunctions,
response: IHttpResponse,
): Promise<Output>;
protected handleError(
operationSchema: OperationSchema,
context: HandlerExecutionContext & SerdeFunctions,
response: IHttpResponse,
dataObject: any,
metadata: ResponseMetadata,
): Promise<never>;
protected getDefaultContentType(): string;
private hasUnstructuredPayloadBinding;
}
import { HttpResponse, SerdeContext } from "@smithy/types";
/**
* @internal
*/
export declare const parseXmlBody: (streamBody: any, context: SerdeContext) => any;
/**
* @internal
*/
export declare const parseXmlErrorBody: (errorBody: any, context: SerdeContext) => Promise<any>;
/**
* @internal
*/
export declare const loadRestXmlErrorCode: (output: HttpResponse, data: any) => string | undefined;

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

/**
* Formats XML, for testing only.
* @internal
* @deprecated don't use in runtime code.
*/
export declare function simpleFormatXml(xml: string): string;

@@ -6,10 +6,13 @@ import { Codec, CodecSettings } from "@smithy/types";

export type XmlSettings = CodecSettings & {
xmlNamespace: string;
serviceNamespace: string;
xmlNamespace: string;
serviceNamespace: string;
};
export declare class XmlCodec extends SerdeContextConfig implements Codec<Uint8Array | string, Uint8Array | string> {
readonly settings: XmlSettings;
constructor(settings: XmlSettings);
createSerializer(): XmlShapeSerializer;
createDeserializer(): XmlShapeDeserializer;
export declare class XmlCodec
extends SerdeContextConfig
implements Codec<Uint8Array | string, Uint8Array | string>
{
readonly settings: XmlSettings;
constructor(settings: XmlSettings);
createSerializer(): XmlShapeSerializer;
createDeserializer(): XmlShapeDeserializer;
}
import { Schema, SerdeFunctions, ShapeDeserializer } from "@smithy/types";
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
import { XmlSettings } from "./XmlCodec";
/**
* @public
*/
export declare class XmlShapeDeserializer extends SerdeContextConfig implements ShapeDeserializer<Uint8Array | string> {
readonly settings: XmlSettings;
private stringDeserializer;
constructor(settings: XmlSettings);
setSerdeContext(serdeContext: SerdeFunctions): void;
/**
* @param schema - describing the data.
* @param bytes - serialized data.
* @param key - used by AwsQuery to step one additional depth into the object before reading it.
*/
read(schema: Schema, bytes: Uint8Array | string, key?: string): any;
readSchema(_schema: Schema, value: any): any;
protected parseXml(xml: string): any;
export declare class XmlShapeDeserializer
extends SerdeContextConfig
implements ShapeDeserializer<Uint8Array | string>
{
readonly settings: XmlSettings;
private stringDeserializer;
constructor(settings: XmlSettings);
setSerdeContext(serdeContext: SerdeFunctions): void;
read(schema: Schema, bytes: Uint8Array | string, key?: string): any;
readSchema(_schema: Schema, value: any): any;
protected parseXml(xml: string): any;
}
import { Schema as ISchema, ShapeSerializer } from "@smithy/types";
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
import { XmlSettings } from "./XmlCodec";
/**
* @public
*/
export declare class XmlShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string | Uint8Array> {
readonly settings: XmlSettings;
private stringBuffer?;
private byteBuffer?;
private buffer?;
constructor(settings: XmlSettings);
write(schema: ISchema, value: unknown): void;
flush(): string | Uint8Array;
private writeStruct;
private writeList;
private writeMap;
private writeSimple;
private writeSimpleInto;
private getXmlnsAttribute;
export declare class XmlShapeSerializer
extends SerdeContextConfig
implements ShapeSerializer<string | Uint8Array>
{
readonly settings: XmlSettings;
private stringBuffer?;
private byteBuffer?;
private buffer?;
constructor(settings: XmlSettings);
write(schema: ISchema, value: unknown): void;
flush(): string | Uint8Array;
private writeStruct;
private writeList;
private writeMap;
private writeSimple;
private writeSimpleInto;
private getXmlnsAttribute;
}

@@ -1,32 +0,14 @@

/**
* @internal
*/
export interface ARN {
partition: string;
service: string;
region: string;
accountId: string;
resource: string;
partition: string;
service: string;
region: string;
accountId: string;
resource: string;
}
/**
* Validate whether a string is an ARN.
* @internal
*/
export declare const validate: (str: any) => boolean;
/**
* Parse an ARN string into structure with partition, service, region, accountId and resource values
* @internal
*/
export declare const parse: (arn: string) => ARN;
/**
* @internal
*/
type buildOptions = Pick<ARN, Exclude<keyof ARN, "partition">> & {
partition?: string;
partition?: string;
};
/**
* Build an ARN with service, partition, region, accountId, and resources strings
* @internal
*/
export declare const build: (arnObject: buildOptions) => string;
export {};
import { HttpRequest } from "@smithy/types";
export declare function formatUrl(request: Pick<HttpRequest, Exclude<keyof HttpRequest, "headers" | "method">>): string;
export declare function formatUrl(
request: Pick<HttpRequest, Exclude<keyof HttpRequest, "headers" | "method">>,
): string;
{
"name": "@aws-sdk/core",
"version": "3.977.1",
"version": "3.977.2",
"description": "Core functions & classes shared by multiple AWS SDK clients.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages-internal/core",

import { determineTimestampFormat } from "@smithy/core/protocols";
import { NormalizedSchema } from "@smithy/core/schema";
import { LazyJsonString, NumericValue, parseEpochTimestamp, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, } from "@smithy/core/serde";
import { fromBase64 } from "@smithy/core/serde";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import { UnionSerde } from "../../UnionSerde";
import { detectBufferParsing } from "../detectBufferParsing";
import { jsonReviver } from "../jsonReviver";
import { needsReviver } from "../needsReviver";
import { parseJsonBody } from "../parseJsonBody";
import { writeKey } from "../../writeKey";
export class BufferJsonShapeDeserializer extends SerdeContextConfig {
settings;
constructor(settings) {
super();
this.settings = settings;
}
async read(schema, data) {
const reviver = needsReviver(schema) ? jsonReviver : undefined;
let parsed;
if (typeof data === "string") {
parsed = JSON.parse(data, reviver);
}
else if (data instanceof Uint8Array && detectBufferParsing()) {
const buf = Buffer.isBuffer(data) ? data : Buffer.from(data.buffer, data.byteOffset, data.byteLength);
parsed = JSON.parse(buf, reviver);
}
else {
parsed = await parseJsonBody(data, this.serdeContext);
}
return this._read(schema, parsed);
}
readObject(schema, data) {
return this._read(schema, data);
}
_read(schema, value) {
const isObject = value !== null && typeof value === "object";
const ns = NormalizedSchema.of(schema);
if (isObject) {
if (ns.isStructSchema()) {
return this._readStruct(ns, value);
}
if (Array.isArray(value) && ns.isListSchema()) {
const listMember = ns.getValueSchema();
for (let i = 0; i < value.length; ++i) {
value[i] = this._read(listMember, value[i]);
}
return value;
}
if (ns.isMapSchema()) {
const mapMember = ns.getValueSchema();
const map = value;
for (const k in map) {
if (k === "__proto__") {
writeKey(map);
}
map[k] = this._read(mapMember, map[k]);
}
return map;
}
}
if (ns.isBlobSchema() && typeof value === "string") {
return fromBase64(value);
}
const mediaType = ns.getMergedTraits().mediaType;
if (ns.isStringSchema() && typeof value === "string" && mediaType) {
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
if (isJson) {
return LazyJsonString.from(value);
}
return value;
}
if (ns.isTimestampSchema() && value != null) {
const format = determineTimestampFormat(ns, this.settings);
switch (format) {
case 5:
return parseRfc3339DateTimeWithOffset(value);
case 6:
return parseRfc7231DateTime(value);
case 7:
return parseEpochTimestamp(value);
default:
console.warn("Missing timestamp format, parsing value with Date constructor:", value);
return new Date(value);
}
}
if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) {
return BigInt(value);
}
if (ns.isBigDecimalSchema() && value != undefined) {
if (value instanceof NumericValue) {
return value;
}
const untyped = value;
if (untyped.type === "bigDecimal" && "string" in untyped) {
return new NumericValue(untyped.string, untyped.type);
}
return new NumericValue(String(value), "bigDecimal");
}
if (ns.isNumericSchema() && typeof value === "string") {
switch (value) {
case "Infinity":
return Infinity;
case "-Infinity":
return -Infinity;
case "NaN":
return NaN;
}
return value;
}
if (ns.isDocumentSchema()) {
if (isObject) {
if (Array.isArray(value)) {
for (let i = 0; i < value.length; ++i) {
const v = value[i];
if (!(v instanceof NumericValue)) {
value[i] = this._read(ns, v);
}
}
}
else {
const doc = value;
for (const k in doc) {
if (k === "__proto__") {
writeKey(doc);
}
const v = doc[k];
if (!(v instanceof NumericValue)) {
doc[k] = this._read(ns, v);
}
}
}
return value;
}
else {
return value;
}
}
return value;
}
_readStruct(ns, record) {
const union = ns.isUnionSchema();
const out = {};
let nameMap = void 0;
const { jsonName } = this.settings;
if (jsonName) {
nameMap = {};
}
let unionSerde;
if (union) {
unionSerde = new UnionSerde(record, out);
}
for (const [memberName, memberSchema] of ns.structIterator()) {
let fromKey = memberName;
if (jsonName) {
fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
nameMap[fromKey] = memberName;
}
if (union) {
unionSerde.mark(fromKey);
}
if (record[fromKey] != null) {
out[memberName] = this._read(memberSchema, record[fromKey]);
}
}
if (union) {
unionSerde.writeUnknown();
}
else if (typeof record.__type === "string") {
for (const k in record) {
const v = record[k];
const t = jsonName ? (nameMap[k] ?? k) : k;
if (!(t in out)) {
out[t] = v;
}
}
}
return out;
}
}
import { determineTimestampFormat } from "@smithy/core/protocols";
import { NormalizedSchema } from "@smithy/core/schema";
import { dateToUtcString, generateIdempotencyToken, LazyJsonString, NumericValue, toBase64 } from "@smithy/core/serde";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import { writeKey } from "../../writeKey";
const encoder = new TextEncoder();
const OPEN_BRACE = 0x7b;
const CLOSE_BRACE = 0x7d;
const OPEN_BRACKET = 0x5b;
const CLOSE_BRACKET = 0x5d;
const QUOTE = 0x22;
const COLON = 0x3a;
const COMMA = 0x2c;
const BACKSLASH = 0x5c;
const TRUE = new Uint8Array([0x74, 0x72, 0x75, 0x65]);
const FALSE = new Uint8Array([0x66, 0x61, 0x6c, 0x73, 0x65]);
const NULL = new Uint8Array([0x6e, 0x75, 0x6c, 0x6c]);
const ESCAPE_TABLE = new Array(128).fill(null);
ESCAPE_TABLE[0x08] = "b";
ESCAPE_TABLE[0x09] = "t";
ESCAPE_TABLE[0x0a] = "n";
ESCAPE_TABLE[0x0c] = "f";
ESCAPE_TABLE[0x0d] = "r";
ESCAPE_TABLE[0x22] = '"';
ESCAPE_TABLE[0x5c] = "\\";
for (let i = 0; i < 0x20; i++) {
if (ESCAPE_TABLE[i] === null) {
ESCAPE_TABLE[i] = "u00" + i.toString(16).padStart(2, "0");
}
}
const INITIAL_BUFFER_SIZE = 2048;
function alloc(size) {
return typeof Buffer !== "undefined" ? Buffer.allocUnsafe(size) : new Uint8Array(size);
}
export class ByteJsonShapeSerializer extends SerdeContextConfig {
settings;
json;
i = 0;
rootSchema;
constructor(settings) {
super();
this.settings = settings;
this.json = alloc(INITIAL_BUFFER_SIZE);
}
write(schema, value) {
this.i = 0;
this.rootSchema = NormalizedSchema.of(schema);
this.writeValue(this.rootSchema, value, undefined);
}
writeDiscriminatedDocument(schema, value) {
this.i = 0;
this.rootSchema = NormalizedSchema.of(schema);
const ns = this.rootSchema;
if (ns.isStructSchema() && value != null && typeof value === "object") {
this.ensure(2);
this.json[this.i++] = OPEN_BRACE;
this.writeAsciiQuoted("__type");
this.json[this.i++] = COLON;
this.writeAsciiQuoted(ns.getName(true) ?? "Unknown");
let wroteAny = true;
const { jsonName } = this.settings;
for (const [memberName, memberSchema] of ns.structIterator()) {
const item = value[memberName];
if (item == null && !memberSchema.isIdempotencyToken()) {
continue;
}
if (wroteAny) {
this.ensure(1);
this.json[this.i++] = COMMA;
}
const targetKey = jsonName ? (memberSchema.getMergedTraits().jsonName ?? memberName) : memberName;
this.writeAsciiQuoted(targetKey);
this.json[this.i++] = COLON;
this.writeValue(memberSchema, item, ns);
wroteAny = true;
}
this.ensure(1);
this.json[this.i++] = CLOSE_BRACE;
}
else {
this.writeValue(ns, value, undefined);
}
}
flush() {
this.rootSchema = undefined;
const finalPosition = this.i;
this.i = 0;
const result = this.json.subarray(0, finalPosition);
this.json = alloc(INITIAL_BUFFER_SIZE);
return result;
}
ensure(byteCount) {
const { i, json } = this;
if (i + byteCount > json.length) {
let newSize = json.length * 2;
while (newSize < i + byteCount) {
newSize *= 2;
}
const next = alloc(newSize);
next.set(this.json);
this.json = next;
}
}
writeAscii(s) {
const z = s.length;
this.ensure(z);
let { i, json } = this;
for (let j = 0; j < z; ++j) {
json[i] = s.charCodeAt(j);
i += 1;
}
this.i = i;
}
writeAsciiQuoted(s) {
const z = s.length;
this.ensure(z + 4);
let { json, i } = this;
json[i++] = QUOTE;
for (let j = 0; j < z; ++j) {
json[i++] = s.charCodeAt(j);
}
json[i++] = QUOTE;
this.i = i;
}
writeJsonString(s) {
this.ensure(s.length * 2 + 2);
this.json[this.i++] = QUOTE;
const z = s.length;
for (let j = 0; j < z; ++j) {
const c = s.charCodeAt(j);
if (c > 0x22 && c < 0x5c) {
this.json[this.i++] = c;
}
else if (c < 0x80) {
const esc = ESCAPE_TABLE[c];
if (esc !== null) {
this.ensure(esc.length + 1);
this.json[this.i++] = BACKSLASH;
for (let k = 0; k < esc.length; k++) {
this.json[this.i++] = esc.charCodeAt(k);
}
}
else {
this.json[this.i++] = c;
}
}
else if (c >= 0xd800 && c <= 0xdbff) {
const next = j + 1 < z ? s.charCodeAt(j + 1) : 0;
if (next >= 0xdc00 && next <= 0xdfff) {
this.ensure(4);
const { written } = encoder.encodeInto(s.substring(j, j + 2), this.json.subarray(this.i));
this.i += written;
j++;
}
else {
this.ensure(6);
this.writeUnicodeEscape(c);
}
}
else if (c >= 0xdc00 && c <= 0xdfff) {
this.ensure(6);
this.writeUnicodeEscape(c);
}
else {
let { i, json } = this;
if (c < 0x800) {
json[i++] = 0xc0 | (c >> 6);
json[i++] = 0x80 | (c & 0x3f);
}
else {
json[i++] = 0xe0 | (c >> 12);
json[i++] = 0x80 | ((c >> 6) & 0x3f);
json[i++] = 0x80 | (c & 0x3f);
}
this.i = i;
}
}
this.json[this.i++] = QUOTE;
}
writeUnicodeEscape(code) {
let { json, i } = this;
json[i++] = BACKSLASH;
json[i++] = 0x75;
const hex = code.toString(16).padStart(4, "0");
for (let j = 0; j < 4; ++j) {
json[i++] = hex.charCodeAt(j);
}
this.i = i;
}
static B64 = (() => {
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const table = new Uint8Array(64);
for (let i = 0; i < 64; i++)
table[i] = chars.charCodeAt(i);
return table;
})();
writeBase64(data) {
const b64Len = Math.ceil(data.length / 3) * 4;
this.ensure(b64Len + 2);
const json = this.json;
const B64 = ByteJsonShapeSerializer.B64;
let i = this.i;
json[i++] = QUOTE;
const len = data.length;
const remainder = len % 3;
const mainLen = len - remainder;
for (let j = 0; j < mainLen; j += 3) {
const a = data[j];
const b = data[j + 1];
const c = data[j + 2];
json[i++] = B64[a >> 2];
json[i++] = B64[((a & 0x03) << 4) | (b >> 4)];
json[i++] = B64[((b & 0x0f) << 2) | (c >> 6)];
json[i++] = B64[c & 0x3f];
}
if (remainder === 2) {
const a = data[mainLen];
const b = data[mainLen + 1];
json[i++] = B64[a >> 2];
json[i++] = B64[((a & 0x03) << 4) | (b >> 4)];
json[i++] = B64[(b & 0x0f) << 2];
json[i++] = 0x3d;
}
else if (remainder === 1) {
const a = data[mainLen];
json[i++] = B64[a >> 2];
json[i++] = B64[(a & 0x03) << 4];
json[i++] = 0x3d;
json[i++] = 0x3d;
}
json[i++] = QUOTE;
this.i = i;
}
writeValue(schema, value, container) {
if (value == null) {
if (container?.isStructSchema()) {
if (value === undefined) {
const ns = NormalizedSchema.of(schema);
if (ns.isIdempotencyToken()) {
this.writeAsciiQuoted(generateIdempotencyToken());
return;
}
}
return;
}
this.ensure(4);
this.json.set(NULL, this.i);
this.i += 4;
return;
}
const ns = NormalizedSchema.of(schema);
const isObject = typeof value === "object";
if (isObject) {
if (ns.isStructSchema()) {
this.writeStruct(ns, value);
return;
}
if (Array.isArray(value) && (ns.isListSchema() || ns.isDocumentSchema())) {
this.writeList(ns, value, ns.isDocumentSchema());
return;
}
if (ns.isMapSchema()) {
this.writeMap(ns, value, false);
return;
}
if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) {
this.writeBase64(value);
return;
}
if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
this.writeTimestamp(ns, value);
return;
}
if (value instanceof NumericValue) {
this.writeAscii(value.string);
return;
}
if (ns.isDocumentSchema()) {
if (Array.isArray(value)) {
this.writeList(ns, value, true);
}
else {
this.writeMap(ns, value, true);
}
return;
}
const json = JSON.stringify(value);
this.writeAscii(json);
return;
}
if (typeof value === "string") {
if (ns.isStringSchema()) {
const mediaType = ns.getMergedTraits().mediaType;
if (mediaType) {
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
if (isJson) {
this.writeJsonString(LazyJsonString.from(value).toString());
return;
}
}
}
if (ns.isBlobSchema()) {
const b64 = (this.serdeContext?.base64Encoder ?? toBase64)(value);
this.writeAsciiQuoted(b64);
return;
}
this.writeJsonString(value);
return;
}
if (typeof value === "number") {
if (ns.isNumericSchema() && (Math.abs(value) === Infinity || isNaN(value))) {
this.writeAsciiQuoted(String(value));
return;
}
const numStr = String(value);
this.writeAscii(numStr);
return;
}
if (typeof value === "boolean") {
this.ensure(5);
if (value) {
this.json.set(TRUE, this.i);
this.i += 4;
}
else {
this.json.set(FALSE, this.i);
this.i += 5;
}
return;
}
if (typeof value === "bigint") {
this.writeAscii(value.toString());
return;
}
this.writeAscii(String(value));
}
writeStruct(ns, value) {
this.ensure(2);
this.json[this.i++] = OPEN_BRACE;
let first = true;
let wroteAny = false;
const hasType = typeof value.__type === "string";
let writtenKeys;
if (hasType) {
writtenKeys = new Set();
}
for (const [memberName, memberSchema] of ns.structIterator()) {
const item = value[memberName];
if (item == null && !memberSchema.isIdempotencyToken())
continue;
if (!first) {
this.ensure(1);
this.json[this.i++] = COMMA;
}
first = false;
wroteAny = true;
const targetKey = this.settings.jsonName ? (memberSchema.getMergedTraits().jsonName ?? memberName) : memberName;
if (writtenKeys) {
writtenKeys.add(memberName);
writtenKeys.add(targetKey);
}
this.writeAsciiQuoted(targetKey);
this.json[this.i++] = COLON;
this.writeValue(memberSchema, item, ns);
}
if (!wroteAny && ns.isUnionSchema()) {
const { $unknown } = value;
if (Array.isArray($unknown)) {
const [k, v] = $unknown;
this.writeAsciiQuoted(k);
this.ensure(1);
this.json[this.i++] = COLON;
this.writeValue(15, v, ns);
}
}
else if (hasType) {
for (const k in value) {
const targetKey = this.settings.jsonName ? (writtenKeys.has(k) ? k : k) : k;
if (writtenKeys.has(targetKey))
continue;
writtenKeys.add(targetKey);
const v = value[k];
if (!first) {
this.ensure(1);
this.json[this.i++] = COMMA;
}
first = false;
this.writeAsciiQuoted(targetKey);
this.ensure(1);
this.json[this.i++] = COLON;
this.writeValue(15, v, undefined);
}
}
this.ensure(1);
this.json[this.i++] = CLOSE_BRACE;
}
writeList(ns, value, isDocument) {
this.ensure(2);
this.json[this.i++] = OPEN_BRACKET;
const sparse = !!ns.getMergedTraits().sparse;
const valueSchema = ns.getValueSchema();
for (let i = 0; i < value.length; ++i) {
const item = value[i];
if (isDocument ? item === undefined : item == null && !sparse) {
continue;
}
if (i !== 0) {
this.ensure(1);
this.json[this.i++] = COMMA;
}
this.writeValue(valueSchema, item, undefined);
}
this.ensure(1);
this.json[this.i++] = CLOSE_BRACKET;
}
writeMap(ns, value, isDocument) {
const sparse = !!ns.getMergedTraits().sparse;
const valueSchema = ns.getValueSchema();
if (!isDocument) {
if (valueSchema.isStringSchema() || valueSchema.isNumericSchema() || valueSchema.isBooleanSchema()) {
let input = value;
if (sparse) {
input = {};
for (const k in value) {
if (k === "__proto__") {
writeKey(input);
}
input[k] = value[k] ?? null;
}
}
const json = JSON.stringify(input);
this.ensure(json.length * 3);
const { written } = encoder.encodeInto(json, this.json.subarray(this.i));
this.i += written;
return;
}
}
this.ensure(2);
this.json[this.i++] = OPEN_BRACE;
let first = true;
for (const k in value) {
const v = value[k];
if (isDocument ? v === undefined : v == null && !sparse) {
continue;
}
if (!first) {
this.ensure(1);
this.json[this.i++] = COMMA;
}
first = false;
this.writeJsonString(k);
this.ensure(1);
this.json[this.i++] = COLON;
this.writeValue(valueSchema, v, undefined);
}
this.ensure(1);
this.json[this.i++] = CLOSE_BRACE;
}
writeTimestamp(ns, value) {
const format = determineTimestampFormat(ns, this.settings);
switch (format) {
case 5: {
const iso = value.toISOString().replace(".000Z", "Z");
this.writeAsciiQuoted(iso);
return;
}
case 6: {
this.writeAsciiQuoted(dateToUtcString(value));
return;
}
case 7: {
const epochSecs = String(value.getTime() / 1000);
this.writeAscii(epochSecs);
return;
}
default: {
const epochSecs = String(value.getTime() / 1000);
this.writeAscii(epochSecs);
return;
}
}
}
}
import { determineTimestampFormat } from "@smithy/core/protocols";
import { NormalizedSchema } from "@smithy/core/schema";
import { LazyJsonString, NumericValue, parseEpochTimestamp, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, } from "@smithy/core/serde";
import { fromBase64 } from "@smithy/core/serde";
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
import { UnionSerde } from "../UnionSerde";
import { jsonReviver } from "./jsonReviver";
import { needsReviver } from "./needsReviver";
import { parseJsonBody } from "./parseJsonBody";
import { writeKey } from "../writeKey";
export class JsonShapeDeserializer extends SerdeContextConfig {
settings;
constructor(settings) {
super();
this.settings = settings;
}
async read(schema, data) {
const reviver = needsReviver(schema) ? jsonReviver : undefined;
return this._read(schema, typeof data === "string" ? JSON.parse(data, reviver) : await parseJsonBody(data, this.serdeContext, schema));
}
readObject(schema, data) {
return this._read(schema, data);
}
_read(schema, value) {
const isObject = value !== null && typeof value === "object";
const ns = NormalizedSchema.of(schema);
if (isObject) {
if (ns.isStructSchema()) {
const record = value;
const union = ns.isUnionSchema();
const out = {};
let nameMap = void 0;
const { jsonName } = this.settings;
if (jsonName) {
nameMap = {};
}
let unionSerde;
if (union) {
unionSerde = new UnionSerde(record, out);
}
for (const [memberName, memberSchema] of ns.structIterator()) {
let fromKey = memberName;
if (jsonName) {
fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
nameMap[fromKey] = memberName;
}
if (union) {
unionSerde.mark(fromKey);
}
if (record[fromKey] != null) {
out[memberName] = this._read(memberSchema, record[fromKey]);
}
}
if (union) {
unionSerde.writeUnknown();
}
else if (typeof record.__type === "string") {
for (const k in record) {
const v = record[k];
const t = jsonName ? (nameMap[k] ?? k) : k;
if (!(t in out)) {
out[t] = v;
}
}
}
return out;
}
if (Array.isArray(value) && ns.isListSchema()) {
const listMember = ns.getValueSchema();
const out = [];
for (const item of value) {
out.push(this._read(listMember, item));
}
return out;
}
if (ns.isMapSchema()) {
const mapMember = ns.getValueSchema();
const out = {};
for (const _k in value) {
if (_k === "__proto__") {
writeKey(out);
}
out[_k] = this._read(mapMember, value[_k]);
}
return out;
}
}
if (ns.isBlobSchema() && typeof value === "string") {
return fromBase64(value);
}
const mediaType = ns.getMergedTraits().mediaType;
if (ns.isStringSchema() && typeof value === "string" && mediaType) {
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
if (isJson) {
return LazyJsonString.from(value);
}
return value;
}
if (ns.isTimestampSchema() && value != null) {
const format = determineTimestampFormat(ns, this.settings);
switch (format) {
case 5:
return parseRfc3339DateTimeWithOffset(value);
case 6:
return parseRfc7231DateTime(value);
case 7:
return parseEpochTimestamp(value);
default:
console.warn("Missing timestamp format, parsing value with Date constructor:", value);
return new Date(value);
}
}
if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) {
return BigInt(value);
}
if (ns.isBigDecimalSchema() && value != undefined) {
if (value instanceof NumericValue) {
return value;
}
const untyped = value;
if (untyped.type === "bigDecimal" && "string" in untyped) {
return new NumericValue(untyped.string, untyped.type);
}
return new NumericValue(String(value), "bigDecimal");
}
if (ns.isNumericSchema() && typeof value === "string") {
switch (value) {
case "Infinity":
return Infinity;
case "-Infinity":
return -Infinity;
case "NaN":
return NaN;
}
return value;
}
if (ns.isDocumentSchema()) {
if (isObject) {
const out = Array.isArray(value) ? [] : {};
for (const k in value) {
if (k === "__proto__") {
writeKey(out);
}
const v = value[k];
if (v instanceof NumericValue) {
out[k] = v;
}
else {
out[k] = this._read(ns, v);
}
}
return out;
}
else {
return structuredClone(value);
}
}
return value;
}
}
import { determineTimestampFormat } from "@smithy/core/protocols";
import { NormalizedSchema } from "@smithy/core/schema";
import { dateToUtcString, generateIdempotencyToken, LazyJsonString, NumericValue, toBase64 } from "@smithy/core/serde";
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
import { JsonReplacer } from "./jsonReplacer";
import { writeKey } from "../writeKey";
export class JsonShapeSerializer extends SerdeContextConfig {
settings;
buffer;
useReplacer = false;
rootSchema;
constructor(settings) {
super();
this.settings = settings;
}
write(schema, value) {
this.rootSchema = NormalizedSchema.of(schema);
this.buffer = this._write(this.rootSchema, value);
}
flush() {
const { rootSchema, useReplacer } = this;
this.rootSchema = undefined;
this.useReplacer = false;
if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) {
if (!useReplacer) {
return JSON.stringify(this.buffer);
}
const replacer = new JsonReplacer();
return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0));
}
return this.buffer;
}
writeDiscriminatedDocument(schema, value) {
this.write(schema, value);
if (typeof this.buffer === "object") {
this.buffer.__type = NormalizedSchema.of(schema).getName(true);
}
}
_write(schema, value, container) {
const isObject = value !== null && typeof value === "object";
const ns = NormalizedSchema.of(schema);
if (isObject) {
if (ns.isStructSchema()) {
const record = value;
const out = {};
const { jsonName } = this.settings;
let nameMap = void 0;
if (jsonName) {
nameMap = {};
}
let outCount = 0;
for (const [memberName, memberSchema] of ns.structIterator()) {
const serializableValue = this._write(memberSchema, record[memberName], ns);
if (serializableValue !== undefined) {
let targetKey = memberName;
if (jsonName) {
targetKey = memberSchema.getMergedTraits().jsonName ?? memberName;
nameMap[memberName] = targetKey;
}
out[targetKey] = serializableValue;
outCount++;
}
}
if (ns.isUnionSchema() && outCount === 0) {
const { $unknown } = record;
if (Array.isArray($unknown)) {
const [k, v] = $unknown;
if (k === "__proto__") {
writeKey(out);
}
out[k] = this._write(15, v);
}
}
else if (typeof record.__type === "string") {
for (const k in record) {
const v = record[k];
const targetKey = jsonName ? (nameMap[k] ?? k) : k;
if (!(targetKey in out)) {
out[targetKey] = this._write(15, v);
}
}
}
return out;
}
if (Array.isArray(value) && ns.isListSchema()) {
const listMember = ns.getValueSchema();
const out = [];
const sparse = !!ns.getMergedTraits().sparse;
for (const item of value) {
if (sparse || item != null) {
out.push(this._write(listMember, item));
}
}
return out;
}
if (ns.isMapSchema()) {
const mapMember = ns.getValueSchema();
const out = {};
const sparse = !!ns.getMergedTraits().sparse;
for (const _k in value) {
const _v = value[_k];
if (sparse || _v != null) {
if (_k === "__proto__") {
writeKey(out);
}
out[_k] = this._write(mapMember, _v);
}
}
return out;
}
if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) {
if (ns === this.rootSchema) {
return value;
}
return (this.serdeContext?.base64Encoder ?? toBase64)(value);
}
if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
const format = determineTimestampFormat(ns, this.settings);
switch (format) {
case 5:
return value.toISOString().replace(".000Z", "Z");
case 6:
return dateToUtcString(value);
case 7:
return value.getTime() / 1000;
default:
console.warn("Missing timestamp format, using epoch seconds", value);
return value.getTime() / 1000;
}
}
if (value instanceof NumericValue) {
this.useReplacer = true;
}
}
if (value === null && container?.isStructSchema()) {
return void 0;
}
if (ns.isStringSchema()) {
if (typeof value === "undefined" && ns.isIdempotencyToken()) {
return generateIdempotencyToken();
}
const mediaType = ns.getMergedTraits().mediaType;
if (value != null && mediaType) {
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
if (isJson) {
return LazyJsonString.from(value);
}
}
return value;
}
if (typeof value === "number" && ns.isNumericSchema()) {
if (Math.abs(value) === Infinity || isNaN(value)) {
return String(value);
}
return value;
}
if (typeof value === "string" && ns.isBlobSchema()) {
if (ns === this.rootSchema) {
return value;
}
return (this.serdeContext?.base64Encoder ?? toBase64)(value);
}
if (typeof value === "bigint") {
this.useReplacer = true;
}
if (ns.isDocumentSchema()) {
if (isObject) {
const out = Array.isArray(value) ? [] : {};
for (const k in value) {
const v = value[k];
if (k === "__proto__") {
writeKey(out);
}
if (v instanceof NumericValue) {
this.useReplacer = true;
out[k] = v;
}
else {
out[k] = this._write(ns, v);
}
}
return out;
}
else {
return structuredClone(value);
}
}
return value;
}
}
import type { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import type { JsonSettings } from "../JsonCodec";
/**
* Performance-optimized JSON deserializer.
*
* Skips UTF-8 decoding when the runtime supports JSON.parse(Buffer) (Node 22+).
*
* After JSON.parse, lists, maps, and document containers are mutated in place
* (element values are overwritten with their deserialized form) rather than
* copied into new arrays/objects. Structs allocate a fresh object because
* jsonName traits require key renaming, and building the output object
* incrementally lets V8 assign a stable hidden class rather than
* deoptimizing from repeated property deletion/addition on an existing shape.
*
* In-place mutation is safe here because the parsed tree is locally owned
* after JSON.parse with no external references, so rewriting values avoids
* redundant allocation and GC pressure.
*
* @internal
*/
export declare class BufferJsonShapeDeserializer extends SerdeContextConfig implements ShapeDeserializer<string> {
readonly settings: JsonSettings;
constructor(settings: JsonSettings);
read(schema: Schema, data: string | Uint8Array | unknown): Promise<any>;
readObject(schema: Schema, data: DocumentType): any;
protected _read(schema: Schema, value: unknown): any;
private _readStruct;
}
import type { Schema, ShapeSerializer } from "@smithy/types";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import type { JsonSettings } from "../JsonCodec";
/**
* Experimental single-pass JSON serializer that writes directly to a Uint8Array buffer.
* Fewer intermediate states as when compared to the initial multi-pass implementation.
*
* @internal
*/
export declare class ByteJsonShapeSerializer extends SerdeContextConfig implements ShapeSerializer<Uint8Array> {
readonly settings: JsonSettings;
private json;
private i;
private rootSchema;
constructor(settings: JsonSettings);
write(schema: Schema, value: unknown): void;
/**
* @internal
*/
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
/**
* Returns the serialized JSON as a Uint8Array (UTF-8 bytes).
* This is the primary output — pass directly to request.body.
*/
flush(): Uint8Array;
private ensure;
/**
* Write a raw ASCII string (no JSON escaping). Used for pre-validated content
* like numeric literals and pre-encoded base64.
*/
private writeAscii;
/**
* Write a quoted ASCII string with no escape checking.
* Used for struct member keys (jsonName or model names) which are
* guaranteed to be safe ASCII identifiers. No control chars, quotes,
* backslashes, or non-ASCII.
* Ensures extra room for surrounding structural chars (comma, colon).
*/
private writeAsciiQuoted;
/**
* Write a JSON-escaped string including the surrounding quotes.
* Fast-path for ASCII, falls back to TextEncoder for multi-byte.
*/
private writeJsonString;
private writeUnicodeEscape;
private static readonly B64;
/**
* Write a Uint8Array as a quoted base64 string directly into the buffer.
* No intermediate JS string, no escape checking (base64 alphabet is safe ASCII).
*/
private writeBase64;
private writeValue;
private writeStruct;
private writeList;
private writeMap;
private writeTimestamp;
}
import type { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
import type { JsonSettings } from "./JsonCodec";
/**
* @public
*/
export declare class JsonShapeDeserializer extends SerdeContextConfig implements ShapeDeserializer<string> {
readonly settings: JsonSettings;
constructor(settings: JsonSettings);
read(schema: Schema, data: string | Uint8Array | unknown): Promise<any>;
readObject(schema: Schema, data: DocumentType): any;
protected _read(schema: Schema, value: unknown): any;
}
import { NormalizedSchema } from "@smithy/core/schema";
import type { Schema, ShapeSerializer } from "@smithy/types";
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
import type { JsonSettings } from "./JsonCodec";
/**
* @public
*/
export declare class JsonShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string> {
readonly settings: JsonSettings;
/**
* Write buffer. Reused per value serialization pass.
* In the initial implementation, this is not an incremental buffer.
*/
protected buffer: any;
protected useReplacer: boolean;
protected rootSchema: NormalizedSchema | undefined;
constructor(settings: JsonSettings);
write(schema: Schema, value: unknown): void;
flush(): string;
/**
* @internal
*/
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
/**
* Order if-statements by likelihood.
*/
protected _write(schema: Schema, value: unknown, container?: NormalizedSchema): any;
}
import { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import { JsonSettings } from "../JsonCodec";
/**
* Performance-optimized JSON deserializer.
*
* Skips UTF-8 decoding when the runtime supports JSON.parse(Buffer) (Node 22+).
*
* After JSON.parse, lists, maps, and document containers are mutated in place
* (element values are overwritten with their deserialized form) rather than
* copied into new arrays/objects. Structs allocate a fresh object because
* jsonName traits require key renaming, and building the output object
* incrementally lets V8 assign a stable hidden class rather than
* deoptimizing from repeated property deletion/addition on an existing shape.
*
* In-place mutation is safe here because the parsed tree is locally owned
* after JSON.parse with no external references, so rewriting values avoids
* redundant allocation and GC pressure.
*
* @internal
*/
export declare class BufferJsonShapeDeserializer extends SerdeContextConfig implements ShapeDeserializer<string> {
readonly settings: JsonSettings;
constructor(settings: JsonSettings);
read(schema: Schema, data: string | Uint8Array | unknown): Promise<any>;
readObject(schema: Schema, data: DocumentType): any;
protected _read(schema: Schema, value: unknown): any;
private _readStruct;
}
import { Schema, ShapeSerializer } from "@smithy/types";
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
import { JsonSettings } from "../JsonCodec";
/**
* Experimental single-pass JSON serializer that writes directly to a Uint8Array buffer.
* Fewer intermediate states as when compared to the initial multi-pass implementation.
*
* @internal
*/
export declare class ByteJsonShapeSerializer extends SerdeContextConfig implements ShapeSerializer<Uint8Array> {
readonly settings: JsonSettings;
private json;
private i;
private rootSchema;
constructor(settings: JsonSettings);
write(schema: Schema, value: unknown): void;
/**
* @internal
*/
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
/**
* Returns the serialized JSON as a Uint8Array (UTF-8 bytes).
* This is the primary output — pass directly to request.body.
*/
flush(): Uint8Array;
private ensure;
/**
* Write a raw ASCII string (no JSON escaping). Used for pre-validated content
* like numeric literals and pre-encoded base64.
*/
private writeAscii;
/**
* Write a quoted ASCII string with no escape checking.
* Used for struct member keys (jsonName or model names) which are
* guaranteed to be safe ASCII identifiers. No control chars, quotes,
* backslashes, or non-ASCII.
* Ensures extra room for surrounding structural chars (comma, colon).
*/
private writeAsciiQuoted;
/**
* Write a JSON-escaped string including the surrounding quotes.
* Fast-path for ASCII, falls back to TextEncoder for multi-byte.
*/
private writeJsonString;
private writeUnicodeEscape;
private static readonly B64;
/**
* Write a Uint8Array as a quoted base64 string directly into the buffer.
* No intermediate JS string, no escape checking (base64 alphabet is safe ASCII).
*/
private writeBase64;
private writeValue;
private writeStruct;
private writeList;
private writeMap;
private writeTimestamp;
}
import { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
import { JsonSettings } from "./JsonCodec";
/**
* @public
*/
export declare class JsonShapeDeserializer extends SerdeContextConfig implements ShapeDeserializer<string> {
readonly settings: JsonSettings;
constructor(settings: JsonSettings);
read(schema: Schema, data: string | Uint8Array | unknown): Promise<any>;
readObject(schema: Schema, data: DocumentType): any;
protected _read(schema: Schema, value: unknown): any;
}
import { NormalizedSchema } from "@smithy/core/schema";
import { Schema, ShapeSerializer } from "@smithy/types";
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
import { JsonSettings } from "./JsonCodec";
/**
* @public
*/
export declare class JsonShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string> {
readonly settings: JsonSettings;
/**
* Write buffer. Reused per value serialization pass.
* In the initial implementation, this is not an incremental buffer.
*/
protected buffer: any;
protected useReplacer: boolean;
protected rootSchema: NormalizedSchema | undefined;
constructor(settings: JsonSettings);
write(schema: Schema, value: unknown): void;
flush(): string;
/**
* @internal
*/
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
/**
* Order if-statements by likelihood.
*/
protected _write(schema: Schema, value: unknown, container?: NormalizedSchema): any;
}