@or-sdk/ccp 10.4.2 → 10.4.3-beta.537.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/api/accountsApi/index.js +180 -0
- package/dist/cjs/api/accountsApi/index.js.map +1 -0
- package/dist/cjs/api/accountsApi/types.js +10 -0
- package/dist/cjs/api/accountsApi/types.js.map +1 -0
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/api/accountsApi/index.js +92 -0
- package/dist/esm/api/accountsApi/index.js.map +1 -0
- package/dist/esm/api/accountsApi/types.js +7 -0
- package/dist/esm/api/accountsApi/types.js.map +1 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/types/api/accountsApi/index.d.ts +18 -0
- package/dist/types/api/accountsApi/index.d.ts.map +1 -0
- package/dist/types/api/accountsApi/types.d.ts +65 -0
- package/dist/types/api/accountsApi/types.d.ts.map +1 -0
- package/dist/types/types.d.ts +1 -16
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api/accountsApi/index.ts +103 -0
- package/src/api/accountsApi/types.ts +70 -0
- package/src/types.ts +1 -21
- package/dist/cjs/api/accountsApi.js +0 -81
- package/dist/cjs/api/accountsApi.js.map +0 -1
- package/dist/esm/api/accountsApi.js +0 -27
- package/dist/esm/api/accountsApi.js.map +0 -1
- package/dist/types/api/accountsApi.d.ts +0 -7
- package/dist/types/api/accountsApi.d.ts.map +0 -1
- package/src/api/accountsApi.ts +0 -28
|
@@ -0,0 +1,180 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
54
|
+
var t = {};
|
|
55
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
56
|
+
t[p] = s[p];
|
|
57
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
58
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
59
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
60
|
+
t[p[i]] = s[p[i]];
|
|
61
|
+
}
|
|
62
|
+
return t;
|
|
63
|
+
};
|
|
64
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
+
var baseApi_1 = require("../baseApi");
|
|
66
|
+
var AccountsApi = (function (_super) {
|
|
67
|
+
__extends(AccountsApi, _super);
|
|
68
|
+
function AccountsApi() {
|
|
69
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
70
|
+
_this.apiBasePath = 'api/v1/accounts';
|
|
71
|
+
return _this;
|
|
72
|
+
}
|
|
73
|
+
AccountsApi.prototype.getAccounts = function (params_1) {
|
|
74
|
+
return __awaiter(this, arguments, void 0, function (params, _a) {
|
|
75
|
+
var _b = _a === void 0 ? {} : _a, signal = _b.signal;
|
|
76
|
+
return __generator(this, function (_c) {
|
|
77
|
+
switch (_c.label) {
|
|
78
|
+
case 0: return [4, this.apiCall({
|
|
79
|
+
method: 'GET',
|
|
80
|
+
route: "".concat(this.apiBasePath),
|
|
81
|
+
params: params,
|
|
82
|
+
signal: signal,
|
|
83
|
+
})];
|
|
84
|
+
case 1: return [2, _c.sent()];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
AccountsApi.prototype.getAllEnvironmentAccounts = function (environmentId_1, params_1) {
|
|
90
|
+
return __awaiter(this, arguments, void 0, function (environmentId, params, _a) {
|
|
91
|
+
var _b = _a === void 0 ? {} : _a, signal = _b.signal;
|
|
92
|
+
return __generator(this, function (_c) {
|
|
93
|
+
switch (_c.label) {
|
|
94
|
+
case 0: return [4, this.apiCall({
|
|
95
|
+
method: 'GET',
|
|
96
|
+
route: "".concat(this.apiBasePath, "/").concat(environmentId, "/environment-accounts-list"),
|
|
97
|
+
params: params,
|
|
98
|
+
signal: signal,
|
|
99
|
+
})];
|
|
100
|
+
case 1: return [2, _c.sent()];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
AccountsApi.prototype.getEnvironmentAccount = function (environmentId_1, accountId_1) {
|
|
106
|
+
return __awaiter(this, arguments, void 0, function (environmentId, accountId, _a) {
|
|
107
|
+
var _b = _a === void 0 ? {} : _a, signal = _b.signal;
|
|
108
|
+
return __generator(this, function (_c) {
|
|
109
|
+
switch (_c.label) {
|
|
110
|
+
case 0: return [4, this.apiCall({
|
|
111
|
+
method: 'GET',
|
|
112
|
+
route: "".concat(this.apiBasePath, "/").concat(environmentId, "/environment-account/").concat(accountId),
|
|
113
|
+
signal: signal,
|
|
114
|
+
})];
|
|
115
|
+
case 1: return [2, _c.sent()];
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
AccountsApi.prototype.createEnvironmentAccount = function (data) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
+
var environmentId, restData;
|
|
123
|
+
return __generator(this, function (_a) {
|
|
124
|
+
switch (_a.label) {
|
|
125
|
+
case 0:
|
|
126
|
+
environmentId = data.environmentId, restData = __rest(data, ["environmentId"]);
|
|
127
|
+
return [4, this.apiCall({
|
|
128
|
+
method: 'POST',
|
|
129
|
+
route: "".concat(this.apiBasePath, "/").concat(environmentId, "/environment-account"),
|
|
130
|
+
data: restData,
|
|
131
|
+
})];
|
|
132
|
+
case 1: return [2, _a.sent()];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
AccountsApi.prototype.updateEnvironmentAccount = function (environmentId, accountId, data) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
139
|
+
return __generator(this, function (_a) {
|
|
140
|
+
switch (_a.label) {
|
|
141
|
+
case 0: return [4, this.apiCall({
|
|
142
|
+
method: 'PUT',
|
|
143
|
+
route: "".concat(this.apiBasePath, "/").concat(environmentId, "/environment-account/").concat(accountId),
|
|
144
|
+
data: data,
|
|
145
|
+
})];
|
|
146
|
+
case 1: return [2, _a.sent()];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
AccountsApi.prototype.enableEnvironmentAccount = function (environmentId, accountId) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
153
|
+
return __generator(this, function (_a) {
|
|
154
|
+
switch (_a.label) {
|
|
155
|
+
case 0: return [4, this.apiCall({
|
|
156
|
+
method: 'PUT',
|
|
157
|
+
route: "".concat(this.apiBasePath, "/").concat(environmentId, "/environment-account/").concat(accountId, "/enable"),
|
|
158
|
+
})];
|
|
159
|
+
case 1: return [2, _a.sent()];
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
AccountsApi.prototype.disableEnvironmentAccount = function (environmentId, accountId) {
|
|
165
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
166
|
+
return __generator(this, function (_a) {
|
|
167
|
+
switch (_a.label) {
|
|
168
|
+
case 0: return [4, this.apiCall({
|
|
169
|
+
method: 'PUT',
|
|
170
|
+
route: "".concat(this.apiBasePath, "/").concat(environmentId, "/environment-account/").concat(accountId, "/disable"),
|
|
171
|
+
})];
|
|
172
|
+
case 1: return [2, _a.sent()];
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
return AccountsApi;
|
|
178
|
+
}(baseApi_1.BaseApi));
|
|
179
|
+
exports.default = AccountsApi;
|
|
180
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/accountsApi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,sCAAqC;AAYrC;IAAyC,+BAAO;IAAhD;;QACmB,iBAAW,GAAG,iBAAiB,CAAC;;IAwFnD,CAAC;IA7Ec,iCAAW,GAAxB;4DACE,MAA4B,EAC5B,EAA+B;gBAA/B,qBAA6B,EAAE,KAAA,EAA7B,MAAM,YAAA;;;4BAED,WAAM,IAAI,CAAC,OAAO,CAAC;4BACxB,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,CAAE;4BAC5B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AAI,aAAa,kCAAwB,SAAS,CAAE;4BAC9E,IAAI,MAAA;yBACL,CAAC,EAAA;4BAJF,WAAO,SAIL,EAAC;;;;KACJ;IAEK,8CAAwB,GAA9B,UACE,aAAqB,EACrB,SAAiB;;;;4BAEV,WAAM,IAAI,CAAC,OAAO,CAAC;4BACxB,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,cAAI,aAAa,kCAAwB,SAAS,YAAS;yBACtF,CAAC,EAAA;4BAHF,WAAO,SAGL,EAAC;;;;KACJ;IAEK,+CAAyB,GAA/B,UACE,aAAqB,EACrB,SAAiB;;;;4BAEV,WAAM,IAAI,CAAC,OAAO,CAAC;4BACxB,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,cAAI,aAAa,kCAAwB,SAAS,aAAU;yBACvF,CAAC,EAAA;4BAHF,WAAO,SAGL,EAAC;;;;KACJ;IACH,kBAAC;AAAD,CAAC,AAzFD,CAAyC,iBAAO,GAyF/C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountType = void 0;
|
|
4
|
+
var AccountType;
|
|
5
|
+
(function (AccountType) {
|
|
6
|
+
AccountType["USER"] = "user";
|
|
7
|
+
AccountType["SYSTEM"] = "system";
|
|
8
|
+
AccountType["MAINTENANCE"] = "maintenance";
|
|
9
|
+
})(AccountType || (exports.AccountType = AccountType = {}));
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/accountsApi/types.ts"],"names":[],"mappings":";;;AAKA,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,gCAAiB,CAAA;IACjB,0CAA2B,CAAA;AAC7B,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB"}
|
package/dist/cjs/types.js
CHANGED
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./api/customers-api/types"), exports);
|
|
18
|
+
__exportStar(require("./api/accountsApi/types"), exports);
|
|
18
19
|
//# sourceMappingURL=types.js.map
|
package/dist/cjs/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,4DAA0C"}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,4DAA0C;AAC1C,0DAAwC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
import { BaseApi } from '../baseApi';
|
|
22
|
+
export default class AccountsApi extends BaseApi {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.apiBasePath = 'api/v1/accounts';
|
|
26
|
+
}
|
|
27
|
+
getAccounts(params_1) {
|
|
28
|
+
return __awaiter(this, arguments, void 0, function* (params, { signal } = {}) {
|
|
29
|
+
return yield this.apiCall({
|
|
30
|
+
method: 'GET',
|
|
31
|
+
route: `${this.apiBasePath}`,
|
|
32
|
+
params,
|
|
33
|
+
signal,
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
getAllEnvironmentAccounts(environmentId_1, params_1) {
|
|
38
|
+
return __awaiter(this, arguments, void 0, function* (environmentId, params, { signal } = {}) {
|
|
39
|
+
return yield this.apiCall({
|
|
40
|
+
method: 'GET',
|
|
41
|
+
route: `${this.apiBasePath}/${environmentId}/environment-accounts-list`,
|
|
42
|
+
params,
|
|
43
|
+
signal,
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
getEnvironmentAccount(environmentId_1, accountId_1) {
|
|
48
|
+
return __awaiter(this, arguments, void 0, function* (environmentId, accountId, { signal } = {}) {
|
|
49
|
+
return yield this.apiCall({
|
|
50
|
+
method: 'GET',
|
|
51
|
+
route: `${this.apiBasePath}/${environmentId}/environment-account/${accountId}`,
|
|
52
|
+
signal,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
createEnvironmentAccount(data) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const { environmentId } = data, restData = __rest(data, ["environmentId"]);
|
|
59
|
+
return yield this.apiCall({
|
|
60
|
+
method: 'POST',
|
|
61
|
+
route: `${this.apiBasePath}/${environmentId}/environment-account`,
|
|
62
|
+
data: restData,
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
updateEnvironmentAccount(environmentId, accountId, data) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return yield this.apiCall({
|
|
69
|
+
method: 'PUT',
|
|
70
|
+
route: `${this.apiBasePath}/${environmentId}/environment-account/${accountId}`,
|
|
71
|
+
data,
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
enableEnvironmentAccount(environmentId, accountId) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
return yield this.apiCall({
|
|
78
|
+
method: 'PUT',
|
|
79
|
+
route: `${this.apiBasePath}/${environmentId}/environment-account/${accountId}/enable`,
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
disableEnvironmentAccount(environmentId, accountId) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
return yield this.apiCall({
|
|
86
|
+
method: 'PUT',
|
|
87
|
+
route: `${this.apiBasePath}/${environmentId}/environment-account/${accountId}/disable`,
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/accountsApi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAYrC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAAhD;;QACmB,gBAAW,GAAG,iBAAiB,CAAC;IAwFnD,CAAC;IA7Ec,WAAW;6DACtB,MAA4B,EAC5B,EAAE,MAAM,KAAqB,EAAE;YAE/B,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAA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B,EACrB,SAAiB;;YAEjB,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,IAAI,aAAa,wBAAwB,SAAS,SAAS;aACtF,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,yBAAyB,CAC7B,aAAqB,EACrB,SAAiB;;YAEjB,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,IAAI,aAAa,wBAAwB,SAAS,UAAU;aACvF,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/accountsApi/types.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,gCAAiB,CAAA;IACjB,0CAA2B,CAAA;AAC7B,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB"}
|
package/dist/esm/types.js
CHANGED
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAIA,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAIA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OptionalParams, PaginatedResponse } from '../../types';
|
|
2
|
+
import { BaseApi } from '../baseApi';
|
|
3
|
+
import { Account, AccountRequestParams, CreateEnvironmentAccountDto, EnvAccountAccountsFiltersDto, EnvironmentAccountDto, UpdateEnvironmentAccountDto } from './types';
|
|
4
|
+
export default class AccountsApi extends BaseApi {
|
|
5
|
+
private readonly apiBasePath;
|
|
6
|
+
getAccounts(params: AccountRequestParams, { signal }?: OptionalParams): Promise<Account[]>;
|
|
7
|
+
getAllEnvironmentAccounts(environmentId: string, params?: EnvAccountAccountsFiltersDto, { signal }?: OptionalParams): Promise<PaginatedResponse<EnvironmentAccountDto>>;
|
|
8
|
+
getEnvironmentAccount(environmentId: string, accountId: string, { signal }?: OptionalParams): Promise<EnvironmentAccountDto>;
|
|
9
|
+
createEnvironmentAccount(data: CreateEnvironmentAccountDto): Promise<EnvironmentAccountDto>;
|
|
10
|
+
updateEnvironmentAccount(environmentId: string, accountId: string, data: UpdateEnvironmentAccountDto): Promise<EnvironmentAccountDto>;
|
|
11
|
+
enableEnvironmentAccount(environmentId: string, accountId: string): Promise<{
|
|
12
|
+
message: string;
|
|
13
|
+
}>;
|
|
14
|
+
disableEnvironmentAccount(environmentId: string, accountId: string): Promise<{
|
|
15
|
+
message: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/accountsApi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EACL,OAAO,EACP,oBAAoB,EACpB,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAGjB,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAC9C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IAWpC,WAAW,CACtB,MAAM,EAAE,oBAAoB,EAC5B,EAAE,MAAM,EAAE,GAAE,cAAmB,GAC9B,OAAO,CAAC,OAAO,EAAE,CAAC;IASf,yBAAyB,CAC7B,aAAa,EAAE,MAAM,EACrB,MAAM,CAAC,EAAE,4BAA4B,EACrC,EAAE,MAAM,EAAE,GAAE,cAAmB,GAC9B,OAAO,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CAAC;IAS9C,qBAAqB,CACzB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,EAAE,MAAM,EAAE,GAAE,cAAmB,GAC9B,OAAO,CAAC,qBAAqB,CAAC;IAQ3B,wBAAwB,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAS3F,wBAAwB,CAC5B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,qBAAqB,CAAC;IAQ3B,wBAAwB,CAC5B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;KAAC,CAAC;IAOxB,yBAAyB,CAC7B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;KAAC,CAAC;CAM/B"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { SortOrder } from '../../constants';
|
|
2
|
+
import { ApiRequestClientId } from '../../types';
|
|
3
|
+
export type AccountStatus = 'ACTIVE' | 'INACTIVE';
|
|
4
|
+
export declare enum AccountType {
|
|
5
|
+
USER = "user",
|
|
6
|
+
SYSTEM = "system",
|
|
7
|
+
MAINTENANCE = "maintenance"
|
|
8
|
+
}
|
|
9
|
+
export type AccountRequestParams = ApiRequestClientId & {
|
|
10
|
+
id?: string;
|
|
11
|
+
accountName?: string;
|
|
12
|
+
environmentId?: string;
|
|
13
|
+
billable?: boolean;
|
|
14
|
+
status?: AccountStatus;
|
|
15
|
+
};
|
|
16
|
+
export interface Account {
|
|
17
|
+
id: string;
|
|
18
|
+
accountName: string;
|
|
19
|
+
customerId: string;
|
|
20
|
+
environmentId: string;
|
|
21
|
+
billable: boolean;
|
|
22
|
+
status?: AccountStatus;
|
|
23
|
+
}
|
|
24
|
+
export interface EnvironmentAccountDataDto {
|
|
25
|
+
createdBy: string;
|
|
26
|
+
updatedBy?: string;
|
|
27
|
+
purpose?: string;
|
|
28
|
+
billable?: boolean;
|
|
29
|
+
customerId?: string;
|
|
30
|
+
type?: string;
|
|
31
|
+
settings?: {
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface EnvironmentAccountDto {
|
|
36
|
+
version: number;
|
|
37
|
+
dateCreated: number;
|
|
38
|
+
data: EnvironmentAccountDataDto;
|
|
39
|
+
accountName: string;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
dateModified: number;
|
|
42
|
+
id: string;
|
|
43
|
+
}
|
|
44
|
+
export interface EnvAccountAccountsFiltersDto {
|
|
45
|
+
id?: string;
|
|
46
|
+
clientId: string;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
billable?: boolean;
|
|
49
|
+
type?: AccountType;
|
|
50
|
+
search?: string;
|
|
51
|
+
page?: number;
|
|
52
|
+
limit?: number;
|
|
53
|
+
sortBy?: string;
|
|
54
|
+
sortOrder?: SortOrder;
|
|
55
|
+
}
|
|
56
|
+
export interface CreateEnvironmentAccountDto {
|
|
57
|
+
environmentId: string;
|
|
58
|
+
accountName: string;
|
|
59
|
+
customerId: string;
|
|
60
|
+
}
|
|
61
|
+
export interface UpdateEnvironmentAccountDto {
|
|
62
|
+
accountName?: string;
|
|
63
|
+
customerId?: string;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/api/accountsApi/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;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AC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,2BAA2B;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OrderDirection, Token } from '@or-sdk/base';
|
|
2
2
|
import { SortOrder } from './constants';
|
|
3
3
|
export * from './api/customers-api/types';
|
|
4
|
+
export * from './api/accountsApi/types';
|
|
4
5
|
export type CcpConfig = {
|
|
5
6
|
token: Token;
|
|
6
7
|
discoveryUrl?: string;
|
|
@@ -42,22 +43,6 @@ export type Environment = {
|
|
|
42
43
|
studioUrl?: string;
|
|
43
44
|
authUrl?: string;
|
|
44
45
|
};
|
|
45
|
-
export type AccountStatus = 'ACTIVE' | 'INACTIVE';
|
|
46
|
-
export type AccountRequestParams = ApiRequestClientId & {
|
|
47
|
-
id?: string;
|
|
48
|
-
accountName?: string;
|
|
49
|
-
environmentId?: string;
|
|
50
|
-
billable?: boolean;
|
|
51
|
-
status?: AccountStatus;
|
|
52
|
-
};
|
|
53
|
-
export interface Account {
|
|
54
|
-
id: string;
|
|
55
|
-
accountName: string;
|
|
56
|
-
customerId: string;
|
|
57
|
-
environmentId: string;
|
|
58
|
-
billable: boolean;
|
|
59
|
-
status?: AccountStatus;
|
|
60
|
-
}
|
|
61
46
|
export interface Category {
|
|
62
47
|
name: string;
|
|
63
48
|
value: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,cAAc,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AAGxC,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;AAGF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,CAAC;CACX,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MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAOD,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/ccp",
|
|
3
|
-
"version": "10.4.
|
|
3
|
+
"version": "10.4.3-beta.537.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dev": "pnpm build:watch:esm"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@or-sdk/base": "^0.42.
|
|
21
|
+
"@or-sdk/base": "^0.42.4"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"concurrently": "9.0.1",
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { OptionalParams, PaginatedResponse } from '../../types';
|
|
2
|
+
import { BaseApi } from '../baseApi';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
Account,
|
|
6
|
+
AccountRequestParams,
|
|
7
|
+
CreateEnvironmentAccountDto,
|
|
8
|
+
EnvAccountAccountsFiltersDto,
|
|
9
|
+
EnvironmentAccountDto,
|
|
10
|
+
UpdateEnvironmentAccountDto,
|
|
11
|
+
} from './types';
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export default class AccountsApi extends BaseApi {
|
|
15
|
+
private readonly apiBasePath = 'api/v1/accounts';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @description get client's accounts
|
|
19
|
+
* @param clientId
|
|
20
|
+
* @param id
|
|
21
|
+
* @param accountName
|
|
22
|
+
* @param billable
|
|
23
|
+
* @param environmentId
|
|
24
|
+
* @param status
|
|
25
|
+
*/
|
|
26
|
+
public async getAccounts(
|
|
27
|
+
params: AccountRequestParams,
|
|
28
|
+
{ signal }: OptionalParams = {}
|
|
29
|
+
): Promise<Account[]> {
|
|
30
|
+
return await this.apiCall({
|
|
31
|
+
method: 'GET',
|
|
32
|
+
route: `${this.apiBasePath}`,
|
|
33
|
+
params,
|
|
34
|
+
signal,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async getAllEnvironmentAccounts(
|
|
39
|
+
environmentId: string,
|
|
40
|
+
params?: EnvAccountAccountsFiltersDto,
|
|
41
|
+
{ signal }: OptionalParams = {}
|
|
42
|
+
): Promise<PaginatedResponse<EnvironmentAccountDto>> {
|
|
43
|
+
return await this.apiCall({
|
|
44
|
+
method: 'GET',
|
|
45
|
+
route: `${this.apiBasePath}/${environmentId}/environment-accounts-list`,
|
|
46
|
+
params,
|
|
47
|
+
signal,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async getEnvironmentAccount(
|
|
52
|
+
environmentId: string,
|
|
53
|
+
accountId: string,
|
|
54
|
+
{ signal }: OptionalParams = {}
|
|
55
|
+
): Promise<EnvironmentAccountDto> {
|
|
56
|
+
return await this.apiCall({
|
|
57
|
+
method: 'GET',
|
|
58
|
+
route: `${this.apiBasePath}/${environmentId}/environment-account/${accountId}`,
|
|
59
|
+
signal,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async createEnvironmentAccount(data: CreateEnvironmentAccountDto): Promise<EnvironmentAccountDto> {
|
|
64
|
+
const { environmentId, ...restData } = data;
|
|
65
|
+
return await this.apiCall({
|
|
66
|
+
method: 'POST',
|
|
67
|
+
route: `${this.apiBasePath}/${environmentId}/environment-account`,
|
|
68
|
+
data: restData,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async updateEnvironmentAccount(
|
|
73
|
+
environmentId: string,
|
|
74
|
+
accountId: string,
|
|
75
|
+
data: UpdateEnvironmentAccountDto
|
|
76
|
+
): Promise<EnvironmentAccountDto> {
|
|
77
|
+
return await this.apiCall({
|
|
78
|
+
method: 'PUT',
|
|
79
|
+
route: `${this.apiBasePath}/${environmentId}/environment-account/${accountId}`,
|
|
80
|
+
data,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async enableEnvironmentAccount(
|
|
85
|
+
environmentId: string,
|
|
86
|
+
accountId: string,
|
|
87
|
+
): Promise<{message: string;}> {
|
|
88
|
+
return await this.apiCall({
|
|
89
|
+
method: 'PUT',
|
|
90
|
+
route: `${this.apiBasePath}/${environmentId}/environment-account/${accountId}/enable`,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async disableEnvironmentAccount(
|
|
95
|
+
environmentId: string,
|
|
96
|
+
accountId: string,
|
|
97
|
+
): Promise<{message: string;}> {
|
|
98
|
+
return await this.apiCall({
|
|
99
|
+
method: 'PUT',
|
|
100
|
+
route: `${this.apiBasePath}/${environmentId}/environment-account/${accountId}/disable`,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { SortOrder } from '../../constants';
|
|
2
|
+
import { ApiRequestClientId } from '../../types';
|
|
3
|
+
|
|
4
|
+
export type AccountStatus = 'ACTIVE' | 'INACTIVE';
|
|
5
|
+
|
|
6
|
+
export enum AccountType {
|
|
7
|
+
USER = 'user',
|
|
8
|
+
SYSTEM = 'system',
|
|
9
|
+
MAINTENANCE = 'maintenance',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type AccountRequestParams = ApiRequestClientId & {
|
|
13
|
+
id?: string;
|
|
14
|
+
accountName?: string;
|
|
15
|
+
environmentId?: string;
|
|
16
|
+
billable?: boolean;
|
|
17
|
+
status?: AccountStatus;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export interface Account {
|
|
21
|
+
id: string;
|
|
22
|
+
accountName: string;
|
|
23
|
+
customerId: string;
|
|
24
|
+
environmentId: string;
|
|
25
|
+
billable: boolean;
|
|
26
|
+
status?: AccountStatus;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface EnvironmentAccountDataDto {
|
|
30
|
+
createdBy: string;
|
|
31
|
+
updatedBy?: string;
|
|
32
|
+
purpose?: string;
|
|
33
|
+
billable?: boolean;
|
|
34
|
+
customerId?: string;
|
|
35
|
+
type?: string;
|
|
36
|
+
settings?: { [key: string]: unknown; };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface EnvironmentAccountDto {
|
|
40
|
+
version: number;
|
|
41
|
+
dateCreated: number;
|
|
42
|
+
data: EnvironmentAccountDataDto;
|
|
43
|
+
accountName: string;
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
dateModified: number;
|
|
46
|
+
id: string;
|
|
47
|
+
}
|
|
48
|
+
export interface EnvAccountAccountsFiltersDto {
|
|
49
|
+
id?: string;
|
|
50
|
+
clientId: string;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
billable?: boolean;
|
|
53
|
+
type?: AccountType;
|
|
54
|
+
search?: string;
|
|
55
|
+
page?: number;
|
|
56
|
+
limit?: number;
|
|
57
|
+
sortBy?: string;
|
|
58
|
+
sortOrder?: SortOrder;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface CreateEnvironmentAccountDto {
|
|
62
|
+
environmentId: string;
|
|
63
|
+
accountName: string;
|
|
64
|
+
customerId: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface UpdateEnvironmentAccountDto {
|
|
68
|
+
accountName?: string;
|
|
69
|
+
customerId?: string;
|
|
70
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { OrderDirection, Token } from '@or-sdk/base';
|
|
|
3
3
|
import { SortOrder } from './constants';
|
|
4
4
|
|
|
5
5
|
export * from './api/customers-api/types';
|
|
6
|
+
export * from './api/accountsApi/types';
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
export type CcpConfig = {
|
|
@@ -72,26 +73,6 @@ export type Environment = {
|
|
|
72
73
|
authUrl?: string;
|
|
73
74
|
};
|
|
74
75
|
|
|
75
|
-
// Account types
|
|
76
|
-
export type AccountStatus = 'ACTIVE' | 'INACTIVE';
|
|
77
|
-
|
|
78
|
-
export type AccountRequestParams = ApiRequestClientId & {
|
|
79
|
-
id?: string;
|
|
80
|
-
accountName?: string;
|
|
81
|
-
environmentId?: string;
|
|
82
|
-
billable?: boolean;
|
|
83
|
-
status?: AccountStatus;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export interface Account {
|
|
87
|
-
id: string;
|
|
88
|
-
accountName: string;
|
|
89
|
-
customerId: string;
|
|
90
|
-
environmentId: string;
|
|
91
|
-
billable: boolean;
|
|
92
|
-
status?: AccountStatus;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
76
|
export interface Category {
|
|
96
77
|
name: string;
|
|
97
78
|
value: string;
|
|
@@ -145,7 +126,6 @@ export interface Usage {
|
|
|
145
126
|
flow_id: string;
|
|
146
127
|
}
|
|
147
128
|
|
|
148
|
-
|
|
149
129
|
/**
|
|
150
130
|
* TODO:
|
|
151
131
|
* - use ApiParamsRequestDto for sdk consistency
|
|
@@ -1,81 +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 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_1) {
|
|
63
|
-
return __awaiter(this, arguments, void 0, function (params, _a) {
|
|
64
|
-
var _b = _a === void 0 ? {} : _a, signal = _b.signal;
|
|
65
|
-
return __generator(this, function (_c) {
|
|
66
|
-
switch (_c.label) {
|
|
67
|
-
case 0: return [4, this.apiCall({
|
|
68
|
-
method: 'GET',
|
|
69
|
-
route: "".concat(this.apiBasePath),
|
|
70
|
-
params: params,
|
|
71
|
-
signal: signal,
|
|
72
|
-
})];
|
|
73
|
-
case 1: return [2, _c.sent()];
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
return AccountsApi;
|
|
79
|
-
}(baseApi_1.BaseApi));
|
|
80
|
-
exports.default = AccountsApi;
|
|
81
|
-
//# sourceMappingURL=accountsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accountsApi.js","sourceRoot":"","sources":["../../../src/api/accountsApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,qCAAoC;AAEpC;IAAyC,+BAAO;IAAhD;;QACmB,iBAAW,GAAG,iBAAiB,CAAC;;IAsBnD,CAAC;IAXc,iCAAW,GAAxB;4DACE,MAA4B,EAC5B,EAA+B;gBAA/B,qBAA6B,EAAE,KAAA,EAA7B,MAAM,YAAA;;;4BAED,WAAM,IAAI,CAAC,OAAO,CAAC;4BACxB,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,CAAE;4BAC5B,MAAM,QAAA;4BACN,MAAM,QAAA;yBACP,CAAC,EAAA;4BALF,WAAO,SAKL,EAAC;;;;KACJ;IACH,kBAAC;AAAD,CAAC,AAvBD,CAAyC,iBAAO,GAuB/C"}
|
|
@@ -1,27 +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_1) {
|
|
17
|
-
return __awaiter(this, arguments, void 0, function* (params, { signal } = {}) {
|
|
18
|
-
return yield this.apiCall({
|
|
19
|
-
method: 'GET',
|
|
20
|
-
route: `${this.apiBasePath}`,
|
|
21
|
-
params,
|
|
22
|
-
signal,
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=accountsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accountsApi.js","sourceRoot":"","sources":["../../../src/api/accountsApi.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAAhD;;QACmB,gBAAW,GAAG,iBAAiB,CAAC;IAsBnD,CAAC;IAXc,WAAW;6DACtB,MAA4B,EAC5B,EAAE,MAAM,KAAqB,EAAE;YAE/B,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;gBAC5B,MAAM;gBACN,MAAM;aACP,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Account, AccountRequestParams, OptionalParams } from '../types';
|
|
2
|
-
import { BaseApi } from './baseApi';
|
|
3
|
-
export default class AccountsApi extends BaseApi {
|
|
4
|
-
private readonly apiBasePath;
|
|
5
|
-
getAccounts(params: AccountRequestParams, { signal }?: OptionalParams): 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,oBAAoB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAC9C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IAWpC,WAAW,CACtB,MAAM,EAAE,oBAAoB,EAC5B,EAAE,MAAM,EAAE,GAAE,cAAmB,GAC9B,OAAO,CAAC,OAAO,EAAE,CAAC;CAQtB"}
|
package/src/api/accountsApi.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Account, AccountRequestParams, OptionalParams } from '../types';
|
|
2
|
-
|
|
3
|
-
import { BaseApi } from './baseApi';
|
|
4
|
-
|
|
5
|
-
export default class AccountsApi extends BaseApi {
|
|
6
|
-
private readonly apiBasePath = 'api/v1/accounts';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @description get client's accounts
|
|
10
|
-
* @param clientId
|
|
11
|
-
* @param id
|
|
12
|
-
* @param accountName
|
|
13
|
-
* @param billable
|
|
14
|
-
* @param environmentId
|
|
15
|
-
* @param status
|
|
16
|
-
*/
|
|
17
|
-
public async getAccounts(
|
|
18
|
-
params: AccountRequestParams,
|
|
19
|
-
{ signal }: OptionalParams = {}
|
|
20
|
-
): Promise<Account[]> {
|
|
21
|
-
return await this.apiCall({
|
|
22
|
-
method: 'GET',
|
|
23
|
-
route: `${this.apiBasePath}`,
|
|
24
|
-
params,
|
|
25
|
-
signal,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|