@ancon/wildcat-utils 1.54.0-check-optimizations.6 → 1.54.1

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 (33) hide show
  1. package/api/generateBackoffWithFullJitter.d.ts +15 -0
  2. package/api/generateBackoffWithFullJitter.js +1 -0
  3. package/api/generateBackoffWithFullJitter.mjs +7 -0
  4. package/api/generateBackoffWithVariableJitter.d.ts +3 -1
  5. package/api/generateBackoffWithVariableJitter.js +1 -1
  6. package/api/generateBackoffWithVariableJitter.mjs +12 -9
  7. package/api/getRateLimitRetryDelay.d.ts +31 -0
  8. package/api/getRateLimitRetryDelay.js +1 -0
  9. package/api/getRateLimitRetryDelay.mjs +19 -0
  10. package/api/index.d.ts +3 -1
  11. package/api/index.js +1 -1
  12. package/api/index.mjs +24 -16
  13. package/check/getOrganizedCheckItemModifications.d.ts +2 -2
  14. package/check/getOrganizedCheckItemModifications.js +1 -1
  15. package/check/getOrganizedCheckItemModifications.mjs +68 -74
  16. package/check/getUniqueCheckItemModificationId.d.ts +2 -2
  17. package/check/getUniqueCheckItemModificationId.js +1 -1
  18. package/check/getUniqueCheckItemModificationId.mjs +5 -5
  19. package/error/getRateLimit.d.ts +31 -0
  20. package/error/getRateLimit.js +1 -0
  21. package/error/getRateLimit.mjs +60 -0
  22. package/error/index.d.ts +4 -2
  23. package/error/index.js +1 -1
  24. package/error/index.mjs +34 -28
  25. package/error/isRateLimitError.d.ts +7 -0
  26. package/error/isRateLimitError.js +1 -0
  27. package/error/isRateLimitError.mjs +8 -0
  28. package/index.js +1 -1
  29. package/index.mjs +367 -353
  30. package/multilingual/createLocalizedCheckDetails.d.ts +2 -2
  31. package/multilingual/createLocalizedCheckDetails.js +1 -1
  32. package/multilingual/createLocalizedCheckDetails.mjs +27 -31
  33. package/package.json +21 -1
@@ -1,4 +1,4 @@
1
- import { CheckDetailsV2 } from '@ancon/wildcat-types';
1
+ import { CheckDetails } from '@ancon/wildcat-types';
2
2
  /**
3
3
  * This creates localized check details by replacing following properties with localized values based on current app language.
4
4
  * Affected properties on each check item (and its sub-items):
@@ -12,5 +12,5 @@ import { CheckDetailsV2 } from '@ancon/wildcat-types';
12
12
  * @param locale - locale to be used for localization
13
13
  * @returns localized check details
14
14
  */
15
- declare function createLocalizedCheckDetails(checkDetails: CheckDetailsV2, locale: string): CheckDetailsV2;
15
+ declare function createLocalizedCheckDetails(checkDetails: CheckDetails, locale: string): CheckDetails;
16
16
  export default createLocalizedCheckDetails;
