@aws-sdk/client-cloudsearch-domain 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/CloudSearchDomain.js +21 -14
- package/dist-es/CloudSearchDomainClient.js +28 -22
- package/dist-es/commands/SearchCommand.js +28 -21
- package/dist-es/commands/SuggestCommand.js +28 -21
- package/dist-es/commands/UploadDocumentsCommand.js +28 -21
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/CloudSearchDomainServiceException.js +10 -5
- package/dist-es/models/models_0.js +40 -71
- package/dist-es/protocols/Aws_restJson1.js +407 -306
- 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,251 +1,339 @@
|
|
|
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, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
4
|
import { CloudSearchDomainServiceException as __BaseException } from "../models/CloudSearchDomainServiceException";
|
|
4
5
|
import { DocumentServiceException, SearchException, } from "../models/models_0";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
6
|
+
export var serializeAws_restJson1SearchCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, 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
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/2013-01-01/search";
|
|
15
|
+
query = map({
|
|
16
|
+
format: [, "sdk"],
|
|
17
|
+
pretty: [, "true"],
|
|
18
|
+
cursor: [, input.cursor],
|
|
19
|
+
expr: [, input.expr],
|
|
20
|
+
facet: [, input.facet],
|
|
21
|
+
fq: [, input.filterQuery],
|
|
22
|
+
highlight: [, input.highlight],
|
|
23
|
+
partial: [function () { return input.partial !== void 0; }, function () { return input.partial.toString(); }],
|
|
24
|
+
q: [, input.query],
|
|
25
|
+
"q.options": [, input.queryOptions],
|
|
26
|
+
"q.parser": [, input.queryParser],
|
|
27
|
+
return: [, input.return],
|
|
28
|
+
size: [function () { return input.size !== void 0; }, function () { return input.size.toString(); }],
|
|
29
|
+
sort: [, input.sort],
|
|
30
|
+
start: [function () { return input.start !== void 0; }, function () { return input.start.toString(); }],
|
|
31
|
+
stats: [, input.stats],
|
|
32
|
+
});
|
|
33
|
+
return [2, new __HttpRequest({
|
|
34
|
+
protocol: protocol,
|
|
35
|
+
hostname: hostname,
|
|
36
|
+
port: port,
|
|
37
|
+
method: "GET",
|
|
38
|
+
headers: headers,
|
|
39
|
+
path: resolvedPath,
|
|
40
|
+
query: query,
|
|
41
|
+
body: body,
|
|
42
|
+
})];
|
|
43
|
+
}
|
|
37
44
|
});
|
|
38
|
-
};
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
}); };
|
|
46
|
+
export var serializeAws_restJson1SuggestCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
47
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
48
|
+
return __generator(this, function (_c) {
|
|
49
|
+
switch (_c.label) {
|
|
50
|
+
case 0: return [4, context.endpoint()];
|
|
51
|
+
case 1:
|
|
52
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
53
|
+
headers = {};
|
|
54
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/2013-01-01/suggest";
|
|
55
|
+
query = map({
|
|
56
|
+
format: [, "sdk"],
|
|
57
|
+
pretty: [, "true"],
|
|
58
|
+
q: [, input.query],
|
|
59
|
+
suggester: [, input.suggester],
|
|
60
|
+
size: [function () { return input.size !== void 0; }, function () { return input.size.toString(); }],
|
|
61
|
+
});
|
|
62
|
+
return [2, new __HttpRequest({
|
|
63
|
+
protocol: protocol,
|
|
64
|
+
hostname: hostname,
|
|
65
|
+
port: port,
|
|
66
|
+
method: "GET",
|
|
67
|
+
headers: headers,
|
|
68
|
+
path: resolvedPath,
|
|
69
|
+
query: query,
|
|
70
|
+
body: body,
|
|
71
|
+
})];
|
|
72
|
+
}
|
|
49
73
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
}); };
|
|
75
|
+
export var serializeAws_restJson1UploadDocumentsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
76
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
77
|
+
return __generator(this, function (_c) {
|
|
78
|
+
switch (_c.label) {
|
|
79
|
+
case 0: return [4, context.endpoint()];
|
|
80
|
+
case 1:
|
|
81
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
82
|
+
headers = map({}, isSerializableHeaderValue, {
|
|
83
|
+
"content-type": input.contentType || "application/octet-stream",
|
|
84
|
+
});
|
|
85
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/2013-01-01/documents/batch";
|
|
86
|
+
query = map({
|
|
87
|
+
format: [, "sdk"],
|
|
88
|
+
});
|
|
89
|
+
if (input.documents !== undefined) {
|
|
90
|
+
body = input.documents;
|
|
91
|
+
}
|
|
92
|
+
return [2, new __HttpRequest({
|
|
93
|
+
protocol: protocol,
|
|
94
|
+
hostname: hostname,
|
|
95
|
+
port: port,
|
|
96
|
+
method: "POST",
|
|
97
|
+
headers: headers,
|
|
98
|
+
path: resolvedPath,
|
|
99
|
+
query: query,
|
|
100
|
+
body: body,
|
|
101
|
+
})];
|
|
102
|
+
}
|
|
60
103
|
});
|
|
61
|
-
};
|
|
62
|
-
export
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
104
|
+
}); };
|
|
105
|
+
export var deserializeAws_restJson1SearchCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
106
|
+
var contents, data, _a, _b;
|
|
107
|
+
return __generator(this, function (_c) {
|
|
108
|
+
switch (_c.label) {
|
|
109
|
+
case 0:
|
|
110
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
111
|
+
return [2, deserializeAws_restJson1SearchCommandError(output, context)];
|
|
112
|
+
}
|
|
113
|
+
contents = map({
|
|
114
|
+
$metadata: deserializeMetadata(output),
|
|
115
|
+
});
|
|
116
|
+
_a = __expectNonNull;
|
|
117
|
+
_b = __expectObject;
|
|
118
|
+
return [4, parseBody(output.body, context)];
|
|
119
|
+
case 1:
|
|
120
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
121
|
+
if (data.facets != null) {
|
|
122
|
+
contents.facets = deserializeAws_restJson1Facets(data.facets, context);
|
|
123
|
+
}
|
|
124
|
+
if (data.hits != null) {
|
|
125
|
+
contents.hits = deserializeAws_restJson1Hits(data.hits, context);
|
|
126
|
+
}
|
|
127
|
+
if (data.stats != null) {
|
|
128
|
+
contents.stats = deserializeAws_restJson1Stats(data.stats, context);
|
|
129
|
+
}
|
|
130
|
+
if (data.status != null) {
|
|
131
|
+
contents.status = deserializeAws_restJson1SearchStatus(data.status, context);
|
|
132
|
+
}
|
|
133
|
+
return [2, contents];
|
|
134
|
+
}
|
|
66
135
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
136
|
+
}); };
|
|
137
|
+
var deserializeAws_restJson1SearchCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
138
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
139
|
+
var _c;
|
|
140
|
+
return __generator(this, function (_d) {
|
|
141
|
+
switch (_d.label) {
|
|
142
|
+
case 0:
|
|
143
|
+
_a = [__assign({}, output)];
|
|
144
|
+
_c = {};
|
|
145
|
+
return [4, parseErrorBody(output.body, context)];
|
|
146
|
+
case 1:
|
|
147
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
148
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
149
|
+
_b = errorCode;
|
|
150
|
+
switch (_b) {
|
|
151
|
+
case "SearchException": return [3, 2];
|
|
152
|
+
case "com.amazonaws.cloudsearchdomain#SearchException": return [3, 2];
|
|
153
|
+
}
|
|
154
|
+
return [3, 4];
|
|
155
|
+
case 2: return [4, deserializeAws_restJson1SearchExceptionResponse(parsedOutput, context)];
|
|
156
|
+
case 3: throw _d.sent();
|
|
157
|
+
case 4:
|
|
158
|
+
parsedBody = parsedOutput.body;
|
|
159
|
+
throwDefaultError({
|
|
160
|
+
output: output,
|
|
161
|
+
parsedBody: parsedBody,
|
|
162
|
+
exceptionCtor: __BaseException,
|
|
163
|
+
errorCode: errorCode,
|
|
164
|
+
});
|
|
165
|
+
_d.label = 5;
|
|
166
|
+
case 5: return [2];
|
|
167
|
+
}
|
|
70
168
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
169
|
+
}); };
|
|
170
|
+
export var deserializeAws_restJson1SuggestCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
171
|
+
var contents, data, _a, _b;
|
|
172
|
+
return __generator(this, function (_c) {
|
|
173
|
+
switch (_c.label) {
|
|
174
|
+
case 0:
|
|
175
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
176
|
+
return [2, deserializeAws_restJson1SuggestCommandError(output, context)];
|
|
177
|
+
}
|
|
178
|
+
contents = map({
|
|
179
|
+
$metadata: deserializeMetadata(output),
|
|
180
|
+
});
|
|
181
|
+
_a = __expectNonNull;
|
|
182
|
+
_b = __expectObject;
|
|
183
|
+
return [4, parseBody(output.body, context)];
|
|
184
|
+
case 1:
|
|
185
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
186
|
+
if (data.status != null) {
|
|
187
|
+
contents.status = deserializeAws_restJson1SuggestStatus(data.status, context);
|
|
188
|
+
}
|
|
189
|
+
if (data.suggest != null) {
|
|
190
|
+
contents.suggest = deserializeAws_restJson1SuggestModel(data.suggest, context);
|
|
191
|
+
}
|
|
192
|
+
return [2, contents];
|
|
193
|
+
}
|
|
84
194
|
});
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
195
|
+
}); };
|
|
196
|
+
var deserializeAws_restJson1SuggestCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
197
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
198
|
+
var _c;
|
|
199
|
+
return __generator(this, function (_d) {
|
|
200
|
+
switch (_d.label) {
|
|
201
|
+
case 0:
|
|
202
|
+
_a = [__assign({}, output)];
|
|
203
|
+
_c = {};
|
|
204
|
+
return [4, parseErrorBody(output.body, context)];
|
|
205
|
+
case 1:
|
|
206
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
207
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
208
|
+
_b = errorCode;
|
|
209
|
+
switch (_b) {
|
|
210
|
+
case "SearchException": return [3, 2];
|
|
211
|
+
case "com.amazonaws.cloudsearchdomain#SearchException": return [3, 2];
|
|
212
|
+
}
|
|
213
|
+
return [3, 4];
|
|
214
|
+
case 2: return [4, deserializeAws_restJson1SearchExceptionResponse(parsedOutput, context)];
|
|
215
|
+
case 3: throw _d.sent();
|
|
216
|
+
case 4:
|
|
217
|
+
parsedBody = parsedOutput.body;
|
|
218
|
+
throwDefaultError({
|
|
219
|
+
output: output,
|
|
220
|
+
parsedBody: parsedBody,
|
|
221
|
+
exceptionCtor: __BaseException,
|
|
222
|
+
errorCode: errorCode,
|
|
223
|
+
});
|
|
224
|
+
_d.label = 5;
|
|
225
|
+
case 5: return [2];
|
|
226
|
+
}
|
|
92
227
|
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
errorCode,
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
export const deserializeAws_restJson1SuggestCommand = async (output, context) => {
|
|
129
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
130
|
-
return deserializeAws_restJson1SuggestCommandError(output, context);
|
|
131
|
-
}
|
|
132
|
-
const contents = map({
|
|
133
|
-
$metadata: deserializeMetadata(output),
|
|
228
|
+
}); };
|
|
229
|
+
export var deserializeAws_restJson1UploadDocumentsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
230
|
+
var contents, data, _a, _b;
|
|
231
|
+
return __generator(this, function (_c) {
|
|
232
|
+
switch (_c.label) {
|
|
233
|
+
case 0:
|
|
234
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
235
|
+
return [2, deserializeAws_restJson1UploadDocumentsCommandError(output, context)];
|
|
236
|
+
}
|
|
237
|
+
contents = map({
|
|
238
|
+
$metadata: deserializeMetadata(output),
|
|
239
|
+
});
|
|
240
|
+
_a = __expectNonNull;
|
|
241
|
+
_b = __expectObject;
|
|
242
|
+
return [4, parseBody(output.body, context)];
|
|
243
|
+
case 1:
|
|
244
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
245
|
+
if (data.adds != null) {
|
|
246
|
+
contents.adds = __expectLong(data.adds);
|
|
247
|
+
}
|
|
248
|
+
if (data.deletes != null) {
|
|
249
|
+
contents.deletes = __expectLong(data.deletes);
|
|
250
|
+
}
|
|
251
|
+
if (data.status != null) {
|
|
252
|
+
contents.status = __expectString(data.status);
|
|
253
|
+
}
|
|
254
|
+
if (data.warnings != null) {
|
|
255
|
+
contents.warnings = deserializeAws_restJson1DocumentServiceWarnings(data.warnings, context);
|
|
256
|
+
}
|
|
257
|
+
return [2, contents];
|
|
258
|
+
}
|
|
134
259
|
});
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
const contents = map({
|
|
169
|
-
$metadata: deserializeMetadata(output),
|
|
260
|
+
}); };
|
|
261
|
+
var deserializeAws_restJson1UploadDocumentsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
262
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
263
|
+
var _c;
|
|
264
|
+
return __generator(this, function (_d) {
|
|
265
|
+
switch (_d.label) {
|
|
266
|
+
case 0:
|
|
267
|
+
_a = [__assign({}, output)];
|
|
268
|
+
_c = {};
|
|
269
|
+
return [4, parseErrorBody(output.body, context)];
|
|
270
|
+
case 1:
|
|
271
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
272
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
273
|
+
_b = errorCode;
|
|
274
|
+
switch (_b) {
|
|
275
|
+
case "DocumentServiceException": return [3, 2];
|
|
276
|
+
case "com.amazonaws.cloudsearchdomain#DocumentServiceException": return [3, 2];
|
|
277
|
+
}
|
|
278
|
+
return [3, 4];
|
|
279
|
+
case 2: return [4, deserializeAws_restJson1DocumentServiceExceptionResponse(parsedOutput, context)];
|
|
280
|
+
case 3: throw _d.sent();
|
|
281
|
+
case 4:
|
|
282
|
+
parsedBody = parsedOutput.body;
|
|
283
|
+
throwDefaultError({
|
|
284
|
+
output: output,
|
|
285
|
+
parsedBody: parsedBody,
|
|
286
|
+
exceptionCtor: __BaseException,
|
|
287
|
+
errorCode: errorCode,
|
|
288
|
+
});
|
|
289
|
+
_d.label = 5;
|
|
290
|
+
case 5: return [2];
|
|
291
|
+
}
|
|
170
292
|
});
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
contents
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
const deserializeAws_restJson1UploadDocumentsCommandError = async (output, context) => {
|
|
187
|
-
const parsedOutput = {
|
|
188
|
-
...output,
|
|
189
|
-
body: await parseErrorBody(output.body, context),
|
|
190
|
-
};
|
|
191
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
192
|
-
switch (errorCode) {
|
|
193
|
-
case "DocumentServiceException":
|
|
194
|
-
case "com.amazonaws.cloudsearchdomain#DocumentServiceException":
|
|
195
|
-
throw await deserializeAws_restJson1DocumentServiceExceptionResponse(parsedOutput, context);
|
|
196
|
-
default:
|
|
197
|
-
const parsedBody = parsedOutput.body;
|
|
198
|
-
throwDefaultError({
|
|
199
|
-
output,
|
|
200
|
-
parsedBody,
|
|
201
|
-
exceptionCtor: __BaseException,
|
|
202
|
-
errorCode,
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
const map = __map;
|
|
207
|
-
const deserializeAws_restJson1DocumentServiceExceptionResponse = async (parsedOutput, context) => {
|
|
208
|
-
const contents = map({});
|
|
209
|
-
const data = parsedOutput.body;
|
|
210
|
-
if (data.message != null) {
|
|
211
|
-
contents.message = __expectString(data.message);
|
|
212
|
-
}
|
|
213
|
-
if (data.status != null) {
|
|
214
|
-
contents.status = __expectString(data.status);
|
|
215
|
-
}
|
|
216
|
-
const exception = new DocumentServiceException({
|
|
217
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
218
|
-
...contents,
|
|
293
|
+
}); };
|
|
294
|
+
var map = __map;
|
|
295
|
+
var deserializeAws_restJson1DocumentServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
296
|
+
var contents, data, exception;
|
|
297
|
+
return __generator(this, function (_a) {
|
|
298
|
+
contents = map({});
|
|
299
|
+
data = parsedOutput.body;
|
|
300
|
+
if (data.message != null) {
|
|
301
|
+
contents.message = __expectString(data.message);
|
|
302
|
+
}
|
|
303
|
+
if (data.status != null) {
|
|
304
|
+
contents.status = __expectString(data.status);
|
|
305
|
+
}
|
|
306
|
+
exception = new DocumentServiceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
307
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
219
308
|
});
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
230
|
-
|
|
309
|
+
}); };
|
|
310
|
+
var deserializeAws_restJson1SearchExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
311
|
+
var contents, data, exception;
|
|
312
|
+
return __generator(this, function (_a) {
|
|
313
|
+
contents = map({});
|
|
314
|
+
data = parsedOutput.body;
|
|
315
|
+
if (data.message != null) {
|
|
316
|
+
contents.message = __expectString(data.message);
|
|
317
|
+
}
|
|
318
|
+
exception = new SearchException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
319
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
231
320
|
});
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
const deserializeAws_restJson1Bucket = (output, context) => {
|
|
321
|
+
}); };
|
|
322
|
+
var deserializeAws_restJson1Bucket = function (output, context) {
|
|
235
323
|
return {
|
|
236
324
|
count: __expectLong(output.count),
|
|
237
325
|
value: __expectString(output.value),
|
|
238
326
|
};
|
|
239
327
|
};
|
|
240
|
-
|
|
328
|
+
var deserializeAws_restJson1BucketInfo = function (output, context) {
|
|
241
329
|
return {
|
|
242
330
|
buckets: output.buckets != null ? deserializeAws_restJson1BucketList(output.buckets, context) : undefined,
|
|
243
331
|
};
|
|
244
332
|
};
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
.filter((e)
|
|
248
|
-
.map((entry)
|
|
333
|
+
var deserializeAws_restJson1BucketList = function (output, context) {
|
|
334
|
+
var retVal = (output || [])
|
|
335
|
+
.filter(function (e) { return e != null; })
|
|
336
|
+
.map(function (entry) {
|
|
249
337
|
if (entry === null) {
|
|
250
338
|
return null;
|
|
251
339
|
}
|
|
@@ -253,15 +341,15 @@ const deserializeAws_restJson1BucketList = (output, context) => {
|
|
|
253
341
|
});
|
|
254
342
|
return retVal;
|
|
255
343
|
};
|
|
256
|
-
|
|
344
|
+
var deserializeAws_restJson1DocumentServiceWarning = function (output, context) {
|
|
257
345
|
return {
|
|
258
346
|
message: __expectString(output.message),
|
|
259
347
|
};
|
|
260
348
|
};
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
.filter((e)
|
|
264
|
-
.map((entry)
|
|
349
|
+
var deserializeAws_restJson1DocumentServiceWarnings = function (output, context) {
|
|
350
|
+
var retVal = (output || [])
|
|
351
|
+
.filter(function (e) { return e != null; })
|
|
352
|
+
.map(function (entry) {
|
|
265
353
|
if (entry === null) {
|
|
266
354
|
return null;
|
|
267
355
|
}
|
|
@@ -269,40 +357,37 @@ const deserializeAws_restJson1DocumentServiceWarnings = (output, context) => {
|
|
|
269
357
|
});
|
|
270
358
|
return retVal;
|
|
271
359
|
};
|
|
272
|
-
|
|
273
|
-
return Object.entries(output).reduce((acc,
|
|
360
|
+
var deserializeAws_restJson1Exprs = function (output, context) {
|
|
361
|
+
return Object.entries(output).reduce(function (acc, _a) {
|
|
362
|
+
var _b;
|
|
363
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
274
364
|
if (value === null) {
|
|
275
365
|
return acc;
|
|
276
366
|
}
|
|
277
|
-
return {
|
|
278
|
-
...acc,
|
|
279
|
-
[key]: __expectString(value),
|
|
280
|
-
};
|
|
367
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
|
|
281
368
|
}, {});
|
|
282
369
|
};
|
|
283
|
-
|
|
284
|
-
return Object.entries(output).reduce((acc,
|
|
370
|
+
var deserializeAws_restJson1Facets = function (output, context) {
|
|
371
|
+
return Object.entries(output).reduce(function (acc, _a) {
|
|
372
|
+
var _b;
|
|
373
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
285
374
|
if (value === null) {
|
|
286
375
|
return acc;
|
|
287
376
|
}
|
|
288
|
-
return {
|
|
289
|
-
...acc,
|
|
290
|
-
[key]: deserializeAws_restJson1BucketInfo(value, context),
|
|
291
|
-
};
|
|
377
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1BucketInfo(value, context), _b));
|
|
292
378
|
}, {});
|
|
293
379
|
};
|
|
294
|
-
|
|
295
|
-
return Object.entries(output).reduce((acc,
|
|
380
|
+
var deserializeAws_restJson1Fields = function (output, context) {
|
|
381
|
+
return Object.entries(output).reduce(function (acc, _a) {
|
|
382
|
+
var _b;
|
|
383
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
296
384
|
if (value === null) {
|
|
297
385
|
return acc;
|
|
298
386
|
}
|
|
299
|
-
return {
|
|
300
|
-
...acc,
|
|
301
|
-
[key]: deserializeAws_restJson1FieldValue(value, context),
|
|
302
|
-
};
|
|
387
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1FieldValue(value, context), _b));
|
|
303
388
|
}, {});
|
|
304
389
|
};
|
|
305
|
-
|
|
390
|
+
var deserializeAws_restJson1FieldStats = function (output, context) {
|
|
306
391
|
return {
|
|
307
392
|
count: __expectLong(output.count),
|
|
308
393
|
max: __expectString(output.max),
|
|
@@ -314,10 +399,10 @@ const deserializeAws_restJson1FieldStats = (output, context) => {
|
|
|
314
399
|
sumOfSquares: __limitedParseDouble(output.sumOfSquares),
|
|
315
400
|
};
|
|
316
401
|
};
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
.filter((e)
|
|
320
|
-
.map((entry)
|
|
402
|
+
var deserializeAws_restJson1FieldValue = function (output, context) {
|
|
403
|
+
var retVal = (output || [])
|
|
404
|
+
.filter(function (e) { return e != null; })
|
|
405
|
+
.map(function (entry) {
|
|
321
406
|
if (entry === null) {
|
|
322
407
|
return null;
|
|
323
408
|
}
|
|
@@ -325,18 +410,17 @@ const deserializeAws_restJson1FieldValue = (output, context) => {
|
|
|
325
410
|
});
|
|
326
411
|
return retVal;
|
|
327
412
|
};
|
|
328
|
-
|
|
329
|
-
return Object.entries(output).reduce((acc,
|
|
413
|
+
var deserializeAws_restJson1Highlights = function (output, context) {
|
|
414
|
+
return Object.entries(output).reduce(function (acc, _a) {
|
|
415
|
+
var _b;
|
|
416
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
330
417
|
if (value === null) {
|
|
331
418
|
return acc;
|
|
332
419
|
}
|
|
333
|
-
return {
|
|
334
|
-
...acc,
|
|
335
|
-
[key]: __expectString(value),
|
|
336
|
-
};
|
|
420
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
|
|
337
421
|
}, {});
|
|
338
422
|
};
|
|
339
|
-
|
|
423
|
+
var deserializeAws_restJson1Hit = function (output, context) {
|
|
340
424
|
return {
|
|
341
425
|
exprs: output.exprs != null ? deserializeAws_restJson1Exprs(output.exprs, context) : undefined,
|
|
342
426
|
fields: output.fields != null ? deserializeAws_restJson1Fields(output.fields, context) : undefined,
|
|
@@ -344,10 +428,10 @@ const deserializeAws_restJson1Hit = (output, context) => {
|
|
|
344
428
|
id: __expectString(output.id),
|
|
345
429
|
};
|
|
346
430
|
};
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
.filter((e)
|
|
350
|
-
.map((entry)
|
|
431
|
+
var deserializeAws_restJson1HitList = function (output, context) {
|
|
432
|
+
var retVal = (output || [])
|
|
433
|
+
.filter(function (e) { return e != null; })
|
|
434
|
+
.map(function (entry) {
|
|
351
435
|
if (entry === null) {
|
|
352
436
|
return null;
|
|
353
437
|
}
|
|
@@ -355,7 +439,7 @@ const deserializeAws_restJson1HitList = (output, context) => {
|
|
|
355
439
|
});
|
|
356
440
|
return retVal;
|
|
357
441
|
};
|
|
358
|
-
|
|
442
|
+
var deserializeAws_restJson1Hits = function (output, context) {
|
|
359
443
|
return {
|
|
360
444
|
cursor: __expectString(output.cursor),
|
|
361
445
|
found: __expectLong(output.found),
|
|
@@ -363,34 +447,33 @@ const deserializeAws_restJson1Hits = (output, context) => {
|
|
|
363
447
|
start: __expectLong(output.start),
|
|
364
448
|
};
|
|
365
449
|
};
|
|
366
|
-
|
|
450
|
+
var deserializeAws_restJson1SearchStatus = function (output, context) {
|
|
367
451
|
return {
|
|
368
452
|
rid: __expectString(output.rid),
|
|
369
453
|
timems: __expectLong(output.timems),
|
|
370
454
|
};
|
|
371
455
|
};
|
|
372
|
-
|
|
373
|
-
return Object.entries(output).reduce((acc,
|
|
456
|
+
var deserializeAws_restJson1Stats = function (output, context) {
|
|
457
|
+
return Object.entries(output).reduce(function (acc, _a) {
|
|
458
|
+
var _b;
|
|
459
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
374
460
|
if (value === null) {
|
|
375
461
|
return acc;
|
|
376
462
|
}
|
|
377
|
-
return {
|
|
378
|
-
...acc,
|
|
379
|
-
[key]: deserializeAws_restJson1FieldStats(value, context),
|
|
380
|
-
};
|
|
463
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1FieldStats(value, context), _b));
|
|
381
464
|
}, {});
|
|
382
465
|
};
|
|
383
|
-
|
|
466
|
+
var deserializeAws_restJson1SuggestionMatch = function (output, context) {
|
|
384
467
|
return {
|
|
385
468
|
id: __expectString(output.id),
|
|
386
469
|
score: __expectLong(output.score),
|
|
387
470
|
suggestion: __expectString(output.suggestion),
|
|
388
471
|
};
|
|
389
472
|
};
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
.filter((e)
|
|
393
|
-
.map((entry)
|
|
473
|
+
var deserializeAws_restJson1Suggestions = function (output, context) {
|
|
474
|
+
var retVal = (output || [])
|
|
475
|
+
.filter(function (e) { return e != null; })
|
|
476
|
+
.map(function (entry) {
|
|
394
477
|
if (entry === null) {
|
|
395
478
|
return null;
|
|
396
479
|
}
|
|
@@ -398,52 +481,70 @@ const deserializeAws_restJson1Suggestions = (output, context) => {
|
|
|
398
481
|
});
|
|
399
482
|
return retVal;
|
|
400
483
|
};
|
|
401
|
-
|
|
484
|
+
var deserializeAws_restJson1SuggestModel = function (output, context) {
|
|
402
485
|
return {
|
|
403
486
|
found: __expectLong(output.found),
|
|
404
487
|
query: __expectString(output.query),
|
|
405
488
|
suggestions: output.suggestions != null ? deserializeAws_restJson1Suggestions(output.suggestions, context) : undefined,
|
|
406
489
|
};
|
|
407
490
|
};
|
|
408
|
-
|
|
491
|
+
var deserializeAws_restJson1SuggestStatus = function (output, context) {
|
|
409
492
|
return {
|
|
410
493
|
rid: __expectString(output.rid),
|
|
411
494
|
timems: __expectLong(output.timems),
|
|
412
495
|
};
|
|
413
496
|
};
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
497
|
+
var deserializeMetadata = function (output) {
|
|
498
|
+
var _a, _b;
|
|
499
|
+
return ({
|
|
500
|
+
httpStatusCode: output.statusCode,
|
|
501
|
+
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"],
|
|
502
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
503
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
504
|
+
});
|
|
505
|
+
};
|
|
506
|
+
var collectBody = function (streamBody, context) {
|
|
507
|
+
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
421
508
|
if (streamBody instanceof Uint8Array) {
|
|
422
509
|
return Promise.resolve(streamBody);
|
|
423
510
|
}
|
|
424
511
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
425
512
|
};
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
}
|
|
436
|
-
return {};
|
|
437
|
-
});
|
|
438
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
439
|
-
const value = await parseBody(errorBody, context);
|
|
440
|
-
value.message = value.message ?? value.Message;
|
|
441
|
-
return value;
|
|
513
|
+
var collectBodyString = function (streamBody, context) {
|
|
514
|
+
return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
|
|
515
|
+
};
|
|
516
|
+
var isSerializableHeaderValue = function (value) {
|
|
517
|
+
return value !== undefined &&
|
|
518
|
+
value !== null &&
|
|
519
|
+
value !== "" &&
|
|
520
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
521
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
442
522
|
};
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
523
|
+
var parseBody = function (streamBody, context) {
|
|
524
|
+
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
525
|
+
if (encoded.length) {
|
|
526
|
+
return JSON.parse(encoded);
|
|
527
|
+
}
|
|
528
|
+
return {};
|
|
529
|
+
});
|
|
530
|
+
};
|
|
531
|
+
var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
532
|
+
var value;
|
|
533
|
+
var _a;
|
|
534
|
+
return __generator(this, function (_b) {
|
|
535
|
+
switch (_b.label) {
|
|
536
|
+
case 0: return [4, parseBody(errorBody, context)];
|
|
537
|
+
case 1:
|
|
538
|
+
value = _b.sent();
|
|
539
|
+
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
540
|
+
return [2, value];
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
}); };
|
|
544
|
+
var loadRestJsonErrorCode = function (output, data) {
|
|
545
|
+
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
546
|
+
var sanitizeErrorCode = function (rawValue) {
|
|
547
|
+
var cleanValue = rawValue;
|
|
447
548
|
if (typeof cleanValue === "number") {
|
|
448
549
|
cleanValue = cleanValue.toString();
|
|
449
550
|
}
|
|
@@ -458,7 +559,7 @@ const loadRestJsonErrorCode = (output, data) => {
|
|
|
458
559
|
}
|
|
459
560
|
return cleanValue;
|
|
460
561
|
};
|
|
461
|
-
|
|
562
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
462
563
|
if (headerKey !== undefined) {
|
|
463
564
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
464
565
|
}
|