ggez-banking-sdk 0.1.178 → 0.1.180
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/clients/account.d.ts +4 -4
- package/dist/api/clients/account.js +10 -11
- package/dist/api/clients/auth.d.ts +4 -4
- package/dist/api/clients/auth.js +13 -14
- package/dist/api/clients/base.d.ts +8 -0
- package/dist/api/clients/base.js +12 -0
- package/dist/api/clients/blockchain.d.ts +8 -8
- package/dist/api/clients/blockchain.js +14 -15
- package/dist/api/clients/ipAddressAndLocation.d.ts +17 -7
- package/dist/api/clients/ipAddressAndLocation.js +26 -14
- package/dist/api/clients/limited.d.ts +4 -4
- package/dist/api/clients/limited.js +21 -22
- package/dist/api/clients/order.d.ts +4 -4
- package/dist/api/clients/order.js +7 -8
- package/dist/api/clients/organization.d.ts +4 -4
- package/dist/api/clients/organization.js +13 -14
- package/dist/api/clients/promotion.d.ts +4 -4
- package/dist/api/clients/promotion.js +11 -12
- package/dist/api/clients/transaction.d.ts +4 -4
- package/dist/api/clients/transaction.js +10 -10
- package/dist/api/clients/user.d.ts +4 -4
- package/dist/api/clients/user.js +159 -159
- package/dist/api/data/result.js +3 -3
- package/dist/api/services/account.d.ts +1 -1
- package/dist/api/services/account.js +7 -9
- package/dist/api/services/auth.d.ts +1 -1
- package/dist/api/services/auth.js +4 -4
- package/dist/api/services/base.d.ts +2 -1
- package/dist/api/services/base.js +15 -17
- package/dist/api/services/blockchain.d.ts +2 -2
- package/dist/api/services/blockchain.js +6 -6
- package/dist/api/services/ipAddressAndLocation.d.ts +1 -1
- package/dist/api/services/ipAddressAndLocation.js +3 -3
- package/dist/api/services/limited.d.ts +1 -1
- package/dist/api/services/limited.js +13 -13
- package/dist/api/services/order.d.ts +2 -2
- package/dist/api/services/order.js +4 -4
- package/dist/api/services/organization.d.ts +2 -2
- package/dist/api/services/organization.js +7 -7
- package/dist/api/services/promotion.d.ts +2 -2
- package/dist/api/services/promotion.js +5 -5
- package/dist/api/services/transaction.d.ts +2 -2
- package/dist/api/services/transaction.js +5 -5
- package/dist/api/services/user.d.ts +2 -2
- package/dist/api/services/user.js +66 -66
- package/dist/helper/api/responseHelper.d.ts +6 -4
- package/dist/helper/api/responseHelper.js +8 -4
- package/dist/helper/storage/localStorageHelper.d.ts +1 -0
- package/dist/helper/storage/localStorageHelper.js +5 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/api/service/base.d.ts +2 -1
- package/dist/types/api/service/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { AxiosHelper } from "../../helper";
|
|
2
|
-
import { ResponseHelper } from "../../helper";
|
|
3
2
|
import { FillCreateOrganizationData, FillCreateOrganizationDocumentData, FillOrganizationData, FillUpdateOrganizationData, } from "../data/organization";
|
|
4
3
|
import { OrganizationService } from "../services";
|
|
5
4
|
import { FillDocumentData, FillResultByError } from "../data";
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { BaseClient } from "./base";
|
|
6
|
+
class OrganizationClient extends BaseClient {
|
|
8
7
|
organizationService;
|
|
9
8
|
userId;
|
|
10
|
-
constructor(clientData) {
|
|
11
|
-
|
|
9
|
+
constructor(clientData, errorHandler) {
|
|
10
|
+
super(clientData, errorHandler);
|
|
12
11
|
const { token, baseUrl, userId, lang, installationId } = clientData;
|
|
13
12
|
const config = AxiosHelper.GetAxiosConfig(token, baseUrl, lang, installationId);
|
|
14
|
-
this.organizationService = new OrganizationService({ config, userId });
|
|
13
|
+
this.organizationService = new OrganizationService({ config, userId }, this.errorHandler);
|
|
15
14
|
this.userId = userId;
|
|
16
15
|
}
|
|
17
16
|
// #region "POST"
|
|
@@ -19,24 +18,24 @@ class OrganizationClient {
|
|
|
19
18
|
try {
|
|
20
19
|
const organizationData = FillCreateOrganizationData(data, this.userId);
|
|
21
20
|
const response = await this.organizationService.create(organizationData);
|
|
22
|
-
return
|
|
21
|
+
return this.responseHelper.GetResponse(response.data);
|
|
23
22
|
}
|
|
24
23
|
catch (error) {
|
|
25
24
|
const result = FillResultByError(error);
|
|
26
25
|
const organization = FillOrganizationData("result", result);
|
|
27
|
-
return
|
|
26
|
+
return this.responseHelper.GetErrorResponse(organization, "CreateOrganization");
|
|
28
27
|
}
|
|
29
28
|
};
|
|
30
29
|
UploadDocument = async (data) => {
|
|
31
30
|
try {
|
|
32
31
|
const documentData = FillCreateOrganizationDocumentData(data);
|
|
33
32
|
const response = await this.organizationService.createDocument(data.id, documentData);
|
|
34
|
-
return
|
|
33
|
+
return this.responseHelper.GetResponse(response.data);
|
|
35
34
|
}
|
|
36
35
|
catch (error) {
|
|
37
36
|
const result = FillResultByError(error);
|
|
38
37
|
const documentData = FillDocumentData("result", result);
|
|
39
|
-
return
|
|
38
|
+
return this.responseHelper.GetErrorResponse(documentData, "CreateOrganizationDocument");
|
|
40
39
|
}
|
|
41
40
|
};
|
|
42
41
|
// #endregion
|
|
@@ -45,12 +44,12 @@ class OrganizationClient {
|
|
|
45
44
|
try {
|
|
46
45
|
const organizationData = FillUpdateOrganizationData(data, this.userId);
|
|
47
46
|
const response = await this.organizationService.update(data.id, organizationData);
|
|
48
|
-
return
|
|
47
|
+
return this.responseHelper.GetResponse(response.data);
|
|
49
48
|
}
|
|
50
49
|
catch (error) {
|
|
51
50
|
const result = FillResultByError(error);
|
|
52
51
|
const organization = FillOrganizationData("result", result);
|
|
53
|
-
return
|
|
52
|
+
return this.responseHelper.GetErrorResponse(organization, "UpdateOrganization");
|
|
54
53
|
}
|
|
55
54
|
};
|
|
56
55
|
// #endregion
|
|
@@ -58,12 +57,12 @@ class OrganizationClient {
|
|
|
58
57
|
DeleteOrganization = async (id) => {
|
|
59
58
|
try {
|
|
60
59
|
const response = await this.organizationService.delete(id);
|
|
61
|
-
return
|
|
60
|
+
return this.responseHelper.GetResponse(response.data);
|
|
62
61
|
}
|
|
63
62
|
catch (error) {
|
|
64
63
|
const result = FillResultByError(error);
|
|
65
64
|
const organization = FillOrganizationData("result", result);
|
|
66
|
-
return
|
|
65
|
+
return this.responseHelper.GetErrorResponse(organization, "DeleteOrganization");
|
|
67
66
|
}
|
|
68
67
|
};
|
|
69
68
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { BaseResult, GGEZGiftRewards, PromotionClientData } from "../../types";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { BaseResult, ErrorHandler, GGEZGiftRewards, PromotionClientData } from "../../types";
|
|
2
|
+
import { BaseClient } from "./base";
|
|
3
|
+
declare class PromotionClient extends BaseClient {
|
|
4
4
|
private promotionService;
|
|
5
|
-
constructor(clientData: PromotionClientData);
|
|
5
|
+
constructor(clientData: PromotionClientData, errorHandler: ErrorHandler);
|
|
6
6
|
GetPromotionByCode: (code: string) => Promise<{
|
|
7
7
|
data: BaseResult;
|
|
8
8
|
success: boolean;
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
import { AxiosHelper } from "../../helper";
|
|
2
|
-
import { ResponseHelper } from "../../helper";
|
|
3
2
|
import { PromotionService } from "../services";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { BaseClient } from "./base";
|
|
4
|
+
class PromotionClient extends BaseClient {
|
|
6
5
|
promotionService;
|
|
7
|
-
constructor(clientData) {
|
|
8
|
-
|
|
6
|
+
constructor(clientData, errorHandler) {
|
|
7
|
+
super(clientData, errorHandler);
|
|
9
8
|
const { nodeUrl, lang, userId } = this.clientData;
|
|
10
9
|
const config = AxiosHelper.GetAuthAxiosConfig(nodeUrl, lang, "");
|
|
11
|
-
this.promotionService = new PromotionService({ config, userId });
|
|
10
|
+
this.promotionService = new PromotionService({ config, userId }, this.errorHandler);
|
|
12
11
|
}
|
|
13
12
|
// #region "GET"
|
|
14
13
|
GetPromotionByCode = async (code) => {
|
|
15
14
|
try {
|
|
16
15
|
const response = await this.promotionService.getPromotionByCode(code);
|
|
17
|
-
return
|
|
16
|
+
return this.responseHelper.GetResponse(response.data);
|
|
18
17
|
}
|
|
19
18
|
catch (error) {
|
|
20
|
-
return
|
|
19
|
+
return this.responseHelper.GetErrorResponse(error, "GetPromotionByCode");
|
|
21
20
|
}
|
|
22
21
|
};
|
|
23
22
|
GetTwitterSpotlightPostIds = async () => {
|
|
24
23
|
try {
|
|
25
24
|
const response = await this.promotionService.getTwitterSpotlightPostIds();
|
|
26
|
-
return
|
|
25
|
+
return this.responseHelper.GetResponse(response);
|
|
27
26
|
}
|
|
28
27
|
catch (error) {
|
|
29
|
-
return
|
|
28
|
+
return this.responseHelper.GetErrorResponse(error, "GetTwitterSpotlightPostIds");
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
31
|
// #endregion
|
|
@@ -34,10 +33,10 @@ class PromotionClient {
|
|
|
34
33
|
IncrementPromotionParticipants = async (data) => {
|
|
35
34
|
try {
|
|
36
35
|
const response = await this.promotionService.incrementPromotionParticipants(data);
|
|
37
|
-
return
|
|
36
|
+
return this.responseHelper.GetResponse(response);
|
|
38
37
|
}
|
|
39
38
|
catch (error) {
|
|
40
|
-
return
|
|
39
|
+
return this.responseHelper.GetErrorResponse(error, "IncrementPromotionParticipants");
|
|
41
40
|
}
|
|
42
41
|
};
|
|
43
42
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ICreateTransactionData, IInquiryTransactionData, TransactionClientData } from "../../types";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { ErrorHandler, ICreateTransactionData, IInquiryTransactionData, TransactionClientData } from "../../types";
|
|
2
|
+
import { BaseClient } from "./base";
|
|
3
|
+
declare class TransactionClient extends BaseClient {
|
|
4
4
|
private transactionService;
|
|
5
|
-
constructor(clientData: TransactionClientData);
|
|
5
|
+
constructor(clientData: TransactionClientData, errorHandler: ErrorHandler);
|
|
6
6
|
InquiryTransaction: (params: IInquiryTransactionData) => Promise<{
|
|
7
7
|
data: import("../../types").TransactionResultInquiry;
|
|
8
8
|
success: boolean;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { AxiosHelper
|
|
1
|
+
import { AxiosHelper } from "../../helper";
|
|
2
2
|
import { FillCreateTransactionData, FillResultByError, FillTransactionData, FillTransactionInquiryData, FillTransactionInquiryResultData, } from "../data";
|
|
3
3
|
import { TransactionService } from "../services";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { BaseClient } from "./base";
|
|
5
|
+
class TransactionClient extends BaseClient {
|
|
6
6
|
transactionService;
|
|
7
|
-
constructor(clientData) {
|
|
8
|
-
|
|
7
|
+
constructor(clientData, errorHandler) {
|
|
8
|
+
super(clientData, errorHandler);
|
|
9
9
|
const { token, baseUrl, lang, installationId, userId } = clientData;
|
|
10
10
|
const config = AxiosHelper.GetAxiosConfig(token, baseUrl, lang, installationId);
|
|
11
|
-
this.transactionService = new TransactionService({ config, userId });
|
|
11
|
+
this.transactionService = new TransactionService({ config, userId }, this.errorHandler);
|
|
12
12
|
}
|
|
13
13
|
// #region "GET"
|
|
14
14
|
InquiryTransaction = async (params) => {
|
|
15
15
|
try {
|
|
16
16
|
const transactionInquiryData = FillTransactionInquiryData(params);
|
|
17
17
|
const response = await this.transactionService.inquiry(transactionInquiryData);
|
|
18
|
-
return
|
|
18
|
+
return this.responseHelper.GetResponse(response.data);
|
|
19
19
|
}
|
|
20
20
|
catch (error) {
|
|
21
21
|
const result = FillResultByError(error);
|
|
22
22
|
const transactionInquiryResult = FillTransactionInquiryResultData("result", result);
|
|
23
|
-
return
|
|
23
|
+
return this.responseHelper.GetErrorResponse(transactionInquiryResult, "InquiryTransaction");
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
// #endregion
|
|
@@ -29,12 +29,12 @@ class TransactionClient {
|
|
|
29
29
|
try {
|
|
30
30
|
const transactionData = FillCreateTransactionData(data);
|
|
31
31
|
const response = await this.transactionService.create(transactionData);
|
|
32
|
-
return
|
|
32
|
+
return this.responseHelper.GetResponse(response.data);
|
|
33
33
|
}
|
|
34
34
|
catch (error) {
|
|
35
35
|
const result = FillResultByError(error);
|
|
36
36
|
const transactionData = FillTransactionData("result", result);
|
|
37
|
-
return
|
|
37
|
+
return this.responseHelper.GetErrorResponse(transactionData, "CreateTransaction");
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IActivateGoogleAuthData, IConfirmDeviceData, IConfirmEmailData, IConfirmPhoneData, ICreateAddressData, ICreateBankAccountData, ICreateDeviceData, ICreateEmailData, ICreateIdentificationData, ICreatePhoneData, ICreateTicketData, ICreateUserData, ICreateUserWithGoogleData, IDeactivateGoogleAuthData, IDeleteAddressData, IDeleteBankAccountData, IDeleteDeviceData, IDeleteEmailData, IDeleteGoogleAuthData, IDeleteIdentificationData, IDeletePhoneData, IGetUserData, ILogoutDeviceData, IMakeAddressPrimaryData, IMakeBankAccountPrimaryData, IMakeEmailPrimaryData, IMakePhonePrimaryData, IResetPasswordData, IResetSecurityCodeData, IResetSecurityQuestionsData, ISendEmailOTPData, ISendPhoneOTPData, IUpdateAddressData, IUpdateBankAccountData, IUpdateDeviceData, IUpdateEmailData, IUpdateIdentificationData, IUpdatePersonalInfoData, IUpdatePhoneData, IUpdatePreferencesData, IUploadDocumentData, IUploadProfilePictureData, IValidateSecurityCodeData, IVerifyDeviceData, IVerifyEmailData, IVerifyPhoneData } from "../../types";
|
|
1
|
+
import type { ErrorHandler, IActivateGoogleAuthData, IConfirmDeviceData, IConfirmEmailData, IConfirmPhoneData, ICreateAddressData, ICreateBankAccountData, ICreateDeviceData, ICreateEmailData, ICreateIdentificationData, ICreatePhoneData, ICreateTicketData, ICreateUserData, ICreateUserWithGoogleData, IDeactivateGoogleAuthData, IDeleteAddressData, IDeleteBankAccountData, IDeleteDeviceData, IDeleteEmailData, IDeleteGoogleAuthData, IDeleteIdentificationData, IDeletePhoneData, IGetUserData, ILogoutDeviceData, IMakeAddressPrimaryData, IMakeBankAccountPrimaryData, IMakeEmailPrimaryData, IMakePhonePrimaryData, IResetPasswordData, IResetSecurityCodeData, IResetSecurityQuestionsData, ISendEmailOTPData, ISendPhoneOTPData, IUpdateAddressData, IUpdateBankAccountData, IUpdateDeviceData, IUpdateEmailData, IUpdateIdentificationData, IUpdatePersonalInfoData, IUpdatePhoneData, IUpdatePreferencesData, IUploadDocumentData, IUploadProfilePictureData, IValidateSecurityCodeData, IVerifyDeviceData, IVerifyEmailData, IVerifyPhoneData } from "../../types";
|
|
2
2
|
import type { UserClientData } from "../../types";
|
|
3
3
|
import type { ResetUserSecurity, UserData } from "../../types";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { BaseClient } from "./base";
|
|
5
|
+
declare class UserClient extends BaseClient {
|
|
6
6
|
private userService;
|
|
7
7
|
private authService;
|
|
8
|
-
constructor(clientData: UserClientData);
|
|
8
|
+
constructor(clientData: UserClientData, errorHandler: ErrorHandler);
|
|
9
9
|
GetUser: (data: IGetUserData) => Promise<{
|
|
10
10
|
data: UserData;
|
|
11
11
|
success: boolean;
|