@aws-sdk/client-connect-contact-lens 3.183.0 → 3.186.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 +19 -0
- package/dist-cjs/protocols/Aws_restJson1.js +2 -2
- package/dist-es/ConnectContactLens.js +13 -6
- package/dist-es/ConnectContactLensClient.js +28 -22
- package/dist-es/commands/ListRealtimeContactAnalysisSegmentsCommand.js +28 -21
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/ConnectContactLensServiceException.js +10 -5
- package/dist-es/models/models_0.js +70 -87
- package/dist-es/pagination/ListRealtimeContactAnalysisSegmentsPaginator.js +68 -25
- package/dist-es/protocols/Aws_restJson1.js +228 -182
- package/dist-es/runtimeConfig.browser.js +12 -26
- package/dist-es/runtimeConfig.js +12 -30
- package/dist-es/runtimeConfig.native.js +5 -8
- package/dist-es/runtimeConfig.shared.js +11 -8
- package/package.json +33 -33
|
@@ -1,141 +1,170 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
1
2
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
4
|
import { ConnectContactLensServiceException as __BaseException } from "../models/ConnectContactLensServiceException";
|
|
4
5
|
import { AccessDeniedException, InternalServiceException, InvalidRequestException, ResourceNotFoundException, ThrottlingException, } from "../models/models_0";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
export var serializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
8
|
+
return __generator(this, function (_c) {
|
|
9
|
+
switch (_c.label) {
|
|
10
|
+
case 0: return [4, context.endpoint()];
|
|
11
|
+
case 1:
|
|
12
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
13
|
+
headers = {
|
|
14
|
+
"content-type": "application/json",
|
|
15
|
+
};
|
|
16
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
17
|
+
"/realtime-contact-analysis/analysis-segments";
|
|
18
|
+
body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.ContactId != null && { ContactId: input.ContactId })), (input.InstanceId != null && { InstanceId: input.InstanceId })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })));
|
|
19
|
+
return [2, new __HttpRequest({
|
|
20
|
+
protocol: protocol,
|
|
21
|
+
hostname: hostname,
|
|
22
|
+
port: port,
|
|
23
|
+
method: "POST",
|
|
24
|
+
headers: headers,
|
|
25
|
+
path: resolvedPath,
|
|
26
|
+
body: body,
|
|
27
|
+
})];
|
|
28
|
+
}
|
|
18
29
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
}); };
|
|
31
|
+
export var deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
32
|
+
var contents, data, _a, _b;
|
|
33
|
+
return __generator(this, function (_c) {
|
|
34
|
+
switch (_c.label) {
|
|
35
|
+
case 0:
|
|
36
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
37
|
+
return [2, deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommandError(output, context)];
|
|
38
|
+
}
|
|
39
|
+
contents = map({
|
|
40
|
+
$metadata: deserializeMetadata(output),
|
|
41
|
+
});
|
|
42
|
+
_a = __expectNonNull;
|
|
43
|
+
_b = __expectObject;
|
|
44
|
+
return [4, parseBody(output.body, context)];
|
|
45
|
+
case 1:
|
|
46
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
47
|
+
if (data.NextToken != null) {
|
|
48
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
49
|
+
}
|
|
50
|
+
if (data.Segments != null) {
|
|
51
|
+
contents.Segments = deserializeAws_restJson1RealtimeContactAnalysisSegments(data.Segments, context);
|
|
52
|
+
}
|
|
53
|
+
return [2, contents];
|
|
54
|
+
}
|
|
27
55
|
});
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
56
|
+
}); };
|
|
57
|
+
var deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
59
|
+
var _c;
|
|
60
|
+
return __generator(this, function (_d) {
|
|
61
|
+
switch (_d.label) {
|
|
62
|
+
case 0:
|
|
63
|
+
_a = [__assign({}, output)];
|
|
64
|
+
_c = {};
|
|
65
|
+
return [4, parseErrorBody(output.body, context)];
|
|
66
|
+
case 1:
|
|
67
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
68
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
69
|
+
_b = errorCode;
|
|
70
|
+
switch (_b) {
|
|
71
|
+
case "AccessDeniedException": return [3, 2];
|
|
72
|
+
case "com.amazonaws.connectcontactlens#AccessDeniedException": return [3, 2];
|
|
73
|
+
case "InternalServiceException": return [3, 4];
|
|
74
|
+
case "com.amazonaws.connectcontactlens#InternalServiceException": return [3, 4];
|
|
75
|
+
case "InvalidRequestException": return [3, 6];
|
|
76
|
+
case "com.amazonaws.connectcontactlens#InvalidRequestException": return [3, 6];
|
|
77
|
+
case "ResourceNotFoundException": return [3, 8];
|
|
78
|
+
case "com.amazonaws.connectcontactlens#ResourceNotFoundException": return [3, 8];
|
|
79
|
+
case "ThrottlingException": return [3, 10];
|
|
80
|
+
case "com.amazonaws.connectcontactlens#ThrottlingException": return [3, 10];
|
|
81
|
+
}
|
|
82
|
+
return [3, 12];
|
|
83
|
+
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
84
|
+
case 3: throw _d.sent();
|
|
85
|
+
case 4: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
|
|
86
|
+
case 5: throw _d.sent();
|
|
87
|
+
case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
88
|
+
case 7: throw _d.sent();
|
|
89
|
+
case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
90
|
+
case 9: throw _d.sent();
|
|
91
|
+
case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
92
|
+
case 11: throw _d.sent();
|
|
93
|
+
case 12:
|
|
94
|
+
parsedBody = parsedOutput.body;
|
|
95
|
+
throwDefaultError({
|
|
96
|
+
output: output,
|
|
97
|
+
parsedBody: parsedBody,
|
|
98
|
+
exceptionCtor: __BaseException,
|
|
99
|
+
errorCode: errorCode,
|
|
100
|
+
});
|
|
101
|
+
_d.label = 13;
|
|
102
|
+
case 13: return [2];
|
|
103
|
+
}
|
|
35
104
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
contents
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
body: await parseErrorBody(output.body, context),
|
|
49
|
-
};
|
|
50
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
51
|
-
switch (errorCode) {
|
|
52
|
-
case "AccessDeniedException":
|
|
53
|
-
case "com.amazonaws.connectcontactlens#AccessDeniedException":
|
|
54
|
-
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
55
|
-
case "InternalServiceException":
|
|
56
|
-
case "com.amazonaws.connectcontactlens#InternalServiceException":
|
|
57
|
-
throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
|
|
58
|
-
case "InvalidRequestException":
|
|
59
|
-
case "com.amazonaws.connectcontactlens#InvalidRequestException":
|
|
60
|
-
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
61
|
-
case "ResourceNotFoundException":
|
|
62
|
-
case "com.amazonaws.connectcontactlens#ResourceNotFoundException":
|
|
63
|
-
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
64
|
-
case "ThrottlingException":
|
|
65
|
-
case "com.amazonaws.connectcontactlens#ThrottlingException":
|
|
66
|
-
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
67
|
-
default:
|
|
68
|
-
const parsedBody = parsedOutput.body;
|
|
69
|
-
throwDefaultError({
|
|
70
|
-
output,
|
|
71
|
-
parsedBody,
|
|
72
|
-
exceptionCtor: __BaseException,
|
|
73
|
-
errorCode,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
const map = __map;
|
|
78
|
-
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
79
|
-
const contents = map({});
|
|
80
|
-
const data = parsedOutput.body;
|
|
81
|
-
if (data.Message != null) {
|
|
82
|
-
contents.Message = __expectString(data.Message);
|
|
83
|
-
}
|
|
84
|
-
const exception = new AccessDeniedException({
|
|
85
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
86
|
-
...contents,
|
|
105
|
+
}); };
|
|
106
|
+
var map = __map;
|
|
107
|
+
var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
108
|
+
var contents, data, exception;
|
|
109
|
+
return __generator(this, function (_a) {
|
|
110
|
+
contents = map({});
|
|
111
|
+
data = parsedOutput.body;
|
|
112
|
+
if (data.Message != null) {
|
|
113
|
+
contents.Message = __expectString(data.Message);
|
|
114
|
+
}
|
|
115
|
+
exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
116
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
87
117
|
});
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
98
|
-
|
|
118
|
+
}); };
|
|
119
|
+
var deserializeAws_restJson1InternalServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
120
|
+
var contents, data, exception;
|
|
121
|
+
return __generator(this, function (_a) {
|
|
122
|
+
contents = map({});
|
|
123
|
+
data = parsedOutput.body;
|
|
124
|
+
if (data.Message != null) {
|
|
125
|
+
contents.Message = __expectString(data.Message);
|
|
126
|
+
}
|
|
127
|
+
exception = new InternalServiceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
128
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
99
129
|
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
110
|
-
|
|
130
|
+
}); };
|
|
131
|
+
var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
132
|
+
var contents, data, exception;
|
|
133
|
+
return __generator(this, function (_a) {
|
|
134
|
+
contents = map({});
|
|
135
|
+
data = parsedOutput.body;
|
|
136
|
+
if (data.Message != null) {
|
|
137
|
+
contents.Message = __expectString(data.Message);
|
|
138
|
+
}
|
|
139
|
+
exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
140
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
111
141
|
});
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
122
|
-
|
|
142
|
+
}); };
|
|
143
|
+
var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
144
|
+
var contents, data, exception;
|
|
145
|
+
return __generator(this, function (_a) {
|
|
146
|
+
contents = map({});
|
|
147
|
+
data = parsedOutput.body;
|
|
148
|
+
if (data.Message != null) {
|
|
149
|
+
contents.Message = __expectString(data.Message);
|
|
150
|
+
}
|
|
151
|
+
exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
152
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
123
153
|
});
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
134
|
-
|
|
154
|
+
}); };
|
|
155
|
+
var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
156
|
+
var contents, data, exception;
|
|
157
|
+
return __generator(this, function (_a) {
|
|
158
|
+
contents = map({});
|
|
159
|
+
data = parsedOutput.body;
|
|
160
|
+
if (data.Message != null) {
|
|
161
|
+
contents.Message = __expectString(data.Message);
|
|
162
|
+
}
|
|
163
|
+
exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
164
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
135
165
|
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const deserializeAws_restJson1Categories = (output, context) => {
|
|
166
|
+
}); };
|
|
167
|
+
var deserializeAws_restJson1Categories = function (output, context) {
|
|
139
168
|
return {
|
|
140
169
|
MatchedCategories: output.MatchedCategories != null
|
|
141
170
|
? deserializeAws_restJson1MatchedCategories(output.MatchedCategories, context)
|
|
@@ -145,30 +174,30 @@ const deserializeAws_restJson1Categories = (output, context) => {
|
|
|
145
174
|
: undefined,
|
|
146
175
|
};
|
|
147
176
|
};
|
|
148
|
-
|
|
177
|
+
var deserializeAws_restJson1CategoryDetails = function (output, context) {
|
|
149
178
|
return {
|
|
150
179
|
PointsOfInterest: output.PointsOfInterest != null
|
|
151
180
|
? deserializeAws_restJson1PointsOfInterest(output.PointsOfInterest, context)
|
|
152
181
|
: undefined,
|
|
153
182
|
};
|
|
154
183
|
};
|
|
155
|
-
|
|
184
|
+
var deserializeAws_restJson1CharacterOffsets = function (output, context) {
|
|
156
185
|
return {
|
|
157
186
|
BeginOffsetChar: __expectInt32(output.BeginOffsetChar),
|
|
158
187
|
EndOffsetChar: __expectInt32(output.EndOffsetChar),
|
|
159
188
|
};
|
|
160
189
|
};
|
|
161
|
-
|
|
190
|
+
var deserializeAws_restJson1IssueDetected = function (output, context) {
|
|
162
191
|
return {
|
|
163
192
|
CharacterOffsets: output.CharacterOffsets != null
|
|
164
193
|
? deserializeAws_restJson1CharacterOffsets(output.CharacterOffsets, context)
|
|
165
194
|
: undefined,
|
|
166
195
|
};
|
|
167
196
|
};
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
.filter((e)
|
|
171
|
-
.map((entry)
|
|
197
|
+
var deserializeAws_restJson1IssuesDetected = function (output, context) {
|
|
198
|
+
var retVal = (output || [])
|
|
199
|
+
.filter(function (e) { return e != null; })
|
|
200
|
+
.map(function (entry) {
|
|
172
201
|
if (entry === null) {
|
|
173
202
|
return null;
|
|
174
203
|
}
|
|
@@ -176,10 +205,10 @@ const deserializeAws_restJson1IssuesDetected = (output, context) => {
|
|
|
176
205
|
});
|
|
177
206
|
return retVal;
|
|
178
207
|
};
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
.filter((e)
|
|
182
|
-
.map((entry)
|
|
208
|
+
var deserializeAws_restJson1MatchedCategories = function (output, context) {
|
|
209
|
+
var retVal = (output || [])
|
|
210
|
+
.filter(function (e) { return e != null; })
|
|
211
|
+
.map(function (entry) {
|
|
183
212
|
if (entry === null) {
|
|
184
213
|
return null;
|
|
185
214
|
}
|
|
@@ -187,27 +216,26 @@ const deserializeAws_restJson1MatchedCategories = (output, context) => {
|
|
|
187
216
|
});
|
|
188
217
|
return retVal;
|
|
189
218
|
};
|
|
190
|
-
|
|
191
|
-
return Object.entries(output).reduce((acc,
|
|
219
|
+
var deserializeAws_restJson1MatchedDetails = function (output, context) {
|
|
220
|
+
return Object.entries(output).reduce(function (acc, _a) {
|
|
221
|
+
var _b;
|
|
222
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
192
223
|
if (value === null) {
|
|
193
224
|
return acc;
|
|
194
225
|
}
|
|
195
|
-
return {
|
|
196
|
-
...acc,
|
|
197
|
-
[key]: deserializeAws_restJson1CategoryDetails(value, context),
|
|
198
|
-
};
|
|
226
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1CategoryDetails(value, context), _b));
|
|
199
227
|
}, {});
|
|
200
228
|
};
|
|
201
|
-
|
|
229
|
+
var deserializeAws_restJson1PointOfInterest = function (output, context) {
|
|
202
230
|
return {
|
|
203
231
|
BeginOffsetMillis: __expectInt32(output.BeginOffsetMillis),
|
|
204
232
|
EndOffsetMillis: __expectInt32(output.EndOffsetMillis),
|
|
205
233
|
};
|
|
206
234
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
.filter((e)
|
|
210
|
-
.map((entry)
|
|
235
|
+
var deserializeAws_restJson1PointsOfInterest = function (output, context) {
|
|
236
|
+
var retVal = (output || [])
|
|
237
|
+
.filter(function (e) { return e != null; })
|
|
238
|
+
.map(function (entry) {
|
|
211
239
|
if (entry === null) {
|
|
212
240
|
return null;
|
|
213
241
|
}
|
|
@@ -215,16 +243,16 @@ const deserializeAws_restJson1PointsOfInterest = (output, context) => {
|
|
|
215
243
|
});
|
|
216
244
|
return retVal;
|
|
217
245
|
};
|
|
218
|
-
|
|
246
|
+
var deserializeAws_restJson1RealtimeContactAnalysisSegment = function (output, context) {
|
|
219
247
|
return {
|
|
220
248
|
Categories: output.Categories != null ? deserializeAws_restJson1Categories(output.Categories, context) : undefined,
|
|
221
249
|
Transcript: output.Transcript != null ? deserializeAws_restJson1Transcript(output.Transcript, context) : undefined,
|
|
222
250
|
};
|
|
223
251
|
};
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
.filter((e)
|
|
227
|
-
.map((entry)
|
|
252
|
+
var deserializeAws_restJson1RealtimeContactAnalysisSegments = function (output, context) {
|
|
253
|
+
var retVal = (output || [])
|
|
254
|
+
.filter(function (e) { return e != null; })
|
|
255
|
+
.map(function (entry) {
|
|
228
256
|
if (entry === null) {
|
|
229
257
|
return null;
|
|
230
258
|
}
|
|
@@ -232,7 +260,7 @@ const deserializeAws_restJson1RealtimeContactAnalysisSegments = (output, context
|
|
|
232
260
|
});
|
|
233
261
|
return retVal;
|
|
234
262
|
};
|
|
235
|
-
|
|
263
|
+
var deserializeAws_restJson1Transcript = function (output, context) {
|
|
236
264
|
return {
|
|
237
265
|
BeginOffsetMillis: __expectInt32(output.BeginOffsetMillis),
|
|
238
266
|
Content: __expectString(output.Content),
|
|
@@ -246,39 +274,57 @@ const deserializeAws_restJson1Transcript = (output, context) => {
|
|
|
246
274
|
Sentiment: __expectString(output.Sentiment),
|
|
247
275
|
};
|
|
248
276
|
};
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
277
|
+
var deserializeMetadata = function (output) {
|
|
278
|
+
var _a, _b;
|
|
279
|
+
return ({
|
|
280
|
+
httpStatusCode: output.statusCode,
|
|
281
|
+
requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
|
|
282
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
283
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
var collectBody = function (streamBody, context) {
|
|
287
|
+
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
256
288
|
if (streamBody instanceof Uint8Array) {
|
|
257
289
|
return Promise.resolve(streamBody);
|
|
258
290
|
}
|
|
259
291
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
260
292
|
};
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
value !== null &&
|
|
264
|
-
value !== "" &&
|
|
265
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
266
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
267
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
268
|
-
if (encoded.length) {
|
|
269
|
-
return JSON.parse(encoded);
|
|
270
|
-
}
|
|
271
|
-
return {};
|
|
272
|
-
});
|
|
273
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
274
|
-
const value = await parseBody(errorBody, context);
|
|
275
|
-
value.message = value.message ?? value.Message;
|
|
276
|
-
return value;
|
|
293
|
+
var collectBodyString = function (streamBody, context) {
|
|
294
|
+
return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
|
|
277
295
|
};
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
296
|
+
var isSerializableHeaderValue = function (value) {
|
|
297
|
+
return value !== undefined &&
|
|
298
|
+
value !== null &&
|
|
299
|
+
value !== "" &&
|
|
300
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
301
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
302
|
+
};
|
|
303
|
+
var parseBody = function (streamBody, context) {
|
|
304
|
+
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
305
|
+
if (encoded.length) {
|
|
306
|
+
return JSON.parse(encoded);
|
|
307
|
+
}
|
|
308
|
+
return {};
|
|
309
|
+
});
|
|
310
|
+
};
|
|
311
|
+
var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
312
|
+
var value;
|
|
313
|
+
var _a;
|
|
314
|
+
return __generator(this, function (_b) {
|
|
315
|
+
switch (_b.label) {
|
|
316
|
+
case 0: return [4, parseBody(errorBody, context)];
|
|
317
|
+
case 1:
|
|
318
|
+
value = _b.sent();
|
|
319
|
+
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
320
|
+
return [2, value];
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
}); };
|
|
324
|
+
var loadRestJsonErrorCode = function (output, data) {
|
|
325
|
+
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
326
|
+
var sanitizeErrorCode = function (rawValue) {
|
|
327
|
+
var cleanValue = rawValue;
|
|
282
328
|
if (typeof cleanValue === "number") {
|
|
283
329
|
cleanValue = cleanValue.toString();
|
|
284
330
|
}
|
|
@@ -293,7 +339,7 @@ const loadRestJsonErrorCode = (output, data) => {
|
|
|
293
339
|
}
|
|
294
340
|
return cleanValue;
|
|
295
341
|
};
|
|
296
|
-
|
|
342
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
297
343
|
if (headerKey !== undefined) {
|
|
298
344
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
299
345
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
1
2
|
import packageInfo from "../package.json";
|
|
2
3
|
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
4
|
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
|
|
@@ -11,30 +12,15 @@ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
|
|
|
11
12
|
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
12
13
|
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
|
|
13
14
|
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
26
|
-
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
27
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
28
|
-
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
29
|
-
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
30
|
-
region: config?.region ?? invalidProvider("Region is missing"),
|
|
31
|
-
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
32
|
-
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
33
|
-
sha256: config?.sha256 ?? Sha256,
|
|
34
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
35
|
-
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
36
|
-
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
37
|
-
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
38
|
-
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
39
|
-
};
|
|
15
|
+
export var getRuntimeConfig = function (config) {
|
|
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); };
|
|
19
|
+
var clientSharedValues = getSharedRuntimeConfig(config);
|
|
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 });
|
|
40
26
|
};
|
package/dist-es/runtimeConfig.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
1
2
|
import packageInfo from "../package.json";
|
|
2
3
|
import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
|
|
3
4
|
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@aws-sdk/config-resolver";
|
|
@@ -14,35 +15,16 @@ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shar
|
|
|
14
15
|
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
|
|
15
16
|
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node";
|
|
16
17
|
import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
|
|
17
|
-
export
|
|
18
|
+
export var getRuntimeConfig = function (config) {
|
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
18
20
|
emitWarningIfUnsupportedVersion(process.version);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
29
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
30
|
-
credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
|
|
31
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
32
|
-
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
33
|
-
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
34
|
-
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
35
|
-
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
36
|
-
retryMode: config?.retryMode ??
|
|
37
|
-
loadNodeConfig({
|
|
38
|
-
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
39
|
-
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
40
|
-
}),
|
|
41
|
-
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
42
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
43
|
-
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
|
|
44
|
-
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
|
|
45
|
-
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
46
|
-
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
47
|
-
};
|
|
21
|
+
var defaultsMode = resolveDefaultsModeConfig(config);
|
|
22
|
+
var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
|
|
23
|
+
var clientSharedValues = getSharedRuntimeConfig(config);
|
|
24
|
+
return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "node", 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 : decorateDefaultCredentialProvider(credentialDefaultProvider), 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 : loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), 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 : loadNodeConfig(__assign(__assign({}, NODE_RETRY_MODE_CONFIG_OPTIONS), { default: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
25
|
+
switch (_a.label) {
|
|
26
|
+
case 0: return [4, defaultConfigProvider()];
|
|
27
|
+
case 1: return [2, (_a.sent()).retryMode || DEFAULT_RETRY_MODE];
|
|
28
|
+
}
|
|
29
|
+
}); }); } })), sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : Hash.bind(null, "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 : loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), 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 });
|
|
48
30
|
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
1
2
|
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
3
|
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
...config,
|
|
8
|
-
runtime: "react-native",
|
|
9
|
-
sha256: config?.sha256 ?? Sha256,
|
|
10
|
-
};
|
|
4
|
+
export var getRuntimeConfig = function (config) {
|
|
5
|
+
var _a;
|
|
6
|
+
var browserDefaults = getBrowserRuntimeConfig(config);
|
|
7
|
+
return __assign(__assign(__assign({}, browserDefaults), config), { runtime: "react-native", sha256: (_a = config === null || config === void 0 ? void 0 : config.sha256) !== null && _a !== void 0 ? _a : Sha256 });
|
|
11
8
|
};
|