@wildix/wim-cache-client 1.0.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.
Files changed (61) hide show
  1. package/dist-cjs/WimCache.js +23 -0
  2. package/dist-cjs/WimCacheClient.js +35 -0
  3. package/dist-cjs/commands/DeleteEntitiesFromGeneralCacheCommand.js +41 -0
  4. package/dist-cjs/commands/GetEntitiesByIdsCommand.js +41 -0
  5. package/dist-cjs/commands/PutEntitiesToGeneralCacheCommand.js +41 -0
  6. package/dist-cjs/commands/SearchEntitiesByListParamsCommand.js +41 -0
  7. package/dist-cjs/commands/SearchEntitiesByParamsCommand.js +41 -0
  8. package/dist-cjs/commands/SyncCacheCommand.js +41 -0
  9. package/dist-cjs/commands/index.js +9 -0
  10. package/dist-cjs/extensionConfiguration.js +2 -0
  11. package/dist-cjs/index.js +10 -0
  12. package/dist-cjs/models/WimCacheServiceException.js +12 -0
  13. package/dist-cjs/models/index.js +4 -0
  14. package/dist-cjs/models/models_0.js +17 -0
  15. package/dist-cjs/protocols/Aws_restJson1.js +403 -0
  16. package/dist-cjs/runtimeConfig.browser.js +28 -0
  17. package/dist-cjs/runtimeConfig.js +32 -0
  18. package/dist-cjs/runtimeConfig.native.js +15 -0
  19. package/dist-cjs/runtimeConfig.shared.js +19 -0
  20. package/dist-cjs/runtimeExtensions.js +19 -0
  21. package/dist-es/WimCache.js +19 -0
  22. package/dist-es/WimCacheClient.js +31 -0
  23. package/dist-es/commands/DeleteEntitiesFromGeneralCacheCommand.js +37 -0
  24. package/dist-es/commands/GetEntitiesByIdsCommand.js +37 -0
  25. package/dist-es/commands/PutEntitiesToGeneralCacheCommand.js +37 -0
  26. package/dist-es/commands/SearchEntitiesByListParamsCommand.js +37 -0
  27. package/dist-es/commands/SearchEntitiesByParamsCommand.js +37 -0
  28. package/dist-es/commands/SyncCacheCommand.js +37 -0
  29. package/dist-es/commands/index.js +6 -0
  30. package/dist-es/extensionConfiguration.js +1 -0
  31. package/dist-es/index.js +5 -0
  32. package/dist-es/models/WimCacheServiceException.js +8 -0
  33. package/dist-es/models/index.js +1 -0
  34. package/dist-es/models/models_0.js +13 -0
  35. package/dist-es/protocols/Aws_restJson1.js +388 -0
  36. package/dist-es/runtimeConfig.browser.js +24 -0
  37. package/dist-es/runtimeConfig.js +28 -0
  38. package/dist-es/runtimeConfig.native.js +11 -0
  39. package/dist-es/runtimeConfig.shared.js +15 -0
  40. package/dist-es/runtimeExtensions.js +15 -0
  41. package/dist-types/WimCache.d.ts +51 -0
  42. package/dist-types/WimCacheClient.d.ts +144 -0
  43. package/dist-types/commands/DeleteEntitiesFromGeneralCacheCommand.d.ts +73 -0
  44. package/dist-types/commands/GetEntitiesByIdsCommand.d.ts +112 -0
  45. package/dist-types/commands/PutEntitiesToGeneralCacheCommand.d.ts +86 -0
  46. package/dist-types/commands/SearchEntitiesByListParamsCommand.d.ts +121 -0
  47. package/dist-types/commands/SearchEntitiesByParamsCommand.d.ts +120 -0
  48. package/dist-types/commands/SyncCacheCommand.d.ts +73 -0
  49. package/dist-types/commands/index.d.ts +6 -0
  50. package/dist-types/extensionConfiguration.d.ts +7 -0
  51. package/dist-types/index.d.ts +5 -0
  52. package/dist-types/models/WimCacheServiceException.d.ts +13 -0
  53. package/dist-types/models/index.d.ts +1 -0
  54. package/dist-types/models/models_0.d.ts +230 -0
  55. package/dist-types/protocols/Aws_restJson1.d.ts +56 -0
  56. package/dist-types/runtimeConfig.browser.d.ts +27 -0
  57. package/dist-types/runtimeConfig.d.ts +27 -0
  58. package/dist-types/runtimeConfig.native.d.ts +26 -0
  59. package/dist-types/runtimeConfig.shared.d.ts +15 -0
  60. package/dist-types/runtimeExtensions.d.ts +17 -0
  61. package/package.json +77 -0
