react-memory-optimization 0.0.110 → 0.0.112
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/bundle.js +1 -1
- package/dist/lib/service/api/constants.js +46 -0
- package/dist/lib/service/api/index.d.ts +7 -0
- package/dist/lib/service/api/types.d.ts +14 -2
- package/dist/lib/service/api/types.js +15 -0
- package/dist/lib/socket/index.d.ts +2 -0
- package/dist/lib/socket/types/socket.d.ts +2 -0
- package/dist/lib/store/new-flow/index.d.ts +18 -0
- package/dist/lib/store/new-flow/store/UI/Home/Banners/index.d.ts +24 -0
- package/dist/lib/store/new-flow/store/UI/Home/Banners/types.d.ts +21 -0
- package/dist/lib/store/new-flow/store/UI/Home/Banners/types.js +2 -0
- package/dist/lib/store/new-flow/store/UI/Home/index.d.ts +14 -0
- package/dist/lib/store/new-flow/store/UI/Home/service/index.d.ts +6 -0
- package/dist/lib/store/new-flow/store/UI/index.d.ts +12 -0
- package/dist/lib/store/new-flow/store/UI/service/index.d.ts +5 -0
- package/dist/lib/store/new-flow/transport/api-transport.d.ts +21 -0
- package/dist/lib/store/new-flow/transport/api-transport.js +84 -0
- package/dist/lib/store/new-flow/transport/types.d.ts +8 -0
- package/dist/lib/store/new-flow/transport/types.js +7 -0
- package/dist/lib/store/new-flow/types.d.ts +4 -0
- package/dist/lib/store/new-flow/types.js +2 -0
- package/dist/lib/store/user/types.d.ts +5 -0
- package/dist/lib/store/user/types.js +5 -0
- package/package.json +1 -1
|
@@ -39,4 +39,50 @@ exports.PAYMENT_REQUEST_PATHS = {
|
|
|
39
39
|
path: types_1.EApiPath.CreateProdWithdraw,
|
|
40
40
|
adapterFn: utils_1.restAdapterWithdraw,
|
|
41
41
|
},
|
|
42
|
+
// MYR
|
|
43
|
+
[types_1.EPaymentRequestPath.PayinTouchNGoMYRDeposit]: {
|
|
44
|
+
path: types_1.EApiPath.CreateProdDeposit,
|
|
45
|
+
adapterFn: utils_1.restAdapterDeposit,
|
|
46
|
+
},
|
|
47
|
+
[types_1.EPaymentRequestPath.PayoutTouchNGoMYRWithdraw]: {
|
|
48
|
+
path: types_1.EApiPath.CreateProdWithdraw,
|
|
49
|
+
adapterFn: utils_1.restAdapterWithdraw,
|
|
50
|
+
},
|
|
51
|
+
// MYR
|
|
52
|
+
[types_1.EPaymentRequestPath.PayinGrabpayMYRDeposit]: {
|
|
53
|
+
path: types_1.EApiPath.CreateProdDeposit,
|
|
54
|
+
adapterFn: utils_1.restAdapterDeposit,
|
|
55
|
+
},
|
|
56
|
+
[types_1.EPaymentRequestPath.PayoutGrabpayMYRWithdraw]: {
|
|
57
|
+
path: types_1.EApiPath.CreateProdWithdraw,
|
|
58
|
+
adapterFn: utils_1.restAdapterWithdraw,
|
|
59
|
+
},
|
|
60
|
+
// PayinDuitNowMYRDeposit
|
|
61
|
+
[types_1.EPaymentRequestPath.PayinDuitNowMYRDeposit]: {
|
|
62
|
+
path: types_1.EApiPath.CreateProdDeposit,
|
|
63
|
+
adapterFn: utils_1.restAdapterDeposit,
|
|
64
|
+
},
|
|
65
|
+
[types_1.EPaymentRequestPath.PayoutDuitNowMYRWithdraw]: {
|
|
66
|
+
path: types_1.EApiPath.CreateProdWithdraw,
|
|
67
|
+
adapterFn: utils_1.restAdapterWithdraw,
|
|
68
|
+
},
|
|
69
|
+
// DataForPayinOnlineBankingDeposit
|
|
70
|
+
[types_1.EPaymentRequestPath.PayinOnlineBankingMYRDepositDeposit]: {
|
|
71
|
+
path: types_1.EApiPath.CreateProdDeposit,
|
|
72
|
+
adapterFn: utils_1.restAdapterDeposit,
|
|
73
|
+
},
|
|
74
|
+
[types_1.EPaymentRequestPath.PayinOnlineBankingMYRDepositWithdraw]: {
|
|
75
|
+
path: types_1.EApiPath.CreateProdWithdraw,
|
|
76
|
+
adapterFn: utils_1.restAdapterWithdraw,
|
|
77
|
+
},
|
|
78
|
+
// PayoutBankTransferMYRWithdraw
|
|
79
|
+
[types_1.EPaymentRequestPath.PayoutBankTransferMYRWithdraw]: {
|
|
80
|
+
path: types_1.EApiPath.CreateProdWithdraw,
|
|
81
|
+
adapterFn: utils_1.restAdapterWithdraw,
|
|
82
|
+
},
|
|
83
|
+
// PayinBankTransferMYRDeposit
|
|
84
|
+
[types_1.EPaymentRequestPath.PayinBankTransferMYRDeposit]: {
|
|
85
|
+
path: types_1.EApiPath.CreateProdDeposit,
|
|
86
|
+
adapterFn: utils_1.restAdapterDeposit,
|
|
87
|
+
},
|
|
42
88
|
};
|
|
@@ -4,12 +4,14 @@ interface ApiRequestConfig extends RequestInit {
|
|
|
4
4
|
method: HttpMethod;
|
|
5
5
|
headers?: HeadersInit & {
|
|
6
6
|
Authorization: string;
|
|
7
|
+
'X-Partner-Id'?: string;
|
|
7
8
|
};
|
|
8
9
|
}
|
|
9
10
|
declare class Api {
|
|
10
11
|
private baseUrl;
|
|
11
12
|
private defaultConfig;
|
|
12
13
|
constructor();
|
|
14
|
+
setPartnerId(partnerId: number): void;
|
|
13
15
|
setToken(token: string): void;
|
|
14
16
|
private request;
|
|
15
17
|
get<T>(url: EApiPath, config?: Partial<ApiRequestConfig>): Promise<T | null>;
|
|
@@ -17,6 +19,11 @@ declare class Api {
|
|
|
17
19
|
private getCommandList;
|
|
18
20
|
validationCommand<T = unknown>(command: EPaymentRequestPath, sendData?: any): Promise<T | null>;
|
|
19
21
|
registration(path: string | undefined, sendData: RestCommandDataProps): Promise<any>;
|
|
22
|
+
getPaymentBankList(key: EApiPath.GetPaymentBankListDeposit | EApiPath.GetPaymentBankListWithdraw, { clientId, channelId, appType, }: {
|
|
23
|
+
clientId: string;
|
|
24
|
+
channelId: string;
|
|
25
|
+
appType: number;
|
|
26
|
+
}): Promise<any>;
|
|
20
27
|
}
|
|
21
28
|
export declare const api: Api;
|
|
22
29
|
export {};
|
|
@@ -4,7 +4,9 @@ export declare enum EApiPath {
|
|
|
4
4
|
CreateDevDeposit = "/pay-service-dev/api/v2/deposit/create",
|
|
5
5
|
CreateProdDeposit = "/pay-service/api/v2/deposit/create",
|
|
6
6
|
CreateDevWithdraw = "/pay-service-dev/api/v2/withdrawal/create",
|
|
7
|
-
CreateProdWithdraw = "/pay-service/api/v2/withdrawal/create"
|
|
7
|
+
CreateProdWithdraw = "/pay-service/api/v2/withdrawal/create",
|
|
8
|
+
GetPaymentBankListDeposit = "/pay-service/api/v2/info/banks/malaysia/payin",
|
|
9
|
+
GetPaymentBankListWithdraw = "/pay-service/api/v2/info/banks/malaysia/payout"
|
|
8
10
|
}
|
|
9
11
|
export type RestCommandDataProps = {
|
|
10
12
|
[key: string]: string | number | any[];
|
|
@@ -22,7 +24,17 @@ export declare enum EPaymentRequestPath {
|
|
|
22
24
|
PiqPayPkDeposit = "piq_pay_pk_deposit",
|
|
23
25
|
PiqPayPkWithdraw = "piq_pay_pk_withdraw",
|
|
24
26
|
JazzcashPTCPkrDeposit = "jazzcash_ptc_pkr_deposit",
|
|
25
|
-
JazzcashPTCPkrWithdraw = "jazzcash_ptc_pkr_withdraw"
|
|
27
|
+
JazzcashPTCPkrWithdraw = "jazzcash_ptc_pkr_withdraw",
|
|
28
|
+
PayinTouchNGoMYRDeposit = "payin_and_out_touch_n_go_myr_deposit",
|
|
29
|
+
PayoutTouchNGoMYRWithdraw = "payout_touch_n_go_myr_withdraw",
|
|
30
|
+
PayinGrabpayMYRDeposit = "payin_grabpay_myr_deposit",
|
|
31
|
+
PayoutGrabpayMYRWithdraw = "payout_grabpay_myr_withdraw",
|
|
32
|
+
PayinDuitNowMYRDeposit = "payin_duitnow_myr_deposit",
|
|
33
|
+
PayoutDuitNowMYRWithdraw = "payout_duitnow_myr_withdraw",
|
|
34
|
+
PayinOnlineBankingMYRDepositDeposit = "prepare_data_for_payin_online_banking_myr",
|
|
35
|
+
PayinOnlineBankingMYRDepositWithdraw = "prepare_data_for_payout_online_banking_myr",
|
|
36
|
+
PayoutBankTransferMYRWithdraw = "payout_bank_transfer_myr_withdraw",
|
|
37
|
+
PayinBankTransferMYRDeposit = "payin_bank_transfer_myr_deposit"
|
|
26
38
|
}
|
|
27
39
|
export type ApiList = {
|
|
28
40
|
[key: string]: {
|
|
@@ -9,6 +9,8 @@ var EApiPath;
|
|
|
9
9
|
EApiPath["CreateProdDeposit"] = "/pay-service/api/v2/deposit/create";
|
|
10
10
|
EApiPath["CreateDevWithdraw"] = "/pay-service-dev/api/v2/withdrawal/create";
|
|
11
11
|
EApiPath["CreateProdWithdraw"] = "/pay-service/api/v2/withdrawal/create";
|
|
12
|
+
EApiPath["GetPaymentBankListDeposit"] = "/pay-service/api/v2/info/banks/malaysia/payin";
|
|
13
|
+
EApiPath["GetPaymentBankListWithdraw"] = "/pay-service/api/v2/info/banks/malaysia/payout";
|
|
12
14
|
})(EApiPath || (exports.EApiPath = EApiPath = {}));
|
|
13
15
|
var EValidationCommandDataProps;
|
|
14
16
|
(function (EValidationCommandDataProps) {
|
|
@@ -26,6 +28,19 @@ var EPaymentRequestPath;
|
|
|
26
28
|
EPaymentRequestPath["PiqPayPkWithdraw"] = "piq_pay_pk_withdraw";
|
|
27
29
|
EPaymentRequestPath["JazzcashPTCPkrDeposit"] = "jazzcash_ptc_pkr_deposit";
|
|
28
30
|
EPaymentRequestPath["JazzcashPTCPkrWithdraw"] = "jazzcash_ptc_pkr_withdraw";
|
|
31
|
+
// MYR
|
|
32
|
+
EPaymentRequestPath["PayinTouchNGoMYRDeposit"] = "payin_and_out_touch_n_go_myr_deposit";
|
|
33
|
+
EPaymentRequestPath["PayoutTouchNGoMYRWithdraw"] = "payout_touch_n_go_myr_withdraw";
|
|
34
|
+
// MYR
|
|
35
|
+
EPaymentRequestPath["PayinGrabpayMYRDeposit"] = "payin_grabpay_myr_deposit";
|
|
36
|
+
EPaymentRequestPath["PayoutGrabpayMYRWithdraw"] = "payout_grabpay_myr_withdraw";
|
|
37
|
+
// PayinDuitNowMYRDeposit
|
|
38
|
+
EPaymentRequestPath["PayinDuitNowMYRDeposit"] = "payin_duitnow_myr_deposit";
|
|
39
|
+
EPaymentRequestPath["PayoutDuitNowMYRWithdraw"] = "payout_duitnow_myr_withdraw";
|
|
40
|
+
EPaymentRequestPath["PayinOnlineBankingMYRDepositDeposit"] = "prepare_data_for_payin_online_banking_myr";
|
|
41
|
+
EPaymentRequestPath["PayinOnlineBankingMYRDepositWithdraw"] = "prepare_data_for_payout_online_banking_myr";
|
|
42
|
+
EPaymentRequestPath["PayoutBankTransferMYRWithdraw"] = "payout_bank_transfer_myr_withdraw";
|
|
43
|
+
EPaymentRequestPath["PayinBankTransferMYRDeposit"] = "payin_bank_transfer_myr_deposit";
|
|
29
44
|
})(EPaymentRequestPath || (exports.EPaymentRequestPath = EPaymentRequestPath = {}));
|
|
30
45
|
// FlashPayUpiDeposit
|
|
31
46
|
var EPaymentStatusCode;
|
|
@@ -30,6 +30,7 @@ import { SubscribeUserKeys } from 'store/user/types';
|
|
|
30
30
|
import { PromotionSubscribeProps } from 'store/casino/entities/promotions/types';
|
|
31
31
|
import { UIEntitiesSettings } from 'store/ui/types';
|
|
32
32
|
import { TournamentSubscribeProps } from 'store/casino/entities/casinoTournaments/types';
|
|
33
|
+
import { NewFlowEntity } from 'store/new-flow';
|
|
33
34
|
export declare class Socket implements SocketInterface {
|
|
34
35
|
socketServices: SocketServices;
|
|
35
36
|
initialSettings: ISocketSettings;
|
|
@@ -51,6 +52,7 @@ export declare class Socket implements SocketInterface {
|
|
|
51
52
|
key: string;
|
|
52
53
|
result: any;
|
|
53
54
|
}[];
|
|
55
|
+
newFlowEntity: NewFlowEntity;
|
|
54
56
|
constructor(settings: ISocketSettings);
|
|
55
57
|
set socketStatus(s: ESocketCallbackStep);
|
|
56
58
|
get socketStatus(): ESocketCallbackStep;
|
|
@@ -28,6 +28,7 @@ import { SubscribeUserKeys, UserInfoSettings } from 'store/user/types';
|
|
|
28
28
|
import { ResponseAdapter } from 'service/responseAdapter';
|
|
29
29
|
import { CasinoPromotionSettings, PromotionSubscribeProps } from 'store/casino/entities/promotions/types';
|
|
30
30
|
import { UIEntitiesSettings } from 'store/ui/types';
|
|
31
|
+
import { ShadowIntegrationSettings } from 'store/new-flow/types';
|
|
31
32
|
export declare enum ESocketCallbackStep {
|
|
32
33
|
Unknown = 0,
|
|
33
34
|
Init = 1,
|
|
@@ -47,6 +48,7 @@ export interface ISocketSettings {
|
|
|
47
48
|
userInfo: UserInfoSettings;
|
|
48
49
|
appType: number;
|
|
49
50
|
isDevMode?: boolean;
|
|
51
|
+
shadowIntegration?: ShadowIntegrationSettings;
|
|
50
52
|
socketCallback: (step: ESocketCallbackStep) => void;
|
|
51
53
|
decodedDataCallback: (step: string, result?: any) => void;
|
|
52
54
|
referralBaseUrl: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Socket } from 'index';
|
|
2
|
+
import { UIEntities } from './store/UI';
|
|
3
|
+
import { ApiTransport } from './transport/api-transport';
|
|
4
|
+
import { ShadowIntegrationSettings } from './types';
|
|
5
|
+
export declare class NewFlowEntity {
|
|
6
|
+
_settings: ShadowIntegrationSettings;
|
|
7
|
+
_uiEntities: UIEntities | null;
|
|
8
|
+
_apiTransport: ApiTransport;
|
|
9
|
+
_socketInstance: Socket;
|
|
10
|
+
constructor(socketInstance: Socket, settings?: ShadowIntegrationSettings);
|
|
11
|
+
set apiTransport(apiTransport: ApiTransport);
|
|
12
|
+
get apiTransport(): ApiTransport;
|
|
13
|
+
set settings(settings: ShadowIntegrationSettings);
|
|
14
|
+
get settings(): ShadowIntegrationSettings;
|
|
15
|
+
set uiEntities(uiEntities: UIEntities);
|
|
16
|
+
get uiEntities(): UIEntities | null;
|
|
17
|
+
init(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ObservableEntity } from 'service/observableEntity';
|
|
2
|
+
import { HomePageService } from '../service';
|
|
3
|
+
import { BaseObservableSubscriber, UpdateData } from 'service/observable/type';
|
|
4
|
+
import { Banner, SliderSettings } from './types';
|
|
5
|
+
export declare class HomeBanners extends ObservableEntity<unknown> {
|
|
6
|
+
homeService?: null;
|
|
7
|
+
homePageService: HomePageService;
|
|
8
|
+
_banners: Banner[] | null;
|
|
9
|
+
_viewType: 'desktop' | 'mobile';
|
|
10
|
+
_sliderSettings: SliderSettings | null;
|
|
11
|
+
_status: 'idle' | 'loading' | 'error' | 'success';
|
|
12
|
+
constructor(service: HomePageService);
|
|
13
|
+
set viewType(viewType: 'desktop' | 'mobile');
|
|
14
|
+
get viewType(): 'desktop' | 'mobile';
|
|
15
|
+
set status(status: 'idle' | 'loading' | 'error' | 'success');
|
|
16
|
+
get status(): 'idle' | 'loading' | 'error' | 'success';
|
|
17
|
+
set banners(banners: Banner[]);
|
|
18
|
+
get banners(): Banner[] | null;
|
|
19
|
+
set sliderSettings(sliderSettings: SliderSettings);
|
|
20
|
+
get sliderSettings(): SliderSettings | null;
|
|
21
|
+
sendUpdateEntity(d: BaseObservableSubscriber & {
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}): UpdateData | null;
|
|
24
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EBannerAction } from 'store/ui/home/entity/banners/types';
|
|
2
|
+
export type SliderSettings = {
|
|
3
|
+
isDragFree: boolean;
|
|
4
|
+
isProgress: boolean;
|
|
5
|
+
isInfinity: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type Banner = {
|
|
8
|
+
actionType: EBannerAction;
|
|
9
|
+
actionValue: keyof typeof EBannerAction;
|
|
10
|
+
countryDependencies: number[];
|
|
11
|
+
depositDependency: number;
|
|
12
|
+
id: number;
|
|
13
|
+
isAuthDependency: boolean;
|
|
14
|
+
path: string;
|
|
15
|
+
order: number;
|
|
16
|
+
translations: {
|
|
17
|
+
title: string;
|
|
18
|
+
subTitle?: string;
|
|
19
|
+
buttonText: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UIService } from '../service';
|
|
2
|
+
import { HomeBanners } from './Banners';
|
|
3
|
+
import { HomePageService } from './service';
|
|
4
|
+
export declare class HomePage {
|
|
5
|
+
uiService: UIService;
|
|
6
|
+
_homePageService: null | HomePageService;
|
|
7
|
+
_homePageBanners: null | HomeBanners;
|
|
8
|
+
constructor(uiService: UIService);
|
|
9
|
+
set homePageService(homePageService: HomePageService);
|
|
10
|
+
get homePageService(): HomePageService | null;
|
|
11
|
+
set homePageBanners(homePageBanners: HomeBanners);
|
|
12
|
+
get homePageBanners(): HomeBanners | null;
|
|
13
|
+
init(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NewFlowEntity } from 'store/new-flow';
|
|
2
|
+
import { HomePage } from './Home';
|
|
3
|
+
import { UIService } from './service';
|
|
4
|
+
export declare class UIEntities {
|
|
5
|
+
root: NewFlowEntity;
|
|
6
|
+
_homePage: HomePage | null;
|
|
7
|
+
uiService: UIService;
|
|
8
|
+
constructor(root: NewFlowEntity);
|
|
9
|
+
set homePage(homePage: HomePage);
|
|
10
|
+
get homePage(): HomePage | null;
|
|
11
|
+
init(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ShadowIntegrationSettings } from '../types';
|
|
2
|
+
import { RequestQueue } from './types';
|
|
3
|
+
export declare class ApiTransport {
|
|
4
|
+
_baseUrl: string;
|
|
5
|
+
_isConfigured: boolean;
|
|
6
|
+
baseHeaders: Record<string, string>;
|
|
7
|
+
_requestQueue: RequestQueue[];
|
|
8
|
+
constructor();
|
|
9
|
+
set requestQueue(requestQueue: RequestQueue[]);
|
|
10
|
+
get requestQueue(): RequestQueue[];
|
|
11
|
+
set isConfigured(isConfigured: boolean);
|
|
12
|
+
get isConfigured(): boolean;
|
|
13
|
+
set baseUrl(baseUrl: string);
|
|
14
|
+
get baseUrl(): string;
|
|
15
|
+
get<T>(path: string): Promise<T | null>;
|
|
16
|
+
post<T>(path: string, data: any): Promise<T | null>;
|
|
17
|
+
configure(settings: ShadowIntegrationSettings): void;
|
|
18
|
+
subscribe(props: RequestQueue): void;
|
|
19
|
+
processRequestQueue(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare const apiTransport: ApiTransport;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.apiTransport = exports.ApiTransport = void 0;
|
|
4
|
+
class ApiTransport {
|
|
5
|
+
constructor() {
|
|
6
|
+
this._baseUrl = '';
|
|
7
|
+
this.baseHeaders = {
|
|
8
|
+
'Content-Type': 'application/json',
|
|
9
|
+
// Notice: move to settings
|
|
10
|
+
'x-brand-prefix': 'gobo-baf11357',
|
|
11
|
+
};
|
|
12
|
+
this._isConfigured = false;
|
|
13
|
+
this._requestQueue = [];
|
|
14
|
+
}
|
|
15
|
+
set requestQueue(requestQueue) {
|
|
16
|
+
this._requestQueue = requestQueue;
|
|
17
|
+
}
|
|
18
|
+
get requestQueue() {
|
|
19
|
+
return this._requestQueue;
|
|
20
|
+
}
|
|
21
|
+
set isConfigured(isConfigured) {
|
|
22
|
+
this._isConfigured = isConfigured;
|
|
23
|
+
this.processRequestQueue();
|
|
24
|
+
}
|
|
25
|
+
get isConfigured() {
|
|
26
|
+
return this._isConfigured;
|
|
27
|
+
}
|
|
28
|
+
set baseUrl(baseUrl) {
|
|
29
|
+
this.isConfigured = true;
|
|
30
|
+
this._baseUrl = baseUrl;
|
|
31
|
+
}
|
|
32
|
+
get baseUrl() {
|
|
33
|
+
return this._baseUrl;
|
|
34
|
+
}
|
|
35
|
+
async get(path) {
|
|
36
|
+
try {
|
|
37
|
+
const response = await fetch(`${this._baseUrl}${path}`, {
|
|
38
|
+
method: 'GET',
|
|
39
|
+
headers: {
|
|
40
|
+
'Content-Type': 'application/json',
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return response.json();
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
console.error(error);
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async post(path, data) {
|
|
51
|
+
try {
|
|
52
|
+
const response = await fetch(`${this._baseUrl}${path}`, {
|
|
53
|
+
method: 'POST',
|
|
54
|
+
body: JSON.stringify(data),
|
|
55
|
+
headers: {
|
|
56
|
+
'Content-Type': 'application/json',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
return response.json();
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
console.error(error);
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
configure(settings) {
|
|
67
|
+
this.baseUrl = settings.baseUrl;
|
|
68
|
+
}
|
|
69
|
+
subscribe(props) {
|
|
70
|
+
this.requestQueue.push(props);
|
|
71
|
+
this.processRequestQueue();
|
|
72
|
+
}
|
|
73
|
+
processRequestQueue() {
|
|
74
|
+
if (!this.isConfigured) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
this.requestQueue.forEach((request) => {
|
|
78
|
+
request.fn(request.fnProps);
|
|
79
|
+
});
|
|
80
|
+
this.requestQueue = [];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.ApiTransport = ApiTransport;
|
|
84
|
+
exports.apiTransport = new ApiTransport();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ETransportPath = void 0;
|
|
4
|
+
var ETransportPath;
|
|
5
|
+
(function (ETransportPath) {
|
|
6
|
+
ETransportPath["HomeBanners"] = "/banners";
|
|
7
|
+
})(ETransportPath || (exports.ETransportPath = ETransportPath = {}));
|
|
@@ -189,7 +189,12 @@ export declare enum PaymentChannelType {
|
|
|
189
189
|
MefeteMpay = 94,
|
|
190
190
|
MefeteMpayQr = 95,
|
|
191
191
|
PopyMpay = 97,
|
|
192
|
+
PayoutBankTransferMYR = 99,
|
|
193
|
+
PayinAndOutTouchNGoMYR = 100,
|
|
194
|
+
PayinGrabpayMYR = 101,
|
|
192
195
|
Rocket = 103,
|
|
196
|
+
PayinDuitNowMYR = 104,
|
|
197
|
+
PayinOnlineBankingMYR = 105,
|
|
193
198
|
BkashMonetics = 126,
|
|
194
199
|
NagadMonetics = 127,
|
|
195
200
|
OctopayNagad = 134,
|
|
@@ -80,8 +80,13 @@ var PaymentChannelType;
|
|
|
80
80
|
PaymentChannelType[PaymentChannelType["MefeteMpay"] = 94] = "MefeteMpay";
|
|
81
81
|
PaymentChannelType[PaymentChannelType["MefeteMpayQr"] = 95] = "MefeteMpayQr";
|
|
82
82
|
PaymentChannelType[PaymentChannelType["PopyMpay"] = 97] = "PopyMpay";
|
|
83
|
+
PaymentChannelType[PaymentChannelType["PayoutBankTransferMYR"] = 99] = "PayoutBankTransferMYR";
|
|
84
|
+
PaymentChannelType[PaymentChannelType["PayinAndOutTouchNGoMYR"] = 100] = "PayinAndOutTouchNGoMYR";
|
|
85
|
+
PaymentChannelType[PaymentChannelType["PayinGrabpayMYR"] = 101] = "PayinGrabpayMYR";
|
|
83
86
|
// - Mpay end ( not full )
|
|
84
87
|
PaymentChannelType[PaymentChannelType["Rocket"] = 103] = "Rocket";
|
|
88
|
+
PaymentChannelType[PaymentChannelType["PayinDuitNowMYR"] = 104] = "PayinDuitNowMYR";
|
|
89
|
+
PaymentChannelType[PaymentChannelType["PayinOnlineBankingMYR"] = 105] = "PayinOnlineBankingMYR";
|
|
85
90
|
PaymentChannelType[PaymentChannelType["BkashMonetics"] = 126] = "BkashMonetics";
|
|
86
91
|
PaymentChannelType[PaymentChannelType["NagadMonetics"] = 127] = "NagadMonetics";
|
|
87
92
|
PaymentChannelType[PaymentChannelType["OctopayNagad"] = 134] = "OctopayNagad";
|