@wildix/wim-cache-client 1.0.0 → 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.
Files changed (50) hide show
  1. package/dist-cjs/WimCache.js +2 -0
  2. package/dist-cjs/WimCacheClient.js +14 -8
  3. package/dist-cjs/commands/DeleteEntitiesFromGeneralCacheCommand.js +12 -32
  4. package/dist-cjs/commands/GetEntitiesByIdsCommand.js +12 -32
  5. package/dist-cjs/commands/PutEntitiesToGeneralCacheCommand.js +12 -32
  6. package/dist-cjs/commands/SearchEntitiesByListParamsCommand.js +12 -32
  7. package/dist-cjs/commands/SearchEntitiesByParamsCommand.js +12 -32
  8. package/dist-cjs/commands/SyncCacheCommand.js +12 -32
  9. package/dist-cjs/commands/UpdateEntitiesWeightCommand.js +21 -0
  10. package/dist-cjs/commands/index.js +1 -0
  11. package/dist-cjs/models/models_0.js +16 -3
  12. package/dist-cjs/protocols/Aws_restJson1.js +118 -233
  13. package/dist-cjs/runtimeConfig.browser.js +5 -1
  14. package/dist-cjs/runtimeConfig.js +8 -3
  15. package/dist-cjs/runtimeConfig.shared.js +13 -11
  16. package/dist-cjs/runtimeExtensions.js +2 -10
  17. package/dist-es/WimCache.js +2 -0
  18. package/dist-es/WimCacheClient.js +15 -9
  19. package/dist-es/commands/DeleteEntitiesFromGeneralCacheCommand.js +12 -32
  20. package/dist-es/commands/GetEntitiesByIdsCommand.js +12 -32
  21. package/dist-es/commands/PutEntitiesToGeneralCacheCommand.js +12 -32
  22. package/dist-es/commands/SearchEntitiesByListParamsCommand.js +12 -32
  23. package/dist-es/commands/SearchEntitiesByParamsCommand.js +12 -32
  24. package/dist-es/commands/SyncCacheCommand.js +12 -32
  25. package/dist-es/commands/UpdateEntitiesWeightCommand.js +17 -0
  26. package/dist-es/commands/index.js +1 -0
  27. package/dist-es/models/models_0.js +14 -2
  28. package/dist-es/protocols/Aws_restJson1.js +109 -226
  29. package/dist-es/runtimeConfig.browser.js +4 -1
  30. package/dist-es/runtimeConfig.js +7 -3
  31. package/dist-es/runtimeConfig.shared.js +13 -11
  32. package/dist-es/runtimeExtensions.js +2 -10
  33. package/dist-types/WimCache.d.ts +10 -0
  34. package/dist-types/WimCacheClient.d.ts +21 -15
  35. package/dist-types/commands/DeleteEntitiesFromGeneralCacheCommand.d.ts +24 -21
  36. package/dist-types/commands/GetEntitiesByIdsCommand.d.ts +25 -21
  37. package/dist-types/commands/PutEntitiesToGeneralCacheCommand.d.ts +24 -21
  38. package/dist-types/commands/SearchEntitiesByListParamsCommand.d.ts +25 -21
  39. package/dist-types/commands/SearchEntitiesByParamsCommand.d.ts +25 -21
  40. package/dist-types/commands/SyncCacheCommand.d.ts +24 -21
  41. package/dist-types/commands/UpdateEntitiesWeightCommand.d.ts +79 -0
  42. package/dist-types/commands/index.d.ts +1 -0
  43. package/dist-types/index.d.ts +2 -0
  44. package/dist-types/models/WimCacheServiceException.d.ts +2 -1
  45. package/dist-types/models/models_0.d.ts +104 -71
  46. package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
  47. package/dist-types/runtimeConfig.browser.d.ts +8 -4
  48. package/dist-types/runtimeConfig.d.ts +8 -4
  49. package/dist-types/runtimeConfig.native.d.ts +8 -4
  50. package/package.json +42 -36
@@ -1,137 +1,124 @@
1
1
  import { WimCacheServiceException as __BaseException } from "../models/WimCacheServiceException";
