@or-sdk/billing 11.23.1 → 11.24.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 +95 -0
- package/dist/cjs/api/accountsApi/index.js.map +1 -1
- package/dist/cjs/api/accountsApi/types.js +2 -6
- package/dist/cjs/api/accountsApi/types.js.map +1 -1
- package/dist/esm/api/accountsApi/index.js +60 -0
- package/dist/esm/api/accountsApi/index.js.map +1 -1
- package/dist/esm/api/accountsApi/types.js +2 -6
- package/dist/esm/api/accountsApi/types.js.map +1 -1
- package/dist/types/api/accountsApi/index.d.ts +9 -1
- package/dist/types/api/accountsApi/index.d.ts.map +1 -1
- package/dist/types/api/accountsApi/types.d.ts +3 -6
- package/dist/types/api/accountsApi/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/api/accountsApi/index.ts +111 -1
- package/src/api/accountsApi/types.ts +9 -6
|
@@ -57,6 +57,7 @@ var AccountsApi = (function (_super) {
|
|
|
57
57
|
function AccountsApi() {
|
|
58
58
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
59
59
|
_this.apiBasePath = 'accounts';
|
|
60
|
+
_this.accountsManagementPath = 'accounts-management';
|
|
60
61
|
return _this;
|
|
61
62
|
}
|
|
62
63
|
AccountsApi.prototype.getAccounts = function (params) {
|
|
@@ -136,6 +137,100 @@ var AccountsApi = (function (_super) {
|
|
|
136
137
|
});
|
|
137
138
|
});
|
|
138
139
|
};
|
|
140
|
+
AccountsApi.prototype.listEnvironmentAccounts = function (environmentId, filters) {
|
|
141
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
142
|
+
return __generator(this, function (_a) {
|
|
143
|
+
switch (_a.label) {
|
|
144
|
+
case 0: return [4, this.apiCall({
|
|
145
|
+
method: 'GET',
|
|
146
|
+
route: "".concat(this.accountsManagementPath, "/").concat(environmentId, "/list"),
|
|
147
|
+
params: filters,
|
|
148
|
+
})];
|
|
149
|
+
case 1: return [2, _a.sent()];
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
AccountsApi.prototype.environmentAccount = function (environmentId, accountId) {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
156
|
+
return __generator(this, function (_a) {
|
|
157
|
+
switch (_a.label) {
|
|
158
|
+
case 0: return [4, this.apiCall({
|
|
159
|
+
method: 'GET',
|
|
160
|
+
route: "".concat(this.accountsManagementPath, "/").concat(environmentId, "/account/").concat(accountId),
|
|
161
|
+
})];
|
|
162
|
+
case 1: return [2, _a.sent()];
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
AccountsApi.prototype.environmentAccountData = function (environmentId, accountId) {
|
|
168
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
169
|
+
return __generator(this, function (_a) {
|
|
170
|
+
switch (_a.label) {
|
|
171
|
+
case 0: return [4, this.apiCall({
|
|
172
|
+
method: 'GET',
|
|
173
|
+
route: "".concat(this.accountsManagementPath, "/").concat(environmentId, "/account-data/").concat(accountId),
|
|
174
|
+
})];
|
|
175
|
+
case 1: return [2, _a.sent()];
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
AccountsApi.prototype.updateEnvironmentAccountData = function (environmentId, accountId, data) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
182
|
+
return __generator(this, function (_a) {
|
|
183
|
+
switch (_a.label) {
|
|
184
|
+
case 0: return [4, this.apiCall({
|
|
185
|
+
method: 'PUT',
|
|
186
|
+
route: "".concat(this.accountsManagementPath, "/").concat(environmentId, "/account-data/").concat(accountId),
|
|
187
|
+
data: data,
|
|
188
|
+
})];
|
|
189
|
+
case 1: return [2, _a.sent()];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
AccountsApi.prototype.createEnvironmentAccount = function (environmentId, data) {
|
|
195
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
196
|
+
return __generator(this, function (_a) {
|
|
197
|
+
switch (_a.label) {
|
|
198
|
+
case 0: return [4, this.apiCall({
|
|
199
|
+
method: 'POST',
|
|
200
|
+
route: "".concat(this.accountsManagementPath, "/").concat(environmentId, "/account"),
|
|
201
|
+
data: data,
|
|
202
|
+
})];
|
|
203
|
+
case 1: return [2, _a.sent()];
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
AccountsApi.prototype.enableEnvironmentAccount = function (environmentId, accountId) {
|
|
209
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
210
|
+
return __generator(this, function (_a) {
|
|
211
|
+
switch (_a.label) {
|
|
212
|
+
case 0: return [4, this.apiCall({
|
|
213
|
+
method: 'PUT',
|
|
214
|
+
route: "".concat(this.accountsManagementPath, "/").concat(environmentId, "/account-enable/").concat(accountId),
|
|
215
|
+
})];
|
|
216
|
+
case 1: return [2, _a.sent()];
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
AccountsApi.prototype.disableEnvironmentAccount = function (environmentId, accountId) {
|
|
222
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
223
|
+
return __generator(this, function (_a) {
|
|
224
|
+
switch (_a.label) {
|
|
225
|
+
case 0: return [4, this.apiCall({
|
|
226
|
+
method: 'PUT',
|
|
227
|
+
route: "".concat(this.accountsManagementPath, "/").concat(environmentId, "/account-disable/").concat(accountId),
|
|
228
|
+
})];
|
|
229
|
+
case 1: return [2, _a.sent()];
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
};
|
|
139
234
|
return AccountsApi;
|
|
140
235
|
}(baseApi_1.BaseApi));
|
|
141
236
|
exports.default = AccountsApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/accountsApi/index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
AccountType["USER"] = "user";
|
|
7
|
-
AccountType["SYSTEM"] = "system";
|
|
8
|
-
AccountType["MAINTENANCE"] = "maintenance";
|
|
9
|
-
})(AccountType || (exports.AccountType = AccountType = {}));
|
|
4
|
+
var billing_shared_1 = require("@onereach/billing-shared");
|
|
5
|
+
Object.defineProperty(exports, "AccountType", { enumerable: true, get: function () { return billing_shared_1.AccountType; } });
|
|
10
6
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/accountsApi/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/accountsApi/types.ts"],"names":[],"mappings":";;;AAAA,2DAAmE;AAE1D,4FAFY,4BAAW,OAEZ"}
|
|
@@ -12,6 +12,7 @@ export default class AccountsApi extends BaseApi {
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
14
|
this.apiBasePath = 'accounts';
|
|
15
|
+
this.accountsManagementPath = 'accounts-management';
|
|
15
16
|
}
|
|
16
17
|
getAccounts(params) {
|
|
17
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -64,5 +65,64 @@ export default class AccountsApi extends BaseApi {
|
|
|
64
65
|
});
|
|
65
66
|
});
|
|
66
67
|
}
|
|
68
|
+
listEnvironmentAccounts(environmentId, filters) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
return yield this.apiCall({
|
|
71
|
+
method: 'GET',
|
|
72
|
+
route: `${this.accountsManagementPath}/${environmentId}/list`,
|
|
73
|
+
params: filters,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
environmentAccount(environmentId, accountId) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
return yield this.apiCall({
|
|
80
|
+
method: 'GET',
|
|
81
|
+
route: `${this.accountsManagementPath}/${environmentId}/account/${accountId}`,
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
environmentAccountData(environmentId, accountId) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
return yield this.apiCall({
|
|
88
|
+
method: 'GET',
|
|
89
|
+
route: `${this.accountsManagementPath}/${environmentId}/account-data/${accountId}`,
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
updateEnvironmentAccountData(environmentId, accountId, data) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
return yield this.apiCall({
|
|
96
|
+
method: 'PUT',
|
|
97
|
+
route: `${this.accountsManagementPath}/${environmentId}/account-data/${accountId}`,
|
|
98
|
+
data,
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
createEnvironmentAccount(environmentId, data) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
return yield this.apiCall({
|
|
105
|
+
method: 'POST',
|
|
106
|
+
route: `${this.accountsManagementPath}/${environmentId}/account`,
|
|
107
|
+
data,
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
enableEnvironmentAccount(environmentId, accountId) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
return yield this.apiCall({
|
|
114
|
+
method: 'PUT',
|
|
115
|
+
route: `${this.accountsManagementPath}/${environmentId}/account-enable/${accountId}`,
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
disableEnvironmentAccount(environmentId, accountId) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
return yield this.apiCall({
|
|
122
|
+
method: 'PUT',
|
|
123
|
+
route: `${this.accountsManagementPath}/${environmentId}/account-disable/${accountId}`,
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
67
127
|
}
|
|
68
128
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/accountsApi/index.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AASrC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAAhD;;QACmB,gBAAW,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/accountsApi/index.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AASrC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAAhD;;QACmB,gBAAW,GAAG,UAAU,CAAC;QACzB,2BAAsB,GAAG,qBAAqB,CAAC;IAoSlE,CAAC;IA9Pc,WAAW,CAAC,MAA0B;;YACjD,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;gBAC5B,MAAM,EAAE,MAAM;aACf,CAAC,CAAC;QACL,CAAC;KAAA;IAyCY,aAAa,CAAC,IAAyB;;YAClD,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;gBAC5B,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KAAA;IAiCY,aAAa,CAAC,EAAU,EAAE,IAAyB;;YAC9D,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;gBAC5B,MAAM,EAAE;oBACN,EAAE,EAAE,EAAE;iBACP;gBACD,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KAAA;IAQY,aAAa;6DAAC,EAAU,EAAE,UAAU,GAAG,IAAI;YAC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gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,sBAAsB,IAAI,aAAa,iBAAiB,SAAS,EAAE;gBAClF,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KAAA;IAOK,wBAAwB,CAC5B,aAAqB,EACrB,IAAiC;;YAEjC,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,GAAG,IAAI,CAAC,sBAAsB,IAAI,aAAa,UAAU;gBAChE,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KAAA;IAOK,wBAAwB,CAC5B,aAAqB,EACrB,SAAiB;;YAEjB,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,sBAAsB,IAAI,aAAa,mBAAmB,SAAS,EAAE;aACrF,CAAC,CAAC;QACL,CAAC;KAAA;IAOK,yBAAyB,CAC7B,aAAqB,EACrB,SAAiB;;YAEjB,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,sBAAsB,IAAI,aAAa,oBAAoB,SAAS,EAAE;aACtF,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
AccountType["USER"] = "user";
|
|
4
|
-
AccountType["SYSTEM"] = "system";
|
|
5
|
-
AccountType["MAINTENANCE"] = "maintenance";
|
|
6
|
-
})(AccountType || (AccountType = {}));
|
|
1
|
+
import { AccountType } from '@onereach/billing-shared';
|
|
2
|
+
export { AccountType };
|
|
7
3
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/accountsApi/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/accountsApi/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { AccountsQueryParamsV2Dto, AccountV2Dto } from '@onereach/billing-dto';
|
|
1
|
+
import { AccountsQueryParamsV2Dto, AccountV2Dto, CreateEnvironmentAccountDto, UpdateEnvironmentAccountDto, EnvironmentAccountDto, PaginatedResponseDto, EnvironmentAccountDataDto, EnvironmentAccountsFiltersDto } from '@onereach/billing-dto';
|
|
2
2
|
import { ResponseDto } from '@onereach/billing-shared';
|
|
3
3
|
import { BaseApi } from '../baseApi';
|
|
4
4
|
import { AccountQueryParams, CreateAccountParams, UpdateAccountParams, AccountDto } from './types';
|
|
5
5
|
export default class AccountsApi extends BaseApi {
|
|
6
6
|
private readonly apiBasePath;
|
|
7
|
+
private readonly accountsManagementPath;
|
|
7
8
|
getAccounts(params: AccountQueryParams): Promise<ResponseDto<AccountDto>>;
|
|
8
9
|
createAccount(data: CreateAccountParams): Promise<AccountDto>;
|
|
9
10
|
updateAccount(id: string, data: UpdateAccountParams): Promise<AccountDto>;
|
|
10
11
|
deleteAccount(id: string, softDelete?: boolean): Promise<void>;
|
|
11
12
|
getAccountsV2(params: AccountsQueryParamsV2Dto): Promise<ResponseDto<AccountV2Dto>>;
|
|
13
|
+
listEnvironmentAccounts(environmentId: string, filters?: EnvironmentAccountsFiltersDto): Promise<PaginatedResponseDto<EnvironmentAccountDto>>;
|
|
14
|
+
environmentAccount(environmentId: string, accountId: string): Promise<EnvironmentAccountDto>;
|
|
15
|
+
environmentAccountData(environmentId: string, accountId: string): Promise<EnvironmentAccountDataDto>;
|
|
16
|
+
updateEnvironmentAccountData(environmentId: string, accountId: string, data: UpdateEnvironmentAccountDto): Promise<EnvironmentAccountDto>;
|
|
17
|
+
createEnvironmentAccount(environmentId: string, data: CreateEnvironmentAccountDto): Promise<EnvironmentAccountDto>;
|
|
18
|
+
enableEnvironmentAccount(environmentId: string, accountId: string): Promise<void>;
|
|
19
|
+
disableEnvironmentAccount(environmentId: string, accountId: string): Promise<void>;
|
|
12
20
|
}
|
|
13
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/accountsApi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/accountsApi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAChP,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACX,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAC9C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAyB;IAsCnD,WAAW,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IA+CzE,aAAa,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;IAuC7D,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;IAiBzE,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAmC3D,aAAa,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAe1F,uBAAuB,CAC3B,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,6BAA6B,GACtC,OAAO,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;IAajD,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAY5F,sBAAsB,CAC1B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,yBAAyB,CAAC;IAa/B,4BAA4B,CAChC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,qBAAqB,CAAC;IAa3B,wBAAwB,CAC5B,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,qBAAqB,CAAC;IAa3B,wBAAwB,CAC5B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;IAYV,yBAAyB,CAC7B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;CAMjB"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { RequestDto } from '@onereach/billing-shared';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
SYSTEM = "system",
|
|
5
|
-
MAINTENANCE = "maintenance"
|
|
6
|
-
}
|
|
1
|
+
import { RequestDto, AccountType } from '@onereach/billing-shared';
|
|
2
|
+
export { AccountType };
|
|
3
|
+
export { EnvironmentAccountDataDto, EnvironmentAccountsFiltersDto, CreateEnvironmentAccountDto, UpdateEnvironmentAccountDto, EnvironmentAccountDto, } from '@onereach/billing-dto';
|
|
7
4
|
export interface AccountDto {
|
|
8
5
|
id: string;
|
|
9
6
|
environmentId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/api/accountsApi/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/api/accountsApi/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QA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
|
2
2
|
"name": "@or-sdk/billing",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.24.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dev": "pnpm build:watch:esm"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@onereach/billing-dto": "^11.
|
|
19
|
-
"@onereach/billing-shared": "^11.
|
|
18
|
+
"@onereach/billing-dto": "^11.24.0",
|
|
19
|
+
"@onereach/billing-shared": "^11.24.0",
|
|
20
20
|
"@or-sdk/base": "^0.42.3",
|
|
21
21
|
"@or-sdk/discovery": "1.10.4",
|
|
22
22
|
"@types/qs": "6.14.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountsQueryParamsV2Dto, AccountV2Dto } from '@onereach/billing-dto';
|
|
1
|
+
import { AccountsQueryParamsV2Dto, AccountV2Dto, CreateEnvironmentAccountDto, UpdateEnvironmentAccountDto, EnvironmentAccountDto, PaginatedResponseDto, EnvironmentAccountDataDto, EnvironmentAccountsFiltersDto } from '@onereach/billing-dto';
|
|
2
2
|
import { ResponseDto } from '@onereach/billing-shared';
|
|
3
3
|
|
|
4
4
|
import { BaseApi } from '../baseApi';
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
|
|
13
13
|
export default class AccountsApi extends BaseApi {
|
|
14
14
|
private readonly apiBasePath = 'accounts';
|
|
15
|
+
private readonly accountsManagementPath = 'accounts-management';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Retrieves accounts based on specified query parameters
|
|
@@ -194,4 +195,113 @@ export default class AccountsApi extends BaseApi {
|
|
|
194
195
|
params: params,
|
|
195
196
|
});
|
|
196
197
|
}
|
|
198
|
+
|
|
199
|
+
/*
|
|
200
|
+
* Retrieves a paginated list of environment accounts for the specified environment.
|
|
201
|
+
* @param {string} environmentId - The unique identifier of the environment.
|
|
202
|
+
* @param {EnvironmentAccountsFiltersDto} [filters] - Accounts filters
|
|
203
|
+
* @returns {Promise<PaginatedResponseDto<EnvironmentAccountDto>>}
|
|
204
|
+
* Paginated response with environment account DTOs.
|
|
205
|
+
* */
|
|
206
|
+
async listEnvironmentAccounts(
|
|
207
|
+
environmentId: string,
|
|
208
|
+
filters?: EnvironmentAccountsFiltersDto,
|
|
209
|
+
): Promise<PaginatedResponseDto<EnvironmentAccountDto>> {
|
|
210
|
+
return await this.apiCall({
|
|
211
|
+
method: 'GET',
|
|
212
|
+
route: `${this.accountsManagementPath}/${environmentId}/list`,
|
|
213
|
+
params: filters,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** Retrieves a specific account within an environment.
|
|
218
|
+
* @param {string} environmentId - The unique identifier of the environment.
|
|
219
|
+
* @param {string} accountId - The unique identifier of the account.
|
|
220
|
+
* @returns {Promise<EnvironmentAccountDto>} The requested environment account DTO.
|
|
221
|
+
* */
|
|
222
|
+
async environmentAccount(environmentId: string, accountId: string): Promise<EnvironmentAccountDto> {
|
|
223
|
+
return await this.apiCall({
|
|
224
|
+
method: 'GET',
|
|
225
|
+
route: `${this.accountsManagementPath}/${environmentId}/account/${accountId}`,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** Retrieves the 'data' object associated with an environment account.
|
|
230
|
+
* @param {string} environmentId - The unique identifier of the environment.
|
|
231
|
+
* @param {string} accountId - The unique identifier of the account.
|
|
232
|
+
* @returns {Promise<EnvironmentAccountDataDto>} The account's data object
|
|
233
|
+
* */
|
|
234
|
+
async environmentAccountData(
|
|
235
|
+
environmentId: string,
|
|
236
|
+
accountId: string,
|
|
237
|
+
): Promise<EnvironmentAccountDataDto> {
|
|
238
|
+
return await this.apiCall({
|
|
239
|
+
method: 'GET',
|
|
240
|
+
route: `${this.accountsManagementPath}/${environmentId}/account-data/${accountId}`,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/** Updates the 'data' object for a specific environment account.
|
|
245
|
+
* @param {string} environmentId - The unique identifier of the environment.
|
|
246
|
+
* @param {string} accountId - The unique identifier of the account.
|
|
247
|
+
* @param {UpdateEnvironmentAccountDto} data - The updated data values.
|
|
248
|
+
* @returns {Promise<EnvironmentAccountDto>} The updated environment account DTO.
|
|
249
|
+
* */
|
|
250
|
+
async updateEnvironmentAccountData(
|
|
251
|
+
environmentId: string,
|
|
252
|
+
accountId: string,
|
|
253
|
+
data: UpdateEnvironmentAccountDto,
|
|
254
|
+
): Promise<EnvironmentAccountDto> {
|
|
255
|
+
return await this.apiCall({
|
|
256
|
+
method: 'PUT',
|
|
257
|
+
route: `${this.accountsManagementPath}/${environmentId}/account-data/${accountId}`,
|
|
258
|
+
data,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/** Creates a new account within an environment.
|
|
263
|
+
* @param {string} environmentId - The unique identifier of the environment.
|
|
264
|
+
* @param {CreateEnvironmentAccountDto} data - Data for the new environment account.
|
|
265
|
+
* @returns {Promise<EnvironmentAccountDto>} The created environment account DTO.
|
|
266
|
+
* */
|
|
267
|
+
async createEnvironmentAccount(
|
|
268
|
+
environmentId: string,
|
|
269
|
+
data: CreateEnvironmentAccountDto,
|
|
270
|
+
): Promise<EnvironmentAccountDto> {
|
|
271
|
+
return await this.apiCall({
|
|
272
|
+
method: 'POST',
|
|
273
|
+
route: `${this.accountsManagementPath}/${environmentId}/account`,
|
|
274
|
+
data,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** Enables (activates) an environment account by its ID.
|
|
279
|
+
* @param {string} environmentId - The unique identifier of the environment.
|
|
280
|
+
* @param {string} accountId - The unique identifier of the account to enable.
|
|
281
|
+
* @returns {Promise<void>} No return value.
|
|
282
|
+
* */
|
|
283
|
+
async enableEnvironmentAccount(
|
|
284
|
+
environmentId: string,
|
|
285
|
+
accountId: string,
|
|
286
|
+
): Promise<void> {
|
|
287
|
+
return await this.apiCall({
|
|
288
|
+
method: 'PUT',
|
|
289
|
+
route: `${this.accountsManagementPath}/${environmentId}/account-enable/${accountId}`,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/** Disables (deactivates) an environment account by its ID.
|
|
294
|
+
* @param {string} environmentId - The unique identifier of the environment.
|
|
295
|
+
* @param {string} accountId - The unique identifier of the account to disable.
|
|
296
|
+
* @returns {Promise<void>} No return value.
|
|
297
|
+
* */
|
|
298
|
+
async disableEnvironmentAccount(
|
|
299
|
+
environmentId: string,
|
|
300
|
+
accountId: string,
|
|
301
|
+
): Promise<void> {
|
|
302
|
+
return await this.apiCall({
|
|
303
|
+
method: 'PUT',
|
|
304
|
+
route: `${this.accountsManagementPath}/${environmentId}/account-disable/${accountId}`,
|
|
305
|
+
});
|
|
306
|
+
}
|
|
197
307
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { RequestDto } from '@onereach/billing-shared';
|
|
1
|
+
import { RequestDto, AccountType } from '@onereach/billing-shared';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
USER = 'user',
|
|
5
|
-
SYSTEM = 'system',
|
|
6
|
-
MAINTENANCE = 'maintenance',
|
|
7
|
-
}
|
|
3
|
+
export { AccountType };
|
|
8
4
|
|
|
5
|
+
export {
|
|
6
|
+
EnvironmentAccountDataDto,
|
|
7
|
+
EnvironmentAccountsFiltersDto,
|
|
8
|
+
CreateEnvironmentAccountDto,
|
|
9
|
+
UpdateEnvironmentAccountDto,
|
|
10
|
+
EnvironmentAccountDto,
|
|
11
|
+
} from '@onereach/billing-dto';
|
|
9
12
|
|
|
10
13
|
export interface AccountDto {
|
|
11
14
|
id: string;
|