@@ -1 +1 @@
1
- "use strict";const r=require("@ancon/wildcat-types");function d(e){switch(e){case"sv":return r.IETFLanguageTag.Swedish;case"nb":return r.IETFLanguageTag.Norwegian;case"en":return r.IETFLanguageTag.English;default:return null}}function s(e,a){var t,i;if(e){const c=e,n=(t=e.localizedProductNames)==null?void 0:t[a],o=(i=e.localizedVariantNames)==null?void 0:i[a];return n&&(c.productName=n),o&&(c.variantName=o),c}return e}function m(e,a){var n,o;const t=e,i=(n=e.localizedNames)==null?void 0:n[a],c=(o=e.localizedReplacementNames)==null?void 0:o[a];return i&&(t.name=i),c&&(t.replacementName=c),t}function z(e,a){const t=e;return t.product=s(e.product,a),t}function u(e,a){const t=e,{product:i,modifications:c,addOnProducts:n,subCheckItems:o}=e;return t.product=s(i,a),c!=null&&c.length&&(t.modifications=c.map(l=>m(l,a))),n!=null&&n.length&&(t.addOnProducts=n==null?void 0:n.map(l=>z(l,a))),o!=null&&o.length&&(t.subCheckItems=o.map(l=>u(l,a))),t}function f(e,a){var i;const t=d(a);if(t){const c=e;return c.items=(i=e.items)==null?void 0:i.map(n=>u(n,t)),c}return e}module.exports=f;
1
+ "use strict";const l=require("@ancon/wildcat-types");function u(e){switch(e){case"sv":return l.IETFLanguageTag.Swedish;case"nb":return l.IETFLanguageTag.Norwegian;case"en":return l.IETFLanguageTag.English;default:return null}}function s(e,c){var i,o;const t=e,a=(i=e.localizedProductNames)==null?void 0:i[c],n=(o=e.localizedVariantNames)==null?void 0:o[c];return a&&(t.productName=a),n&&(t.variantName=n),t}function m(e,c){var i,o;const t=e,a=(i=e.localizedNames)==null?void 0:i[c],n=(o=e.localizedReplacementNames)==null?void 0:o[c];return a&&(t.name=a),n&&(t.replacementName=n),t}function z(e,c){const t=e;return t.product=s(e.product,c),t}function d(e,c){const t=e,{product:a,modifications:n,addOnProducts:i,subCheckItems:o}=e;return t.product=s(a,c),n.length&&(t.modifications=n.map(r=>m(r,c))),i!=null&&i.length&&(t.addOnProducts=i.map(r=>z(r,c))),o.length&&(t.subCheckItems=o.map(r=>d(r,c))),t}function f(e,c){const t=u(c);if(t){const a=e;return a.items=e.items.map(n=>d(n,t)),a}return e}module.exports=f;
@@ -1,5 +1,5 @@
1
1
  import { IETFLanguageTag as r } from "@ancon/wildcat-types";