2
- import { ValidationException, } from "../models/models_0";
3
- import { HttpRequest as __HttpRequest, } from "@smithy/protocol-http";
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 { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const b = rb(input, context);
7
8
  const headers = {};
8
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/cache/general";
9
+ b.bp("/v1/cache/general");
9
10
  const query = map({
10
- "email": [, input.email],
11
- "phone": [, input.phone],
12
- "clean": [() => input.clean !== void 0, () => (input.clean.toString())],
11
+ [_e]: [, input[_e]],
12
+ [_p]: [, input[_p]],
13
+ [_c]: [() => input.clean !== void 0, () => (input[_c].toString())],
13
14
  });
14
15
  let body;
15
- return new __HttpRequest({
16
- protocol,
17
- hostname,
18
- port,
19
- method: "DELETE",
20
- headers,
21
- path: resolvedPath,
22
- query,
23
- body,
24
- });
16
+ b.m("DELETE")
17
+ .h(headers)
18
+ .q(query)
19
+ .b(body);
20
+ return b.build();
25
21
  };
26
22
  export const se_GetEntitiesByIdsCommand = async (input, context) => {
27
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
23
+ const b = rb(input, context);
28
24
  const headers = {
29
25
  'content-type': 'application/json',
30
26
  };
31
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/cache/object";
27
+ b.bp("/v1/cache/object");
32
28
  let body;
33
29
  body = JSON.stringify(take(input, {
34
30
  'entityIds': _ => _json(_),
35
31
  'organizationId': [],
36
32
  }));
37
- return new __HttpRequest({
38
- protocol,
39
- hostname,
40
- port,
41
- method: "POST",
42
- headers,
43
- path: resolvedPath,
44
- body,
45
- });
33
+ b.m("POST")
34
+ .h(headers)
35
+ .b(body);
36
+ return b.build();
46
37
  };
47
38
  export const se_PutEntitiesToGeneralCacheCommand = async (input, context) => {
48
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
39
+ const b = rb(input, context);
49
40
  const headers = {
50
41
  'content-type': 'application/json',
51
42
  };
52
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/cache/general";
43
+ b.bp("/v1/cache/general");
53
44
  let body;
54
45
  body = JSON.stringify(take(input, {
55
46
  'items': _ => _json(_),
56
47
  }));
57
- return new __HttpRequest({
58
- protocol,
59
- hostname,
60
- port,
61
- method: "PUT",
62
- headers,
63
- path: resolvedPath,
64
- body,
65
- });
48
+ b.m("PUT")
49
+ .h(headers)
50
+ .b(body);
51
+ return b.build();
66
52
  };
67
53
  export const se_SearchEntitiesByListParamsCommand = async (input, context) => {
68
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
54
+ const b = rb(input, context);
69
55
  const headers = {
70
56
  'content-type': 'application/json',
71
57
  };
72
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/cache/search";
58
+ b.bp("/v1/cache/search");
73
59
  let body;
74
60
  body = JSON.stringify(take(input, {
75
61
  'organizationId': [],
76
62
  'params': _ => _json(_),
77
63
  }));
78
- return new __HttpRequest({
79
- protocol,
80
- hostname,
81
- port,
82
- method: "POST",
83
- headers,
84
- path: resolvedPath,
85
- body,
86
- });
64
+ b.m("POST")
65
+ .h(headers)
66
+ .b(body);
67
+ return b.build();
87
68
  };
88
69
  export const se_SearchEntitiesByParamsCommand = async (input, context) => {
89
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
70
+ const b = rb(input, context);
90
71
  const headers = {};
91
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/cache/search";
72
+ b.bp("/v1/cache/search");
92
73
  const query = map({
93
- "organizationId": [, input.organizationId],
94
- "phone": [, input.phone],
95
- "email": [, input.email],
96
- "query": [, input.query],
97
- "from": [() => input.from !== void 0, () => (input.from.toString())],
98
- "size": [() => input.size !== void 0, () => (input.size.toString())],
74
+ [_oI]: [, input[_oI]],
75
+ [_p]: [, input[_p]],
76
+ [_e]: [, input[_e]],
77
+ [_q]: [, input[_q]],
78
+ [_f]: [() => input.from !== void 0, () => (input[_f].toString())],
79
+ [_s]: [() => input.size !== void 0, () => (input[_s].toString())],
99
80
  });
100
81
  let body;
101
- return new __HttpRequest({
102
- protocol,
103
- hostname,
104
- port,
105
- method: "GET",
106
- headers,
107
- path: resolvedPath,
108
- query,
109
- body,
110
- });
82
+ b.m("GET")
83
+ .h(headers)
84
+ .q(query)
85
+ .b(body);
86
+ return b.build();
111
87
  };
