@paypay/mini-app-js-sdk 2.56.0 → 2.60.0

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.
Files changed (37) hide show
  1. package/dist/client/communicationWithCore.d.ts +2 -1
  2. package/dist/composition-api/useKycPassport.d.ts +2 -2
  3. package/dist/constants/clientUtilFunctionName.d.ts +1 -0
  4. package/dist/constants/errorCodes.d.ts +1 -0
  5. package/dist/constants/index.d.ts +11 -0
  6. package/dist/constants/localStorageKeys.d.ts +1 -0
  7. package/dist/constants/permissionName.d.ts +1 -0
  8. package/dist/constants/sdkFunctionNames.d.ts +1 -0
  9. package/dist/core/coreFunctions/renderButton/types.d.ts +1 -0
  10. package/dist/core/sentry.d.ts +2 -2
  11. package/dist/environment-variables.d.ts +0 -1
  12. package/dist/mini-app-js-sdk.browser.js +1 -1
  13. package/dist/mini-app-js-sdk.es.js +86 -1219
  14. package/dist/model/bridge/getTransactionInfo.d.ts +1 -1
  15. package/dist/model/bridge/getTransactions.d.ts +1 -1
  16. package/dist/model/miniAppError.d.ts +3 -1
  17. package/dist/model/permission.d.ts +7 -3
  18. package/dist/resources/images.d.ts +1 -0
  19. package/dist/resources/locales/payment/index.d.ts +20 -0
  20. package/dist/resources/locales/payment/ja.d.ts +10 -0
  21. package/dist/resources/locales/topup/index.d.ts +2 -0
  22. package/dist/resources/locales/topup/ja.d.ts +1 -0
  23. package/dist/types/getPermissionStatus.d.ts +2 -44
  24. package/dist/types/makePayment.d.ts +23 -3
  25. package/dist/types.d.ts +3 -80
  26. package/dist/utils/analytics.d.ts +2 -1
  27. package/dist/utils/api.d.ts +14 -8
  28. package/dist/utils/errors.d.ts +3 -3
  29. package/dist/utils/fetch.d.ts +11 -9
  30. package/dist/utils/helper.d.ts +8 -8
  31. package/dist/utils/miniAppRequest.d.ts +2 -2
  32. package/dist/utils/pureHelpers.d.ts +2 -0
  33. package/dist/utils/storage.d.ts +1 -1
  34. package/dist/utils/windowBridge.d.ts +4 -1
  35. package/dist/views/make-payment/store/util-for-handle-error.d.ts +2 -2
  36. package/dist/views/make-payment/store.d.ts +8525 -603
  37. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
1
  import { GetTransactionInfoParams } from '../../types/getTransactionInfo';
2
- export declare function getTransactionInfo(params: GetTransactionInfoParams): Promise<void>;
2
+ export declare function getTransactionInfo(params: GetTransactionInfoParams): Promise<void | undefined>;
@@ -1,2 +1,2 @@
1
1
  import { GetTransactionsParams } from '../../types/getTransactions';
2
- export declare function getTransactions(params: GetTransactionsParams): Promise<void>;
2
+ export declare function getTransactions(params: GetTransactionsParams): Promise<void | undefined>;
@@ -68,6 +68,8 @@ export declare enum MiniAppErrorType {
68
68
  merchantTimeout = "MERCHANT_TIMEOUT",
69
69
  rateLimitExceeded = "RATE_LIMIT_EXCEEDED",
70
70
  sdkUpgradeRequired = "SDK_UPGRADE_REQUIRED",
71
+ maintenanceMode = "MAINTENANCE_MODE",
71
72
  authorizationNeeded = "AUTHORIZATION_NEEDED",
72
- invalidVirtualAccount = "INVALID_VIRTUAL_ACCOUNT"
73
+ invalidVirtualAccount = "INVALID_VIRTUAL_ACCOUNT",
74
+ notSupportedUser = "NOT_SUPPORTED_USER"
73
75
  }
@@ -1,3 +1,7 @@
1
- import { PermissionNameType, PermissionStatus } from '../types/getPermissionStatus';
2
- export declare const checkPermission: (permissionNames: string[] | string) => Promise<PermissionStatus>;
3
- export declare function getUserGrantedPermission(): Promise<PermissionNameType[]>;
1
+ import { GrantedPermissionRespone } from '../types/getPermissionStatus';
2
+ import { PPFetchResult } from '../utils/fetch';
3
+ import { ErrorCodesType } from '../constants';
4
+ export declare const checkPermissionOrFail: (permissionNames: string[] | string, fail: ((error: {
5
+ errorCode: ErrorCodesType;
6
+ }) => void) | undefined) => Promise<boolean>;
7
+ export declare function getUserGrantedPermission(): Promise<PPFetchResult<GrantedPermissionRespone>>;
@@ -56,3 +56,4 @@ export declare const img_ppCredit: string;
56
56
  export declare const qr_kyc: string;
