@opexa/portal-sdk 0.0.86 → 0.0.88

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/sdk/sdk.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AccountReturn, ActivityRecordsInput, ActivityRecordsReturn, AnnouncementsInput, AnnouncementsReturn, AuthenticateInput, AuthenticateReturn, AvailablePromosReturn, BetRecordsInput, BetRecordsReturn, BonusReturn, CashbackBonusReturn, CashbacksReturn, ClaimCashbackBonusReturn, CreateAccountInput, CreateAccountInput__Next, CreateAccountReturn, CreateDepositInput, CreateDepositReturn, CreateGameSessionInput, CreateGameSessionReturn, CreateWithdrawalInput, CreateWithdrawalReturn, DeleteAccountReturn, DepositRecordsInput, DepositRecordsReturn, DepositReturn, DepositsCountReturn, DownlinesByNameInput, DownlinesByNameReturn, EndGameSessionReturn, FileReturn, GameReturn, GameSessionReturn, GamesInput, GamesReturn, LatestBetRecordsReturn, MayaSignInInput, MayaSignInReturn, MobileNumberSignInInput, MobileNumberSignInReturn, NameAndPasswordSignInInput, NameAndPasswordSignInReturn, PlatformReturn, PointsWalletReturn, PointsWalletTransactionsInput, PointsWalletTransactionsReturn, ProfileCompletionReturn, PromosReturn, RedeemPointsInput, RedeemPointsReturn, ReferralCodeReturn, ReferralCommissionReturn, ReferralsInput, ReferralsReturn, RegisterMayaAccountInput, RegisterMayaAccountReturn, RemainingDailyWithdrawalsCountReturn, ResetPasswordInput, ResetPasswordReturn, SendVerificationCodeInput__Next, SendVerificationCodeReturn, SendVerificationCodeReturn__Next, SessionReturn, SiteReturn, SubmitVerificationDetailsInput, SubmitVerificationDetailsReturn, TransactionRecordsInput, TransactionRecordsReturn, UpdateAccountInput, UpdateAccountReturn, UpdateReferralCodeInput, UpdateReferralCodeReturn, UpdateVerificationDetailsInput, UpdateVerificationDetailsReturn, UplinesByNameInput, UplinesByNameReturn, UploadImageFileInput, UploadImageFileReturn, ValidateMayaSessionReturn, VerificationDetailsReturn, VerifyMobileNumberReturn, WalletReturn, WatchSessionInput, WithdrawalRecordsInput, WithdrawalRecordsReturn } from './types';
1
+ import { AccountReturn, ActivityRecordsInput, ActivityRecordsReturn, AnnouncementsInput, AnnouncementsReturn, AuthenticateInput, AuthenticateReturn, AvailablePromosReturn, BetRecordsInput, BetRecordsReturn, BonusReturn, CashbackBonusReturn, CashbacksReturn, ClaimCashbackBonusReturn, CreateAccountInput, CreateAccountInput__Next, CreateAccountReturn, CreateDepositInput, CreateDepositReturn, CreateGameSessionInput, CreateGameSessionReturn, CreateWithdrawalInput, CreateWithdrawalReturn, DeleteAccountReturn, DepositRecordsInput, DepositRecordsReturn, DepositReturn, DepositsCountReturn, DownlinesByNameInput, DownlinesByNameReturn, EndGameSessionReturn, FileReturn, GameReturn, GameSessionReturn, GamesInput, GamesReturn, LatestBetRecordsReturn, MayaSignInInput, MayaSignInReturn, MobileNumberSignInInput, MobileNumberSignInReturn, NameAndPasswordSignInInput, NameAndPasswordSignInReturn, PaymentSettingsReturn, PlatformReturn, PlatformReturn__Next, PointsClubSettingsReturn, PointsWalletReturn, PointsWalletTransactionsInput, PointsWalletTransactionsReturn, ProfileCompletionReturn, PromosReturn, RedeemPointsInput, RedeemPointsReturn, ReferralCodeReturn, ReferralCommissionReturn, ReferralsInput, ReferralsReturn, RegisterMayaAccountInput, RegisterMayaAccountReturn, RemainingDailyWithdrawalsCountReturn, ResetPasswordInput, ResetPasswordReturn, SendVerificationCodeInput__Next, SendVerificationCodeReturn, SendVerificationCodeReturn__Next, SessionReturn, SiteReturn, SubmitVerificationDetailsInput, SubmitVerificationDetailsReturn, TransactionRecordsInput, TransactionRecordsReturn, UpdateAccountInput, UpdateAccountReturn, UpdateReferralCodeInput, UpdateReferralCodeReturn, UpdateVerificationDetailsInput, UpdateVerificationDetailsReturn, UplinesByNameInput, UplinesByNameReturn, UploadImageFileInput, UploadImageFileReturn, ValidateMayaSessionReturn, VerificationDetailsReturn, VerifyMobileNumberReturn, WalletReturn, WatchSessionInput, WithdrawalRecordsInput, WithdrawalRecordsReturn } from './types';
2
2
 
