@cdk8s/awscdk-resolver 0.0.635 → 0.0.636

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.
Files changed (42) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +1 -1
  4. package/node_modules/@aws-sdk/client-cloudformation/package.json +3 -3
  5. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.js +182 -0
  6. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/ByteJsonShapeSerializer.js +473 -0
  7. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +29 -0
  8. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +59 -0
  9. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +14 -0
  10. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +30 -0
  11. package/node_modules/@aws-sdk/core/package.json +2 -1
  12. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  13. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  14. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  15. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  16. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  17. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  18. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  19. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  20. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  21. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  22. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  23. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  24. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  25. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  26. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  27. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +34 -11
  28. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +34 -11
  29. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +1 -0
  30. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +34 -11
  31. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +1 -0
  32. package/node_modules/@smithy/core/dist-types/submodules/event-streams/EventStreamSerde.d.ts +10 -2
  33. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts +10 -2
  34. package/node_modules/@smithy/core/package.json +1 -1
  35. package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
  36. package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
  37. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  38. package/node_modules/@smithy/signature-v4/package.json +2 -2
  39. package/package.json +2 -2
  40. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.js +0 -135
  41. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.d.ts +0 -27
  42. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.d.ts +0 -17
package/.jsii CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "https://aws.amazon.com"
8
8
  },
9
9
  "bundled": {
10
- "@aws-sdk/client-cloudformation": "^3.1091.0"
10
+ "@aws-sdk/client-cloudformation": "^3.1092.0"
11
11
  },
12
12
  "dependencies": {
13
13
  "aws-cdk-lib": "^2.195.0",
@@ -4082,6 +4082,6 @@
4082
4082
  "symbolId": "src/resolve:AwsCdkResolver"
4083
4083
  }
4084
4084
  },
4085
- "version": "0.0.635",
4086
- "fingerprint": "Adzsbu4ML1plCH2CNeZUABm2yb8Fh3OHWfZU0J7mKJI="
4085
+ "version": "0.0.636",
4086
+ "fingerprint": "4Yt9AbBa+2xchM6uvFMWyR0G4smB6XdcHC8ZJ4rpWGk="
4087
4087
  }
package/lib/resolve.js CHANGED
@@ -39,7 +39,7 @@ const child_process_1 = require("child_process");
39
39
  const path = __importStar(require("path"));
40
40
  const aws_cdk_lib_1 = require("aws-cdk-lib");
