@wildix/wim-cache-client 1.0.1 → 1.0.2
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/dist-cjs/WimCache.js +2 -0
- package/dist-cjs/WimCacheClient.js +14 -8
- package/dist-cjs/commands/DeleteEntitiesFromGeneralCacheCommand.js +12 -32
- package/dist-cjs/commands/GetEntitiesByIdsCommand.js +12 -32
- package/dist-cjs/commands/PutEntitiesToGeneralCacheCommand.js +12 -32
- package/dist-cjs/commands/SearchEntitiesByListParamsCommand.js +12 -32
- package/dist-cjs/commands/SearchEntitiesByParamsCommand.js +12 -32
- package/dist-cjs/commands/SyncCacheCommand.js +12 -32
- package/dist-cjs/commands/UpdateEntitiesWeightCommand.js +21 -0
- package/dist-cjs/commands/index.js +1 -0
- package/dist-cjs/models/models_0.js +16 -3
- package/dist-cjs/protocols/Aws_restJson1.js +118 -233
- package/dist-cjs/runtimeConfig.browser.js +5 -1
- package/dist-cjs/runtimeConfig.js +8 -3
- package/dist-cjs/runtimeConfig.shared.js +13 -11
- package/dist-cjs/runtimeExtensions.js +2 -10
- package/dist-es/WimCache.js +2 -0
- package/dist-es/WimCacheClient.js +15 -9
- package/dist-es/commands/DeleteEntitiesFromGeneralCacheCommand.js +12 -32
- package/dist-es/commands/GetEntitiesByIdsCommand.js +12 -32
- package/dist-es/commands/PutEntitiesToGeneralCacheCommand.js +12 -32
- package/dist-es/commands/SearchEntitiesByListParamsCommand.js +12 -32
- package/dist-es/commands/SearchEntitiesByParamsCommand.js +12 -32
- package/dist-es/commands/SyncCacheCommand.js +12 -32
- package/dist-es/commands/UpdateEntitiesWeightCommand.js +17 -0
- package/dist-es/commands/index.js +1 -0
- package/dist-es/models/models_0.js +14 -2
- package/dist-es/protocols/Aws_restJson1.js +109 -226
- package/dist-es/runtimeConfig.browser.js +4 -1
- package/dist-es/runtimeConfig.js +7 -3
- package/dist-es/runtimeConfig.shared.js +13 -11
- package/dist-es/runtimeExtensions.js +2 -10
- package/dist-types/WimCache.d.ts +10 -0
- package/dist-types/WimCacheClient.d.ts +19 -11
- package/dist-types/commands/DeleteEntitiesFromGeneralCacheCommand.d.ts +24 -21
- package/dist-types/commands/GetEntitiesByIdsCommand.d.ts +25 -21
- package/dist-types/commands/PutEntitiesToGeneralCacheCommand.d.ts +24 -21
- package/dist-types/commands/SearchEntitiesByListParamsCommand.d.ts +25 -21
- package/dist-types/commands/SearchEntitiesByParamsCommand.d.ts +25 -21
- package/dist-types/commands/SyncCacheCommand.d.ts +24 -21
- package/dist-types/commands/UpdateEntitiesWeightCommand.d.ts +79 -0
- package/dist-types/commands/index.d.ts +1 -0
- package/dist-types/index.d.ts +2 -0
- package/dist-types/models/WimCacheServiceException.d.ts +2 -1
- package/dist-types/models/models_0.d.ts +104 -71
- package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
- package/dist-types/runtimeConfig.browser.d.ts +7 -5
- package/dist-types/runtimeConfig.d.ts +7 -5
- package/dist-types/runtimeConfig.native.d.ts +7 -5
- package/package.json +42 -36
|
@@ -1,146 +1,134 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_SyncCacheCommand = exports.de_SearchEntitiesByParamsCommand = exports.de_SearchEntitiesByListParamsCommand = exports.de_PutEntitiesToGeneralCacheCommand = exports.de_GetEntitiesByIdsCommand = exports.de_DeleteEntitiesFromGeneralCacheCommand = exports.se_SyncCacheCommand = exports.se_SearchEntitiesByParamsCommand = exports.se_SearchEntitiesByListParamsCommand = exports.se_PutEntitiesToGeneralCacheCommand = exports.se_GetEntitiesByIdsCommand = exports.se_DeleteEntitiesFromGeneralCacheCommand = void 0;
|
|
3
|
+
exports.de_UpdateEntitiesWeightCommand = exports.de_SyncCacheCommand = exports.de_SearchEntitiesByParamsCommand = exports.de_SearchEntitiesByListParamsCommand = exports.de_PutEntitiesToGeneralCacheCommand = exports.de_GetEntitiesByIdsCommand = exports.de_DeleteEntitiesFromGeneralCacheCommand = exports.se_UpdateEntitiesWeightCommand = exports.se_SyncCacheCommand = exports.se_SearchEntitiesByParamsCommand = exports.se_SearchEntitiesByListParamsCommand = exports.se_PutEntitiesToGeneralCacheCommand = exports.se_GetEntitiesByIdsCommand = exports.se_DeleteEntitiesFromGeneralCacheCommand = void 0;
|
|
4
4
|
const WimCacheServiceException_1 = require("../models/WimCacheServiceException");
|
|
5
5
|
const models_0_1 = require("../models/models_0");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@aws-sdk/core");
|
|
7
|
+
const core_2 = require("@smithy/core");
|
|
7
8
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
8
9
|
const se_DeleteEntitiesFromGeneralCacheCommand = async (input, context) => {
|
|
9
|
-
const
|
|
10
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
10
11
|
const headers = {};
|
|
11
|
-
|
|
12
|
+
b.bp("/v1/cache/general");
|
|
12
13
|
const query = (0, smithy_client_1.map)({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
[_e]: [, input[_e]],
|
|
15
|
+
[_p]: [, input[_p]],
|
|
16
|
+
[_c]: [() => input.clean !== void 0, () => (input[_c].toString())],
|
|
16
17
|
});
|
|
17
18
|
let body;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
headers,
|
|
24
|
-
path: resolvedPath,
|
|
25
|
-
query,
|
|
26
|
-
body,
|
|
27
|
-
});
|
|
19
|
+
b.m("DELETE")
|
|
20
|
+
.h(headers)
|
|
21
|
+
.q(query)
|
|
22
|
+
.b(body);
|
|
23
|
+
return b.build();
|
|
28
24
|
};
|
|
29
25
|
exports.se_DeleteEntitiesFromGeneralCacheCommand = se_DeleteEntitiesFromGeneralCacheCommand;
|
|
30
26
|
const se_GetEntitiesByIdsCommand = async (input, context) => {
|
|
31
|
-
const
|
|
27
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
32
28
|
const headers = {
|
|
33
29
|
'content-type': 'application/json',
|
|
34
30
|
};
|
|
35
|
-
|
|
31
|
+
b.bp("/v1/cache/object");
|
|
36
32
|
let body;
|
|
37
33
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
38
34
|
'entityIds': _ => (0, smithy_client_1._json)(_),
|
|
39
35
|
'organizationId': [],
|
|
40
36
|
}));
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
method: "POST",
|
|
46
|
-
headers,
|
|
47
|
-
path: resolvedPath,
|
|
48
|
-
body,
|
|
49
|
-
});
|
|
37
|
+
b.m("POST")
|
|
38
|
+
.h(headers)
|
|
39
|
+
.b(body);
|
|
40
|
+
return b.build();
|
|
50
41
|
};
|
|
51
42
|
exports.se_GetEntitiesByIdsCommand = se_GetEntitiesByIdsCommand;
|
|
52
43
|
const se_PutEntitiesToGeneralCacheCommand = async (input, context) => {
|
|
53
|
-
const
|
|
44
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
54
45
|
const headers = {
|
|
55
46
|
'content-type': 'application/json',
|
|
56
47
|
};
|
|
57
|
-
|
|
48
|
+
b.bp("/v1/cache/general");
|
|
58
49
|
let body;
|
|
59
50
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
60
51
|
'items': _ => (0, smithy_client_1._json)(_),
|
|
61
52
|
}));
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
method: "PUT",
|
|
67
|
-
headers,
|
|
68
|
-
path: resolvedPath,
|
|
69
|
-
body,
|
|
70
|
-
});
|
|
53
|
+
b.m("PUT")
|
|
54
|
+
.h(headers)
|
|
55
|
+
.b(body);
|
|
56
|
+
return b.build();
|
|
71
57
|
};
|
|
72
58
|
exports.se_PutEntitiesToGeneralCacheCommand = se_PutEntitiesToGeneralCacheCommand;
|
|
73
59
|
const se_SearchEntitiesByListParamsCommand = async (input, context) => {
|
|
74
|
-
const
|
|
60
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
75
61
|
const headers = {
|
|
76
62
|
'content-type': 'application/json',
|
|
77
63
|
};
|
|
78
|
-
|
|
64
|
+
b.bp("/v1/cache/search");
|
|
79
65
|
let body;
|
|
80
66
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
81
67
|
'organizationId': [],
|
|
82
68
|
'params': _ => (0, smithy_client_1._json)(_),
|
|
83
69
|
}));
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
method: "POST",
|
|
89
|
-
headers,
|
|
90
|
-
path: resolvedPath,
|
|
91
|
-
body,
|
|
92
|
-
});
|
|
70
|
+
b.m("POST")
|
|
71
|
+
.h(headers)
|
|
72
|
+
.b(body);
|
|
73
|
+
return b.build();
|
|
93
74
|
};
|
|
94
75
|
exports.se_SearchEntitiesByListParamsCommand = se_SearchEntitiesByListParamsCommand;
|
|
95
76
|
const se_SearchEntitiesByParamsCommand = async (input, context) => {
|
|
96
|
-
const
|
|
77
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
97
78
|
const headers = {};
|
|
98
|
-
|
|
79
|
+
b.bp("/v1/cache/search");
|
|
99
80
|
const query = (0, smithy_client_1.map)({
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
81
|
+
[_oI]: [, input[_oI]],
|
|
82
|
+
[_p]: [, input[_p]],
|
|
83
|
+
[_e]: [, input[_e]],
|
|
84
|
+
[_q]: [, input[_q]],
|
|
85
|
+
[_f]: [() => input.from !== void 0, () => (input[_f].toString())],
|
|
86
|
+
[_s]: [() => input.size !== void 0, () => (input[_s].toString())],
|
|
106
87
|
});
|
|
107
88
|
let body;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
headers,
|
|
114
|
-
path: resolvedPath,
|
|
115
|
-
query,
|
|
116
|
-
body,
|
|
117
|
-
});
|
|
89
|
+
b.m("GET")
|
|
90
|
+
.h(headers)
|
|
91
|
+
.q(query)
|
|
92
|
+
.b(body);
|
|
93
|
+
return b.build();
|
|
118
94
|
};
|
|
119
95
|
exports.se_SearchEntitiesByParamsCommand = se_SearchEntitiesByParamsCommand;
|
|
120
96
|
const se_SyncCacheCommand = async (input, context) => {
|
|
121
|
-
const
|
|
97
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
122
98
|
const headers = {
|
|
123
99
|
'content-type': 'application/json',
|
|
124
100
|
};
|
|
125
|
-
|
|
101
|
+
b.bp("/v1/cache/sync");
|
|
126
102
|
let body;
|
|
127
103
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
128
104
|
'organizationId': [],
|
|
129
105
|
}));
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
method: "POST",
|
|
135
|
-
headers,
|
|
136
|
-
path: resolvedPath,
|
|
137
|
-
body,
|
|
138
|
-
});
|
|
106
|
+
b.m("POST")
|
|
107
|
+
.h(headers)
|
|
108
|
+
.b(body);
|
|
109
|
+
return b.build();
|
|
139
110
|
};
|
|
140
111
|
exports.se_SyncCacheCommand = se_SyncCacheCommand;
|
|
112
|
+
const se_UpdateEntitiesWeightCommand = async (input, context) => {
|
|
113
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
114
|
+
const headers = {
|
|
115
|
+
'content-type': 'application/json',
|
|
116
|
+
};
|
|
117
|
+
b.bp("/v1/cache/weight");
|
|
118
|
+
let body;
|
|
119
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
120
|
+
'entityIds': _ => (0, smithy_client_1._json)(_),
|
|
121
|
+
'organizationId': [],
|
|
122
|
+
}));
|
|
123
|
+
b.m("POST")
|
|
124
|
+
.h(headers)
|
|
125
|
+
.b(body);
|
|
126
|
+
return b.build();
|
|
127
|
+
};
|
|
128
|
+
exports.se_UpdateEntitiesWeightCommand = se_UpdateEntitiesWeightCommand;
|
|
141
129
|
const de_DeleteEntitiesFromGeneralCacheCommand = async (output, context) => {
|
|
142
130
|
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
143
|
-
return
|
|
131
|
+
return de_CommandError(output, context);
|
|
144
132
|
}
|
|
145
133
|
const contents = (0, smithy_client_1.map)({
|
|
146
134
|
$metadata: deserializeMetadata(output),
|
|
@@ -149,33 +137,14 @@ const de_DeleteEntitiesFromGeneralCacheCommand = async (output, context) => {
|
|
|
149
137
|
return contents;
|
|
150
138
|
};
|
|
151
139
|
exports.de_DeleteEntitiesFromGeneralCacheCommand = de_DeleteEntitiesFromGeneralCacheCommand;
|
|
152
|
-
const de_DeleteEntitiesFromGeneralCacheCommandError = async (output, context) => {
|
|
153
|
-
const parsedOutput = {
|
|
154
|
-
...output,
|
|
155
|
-
body: await parseErrorBody(output.body, context)
|
|
156
|
-
};
|
|
157
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
158
|
-
switch (errorCode) {
|
|
159
|
-
case "ValidationException":
|
|
160
|
-
case "smithy.framework#ValidationException":
|
|
161
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
162
|
-
default:
|
|
163
|
-
const parsedBody = parsedOutput.body;
|
|
164
|
-
return throwDefaultError({
|
|
165
|
-
output,
|
|
166
|
-
parsedBody,
|
|
167
|
-
errorCode
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
140
|
const de_GetEntitiesByIdsCommand = async (output, context) => {
|
|
172
141
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
173
|
-
return
|
|
142
|
+
return de_CommandError(output, context);
|
|
174
143
|
}
|
|
175
144
|
const contents = (0, smithy_client_1.map)({
|
|
176
145
|
$metadata: deserializeMetadata(output),
|
|
177
146
|
});
|
|
178
|
-
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await
|
|
147
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
179
148
|
const doc = (0, smithy_client_1.take)(data, {
|
|
180
149
|
'items': smithy_client_1._json,
|
|
181
150
|
});
|
|
@@ -183,28 +152,9 @@ const de_GetEntitiesByIdsCommand = async (output, context) => {
|
|
|
183
152
|
return contents;
|
|
184
153
|
};
|
|
185
154
|
exports.de_GetEntitiesByIdsCommand = de_GetEntitiesByIdsCommand;
|
|
186
|
-
const de_GetEntitiesByIdsCommandError = 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 "ValidationException":
|
|
194
|
-
case "smithy.framework#ValidationException":
|
|
195
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
196
|
-
default:
|
|
197
|
-
const parsedBody = parsedOutput.body;
|
|
198
|
-
return throwDefaultError({
|
|
199
|
-
output,
|
|
200
|
-
parsedBody,
|
|
201
|
-
errorCode
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
155
|
const de_PutEntitiesToGeneralCacheCommand = async (output, context) => {
|
|
206
156
|
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
207
|
-
return
|
|
157
|
+
return de_CommandError(output, context);
|
|
208
158
|
}
|
|
209
159
|
const contents = (0, smithy_client_1.map)({
|
|
210
160
|
$metadata: deserializeMetadata(output),
|
|
@@ -213,33 +163,14 @@ const de_PutEntitiesToGeneralCacheCommand = async (output, context) => {
|
|
|
213
163
|
return contents;
|
|
214
164
|
};
|
|
215
165
|
exports.de_PutEntitiesToGeneralCacheCommand = de_PutEntitiesToGeneralCacheCommand;
|
|
216
|
-
const de_PutEntitiesToGeneralCacheCommandError = async (output, context) => {
|
|
217
|
-
const parsedOutput = {
|
|
218
|
-
...output,
|
|
219
|
-
body: await parseErrorBody(output.body, context)
|
|
220
|
-
};
|
|
221
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
222
|
-
switch (errorCode) {
|
|
223
|
-
case "ValidationException":
|
|
224
|
-
case "smithy.framework#ValidationException":
|
|
225
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
226
|
-
default:
|
|
227
|
-
const parsedBody = parsedOutput.body;
|
|
228
|
-
return throwDefaultError({
|
|
229
|
-
output,
|
|
230
|
-
parsedBody,
|
|
231
|
-
errorCode
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
166
|
const de_SearchEntitiesByListParamsCommand = async (output, context) => {
|
|
236
167
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
237
|
-
return
|
|
168
|
+
return de_CommandError(output, context);
|
|
238
169
|
}
|
|
239
170
|
const contents = (0, smithy_client_1.map)({
|
|
240
171
|
$metadata: deserializeMetadata(output),
|
|
241
172
|
});
|
|
242
|
-
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await
|
|
173
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
243
174
|
const doc = (0, smithy_client_1.take)(data, {
|
|
244
175
|
'items': smithy_client_1._json,
|
|
245
176
|
});
|
|
@@ -247,33 +178,14 @@ const de_SearchEntitiesByListParamsCommand = async (output, context) => {
|
|
|
247
178
|
return contents;
|
|
248
179
|
};
|
|
249
180
|
exports.de_SearchEntitiesByListParamsCommand = de_SearchEntitiesByListParamsCommand;
|
|
250
|
-
const de_SearchEntitiesByListParamsCommandError = async (output, context) => {
|
|
251
|
-
const parsedOutput = {
|
|
252
|
-
...output,
|
|
253
|
-
body: await parseErrorBody(output.body, context)
|
|
254
|
-
};
|
|
255
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
256
|
-
switch (errorCode) {
|
|
257
|
-
case "ValidationException":
|
|
258
|
-
case "smithy.framework#ValidationException":
|
|
259
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
260
|
-
default:
|
|
261
|
-
const parsedBody = parsedOutput.body;
|
|
262
|
-
return throwDefaultError({
|
|
263
|
-
output,
|
|
264
|
-
parsedBody,
|
|
265
|
-
errorCode
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
181
|
const de_SearchEntitiesByParamsCommand = async (output, context) => {
|
|
270
182
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
271
|
-
return
|
|
183
|
+
return de_CommandError(output, context);
|
|
272
184
|
}
|
|
273
185
|
const contents = (0, smithy_client_1.map)({
|
|
274
186
|
$metadata: deserializeMetadata(output),
|
|
275
187
|
});
|
|
276
|
-
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await
|
|
188
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
277
189
|
const doc = (0, smithy_client_1.take)(data, {
|
|
278
190
|
'items': smithy_client_1._json,
|
|
279
191
|
});
|
|
@@ -281,33 +193,14 @@ const de_SearchEntitiesByParamsCommand = async (output, context) => {
|
|
|
281
193
|
return contents;
|
|
282
194
|
};
|
|
283
195
|
exports.de_SearchEntitiesByParamsCommand = de_SearchEntitiesByParamsCommand;
|
|
284
|
-
const de_SearchEntitiesByParamsCommandError = async (output, context) => {
|
|
285
|
-
const parsedOutput = {
|
|
286
|
-
...output,
|
|
287
|
-
body: await parseErrorBody(output.body, context)
|
|
288
|
-
};
|
|
289
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
290
|
-
switch (errorCode) {
|
|
291
|
-
case "ValidationException":
|
|
292
|
-
case "smithy.framework#ValidationException":
|
|
293
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
294
|
-
default:
|
|
295
|
-
const parsedBody = parsedOutput.body;
|
|
296
|
-
return throwDefaultError({
|
|
297
|
-
output,
|
|
298
|
-
parsedBody,
|
|
299
|
-
errorCode
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
196
|
const de_SyncCacheCommand = async (output, context) => {
|
|
304
197
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
305
|
-
return
|
|
198
|
+
return de_CommandError(output, context);
|
|
306
199
|
}
|
|
307
200
|
const contents = (0, smithy_client_1.map)({
|
|
308
201
|
$metadata: deserializeMetadata(output),
|
|
309
202
|
});
|
|
310
|
-
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await
|
|
203
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
311
204
|
const doc = (0, smithy_client_1.take)(data, {
|
|
312
205
|
'success': smithy_client_1.expectBoolean,
|
|
313
206
|
});
|
|
@@ -315,13 +208,31 @@ const de_SyncCacheCommand = async (output, context) => {
|
|
|
315
208
|
return contents;
|
|
316
209
|
};
|
|
317
210
|
exports.de_SyncCacheCommand = de_SyncCacheCommand;
|
|
318
|
-
const
|
|
211
|
+
const de_UpdateEntitiesWeightCommand = async (output, context) => {
|
|
212
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
213
|
+
return de_CommandError(output, context);
|
|
214
|
+
}
|
|
215
|
+
const contents = (0, smithy_client_1.map)({
|
|
216
|
+
$metadata: deserializeMetadata(output),
|
|
217
|
+
});
|
|
218
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
219
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
220
|
+
'success': smithy_client_1.expectBoolean,
|
|
221
|
+
});
|
|
222
|
+
Object.assign(contents, doc);
|
|
223
|
+
return contents;
|
|
224
|
+
};
|
|
225
|
+
exports.de_UpdateEntitiesWeightCommand = de_UpdateEntitiesWeightCommand;
|
|
226
|
+
const de_CommandError = async (output, context) => {
|
|
319
227
|
const parsedOutput = {
|
|
320
228
|
...output,
|
|
321
|
-
body: await
|
|
229
|
+
body: await (0, core_1.parseJsonErrorBody)(output.body, context)
|
|
322
230
|
};
|
|
323
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
231
|
+
const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
324
232
|
switch (errorCode) {
|
|
233
|
+
case "ForbiddenException":
|
|
234
|
+
case "smithy.framework#ForbiddenException":
|
|
235
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
325
236
|
case "ValidationException":
|
|
326
237
|
case "smithy.framework#ValidationException":
|
|
327
238
|
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
@@ -335,6 +246,19 @@ const de_SyncCacheCommandError = async (output, context) => {
|
|
|
335
246
|
}
|
|
336
247
|
};
|
|
337
248
|
const throwDefaultError = (0, smithy_client_1.withBaseException)(WimCacheServiceException_1.WimCacheServiceException);
|
|
249
|
+
const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
|
|
250
|
+
const contents = (0, smithy_client_1.map)({});
|
|
251
|
+
const data = parsedOutput.body;
|
|
252
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
253
|
+
'message': smithy_client_1.expectString,
|
|
254
|
+
});
|
|
255
|
+
Object.assign(contents, doc);
|
|
256
|
+
const exception = new models_0_1.ForbiddenException({
|
|
257
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
258
|
+
...contents
|
|
259
|
+
});
|
|
260
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
261
|
+
};
|
|
338
262
|
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
339
263
|
const contents = (0, smithy_client_1.map)({});
|
|
340
264
|
const data = parsedOutput.body;
|
|
@@ -355,49 +279,10 @@ const deserializeMetadata = (output) => ({
|
|
|
355
279
|
cfId: output.headers["x-amz-cf-id"],
|
|
356
280
|
});
|
|
357
281
|
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
if (encoded.length) {
|
|
366
|
-
return JSON.parse(encoded);
|
|
367
|
-
}
|
|
368
|
-
return {};
|
|
369
|
-
});
|
|
370
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
371
|
-
const value = await parseBody(errorBody, context);
|
|
372
|
-
value.message = value.message ?? value.Message;
|
|
373
|
-
return value;
|
|
374
|
-
};
|
|
375
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
376
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
377
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
378
|
-
let cleanValue = rawValue;
|
|
379
|
-
if (typeof cleanValue === "number") {
|
|
380
|
-
cleanValue = cleanValue.toString();
|
|
381
|
-
}
|
|
382
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
383
|
-
cleanValue = cleanValue.split(",")[0];
|
|
384
|
-
}
|
|
385
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
386
|
-
cleanValue = cleanValue.split(":")[0];
|
|
387
|
-
}
|
|
388
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
389
|
-
cleanValue = cleanValue.split("#")[1];
|
|
390
|
-
}
|
|
391
|
-
return cleanValue;
|
|
392
|
-
};
|
|
393
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
394
|
-
if (headerKey !== undefined) {
|
|
395
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
396
|
-
}
|
|
397
|
-
if (data.code !== undefined) {
|
|
398
|
-
return sanitizeErrorCode(data.code);
|
|
399
|
-
}
|
|
400
|
-
if (data["__type"] !== undefined) {
|
|
401
|
-
return sanitizeErrorCode(data["__type"]);
|
|
402
|
-
}
|
|
403
|
-
};
|
|
282
|
+
const _c = "clean";
|
|
283
|
+
const _e = "email";
|
|
284
|
+
const _f = "from";
|
|
285
|
+
const _oI = "organizationId";
|
|
286
|
+
const _p = "phone";
|
|
287
|
+
const _q = "query";
|
|
288
|
+
const _s = "size";
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
4
6
|
const sha256_browser_1 = require("@aws-crypto/sha256-browser");
|
|
7
|
+
const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
|
|
5
8
|
const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
|
|
6
9
|
const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
|
|
7
10
|
const util_retry_1 = require("@smithy/util-retry");
|
|
@@ -18,8 +21,9 @@ const getRuntimeConfig = (config) => {
|
|
|
18
21
|
runtime: "browser",
|
|
19
22
|
defaultsMode,
|
|
20
23
|
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
|
|
24
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_browser_1.createDefaultUserAgentProvider)({ serviceId: package_json_1.default.name, clientVersion: package_json_1.default.version }),
|
|
21
25
|
maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
|
|
22
|
-
requestHandler: config?.requestHandler ??
|
|
26
|
+
requestHandler: fetch_http_handler_1.FetchHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
23
27
|
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
|
|
24
28
|
sha256: config?.sha256 ?? sha256_browser_1.Sha256,
|
|
25
29
|
streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
6
|
+
const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
|
|
4
7
|
const hash_node_1 = require("@smithy/hash-node");
|
|
5
8
|
const middleware_retry_1 = require("@smithy/middleware-retry");
|
|
6
9
|
const node_config_provider_1 = require("@smithy/node-config-provider");
|
|
@@ -22,11 +25,13 @@ const getRuntimeConfig = (config) => {
|
|
|
22
25
|
runtime: "node",
|
|
23
26
|
defaultsMode,
|
|
24
27
|
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: package_json_1.default.name, clientVersion: package_json_1.default.version }),
|
|
29
|
+
maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
30
|
+
requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
31
|
+
retryMode: config?.retryMode ?? (0, node_config_provider_1.loadConfig)({ ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, }, config),
|
|
28
32
|
sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
|
|
29
33
|
streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
|
|
34
|
+
userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, { profile: 'wildix' }),
|
|
30
35
|
};
|
|
31
36
|
};
|
|
32
37
|
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -5,15 +5,17 @@ const smithy_client_1 = require("@smithy/smithy-client");
|
|
|
5
5
|
const url_parser_1 = require("@smithy/url-parser");
|
|
6
6
|
const util_base64_1 = require("@smithy/util-base64");
|
|
7
7
|
const util_utf8_1 = require("@smithy/util-utf8");
|
|
8
|
-
const getRuntimeConfig = (config) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
const getRuntimeConfig = (config) => {
|
|
9
|
+
return {
|
|
10
|
+
apiVersion: "v2",
|
|
11
|
+
base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
|
|
12
|
+
base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
|
|
13
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
14
|
+
extensions: config?.extensions ?? [],
|
|
15
|
+
logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
|
|
16
|
+
urlParser: config?.urlParser ?? url_parser_1.parseUrl,
|
|
17
|
+
utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
|
|
18
|
+
utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
19
21
|
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -3,17 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.resolveRuntimeExtensions = void 0;
|
|
4
4
|
const protocol_http_1 = require("@smithy/protocol-http");
|
|
5
5
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
|
-
const asPartial = (t) => t;
|
|
7
6
|
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
8
|
-
const extensionConfiguration =
|
|
9
|
-
...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
|
|
10
|
-
...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
|
|
11
|
-
};
|
|
7
|
+
const extensionConfiguration = Object.assign((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig));
|
|
12
8
|
extensions.forEach(extension => extension.configure(extensionConfiguration));
|
|
13
|
-
return
|
|
14
|
-
...runtimeConfig,
|
|
15
|
-
...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
|
|
16
|
-
...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
|
|
17
|
-
};
|
|
9
|
+
return Object.assign(runtimeConfig, (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration));
|
|
18
10
|
};
|
|
19
11
|
exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
|
package/dist-es/WimCache.js
CHANGED
|
@@ -5,6 +5,7 @@ import { PutEntitiesToGeneralCacheCommand, } from "./commands/PutEntitiesToGener
|
|
|
5
5
|
import { SearchEntitiesByListParamsCommand, } from "./commands/SearchEntitiesByListParamsCommand";
|
|
6
6
|
import { SearchEntitiesByParamsCommand, } from "./commands/SearchEntitiesByParamsCommand";
|
|
7
7
|
import { SyncCacheCommand, } from "./commands/SyncCacheCommand";
|
|
8
|
+
import { UpdateEntitiesWeightCommand, } from "./commands/UpdateEntitiesWeightCommand";
|
|
8
9
|
import { createAggregatedClient } from "@smithy/smithy-client";
|
|
9
10
|
const commands = {
|
|
10
11
|
DeleteEntitiesFromGeneralCacheCommand,
|
|
@@ -13,6 +14,7 @@ const commands = {
|
|
|
13
14
|
SearchEntitiesByListParamsCommand,
|
|
14
15
|
SearchEntitiesByParamsCommand,
|
|
15
16
|
SyncCacheCommand,
|
|
17
|
+
UpdateEntitiesWeightCommand,
|
|
16
18
|
};
|
|
17
19
|
export class WimCache extends WimCacheClient {
|
|
18
20
|
}
|