112
88
  export const se_SyncCacheCommand = async (input, context) => {
113
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
89
+ const b = rb(input, context);
114
90
  const headers = {
115
91
  'content-type': 'application/json',
116
92
  };
117
- let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/v1/cache/sync";
93
+ b.bp("/v1/cache/sync");
118
94
  let body;
119
95
  body = JSON.stringify(take(input, {
120
96
  'organizationId': [],
121
97
  }));
122
- return new __HttpRequest({
123
- protocol,
124
- hostname,
125
- port,
126
- method: "POST",
127
- headers,
128
- path: resolvedPath,
129
- body,
130
- });
98
+ b.m("POST")
99
+ .h(headers)
100
+ .b(body);
101
+ return b.build();
102
+ };
103
+ export const se_UpdateEntitiesWeightCommand = async (input, context) => {
104
+ const b = rb(input, context);
105
+ const headers = {
106
+ 'content-type': 'application/json',
107
+ };
108
+ b.bp("/v1/cache/weight");
109
+ let body;
110
+ body = JSON.stringify(take(input, {
111
+ 'entityIds': _ => _json(_),
112
+ 'organizationId': [],
113
+ }));
114
+ b.m("POST")
115
+ .h(headers)
116
+ .b(body);
117
+ return b.build();
131
118
  };
