@neuralinnovations/dataisland-sdk 0.0.1-dev42 → 0.0.1-dev43
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/package.json +1 -1
- package/dist/src/dataIslandApp.d.ts +0 -5
- package/dist/src/dataIslandApp.d.ts.map +1 -1
- package/dist/src/dataIslandApp.js.map +1 -1
- package/dist/src/internal/app.impl.d.ts +2 -2
- package/dist/src/internal/app.impl.d.ts.map +1 -1
- package/dist/src/internal/app.impl.js +2 -5
- package/dist/src/internal/app.impl.js.map +1 -1
- package/dist/src/storages/acquirings/acquiring.d.ts +20 -0
- package/dist/src/storages/acquirings/acquiring.d.ts.map +1 -0
- package/dist/src/storages/acquirings/acquiring.impl.d.ts +13 -0
- package/dist/src/storages/acquirings/acquiring.impl.d.ts.map +1 -0
- package/dist/src/{services/acquiringService.js → storages/acquirings/acquiring.impl.js} +20 -12
- package/dist/src/storages/acquirings/acquiring.impl.js.map +1 -0
- package/dist/src/storages/acquirings/acquiring.js +10 -0
- package/dist/src/storages/acquirings/acquiring.js.map +1 -0
- package/dist/src/storages/organizations/organization.d.ts +5 -0
- package/dist/src/storages/organizations/organization.d.ts.map +1 -1
- package/dist/src/storages/organizations/organization.impl.d.ts +3 -0
- package/dist/src/storages/organizations/organization.impl.d.ts.map +1 -1
- package/dist/src/storages/organizations/organization.impl.js +14 -3
- package/dist/src/storages/organizations/organization.impl.js.map +1 -1
- package/dist/src/storages/organizations/organization.js.map +1 -1
- package/package.json +1 -1
- package/src/dataIslandApp.ts +0 -6
- package/src/internal/app.impl.ts +4 -7
- package/src/storages/acquirings/acquiring.impl.ts +66 -0
- package/src/storages/acquirings/acquiring.ts +27 -0
- package/src/storages/organizations/organization.impl.ts +39 -12
- package/src/storages/organizations/organization.ts +18 -11
- package/dist/src/services/acquiringService.d.ts +0 -8
- package/dist/src/services/acquiringService.d.ts.map +0 -1
- package/dist/src/services/acquiringService.js.map +0 -1
- package/src/services/acquiringService.ts +0 -50
package/dist/package.json
CHANGED
@@ -4,7 +4,6 @@ import { Context } from "./context";
|
|
4
4
|
import type { Constructor } from "./internal/registry";
|
5
5
|
import { Organizations } from "./storages/organizations/organizations";
|
6
6
|
import { UserProfile } from "./storages/user/userProfile";
|
7
|
-
import { AcquiringService } from "./services/acquiringService";
|
8
7
|
/**
|
9
8
|
* DataIsland App instance.
|
10
9
|
*/
|
@@ -38,10 +37,6 @@ export declare abstract class DataIslandApp {
|
|
38
37
|
* User's organizations.
|
39
38
|
*/
|
40
39
|
abstract get organizations(): Organizations;
|
41
|
-
/**
|
42
|
-
* Acquiring
|
43
|
-
*/
|
44
|
-
abstract get acquiring(): AcquiringService;
|
45
40
|
/**
|
46
41
|
* User's profile.
|
47
42
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dataIslandApp.d.ts","sourceRoot":"","sources":["../../src/dataIslandApp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;
|
1
|
+
{"version":3,"file":"dataIslandApp.d.ts","sourceRoot":"","sources":["../../src/dataIslandApp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEzD;;GAEG;AACH,8BAAsB,aAAa;IACjC;;OAEG;IACH,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAA;IAE3B;;OAEG;IACH,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAA;IAE3B;;OAEG;IACH,QAAQ,KAAK,8BAA8B,IAAI,OAAO,CAAA;IAEtD;;OAEG;IACH,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAA;IAEjC;;OAEG;IACH,QAAQ,KAAK,UAAU,IAAI,cAAc,GAAG,SAAS,CAAA;IAErD,QAAQ,KAAK,UAAU,CAAC,KAAK,EAAE,cAAc,EAAC;IAE9C;;OAEG;IACH,QAAQ,KAAK,OAAO,IAAI,OAAO,CAAA;IAE/B;;OAEG;IACH,QAAQ,KAAK,aAAa,IAAI,aAAa,CAAA;IAE3C;;OAEG;IACH,QAAQ,KAAK,WAAW,IAAI,WAAW,CAAA;IAEvC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS;CACzD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dataIslandApp.js","sourceRoot":"","sources":["../../src/dataIslandApp.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"dataIslandApp.js","sourceRoot":"","sources":["../../src/dataIslandApp.ts"],"names":[],"mappings":";;;AAOA;;GAEG;AACH,MAAsB,aAAa;CAgDlC;AAhDD,sCAgDC"}
|
@@ -6,7 +6,7 @@ import { type CredentialBase } from "../credentials";
|
|
6
6
|
import { DataIslandApp } from "../dataIslandApp";
|
7
7
|
import { Organizations } from "../storages/organizations/organizations";
|
8
8
|
import { UserProfile } from "../storages/user/userProfile";
|
9
|
-
import {
|
9
|
+
import { Acquiring } from "../storages/acquirings/acquiring";
|
10
10
|
export declare class DataIslandAppImpl extends DataIslandApp {
|
11
11
|
readonly name: string;
|
12
12
|
private _host;
|
@@ -24,7 +24,7 @@ export declare class DataIslandAppImpl extends DataIslandApp {
|
|
24
24
|
get host(): string;
|
25
25
|
get organizations(): Organizations;
|
26
26
|
get userProfile(): UserProfile;
|
27
|
-
get acquiring():
|
27
|
+
get acquiring(): Acquiring;
|
28
28
|
initialize(setup: ((builder: AppBuilder) => Promise<void>) | undefined): Promise<void>;
|
29
29
|
}
|
30
30
|
//# sourceMappingURL=app.impl.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"app.impl.d.ts","sourceRoot":"","sources":["../../../src/internal/app.impl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,YAAY,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAuB,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAIlE,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAShD,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;
|
1
|
+
{"version":3,"file":"app.impl.d.ts","sourceRoot":"","sources":["../../../src/internal/app.impl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,YAAY,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAuB,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAIlE,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAShD,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAS1D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAE5D,qBAAa,iBAAkB,SAAQ,aAAa;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,+BAA+B,CAAgB;IACvD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;gBAErC,IAAI,EAAE,MAAM;IAUxB,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,UAAU,IAAI,cAAc,GAAG,SAAS,CAE3C;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,cAAc,EAEnC;IAED,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,OAAO,6CAAuE;IAE9E,IAAI,8BAA8B,IAAI,OAAO,CAE5C;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,aAAa,IAAI,aAAa,CAEjC;IAED,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,IAAI,SAAS,IAAI,SAAS,CAEzB;IAEK,UAAU,CACd,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,GAC1D,OAAO,CAAC,IAAI,CAAC;CAiIjB"}
|
@@ -20,7 +20,7 @@ const unitTest_1 = require("../unitTest");
|
|
20
20
|
const deleteUserFullCommandHandler_1 = require("../commands/deleteUserFullCommandHandler");
|
21
21
|
const cookieService_1 = require("../services/cookieService");
|
22
22
|
const anonymousService_1 = require("../services/anonymousService");
|
23
|
-
const
|
23
|
+
const acquiring_impl_1 = require("../storages/acquirings/acquiring.impl");
|
24
24
|
class DataIslandAppImpl extends dataIslandApp_1.DataIslandApp {
|
25
25
|
constructor(name) {
|
26
26
|
super();
|
@@ -62,7 +62,7 @@ class DataIslandAppImpl extends dataIslandApp_1.DataIslandApp {
|
|
62
62
|
return (_a = this.resolve(userProfileService_1.UserProfileService)) === null || _a === void 0 ? void 0 : _a.userProfile;
|
63
63
|
}
|
64
64
|
get acquiring() {
|
65
|
-
return this.resolve(
|
65
|
+
return this.resolve(acquiring_impl_1.AcquiringImpl);
|
66
66
|
}
|
67
67
|
async initialize(setup) {
|
68
68
|
// create app builder
|
@@ -99,9 +99,6 @@ class DataIslandAppImpl extends dataIslandApp_1.DataIslandApp {
|
|
99
99
|
builder.registerService(anonymousService_1.AnonymousService, (context) => {
|
100
100
|
return new anonymousService_1.AnonymousService(context);
|
101
101
|
});
|
102
|
-
builder.registerService(acquiringService_1.AcquiringService, (context) => {
|
103
|
-
return new acquiringService_1.AcquiringService(context);
|
104
|
-
});
|
105
102
|
// call customer setup
|
106
103
|
if (setup !== undefined) {
|
107
104
|
await setup(builder);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"app.impl.js","sourceRoot":"","sources":["../../../src/internal/app.impl.ts"],"names":[],"mappings":";;;AAAA,oCAAuC;AAEvC,uDAA4D;AAC5D,yCAAuD;AACvD,wCAAoC;AACpC,8CAAkE;AAClE,iDAAkE;AAClE,qEAAiE;AACjE,qEAAiE;AACjE,gDAIuB;AACvB,oDAAgD;AAChD,uDAAmD;AACnD,+DAA2D;AAC3D,yEAGwC;AACxC,uEAAmE;AACnE,yEAAqE;AAGrE,0CAAkD;AAClD,2FAGiD;AACjD,6DAAyD;AACzD,mEAA+D;AAC/D,
|
1
|
+
{"version":3,"file":"app.impl.js","sourceRoot":"","sources":["../../../src/internal/app.impl.ts"],"names":[],"mappings":";;;AAAA,oCAAuC;AAEvC,uDAA4D;AAC5D,yCAAuD;AACvD,wCAAoC;AACpC,8CAAkE;AAClE,iDAAkE;AA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Ac,IAAI,CAAC,IAAI,cAAc,CAAC,CAAA;QACpD,CAAC;IACH,CAAC;CACF;AA3LD,8CA2LC"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { AcquiringPlansResponse, CreateOrederData as CreateOrderData, UserAcquiringPlan } from "../../dto/acquiringResponse";
|
2
|
+
/**
|
3
|
+
* Acquiring service
|
4
|
+
*/
|
5
|
+
export declare abstract class Acquiring {
|
6
|
+
/**
|
7
|
+
* Create order
|
8
|
+
* @param key
|
9
|
+
*/
|
10
|
+
abstract createOrder(key: string): Promise<CreateOrderData>;
|
11
|
+
/**
|
12
|
+
* Get plans
|
13
|
+
*/
|
14
|
+
abstract getPlans(): Promise<AcquiringPlansResponse>;
|
15
|
+
/**
|
16
|
+
* Get user plan
|
17
|
+
*/
|
18
|
+
abstract getUserPlan(): Promise<UserAcquiringPlan>;
|
19
|
+
}
|
20
|
+
//# sourceMappingURL=acquiring.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"acquiring.d.ts","sourceRoot":"","sources":["../../../../src/storages/acquirings/acquiring.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,gBAAgB,IAAI,eAAe,EACnC,iBAAiB,EAClB,MAAM,6BAA6B,CAAA;AAEpC;;GAEG;AACH,8BAAsB,SAAS;IAE7B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAE3D;;OAEG;IACH,QAAQ,CAAC,QAAQ,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAEpD;;OAEG;IACH,QAAQ,CAAC,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC;CACnD"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { AcquiringPlansResponse, CreateOrederData as CreateOrderData, UserAcquiringPlan } from "../../dto/acquiringResponse";
|
2
|
+
import { Acquiring } from "./acquiring";
|
3
|
+
import { Context } from "../../context";
|
4
|
+
import { Organization } from "../organizations/organization";
|
5
|
+
export declare class AcquiringImpl implements Acquiring {
|
6
|
+
private readonly organization;
|
7
|
+
private readonly context;
|
8
|
+
constructor(organization: Organization, context: Context);
|
9
|
+
createOrder(key: string): Promise<CreateOrderData>;
|
10
|
+
getPlans(): Promise<AcquiringPlansResponse>;
|
11
|
+
getUserPlan(): Promise<UserAcquiringPlan>;
|
12
|
+
}
|
13
|
+
//# sourceMappingURL=acquiring.impl.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"acquiring.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/acquirings/acquiring.impl.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EAEtB,gBAAgB,IAAI,eAAe,EACnC,iBAAiB,EAClB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAE5D,qBAAa,aAAc,YAAW,SAAS;IAG3C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO;IAG7B,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAgBlD,QAAQ,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAe3C,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAehD"}
|
@@ -1,12 +1,15 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
const
|
5
|
-
const
|
6
|
-
|
7
|
-
|
3
|
+
exports.AcquiringImpl = void 0;
|
4
|
+
const rpcService_1 = require("../../services/rpcService");
|
5
|
+
const responseUtils_1 = require("../../services/responseUtils");
|
6
|
+
class AcquiringImpl {
|
7
|
+
constructor(organization, context) {
|
8
|
+
this.organization = organization;
|
9
|
+
this.context = context;
|
10
|
+
}
|
8
11
|
async createOrder(key) {
|
9
|
-
const rpc = this.resolve(rpcService_1.RpcService);
|
12
|
+
const rpc = this.context.resolve(rpcService_1.RpcService);
|
10
13
|
const response = await rpc.requestBuilder("api/v1/Acquiring/order")
|
11
14
|
.sendPostJson({
|
12
15
|
key: key
|
@@ -18,8 +21,10 @@ class AcquiringService extends service_1.Service {
|
|
18
21
|
return order.data;
|
19
22
|
}
|
20
23
|
async getPlans() {
|
21
|
-
const rpc = this.resolve(rpcService_1.RpcService);
|
22
|
-
const response = await rpc
|
24
|
+
const rpc = this.context.resolve(rpcService_1.RpcService);
|
25
|
+
const response = await rpc
|
26
|
+
.requestBuilder("api/v1/Acquiring/plans")
|
27
|
+
.sendGet();
|
23
28
|
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
24
29
|
await responseUtils_1.ResponseUtils.throwError("Failed to get acquiring plans", response);
|
25
30
|
}
|
@@ -27,8 +32,11 @@ class AcquiringService extends service_1.Service {
|
|
27
32
|
return content;
|
28
33
|
}
|
29
34
|
async getUserPlan() {
|
30
|
-
const rpc = this.resolve(rpcService_1.RpcService);
|
31
|
-
const response = await rpc
|
35
|
+
const rpc = this.context.resolve(rpcService_1.RpcService);
|
36
|
+
const response = await rpc
|
37
|
+
.requestBuilder("api/v1/Acquiring/user/subscription")
|
38
|
+
.searchParam("organizationId", this.organization.id)
|
39
|
+
.sendGet();
|
32
40
|
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
33
41
|
await responseUtils_1.ResponseUtils.throwError("Failed to get user subscription", response);
|
34
42
|
}
|
@@ -36,5 +44,5 @@ class AcquiringService extends service_1.Service {
|
|
36
44
|
return content;
|
37
45
|
}
|
38
46
|
}
|
39
|
-
exports.
|
40
|
-
//# sourceMappingURL=
|
47
|
+
exports.AcquiringImpl = AcquiringImpl;
|
48
|
+
//# sourceMappingURL=acquiring.impl.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O,CAAA;IAChB,CAAC;IAED,KAAK,CAAC,WAAW;QACf,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,uBAAU,CAAe,CAAA;QAC1D,MAAM,QAAQ,GAAG,MAAM,GAAG;aACvB,cAAc,CAAC,oCAAoC,CAAC;aACpD,WAAW,CAAC,gBAAgB,EAAU,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;aAC3D,OAAO,EAAE,CAAA;QAEZ,IAAI,6BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAAC,iCAAiC,EAAE,QAAQ,CAAC,CAAA;QAC7E,CAAC;QAED,MAAM,OAAO,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAsB,CAAA;QAE5D,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AArDD,sCAqDC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"acquiring.js","sourceRoot":"","sources":["../../../../src/storages/acquirings/acquiring.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACH,MAAsB,SAAS;CAiB9B;AAjBD,8BAiBC"}
|
@@ -7,6 +7,7 @@ import { CurrentLimitsData, UserDto, UsersStatisticsResponse } from "../../dto/u
|
|
7
7
|
import { GroupId } from "../groups/group";
|
8
8
|
import { StatisticsResponse } from "../../dto/statisticsResponse";
|
9
9
|
import { SegmentData } from "../../dto/limitsResponse";
|
10
|
+
import { Acquiring } from "../acquirings/acquiring";
|
10
11
|
/**
|
11
12
|
* Organization event.
|
12
13
|
*/
|
@@ -91,5 +92,9 @@ export declare abstract class Organization extends EventDispatcher<OrganizationE
|
|
91
92
|
* Validate invite code for user
|
92
93
|
*/
|
93
94
|
abstract validateInviteCode(code: string): Promise<void>;
|
95
|
+
/**
|
96
|
+
* Acquiring
|
97
|
+
*/
|
98
|
+
abstract get acquiring(): Acquiring;
|
94
99
|
}
|
95
100
|
//# sourceMappingURL=organization.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,
|
1
|
+
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EACL,iBAAiB,EACjB,OAAO,EACP,uBAAuB,EACxB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,8BAAsB,YAAa,SAAQ,eAAe,CACxD,iBAAiB,EACjB,YAAY,CACb;IACC;;OAEG;IACH,QAAQ,KAAK,EAAE,IAAI,cAAc,CAAA;IAEjC;;OAEG;IACH,QAAQ,KAAK,IAAI,IAAI,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AE,GAAG,OAAO,CAAC,MAAM,CAAC;IAEnE;;OAEG;IACH,QAAQ,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAExD;;OAEG;IACH,QAAQ,KAAK,SAAS,IAAI,SAAS,CAAA;CACpC"}
|
@@ -8,6 +8,7 @@ import { Groups } from "../groups/groups";
|
|
8
8
|
import { Chats } from "../chats/chats";
|
9
9
|
import { StatisticsResponse } from "../../dto/statisticsResponse";
|
10
10
|
import { SegmentData } from "../../dto/limitsResponse";
|
11
|
+
import { type Acquiring } from "../acquirings/acquiring";
|
11
12
|
export declare class OrganizationImpl extends Organization implements Disposable {
|
12
13
|
private readonly context;
|
13
14
|
private _isDisposed;
|
@@ -16,6 +17,7 @@ export declare class OrganizationImpl extends Organization implements Disposable
|
|
16
17
|
private readonly _workspaces;
|
17
18
|
private readonly _accessGroups;
|
18
19
|
private readonly _chats;
|
20
|
+
private readonly _acquiring;
|
19
21
|
constructor(context: Context);
|
20
22
|
initFrom(content: OrganizationDto, isAdmin: boolean): Promise<OrganizationImpl>;
|
21
23
|
get isAdmin(): boolean;
|
@@ -27,6 +29,7 @@ export declare class OrganizationImpl extends Organization implements Disposable
|
|
27
29
|
get workspaces(): Workspaces;
|
28
30
|
get accessGroups(): Groups;
|
29
31
|
get chats(): Chats;
|
32
|
+
get acquiring(): Acquiring;
|
30
33
|
members(): Promise<UserDto[]>;
|
31
34
|
change(name: string, description: string): Promise<void>;
|
32
35
|
statistics(dateFrom: number, dateTo: number): Promise<StatisticsResponse>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"organization.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,
|
1
|
+
{"version":3,"file":"organization.impl.d.ts","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Service_1 = require("../../services/rpcService");
|
9
9
|
const responseUtils_1 = require("../../services/responseUtils");
|
10
|
+
const acquiring_impl_1 = require("../acquirings/acquiring.impl");
|
10
11
|
class OrganizationImpl extends organization_1.Organization {
|
11
12
|
constructor(context) {
|
12
13
|
super();
|
@@ -16,6 +17,7 @@ class OrganizationImpl extends organization_1.Organization {
|
|
16
17
|
this._workspaces = new workspaces_impl_1.WorkspacesImpl(this, this.context);
|
17
18
|
this._accessGroups = new groups_impl_1.GroupsImpl(this, this.context);
|
18
19
|
this._chats = new chats_impl_1.ChatsImpl(this, this.context);
|
20
|
+
this._acquiring = new acquiring_impl_1.AcquiringImpl(this, this.context);
|
19
21
|
}
|
20
22
|
async initFrom(content, isAdmin) {
|
21
23
|
this._content = content;
|
@@ -56,6 +58,9 @@ class OrganizationImpl extends organization_1.Organization {
|
|
56
58
|
get chats() {
|
57
59
|
return this._chats;
|
58
60
|
}
|
61
|
+
get acquiring() {
|
62
|
+
return this._acquiring;
|
63
|
+
}
|
59
64
|
async members() {
|
60
65
|
var _a;
|
61
66
|
// send request to the server
|
@@ -146,10 +151,16 @@ class OrganizationImpl extends organization_1.Organization {
|
|
146
151
|
}
|
147
152
|
// parse limits from the server's response
|
148
153
|
const limits = (await response.json());
|
149
|
-
const currentLimits = {
|
154
|
+
const currentLimits = {
|
155
|
+
segment: limits.userSegment.key,
|
156
|
+
limits: []
|
157
|
+
};
|
150
158
|
for (const limit of limits.userLimits) {
|
151
159
|
const type = limit.action;
|
152
|
-
const currentItem = {
|
160
|
+
const currentItem = {
|
161
|
+
action: type,
|
162
|
+
records: []
|
163
|
+
};
|
153
164
|
if (limit.records.length == 0)
|
154
165
|
continue;
|
155
166
|
for (const record of limit.records) {
|
@@ -229,7 +240,7 @@ class OrganizationImpl extends organization_1.Organization {
|
|
229
240
|
var _a;
|
230
241
|
const response = await ((_a = this.context
|
231
242
|
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/Invites/apply").sendPutJson({
|
232
|
-
code: code
|
243
|
+
code: code
|
233
244
|
}));
|
234
245
|
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
235
246
|
await responseUtils_1.ResponseUtils.throwError(`Invite code validation failed for organization ${this.id}`, response);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"organization.impl.js","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.impl.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"organization.impl.js","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.impl.ts"],"names":[],"mappings":";;;AAaA,mEAA8D;AAE9D,iDAAgE;AAChE,uDAAkD;AAElD,oDAA+C;AAE/C,0DAAsD;AACtD,gEAA4D;AAS5D,iEAA4D;AAE5D,MAAa,gBAAiB,SAAQ,2BAAY;IAShD,YAA6B,OAAgB;QAC3C,KAAK,EAAE,CAAA;QADoB,YAAO,GAAP,OAAO,CAAS;QARrC,gBAAW,GAAY,KAAK,CAAA;QAC5B,aAAQ,GAAY,KAAK,CAAA;QAS/B,IAAI,CAAC,WAAW,GAAG,IAAI,gCAAc,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACzD,IAAI,CAAC,aAAa,GAAG,IAAI,wBAAU,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACvD,IAAI,CAAC,MAAM,GAAG,IAAI,sBAAS,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/C,IAAI,CAAC,UAAU,GAAG,IAAI,8BAAa,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACzD,CAAC;IAEM,KAAK,CAAC,QAAQ,CACnB,OAAwB,EACxB,OAAgB;QAEhB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QAEvB,qCAAqC;QACrC,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,C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gBAAgB,CAAC,YAAsB;;QAC3C,MAAM,QAAQ,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,OAAO;aAChC,OAAO,CAAC,uBAAU,CAAC,0CAClB,cAAc,CAAC,qBAAqB,EACrC,YAAY,CAAC;YACZ,cAAc,EAAE,IAAI,CAAC,EAAE;YACvB,cAAc,EAAE,YAAY;SAC7B,CAAC,CAAA,CAAA;QACJ,IAAI,6BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAC5B,gDAAgD,IAAI,CAAC,EAAE,EAAE,EACzD,QAAQ,CACT,CAAA;QACH,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAS,CAAC,IAAI,EAAE,CAAA;QAEnC,MAAM,IAAI,GAAI,IAA2B,CAAC,IAAI,CAAA;QAE9C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,IAAY;;QACnC,MAAM,QAAQ,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,OAAO;aAChC,OAAO,CAAC,uBAAU,CAAC,0CAClB,cAAc,CAAC,sBAAsB,EACtC,WAAW,CAAC;YACX,IAAI,EAAE,IAAI;SACX,CAAC,CAAA,CAAA;QACJ,IAAI,6BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAC5B,kDAAkD,IAAI,CAAC,EAAE,EAAE,EAC3D,QAAQ,CACT,CAAA;QACH,CAAC;IACH,CAAC;CACF;AA/VD,4CA+VC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.ts"],"names":[],"mappings":";;;AAIA,yCAA8C;
|
1
|
+
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.ts"],"names":[],"mappings":";;;AAIA,yCAA8C;AAW9C;;GAEG;AACH,IAAY,iBAEX;AAFD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;AACrB,CAAC,EAFW,iBAAiB,iCAAjB,iBAAiB,QAE5B;AAED;;GAEG;AACH,MAAsB,YAAa,SAAQ,wBAG1C;CAgGA;AAnGD,oCAmGC"}
|
package/package.json
CHANGED
package/src/dataIslandApp.ts
CHANGED
@@ -4,7 +4,6 @@ import { Context } from "./context"
|
|
4
4
|
import type { Constructor } from "./internal/registry"
|
5
5
|
import { Organizations } from "./storages/organizations/organizations"
|
6
6
|
import { UserProfile } from "./storages/user/userProfile"
|
7
|
-
import { AcquiringService } from "./services/acquiringService"
|
8
7
|
|
9
8
|
/**
|
10
9
|
* DataIsland App instance.
|
@@ -47,11 +46,6 @@ export abstract class DataIslandApp {
|
|
47
46
|
*/
|
48
47
|
abstract get organizations(): Organizations
|
49
48
|
|
50
|
-
/**
|
51
|
-
* Acquiring
|
52
|
-
*/
|
53
|
-
abstract get acquiring(): AcquiringService
|
54
|
-
|
55
49
|
/**
|
56
50
|
* User's profile.
|
57
51
|
*/
|
package/src/internal/app.impl.ts
CHANGED
@@ -30,7 +30,8 @@ import {
|
|
30
30
|
} from "../commands/deleteUserFullCommandHandler"
|
31
31
|
import { CookieService } from "../services/cookieService"
|
32
32
|
import { AnonymousService } from "../services/anonymousService"
|
33
|
-
import {
|
33
|
+
import { AcquiringImpl } from "../storages/acquirings/acquiring.impl"
|
34
|
+
import { Acquiring } from "../storages/acquirings/acquiring"
|
34
35
|
|
35
36
|
export class DataIslandAppImpl extends DataIslandApp {
|
36
37
|
readonly name: string
|
@@ -84,8 +85,8 @@ export class DataIslandAppImpl extends DataIslandApp {
|
|
84
85
|
return this.resolve(UserProfileService)?.userProfile as UserProfile
|
85
86
|
}
|
86
87
|
|
87
|
-
get acquiring():
|
88
|
-
return this.resolve(
|
88
|
+
get acquiring(): Acquiring {
|
89
|
+
return this.resolve(AcquiringImpl) as AcquiringImpl
|
89
90
|
}
|
90
91
|
|
91
92
|
async initialize(
|
@@ -127,10 +128,6 @@ export class DataIslandAppImpl extends DataIslandApp {
|
|
127
128
|
builder.registerService(AnonymousService, (context: ServiceContext) => {
|
128
129
|
return new AnonymousService(context)
|
129
130
|
})
|
130
|
-
builder.registerService(AcquiringService, (context: ServiceContext) => {
|
131
|
-
return new AcquiringService(context)
|
132
|
-
})
|
133
|
-
|
134
131
|
|
135
132
|
// call customer setup
|
136
133
|
if (setup !== undefined) {
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { RpcService } from "../../services/rpcService"
|
2
|
+
import { ResponseUtils } from "../../services/responseUtils"
|
3
|
+
import {
|
4
|
+
AcquiringPlansResponse,
|
5
|
+
CreateOrderResponse,
|
6
|
+
CreateOrederData as CreateOrderData,
|
7
|
+
UserAcquiringPlan
|
8
|
+
} from "../../dto/acquiringResponse"
|
9
|
+
import { Acquiring } from "./acquiring"
|
10
|
+
import { Context } from "../../context"
|
11
|
+
import { Organization } from "../organizations/organization"
|
12
|
+
|
13
|
+
export class AcquiringImpl implements Acquiring {
|
14
|
+
|
15
|
+
constructor(
|
16
|
+
private readonly organization: Organization,
|
17
|
+
private readonly context: Context) {
|
18
|
+
}
|
19
|
+
|
20
|
+
async createOrder(key: string): Promise<CreateOrderData> {
|
21
|
+
const rpc = this.context.resolve(RpcService) as RpcService
|
22
|
+
const response = await rpc.requestBuilder("api/v1/Acquiring/order")
|
23
|
+
.sendPostJson({
|
24
|
+
key: key
|
25
|
+
})
|
26
|
+
|
27
|
+
if (ResponseUtils.isFail(response)) {
|
28
|
+
await ResponseUtils.throwError("Failed to create order", response)
|
29
|
+
}
|
30
|
+
|
31
|
+
const order = (await response.json()) as CreateOrderResponse
|
32
|
+
|
33
|
+
return order.data
|
34
|
+
}
|
35
|
+
|
36
|
+
async getPlans(): Promise<AcquiringPlansResponse> {
|
37
|
+
const rpc = this.context.resolve(RpcService) as RpcService
|
38
|
+
const response = await rpc
|
39
|
+
.requestBuilder("api/v1/Acquiring/plans")
|
40
|
+
.sendGet()
|
41
|
+
|
42
|
+
if (ResponseUtils.isFail(response)) {
|
43
|
+
await ResponseUtils.throwError("Failed to get acquiring plans", response)
|
44
|
+
}
|
45
|
+
|
46
|
+
const content = (await response.json()) as AcquiringPlansResponse
|
47
|
+
|
48
|
+
return content
|
49
|
+
}
|
50
|
+
|
51
|
+
async getUserPlan(): Promise<UserAcquiringPlan> {
|
52
|
+
const rpc = this.context.resolve(RpcService) as RpcService
|
53
|
+
const response = await rpc
|
54
|
+
.requestBuilder("api/v1/Acquiring/user/subscription")
|
55
|
+
.searchParam("organizationId", <string>this.organization.id)
|
56
|
+
.sendGet()
|
57
|
+
|
58
|
+
if (ResponseUtils.isFail(response)) {
|
59
|
+
await ResponseUtils.throwError("Failed to get user subscription", response)
|
60
|
+
}
|
61
|
+
|
62
|
+
const content = (await response.json()) as UserAcquiringPlan
|
63
|
+
|
64
|
+
return content
|
65
|
+
}
|
66
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import {
|
2
|
+
AcquiringPlansResponse,
|
3
|
+
CreateOrederData as CreateOrderData,
|
4
|
+
UserAcquiringPlan
|
5
|
+
} from "../../dto/acquiringResponse"
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Acquiring service
|
9
|
+
*/
|
10
|
+
export abstract class Acquiring {
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Create order
|
14
|
+
* @param key
|
15
|
+
*/
|
16
|
+
abstract createOrder(key: string): Promise<CreateOrderData>
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Get plans
|
20
|
+
*/
|
21
|
+
abstract getPlans(): Promise<AcquiringPlansResponse>
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Get user plan
|
25
|
+
*/
|
26
|
+
abstract getUserPlan(): Promise<UserAcquiringPlan>
|
27
|
+
}
|
@@ -1,6 +1,15 @@
|
|
1
1
|
import { OrganizationId } from "./organizations"
|
2
2
|
import { Disposable } from "../../disposable"
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
CurrentLimitItem,
|
5
|
+
CurrentLimitRecordData,
|
6
|
+
CurrentLimitsData,
|
7
|
+
OrganizationDto,
|
8
|
+
OrganizationSegmentData,
|
9
|
+
UserDto,
|
10
|
+
UserLimitsData,
|
11
|
+
UsersStatisticsResponse
|
12
|
+
} from "../../dto/userInfoResponse"
|
4
13
|
import { Workspaces } from "../workspaces/workspaces"
|
5
14
|
import { WorkspacesImpl } from "../workspaces/workspaces.impl"
|
6
15
|
import { Context } from "../../context"
|
@@ -12,8 +21,14 @@ import { Chats } from "../chats/chats"
|
|
12
21
|
import { RpcService } from "../../services/rpcService"
|
13
22
|
import { ResponseUtils } from "../../services/responseUtils"
|
14
23
|
import { StatisticsResponse } from "../../dto/statisticsResponse"
|
15
|
-
import {
|
24
|
+
import {
|
25
|
+
LimitActionType,
|
26
|
+
SegmentData,
|
27
|
+
SegmentsData
|
28
|
+
} from "../../dto/limitsResponse"
|
16
29
|
import { InviteCodeResponse } from "../../dto/accessGroupResponse"
|
30
|
+
import { type Acquiring } from "../acquirings/acquiring"
|
31
|
+
import { AcquiringImpl } from "../acquirings/acquiring.impl"
|
17
32
|
|
18
33
|
export class OrganizationImpl extends Organization implements Disposable {
|
19
34
|
private _isDisposed: boolean = false
|
@@ -22,12 +37,14 @@ export class OrganizationImpl extends Organization implements Disposable {
|
|
22
37
|
private readonly _workspaces: WorkspacesImpl
|
23
38
|
private readonly _accessGroups: GroupsImpl
|
24
39
|
private readonly _chats: ChatsImpl
|
40
|
+
private readonly _acquiring: AcquiringImpl
|
25
41
|
|
26
42
|
constructor(private readonly context: Context) {
|
27
43
|
super()
|
28
44
|
this._workspaces = new WorkspacesImpl(this, this.context)
|
29
45
|
this._accessGroups = new GroupsImpl(this, this.context)
|
30
46
|
this._chats = new ChatsImpl(this, this.context)
|
47
|
+
this._acquiring = new AcquiringImpl(this, this.context)
|
31
48
|
}
|
32
49
|
|
33
50
|
public async initFrom(
|
@@ -81,6 +98,10 @@ export class OrganizationImpl extends Organization implements Disposable {
|
|
81
98
|
return this._chats
|
82
99
|
}
|
83
100
|
|
101
|
+
get acquiring(): Acquiring {
|
102
|
+
return this._acquiring
|
103
|
+
}
|
104
|
+
|
84
105
|
async members(): Promise<UserDto[]> {
|
85
106
|
// send request to the server
|
86
107
|
const response = await this.context
|
@@ -228,29 +249,35 @@ export class OrganizationImpl extends Organization implements Disposable {
|
|
228
249
|
// parse limits from the server's response
|
229
250
|
const limits = (await response!.json()) as UserLimitsData
|
230
251
|
|
231
|
-
const currentLimits = {
|
232
|
-
|
252
|
+
const currentLimits = {
|
253
|
+
segment: limits.userSegment.key,
|
254
|
+
limits: []
|
255
|
+
} as CurrentLimitsData
|
256
|
+
for (const limit of limits.userLimits) {
|
233
257
|
const type = limit.action as LimitActionType
|
234
|
-
const currentItem = {
|
258
|
+
const currentItem = {
|
259
|
+
action: type,
|
260
|
+
records: []
|
261
|
+
} as CurrentLimitItem
|
235
262
|
|
236
263
|
if (limit.records.length == 0) continue
|
237
264
|
|
238
265
|
for (const record of limit.records) {
|
239
266
|
const segmentRecord = limits.userSegment.dayItems.find(item => item.daysCount == record.daysCount)
|
240
|
-
if (segmentRecord == null){
|
267
|
+
if (segmentRecord == null) {
|
241
268
|
throw new Error(`Invalid response during get limits in organization: ${this.id}. Days count with ${type} not found in segment ${limits.userSegment.key}`)
|
242
269
|
}
|
243
270
|
const actionRecord = segmentRecord?.actionItems.find(item => item.type == type)
|
244
|
-
if (actionRecord == null){
|
245
|
-
throw new Error(`Invalid response during get limits in organization: ${this.id}. Type ${type} not found in segment ${limits.userSegment.key}`)
|
271
|
+
if (actionRecord == null) {
|
272
|
+
throw new Error(`Invalid response during get limits in organization: ${this.id}. Type ${type} not found in segment ${limits.userSegment.key}`)
|
246
273
|
}
|
247
274
|
|
248
275
|
const currentRecord = {} as CurrentLimitRecordData
|
249
276
|
currentRecord.daysCount = record.daysCount
|
250
277
|
currentRecord.activeTill = record.activeTill
|
251
|
-
currentRecord.all = actionRecord?.tokenLimit ?? actionRecord?.countLimit
|
252
|
-
|
253
|
-
const available = record.tokenLimit ?? record.countLimit
|
278
|
+
currentRecord.all = actionRecord?.tokenLimit ?? actionRecord?.countLimit
|
279
|
+
|
280
|
+
const available = record.tokenLimit ?? record.countLimit
|
254
281
|
currentRecord.used = currentRecord.all - available
|
255
282
|
|
256
283
|
currentItem.records.push(currentRecord)
|
@@ -345,7 +372,7 @@ export class OrganizationImpl extends Organization implements Disposable {
|
|
345
372
|
.resolve(RpcService)
|
346
373
|
?.requestBuilder("api/v1/Invites/apply")
|
347
374
|
.sendPutJson({
|
348
|
-
code: code
|
375
|
+
code: code
|
349
376
|
})
|
350
377
|
if (ResponseUtils.isFail(response)) {
|
351
378
|
await ResponseUtils.throwError(
|
@@ -3,10 +3,15 @@ import { OrganizationId } from "./organizations"
|
|
3
3
|
import { Groups } from "../groups/groups"
|
4
4
|
import { Chats } from "../chats/chats"
|
5
5
|
import { EventDispatcher } from "../../events"
|
6
|
-
import {
|
6
|
+
import {
|
7
|
+
CurrentLimitsData,
|
8
|
+
UserDto,
|
9
|
+
UsersStatisticsResponse
|
10
|
+
} from "../../dto/userInfoResponse"
|
7
11
|
import { GroupId } from "../groups/group"
|
8
12
|
import { StatisticsResponse } from "../../dto/statisticsResponse"
|
9
13
|
import { SegmentData } from "../../dto/limitsResponse"
|
14
|
+
import { Acquiring } from "../acquirings/acquiring"
|
10
15
|
|
11
16
|
/**
|
12
17
|
* Organization event.
|
@@ -59,28 +64,25 @@ export abstract class Organization extends EventDispatcher<
|
|
59
64
|
|
60
65
|
/**
|
61
66
|
* Get organization statistics
|
62
|
-
* @param dateFrom
|
63
|
-
* @param dateTo
|
67
|
+
* @param dateFrom
|
68
|
+
* @param dateTo
|
64
69
|
*/
|
65
70
|
abstract statistics(dateFrom: number, dateTo: number): Promise<StatisticsResponse>
|
66
71
|
|
67
|
-
|
68
72
|
/**
|
69
73
|
* Get organization statistics
|
70
|
-
* @param dateFrom
|
71
|
-
* @param dateTo
|
74
|
+
* @param dateFrom
|
75
|
+
* @param dateTo
|
72
76
|
*/
|
73
77
|
abstract membersStatistics(dateFrom: number, dateTo: number): Promise<UsersStatisticsResponse>
|
74
78
|
|
75
|
-
|
76
79
|
/**
|
77
80
|
* Get statistics for user
|
78
|
-
* @param dateFrom
|
79
|
-
* @param dateTo
|
81
|
+
* @param dateFrom
|
82
|
+
* @param dateTo
|
80
83
|
*/
|
81
84
|
abstract userStatistic(userid: string, dateFrom: number, dateTo: number): Promise<StatisticsResponse>
|
82
85
|
|
83
|
-
|
84
86
|
/**
|
85
87
|
* Get user limits data
|
86
88
|
*/
|
@@ -102,7 +104,7 @@ export abstract class Organization extends EventDispatcher<
|
|
102
104
|
abstract change(name: string, description: string): Promise<void>
|
103
105
|
|
104
106
|
/**
|
105
|
-
* Invite users with given emails to organization
|
107
|
+
* Invite users with given emails to organization
|
106
108
|
*/
|
107
109
|
abstract inviteUsers(emails: string[], accessGroups: GroupId[]): Promise<void>
|
108
110
|
|
@@ -115,4 +117,9 @@ export abstract class Organization extends EventDispatcher<
|
|
115
117
|
* Validate invite code for user
|
116
118
|
*/
|
117
119
|
abstract validateInviteCode(code: string): Promise<void>
|
120
|
+
|
121
|
+
/**
|
122
|
+
* Acquiring
|
123
|
+
*/
|
124
|
+
abstract get acquiring(): Acquiring
|
118
125
|
}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { Service } from "./service";
|
2
|
-
import { AcquiringPlansResponse, CreateOrederData as CreateOrderData, UserAcquiringPlan } from "../dto/acquiringResponse";
|
3
|
-
export declare class AcquiringService extends Service {
|
4
|
-
createOrder(key: string): Promise<CreateOrderData>;
|
5
|
-
getPlans(): Promise<AcquiringPlansResponse>;
|
6
|
-
getUserPlan(): Promise<UserAcquiringPlan>;
|
7
|
-
}
|
8
|
-
//# sourceMappingURL=acquiringService.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"acquiringService.d.ts","sourceRoot":"","sources":["../../../src/services/acquiringService.ts"],"names":[],"mappings":"AA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AI,6BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAA;QAC3E,CAAC;QAED,MAAM,OAAO,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA2B,CAAA;QAEjE,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,KAAK,CAAC,WAAW;QACf,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,uBAAU,CAAe,CAAA;QAClD,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,oCAAoC,CAAC,CAAC,OAAO,EAAE,CAAA;QAEzF,IAAI,6BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAAC,iCAAiC,EAAE,QAAQ,CAAC,CAAA;QAC7E,CAAC;QAED,MAAM,OAAO,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAsB,CAAA;QAE5D,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AA5CD,4CA4CC"}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
import { Service } from "./service"
|
2
|
-
import { RpcService } from "./rpcService"
|
3
|
-
import { ResponseUtils } from "./responseUtils"
|
4
|
-
import { AcquiringPlansResponse, CreateOrderResponse, CreateOrederData as CreateOrderData, UserAcquiringPlan } from "../dto/acquiringResponse"
|
5
|
-
|
6
|
-
export class AcquiringService extends Service {
|
7
|
-
|
8
|
-
async createOrder(key: string): Promise<CreateOrderData>{
|
9
|
-
const rpc = this.resolve(RpcService) as RpcService
|
10
|
-
const response = await rpc.requestBuilder("api/v1/Acquiring/order")
|
11
|
-
.sendPostJson({
|
12
|
-
key: key
|
13
|
-
})
|
14
|
-
|
15
|
-
if (ResponseUtils.isFail(response)) {
|
16
|
-
await ResponseUtils.throwError("Failed to create order", response)
|
17
|
-
}
|
18
|
-
|
19
|
-
|
20
|
-
const order = (await response.json()) as CreateOrderResponse
|
21
|
-
|
22
|
-
return order.data
|
23
|
-
}
|
24
|
-
|
25
|
-
async getPlans(): Promise<AcquiringPlansResponse> {
|
26
|
-
const rpc = this.resolve(RpcService) as RpcService
|
27
|
-
const response = await rpc.requestBuilder("api/v1/Acquiring/plans").sendGet()
|
28
|
-
|
29
|
-
if (ResponseUtils.isFail(response)) {
|
30
|
-
await ResponseUtils.throwError("Failed to get acquiring plans", response)
|
31
|
-
}
|
32
|
-
|
33
|
-
const content = (await response.json()) as AcquiringPlansResponse
|
34
|
-
|
35
|
-
return content
|
36
|
-
}
|
37
|
-
|
38
|
-
async getUserPlan(): Promise<UserAcquiringPlan> {
|
39
|
-
const rpc = this.resolve(RpcService) as RpcService
|
40
|
-
const response = await rpc.requestBuilder("api/v1/Acquiring/user/subscription").sendGet()
|
41
|
-
|
42
|
-
if (ResponseUtils.isFail(response)) {
|
43
|
-
await ResponseUtils.throwError("Failed to get user subscription", response)
|
44
|
-
}
|
45
|
-
|
46
|
-
const content = (await response.json()) as UserAcquiringPlan
|
47
|
-
|
48
|
-
return content
|
49
|
-
}
|
50
|
-
}
|