@gradientedge/commercetools-utils 4.11.2 → 4.11.3

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 (105) hide show
  1. package/dist/ge-commercetools-utils-browser.cjs.js +2 -0
  2. package/dist/ge-commercetools-utils-browser.cjs.js.map +1 -0
  3. package/dist/ge-commercetools-utils-browser.esm.js +2 -0
  4. package/dist/ge-commercetools-utils-browser.esm.js.map +1 -0
  5. package/dist/ge-commercetools-utils-node.cjs.js +2 -0
  6. package/dist/ge-commercetools-utils-node.cjs.js.map +1 -0
  7. package/dist/ge-commercetools-utils-node.esm.js +1 -0
  8. package/dist/typings/api/CommercetoolsApi.d.ts +436 -0
  9. package/dist/{api → typings/api}/index.d.ts +0 -1
  10. package/dist/typings/api/types.d.ts +12 -0
  11. package/dist/typings/auth/CommercetoolsAuth.d.ts +22 -0
  12. package/dist/typings/auth/CommercetoolsAuthApi.d.ts +21 -0
  13. package/dist/typings/auth/CommercetoolsGrant.d.ts +13 -0
  14. package/dist/{auth → typings/auth}/constants.d.ts +0 -4
  15. package/dist/{auth → typings/auth}/index.d.ts +0 -1
  16. package/dist/typings/auth/scopes.d.ts +2 -0
  17. package/dist/typings/auth/types.d.ts +43 -0
  18. package/dist/{auth → typings/auth}/utils.d.ts +0 -1
  19. package/dist/typings/constants.d.ts +1 -0
  20. package/dist/typings/error/CommercetoolsError.d.ts +16 -0
  21. package/dist/{error → typings/error}/index.d.ts +0 -1
  22. package/dist/{index.d.ts → typings/index.d.ts} +0 -1
  23. package/dist/typings/types.d.ts +21 -0
  24. package/dist/typings/utils/format.d.ts +1 -0
  25. package/dist/{utils → typings/utils}/index.d.ts +0 -2
  26. package/dist/typings/utils/mask.d.ts +6 -0
  27. package/dist/typings/utils/useragent.d.ts +1 -0
  28. package/package.json +23 -7
  29. package/dist/api/CommercetoolsApi.d.ts +0 -1096
  30. package/dist/api/CommercetoolsApi.d.ts.map +0 -1
  31. package/dist/api/CommercetoolsApi.js +0 -1425
  32. package/dist/api/CommercetoolsApi.js.map +0 -1
  33. package/dist/api/index.d.ts.map +0 -1
  34. package/dist/api/index.js +0 -15
  35. package/dist/api/index.js.map +0 -1
  36. package/dist/api/types.d.ts +0 -33
  37. package/dist/api/types.d.ts.map +0 -1
  38. package/dist/api/types.js +0 -3
  39. package/dist/api/types.js.map +0 -1
  40. package/dist/auth/CommercetoolsAuth.d.ts +0 -182
  41. package/dist/auth/CommercetoolsAuth.d.ts.map +0 -1
  42. package/dist/auth/CommercetoolsAuth.js +0 -326
  43. package/dist/auth/CommercetoolsAuth.js.map +0 -1
  44. package/dist/auth/CommercetoolsAuthApi.d.ts +0 -74
  45. package/dist/auth/CommercetoolsAuthApi.d.ts.map +0 -1
  46. package/dist/auth/CommercetoolsAuthApi.js +0 -248
  47. package/dist/auth/CommercetoolsAuthApi.js.map +0 -1
  48. package/dist/auth/CommercetoolsGrant.d.ts +0 -66
  49. package/dist/auth/CommercetoolsGrant.d.ts.map +0 -1
  50. package/dist/auth/CommercetoolsGrant.js +0 -82
  51. package/dist/auth/CommercetoolsGrant.js.map +0 -1
  52. package/dist/auth/constants.d.ts.map +0 -1
  53. package/dist/auth/constants.js +0 -32
  54. package/dist/auth/constants.js.map +0 -1
  55. package/dist/auth/index.d.ts.map +0 -1
  56. package/dist/auth/index.js +0 -15
  57. package/dist/auth/index.js.map +0 -1
  58. package/dist/auth/scopes.d.ts +0 -11
  59. package/dist/auth/scopes.d.ts.map +0 -1
  60. package/dist/auth/scopes.js +0 -30
  61. package/dist/auth/scopes.js.map +0 -1
  62. package/dist/auth/types.d.ts +0 -120
  63. package/dist/auth/types.d.ts.map +0 -1
  64. package/dist/auth/types.js +0 -28
  65. package/dist/auth/types.js.map +0 -1
  66. package/dist/auth/utils.d.ts.map +0 -1
  67. package/dist/auth/utils.js +0 -15
  68. package/dist/auth/utils.js.map +0 -1
  69. package/dist/constants.d.ts +0 -6
  70. package/dist/constants.d.ts.map +0 -1
  71. package/dist/constants.js +0 -9
  72. package/dist/constants.js.map +0 -1
  73. package/dist/error/CommercetoolsError.d.ts +0 -38
  74. package/dist/error/CommercetoolsError.d.ts.map +0 -1
  75. package/dist/error/CommercetoolsError.js +0 -117
  76. package/dist/error/CommercetoolsError.js.map +0 -1
  77. package/dist/error/index.d.ts.map +0 -1
  78. package/dist/error/index.js +0 -14
  79. package/dist/error/index.js.map +0 -1
  80. package/dist/index.d.ts.map +0 -1
  81. package/dist/index.js +0 -21
  82. package/dist/index.js.map +0 -1
  83. package/dist/types.d.ts +0 -44
  84. package/dist/types.d.ts.map +0 -1
  85. package/dist/types.js +0 -16
  86. package/dist/types.js.map +0 -1
  87. package/dist/utils/format.d.ts +0 -11
  88. package/dist/utils/format.d.ts.map +0 -1
  89. package/dist/utils/format.js +0 -48
  90. package/dist/utils/format.js.map +0 -1
  91. package/dist/utils/index.d.ts.map +0 -1
  92. package/dist/utils/index.js +0 -17
  93. package/dist/utils/index.js.map +0 -1
  94. package/dist/utils/isNode.d.ts +0 -2
  95. package/dist/utils/isNode.d.ts.map +0 -1
  96. package/dist/utils/isNode.js +0 -12
  97. package/dist/utils/isNode.js.map +0 -1
  98. package/dist/utils/mask.d.ts +0 -28
  99. package/dist/utils/mask.d.ts.map +0 -1
  100. package/dist/utils/mask.js +0 -56
  101. package/dist/utils/mask.js.map +0 -1
  102. package/dist/utils/useragent.d.ts +0 -10
  103. package/dist/utils/useragent.d.ts.map +0 -1
  104. package/dist/utils/useragent.js +0 -20
  105. package/dist/utils/useragent.js.map +0 -1
