react-memory-optimization 0.0.46 → 0.0.48

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.
@@ -0,0 +1,2 @@
1
+ import { RequestCommands } from 'binary/types';
2
+ export declare const PLIXO_CASHX_REQUESTS: RequestCommands;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PLIXO_CASHX_REQUESTS = void 0;
4
+ const types_1 = require("binary/types");
5
+ exports.PLIXO_CASHX_REQUESTS = {
6
+ '\\246x247_deposit': {
7
+ command: 'BetPaymentCreateDeposit',
8
+ responseKey: '',
9
+ writeScheme: [
10
+ {
11
+ type: 0 /* EWriteModifiedDataType.Usual */,
12
+ binary: types_1.EWriteDataType.Long,
13
+ key: 'bonusId',
14
+ },
15
+ {
16
+ type: 0 /* EWriteModifiedDataType.Usual */,
17
+ binary: types_1.EWriteDataType.Short,
18
+ key: 'currencyId',
19
+ },
20
+ {
21
+ type: 0 /* EWriteModifiedDataType.Usual */,
22
+ binary: types_1.EWriteDataType.Byte,
23
+ key: 'channelId',
24
+ },
25
+ {
26
+ type: 0 /* EWriteModifiedDataType.Usual */,
27
+ binary: types_1.EWriteDataType.Byte,
28
+ key: 'name',
29
+ },
30
+ {
31
+ type: 0 /* EWriteModifiedDataType.Usual */,
32
+ binary: types_1.EWriteDataType.Byte,
33
+ key: 'sureName',
34
+ },
35
+ {
36
+ type: 0 /* EWriteModifiedDataType.Usual */,
37
+ binary: types_1.EWriteDataType.Byte,
38
+ key: 'email',
39
+ },
40
+ {
41
+ type: 0 /* EWriteModifiedDataType.Usual */,
42
+ binary: types_1.EWriteDataType.Byte,
43
+ key: 'phone',
44
+ },
45
+ {
46
+ type: 0 /* EWriteModifiedDataType.Usual */,
47
+ binary: types_1.EWriteDataType.Int,
48
+ key: 'amount',
49
+ },
50
+ {
51
+ type: 0 /* EWriteModifiedDataType.Usual */,
52
+ binary: types_1.EWriteDataType.Byte,
53
+ key: 'requestId',
54
+ },
55
+ ],
56
+ },
57
+ '\\246x247_withdraw': {
58
+ command: 'BetPaymentCreateWithdraw',
59
+ responseKey: '',
60
+ writeScheme: [
61
+ {
62
+ type: 0 /* EWriteModifiedDataType.Usual */,
63
+ binary: types_1.EWriteDataType.Short,
64
+ key: 'currencyId',
65
+ },
66
+ {
67
+ type: 0 /* EWriteModifiedDataType.Usual */,
68
+ binary: types_1.EWriteDataType.Byte,
69
+ key: 'channelId',
70
+ },
71
+ {
72
+ type: 0 /* EWriteModifiedDataType.Usual */,
73
+ binary: types_1.EWriteDataType.Byte,
74
+ key: 'name',
75
+ },
76
+ {
77
+ type: 0 /* EWriteModifiedDataType.Usual */,
78
+ binary: types_1.EWriteDataType.Byte,
79
+ key: 'sureName',
80
+ },
81
+ {
82
+ type: 0 /* EWriteModifiedDataType.Usual */,
83
+ binary: types_1.EWriteDataType.Byte,
84
+ key: 'email',
85
+ },
86
+ {
87
+ type: 0 /* EWriteModifiedDataType.Usual */,
88
+ binary: types_1.EWriteDataType.Byte,
89
+ key: 'phone',
90
+ },
91
+ {
92
+ type: 0 /* EWriteModifiedDataType.Usual */,
93
+ binary: types_1.EWriteDataType.Int,
94
+ key: 'amount',
95
+ },
96
+ {
97
+ type: 0 /* EWriteModifiedDataType.Usual */,
98
+ binary: types_1.EWriteDataType.Byte,
99
+ key: 'requestId',
100
+ },
101
+ ],
102
+ },
103
+ };
@@ -6,7 +6,8 @@ const PlixoRequests_1 = require("./requestModules/PlixoRequests");
6
6
  const APayRequest_1 = require("./requestModules/APayRequest");
