@granite-js/pulumi-aws 0.1.34 → 1.0.1

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 (82) hide show
  1. package/CHANGELOG.md +4 -116
  2. package/dist/chunk-23MVQUOJ.js +1630 -0
  3. package/dist/chunk-24XYHOWM.js +171 -0
  4. package/dist/chunk-3AVBP57V.js +1598 -0
  5. package/dist/chunk-3JKQPIJ2.js +460 -0
  6. package/dist/{chunk-ITI6QA2Q.js → chunk-3OYGHA4S.js} +1 -1
  7. package/dist/{chunk-IEZY5C3G.js → chunk-46DIC54Q.js} +49 -37
  8. package/dist/chunk-57WYIP4I.js +808 -0
  9. package/dist/{chunk-WCHHWTND.js → chunk-63Q3RLAK.js} +93 -59
  10. package/dist/chunk-6KRYZP6R.js +28 -0
  11. package/dist/{chunk-QAE2S7MG.js → chunk-7NN7DVGK.js} +2050 -552
  12. package/dist/{chunk-5W7B34BN.js → chunk-ASGFIK4A.js} +2231 -464
  13. package/dist/chunk-BTBQTDRJ.js +174 -0
  14. package/dist/chunk-DDZTWBHZ.js +154 -0
  15. package/dist/chunk-G3FWLTNJ.js +10 -0
  16. package/dist/{chunk-TJ744C2T.js → chunk-GJFKL6XM.js} +43 -38
  17. package/dist/chunk-H4QJ5O4E.js +36 -0
  18. package/dist/{chunk-X6XO7USX.js → chunk-LCO5F3JB.js} +109 -56
  19. package/dist/chunk-NDDYFDCU.js +60 -0
  20. package/dist/chunk-OCHPLE5N.js +28 -0
  21. package/dist/chunk-OSJA4YYQ.js +846 -0
  22. package/dist/chunk-PIT3K3NC.js +464 -0
  23. package/dist/chunk-QCKAO4UT.js +476 -0
  24. package/dist/{chunk-64IS37V6.js → chunk-RYIGWCGK.js} +1 -6
  25. package/dist/chunk-S4LJWEXU.js +37 -0
  26. package/dist/chunk-SJ26Y3GW.js +472 -0
  27. package/dist/chunk-TDZTH7TL.js +60 -0
  28. package/dist/chunk-THUA35UY.js +35 -0
  29. package/dist/{chunk-IUKLHJNE.js → chunk-V7TRGEV6.js} +4 -7
  30. package/dist/{chunk-KGNTV362.js → chunk-WDFKVCPC.js} +66 -34
  31. package/dist/{chunk-B7OAPHPY.js → chunk-YWWEFWFD.js} +3 -3
  32. package/dist/chunk-Z4UYYQ4J.js +42 -0
  33. package/dist/chunk-ZBT5SDIQ.js +16528 -0
  34. package/dist/chunk-ZIHRRTTA.js +24 -0
  35. package/dist/{dist-es-CDFIYJVE.js → dist-es-3VZ2IGGJ.js} +18 -15
  36. package/dist/{dist-es-SUPEA6VE-3B5JSW5C.js → dist-es-BQW4ETQH-C7ZSD5EG.js} +8 -25
  37. package/dist/{dist-es-GHYMLBON.js → dist-es-HSWXMGNC.js} +21 -21
  38. package/dist/{dist-es-OCQVKISC-TNAJ62WG.js → dist-es-IDBNBAO5-H3TO63FG.js} +15 -18
  39. package/dist/{dist-es-S75EKWRJ.js → dist-es-KPJNIAPT.js} +9 -10
  40. package/dist/{dist-es-PRWCVZGQ-HTTVI42T.js → dist-es-LZDRG6RP-SP2FWWEO.js} +3 -4
  41. package/dist/{dist-es-OZGLUDWT.js → dist-es-PIWY5TOR.js} +49 -26
  42. package/dist/{dist-es-ADTONJUN-RVFWNZHO.js → dist-es-R4LD2OHZ-B5MB6BR2.js} +11 -13
  43. package/dist/dist-es-S2KJK4L2-5GDBXJIO.js +470 -0
  44. package/dist/{dist-es-XQME5F6W.js → dist-es-THYWPEKB.js} +12 -10
  45. package/dist/{dist-es-HJVOMDYC-PIAMWMAL.js → dist-es-TIYLKN6W-BAHZRZH5.js} +7 -13
  46. package/dist/{dist-es-IDBDK36G-Y6TQMRO5.js → dist-es-VORPMM2F-WOMP2FYQ.js} +37 -30
  47. package/dist/{dist-es-WQHDOVD7.js → dist-es-WESJCADT.js} +3 -4
  48. package/dist/dist-es-XMOG24OT.js +490 -0
  49. package/dist/event-streams-L7RH32OW-AFMBEYJJ.js +237 -0
  50. package/dist/event-streams-NGUY2RWE.js +237 -0
  51. package/dist/index.cjs +2 -2
  52. package/dist/index.js +2 -2
  53. package/dist/lambda/auto-cache-removal.cjs +28894 -16488
  54. package/dist/lambda/auto-cache-removal.js +11574 -2713
  55. package/dist/lambda/origin-request.cjs +22351 -17619
  56. package/dist/lambda/origin-request.js +21 -17
  57. package/dist/lambda/origin-response.cjs +22219 -17387
  58. package/dist/lambda/origin-response.js +17 -13
  59. package/dist/{loadSso-CZSSLFH6-SA5HOQAX.js → loadSso-F4PTCHDN-YR3RRUYW.js} +330 -227
  60. package/dist/{loadSso-T7GJVVO2.js → loadSso-LG7MFP7N.js} +344 -223
  61. package/dist/signin-P7DNG43W.js +658 -0
  62. package/dist/signin-XWTOVLF3-4ENWNEF7.js +630 -0
  63. package/dist/{sso-oidc-PKO5GYK5-LC65L46O.js → sso-oidc-FQQGUOJL.js} +293 -332
  64. package/dist/{sso-oidc-55SJ27II.js → sso-oidc-RRDYLOJY-FK3AUTOI.js} +263 -337
  65. package/dist/{sts-OPF4H3GL.js → sts-7FBOVTCN.js} +674 -601
  66. package/dist/{sts-P7Q3MYTS-BKGWHQE4.js → sts-TBWJ374A-DHXXCVJJ.js} +651 -608
  67. package/package.json +5 -5
  68. package/dist/chunk-AEOST5WF.js +0 -63
  69. package/dist/chunk-FO7L563E.js +0 -13695
  70. package/dist/chunk-FRWSD3YQ.js +0 -1722
  71. package/dist/chunk-JBVMOFGH.js +0 -152
  72. package/dist/chunk-JSBRDJBE.js +0 -30
  73. package/dist/chunk-KRJS4RAS.js +0 -1732
  74. package/dist/chunk-M5GUUX64.js +0 -63
  75. package/dist/chunk-SX6SVQKS.js +0 -67
  76. package/dist/chunk-UNXXS5FM.js +0 -120
  77. package/dist/chunk-UT2RMOJS.js +0 -2447
  78. package/dist/chunk-VOTRVWIB.js +0 -1965
  79. package/dist/chunk-W3VXP3A3.js +0 -119
  80. package/dist/chunk-XLUI7RQ4.js +0 -115
  81. package/dist/dist-es-2M7RLZ5O.js +0 -200
  82. package/dist/dist-es-Y7VN37H5-WQ3GYROF.js +0 -196
