@smithy/core 3.23.12 → 3.23.14
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/README.md +12 -1
- 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/submodules/protocols/index.js +8 -17
- 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/dist-es/submodules/protocols/HttpBindingProtocol.js +1 -8
- package/dist-es/submodules/protocols/RpcProtocol.js +7 -9
- package/dist-types/submodules/protocols/RpcProtocol.d.ts +1 -1
- 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,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
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CodecSettings, Schema, ShapeSerializer } from "@smithy/types";
|
|
2
|
-
import { SerdeContext } from "../SerdeContext";
|
|
3
|
-
/**
|
|
4
|
-
* Serializes a shape to string.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export declare class ToStringShapeSerializer extends SerdeContext implements ShapeSerializer<string> {
|
|
9
|
-
private settings;
|
|
10
|
-
private stringBuffer;
|
|
11
|
-
constructor(settings: CodecSettings);
|
|
12
|
-
write(schema: Schema, value: unknown): void;
|
|
13
|
-
flush(): string;
|
|
14
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NormalizedSchema } from "@smithy/core/schema";
|
|
2
|
-
import { CodecSettings, TimestampDateTimeSchema, TimestampEpochSecondsSchema, TimestampHttpDateSchema } from "@smithy/types";
|
|
3
|
-
/**
|
|
4
|
-
* Assuming the schema is a timestamp type, the function resolves the format using
|
|
5
|
-
* either the timestamp's own traits, or the default timestamp format from the CodecSettings.
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare function determineTimestampFormat(ns: NormalizedSchema, settings: CodecSettings): TimestampDateTimeSchema | TimestampHttpDateSchema | TimestampEpochSecondsSchema;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Schema as ISchema, StaticErrorSchema } from "@smithy/types";
|
|
2
|
-
import { ErrorSchema } from "./schemas/ErrorSchema";
|
|
3
|
-
/**
|
|
4
|
-
* A way to look up schema by their ShapeId values.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export declare class TypeRegistry {
|
|
9
|
-
readonly namespace: string;
|
|
10
|
-
private schemas;
|
|
11
|
-
private exceptions;
|
|
12
|
-
static readonly registries: Map<string, TypeRegistry>;
|
|
13
|
-
private constructor();
|
|
14
|
-
/**
|
|
15
|
-
* @param namespace - specifier.
|
|
16
|
-
* @returns the schema for that namespace, creating it if necessary.
|
|
17
|
-
*/
|
|
18
|
-
static for(namespace: string): TypeRegistry;
|
|
19
|
-
/**
|
|
20
|
-
* Copies entries from another instance without changing the namespace of self.
|
|
21
|
-
* The composition is additive but non-destructive and will not overwrite existing entries.
|
|
22
|
-
*
|
|
23
|
-
* @param other - another TypeRegistry.
|
|
24
|
-
*/
|
|
25
|
-
copyFrom(other: TypeRegistry): void;
|
|
26
|
-
/**
|
|
27
|
-
* Adds the given schema to a type registry with the same namespace, and this registry.
|
|
28
|
-
*
|
|
29
|
-
* @param shapeId - to be registered.
|
|
30
|
-
* @param schema - to be registered.
|
|
31
|
-
*/
|
|
32
|
-
register(shapeId: string, schema: ISchema): void;
|
|
33
|
-
/**
|
|
34
|
-
* @param shapeId - query.
|
|
35
|
-
* @returns the schema.
|
|
36
|
-
*/
|
|
37
|
-
getSchema(shapeId: string): ISchema;
|
|
38
|
-
/**
|
|
39
|
-
* Associates an error schema with its constructor.
|
|
40
|
-
*/
|
|
41
|
-
registerError(es: ErrorSchema | StaticErrorSchema, ctor: any): void;
|
|
42
|
-
/**
|
|
43
|
-
* @param es - query.
|
|
44
|
-
* @returns Error constructor that extends the service's base exception.
|
|
45
|
-
*/
|
|
46
|
-
getErrorCtor(es: ErrorSchema | StaticErrorSchema): any;
|
|
47
|
-
/**
|
|
48
|
-
* The smithy-typescript code generator generates a synthetic (i.e. unmodeled) base exception,
|
|
49
|
-
* because generated SDKs before the introduction of schemas have the notion of a ServiceBaseException, which
|
|
50
|
-
* is unique per service/model.
|
|
51
|
-
*
|
|
52
|
-
* This is generated under a unique prefix that is combined with the service namespace, and this
|
|
53
|
-
* method is used to retrieve it.
|
|
54
|
-
*
|
|
55
|
-
* The base exception synthetic schema is used when an error is returned by a service, but we cannot
|
|
56
|
-
* determine what existing schema to use to deserialize it.
|
|
57
|
-
*
|
|
58
|
-
* @returns the synthetic base exception of the service namespace associated with this registry instance.
|
|
59
|
-
*/
|
|
60
|
-
getBaseException(): StaticErrorSchema | undefined;
|
|
61
|
-
/**
|
|
62
|
-
* @param predicate - criterion.
|
|
63
|
-
* @returns a schema in this registry matching the predicate.
|
|
64
|
-
*/
|
|
65
|
-
find(predicate: (schema: ISchema) => boolean): ISchema | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Unloads the current TypeRegistry.
|
|
68
|
-
*/
|
|
69
|
-
clear(): void;
|
|
70
|
-
private normalizeShapeId;
|
|
71
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from "./deref";
|
|
2
|
-
export * from "./middleware/getSchemaSerdePlugin";
|
|
3
|
-
export * from "./schemas/ListSchema";
|
|
4
|
-
export * from "./schemas/MapSchema";
|
|
5
|
-
export * from "./schemas/OperationSchema";
|
|
6
|
-
export * from "./schemas/operation";
|
|
7
|
-
export * from "./schemas/ErrorSchema";
|
|
8
|
-
export * from "./schemas/NormalizedSchema";
|
|
9
|
-
export * from "./schemas/Schema";
|
|
10
|
-
export * from "./schemas/SimpleSchema";
|
|
11
|
-
export * from "./schemas/StructureSchema";
|
|
12
|
-
export * from "./schemas/sentinels";
|
|
13
|
-
export * from "./schemas/translateTraits";
|
|
14
|
-
export * from "./TypeRegistry";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DeserializeHandlerOptions, MetadataBearer, Pluggable, SerializeHandlerOptions } from "@smithy/types";
|
|
2
|
-
import { PreviouslyResolved } from "./schema-middleware-types";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare const deserializerMiddlewareOption: DeserializeHandlerOptions;
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export declare const serializerMiddlewareOption: SerializeHandlerOptions;
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare function getSchemaSerdePlugin<InputType extends object = any, OutputType extends MetadataBearer = any>(config: PreviouslyResolved): Pluggable<InputType, OutputType>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ClientProtocol, SerdeContext, UrlParser } from "@smithy/types";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export type PreviouslyResolved = Pick<SerdeContext & {
|
|
6
|
-
urlParser: UrlParser;
|
|
7
|
-
protocol: ClientProtocol<any, any>;
|
|
8
|
-
}, Exclude<keyof (SerdeContext & {
|
|
9
|
-
urlParser: UrlParser;
|
|
10
|
-
protocol: ClientProtocol<any, any>;
|
|
11
|
-
}), "endpoint">>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DeserializeHandler, DeserializeHandlerArguments, HandlerExecutionContext } from "@smithy/types";
|
|
2
|
-
import { PreviouslyResolved } from "./schema-middleware-types";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare const schemaDeserializationMiddleware: <O>(config: PreviouslyResolved) => (next: DeserializeHandler<any, any>, context: HandlerExecutionContext) => (args: DeserializeHandlerArguments<any>) => Promise<{
|
|
7
|
-
response: unknown;
|
|
8
|
-
output: O;
|
|
9
|
-
}>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { HandlerExecutionContext, SerializeHandler, SerializeHandlerArguments } from "@smithy/types";
|
|
2
|
-
import { PreviouslyResolved } from "./schema-middleware-types";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare const schemaSerializationMiddleware: (config: PreviouslyResolved) => (next: SerializeHandler<any, any>, context: HandlerExecutionContext) => (args: SerializeHandlerArguments<any>) => Promise<import("@smithy/types").SerializeHandlerOutput<any>>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { SchemaRef, SchemaTraits } from "@smithy/types";
|
|
2
|
-
import { StructureSchema } from "./StructureSchema";
|
|
3
|
-
/**
|
|
4
|
-
* A schema for a structure shape having the error trait. These represent enumerated operation errors.
|
|
5
|
-
* Because Smithy-TS SDKs use classes for exceptions, whereas plain objects are used for all other data,
|
|
6
|
-
* and have an existing notion of a XYZServiceBaseException, the ErrorSchema differs from a StructureSchema
|
|
7
|
-
* by additionally holding the class reference for the corresponding ServiceException class.
|
|
8
|
-
*
|
|
9
|
-
* @internal
|
|
10
|
-
* @deprecated use StaticSchema
|
|
11
|
-
*/
|
|
12
|
-
export declare class ErrorSchema extends StructureSchema {
|
|
13
|
-
static readonly symbol: unique symbol;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated - field unused.
|
|
16
|
-
*/
|
|
17
|
-
ctor: any;
|
|
18
|
-
protected readonly symbol: symbol;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Factory for ErrorSchema, to reduce codegen output and register the schema.
|
|
22
|
-
*
|
|
23
|
-
* @internal
|
|
24
|
-
* @deprecated use StaticSchema
|
|
25
|
-
*
|
|
26
|
-
* @param namespace - shapeId namespace.
|
|
27
|
-
* @param name - shapeId name.
|
|
28
|
-
* @param traits - shape level serde traits.
|
|
29
|
-
* @param memberNames - list of member names.
|
|
30
|
-
* @param memberList - list of schemaRef corresponding to each
|
|
31
|
-
* @param ctor - class reference for the existing Error extending class.
|
|
32
|
-
*/
|
|
33
|
-
export declare const error: (namespace: string, name: string, traits: SchemaTraits, memberNames: string[], memberList: SchemaRef[],
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated - field unused.
|
|
36
|
-
*/
|
|
37
|
-
ctor?: any) => ErrorSchema;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ListSchema as IListSchema, SchemaRef, SchemaTraits } from "@smithy/types";
|
|
2
|
-
import { Schema } from "./Schema";
|
|
3
|
-
/**
|
|
4
|
-
* A schema with a single member schema.
|
|
5
|
-
* The deprecated Set type may be represented as a list.
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
* @deprecated use StaticSchema
|
|
9
|
-
*/
|
|
10
|
-
export declare class ListSchema extends Schema implements IListSchema {
|
|
11
|
-
static readonly symbol: unique symbol;
|
|
12
|
-
name: string;
|
|
13
|
-
traits: SchemaTraits;
|
|
14
|
-
valueSchema: SchemaRef;
|
|
15
|
-
protected readonly symbol: symbol;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Factory for ListSchema.
|
|
19
|
-
*
|
|
20
|
-
* @internal
|
|
21
|
-
* @deprecated use StaticSchema
|
|
22
|
-
*/
|
|
23
|
-
export declare const list: (namespace: string, name: string, traits: SchemaTraits, valueSchema: SchemaRef) => ListSchema;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { MapSchema as IMapSchema, SchemaRef, SchemaTraits } from "@smithy/types";
|
|
2
|
-
import { Schema } from "./Schema";
|
|
3
|
-
/**
|
|
4
|
-
* A schema with a key schema and value schema.
|
|
5
|
-
* @internal
|
|
6
|
-
* @deprecated use StaticSchema
|
|
7
|
-
*/
|
|
8
|
-
export declare class MapSchema extends Schema implements IMapSchema {
|
|
9
|
-
static readonly symbol: unique symbol;
|
|
10
|
-
name: string;
|
|
11
|
-
traits: SchemaTraits;
|
|
12
|
-
/**
|
|
13
|
-
* This is expected to be StringSchema, but may have traits.
|
|
14
|
-
*/
|
|
15
|
-
keySchema: SchemaRef;
|
|
16
|
-
valueSchema: SchemaRef;
|
|
17
|
-
protected readonly symbol: symbol;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Factory for MapSchema.
|
|
21
|
-
* @internal
|
|
22
|
-
* @deprecated use StaticSchema
|
|
23
|
-
*/
|
|
24
|
-
export declare const map: (namespace: string, name: string, traits: SchemaTraits, keySchema: SchemaRef, valueSchema: SchemaRef) => MapSchema;
|