7
7
  const PlixoTryRequests_1 = require("./requestModules/PlixoTryRequests");
8
8
  const PlixoCreedo_1 = require("./requestModules/PlixoCreedo");
9
- exports.REQUEST_COMMANDS = Object.assign(Object.assign(Object.assign(Object.assign({ '\\x0': {
9
+ const PlixoPkr_1 = require("./requestModules/PlixoPkr");
10
+ exports.REQUEST_COMMANDS = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ '\\x0': {
10
11
  command: 'GeoProviders',
11
12
  responseKey: '-',
12
13
  writeScheme: [],
@@ -3294,4 +3295,4 @@ exports.REQUEST_COMMANDS = Object.assign(Object.assign(Object.assign(Object.assi
3294
3295
  key: 'requestId',
3295
3296
  },
3296
3297
  ],
3297
- } }, PlixoRequests_1.PLIXO_REQUESTS), APayRequest_1.APAY_REQUESTS), PlixoTryRequests_1.PLIXO_TRY_REQUESTS), PlixoCreedo_1.PLIXO_CREEDO_REQUESTS);
3298
+ } }, PlixoRequests_1.PLIXO_REQUESTS), APayRequest_1.APAY_REQUESTS), PlixoTryRequests_1.PLIXO_TRY_REQUESTS), PlixoCreedo_1.PLIXO_CREEDO_REQUESTS), PlixoPkr_1.PLIXO_CASHX_REQUESTS);
@@ -1,3 +1,4 @@
1
1
  export { Socket } from './socket';
2
2
  export { experimentalFeatures } from './service/experimental';
3
3
  export { getCurrencyInfoByIdOrName } from './utils/shader';
4
+ export { api } from './service/api';
@@ -0,0 +1,17 @@
1
+ import { EApiPath } from './types';
2
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
3
+ interface ApiRequestConfig extends RequestInit {
4
+ method: HttpMethod;
5
+ headers?: HeadersInit;
6
+ }
7
+ declare class Api {
8
+ private baseUrl;
9
+ private defaultConfig;
10
+ constructor();
11
+ setToken(token: string): void;
12
+ private request;
13
+ get<T>(url: EApiPath, config?: Partial<ApiRequestConfig>): Promise<T | null>;
14
+ post<T, U = unknown>(url: EApiPath, body: U, config?: Partial<ApiRequestConfig>): Promise<T | null>;
15
+ }
16
+ export declare const api: Api;
17
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare enum EApiPath {
2
+ AccrualHistory = "/ref_service/api/v1/client/accural_bonus"
3
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EApiPath = void 0;
4
+ var EApiPath;
5
+ (function (EApiPath) {
6
+ EApiPath["AccrualHistory"] = "/ref_service/api/v1/client/accural_bonus";
7
+ })(EApiPath || (exports.EApiPath = EApiPath = {}));
@@ -69,12 +69,12 @@ export declare class Socket implements SocketInterface {
69
69
  subscribeEntity(method: () => boolean): boolean;
70
70
  logout(): void;
71
71
  subscribeUserEntity(props: BaseObservableSubscriber & SubscribeUserKeys): boolean;
72
+ unsubscribeUserEntity(uid: string): boolean;
72
73
  subscribeBazarFrameUrl(props: BaseObservableSubscriber & {
73
74
  gameId: number;
74
75
  }): boolean;
75
76
  unsubscribeBazarFrameUrl(uid: string): boolean;
76
77
  subscribeStories(props: BaseObservableSubscriber): boolean;
77
- unsubscribeUserEntity(uid: string): boolean;
78
78
  subscribeBalanceInfo(props: BaseObservableSubscriber): boolean;
79
79
  subscribeBonusBalanceCoins(props: BaseObservableSubscriber): boolean;
80
80
  unsubscribeBalanceEntity(uid: string): boolean;
@@ -115,6 +115,8 @@ export declare class Socket implements SocketInterface {
115
115
  isActive?: boolean;
116
116
  }): boolean;
117
117
  unsubscribeTournamentBonuses(uid: string): boolean;
118
+ subscribeAccrualHistory(props: BaseObservableSubscriber): boolean;
119
+ unsubscribeAccrualHistory(uid: string): boolean;
118
120
  saveToFavoriteEntities(props: PrepareFavoriteEntitiesForSavingProps): boolean;
119
121
  subscribeIsFavoriteGame(props: SubscribeFavoriteGameProps): boolean;
120
122
  subscribeFavoriteGames(props: SubscribeFavoriteGamesProps): boolean;
@@ -179,6 +179,8 @@ export interface SocketInterface {
179
179
  isActive: boolean;
180
180
  }) => boolean;
