backend v4 half
This commit is contained in:
Generated
Vendored
+20
-20
@@ -225,7 +225,10 @@ var HttpProtocol = class {
|
||||
|
||||
// src/submodules/protocols/HttpBindingProtocol.ts
|
||||
var HttpBindingProtocol = class extends HttpProtocol {
|
||||
async serializeRequest(operationSchema, input, context) {
|
||||
async serializeRequest(operationSchema, _input, context) {
|
||||
const input = {
|
||||
..._input ?? {}
|
||||
};
|
||||
const serializer = this.serializer;
|
||||
const query = {};
|
||||
const headers = {};
|
||||
@@ -260,16 +263,12 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
||||
Object.assign(query, Object.fromEntries(traitSearchParams));
|
||||
}
|
||||
}
|
||||
const _input = {
|
||||
...input
|
||||
};
|
||||
for (const memberName of Object.keys(_input)) {
|
||||
const memberNs = ns.getMemberSchema(memberName);
|
||||
if (memberNs === void 0) {
|
||||
for (const [memberName, memberNs] of ns.structIterator()) {
|
||||
const memberTraits = memberNs.getMergedTraits() ?? {};
|
||||
const inputMemberValue = input[memberName];
|
||||
if (inputMemberValue == null) {
|
||||
continue;
|
||||
}
|
||||
const memberTraits = memberNs.getMergedTraits();
|
||||
const inputMember = _input[memberName];
|
||||
if (memberTraits.httpPayload) {
|
||||
const isStreaming = memberNs.isStreaming();
|
||||
if (isStreaming) {
|
||||
@@ -277,14 +276,15 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
||||
if (isEventStream) {
|
||||
throw new Error("serialization of event streams is not yet implemented");
|
||||
} else {
|
||||
payload = inputMember;
|
||||
payload = inputMemberValue;
|
||||
}
|
||||
} else {
|
||||
serializer.write(memberNs, inputMember);
|
||||
serializer.write(memberNs, inputMemberValue);
|
||||
payload = serializer.flush();
|
||||
}
|
||||
delete input[memberName];
|
||||
} else if (memberTraits.httpLabel) {
|
||||
serializer.write(memberNs, inputMember);
|
||||
serializer.write(memberNs, inputMemberValue);
|
||||
const replacement = serializer.flush();
|
||||
if (request.path.includes(`{${memberName}+}`)) {
|
||||
request.path = request.path.replace(
|
||||
@@ -294,27 +294,27 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
||||
} else if (request.path.includes(`{${memberName}}`)) {
|
||||
request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement));
|
||||
}
|
||||
delete _input[memberName];
|
||||
delete input[memberName];
|
||||
} else if (memberTraits.httpHeader) {
|
||||
serializer.write(memberNs, inputMember);
|
||||
serializer.write(memberNs, inputMemberValue);
|
||||
headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
|
||||
delete _input[memberName];
|
||||
delete input[memberName];
|
||||
} else if (typeof memberTraits.httpPrefixHeaders === "string") {
|
||||
for (const [key, val] of Object.entries(inputMember)) {
|
||||
for (const [key, val] of Object.entries(inputMemberValue)) {
|
||||
const amalgam = memberTraits.httpPrefixHeaders + key;
|
||||
serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
|
||||
headers[amalgam.toLowerCase()] = serializer.flush();
|
||||
}
|
||||
delete _input[memberName];
|
||||
delete input[memberName];
|
||||
} else if (memberTraits.httpQuery || memberTraits.httpQueryParams) {
|
||||
this.serializeQuery(memberNs, inputMember, query);
|
||||
delete _input[memberName];
|
||||
this.serializeQuery(memberNs, inputMemberValue, query);
|
||||
delete input[memberName];
|
||||
} else {
|
||||
hasNonHttpBindingMember = true;
|
||||
}
|
||||
}
|
||||
if (hasNonHttpBindingMember && input) {
|
||||
serializer.write(schema, _input);
|
||||
serializer.write(schema, input);
|
||||
payload = serializer.flush();
|
||||
}
|
||||
request.headers = headers;
|
||||
|
||||
Generated
Vendored
+80
-6
@@ -247,12 +247,24 @@ var Schema = class {
|
||||
};
|
||||
|
||||
// src/submodules/schema/schemas/ListSchema.ts
|
||||
var ListSchema = class extends Schema {
|
||||
var ListSchema = class _ListSchema extends Schema {
|
||||
constructor(name, traits, valueSchema) {
|
||||
super(name, traits);
|
||||
this.name = name;
|
||||
this.traits = traits;
|
||||
this.valueSchema = valueSchema;
|
||||
this.symbol = _ListSchema.symbol;
|
||||
}
|
||||
static {
|
||||
this.symbol = Symbol.for("@smithy/core/schema::ListSchema");
|
||||
}
|
||||
static [Symbol.hasInstance](lhs) {
|
||||
const isPrototype = _ListSchema.prototype.isPrototypeOf(lhs);
|
||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||
const list2 = lhs;
|
||||
return list2.symbol === _ListSchema.symbol;
|
||||
}
|
||||
return isPrototype;
|
||||
}
|
||||
};
|
||||
function list(namespace, name, traits = {}, valueSchema) {
|
||||
@@ -266,13 +278,25 @@ function list(namespace, name, traits = {}, valueSchema) {
|
||||
}
|
||||
|
||||
// src/submodules/schema/schemas/MapSchema.ts
|
||||
var MapSchema = class extends Schema {
|
||||
var MapSchema = class _MapSchema extends Schema {
|
||||
constructor(name, traits, keySchema, valueSchema) {
|
||||
super(name, traits);
|
||||
this.name = name;
|
||||
this.traits = traits;
|
||||
this.keySchema = keySchema;
|
||||
this.valueSchema = valueSchema;
|
||||
this.symbol = _MapSchema.symbol;
|
||||
}
|
||||
static {
|
||||
this.symbol = Symbol.for("@smithy/core/schema::MapSchema");
|
||||
}
|
||||
static [Symbol.hasInstance](lhs) {
|
||||
const isPrototype = _MapSchema.prototype.isPrototypeOf(lhs);
|
||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||
const map2 = lhs;
|
||||
return map2.symbol === _MapSchema.symbol;
|
||||
}
|
||||
return isPrototype;
|
||||
}
|
||||
};
|
||||
function map(namespace, name, traits = {}, keySchema, valueSchema) {
|
||||
@@ -303,18 +327,30 @@ function op(namespace, name, traits = {}, input, output) {
|
||||
}
|
||||
|
||||
// src/submodules/schema/schemas/StructureSchema.ts
|
||||
var StructureSchema = class extends Schema {
|
||||
var StructureSchema = class _StructureSchema extends Schema {
|
||||
constructor(name, traits, memberNames, memberList) {
|
||||
super(name, traits);
|
||||
this.name = name;
|
||||
this.traits = traits;
|
||||
this.memberNames = memberNames;
|
||||
this.memberList = memberList;
|
||||
this.symbol = _StructureSchema.symbol;
|
||||
this.members = {};
|
||||
for (let i = 0; i < memberNames.length; ++i) {
|
||||
this.members[memberNames[i]] = Array.isArray(memberList[i]) ? memberList[i] : [memberList[i], 0];
|
||||
}
|
||||
}
|
||||
static {
|
||||
this.symbol = Symbol.for("@smithy/core/schema::StructureSchema");
|
||||
}
|
||||
static [Symbol.hasInstance](lhs) {
|
||||
const isPrototype = _StructureSchema.prototype.isPrototypeOf(lhs);
|
||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||
const struct2 = lhs;
|
||||
return struct2.symbol === _StructureSchema.symbol;
|
||||
}
|
||||
return isPrototype;
|
||||
}
|
||||
};
|
||||
function struct(namespace, name, traits, memberNames, memberList) {
|
||||
const schema = new StructureSchema(namespace + "#" + name, traits, memberNames, memberList);
|
||||
@@ -323,7 +359,7 @@ function struct(namespace, name, traits, memberNames, memberList) {
|
||||
}
|
||||
|
||||
// src/submodules/schema/schemas/ErrorSchema.ts
|
||||
var ErrorSchema = class extends StructureSchema {
|
||||
var ErrorSchema = class _ErrorSchema extends StructureSchema {
|
||||
constructor(name, traits, memberNames, memberList, ctor) {
|
||||
super(name, traits, memberNames, memberList);
|
||||
this.name = name;
|
||||
@@ -331,6 +367,18 @@ var ErrorSchema = class extends StructureSchema {
|
||||
this.memberNames = memberNames;
|
||||
this.memberList = memberList;
|
||||
this.ctor = ctor;
|
||||
this.symbol = _ErrorSchema.symbol;
|
||||
}
|
||||
static {
|
||||
this.symbol = Symbol.for("@smithy/core/schema::ErrorSchema");
|
||||
}
|
||||
static [Symbol.hasInstance](lhs) {
|
||||
const isPrototype = _ErrorSchema.prototype.isPrototypeOf(lhs);
|
||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||
const err = lhs;
|
||||
return err.symbol === _ErrorSchema.symbol;
|
||||
}
|
||||
return isPrototype;
|
||||
}
|
||||
};
|
||||
function error(namespace, name, traits = {}, memberNames, memberList, ctor) {
|
||||
@@ -372,12 +420,24 @@ var SCHEMA = {
|
||||
};
|
||||
|
||||
// src/submodules/schema/schemas/SimpleSchema.ts
|
||||
var SimpleSchema = class extends Schema {
|
||||
var SimpleSchema = class _SimpleSchema extends Schema {
|
||||
constructor(name, schemaRef, traits) {
|
||||
super(name, traits);
|
||||
this.name = name;
|
||||
this.schemaRef = schemaRef;
|
||||
this.traits = traits;
|
||||
this.symbol = _SimpleSchema.symbol;
|
||||
}
|
||||
static {
|
||||
this.symbol = Symbol.for("@smithy/core/schema::SimpleSchema");
|
||||
}
|
||||
static [Symbol.hasInstance](lhs) {
|
||||
const isPrototype = _SimpleSchema.prototype.isPrototypeOf(lhs);
|
||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||
const sim2 = lhs;
|
||||
return sim2.symbol === _SimpleSchema.symbol;
|
||||
}
|
||||
return isPrototype;
|
||||
}
|
||||
};
|
||||
function sim(namespace, name, schemaRef, traits) {
|
||||
@@ -395,6 +455,7 @@ var NormalizedSchema = class _NormalizedSchema {
|
||||
constructor(ref, memberName) {
|
||||
this.ref = ref;
|
||||
this.memberName = memberName;
|
||||
this.symbol = _NormalizedSchema.symbol;
|
||||
const traitStack = [];
|
||||
let _ref = ref;
|
||||
let schema = ref;
|
||||
@@ -434,10 +495,23 @@ var NormalizedSchema = class _NormalizedSchema {
|
||||
this.name = (typeof this.schema === "object" ? this.schema?.name : void 0) ?? this.memberName ?? this.getSchemaName();
|
||||
if (this._isMemberSchema && !memberName) {
|
||||
throw new Error(
|
||||
`@smithy/core/schema - NormalizedSchema member schema ${this.getName(true)} must initialize with memberName argument.`
|
||||
`@smithy/core/schema - NormalizedSchema member schema ${this.getName(
|
||||
true
|
||||
)} must initialize with memberName argument.`
|
||||
);
|
||||
}
|
||||
}
|
||||
static {
|
||||
this.symbol = Symbol.for("@smithy/core/schema::NormalizedSchema");
|
||||
}
|
||||
static [Symbol.hasInstance](lhs) {
|
||||
const isPrototype = _NormalizedSchema.prototype.isPrototypeOf(lhs);
|
||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||
const ns = lhs;
|
||||
return ns.symbol === _NormalizedSchema.symbol;
|
||||
}
|
||||
return isPrototype;
|
||||
}
|
||||
/**
|
||||
* Static constructor that attempts to avoid wrapping a NormalizedSchema within another.
|
||||
*/
|
||||
|
||||
Generated
Vendored
+20
-20
@@ -4,7 +4,10 @@ import { collectBody } from "./collect-stream-body";
|
||||
import { extendedEncodeURIComponent } from "./extended-encode-uri-component";
|
||||
import { HttpProtocol } from "./HttpProtocol";
|
||||
export class HttpBindingProtocol extends HttpProtocol {
|
||||
async serializeRequest(operationSchema, input, context) {
|
||||
async serializeRequest(operationSchema, _input, context) {
|
||||
const input = {
|
||||
...(_input ?? {}),
|
||||
};
|
||||
const serializer = this.serializer;
|
||||
const query = {};
|
||||
const headers = {};
|
||||
@@ -40,16 +43,12 @@ export class HttpBindingProtocol extends HttpProtocol {
|
||||
Object.assign(query, Object.fromEntries(traitSearchParams));
|
||||
}
|
||||
}
|
||||
const _input = {
|
||||
...input,
|
||||
};
|
||||
for (const memberName of Object.keys(_input)) {
|
||||
const memberNs = ns.getMemberSchema(memberName);
|
||||
if (memberNs === undefined) {
|
||||
for (const [memberName, memberNs] of ns.structIterator()) {
|
||||
const memberTraits = memberNs.getMergedTraits() ?? {};
|
||||
const inputMemberValue = input[memberName];
|
||||
if (inputMemberValue == null) {
|
||||
continue;
|
||||
}
|
||||
const memberTraits = memberNs.getMergedTraits();
|
||||
const inputMember = _input[memberName];
|
||||
if (memberTraits.httpPayload) {
|
||||
const isStreaming = memberNs.isStreaming();
|
||||
if (isStreaming) {
|
||||
@@ -58,16 +57,17 @@ export class HttpBindingProtocol extends HttpProtocol {
|
||||
throw new Error("serialization of event streams is not yet implemented");
|
||||
}
|
||||
else {
|
||||
payload = inputMember;
|
||||
payload = inputMemberValue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
serializer.write(memberNs, inputMember);
|
||||
serializer.write(memberNs, inputMemberValue);
|
||||
payload = serializer.flush();
|
||||
}
|
||||
delete input[memberName];
|
||||
}
|
||||
else if (memberTraits.httpLabel) {
|
||||
serializer.write(memberNs, inputMember);
|
||||
serializer.write(memberNs, inputMemberValue);
|
||||
const replacement = serializer.flush();
|
||||
if (request.path.includes(`{${memberName}+}`)) {
|
||||
request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/"));
|
||||
@@ -75,31 +75,31 @@ export class HttpBindingProtocol extends HttpProtocol {
|
||||
else if (request.path.includes(`{${memberName}}`)) {
|
||||
request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement));
|
||||
}
|
||||
delete _input[memberName];
|
||||
delete input[memberName];
|
||||
}
|
||||
else if (memberTraits.httpHeader) {
|
||||
serializer.write(memberNs, inputMember);
|
||||
serializer.write(memberNs, inputMemberValue);
|
||||
headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
|
||||
delete _input[memberName];
|
||||
delete input[memberName];
|
||||
}
|
||||
else if (typeof memberTraits.httpPrefixHeaders === "string") {
|
||||
for (const [key, val] of Object.entries(inputMember)) {
|
||||
for (const [key, val] of Object.entries(inputMemberValue)) {
|
||||
const amalgam = memberTraits.httpPrefixHeaders + key;
|
||||
serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
|
||||
headers[amalgam.toLowerCase()] = serializer.flush();
|
||||
}
|
||||
delete _input[memberName];
|
||||
delete input[memberName];
|
||||
}
|
||||
else if (memberTraits.httpQuery || memberTraits.httpQueryParams) {
|
||||
this.serializeQuery(memberNs, inputMember, query);
|
||||
delete _input[memberName];
|
||||
this.serializeQuery(memberNs, inputMemberValue, query);
|
||||
delete input[memberName];
|
||||
}
|
||||
else {
|
||||
hasNonHttpBindingMember = true;
|
||||
}
|
||||
}
|
||||
if (hasNonHttpBindingMember && input) {
|
||||
serializer.write(schema, _input);
|
||||
serializer.write(schema, input);
|
||||
payload = serializer.flush();
|
||||
}
|
||||
request.headers = headers;
|
||||
|
||||
Generated
Vendored
+10
@@ -8,8 +8,18 @@ export class ErrorSchema extends StructureSchema {
|
||||
this.memberNames = memberNames;
|
||||
this.memberList = memberList;
|
||||
this.ctor = ctor;
|
||||
this.symbol = ErrorSchema.symbol;
|
||||
}
|
||||
static [Symbol.hasInstance](lhs) {
|
||||
const isPrototype = ErrorSchema.prototype.isPrototypeOf(lhs);
|
||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||
const err = lhs;
|
||||
return err.symbol === ErrorSchema.symbol;
|
||||
}
|
||||
return isPrototype;
|
||||
}
|
||||
}
|
||||
ErrorSchema.symbol = Symbol.for("@smithy/core/schema::ErrorSchema");
|
||||
export function error(namespace, name, traits = {}, memberNames, memberList, ctor) {
|
||||
const schema = new ErrorSchema(namespace + "#" + name, traits, memberNames, memberList, ctor);
|
||||
TypeRegistry.for(namespace).register(name, schema);
|
||||
|
||||
Generated
Vendored
+10
@@ -6,8 +6,18 @@ export class ListSchema extends Schema {
|
||||
this.name = name;
|
||||
this.traits = traits;
|
||||
this.valueSchema = valueSchema;
|
||||
this.symbol = ListSchema.symbol;
|
||||
}
|
||||
static [Symbol.hasInstance](lhs) {
|
||||
const isPrototype = ListSchema.prototype.isPrototypeOf(lhs);
|
||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||
const list = lhs;
|
||||
return list.symbol === ListSchema.symbol;
|
||||
}
|
||||
return isPrototype;
|
||||
}
|
||||
}
|
||||
ListSchema.symbol = Symbol.for("@smithy/core/schema::ListSchema");
|
||||
export function list(namespace, name, traits = {}, valueSchema) {
|
||||
const schema = new ListSchema(namespace + "#" + name, traits, typeof valueSchema === "function" ? valueSchema() : valueSchema);
|
||||
TypeRegistry.for(namespace).register(name, schema);
|
||||
|
||||
Generated
Vendored
+10
@@ -7,8 +7,18 @@ export class MapSchema extends Schema {
|
||||
this.traits = traits;
|
||||
this.keySchema = keySchema;
|
||||
this.valueSchema = valueSchema;
|
||||
this.symbol = MapSchema.symbol;
|
||||
}
|
||||
static [Symbol.hasInstance](lhs) {
|
||||
const isPrototype = MapSchema.prototype.isPrototypeOf(lhs);
|
||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||
const map = lhs;
|
||||
return map.symbol === MapSchema.symbol;
|
||||
}
|
||||
return isPrototype;
|
||||
}
|
||||
}
|
||||
MapSchema.symbol = Symbol.for("@smithy/core/schema::MapSchema");
|
||||
export function map(namespace, name, traits = {}, keySchema, valueSchema) {
|
||||
const schema = new MapSchema(namespace + "#" + name, traits, keySchema, typeof valueSchema === "function" ? valueSchema() : valueSchema);
|
||||
TypeRegistry.for(namespace).register(name, schema);
|
||||
|
||||
Generated
Vendored
+10
@@ -8,6 +8,7 @@ export class NormalizedSchema {
|
||||
constructor(ref, memberName) {
|
||||
this.ref = ref;
|
||||
this.memberName = memberName;
|
||||
this.symbol = NormalizedSchema.symbol;
|
||||
const traitStack = [];
|
||||
let _ref = ref;
|
||||
let schema = ref;
|
||||
@@ -52,6 +53,14 @@ export class NormalizedSchema {
|
||||
throw new Error(`@smithy/core/schema - NormalizedSchema member schema ${this.getName(true)} must initialize with memberName argument.`);
|
||||
}
|
||||
}
|
||||
static [Symbol.hasInstance](lhs) {
|
||||
const isPrototype = NormalizedSchema.prototype.isPrototypeOf(lhs);
|
||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||
const ns = lhs;
|
||||
return ns.symbol === NormalizedSchema.symbol;
|
||||
}
|
||||
return isPrototype;
|
||||
}
|
||||
static of(ref, memberName) {
|
||||
if (ref instanceof NormalizedSchema) {
|
||||
return ref;
|
||||
@@ -292,3 +301,4 @@ export class NormalizedSchema {
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
NormalizedSchema.symbol = Symbol.for("@smithy/core/schema::NormalizedSchema");
|
||||
|
||||
Generated
Vendored
+10
@@ -6,8 +6,18 @@ export class SimpleSchema extends Schema {
|
||||
this.name = name;
|
||||
this.schemaRef = schemaRef;
|
||||
this.traits = traits;
|
||||
this.symbol = SimpleSchema.symbol;
|
||||
}
|
||||
static [Symbol.hasInstance](lhs) {
|
||||
const isPrototype = SimpleSchema.prototype.isPrototypeOf(lhs);
|
||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||
const sim = lhs;
|
||||
return sim.symbol === SimpleSchema.symbol;
|
||||
}
|
||||
return isPrototype;
|
||||
}
|
||||
}
|
||||
SimpleSchema.symbol = Symbol.for("@smithy/core/schema::SimpleSchema");
|
||||
export function sim(namespace, name, schemaRef, traits) {
|
||||
const schema = new SimpleSchema(namespace + "#" + name, schemaRef, traits);
|
||||
TypeRegistry.for(namespace).register(name, schema);
|
||||
|
||||
Generated
Vendored
+10
@@ -7,6 +7,7 @@ export class StructureSchema extends Schema {
|
||||
this.traits = traits;
|
||||
this.memberNames = memberNames;
|
||||
this.memberList = memberList;
|
||||
this.symbol = StructureSchema.symbol;
|
||||
this.members = {};
|
||||
for (let i = 0; i < memberNames.length; ++i) {
|
||||
this.members[memberNames[i]] = Array.isArray(memberList[i])
|
||||
@@ -14,7 +15,16 @@ export class StructureSchema extends Schema {
|
||||
: [memberList[i], 0];
|
||||
}
|
||||
}
|
||||
static [Symbol.hasInstance](lhs) {
|
||||
const isPrototype = StructureSchema.prototype.isPrototypeOf(lhs);
|
||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||
const struct = lhs;
|
||||
return struct.symbol === StructureSchema.symbol;
|
||||
}
|
||||
return isPrototype;
|
||||
}
|
||||
}
|
||||
StructureSchema.symbol = Symbol.for("@smithy/core/schema::StructureSchema");
|
||||
export function struct(namespace, name, traits, memberNames, memberList) {
|
||||
const schema = new StructureSchema(namespace + "#" + name, traits, memberNames, memberList);
|
||||
TypeRegistry.for(namespace).register(name, schema);
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -9,7 +9,7 @@ import { HttpProtocol } from "./HttpProtocol";
|
||||
* @alpha
|
||||
*/
|
||||
export declare abstract class HttpBindingProtocol extends HttpProtocol {
|
||||
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
||||
serializeRequest<Input extends object>(operationSchema: OperationSchema, _input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
||||
protected serializeQuery(ns: NormalizedSchema, data: any, query: HttpRequest["query"]): void;
|
||||
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
||||
}
|
||||
|
||||
Generated
Vendored
+3
@@ -17,11 +17,14 @@ export declare class ErrorSchema extends StructureSchema {
|
||||
* Constructor for a modeled service exception class that extends Error.
|
||||
*/
|
||||
ctor: any;
|
||||
static symbol: symbol;
|
||||
protected symbol: symbol;
|
||||
constructor(name: string, traits: SchemaTraits, memberNames: string[], memberList: SchemaRef[],
|
||||
/**
|
||||
* Constructor for a modeled service exception class that extends Error.
|
||||
*/
|
||||
ctor: any);
|
||||
static [Symbol.hasInstance](lhs: unknown): lhs is ErrorSchema;
|
||||
}
|
||||
/**
|
||||
* Factory for ErrorSchema, to reduce codegen output and register the schema.
|
||||
|
||||
Generated
Vendored
+3
@@ -10,7 +10,10 @@ export declare class ListSchema extends Schema implements IListSchema {
|
||||
name: string;
|
||||
traits: SchemaTraits;
|
||||
valueSchema: SchemaRef;
|
||||
static symbol: symbol;
|
||||
protected symbol: symbol;
|
||||
constructor(name: string, traits: SchemaTraits, valueSchema: SchemaRef);
|
||||
static [Symbol.hasInstance](lhs: unknown): lhs is ListSchema;
|
||||
}
|
||||
/**
|
||||
* Factory for ListSchema.
|
||||
|
||||
Generated
Vendored
+3
@@ -12,11 +12,14 @@ export declare class MapSchema extends Schema implements IMapSchema {
|
||||
*/
|
||||
keySchema: SchemaRef;
|
||||
valueSchema: SchemaRef;
|
||||
static symbol: symbol;
|
||||
protected symbol: symbol;
|
||||
constructor(name: string, traits: SchemaTraits,
|
||||
/**
|
||||
* This is expected to be StringSchema, but may have traits.
|
||||
*/
|
||||
keySchema: SchemaRef, valueSchema: SchemaRef);
|
||||
static [Symbol.hasInstance](lhs: unknown): lhs is MapSchema;
|
||||
}
|
||||
/**
|
||||
* Factory for MapSchema.
|
||||
|
||||
Generated
Vendored
+3
@@ -8,6 +8,8 @@ import type { MemberSchema, NormalizedSchema as INormalizedSchema, Schema as ISc
|
||||
export declare class NormalizedSchema implements INormalizedSchema {
|
||||
private readonly ref;
|
||||
private memberName?;
|
||||
static symbol: symbol;
|
||||
protected symbol: symbol;
|
||||
private readonly name;
|
||||
private readonly traits;
|
||||
private _isMemberSchema;
|
||||
@@ -19,6 +21,7 @@ export declare class NormalizedSchema implements INormalizedSchema {
|
||||
* @param memberName - optional memberName if this NormalizedSchema should be considered a member schema.
|
||||
*/
|
||||
constructor(ref: SchemaRef, memberName?: string | undefined);
|
||||
static [Symbol.hasInstance](lhs: unknown): lhs is NormalizedSchema;
|
||||
/**
|
||||
* Static constructor that attempts to avoid wrapping a NormalizedSchema within another.
|
||||
*/
|
||||
|
||||
SerpentRace_Backend/node_modules/@smithy/core/dist-types/submodules/schema/schemas/SimpleSchema.d.ts
Generated
Vendored
+3
@@ -10,7 +10,10 @@ export declare class SimpleSchema extends Schema implements TraitsSchema {
|
||||
name: string;
|
||||
schemaRef: SchemaRef;
|
||||
traits: SchemaTraits;
|
||||
static symbol: symbol;
|
||||
protected symbol: symbol;
|
||||
constructor(name: string, schemaRef: SchemaRef, traits: SchemaTraits);
|
||||
static [Symbol.hasInstance](lhs: unknown): lhs is SimpleSchema;
|
||||
}
|
||||
/**
|
||||
* Factory for simple schema class objects.
|
||||
|
||||
Generated
Vendored
+3
@@ -10,8 +10,11 @@ export declare class StructureSchema extends Schema implements IStructureSchema
|
||||
traits: SchemaTraits;
|
||||
memberNames: string[];
|
||||
memberList: SchemaRef[];
|
||||
static symbol: symbol;
|
||||
protected symbol: symbol;
|
||||
members: Record<string, [SchemaRef, SchemaTraits]>;
|
||||
constructor(name: string, traits: SchemaTraits, memberNames: string[], memberList: SchemaRef[]);
|
||||
static [Symbol.hasInstance](lhs: unknown): lhs is StructureSchema;
|
||||
}
|
||||
/**
|
||||
* Factory for StructureSchema.
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -9,7 +9,7 @@ import { HttpProtocol } from "./HttpProtocol";
|
||||
* @alpha
|
||||
*/
|
||||
export declare abstract class HttpBindingProtocol extends HttpProtocol {
|
||||
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
||||
serializeRequest<Input extends object>(operationSchema: OperationSchema, _input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
||||
protected serializeQuery(ns: NormalizedSchema, data: any, query: HttpRequest["query"]): void;
|
||||
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
||||
}
|
||||
|
||||
Generated
Vendored
+3
@@ -17,11 +17,14 @@ export declare class ErrorSchema extends StructureSchema {
|
||||
* Constructor for a modeled service exception class that extends Error.
|
||||
*/
|
||||
ctor: any;
|
||||
static symbol: symbol;
|
||||
protected symbol: symbol;
|
||||
constructor(name: string, traits: SchemaTraits, memberNames: string[], memberList: SchemaRef[],
|
||||
/**
|
||||
* Constructor for a modeled service exception class that extends Error.
|
||||
*/
|
||||
ctor: any);
|
||||
static [Symbol.hasInstance](lhs: unknown): lhs is ErrorSchema;
|
||||
}
|
||||
/**
|
||||
* Factory for ErrorSchema, to reduce codegen output and register the schema.
|
||||
|
||||
Generated
Vendored
+3
@@ -10,7 +10,10 @@ export declare class ListSchema extends Schema implements IListSchema {
|
||||
name: string;
|
||||
traits: SchemaTraits;
|
||||
valueSchema: SchemaRef;
|
||||
static symbol: symbol;
|
||||
protected symbol: symbol;
|
||||
constructor(name: string, traits: SchemaTraits, valueSchema: SchemaRef);
|
||||
static [Symbol.hasInstance](lhs: unknown): lhs is ListSchema;
|
||||
}
|
||||
/**
|
||||
* Factory for ListSchema.
|
||||
|
||||
Generated
Vendored
+3
@@ -12,11 +12,14 @@ export declare class MapSchema extends Schema implements IMapSchema {
|
||||
*/
|
||||
keySchema: SchemaRef;
|
||||
valueSchema: SchemaRef;
|
||||
static symbol: symbol;
|
||||
protected symbol: symbol;
|
||||
constructor(name: string, traits: SchemaTraits,
|
||||
/**
|
||||
* This is expected to be StringSchema, but may have traits.
|
||||
*/
|
||||
keySchema: SchemaRef, valueSchema: SchemaRef);
|
||||
static [Symbol.hasInstance](lhs: unknown): lhs is MapSchema;
|
||||
}
|
||||
/**
|
||||
* Factory for MapSchema.
|
||||
|
||||
Generated
Vendored
+3
@@ -8,6 +8,8 @@ import { MemberSchema, NormalizedSchema as INormalizedSchema, Schema as ISchema,
|
||||
export declare class NormalizedSchema implements INormalizedSchema {
|
||||
private readonly ref;
|
||||
private memberName?;
|
||||
static symbol: symbol;
|
||||
protected symbol: symbol;
|
||||
private readonly name;
|
||||
private readonly traits;
|
||||
private _isMemberSchema;
|
||||
@@ -19,6 +21,7 @@ export declare class NormalizedSchema implements INormalizedSchema {
|
||||
* @param memberName - optional memberName if this NormalizedSchema should be considered a member schema.
|
||||
*/
|
||||
constructor(ref: SchemaRef, memberName?: string | undefined);
|
||||
static [Symbol.hasInstance](lhs: unknown): lhs is NormalizedSchema;
|
||||
/**
|
||||
* Static constructor that attempts to avoid wrapping a NormalizedSchema within another.
|
||||
*/
|
||||
|
||||
Generated
Vendored
+3
@@ -10,7 +10,10 @@ export declare class SimpleSchema extends Schema implements TraitsSchema {
|
||||
name: string;
|
||||
schemaRef: SchemaRef;
|
||||
traits: SchemaTraits;
|
||||
static symbol: symbol;
|
||||
protected symbol: symbol;
|
||||
constructor(name: string, schemaRef: SchemaRef, traits: SchemaTraits);
|
||||
static [Symbol.hasInstance](lhs: unknown): lhs is SimpleSchema;
|
||||
}
|
||||
/**
|
||||
* Factory for simple schema class objects.
|
||||
|
||||
Generated
Vendored
+3
@@ -10,11 +10,14 @@ export declare class StructureSchema extends Schema implements IStructureSchema
|
||||
traits: SchemaTraits;
|
||||
memberNames: string[];
|
||||
memberList: SchemaRef[];
|
||||
static symbol: symbol;
|
||||
protected symbol: symbol;
|
||||
members: Record<string, [
|
||||
SchemaRef,
|
||||
SchemaTraits
|
||||
]>;
|
||||
constructor(name: string, traits: SchemaTraits, memberNames: string[], memberList: SchemaRef[]);
|
||||
static [Symbol.hasInstance](lhs: unknown): lhs is StructureSchema;
|
||||
}
|
||||
/**
|
||||
* Factory for StructureSchema.
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@smithy/core",
|
||||
"version": "3.6.0",
|
||||
"version": "3.7.0",
|
||||
"scripts": {
|
||||
"build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
||||
"build:cjs": "node ../../scripts/inline core",
|
||||
@@ -75,7 +75,7 @@
|
||||
"@smithy/util-base64": "^4.0.0",
|
||||
"@smithy/util-body-length-browser": "^4.0.0",
|
||||
"@smithy/util-middleware": "^4.0.4",
|
||||
"@smithy/util-stream": "^4.2.2",
|
||||
"@smithy/util-stream": "^4.2.3",
|
||||
"@smithy/util-utf8": "^4.0.0",
|
||||
"tslib": "^2.6.2"
|
||||
},
|
||||
|
||||
+2
-2
@@ -83,11 +83,11 @@ var FetchHttpHandler = class _FetchHttpHandler {
|
||||
}
|
||||
destroy() {
|
||||
}
|
||||
async handle(request, { abortSignal } = {}) {
|
||||
async handle(request, { abortSignal, requestTimeout: requestTimeout2 } = {}) {
|
||||
if (!this.config) {
|
||||
this.config = await this.configProvider;
|
||||
}
|
||||
const requestTimeoutInMs = this.config.requestTimeout;
|
||||
const requestTimeoutInMs = requestTimeout2 ?? this.config.requestTimeout;
|
||||
const keepAlive = this.config.keepAlive === true;
|
||||
const credentials = this.config.credentials;
|
||||
if (abortSignal?.aborted) {
|
||||
|
||||
Generated
Vendored
+4
-4
@@ -1,7 +1,7 @@
|
||||
import { HttpResponse } from "@smithy/protocol-http";
|
||||
import { buildQueryString } from "@smithy/querystring-builder";
|
||||
import { createRequest } from "./create-request";
|
||||
import { requestTimeout } from "./request-timeout";
|
||||
import { requestTimeout as requestTimeoutFn } from "./request-timeout";
|
||||
export const keepAliveSupport = {
|
||||
supported: undefined,
|
||||
};
|
||||
@@ -26,11 +26,11 @@ export class FetchHttpHandler {
|
||||
}
|
||||
destroy() {
|
||||
}
|
||||
async handle(request, { abortSignal } = {}) {
|
||||
async handle(request, { abortSignal, requestTimeout } = {}) {
|
||||
if (!this.config) {
|
||||
this.config = await this.configProvider;
|
||||
}
|
||||
const requestTimeoutInMs = this.config.requestTimeout;
|
||||
const requestTimeoutInMs = requestTimeout ?? this.config.requestTimeout;
|
||||
const keepAlive = this.config.keepAlive === true;
|
||||
const credentials = this.config.credentials;
|
||||
if (abortSignal?.aborted) {
|
||||
@@ -105,7 +105,7 @@ export class FetchHttpHandler {
|
||||
}),
|
||||
};
|
||||
}),
|
||||
requestTimeout(requestTimeoutInMs),
|
||||
requestTimeoutFn(requestTimeoutInMs),
|
||||
];
|
||||
if (abortSignal) {
|
||||
raceOfPromises.push(new Promise((resolve, reject) => {
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -33,7 +33,7 @@ export declare class FetchHttpHandler implements HttpHandler<FetchHttpHandlerOpt
|
||||
static create(instanceOrOptions?: HttpHandler<any> | FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>): FetchHttpHandler | HttpHandler<any>;
|
||||
constructor(options?: FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>);
|
||||
destroy(): void;
|
||||
handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
|
||||
handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
|
||||
response: HttpResponse;
|
||||
}>;
|
||||
updateHttpClientConfig(key: keyof FetchHttpHandlerOptions, value: FetchHttpHandlerOptions[typeof key]): void;
|
||||
|
||||
SerpentRace_Backend/node_modules/@smithy/fetch-http-handler/dist-types/ts3.4/fetch-http-handler.d.ts
Generated
Vendored
+1
-1
@@ -33,7 +33,7 @@ export declare class FetchHttpHandler implements HttpHandler<FetchHttpHandlerOpt
|
||||
static create(instanceOrOptions?: HttpHandler<any> | FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>): FetchHttpHandler | HttpHandler<any>;
|
||||
constructor(options?: FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>);
|
||||
destroy(): void;
|
||||
handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
|
||||
handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
|
||||
response: HttpResponse;
|
||||
}>;
|
||||
updateHttpClientConfig(key: keyof FetchHttpHandlerOptions, value: FetchHttpHandlerOptions[typeof key]): void;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@smithy/fetch-http-handler",
|
||||
"version": "5.0.4",
|
||||
"version": "5.1.0",
|
||||
"description": "Provides a way to make requests",
|
||||
"scripts": {
|
||||
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
||||
|
||||
+6
-2
@@ -89,6 +89,9 @@ var createConfigValueProvider = /* @__PURE__ */ __name((configKey, canonicalEndp
|
||||
}
|
||||
if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
|
||||
return async () => {
|
||||
if (config.isCustomEndpoint === false) {
|
||||
return void 0;
|
||||
}
|
||||
const endpoint = await configProvider();
|
||||
if (endpoint && typeof endpoint === "object") {
|
||||
if ("url" in endpoint) {
|
||||
@@ -122,7 +125,7 @@ var toEndpointV1 = /* @__PURE__ */ __name((endpoint) => {
|
||||
|
||||
// src/adaptors/getEndpointFromInstructions.ts
|
||||
var getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig, context) => {
|
||||
if (!clientConfig.endpoint) {
|
||||
if (!clientConfig.isCustomEndpoint) {
|
||||
let endpointFromConfig;
|
||||
if (clientConfig.serviceConfiguredEndpoint) {
|
||||
endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
|
||||
@@ -131,6 +134,7 @@ var getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, in
|
||||
}
|
||||
if (endpointFromConfig) {
|
||||
clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
|
||||
clientConfig.isCustomEndpoint = true;
|
||||
}
|
||||
}
|
||||
const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
|
||||
@@ -179,7 +183,7 @@ var endpointMiddleware = /* @__PURE__ */ __name(({
|
||||
instructions
|
||||
}) => {
|
||||
return (next, context) => async (args) => {
|
||||
if (config.endpoint) {
|
||||
if (config.isCustomEndpoint) {
|
||||
(0, import_core.setFeature)(context, "ENDPOINT_OVERRIDE", "N");
|
||||
}
|
||||
const endpoint = await getEndpointFromInstructions(
|
||||
|
||||
Generated
Vendored
+3
@@ -22,6 +22,9 @@ export const createConfigValueProvider = (configKey, canonicalEndpointParamKey,
|
||||
}
|
||||
if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
|
||||
return async () => {
|
||||
if (config.isCustomEndpoint === false) {
|
||||
return undefined;
|
||||
}
|
||||
const endpoint = await configProvider();
|
||||
if (endpoint && typeof endpoint === "object") {
|
||||
if ("url" in endpoint) {
|
||||
|
||||
Generated
Vendored
+2
-1
@@ -3,7 +3,7 @@ import { createConfigValueProvider } from "./createConfigValueProvider";
|
||||
import { getEndpointFromConfig } from "./getEndpointFromConfig";
|
||||
import { toEndpointV1 } from "./toEndpointV1";
|
||||
export const getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => {
|
||||
if (!clientConfig.endpoint) {
|
||||
if (!clientConfig.isCustomEndpoint) {
|
||||
let endpointFromConfig;
|
||||
if (clientConfig.serviceConfiguredEndpoint) {
|
||||
endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
|
||||
@@ -13,6 +13,7 @@ export const getEndpointFromInstructions = async (commandInput, instructionsSupp
|
||||
}
|
||||
if (endpointFromConfig) {
|
||||
clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
|
||||
clientConfig.isCustomEndpoint = true;
|
||||
}
|
||||
}
|
||||
const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -3,7 +3,7 @@ import { getSmithyContext } from "@smithy/util-middleware";
|
||||
import { getEndpointFromInstructions } from "./adaptors/getEndpointFromInstructions";
|
||||
export const endpointMiddleware = ({ config, instructions, }) => {
|
||||
return (next, context) => async (args) => {
|
||||
if (config.endpoint) {
|
||||
if (config.isCustomEndpoint) {
|
||||
setFeature(context, "ENDPOINT_OVERRIDE", "N");
|
||||
}
|
||||
const endpoint = await getEndpointFromInstructions(args.input, {
|
||||
|
||||
Generated
Vendored
+5
-2
@@ -56,7 +56,7 @@ interface PreviouslyResolved<T extends EndpointParameters = EndpointParameters>
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* This supercedes the similarly named EndpointsResolvedConfig (no parametric types)
|
||||
* This supersedes the similarly named EndpointsResolvedConfig (no parametric types)
|
||||
* from resolveEndpointsConfig.ts in \@smithy/config-resolver.
|
||||
*/
|
||||
export interface EndpointResolvedConfig<T extends EndpointParameters = EndpointParameters> {
|
||||
@@ -76,8 +76,11 @@ export interface EndpointResolvedConfig<T extends EndpointParameters = EndpointP
|
||||
tls: boolean;
|
||||
/**
|
||||
* Whether the endpoint is specified by caller.
|
||||
* This should be used over checking the existence of `endpoint`, since
|
||||
* that may have been set by other means, such as the default regional
|
||||
* endpoint provider function.
|
||||
*
|
||||
* @internal
|
||||
* @deprecated
|
||||
*/
|
||||
isCustomEndpoint?: boolean;
|
||||
/**
|
||||
|
||||
Generated
Vendored
+5
-2
@@ -56,7 +56,7 @@ interface PreviouslyResolved<T extends EndpointParameters = EndpointParameters>
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* This supercedes the similarly named EndpointsResolvedConfig (no parametric types)
|
||||
* This supersedes the similarly named EndpointsResolvedConfig (no parametric types)
|
||||
* from resolveEndpointsConfig.ts in \@smithy/config-resolver.
|
||||
*/
|
||||
export interface EndpointResolvedConfig<T extends EndpointParameters = EndpointParameters> {
|
||||
@@ -76,8 +76,11 @@ export interface EndpointResolvedConfig<T extends EndpointParameters = EndpointP
|
||||
tls: boolean;
|
||||
/**
|
||||
* Whether the endpoint is specified by caller.
|
||||
* This should be used over checking the existence of `endpoint`, since
|
||||
* that may have been set by other means, such as the default regional
|
||||
* endpoint provider function.
|
||||
*
|
||||
* @internal
|
||||
* @deprecated
|
||||
*/
|
||||
isCustomEndpoint?: boolean;
|
||||
/**
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@smithy/middleware-endpoint",
|
||||
"version": "4.1.13",
|
||||
"version": "4.1.15",
|
||||
"scripts": {
|
||||
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
||||
"build:cjs": "node ../../scripts/inline middleware-endpoint",
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@smithy/core": "^3.6.0",
|
||||
"@smithy/core": "^3.7.0",
|
||||
"@smithy/middleware-serde": "^4.0.8",
|
||||
"@smithy/node-config-provider": "^4.1.3",
|
||||
"@smithy/shared-ini-file-loader": "^4.0.4",
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@smithy/middleware-retry",
|
||||
"version": "4.1.14",
|
||||
"version": "4.1.16",
|
||||
"scripts": {
|
||||
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
||||
"build:cjs": "node ../../scripts/inline middleware-retry",
|
||||
@@ -36,7 +36,7 @@
|
||||
"@smithy/node-config-provider": "^4.1.3",
|
||||
"@smithy/protocol-http": "^5.1.2",
|
||||
"@smithy/service-error-classification": "^4.0.6",
|
||||
"@smithy/smithy-client": "^4.4.5",
|
||||
"@smithy/smithy-client": "^4.4.7",
|
||||
"@smithy/types": "^4.3.1",
|
||||
"@smithy/util-middleware": "^4.0.4",
|
||||
"@smithy/util-retry": "^4.0.6",
|
||||
|
||||
+11
-9
@@ -293,7 +293,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
||||
this.config?.httpAgent?.destroy();
|
||||
this.config?.httpsAgent?.destroy();
|
||||
}
|
||||
async handle(request, { abortSignal } = {}) {
|
||||
async handle(request, { abortSignal, requestTimeout } = {}) {
|
||||
if (!this.config) {
|
||||
this.config = await this.configProvider;
|
||||
}
|
||||
@@ -394,8 +394,9 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
||||
abortSignal.onabort = onAbort;
|
||||
}
|
||||
}
|
||||
const effectiveRequestTimeout = requestTimeout ?? this.config.requestTimeout;
|
||||
timeouts.push(setConnectionTimeout(req, reject, this.config.connectionTimeout));
|
||||
timeouts.push(setSocketTimeout(req, reject, this.config.requestTimeout));
|
||||
timeouts.push(setSocketTimeout(req, reject, effectiveRequestTimeout));
|
||||
const httpAgent = nodeHttpsOptions.agent;
|
||||
if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
|
||||
timeouts.push(
|
||||
@@ -407,7 +408,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
||||
})
|
||||
);
|
||||
}
|
||||
writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch((e) => {
|
||||
writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout).catch((e) => {
|
||||
timeouts.forEach(timing.clearTimeout);
|
||||
return _reject(e);
|
||||
});
|
||||
@@ -596,7 +597,7 @@ var NodeHttp2Handler = class _NodeHttp2Handler {
|
||||
destroy() {
|
||||
this.connectionManager.destroy();
|
||||
}
|
||||
async handle(request, { abortSignal } = {}) {
|
||||
async handle(request, { abortSignal, requestTimeout } = {}) {
|
||||
if (!this.config) {
|
||||
this.config = await this.configProvider;
|
||||
this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false);
|
||||
@@ -604,7 +605,8 @@ var NodeHttp2Handler = class _NodeHttp2Handler {
|
||||
this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams);
|
||||
}
|
||||
}
|
||||
const { requestTimeout, disableConcurrentStreams } = this.config;
|
||||
const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config;
|
||||
const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout;
|
||||
return new Promise((_resolve, _reject) => {
|
||||
let fulfilled = false;
|
||||
let writeRequestBodyPromise = void 0;
|
||||
@@ -670,10 +672,10 @@ var NodeHttp2Handler = class _NodeHttp2Handler {
|
||||
this.connectionManager.deleteSession(authority, session);
|
||||
}
|
||||
});
|
||||
if (requestTimeout) {
|
||||
req.setTimeout(requestTimeout, () => {
|
||||
if (effectiveRequestTimeout) {
|
||||
req.setTimeout(effectiveRequestTimeout, () => {
|
||||
req.close();
|
||||
const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`);
|
||||
const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`);
|
||||
timeoutError.name = "TimeoutError";
|
||||
rejectWithDestroy(timeoutError);
|
||||
});
|
||||
@@ -711,7 +713,7 @@ var NodeHttp2Handler = class _NodeHttp2Handler {
|
||||
rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response"));
|
||||
}
|
||||
});
|
||||
writeRequestBodyPromise = writeRequestBody(req, request, requestTimeout);
|
||||
writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout);
|
||||
});
|
||||
}
|
||||
updateHttpClientConfig(key, value) {
|
||||
|
||||
Generated
Vendored
+4
-3
@@ -83,7 +83,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
||||
this.config?.httpAgent?.destroy();
|
||||
this.config?.httpsAgent?.destroy();
|
||||
}
|
||||
async handle(request, { abortSignal } = {}) {
|
||||
async handle(request, { abortSignal, requestTimeout } = {}) {
|
||||
if (!this.config) {
|
||||
this.config = await this.configProvider;
|
||||
}
|
||||
@@ -179,8 +179,9 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
||||
abortSignal.onabort = onAbort;
|
||||
}
|
||||
}
|
||||
const effectiveRequestTimeout = requestTimeout ?? this.config.requestTimeout;
|
||||
timeouts.push(setConnectionTimeout(req, reject, this.config.connectionTimeout));
|
||||
timeouts.push(setSocketTimeout(req, reject, this.config.requestTimeout));
|
||||
timeouts.push(setSocketTimeout(req, reject, effectiveRequestTimeout));
|
||||
const httpAgent = nodeHttpsOptions.agent;
|
||||
if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
|
||||
timeouts.push(setSocketKeepAlive(req, {
|
||||
@@ -188,7 +189,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
||||
keepAliveMsecs: httpAgent.keepAliveMsecs,
|
||||
}));
|
||||
}
|
||||
writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch((e) => {
|
||||
writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout).catch((e) => {
|
||||
timeouts.forEach(timing.clearTimeout);
|
||||
return _reject(e);
|
||||
});
|
||||
|
||||
Generated
Vendored
+7
-6
@@ -30,7 +30,7 @@ export class NodeHttp2Handler {
|
||||
destroy() {
|
||||
this.connectionManager.destroy();
|
||||
}
|
||||
async handle(request, { abortSignal } = {}) {
|
||||
async handle(request, { abortSignal, requestTimeout } = {}) {
|
||||
if (!this.config) {
|
||||
this.config = await this.configProvider;
|
||||
this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false);
|
||||
@@ -38,7 +38,8 @@ export class NodeHttp2Handler {
|
||||
this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams);
|
||||
}
|
||||
}
|
||||
const { requestTimeout, disableConcurrentStreams } = this.config;
|
||||
const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config;
|
||||
const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout;
|
||||
return new Promise((_resolve, _reject) => {
|
||||
let fulfilled = false;
|
||||
let writeRequestBodyPromise = undefined;
|
||||
@@ -104,10 +105,10 @@ export class NodeHttp2Handler {
|
||||
this.connectionManager.deleteSession(authority, session);
|
||||
}
|
||||
});
|
||||
if (requestTimeout) {
|
||||
req.setTimeout(requestTimeout, () => {
|
||||
if (effectiveRequestTimeout) {
|
||||
req.setTimeout(effectiveRequestTimeout, () => {
|
||||
req.close();
|
||||
const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`);
|
||||
const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`);
|
||||
timeoutError.name = "TimeoutError";
|
||||
rejectWithDestroy(timeoutError);
|
||||
});
|
||||
@@ -144,7 +145,7 @@ export class NodeHttp2Handler {
|
||||
rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response"));
|
||||
}
|
||||
});
|
||||
writeRequestBodyPromise = writeRequestBody(req, request, requestTimeout);
|
||||
writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout);
|
||||
});
|
||||
}
|
||||
updateHttpClientConfig(key, value) {
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -37,7 +37,7 @@ export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptio
|
||||
constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>);
|
||||
private resolveDefaultConfig;
|
||||
destroy(): void;
|
||||
handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
|
||||
handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
|
||||
response: HttpResponse;
|
||||
}>;
|
||||
updateHttpClientConfig(key: keyof NodeHttpHandlerOptions, value: NodeHttpHandlerOptions[typeof key]): void;
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -49,7 +49,7 @@ export declare class NodeHttp2Handler implements HttpHandler<NodeHttp2HandlerOpt
|
||||
static create(instanceOrOptions?: HttpHandler<any> | NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>): HttpHandler<any> | NodeHttp2Handler;
|
||||
constructor(options?: NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>);
|
||||
destroy(): void;
|
||||
handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
|
||||
handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
|
||||
response: HttpResponse;
|
||||
}>;
|
||||
updateHttpClientConfig(key: keyof NodeHttp2HandlerOptions, value: NodeHttp2HandlerOptions[typeof key]): void;
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -37,7 +37,7 @@ export declare class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptio
|
||||
constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>);
|
||||
private resolveDefaultConfig;
|
||||
destroy(): void;
|
||||
handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
|
||||
handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
|
||||
response: HttpResponse;
|
||||
}>;
|
||||
updateHttpClientConfig(key: keyof NodeHttpHandlerOptions, value: NodeHttpHandlerOptions[typeof key]): void;
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -49,7 +49,7 @@ export declare class NodeHttp2Handler implements HttpHandler<NodeHttp2HandlerOpt
|
||||
static create(instanceOrOptions?: HttpHandler<any> | NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>): HttpHandler<any> | NodeHttp2Handler;
|
||||
constructor(options?: NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>);
|
||||
destroy(): void;
|
||||
handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
|
||||
handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
|
||||
response: HttpResponse;
|
||||
}>;
|
||||
updateHttpClientConfig(key: keyof NodeHttp2HandlerOptions, value: NodeHttp2HandlerOptions[typeof key]): void;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@smithy/node-http-handler",
|
||||
"version": "4.0.6",
|
||||
"version": "4.1.0",
|
||||
"description": "Provides a way to make requests",
|
||||
"scripts": {
|
||||
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@smithy/smithy-client",
|
||||
"version": "4.4.5",
|
||||
"version": "4.4.7",
|
||||
"scripts": {
|
||||
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
||||
"build:cjs": "node ../../scripts/inline smithy-client",
|
||||
@@ -24,12 +24,12 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@smithy/core": "^3.6.0",
|
||||
"@smithy/middleware-endpoint": "^4.1.13",
|
||||
"@smithy/core": "^3.7.0",
|
||||
"@smithy/middleware-endpoint": "^4.1.15",
|
||||
"@smithy/middleware-stack": "^4.0.4",
|
||||
"@smithy/protocol-http": "^5.1.2",
|
||||
"@smithy/types": "^4.3.1",
|
||||
"@smithy/util-stream": "^4.2.2",
|
||||
"@smithy/util-stream": "^4.2.3",
|
||||
"tslib": "^2.6.2"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@smithy/util-defaults-mode-browser",
|
||||
"version": "4.0.21",
|
||||
"version": "4.0.23",
|
||||
"scripts": {
|
||||
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
||||
"build:cjs": "node ../../scripts/inline util-defaults-mode-browser",
|
||||
@@ -24,7 +24,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@smithy/property-provider": "^4.0.4",
|
||||
"@smithy/smithy-client": "^4.4.5",
|
||||
"@smithy/smithy-client": "^4.4.7",
|
||||
"@smithy/types": "^4.3.1",
|
||||
"bowser": "^2.11.0",
|
||||
"tslib": "^2.6.2"
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@smithy/util-defaults-mode-node",
|
||||
"version": "4.0.21",
|
||||
"version": "4.0.23",
|
||||
"scripts": {
|
||||
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
||||
"build:cjs": "node ../../scripts/inline util-defaults-mode-node",
|
||||
@@ -27,7 +27,7 @@
|
||||
"@smithy/credential-provider-imds": "^4.0.6",
|
||||
"@smithy/node-config-provider": "^4.1.3",
|
||||
"@smithy/property-provider": "^4.0.4",
|
||||
"@smithy/smithy-client": "^4.4.5",
|
||||
"@smithy/smithy-client": "^4.4.7",
|
||||
"@smithy/types": "^4.3.1",
|
||||
"tslib": "^2.6.2"
|
||||
},
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@smithy/util-stream",
|
||||
"version": "4.2.2",
|
||||
"version": "4.2.3",
|
||||
"scripts": {
|
||||
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
||||
"build:cjs": "node ../../scripts/inline util-stream",
|
||||
@@ -28,8 +28,8 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@smithy/fetch-http-handler": "^5.0.4",
|
||||
"@smithy/node-http-handler": "^4.0.6",
|
||||
"@smithy/fetch-http-handler": "^5.1.0",
|
||||
"@smithy/node-http-handler": "^4.1.0",
|
||||
"@smithy/types": "^4.3.1",
|
||||
"@smithy/util-base64": "^4.0.0",
|
||||
"@smithy/util-buffer-from": "^4.0.0",
|
||||
|
||||
Reference in New Issue
Block a user