@or-sdk/ccp 1.1.1-beta.2850.0 → 1.1.1-beta.2851.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 (65) hide show
  1. package/dist/cjs/Ccp.js +0 -5
  2. package/dist/cjs/Ccp.js.map +1 -1
  3. package/dist/cjs/api/customersApi.js +1 -1
  4. package/dist/cjs/api/customersApi.js.map +1 -1
  5. package/dist/cjs/api/index.js +1 -11
  6. package/dist/cjs/api/index.js.map +1 -1
  7. package/dist/esm/Ccp.js +1 -6
  8. package/dist/esm/Ccp.js.map +1 -1
  9. package/dist/esm/api/customersApi.js +1 -1
  10. package/dist/esm/api/customersApi.js.map +1 -1
  11. package/dist/esm/api/index.js +0 -5
  12. package/dist/esm/api/index.js.map +1 -1
  13. package/dist/types/Ccp.d.ts +1 -6
  14. package/dist/types/Ccp.d.ts.map +1 -1
  15. package/dist/types/api/index.d.ts +0 -5
  16. package/dist/types/api/index.d.ts.map +1 -1
  17. package/dist/types/types.d.ts +0 -58
  18. package/dist/types/types.d.ts.map +1 -1
  19. package/package.json +2 -2
  20. package/src/Ccp.ts +1 -11
  21. package/src/api/customersApi.ts +1 -1
  22. package/src/api/index.ts +0 -5
  23. package/src/types.ts +0 -66
  24. package/dist/cjs/api/accountsApi.js +0 -79
  25. package/dist/cjs/api/accountsApi.js.map +0 -1
  26. package/dist/cjs/api/categoriesApi.js +0 -78
  27. package/dist/cjs/api/categoriesApi.js.map +0 -1
  28. package/dist/cjs/api/environmentsApi.js +0 -79
  29. package/dist/cjs/api/environmentsApi.js.map +0 -1
  30. package/dist/cjs/api/mappingApi.js +0 -78
  31. package/dist/cjs/api/mappingApi.js.map +0 -1
  32. package/dist/cjs/api/reportingApi.js +0 -94
  33. package/dist/cjs/api/reportingApi.js.map +0 -1
  34. package/dist/cjs/utils.js +0 -16
  35. package/dist/cjs/utils.js.map +0 -1
  36. package/dist/esm/api/accountsApi.js +0 -26
  37. package/dist/esm/api/accountsApi.js.map +0 -1
  38. package/dist/esm/api/categoriesApi.js +0 -25
  39. package/dist/esm/api/categoriesApi.js.map +0 -1
  40. package/dist/esm/api/environmentsApi.js +0 -26
  41. package/dist/esm/api/environmentsApi.js.map +0 -1
  42. package/dist/esm/api/mappingApi.js +0 -25
  43. package/dist/esm/api/mappingApi.js.map +0 -1
  44. package/dist/esm/api/reportingApi.js +0 -36
  45. package/dist/esm/api/reportingApi.js.map +0 -1
  46. package/dist/esm/utils.js +0 -11
  47. package/dist/esm/utils.js.map +0 -1
  48. package/dist/types/api/accountsApi.d.ts +0 -7
  49. package/dist/types/api/accountsApi.d.ts.map +0 -1
  50. package/dist/types/api/categoriesApi.d.ts +0 -7
  51. package/dist/types/api/categoriesApi.d.ts.map +0 -1
  52. package/dist/types/api/environmentsApi.d.ts +0 -7
  53. package/dist/types/api/environmentsApi.d.ts.map +0 -1
  54. package/dist/types/api/mappingApi.d.ts +0 -7
  55. package/dist/types/api/mappingApi.d.ts.map +0 -1
  56. package/dist/types/api/reportingApi.d.ts +0 -8
  57. package/dist/types/api/reportingApi.d.ts.map +0 -1
  58. package/dist/types/utils.d.ts +0 -4
  59. package/dist/types/utils.d.ts.map +0 -1
  60. package/src/api/accountsApi.ts +0 -23
  61. package/src/api/categoriesApi.ts +0 -16
  62. package/src/api/environmentsApi.ts +0 -21
  63. package/src/api/mappingApi.ts +0 -16
  64. package/src/api/reportingApi.ts +0 -43
  65. package/src/utils.ts +0 -9