@@ -0,0 +1,403 @@
1
+ "use strict";
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;
4
+ const WimCacheServiceException_1 = require("../models/WimCacheServiceException");
5
+ const models_0_1 = require("../models/models_0");
6
+ const protocol_http_1 = require("@smithy/protocol-http");
7
+ const smithy_client_1 = require("@smithy/smithy-client");
8
+ const se_DeleteEntitiesFromGeneralCacheCommand = async (input, context) => {
9
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
+ const headers = {};
11
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/cache/general";
12
+ const query = (0, smithy_client_1.map)({
13
+ "email": [, input.email],
14
+ "phone": [, input.phone],
15
+ "clean": [() => input.clean !== void 0, () => (input.clean.toString())],
16
+ });
17
+ let body;
18
+ return new protocol_http_1.HttpRequest({
19
+ protocol,
20
+ hostname,
21
+ port,
22
+ method: "DELETE",
23
+ headers,
24
+ path: resolvedPath,
25
+ query,
26
+ body,
27
+ });
28
+ };
29
+ exports.se_DeleteEntitiesFromGeneralCacheCommand = se_DeleteEntitiesFromGeneralCacheCommand;
30
+ const se_GetEntitiesByIdsCommand = async (input, context) => {
31
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
32
+ const headers = {
33
+ 'content-type': 'application/json',
34
+ };
35
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/cache/object";
36
+ let body;
37
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
38
+ 'entityIds': _ => (0, smithy_client_1._json)(_),
39
+ 'organizationId': [],
40
+ }));
41
+ return new protocol_http_1.HttpRequest({
42
+ protocol,
43
+ hostname,
44
+ port,
45
+ method: "POST",
46
+ headers,
47
+ path: resolvedPath,
48
+ body,
49
+ });
50
+ };
51
+ exports.se_GetEntitiesByIdsCommand = se_GetEntitiesByIdsCommand;
52
+ const se_PutEntitiesToGeneralCacheCommand = async (input, context) => {
53
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
54
+ const headers = {
55
+ 'content-type': 'application/json',
56
+ };
57
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/cache/general";
58
+ let body;
59
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
60
+ 'items': _ => (0, smithy_client_1._json)(_),
61
+ }));
62
+ return new protocol_http_1.HttpRequest({
63
+ protocol,
64
+ hostname,
65
+ port,
66
+ method: "PUT",
67
+ headers,
68
+ path: resolvedPath,
69
+ body,
70
+ });
71
+ };
72
+ exports.se_PutEntitiesToGeneralCacheCommand = se_PutEntitiesToGeneralCacheCommand;
73
+ const se_SearchEntitiesByListParamsCommand = async (input, context) => {
74
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
75
+ const headers = {
76
+ 'content-type': 'application/json',
77
+ };
78
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/cache/search";
79
+ let body;
80
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
81
+ 'organizationId': [],
82
+ 'params': _ => (0, smithy_client_1._json)(_),
83
+ }));
84
+ return new protocol_http_1.HttpRequest({
85
+ protocol,
86
+ hostname,
87
+ port,
88
+ method: "POST",
89
+ headers,
90
+ path: resolvedPath,
91
+ body,
92
+ });
93
+ };
94
+ exports.se_SearchEntitiesByListParamsCommand = se_SearchEntitiesByListParamsCommand;
95
+ const se_SearchEntitiesByParamsCommand = async (input, context) => {
96
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
97
+ const headers = {};
98
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/cache/search";
99
+ const query = (0, smithy_client_1.map)({
100
+ "organizationId": [, input.organizationId],
101
+ "phone": [, input.phone],
102
+ "email": [, input.email],
103
+ "query": [, input.query],
104
+ "from": [() => input.from !== void 0, () => (input.from.toString())],
105
+ "size": [() => input.size !== void 0, () => (input.size.toString())],
106
+ });
107
+ let body;
108
+ return new protocol_http_1.HttpRequest({
109
+ protocol,
110
+ hostname,
111
+ port,
112
+ method: "GET",
113
+ headers,
114
+ path: resolvedPath,
115
+ query,
116
+ body,
117
+ });
118
+ };
119
+ exports.se_SearchEntitiesByParamsCommand = se_SearchEntitiesByParamsCommand;
120
+ const se_SyncCacheCommand = async (input, context) => {
121
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
122
+ const headers = {
123
+ 'content-type': 'application/json',
124
+ };
125
+ let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/cache/sync";
126
+ let body;
127
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
128
+ 'organizationId': [],
129
+ }));
130
+ return new protocol_http_1.HttpRequest({
131
+ protocol,
132
+ hostname,
133
+ port,
134
+ method: "POST",
135
+ headers,
136
+ path: resolvedPath,
137
+ body,
138
+ });
139
+ };
140
+ exports.se_SyncCacheCommand = se_SyncCacheCommand;
141
+ const de_DeleteEntitiesFromGeneralCacheCommand = async (output, context) => {
142
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
143
+ return de_DeleteEntitiesFromGeneralCacheCommandError(output, context);
144
+ }
145
+ const contents = (0, smithy_client_1.map)({
146
+ $metadata: deserializeMetadata(output),
147
+ });
148
+ await (0, smithy_client_1.collectBody)(output.body, context);
149
+ return contents;
150
+ };
151
+ 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
+ const de_GetEntitiesByIdsCommand = async (output, context) => {
172
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
173
+ return de_GetEntitiesByIdsCommandError(output, context);
174
+ }
175
+ const contents = (0, smithy_client_1.map)({
176
+ $metadata: deserializeMetadata(output),
177
+ });
178
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
179
+ const doc = (0, smithy_client_1.take)(data, {
180
+ 'items': smithy_client_1._json,
181
+ });
182
+ Object.assign(contents, doc);
183
+ return contents;
184
+ };
185
+ 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
+ const de_PutEntitiesToGeneralCacheCommand = async (output, context) => {
206
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
207
+ return de_PutEntitiesToGeneralCacheCommandError(output, context);
208
+ }
209
+ const contents = (0, smithy_client_1.map)({
210
+ $metadata: deserializeMetadata(output),
211
+ });
212
+ await (0, smithy_client_1.collectBody)(output.body, context);
213
+ return contents;
214
+ };
215
+ 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
+ const de_SearchEntitiesByListParamsCommand = async (output, context) => {
236
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
237
+ return de_SearchEntitiesByListParamsCommandError(output, context);
238
+ }
239
+ const contents = (0, smithy_client_1.map)({
240
+ $metadata: deserializeMetadata(output),
241
+ });
242
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
243
+ const doc = (0, smithy_client_1.take)(data, {
244
+ 'items': smithy_client_1._json,
245
+ });
246
+ Object.assign(contents, doc);
247
+ return contents;
248
+ };
249
+ 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
+ const de_SearchEntitiesByParamsCommand = async (output, context) => {
270
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
271
+ return de_SearchEntitiesByParamsCommandError(output, context);
272
+ }
273
+ const contents = (0, smithy_client_1.map)({
274
+ $metadata: deserializeMetadata(output),
275
+ });
276
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
277
+ const doc = (0, smithy_client_1.take)(data, {
278
+ 'items': smithy_client_1._json,
279
+ });
280
+ Object.assign(contents, doc);
281
+ return contents;
282
+ };
283
+ 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
+ const de_SyncCacheCommand = async (output, context) => {
304
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
305
+ return de_SyncCacheCommandError(output, context);
306
+ }
307
+ const contents = (0, smithy_client_1.map)({
308
+ $metadata: deserializeMetadata(output),
309
+ });
310
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
311
+ const doc = (0, smithy_client_1.take)(data, {
312
+ 'success': smithy_client_1.expectBoolean,
313
+ });
314
+ Object.assign(contents, doc);
315
+ return contents;
316
+ };
317
+ exports.de_SyncCacheCommand = de_SyncCacheCommand;
318
+ const de_SyncCacheCommandError = async (output, context) => {
319
+ const parsedOutput = {
320
+ ...output,
321
+ body: await parseErrorBody(output.body, context)
322
+ };
323
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
324
+ switch (errorCode) {
325
+ case "ValidationException":
326
+ case "smithy.framework#ValidationException":
327
+ throw await de_ValidationExceptionRes(parsedOutput, context);
328
+ default:
329
+ const parsedBody = parsedOutput.body;
330
+ return throwDefaultError({
331
+ output,
332
+ parsedBody,
333
+ errorCode
334
+ });
335
+ }
336
+ };
337
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(WimCacheServiceException_1.WimCacheServiceException);
338
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
339
+ const contents = (0, smithy_client_1.map)({});
340
+ const data = parsedOutput.body;
341
+ const doc = (0, smithy_client_1.take)(data, {
342
+ 'message': smithy_client_1.expectString,
343
+ });
344
+ Object.assign(contents, doc);
345
+ const exception = new models_0_1.ValidationException({
346
+ $metadata: deserializeMetadata(parsedOutput),
347
+ ...contents
348
+ });
349
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
350
+ };
351
+ const deserializeMetadata = (output) => ({
352
+ httpStatusCode: output.statusCode,
353
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
354
+ extendedRequestId: output.headers["x-amz-id-2"],
355
+ cfId: output.headers["x-amz-cf-id"],
356
+ });
357
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
358
+ const isSerializableHeaderValue = (value) => value !== undefined &&
359
+ value !== null &&
360
+ value !== "" &&
361
+ (!Object.getOwnPropertyNames(value).includes("length") ||
362
+ value.length != 0) &&
363
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
364
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
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
+ };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const sha256_browser_1 = require("@aws-crypto/sha256-browser");
5
+ const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
6
+ const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
7
+ const util_retry_1 = require("@smithy/util-retry");
8
+ const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
9
+ const smithy_client_1 = require("@smithy/smithy-client");
10
+ const util_defaults_mode_browser_1 = require("@smithy/util-defaults-mode-browser");
11
+ const getRuntimeConfig = (config) => {
12
+ const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
13
+ const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
14
+ const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
15
+ return {
16
+ ...clientSharedValues,
17
+ ...config,
18
+ runtime: "browser",
19
+ defaultsMode,
20
+ bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
21
+ maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
22
+ requestHandler: config?.requestHandler ?? new fetch_http_handler_1.FetchHttpHandler(defaultConfigProvider),
23
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
24
+ sha256: config?.sha256 ?? sha256_browser_1.Sha256,
25
+ streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
26
+ };
27
+ };
28
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const hash_node_1 = require("@smithy/hash-node");
5
+ const middleware_retry_1 = require("@smithy/middleware-retry");
6
+ const node_config_provider_1 = require("@smithy/node-config-provider");
7
+ const node_http_handler_1 = require("@smithy/node-http-handler");
8
+ const util_body_length_node_1 = require("@smithy/util-body-length-node");
9
+ const util_retry_1 = require("@smithy/util-retry");
10
+ const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
11
+ const smithy_client_1 = require("@smithy/smithy-client");
12
+ const util_defaults_mode_node_1 = require("@smithy/util-defaults-mode-node");
13
+ const smithy_client_2 = require("@smithy/smithy-client");
14
+ const getRuntimeConfig = (config) => {
15
+ (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
16
+ const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
17
+ const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
18
+ const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
19
+ return {
20
+ ...clientSharedValues,
21
+ ...config,
22
+ runtime: "node",
23
+ defaultsMode,
24
+ bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
25
+ maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
26
+ requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(defaultConfigProvider),
27
+ 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, }),
28
+ sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
29
+ streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
30
+ };
31
+ };
32
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const sha256_js_1 = require("@aws-crypto/sha256-js");
5
+ const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
6
+ const getRuntimeConfig = (config) => {
7
+ const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
8
+ return {
9
+ ...browserDefaults,
10
+ ...config,
11
+ runtime: "react-native",
12
+ sha256: config?.sha256 ?? sha256_js_1.Sha256,
13
+ };
14
+ };
15
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const smithy_client_1 = require("@smithy/smithy-client");
5
+ const url_parser_1 = require("@smithy/url-parser");
6
+ const util_base64_1 = require("@smithy/util-base64");
7
+ const util_utf8_1 = require("@smithy/util-utf8");
8
+ const getRuntimeConfig = (config) => ({
9
+ apiVersion: "v2",
10
+ base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
11
+ base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
12
+ disableHostPrefix: config?.disableHostPrefix ?? false,
13
+ extensions: config?.extensions ?? [],
14
+ logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
15
+ urlParser: config?.urlParser ?? url_parser_1.parseUrl,
16
+ utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
17
+ utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
18
+ });
19
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveRuntimeExtensions = void 0;
4
+ const protocol_http_1 = require("@smithy/protocol-http");
5
+ const smithy_client_1 = require("@smithy/smithy-client");
6
+ const asPartial = (t) => t;
7
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
8
+ const extensionConfiguration = {
9
+ ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
10
+ ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
11
+ };
12
+ 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
+ };
18
+ };
19
+ exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
@@ -0,0 +1,19 @@
1
+ import { WimCacheClient, } from "./WimCacheClient";
2
+ import { DeleteEntitiesFromGeneralCacheCommand, } from "./commands/DeleteEntitiesFromGeneralCacheCommand";
3
+ import { GetEntitiesByIdsCommand, } from "./commands/GetEntitiesByIdsCommand";
4
+ import { PutEntitiesToGeneralCacheCommand, } from "./commands/PutEntitiesToGeneralCacheCommand";
5
+ import { SearchEntitiesByListParamsCommand, } from "./commands/SearchEntitiesByListParamsCommand";
6
+ import { SearchEntitiesByParamsCommand, } from "./commands/SearchEntitiesByParamsCommand";
7
+ import { SyncCacheCommand, } from "./commands/SyncCacheCommand";
8
+ import { createAggregatedClient } from "@smithy/smithy-client";
9
+ const commands = {
10
+ DeleteEntitiesFromGeneralCacheCommand,
11
+ GetEntitiesByIdsCommand,
12
+ PutEntitiesToGeneralCacheCommand,
13
+ SearchEntitiesByListParamsCommand,
14
+ SearchEntitiesByParamsCommand,
15
+ SyncCacheCommand,
16
+ };
17
+ export class WimCache extends WimCacheClient {
18
+ }
19
+ createAggregatedClient(commands, WimCache);
@@ -0,0 +1,31 @@
1
+ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
2
+ import { resolveRuntimeExtensions, } from "./runtimeExtensions";
3
+ import { Client as __Client, } from "@smithy/smithy-client";
4
+ import { authorizationMiddleware } from "@wildix/smithy-utils";
5
+ export { __Client };
6
+ export class WimCacheClient extends __Client {
7
+ constructor(...[configuration]) {
8
+ let _config_0 = __getRuntimeConfig(configuration || {});
9
+ let _config_1 = resolveRuntimeExtensions(_config_0, configuration?.extensions || []);
10
+ const endpoint = () => {
11
+ let env = configuration.env && configuration.env !== 'prod' ? '-' + configuration.env : '';
12
+ const hostname = `wim${env}.wildix.com`;
13
+ return {
14
+ hostname,
15
+ protocol: "https",
16
+ port: '443',
17
+ path: ''
18
+ };
19
+ };
20
+ const config = {
21
+ ..._config_1,
22
+ endpoint,
23
+ };
24
+ super(config);
25
+ this.config = config;
26
+ this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
27
+ }
28
+ destroy() {
29
+ super.destroy();
30
+ }
31
+ }
@@ -0,0 +1,37 @@
1
+ import { de_DeleteEntitiesFromGeneralCacheCommand, se_DeleteEntitiesFromGeneralCacheCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ export { $Command };
6
+ export class DeleteEntitiesFromGeneralCacheCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ resolveMiddleware(clientStack, configuration, options) {
12
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
13
+ const stack = clientStack.concat(this.middlewareStack);
14
+ const { logger } = configuration;
15
+ const clientName = "WimCacheClient";
16
+ const commandName = "DeleteEntitiesFromGeneralCacheCommand";
17
+ const handlerExecutionContext = {
18
+ logger,
19
+ clientName,
20
+ commandName,
21
+ inputFilterSensitiveLog: (_) => _,
22
+ outputFilterSensitiveLog: (_) => _,
23
+ [SMITHY_CONTEXT_KEY]: {
24
+ service: "WimCache",
25
+ operation: "DeleteEntitiesFromGeneralCache",
26
+ },
27
+ };
28
+ const { requestHandler } = configuration;
29
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
30
+ }
31
+ serialize(input, context) {
32
+ return se_DeleteEntitiesFromGeneralCacheCommand(input, context);
33
+ }
34
+ deserialize(output, context) {
35
+ return de_DeleteEntitiesFromGeneralCacheCommand(output, context);
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ import { de_GetEntitiesByIdsCommand, se_GetEntitiesByIdsCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ export { $Command };
6
+ export class GetEntitiesByIdsCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ resolveMiddleware(clientStack, configuration, options) {
12
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
13
+ const stack = clientStack.concat(this.middlewareStack);
14
+ const { logger } = configuration;
15
+ const clientName = "WimCacheClient";
16
+ const commandName = "GetEntitiesByIdsCommand";
17
+ const handlerExecutionContext = {
18
+ logger,
19
+ clientName,
20
+ commandName,
21
+ inputFilterSensitiveLog: (_) => _,
22
+ outputFilterSensitiveLog: (_) => _,
23
+ [SMITHY_CONTEXT_KEY]: {
24
+ service: "WimCache",
25
+ operation: "GetEntitiesByIds",
26
+ },
27
+ };
28
+ const { requestHandler } = configuration;
29
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
30
+ }
31
+ serialize(input, context) {
32
+ return se_GetEntitiesByIdsCommand(input, context);
33
+ }
34
+ deserialize(output, context) {
35
+ return de_GetEntitiesByIdsCommand(output, context);
36
+ }
37
+ }