@@ -0,0 +1,237 @@
1
+ import {
2
+ fromUtf8,
3
+ toUtf8
4
+ } from "./chunk-H4QJ5O4E.js";
5
+
6
+ // ../deployment-manager/dist/event-streams-L7RH32OW.js
7
+ var EventStreamSerde = class {
8
+ marshaller;
9
+ serializer;
10
+ deserializer;
11
+ serdeContext;
12
+ defaultContentType;
13
+ constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType }) {
14
+ this.marshaller = marshaller;
15
+ this.serializer = serializer;
16
+ this.deserializer = deserializer;
17
+ this.serdeContext = serdeContext;
18
+ this.defaultContentType = defaultContentType;
19
+ }
20
+ async serializeEventStream({ eventStream, requestSchema, initialRequest }) {
21
+ const marshaller = this.marshaller;
22
+ const eventStreamMember = requestSchema.getEventStreamMember();
23
+ const unionSchema = requestSchema.getMemberSchema(eventStreamMember);
24
+ const serializer = this.serializer;
25
+ const defaultContentType = this.defaultContentType;
26
+ const initialRequestMarker = Symbol("initialRequestMarker");
27
+ const eventStreamIterable = {
28
+ async *[Symbol.asyncIterator]() {
29
+ if (initialRequest) {
30
+ const headers = {
31
+ ":event-type": { type: "string", value: "initial-request" },
32
+ ":message-type": { type: "string", value: "event" },
33
+ ":content-type": { type: "string", value: defaultContentType }
34
+ };
35
+ serializer.write(requestSchema, initialRequest);
36
+ const body = serializer.flush();
37
+ yield {
38
+ [initialRequestMarker]: true,
39
+ headers,
40
+ body
41
+ };
42
+ }
43
+ for await (const page of eventStream) {
44
+ yield page;
45
+ }
46
+ }
47
+ };
48
+ return marshaller.serialize(eventStreamIterable, (event) => {
49
+ if (event[initialRequestMarker]) {
50
+ return {
51
+ headers: event.headers,
52
+ body: event.body
53
+ };
54
+ }
55
+ const unionMember = Object.keys(event).find((key) => {
56
+ return key !== "__type";
57
+ }) ?? "";
58
+ const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event);
59
+ const headers = {
60
+ ":event-type": { type: "string", value: eventType },
61
+ ":message-type": { type: "string", value: "event" },
62
+ ":content-type": { type: "string", value: explicitPayloadContentType ?? defaultContentType },
63
+ ...additionalHeaders
64
+ };
65
+ return {
66
+ headers,
67
+ body
68
+ };
69
+ });
70
+ }
71
+ async deserializeEventStream({ response, responseSchema, initialResponseContainer }) {
72
+ const marshaller = this.marshaller;
73
+ const eventStreamMember = responseSchema.getEventStreamMember();
74
+ const unionSchema = responseSchema.getMemberSchema(eventStreamMember);
75
+ const memberSchemas = unionSchema.getMemberSchemas();
76
+ const initialResponseMarker = Symbol("initialResponseMarker");
77
+ const asyncIterable = marshaller.deserialize(response.body, async (event) => {
78
+ const unionMember = Object.keys(event).find((key) => {
79
+ return key !== "__type";
80
+ }) ?? "";
81
+ const body = event[unionMember].body;
82
+ if (unionMember === "initial-response") {
83
+ const dataObject = await this.deserializer.read(responseSchema, body);
84
+ delete dataObject[eventStreamMember];
85
+ return {
86
+ [initialResponseMarker]: true,
87
+ ...dataObject
88
+ };
89
+ } else if (unionMember in memberSchemas) {
90
+ const eventStreamSchema = memberSchemas[unionMember];
91
+ if (eventStreamSchema.isStructSchema()) {
92
+ const out = {};
93
+ let hasBindings = false;
94
+ for (const [name, member] of eventStreamSchema.structIterator()) {
95
+ const { eventHeader, eventPayload } = member.getMergedTraits();
96
+ hasBindings = hasBindings || Boolean(eventHeader || eventPayload);
97
+ if (eventPayload) {
98
+ if (member.isBlobSchema()) {
99
+ out[name] = body;
100
+ } else if (member.isStringSchema()) {
101
+ out[name] = (this.serdeContext?.utf8Encoder ?? toUtf8)(body);
102
+ } else if (member.isStructSchema()) {
103
+ out[name] = await this.deserializer.read(member, body);
104
+ }
105
+ } else if (eventHeader) {
106
+ const value = event[unionMember].headers[name]?.value;
107
+ if (value != null) {
108
+ if (member.isNumericSchema()) {
109
+ if (value && typeof value === "object" && "bytes" in value) {
110
+ out[name] = BigInt(value.toString());
111
+ } else {
112
+ out[name] = Number(value);
113
+ }
114
+ } else {
115
+ out[name] = value;
116
+ }
117
+ }
118
+ }
119
+ }
120
+ if (hasBindings) {
121
+ return {
122
+ [unionMember]: out
123
+ };
124
+ }
125
+ }
126
+ return {
127
+ [unionMember]: await this.deserializer.read(eventStreamSchema, body)
128
+ };
129
+ } else {
130
+ return {
131
+ $unknown: event
132
+ };
133
+ }
134
+ });
135
+ const asyncIterator = asyncIterable[Symbol.asyncIterator]();
136
+ const firstEvent = await asyncIterator.next();
137
+ if (firstEvent.done) {
138
+ return asyncIterable;
139
+ }
140
+ if (firstEvent.value?.[initialResponseMarker]) {
141
+ if (!responseSchema) {
142
+ throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");
143
+ }
144
+ for (const [key, value] of Object.entries(firstEvent.value)) {
145
+ initialResponseContainer[key] = value;
146
+ }
147
+ }
148
+ return {
149
+ async *[Symbol.asyncIterator]() {
150
+ if (!firstEvent?.value?.[initialResponseMarker]) {
151
+ yield firstEvent.value;
152
+ }
153
+ while (true) {
154
+ const { done, value } = await asyncIterator.next();
155
+ if (done) {
156
+ break;
157
+ }
158
+ yield value;
159
+ }
160
+ }
161
+ };
162
+ }
163
+ writeEventBody(unionMember, unionSchema, event) {
164
+ const serializer = this.serializer;
165
+ let eventType = unionMember;
166
+ let explicitPayloadMember = null;
167
+ let explicitPayloadContentType;
168
+ const isKnownSchema = (() => {
169
+ const struct = unionSchema.getSchema();
170
+ return struct[4].includes(unionMember);
171
+ })();
172
+ const additionalHeaders = {};
173
+ if (!isKnownSchema) {
174
+ const [type, value] = event[unionMember];
175
+ eventType = type;
176
+ serializer.write(15, value);
177
+ } else {
178
+ const eventSchema = unionSchema.getMemberSchema(unionMember);
179
+ if (eventSchema.isStructSchema()) {
180
+ for (const [memberName, memberSchema] of eventSchema.structIterator()) {
181
+ const { eventHeader, eventPayload } = memberSchema.getMergedTraits();
182
+ if (eventPayload) {
183
+ explicitPayloadMember = memberName;
184
+ break;
185
+ } else if (eventHeader) {
186
+ const value = event[unionMember][memberName];
187
+ let type = "binary";
188
+ if (memberSchema.isNumericSchema()) {
189
+ if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) {
190
+ type = "integer";
191
+ } else {
192
+ type = "long";
193
+ }
194
+ } else if (memberSchema.isTimestampSchema()) {
195
+ type = "timestamp";
196
+ } else if (memberSchema.isStringSchema()) {
197
+ type = "string";
198
+ } else if (memberSchema.isBooleanSchema()) {
199
+ type = "boolean";
200
+ }
201
+ if (value != null) {
202
+ additionalHeaders[memberName] = {
203
+ type,
204
+ value
205
+ };
206
+ delete event[unionMember][memberName];
207
+ }
208
+ }
209
+ }
210
+ if (explicitPayloadMember !== null) {
211
+ const payloadSchema = eventSchema.getMemberSchema(explicitPayloadMember);
212
+ if (payloadSchema.isBlobSchema()) {
213
+ explicitPayloadContentType = "application/octet-stream";
214
+ } else if (payloadSchema.isStringSchema()) {
215
+ explicitPayloadContentType = "text/plain";
216
+ }
217
+ serializer.write(payloadSchema, event[unionMember][explicitPayloadMember]);
218
+ } else {
219
+ serializer.write(eventSchema, event[unionMember]);
220
+ }
221
+ } else {
222
+ throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.");
223
+ }
224
+ }
225
+ const messageSerialization = serializer.flush();
226
+ const body = typeof messageSerialization === "string" ? (this.serdeContext?.utf8Decoder ?? fromUtf8)(messageSerialization) : messageSerialization;
227
+ return {
228
+ body,
229
+ eventType,
230
+ explicitPayloadContentType,
231
+ additionalHeaders
232
+ };
233
+ }
234
+ };
235
+ export {
236
+ EventStreamSerde
237
+ };
@@ -0,0 +1,237 @@
1
+ import {
2
+ fromUtf8,
3
+ toUtf8
4
+ } from "./chunk-Z4UYYQ4J.js";
5
+
6
+ // ../../.yarn/cache/@smithy-core-npm-3.18.5-16e80a170e-c6ccaf4a06.zip/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js
7
+ var EventStreamSerde = class {
8
+ marshaller;
9
+ serializer;
10
+ deserializer;
11
+ serdeContext;
12
+ defaultContentType;
13
+ constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType }) {
14
+ this.marshaller = marshaller;
15
+ this.serializer = serializer;
16
+ this.deserializer = deserializer;
17
+ this.serdeContext = serdeContext;
18
+ this.defaultContentType = defaultContentType;
19
+ }
20
+ async serializeEventStream({ eventStream, requestSchema, initialRequest }) {
21
+ const marshaller = this.marshaller;
22
+ const eventStreamMember = requestSchema.getEventStreamMember();
23
+ const unionSchema = requestSchema.getMemberSchema(eventStreamMember);
24
+ const serializer = this.serializer;
25
+ const defaultContentType = this.defaultContentType;
26
+ const initialRequestMarker = Symbol("initialRequestMarker");
27
+ const eventStreamIterable = {
28
+ async *[Symbol.asyncIterator]() {
29
+ if (initialRequest) {
30
+ const headers = {
31
+ ":event-type": { type: "string", value: "initial-request" },
32
+ ":message-type": { type: "string", value: "event" },
33
+ ":content-type": { type: "string", value: defaultContentType }
34
+ };
35
+ serializer.write(requestSchema, initialRequest);
36
+ const body = serializer.flush();
37
+ yield {
38
+ [initialRequestMarker]: true,
39
+ headers,
40
+ body
41
+ };
42
+ }
43
+ for await (const page of eventStream) {
44
+ yield page;
45
+ }
46
+ }
47
+ };
48
+ return marshaller.serialize(eventStreamIterable, (event) => {
49
+ if (event[initialRequestMarker]) {
50
+ return {
51
+ headers: event.headers,
52
+ body: event.body
53
+ };
54
+ }
55
+ const unionMember = Object.keys(event).find((key) => {
56
+ return key !== "__type";
57
+ }) ?? "";
58
+ const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event);
59
+ const headers = {
60
+ ":event-type": { type: "string", value: eventType },
61
+ ":message-type": { type: "string", value: "event" },
62
+ ":content-type": { type: "string", value: explicitPayloadContentType ?? defaultContentType },
63
+ ...additionalHeaders
64
+ };
65
+ return {
66
+ headers,
67
+ body
68
+ };
69
+ });
70
+ }
71
+ async deserializeEventStream({ response, responseSchema, initialResponseContainer }) {
72
+ const marshaller = this.marshaller;
73
+ const eventStreamMember = responseSchema.getEventStreamMember();
74
+ const unionSchema = responseSchema.getMemberSchema(eventStreamMember);
75
+ const memberSchemas = unionSchema.getMemberSchemas();
76
+ const initialResponseMarker = Symbol("initialResponseMarker");
77
+ const asyncIterable = marshaller.deserialize(response.body, async (event) => {
78
+ const unionMember = Object.keys(event).find((key) => {
79
+ return key !== "__type";
80
+ }) ?? "";
81
+ const body = event[unionMember].body;
82
+ if (unionMember === "initial-response") {
83
+ const dataObject = await this.deserializer.read(responseSchema, body);
84
+ delete dataObject[eventStreamMember];
85
+ return {
86
+ [initialResponseMarker]: true,
87
+ ...dataObject
88
+ };
89
+ } else if (unionMember in memberSchemas) {
90
+ const eventStreamSchema = memberSchemas[unionMember];
91
+ if (eventStreamSchema.isStructSchema()) {
92
+ const out = {};
93
+ let hasBindings = false;
94
+ for (const [name, member] of eventStreamSchema.structIterator()) {
95
+ const { eventHeader, eventPayload } = member.getMergedTraits();
96
+ hasBindings = hasBindings || Boolean(eventHeader || eventPayload);
97
+ if (eventPayload) {
98
+ if (member.isBlobSchema()) {
99
+ out[name] = body;
100
+ } else if (member.isStringSchema()) {
101
+ out[name] = (this.serdeContext?.utf8Encoder ?? toUtf8)(body);
102
+ } else if (member.isStructSchema()) {
103
+ out[name] = await this.deserializer.read(member, body);
104
+ }
105
+ } else if (eventHeader) {
106
+ const value = event[unionMember].headers[name]?.value;
107
+ if (value != null) {
108
+ if (member.isNumericSchema()) {
109
+ if (value && typeof value === "object" && "bytes" in value) {
110
+ out[name] = BigInt(value.toString());
111
+ } else {
112
+ out[name] = Number(value);
113
+ }
114
+ } else {
115
+ out[name] = value;
116
+ }
117
+ }
118
+ }
119
+ }
120
+ if (hasBindings) {
121
+ return {
122
+ [unionMember]: out
123
+ };
124
+ }
125
+ }
126
+ return {
127
+ [unionMember]: await this.deserializer.read(eventStreamSchema, body)
128
+ };
129
+ } else {
130
+ return {
131
+ $unknown: event
132
+ };
133
+ }
134
+ });
135
+ const asyncIterator = asyncIterable[Symbol.asyncIterator]();
136
+ const firstEvent = await asyncIterator.next();
137
+ if (firstEvent.done) {
138
+ return asyncIterable;
139
+ }
140
+ if (firstEvent.value?.[initialResponseMarker]) {
141
+ if (!responseSchema) {
142
+ throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");
143
+ }
144
+ for (const [key, value] of Object.entries(firstEvent.value)) {
145
+ initialResponseContainer[key] = value;
146
+ }
147
+ }
148
+ return {
149
+ async *[Symbol.asyncIterator]() {
150
+ if (!firstEvent?.value?.[initialResponseMarker]) {
151
+ yield firstEvent.value;
152
+ }
153
+ while (true) {
154
+ const { done, value } = await asyncIterator.next();
155
+ if (done) {
156
+ break;
157
+ }
158
+ yield value;
159
+ }
160
+ }
161
+ };
162
+ }
163
+ writeEventBody(unionMember, unionSchema, event) {
164
+ const serializer = this.serializer;
165
+ let eventType = unionMember;
166
+ let explicitPayloadMember = null;
167
+ let explicitPayloadContentType;
168
+ const isKnownSchema = (() => {
169
+ const struct = unionSchema.getSchema();
170
+ return struct[4].includes(unionMember);
171
+ })();
172
+ const additionalHeaders = {};
173
+ if (!isKnownSchema) {
174
+ const [type, value] = event[unionMember];
175
+ eventType = type;
176
+ serializer.write(15, value);
177
+ } else {
178
+ const eventSchema = unionSchema.getMemberSchema(unionMember);
179
+ if (eventSchema.isStructSchema()) {
180
+ for (const [memberName, memberSchema] of eventSchema.structIterator()) {
181
+ const { eventHeader, eventPayload } = memberSchema.getMergedTraits();
182
+ if (eventPayload) {
183
+ explicitPayloadMember = memberName;
184
+ break;
185
+ } else if (eventHeader) {
186
+ const value = event[unionMember][memberName];
187
+ let type = "binary";
188
+ if (memberSchema.isNumericSchema()) {
189
+ if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) {
190
+ type = "integer";
191
+ } else {
192
+ type = "long";
193
+ }
194
+ } else if (memberSchema.isTimestampSchema()) {
195
+ type = "timestamp";
196
+ } else if (memberSchema.isStringSchema()) {
197
+ type = "string";
198
+ } else if (memberSchema.isBooleanSchema()) {
199
+ type = "boolean";
200
+ }
201
+ if (value != null) {
202
+ additionalHeaders[memberName] = {
203
+ type,
204
+ value
205
+ };
206
+ delete event[unionMember][memberName];
207
+ }
208
+ }
209
+ }
210
+ if (explicitPayloadMember !== null) {
211
+ const payloadSchema = eventSchema.getMemberSchema(explicitPayloadMember);
212
+ if (payloadSchema.isBlobSchema()) {
213
+ explicitPayloadContentType = "application/octet-stream";
214
+ } else if (payloadSchema.isStringSchema()) {
215
+ explicitPayloadContentType = "text/plain";
216
+ }
217
+ serializer.write(payloadSchema, event[unionMember][explicitPayloadMember]);
218
+ } else {
219
+ serializer.write(eventSchema, event[unionMember]);
220
+ }
221
+ } else {
222
+ throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.");
223
+ }
224
+ }
225
+ const messageSerialization = serializer.flush();
226
+ const body = typeof messageSerialization === "string" ? (this.serdeContext?.utf8Decoder ?? fromUtf8)(messageSerialization) : messageSerialization;
227
+ return {
228
+ body,
229
+ eventType,
230
+ explicitPayloadContentType,
231
+ additionalHeaders
232
+ };
233
+ }
234
+ };
235
+ export {
236
+ EventStreamSerde
237
+ };
package/dist/index.cjs CHANGED
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../.yarn/__virtual__/tsup-virtual-699424e35d/0/cache/tsup-npm-8.5.0-e9d25b74d7-2eddc1138a.zip/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../.yarn/__virtual__/tsup-virtual-4b32ec60ab/0/cache/tsup-npm-8.5.1-41f4f7d59b-86b0a5ee55.zip/node_modules/tsup/assets/cjs_shims.js
37
37
  var init_cjs_shims = __esm({
38
- "../../.yarn/__virtual__/tsup-virtual-699424e35d/0/cache/tsup-npm-8.5.0-e9d25b74d7-2eddc1138a.zip/node_modules/tsup/assets/cjs_shims.js"() {
38
+ "../../.yarn/__virtual__/tsup-virtual-4b32ec60ab/0/cache/tsup-npm-8.5.1-41f4f7d59b-86b0a5ee55.zip/node_modules/tsup/assets/cjs_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
package/dist/index.js CHANGED
@@ -33,12 +33,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  mod
34
34
  ));
35
35
 
36
- // ../../.yarn/__virtual__/tsup-virtual-699424e35d/0/cache/tsup-npm-8.5.0-e9d25b74d7-2eddc1138a.zip/node_modules/tsup/assets/esm_shims.js
36
+ // ../../.yarn/__virtual__/tsup-virtual-4b32ec60ab/0/cache/tsup-npm-8.5.1-41f4f7d59b-86b0a5ee55.zip/node_modules/tsup/assets/esm_shims.js
37
37
  import path from "path";
38
38
  import { fileURLToPath } from "url";
39
39
  var getFilename, getDirname, __dirname;
40
40
  var init_esm_shims = __esm({
41
- "../../.yarn/__virtual__/tsup-virtual-699424e35d/0/cache/tsup-npm-8.5.0-e9d25b74d7-2eddc1138a.zip/node_modules/tsup/assets/esm_shims.js"() {
41
+ "../../.yarn/__virtual__/tsup-virtual-4b32ec60ab/0/cache/tsup-npm-8.5.1-41f4f7d59b-86b0a5ee55.zip/node_modules/tsup/assets/esm_shims.js"() {
42
42
  "use strict";
43
43
  getFilename = () => fileURLToPath(import.meta.url);
44
44
  getDirname = () => path.dirname(getFilename());