@vtex/api 1.9.2 → 1.9.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 (76) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +1 -1
  3. package/lib/Apps.d.ts +0 -66
  4. package/lib/Apps.js +0 -211
  5. package/lib/Billing.d.ts +0 -18
  6. package/lib/Billing.js +0 -27
  7. package/lib/Builder.d.ts +0 -40
  8. package/lib/Builder.js +0 -80
  9. package/lib/Events.d.ts +0 -6
  10. package/lib/Events.js +0 -19
  11. package/lib/HttpClient/context.d.ts +0 -9
  12. package/lib/HttpClient/context.js +0 -2
  13. package/lib/HttpClient/index.d.ts +0 -92
  14. package/lib/HttpClient/index.js +0 -121
  15. package/lib/HttpClient/middlewares/cache.d.ts +0 -16
  16. package/lib/HttpClient/middlewares/cache.js +0 -85
  17. package/lib/HttpClient/middlewares/metrics.d.ts +0 -3
  18. package/lib/HttpClient/middlewares/metrics.js +0 -41
  19. package/lib/HttpClient/middlewares/notFound.d.ts +0 -7
  20. package/lib/HttpClient/middlewares/notFound.js +0 -28
  21. package/lib/HttpClient/middlewares/recorder.d.ts +0 -3
  22. package/lib/HttpClient/middlewares/recorder.js +0 -26
  23. package/lib/HttpClient/middlewares/request.d.ts +0 -3
  24. package/lib/HttpClient/middlewares/request.js +0 -39
  25. package/lib/ID.d.ts +0 -23
  26. package/lib/ID.js +0 -46
  27. package/lib/IODataSource.d.ts +0 -23
  28. package/lib/IODataSource.js +0 -43
  29. package/lib/Logger.d.ts +0 -20
  30. package/lib/Logger.js +0 -62
  31. package/lib/Metadata.d.ts +0 -27
  32. package/lib/Metadata.js +0 -53
  33. package/lib/Registry.d.ts +0 -52
  34. package/lib/Registry.js +0 -112
  35. package/lib/Router.d.ts +0 -35
  36. package/lib/Router.js +0 -52
  37. package/lib/VBase.d.ts +0 -40
  38. package/lib/VBase.js +0 -82
  39. package/lib/Workspaces.d.ts +0 -17
  40. package/lib/Workspaces.js +0 -39
  41. package/lib/caches/CacheLayer.d.ts +0 -7
  42. package/lib/caches/CacheLayer.js +0 -2
  43. package/lib/caches/DiskCache.d.ts +0 -17
  44. package/lib/caches/DiskCache.js +0 -75
  45. package/lib/caches/LRUCache.d.ts +0 -16
  46. package/lib/caches/LRUCache.js +0 -49
  47. package/lib/caches/LRUDiskCache.d.ts +0 -21
  48. package/lib/caches/LRUDiskCache.js +0 -132
  49. package/lib/caches/MultilayeredCache.d.ts +0 -14
  50. package/lib/caches/MultilayeredCache.js +0 -76
  51. package/lib/caches/index.d.ts +0 -6
  52. package/lib/caches/index.js +0 -9
  53. package/lib/caches/typings.d.ts +0 -48
  54. package/lib/caches/typings.js +0 -2
  55. package/lib/constants.d.ts +0 -1
  56. package/lib/constants.js +0 -3
  57. package/lib/index.d.ts +0 -19
  58. package/lib/index.js +0 -21
  59. package/lib/metrics/metricsAccumulator.d.ts +0 -27
  60. package/lib/metrics/metricsAccumulator.js +0 -80
  61. package/lib/metrics/metricsLogger.d.ts +0 -6
  62. package/lib/metrics/metricsLogger.js +0 -2
  63. package/lib/responses.d.ts +0 -95
  64. package/lib/responses.js +0 -2
  65. package/lib/runtime.d.ts +0 -27
  66. package/lib/runtime.js +0 -2
  67. package/lib/utils/AppId.d.ts +0 -19
  68. package/lib/utils/AppId.js +0 -42
  69. package/lib/utils/Time.d.ts +0 -4
  70. package/lib/utils/Time.js +0 -7
  71. package/lib/utils/index.d.ts +0 -2
  72. package/lib/utils/index.js +0 -7
  73. package/lib/utils/json.d.ts +0 -5
  74. package/lib/utils/json.js +0 -18
  75. package/lib/utils/log.d.ts +0 -3
  76. package/lib/utils/log.js +0 -7
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const semver = require("semver");
4
- // Note: The name that composes the part of the appId that precedes the
5
- // character '@' includes the name given to the app and the vendor name.
6
- exports.removeBuild = (id) => id.split('+')[0];
7
- exports.removeVersionFromAppId = (appId) => appId.split('@')[0];
8
- exports.extractVersionFromAppId = (appId) => appId.split('@').slice(-1)[0];
9
- exports.transformToLinkedLocator = (appId) => appId.replace(/\+build.*$/, '+linked');
10
- exports.formatLocator = (name, versionAndBuild) => `${name}@${exports.removeBuild(versionAndBuild)}`;
11
- exports.parseAppId = (appId) => {
12
- const name = exports.removeVersionFromAppId(appId);
13
- const version = exports.extractVersionFromAppId(appId);
14
- const splittedVersion = version.split('+');
15
- return {
16
- build: splittedVersion[1],
17
- locator: exports.formatLocator(name, version),
18
- name,
19
- version: splittedVersion[0],
20
- };
21
- };
22
- exports.formatAppId = ({ locator, build }) => build ? `${locator}+${build}` : locator;
23
- exports.satisfies = (appId, version) => {
24
- const { version: appVer } = exports.parseAppId(appId);
25
- return semver.satisfies(appVer, version);
26
- };
27
- exports.versionToMajor = (version) => version.split('.')[0];
28
- exports.versionToMajorRange = (version) => `${exports.versionToMajor(version)}.x`;
29
- exports.formatMajorLocator = (name, version) => {
30
- const majorRange = exports.versionToMajorRange(version);
31
- return `${name}@${majorRange}`;
32
- };
33
- exports.appIdToAppAtMajor = (appId) => {
34
- const { name, version } = exports.parseAppId(appId);
35
- const majorRange = exports.versionToMajorRange(version);
36
- return `${name}@${majorRange}`;
37
- };
38
- // SemVer regex from https://github.com/sindresorhus/semver-regex
39
- const APP_ID_REGEX = /^[\w\-]+\.[\w\-]+@(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?$/;
40
- exports.isValidAppIdOrLocator = (appId) => {
41
- return APP_ID_REGEX.test(appId);
42
- };
@@ -1,4 +0,0 @@
1
- export declare const hrToMillis: ([seconds, nanoseconds]: [number, number]) => number;
2
- export declare const hrToNano: ([seconds, nanoseconds]: [number, number]) => number;
3
- export declare const formatNano: (nanoseconds: number) => string;
4
- export declare const reduceHrToNano: (list: ReadonlyArray<[number, number]>) => number;
package/lib/utils/Time.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const ramda_1 = require("ramda");
4
- exports.hrToMillis = ([seconds, nanoseconds]) => Math.round((seconds * 1e3) + (nanoseconds / 1e6));
5
- exports.hrToNano = ([seconds, nanoseconds]) => seconds * 1e9 + nanoseconds;
6
- exports.formatNano = (nanoseconds) => `${(nanoseconds / 1e9).toFixed(0)}s ${((nanoseconds / 1e6) % 1e3).toFixed(0)}ms`;
7
- exports.reduceHrToNano = ramda_1.reduce((acc, hr) => acc + exports.hrToNano(hr), 0);
@@ -1,2 +0,0 @@
1
- export * from './AppId';
2
- export * from './Time';
@@ -1,7 +0,0 @@
1
- "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- __export(require("./AppId"));
7
- __export(require("./Time"));
@@ -1,5 +0,0 @@
1
- export declare function cleanJson(json: {
2
- [k: string]: any;
3
- }, targetFields: string[]): {
4
- [k: string]: any;
5
- };
package/lib/utils/json.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- function cleanJson(json, targetFields) {
4
- for (const key of Object.keys(json)) {
5
- let deleted = false;
6
- for (const field of targetFields) {
7
- if (key === field) {
8
- delete json[key];
9
- deleted = true;
10
- }
11
- }
12
- if (!deleted && json[key] && typeof json[key] === 'object') {
13
- json[key] = cleanJson(json[key], targetFields);
14
- }
15
- }
16
- return json;
17
- }
18
- exports.cleanJson = cleanJson;
@@ -1,3 +0,0 @@
1
- export declare const removeSensitiveData: (log: any) => {
2
- [k: string]: any;
3
- };
package/lib/utils/log.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const json_1 = require("./json");
4
- const SENSITIVE_FIELDS = ['cookie', 'Cookie', 'vtexIdclientautcookie', 'error'];
5
- exports.removeSensitiveData = (log) => {
6
- return json_1.cleanJson(log, SENSITIVE_FIELDS);
7
- };