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