@cdk8s/awscdk-resolver 0.0.635 → 0.0.637
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 +3 -3
- package/lib/resolve.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/package.json +3 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.js +182 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/ByteJsonShapeSerializer.js +473 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +29 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +59 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +14 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +30 -0
- package/node_modules/@aws-sdk/core/package.json +2 -1
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +34 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +34 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +34 -11
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/event-streams/EventStreamSerde.d.ts +10 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts +10 -2
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
- package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
- package/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/@smithy/signature-v4/package.json +2 -2
- package/package.json +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.js +0 -135
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.d.ts +0 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.d.ts +0 -17
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { determineTimestampFormat } from "@smithy/core/protocols";
|
|
2
|
-
import { NormalizedSchema } from "@smithy/core/schema";
|
|
3
|
-
import { dateToUtcString, generateIdempotencyToken, LazyJsonString, NumericValue, toBase64 } from "@smithy/core/serde";
|
|
4
|
-
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
5
|
-
export class SinglePassJsonShapeSerializer extends SerdeContextConfig {
|
|
6
|
-
settings;
|
|
7
|
-
buffer;
|
|
8
|
-
rootSchema;
|
|
9
|
-
constructor(settings) {
|
|
10
|
-
super();
|
|
11
|
-
this.settings = settings;
|
|
12
|
-
}
|
|
13
|
-
write(schema, value) {
|
|
14
|
-
this.rootSchema = NormalizedSchema.of(schema);
|
|
15
|
-
this.buffer = this.writeObject(this.rootSchema, value);
|
|
16
|
-
}
|
|
17
|
-
writeDiscriminatedDocument(schema, value) {
|
|
18
|
-
this.write(schema, value);
|
|
19
|
-
if (typeof this.buffer === "object") {
|
|
20
|
-
this.buffer.__type = NormalizedSchema.of(schema).getName(true);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
flush() {
|
|
24
|
-
this.rootSchema = undefined;
|
|
25
|
-
return this.buffer;
|
|
26
|
-
}
|
|
27
|
-
writeObject(schema, value) {
|
|
28
|
-
if (value == undefined) {
|
|
29
|
-
return "";
|
|
30
|
-
}
|
|
31
|
-
let b = "";
|
|
32
|
-
const ns = NormalizedSchema.of(schema);
|
|
33
|
-
const sparse = !!ns.getMergedTraits().sparse;
|
|
34
|
-
if (Array.isArray(value) && (ns.isDocumentSchema() || ns.isListSchema())) {
|
|
35
|
-
b += "[";
|
|
36
|
-
for (let i = 0; i < value.length; ++i) {
|
|
37
|
-
const item = value[i];
|
|
38
|
-
if (item != null || sparse) {
|
|
39
|
-
b += this.writeValue(ns.getValueSchema(), item);
|
|
40
|
-
b += ",";
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
else if (ns.isStructSchema()) {
|
|
45
|
-
b += "{";
|
|
46
|
-
let didWriteMember = false;
|
|
47
|
-
for (const [name, member] of ns.structIterator()) {
|
|
48
|
-
const item = value[name];
|
|
49
|
-
const targetKey = this.settings.jsonName ? (member.getMergedTraits().jsonName ?? name) : name;
|
|
50
|
-
const serializableValue = this.writeValue(member, item);
|
|
51
|
-
if (item != null || member.isIdempotencyToken()) {
|
|
52
|
-
didWriteMember = true;
|
|
53
|
-
b += `"${targetKey}":${serializableValue}`;
|
|
54
|
-
b += ",";
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (!didWriteMember && ns.isUnionSchema()) {
|
|
58
|
-
const { $unknown } = value;
|
|
59
|
-
if (Array.isArray($unknown)) {
|
|
60
|
-
const [k, v] = $unknown;
|
|
61
|
-
b += `"${k}":${this.writeValue(15, v)}`;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
else if (ns.isMapSchema() || ns.isDocumentSchema()) {
|
|
66
|
-
b += "{";
|
|
67
|
-
for (const k in value) {
|
|
68
|
-
const v = value[k];
|
|
69
|
-
if (v != null || sparse) {
|
|
70
|
-
b += `"${k}":${this.writeValue(ns, v)}`;
|
|
71
|
-
b += ",";
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (b[b.length - 1] === ",") {
|
|
76
|
-
b = b.slice(0, -1);
|
|
77
|
-
}
|
|
78
|
-
if (b[0] === "[") {
|
|
79
|
-
b += "]";
|
|
80
|
-
}
|
|
81
|
-
if (b[0] === "{") {
|
|
82
|
-
b += "}";
|
|
83
|
-
}
|
|
84
|
-
return b;
|
|
85
|
-
}
|
|
86
|
-
writeValue(schema, value) {
|
|
87
|
-
const isObject = value !== null && typeof value === "object";
|
|
88
|
-
const ns = NormalizedSchema.of(schema);
|
|
89
|
-
const quote = (_) => `"${_}"`;
|
|
90
|
-
if ((ns.isBlobSchema() && (value instanceof Uint8Array || typeof value === "string")) ||
|
|
91
|
-
(ns.isDocumentSchema() && value instanceof Uint8Array)) {
|
|
92
|
-
return quote((this.serdeContext?.base64Encoder ?? toBase64)(value));
|
|
93
|
-
}
|
|
94
|
-
if ((ns.isTimestampSchema() || ns.isDocumentSchema()) && value instanceof Date) {
|
|
95
|
-
const format = determineTimestampFormat(ns, this.settings);
|
|
96
|
-
switch (format) {
|
|
97
|
-
case 5:
|
|
98
|
-
return quote(value.toISOString().replace(".000Z", "Z"));
|
|
99
|
-
case 6:
|
|
100
|
-
return quote(dateToUtcString(value));
|
|
101
|
-
case 7:
|
|
102
|
-
return String(value.getTime() / 1000);
|
|
103
|
-
default:
|
|
104
|
-
console.warn("Missing timestamp format, using epoch seconds", value);
|
|
105
|
-
return String(value.getTime() / 1000);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
if (ns.isNumericSchema() && typeof value === "number") {
|
|
109
|
-
if (Math.abs(value) === Infinity || isNaN(value)) {
|
|
110
|
-
return quote(String(value));
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (ns.isStringSchema()) {
|
|
114
|
-
if (typeof value === "undefined" && ns.isIdempotencyToken()) {
|
|
115
|
-
return quote(generateIdempotencyToken());
|
|
116
|
-
}
|
|
117
|
-
if (typeof value === "string") {
|
|
118
|
-
const mediaType = ns.getMergedTraits().mediaType;
|
|
119
|
-
if (mediaType) {
|
|
120
|
-
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
|
|
121
|
-
if (isJson) {
|
|
122
|
-
return quote(LazyJsonString.from(value).toString());
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
if (value instanceof NumericValue) {
|
|
128
|
-
return value.string;
|
|
129
|
-
}
|
|
130
|
-
if (isObject) {
|
|
131
|
-
return this.writeObject(ns, value);
|
|
132
|
-
}
|
|
133
|
-
return typeof value === "string" ? quote(value) : String(value);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Schema, ShapeSerializer } from "@smithy/types";
|
|
2
|
-
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
3
|
-
import type { JsonSettings } from "../JsonCodec";
|
|
4
|
-
/**
|
|
5
|
-
* This implementation uses single-pass JSON serialization with JS code instead of
|
|
6
|
-
* JSON.stringify.
|
|
7
|
-
*
|
|
8
|
-
* It isn't significantly faster than dual-pass ending with native JSON.stringify
|
|
9
|
-
* that I would want to use it. It seems to be barely faster in some mid-range object
|
|
10
|
-
* sizes but slower on the high end.
|
|
11
|
-
*
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare class SinglePassJsonShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string> {
|
|
15
|
-
readonly settings: JsonSettings;
|
|
16
|
-
private buffer;
|
|
17
|
-
private rootSchema;
|
|
18
|
-
constructor(settings: JsonSettings);
|
|
19
|
-
write(schema: Schema, value: unknown): void;
|
|
20
|
-
/**
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
|
|
24
|
-
flush(): string;
|
|
25
|
-
private writeObject;
|
|
26
|
-
private writeValue;
|
|
27
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Schema, ShapeSerializer } from "@smithy/types";
|
|
2
|
-
import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
|
|
3
|
-
import { JsonSettings } from "../JsonCodec";
|
|
4
|
-
export declare class SinglePassJsonShapeSerializer
|
|
5
|
-
extends SerdeContextConfig
|
|
6
|
-
implements ShapeSerializer<string>
|
|
7
|
-
{
|
|
8
|
-
readonly settings: JsonSettings;
|
|
9
|
-
private buffer;
|
|
10
|
-
private rootSchema;
|
|
11
|
-
constructor(settings: JsonSettings);
|
|
12
|
-
write(schema: Schema, value: unknown): void;
|
|
13
|
-
writeDiscriminatedDocument(schema: Schema, value: unknown): void;
|
|
14
|
-
flush(): string;
|
|
15
|
-
private writeObject;
|
|
16
|
-
private writeValue;
|
|
17
|
-
}
|