@@ -1,78 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- var baseApi_1 = require("./baseApi");
55
- var MappingApi = (function (_super) {
56
- __extends(MappingApi, _super);
57
- function MappingApi() {
58
- var _this = _super !== null && _super.apply(this, arguments) || this;
59
- _this.apiBasePath = 'api/v1/mapping';
60
- return _this;
61
- }
62
- MappingApi.prototype.getMapping = function () {
63
- return __awaiter(this, void 0, void 0, function () {
64
- return __generator(this, function (_a) {
65
- switch (_a.label) {
66
- case 0: return [4, this.apiCall({
67
- method: 'GET',
68
- route: "".concat(this.apiBasePath),
69
- })];
70
- case 1: return [2, _a.sent()];
71
- }
72
- });
73
- });
74
- };
75
- return MappingApi;
76
- }(baseApi_1.BaseApi));
77
- exports.default = MappingApi;
78
- //# sourceMappingURL=mappingApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mappingApi.js","sourceRoot":"","sources":["../../../src/api/mappingApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AAGpC;IAAwC,8BAAO;IAA/C;QAAA,qEAYC;QAXkB,iBAAW,GAAG,gBAAgB,CAAC;;IAWlD,CAAC;IANc,+BAAU,GAAvB;;;;4BACS,WAAM,IAAI,CAAC,OAAO,CAAC;4BACxB,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,CAAE;yBAC7B,CAAC,EAAA;4BAHF,WAAO,SAGL,EAAC;;;;KACJ;IACH,iBAAC;AAAD,CAAC,AAZD,CAAwC,iBAAO,GAY9C"}
@@ -1,94 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- var baseApi_1 = require("./baseApi");
55
- var utils_1 = require("../utils");
56
- var ReportingApi = (function (_super) {
57
- __extends(ReportingApi, _super);
58
- function ReportingApi() {
59
- var _this = _super !== null && _super.apply(this, arguments) || this;
60
- _this.apiBasePath = 'api/v1';
61
- return _this;
62
- }
63
- ReportingApi.prototype.getUsage = function (params) {
64
- return __awaiter(this, void 0, void 0, function () {
65
- return __generator(this, function (_a) {
66
- switch (_a.label) {
67
- case 0: return [4, this.apiCall({
68
- method: 'GET',
69
- route: "".concat(this.apiBasePath, "/usage"),
70
- params: (0, utils_1.adaptParams)(params),
71
- })];
72
- case 1: return [2, _a.sent()];
73
- }
74
- });
75
- });
76
- };
77
- ReportingApi.prototype.getUsageTotal = function (params) {
78
- return __awaiter(this, void 0, void 0, function () {
79
- return __generator(this, function (_a) {
80
- switch (_a.label) {
81
- case 0: return [4, this.apiCall({
82
- method: 'GET',
83
- route: "".concat(this.apiBasePath, "/usage/total"),
84
- params: (0, utils_1.adaptParams)(params),
85
- })];
86
- case 1: return [2, _a.sent()];
87
- }
88
- });
89
- });
90
- };
91
- return ReportingApi;
92
- }(baseApi_1.BaseApi));
93
- exports.default = ReportingApi;
94
- //# sourceMappingURL=reportingApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reportingApi.js","sourceRoot":"","sources":["../../../src/api/reportingApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AAEpC,kCAAuC;AAEvC;IAA0C,gCAAO;IAAjD;QAAA,qEAsCC;QArCkB,iBAAW,GAAG,QAAQ,CAAC;;IAqC1C,CAAC;IAzBc,+BAAQ,GAArB,UAAsB,MAA0B;;;;4BACvC,WAAM,IAAI,CAAC,OAAO,CAAC;4BACxB,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,WAAQ;4BAClC,MAAM,EAAE,IAAA,mBAAW,EAAqB,MAAM,CAAC;yBAChD,CAAC,EAAA;4BAJF,WAAO,SAIL,EAAC;;;;KACJ;IAYY,oCAAa,GAA1B,UAA2B,MAA0B;;;;4BAC5C,WAAM,IAAI,CAAC,OAAO,CAAC;4BACxB,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,iBAAc;4BACxC,MAAM,EAAE,IAAA,mBAAW,EAAqB,MAAM,CAAC;yBAChD,CAAC,EAAA;4BAJF,WAAO,SAIL,EAAC;;;;KACJ;IACH,mBAAC;AAAD,CAAC,AAtCD,CAA0C,iBAAO,GAsChD"}
package/dist/cjs/utils.js DELETED
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.adaptParams = void 0;
4
- function adaptParams(params) {
5
- var p = {};
6
- Object.entries(params).forEach(function (_a) {
7
- var k = _a[0], v = _a[1];
8
- if (Array.isArray(v))
9
- p[k] = v.join();
10
- else
11
- p[k] = v;
12
- });
13
- return p;
14
- }
15
- exports.adaptParams = adaptParams;
16
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAoC,MAAS;IACtE,IAAM,CAAC,GAAG,EAAiC,CAAC;IAE3C,MAAM,CAAC,OAAO,CAAC,MAAM,CAA+B,CAAC,OAAO,CAAC,UAAC,EAAM;YAAL,CAAC,QAAA,EAAE,CAAC,QAAA;QAClE,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;;YACjC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,CAAC;AACX,CAAC;AARD,kCAQC"}
@@ -1,26 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { BaseApi } from './baseApi';
11
- export default class AccountsApi extends BaseApi {
12
- constructor() {
13
- super(...arguments);
14
- this.apiBasePath = 'api/v1/accounts';
15
- }
16
- getAccounts(params) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- return yield this.apiCall({
19
- method: 'GET',
20
- route: `${this.apiBasePath}`,
21
- params,
22
- });
23
- });
24
- }
25
- }
26
- //# sourceMappingURL=accountsApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accountsApi.js","sourceRoot":"","sources":["../../../src/api/accountsApi.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAAhD;;QACmB,gBAAW,GAAG,iBAAiB,CAAC;IAkBnD,CAAC;IAPc,WAAW,CAAC,MAA4B;;YACnD,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;gBAC5B,MAAM;aACP,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
@@ -1,25 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { BaseApi } from './baseApi';
11
- export default class CategoriesApi extends BaseApi {
12
- constructor() {
13
- super(...arguments);
14
- this.apiBasePath = 'api/v1/categories';
15
- }
16
- getCategories() {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- return yield this.apiCall({
19
- method: 'GET',
20
- route: `${this.apiBasePath}`,
21
- });
22
- });
23
- }
24
- }
25
- //# sourceMappingURL=categoriesApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"categoriesApi.js","sourceRoot":"","sources":["../../../src/api/categoriesApi.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,OAAO;IAAlD;;QACmB,gBAAW,GAAG,mBAAmB,CAAC;IAWrD,CAAC;IANc,aAAa;;YACxB,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;aAC7B,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
@@ -1,26 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { BaseApi } from './baseApi';
11
- export default class EnvironmentsApi extends BaseApi {
12
- constructor() {
13
- super(...arguments);
14
- this.apiBasePath = 'api/v1/environments';
15
- }
16
- getEnvironments(params) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- return yield this.apiCall({
19
- method: 'GET',
20
- route: `${this.apiBasePath}`,
21
- params,
22
- });
23
- });
24
- }
25
- }
26
- //# sourceMappingURL=environmentsApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environmentsApi.js","sourceRoot":"","sources":["../../../src/api/environmentsApi.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAApD;;QACmB,gBAAW,GAAG,qBAAqB,CAAC;IAgBvD,CAAC;IAPc,eAAe,CAAC,MAAgC;;YAC3D,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;gBAC5B,MAAM;aACP,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
@@ -1,25 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { BaseApi } from './baseApi';
11
- export default class MappingApi extends BaseApi {
12
- constructor() {
13
- super(...arguments);
14
- this.apiBasePath = 'api/v1/mapping';
15
- }
16
- getMapping() {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- return yield this.apiCall({
19
- method: 'GET',
20
- route: `${this.apiBasePath}`,
21
- });
22
- });
23
- }
24
- }
25
- //# sourceMappingURL=mappingApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mappingApi.js","sourceRoot":"","sources":["../../../src/api/mappingApi.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;IAA/C;;QACmB,gBAAW,GAAG,gBAAgB,CAAC;IAWlD,CAAC;IANc,UAAU;;YACrB,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;aAC7B,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
@@ -1,36 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { BaseApi } from './baseApi';
11
- import { adaptParams } from '../utils';
12
- export default class ReportingApi extends BaseApi {
13
- constructor() {
14
- super(...arguments);
15
- this.apiBasePath = 'api/v1';
16
- }
17
- getUsage(params) {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- return yield this.apiCall({
20
- method: 'GET',
21
- route: `${this.apiBasePath}/usage`,
22
- params: adaptParams(params),
23
- });
24
- });
25
- }
26
- getUsageTotal(params) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- return yield this.apiCall({
29
- method: 'GET',
30
- route: `${this.apiBasePath}/usage/total`,
31
- params: adaptParams(params),
32
- });
33
- });
34
- }
35
- }
36
- //# sourceMappingURL=reportingApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reportingApi.js","sourceRoot":"","sources":["../../../src/api/reportingApi.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,OAAO;IAAjD;;QACmB,gBAAW,GAAG,QAAQ,CAAC;IAqC1C,CAAC;IAzBc,QAAQ,CAAC,MAA0B;;YAC9C,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,QAAQ;gBAClC,MAAM,EAAE,WAAW,CAAqB,MAAM,CAAC;aAChD,CAAC,CAAC;QACL,CAAC;KAAA;IAYY,aAAa,CAAC,MAA0B;;YACnD,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,cAAc;gBACxC,MAAM,EAAE,WAAW,CAAqB,MAAM,CAAC;aAChD,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
package/dist/esm/utils.js DELETED
@@ -1,11 +0,0 @@
1
- export function adaptParams(params) {
2
- const p = {};
3
- Object.entries(params).forEach(([k, v]) => {
4
- if (Array.isArray(v))
5
- p[k] = v.join();
6
- else
7
- p[k] = v;
8
- });
9
- return p;
10
- }
11
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAoC,MAAS;IACtE,MAAM,CAAC,GAAG,EAAiC,CAAC;IAE3C,MAAM,CAAC,OAAO,CAAC,MAAM,CAA+B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QACvE,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;;YACjC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -1,7 +0,0 @@
1
- import { BaseApi } from './baseApi';
2
- import { Account, AccountRequestParams } from '../types';
3
- export default class AccountsApi extends BaseApi {
4
- private readonly apiBasePath;
5
- getAccounts(params: AccountRequestParams): Promise<Account[]>;
6
- }
7
- //# sourceMappingURL=accountsApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accountsApi.d.ts","sourceRoot":"","sources":["../../../src/api/accountsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAC9C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IAWpC,WAAW,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAO3E"}
@@ -1,7 +0,0 @@
1
- import { BaseApi } from './baseApi';
2
- import { Category } from '../types';
3
- export default class CategoriesApi extends BaseApi {
4
- private readonly apiBasePath;
5
- getCategories(): Promise<Category[]>;
6
- }
7
- //# sourceMappingURL=categoriesApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"categoriesApi.d.ts","sourceRoot":"","sources":["../../../src/api/categoriesApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,OAAO;IAChD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IAKtC,aAAa,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;CAMlD"}
@@ -1,7 +0,0 @@
1
- import { BaseApi } from './baseApi';
2
- import { Environment, EnvironmentRequestParams } from '../types';
3
- export default class EnvironmentsApi extends BaseApi {
4
- private readonly apiBasePath;
5
- getEnvironments(params: EnvironmentRequestParams): Promise<Environment[]>;
6
- }
7
- //# sourceMappingURL=environmentsApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environmentsApi.d.ts","sourceRoot":"","sources":["../../../src/api/environmentsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEjE,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAClD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyB;IASxC,eAAe,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAOvF"}
@@ -1,7 +0,0 @@
1
- import { BaseApi } from './baseApi';
2
- import { Mapping } from '../types';
3
- export default class MappingApi extends BaseApi {
4
- private readonly apiBasePath;
5
- getMapping(): Promise<Mapping>;
6
- }
7
- //# sourceMappingURL=mappingApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mappingApi.d.ts","sourceRoot":"","sources":["../../../src/api/mappingApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoB;IAKnC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;CAM5C"}
@@ -1,8 +0,0 @@
1
- import { BaseApi } from './baseApi';
2
- import { UsageRequestParams, Usage } from '../types';
3
- export default class ReportingApi extends BaseApi {
4
- private readonly apiBasePath;
5
- getUsage(params: UsageRequestParams): Promise<Usage[]>;
6
- getUsageTotal(params: UsageRequestParams): Promise<number>;
7
- }
8
- //# sourceMappingURL=reportingApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reportingApi.d.ts","sourceRoot":"","sources":["../../../src/api/reportingApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGrD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,OAAO;IAC/C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAY;IAY3B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAkBtD,aAAa,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;CAOxE"}
@@ -1,4 +0,0 @@
1
- export declare function adaptParams<T extends Record<string, unknown>>(params: T): {
2
- [K in keyof T]: unknown;
3
- };
4
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO;CAAE,CAQrG"}
@@ -1,23 +0,0 @@
1
- import { BaseApi } from './baseApi';
2
- import { Account, AccountRequestParams } from '../types';
3
-
4
- export default class AccountsApi extends BaseApi {
5
- private readonly apiBasePath = 'api/v1/accounts';
6
-
7
- /**
8
- * @description get client's accounts
9
- * @param clientId
10
- * @param id
11
- * @param accountName
12
- * @param billable
13
- * @param environmentId
14
- * @param status
15
- */
16
- public async getAccounts(params: AccountRequestParams): Promise<Account[]> {
17
- return await this.apiCall({
18
- method: 'GET',
19
- route: `${this.apiBasePath}`,
20
- params,
21
- });
22
- }
23
- }
@@ -1,16 +0,0 @@
1
- import { BaseApi } from './baseApi';
2
- import { Category } from '../types';
3
-
4
- export default class CategoriesApi extends BaseApi {
5
- private readonly apiBasePath = 'api/v1/categories';
6
-
7
- /**
8
- * @description get categories
9
- */
10
- public async getCategories(): Promise<Category[]> {
11
- return await this.apiCall({
12
- method: 'GET',
13
- route: `${this.apiBasePath}`,
14
- });
15
- }
16
- }
@@ -1,21 +0,0 @@
1
- import { BaseApi } from './baseApi';
2
- import { Environment, EnvironmentRequestParams } from '../types';
3
-
4
- export default class EnvironmentsApi extends BaseApi {
5
- private readonly apiBasePath = 'api/v1/environments';
6
-
7
- /**
8
- * @description get client's environments
9
- * @param clientId
10
- * @param id
11
- * @param environmentName
12
- * @param status
13
- */
14
- public async getEnvironments(params: EnvironmentRequestParams): Promise<Environment[]> {
15
- return await this.apiCall({
16
- method: 'GET',
17
- route: `${this.apiBasePath}`,
18
- params,
19
- });
20
- }
21
- }
@@ -1,16 +0,0 @@
1
- import { BaseApi } from './baseApi';
2
- import { Mapping } from '../types';
3
-
4
- export default class MappingApi extends BaseApi {
5
- private readonly apiBasePath = 'api/v1/mapping';
6
-
7
- /**
8
- * @description get mapping
9
- */
10
- public async getMapping(): Promise<Mapping> {
11
- return await this.apiCall({
12
- method: 'GET',
13
- route: `${this.apiBasePath}`,
14
- });
15
- }
16
- }
@@ -1,43 +0,0 @@
1
- import { BaseApi } from './baseApi';
2
- import { UsageRequestParams, Usage } from '../types';
3
- import { adaptParams } from '../utils';
4
-
5
- export default class ReportingApi extends BaseApi {
6
- private readonly apiBasePath = 'api/v1';
7
-
8
- /**
9
- * @description get usage traffic
10
- * @param clientId string
11
- * @param dateFrom Date
12
- * @param dateTo Date
13
- * @param tiers boolean
14
- * @param environments string[]
15
- * @param accounts string[]
16
- * @param categories string[]
17
- */
18
- public async getUsage(params: UsageRequestParams): Promise<Usage[]> {
19
- return await this.apiCall({
20
- method: 'GET',
21
- route: `${this.apiBasePath}/usage`,
22
- params: adaptParams<UsageRequestParams>(params),
23
- });
24
- }
25
-
26
- /**
27
- * @description get usage traffic total cost
28
- * @param clientId string
29
- * @param dateFrom Date
30
- * @param dateTo Date
31
- * @param tiers boolean
32
- * @param environments string[]
33
- * @param accounts string[]
34
- * @param categories string[]
35
- */
36
- public async getUsageTotal(params: UsageRequestParams): Promise<number> {
37
- return await this.apiCall({
38
- method: 'GET',
39
- route: `${this.apiBasePath}/usage/total`,
40
- params: adaptParams<UsageRequestParams>(params),
41
- });
42
- }
43
- }
package/src/utils.ts DELETED
@@ -1,9 +0,0 @@
1
- export function adaptParams<T extends Record<string, unknown>>(params: T): { [K in keyof T]: unknown } {
2
- const p = {} as { [K in keyof T]: unknown };
3
-
4
- (Object.entries(params) as Array<[keyof T, unknown]>).forEach(([k, v]) => {
5
- if (Array.isArray(v)) p[k] = v.join();
6
- else p[k] = v;
7
- });
8
- return p;
9
- }