3
3
  export interface SdkConfig {
4
4
  site: string;
@@ -19,8 +19,10 @@ export declare class Sdk {
19
19
  private sessionManager;
20
20
  private transformer;
21
21
  private logger;
22
+ private cache;
22
23
  constructor(config: SdkConfig);
23
24
  private get authMiddleware();
25
+ private get locale();
24
26
  signIn(input: NameAndPasswordSignInInput): Promise<NameAndPasswordSignInReturn>;
25
27
  signIn(input: MobileNumberSignInInput): Promise<MobileNumberSignInReturn>;
26
28
  signIn(input: MayaSignInInput): Promise<MayaSignInReturn>;
@@ -30,7 +32,10 @@ export declare class Sdk {
30
32
  session(): Promise<SessionReturn>;
31
33
  validateMayaSession(): Promise<ValidateMayaSessionReturn>;
32
34
  site(): Promise<SiteReturn>;
35
+ /** @deprecated */
33
36
  platform(): Promise<PlatformReturn>;
37
+ platform__next(): Promise<PlatformReturn__Next>;
38
+ paymentSettings(): Promise<PaymentSettingsReturn>;
34
39
  account(): Promise<AccountReturn>;
35
40
  /**
36
41
  * @deprecated use `createAccount__next`
@@ -86,5 +91,6 @@ export declare class Sdk {
86
91
  referralCommission(): Promise<ReferralCommissionReturn>;
87
92
  uplinesByName(input: UplinesByNameInput): Promise<UplinesByNameReturn>;
88
93
  downlinesByName(input: DownlinesByNameInput): Promise<DownlinesByNameReturn>;
94
+ pointsClubSettings(): Promise<PointsClubSettingsReturn>;
89
95
  }
90
96
  export default Sdk;
@@ -32,9 +32,16 @@ export declare class Transformer {
32
32
  activityRecord: (data: Internal.ActivityRecord) => External.ActivityRecord;
33
33
  referral: (data: Internal.Referral) => External.Referral;
34
34
  referralCommission: (data: Internal.ReferralCommission) => External.ReferralCommission;
35
+ platform__next: (data: Internal.Platform__Next) => External.Platform__Next;
36
+ pointsClubSettings: (data: Internal.PointsClubSettings) => External.PointsClubSettings;
37
+ paymentSettings: (data: Internal.PaymentSettings) => External.PaymentSettings;
35
38
  };
36
39
  private site;
40
+ /** @deprecated */
37
41
  private platform;
42
+ private platform__next;
43
+ private pointsClubSettings;
44
+ private paymentSettings;
38
45
  private account;
39
46
  private wallet;
40
47
  private verificationDetails;
@@ -233,7 +233,22 @@ export type SendVerificationCodeError__Next = UnionAlias<Internal.SendVerificati
233
233
  export type SendVerificationCodeReturn__Next = OperationResult<SendVerificationCodeError__Next>;
234
234
  export type VerifyMobileNumberError = UnionAlias<Internal.VerifyMobileNumberError>;
235
235
  export type VerifyMobileNumberReturn = OperationResult<VerifyMobileNumberError>;
236
+ /**
237
+ * - `PHP` (Philippine Peso)
238
+ * - `USD` (United States Dollar)
239
+ * - `INR` (Indian Rupee)
240
+ * - `MYR` (Malaysian Ringgit)
241
+ * - `IDR` (Indonesian Rupiah)
242
+ */
236
243
  export type Currency = UnionAlias<Internal.Currency>;
244
+ /**
245
+ * - `en-PH` (Philippines)
246
+ * - `en-IN` (India)
247
+ * - `en-MY` (Malaysia)
248
+ * - `en-ID` (Indonesia)
249
+ * - `en-US` (United States)
250
+ */
251
+ export type Locale = 'en-PH' | 'en-IN' | 'en-MY' | 'en-ID' | 'en-US';
237
252
  export interface Wallet {
238
253
  id: string;
239
254
  balance: number;
@@ -539,10 +554,10 @@ export interface ManualWithdrawalRecord extends WithdrawalRecordCommonProps {
539
554
  recipientMobileNumber?: never;
540
555
  }
541
556
  /**
542
- * - `AUBKPHMM` - ASIA UNITED BANK
543
- * - `MBTCPHMM` - METROPOLITAN BANK AND TRUST CO.
544
- * - `BNORPHMM` - BDO UNIBANK, INC.
545
- * - `MKRUPHM1` - BANK OF MAKATI
557
+ * - `AUBKPHMM` (ASIA UNITED BANK)
558
+ * - `MBTCPHMM` (METROPOLITAN BANK AND TRUST CO)
559
+ * - `BNORPHMM` (BDO UNIBANK, INC)
560
+ * - `MKRUPHM1` (BANK OF MAKATI)
546
561
  */
547
562
  export type Bank = UnionAlias<Internal.Bank>;
548
563
  export interface BankWithdrawalRecord extends WithdrawalRecordCommonProps {
@@ -606,9 +621,6 @@ export interface GatewaySettings {
606
621
  androidEnabled: boolean;
607
622
  iosEnabled: boolean;
608
623
  }
609
- export interface PointsClubSettings {
610
- multiplier: number;
611
- }
612
624
  export interface PaymentSettings {
613
625
  minimumFirstDepositAmount?: number;
614
626
  restrictWithdrawalsToVerifiedMembers: boolean;
@@ -625,13 +637,22 @@ export interface PaymentSettings {
625
637
  mayaApp: GatewaySettings;
626
638
  };
627
639
  }
640
+ /** @deprecated */
628
641
  export interface Platform {
629
642
  currency: Currency;
630
643
  timezone: string;
631
644
  paymentSettings: PaymentSettings;
632
645
  pointsClubSettings: PointsClubSettings;
633
646
  }
647
+ /** @deprecated */
634
648
  export type PlatformReturn = OperationResult<never, Platform>;
649
+ export interface Platform__Next {
650
+ currency: Currency;
651
+ timezone: string;
652
+ locale: Locale;
653
+ }
654
+ export type PlatformReturn__Next = OperationResult<never, Platform__Next>;
655
+ export type PaymentSettingsReturn = OperationResult<never, PaymentSettings>;
635
656
  export type PromoType = UnionAlias<Internal.PromoType>;
636
657
  export type PromoStatus = UnionAlias<Internal.PromoStatus>;
637
658
  export interface Promo {
@@ -751,7 +772,7 @@ export interface Referral {
751
772
  };
752
773
  level: number;
753
774
  turnover: number;
754
- commision: number;
775
+ commission: number;
755
776
  dateTimeCreated: Date;
756
777
  }
757
778
  export interface ReferralsInput extends Internal.ReferralsQueryVariables {
@@ -759,9 +780,9 @@ export interface ReferralsInput extends Internal.ReferralsQueryVariables {
759
780
  export type ReferralsReturn = OperationResult<never, PaginatedQueryResult<'referrals', Referral>>;
760
781
  export interface UplinesByNameInput extends Internal.UplinesByNameQueryVariables {
761
782
  }
783
+ export type UplinesByNameReturn = OperationResult<never, Referral[]>;
762
784
  export interface DownlinesByNameInput extends Internal.DownlinesByNameQueryVariables {
763
785
  }
764
- export type UplinesByNameReturn = OperationResult<never, Referral[]>;
765
786
  export type DownlinesByNameReturn = OperationResult<never, Referral[]>;
766
787
  export interface ReferralCommission {
767
788
  id: string;
@@ -778,4 +799,8 @@ export interface ReferralCommission {
778
799
  dateTimeLastUpdated: Date;
779
800
  }
780
801
  export type ReferralCommissionReturn = OperationResult<never, ReferralCommission | null>;
802
+ export interface PointsClubSettings {
803
+ multiplier: number;
804
+ }
805
+ export type PointsClubSettingsReturn = OperationResult<never, PointsClubSettings | null>;
781
806
  export {};
@@ -1,6 +1,6 @@
1
1
  import { GraphQLClient } from '../utils/graphql-client';
2
2
  import { OperationResult } from '../utils/types';
3
- import { Announcement, AnnouncementsQueryVariables, CreateMemberVerificationError, CreateMemberVerificationMutationVariables, DeleteMemberAccountMutationVariables, MemberAccount, MemberVerification, PaginatedQueryResult, Platform, ProfileCompletion, RegisterMayaMemberAccountError, RegisterMayaMemberAccountMutationVariables, RegisterMemberAccountError, RegisterMemberAccountMutationVariables, RegisterMemberAccountMutationVariables__Next, RegisterMemberAccountViaMobileMutationVariables, ResetPasswordError, ResetPasswordMutationVariables, SendVerificationCodeError, SendVerificationCodeMutationVariables, UpdateMemberAccountError, UpdateMemberAccountMutationVariables, UpdateMemberVerificationError, UpdateMemberVerificationMutationVariables, UpdateReferralCodeError, UpdateReferralCodeMutationVariables, VerifyMobileNumberError, VerifyMobileNumberMutationVariables } from './types';
3
+ import { Announcement, AnnouncementsQueryVariables, CreateMemberVerificationError, CreateMemberVerificationMutationVariables, DeleteMemberAccountMutationVariables, MemberAccount, MemberVerification, PaginatedQueryResult, PaymentSettings, Platform, PointsClubSettings, ProfileCompletion, RegisterMayaMemberAccountError, RegisterMayaMemberAccountMutationVariables, RegisterMemberAccountError, RegisterMemberAccountMutationVariables, RegisterMemberAccountMutationVariables__Next, RegisterMemberAccountViaMobileMutationVariables, ResetPasswordError, ResetPasswordMutationVariables, SendVerificationCodeError, SendVerificationCodeMutationVariables, UpdateMemberAccountError, UpdateMemberAccountMutationVariables, UpdateMemberVerificationError, UpdateMemberVerificationMutationVariables, UpdateReferralCodeError, UpdateReferralCodeMutationVariables, VerifyMobileNumberError, VerifyMobileNumberMutationVariables } from './types';
4
4
 
5
5
  export declare class AccountService {
6
6
  private client;
@@ -14,9 +14,11 @@ export declare class AccountService {
14
14
  deleteMemberAccount(variables: DeleteMemberAccountMutationVariables): Promise<OperationResult>;
15
15
  resetPassword(variables: ResetPasswordMutationVariables): Promise<OperationResult<ResetPasswordError>>;
16
16
  profileCompletion(): Promise<OperationResult<never, ProfileCompletion>>;
17
+ /** @deprecated */
17
18
  platform(): Promise<OperationResult<never, Platform>>;
18
19
  /** @deprecated */
19
20
  sendVerificationCode(variables: SendVerificationCodeMutationVariables): Promise<OperationResult<SendVerificationCodeError>>;
21
+ paymentSettings(): Promise<OperationResult<never, PaymentSettings>>;
20
22
  verifyMobileNumber(variables: VerifyMobileNumberMutationVariables): Promise<OperationResult<VerifyMobileNumberError>>;
21
23
  createMemberVerification(variables: CreateMemberVerificationMutationVariables): Promise<OperationResult<CreateMemberVerificationError>>;
22
24
  updateMemberVerification(variables: UpdateMemberVerificationMutationVariables): Promise<OperationResult<UpdateMemberVerificationError>>;
@@ -25,4 +27,5 @@ export declare class AccountService {
25
27
  registerMayaMemberAccount(variables: RegisterMayaMemberAccountMutationVariables): Promise<OperationResult<RegisterMayaMemberAccountError>>;
26
28
  referralCode(): Promise<OperationResult<never, string | null | undefined>>;
27
29
  updateReferralCode(variables: UpdateReferralCodeMutationVariables): Promise<OperationResult<UpdateReferralCodeError>>;
30
+ pointsClubSettings(): Promise<OperationResult<never, PointsClubSettings | null | undefined>>;
28
31
  }
@@ -1,9 +1,10 @@
1
1
  import { GraphQLClient } from '../utils/graphql-client';
2
2
  import { OperationResult } from '../utils/types';
3
- import { LatestBetRecord } from './types';
3
+ import { LatestBetRecord, PlatformQuery__Next } from './types';
4
4
 
5
5
  export declare class PortalService {
6
6
  private client;
7
7
  constructor(client: GraphQLClient);
8
8
  latestBetRecords(): Promise<OperationResult<never, LatestBetRecord[]>>;
9
+ platform(): Promise<OperationResult<never, PlatformQuery__Next>>;
9
10
  }
@@ -57,7 +57,10 @@ export declare const UPDATE_MEMBER_VERIFICATION_MUTATION: string;
57
57
  export declare const PROFILE_COMPLETION_QUERY: string;
58
58
  /** @deprecated */
59
59
  export declare const SEND_VERIFICATION_CODE_MUTATION: string;
60
+ /** @deprecated */
60
61
  export declare const PLATFORM_QUERY: string;
62
+ export declare const PLATFORM_QUERY__NEXT: string;
63
+ export declare const PAYMENT_SETTINGS_QUERY: string;
61
64
  export declare const MAYA_SESSION_QUERY: string;
62
65
  export declare const VALIDATE_MAYA_SESSION_MUTATION: string;
63
66
  export declare const ACTIVITY_RECORDS_QUERY: string;
@@ -68,3 +71,4 @@ export declare const REFERRALS_QUERY: string;
68
71
  export declare const UPLINES_BY_NAME_QUERY: string;
69
72
  export declare const DOWNLINES_BY_NAME_QUERY: string;
70
73
  export declare const REFERRAL_COMMISSION_QUERY: string;
74
+ export declare const POINTS_CLUB_SETTINGS_QUERY: string;
@@ -551,7 +551,7 @@ export interface TransactionRecordsQueryVariables {
551
551
  dateTimeCreated?: DateFilterField;
552
552
  };
553
553
  }
554
- export type Currency = 'PHP' | 'USD' | 'INR' | 'MYR' | 'IDR' | (string & {});
554
+ export type Currency = 'PHP' | 'USD' | 'INR' | 'MYR' | 'IDR';
555
555
  export interface Wallet {
556
556
  id: string;
557
557
  balance: Decimal;
@@ -850,9 +850,7 @@ export interface WithdrawalGatewaySettings {
850
850
  androidEnabled: boolean;
851
851
  iosEnabled: boolean;
852
852
  }
853
- export interface PointsClubSettings {
854
- multiplier: Decimal;
855
- }
853
+ /** @deprecated */
856
854
  export interface Platform {
857
855
  currency: Currency;
858
856
  timezone: string;
@@ -868,7 +866,26 @@ export interface Platform {
868
866
  mayaAppWithdrawalGatewaySettings?: WithdrawalGatewaySettings | null;
869
867
  pointsClubSettings?: PointsClubSettings | null;
870
868
  }
869
+ /** @deprecated */
871
870
  export type PlatformQuery = Platform;
871
+ export interface Platform__Next {
872
+ currency: Currency;
873
+ timezone: string;
874
+ }
875
+ export type PlatformQuery__Next = Platform__Next;
876
+ export interface PaymentSettings {
877
+ restrictWithdrawalsToVerifiedMembers: boolean;
878
+ minimumFirstDepositAmount: Decimal;
879
+ bankDepositGatewaySettings?: DepositGatewaySettings | null;
880
+ gcashDepositGatewaySettings?: DepositGatewaySettings | null;
881
+ mayaDepositGatewaySettings?: DepositGatewaySettings | null;
882
+ mayaAppDepositGatewaySettings?: DepositGatewaySettings | null;
883
+ bankWithdrawalGatewaySettings?: WithdrawalGatewaySettings | null;
884
+ gcashWithdrawalGatewaySettings?: WithdrawalGatewaySettings | null;
885
+ mayaWithdrawalGatewaySettings?: WithdrawalGatewaySettings | null;
886
+ mayaAppWithdrawalGatewaySettings?: WithdrawalGatewaySettings | null;
887
+ }
888
+ export type PaymentSettingsQuery = PaymentSettings;
872
889
  export interface Session {
873
890
  id: string;
874
891
  dateTimeCreated: DateString;
@@ -1063,7 +1080,7 @@ export interface Referral {
1063
1080
  };
1064
1081
  level: number;
1065
1082
  turnover: Decimal;
1066
- commision: Decimal;
1083
+ commission: Decimal;
1067
1084
  dateTimeCreated: DateString;
1068
1085
  }
1069
1086
  export interface ReferralsQuery {
@@ -1111,3 +1128,9 @@ export interface UplinesByNameQuery {
1111
1128
  export interface DownlinesByNameQuery {
1112
1129
  downlinesByName: Referral[];
1113
1130
  }
1131
+ export interface PointsClubSettings {
1132
+ multiplier: Decimal;
1133
+ }
1134
+ export interface PointsClubSettingsQuery {
1135
+ pointsClubSettings?: PointsClubSettings | null;
1136
+ }
@@ -0,0 +1,15 @@
1
+ interface CacheConfig {
2
+ /**
3
+ * @description The number in minutes the cache is valid
4
+ * @default 5
5
+ */
6
+ cacheTime: number;
7
+ }
8
+ export declare class Cache<T = unknown> {
9
+ private config;
10
+ private cache;
11
+ constructor(config?: CacheConfig);
12
+ set(key: string, value: T): void;
13
+ get<V = never>(key: string): [V] extends [never] ? T | null : V | null;
14
+ }
15
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Currency, Locale } from '../sdk';
2
+
3
+ export declare function getLocaleByCurrency(currency: Currency): Locale;
4
+ export declare function getAreaCodeByLocale(locale: Locale): "+91" | "+60" | "+62" | "+1" | "+63";
@@ -1,11 +1,13 @@
1
+ import { Locale } from '../sdk';
2
+
1
3
  /**
2
4
  * @description Ensures mobile number has complete area code
3
5
  * @example
4
6
  * ```ts
5
- * addAreaCode('9190010001'); // +639190010001
6
- * addAreaCode('09190010001'); // +639190010001
7
- * addAreaCode('639190010001'); // +639190010001
8
- * addAreaCode('+639190010001'); // +639190010001
7
+ * addAreaCode('9190010001', 'en-PH'); // +639190010001
8
+ * addAreaCode('09190010001', 'en-PH'); // +639190010001
9
+ * addAreaCode('639190010001', 'en-PH'); // +639190010001
10
+ * addAreaCode('+639190010001', 'en-PH'); // +639190010001
9
11
  * ```
10
12
  */
11
- export declare function addAreaCode(mobileNumber: string): string;
13
+ export declare function addAreaCode(mobileNumber: string, locale: Locale): string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opexa/portal-sdk",
3
3
  "type": "module",
4
- "version": "0.0.86",
4
+ "version": "0.0.88",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "typings": "dist/index.d.ts",