@cdk8s/awscdk-resolver 0.0.348 → 0.0.349
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/.jsii +2 -2
- package/lib/resolve.js +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +44 -15
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +261 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +129 -39
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +25 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +36 -15
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +200 -0
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +11 -26
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +36 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +36 -10
- package/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +17 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/CborCodec.d.ts +6 -2
- package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/parseCborBody.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/event-streams/EventStreamSerde.d.ts +60 -0
- package/node_modules/@smithy/core/dist-types/submodules/event-streams/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpBindingProtocol.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpProtocol.d.ts +39 -1
- package/node_modules/@smithy/core/dist-types/submodules/protocols/RpcProtocol.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/protocols/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/serde/FromStringShapeDeserializer.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/protocols/serde/HttpInterceptingShapeDeserializer.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/protocols/serde/HttpInterceptingShapeSerializer.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/protocols/serde/ToStringShapeSerializer.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/protocols/serde/determineTimestampFormat.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/schema/middleware/getSchemaSerdePlugin.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/schema/middleware/schemaDeserializationMiddleware.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +10 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/SimpleSchema.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/sentinels.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/serde/copyDocumentWithTransform.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/CborCodec.d.ts +5 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts +60 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/event-streams/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/HttpProtocol.d.ts +39 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/serde/determineTimestampFormat.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +10 -0
- package/node_modules/@smithy/core/event-streams.d.ts +7 -0
- package/node_modules/@smithy/core/event-streams.js +6 -0
- package/node_modules/@smithy/core/package.json +11 -1
- package/node_modules/@smithy/middleware-endpoint/package.json +2 -2
- package/node_modules/@smithy/middleware-retry/package.json +4 -4
- package/node_modules/@smithy/smithy-client/dist-cjs/index.js +43 -6
- package/node_modules/@smithy/smithy-client/dist-cjs/schemaLogFilter.js +1 -0
- package/node_modules/@smithy/smithy-client/dist-es/command.js +7 -4
- package/node_modules/@smithy/smithy-client/dist-es/schemaLogFilter.js +34 -0
- package/node_modules/@smithy/smithy-client/dist-types/schemaLogFilter.d.ts +9 -0
- package/node_modules/@smithy/smithy-client/dist-types/ts3.4/schemaLogFilter.d.ts +9 -0
- package/node_modules/@smithy/smithy-client/package.json +3 -3
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
- package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
- package/package.json +3 -3
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CodecSettings, Schema, SerdeFunctions, ShapeDeserializer } from "@smithy/types";
|
1
|
+
import type { CodecSettings, Schema, SerdeFunctions, ShapeDeserializer } from "@smithy/types";
|
2
2
|
/**
|
3
3
|
* This deserializer is a dispatcher that decides whether to use a string deserializer
|
4
4
|
* or a codec deserializer based on HTTP traits.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CodecSettings, Schema as ISchema, SerdeFunctions, ShapeSerializer } from "@smithy/types";
|
1
|
+
import type { CodecSettings, Schema as ISchema, SerdeFunctions, ShapeSerializer } from "@smithy/types";
|
2
2
|
import { ToStringShapeSerializer } from "./ToStringShapeSerializer";
|
3
3
|
/**
|
4
4
|
* This serializer decides whether to dispatch to a string serializer or a codec serializer
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { NormalizedSchema } from "@smithy/core/schema";
|
2
|
-
import {
|
2
|
+
import type { CodecSettings, TimestampDateTimeSchema, TimestampEpochSecondsSchema, TimestampHttpDateSchema } from "@smithy/types";
|
3
3
|
/**
|
4
4
|
* Assuming the schema is a timestamp type, the function resolves the format using
|
5
5
|
* either the timestamp's own traits, or the default timestamp format from the CodecSettings.
|
package/node_modules/@smithy/core/dist-types/submodules/schema/middleware/getSchemaSerdePlugin.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { DeserializeHandlerOptions, MetadataBearer, Pluggable, SerializeHandlerOptions } from "@smithy/types";
|
1
|
+
import type { DeserializeHandlerOptions, MetadataBearer, Pluggable, SerializeHandlerOptions } from "@smithy/types";
|
2
2
|
import { PreviouslyResolved } from "./schema-middleware-types";
|
3
3
|
/**
|
4
4
|
* @internal
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { DeserializeHandler, DeserializeHandlerArguments, HandlerExecutionContext } from "@smithy/types";
|
1
|
+
import type { DeserializeHandler, DeserializeHandlerArguments, HandlerExecutionContext } from "@smithy/types";
|
2
2
|
import { PreviouslyResolved } from "./schema-middleware-types";
|
3
3
|
/**
|
4
4
|
* @internal
|
package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts
CHANGED
@@ -98,6 +98,11 @@ export declare class NormalizedSchema implements INormalizedSchema {
|
|
98
98
|
* @throws Error if the schema is not a Map, List, nor Document.
|
99
99
|
*/
|
100
100
|
getValueSchema(): NormalizedSchema;
|
101
|
+
/**
|
102
|
+
* @param member - to query.
|
103
|
+
* @returns whether there is a memberSchema with the given member name. False if not a structure (or union).
|
104
|
+
*/
|
105
|
+
hasMemberSchema(member: string): boolean;
|
101
106
|
/**
|
102
107
|
* @returns the NormalizedSchema for the given member name. The returned instance will return true for `isMemberSchema()`
|
103
108
|
* and will have the member name given.
|
@@ -116,6 +121,11 @@ export declare class NormalizedSchema implements INormalizedSchema {
|
|
116
121
|
* @returns a map of member names to member schemas (normalized).
|
117
122
|
*/
|
118
123
|
getMemberSchemas(): Record<string, NormalizedSchema>;
|
124
|
+
/**
|
125
|
+
* @returns member name of event stream or empty string indicating none exists or this
|
126
|
+
* isn't a structure schema.
|
127
|
+
*/
|
128
|
+
getEventStreamMember(): string;
|
119
129
|
/**
|
120
130
|
* Allows iteration over members of a structure schema.
|
121
131
|
* Each yield is a pair of the member name and member schema.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SchemaRef, SchemaTraits, TraitsSchema } from "@smithy/types";
|
1
|
+
import type { SchemaRef, SchemaTraits, TraitsSchema } from "@smithy/types";
|
2
2
|
import { Schema } from "./Schema";
|
3
3
|
/**
|
4
4
|
* Although numeric values exist for most simple schema, this class is used for cases where traits are
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { BigDecimalSchema, BigIntegerSchema, BlobSchema, BooleanSchema, DocumentSchema, ListSchemaModifier, MapSchemaModifier, NumericSchema, StreamingBlobSchema, StringSchema, TimestampDateTimeSchema, TimestampDefaultSchema, TimestampEpochSecondsSchema, TimestampHttpDateSchema } from "@smithy/types";
|
1
|
+
import type { BigDecimalSchema, BigIntegerSchema, BlobSchema, BooleanSchema, DocumentSchema, ListSchemaModifier, MapSchemaModifier, NumericSchema, StreamingBlobSchema, StringSchema, TimestampDateTimeSchema, TimestampDefaultSchema, TimestampEpochSecondsSchema, TimestampHttpDateSchema } from "@smithy/types";
|
2
2
|
/**
|
3
3
|
* Schema sentinel runtime values.
|
4
4
|
* @alpha
|
@@ -30,5 +30,9 @@ export declare class CborShapeDeserializer implements ShapeDeserializer {
|
|
30
30
|
private serdeContext?;
|
31
31
|
setSerdeContext(serdeContext: SerdeFunctions): void;
|
32
32
|
read(schema: Schema, bytes: Uint8Array): any;
|
33
|
-
|
33
|
+
/**
|
34
|
+
* Public because it's called by the protocol implementation to deserialize errors.
|
35
|
+
* @internal
|
36
|
+
*/
|
37
|
+
readValue(_schema: Schema, value: any): any;
|
34
38
|
}
|
package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts
CHANGED
@@ -19,4 +19,5 @@ export declare class SmithyRpcV2CborProtocol extends RpcProtocol {
|
|
19
19
|
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
20
20
|
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
21
21
|
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
|
22
|
+
protected getDefaultContentType(): string;
|
22
23
|
}
|
package/node_modules/@smithy/core/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts
ADDED
@@ -0,0 +1,60 @@
|
|
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
|
+
* @alpha
|
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
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./EventStreamSerde";
|
@@ -1,4 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { EventStreamSerde } from "@smithy/core/event-streams";
|
2
|
+
import { NormalizedSchema } 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";
|
2
4
|
/**
|
3
5
|
* Abstract base for HTTP-based client protocols.
|
4
6
|
*
|
@@ -25,6 +27,41 @@ export declare abstract class HttpProtocol implements ClientProtocol<IHttpReques
|
|
25
27
|
protected setHostPrefix<Input extends object>(request: IHttpRequest, operationSchema: OperationSchema, input: Input): void;
|
26
28
|
protected abstract handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
|
27
29
|
protected deserializeMetadata(output: IHttpResponse): ResponseMetadata;
|
30
|
+
/**
|
31
|
+
* @param eventStream - the iterable provided by the caller.
|
32
|
+
* @param requestSchema - the schema of the event stream container (struct).
|
33
|
+
* @param [initialRequest] - only provided if the initial-request is part of the event stream (RPC).
|
34
|
+
*
|
35
|
+
* @returns a stream suitable for the HTTP body of a request.
|
36
|
+
*/
|
37
|
+
protected serializeEventStream({ eventStream, requestSchema, initialRequest, }: {
|
38
|
+
eventStream: AsyncIterable<any>;
|
39
|
+
requestSchema: NormalizedSchema;
|
40
|
+
initialRequest?: any;
|
41
|
+
}): Promise<IHttpRequest["body"]>;
|
42
|
+
/**
|
43
|
+
* @param response - http response from which to read the event stream.
|
44
|
+
* @param unionSchema - schema of the event stream container (struct).
|
45
|
+
* @param [initialResponseContainer] - provided and written to only if the initial response is part of the event stream (RPC).
|
46
|
+
*
|
47
|
+
* @returns the asyncIterable of the event stream.
|
48
|
+
*/
|
49
|
+
protected deserializeEventStream({ response, responseSchema, initialResponseContainer, }: {
|
50
|
+
response: IHttpResponse;
|
51
|
+
responseSchema: NormalizedSchema;
|
52
|
+
initialResponseContainer?: any;
|
53
|
+
}): Promise<AsyncIterable<{
|
54
|
+
[key: string]: any;
|
55
|
+
$unknown?: unknown;
|
56
|
+
}>>;
|
57
|
+
/**
|
58
|
+
* Loads eventStream capability async (for chunking).
|
59
|
+
*/
|
60
|
+
protected loadEventStreamCapability(): Promise<EventStreamSerde>;
|
61
|
+
/**
|
62
|
+
* @returns content-type default header value for event stream events and other documents.
|
63
|
+
*/
|
64
|
+
protected getDefaultContentType(): string;
|
28
65
|
/**
|
29
66
|
* For HTTP binding protocols, this method is overridden in {@link HttpBindingProtocol}.
|
30
67
|
*
|
@@ -32,4 +69,5 @@ export declare abstract class HttpProtocol implements ClientProtocol<IHttpReques
|
|
32
69
|
*/
|
33
70
|
protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, headerBindings: Set<string>, dataObject: any): Promise<string[]>;
|
34
71
|
protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any): Promise<string[]>;
|
72
|
+
protected getEventStreamMarshaller(): EventStreamMarshaller;
|
35
73
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { NormalizedSchema } from "@smithy/core/schema";
|
2
|
-
import { TimestampDateTimeSchema, TimestampEpochSecondsSchema, TimestampHttpDateSchema
|
2
|
+
import { CodecSettings, TimestampDateTimeSchema, TimestampEpochSecondsSchema, TimestampHttpDateSchema } from "@smithy/types";
|
3
3
|
/**
|
4
4
|
* Assuming the schema is a timestamp type, the function resolves the format using
|
5
5
|
* either the timestamp's own traits, or the default timestamp format from the CodecSettings.
|
package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts
CHANGED
@@ -98,6 +98,11 @@ export declare class NormalizedSchema implements INormalizedSchema {
|
|
98
98
|
* @throws Error if the schema is not a Map, List, nor Document.
|
99
99
|
*/
|
100
100
|
getValueSchema(): NormalizedSchema;
|
101
|
+
/**
|
102
|
+
* @param member - to query.
|
103
|
+
* @returns whether there is a memberSchema with the given member name. False if not a structure (or union).
|
104
|
+
*/
|
105
|
+
hasMemberSchema(member: string): boolean;
|
101
106
|
/**
|
102
107
|
* @returns the NormalizedSchema for the given member name. The returned instance will return true for `isMemberSchema()`
|
103
108
|
* and will have the member name given.
|
@@ -116,6 +121,11 @@ export declare class NormalizedSchema implements INormalizedSchema {
|
|
116
121
|
* @returns a map of member names to member schemas (normalized).
|
117
122
|
*/
|
118
123
|
getMemberSchemas(): Record<string, NormalizedSchema>;
|
124
|
+
/**
|
125
|
+
* @returns member name of event stream or empty string indicating none exists or this
|
126
|
+
* isn't a structure schema.
|
127
|
+
*/
|
128
|
+
getEventStreamMember(): string;
|
119
129
|
/**
|
120
130
|
* Allows iteration over members of a structure schema.
|
121
131
|
* Each yield is a pair of the member name and member schema.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.9.0",
|
4
4
|
"scripts": {
|
5
5
|
"build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline core",
|
@@ -60,6 +60,13 @@
|
|
60
60
|
"node": "./dist-cjs/submodules/schema/index.js",
|
61
61
|
"import": "./dist-es/submodules/schema/index.js",
|
62
62
|
"require": "./dist-cjs/submodules/schema/index.js"
|
63
|
+
},
|
64
|
+
"./event-streams": {
|
65
|
+
"types": "./dist-types/submodules/event-streams/index.d.ts",
|
66
|
+
"module": "./dist-es/submodules/event-streams/index.js",
|
67
|
+
"node": "./dist-cjs/submodules/event-streams/index.js",
|
68
|
+
"import": "./dist-es/submodules/event-streams/index.js",
|
69
|
+
"require": "./dist-cjs/submodules/event-streams/index.js"
|
63
70
|
}
|
64
71
|
},
|
65
72
|
"author": {
|
@@ -95,6 +102,8 @@
|
|
95
102
|
"files": [
|
96
103
|
"./cbor.d.ts",
|
97
104
|
"./cbor.js",
|
105
|
+
"./event-streams.d.ts",
|
106
|
+
"./event-streams.js",
|
98
107
|
"./protocols.d.ts",
|
99
108
|
"./protocols.js",
|
100
109
|
"./schema.d.ts",
|
@@ -110,6 +119,7 @@
|
|
110
119
|
"directory": "packages/core"
|
111
120
|
},
|
112
121
|
"devDependencies": {
|
122
|
+
"@smithy/eventstream-serde-node": "^4.0.5",
|
113
123
|
"@types/node": "^18.11.9",
|
114
124
|
"concurrently": "7.0.0",
|
115
125
|
"downlevel-dts": "0.10.1",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/middleware-endpoint",
|
3
|
-
"version": "4.1.
|
3
|
+
"version": "4.1.19",
|
4
4
|
"scripts": {
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline middleware-endpoint",
|
@@ -24,7 +24,7 @@
|
|
24
24
|
},
|
25
25
|
"license": "Apache-2.0",
|
26
26
|
"dependencies": {
|
27
|
-
"@smithy/core": "^3.
|
27
|
+
"@smithy/core": "^3.9.0",
|
28
28
|
"@smithy/middleware-serde": "^4.0.9",
|
29
29
|
"@smithy/node-config-provider": "^4.1.4",
|
30
30
|
"@smithy/shared-ini-file-loader": "^4.0.5",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/middleware-retry",
|
3
|
-
"version": "4.1.
|
3
|
+
"version": "4.1.20",
|
4
4
|
"scripts": {
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline middleware-retry",
|
@@ -13,9 +13,9 @@
|
|
13
13
|
"format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
|
14
14
|
"extract:docs": "api-extractor run --local",
|
15
15
|
"test": "yarn g:vitest run",
|
16
|
-
"test:integration": "yarn g:vitest run -c vitest.config.integ.
|
16
|
+
"test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
|
17
17
|
"test:watch": "yarn g:vitest watch",
|
18
|
-
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.
|
18
|
+
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
|
19
19
|
},
|
20
20
|
"main": "./dist-cjs/index.js",
|
21
21
|
"module": "./dist-es/index.js",
|
@@ -36,7 +36,7 @@
|
|
36
36
|
"@smithy/node-config-provider": "^4.1.4",
|
37
37
|
"@smithy/protocol-http": "^5.1.3",
|
38
38
|
"@smithy/service-error-classification": "^4.0.7",
|
39
|
-
"@smithy/smithy-client": "^4.
|
39
|
+
"@smithy/smithy-client": "^4.5.0",
|
40
40
|
"@smithy/types": "^4.3.2",
|
41
41
|
"@smithy/util-middleware": "^4.0.5",
|
42
42
|
"@smithy/util-retry": "^4.0.7",
|
@@ -24,7 +24,7 @@ __export(src_exports, {
|
|
24
24
|
Client: () => Client,
|
25
25
|
Command: () => Command,
|
26
26
|
NoOpLogger: () => NoOpLogger,
|
27
|
-
SENSITIVE_STRING: () =>
|
27
|
+
SENSITIVE_STRING: () => SENSITIVE_STRING2,
|
28
28
|
ServiceException: () => ServiceException,
|
29
29
|
_json: () => _json,
|
30
30
|
collectBody: () => import_protocols.collectBody,
|
@@ -106,6 +106,43 @@ var import_protocols = require("@smithy/core/protocols");
|
|
106
106
|
// src/command.ts
|
107
107
|
|
108
108
|
var import_types = require("@smithy/types");
|
109
|
+
|
110
|
+
// src/schemaLogFilter.ts
|
111
|
+
var import_schema = require("@smithy/core/schema");
|
112
|
+
var SENSITIVE_STRING = "***SensitiveInformation***";
|
113
|
+
function schemaLogFilter(schema, data) {
|
114
|
+
if (data == null) {
|
115
|
+
return data;
|
116
|
+
}
|
117
|
+
const ns = import_schema.NormalizedSchema.of(schema);
|
118
|
+
if (ns.getMergedTraits().sensitive) {
|
119
|
+
return SENSITIVE_STRING;
|
120
|
+
}
|
121
|
+
if (ns.isListSchema()) {
|
122
|
+
const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive;
|
123
|
+
if (isSensitive) {
|
124
|
+
return SENSITIVE_STRING;
|
125
|
+
}
|
126
|
+
} else if (ns.isMapSchema()) {
|
127
|
+
const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive;
|
128
|
+
if (isSensitive) {
|
129
|
+
return SENSITIVE_STRING;
|
130
|
+
}
|
131
|
+
} else if (ns.isStructSchema() && typeof data === "object") {
|
132
|
+
const object = data;
|
133
|
+
const newObject = {};
|
134
|
+
for (const [member, memberNs] of ns.structIterator()) {
|
135
|
+
if (object[member] != null) {
|
136
|
+
newObject[member] = schemaLogFilter(memberNs, object[member]);
|
137
|
+
}
|
138
|
+
}
|
139
|
+
return newObject;
|
140
|
+
}
|
141
|
+
return data;
|
142
|
+
}
|
143
|
+
__name(schemaLogFilter, "schemaLogFilter");
|
144
|
+
|
145
|
+
// src/command.ts
|
109
146
|
var Command = class {
|
110
147
|
constructor() {
|
111
148
|
this.middlewareStack = (0, import_middleware_stack.constructStack)();
|
@@ -167,8 +204,8 @@ var ClassBuilder = class {
|
|
167
204
|
this._clientName = "";
|
168
205
|
this._additionalContext = {};
|
169
206
|
this._smithyContext = {};
|
170
|
-
this._inputFilterSensitiveLog =
|
171
|
-
this._outputFilterSensitiveLog =
|
207
|
+
this._inputFilterSensitiveLog = void 0;
|
208
|
+
this._outputFilterSensitiveLog = void 0;
|
172
209
|
this._serializer = null;
|
173
210
|
this._deserializer = null;
|
174
211
|
}
|
@@ -295,8 +332,8 @@ var ClassBuilder = class {
|
|
295
332
|
middlewareFn: closure._middlewareFn,
|
296
333
|
clientName: closure._clientName,
|
297
334
|
commandName: closure._commandName,
|
298
|
-
inputFilterSensitiveLog: closure._inputFilterSensitiveLog,
|
299
|
-
outputFilterSensitiveLog: closure._outputFilterSensitiveLog,
|
335
|
+
inputFilterSensitiveLog: closure._inputFilterSensitiveLog ?? (closure._operationSchema ? schemaLogFilter.bind(null, closure._operationSchema.input) : (_) => _),
|
336
|
+
outputFilterSensitiveLog: closure._outputFilterSensitiveLog ?? (closure._operationSchema ? schemaLogFilter.bind(null, closure._operationSchema.output) : (_) => _),
|
300
337
|
smithyContext: closure._smithyContext,
|
301
338
|
additionalContext: closure._additionalContext
|
302
339
|
});
|
@@ -306,7 +343,7 @@ var ClassBuilder = class {
|
|
306
343
|
};
|
307
344
|
|
308
345
|
// src/constants.ts
|
309
|
-
var
|
346
|
+
var SENSITIVE_STRING2 = "***SensitiveInformation***";
|
310
347
|
|
311
348
|
// src/create-aggregated-client.ts
|
312
349
|
var createAggregatedClient = /* @__PURE__ */ __name((commands, Client2) => {
|
@@ -0,0 +1 @@
|
|
1
|
+
module.exports = require("./index.js");
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { constructStack } from "@smithy/middleware-stack";
|
2
2
|
import { SMITHY_CONTEXT_KEY } from "@smithy/types";
|
3
|
+
import { schemaLogFilter } from "./schemaLogFilter";
|
3
4
|
export class Command {
|
4
5
|
constructor() {
|
5
6
|
this.middlewareStack = constructStack();
|
@@ -38,8 +39,8 @@ class ClassBuilder {
|
|
38
39
|
this._clientName = "";
|
39
40
|
this._additionalContext = {};
|
40
41
|
this._smithyContext = {};
|
41
|
-
this._inputFilterSensitiveLog =
|
42
|
-
this._outputFilterSensitiveLog =
|
42
|
+
this._inputFilterSensitiveLog = undefined;
|
43
|
+
this._outputFilterSensitiveLog = undefined;
|
43
44
|
this._serializer = null;
|
44
45
|
this._deserializer = null;
|
45
46
|
}
|
@@ -110,8 +111,10 @@ class ClassBuilder {
|
|
110
111
|
middlewareFn: closure._middlewareFn,
|
111
112
|
clientName: closure._clientName,
|
112
113
|
commandName: closure._commandName,
|
113
|
-
inputFilterSensitiveLog: closure._inputFilterSensitiveLog
|
114
|
-
|
114
|
+
inputFilterSensitiveLog: closure._inputFilterSensitiveLog ??
|
115
|
+
(closure._operationSchema ? schemaLogFilter.bind(null, closure._operationSchema.input) : (_) => _),
|
116
|
+
outputFilterSensitiveLog: closure._outputFilterSensitiveLog ??
|
117
|
+
(closure._operationSchema ? schemaLogFilter.bind(null, closure._operationSchema.output) : (_) => _),
|
115
118
|
smithyContext: closure._smithyContext,
|
116
119
|
additionalContext: closure._additionalContext,
|
117
120
|
});
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { NormalizedSchema } from "@smithy/core/schema";
|
2
|
+
const SENSITIVE_STRING = "***SensitiveInformation***";
|
3
|
+
export function schemaLogFilter(schema, data) {
|
4
|
+
if (data == null) {
|
5
|
+
return data;
|
6
|
+
}
|
7
|
+
const ns = NormalizedSchema.of(schema);
|
8
|
+
if (ns.getMergedTraits().sensitive) {
|
9
|
+
return SENSITIVE_STRING;
|
10
|
+
}
|
11
|
+
if (ns.isListSchema()) {
|
12
|
+
const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive;
|
13
|
+
if (isSensitive) {
|
14
|
+
return SENSITIVE_STRING;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
else if (ns.isMapSchema()) {
|
18
|
+
const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive;
|
19
|
+
if (isSensitive) {
|
20
|
+
return SENSITIVE_STRING;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
else if (ns.isStructSchema() && typeof data === "object") {
|
24
|
+
const object = data;
|
25
|
+
const newObject = {};
|
26
|
+
for (const [member, memberNs] of ns.structIterator()) {
|
27
|
+
if (object[member] != null) {
|
28
|
+
newObject[member] = schemaLogFilter(memberNs, object[member]);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
return newObject;
|
32
|
+
}
|
33
|
+
return data;
|
34
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import type { SchemaRef } from "@smithy/types";
|
2
|
+
/**
|
3
|
+
* Redacts sensitive parts of any data object using its schema, for logging.
|
4
|
+
*
|
5
|
+
* @internal
|
6
|
+
* @param schema - with filtering traits.
|
7
|
+
* @param data - to be logged.
|
8
|
+
*/
|
9
|
+
export declare function schemaLogFilter(schema: SchemaRef, data: unknown): any;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { SchemaRef } from "@smithy/types";
|
2
|
+
/**
|
3
|
+
* Redacts sensitive parts of any data object using its schema, for logging.
|
4
|
+
*
|
5
|
+
* @internal
|
6
|
+
* @param schema - with filtering traits.
|
7
|
+
* @param data - to be logged.
|
8
|
+
*/
|
9
|
+
export declare function schemaLogFilter(schema: SchemaRef, data: unknown): any;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/smithy-client",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.5.0",
|
4
4
|
"scripts": {
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline smithy-client",
|
@@ -24,8 +24,8 @@
|
|
24
24
|
},
|
25
25
|
"license": "Apache-2.0",
|
26
26
|
"dependencies": {
|
27
|
-
"@smithy/core": "^3.
|
28
|
-
"@smithy/middleware-endpoint": "^4.1.
|
27
|
+
"@smithy/core": "^3.9.0",
|
28
|
+
"@smithy/middleware-endpoint": "^4.1.19",
|
29
29
|
"@smithy/middleware-stack": "^4.0.5",
|
30
30
|
"@smithy/protocol-http": "^5.1.3",
|
31
31
|
"@smithy/types": "^4.3.2",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/util-defaults-mode-browser",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.27",
|
4
4
|
"scripts": {
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline util-defaults-mode-browser",
|
@@ -24,7 +24,7 @@
|
|
24
24
|
"license": "Apache-2.0",
|
25
25
|
"dependencies": {
|
26
26
|
"@smithy/property-provider": "^4.0.5",
|
27
|
-
"@smithy/smithy-client": "^4.
|
27
|
+
"@smithy/smithy-client": "^4.5.0",
|
28
28
|
"@smithy/types": "^4.3.2",
|
29
29
|
"bowser": "^2.11.0",
|
30
30
|
"tslib": "^2.6.2"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/util-defaults-mode-node",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.27",
|
4
4
|
"scripts": {
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline util-defaults-mode-node",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
"@smithy/credential-provider-imds": "^4.0.7",
|
28
28
|
"@smithy/node-config-provider": "^4.1.4",
|
29
29
|
"@smithy/property-provider": "^4.0.5",
|
30
|
-
"@smithy/smithy-client": "^4.
|
30
|
+
"@smithy/smithy-client": "^4.5.0",
|
31
31
|
"@smithy/types": "^4.3.2",
|
32
32
|
"tslib": "^2.6.2"
|
33
33
|
},
|