41
41
  class AwsCdkResolver {
42
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@cdk8s/awscdk-resolver.AwsCdkResolver", version: "0.0.635" };
42
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@cdk8s/awscdk-resolver.AwsCdkResolver", version: "0.0.636" };
43
43
  resolve(context) {
44
44
  if (!aws_cdk_lib_1.Token.isUnresolved(context.value)) {
45
45
  return;
@@ -69,7 +69,7 @@ const commonParams = {
69
69
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
70
70
  };
71
71
 
72
- var version = "3.1090.0";
72
+ var version = "3.1091.0";
73
73
  var packageInfo = {
74
74
  version: version};
75
75
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-cloudformation",
3
- "version": "3.1091.0",
3
+ "version": "3.1092.0",
4
4
  "description": "AWS SDK for JavaScript Cloudformation Client for Node.js, Browser and React Native",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudformation",
6
6
  "license": "Apache-2.0",
@@ -48,8 +48,8 @@
48
48
  "test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs"
49
49
  },
50
50
  "dependencies": {
51
- "@aws-sdk/core": "^3.975.3",
52
- "@aws-sdk/credential-provider-node": "^3.972.70",
51
+ "@aws-sdk/core": "^3.976.0",
52
+ "@aws-sdk/credential-provider-node": "^3.972.71",
53
53
  "@aws-sdk/types": "^3.974.2",
54
54
  "@smithy/core": "^3.29.4",
55
55
  "@smithy/fetch-http-handler": "^5.6.6",
@@ -0,0 +1,182 @@
1
+ import { determineTimestampFormat } from "@smithy/core/protocols";
2
+ import { NormalizedSchema } from "@smithy/core/schema";
3
+ import { LazyJsonString, NumericValue, parseEpochTimestamp, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, } from "@smithy/core/serde";
4
+ import { fromBase64 } from "@smithy/core/serde";
5
+ import { SerdeContextConfig } from "../../ConfigurableSerdeContext";
6
+ import { UnionSerde } from "../../UnionSerde";
7
+ import { jsonReviver } from "../jsonReviver";
8
+ import { parseJsonBody } from "../parseJsonBody";
9
+ let canParseBuffer;
10
+ function detectBufferParsing() {
11
+ if (canParseBuffer === undefined) {
12
+ try {
13
+ const result = JSON.parse(new Uint8Array([0x7b, 0x7d]));
14
+ canParseBuffer = result !== null && typeof result === "object";
15
+ }
16
+ catch {
17
+ canParseBuffer = false;
18
+ }
19
+ }
20
+ return canParseBuffer;
21
+ }
22
+ export class BufferJsonShapeDeserializer extends SerdeContextConfig {
23
+ settings;
24
+ constructor(settings) {
25
+ super();
26
+ this.settings = settings;
27
+ }
28
+ async read(schema, data) {
29
+ let parsed;
30
+ if (typeof data === "string") {
31
+ parsed = JSON.parse(data, jsonReviver);
32
+ }
33
+ else if (data instanceof Uint8Array && detectBufferParsing()) {
34
+ parsed = JSON.parse(data, jsonReviver);
35
+ }
36
+ else {
37
+ parsed = await parseJsonBody(data, this.serdeContext);
38
+ }
39
+ return this._read(schema, parsed);
40
+ }
41
+ readObject(schema, data) {
42
+ return this._read(schema, data);
43
+ }
44
+ _read(schema, value) {
45
+ const isObject = value !== null && typeof value === "object";
46
+ const ns = NormalizedSchema.of(schema);
47
+ if (isObject) {
48
+ if (ns.isStructSchema()) {
49
+ return this._readStruct(ns, value);
50
+ }
51
+ if (Array.isArray(value) && ns.isListSchema()) {
52
+ const listMember = ns.getValueSchema();
53
+ for (let i = 0; i < value.length; ++i) {
54
+ value[i] = this._read(listMember, value[i]);
55
+ }
56
+ return value;
57
+ }
58
+ if (ns.isMapSchema()) {
59
+ const mapMember = ns.getValueSchema();
60
+ const map = value;
61
+ for (const k in map) {
62
+ map[k] = this._read(mapMember, map[k]);
63
+ }
64
+ return map;
65
+ }
66
+ }
67
+ if (ns.isBlobSchema() && typeof value === "string") {
68
+ return fromBase64(value);
69
+ }
70
+ const mediaType = ns.getMergedTraits().mediaType;
71
+ if (ns.isStringSchema() && typeof value === "string" && mediaType) {
72
+ const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
73
+ if (isJson) {
74
+ return LazyJsonString.from(value);
75
+ }
76
+ return value;
77
+ }
78
+ if (ns.isTimestampSchema() && value != null) {
79
+ const format = determineTimestampFormat(ns, this.settings);
80
+ switch (format) {
81
+ case 5:
82
+ return parseRfc3339DateTimeWithOffset(value);
83
+ case 6:
84
+ return parseRfc7231DateTime(value);
85
+ case 7:
86
+ return parseEpochTimestamp(value);
87
+ default:
88
+ console.warn("Missing timestamp format, parsing value with Date constructor:", value);
89
+ return new Date(value);
90
+ }
91
+ }
92
+ if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) {
93
+ return BigInt(value);
94
+ }
95
+ if (ns.isBigDecimalSchema() && value != undefined) {
96
+ if (value instanceof NumericValue) {
97
+ return value;
98
+ }
99
+ const untyped = value;
100
+ if (untyped.type === "bigDecimal" && "string" in untyped) {
101
+ return new NumericValue(untyped.string, untyped.type);
102
+ }
103
+ return new NumericValue(String(value), "bigDecimal");
104
+ }
105
+ if (ns.isNumericSchema() && typeof value === "string") {
106
+ switch (value) {
107
+ case "Infinity":
108
+ return Infinity;
109
+ case "-Infinity":
110
+ return -Infinity;
111
+ case "NaN":
112
+ return NaN;
113
+ }
114
+ return value;
115
+ }
116
+ if (ns.isDocumentSchema()) {
117
+ if (isObject) {
118
+ if (Array.isArray(value)) {
119
+ for (let i = 0; i < value.length; ++i) {
120
+ const v = value[i];
121
+ if (!(v instanceof NumericValue)) {
122
+ value[i] = this._read(ns, v);
123
+ }
124
+ }
125
+ }
126
+ else {
127
+ const doc = value;
128
+ for (const k in doc) {
129
+ const v = doc[k];
130
+ if (!(v instanceof NumericValue)) {
131
+ doc[k] = this._read(ns, v);
132
+ }
133
+ }
134
+ }
135
+ return value;
136
+ }
137
+ else {
138
+ return value;
139
+ }
140
+ }
141
+ return value;
142
+ }
143
+ _readStruct(ns, record) {
144
+ const union = ns.isUnionSchema();
145
+ const out = {};
146
+ let nameMap = void 0;
147
+ const { jsonName } = this.settings;
148
+ if (jsonName) {
149
+ nameMap = {};
150
+ }
151
+ let unionSerde;
152
+ if (union) {
153
+ unionSerde = new UnionSerde(record, out);
154
+ }
155
+ for (const [memberName, memberSchema] of ns.structIterator()) {
156
+ let fromKey = memberName;
157
+ if (jsonName) {
158
+ fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
159
+ nameMap[fromKey] = memberName;
160
+ }
161
+ if (union) {
162
+ unionSerde.mark(fromKey);
163
+ }
164
+ if (record[fromKey] != null) {
165
+ out[memberName] = this._read(memberSchema, record[fromKey]);
166
+ }
167
+ }
168
+ if (union) {
169
+ unionSerde.writeUnknown();
170
+ }
171
+ else if (typeof record.__type === "string") {
172
+ for (const k in record) {
173
+ const v = record[k];
174
+ const t = jsonName ? (nameMap[k] ?? k) : k;
175
+ if (!(t in out)) {
176
+ out[t] = v;
177
+ }
178
+ }
179
+ }
180
+ return out;
181
+ }
182
+ }