@aws-sdk/client-ivs 3.42.0 → 3.47.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.
- package/CHANGELOG.md +50 -0
- package/README.md +10 -1
- package/dist-cjs/Ivs.js +30 -0
- package/dist-cjs/commands/GetStreamSessionCommand.js +36 -0
- package/dist-cjs/commands/ListStreamSessionsCommand.js +36 -0
- package/dist-cjs/commands/index.js +2 -0
- package/dist-cjs/endpoints.js +1 -0
- package/dist-cjs/models/models_0.js +68 -62
- package/dist-cjs/pagination/ListStreamSessionsPaginator.js +35 -0
- package/dist-cjs/pagination/index.js +1 -0
- package/dist-cjs/protocols/Aws_restJson1.js +282 -2
- package/dist-cjs/runtimeConfig.browser.js +7 -2
- package/dist-cjs/runtimeConfig.js +9 -3
- package/dist-es/Ivs.js +30 -0
- package/dist-es/commands/GetStreamSessionCommand.js +39 -0
- package/dist-es/commands/ListStreamSessionsCommand.js +39 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/endpoints.js +1 -0
- package/dist-es/models/models_0.js +44 -40
- package/dist-es/pagination/ListStreamSessionsPaginator.js +74 -0
- package/dist-es/pagination/index.js +1 -0
- package/dist-es/protocols/Aws_restJson1.js +309 -1
- package/dist-es/runtimeConfig.browser.js +12 -3
- package/dist-es/runtimeConfig.js +13 -6
- package/dist-types/Ivs.d.ts +44 -19
- package/dist-types/IvsClient.d.ts +19 -4
- package/dist-types/commands/CreateRecordingConfigurationCommand.d.ts +9 -9
- package/dist-types/commands/DeleteChannelCommand.d.ts +2 -1
- package/dist-types/commands/GetStreamSessionCommand.d.ts +35 -0
- package/dist-types/commands/ListChannelsCommand.d.ts +3 -3
- package/dist-types/commands/ListRecordingConfigurationsCommand.d.ts +2 -2
- package/dist-types/commands/ListStreamSessionsCommand.d.ts +36 -0
- package/dist-types/commands/ListStreamsCommand.d.ts +2 -2
- package/dist-types/commands/PutMetadataCommand.d.ts +1 -1
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/models/models_0.d.ts +289 -66
- package/dist-types/pagination/ListStreamSessionsPaginator.d.ts +4 -0
- package/dist-types/pagination/index.d.ts +1 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +6 -0
- package/dist-types/runtimeConfig.browser.d.ts +3 -2
- package/dist-types/runtimeConfig.d.ts +4 -3
- package/dist-types/runtimeConfig.native.d.ts +1 -0
- package/dist-types/ts3.4/Ivs.d.ts +10 -0
- package/dist-types/ts3.4/IvsClient.d.ts +7 -3
- package/dist-types/ts3.4/commands/GetStreamSessionCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListStreamSessionsCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/models/models_0.d.ts +153 -40
- package/dist-types/ts3.4/pagination/ListStreamSessionsPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/index.d.ts +1 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +6 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +3 -2
- package/dist-types/ts3.4/runtimeConfig.d.ts +4 -3
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -0
- package/package.json +38 -45
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import { SENSITIVE_STRING } from "@aws-sdk/smithy-client";
|
|
3
|
-
export var AccessDeniedException;
|
|
4
|
-
(function (AccessDeniedException) {
|
|
5
|
-
AccessDeniedException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
6
|
-
})(AccessDeniedException || (AccessDeniedException = {}));
|
|
7
3
|
export var BatchGetChannelRequest;
|
|
8
4
|
(function (BatchGetChannelRequest) {
|
|
9
5
|
BatchGetChannelRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -50,26 +46,6 @@ export var CreateChannelResponse;
|
|
|
50
46
|
(function (CreateChannelResponse) {
|
|
51
47
|
CreateChannelResponse.filterSensitiveLog = function (obj) { return (__assign(__assign({}, obj), (obj.streamKey && { streamKey: StreamKey.filterSensitiveLog(obj.streamKey) }))); };
|
|
52
48
|
})(CreateChannelResponse || (CreateChannelResponse = {}));
|
|
53
|
-
export var PendingVerification;
|
|
54
|
-
(function (PendingVerification) {
|
|
55
|
-
PendingVerification.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
56
|
-
})(PendingVerification || (PendingVerification = {}));
|
|
57
|
-
export var ResourceNotFoundException;
|
|
58
|
-
(function (ResourceNotFoundException) {
|
|
59
|
-
ResourceNotFoundException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
60
|
-
})(ResourceNotFoundException || (ResourceNotFoundException = {}));
|
|
61
|
-
export var ServiceQuotaExceededException;
|
|
62
|
-
(function (ServiceQuotaExceededException) {
|
|
63
|
-
ServiceQuotaExceededException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
64
|
-
})(ServiceQuotaExceededException || (ServiceQuotaExceededException = {}));
|
|
65
|
-
export var ValidationException;
|
|
66
|
-
(function (ValidationException) {
|
|
67
|
-
ValidationException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
68
|
-
})(ValidationException || (ValidationException = {}));
|
|
69
|
-
export var ConflictException;
|
|
70
|
-
(function (ConflictException) {
|
|
71
|
-
ConflictException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
72
|
-
})(ConflictException || (ConflictException = {}));
|
|
73
49
|
export var S3DestinationConfiguration;
|
|
74
50
|
(function (S3DestinationConfiguration) {
|
|
75
51
|
S3DestinationConfiguration.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -96,10 +72,6 @@ export var CreateRecordingConfigurationResponse;
|
|
|
96
72
|
(function (CreateRecordingConfigurationResponse) {
|
|
97
73
|
CreateRecordingConfigurationResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
98
74
|
})(CreateRecordingConfigurationResponse || (CreateRecordingConfigurationResponse = {}));
|
|
99
|
-
export var InternalServerException;
|
|
100
|
-
(function (InternalServerException) {
|
|
101
|
-
InternalServerException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
102
|
-
})(InternalServerException || (InternalServerException = {}));
|
|
103
75
|
export var CreateStreamKeyRequest;
|
|
104
76
|
(function (CreateStreamKeyRequest) {
|
|
105
77
|
CreateStreamKeyRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -156,10 +128,6 @@ export var GetRecordingConfigurationResponse;
|
|
|
156
128
|
(function (GetRecordingConfigurationResponse) {
|
|
157
129
|
GetRecordingConfigurationResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
158
130
|
})(GetRecordingConfigurationResponse || (GetRecordingConfigurationResponse = {}));
|
|
159
|
-
export var ChannelNotBroadcasting;
|
|
160
|
-
(function (ChannelNotBroadcasting) {
|
|
161
|
-
ChannelNotBroadcasting.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
162
|
-
})(ChannelNotBroadcasting || (ChannelNotBroadcasting = {}));
|
|
163
131
|
export var GetStreamRequest;
|
|
164
132
|
(function (GetStreamRequest) {
|
|
165
133
|
GetStreamRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -191,6 +159,34 @@ export var GetStreamKeyResponse;
|
|
|
191
159
|
(function (GetStreamKeyResponse) {
|
|
192
160
|
GetStreamKeyResponse.filterSensitiveLog = function (obj) { return (__assign(__assign({}, obj), (obj.streamKey && { streamKey: StreamKey.filterSensitiveLog(obj.streamKey) }))); };
|
|
193
161
|
})(GetStreamKeyResponse || (GetStreamKeyResponse = {}));
|
|
162
|
+
export var GetStreamSessionRequest;
|
|
163
|
+
(function (GetStreamSessionRequest) {
|
|
164
|
+
GetStreamSessionRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
165
|
+
})(GetStreamSessionRequest || (GetStreamSessionRequest = {}));
|
|
166
|
+
export var AudioConfiguration;
|
|
167
|
+
(function (AudioConfiguration) {
|
|
168
|
+
AudioConfiguration.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
169
|
+
})(AudioConfiguration || (AudioConfiguration = {}));
|
|
170
|
+
export var VideoConfiguration;
|
|
171
|
+
(function (VideoConfiguration) {
|
|
172
|
+
VideoConfiguration.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
173
|
+
})(VideoConfiguration || (VideoConfiguration = {}));
|
|
174
|
+
export var IngestConfiguration;
|
|
175
|
+
(function (IngestConfiguration) {
|
|
176
|
+
IngestConfiguration.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
177
|
+
})(IngestConfiguration || (IngestConfiguration = {}));
|
|
178
|
+
export var StreamEvent;
|
|
179
|
+
(function (StreamEvent) {
|
|
180
|
+
StreamEvent.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
181
|
+
})(StreamEvent || (StreamEvent = {}));
|
|
182
|
+
export var StreamSession;
|
|
183
|
+
(function (StreamSession) {
|
|
184
|
+
StreamSession.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
185
|
+
})(StreamSession || (StreamSession = {}));
|
|
186
|
+
export var GetStreamSessionResponse;
|
|
187
|
+
(function (GetStreamSessionResponse) {
|
|
188
|
+
GetStreamSessionResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
189
|
+
})(GetStreamSessionResponse || (GetStreamSessionResponse = {}));
|
|
194
190
|
export var ImportPlaybackKeyPairRequest;
|
|
195
191
|
(function (ImportPlaybackKeyPairRequest) {
|
|
196
192
|
ImportPlaybackKeyPairRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -247,6 +243,10 @@ export var ListStreamKeysResponse;
|
|
|
247
243
|
(function (ListStreamKeysResponse) {
|
|
248
244
|
ListStreamKeysResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
249
245
|
})(ListStreamKeysResponse || (ListStreamKeysResponse = {}));
|
|
246
|
+
export var StreamFilters;
|
|
247
|
+
(function (StreamFilters) {
|
|
248
|
+
StreamFilters.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
249
|
+
})(StreamFilters || (StreamFilters = {}));
|
|
250
250
|
export var ListStreamsRequest;
|
|
251
251
|
(function (ListStreamsRequest) {
|
|
252
252
|
ListStreamsRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -259,6 +259,18 @@ export var ListStreamsResponse;
|
|
|
259
259
|
(function (ListStreamsResponse) {
|
|
260
260
|
ListStreamsResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
261
261
|
})(ListStreamsResponse || (ListStreamsResponse = {}));
|
|
262
|
+
export var ListStreamSessionsRequest;
|
|
263
|
+
(function (ListStreamSessionsRequest) {
|
|
264
|
+
ListStreamSessionsRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
265
|
+
})(ListStreamSessionsRequest || (ListStreamSessionsRequest = {}));
|
|
266
|
+
export var StreamSessionSummary;
|
|
267
|
+
(function (StreamSessionSummary) {
|
|
268
|
+
StreamSessionSummary.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
269
|
+
})(StreamSessionSummary || (StreamSessionSummary = {}));
|
|
270
|
+
export var ListStreamSessionsResponse;
|
|
271
|
+
(function (ListStreamSessionsResponse) {
|
|
272
|
+
ListStreamSessionsResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
273
|
+
})(ListStreamSessionsResponse || (ListStreamSessionsResponse = {}));
|
|
262
274
|
export var ListTagsForResourceRequest;
|
|
263
275
|
(function (ListTagsForResourceRequest) {
|
|
264
276
|
ListTagsForResourceRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -271,10 +283,6 @@ export var PutMetadataRequest;
|
|
|
271
283
|
(function (PutMetadataRequest) {
|
|
272
284
|
PutMetadataRequest.filterSensitiveLog = function (obj) { return (__assign(__assign({}, obj), (obj.metadata && { metadata: SENSITIVE_STRING }))); };
|
|
273
285
|
})(PutMetadataRequest || (PutMetadataRequest = {}));
|
|
274
|
-
export var ThrottlingException;
|
|
275
|
-
(function (ThrottlingException) {
|
|
276
|
-
ThrottlingException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
277
|
-
})(ThrottlingException || (ThrottlingException = {}));
|
|
278
286
|
export var StopStreamRequest;
|
|
279
287
|
(function (StopStreamRequest) {
|
|
280
288
|
StopStreamRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -283,10 +291,6 @@ export var StopStreamResponse;
|
|
|
283
291
|
(function (StopStreamResponse) {
|
|
284
292
|
StopStreamResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
285
293
|
})(StopStreamResponse || (StopStreamResponse = {}));
|
|
286
|
-
export var StreamUnavailable;
|
|
287
|
-
(function (StreamUnavailable) {
|
|
288
|
-
StreamUnavailable.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
289
|
-
})(StreamUnavailable || (StreamUnavailable = {}));
|
|
290
294
|
export var TagResourceRequest;
|
|
291
295
|
(function (TagResourceRequest) {
|
|
292
296
|
TagResourceRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
|
|
2
|
+
import { ListStreamSessionsCommand, } from "../commands/ListStreamSessionsCommand";
|
|
3
|
+
import { Ivs } from "../Ivs";
|
|
4
|
+
import { IvsClient } from "../IvsClient";
|
|
5
|
+
var makePagedClientRequest = function (client, input) {
|
|
6
|
+
var args = [];
|
|
7
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
8
|
+
args[_i - 2] = arguments[_i];
|
|
9
|
+
}
|
|
10
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
11
|
+
return __generator(this, function (_a) {
|
|
12
|
+
switch (_a.label) {
|
|
13
|
+
case 0: return [4, client.send.apply(client, __spreadArray([new ListStreamSessionsCommand(input)], __read(args)))];
|
|
14
|
+
case 1: return [2, _a.sent()];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var makePagedRequest = function (client, input) {
|
|
20
|
+
var args = [];
|
|
21
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
22
|
+
args[_i - 2] = arguments[_i];
|
|
23
|
+
}
|
|
24
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
25
|
+
return __generator(this, function (_a) {
|
|
26
|
+
switch (_a.label) {
|
|
27
|
+
case 0: return [4, client.listStreamSessions.apply(client, __spreadArray([input], __read(args)))];
|
|
28
|
+
case 1: return [2, _a.sent()];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export function paginateListStreamSessions(config, input) {
|
|
34
|
+
var additionalArguments = [];
|
|
35
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
36
|
+
additionalArguments[_i - 2] = arguments[_i];
|
|
37
|
+
}
|
|
38
|
+
return __asyncGenerator(this, arguments, function paginateListStreamSessions_1() {
|
|
39
|
+
var token, hasNext, page;
|
|
40
|
+
return __generator(this, function (_a) {
|
|
41
|
+
switch (_a.label) {
|
|
42
|
+
case 0:
|
|
43
|
+
token = config.startingToken || undefined;
|
|
44
|
+
hasNext = true;
|
|
45
|
+
_a.label = 1;
|
|
46
|
+
case 1:
|
|
47
|
+
if (!hasNext) return [3, 9];
|
|
48
|
+
input.nextToken = token;
|
|
49
|
+
input["maxResults"] = config.pageSize;
|
|
50
|
+
if (!(config.client instanceof Ivs)) return [3, 3];
|
|
51
|
+
return [4, __await(makePagedRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments))))];
|
|
52
|
+
case 2:
|
|
53
|
+
page = _a.sent();
|
|
54
|
+
return [3, 6];
|
|
55
|
+
case 3:
|
|
56
|
+
if (!(config.client instanceof IvsClient)) return [3, 5];
|
|
57
|
+
return [4, __await(makePagedClientRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments))))];
|
|
58
|
+
case 4:
|
|
59
|
+
page = _a.sent();
|
|
60
|
+
return [3, 6];
|
|
61
|
+
case 5: throw new Error("Invalid client, expected Ivs | IvsClient");
|
|
62
|
+
case 6: return [4, __await(page)];
|
|
63
|
+
case 7: return [4, _a.sent()];
|
|
64
|
+
case 8:
|
|
65
|
+
_a.sent();
|
|
66
|
+
token = page.nextToken;
|
|
67
|
+
hasNext = !!token;
|
|
68
|
+
return [3, 1];
|
|
69
|
+
case 9: return [4, __await(undefined)];
|
|
70
|
+
case 10: return [2, _a.sent()];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
@@ -3,4 +3,5 @@ export * from "./ListChannelsPaginator";
|
|
|
3
3
|
export * from "./ListPlaybackKeyPairsPaginator";
|
|
4
4
|
export * from "./ListRecordingConfigurationsPaginator";
|
|
5
5
|
export * from "./ListStreamKeysPaginator";
|
|
6
|
+
export * from "./ListStreamSessionsPaginator";
|
|
6
7
|
export * from "./ListStreamsPaginator";
|
|
@@ -343,6 +343,30 @@ export var serializeAws_restJson1GetStreamKeyCommand = function (input, context)
|
|
|
343
343
|
}
|
|
344
344
|
});
|
|
345
345
|
}); };
|
|
346
|
+
export var serializeAws_restJson1GetStreamSessionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
347
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
348
|
+
return __generator(this, function (_c) {
|
|
349
|
+
switch (_c.label) {
|
|
350
|
+
case 0: return [4, context.endpoint()];
|
|
351
|
+
case 1:
|
|
352
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
353
|
+
headers = {
|
|
354
|
+
"content-type": "application/json",
|
|
355
|
+
};
|
|
356
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/GetStreamSession";
|
|
357
|
+
body = JSON.stringify(__assign(__assign({}, (input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn })), (input.streamId !== undefined && input.streamId !== null && { streamId: input.streamId })));
|
|
358
|
+
return [2, new __HttpRequest({
|
|
359
|
+
protocol: protocol,
|
|
360
|
+
hostname: hostname,
|
|
361
|
+
port: port,
|
|
362
|
+
method: "POST",
|
|
363
|
+
headers: headers,
|
|
364
|
+
path: resolvedPath,
|
|
365
|
+
body: body,
|
|
366
|
+
})];
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}); };
|
|
346
370
|
export var serializeAws_restJson1ImportPlaybackKeyPairCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
347
371
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
348
372
|
return __generator(this, function (_c) {
|
|
@@ -478,7 +502,32 @@ export var serializeAws_restJson1ListStreamsCommand = function (input, context)
|
|
|
478
502
|
"content-type": "application/json",
|
|
479
503
|
};
|
|
480
504
|
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/ListStreams";
|
|
481
|
-
body = JSON.stringify(__assign(__assign(
|
|
505
|
+
body = JSON.stringify(__assign(__assign(__assign({}, (input.filterBy !== undefined &&
|
|
506
|
+
input.filterBy !== null && { filterBy: serializeAws_restJson1StreamFilters(input.filterBy, context) })), (input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults })), (input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken })));
|
|
507
|
+
return [2, new __HttpRequest({
|
|
508
|
+
protocol: protocol,
|
|
509
|
+
hostname: hostname,
|
|
510
|
+
port: port,
|
|
511
|
+
method: "POST",
|
|
512
|
+
headers: headers,
|
|
513
|
+
path: resolvedPath,
|
|
514
|
+
body: body,
|
|
515
|
+
})];
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
}); };
|
|
519
|
+
export var serializeAws_restJson1ListStreamSessionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
520
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
521
|
+
return __generator(this, function (_c) {
|
|
522
|
+
switch (_c.label) {
|
|
523
|
+
case 0: return [4, context.endpoint()];
|
|
524
|
+
case 1:
|
|
525
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
526
|
+
headers = {
|
|
527
|
+
"content-type": "application/json",
|
|
528
|
+
};
|
|
529
|
+
resolvedPath = "" + ((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/ListStreamSessions";
|
|
530
|
+
body = JSON.stringify(__assign(__assign(__assign({}, (input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn })), (input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults })), (input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken })));
|
|
482
531
|
return [2, new __HttpRequest({
|
|
483
532
|
protocol: protocol,
|
|
484
533
|
hostname: hostname,
|
|
@@ -1806,6 +1855,84 @@ var deserializeAws_restJson1GetStreamKeyCommandError = function (output, context
|
|
|
1806
1855
|
}
|
|
1807
1856
|
});
|
|
1808
1857
|
}); };
|
|
1858
|
+
export var deserializeAws_restJson1GetStreamSessionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1859
|
+
var contents, data, _a, _b;
|
|
1860
|
+
return __generator(this, function (_c) {
|
|
1861
|
+
switch (_c.label) {
|
|
1862
|
+
case 0:
|
|
1863
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1864
|
+
return [2, deserializeAws_restJson1GetStreamSessionCommandError(output, context)];
|
|
1865
|
+
}
|
|
1866
|
+
contents = {
|
|
1867
|
+
$metadata: deserializeMetadata(output),
|
|
1868
|
+
streamSession: undefined,
|
|
1869
|
+
};
|
|
1870
|
+
_a = __expectNonNull;
|
|
1871
|
+
_b = __expectObject;
|
|
1872
|
+
return [4, parseBody(output.body, context)];
|
|
1873
|
+
case 1:
|
|
1874
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
1875
|
+
if (data.streamSession !== undefined && data.streamSession !== null) {
|
|
1876
|
+
contents.streamSession = deserializeAws_restJson1StreamSession(data.streamSession, context);
|
|
1877
|
+
}
|
|
1878
|
+
return [2, Promise.resolve(contents)];
|
|
1879
|
+
}
|
|
1880
|
+
});
|
|
1881
|
+
}); };
|
|
1882
|
+
var deserializeAws_restJson1GetStreamSessionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1883
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, parsedBody, message;
|
|
1884
|
+
var _f;
|
|
1885
|
+
return __generator(this, function (_g) {
|
|
1886
|
+
switch (_g.label) {
|
|
1887
|
+
case 0:
|
|
1888
|
+
_a = [__assign({}, output)];
|
|
1889
|
+
_f = {};
|
|
1890
|
+
return [4, parseBody(output.body, context)];
|
|
1891
|
+
case 1:
|
|
1892
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_f.body = _g.sent(), _f)]));
|
|
1893
|
+
errorCode = "UnknownError";
|
|
1894
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1895
|
+
_b = errorCode;
|
|
1896
|
+
switch (_b) {
|
|
1897
|
+
case "AccessDeniedException": return [3, 2];
|
|
1898
|
+
case "com.amazonaws.ivs#AccessDeniedException": return [3, 2];
|
|
1899
|
+
case "ResourceNotFoundException": return [3, 4];
|
|
1900
|
+
case "com.amazonaws.ivs#ResourceNotFoundException": return [3, 4];
|
|
1901
|
+
case "ValidationException": return [3, 6];
|
|
1902
|
+
case "com.amazonaws.ivs#ValidationException": return [3, 6];
|
|
1903
|
+
}
|
|
1904
|
+
return [3, 8];
|
|
1905
|
+
case 2:
|
|
1906
|
+
_c = [{}];
|
|
1907
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
1908
|
+
case 3:
|
|
1909
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1910
|
+
return [3, 9];
|
|
1911
|
+
case 4:
|
|
1912
|
+
_d = [{}];
|
|
1913
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1914
|
+
case 5:
|
|
1915
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1916
|
+
return [3, 9];
|
|
1917
|
+
case 6:
|
|
1918
|
+
_e = [{}];
|
|
1919
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
1920
|
+
case 7:
|
|
1921
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1922
|
+
return [3, 9];
|
|
1923
|
+
case 8:
|
|
1924
|
+
parsedBody = parsedOutput.body;
|
|
1925
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1926
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1927
|
+
_g.label = 9;
|
|
1928
|
+
case 9:
|
|
1929
|
+
message = response.message || response.Message || errorCode;
|
|
1930
|
+
response.message = message;
|
|
1931
|
+
delete response.Message;
|
|
1932
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1933
|
+
}
|
|
1934
|
+
});
|
|
1935
|
+
}); };
|
|
1809
1936
|
export var deserializeAws_restJson1ImportPlaybackKeyPairCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1810
1937
|
var contents, data, _a, _b;
|
|
1811
1938
|
return __generator(this, function (_c) {
|
|
@@ -2286,6 +2413,88 @@ var deserializeAws_restJson1ListStreamsCommandError = function (output, context)
|
|
|
2286
2413
|
}
|
|
2287
2414
|
});
|
|
2288
2415
|
}); };
|
|
2416
|
+
export var deserializeAws_restJson1ListStreamSessionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2417
|
+
var contents, data, _a, _b;
|
|
2418
|
+
return __generator(this, function (_c) {
|
|
2419
|
+
switch (_c.label) {
|
|
2420
|
+
case 0:
|
|
2421
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2422
|
+
return [2, deserializeAws_restJson1ListStreamSessionsCommandError(output, context)];
|
|
2423
|
+
}
|
|
2424
|
+
contents = {
|
|
2425
|
+
$metadata: deserializeMetadata(output),
|
|
2426
|
+
nextToken: undefined,
|
|
2427
|
+
streamSessions: undefined,
|
|
2428
|
+
};
|
|
2429
|
+
_a = __expectNonNull;
|
|
2430
|
+
_b = __expectObject;
|
|
2431
|
+
return [4, parseBody(output.body, context)];
|
|
2432
|
+
case 1:
|
|
2433
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
2434
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2435
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
2436
|
+
}
|
|
2437
|
+
if (data.streamSessions !== undefined && data.streamSessions !== null) {
|
|
2438
|
+
contents.streamSessions = deserializeAws_restJson1StreamSessionList(data.streamSessions, context);
|
|
2439
|
+
}
|
|
2440
|
+
return [2, Promise.resolve(contents)];
|
|
2441
|
+
}
|
|
2442
|
+
});
|
|
2443
|
+
}); };
|
|
2444
|
+
var deserializeAws_restJson1ListStreamSessionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2445
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, parsedBody, message;
|
|
2446
|
+
var _f;
|
|
2447
|
+
return __generator(this, function (_g) {
|
|
2448
|
+
switch (_g.label) {
|
|
2449
|
+
case 0:
|
|
2450
|
+
_a = [__assign({}, output)];
|
|
2451
|
+
_f = {};
|
|
2452
|
+
return [4, parseBody(output.body, context)];
|
|
2453
|
+
case 1:
|
|
2454
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_f.body = _g.sent(), _f)]));
|
|
2455
|
+
errorCode = "UnknownError";
|
|
2456
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2457
|
+
_b = errorCode;
|
|
2458
|
+
switch (_b) {
|
|
2459
|
+
case "AccessDeniedException": return [3, 2];
|
|
2460
|
+
case "com.amazonaws.ivs#AccessDeniedException": return [3, 2];
|
|
2461
|
+
case "ResourceNotFoundException": return [3, 4];
|
|
2462
|
+
case "com.amazonaws.ivs#ResourceNotFoundException": return [3, 4];
|
|
2463
|
+
case "ValidationException": return [3, 6];
|
|
2464
|
+
case "com.amazonaws.ivs#ValidationException": return [3, 6];
|
|
2465
|
+
}
|
|
2466
|
+
return [3, 8];
|
|
2467
|
+
case 2:
|
|
2468
|
+
_c = [{}];
|
|
2469
|
+
return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
2470
|
+
case 3:
|
|
2471
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2472
|
+
return [3, 9];
|
|
2473
|
+
case 4:
|
|
2474
|
+
_d = [{}];
|
|
2475
|
+
return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
2476
|
+
case 5:
|
|
2477
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2478
|
+
return [3, 9];
|
|
2479
|
+
case 6:
|
|
2480
|
+
_e = [{}];
|
|
2481
|
+
return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
2482
|
+
case 7:
|
|
2483
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
2484
|
+
return [3, 9];
|
|
2485
|
+
case 8:
|
|
2486
|
+
parsedBody = parsedOutput.body;
|
|
2487
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2488
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
2489
|
+
_g.label = 9;
|
|
2490
|
+
case 9:
|
|
2491
|
+
message = response.message || response.Message || errorCode;
|
|
2492
|
+
response.message = message;
|
|
2493
|
+
delete response.Message;
|
|
2494
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
2495
|
+
}
|
|
2496
|
+
});
|
|
2497
|
+
}); };
|
|
2289
2498
|
export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2290
2499
|
var contents, data, _a, _b;
|
|
2291
2500
|
return __generator(this, function (_c) {
|
|
@@ -2955,6 +3164,9 @@ var serializeAws_restJson1DestinationConfiguration = function (input, context) {
|
|
|
2955
3164
|
var serializeAws_restJson1S3DestinationConfiguration = function (input, context) {
|
|
2956
3165
|
return __assign({}, (input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }));
|
|
2957
3166
|
};
|
|
3167
|
+
var serializeAws_restJson1StreamFilters = function (input, context) {
|
|
3168
|
+
return __assign({}, (input.health !== undefined && input.health !== null && { health: input.health }));
|
|
3169
|
+
};
|
|
2958
3170
|
var serializeAws_restJson1StreamKeyArnList = function (input, context) {
|
|
2959
3171
|
return input
|
|
2960
3172
|
.filter(function (e) { return e != null; })
|
|
@@ -2975,6 +3187,14 @@ var serializeAws_restJson1Tags = function (input, context) {
|
|
|
2975
3187
|
return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
|
|
2976
3188
|
}, {});
|
|
2977
3189
|
};
|
|
3190
|
+
var deserializeAws_restJson1AudioConfiguration = function (output, context) {
|
|
3191
|
+
return {
|
|
3192
|
+
channels: __expectLong(output.channels),
|
|
3193
|
+
codec: __expectString(output.codec),
|
|
3194
|
+
sampleRate: __expectLong(output.sampleRate),
|
|
3195
|
+
targetBitrate: __expectLong(output.targetBitrate),
|
|
3196
|
+
};
|
|
3197
|
+
};
|
|
2978
3198
|
var deserializeAws_restJson1BatchError = function (output, context) {
|
|
2979
3199
|
return {
|
|
2980
3200
|
arn: __expectString(output.arn),
|
|
@@ -3046,6 +3266,16 @@ var deserializeAws_restJson1DestinationConfiguration = function (output, context
|
|
|
3046
3266
|
: undefined,
|
|
3047
3267
|
};
|
|
3048
3268
|
};
|
|
3269
|
+
var deserializeAws_restJson1IngestConfiguration = function (output, context) {
|
|
3270
|
+
return {
|
|
3271
|
+
audio: output.audio !== undefined && output.audio !== null
|
|
3272
|
+
? deserializeAws_restJson1AudioConfiguration(output.audio, context)
|
|
3273
|
+
: undefined,
|
|
3274
|
+
video: output.video !== undefined && output.video !== null
|
|
3275
|
+
? deserializeAws_restJson1VideoConfiguration(output.video, context)
|
|
3276
|
+
: undefined,
|
|
3277
|
+
};
|
|
3278
|
+
};
|
|
3049
3279
|
var deserializeAws_restJson1PlaybackKeyPair = function (output, context) {
|
|
3050
3280
|
return {
|
|
3051
3281
|
arn: __expectString(output.arn),
|
|
@@ -3125,9 +3355,29 @@ var deserializeAws_restJson1_Stream = function (output, context) {
|
|
|
3125
3355
|
? __expectNonNull(__parseRfc3339DateTime(output.startTime))
|
|
3126
3356
|
: undefined,
|
|
3127
3357
|
state: __expectString(output.state),
|
|
3358
|
+
streamId: __expectString(output.streamId),
|
|
3128
3359
|
viewerCount: __expectLong(output.viewerCount),
|
|
3129
3360
|
};
|
|
3130
3361
|
};
|
|
3362
|
+
var deserializeAws_restJson1StreamEvent = function (output, context) {
|
|
3363
|
+
return {
|
|
3364
|
+
eventTime: output.eventTime !== undefined && output.eventTime !== null
|
|
3365
|
+
? __expectNonNull(__parseRfc3339DateTime(output.eventTime))
|
|
3366
|
+
: undefined,
|
|
3367
|
+
name: __expectString(output.name),
|
|
3368
|
+
type: __expectString(output.type),
|
|
3369
|
+
};
|
|
3370
|
+
};
|
|
3371
|
+
var deserializeAws_restJson1StreamEvents = function (output, context) {
|
|
3372
|
+
return (output || [])
|
|
3373
|
+
.filter(function (e) { return e != null; })
|
|
3374
|
+
.map(function (entry) {
|
|
3375
|
+
if (entry === null) {
|
|
3376
|
+
return null;
|
|
3377
|
+
}
|
|
3378
|
+
return deserializeAws_restJson1StreamEvent(entry, context);
|
|
3379
|
+
});
|
|
3380
|
+
};
|
|
3131
3381
|
var deserializeAws_restJson1StreamKey = function (output, context) {
|
|
3132
3382
|
return {
|
|
3133
3383
|
arn: __expectString(output.arn),
|
|
@@ -3177,6 +3427,51 @@ var deserializeAws_restJson1StreamList = function (output, context) {
|
|
|
3177
3427
|
return deserializeAws_restJson1StreamSummary(entry, context);
|
|
3178
3428
|
});
|
|
3179
3429
|
};
|
|
3430
|
+
var deserializeAws_restJson1StreamSession = function (output, context) {
|
|
3431
|
+
return {
|
|
3432
|
+
channel: output.channel !== undefined && output.channel !== null
|
|
3433
|
+
? deserializeAws_restJson1Channel(output.channel, context)
|
|
3434
|
+
: undefined,
|
|
3435
|
+
endTime: output.endTime !== undefined && output.endTime !== null
|
|
3436
|
+
? __expectNonNull(__parseRfc3339DateTime(output.endTime))
|
|
3437
|
+
: undefined,
|
|
3438
|
+
ingestConfiguration: output.ingestConfiguration !== undefined && output.ingestConfiguration !== null
|
|
3439
|
+
? deserializeAws_restJson1IngestConfiguration(output.ingestConfiguration, context)
|
|
3440
|
+
: undefined,
|
|
3441
|
+
recordingConfiguration: output.recordingConfiguration !== undefined && output.recordingConfiguration !== null
|
|
3442
|
+
? deserializeAws_restJson1RecordingConfiguration(output.recordingConfiguration, context)
|
|
3443
|
+
: undefined,
|
|
3444
|
+
startTime: output.startTime !== undefined && output.startTime !== null
|
|
3445
|
+
? __expectNonNull(__parseRfc3339DateTime(output.startTime))
|
|
3446
|
+
: undefined,
|
|
3447
|
+
streamId: __expectString(output.streamId),
|
|
3448
|
+
truncatedEvents: output.truncatedEvents !== undefined && output.truncatedEvents !== null
|
|
3449
|
+
? deserializeAws_restJson1StreamEvents(output.truncatedEvents, context)
|
|
3450
|
+
: undefined,
|
|
3451
|
+
};
|
|
3452
|
+
};
|
|
3453
|
+
var deserializeAws_restJson1StreamSessionList = function (output, context) {
|
|
3454
|
+
return (output || [])
|
|
3455
|
+
.filter(function (e) { return e != null; })
|
|
3456
|
+
.map(function (entry) {
|
|
3457
|
+
if (entry === null) {
|
|
3458
|
+
return null;
|
|
3459
|
+
}
|
|
3460
|
+
return deserializeAws_restJson1StreamSessionSummary(entry, context);
|
|
3461
|
+
});
|
|
3462
|
+
};
|
|
3463
|
+
var deserializeAws_restJson1StreamSessionSummary = function (output, context) {
|
|
3464
|
+
return {
|
|
3465
|
+
endTime: output.endTime !== undefined && output.endTime !== null
|
|
3466
|
+
? __expectNonNull(__parseRfc3339DateTime(output.endTime))
|
|
3467
|
+
: undefined,
|
|
3468
|
+
hasErrorEvent: __expectBoolean(output.hasErrorEvent),
|
|
3469
|
+
startTime: output.startTime !== undefined && output.startTime !== null
|
|
3470
|
+
? __expectNonNull(__parseRfc3339DateTime(output.startTime))
|
|
3471
|
+
: undefined,
|
|
3472
|
+
streamId: __expectString(output.streamId),
|
|
3473
|
+
};
|
|
3474
|
+
};
|
|
3180
3475
|
var deserializeAws_restJson1StreamSummary = function (output, context) {
|
|
3181
3476
|
return {
|
|
3182
3477
|
channelArn: __expectString(output.channelArn),
|
|
@@ -3185,6 +3480,7 @@ var deserializeAws_restJson1StreamSummary = function (output, context) {
|
|
|
3185
3480
|
? __expectNonNull(__parseRfc3339DateTime(output.startTime))
|
|
3186
3481
|
: undefined,
|
|
3187
3482
|
state: __expectString(output.state),
|
|
3483
|
+
streamId: __expectString(output.streamId),
|
|
3188
3484
|
viewerCount: __expectLong(output.viewerCount),
|
|
3189
3485
|
};
|
|
3190
3486
|
};
|
|
@@ -3198,6 +3494,18 @@ var deserializeAws_restJson1Tags = function (output, context) {
|
|
|
3198
3494
|
return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
|
|
3199
3495
|
}, {});
|
|
3200
3496
|
};
|
|
3497
|
+
var deserializeAws_restJson1VideoConfiguration = function (output, context) {
|
|
3498
|
+
return {
|
|
3499
|
+
avcLevel: __expectString(output.avcLevel),
|
|
3500
|
+
avcProfile: __expectString(output.avcProfile),
|
|
3501
|
+
codec: __expectString(output.codec),
|
|
3502
|
+
encoder: __expectString(output.encoder),
|
|
3503
|
+
targetBitrate: __expectLong(output.targetBitrate),
|
|
3504
|
+
targetFramerate: __expectLong(output.targetFramerate),
|
|
3505
|
+
videoHeight: __expectLong(output.videoHeight),
|
|
3506
|
+
videoWidth: __expectLong(output.videoWidth),
|
|
3507
|
+
};
|
|
3508
|
+
};
|
|
3201
3509
|
var deserializeMetadata = function (output) {
|
|
3202
3510
|
var _a;
|
|
3203
3511
|
return ({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
2
|
import packageInfo from "../package.json";
|
|
3
3
|
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
4
4
|
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
|
|
5
|
-
import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
|
|
5
|
+
import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
|
|
6
6
|
import { invalidProvider } from "@aws-sdk/invalid-dependency";
|
|
7
7
|
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
|
|
8
8
|
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
|
|
@@ -10,8 +10,17 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-browser";
|
|
|
10
10
|
import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
|
|
11
11
|
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
|
|
12
12
|
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
13
|
+
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
|
|
14
|
+
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";
|
|
13
15
|
export var getRuntimeConfig = function (config) {
|
|
14
16
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
17
|
+
var defaultsMode = resolveDefaultsModeConfig(config);
|
|
18
|
+
var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
|
|
15
19
|
var clientSharedValues = getSharedRuntimeConfig(config);
|
|
16
|
-
return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "browser", base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : (function (_) { return function () { return Promise.reject(new Error("Credential is missing")); }; }), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : DEFAULT_MAX_ATTEMPTS, region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : invalidProvider("Region is missing"), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new
|
|
20
|
+
return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "browser", defaultsMode: defaultsMode, base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : (function (_) { return function () { return Promise.reject(new Error("Credential is missing")); }; }), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : DEFAULT_MAX_ATTEMPTS, region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : invalidProvider("Region is missing"), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new RequestHandler(defaultConfigProvider), retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : (function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
21
|
+
switch (_a.label) {
|
|
22
|
+
case 0: return [4, defaultConfigProvider()];
|
|
23
|
+
case 1: return [2, (_a.sent()).retryMode || DEFAULT_RETRY_MODE];
|
|
24
|
+
}
|
|
25
|
+
}); }); }), sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : Sha256, streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : streamCollector, useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : (function () { return Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT); }), useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : (function () { return Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT); }), utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : fromUtf8, utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : toUtf8 });
|
|
17
26
|
};
|