132
119
  export const de_DeleteEntitiesFromGeneralCacheCommand = async (output, context) => {
133
120
  if (output.statusCode !== 204 && output.statusCode >= 300) {
134
- return de_DeleteEntitiesFromGeneralCacheCommandError(output, context);
121
+ return de_CommandError(output, context);
135
122
  }
136
123
  const contents = map({
137
124
  $metadata: deserializeMetadata(output),
@@ -139,28 +126,9 @@ export const de_DeleteEntitiesFromGeneralCacheCommand = async (output, context)
139
126
  await collectBody(output.body, context);
140
127
  return contents;
141
128
  };
142
- const de_DeleteEntitiesFromGeneralCacheCommandError = async (output, context) => {
143
- const parsedOutput = {
144
- ...output,
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
- });
159
- }
160
- };
161
129
  export const de_GetEntitiesByIdsCommand = async (output, context) => {
162
130
  if (output.statusCode !== 200 && output.statusCode >= 300) {
163
- return de_GetEntitiesByIdsCommandError(output, context);
131
+ return de_CommandError(output, context);
164
132
  }
165
133
  const contents = map({
166
134
  $metadata: deserializeMetadata(output),
@@ -172,28 +140,9 @@ export const de_GetEntitiesByIdsCommand = async (output, context) => {
172
140
  Object.assign(contents, doc);
173
141
  return contents;
174
142
  };
175
- const de_GetEntitiesByIdsCommandError = async (output, context) => {
176
- const parsedOutput = {
177
- ...output,
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
- });
192
- }
193
- };
194
143
  export const de_PutEntitiesToGeneralCacheCommand = async (output, context) => {
195
144
  if (output.statusCode !== 204 && output.statusCode >= 300) {
196
- return de_PutEntitiesToGeneralCacheCommandError(output, context);
145
+ return de_CommandError(output, context);
197
146
  }
198
147
  const contents = map({
199
148
  $metadata: deserializeMetadata(output),
@@ -201,28 +150,9 @@ export const de_PutEntitiesToGeneralCacheCommand = async (output, context) => {
201
150
  await collectBody(output.body, context);
202
151
  return contents;
203
152
  };
204
- const de_PutEntitiesToGeneralCacheCommandError = async (output, context) => {
205
- const parsedOutput = {
206
- ...output,
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
- });
221
- }
222
- };
223
153
  export const de_SearchEntitiesByListParamsCommand = async (output, context) => {
224
154
  if (output.statusCode !== 200 && output.statusCode >= 300) {
225
- return de_SearchEntitiesByListParamsCommandError(output, context);
155
+ return de_CommandError(output, context);
226
156
  }
227
157
  const contents = map({
228
158
  $metadata: deserializeMetadata(output),
@@ -234,28 +164,9 @@ export const de_SearchEntitiesByListParamsCommand = async (output, context) => {
234
164
  Object.assign(contents, doc);
235
165
  return contents;
236
166
  };
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
167
  export const de_SearchEntitiesByParamsCommand = async (output, context) => {
257
168
  if (output.statusCode !== 200 && output.statusCode >= 300) {
258
- return de_SearchEntitiesByParamsCommandError(output, context);
169
+ return de_CommandError(output, context);
259
170
  }
260
171
  const contents = map({
261
172
  $metadata: deserializeMetadata(output),
@@ -267,28 +178,23 @@ export const de_SearchEntitiesByParamsCommand = async (output, context) => {
267
178
  Object.assign(contents, doc);
268
179
  return contents;
269
180
  };
270
- const de_SearchEntitiesByParamsCommandError = async (output, context) => {
271
- const parsedOutput = {
272
- ...output,
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
- });
181
+ export const de_SyncCacheCommand = async (output, context) => {
182
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
183
+ return de_CommandError(output, context);
287
184
  }
185
+ const contents = map({
186
+ $metadata: deserializeMetadata(output),
187
+ });
188
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
189
+ const doc = take(data, {
190
+ 'success': __expectBoolean,
191
+ });
192
+ Object.assign(contents, doc);
193
+ return contents;
288
194
  };
289
- export const de_SyncCacheCommand = async (output, context) => {
195
+ export const de_UpdateEntitiesWeightCommand = async (output, context) => {
290
196
  if (output.statusCode !== 200 && output.statusCode >= 300) {
291
- return de_SyncCacheCommandError(output, context);
197
+ return de_CommandError(output, context);
292
198
  }
293
199
  const contents = map({
294
200
  $metadata: deserializeMetadata(output),
@@ -300,13 +206,16 @@ export const de_SyncCacheCommand = async (output, context) => {
300
206
  Object.assign(contents, doc);
301
207
  return contents;
302
208
  };
303
- const de_SyncCacheCommandError = async (output, context) => {
209
+ const de_CommandError = async (output, context) => {
304
210
  const parsedOutput = {
305
211
  ...output,
306
212
  body: await parseErrorBody(output.body, context)
307
213
  };
308
214
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
309
215
  switch (errorCode) {
216
+ case "ForbiddenException":
217
+ case "smithy.framework#ForbiddenException":
218
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
310
219
  case "ValidationException":
311
220
  case "smithy.framework#ValidationException":
312
221
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -320,6 +229,19 @@ const de_SyncCacheCommandError = async (output, context) => {
320
229
  }
321
230
  };
322
231
  const throwDefaultError = withBaseException(__BaseException);
232
+ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
233
+ const contents = map({});
234
+ const data = parsedOutput.body;
235
+ const doc = take(data, {
236
+ 'message': __expectString,
237
+ });
238
+ Object.assign(contents, doc);
239
+ const exception = new ForbiddenException({
240
+ $metadata: deserializeMetadata(parsedOutput),
241
+ ...contents
242
+ });
243
+ return __decorateServiceException(exception, parsedOutput.body);
244
+ };
323
245
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
324
246
  const contents = map({});
325
247
  const data = parsedOutput.body;
@@ -340,49 +262,10 @@ const deserializeMetadata = (output) => ({
340
262
  cfId: output.headers["x-amz-cf-id"],
341
263
  });
342
264
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then(body => context.utf8Encoder(body));
343
- const isSerializableHeaderValue = (value) => value !== undefined &&
344
- value !== null &&
345
- value !== "" &&
346
- (!Object.getOwnPropertyNames(value).includes("length") ||
347
- value.length != 0) &&
348
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
349
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
350
- if (encoded.length) {
351
- return JSON.parse(encoded);
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
- };
265
+ const _c = "clean";
266
+ const _e = "email";
267
+ const _f = "from";
268
+ const _oI = "organizationId";
269
+ const _p = "phone";
270
+ const _q = "query";
271
+ const _s = "size";
@@ -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 ?? new RequestHandler(defaultConfigProvider),
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,
@@ -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
- maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
23
- requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
24
- retryMode: config?.retryMode ?? loadNodeConfig({ ...NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, }),
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
- apiVersion: "v2",
7
- base64Decoder: config?.base64Decoder ?? fromBase64,
8
- base64Encoder: config?.base64Encoder ?? toBase64,
9
- disableHostPrefix: config?.disableHostPrefix ?? false,
10
- extensions: config?.extensions ?? [],
11
- logger: config?.logger ?? new NoOpLogger(),
12
- urlParser: config?.urlParser ?? parseUrl,
13
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
14
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
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
  };
@@ -5,11 +5,13 @@ import { PutEntitiesToGeneralCacheCommandInput, PutEntitiesToGeneralCacheCommand
5
5
  import { SearchEntitiesByListParamsCommandInput, SearchEntitiesByListParamsCommandOutput } from "./commands/SearchEntitiesByListParamsCommand";
6
6
  import { SearchEntitiesByParamsCommandInput, SearchEntitiesByParamsCommandOutput } from "./commands/SearchEntitiesByParamsCommand";
7
7
  import { SyncCacheCommandInput, SyncCacheCommandOutput } from "./commands/SyncCacheCommand";
8
+ import { UpdateEntitiesWeightCommandInput, UpdateEntitiesWeightCommandOutput } from "./commands/UpdateEntitiesWeightCommand";
8
9
  import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
9
10
  export interface WimCache {
10
11
  /**
11
12
  * @see {@link DeleteEntitiesFromGeneralCacheCommand}
12
13
  */
14
+ deleteEntitiesFromGeneralCache(): Promise<DeleteEntitiesFromGeneralCacheCommandOutput>;
13
15
  deleteEntitiesFromGeneralCache(args: DeleteEntitiesFromGeneralCacheCommandInput, options?: __HttpHandlerOptions): Promise<DeleteEntitiesFromGeneralCacheCommandOutput>;
14
16
  deleteEntitiesFromGeneralCache(args: DeleteEntitiesFromGeneralCacheCommandInput, cb: (err: any, data?: DeleteEntitiesFromGeneralCacheCommandOutput) => void): void;
15
17
  deleteEntitiesFromGeneralCache(args: DeleteEntitiesFromGeneralCacheCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteEntitiesFromGeneralCacheCommandOutput) => void): void;
@@ -22,6 +24,7 @@ export interface WimCache {
22
24
  /**
23
25
  * @see {@link PutEntitiesToGeneralCacheCommand}
24
26
  */
27
+ putEntitiesToGeneralCache(): Promise<PutEntitiesToGeneralCacheCommandOutput>;
25
28
  putEntitiesToGeneralCache(args: PutEntitiesToGeneralCacheCommandInput, options?: __HttpHandlerOptions): Promise<PutEntitiesToGeneralCacheCommandOutput>;
26
29
  putEntitiesToGeneralCache(args: PutEntitiesToGeneralCacheCommandInput, cb: (err: any, data?: PutEntitiesToGeneralCacheCommandOutput) => void): void;
27
30
  putEntitiesToGeneralCache(args: PutEntitiesToGeneralCacheCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutEntitiesToGeneralCacheCommandOutput) => void): void;
@@ -34,6 +37,7 @@ export interface WimCache {
34
37
  /**
35
38
  * @see {@link SearchEntitiesByParamsCommand}
36
39
  */
40
+ searchEntitiesByParams(): Promise<SearchEntitiesByParamsCommandOutput>;
37
41
  searchEntitiesByParams(args: SearchEntitiesByParamsCommandInput, options?: __HttpHandlerOptions): Promise<SearchEntitiesByParamsCommandOutput>;
38
42
  searchEntitiesByParams(args: SearchEntitiesByParamsCommandInput, cb: (err: any, data?: SearchEntitiesByParamsCommandOutput) => void): void;
39
43
  searchEntitiesByParams(args: SearchEntitiesByParamsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: SearchEntitiesByParamsCommandOutput) => void): void;
@@ -43,6 +47,12 @@ export interface WimCache {
43
47
  syncCache(args: SyncCacheCommandInput, options?: __HttpHandlerOptions): Promise<SyncCacheCommandOutput>;
44
48
  syncCache(args: SyncCacheCommandInput, cb: (err: any, data?: SyncCacheCommandOutput) => void): void;
45
49
  syncCache(args: SyncCacheCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: SyncCacheCommandOutput) => void): void;
50
+ /**
51
+ * @see {@link UpdateEntitiesWeightCommand}
52
+ */
53
+ updateEntitiesWeight(args: UpdateEntitiesWeightCommandInput, options?: __HttpHandlerOptions): Promise<UpdateEntitiesWeightCommandOutput>;
54
+ updateEntitiesWeight(args: UpdateEntitiesWeightCommandInput, cb: (err: any, data?: UpdateEntitiesWeightCommandOutput) => void): void;
55
+ updateEntitiesWeight(args: UpdateEntitiesWeightCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UpdateEntitiesWeightCommandOutput) => void): void;
46
56
  }
47
57
  /**
48
58
  * @public