@or-sdk/ccp 1.1.0 → 1.1.1-beta.2834.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.
- package/dist/cjs/Ccp.js +4 -0
- package/dist/cjs/Ccp.js.map +1 -1
- package/dist/cjs/api/accountsApi.js +79 -0
- package/dist/cjs/api/accountsApi.js.map +1 -0
- package/dist/cjs/api/categoriesApi.js +78 -0
- package/dist/cjs/api/categoriesApi.js.map +1 -0
- package/dist/cjs/api/environmentsApi.js +79 -0
- package/dist/cjs/api/environmentsApi.js.map +1 -0
- package/dist/cjs/api/index.js +9 -1
- package/dist/cjs/api/index.js.map +1 -1
- package/dist/cjs/api/mappingApi.js +78 -0
- package/dist/cjs/api/mappingApi.js.map +1 -0
- package/dist/esm/Ccp.js +5 -1
- package/dist/esm/Ccp.js.map +1 -1
- package/dist/esm/api/accountsApi.js +26 -0
- package/dist/esm/api/accountsApi.js.map +1 -0
- package/dist/esm/api/categoriesApi.js +25 -0
- package/dist/esm/api/categoriesApi.js.map +1 -0
- package/dist/esm/api/environmentsApi.js +26 -0
- package/dist/esm/api/environmentsApi.js.map +1 -0
- package/dist/esm/api/index.js +4 -0
- package/dist/esm/api/index.js.map +1 -1
- package/dist/esm/api/mappingApi.js +25 -0
- package/dist/esm/api/mappingApi.js.map +1 -0
- package/dist/types/Ccp.d.ts +5 -1
- package/dist/types/Ccp.d.ts.map +1 -1
- package/dist/types/api/accountsApi.d.ts +7 -0
- package/dist/types/api/accountsApi.d.ts.map +1 -0
- package/dist/types/api/categoriesApi.d.ts +7 -0
- package/dist/types/api/categoriesApi.d.ts.map +1 -0
- package/dist/types/api/environmentsApi.d.ts +7 -0
- package/dist/types/api/environmentsApi.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +4 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/mappingApi.d.ts +7 -0
- package/dist/types/api/mappingApi.d.ts.map +1 -0
- package/dist/types/types.d.ts +40 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +2 -3
- package/src/Ccp.ts +9 -1
- package/src/api/accountsApi.ts +23 -0
- package/src/api/categoriesApi.ts +16 -0
- package/src/api/environmentsApi.ts +21 -0
- package/src/api/index.ts +4 -0
- package/src/api/mappingApi.ts +16 -0
- package/src/types.ts +46 -0
package/dist/cjs/Ccp.js
CHANGED
|
@@ -45,6 +45,10 @@ var Ccp = (function (_super) {
|
|
|
45
45
|
var apiCall = _this.callApi.bind(_this);
|
|
46
46
|
_this.withApiErrorLog = Boolean(params.withApiErrorLog);
|
|
47
47
|
_this.customersApi = new api_1.CustomersApi(apiCall);
|
|
48
|
+
_this.environmentsApi = new api_1.EnvironmentsApi(apiCall);
|
|
49
|
+
_this.accountsApi = new api_1.AccountsApi(apiCall);
|
|
50
|
+
_this.categoriesApi = new api_1.CategoriesApi(apiCall);
|
|
51
|
+
_this.mappingApi = new api_1.MappingApi(apiCall);
|
|
48
52
|
return _this;
|
|
49
53
|
}
|
|
50
54
|
Ccp.prototype.callApi = function (params) {
|
package/dist/cjs/Ccp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ccp.js","sourceRoot":"","sources":["../../src/Ccp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"Ccp.js","sourceRoot":"","sources":["../../src/Ccp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAA8D;AAC9D,6BAA8F;AAC9F,uCAAsC;AAEtC,yCAA0C;AAS1C;IAAyB,uBAAI;IAc3B,aAAY,MAAiB;QAA7B,iBAmBC;QAlBS,IAAA,KAAK,GAA8B,MAAM,MAApC,EAAE,YAAY,GAAgB,MAAM,aAAtB,EAAE,SAAS,GAAK,MAAM,UAAX,CAAY;gBAElD,kBAAM;YACJ,KAAK,OAAA;YACL,YAAY,cAAA;YACZ,U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CAAC,KAAK,CAAC,0BAAmB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAE,CAAC,CAAC;QACrD,OAAO,CAAC,KAAK,CAAC,0BAAmB,IAAI,CAAC,SAAS,CAAC,CAAA,MAAA,CAAC,CAAC,MAAM,0CAAE,MAAM,KAAI,EAAE,CAAC,CAAE,CAAC,CAAC;QAC3E,OAAO,CAAC,KAAK,CAAC,0BAAmB,CAAC;;YAChC,IAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAA,MAAA,CAAC,CAAC,MAAM,0CAAE,IAAI,KAAI,EAAE,CAAC,CAAC;YACjD,OAAO,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;QAC5D,CAAC,CAAC,EAAE,CAAE,CAAC,CAAC;QACR,OAAO,CAAC,KAAK,CAAC,0BAAmB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC,CAAC;QAC7D,OAAO,CAAC,KAAK,CAAC,0BAAmB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAE,CAAC,CAAC;QAChE,OAAO,CAAC,KAAK,CAAC,0BAAmB,MAAA,CAAC,CAAC,MAAM,0CAAE,OAAO,CAAC,aAAa,CAAE,CAAC,CAAC;IACtE,CAAC;IACH,UAAC;AAAD,CAAC,AAlED,CAAyB,WAAI,GAkE5B;AAlEY,kBAAG"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 AccountsApi = (function (_super) {
|
|
56
|
+
__extends(AccountsApi, _super);
|
|
57
|
+
function AccountsApi() {
|
|
58
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
59
|
+
_this.apiBasePath = 'api/v1/accounts';
|
|
60
|
+
return _this;
|
|
61
|
+
}
|
|
62
|
+
AccountsApi.prototype.getAccounts = function (params) {
|
|
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
|
+
params: params,
|
|
70
|
+
})];
|
|
71
|
+
case 1: return [2, _a.sent()];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
return AccountsApi;
|
|
77
|
+
}(baseApi_1.BaseApi));
|
|
78
|
+
exports.default = AccountsApi;
|
|
79
|
+
//# sourceMappingURL=accountsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accountsApi.js","sourceRoot":"","sources":["../../../src/api/accountsApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AAGpC;IAAyC,+BAAO;IAAhD;QAAA,qEAmBC;QAlBkB,iBAAW,GAAG,iBAAiB,CAAC;;IAkBnD,CAAC;IAPc,iCAAW,GAAxB,UAAyB,MAA4B;;;;4BAC5C,WAAM,IAAI,CAAC,OAAO,CAAC;4BACxB,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,CAAE;4BAC5B,MAAM,QAAA;yBACP,CAAC,EAAA;4BAJF,WAAO,SAIL,EAAC;;;;KACJ;IACH,kBAAC;AAAD,CAAC,AAnBD,CAAyC,iBAAO,GAmB/C"}
|
|
@@ -0,0 +1,78 @@
|
|
|
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 CategoriesApi = (function (_super) {
|
|
56
|
+
__extends(CategoriesApi, _super);
|
|
57
|
+
function CategoriesApi() {
|
|
58
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
59
|
+
_this.apiBasePath = 'api/v1/categories';
|
|
60
|
+
return _this;
|
|
61
|
+
}
|
|
62
|
+
CategoriesApi.prototype.getCategories = 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 CategoriesApi;
|
|
76
|
+
}(baseApi_1.BaseApi));
|
|
77
|
+
exports.default = CategoriesApi;
|
|
78
|
+
//# sourceMappingURL=categoriesApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categoriesApi.js","sourceRoot":"","sources":["../../../src/api/categoriesApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AAGpC;IAA2C,iCAAO;IAAlD;QAAA,qEAYC;QAXkB,iBAAW,GAAG,mBAAmB,CAAC;;IAWrD,CAAC;IANc,qCAAa,GAA1B;;;;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,oBAAC;AAAD,CAAC,AAZD,CAA2C,iBAAO,GAYjD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 EnvironmentsApi = (function (_super) {
|
|
56
|
+
__extends(EnvironmentsApi, _super);
|
|
57
|
+
function EnvironmentsApi() {
|
|
58
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
59
|
+
_this.apiBasePath = 'api/v1/environments';
|
|
60
|
+
return _this;
|
|
61
|
+
}
|
|
62
|
+
EnvironmentsApi.prototype.getEnvironments = function (params) {
|
|
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
|
+
params: params,
|
|
70
|
+
})];
|
|
71
|
+
case 1: return [2, _a.sent()];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
return EnvironmentsApi;
|
|
77
|
+
}(baseApi_1.BaseApi));
|
|
78
|
+
exports.default = EnvironmentsApi;
|
|
79
|
+
//# sourceMappingURL=environmentsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environmentsApi.js","sourceRoot":"","sources":["../../../src/api/environmentsApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AAGpC;IAA6C,mCAAO;IAApD;QAAA,qEAiBC;QAhBkB,iBAAW,GAAG,qBAAqB,CAAC;;IAgBvD,CAAC;IAPc,yCAAe,GAA5B,UAA6B,MAAgC;;;;4BACpD,WAAM,IAAI,CAAC,OAAO,CAAC;4BACxB,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,CAAE;4BAC5B,MAAM,QAAA;yBACP,CAAC,EAAA;4BAJF,WAAO,SAIL,EAAC;;;;KACJ;IACH,sBAAC;AAAD,CAAC,AAjBD,CAA6C,iBAAO,GAiBnD"}
|
package/dist/cjs/api/index.js
CHANGED
|
@@ -3,7 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CustomersApi = void 0;
|
|
6
|
+
exports.MappingApi = exports.CategoriesApi = exports.AccountsApi = exports.EnvironmentsApi = exports.CustomersApi = void 0;
|
|
7
7
|
var customersApi_1 = require("./customersApi");
|
|
8
8
|
Object.defineProperty(exports, "CustomersApi", { enumerable: true, get: function () { return __importDefault(customersApi_1).default; } });
|
|
9
|
+
var environmentsApi_1 = require("./environmentsApi");
|
|
10
|
+
Object.defineProperty(exports, "EnvironmentsApi", { enumerable: true, get: function () { return __importDefault(environmentsApi_1).default; } });
|
|
11
|
+
var accountsApi_1 = require("./accountsApi");
|
|
12
|
+
Object.defineProperty(exports, "AccountsApi", { enumerable: true, get: function () { return __importDefault(accountsApi_1).default; } });
|
|
13
|
+
var categoriesApi_1 = require("./categoriesApi");
|
|
14
|
+
Object.defineProperty(exports, "CategoriesApi", { enumerable: true, get: function () { return __importDefault(categoriesApi_1).default; } });
|
|
15
|
+
var mappingApi_1 = require("./mappingApi");
|
|
16
|
+
Object.defineProperty(exports, "MappingApi", { enumerable: true, get: function () { return __importDefault(mappingApi_1).default; } });
|
|
9
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC,6CAAuD;AAA9C,2HAAA,OAAO,OAAe;AAC/B,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB;AACjC,2CAAqD;AAA5C,yHAAA,OAAO,OAAc"}
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/dist/esm/Ccp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Base } from '@or-sdk/base';
|
|
2
|
-
import { CustomersApi } from './api';
|
|
2
|
+
import { CustomersApi, EnvironmentsApi, AccountsApi, CategoriesApi, MappingApi } from './api';
|
|
3
3
|
import { ApiError } from './apiError';
|
|
4
4
|
import { SERVICE_KEY } from './constants';
|
|
5
5
|
export class Ccp extends Base {
|
|
@@ -14,6 +14,10 @@ export class Ccp extends Base {
|
|
|
14
14
|
const apiCall = this.callApi.bind(this);
|
|
15
15
|
this.withApiErrorLog = Boolean(params.withApiErrorLog);
|
|
16
16
|
this.customersApi = new CustomersApi(apiCall);
|
|
17
|
+
this.environmentsApi = new EnvironmentsApi(apiCall);
|
|
18
|
+
this.accountsApi = new AccountsApi(apiCall);
|
|
19
|
+
this.categoriesApi = new CategoriesApi(apiCall);
|
|
20
|
+
this.mappingApi = new MappingApi(apiCall);
|
|
17
21
|
}
|
|
18
22
|
callApi(params) {
|
|
19
23
|
return super.callApiV2(Object.assign({}, params));
|
package/dist/esm/Ccp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ccp.js","sourceRoot":"","sources":["../../src/Ccp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,IAAI,EAAgB,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Ccp.js","sourceRoot":"","sources":["../../src/Ccp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,IAAI,EAAgB,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YA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26 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/dist/esm/api/index.js
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export { default as CustomersApi } from './customersApi';
|
|
2
|
+
export { default as EnvironmentsApi } from './environmentsApi';
|
|
3
|
+
export { default as AccountsApi } from './accountsApi';
|
|
4
|
+
export { default as CategoriesApi } from './categoriesApi';
|
|
5
|
+
export { default as MappingApi } from './mappingApi';
|
|
2
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/dist/types/Ccp.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { AxiosError, Base, CalApiParams } from '@or-sdk/base';
|
|
2
|
-
import { CustomersApi } from './api';
|
|
2
|
+
import { CustomersApi, EnvironmentsApi, AccountsApi, CategoriesApi, MappingApi } from './api';
|
|
3
3
|
import { CcpConfig } from './types';
|
|
4
4
|
export declare class Ccp extends Base {
|
|
5
5
|
readonly customersApi: CustomersApi;
|
|
6
|
+
readonly environmentsApi: EnvironmentsApi;
|
|
7
|
+
readonly accountsApi: AccountsApi;
|
|
8
|
+
readonly categoriesApi: CategoriesApi;
|
|
9
|
+
readonly mappingApi: MappingApi;
|
|
6
10
|
private withApiErrorLog;
|
|
7
11
|
constructor(params: CcpConfig);
|
|
8
12
|
callApi<T>(params: CalApiParams): Promise<T>;
|
package/dist/types/Ccp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ccp.d.ts","sourceRoot":"","sources":["../../src/Ccp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Ccp.d.ts","sourceRoot":"","sources":["../../src/Ccp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE9F,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAUpC,qBAAa,GAAI,SAAQ,IAAI;IAC3B,SAAgB,YAAY,EAAE,YAAY,CAAC;IAC3C,SAAgB,eAAe,EAAE,eAAe,CAAC;IACjD,SAAgB,WAAW,EAAE,WAAW,CAAC;IACzC,SAAgB,aAAa,EAAE,aAAa,CAAC;IAC7C,SAAgB,UAAU,EAAE,UAAU,CAAC;IACvC,OAAO,CAAC,eAAe,CAAU;gBAQrB,MAAM,EAAE,SAAS;IAqB7B,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC;IAM5C,UAAU,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK;IAahC,OAAO,CAAC,WAAW;CAYpB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,2 +1,6 @@
|
|
|
1
1
|
export { default as CustomersApi } from './customersApi';
|
|
2
|
+
export { default as EnvironmentsApi } from './environmentsApi';
|
|
3
|
+
export { default as AccountsApi } from './accountsApi';
|
|
4
|
+
export { default as CategoriesApi } from './categoriesApi';
|
|
5
|
+
export { default as MappingApi } from './mappingApi';
|
|
2
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -31,4 +31,44 @@ export interface Customer {
|
|
|
31
31
|
BillingAddress?: CustomerBillingAddress;
|
|
32
32
|
IdwCustomerId?: string;
|
|
33
33
|
}
|
|
34
|
+
export type ApiRequestParams = {
|
|
35
|
+
clientId: string;
|
|
36
|
+
};
|
|
37
|
+
export type EnvironmentStatus = 'ACTIVE' | 'NOT ACTIVE';
|
|
38
|
+
export type EnvironmentRequestParams = ApiRequestParams & {
|
|
39
|
+
id?: string;
|
|
40
|
+
environmentName?: string;
|
|
41
|
+
status?: EnvironmentStatus;
|
|
42
|
+
};
|
|
43
|
+
export interface Environment {
|
|
44
|
+
id: string;
|
|
45
|
+
environmentName: string;
|
|
46
|
+
customer: string;
|
|
47
|
+
status: EnvironmentStatus;
|
|
48
|
+
}
|
|
49
|
+
export type AccountStatus = 'ACTIVE' | 'INACTIVE';
|
|
50
|
+
export type AccountRequestParams = ApiRequestParams & {
|
|
51
|
+
id?: string;
|
|
52
|
+
accountName?: string;
|
|
53
|
+
environmentId?: string;
|
|
54
|
+
billable: boolean;
|
|
55
|
+
status?: AccountStatus;
|
|
56
|
+
};
|
|
57
|
+
export interface Account {
|
|
58
|
+
id: string;
|
|
59
|
+
accountName: string;
|
|
60
|
+
customerId: string;
|
|
61
|
+
environmentId: string;
|
|
62
|
+
billable: boolean;
|
|
63
|
+
status?: AccountStatus;
|
|
64
|
+
}
|
|
65
|
+
export interface Category {
|
|
66
|
+
name: string;
|
|
67
|
+
value: string;
|
|
68
|
+
}
|
|
69
|
+
export interface Mapping {
|
|
70
|
+
[key: string]: {
|
|
71
|
+
[key: string]: string;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
34
74
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,MAAM,MAAM,SAAS,GAAG;IAItB,KAAK,EAAE,KAAK,CAAC;IAIb,YAAY,CAAC,EAAE,MAAM,CAAC;IAItB,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,UAAU,CAAC,EAAE,MAAM,CAAC;IAKpB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,oBAAY,cAAc;IACxB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MA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
3
|
+
"version": "1.1.1-beta.2834.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -26,6 +26,5 @@
|
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
|
-
}
|
|
30
|
-
"gitHead": "d2f99b5b84b53b0ead88e9868ac7e4e385d8471c"
|
|
29
|
+
}
|
|
31
30
|
}
|
package/src/Ccp.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosError, Base, CalApiParams } from '@or-sdk/base';
|
|
2
|
-
import { CustomersApi } from './api';
|
|
2
|
+
import { CustomersApi, EnvironmentsApi, AccountsApi, CategoriesApi, MappingApi } from './api';
|
|
3
3
|
import { ApiError } from './apiError';
|
|
4
4
|
import { CcpConfig } from './types';
|
|
5
5
|
import { SERVICE_KEY } from './constants';
|
|
@@ -13,6 +13,10 @@ import { SERVICE_KEY } from './constants';
|
|
|
13
13
|
*/
|
|
14
14
|
export class Ccp extends Base {
|
|
15
15
|
public readonly customersApi: CustomersApi;
|
|
16
|
+
public readonly environmentsApi: EnvironmentsApi;
|
|
17
|
+
public readonly accountsApi: AccountsApi;
|
|
18
|
+
public readonly categoriesApi: CategoriesApi;
|
|
19
|
+
public readonly mappingApi: MappingApi;
|
|
16
20
|
private withApiErrorLog: boolean;
|
|
17
21
|
|
|
18
22
|
/**
|
|
@@ -36,6 +40,10 @@ export class Ccp extends Base {
|
|
|
36
40
|
this.withApiErrorLog = Boolean(params.withApiErrorLog);
|
|
37
41
|
|
|
38
42
|
this.customersApi = new CustomersApi(apiCall);
|
|
43
|
+
this.environmentsApi = new EnvironmentsApi(apiCall);
|
|
44
|
+
this.accountsApi = new AccountsApi(apiCall);
|
|
45
|
+
this.categoriesApi = new CategoriesApi(apiCall);
|
|
46
|
+
this.mappingApi = new MappingApi(apiCall);
|
|
39
47
|
}
|
|
40
48
|
|
|
41
49
|
callApi<T>(params: CalApiParams): Promise<T> {
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
}
|
package/src/api/index.ts
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
1
|
export { default as CustomersApi } from './customersApi';
|
|
2
|
+
export { default as EnvironmentsApi } from './environmentsApi';
|
|
3
|
+
export { default as AccountsApi } from './accountsApi';
|
|
4
|
+
export { default as CategoriesApi } from './categoriesApi';
|
|
5
|
+
export { default as MappingApi } from './mappingApi';
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -52,3 +52,49 @@ export interface Customer {
|
|
|
52
52
|
IdwCustomerId?: string;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
export type ApiRequestParams = {
|
|
56
|
+
clientId: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type EnvironmentStatus = 'ACTIVE' | 'NOT ACTIVE';
|
|
60
|
+
|
|
61
|
+
export type EnvironmentRequestParams = ApiRequestParams & {
|
|
62
|
+
id?: string;
|
|
63
|
+
environmentName?: string;
|
|
64
|
+
status?: EnvironmentStatus;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export interface Environment {
|
|
68
|
+
id: string;
|
|
69
|
+
environmentName: string;
|
|
70
|
+
customer: string;
|
|
71
|
+
status: EnvironmentStatus;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type AccountStatus = 'ACTIVE' | 'INACTIVE';
|
|
75
|
+
|
|
76
|
+
export type AccountRequestParams = ApiRequestParams & {
|
|
77
|
+
id?: string;
|
|
78
|
+
accountName?: string;
|
|
79
|
+
environmentId?: string;
|
|
80
|
+
billable: boolean;
|
|
81
|
+
status?: AccountStatus;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export interface Account {
|
|
85
|
+
id: string;
|
|
86
|
+
accountName: string;
|
|
87
|
+
customerId: string;
|
|
88
|
+
environmentId: string;
|
|
89
|
+
billable: boolean;
|
|
90
|
+
status?: AccountStatus;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface Category {
|
|
94
|
+
name: string;
|
|
95
|
+
value: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface Mapping {
|
|
99
|
+
[key: string]: { [key: string]: string; };
|
|
100
|
+
}
|