181
181
  unsubscribeTournamentBonuses: (uid: string) => void;
182
+ subscribeAccrualHistory: (props: BaseObservableSubscriber) => boolean;
183
+ unsubscribeAccrualHistory: (uid: string) => void;
182
184
  subscribeIsFavoriteGame: (props: SubscribeFavoriteGameProps) => boolean;
183
185
  subscribeFavoriteGames: (props: SubscribeFavoriteGamesProps) => boolean;
184
186
  saveToFavoriteEntities: (data: PrepareFavoriteEntitiesForSavingProps) => void;
@@ -13,5 +13,6 @@ export declare enum ENotifications {
13
13
  BalanceIsNotAvailable = 11,
14
14
  PromoCodeError = 12,
15
15
  PromoCodeSuccess = 13,
16
- LootBoxTakeMonthly = 14
16
+ LootBoxTakeMonthly = 14,
17
+ AccrualHistoryError = 15
17
18
  }
@@ -18,4 +18,5 @@ var ENotifications;
18
18
  ENotifications[ENotifications["PromoCodeError"] = 12] = "PromoCodeError";
19
19
  ENotifications[ENotifications["PromoCodeSuccess"] = 13] = "PromoCodeSuccess";
20
20
  ENotifications[ENotifications["LootBoxTakeMonthly"] = 14] = "LootBoxTakeMonthly";
21
+ ENotifications[ENotifications["AccrualHistoryError"] = 15] = "AccrualHistoryError";
21
22
  })(ENotifications || (exports.ENotifications = ENotifications = {}));
@@ -0,0 +1 @@
1
+ export declare const POLLING_DELAY = 10000;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.POLLING_DELAY = void 0;
4
+ exports.POLLING_DELAY = 10000; // 10 sec
@@ -0,0 +1,17 @@
1
+ import { BaseObservableSubscriber, UpdateData } from 'service/observable/type';
2
+ import { ObservableEntity } from 'service/observableEntity';
3
+ import { UserOperationServices } from 'store/operations/services';
4
+ import { AccrualHistoryCamelCaseType, AccrualHistoryRequestInfo } from './types';
5
+ export declare class AccrualHistory extends ObservableEntity<undefined> {
6
+ services: UserOperationServices;
7
+ throttling: number;
8
+ _info: AccrualHistoryCamelCaseType | null;
9
+ requestInfo: AccrualHistoryRequestInfo;
10
+ constructor(services: UserOperationServices);
11
+ set info(data: AccrualHistoryCamelCaseType | null);
12
+ get info(): AccrualHistoryCamelCaseType | null;
13
+ prepareAccrualHistory(): UpdateData | null;
14
+ sendUpdateEntity(d: BaseObservableSubscriber & {
15
+ [key: string]: unknown;
16
+ }): UpdateData | null;
17
+ }
@@ -0,0 +1,21 @@
1
+ export type AccrualHistoryType = {
2
+ deposit_bonus: number;
3
+ rakeback: number;
4
+ free_spins: number;
5
+ weekly_bonus: number;
6
+ monthly_bonus: number;
7
+ weekly_battles: number;
8
+ bonus_from_support: number;
9
+ cash_bonus: number;
10
+ new_loyalty_level: number;
11
+ key: string;
12
+ };
13
+ type SnakeToCamelCase<S extends string> = S extends `${infer T}_${infer U}` ? `${T}${Capitalize<SnakeToCamelCase<U>>}` : S;
14
+ export type AccrualHistoryCamelCaseType = {
15
+ [K in keyof AccrualHistoryType as SnakeToCamelCase<K>]: AccrualHistoryType[K];
16
+ };
17
+ export type AccrualHistoryRequestInfo = {
18
+ requestTime: number;
19
+ isRequesting: boolean;
20
+ };
21
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { AccrualHistoryCamelCaseType, AccrualHistoryType } from './types';
2
+ export declare const transformKeysToCamelCase: (obj: AccrualHistoryType) => AccrualHistoryCamelCaseType;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformKeysToCamelCase = void 0;
4
+ function snakeToCamel(str) {
5
+ return str.replace(/(_\w)/g, (match) => match[1].toUpperCase());
6
+ }
7
+ const transformKeysToCamelCase = (obj) => {
8
+ const result = {};
9
+ for (const key in obj) {
10
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
11
+ const camelKey = snakeToCamel(key);
12
+ result[camelKey] = obj[key];
13
+ }
14
+ }
15
+ return result;
16
+ };
17
+ exports.transformKeysToCamelCase = transformKeysToCamelCase;
@@ -14,6 +14,7 @@ import { UpdateData } from 'service/observable/type';
14
14
  import { CashBonuses } from './entities/cashBonuses';