2
- function m(e) {
2
+ function u(e) {
3
3
  switch (e) {
4
4
  case "sv":
5
5
  return r.Swedish;
@@ -11,47 +11,43 @@ function m(e) {
11
11
  return null;
12
12
  }
13
13
  }
14
- function u(e, a) {
15
- var t, i;
16
- if (e) {
17
- const c = e, n = (t = e.localizedProductNames) == null ? void 0 : t[a], o = (i = e.localizedVariantNames) == null ? void 0 : i[a];
18
- return n && (c.productName = n), o && (c.variantName = o), c;
19
- }
20
- return e;
14
+ function d(e, c) {
15
+ var i, n;
16
+ const t = e, a = (i = e.localizedProductNames) == null ? void 0 : i[c], o = (n = e.localizedVariantNames) == null ? void 0 : n[c];
17
+ return a && (t.productName = a), o && (t.variantName = o), t;
21
18
  }
22
- function s(e, a) {
23
- var n, o;
24
- const t = e, i = (n = e.localizedNames) == null ? void 0 : n[a], c = (o = e.localizedReplacementNames) == null ? void 0 : o[a];
25
- return i && (t.name = i), c && (t.replacementName = c), t;
19
+ function m(e, c) {
20
+ var i, n;
21
+ const t = e, a = (i = e.localizedNames) == null ? void 0 : i[c], o = (n = e.localizedReplacementNames) == null ? void 0 : n[c];
22
+ return a && (t.name = a), o && (t.replacementName = o), t;
26
23
  }
27
- function f(e, a) {
24
+ function f(e, c) {
28
25
  const t = e;
29
- return t.product = u(
26
+ return t.product = d(
30
27
  e.product,
31
- a
28
+ c
32
29
  ), t;
33
30
  }
34
- function d(e, a) {
35
- const t = e, { product: i, modifications: c, addOnProducts: n, subCheckItems: o } = e;
36
- return t.product = u(i, a), c != null && c.length && (t.modifications = c.map(
37
- (l) => s(l, a)
38
- )), n != null && n.length && (t.addOnProducts = n == null ? void 0 : n.map(
39
- (l) => f(l, a)
40
- )), o != null && o.length && (t.subCheckItems = o.map(
41
- (l) => d(l, a)
31
+ function s(e, c) {
32
+ const t = e, { product: a, modifications: o, addOnProducts: i, subCheckItems: n } = e;
33
+ return t.product = d(a, c), o.length && (t.modifications = o.map(
34
+ (l) => m(l, c)
35
+ )), i != null && i.length && (t.addOnProducts = i.map(
36
+ (l) => f(l, c)
37
+ )), n.length && (t.subCheckItems = n.map(
38
+ (l) => s(l, c)
42
39
  )), t;
43
40
  }
44
- function N(e, a) {
45
- var i;
46
- const t = m(a);
41
+ function p(e, c) {
42
+ const t = u(c);
47
43
  if (t) {
48
- const c = e;
49
- return c.items = (i = e.items) == null ? void 0 : i.map(
50
- (n) => d(n, t)
51
- ), c;
44
+ const a = e;
45
+ return a.items = e.items.map(
46
+ (o) => s(o, t)
47
+ ), a;
52
48
  }
53
49
  return e;
54
50
  }
55
51
  export {
56
- N as default
52
+ p as default
57
53
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancon/wildcat-utils",
3
- "version": "1.54.0-check-optimizations.6",
3
+ "version": "1.54.1",
4
4
  "main": "index.js",
5
5
  "module": "index.mjs",
6
6
  "types": "index.d.ts",
@@ -15,6 +15,11 @@
15
15
  "require": "./api/generateBackoffWithEqualJitter.js",
16
16
  "types": "./api/generateBackoffWithEqualJitter.d.ts"
17
17
  },
18
+ "./api/generateBackoffWithFullJitter": {
19
+ "import": "./api/generateBackoffWithFullJitter.mjs",
20
+ "require": "./api/generateBackoffWithFullJitter.js",
21
+ "types": "./api/generateBackoffWithFullJitter.d.ts"
22
+ },
18
23
  "./api/generateBackoffWithVariableJitter": {
19
24
  "import": "./api/generateBackoffWithVariableJitter.mjs",
20
25
  "require": "./api/generateBackoffWithVariableJitter.js",
@@ -30,6 +35,11 @@
30
35
  "require": "./api/getMediaImageClosestSize.js",
31
36
  "types": "./api/getMediaImageClosestSize.d.ts"
32
37
  },
38
+ "./api/getRateLimitRetryDelay": {
39
+ "import": "./api/getRateLimitRetryDelay.mjs",
40
+ "require": "./api/getRateLimitRetryDelay.js",
41
+ "types": "./api/getRateLimitRetryDelay.d.ts"
42
+ },
33
43
  "./api/getUrlAndParams": {
34
44
  "import": "./api/getUrlAndParams.mjs",
35
45
  "require": "./api/getUrlAndParams.js",
@@ -460,6 +470,11 @@
460
470
  "require": "./error/getErrorCode.js",
461
471
  "types": "./error/getErrorCode.d.ts"
462
472
  },
473
+ "./error/getRateLimit": {
474
+ "import": "./error/getRateLimit.mjs",
475
+ "require": "./error/getRateLimit.js",
476
+ "types": "./error/getRateLimit.d.ts"
477
+ },
463
478
  "./error": {
464
479
  "import": "./error/index.mjs",
465
480
  "require": "./error/index.js",
@@ -500,6 +515,11 @@
500
515
  "require": "./error/isNotFoundError.js",
501
516
  "types": "./error/isNotFoundError.d.ts"
502
517
  },
518
+ "./error/isRateLimitError": {
519
+ "import": "./error/isRateLimitError.mjs",
520
+ "require": "./error/isRateLimitError.js",
521
+ "types": "./error/isRateLimitError.d.ts"
522
+ },
503
523
  "./error/isSerializedAPIError": {
504
524
  "import": "./error/isSerializedAPIError.mjs",
505
525
  "require": "./error/isSerializedAPIError.js",