@@ -1,28 +0,0 @@
1
- /**
2
- * List of property names that we want to mask.
3
- * Names are not case sensitive.
4
- */
5
- export declare const SENSITIVE_PROPERTY_NAMES: string[];
6
- /**
7
- * List of HTTP header names that we want to mask.
8
- * Names are not case sensitive.
9
- */
10
- export declare const SENSITIVE_HEADER_NAMES: string[];
11
- /**
12
- * The string mask to use if none explicitly provided.
13
- */
14
- export declare const DEFAULT_MASKING_STRING = "********";
15
- /**
16
- * Mask all properties matching those in {@see SENSITIVE_PROPERTY_NAMES}
17
- */
18
- export declare function maskSensitiveInput(data: unknown): unknown;
19
- /**
20
- * Mask all properties matching those in {@see SENSITIVE_HEADER_NAMES}
21
- */
22
- export declare function maskSensitiveHeaders(data: unknown): unknown;
23
- /**
24
- * Mask all properties defined by {@see propertyNames} in the given {@see data} object
25
- * with the mask string defined by the {@see mask} parameter.
26
- */
27
- export declare function maskSensitiveData(data: unknown, propertyNames: string[], mask?: string): unknown;
28
- //# sourceMappingURL=mask.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../src/lib/utils/mask.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,wBAAwB,UAAgC,CAAA;AAErE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,UAAoB,CAAA;AAEvD;;GAEG;AACH,eAAO,MAAM,sBAAsB,aAAa,CAAA;AAEhD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,WAE/C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,WAEjD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,IAAI,SAAyB,WAWtG"}
@@ -1,56 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.maskSensitiveData = exports.maskSensitiveHeaders = exports.maskSensitiveInput = exports.DEFAULT_MASKING_STRING = exports.SENSITIVE_HEADER_NAMES = exports.SENSITIVE_PROPERTY_NAMES = void 0;
7
- var lodash_clonedeep_1 = __importDefault(require("lodash.clonedeep"));
8
- var traverse_1 = __importDefault(require("traverse"));
9
- /**
10
- * List of property names that we want to mask.
11
- * Names are not case sensitive.
12
- */
13
- exports.SENSITIVE_PROPERTY_NAMES = ['password', 'refresh_token'];
14
- /**
15
- * List of HTTP header names that we want to mask.
16
- * Names are not case sensitive.
17
- */
18
- exports.SENSITIVE_HEADER_NAMES = ['authorization'];
19
- /**
20
- * The string mask to use if none explicitly provided.
21
- */
22
- exports.DEFAULT_MASKING_STRING = '********';
23
- /**
24
- * Mask all properties matching those in {@see SENSITIVE_PROPERTY_NAMES}
25
- */
26
- function maskSensitiveInput(data) {
27
- return maskSensitiveData(data, exports.SENSITIVE_PROPERTY_NAMES);
28
- }
29
- exports.maskSensitiveInput = maskSensitiveInput;
30
- /**
31
- * Mask all properties matching those in {@see SENSITIVE_HEADER_NAMES}
32
- */
33
- function maskSensitiveHeaders(data) {
34
- return maskSensitiveData(data, exports.SENSITIVE_HEADER_NAMES);
35
- }
36
- exports.maskSensitiveHeaders = maskSensitiveHeaders;
37
- /**
38
- * Mask all properties defined by {@see propertyNames} in the given {@see data} object
39
- * with the mask string defined by the {@see mask} parameter.
40
- */
41
- function maskSensitiveData(data, propertyNames, mask) {
42
- if (mask === void 0) { mask = exports.DEFAULT_MASKING_STRING; }
43
- if (typeof data === 'object') {
44
- var mutatedData = (0, lodash_clonedeep_1.default)(data);
45
- (0, traverse_1.default)(mutatedData).forEach(function () {
46
- var _a, _b;
47
- if (propertyNames.includes((_b = (_a = this.key) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : '')) {
48
- this.update(mask);
49
- }
50
- });
51
- return mutatedData;
52
- }
53
- return data;
54
- }
55
- exports.maskSensitiveData = maskSensitiveData;
56
- //# sourceMappingURL=mask.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mask.js","sourceRoot":"","sources":["../../src/lib/utils/mask.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAwC;AACxC,sDAA+B;AAE/B;;;GAGG;AACU,QAAA,wBAAwB,GAAG,CAAC,UAAU,EAAE,eAAe,CAAC,CAAA;AAErE;;;GAGG;AACU,QAAA,sBAAsB,GAAG,CAAC,eAAe,CAAC,CAAA;AAEvD;;GAEG;AACU,QAAA,sBAAsB,GAAG,UAAU,CAAA;AAEhD;;GAEG;AACH,SAAgB,kBAAkB,CAAC,IAAa;IAC9C,OAAO,iBAAiB,CAAC,IAAI,EAAE,gCAAwB,CAAC,CAAA;AAC1D,CAAC;AAFD,gDAEC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAAC,IAAa;IAChD,OAAO,iBAAiB,CAAC,IAAI,EAAE,8BAAsB,CAAC,CAAA;AACxD,CAAC;AAFD,oDAEC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,IAAa,EAAE,aAAuB,EAAE,IAA6B;IAA7B,qBAAA,EAAA,OAAO,8BAAsB;IACrG,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,IAAM,WAAW,GAAG,IAAA,0BAAS,EAAC,IAAI,CAAC,CAAA;QACnC,IAAA,kBAAQ,EAAC,WAAW,CAAC,CAAC,OAAO,CAAC;;YAC5B,IAAI,aAAa,CAAC,QAAQ,CAAC,MAAA,MAAA,IAAI,CAAC,GAAG,0CAAE,WAAW,EAAE,mCAAI,EAAE,CAAC,EAAE;gBACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;aAClB;QACH,CAAC,CAAC,CAAA;QACF,OAAO,WAAW,CAAA;KACnB;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAXD,8CAWC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Build a string suitable for sending as the `User-Agent` HTTP header.
3
- * This should contain information that allows commercetools to easily
4
- * identify the source of the request. The `systemIdentifier` comes from
5
- * {@see CommercetoolsApiConfig.systemIdentifier} and should be a string
6
- * that uniquely identifies the application where this package is being
7
- * used.
8
- */
9
- export declare function buildUserAgent(systemIdentifier?: string): string;
10
- //# sourceMappingURL=useragent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useragent.d.ts","sourceRoot":"","sources":["../../src/lib/utils/useragent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,gBAAgB,CAAC,EAAE,MAAM,UAMvD"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildUserAgent = void 0;
4
- /**
5
- * Build a string suitable for sending as the `User-Agent` HTTP header.
6
- * This should contain information that allows commercetools to easily
7
- * identify the source of the request. The `systemIdentifier` comes from
8
- * {@see CommercetoolsApiConfig.systemIdentifier} and should be a string
9
- * that uniquely identifies the application where this package is being
10
- * used.
11
- */
12
- function buildUserAgent(systemIdentifier) {
13
- var userAgent = "@gradientedge/commercetools-utils";
14
- if (systemIdentifier) {
15
- userAgent = "".concat(userAgent, " (").concat(systemIdentifier, ")");
16
- }
17
- return userAgent;
18
- }
19
- exports.buildUserAgent = buildUserAgent;
20
- //# sourceMappingURL=useragent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useragent.js","sourceRoot":"","sources":["../../src/lib/utils/useragent.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,gBAAyB;IACtD,IAAI,SAAS,GAAG,mCAAmC,CAAA;IACnD,IAAI,gBAAgB,EAAE;QACpB,SAAS,GAAG,UAAG,SAAS,eAAK,gBAAgB,MAAG,CAAA;KACjD;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAND,wCAMC"}