57
57
  export declare const qr_topup: string;
58
58
  export declare const img_iconEmail: string;
59
+ export declare const img_iconGV: string;
@@ -72,6 +72,16 @@ declare const _default: {
72
72
  bodyAddTopup: string;
73
73
  close: string;
74
74
  };
75
+ giftVoucher: {
76
+ applicableGVInfo: string;
77
+ pmpSettingInfoBox: {
78
+ title: string;
79
+ description: string;
80
+ };
81
+ topupInfoBox: {
82
+ description: string;
83
+ };
84
+ };
75
85
  type: {
76
86
  payment: {
77
87
  title: string;
@@ -320,6 +330,16 @@ declare const _default: {
320
330
  bodyAddTopup: string;
321
331
  close: string;
322
332
  };
333
+ giftVoucher: {
334
+ applicableGVInfo: string;
335
+ pmpSettingInfoBox: {
336
+ title: string;
337
+ description: string;
338
+ };
339
+ topupInfoBox: {
340
+ description: string;
341
+ };
342
+ };
323
343
  type: {
324
344
  payment: {
325
345
  title: string;
@@ -71,6 +71,16 @@ declare const _default: {
71
71
  bodyAddTopup: string;
72
72
  close: string;
73
73
  };
74
+ giftVoucher: {
75
+ applicableGVInfo: string;
76
+ pmpSettingInfoBox: {
77
+ title: string;
78
+ description: string;
79
+ };
80
+ topupInfoBox: {
81
+ description: string;
82
+ };
83
+ };
74
84
  type: {
75
85
  payment: {
76
86
  title: string;
@@ -3,6 +3,7 @@ declare const _default: {
3
3
  topup: {
4
4
  title: string;
5
5
  charge: string;
6
+ selectChargeAmount: string;
6
7
  minAmount: string;
7
8
  maxAmount: string;
8
9
  maxErrorWithAmount: string;
@@ -56,6 +57,7 @@ declare const _default: {
56
57
  topup: {
57
58
  title: string;
58
59
  charge: string;
60
+ selectChargeAmount: string;
59
61
  minAmount: string;
60
62
  maxAmount: string;
61
63
  maxErrorWithAmount: string;
@@ -2,6 +2,7 @@ declare const _default: {
2
2
  topup: {
3
3
  title: string;
4
4
  charge: string;
5
+ selectChargeAmount: string;
5
6
  minAmount: string;
6
7
  maxAmount: string;
7
8
  maxErrorWithAmount: string;
@@ -1,51 +1,9 @@
1
+ import { PermissionNameType } from '../constants';
1
2
  import { NativeParams } from '../jsbridge-core/jsbridge';
2
3
  export declare enum PermissionStatus {
3
4
  granted = "GRANTED",
4
5
  denied = "DENIED"
5
6
  }
6
- export declare const PermissionName: {
7
- readonly mini_app_payment_balance: "mini_app_payment_balance";
8
- readonly mini_app_device_info: "mini_app_device_info";
9
- readonly mini_app_user_contacts: "mini_app_user_contacts";
10
- readonly mini_app_device_battery: "mini_app_device_battery";
11
- readonly mini_app_kyc: "mini_app_kyc";
12
- readonly mini_app_user_location: "mini_app_user_location";
13
- readonly mini_app_check_payment_method: "mini_app_check_payment_method";
14
- readonly cashback: "cashback";
15
- readonly bank_registration: "bank_registration";
16
- readonly mini_app_user_email_address: "mini_app_user_email_address";
17
- readonly mini_app_user_address: "mini_app_user_address";
18
- readonly mini_app_user_phone_camera: "mini_app_user_phone_camera";
19
- readonly mini_app_user_phone_album: "mini_app_user_phone_album";
20
- readonly mini_app_bank_information: "mini_app_bank_information";
21
- readonly mini_app_cashback_information: "mini_app_cashback_information";
22
- readonly mini_app_user_phone_number: "mini_app_user_phone_number";
23
- readonly mini_app_user_name: "mini_app_user_name";
24
- readonly mini_app_user_nickname: "mini_app_user_nickname";
25
- readonly mini_app_user_avatar: "mini_app_user_avatar";
26
- readonly mini_app_user_signup_date: "mini_app_user_signup_date";
27
- readonly mini_app_user_employer_info: "mini_app_user_employer_info";
28
- readonly mini_app_user_gender: "mini_app_user_gender";
29
- readonly direct_debit: "direct_debit";
30
- readonly continuous_payments: "continuous_payments";
31
- readonly pending_payments: "pending_payments";
32
- readonly preauth_capture_native: "preauth_capture_native";
33
- readonly mini_app_point_usage_setting: "mini_app_point_usage_setting";
34
- readonly mini_app_user_payment_limit: "mini_app_user_payment_limit";
35
- readonly mini_app_user_p2p_limit: "mini_app_user_p2p_limit";
36
- readonly mini_app_user_topup_limit: "mini_app_user_topup_limit";
37
- readonly merchant_topup: "merchant_topup";
38
- readonly mini_app_notification_center: "mini_app_notification_center";
39
- readonly push_notification: "push_notification";
40
- readonly notification_center_tl: "notification_center_tl";
41
- readonly user_info_softbank_user: "user_info_softbank_user";
42
- readonly user_info_yahoo_mobile_user: "user_info_yahoo_mobile_user";
43
- readonly user_info_yahoo_premium_user: "user_info_yahoo_premium_user";
44
- readonly user_info_tpoint: "user_info_tpoint";
45
- readonly mini_app_transaction: "mini_app_transaction";
46
- readonly mini_app_device_esim_info: "mini_app_device_esim_info";
47
- };
48
- export declare type PermissionNameType = (typeof PermissionName)[keyof typeof PermissionName];
49
7
  export declare type Permission = {
50
8
  blocker: boolean;
51
9
  name: string;
@@ -58,7 +16,7 @@ export interface GetPermissionStatusParams extends NativeParams<GetPermissionSta
58
16
  export declare type GrantedPermissionRespone = {
59
17
  unsigned?: {
60
18
  data?: {
61
- scopes?: Array<string>;
19
+ scopes?: Array<PermissionNameType>;
62
20
  };
63
21
  };
64
22
  };
@@ -1,6 +1,6 @@
1
1
  import { NativeParams } from '../jsbridge-core/jsbridge';
2
2
  import { UIComponentsError } from '../model/uiComponents';
3
- import { MiniAppErrorType } from '../model/miniAppError';
3
+ import { ErrorCodesType } from '../constants';
4
4
  export declare const Order: {
5
5
  readonly ACQUIRING: "ACQUIRING";
6
6
  readonly REMITTANCE: "REMITTANCE";
@@ -83,6 +83,7 @@ export declare const PaymentMethodName: {
83
83
  readonly SBID_CARRIER_BILLING: "SBID_CARRIER_BILLING";
84
84
  readonly PAY_LATER: "PAY_LATER";
85
85
  readonly PAY_LATER_CC: "PAY_LATER_CC";
86
+ readonly GIFT_VOUCHER: "GIFT_VOUCHER";
86
87
  };
87
88
  export declare type PaymentMethodNameType = (typeof PaymentMethodName)[keyof typeof PaymentMethodName];
88
89
  declare type GlobalLimitInfo = {
@@ -261,6 +262,24 @@ export declare type PayLaterCCInfo = {
261
262
  declare type PayLaterMethod = MethodBase & {
262
263
  paymentMethodType: 'PAY_LATER';
263
264
  };
265
+ export declare type GiftVoucherMethod = MethodBase & {
266
+ paymentMethodType: 'GIFT_VOUCHER';
267
+ overallGiftVoucherInfo?: {
268
+ availableAmount: string;
269
+ paymentMethodStatus: PaymentMethodStatus;
270
+ paymentMethodStatusLabel: string;
271
+ logoUrl: string;
272
+ labelInfo: {
273
+ text: string;
274
+ textColor: string;
275
+ boxColor: string;
276
+ };
277
+ detailInfo: {
278
+ text: string;
279
+ url: string;
280
+ };
281
+ };
282
+ };
264
283
  export declare type ResponseBase = {
265
284
  status: number;
266
285
  signed: {
@@ -271,11 +290,11 @@ export declare type ResponseBase = {
271
290
  };
272
291
  unsigned: {
273
292
  resultInfo: {
274
- code: MiniAppErrorType;
293
+ code: ErrorCodesType;
275
294
  };
276
295
  };
277
296
  };
278
- export declare type PaymentMethod = WalletMethod | CreditMethod | BankMethod | SbidBankMethod | PayLaterCCMethod | PayLaterMethod;
297
+ export declare type PaymentMethod = WalletMethod | CreditMethod | BankMethod | SbidBankMethod | PayLaterCCMethod | PayLaterMethod | GiftVoucherMethod;
279
298
  export declare type TopupFeeInfo = {
280
299
  feePercentage?: number;
281
300
  label: string;
@@ -284,6 +303,7 @@ export declare type TopupFeeInfo = {
284
303
  declare type PaymentMethodPreference = {
285
304
  preTransactionAutoChargeEnabled: boolean;
286
305
  prioritizedPaymentMethodsEnabled: boolean;
306
+ giftVouchersAutoSelectingEnabled: boolean;
287
307
  };
288
308
  declare type OverdraftBalanceInfo = {
289
309
  balance: number;
package/dist/types.d.ts CHANGED
@@ -3,12 +3,14 @@ import { Permission } from './types/getPermissionStatus';
3
3
  import { NativeParams, NativeResponse } from './jsbridge-core/jsbridge';
4
4
  import { MiniAppErrorType } from './model/miniAppError';
5
5
  import { OrderType } from './types/makePayment';
6
+ import { ErrorCodesType, PPFunctionNameType, PPUtilFunctionNameType } from './constants';
6
7
  declare global {
7
8
  type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
9
+ type ObjectValues<T> = T[keyof T];
8
10
  }
9
11
  export declare type MiniAppResult = Record<string, unknown>;
10
12
  export interface MiniAppErrorResultType {
11
- errorCode: MiniAppErrorType;
13
+ errorCode: MiniAppErrorType | ErrorCodesType;
12
14
  }
13
15
  export interface CopyToClipBoardParams extends NativeParams<void> {
14
16
  value: string;
@@ -259,28 +261,6 @@ export declare type AppDetail = {
259
261
  window: Window;
260
262
  subdomainCookieSharing: boolean;
261
263
  };
262
- export declare enum PpLocalStorageKey {
263
- accessToken = "ppjssdk.accessToken",
264
- refreshToken = "ppjssdk.refreshToken",
265
- env = "ppjssdk.env",
266
- deviceUUID = "ppjssdk.deviceUUID",
267
- clientUUID = "ppjssdk.clientUUID",
268
- lastPayment = "ppjssdk.lastPayment",
269
- lastTopup = "ppjssdk.lastTopup",
270
- appDetail = "ppjssdk.appDetail",
271
- appConfig = "ppjssdk.appConfig",
272
- userInfo = "ppjssdk.userInfo",
273
- lastPaymentMethod = "ppjssdk.lastPaymentMethod",
274
- lastTopupPayMethod = "ppjssdk.lastTopupPayMethod",
275
- codeVerifier = "ppjssdk.codeVerifier",
276
- clientOrigin = "ppjssdk.clientOrigin",
277
- clientVersion = "ppjssdk.clientVersion",
278
- debugMode = "ppjssdk.debugMode",
279
- claimCouponImmediately = "ppjssdk.claimCouponImmediately",
280
- merchant = "ppjssdk.merchant",
281
- consumedOTT = "ppjssdk.consumedOTT",
282
- initializedAt = "ppjssdk.initializedAt"
283
- }
284
264
  export declare enum RenderType {
285
265
  COVER = "cover",
286
266
  CONTAIN = "contain"
@@ -403,63 +383,6 @@ export declare type LinkOption = {
403
383
  export declare type HandleMessageFromNativeParams = {
404
384
  json: NativeResponse;
405
385
  };
406
- export declare const PPFunctionName: {
407
- readonly init: "init";
408
- readonly getBankInfo: "getBankInfo";
409
- readonly showAlert: "showAlert";
410
- readonly render: "render";
411
- readonly makePayment: "makePayment";
412
- readonly getUAID: "getUAID";
413
- readonly logout: "logout";
414
- readonly startMultiFactorAuth: "startMultiFactorAuth";
415
- readonly verifyMultiFactorAuthResult: "verifyMultiFactorAuthResult";
416
- readonly getPermissionStatus: "getPermissionStatus";
417
- readonly registerKyc: "registerKyc";
418
- readonly getKycInformation: "getKycInformation";
419
- readonly getUserAddress: "getUserAddress";
420
- readonly getUserLocation: "getUserLocation";
421
- readonly getUserProfile: "getUserProfile";
422
- readonly registerEmail: "registerEmail";
423
- readonly showUpdateWarning: "showUpdateWarning";
424
- readonly showErrorSheet: "showErrorSheet";
425
- readonly getPlatformInformation: "getPlatformInformation";
426
- readonly share: "share";
427
- readonly getTopBarHeight: "getTopBarHeight";
428
- readonly openWebview: "openWebview";
429
- readonly openMap: "openMap";
430
- readonly closeApp: "closeApp";
431
- readonly openApp: "openApp";
432
- readonly checkPaymentMethod: "checkPaymentMethod";
433
- readonly getBalance: "getBalance";
434
- readonly topup: "topup";
435
- readonly registerPaymentFeatures: "registerPaymentFeatures";
436
- readonly registerUserInfo: "registerUserInfo";
437
- readonly requestInternal: "requestInternal";
438
- readonly scanCode: "scanCode";
439
- readonly getAuthStatus: "getAuthStatus";
440
- readonly inputAddress: "inputAddress";
441
- readonly getCashbackInformation: "getCashbackInformation";
442
- readonly request: "request";
443
- readonly getDeviceInformation: "getDeviceInformation";
444
- readonly createOrder: "createOrder";
445
- readonly handleMessageFromNative: "handleMessageFromNative";
446
- readonly initKycPassport: "initKycPassport";
447
- readonly smsAuth: "smsAuth";
448
- readonly getKycPassportInfo: "getKycPassportInfo";
449
- };
450
- export declare type PPFunctionNameType = (typeof PPFunctionName)[keyof typeof PPFunctionName];
451
- export declare const PPUtilFunctionName: {
452
- readonly reload: "reload";
453
- readonly link: "link";
454
- readonly saveRefreshToken: "saveRefreshToken";
455
- readonly saveCodeVerifier: "saveCodeVerifier";
456
- readonly makeVisible: "makeVisible";
457
- readonly hideIframe: "hideIframe";
458
- readonly showIframe: "showIframe";
459
- readonly consoleDebugInfo: "consoleDebugInfo";
460
- readonly clientPopState: "clientPopState";
461
- };
462
- export declare type PPUtilFunctionNameType = (typeof PPUtilFunctionName)[keyof typeof PPUtilFunctionName];
463
386
  export declare type SaveCodeVerifierOption = {
464
387
  codeVerifier: string;
465
388
  domain: string;
@@ -1,4 +1,5 @@
1
- import { PPFunctionNameType, SdkType } from '../types';
1
+ import { PPFunctionNameType } from '../constants';
2
+ import { SdkType } from '../types';
2
3
  import { PPEnvType } from '../types/init';
3
4
  interface EventParams {
4
5
  env: PPEnvType;
@@ -1,4 +1,4 @@
1
- import { MiniAppErrorType } from '../model/miniAppError';
1
+ import { ErrorCodesType } from '../constants';
2
2
  import { UIComponentsError } from '../model/uiComponents';
3
3
  import { CashbackResponse, SmartPayParams } from '../types';
4
4
  import { PPFetchResult } from './fetch';
@@ -52,7 +52,7 @@ export interface TopupResponse {
52
52
  };
53
53
  unsigned: {
54
54
  resultInfo: {
55
- code: MiniAppErrorType;
55
+ code: ErrorCodesType;
56
56
  };
57
57
  data: TopupResponseData;
58
58
  };
@@ -111,7 +111,7 @@ export declare type GetAddressListResponse = {
111
111
  signed: unknown;
112
112
  unsigned: {
113
113
  resultInfo: {
114
- code: MiniAppErrorType;
114
+ code: ErrorCodesType;
115
115
  };
116
116
  data: {
117
117
  addresses: Address[];
@@ -124,12 +124,12 @@ export declare type GetOTPResponse = {
124
124
  signed: {
125
125
  jws: string;
126
126
  resultInfo: {
127
- code: MiniAppErrorType;
127
+ code: ErrorCodesType;
128
128
  };
129
129
  };
130
130
  unsigned: {
131
131
  resultInfo: {
132
- code: MiniAppErrorType;
132
+ code: ErrorCodesType;
133
133
  codeId?: string;
134
134
  };
135
135
  data: {
@@ -143,12 +143,12 @@ export declare type VerifyOTPResponse = {
143
143
  signed: {
144
144
  jws: string;
145
145
  resultInfo: {
146
- code: MiniAppErrorType;
146
+ code: ErrorCodesType;
147
147
  };
148
148
  };
149
149
  unsigned: {
150
150
  resultInfo: {
151
- code: MiniAppErrorType;
151
+ code: ErrorCodesType;
152
152
  };
153
153
  };
154
154
  };
@@ -192,7 +192,13 @@ export declare type VerifyKycPassportResponse = {
192
192
  data: GetKycPassportInfoResult;
193
193
  };
194
194
  };
195
- export declare function getInitKycPassport(params: InitKycPassportParams): Promise<PPFetchResult<KycTypeResponse, Record<string, unknown>>>;
195
+ export declare function getInitKycPassport(params: InitKycPassportParams): Promise<PPFetchResult<KycTypeResponse, {
196
+ unsigned: {
197
+ data: {
198
+ helpUrl?: string;
199
+ };
200
+ };
201
+ }>>;
196
202
  export declare function verifyOtp(body: VerifyOTPBody): Promise<PPFetchResult<VerifyOTPResponse, Record<string, unknown>>>;
197
203
  export declare function editAddress(body: NewAddress, id: number): Promise<PPFetchResult<GetAddressListResponse, Record<string, unknown>>>;
198
204
  export declare function deleteAddress(id: number): Promise<PPFetchResult<GetAddressListResponse, Record<string, unknown>>>;
@@ -1,5 +1,5 @@
1
- import { MiniAppErrorType } from '../model/miniAppError';
1
+ import { ErrorCodesType } from '../constants';
2
2
  export declare class PPError extends Error {
3
- errorCode: MiniAppErrorType;
4
- constructor(message: string, errorCode: MiniAppErrorType);
3
+ errorCode: ErrorCodesType;
4
+ constructor(message: string, errorCode: ErrorCodesType);
5
5
  }
@@ -1,4 +1,4 @@
1
- import { MiniAppErrorType } from '../model/miniAppError';
1
+ import { ErrorCodes, ErrorCodesType } from '../constants';
2
2
  import { UIComponentsError } from '../model/uiComponents';
3
3
  declare const createHeaderMiniAppApi: (urlEndpoint: string, authorizationRequired?: boolean, customHeaders?: Record<string, string> | undefined) => Headers | undefined;
4
4
  export declare type ErrorResponse = {
@@ -34,7 +34,6 @@ declare type APIBaseResponse = {
34
34
  resultCode?: string;
35
35
  };
36
36
  error?: unknown;
37
- helpUrl?: string;
38
37
  };
39
38
  };
40
39
  uiComponents?: {
@@ -57,28 +56,31 @@ export declare type PPFetchResult<T, E = Record<string, unknown>> = {
57
56
  statusCode: number;
58
57
  body: T;
59
58
  } | {
60
- ppFetchResult: 'apiError' | 'rateLimitExceeded';
61
- errorCode: MiniAppErrorType;
59
+ ppFetchResult: 'apiError' | 'rateLimitExceeded' | 'maintenance';
60
+ errorCode: ErrorCodesType;
62
61
  statusCode: number;
63
62
  body: APIBaseResponse & E;
64
63
  } | {
65
64
  ppFetchResult: 'notAuthorized';
66
- errorCode: MiniAppErrorType.notAuthorized;
65
+ errorCode: typeof ErrorCodes.notAuthorized;
67
66
  body: null;
68
67
  } | {
69
68
  ppFetchResult: 'fetchError';
70
- errorCode: MiniAppErrorType.serverError;
69
+ errorCode: typeof ErrorCodes.serverError;
71
70
  body: null;
72
71
  } | {
73
72
  ppFetchResult: 'timeout';
74
- errorCode: MiniAppErrorType.timeOut;
73
+ errorCode: typeof ErrorCodes.timeOut;
75
74
  body: null;
76
75
  } | {
77
76
  ppFetchResult: 'tokenExpired';
78
- errorCode: MiniAppErrorType.tokenExpired;
77
+ errorCode: typeof ErrorCodes.tokenExpired;
79
78
  statusCode: number;
80
79
  body?: null;
81
80
  };
82
81
  export declare function ppFetch<T, E = Record<string, unknown>>(options: PPFetchOptions): Promise<PPFetchResult<T, E>>;
83
- export declare function fetchRefreshToken(refreshToken: string, clientOrigin?: string): Promise<boolean>;
82
+ export declare function fetchRefreshToken(refreshToken: string, clientOrigin?: string): Promise<{
83
+ success: boolean;
84
+ errorCode?: ErrorCodesType;
85
+ }>;
84
86
  export { createHeaderMiniAppApi };
@@ -1,11 +1,11 @@
1
- import { MiniAppErrorType } from '../model/miniAppError';
1
+ import { ErrorCodesType } from '../constants';
2
2
  import { UIComponentsErrorButton } from '../model/uiComponents';
3
3
  import { ErrorSheetButton, PaymentLabelType, SmartPayParams } from '../types';
4
4
  import { FontSize } from '../types/getPlatformInformation';
5
5
  import { InitParams } from '../types/init';
6
6
  import { BankInfo, CreditCardInfo, InfoBanner, MakePaymentParams, OrderType, PayLaterCCInfo, PaymentMethod, SbidBankInfo } from '../types/makePayment';
7
+ import { PPFetchResult } from './fetch';
7
8
  export declare function isDef<T>(val: T): val is NonNullable<T>;
8
- export declare function isFunction(val: unknown): val is (...ars: Array<unknown>) => unknown;
9
9
  export declare function isNumeric(val: string | number): val is string;
10
10
  export declare function formatNumber(value: string, options?: {
11
11
  allowDot?: boolean;
@@ -51,9 +51,9 @@ export declare function clientStorageFunctionsAreAvailable(): boolean;
51
51
  export declare function shouldRemoveOTTFromQueryParams(initParams: InitParams): boolean;
52
52
  export declare function getPlatformFontSize(): FontSize;
53
53
  export declare function delay(time?: number): Promise<boolean>;
54
- export declare const createErrorCode: (errorCode: MiniAppErrorType, jws?: string | null | undefined) => {
55
- errorCode: MiniAppErrorType;
56
- jws: string | null | undefined;
54
+ export declare const createErrorCode: (errorCode: ErrorCodesType, jws?: string | null | undefined) => {
55
+ errorCode: ErrorCodesType;
56
+ jws?: string | null | undefined;
57
57
  };
58
58
  export declare function updateLocalisedString(data: string, target: string, value: string): string;
59
59
  export declare function handleHeightResize(el: HTMLElement, windowHeight: number, isScrollable: boolean, offsetHeight: number): boolean;
@@ -64,14 +64,13 @@ export declare function hasOmittedPrimaryButton(params: {
64
64
  filteredButtonList: UIComponentsErrorButton[] | undefined;
65
65
  }): boolean;
66
66
  export declare function checkPrimaryButtonNotPresent(buttonList: UIComponentsErrorButton[] | undefined): boolean;
67
- export declare function getFailErrorCode(ppFetchResult: string): MiniAppErrorType.timeOut | MiniAppErrorType.serverError | MiniAppErrorType.tokenExpired | MiniAppErrorType.notAuthorized | MiniAppErrorType.rateLimitExceeded;
67
+ export declare function getFailErrorCode(ppFetchResult: Exclude<PPFetchResult<unknown>['ppFetchResult'], 'success'>): "TIME_OUT" | "SERVER_ERROR" | "TOKEN_EXPIRED" | "NOT_AUTHORIZED" | "RATE_LIMIT_EXCEEDED" | "MAINTENANCE_MODE";
68
68
  export declare function getStoreUrl(): "https://play.google.com/store/apps/details?id=jp.ne.paypay.android.app" | "https://itunes.apple.com/app/id1435783608";
69
69
  export declare function generateCodeVerifier(length?: number): string;
70
70
  export declare function generateCodeChallenge(codeVerifier: string): Promise<string>;
71
71
  export declare function sha256Hex(text: string): Promise<string>;
72
72
  export declare function openUrl(linkUrl: string): void;
73
73
  export declare function getButtonType(button: UIComponentsErrorButton | ErrorSheetButton, primary?: boolean): "success" | "default" | "link" | "primary" | "warning" | "danger" | "outLined";
74
- export declare function getRandomString(): string;
75
74
  export declare function isAlphabet(value: string): boolean;
76
75
  export declare function reconstructKycPassportCallbackUrl(url: string, type: string): string;
77
76
  export declare function isBffSitEnvironment(): boolean;
@@ -80,7 +79,7 @@ export declare function validateUrl(url: string): boolean;
80
79
  export declare function constructUrl(baseUrl: string, params: Record<string, string | string[] | number | number[] | boolean | undefined>): string;
81
80
  export declare function makeDefaultErrorHandler(params: {
82
81
  fail?: (error: {
83
- errorCode: MiniAppErrorType;
82
+ errorCode: ErrorCodesType;
84
83
  }) => void;
85
84
  } | undefined, onComplete: () => void): (err: unknown) => void;
86
85
  export declare function getCardBrandImage(brandName: string): string;
@@ -97,4 +96,5 @@ export declare function getOverDraftInfoBanner(banners?: Array<InfoBanner>): Inf
97
96
  export declare function isValidUrl(urlChallenge: string): boolean;
98
97
  export declare function calculateTopMargin(navigationStyle: string, statusBarHeight: number, navBarHeight: number): number;
99
98
  export declare function getWindowByName(frames: Window, windowName: string): Window | undefined;
99
+ export declare function isPaymentMethodDisabled(paymentMethod: PaymentMethod, ignoreBankMaintenanceFlag?: boolean): boolean;
100
100
  export {};
@@ -1,5 +1,5 @@
1
- import { MiniAppErrorType } from '../model/miniAppError';
2
- export declare const errorCodes: Map<number, MiniAppErrorType>;
1
+ import { ErrorCodesType } from '../constants';
2
+ export declare const errorCodes: Map<number, ErrorCodesType>;
3
3
  declare type MiniAppRequestParams = {
4
4
  url: string;
5
5
  headers: Headers;
@@ -0,0 +1,2 @@
1
+ export declare function isFunction(val: unknown): val is (...ars: Array<unknown>) => unknown;
2
+ export declare function getRandomString(): string;
@@ -10,7 +10,7 @@ export declare function saveRefreshToken(token: string): void;
10
10
  export declare function getConsumedOtt(): string | null;
11
11
  export declare function saveConsumedOtt(ott: string): void;
12
12
  export declare function saveEnv(env?: PPEnvType): void;
13
- export declare function getEnv(): PPEnvType | null;
13
+ export declare function getEnv(): PPEnvType;
14
14
  export declare function isProdEnv(): boolean;
15
15
  export declare function saveClientUUID(uuid: string): void;
16
16
  export declare function getClientUUID(): string;
@@ -1,3 +1,4 @@
1
+ import { ErrorCodesType } from '../constants';
1
2
  declare enum MessageType {
2
3
  request = "request",
3
4
  response = "response",
@@ -19,6 +20,7 @@ export interface MessageCallbackType extends MessageBaseType {
19
20
  args: Array<unknown>;
20
21
  }
21
22
  export declare type Callbacks = Record<string, (...args: Array<unknown>) => void>;
23
+ export declare type ErrorLogger = (functionName: string, message: string, error: ErrorCodesType) => void;
22
24
  export declare type MessageRequestType = MessageBaseType & PartialMessageRequestType;
23
25
  export declare type Params = Array<any>;
24
26
  export interface FunctionType {
@@ -38,6 +40,7 @@ export declare class WindowBridge {
38
40
  private allowedOrigins?;
39
41
  private middlewares;
40
42
  private registeredCallbacks;
43
+ private errorLogger?;
41
44
  private constructor();
42
45
  private subscribeToMessageEvent;
43
46
  private unsubscribeToMessageEvent;
@@ -52,7 +55,7 @@ export declare class WindowBridge {
52
55
  private sendMessage;
53
56
  private sendRequest;
54
57
  private addFunctionCallbacks;
55
- static init(functions: FunctionsCollection, allowedOrigins?: Array<string>, middlewares?: Array<Middleware>): WindowBridge;
58
+ static init(functions: FunctionsCollection, allowedOrigins?: Array<string>, middlewares?: Array<Middleware>, errorLogger?: ErrorLogger): WindowBridge;
56
59
  static destroy(): void;
57
60
  static getBridge(): WindowBridge;
58
61
  static getTargetWindowFunctionProxy<T extends FunctionsCollection = FunctionsCollection>(getTargetWindow: GetTargetWindowFunctionType, targetWindowOrigin: string): T;
@@ -1,4 +1,4 @@
1
- import { MiniAppErrorType } from '../../../model/miniAppError';
1
+ import { ErrorCodesType } from '../../../constants';
2
2
  import { ResponseBase } from '../../../types/makePayment';
3
3
  import { PPFetchResult } from '../../../utils/fetch';
4
4
  export declare type API_TYPES = 'consult' | 'payment' | 'topup' | 'paymentMethod' | 'address';
@@ -8,4 +8,4 @@ export declare function createErrorFromType(type?: string): {
8
8
  errorDescription: string;
9
9
  errorIcon: string;
10
10
  };
11
- export declare function createErrorCodeForFailCallBack(res: PPFetchResult<ResponseBase>, api: API_TYPES | API_TYPES_NEVER_RETURN): MiniAppErrorType;
11
+ export declare function createErrorCodeForFailCallBack(res: PPFetchResult<ResponseBase>, api: API_TYPES | API_TYPES_NEVER_RETURN): ErrorCodesType;