@aws-sdk/core 3.977.2 → 3.977.4
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/submodules/protocols/index.js +856 -57
- package/dist-es/submodules/protocols/index.js +6 -3
- package/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -1
- package/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -1
- package/dist-es/submodules/protocols/json/JsonSettings.js +1 -0
- package/dist-es/submodules/protocols/json/{JsonCodec.js → codec-v1/JsonCodec.js} +3 -3
- package/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +1 -0
- package/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +103 -0
- package/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +20 -0
- package/dist-es/submodules/protocols/json/codec-v2/{BufferJsonShapeDeserializer.js → JsonShapeDeserializer2.js} +38 -18
- package/dist-es/submodules/protocols/json/codec-v2/{ByteJsonShapeSerializer.js → JsonShapeSerializer2.js} +67 -79
- package/dist-types/submodules/protocols/index.d.ts +7 -4
- package/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -1
- package/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -1
- package/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +1 -1
- package/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +1 -1
- package/dist-types/submodules/protocols/json/JsonSettings.d.ts +7 -0
- package/dist-types/submodules/protocols/json/codec-v1/JsonCodec.d.ts +15 -0
- package/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +7 -0
- package/dist-types/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +2 -1
- package/dist-types/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +2 -1
- package/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +51 -0
- package/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +13 -0
- package/dist-types/submodules/protocols/json/codec-v2/{BufferJsonShapeDeserializer.d.ts → JsonShapeDeserializer2.d.ts} +4 -3
- package/dist-types/submodules/protocols/json/codec-v2/{ByteJsonShapeSerializer.d.ts → JsonShapeSerializer2.d.ts} +19 -31
- package/dist-types/ts3.4/submodules/protocols/index.d.ts +7 -4
- package/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -1
- package/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -1
- package/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +1 -1
- package/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +1 -1
- package/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +4 -0
- package/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +11 -0
- package/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +4 -0
- package/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +1 -1
- package/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +1 -1
- package/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +27 -0
- package/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +9 -0
- package/dist-types/ts3.4/submodules/protocols/json/codec-v2/{BufferJsonShapeDeserializer.d.ts → JsonShapeDeserializer2.d.ts} +3 -2
- package/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +39 -0
- package/package.json +3 -3
- package/dist-types/submodules/protocols/json/JsonCodec.d.ts +0 -19
- package/dist-types/ts3.4/submodules/protocols/json/JsonCodec.d.ts +0 -13
- package/dist-types/ts3.4/submodules/protocols/json/codec-v2/ByteJsonShapeSerializer.d.ts +0 -39
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpBindingProtocol } from "@smithy/core/protocols";
|
|
2
2
|
import type { TypeRegistry } from "@smithy/core/schema";
|
|
3
3
|
import type { EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
|
|
4
|
-
import { JsonCodec } from "./JsonCodec";
|
|
4
|
+
import { JsonCodec } from "./codec-v1/JsonCodec";
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Codec } from "@smithy/types";
|
|
2
|
+
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
3
|
+
import { JsonShapeDeserializer } from "./JsonShapeDeserializer";
|
|
4
|
+
import { JsonShapeSerializer } from "./JsonShapeSerializer";
|
|
5
|
+
import type { JsonSettings } from "./JsonSettings";
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated use JsonCodec2.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare class JsonCodec extends SerdeContextConfig implements Codec<string, string> {
|
|
11
|
+
readonly settings: JsonSettings;
|
|
12
|
+
constructor(settings: JsonSettings);
|
|
13
|
+
createSerializer(): JsonShapeSerializer;
|
|
14
|
+
createDeserializer(): JsonShapeDeserializer;
|
|
15
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
|
|
2
2
|
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
3
|
-
import type { JsonSettings } from "
|
|
3
|
+
import type { JsonSettings } from "./JsonSettings";
|
|
4
4
|
/**
|
|
5
|
+
* @deprecated prefer JsonShapeDeserializer in codec-v2.
|
|
5
6
|
* @public
|
|
6
7
|
*/
|
|
7
8
|
export declare class JsonShapeDeserializer extends SerdeContextConfig implements ShapeDeserializer<string> {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { NormalizedSchema } from "@smithy/core/schema";
|
|
2
2
|
import type { Schema, ShapeSerializer } from "@smithy/types";
|
|
3
3
|
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
4
|
-
import type { JsonSettings } from "
|
|
4
|
+
import type { JsonSettings } from "./JsonSettings";
|
|
5
5
|
/**
|
|
6
|
+
* @deprecated prefer byte-targeting JsonShapeSerializer or its string adapter StringJsonShapeSerializer in codec-v2.
|
|
6
7
|
* @public
|
|
7
8
|
*/
|
|
8
9
|
export declare class JsonShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string> {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Uint8Array subclass holding serialized JSON bytes that provides
|
|
3
|
+
* string method compatibility for customer middleware.
|
|
4
|
+
*
|
|
5
|
+
* Middleware historically observed `request.body` as a string for JSON
|
|
6
|
+
* protocol services. This class preserves that contract: string methods
|
|
7
|
+
* and coercion (template literals, `+` operator) lazily decode the bytes
|
|
8
|
+
* to a cached string. The HTTP transport layer still sees a Uint8Array
|
|
9
|
+
* and sends raw bytes without conversion.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
* @deprecated this adapter will be removed in a future version.
|
|
13
|
+
*/
|
|
14
|
+
export declare class JsonBytesStringAdapter extends Uint8Array {
|
|
15
|
+
private string;
|
|
16
|
+
static allocUnsafe(bytes: number): JsonBytesStringAdapter;
|
|
17
|
+
/**
|
|
18
|
+
* Enables string coercion via template literals and `+` operator.
|
|
19
|
+
*/
|
|
20
|
+
toString(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Enables string coercion in comparison and arithmetic contexts.
|
|
23
|
+
* @returns a string. The signature is set to avoid incompatibility with extending Uint8Array.
|
|
24
|
+
*/
|
|
25
|
+
valueOf(): any;
|
|
26
|
+
includes(searchString: string | number, position?: number): boolean;
|
|
27
|
+
indexOf(searchString: string | number, position?: number): number;
|
|
28
|
+
lastIndexOf(searchString: string | number, position?: number): number;
|
|
29
|
+
startsWith(searchString: string, position?: number): boolean;
|
|
30
|
+
endsWith(searchString: string, endPosition?: number): boolean;
|
|
31
|
+
match(regexp: string | RegExp): RegExpMatchArray | null;
|
|
32
|
+
replace(searchValue: string | RegExp, replaceValue: string): string;
|
|
33
|
+
search(regexp: string | RegExp): number;
|
|
34
|
+
split(separator: string | RegExp, limit?: number): string[];
|
|
35
|
+
substring(start: number, end?: number): string;
|
|
36
|
+
trim(): string;
|
|
37
|
+
trimStart(): string;
|
|
38
|
+
trimEnd(): string;
|
|
39
|
+
charAt(pos: number): string;
|
|
40
|
+
charCodeAt(index: number): number;
|
|
41
|
+
padStart(maxLength: number, fillString?: string): string;
|
|
42
|
+
padEnd(maxLength: number, fillString?: string): string;
|
|
43
|
+
repeat(count: number): string;
|
|
44
|
+
toUpperCase(): string;
|
|
45
|
+
toLowerCase(): string;
|
|
46
|
+
/**
|
|
47
|
+
* Decodes the bytes to a UTF-8 string on first access, then caches.
|
|
48
|
+
* Subsequent calls return the cached string with zero cost.
|
|
49
|
+
*/
|
|
50
|
+
private s;
|
|
51
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { $ShapeSerializer, $Codec, $ShapeDeserializer } from "@smithy/types";
|
|
2
|
+
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
3
|
+
import type { JsonSettings } from "../JsonSettings";
|
|
4
|
+
/**
|
|
5
|
+
* Codec grouping the v2 serializer and deserializer.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare class JsonCodec2 extends SerdeContextConfig implements $Codec<Uint8Array, string> {
|
|
9
|
+
readonly settings: JsonSettings;
|
|
10
|
+
constructor(settings: JsonSettings);
|
|
11
|
+
createSerializer(): $ShapeSerializer<Uint8Array>;
|
|
12
|
+
createDeserializer(): $ShapeDeserializer<string>;
|
|
13
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
|
|
2
2
|
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
3
|
-
import type { JsonSettings } from "../
|
|
3
|
+
import type { JsonSettings } from "../JsonSettings";
|
|
4
4
|
/**
|
|
5
5
|
* Performance-optimized JSON deserializer.
|
|
6
6
|
*
|
|
@@ -17,13 +17,14 @@ import type { JsonSettings } from "../JsonCodec";
|
|
|
17
17
|
* after JSON.parse with no external references, so rewriting values avoids
|
|
18
18
|
* redundant allocation and GC pressure.
|
|
19
19
|
*
|
|
20
|
-
* @
|
|
20
|
+
* @public
|
|
21
21
|
*/
|
|
22
|
-
export declare class
|
|
22
|
+
export declare class JsonShapeDeserializer2 extends SerdeContextConfig implements ShapeDeserializer<string> {
|
|
23
23
|
readonly settings: JsonSettings;
|
|
24
24
|
constructor(settings: JsonSettings);
|
|
25
25
|
read(schema: Schema, data: string | Uint8Array | unknown): Promise<any>;
|
|
26
26
|
readObject(schema: Schema, data: DocumentType): any;
|
|
27
27
|
protected _read(schema: Schema, value: unknown): any;
|
|
28
28
|
private _readStruct;
|
|
29
|
+
private needsTransform;
|
|
29
30
|
}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
+
import { NormalizedSchema } from "@smithy/core/schema";
|
|
1
2
|
import type { Schema, ShapeSerializer } from "@smithy/types";
|
|
2
3
|
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
3
|
-
import type { JsonSettings } from "../
|
|
4
|
+
import type { JsonSettings } from "../JsonSettings";
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Single-pass JSON serializer that writes directly to a Uint8Array buffer.
|
|
6
7
|
* Fewer intermediate states as when compared to the initial multi-pass implementation.
|
|
7
8
|
*
|
|
8
|
-
* @
|
|
9
|
+
* @public
|
|
9
10
|
*/
|
|
10
|
-
export declare class
|
|
11
|
+
export declare class JsonShapeSerializer2 extends SerdeContextConfig implements ShapeSerializer<Uint8Array> {
|
|
11
12
|
readonly settings: JsonSettings;
|
|
12
13
|
private json;
|
|
13
14
|
private i;
|
|
14
15
|
private rootSchema;
|
|
16
|
+
private rawValue;
|
|
17
|
+
private passthrough;
|
|
15
18
|
constructor(settings: JsonSettings);
|
|
16
19
|
write(schema: Schema, value: unknown): void;
|
|
17
20
|
/**
|
|
@@ -23,12 +26,12 @@ export declare class ByteJsonShapeSerializer extends SerdeContextConfig implemen
|
|
|
23
26
|
* This is the primary output — pass directly to request.body.
|
|
24
27
|
*/
|
|
25
28
|
flush(): Uint8Array;
|
|
26
|
-
|
|
29
|
+
protected ensure(byteCount: number): void;
|
|
27
30
|
/**
|
|
28
31
|
* Write a raw ASCII string (no JSON escaping). Used for pre-validated content
|
|
29
32
|
* like numeric literals and pre-encoded base64.
|
|
30
33
|
*/
|
|
31
|
-
|
|
34
|
+
protected writeAscii(s: string): void;
|
|
32
35
|
/**
|
|
33
36
|
* Write a quoted ASCII string with no escape checking.
|
|
34
37
|
* Used for struct member keys (jsonName or model names) which are
|
|
@@ -36,37 +39,22 @@ export declare class ByteJsonShapeSerializer extends SerdeContextConfig implemen
|
|
|
36
39
|
* backslashes, or non-ASCII.
|
|
37
40
|
* Ensures extra room for surrounding structural chars (comma, colon).
|
|
38
41
|
*/
|
|
39
|
-
|
|
42
|
+
protected writeAsciiQuoted(s: string): void;
|
|
40
43
|
/**
|
|
41
44
|
* Write a JSON-escaped string including the surrounding quotes.
|
|
42
45
|
* Fast-path for ASCII, falls back to TextEncoder for multi-byte.
|
|
43
46
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
protected writeJsonString(s: string): void;
|
|
48
|
+
protected writeUnicodeEscape(code: number): void;
|
|
49
|
+
protected static readonly B64: Uint8Array;
|
|
47
50
|
/**
|
|
48
51
|
* Write a Uint8Array as a quoted base64 string directly into the buffer.
|
|
49
52
|
* No intermediate JS string, no escape checking (base64 alphabet is safe ASCII).
|
|
50
53
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* A string adapter for the byte serializer, for backwards compatibility.
|
|
60
|
-
* @public
|
|
61
|
-
*/
|
|
62
|
-
export declare class StringJsonShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string> {
|
|
63
|
-
readonly settings: JsonSettings;
|
|
64
|
-
private byteSerializer;
|
|
65
|
-
constructor(settings: JsonSettings);
|
|
66
|
-
write(schema: Schema, value: unknown): void;
|
|
67
|
-
/**
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
|
|
71
|
-
flush(): string;
|
|
54
|
+
protected writeBase64(data: Uint8Array): void;
|
|
55
|
+
protected writeValue(schema: Schema, value: unknown, container: NormalizedSchema | undefined): void;
|
|
56
|
+
protected writeStruct(ns: NormalizedSchema, value: Record<string, unknown>): void;
|
|
57
|
+
protected writeList(ns: NormalizedSchema, value: unknown[], isDocument?: boolean): void;
|
|
58
|
+
protected writeMap(ns: NormalizedSchema, value: Record<string, unknown>, isDocument?: boolean): void;
|
|
59
|
+
protected writeTimestamp(ns: NormalizedSchema, value: Date): void;
|
|
72
60
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
export { AwsSmithyRpcV2CborProtocol } from "./cbor/AwsSmithyRpcV2CborProtocol";
|
|
2
|
-
export { _toStr, _toBool, _toNum } from "./coercing-serializers";
|
|
3
2
|
export { AwsJson1_0Protocol } from "./json/AwsJson1_0Protocol";
|
|
4
3
|
export { AwsJson1_1Protocol } from "./json/AwsJson1_1Protocol";
|
|
5
4
|
export { AwsJsonRpcProtocol } from "./json/AwsJsonRpcProtocol";
|
|
6
5
|
export { AwsRestJsonProtocol } from "./json/AwsRestJsonProtocol";
|
|
7
|
-
export { JsonCodec } from "./json/JsonCodec";
|
|
8
|
-
export { JsonSettings } from "./json/
|
|
6
|
+
export { JsonCodec } from "./json/codec-v1/JsonCodec";
|
|
7
|
+
export { JsonSettings } from "./json/JsonSettings";
|
|
9
8
|
export { JsonShapeDeserializer } from "./json/codec-v1/JsonShapeDeserializer";
|
|
10
9
|
export { JsonShapeSerializer } from "./json/codec-v1/JsonShapeSerializer";
|
|
11
|
-
export {
|
|
10
|
+
export { JsonCodec2 } from "./json/codec-v2/JsonCodec2";
|
|
11
|
+
export { JsonShapeDeserializer2 } from "./json/codec-v2/JsonShapeDeserializer2";
|
|
12
|
+
export { JsonShapeSerializer2 } from "./json/codec-v2/JsonShapeSerializer2";
|
|
12
13
|
export {
|
|
13
14
|
parseJsonBody,
|
|
14
15
|
parseJsonErrorBody,
|
|
@@ -25,3 +26,5 @@ export { XmlSettings } from "./xml/XmlCodec";
|
|
|
25
26
|
export { XmlShapeDeserializer } from "./xml/XmlShapeDeserializer";
|
|
26
27
|
export { XmlShapeSerializer } from "./xml/XmlShapeSerializer";
|
|
27
28
|
export { parseXmlBody, parseXmlErrorBody, loadRestXmlErrorCode } from "./xml/parseXmlBody";
|
|
29
|
+
export { awsExpectUnion } from "./json/awsExpectUnion";
|
|
30
|
+
export { _toStr, _toBool, _toNum } from "./coercing-serializers";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TypeRegistry } from "@smithy/core/schema";
|
|
2
2
|
import { AwsJsonRpcProtocol } from "./AwsJsonRpcProtocol";
|
|
3
|
-
import { JsonCodec } from "./JsonCodec";
|
|
3
|
+
import { JsonCodec } from "./codec-v1/JsonCodec";
|
|
4
4
|
export declare class AwsJson1_0Protocol extends AwsJsonRpcProtocol {
|
|
5
5
|
constructor({
|
|
6
6
|
defaultNamespace,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TypeRegistry } from "@smithy/core/schema";
|
|
2
2
|
import { AwsJsonRpcProtocol } from "./AwsJsonRpcProtocol";
|
|
3
|
-
import { JsonCodec } from "./JsonCodec";
|
|
3
|
+
import { JsonCodec } from "./codec-v1/JsonCodec";
|
|
4
4
|
export declare class AwsJson1_1Protocol extends AwsJsonRpcProtocol {
|
|
5
5
|
constructor({
|
|
6
6
|
defaultNamespace,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
ShapeDeserializer,
|
|
12
12
|
ShapeSerializer,
|
|
13
13
|
} from "@smithy/types";
|
|
14
|
-
import { JsonCodec } from "./JsonCodec";
|
|
14
|
+
import { JsonCodec } from "./codec-v1/JsonCodec";
|
|
15
15
|
export declare abstract class AwsJsonRpcProtocol extends RpcProtocol {
|
|
16
16
|
protected serializer: ShapeSerializer<string | Uint8Array>;
|
|
17
17
|
protected deserializer: ShapeDeserializer<string | Uint8Array>;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
ShapeDeserializer,
|
|
13
13
|
ShapeSerializer,
|
|
14
14
|
} from "@smithy/types";
|
|
15
|
-
import { JsonCodec } from "./JsonCodec";
|
|
15
|
+
import { JsonCodec } from "./codec-v1/JsonCodec";
|
|
16
16
|
export declare class AwsRestJsonProtocol extends HttpBindingProtocol {
|
|
17
17
|
protected serializer: ShapeSerializer<string | Uint8Array>;
|
|
18
18
|
protected deserializer: ShapeDeserializer<string | Uint8Array>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Codec } from "@smithy/types";
|
|
2
|
+
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
3
|
+
import { JsonShapeDeserializer } from "./JsonShapeDeserializer";
|
|
4
|
+
import { JsonShapeSerializer } from "./JsonShapeSerializer";
|
|
5
|
+
import { JsonSettings } from "./JsonSettings";
|
|
6
|
+
export declare class JsonCodec extends SerdeContextConfig implements Codec<string, string> {
|
|
7
|
+
readonly settings: JsonSettings;
|
|
8
|
+
constructor(settings: JsonSettings);
|
|
9
|
+
createSerializer(): JsonShapeSerializer;
|
|
10
|
+
createDeserializer(): JsonShapeDeserializer;
|
|
11
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
|
|
2
2
|
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
3
|
-
import { JsonSettings } from "
|
|
3
|
+
import { JsonSettings } from "./JsonSettings";
|
|
4
4
|
export declare class JsonShapeDeserializer
|
|
5
5
|
extends SerdeContextConfig
|
|
6
6
|
implements ShapeDeserializer<string>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NormalizedSchema } from "@smithy/core/schema";
|
|
2
2
|
import { Schema, ShapeSerializer } from "@smithy/types";
|
|
3
3
|
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
4
|
-
import { JsonSettings } from "
|
|
4
|
+
import { JsonSettings } from "./JsonSettings";
|
|
5
5
|
export declare class JsonShapeSerializer
|
|
6
6
|
extends SerdeContextConfig
|
|
7
7
|
implements ShapeSerializer<string>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare class JsonBytesStringAdapter extends Uint8Array {
|
|
2
|
+
private string;
|
|
3
|
+
static allocUnsafe(bytes: number): JsonBytesStringAdapter;
|
|
4
|
+
toString(): string;
|
|
5
|
+
valueOf(): any;
|
|
6
|
+
includes(searchString: string | number, position?: number): boolean;
|
|
7
|
+
indexOf(searchString: string | number, position?: number): number;
|
|
8
|
+
lastIndexOf(searchString: string | number, position?: number): number;
|
|
9
|
+
startsWith(searchString: string, position?: number): boolean;
|
|
10
|
+
endsWith(searchString: string, endPosition?: number): boolean;
|
|
11
|
+
match(regexp: string | RegExp): RegExpMatchArray | null;
|
|
12
|
+
replace(searchValue: string | RegExp, replaceValue: string): string;
|
|
13
|
+
search(regexp: string | RegExp): number;
|
|
14
|
+
split(separator: string | RegExp, limit?: number): string[];
|
|
15
|
+
substring(start: number, end?: number): string;
|
|
16
|
+
trim(): string;
|
|
17
|
+
trimStart(): string;
|
|
18
|
+
trimEnd(): string;
|
|
19
|
+
charAt(pos: number): string;
|
|
20
|
+
charCodeAt(index: number): number;
|
|
21
|
+
padStart(maxLength: number, fillString?: string): string;
|
|
22
|
+
padEnd(maxLength: number, fillString?: string): string;
|
|
23
|
+
repeat(count: number): string;
|
|
24
|
+
toUpperCase(): string;
|
|
25
|
+
toLowerCase(): string;
|
|
26
|
+
private s;
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { $ShapeSerializer, $Codec, $ShapeDeserializer } from "@smithy/types";
|
|
2
|
+
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
3
|
+
import { JsonSettings } from "../JsonSettings";
|
|
4
|
+
export declare class JsonCodec2 extends SerdeContextConfig implements $Codec<Uint8Array, string> {
|
|
5
|
+
readonly settings: JsonSettings;
|
|
6
|
+
constructor(settings: JsonSettings);
|
|
7
|
+
createSerializer(): $ShapeSerializer<Uint8Array>;
|
|
8
|
+
createDeserializer(): $ShapeDeserializer<string>;
|
|
9
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
|
|
2
2
|
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
3
|
-
import { JsonSettings } from "../
|
|
4
|
-
export declare class
|
|
3
|
+
import { JsonSettings } from "../JsonSettings";
|
|
4
|
+
export declare class JsonShapeDeserializer2
|
|
5
5
|
extends SerdeContextConfig
|
|
6
6
|
implements ShapeDeserializer<string>
|
|
7
7
|
{
|
|
@@ -11,4 +11,5 @@ export declare class BufferJsonShapeDeserializer
|
|
|
11
11
|
readObject(schema: Schema, data: DocumentType): any;
|
|
12
12
|
protected _read(schema: Schema, value: unknown): any;
|
|
13
13
|
private _readStruct;
|
|
14
|
+
private needsTransform;
|
|
14
15
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { NormalizedSchema } from "@smithy/core/schema";
|
|
2
|
+
import { Schema, ShapeSerializer } from "@smithy/types";
|
|
3
|
+
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
4
|
+
import { JsonSettings } from "../JsonSettings";
|
|
5
|
+
export declare class JsonShapeSerializer2
|
|
6
|
+
extends SerdeContextConfig
|
|
7
|
+
implements ShapeSerializer<Uint8Array>
|
|
8
|
+
{
|
|
9
|
+
readonly settings: JsonSettings;
|
|
10
|
+
private json;
|
|
11
|
+
private i;
|
|
12
|
+
private rootSchema;
|
|
13
|
+
private rawValue;
|
|
14
|
+
private passthrough;
|
|
15
|
+
constructor(settings: JsonSettings);
|
|
16
|
+
write(schema: Schema, value: unknown): void;
|
|
17
|
+
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
|
|
18
|
+
flush(): Uint8Array;
|
|
19
|
+
protected ensure(byteCount: number): void;
|
|
20
|
+
protected writeAscii(s: string): void;
|
|
21
|
+
protected writeAsciiQuoted(s: string): void;
|
|
22
|
+
protected writeJsonString(s: string): void;
|
|
23
|
+
protected writeUnicodeEscape(code: number): void;
|
|
24
|
+
protected static readonly B64: Uint8Array;
|
|
25
|
+
protected writeBase64(data: Uint8Array): void;
|
|
26
|
+
protected writeValue(
|
|
27
|
+
schema: Schema,
|
|
28
|
+
value: unknown,
|
|
29
|
+
container: NormalizedSchema | undefined,
|
|
30
|
+
): void;
|
|
31
|
+
protected writeStruct(ns: NormalizedSchema, value: Record<string, unknown>): void;
|
|
32
|
+
protected writeList(ns: NormalizedSchema, value: unknown[], isDocument?: boolean): void;
|
|
33
|
+
protected writeMap(
|
|
34
|
+
ns: NormalizedSchema,
|
|
35
|
+
value: Record<string, unknown>,
|
|
36
|
+
isDocument?: boolean,
|
|
37
|
+
): void;
|
|
38
|
+
protected writeTimestamp(ns: NormalizedSchema, value: Date): void;
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/core",
|
|
3
|
-
"version": "3.977.
|
|
3
|
+
"version": "3.977.4",
|
|
4
4
|
"description": "Core functions & classes shared by multiple AWS SDK clients.",
|
|
5
5
|
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages-internal/core",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -127,8 +127,8 @@
|
|
|
127
127
|
"@aws-sdk/types": "^3.974.2",
|
|
128
128
|
"@aws-sdk/xml-builder": "^3.972.37",
|
|
129
129
|
"@aws/lambda-invoke-store": "^0.3.0",
|
|
130
|
-
"@smithy/core": "^3.
|
|
131
|
-
"@smithy/signature-v4": "^5.6.
|
|
130
|
+
"@smithy/core": "^3.31.1",
|
|
131
|
+
"@smithy/signature-v4": "^5.6.12",
|
|
132
132
|
"@smithy/types": "^4.16.1",
|
|
133
133
|
"bowser": "^2.11.0",
|
|
134
134
|
"tslib": "^2.6.2"
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Codec, CodecSettings } from "@smithy/types";
|
|
2
|
-
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
|
|
3
|
-
import { JsonShapeDeserializer } from "./codec-v1/JsonShapeDeserializer";
|
|
4
|
-
import { JsonShapeSerializer } from "./codec-v1/JsonShapeSerializer";
|
|
5
|
-
/**
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export type JsonSettings = CodecSettings & {
|
|
9
|
-
jsonName: boolean;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export declare class JsonCodec extends SerdeContextConfig implements Codec<string, string> {
|
|
15
|
-
readonly settings: JsonSettings;
|
|
16
|
-
constructor(settings: JsonSettings);
|
|
17
|
-
createSerializer(): JsonShapeSerializer;
|
|
18
|
-
createDeserializer(): JsonShapeDeserializer;
|
|
19
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Codec, CodecSettings } from "@smithy/types";
|
|
2
|
-
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
|
|
3
|
-
import { JsonShapeDeserializer } from "./codec-v1/JsonShapeDeserializer";
|
|
4
|
-
import { JsonShapeSerializer } from "./codec-v1/JsonShapeSerializer";
|
|
5
|
-
export type JsonSettings = CodecSettings & {
|
|
6
|
-
jsonName: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare class JsonCodec extends SerdeContextConfig implements Codec<string, string> {
|
|
9
|
-
readonly settings: JsonSettings;
|
|
10
|
-
constructor(settings: JsonSettings);
|
|
11
|
-
createSerializer(): JsonShapeSerializer;
|
|
12
|
-
createDeserializer(): JsonShapeDeserializer;
|
|
13
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Schema, ShapeSerializer } from "@smithy/types";
|
|
2
|
-
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
3
|
-
import { JsonSettings } from "../JsonCodec";
|
|
4
|
-
export declare class ByteJsonShapeSerializer
|
|
5
|
-
extends SerdeContextConfig
|
|
6
|
-
implements ShapeSerializer<Uint8Array>
|
|
7
|
-
{
|
|
8
|
-
readonly settings: JsonSettings;
|
|
9
|
-
private json;
|
|
10
|
-
private i;
|
|
11
|
-
private rootSchema;
|
|
12
|
-
constructor(settings: JsonSettings);
|
|
13
|
-
write(schema: Schema, value: unknown): void;
|
|
14
|
-
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
|
|
15
|
-
flush(): Uint8Array;
|
|
16
|
-
private ensure;
|
|
17
|
-
private writeAscii;
|
|
18
|
-
private writeAsciiQuoted;
|
|
19
|
-
private writeJsonString;
|
|
20
|
-
private writeUnicodeEscape;
|
|
21
|
-
private static readonly B64;
|
|
22
|
-
private writeBase64;
|
|
23
|
-
private writeValue;
|
|
24
|
-
private writeStruct;
|
|
25
|
-
private writeList;
|
|
26
|
-
private writeMap;
|
|
27
|
-
private writeTimestamp;
|
|
28
|
-
}
|
|
29
|
-
export declare class StringJsonShapeSerializer
|
|
30
|
-
extends SerdeContextConfig
|
|
31
|
-
implements ShapeSerializer<string>
|
|
32
|
-
{
|
|
33
|
-
readonly settings: JsonSettings;
|
|
34
|
-
private byteSerializer;
|
|
35
|
-
constructor(settings: JsonSettings);
|
|
36
|
-
write(schema: Schema, value: unknown): void;
|
|
37
|
-
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
|
|
38
|
-
flush(): string;
|
|
39
|
-
}
|