ggez-banking-sdk 0.3.23 → 0.3.25
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/api/api.d.ts +29 -0
- package/dist/api/api.js +95 -0
- package/dist/api/clients/account.d.ts +2 -2
- package/dist/api/clients/account.js +4 -4
- package/dist/api/clients/auth.d.ts +4 -4
- package/dist/api/clients/auth.js +8 -8
- package/dist/api/clients/blockchain.d.ts +4 -4
- package/dist/api/clients/blockchain.js +8 -8
- package/dist/api/clients/ipAddressAndLocation.d.ts +3 -3
- package/dist/api/clients/ipAddressAndLocation.js +3 -3
- package/dist/api/clients/limited.d.ts +9 -9
- package/dist/api/clients/limited.js +24 -20
- package/dist/api/clients/order.d.ts +1 -1
- package/dist/api/clients/order.js +3 -3
- package/dist/api/clients/organization.d.ts +5 -5
- package/dist/api/clients/organization.js +10 -10
- package/dist/api/clients/program.d.ts +3 -3
- package/dist/api/clients/program.js +6 -6
- package/dist/api/clients/promotion.d.ts +3 -3
- package/dist/api/clients/promotion.js +4 -4
- package/dist/api/clients/transaction.d.ts +4 -4
- package/dist/api/clients/transaction.js +8 -8
- package/dist/api/clients/user.d.ts +76 -76
- package/dist/api/clients/user.js +155 -153
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/services/organization.d.ts +0 -1
- package/dist/api/services/organization.js +0 -1
- package/dist/api/services/user.d.ts +0 -1
- package/dist/api/services/user.js +0 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/api/client/clientData.d.ts +12 -0
- package/dist/types/api/client/index.d.ts +1 -0
- package/dist/types/banking/program/bin/index.d.ts +1 -1
- package/dist/types/banking/program/bin/supportedCountriesExtended.d.ts +12 -0
- package/dist/types/banking/program/bin/supportedCountriesExtended.js +1 -0
- package/package.json +1 -1
- package/dist/types/banking/program/bin/SupportedCountriesExtended.d.ts +0 -12
- /package/dist/types/{banking/program/bin/SupportedCountriesExtended.js → api/client/clientData.js} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AccountClient, AuthClient, BlockchainClient, ClientData, ErrorHandler, IPAddressAndLocationClient, LimitedClient, OrderClient, OrganizationClient, ProgramClient, PromotionClient, TransactionClient, UserClient } from "..";
|
|
2
|
+
declare class API {
|
|
3
|
+
private _account;
|
|
4
|
+
private _auth;
|
|
5
|
+
private _blockchain;
|
|
6
|
+
private _ipAddress;
|
|
7
|
+
private _limited;
|
|
8
|
+
private _order;
|
|
9
|
+
private _organization;
|
|
10
|
+
private _program;
|
|
11
|
+
private _promotion;
|
|
12
|
+
private _transaction;
|
|
13
|
+
private _user;
|
|
14
|
+
private errorHandler;
|
|
15
|
+
private clientData;
|
|
16
|
+
constructor(clientData: ClientData, errorHandler: ErrorHandler);
|
|
17
|
+
get account(): AccountClient;
|
|
18
|
+
get auth(): AuthClient;
|
|
19
|
+
get blockchain(): BlockchainClient;
|
|
20
|
+
get ipAddress(): IPAddressAndLocationClient;
|
|
21
|
+
get limited(): LimitedClient;
|
|
22
|
+
get order(): OrderClient;
|
|
23
|
+
get organization(): OrganizationClient;
|
|
24
|
+
get program(): ProgramClient;
|
|
25
|
+
get promotion(): PromotionClient;
|
|
26
|
+
get transaction(): TransactionClient;
|
|
27
|
+
get user(): UserClient;
|
|
28
|
+
}
|
|
29
|
+
export { API };
|
package/dist/api/api.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { AccountClient, AuthClient, BlockchainClient, IPAddressAndLocationClient, LimitedClient, OrderClient, OrganizationClient, ProgramClient, PromotionClient, TransactionClient, UserClient, } from "..";
|
|
2
|
+
class API {
|
|
3
|
+
// #region "Properties"
|
|
4
|
+
_account = null;
|
|
5
|
+
_auth = null;
|
|
6
|
+
_blockchain = null;
|
|
7
|
+
_ipAddress = null;
|
|
8
|
+
_limited = null;
|
|
9
|
+
_order = null;
|
|
10
|
+
_organization = null;
|
|
11
|
+
_program = null;
|
|
12
|
+
_promotion = null;
|
|
13
|
+
_transaction = null;
|
|
14
|
+
_user = null;
|
|
15
|
+
errorHandler;
|
|
16
|
+
clientData;
|
|
17
|
+
// #endregion
|
|
18
|
+
// #region "Constructor"
|
|
19
|
+
constructor(clientData, errorHandler) {
|
|
20
|
+
this.errorHandler = errorHandler;
|
|
21
|
+
this.clientData = clientData;
|
|
22
|
+
}
|
|
23
|
+
// #endregion
|
|
24
|
+
// #region "Clients"
|
|
25
|
+
get account() {
|
|
26
|
+
if (!this._account) {
|
|
27
|
+
this._account = new AccountClient(this.clientData, this.errorHandler);
|
|
28
|
+
}
|
|
29
|
+
return this._account;
|
|
30
|
+
}
|
|
31
|
+
get auth() {
|
|
32
|
+
if (!this._auth) {
|
|
33
|
+
this._auth = new AuthClient(this.clientData, this.errorHandler);
|
|
34
|
+
}
|
|
35
|
+
return this._auth;
|
|
36
|
+
}
|
|
37
|
+
get blockchain() {
|
|
38
|
+
if (!this._blockchain) {
|
|
39
|
+
this._blockchain = new BlockchainClient(this.clientData, this.errorHandler);
|
|
40
|
+
}
|
|
41
|
+
return this._blockchain;
|
|
42
|
+
}
|
|
43
|
+
get ipAddress() {
|
|
44
|
+
if (!this._ipAddress) {
|
|
45
|
+
this._ipAddress = new IPAddressAndLocationClient(this.clientData, this.errorHandler);
|
|
46
|
+
}
|
|
47
|
+
return this._ipAddress;
|
|
48
|
+
}
|
|
49
|
+
get limited() {
|
|
50
|
+
if (!this._limited) {
|
|
51
|
+
this._limited = new LimitedClient(this.clientData, this.errorHandler);
|
|
52
|
+
}
|
|
53
|
+
return this._limited;
|
|
54
|
+
}
|
|
55
|
+
get order() {
|
|
56
|
+
if (!this._order) {
|
|
57
|
+
this._order = new OrderClient(this.clientData, this.errorHandler);
|
|
58
|
+
}
|
|
59
|
+
return this._order;
|
|
60
|
+
}
|
|
61
|
+
get organization() {
|
|
62
|
+
if (!this._organization) {
|
|
63
|
+
this._organization = new OrganizationClient(this.clientData, this.errorHandler);
|
|
64
|
+
}
|
|
65
|
+
return this._organization;
|
|
66
|
+
}
|
|
67
|
+
get program() {
|
|
68
|
+
if (!this._program) {
|
|
69
|
+
this._program = new ProgramClient(this.clientData, this.errorHandler);
|
|
70
|
+
}
|
|
71
|
+
return this._program;
|
|
72
|
+
}
|
|
73
|
+
get promotion() {
|
|
74
|
+
if (!this._promotion) {
|
|
75
|
+
this._promotion = new PromotionClient(this.clientData, this.errorHandler);
|
|
76
|
+
}
|
|
77
|
+
return this._promotion;
|
|
78
|
+
}
|
|
79
|
+
get transaction() {
|
|
80
|
+
if (!this._transaction) {
|
|
81
|
+
this._transaction = new TransactionClient(this.clientData, this.errorHandler);
|
|
82
|
+
}
|
|
83
|
+
return this._transaction;
|
|
84
|
+
}
|
|
85
|
+
get user() {
|
|
86
|
+
if (!this._user) {
|
|
87
|
+
this._user = new UserClient(this.clientData, this.errorHandler);
|
|
88
|
+
}
|
|
89
|
+
return this._user;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const api = new API({}, (error) => {
|
|
93
|
+
console.error("API Error:", error);
|
|
94
|
+
});
|
|
95
|
+
export { API };
|
|
@@ -4,13 +4,13 @@ import { BaseClient } from "./base";
|
|
|
4
4
|
declare class AccountClient extends BaseClient {
|
|
5
5
|
private accountService;
|
|
6
6
|
constructor(clientData: AccountClientData, errorHandler: ErrorHandler);
|
|
7
|
-
|
|
7
|
+
get: (accountId: number, options?: RequestOptions) => Promise<{
|
|
8
8
|
data: import("../..").AccountData;
|
|
9
9
|
success: boolean;
|
|
10
10
|
message: string;
|
|
11
11
|
error: any;
|
|
12
12
|
}>;
|
|
13
|
-
|
|
13
|
+
getLimits: (accountId: number, options?: RequestOptions) => Promise<{
|
|
14
14
|
data: import("../..").AccountData;
|
|
15
15
|
success: boolean;
|
|
16
16
|
message: string;
|
|
@@ -11,7 +11,7 @@ class AccountClient extends BaseClient {
|
|
|
11
11
|
this.accountService = new AccountService({ config, userId });
|
|
12
12
|
}
|
|
13
13
|
// #region "GET"
|
|
14
|
-
|
|
14
|
+
get = async (accountId, options) => {
|
|
15
15
|
try {
|
|
16
16
|
const response = await this.accountService.get(accountId, options);
|
|
17
17
|
return this.responseHelper.GetResponse(response.data);
|
|
@@ -19,10 +19,10 @@ class AccountClient extends BaseClient {
|
|
|
19
19
|
catch (error) {
|
|
20
20
|
const result = FillResultByError(error);
|
|
21
21
|
const accountData = CreateDefaultAccountData({ result });
|
|
22
|
-
return this.responseHelper.GetErrorResponse(accountData, "
|
|
22
|
+
return this.responseHelper.GetErrorResponse(accountData, "get");
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
getLimits = async (accountId, options) => {
|
|
26
26
|
try {
|
|
27
27
|
const response = await this.accountService.getLimits(accountId, options);
|
|
28
28
|
return this.responseHelper.GetResponse(response.data);
|
|
@@ -30,7 +30,7 @@ class AccountClient extends BaseClient {
|
|
|
30
30
|
catch (error) {
|
|
31
31
|
const result = FillResultByError(error);
|
|
32
32
|
const accountData = CreateDefaultAccountData({ result });
|
|
33
|
-
return this.responseHelper.GetErrorResponse(accountData, "
|
|
33
|
+
return this.responseHelper.GetErrorResponse(accountData, "getLimits");
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -4,25 +4,25 @@ declare class AuthClient extends BaseClient {
|
|
|
4
4
|
private programId;
|
|
5
5
|
private authService;
|
|
6
6
|
constructor(clientData: AuthClientData, errorHandler: ErrorHandler);
|
|
7
|
-
|
|
7
|
+
loginUserCredentials: (data: ILoginUserCredentialsData, options?: RequestOptions) => Promise<{
|
|
8
8
|
data: import("../../types").TokenData;
|
|
9
9
|
success: boolean;
|
|
10
10
|
message: string;
|
|
11
11
|
error: any;
|
|
12
12
|
}>;
|
|
13
|
-
|
|
13
|
+
loginDeviceCredentials: (data: ILoginDeviceCredentialsData, options?: RequestOptions) => Promise<{
|
|
14
14
|
data: import("../../types").TokenData;
|
|
15
15
|
success: boolean;
|
|
16
16
|
message: string;
|
|
17
17
|
error: any;
|
|
18
18
|
}>;
|
|
19
|
-
|
|
19
|
+
loginGoogleCredentials: (data: ILoginGoogleCredentialsData, options?: RequestOptions) => Promise<{
|
|
20
20
|
data: import("../../types").TokenData;
|
|
21
21
|
success: boolean;
|
|
22
22
|
message: string;
|
|
23
23
|
error: any;
|
|
24
24
|
}>;
|
|
25
|
-
|
|
25
|
+
generateLimitedToken: (data: IGenerateLimitedTokenData, options?: RequestOptions) => Promise<{
|
|
26
26
|
data: import("../../types").TokenData;
|
|
27
27
|
success: boolean;
|
|
28
28
|
message: string;
|
package/dist/api/clients/auth.js
CHANGED
|
@@ -13,7 +13,7 @@ class AuthClient extends BaseClient {
|
|
|
13
13
|
this.programId = programId;
|
|
14
14
|
}
|
|
15
15
|
// #region "POST"
|
|
16
|
-
|
|
16
|
+
loginUserCredentials = async (data, options) => {
|
|
17
17
|
try {
|
|
18
18
|
const credentialsData = FillLoginUserCredentialsData(this.programId, data);
|
|
19
19
|
const response = await this.authService.login(credentialsData, options);
|
|
@@ -23,10 +23,10 @@ class AuthClient extends BaseClient {
|
|
|
23
23
|
catch (error) {
|
|
24
24
|
const result = FillResultByError(error);
|
|
25
25
|
const tokenData = CreateDefaultTokenData({ result });
|
|
26
|
-
return this.responseHelper.GetErrorResponse(tokenData, "
|
|
26
|
+
return this.responseHelper.GetErrorResponse(tokenData, "loginUserCredentials");
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
loginDeviceCredentials = async (data, options) => {
|
|
30
30
|
try {
|
|
31
31
|
const credentialsData = FillLoginDeviceCredentialsData(this.programId, data);
|
|
32
32
|
const response = await this.authService.login(credentialsData, options);
|
|
@@ -36,10 +36,10 @@ class AuthClient extends BaseClient {
|
|
|
36
36
|
catch (error) {
|
|
37
37
|
const result = FillResultByError(error);
|
|
38
38
|
const tokenData = CreateDefaultTokenData({ result });
|
|
39
|
-
return this.responseHelper.GetErrorResponse(tokenData, "
|
|
39
|
+
return this.responseHelper.GetErrorResponse(tokenData, "loginDeviceCredentials");
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
loginGoogleCredentials = async (data, options) => {
|
|
43
43
|
try {
|
|
44
44
|
const credentialsData = FillLoginGoogleCredentialsData(this.programId, data);
|
|
45
45
|
const response = await this.authService.login(credentialsData, options);
|
|
@@ -49,10 +49,10 @@ class AuthClient extends BaseClient {
|
|
|
49
49
|
catch (error) {
|
|
50
50
|
const result = FillResultByError(error);
|
|
51
51
|
const tokenData = CreateDefaultTokenData({ result });
|
|
52
|
-
return this.responseHelper.GetErrorResponse(tokenData, "
|
|
52
|
+
return this.responseHelper.GetErrorResponse(tokenData, "loginGoogleCredentials");
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
generateLimitedToken = async (data, options) => {
|
|
56
56
|
try {
|
|
57
57
|
const tokenData = FillGenerateLimitedTokenData(data);
|
|
58
58
|
const response = await this.authService.generateLimitedToken(tokenData, options);
|
|
@@ -62,7 +62,7 @@ class AuthClient extends BaseClient {
|
|
|
62
62
|
catch (error) {
|
|
63
63
|
const result = FillResultByError(error);
|
|
64
64
|
const tokenData = CreateDefaultTokenData({ result });
|
|
65
|
-
return this.responseHelper.GetErrorResponse(tokenData, "
|
|
65
|
+
return this.responseHelper.GetErrorResponse(tokenData, "generateLimitedToken");
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
}
|
|
@@ -3,25 +3,25 @@ import { BaseClient } from "./base";
|
|
|
3
3
|
declare class BlockchainClient extends BaseClient {
|
|
4
4
|
private blockchainService;
|
|
5
5
|
constructor(clientData: BlockchainClientData, errorHandler: ErrorHandler);
|
|
6
|
-
|
|
6
|
+
send: (data: IBlockchainSendRequestData, options?: RequestOptions) => Promise<{
|
|
7
7
|
data: import("../../types").BlockchainData;
|
|
8
8
|
success: boolean;
|
|
9
9
|
message: string;
|
|
10
10
|
error: any;
|
|
11
11
|
}>;
|
|
12
|
-
|
|
12
|
+
multiSend: (data: IBlockchainMultiSendRequestData, options?: RequestOptions) => Promise<{
|
|
13
13
|
data: import("../../types").BlockchainData;
|
|
14
14
|
success: boolean;
|
|
15
15
|
message: string;
|
|
16
16
|
error: any;
|
|
17
17
|
}>;
|
|
18
|
-
|
|
18
|
+
delegate: (data: IBlockchainDelegateRequestData, options?: RequestOptions) => Promise<{
|
|
19
19
|
data: import("../../types").BlockchainData;
|
|
20
20
|
success: boolean;
|
|
21
21
|
message: string;
|
|
22
22
|
error: any;
|
|
23
23
|
}>;
|
|
24
|
-
|
|
24
|
+
undelegate: (data: IBlockchainUndelegateRequestData, options?: RequestOptions) => Promise<{
|
|
25
25
|
data: import("../../types").BlockchainData;
|
|
26
26
|
success: boolean;
|
|
27
27
|
message: string;
|
|
@@ -11,7 +11,7 @@ class BlockchainClient extends BaseClient {
|
|
|
11
11
|
this.blockchainService = new BlockchainService({ config, userId });
|
|
12
12
|
}
|
|
13
13
|
// #region "POST"
|
|
14
|
-
|
|
14
|
+
send = async (data, options) => {
|
|
15
15
|
try {
|
|
16
16
|
const blockchainSendData = FillBlockchainSendData(data);
|
|
17
17
|
const response = await this.blockchainService.send(blockchainSendData, options);
|
|
@@ -20,10 +20,10 @@ class BlockchainClient extends BaseClient {
|
|
|
20
20
|
catch (error) {
|
|
21
21
|
const result = FillResultByError(error);
|
|
22
22
|
const blockchainData = CreateDefaultBlockchainData({ result });
|
|
23
|
-
return this.responseHelper.GetErrorResponse(blockchainData, "
|
|
23
|
+
return this.responseHelper.GetErrorResponse(blockchainData, "send");
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
multiSend = async (data, options) => {
|
|
27
27
|
try {
|
|
28
28
|
const blockchainMultiSendData = FillBlockchainMultiSendData(data);
|
|
29
29
|
const response = await this.blockchainService.multiSend(blockchainMultiSendData, options);
|
|
@@ -32,10 +32,10 @@ class BlockchainClient extends BaseClient {
|
|
|
32
32
|
catch (error) {
|
|
33
33
|
const result = FillResultByError(error);
|
|
34
34
|
const blockchainData = CreateDefaultBlockchainData({ result });
|
|
35
|
-
return this.responseHelper.GetErrorResponse(blockchainData, "
|
|
35
|
+
return this.responseHelper.GetErrorResponse(blockchainData, "multiSend");
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
|
|
38
|
+
delegate = async (data, options) => {
|
|
39
39
|
try {
|
|
40
40
|
const blockchainDelegateData = FillBlockchainDelegateData(data);
|
|
41
41
|
const response = await this.blockchainService.delegate(blockchainDelegateData, options);
|
|
@@ -44,10 +44,10 @@ class BlockchainClient extends BaseClient {
|
|
|
44
44
|
catch (error) {
|
|
45
45
|
const result = FillResultByError(error);
|
|
46
46
|
const blockchainData = CreateDefaultBlockchainData({ result });
|
|
47
|
-
return this.responseHelper.GetErrorResponse(blockchainData, "
|
|
47
|
+
return this.responseHelper.GetErrorResponse(blockchainData, "delegate");
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
undelegate = async (data, options) => {
|
|
51
51
|
try {
|
|
52
52
|
const blockchainUndelegateData = FillBlockchainUndelegateData(data);
|
|
53
53
|
const response = await this.blockchainService.undelegate(blockchainUndelegateData, options);
|
|
@@ -56,7 +56,7 @@ class BlockchainClient extends BaseClient {
|
|
|
56
56
|
catch (error) {
|
|
57
57
|
const result = FillResultByError(error);
|
|
58
58
|
const blockchainData = CreateDefaultBlockchainData({ result });
|
|
59
|
-
return this.responseHelper.GetErrorResponse(blockchainData, "
|
|
59
|
+
return this.responseHelper.GetErrorResponse(blockchainData, "undelegate");
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
}
|
|
@@ -3,13 +3,13 @@ import { BaseClient } from "./base";
|
|
|
3
3
|
declare class IPAddressAndLocationClient extends BaseClient {
|
|
4
4
|
private ipAddressAndLocationService;
|
|
5
5
|
constructor(clientData: IPAddressAndLocationClientData, errorHandler: ErrorHandler);
|
|
6
|
-
|
|
6
|
+
getGeoCoordinates: () => Promise<import("../../types").GeoCoordinates> | {
|
|
7
7
|
latitude: number;
|
|
8
8
|
longitude: number;
|
|
9
9
|
position_description: string;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
getIPAddress: () => Promise<string> | "";
|
|
12
|
+
getGeoCoordinatesAndIPAddress: () => Promise<{
|
|
13
13
|
geo_coordinates: import("../../types").GeoCoordinates;
|
|
14
14
|
ip_address: string;
|
|
15
15
|
}> | {
|
|
@@ -14,7 +14,7 @@ class IPAddressAndLocationClient extends BaseClient {
|
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
// #region "GET"
|
|
17
|
-
|
|
17
|
+
getGeoCoordinates = () => {
|
|
18
18
|
try {
|
|
19
19
|
return GeoHelper.GetGeoCoordinates(this.ipAddressAndLocationService);
|
|
20
20
|
}
|
|
@@ -22,7 +22,7 @@ class IPAddressAndLocationClient extends BaseClient {
|
|
|
22
22
|
return { latitude: 0, longitude: 0, position_description: "N/A, N/A" };
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
getIPAddress = () => {
|
|
26
26
|
try {
|
|
27
27
|
return GeoHelper.GetIPAddress(this.ipAddressAndLocationService);
|
|
28
28
|
}
|
|
@@ -30,7 +30,7 @@ class IPAddressAndLocationClient extends BaseClient {
|
|
|
30
30
|
return "";
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
getGeoCoordinatesAndIPAddress = () => {
|
|
34
34
|
try {
|
|
35
35
|
return GeoHelper.GetGeoCoordinatesAndIPAddress(this.ipAddressAndLocationService);
|
|
36
36
|
}
|
|
@@ -3,55 +3,55 @@ import { BaseClient } from "./base";
|
|
|
3
3
|
declare class LimitedClient extends BaseClient {
|
|
4
4
|
private limitedService;
|
|
5
5
|
constructor(clientData: LimitedClientData, errorHandler: ErrorHandler);
|
|
6
|
-
|
|
6
|
+
checkForgetPassword: (data: ICheckForgetPasswordData, options?: RequestOptions) => Promise<{
|
|
7
7
|
data: import("../../types").ForgetSecurityData;
|
|
8
8
|
success: boolean;
|
|
9
9
|
message: string;
|
|
10
10
|
error: any;
|
|
11
11
|
}>;
|
|
12
|
-
|
|
12
|
+
validateForgetPassword: (data: IValidateForgetPasswordData, options?: RequestOptions) => Promise<{
|
|
13
13
|
data: import("../../types").ForgetSecurityData;
|
|
14
14
|
success: boolean;
|
|
15
15
|
message: string;
|
|
16
16
|
error: any;
|
|
17
17
|
}>;
|
|
18
|
-
|
|
18
|
+
confirmForgetPassword: (data: IConfirmForgetPasswordData, options?: RequestOptions) => Promise<{
|
|
19
19
|
data: import("../../types").ForgetSecurityData;
|
|
20
20
|
success: boolean;
|
|
21
21
|
message: string;
|
|
22
22
|
error: any;
|
|
23
23
|
}>;
|
|
24
|
-
|
|
24
|
+
validateEmail: (data: IValidateEmailData, options?: RequestOptions) => Promise<{
|
|
25
25
|
data: import("../../types").ValidateLimitedSecurity;
|
|
26
26
|
success: boolean;
|
|
27
27
|
message: string;
|
|
28
28
|
error: any;
|
|
29
29
|
}>;
|
|
30
|
-
|
|
30
|
+
validatePhone: (data: IValidatePhoneData, options?: RequestOptions) => Promise<{
|
|
31
31
|
data: import("../../types").ValidateLimitedSecurity;
|
|
32
32
|
success: boolean;
|
|
33
33
|
message: string;
|
|
34
34
|
error: any;
|
|
35
35
|
}>;
|
|
36
|
-
|
|
36
|
+
verifyEmail: (data: IVerifyEmailData, options?: RequestOptions) => Promise<{
|
|
37
37
|
data: import("../../types").VerifyUserSecurity;
|
|
38
38
|
success: boolean;
|
|
39
39
|
message: string;
|
|
40
40
|
error: any;
|
|
41
41
|
}>;
|
|
42
|
-
|
|
42
|
+
verifyPhone: (data: IVerifyPhoneData, options?: RequestOptions) => Promise<{
|
|
43
43
|
data: import("../../types").VerifyUserSecurity;
|
|
44
44
|
success: boolean;
|
|
45
45
|
message: string;
|
|
46
46
|
error: any;
|
|
47
47
|
}>;
|
|
48
|
-
|
|
48
|
+
confirmEmail: (data: IConfirmEmailData, options?: RequestOptions) => Promise<{
|
|
49
49
|
data: import("../../types").ConfirmUserSecurity;
|
|
50
50
|
success: boolean;
|
|
51
51
|
message: string;
|
|
52
52
|
error: any;
|
|
53
53
|
}>;
|
|
54
|
-
|
|
54
|
+
confirmPhone: (data: IConfirmPhoneData, options?: RequestOptions) => Promise<{
|
|
55
55
|
data: import("../../types").ConfirmUserSecurity;
|
|
56
56
|
success: boolean;
|
|
57
57
|
message: string;
|
|
@@ -15,7 +15,7 @@ class LimitedClient extends BaseClient {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
// #region "POST"
|
|
18
|
-
|
|
18
|
+
checkForgetPassword = async (data, options) => {
|
|
19
19
|
try {
|
|
20
20
|
const forgetSecurityData = FillCheckForgetPasswordData(data);
|
|
21
21
|
const response = await this.limitedService.checkForgetSecurityData(forgetSecurityData, options);
|
|
@@ -24,10 +24,10 @@ class LimitedClient extends BaseClient {
|
|
|
24
24
|
catch (error) {
|
|
25
25
|
const result = FillResultByError(error);
|
|
26
26
|
const forgetSecurityData = CreateDefaultForgetSecurityData({ result });
|
|
27
|
-
return this.responseHelper.GetErrorResponse(forgetSecurityData, "
|
|
27
|
+
return this.responseHelper.GetErrorResponse(forgetSecurityData, "checkForgetPassword");
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
validateForgetPassword = async (data, options) => {
|
|
31
31
|
try {
|
|
32
32
|
const forgetSecurityData = FillValidateForgetPasswordData(data);
|
|
33
33
|
const response = await this.limitedService.validateForgetSecurityData(forgetSecurityData, options);
|
|
@@ -36,10 +36,10 @@ class LimitedClient extends BaseClient {
|
|
|
36
36
|
catch (error) {
|
|
37
37
|
const result = FillResultByError(error);
|
|
38
38
|
const forgetSecurityData = CreateDefaultForgetSecurityData({ result });
|
|
39
|
-
return this.responseHelper.GetErrorResponse(forgetSecurityData, "
|
|
39
|
+
return this.responseHelper.GetErrorResponse(forgetSecurityData, "validateForgetPassword");
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
confirmForgetPassword = async (data, options) => {
|
|
43
43
|
try {
|
|
44
44
|
const forgetSecurityData = FillConfirmForgetPasswordData(data);
|
|
45
45
|
const response = await this.limitedService.confirmForgetSecurityData(forgetSecurityData, options);
|
|
@@ -48,10 +48,10 @@ class LimitedClient extends BaseClient {
|
|
|
48
48
|
catch (error) {
|
|
49
49
|
const result = FillResultByError(error);
|
|
50
50
|
const forgetSecurityData = CreateDefaultForgetSecurityData({ result });
|
|
51
|
-
return this.responseHelper.GetErrorResponse(forgetSecurityData, "
|
|
51
|
+
return this.responseHelper.GetErrorResponse(forgetSecurityData, "confirmForgetPassword");
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
|
|
54
|
+
validateEmail = async (data, options) => {
|
|
55
55
|
try {
|
|
56
56
|
const validateLimitedSecurity = FillValidateEmailData(data);
|
|
57
57
|
const response = await this.limitedService.validateSecurityData(validateLimitedSecurity, options);
|
|
@@ -59,11 +59,13 @@ class LimitedClient extends BaseClient {
|
|
|
59
59
|
}
|
|
60
60
|
catch (error) {
|
|
61
61
|
const result = FillResultByError(error);
|
|
62
|
-
const forgetSecurityData = CreateDefaultValidateLimitedSecurity({
|
|
63
|
-
|
|
62
|
+
const forgetSecurityData = CreateDefaultValidateLimitedSecurity({
|
|
63
|
+
result,
|
|
64
|
+
});
|
|
65
|
+
return this.responseHelper.GetErrorResponse(forgetSecurityData, "validateEmail");
|
|
64
66
|
}
|
|
65
67
|
};
|
|
66
|
-
|
|
68
|
+
validatePhone = async (data, options) => {
|
|
67
69
|
try {
|
|
68
70
|
const validateLimitedSecurity = FillValidatePhoneData(data);
|
|
69
71
|
const response = await this.limitedService.validateSecurityData(validateLimitedSecurity, options);
|
|
@@ -71,11 +73,13 @@ class LimitedClient extends BaseClient {
|
|
|
71
73
|
}
|
|
72
74
|
catch (error) {
|
|
73
75
|
const result = FillResultByError(error);
|
|
74
|
-
const forgetSecurityData = CreateDefaultValidateLimitedSecurity({
|
|
75
|
-
|
|
76
|
+
const forgetSecurityData = CreateDefaultValidateLimitedSecurity({
|
|
77
|
+
result,
|
|
78
|
+
});
|
|
79
|
+
return this.responseHelper.GetErrorResponse(forgetSecurityData, "validatePhone");
|
|
76
80
|
}
|
|
77
81
|
};
|
|
78
|
-
|
|
82
|
+
verifyEmail = async (data, options) => {
|
|
79
83
|
try {
|
|
80
84
|
const verifyUserSecurity = FillVerifyEmailData(data);
|
|
81
85
|
const response = await this.limitedService.verifySecurityData(verifyUserSecurity, options);
|
|
@@ -84,10 +88,10 @@ class LimitedClient extends BaseClient {
|
|
|
84
88
|
catch (error) {
|
|
85
89
|
const result = FillResultByError(error);
|
|
86
90
|
const verifySecurityData = CreateDefaultVerifyUserSecurity({ result });
|
|
87
|
-
return this.responseHelper.GetErrorResponse(verifySecurityData, "
|
|
91
|
+
return this.responseHelper.GetErrorResponse(verifySecurityData, "verifyEmail");
|
|
88
92
|
}
|
|
89
93
|
};
|
|
90
|
-
|
|
94
|
+
verifyPhone = async (data, options) => {
|
|
91
95
|
try {
|
|
92
96
|
const verifyUserSecurity = FillVerifyPhoneData(data);
|
|
93
97
|
const response = await this.limitedService.verifySecurityData(verifyUserSecurity, options);
|
|
@@ -96,10 +100,10 @@ class LimitedClient extends BaseClient {
|
|
|
96
100
|
catch (error) {
|
|
97
101
|
const result = FillResultByError(error);
|
|
98
102
|
const verifySecurityData = CreateDefaultVerifyUserSecurity({ result });
|
|
99
|
-
return this.responseHelper.GetErrorResponse(verifySecurityData, "
|
|
103
|
+
return this.responseHelper.GetErrorResponse(verifySecurityData, "verifyPhone");
|
|
100
104
|
}
|
|
101
105
|
};
|
|
102
|
-
|
|
106
|
+
confirmEmail = async (data, options) => {
|
|
103
107
|
try {
|
|
104
108
|
const confirmUserSecurity = FillConfirmEmailData(data);
|
|
105
109
|
const response = await this.limitedService.confirmSecurityData(confirmUserSecurity, options);
|
|
@@ -108,10 +112,10 @@ class LimitedClient extends BaseClient {
|
|
|
108
112
|
catch (error) {
|
|
109
113
|
const result = FillResultByError(error);
|
|
110
114
|
const confirmUserSecurity = CreateDefaultConfirmUserSecurity({ result });
|
|
111
|
-
return this.responseHelper.GetErrorResponse(confirmUserSecurity, "
|
|
115
|
+
return this.responseHelper.GetErrorResponse(confirmUserSecurity, "confirmEmail");
|
|
112
116
|
}
|
|
113
117
|
};
|
|
114
|
-
|
|
118
|
+
confirmPhone = async (data, options) => {
|
|
115
119
|
try {
|
|
116
120
|
const confirmUserSecurity = FillConfirmPhoneData(data);
|
|
117
121
|
const response = await this.limitedService.confirmSecurityData(confirmUserSecurity, options);
|
|
@@ -120,7 +124,7 @@ class LimitedClient extends BaseClient {
|
|
|
120
124
|
catch (error) {
|
|
121
125
|
const result = FillResultByError(error);
|
|
122
126
|
const confirmUserSecurity = CreateDefaultConfirmUserSecurity({ result });
|
|
123
|
-
return this.responseHelper.GetErrorResponse(confirmUserSecurity, "
|
|
127
|
+
return this.responseHelper.GetErrorResponse(confirmUserSecurity, "confirmPhone");
|
|
124
128
|
}
|
|
125
129
|
};
|
|
126
130
|
}
|
|
@@ -3,7 +3,7 @@ import { BaseClient } from "./base";
|
|
|
3
3
|
declare class OrderClient extends BaseClient {
|
|
4
4
|
private orderService;
|
|
5
5
|
constructor(clientData: OrderClientData, errorHandler: ErrorHandler);
|
|
6
|
-
|
|
6
|
+
createOrder: (data: ICreateOrderData, options?: RequestOptions) => Promise<{
|
|
7
7
|
data: import("../../types").OrderData;
|
|
8
8
|
success: boolean;
|
|
9
9
|
message: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosHelper } from "../../helper/api/axiosHelper";
|
|
2
|
-
import { FillCreateOrderData, CreateDefaultOrderData, FillResultByError } from "../data";
|
|
2
|
+
import { FillCreateOrderData, CreateDefaultOrderData, FillResultByError, } from "../data";
|
|
3
3
|
import { OrderService } from "../services";
|
|
4
4
|
import { BaseClient } from "./base";
|
|
5
5
|
class OrderClient extends BaseClient {
|
|
@@ -11,7 +11,7 @@ class OrderClient extends BaseClient {
|
|
|
11
11
|
this.orderService = new OrderService({ config, userId });
|
|
12
12
|
}
|
|
13
13
|
// #region "POST"
|
|
14
|
-
|
|
14
|
+
createOrder = async (data, options) => {
|
|
15
15
|
try {
|
|
16
16
|
const createOrderData = FillCreateOrderData(data);
|
|
17
17
|
const response = await this.orderService.create(createOrderData, options);
|
|
@@ -20,7 +20,7 @@ class OrderClient extends BaseClient {
|
|
|
20
20
|
catch (error) {
|
|
21
21
|
const result = FillResultByError(error);
|
|
22
22
|
const orderData = CreateDefaultOrderData({ result });
|
|
23
|
-
return this.responseHelper.GetErrorResponse(orderData, "
|
|
23
|
+
return this.responseHelper.GetErrorResponse(orderData, "createOrder");
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
}
|
|
@@ -5,31 +5,31 @@ declare class OrganizationClient extends BaseClient {
|
|
|
5
5
|
private organizationService;
|
|
6
6
|
private userId;
|
|
7
7
|
constructor(clientData: OrganizationClientData, errorHandler: ErrorHandler);
|
|
8
|
-
|
|
8
|
+
getOrganization: (id: number, options?: RequestOptions) => Promise<{
|
|
9
9
|
data: import("../../types").OrganizationData;
|
|
10
10
|
success: boolean;
|
|
11
11
|
message: string;
|
|
12
12
|
error: any;
|
|
13
13
|
}>;
|
|
14
|
-
|
|
14
|
+
createOrganization: (data: ICreateOrganizationData, options?: RequestOptions) => Promise<{
|
|
15
15
|
data: import("../../types").OrganizationData;
|
|
16
16
|
success: boolean;
|
|
17
17
|
message: string;
|
|
18
18
|
error: any;
|
|
19
19
|
}>;
|
|
20
|
-
|
|
20
|
+
uploadDocument: (data: IUploadOrganizationDocumentData, options?: RequestOptions) => Promise<{
|
|
21
21
|
data: import("../../types").DocumentData;
|
|
22
22
|
success: boolean;
|
|
23
23
|
message: string;
|
|
24
24
|
error: any;
|
|
25
25
|
}>;
|
|
26
|
-
|
|
26
|
+
updateOrganization: (data: IUpdateOrganizationData, options?: RequestOptions) => Promise<{
|
|
27
27
|
data: import("../../types").OrganizationData;
|
|
28
28
|
success: boolean;
|
|
29
29
|
message: string;
|
|
30
30
|
error: any;
|
|
31
31
|
}>;
|
|
32
|
-
|
|
32
|
+
deleteOrganization: (id: number, options?: RequestOptions) => Promise<{
|
|
33
33
|
data: import("../../types").OrganizationData;
|
|
34
34
|
success: boolean;
|
|
35
35
|
message: string;
|