@smithy/core 3.23.13 → 3.23.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/getSmithyContext.js +6 -0
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js +21 -0
- package/dist-cjs/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +21 -0
- package/dist-cjs/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +46 -0
- package/dist-cjs/middleware-http-auth-scheme/index.js +6 -0
- package/dist-cjs/middleware-http-auth-scheme/resolveAuthOptions.js +24 -0
- package/dist-cjs/middleware-http-signing/getHttpSigningMiddleware.js +19 -0
- package/dist-cjs/middleware-http-signing/httpSigningMiddleware.js +27 -0
- package/dist-cjs/middleware-http-signing/index.js +5 -0
- package/dist-cjs/normalizeProvider.js +10 -0
- package/dist-cjs/pagination/createPaginator.js +44 -0
- package/dist-cjs/request-builder/requestBuilder.js +5 -0
- package/dist-cjs/setFeature.js +14 -0
- package/dist-cjs/util-identity-and-auth/DefaultIdentityProviderConfig.js +17 -0
- package/dist-cjs/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js +38 -0
- package/dist-cjs/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js +15 -0
- package/dist-cjs/util-identity-and-auth/httpAuthSchemes/index.js +6 -0
- package/dist-cjs/util-identity-and-auth/httpAuthSchemes/noAuth.js +9 -0
- package/dist-cjs/util-identity-and-auth/index.js +6 -0
- package/dist-cjs/util-identity-and-auth/memoizeIdentityProvider.js +61 -0
- package/package.json +15 -16
- package/dist-types/ts3.4/getSmithyContext.d.ts +0 -5
- package/dist-types/ts3.4/index.d.ts +0 -8
- package/dist-types/ts3.4/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.d.ts +0 -18
- package/dist-types/ts3.4/middleware-http-auth-scheme/getHttpAuthSchemePlugin.d.ts +0 -18
- package/dist-types/ts3.4/middleware-http-auth-scheme/httpAuthSchemeMiddleware.d.ts +0 -33
- package/dist-types/ts3.4/middleware-http-auth-scheme/index.d.ts +0 -3
- package/dist-types/ts3.4/middleware-http-auth-scheme/resolveAuthOptions.d.ts +0 -10
- package/dist-types/ts3.4/middleware-http-signing/getHttpSigningMiddleware.d.ts +0 -9
- package/dist-types/ts3.4/middleware-http-signing/httpSigningMiddleware.d.ts +0 -5
- package/dist-types/ts3.4/middleware-http-signing/index.d.ts +0 -2
- package/dist-types/ts3.4/normalizeProvider.d.ts +0 -7
- package/dist-types/ts3.4/pagination/createPaginator.d.ts +0 -7
- package/dist-types/ts3.4/request-builder/requestBuilder.d.ts +0 -5
- package/dist-types/ts3.4/setFeature.d.ts +0 -12
- package/dist-types/ts3.4/submodules/cbor/CborCodec.d.ts +0 -33
- package/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +0 -28
- package/dist-types/ts3.4/submodules/cbor/byte-printer.d.ts +0 -6
- package/dist-types/ts3.4/submodules/cbor/cbor-decode.d.ts +0 -17
- package/dist-types/ts3.4/submodules/cbor/cbor-encode.d.ts +0 -9
- package/dist-types/ts3.4/submodules/cbor/cbor-types.d.ts +0 -65
- package/dist-types/ts3.4/submodules/cbor/cbor.d.ts +0 -26
- package/dist-types/ts3.4/submodules/cbor/index.d.ts +0 -5
- package/dist-types/ts3.4/submodules/cbor/parseCborBody.d.ts +0 -31
- package/dist-types/ts3.4/submodules/endpoints/index.d.ts +0 -1
- package/dist-types/ts3.4/submodules/endpoints/toEndpointV1.d.ts +0 -6
- package/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts +0 -60
- package/dist-types/ts3.4/submodules/event-streams/index.d.ts +0 -1
- package/dist-types/ts3.4/submodules/protocols/HttpBindingProtocol.d.ts +0 -31
- package/dist-types/ts3.4/submodules/protocols/HttpProtocol.d.ts +0 -89
- package/dist-types/ts3.4/submodules/protocols/RpcProtocol.d.ts +0 -16
- package/dist-types/ts3.4/submodules/protocols/SerdeContext.d.ts +0 -16
- package/dist-types/ts3.4/submodules/protocols/collect-stream-body.d.ts +0 -10
- package/dist-types/ts3.4/submodules/protocols/extended-encode-uri-component.d.ts +0 -7
- package/dist-types/ts3.4/submodules/protocols/index.d.ts +0 -13
- package/dist-types/ts3.4/submodules/protocols/requestBuilder.d.ts +0 -51
- package/dist-types/ts3.4/submodules/protocols/resolve-path.d.ts +0 -4
- package/dist-types/ts3.4/submodules/protocols/serde/FromStringShapeDeserializer.d.ts +0 -13
- package/dist-types/ts3.4/submodules/protocols/serde/HttpInterceptingShapeDeserializer.d.ts +0 -21
- package/dist-types/ts3.4/submodules/protocols/serde/HttpInterceptingShapeSerializer.d.ts +0 -23
- package/dist-types/ts3.4/submodules/protocols/serde/ToStringShapeSerializer.d.ts +0 -14
- package/dist-types/ts3.4/submodules/protocols/serde/determineTimestampFormat.d.ts +0 -9
- package/dist-types/ts3.4/submodules/schema/TypeRegistry.d.ts +0 -71
- package/dist-types/ts3.4/submodules/schema/deref.d.ts +0 -6
- package/dist-types/ts3.4/submodules/schema/index.d.ts +0 -14
- package/dist-types/ts3.4/submodules/schema/middleware/getSchemaSerdePlugin.d.ts +0 -14
- package/dist-types/ts3.4/submodules/schema/middleware/schema-middleware-types.d.ts +0 -11
- package/dist-types/ts3.4/submodules/schema/middleware/schemaDeserializationMiddleware.d.ts +0 -9
- package/dist-types/ts3.4/submodules/schema/middleware/schemaSerializationMiddleware.d.ts +0 -6
- package/dist-types/ts3.4/submodules/schema/schemas/ErrorSchema.d.ts +0 -37
- package/dist-types/ts3.4/submodules/schema/schemas/ListSchema.d.ts +0 -23
- package/dist-types/ts3.4/submodules/schema/schemas/MapSchema.d.ts +0 -24
- package/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +0 -146
- package/dist-types/ts3.4/submodules/schema/schemas/OperationSchema.d.ts +0 -23
- package/dist-types/ts3.4/submodules/schema/schemas/Schema.d.ts +0 -16
- package/dist-types/ts3.4/submodules/schema/schemas/SimpleSchema.d.ts +0 -28
- package/dist-types/ts3.4/submodules/schema/schemas/StructureSchema.d.ts +0 -23
- package/dist-types/ts3.4/submodules/schema/schemas/operation.d.ts +0 -7
- package/dist-types/ts3.4/submodules/schema/schemas/sentinels.d.ts +0 -23
- package/dist-types/ts3.4/submodules/schema/schemas/translateTraits.d.ts +0 -13
- package/dist-types/ts3.4/submodules/serde/copyDocumentWithTransform.d.ts +0 -6
- package/dist-types/ts3.4/submodules/serde/date-utils.d.ts +0 -73
- package/dist-types/ts3.4/submodules/serde/generateIdempotencyToken.d.ts +0 -2
- package/dist-types/ts3.4/submodules/serde/index.d.ts +0 -10
- package/dist-types/ts3.4/submodules/serde/lazy-json.d.ts +0 -45
- package/dist-types/ts3.4/submodules/serde/parse-utils.d.ts +0 -270
- package/dist-types/ts3.4/submodules/serde/quote-header.d.ts +0 -6
- package/dist-types/ts3.4/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +0 -47
- package/dist-types/ts3.4/submodules/serde/split-every.d.ts +0 -11
- package/dist-types/ts3.4/submodules/serde/split-header.d.ts +0 -5
- package/dist-types/ts3.4/submodules/serde/value/NumericValue.d.ts +0 -33
- package/dist-types/ts3.4/util-identity-and-auth/DefaultIdentityProviderConfig.d.ts +0 -15
- package/dist-types/ts3.4/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.d.ts +0 -8
- package/dist-types/ts3.4/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.d.ts +0 -8
- package/dist-types/ts3.4/util-identity-and-auth/httpAuthSchemes/index.d.ts +0 -3
- package/dist-types/ts3.4/util-identity-and-auth/httpAuthSchemes/noAuth.d.ts +0 -8
- package/dist-types/ts3.4/util-identity-and-auth/index.d.ts +0 -3
- package/dist-types/ts3.4/util-identity-and-auth/memoizeIdentityProvider.d.ts +0 -30
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PaginationConfiguration, Paginator } from "@smithy/types";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*
|
|
5
|
-
* Creates a paginator.
|
|
6
|
-
*/
|
|
7
|
-
export declare function createPaginator<PaginationConfigType extends PaginationConfiguration, InputType extends object, OutputType extends object>(ClientCtor: any, CommandCtor: any, inputTokenName: string, outputTokenName: string, pageSizeTokenName?: string): (config: PaginationConfigType, input: InputType, ...additionalArguments: any[]) => Paginator<OutputType>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { HandlerExecutionContext, SmithyFeatures } from "@smithy/types";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
* Indicates to the request context that a given feature is active.
|
|
5
|
-
*
|
|
6
|
-
* @param context - handler execution context.
|
|
7
|
-
* @param feature - readable name of feature.
|
|
8
|
-
* @param value - encoding value of feature. This is required because the
|
|
9
|
-
* specification asks the library not to include a runtime lookup of all
|
|
10
|
-
* the feature identifiers.
|
|
11
|
-
*/
|
|
12
|
-
export declare function setFeature<F extends keyof SmithyFeatures>(context: HandlerExecutionContext, feature: F, value: SmithyFeatures[F]): void;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { SerdeContext } from "@smithy/core/protocols";
|
|
2
|
-
import { Codec, Schema, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export declare class CborCodec extends SerdeContext implements Codec<Uint8Array, Uint8Array> {
|
|
7
|
-
createSerializer(): CborShapeSerializer;
|
|
8
|
-
createDeserializer(): CborShapeDeserializer;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export declare class CborShapeSerializer extends SerdeContext implements ShapeSerializer {
|
|
14
|
-
private value;
|
|
15
|
-
write(schema: Schema, value: unknown): void;
|
|
16
|
-
/**
|
|
17
|
-
* Recursive serializer transform that copies and prepares the user input object
|
|
18
|
-
* for CBOR serialization.
|
|
19
|
-
*/
|
|
20
|
-
serialize(schema: Schema, source: unknown): any;
|
|
21
|
-
flush(): Uint8Array;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
export declare class CborShapeDeserializer extends SerdeContext implements ShapeDeserializer {
|
|
27
|
-
read(schema: Schema, bytes: Uint8Array): any;
|
|
28
|
-
/**
|
|
29
|
-
* Public because it's called by the protocol implementation to deserialize errors.
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
readValue(_schema: Schema, value: any): any;
|
|
33
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { RpcProtocol } from "@smithy/core/protocols";
|
|
2
|
-
import { TypeRegistry } from "@smithy/core/schema";
|
|
3
|
-
import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, SerdeFunctions } from "@smithy/types";
|
|
4
|
-
import { CborCodec } from "./CborCodec";
|
|
5
|
-
/**
|
|
6
|
-
* Client protocol for Smithy RPCv2 CBOR.
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export declare class SmithyRpcV2CborProtocol extends RpcProtocol {
|
|
11
|
-
/**
|
|
12
|
-
* @override
|
|
13
|
-
*/
|
|
14
|
-
protected compositeErrorRegistry: TypeRegistry;
|
|
15
|
-
private codec;
|
|
16
|
-
protected serializer: import("./CborCodec").CborShapeSerializer;
|
|
17
|
-
protected deserializer: import("./CborCodec").CborShapeDeserializer;
|
|
18
|
-
constructor({ defaultNamespace, errorTypeRegistries, }: {
|
|
19
|
-
defaultNamespace: string;
|
|
20
|
-
errorTypeRegistries?: TypeRegistry[];
|
|
21
|
-
});
|
|
22
|
-
getShapeId(): string;
|
|
23
|
-
getPayloadCodec(): CborCodec;
|
|
24
|
-
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
|
25
|
-
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
|
26
|
-
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
|
|
27
|
-
protected getDefaultContentType(): string;
|
|
28
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CborValueType, Float32, Uint8, Uint32 } from "./cbor-types";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
* @param bytes - to be set as the decode source.
|
|
5
|
-
*
|
|
6
|
-
* Sets the decode bytearray source and its data view.
|
|
7
|
-
*/
|
|
8
|
-
export declare function setPayload(bytes: Uint8Array): void;
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
* Decodes the data between the two indices.
|
|
12
|
-
*/
|
|
13
|
-
export declare function decode(at: Uint32, to: Uint32): CborValueType;
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
export declare function bytesToFloat16(a: Uint8, b: Uint8): Float32;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export type CborItemType = undefined | boolean | number | bigint | [
|
|
2
|
-
CborUnstructuredByteStringType,
|
|
3
|
-
Uint64
|
|
4
|
-
] | string | CborTagType;
|
|
5
|
-
export type CborTagType = {
|
|
6
|
-
tag: Uint64 | number;
|
|
7
|
-
value: CborValueType;
|
|
8
|
-
[tagSymbol]: true;
|
|
9
|
-
};
|
|
10
|
-
export type CborUnstructuredByteStringType = Uint8Array;
|
|
11
|
-
export type CborListType<T = any> = Array<T>;
|
|
12
|
-
export type CborMapType<T = any> = Record<string, T>;
|
|
13
|
-
export type CborCollectionType<T = any> = CborMapType<T> | CborListType<T>;
|
|
14
|
-
export type CborValueType = CborItemType | CborCollectionType | any;
|
|
15
|
-
export type CborArgumentLength = 1 | 2 | 4 | 8;
|
|
16
|
-
export type CborArgumentLengthOffset = 1 | 2 | 3 | 5 | 9;
|
|
17
|
-
export type CborOffset = number;
|
|
18
|
-
export type Uint8 = number;
|
|
19
|
-
export type Uint32 = number;
|
|
20
|
-
export type Uint64 = bigint;
|
|
21
|
-
export type Float32 = number;
|
|
22
|
-
export type Int64 = bigint;
|
|
23
|
-
export type Float16Binary = number;
|
|
24
|
-
export type Float32Binary = number;
|
|
25
|
-
export type CborMajorType = typeof majorUint64 | typeof majorNegativeInt64 | typeof majorUnstructuredByteString | typeof majorUtf8String | typeof majorList | typeof majorMap | typeof majorTag | typeof majorSpecial;
|
|
26
|
-
export declare const majorUint64 = 0;
|
|
27
|
-
export declare const majorNegativeInt64 = 1;
|
|
28
|
-
export declare const majorUnstructuredByteString = 2;
|
|
29
|
-
export declare const majorUtf8String = 3;
|
|
30
|
-
export declare const majorList = 4;
|
|
31
|
-
export declare const majorMap = 5;
|
|
32
|
-
export declare const majorTag = 6;
|
|
33
|
-
export declare const majorSpecial = 7;
|
|
34
|
-
export declare const specialFalse = 20;
|
|
35
|
-
export declare const specialTrue = 21;
|
|
36
|
-
export declare const specialNull = 22;
|
|
37
|
-
export declare const specialUndefined = 23;
|
|
38
|
-
export declare const extendedOneByte = 24;
|
|
39
|
-
export declare const extendedFloat16 = 25;
|
|
40
|
-
export declare const extendedFloat32 = 26;
|
|
41
|
-
export declare const extendedFloat64 = 27;
|
|
42
|
-
export declare const minorIndefinite = 31;
|
|
43
|
-
export declare function alloc(size: number): Uint8Array;
|
|
44
|
-
/**
|
|
45
|
-
* @public
|
|
46
|
-
*
|
|
47
|
-
* The presence of this symbol as an object key indicates it should be considered a tag
|
|
48
|
-
* for CBOR serialization purposes.
|
|
49
|
-
*
|
|
50
|
-
* The object must also have the properties "tag" and "value".
|
|
51
|
-
*/
|
|
52
|
-
export declare const tagSymbol: unique symbol;
|
|
53
|
-
/**
|
|
54
|
-
* @public
|
|
55
|
-
* Applies the tag symbol to the object.
|
|
56
|
-
*/
|
|
57
|
-
export declare function tag(data: {
|
|
58
|
-
tag: number | bigint;
|
|
59
|
-
value: any;
|
|
60
|
-
[tagSymbol]?: true;
|
|
61
|
-
}): {
|
|
62
|
-
tag: number | bigint;
|
|
63
|
-
value: any;
|
|
64
|
-
[tagSymbol]: true;
|
|
65
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This implementation is synchronous and only implements the parts of CBOR
|
|
3
|
-
* specification used by Smithy RPCv2 CBOR protocol.
|
|
4
|
-
*
|
|
5
|
-
* This cbor serde implementation is derived from AWS SDK for Go's implementation.
|
|
6
|
-
* @see https://github.com/aws/smithy-go/tree/main/encoding/cbor
|
|
7
|
-
*
|
|
8
|
-
* The cbor-x implementation was also instructional:
|
|
9
|
-
* @see https://github.com/kriszyp/cbor-x
|
|
10
|
-
*/
|
|
11
|
-
export declare const cbor: {
|
|
12
|
-
deserialize(payload: Uint8Array): any;
|
|
13
|
-
serialize(input: any): Uint8Array;
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
* @param size - byte length to allocate.
|
|
17
|
-
*
|
|
18
|
-
* This may be used to garbage collect the CBOR
|
|
19
|
-
* shared encoding buffer space,
|
|
20
|
-
* e.g. resizeEncodingBuffer(0);
|
|
21
|
-
*
|
|
22
|
-
* This may also be used to pre-allocate more space for
|
|
23
|
-
* CBOR encoding, e.g. resizeEncodingBuffer(100_000_000);
|
|
24
|
-
*/
|
|
25
|
-
resizeEncodingBuffer(size: number): void;
|
|
26
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
2
|
-
import { HeaderBag as __HeaderBag, HttpResponse, SerdeContext as __SerdeContext, SerdeContext } from "@smithy/types";
|
|
3
|
-
import { tagSymbol } from "./cbor-types";
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare const parseCborBody: (streamBody: any, context: SerdeContext) => any;
|
|
8
|
-
/**
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export declare const dateToTag: (date: Date) => {
|
|
12
|
-
tag: number | bigint;
|
|
13
|
-
value: any;
|
|
14
|
-
[tagSymbol]: true;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
export declare const parseCborErrorBody: (errorBody: any, context: SerdeContext) => Promise<any>;
|
|
20
|
-
/**
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
export declare const loadSmithyRpcV2CborErrorCode: (output: HttpResponse, data: any) => string | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
export declare const checkCborResponse: (response: HttpResponse) => void;
|
|
28
|
-
/**
|
|
29
|
-
* @internal
|
|
30
|
-
*/
|
|
31
|
-
export declare const buildHttpRpcRequest: (context: __SerdeContext, headers: __HeaderBag, path: string, resolvedHostname: string | undefined, body: any) => Promise<__HttpRequest>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./toEndpointV1";
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { NormalizedSchema } from "@smithy/core/schema";
|
|
2
|
-
import { EventStreamMarshaller, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
|
|
3
|
-
/**
|
|
4
|
-
* Separated module for async mixin of EventStream serde capability.
|
|
5
|
-
* This is used by the HttpProtocol base class from \@smithy/core/protocols.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export declare class EventStreamSerde {
|
|
10
|
-
private readonly marshaller;
|
|
11
|
-
private readonly serializer;
|
|
12
|
-
private readonly deserializer;
|
|
13
|
-
private readonly serdeContext?;
|
|
14
|
-
private readonly defaultContentType;
|
|
15
|
-
/**
|
|
16
|
-
* Properties are injected by the HttpProtocol.
|
|
17
|
-
*/
|
|
18
|
-
constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, }: {
|
|
19
|
-
marshaller: EventStreamMarshaller;
|
|
20
|
-
serializer: ShapeSerializer<string | Uint8Array>;
|
|
21
|
-
deserializer: ShapeDeserializer<string | Uint8Array>;
|
|
22
|
-
serdeContext?: SerdeFunctions;
|
|
23
|
-
defaultContentType: string;
|
|
24
|
-
});
|
|
25
|
-
/**
|
|
26
|
-
* @param eventStream - the iterable provided by the caller.
|
|
27
|
-
* @param requestSchema - the schema of the event stream container (struct).
|
|
28
|
-
* @param [initialRequest] - only provided if the initial-request is part of the event stream (RPC).
|
|
29
|
-
*
|
|
30
|
-
* @returns a stream suitable for the HTTP body of a request.
|
|
31
|
-
*/
|
|
32
|
-
serializeEventStream({ eventStream, requestSchema, initialRequest, }: {
|
|
33
|
-
eventStream: AsyncIterable<any>;
|
|
34
|
-
requestSchema: NormalizedSchema;
|
|
35
|
-
initialRequest?: any;
|
|
36
|
-
}): Promise<IHttpRequest["body"] | Uint8Array>;
|
|
37
|
-
/**
|
|
38
|
-
* @param response - http response from which to read the event stream.
|
|
39
|
-
* @param unionSchema - schema of the event stream container (struct).
|
|
40
|
-
* @param [initialResponseContainer] - provided and written to only if the initial response is part of the event stream (RPC).
|
|
41
|
-
*
|
|
42
|
-
* @returns the asyncIterable of the event stream for the end-user.
|
|
43
|
-
*/
|
|
44
|
-
deserializeEventStream({ response, responseSchema, initialResponseContainer, }: {
|
|
45
|
-
response: IHttpResponse;
|
|
46
|
-
responseSchema: NormalizedSchema;
|
|
47
|
-
initialResponseContainer?: any;
|
|
48
|
-
}): Promise<AsyncIterable<{
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
$unknown?: unknown;
|
|
51
|
-
}>>;
|
|
52
|
-
/**
|
|
53
|
-
* @param unionMember - member name within the structure that contains an event stream union.
|
|
54
|
-
* @param unionSchema - schema of the union.
|
|
55
|
-
* @param event
|
|
56
|
-
*
|
|
57
|
-
* @returns the event body (bytes) and event type (string).
|
|
58
|
-
*/
|
|
59
|
-
private writeEventBody;
|
|
60
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./EventStreamSerde";
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { TypeRegistry, NormalizedSchema } from "@smithy/core/schema";
|
|
2
|
-
import { HttpRequest } from "@smithy/protocol-http";
|
|
3
|
-
import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, Schema, SerdeFunctions } from "@smithy/types";
|
|
4
|
-
import { HttpProtocol } from "./HttpProtocol";
|
|
5
|
-
/**
|
|
6
|
-
* Base for HTTP-binding protocols. Downstream examples
|
|
7
|
-
* include AWS REST JSON and AWS REST XML.
|
|
8
|
-
*
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export declare abstract class HttpBindingProtocol extends HttpProtocol {
|
|
12
|
-
/**
|
|
13
|
-
* @override
|
|
14
|
-
*/
|
|
15
|
-
protected compositeErrorRegistry: TypeRegistry;
|
|
16
|
-
serializeRequest<Input extends object>(operationSchema: OperationSchema, _input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
|
17
|
-
protected serializeQuery(ns: NormalizedSchema, data: any, query: HttpRequest["query"]): void;
|
|
18
|
-
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
|
19
|
-
/**
|
|
20
|
-
* The base method ignores HTTP bindings.
|
|
21
|
-
*
|
|
22
|
-
* @deprecated (only this signature) use signature without headerBindings.
|
|
23
|
-
* @override
|
|
24
|
-
*/
|
|
25
|
-
protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, headerBindings: Set<string>, dataObject: any): Promise<string[] & {
|
|
26
|
-
discardResponseBody?: boolean;
|
|
27
|
-
}>;
|
|
28
|
-
protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any): Promise<string[] & {
|
|
29
|
-
discardResponseBody?: boolean;
|
|
30
|
-
}>;
|
|
31
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { EventStreamSerde } from "@smithy/core/event-streams";
|
|
2
|
-
import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
|
|
3
|
-
import { ClientProtocol, Codec, Endpoint, EndpointBearer, EndpointV2, EventStreamMarshaller, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, Schema, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
|
|
4
|
-
import { SerdeContext } from "./SerdeContext";
|
|
5
|
-
/**
|
|
6
|
-
* Abstract base for HTTP-based client protocols.
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export declare abstract class HttpProtocol extends SerdeContext implements ClientProtocol<IHttpRequest, IHttpResponse> {
|
|
11
|
-
readonly options: {
|
|
12
|
-
defaultNamespace: string;
|
|
13
|
-
errorTypeRegistries?: TypeRegistry[];
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* An error registry having the namespace of the modeled service,
|
|
17
|
-
* but combining all error schemas found within the service closure.
|
|
18
|
-
*
|
|
19
|
-
* Used to look up error schema during deserialization.
|
|
20
|
-
*/
|
|
21
|
-
protected compositeErrorRegistry: TypeRegistry;
|
|
22
|
-
protected abstract serializer: ShapeSerializer<string | Uint8Array>;
|
|
23
|
-
protected abstract deserializer: ShapeDeserializer<string | Uint8Array>;
|
|
24
|
-
/**
|
|
25
|
-
* @param options.defaultNamespace - used by various implementing classes.
|
|
26
|
-
* @param options.errorTypeRegistries - registry instances that contribute to error deserialization.
|
|
27
|
-
*/
|
|
28
|
-
protected constructor(options: {
|
|
29
|
-
defaultNamespace: string;
|
|
30
|
-
errorTypeRegistries?: TypeRegistry[];
|
|
31
|
-
});
|
|
32
|
-
abstract getShapeId(): string;
|
|
33
|
-
abstract getPayloadCodec(): Codec<any, any>;
|
|
34
|
-
getRequestType(): new (...args: any[]) => IHttpRequest;
|
|
35
|
-
getResponseType(): new (...args: any[]) => IHttpResponse;
|
|
36
|
-
/**
|
|
37
|
-
* @override
|
|
38
|
-
*/
|
|
39
|
-
setSerdeContext(serdeContext: SerdeFunctions): void;
|
|
40
|
-
abstract serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
|
41
|
-
updateServiceEndpoint(request: IHttpRequest, endpoint: EndpointV2 | Endpoint): IHttpRequest;
|
|
42
|
-
abstract deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
|
43
|
-
protected setHostPrefix<Input extends object>(request: IHttpRequest, operationSchema: OperationSchema, input: Input): void;
|
|
44
|
-
protected abstract handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
|
|
45
|
-
protected deserializeMetadata(output: IHttpResponse): ResponseMetadata;
|
|
46
|
-
/**
|
|
47
|
-
* @param eventStream - the iterable provided by the caller.
|
|
48
|
-
* @param requestSchema - the schema of the event stream container (struct).
|
|
49
|
-
* @param [initialRequest] - only provided if the initial-request is part of the event stream (RPC).
|
|
50
|
-
*
|
|
51
|
-
* @returns a stream suitable for the HTTP body of a request.
|
|
52
|
-
*/
|
|
53
|
-
protected serializeEventStream({ eventStream, requestSchema, initialRequest, }: {
|
|
54
|
-
eventStream: AsyncIterable<any>;
|
|
55
|
-
requestSchema: NormalizedSchema;
|
|
56
|
-
initialRequest?: any;
|
|
57
|
-
}): Promise<IHttpRequest["body"]>;
|
|
58
|
-
/**
|
|
59
|
-
* @param response - http response from which to read the event stream.
|
|
60
|
-
* @param unionSchema - schema of the event stream container (struct).
|
|
61
|
-
* @param [initialResponseContainer] - provided and written to only if the initial response is part of the event stream (RPC).
|
|
62
|
-
*
|
|
63
|
-
* @returns the asyncIterable of the event stream.
|
|
64
|
-
*/
|
|
65
|
-
protected deserializeEventStream({ response, responseSchema, initialResponseContainer, }: {
|
|
66
|
-
response: IHttpResponse;
|
|
67
|
-
responseSchema: NormalizedSchema;
|
|
68
|
-
initialResponseContainer?: any;
|
|
69
|
-
}): Promise<AsyncIterable<{
|
|
70
|
-
[key: string]: any;
|
|
71
|
-
$unknown?: unknown;
|
|
72
|
-
}>>;
|
|
73
|
-
/**
|
|
74
|
-
* Loads eventStream capability async (for chunking).
|
|
75
|
-
*/
|
|
76
|
-
protected loadEventStreamCapability(): Promise<EventStreamSerde>;
|
|
77
|
-
/**
|
|
78
|
-
* @returns content-type default header value for event stream events and other documents.
|
|
79
|
-
*/
|
|
80
|
-
protected getDefaultContentType(): string;
|
|
81
|
-
/**
|
|
82
|
-
* For HTTP binding protocols, this method is overridden in {@link HttpBindingProtocol}.
|
|
83
|
-
*
|
|
84
|
-
* @deprecated only use this for HTTP binding protocols.
|
|
85
|
-
*/
|
|
86
|
-
protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, headerBindings: Set<string>, dataObject: any): Promise<string[]>;
|
|
87
|
-
protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any): Promise<string[]>;
|
|
88
|
-
protected getEventStreamMarshaller(): EventStreamMarshaller;
|
|
89
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TypeRegistry } from "@smithy/core/schema";
|
|
2
|
-
import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, SerdeFunctions } from "@smithy/types";
|
|
3
|
-
import { HttpProtocol } from "./HttpProtocol";
|
|
4
|
-
/**
|
|
5
|
-
* Abstract base for RPC-over-HTTP protocols.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export declare abstract class RpcProtocol extends HttpProtocol {
|
|
10
|
-
/**
|
|
11
|
-
* @override
|
|
12
|
-
*/
|
|
13
|
-
protected compositeErrorRegistry: TypeRegistry;
|
|
14
|
-
serializeRequest<Input extends object>(operationSchema: OperationSchema, _input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
|
15
|
-
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ConfigurableSerdeContext, SerdeFunctions } from "@smithy/types";
|
|
2
|
-
/**
|
|
3
|
-
* This in practice should be the client config object.
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
type SerdeContextType = SerdeFunctions & {
|
|
7
|
-
disableHostPrefix?: boolean;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export declare abstract class SerdeContext implements ConfigurableSerdeContext {
|
|
13
|
-
protected serdeContext?: SerdeContextType;
|
|
14
|
-
setSerdeContext(serdeContext: SerdeContextType): void;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SerdeContext } from "@smithy/types";
|
|
2
|
-
import { Uint8ArrayBlobAdapter } from "@smithy/util-stream";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*
|
|
6
|
-
* Collect low-level response body stream to Uint8Array.
|
|
7
|
-
*/
|
|
8
|
-
export declare const collectBody: (streamBody: any | undefined, context: {
|
|
9
|
-
streamCollector: SerdeContext["streamCollector"];
|
|
10
|
-
}) => Promise<Uint8ArrayBlobAdapter>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from "./collect-stream-body";
|
|
2
|
-
export * from "./extended-encode-uri-component";
|
|
3
|
-
export * from "./HttpBindingProtocol";
|
|
4
|
-
export * from "./HttpProtocol";
|
|
5
|
-
export * from "./RpcProtocol";
|
|
6
|
-
export * from "./requestBuilder";
|
|
7
|
-
export * from "./resolve-path";
|
|
8
|
-
export * from "./serde/FromStringShapeDeserializer";
|
|
9
|
-
export * from "./serde/HttpInterceptingShapeDeserializer";
|
|
10
|
-
export * from "./serde/HttpInterceptingShapeSerializer";
|
|
11
|
-
export * from "./serde/ToStringShapeSerializer";
|
|
12
|
-
export * from "./serde/determineTimestampFormat";
|
|
13
|
-
export * from "./SerdeContext";
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { HttpRequest } from "@smithy/protocol-http";
|
|
2
|
-
import { SerdeContext } from "@smithy/types";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
* used in code-generated serde.
|
|
6
|
-
*/
|
|
7
|
-
export declare function requestBuilder(input: any, context: SerdeContext): RequestBuilder;
|
|
8
|
-
/**
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export declare class RequestBuilder {
|
|
12
|
-
private input;
|
|
13
|
-
private context;
|
|
14
|
-
private query;
|
|
15
|
-
private method;
|
|
16
|
-
private headers;
|
|
17
|
-
private path;
|
|
18
|
-
private body;
|
|
19
|
-
private hostname;
|
|
20
|
-
private resolvePathStack;
|
|
21
|
-
constructor(input: any, context: SerdeContext);
|
|
22
|
-
build(): Promise<HttpRequest>;
|
|
23
|
-
/**
|
|
24
|
-
* Brevity setter for "hostname".
|
|
25
|
-
*/
|
|
26
|
-
hn(hostname: string): this;
|
|
27
|
-
/**
|
|
28
|
-
* Brevity initial builder for "basepath".
|
|
29
|
-
*/
|
|
30
|
-
bp(uriLabel: string): this;
|
|
31
|
-
/**
|
|
32
|
-
* Brevity incremental builder for "path".
|
|
33
|
-
*/
|
|
34
|
-
p(memberName: string, labelValueProvider: () => string | undefined, uriLabel: string, isGreedyLabel: boolean): this;
|
|
35
|
-
/**
|
|
36
|
-
* Brevity setter for "headers".
|
|
37
|
-
*/
|
|
38
|
-
h(headers: Record<string, string>): this;
|
|
39
|
-
/**
|
|
40
|
-
* Brevity setter for "query".
|
|
41
|
-
*/
|
|
42
|
-
q(query: Record<string, string>): this;
|
|
43
|
-
/**
|
|
44
|
-
* Brevity setter for "body".
|
|
45
|
-
*/
|
|
46
|
-
b(body: any): this;
|
|
47
|
-
/**
|
|
48
|
-
* Brevity setter for "method".
|
|
49
|
-
*/
|
|
50
|
-
m(method: string): this;
|
|
51
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CodecSettings, Schema, ShapeDeserializer } from "@smithy/types";
|
|
2
|
-
import { SerdeContext } from "../SerdeContext";
|
|
3
|
-
/**
|
|
4
|
-
* This deserializer reads strings.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export declare class FromStringShapeDeserializer extends SerdeContext implements ShapeDeserializer<string> {
|
|
9
|
-
private settings;
|
|
10
|
-
constructor(settings: CodecSettings);
|
|
11
|
-
read(_schema: Schema, data: string): any;
|
|
12
|
-
private base64ToUtf8;
|
|
13
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CodecSettings, Schema, SerdeFunctions, ShapeDeserializer } from "@smithy/types";
|
|
2
|
-
import { SerdeContext } from "../SerdeContext";
|
|
3
|
-
/**
|
|
4
|
-
* This deserializer is a dispatcher that decides whether to use a string deserializer
|
|
5
|
-
* or a codec deserializer based on HTTP traits.
|
|
6
|
-
*
|
|
7
|
-
* For example, in a JSON HTTP message, the deserialization of a field will differ depending on whether
|
|
8
|
-
* it is bound to the HTTP header (string) or body (JSON).
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export declare class HttpInterceptingShapeDeserializer<CodecShapeDeserializer extends ShapeDeserializer<any>> extends SerdeContext implements ShapeDeserializer<string | Uint8Array> {
|
|
13
|
-
private codecDeserializer;
|
|
14
|
-
private stringDeserializer;
|
|
15
|
-
constructor(codecDeserializer: CodecShapeDeserializer, codecSettings: CodecSettings);
|
|
16
|
-
/**
|
|
17
|
-
* @override
|
|
18
|
-
*/
|
|
19
|
-
setSerdeContext(serdeContext: SerdeFunctions): void;
|
|
20
|
-
read(schema: Schema, data: string | Uint8Array): any | Promise<any>;
|
|
21
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { CodecSettings, ConfigurableSerdeContext, Schema as ISchema, SerdeFunctions, ShapeSerializer } from "@smithy/types";
|
|
2
|
-
import { ToStringShapeSerializer } from "./ToStringShapeSerializer";
|
|
3
|
-
/**
|
|
4
|
-
* This serializer decides whether to dispatch to a string serializer or a codec serializer
|
|
5
|
-
* depending on HTTP binding traits within the given schema.
|
|
6
|
-
*
|
|
7
|
-
* For example, a JavaScript array is serialized differently when being written
|
|
8
|
-
* to a REST JSON HTTP header (comma-delimited string) and a REST JSON HTTP body (JSON array).
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export declare class HttpInterceptingShapeSerializer<CodecShapeSerializer extends ShapeSerializer<string | Uint8Array>> implements ShapeSerializer<string | Uint8Array>, ConfigurableSerdeContext {
|
|
13
|
-
private codecSerializer;
|
|
14
|
-
private stringSerializer;
|
|
15
|
-
private buffer;
|
|
16
|
-
constructor(codecSerializer: CodecShapeSerializer, codecSettings: CodecSettings, stringSerializer?: ToStringShapeSerializer);
|
|
17
|
-
/**
|
|
18
|
-
* @override
|
|
19
|
-
*/
|
|
20
|
-
setSerdeContext(serdeContext: SerdeFunctions): void;
|
|
21
|
-
write(schema: ISchema, value: unknown): void;
|
|
22
|
-
flush(): string | Uint8Array;
|
|
23
|
-
}
|