15
15
  import { CasinoHistoryBet } from './entities/casinoHistory/types';
16
16
  import { ResponseAdapterService } from 'service/responseAdapter/services';
17
+ import { AccrualHistory } from './entities/accrualHistory';
17
18
  export declare class UserOperations extends ObservableEntity<undefined> {
18
19
  availableBonuses: AvailableBonuses;
19
20
  activeBonuses: ActiveBonuses;
@@ -25,6 +26,7 @@ export declare class UserOperations extends ObservableEntity<undefined> {
25
26
  vipClub: VipClub;
26
27
  tournaments: TournamentOperations;
27
28
  referralOperations: ReferralOperation;
29
+ accrualHistory: AccrualHistory;
28
30
  availableBonusOnDeposit: Operation[];
29
31
  availableFreeSpins: Operation[];
30
32
  activeBonusOnDeposit: Operation[];
@@ -1,4 +1,5 @@
1
1
  import { UserOperations } from '..';
2
+ import { AccrualHistoryCamelCaseType } from '../entities/accrualHistory/types';
2
3
  import { MixerTransactionResponse } from '../types';
3
4
  export declare class UserOperationServices {
4
5
  parent: UserOperations;
@@ -15,4 +16,6 @@ export declare class UserOperationServices {
15
16
  handleWeekly(isActive?: boolean): MixerTransactionResponse;
16
17
  handleMonthly(isActive?: boolean): MixerTransactionResponse;
17
18
  handleTournamentOperation(isActive?: boolean): MixerTransactionResponse;
19
+ fetchingAccrualHistory(): Promise<void>;
20
+ getAccrualHistoryData(): AccrualHistoryCamelCaseType | null;
18
21
  }
@@ -257,6 +257,8 @@ export declare enum PaymentChannelType {
257
257
  APayNayapayP2P = 243,
258
258
  APayBankalfalahP2C = 244,
259
259
  APayBankTransfer = 245,
260
+ PKRPlixoEasypaisa = 246,
261
+ PKRPlixoJazzCash = 247,
260
262
  PlixoCreedoBkash = 248,
261
263
  PlixoCreedoNagad = 249,
262
264
  PlixoCreedoEasyPaisa = 250,
@@ -157,6 +157,8 @@ var PaymentChannelType;
157
157
  PaymentChannelType[PaymentChannelType["APayNayapayP2P"] = 243] = "APayNayapayP2P";
158
158
  PaymentChannelType[PaymentChannelType["APayBankalfalahP2C"] = 244] = "APayBankalfalahP2C";
159
159
  PaymentChannelType[PaymentChannelType["APayBankTransfer"] = 245] = "APayBankTransfer";
160
+ PaymentChannelType[PaymentChannelType["PKRPlixoEasypaisa"] = 246] = "PKRPlixoEasypaisa";
161
+ PaymentChannelType[PaymentChannelType["PKRPlixoJazzCash"] = 247] = "PKRPlixoJazzCash";
160
162
  PaymentChannelType[PaymentChannelType["PlixoCreedoBkash"] = 248] = "PlixoCreedoBkash";
161
163
  PaymentChannelType[PaymentChannelType["PlixoCreedoNagad"] = 249] = "PlixoCreedoNagad";
162
164
  PaymentChannelType[PaymentChannelType["PlixoCreedoEasyPaisa"] = 250] = "PlixoCreedoEasyPaisa";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-memory-optimization",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "description": "react memory optimization library",
5
5
  "sideEffects": false,
6
6
  "files": [