@aws-sdk/client-appconfigdata 3.181.0 → 3.183.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 +8 -0
- package/dist-es/AppConfigData.js +10 -17
- package/dist-es/AppConfigDataClient.js +22 -28
- package/dist-es/commands/GetLatestConfigurationCommand.js +21 -28
- package/dist-es/commands/StartConfigurationSessionCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/AppConfigDataServiceException.js +5 -10
- package/dist-es/models/models_0.js +75 -67
- package/dist-es/protocols/Aws_restJson1.js +227 -301
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,261 +1,203 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, map as __map, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { AppConfigDataServiceException as __BaseException } from "../models/AppConfigDataServiceException";
|
|
5
4
|
import { BadRequestException, InternalServerException, ResourceNotFoundException, ThrottlingException, } from "../models/models_0";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/configuration";
|
|
15
|
-
query = map({
|
|
16
|
-
configuration_token: [, input.ConfigurationToken],
|
|
17
|
-
});
|
|
18
|
-
return [2, new __HttpRequest({
|
|
19
|
-
protocol: protocol,
|
|
20
|
-
hostname: hostname,
|
|
21
|
-
port: port,
|
|
22
|
-
method: "GET",
|
|
23
|
-
headers: headers,
|
|
24
|
-
path: resolvedPath,
|
|
25
|
-
query: query,
|
|
26
|
-
body: body,
|
|
27
|
-
})];
|
|
28
|
-
}
|
|
5
|
+
export const serializeAws_restJson1GetLatestConfigurationCommand = async (input, context) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {};
|
|
8
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/configuration";
|
|
9
|
+
const query = map({
|
|
10
|
+
configuration_token: [, input.ConfigurationToken],
|
|
29
11
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/configurationsessions";
|
|
42
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.ApplicationIdentifier != null && { ApplicationIdentifier: input.ApplicationIdentifier })), (input.ConfigurationProfileIdentifier != null && {
|
|
43
|
-
ConfigurationProfileIdentifier: input.ConfigurationProfileIdentifier,
|
|
44
|
-
})), (input.EnvironmentIdentifier != null && { EnvironmentIdentifier: input.EnvironmentIdentifier })), (input.RequiredMinimumPollIntervalInSeconds != null && {
|
|
45
|
-
RequiredMinimumPollIntervalInSeconds: input.RequiredMinimumPollIntervalInSeconds,
|
|
46
|
-
})));
|
|
47
|
-
return [2, new __HttpRequest({
|
|
48
|
-
protocol: protocol,
|
|
49
|
-
hostname: hostname,
|
|
50
|
-
port: port,
|
|
51
|
-
method: "POST",
|
|
52
|
-
headers: headers,
|
|
53
|
-
path: resolvedPath,
|
|
54
|
-
body: body,
|
|
55
|
-
})];
|
|
56
|
-
}
|
|
12
|
+
let body;
|
|
13
|
+
return new __HttpRequest({
|
|
14
|
+
protocol,
|
|
15
|
+
hostname,
|
|
16
|
+
port,
|
|
17
|
+
method: "GET",
|
|
18
|
+
headers,
|
|
19
|
+
path: resolvedPath,
|
|
20
|
+
query,
|
|
21
|
+
body,
|
|
57
22
|
});
|
|
58
|
-
}
|
|
59
|
-
export
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
});
|
|
76
|
-
return [4, collectBody(output.body, context)];
|
|
77
|
-
case 1:
|
|
78
|
-
data = _a.sent();
|
|
79
|
-
contents.Configuration = data;
|
|
80
|
-
return [2, contents];
|
|
81
|
-
}
|
|
23
|
+
};
|
|
24
|
+
export const serializeAws_restJson1StartConfigurationSessionCommand = async (input, context) => {
|
|
25
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
26
|
+
const headers = {
|
|
27
|
+
"content-type": "application/json",
|
|
28
|
+
};
|
|
29
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/configurationsessions";
|
|
30
|
+
let body;
|
|
31
|
+
body = JSON.stringify({
|
|
32
|
+
...(input.ApplicationIdentifier != null && { ApplicationIdentifier: input.ApplicationIdentifier }),
|
|
33
|
+
...(input.ConfigurationProfileIdentifier != null && {
|
|
34
|
+
ConfigurationProfileIdentifier: input.ConfigurationProfileIdentifier,
|
|
35
|
+
}),
|
|
36
|
+
...(input.EnvironmentIdentifier != null && { EnvironmentIdentifier: input.EnvironmentIdentifier }),
|
|
37
|
+
...(input.RequiredMinimumPollIntervalInSeconds != null && {
|
|
38
|
+
RequiredMinimumPollIntervalInSeconds: input.RequiredMinimumPollIntervalInSeconds,
|
|
39
|
+
}),
|
|
82
40
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
_c = {};
|
|
92
|
-
return [4, parseErrorBody(output.body, context)];
|
|
93
|
-
case 1:
|
|
94
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
95
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
96
|
-
_b = errorCode;
|
|
97
|
-
switch (_b) {
|
|
98
|
-
case "BadRequestException": return [3, 2];
|
|
99
|
-
case "com.amazonaws.appconfigdata#BadRequestException": return [3, 2];
|
|
100
|
-
case "InternalServerException": return [3, 4];
|
|
101
|
-
case "com.amazonaws.appconfigdata#InternalServerException": return [3, 4];
|
|
102
|
-
case "ResourceNotFoundException": return [3, 6];
|
|
103
|
-
case "com.amazonaws.appconfigdata#ResourceNotFoundException": return [3, 6];
|
|
104
|
-
case "ThrottlingException": return [3, 8];
|
|
105
|
-
case "com.amazonaws.appconfigdata#ThrottlingException": return [3, 8];
|
|
106
|
-
}
|
|
107
|
-
return [3, 10];
|
|
108
|
-
case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
109
|
-
case 3: throw _d.sent();
|
|
110
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
111
|
-
case 5: throw _d.sent();
|
|
112
|
-
case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
113
|
-
case 7: throw _d.sent();
|
|
114
|
-
case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
115
|
-
case 9: throw _d.sent();
|
|
116
|
-
case 10:
|
|
117
|
-
parsedBody = parsedOutput.body;
|
|
118
|
-
throwDefaultError({
|
|
119
|
-
output: output,
|
|
120
|
-
parsedBody: parsedBody,
|
|
121
|
-
exceptionCtor: __BaseException,
|
|
122
|
-
errorCode: errorCode,
|
|
123
|
-
});
|
|
124
|
-
_d.label = 11;
|
|
125
|
-
case 11: return [2];
|
|
126
|
-
}
|
|
41
|
+
return new __HttpRequest({
|
|
42
|
+
protocol,
|
|
43
|
+
hostname,
|
|
44
|
+
port,
|
|
45
|
+
method: "POST",
|
|
46
|
+
headers,
|
|
47
|
+
path: resolvedPath,
|
|
48
|
+
body,
|
|
127
49
|
});
|
|
128
|
-
}
|
|
129
|
-
export
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
_b = __expectObject;
|
|
142
|
-
return [4, parseBody(output.body, context)];
|
|
143
|
-
case 1:
|
|
144
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
145
|
-
if (data.InitialConfigurationToken != null) {
|
|
146
|
-
contents.InitialConfigurationToken = __expectString(data.InitialConfigurationToken);
|
|
147
|
-
}
|
|
148
|
-
return [2, contents];
|
|
149
|
-
}
|
|
50
|
+
};
|
|
51
|
+
export const deserializeAws_restJson1GetLatestConfigurationCommand = async (output, context) => {
|
|
52
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
53
|
+
return deserializeAws_restJson1GetLatestConfigurationCommandError(output, context);
|
|
54
|
+
}
|
|
55
|
+
const contents = map({
|
|
56
|
+
$metadata: deserializeMetadata(output),
|
|
57
|
+
NextPollConfigurationToken: [, output.headers["next-poll-configuration-token"]],
|
|
58
|
+
NextPollIntervalInSeconds: [
|
|
59
|
+
() => void 0 !== output.headers["next-poll-interval-in-seconds"],
|
|
60
|
+
() => __strictParseInt32(output.headers["next-poll-interval-in-seconds"]),
|
|
61
|
+
],
|
|
62
|
+
ContentType: [, output.headers["content-type"]],
|
|
150
63
|
});
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
errorCode: errorCode,
|
|
191
|
-
});
|
|
192
|
-
_d.label = 11;
|
|
193
|
-
case 11: return [2];
|
|
194
|
-
}
|
|
64
|
+
const data = await collectBody(output.body, context);
|
|
65
|
+
contents.Configuration = data;
|
|
66
|
+
return contents;
|
|
67
|
+
};
|
|
68
|
+
const deserializeAws_restJson1GetLatestConfigurationCommandError = async (output, context) => {
|
|
69
|
+
const parsedOutput = {
|
|
70
|
+
...output,
|
|
71
|
+
body: await parseErrorBody(output.body, context),
|
|
72
|
+
};
|
|
73
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
74
|
+
switch (errorCode) {
|
|
75
|
+
case "BadRequestException":
|
|
76
|
+
case "com.amazonaws.appconfigdata#BadRequestException":
|
|
77
|
+
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
|
|
78
|
+
case "InternalServerException":
|
|
79
|
+
case "com.amazonaws.appconfigdata#InternalServerException":
|
|
80
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
81
|
+
case "ResourceNotFoundException":
|
|
82
|
+
case "com.amazonaws.appconfigdata#ResourceNotFoundException":
|
|
83
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
84
|
+
case "ThrottlingException":
|
|
85
|
+
case "com.amazonaws.appconfigdata#ThrottlingException":
|
|
86
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
87
|
+
default:
|
|
88
|
+
const parsedBody = parsedOutput.body;
|
|
89
|
+
throwDefaultError({
|
|
90
|
+
output,
|
|
91
|
+
parsedBody,
|
|
92
|
+
exceptionCtor: __BaseException,
|
|
93
|
+
errorCode,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
export const deserializeAws_restJson1StartConfigurationSessionCommand = async (output, context) => {
|
|
98
|
+
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
99
|
+
return deserializeAws_restJson1StartConfigurationSessionCommandError(output, context);
|
|
100
|
+
}
|
|
101
|
+
const contents = map({
|
|
102
|
+
$metadata: deserializeMetadata(output),
|
|
195
103
|
});
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
104
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
105
|
+
if (data.InitialConfigurationToken != null) {
|
|
106
|
+
contents.InitialConfigurationToken = __expectString(data.InitialConfigurationToken);
|
|
107
|
+
}
|
|
108
|
+
return contents;
|
|
109
|
+
};
|
|
110
|
+
const deserializeAws_restJson1StartConfigurationSessionCommandError = async (output, context) => {
|
|
111
|
+
const parsedOutput = {
|
|
112
|
+
...output,
|
|
113
|
+
body: await parseErrorBody(output.body, context),
|
|
114
|
+
};
|
|
115
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
116
|
+
switch (errorCode) {
|
|
117
|
+
case "BadRequestException":
|
|
118
|
+
case "com.amazonaws.appconfigdata#BadRequestException":
|
|
119
|
+
throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
|
|
120
|
+
case "InternalServerException":
|
|
121
|
+
case "com.amazonaws.appconfigdata#InternalServerException":
|
|
122
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
123
|
+
case "ResourceNotFoundException":
|
|
124
|
+
case "com.amazonaws.appconfigdata#ResourceNotFoundException":
|
|
125
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
126
|
+
case "ThrottlingException":
|
|
127
|
+
case "com.amazonaws.appconfigdata#ThrottlingException":
|
|
128
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
129
|
+
default:
|
|
130
|
+
const parsedBody = parsedOutput.body;
|
|
131
|
+
throwDefaultError({
|
|
132
|
+
output,
|
|
133
|
+
parsedBody,
|
|
134
|
+
exceptionCtor: __BaseException,
|
|
135
|
+
errorCode,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const map = __map;
|
|
140
|
+
const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
|
|
141
|
+
const contents = map({});
|
|
142
|
+
const data = parsedOutput.body;
|
|
143
|
+
if (data.Details != null) {
|
|
144
|
+
contents.Details = deserializeAws_restJson1BadRequestDetails(__expectUnion(data.Details), context);
|
|
145
|
+
}
|
|
146
|
+
if (data.Message != null) {
|
|
147
|
+
contents.Message = __expectString(data.Message);
|
|
148
|
+
}
|
|
149
|
+
if (data.Reason != null) {
|
|
150
|
+
contents.Reason = __expectString(data.Reason);
|
|
151
|
+
}
|
|
152
|
+
const exception = new BadRequestException({
|
|
153
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
154
|
+
...contents,
|
|
214
155
|
});
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
156
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
157
|
+
};
|
|
158
|
+
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
159
|
+
const contents = map({});
|
|
160
|
+
const data = parsedOutput.body;
|
|
161
|
+
if (data.Message != null) {
|
|
162
|
+
contents.Message = __expectString(data.Message);
|
|
163
|
+
}
|
|
164
|
+
const exception = new InternalServerException({
|
|
165
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
166
|
+
...contents,
|
|
226
167
|
});
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
168
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
169
|
+
};
|
|
170
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
171
|
+
const contents = map({});
|
|
172
|
+
const data = parsedOutput.body;
|
|
173
|
+
if (data.Message != null) {
|
|
174
|
+
contents.Message = __expectString(data.Message);
|
|
175
|
+
}
|
|
176
|
+
if (data.ReferencedBy != null) {
|
|
177
|
+
contents.ReferencedBy = deserializeAws_restJson1StringMap(data.ReferencedBy, context);
|
|
178
|
+
}
|
|
179
|
+
if (data.ResourceType != null) {
|
|
180
|
+
contents.ResourceType = __expectString(data.ResourceType);
|
|
181
|
+
}
|
|
182
|
+
const exception = new ResourceNotFoundException({
|
|
183
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
184
|
+
...contents,
|
|
244
185
|
});
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
186
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
187
|
+
};
|
|
188
|
+
const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
|
|
189
|
+
const contents = map({});
|
|
190
|
+
const data = parsedOutput.body;
|
|
191
|
+
if (data.Message != null) {
|
|
192
|
+
contents.Message = __expectString(data.Message);
|
|
193
|
+
}
|
|
194
|
+
const exception = new ThrottlingException({
|
|
195
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
196
|
+
...contents,
|
|
256
197
|
});
|
|
257
|
-
|
|
258
|
-
|
|
198
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
199
|
+
};
|
|
200
|
+
const deserializeAws_restJson1BadRequestDetails = (output, context) => {
|
|
259
201
|
if (output.InvalidParameters != null) {
|
|
260
202
|
return {
|
|
261
203
|
InvalidParameters: deserializeAws_restJson1InvalidParameterMap(output.InvalidParameters, context),
|
|
@@ -263,82 +205,66 @@ var deserializeAws_restJson1BadRequestDetails = function (output, context) {
|
|
|
263
205
|
}
|
|
264
206
|
return { $unknown: Object.entries(output)[0] };
|
|
265
207
|
};
|
|
266
|
-
|
|
208
|
+
const deserializeAws_restJson1InvalidParameterDetail = (output, context) => {
|
|
267
209
|
return {
|
|
268
210
|
Problem: __expectString(output.Problem),
|
|
269
211
|
};
|
|
270
212
|
};
|
|
271
|
-
|
|
272
|
-
return Object.entries(output).reduce(
|
|
273
|
-
var _b;
|
|
274
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
213
|
+
const deserializeAws_restJson1InvalidParameterMap = (output, context) => {
|
|
214
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
275
215
|
if (value === null) {
|
|
276
216
|
return acc;
|
|
277
217
|
}
|
|
278
|
-
return
|
|
218
|
+
return {
|
|
219
|
+
...acc,
|
|
220
|
+
[key]: deserializeAws_restJson1InvalidParameterDetail(value, context),
|
|
221
|
+
};
|
|
279
222
|
}, {});
|
|
280
223
|
};
|
|
281
|
-
|
|
282
|
-
return Object.entries(output).reduce(
|
|
283
|
-
var _b;
|
|
284
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
224
|
+
const deserializeAws_restJson1StringMap = (output, context) => {
|
|
225
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
285
226
|
if (value === null) {
|
|
286
227
|
return acc;
|
|
287
228
|
}
|
|
288
|
-
return
|
|
229
|
+
return {
|
|
230
|
+
...acc,
|
|
231
|
+
[key]: __expectString(value),
|
|
232
|
+
};
|
|
289
233
|
}, {});
|
|
290
234
|
};
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
});
|
|
299
|
-
};
|
|
300
|
-
var collectBody = function (streamBody, context) {
|
|
301
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
235
|
+
const deserializeMetadata = (output) => ({
|
|
236
|
+
httpStatusCode: output.statusCode,
|
|
237
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
238
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
239
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
240
|
+
});
|
|
241
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
302
242
|
if (streamBody instanceof Uint8Array) {
|
|
303
243
|
return Promise.resolve(streamBody);
|
|
304
244
|
}
|
|
305
245
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
306
246
|
};
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
});
|
|
247
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
248
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
249
|
+
value !== null &&
|
|
250
|
+
value !== "" &&
|
|
251
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
252
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
253
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
254
|
+
if (encoded.length) {
|
|
255
|
+
return JSON.parse(encoded);
|
|
256
|
+
}
|
|
257
|
+
return {};
|
|
258
|
+
});
|
|
259
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
260
|
+
const value = await parseBody(errorBody, context);
|
|
261
|
+
value.message = value.message ?? value.Message;
|
|
262
|
+
return value;
|
|
324
263
|
};
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
switch (_b.label) {
|
|
330
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
331
|
-
case 1:
|
|
332
|
-
value = _b.sent();
|
|
333
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
334
|
-
return [2, value];
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
}); };
|
|
338
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
339
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
340
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
341
|
-
var cleanValue = rawValue;
|
|
264
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
265
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
266
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
267
|
+
let cleanValue = rawValue;
|
|
342
268
|
if (typeof cleanValue === "number") {
|
|
343
269
|
cleanValue = cleanValue.toString();
|
|
344
270
|
}
|
|
@@ -353,7 +279,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
353
279
|
}
|
|
354
280
|
return cleanValue;
|
|
355
281
|
};
|
|
356
|
-
|
|
282
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
357
283
|
if (headerKey !== undefined) {
|
|
358
284
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
359
285
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import packageInfo from "../package.json";
|
|
3
2
|
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
4
3
|
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
|
|
@@ -12,15 +11,30 @@ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
|
|
|
12
11
|
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
13
12
|
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
|
|
14
13
|
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
export const getRuntimeConfig = (config) => {
|
|
15
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
16
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
17
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
18
|
+
return {
|
|
19
|
+
...clientSharedValues,
|
|
20
|
+
...config,
|
|
21
|
+
runtime: "browser",
|
|
22
|
+
defaultsMode,
|
|
23
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
24
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
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
|
+
};
|
|
26
40
|
};
|