Skip to content

Commit 700b3a0

Browse files
dependabot[bot]GitHub Actions
andauthored
chore: Bump @aws-sdk/client-codedeploy from 3.888.0 to 3.913.0 (#806)
* chore: Bump @aws-sdk/client-codedeploy from 3.888.0 to 3.913.0 Bumps [@aws-sdk/client-codedeploy](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-codedeploy) from 3.888.0 to 3.913.0. - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-codedeploy/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.913.0/clients/client-codedeploy) --- updated-dependencies: - dependency-name: "@aws-sdk/client-codedeploy" dependency-version: 3.913.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore: Update dist --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: GitHub Actions <runner@runnervmwhb2z.ufa45szwqiyexmymkpqo3cogfg.gx.internal.cloudapp.net>
1 parent 6a4f2b4 commit 700b3a0

16 files changed

+73715
-82689
lines changed

dist/136.index.js

Lines changed: 1217 additions & 0 deletions
Large diffs are not rendered by default.

dist/333.index.js

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
"use strict";
2+
exports.id = 333;
3+
exports.ids = [333];
4+
exports.modules = {
5+
6+
/***/ 13333:
7+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8+
9+
10+
11+
var utilUtf8 = __webpack_require__(60791);
12+
13+
class EventStreamSerde {
14+
marshaller;
15+
serializer;
16+
deserializer;
17+
serdeContext;
18+
defaultContentType;
19+
constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, }) {
20+
this.marshaller = marshaller;
21+
this.serializer = serializer;
22+
this.deserializer = deserializer;
23+
this.serdeContext = serdeContext;
24+
this.defaultContentType = defaultContentType;
25+
}
26+
async serializeEventStream({ eventStream, requestSchema, initialRequest, }) {
27+
const marshaller = this.marshaller;
28+
const eventStreamMember = requestSchema.getEventStreamMember();
29+
const unionSchema = requestSchema.getMemberSchema(eventStreamMember);
30+
const serializer = this.serializer;
31+
const defaultContentType = this.defaultContentType;
32+
const initialRequestMarker = Symbol("initialRequestMarker");
33+
const eventStreamIterable = {
34+
async *[Symbol.asyncIterator]() {
35+
if (initialRequest) {
36+
const headers = {
37+
":event-type": { type: "string", value: "initial-request" },
38+
":message-type": { type: "string", value: "event" },
39+
":content-type": { type: "string", value: defaultContentType },
40+
};
41+
serializer.write(requestSchema, initialRequest);
42+
const body = serializer.flush();
43+
yield {
44+
[initialRequestMarker]: true,
45+
headers,
46+
body,
47+
};
48+
}
49+
for await (const page of eventStream) {
50+
yield page;
51+
}
52+
},
53+
};
54+
return marshaller.serialize(eventStreamIterable, (event) => {
55+
if (event[initialRequestMarker]) {
56+
return {
57+
headers: event.headers,
58+
body: event.body,
59+
};
60+
}
61+
const unionMember = Object.keys(event).find((key) => {
62+
return key !== "__type";
63+
}) ?? "";
64+
const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event);
65+
const headers = {
66+
":event-type": { type: "string", value: eventType },
67+
":message-type": { type: "string", value: "event" },
68+
":content-type": { type: "string", value: explicitPayloadContentType ?? defaultContentType },
69+
...additionalHeaders,
70+
};
71+
return {
72+
headers,
73+
body,
74+
};
75+
});
76+
}
77+
async deserializeEventStream({ response, responseSchema, initialResponseContainer, }) {
78+
const marshaller = this.marshaller;
79+
const eventStreamMember = responseSchema.getEventStreamMember();
80+
const unionSchema = responseSchema.getMemberSchema(eventStreamMember);
81+
const memberSchemas = unionSchema.getMemberSchemas();
82+
const initialResponseMarker = Symbol("initialResponseMarker");
83+
const asyncIterable = marshaller.deserialize(response.body, async (event) => {
84+
const unionMember = Object.keys(event).find((key) => {
85+
return key !== "__type";
86+
}) ?? "";
87+
if (unionMember === "initial-response") {
88+
const dataObject = await this.deserializer.read(responseSchema, event[unionMember].body);
89+
delete dataObject[eventStreamMember];
90+
return {
91+
[initialResponseMarker]: true,
92+
...dataObject,
93+
};
94+
}
95+
else if (unionMember in memberSchemas) {
96+
const eventStreamSchema = memberSchemas[unionMember];
97+
return {
98+
[unionMember]: await this.deserializer.read(eventStreamSchema, event[unionMember].body),
99+
};
100+
}
101+
else {
102+
return {
103+
$unknown: event,
104+
};
105+
}
106+
});
107+
const asyncIterator = asyncIterable[Symbol.asyncIterator]();
108+
const firstEvent = await asyncIterator.next();
109+
if (firstEvent.done) {
110+
return asyncIterable;
111+
}
112+
if (firstEvent.value?.[initialResponseMarker]) {
113+
if (!responseSchema) {
114+
throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");
115+
}
116+
for (const [key, value] of Object.entries(firstEvent.value)) {
117+
initialResponseContainer[key] = value;
118+
}
119+
}
120+
return {
121+
async *[Symbol.asyncIterator]() {
122+
if (!firstEvent?.value?.[initialResponseMarker]) {
123+
yield firstEvent.value;
124+
}
125+
while (true) {
126+
const { done, value } = await asyncIterator.next();
127+
if (done) {
128+
break;
129+
}
130+
yield value;
131+
}
132+
},
133+
};
134+
}
135+
writeEventBody(unionMember, unionSchema, event) {
136+
const serializer = this.serializer;
137+
let eventType = unionMember;
138+
let explicitPayloadMember = null;
139+
let explicitPayloadContentType;
140+
const isKnownSchema = (() => {
141+
const struct = unionSchema.getSchema();
142+
return struct[4].includes(unionMember);
143+
})();
144+
const additionalHeaders = {};
145+
if (!isKnownSchema) {
146+
const [type, value] = event[unionMember];
147+
eventType = type;
148+
serializer.write(15, value);
149+
}
150+
else {
151+
const eventSchema = unionSchema.getMemberSchema(unionMember);
152+
if (eventSchema.isStructSchema()) {
153+
for (const [memberName, memberSchema] of eventSchema.structIterator()) {
154+
const { eventHeader, eventPayload } = memberSchema.getMergedTraits();
155+
if (eventPayload) {
156+
explicitPayloadMember = memberName;
157+
break;
158+
}
159+
else if (eventHeader) {
160+
const value = event[unionMember][memberName];
161+
let type = "binary";
162+
if (memberSchema.isNumericSchema()) {
163+
if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) {
164+
type = "integer";
165+
}
166+
else {
167+
type = "long";
168+
}
169+
}
170+
else if (memberSchema.isTimestampSchema()) {
171+
type = "timestamp";
172+
}
173+
else if (memberSchema.isStringSchema()) {
174+
type = "string";
175+
}
176+
else if (memberSchema.isBooleanSchema()) {
177+
type = "boolean";
178+
}
179+
if (value != null) {
180+
additionalHeaders[memberName] = {
181+
type,
182+
value,
183+
};
184+
delete event[unionMember][memberName];
185+
}
186+
}
187+
}
188+
if (explicitPayloadMember !== null) {
189+
const payloadSchema = eventSchema.getMemberSchema(explicitPayloadMember);
190+
if (payloadSchema.isBlobSchema()) {
191+
explicitPayloadContentType = "application/octet-stream";
192+
}
193+
else if (payloadSchema.isStringSchema()) {
194+
explicitPayloadContentType = "text/plain";
195+
}
196+
serializer.write(payloadSchema, event[unionMember][explicitPayloadMember]);
197+
}
198+
else {
199+
serializer.write(eventSchema, event[unionMember]);
200+
}
201+
}
202+
else {
203+
throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.");
204+
}
205+
}
206+
const messageSerialization = serializer.flush();
207+
const body = typeof messageSerialization === "string"
208+
? (this.serdeContext?.utf8Decoder ?? utilUtf8.fromUtf8)(messageSerialization)
209+
: messageSerialization;
210+
return {
211+
body,
212+
eventType,
213+
explicitPayloadContentType,
214+
additionalHeaders,
215+
};
216+
}
217+
}
218+
219+
exports.EventStreamSerde = EventStreamSerde;
220+
221+
222+
/***/ })
223+
224+
};
225+
;

0 commit comments

Comments
 (0)