@aws-sdk/client-dynamodb-streams 3.489.0 → 3.495.0

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.
@@ -1,12 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DynamoDBStreamsServiceException = exports.__ServiceException = void 0;
4
- const smithy_client_1 = require("@smithy/smithy-client");
5
- Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });
6
- class DynamoDBStreamsServiceException extends smithy_client_1.ServiceException {
7
- constructor(options) {
8
- super(options);
9
- Object.setPrototypeOf(this, DynamoDBStreamsServiceException.prototype);
10
- }
11
- }
12
- exports.DynamoDBStreamsServiceException = DynamoDBStreamsServiceException;
1
+ module.exports = require("../index.js");
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./models_0"), exports);
1
+ module.exports = require("../index.js");
@@ -1,122 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AttributeValue = exports.ShardIteratorType = exports.TrimmedDataAccessException = exports.LimitExceededException = exports.OperationType = exports.ExpiredIteratorException = exports.ResourceNotFoundException = exports.InternalServerError = exports.StreamViewType = exports.StreamStatus = exports.KeyType = void 0;
4
- const DynamoDBStreamsServiceException_1 = require("./DynamoDBStreamsServiceException");
5
- exports.KeyType = {
6
- HASH: "HASH",
7
- RANGE: "RANGE",
8
- };
9
- exports.StreamStatus = {
10
- DISABLED: "DISABLED",
11
- DISABLING: "DISABLING",
12
- ENABLED: "ENABLED",
13
- ENABLING: "ENABLING",
14
- };
15
- exports.StreamViewType = {
16
- KEYS_ONLY: "KEYS_ONLY",
17
- NEW_AND_OLD_IMAGES: "NEW_AND_OLD_IMAGES",
18
- NEW_IMAGE: "NEW_IMAGE",
19
- OLD_IMAGE: "OLD_IMAGE",
20
- };
21
- class InternalServerError extends DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException {
22
- constructor(opts) {
23
- super({
24
- name: "InternalServerError",
25
- $fault: "server",
26
- ...opts,
27
- });
28
- this.name = "InternalServerError";
29
- this.$fault = "server";
30
- Object.setPrototypeOf(this, InternalServerError.prototype);
31
- }
32
- }
33
- exports.InternalServerError = InternalServerError;
34
- class ResourceNotFoundException extends DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException {
35
- constructor(opts) {
36
- super({
37
- name: "ResourceNotFoundException",
38
- $fault: "client",
39
- ...opts,
40
- });
41
- this.name = "ResourceNotFoundException";
42
- this.$fault = "client";
43
- Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
44
- }
45
- }
46
- exports.ResourceNotFoundException = ResourceNotFoundException;
47
- class ExpiredIteratorException extends DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException {
48
- constructor(opts) {
49
- super({
50
- name: "ExpiredIteratorException",
51
- $fault: "client",
52
- ...opts,
53
- });
54
- this.name = "ExpiredIteratorException";
55
- this.$fault = "client";
56
- Object.setPrototypeOf(this, ExpiredIteratorException.prototype);
57
- }
58
- }
59
- exports.ExpiredIteratorException = ExpiredIteratorException;
60
- exports.OperationType = {
61
- INSERT: "INSERT",
62
- MODIFY: "MODIFY",
63
- REMOVE: "REMOVE",
64
- };
65
- class LimitExceededException extends DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException {
66
- constructor(opts) {
67
- super({
68
- name: "LimitExceededException",
69
- $fault: "client",
70
- ...opts,
71
- });
72
- this.name = "LimitExceededException";
73
- this.$fault = "client";
74
- Object.setPrototypeOf(this, LimitExceededException.prototype);
75
- }
76
- }
77
- exports.LimitExceededException = LimitExceededException;
78
- class TrimmedDataAccessException extends DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException {
79
- constructor(opts) {
80
- super({
81
- name: "TrimmedDataAccessException",
82
- $fault: "client",
83
- ...opts,
84
- });
85
- this.name = "TrimmedDataAccessException";
86
- this.$fault = "client";
87
- Object.setPrototypeOf(this, TrimmedDataAccessException.prototype);
88
- }
89
- }
90
- exports.TrimmedDataAccessException = TrimmedDataAccessException;
91
- exports.ShardIteratorType = {
92
- AFTER_SEQUENCE_NUMBER: "AFTER_SEQUENCE_NUMBER",
93
- AT_SEQUENCE_NUMBER: "AT_SEQUENCE_NUMBER",
94
- LATEST: "LATEST",
95
- TRIM_HORIZON: "TRIM_HORIZON",
96
- };
97
- var AttributeValue;
98
- (function (AttributeValue) {
99
- AttributeValue.visit = (value, visitor) => {
100
- if (value.S !== undefined)
101
- return visitor.S(value.S);
102
- if (value.N !== undefined)
103
- return visitor.N(value.N);
104
- if (value.B !== undefined)
105
- return visitor.B(value.B);
106
- if (value.SS !== undefined)
107
- return visitor.SS(value.SS);
108
- if (value.NS !== undefined)
109
- return visitor.NS(value.NS);
110
- if (value.BS !== undefined)
111
- return visitor.BS(value.BS);
112
- if (value.M !== undefined)
113
- return visitor.M(value.M);
114
- if (value.L !== undefined)
115
- return visitor.L(value.L);
116
- if (value.NULL !== undefined)
117
- return visitor.NULL(value.NULL);
118
- if (value.BOOL !== undefined)
119
- return visitor.BOOL(value.BOOL);
120
- return visitor._(value.$unknown[0], value.$unknown[1]);
121
- };
122
- })(AttributeValue = exports.AttributeValue || (exports.AttributeValue = {}));
1
+ module.exports = require("../index.js");
@@ -1,442 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_ListStreamsCommand = exports.de_GetShardIteratorCommand = exports.de_GetRecordsCommand = exports.de_DescribeStreamCommand = exports.se_ListStreamsCommand = exports.se_GetShardIteratorCommand = exports.se_GetRecordsCommand = exports.se_DescribeStreamCommand = void 0;
4
- const core_1 = require("@aws-sdk/core");
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const DynamoDBStreamsServiceException_1 = require("../models/DynamoDBStreamsServiceException");
8
- const models_0_1 = require("../models/models_0");
9
- const se_DescribeStreamCommand = async (input, context) => {
10
- const headers = sharedHeaders("DescribeStream");
11
- let body;
12
- body = JSON.stringify((0, smithy_client_1._json)(input));
13
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
- };
15
- exports.se_DescribeStreamCommand = se_DescribeStreamCommand;
16
- const se_GetRecordsCommand = async (input, context) => {
17
- const headers = sharedHeaders("GetRecords");
18
- let body;
19
- body = JSON.stringify((0, smithy_client_1._json)(input));
20
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
21
- };
22
- exports.se_GetRecordsCommand = se_GetRecordsCommand;
23
- const se_GetShardIteratorCommand = async (input, context) => {
24
- const headers = sharedHeaders("GetShardIterator");
25
- let body;
26
- body = JSON.stringify((0, smithy_client_1._json)(input));
27
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
- };
29
- exports.se_GetShardIteratorCommand = se_GetShardIteratorCommand;
30
- const se_ListStreamsCommand = async (input, context) => {
31
- const headers = sharedHeaders("ListStreams");
32
- let body;
33
- body = JSON.stringify((0, smithy_client_1._json)(input));
34
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
35
- };
36
- exports.se_ListStreamsCommand = se_ListStreamsCommand;
37
- const de_DescribeStreamCommand = async (output, context) => {
38
- if (output.statusCode >= 300) {
39
- return de_DescribeStreamCommandError(output, context);
40
- }
41
- const data = await parseBody(output.body, context);
42
- let contents = {};
43
- contents = de_DescribeStreamOutput(data, context);
44
- const response = {
45
- $metadata: deserializeMetadata(output),
46
- ...contents,
47
- };
48
- return response;
49
- };
50
- exports.de_DescribeStreamCommand = de_DescribeStreamCommand;
51
- const de_DescribeStreamCommandError = async (output, context) => {
52
- const parsedOutput = {
53
- ...output,
54
- body: await parseErrorBody(output.body, context),
55
- };
56
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
57
- switch (errorCode) {
58
- case "InternalServerError":
59
- case "com.amazonaws.dynamodbstreams#InternalServerError":
60
- throw await de_InternalServerErrorRes(parsedOutput, context);
61
- case "ResourceNotFoundException":
62
- case "com.amazonaws.dynamodbstreams#ResourceNotFoundException":
63
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
64
- default:
65
- const parsedBody = parsedOutput.body;
66
- return throwDefaultError({
67
- output,
68
- parsedBody,
69
- errorCode,
70
- });
71
- }
72
- };
73
- const de_GetRecordsCommand = async (output, context) => {
74
- if (output.statusCode >= 300) {
75
- return de_GetRecordsCommandError(output, context);
76
- }
77
- const data = await parseBody(output.body, context);
78
- let contents = {};
79
- contents = de_GetRecordsOutput(data, context);
80
- const response = {
81
- $metadata: deserializeMetadata(output),
82
- ...contents,
83
- };
84
- return response;
85
- };
86
- exports.de_GetRecordsCommand = de_GetRecordsCommand;
87
- const de_GetRecordsCommandError = async (output, context) => {
88
- const parsedOutput = {
89
- ...output,
90
- body: await parseErrorBody(output.body, context),
91
- };
92
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
93
- switch (errorCode) {
94
- case "ExpiredIteratorException":
95
- case "com.amazonaws.dynamodbstreams#ExpiredIteratorException":
96
- throw await de_ExpiredIteratorExceptionRes(parsedOutput, context);
97
- case "InternalServerError":
98
- case "com.amazonaws.dynamodbstreams#InternalServerError":
99
- throw await de_InternalServerErrorRes(parsedOutput, context);
100
- case "LimitExceededException":
101
- case "com.amazonaws.dynamodbstreams#LimitExceededException":
102
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
103
- case "ResourceNotFoundException":
104
- case "com.amazonaws.dynamodbstreams#ResourceNotFoundException":
105
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
106
- case "TrimmedDataAccessException":
107
- case "com.amazonaws.dynamodbstreams#TrimmedDataAccessException":
108
- throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context);
109
- default:
110
- const parsedBody = parsedOutput.body;
111
- return throwDefaultError({
112
- output,
113
- parsedBody,
114
- errorCode,
115
- });
116
- }
117
- };
118
- const de_GetShardIteratorCommand = async (output, context) => {
119
- if (output.statusCode >= 300) {
120
- return de_GetShardIteratorCommandError(output, context);
121
- }
122
- const data = await parseBody(output.body, context);
123
- let contents = {};
124
- contents = (0, smithy_client_1._json)(data);
125
- const response = {
126
- $metadata: deserializeMetadata(output),
127
- ...contents,
128
- };
129
- return response;
130
- };
131
- exports.de_GetShardIteratorCommand = de_GetShardIteratorCommand;
132
- const de_GetShardIteratorCommandError = async (output, context) => {
133
- const parsedOutput = {
134
- ...output,
135
- body: await parseErrorBody(output.body, context),
136
- };
137
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
138
- switch (errorCode) {
139
- case "InternalServerError":
140
- case "com.amazonaws.dynamodbstreams#InternalServerError":
141
- throw await de_InternalServerErrorRes(parsedOutput, context);
142
- case "ResourceNotFoundException":
143
- case "com.amazonaws.dynamodbstreams#ResourceNotFoundException":
144
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
145
- case "TrimmedDataAccessException":
146
- case "com.amazonaws.dynamodbstreams#TrimmedDataAccessException":
147
- throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context);
148
- default:
149
- const parsedBody = parsedOutput.body;
150
- return throwDefaultError({
151
- output,
152
- parsedBody,
153
- errorCode,
154
- });
155
- }
156
- };
157
- const de_ListStreamsCommand = async (output, context) => {
158
- if (output.statusCode >= 300) {
159
- return de_ListStreamsCommandError(output, context);
160
- }
161
- const data = await parseBody(output.body, context);
162
- let contents = {};
163
- contents = (0, smithy_client_1._json)(data);
164
- const response = {
165
- $metadata: deserializeMetadata(output),
166
- ...contents,
167
- };
168
- return response;
169
- };
170
- exports.de_ListStreamsCommand = de_ListStreamsCommand;
171
- const de_ListStreamsCommandError = async (output, context) => {
172
- const parsedOutput = {
173
- ...output,
174
- body: await parseErrorBody(output.body, context),
175
- };
176
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
177
- switch (errorCode) {
178
- case "InternalServerError":
179
- case "com.amazonaws.dynamodbstreams#InternalServerError":
180
- throw await de_InternalServerErrorRes(parsedOutput, context);
181
- case "ResourceNotFoundException":
182
- case "com.amazonaws.dynamodbstreams#ResourceNotFoundException":
183
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
184
- default:
185
- const parsedBody = parsedOutput.body;
186
- return throwDefaultError({
187
- output,
188
- parsedBody,
189
- errorCode,
190
- });
191
- }
192
- };
193
- const de_ExpiredIteratorExceptionRes = async (parsedOutput, context) => {
194
- const body = parsedOutput.body;
195
- const deserialized = (0, smithy_client_1._json)(body);
196
- const exception = new models_0_1.ExpiredIteratorException({
197
- $metadata: deserializeMetadata(parsedOutput),
198
- ...deserialized,
199
- });
200
- return (0, smithy_client_1.decorateServiceException)(exception, body);
201
- };
202
- const de_InternalServerErrorRes = async (parsedOutput, context) => {
203
- const body = parsedOutput.body;
204
- const deserialized = (0, smithy_client_1._json)(body);
205
- const exception = new models_0_1.InternalServerError({
206
- $metadata: deserializeMetadata(parsedOutput),
207
- ...deserialized,
208
- });
209
- return (0, smithy_client_1.decorateServiceException)(exception, body);
210
- };
211
- const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
212
- const body = parsedOutput.body;
213
- const deserialized = (0, smithy_client_1._json)(body);
214
- const exception = new models_0_1.LimitExceededException({
215
- $metadata: deserializeMetadata(parsedOutput),
216
- ...deserialized,
217
- });
218
- return (0, smithy_client_1.decorateServiceException)(exception, body);
219
- };
220
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
221
- const body = parsedOutput.body;
222
- const deserialized = (0, smithy_client_1._json)(body);
223
- const exception = new models_0_1.ResourceNotFoundException({
224
- $metadata: deserializeMetadata(parsedOutput),
225
- ...deserialized,
226
- });
227
- return (0, smithy_client_1.decorateServiceException)(exception, body);
228
- };
229
- const de_TrimmedDataAccessExceptionRes = async (parsedOutput, context) => {
230
- const body = parsedOutput.body;
231
- const deserialized = (0, smithy_client_1._json)(body);
232
- const exception = new models_0_1.TrimmedDataAccessException({
233
- $metadata: deserializeMetadata(parsedOutput),
234
- ...deserialized,
235
- });
236
- return (0, smithy_client_1.decorateServiceException)(exception, body);
237
- };
238
- const de_AttributeMap = (output, context) => {
239
- return Object.entries(output).reduce((acc, [key, value]) => {
240
- if (value === null) {
241
- return acc;
242
- }
243
- acc[key] = de_AttributeValue((0, core_1.awsExpectUnion)(value), context);
244
- return acc;
245
- }, {});
246
- };
247
- const de_AttributeValue = (output, context) => {
248
- if (output.B != null) {
249
- return {
250
- B: context.base64Decoder(output.B),
251
- };
252
- }
253
- if ((0, smithy_client_1.expectBoolean)(output.BOOL) !== undefined) {
254
- return { BOOL: (0, smithy_client_1.expectBoolean)(output.BOOL) };
255
- }
256
- if (output.BS != null) {
257
- return {
258
- BS: de_BinarySetAttributeValue(output.BS, context),
259
- };
260
- }
261
- if (output.L != null) {
262
- return {
263
- L: de_ListAttributeValue(output.L, context),
264
- };
265
- }
266
- if (output.M != null) {
267
- return {
268
- M: de_MapAttributeValue(output.M, context),
269
- };
270
- }
271
- if ((0, smithy_client_1.expectString)(output.N) !== undefined) {
272
- return { N: (0, smithy_client_1.expectString)(output.N) };
273
- }
274
- if (output.NS != null) {
275
- return {
276
- NS: (0, smithy_client_1._json)(output.NS),
277
- };
278
- }
279
- if ((0, smithy_client_1.expectBoolean)(output.NULL) !== undefined) {
280
- return { NULL: (0, smithy_client_1.expectBoolean)(output.NULL) };
281
- }
282
- if ((0, smithy_client_1.expectString)(output.S) !== undefined) {
283
- return { S: (0, smithy_client_1.expectString)(output.S) };
284
- }
285
- if (output.SS != null) {
286
- return {
287
- SS: (0, smithy_client_1._json)(output.SS),
288
- };
289
- }
290
- return { $unknown: Object.entries(output)[0] };
291
- };
292
- const de_BinarySetAttributeValue = (output, context) => {
293
- const retVal = (output || [])
294
- .filter((e) => e != null)
295
- .map((entry) => {
296
- return context.base64Decoder(entry);
297
- });
298
- return retVal;
299
- };
300
- const de_DescribeStreamOutput = (output, context) => {
301
- return (0, smithy_client_1.take)(output, {
302
- StreamDescription: (_) => de_StreamDescription(_, context),
303
- });
304
- };
305
- const de_GetRecordsOutput = (output, context) => {
306
- return (0, smithy_client_1.take)(output, {
307
- NextShardIterator: smithy_client_1.expectString,
308
- Records: (_) => de_RecordList(_, context),
309
- });
310
- };
311
- const de_ListAttributeValue = (output, context) => {
312
- const retVal = (output || [])
313
- .filter((e) => e != null)
314
- .map((entry) => {
315
- return de_AttributeValue((0, core_1.awsExpectUnion)(entry), context);
316
- });
317
- return retVal;
318
- };
319
- const de_MapAttributeValue = (output, context) => {
320
- return Object.entries(output).reduce((acc, [key, value]) => {
321
- if (value === null) {
322
- return acc;
323
- }
324
- acc[key] = de_AttributeValue((0, core_1.awsExpectUnion)(value), context);
325
- return acc;
326
- }, {});
327
- };
328
- const de__Record = (output, context) => {
329
- return (0, smithy_client_1.take)(output, {
330
- awsRegion: smithy_client_1.expectString,
331
- dynamodb: (_) => de_StreamRecord(_, context),
332
- eventID: smithy_client_1.expectString,
333
- eventName: smithy_client_1.expectString,
334
- eventSource: smithy_client_1.expectString,
335
- eventVersion: smithy_client_1.expectString,
336
- userIdentity: smithy_client_1._json,
337
- });
338
- };
339
- const de_RecordList = (output, context) => {
340
- const retVal = (output || [])
341
- .filter((e) => e != null)
342
- .map((entry) => {
343
- return de__Record(entry, context);
344
- });
345
- return retVal;
346
- };
347
- const de_StreamDescription = (output, context) => {
348
- return (0, smithy_client_1.take)(output, {
349
- CreationRequestDateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
350
- KeySchema: smithy_client_1._json,
351
- LastEvaluatedShardId: smithy_client_1.expectString,
352
- Shards: smithy_client_1._json,
353
- StreamArn: smithy_client_1.expectString,
354
- StreamLabel: smithy_client_1.expectString,
355
- StreamStatus: smithy_client_1.expectString,
356
- StreamViewType: smithy_client_1.expectString,
357
- TableName: smithy_client_1.expectString,
358
- });
359
- };
360
- const de_StreamRecord = (output, context) => {
361
- return (0, smithy_client_1.take)(output, {
362
- ApproximateCreationDateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
363
- Keys: (_) => de_AttributeMap(_, context),
364
- NewImage: (_) => de_AttributeMap(_, context),
365
- OldImage: (_) => de_AttributeMap(_, context),
366
- SequenceNumber: smithy_client_1.expectString,
367
- SizeBytes: smithy_client_1.expectLong,
368
- StreamViewType: smithy_client_1.expectString,
369
- });
370
- };
371
- const deserializeMetadata = (output) => ({
372
- httpStatusCode: output.statusCode,
373
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
374
- extendedRequestId: output.headers["x-amz-id-2"],
375
- cfId: output.headers["x-amz-cf-id"],
376
- });
377
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
378
- const throwDefaultError = (0, smithy_client_1.withBaseException)(DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException);
379
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
380
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
381
- const contents = {
382
- protocol,
383
- hostname,
384
- port,
385
- method: "POST",
386
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
387
- headers,
388
- };
389
- if (resolvedHostname !== undefined) {
390
- contents.hostname = resolvedHostname;
391
- }
392
- if (body !== undefined) {
393
- contents.body = body;
394
- }
395
- return new protocol_http_1.HttpRequest(contents);
396
- };
397
- function sharedHeaders(operation) {
398
- return {
399
- "content-type": "application/x-amz-json-1.0",
400
- "x-amz-target": `DynamoDBStreams_20120810.${operation}`,
401
- };
402
- }
403
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
404
- if (encoded.length) {
405
- return JSON.parse(encoded);
406
- }
407
- return {};
408
- });
409
- const parseErrorBody = async (errorBody, context) => {
410
- const value = await parseBody(errorBody, context);
411
- value.message = value.message ?? value.Message;
412
- return value;
413
- };
414
- const loadRestJsonErrorCode = (output, data) => {
415
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
416
- const sanitizeErrorCode = (rawValue) => {
417
- let cleanValue = rawValue;
418
- if (typeof cleanValue === "number") {
419
- cleanValue = cleanValue.toString();
420
- }
421
- if (cleanValue.indexOf(",") >= 0) {
422
- cleanValue = cleanValue.split(",")[0];
423
- }
424
- if (cleanValue.indexOf(":") >= 0) {
425
- cleanValue = cleanValue.split(":")[0];
426
- }
427
- if (cleanValue.indexOf("#") >= 0) {
428
- cleanValue = cleanValue.split("#")[1];
429
- }
430
- return cleanValue;
431
- };
432
- const headerKey = findKey(output.headers, "x-amzn-errortype");
433
- if (headerKey !== undefined) {
434
- return sanitizeErrorCode(output.headers[headerKey]);
435
- }
436
- if (data.code !== undefined) {
437
- return sanitizeErrorCode(data.code);
438
- }
439
- if (data["__type"] !== undefined) {
440
- return sanitizeErrorCode(data["__type"]);
441
- }
442
- };
1
+ module.exports = require("../index.js");
@@ -1,22 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveRuntimeExtensions = void 0;
4
- const region_config_resolver_1 = require("@aws-sdk/region-config-resolver");
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const asPartial = (t) => t;
8
- const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
9
- const extensionConfiguration = {
10
- ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
11
- ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
12
- ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
13
- };
14
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
15
- return {
16
- ...runtimeConfig,
17
- ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
18
- ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
19
- ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
20
- };
21
- };
22
- exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
1
+ module.exports = require("./index.js");