@paypay/mini-app-js-sdk 2.56.0 → 2.58.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.
- package/dist/client/communicationWithCore.d.ts +2 -1
- package/dist/composition-api/useKycPassport.d.ts +2 -2
- package/dist/constants/clientUtilFunctionName.d.ts +1 -0
- package/dist/constants/errorCodes.d.ts +1 -0
- package/dist/constants/index.d.ts +11 -0
- package/dist/constants/localStorageKeys.d.ts +1 -0
- package/dist/constants/permissionName.d.ts +1 -0
- package/dist/constants/sdkFunctionNames.d.ts +1 -0
- package/dist/core/coreFunctions/renderButton/types.d.ts +1 -0
- package/dist/core/sentry.d.ts +2 -2
- package/dist/mini-app-js-sdk.browser.js +1 -1
- package/dist/mini-app-js-sdk.es.js +85 -1211
- package/dist/model/miniAppError.d.ts +2 -1
- package/dist/model/permission.d.ts +2 -1
- package/dist/resources/images.d.ts +1 -0
- package/dist/resources/locales/payment/index.d.ts +20 -0
- package/dist/resources/locales/payment/ja.d.ts +10 -0
- package/dist/resources/locales/topup/index.d.ts +2 -0
- package/dist/resources/locales/topup/ja.d.ts +1 -0
- package/dist/types/getPermissionStatus.d.ts +1 -43
- package/dist/types/makePayment.d.ts +23 -3
- package/dist/types.d.ts +3 -80
- package/dist/utils/analytics.d.ts +2 -1
- package/dist/utils/api.d.ts +7 -7
- package/dist/utils/errors.d.ts +3 -3
- package/dist/utils/fetch.d.ts +6 -6
- package/dist/utils/helper.d.ts +7 -8
- package/dist/utils/miniAppRequest.d.ts +2 -2
- package/dist/utils/pureHelpers.d.ts +2 -0
- package/dist/utils/storage.d.ts +1 -1
- package/dist/utils/windowBridge.d.ts +4 -1
- package/dist/views/make-payment/store/util-for-handle-error.d.ts +2 -2
- package/dist/views/make-payment/store.d.ts +8525 -603
- package/package.json +1 -1
|
@@ -69,5 +69,6 @@ export declare enum MiniAppErrorType {
|
|
|
69
69
|
rateLimitExceeded = "RATE_LIMIT_EXCEEDED",
|
|
70
70
|
sdkUpgradeRequired = "SDK_UPGRADE_REQUIRED",
|
|
71
71
|
authorizationNeeded = "AUTHORIZATION_NEEDED",
|
|
72
|
-
invalidVirtualAccount = "INVALID_VIRTUAL_ACCOUNT"
|
|
72
|
+
invalidVirtualAccount = "INVALID_VIRTUAL_ACCOUNT",
|
|
73
|
+
notSupportedUser = "NOT_SUPPORTED_USER"
|
|
73
74
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { PermissionNameType
|
|
1
|
+
import { PermissionNameType } from '../constants';
|
|
2
|
+
import { PermissionStatus } from '../types/getPermissionStatus';
|
|
2
3
|
export declare const checkPermission: (permissionNames: string[] | string) => Promise<PermissionStatus>;
|
|
3
4
|
export declare function getUserGrantedPermission(): Promise<PermissionNameType[]>;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NativeParams } from '../jsbridge-core/jsbridge';
|
|
2
2
|
import { UIComponentsError } from '../model/uiComponents';
|
|
3
|
-
import {
|
|
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:
|
|
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;
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
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:
|
|
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:
|
|
127
|
+
code: ErrorCodesType;
|
|
128
128
|
};
|
|
129
129
|
};
|
|
130
130
|
unsigned: {
|
|
131
131
|
resultInfo: {
|
|
132
|
-
code:
|
|
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:
|
|
146
|
+
code: ErrorCodesType;
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
149
|
unsigned: {
|
|
150
150
|
resultInfo: {
|
|
151
|
-
code:
|
|
151
|
+
code: ErrorCodesType;
|
|
152
152
|
};
|
|
153
153
|
};
|
|
154
154
|
};
|
package/dist/utils/errors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ErrorCodesType } from '../constants';
|
|
2
2
|
export declare class PPError extends Error {
|
|
3
|
-
errorCode:
|
|
4
|
-
constructor(message: string, errorCode:
|
|
3
|
+
errorCode: ErrorCodesType;
|
|
4
|
+
constructor(message: string, errorCode: ErrorCodesType);
|
|
5
5
|
}
|
package/dist/utils/fetch.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 = {
|
|
@@ -58,24 +58,24 @@ export declare type PPFetchResult<T, E = Record<string, unknown>> = {
|
|
|
58
58
|
body: T;
|
|
59
59
|
} | {
|
|
60
60
|
ppFetchResult: 'apiError' | 'rateLimitExceeded';
|
|
61
|
-
errorCode:
|
|
61
|
+
errorCode: ErrorCodesType;
|
|
62
62
|
statusCode: number;
|
|
63
63
|
body: APIBaseResponse & E;
|
|
64
64
|
} | {
|
|
65
65
|
ppFetchResult: 'notAuthorized';
|
|
66
|
-
errorCode:
|
|
66
|
+
errorCode: typeof ErrorCodes.notAuthorized;
|
|
67
67
|
body: null;
|
|
68
68
|
} | {
|
|
69
69
|
ppFetchResult: 'fetchError';
|
|
70
|
-
errorCode:
|
|
70
|
+
errorCode: typeof ErrorCodes.serverError;
|
|
71
71
|
body: null;
|
|
72
72
|
} | {
|
|
73
73
|
ppFetchResult: 'timeout';
|
|
74
|
-
errorCode:
|
|
74
|
+
errorCode: typeof ErrorCodes.timeOut;
|
|
75
75
|
body: null;
|
|
76
76
|
} | {
|
|
77
77
|
ppFetchResult: 'tokenExpired';
|
|
78
|
-
errorCode:
|
|
78
|
+
errorCode: typeof ErrorCodes.tokenExpired;
|
|
79
79
|
statusCode: number;
|
|
80
80
|
body?: null;
|
|
81
81
|
};
|
package/dist/utils/helper.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
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
7
|
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
8
|
export declare function isNumeric(val: string | number): val is string;
|
|
10
9
|
export declare function formatNumber(value: string, options?: {
|
|
11
10
|
allowDot?: boolean;
|
|
@@ -51,9 +50,9 @@ export declare function clientStorageFunctionsAreAvailable(): boolean;
|
|
|
51
50
|
export declare function shouldRemoveOTTFromQueryParams(initParams: InitParams): boolean;
|
|
52
51
|
export declare function getPlatformFontSize(): FontSize;
|
|
53
52
|
export declare function delay(time?: number): Promise<boolean>;
|
|
54
|
-
export declare const createErrorCode: (errorCode:
|
|
55
|
-
errorCode:
|
|
56
|
-
jws
|
|
53
|
+
export declare const createErrorCode: (errorCode: ErrorCodesType, jws?: string | null | undefined) => {
|
|
54
|
+
errorCode: ErrorCodesType;
|
|
55
|
+
jws?: string | null | undefined;
|
|
57
56
|
};
|
|
58
57
|
export declare function updateLocalisedString(data: string, target: string, value: string): string;
|
|
59
58
|
export declare function handleHeightResize(el: HTMLElement, windowHeight: number, isScrollable: boolean, offsetHeight: number): boolean;
|
|
@@ -64,14 +63,13 @@ export declare function hasOmittedPrimaryButton(params: {
|
|
|
64
63
|
filteredButtonList: UIComponentsErrorButton[] | undefined;
|
|
65
64
|
}): boolean;
|
|
66
65
|
export declare function checkPrimaryButtonNotPresent(buttonList: UIComponentsErrorButton[] | undefined): boolean;
|
|
67
|
-
export declare function getFailErrorCode(ppFetchResult: string):
|
|
66
|
+
export declare function getFailErrorCode(ppFetchResult: string): "TIME_OUT" | "SERVER_ERROR" | "TOKEN_EXPIRED" | "NOT_AUTHORIZED" | "RATE_LIMIT_EXCEEDED";
|
|
68
67
|
export declare function getStoreUrl(): "https://play.google.com/store/apps/details?id=jp.ne.paypay.android.app" | "https://itunes.apple.com/app/id1435783608";
|
|
69
68
|
export declare function generateCodeVerifier(length?: number): string;
|
|
70
69
|
export declare function generateCodeChallenge(codeVerifier: string): Promise<string>;
|
|
71
70
|
export declare function sha256Hex(text: string): Promise<string>;
|
|
72
71
|
export declare function openUrl(linkUrl: string): void;
|
|
73
72
|
export declare function getButtonType(button: UIComponentsErrorButton | ErrorSheetButton, primary?: boolean): "success" | "default" | "link" | "primary" | "warning" | "danger" | "outLined";
|
|
74
|
-
export declare function getRandomString(): string;
|
|
75
73
|
export declare function isAlphabet(value: string): boolean;
|
|
76
74
|
export declare function reconstructKycPassportCallbackUrl(url: string, type: string): string;
|
|
77
75
|
export declare function isBffSitEnvironment(): boolean;
|
|
@@ -80,7 +78,7 @@ export declare function validateUrl(url: string): boolean;
|
|
|
80
78
|
export declare function constructUrl(baseUrl: string, params: Record<string, string | string[] | number | number[] | boolean | undefined>): string;
|
|
81
79
|
export declare function makeDefaultErrorHandler(params: {
|
|
82
80
|
fail?: (error: {
|
|
83
|
-
errorCode:
|
|
81
|
+
errorCode: ErrorCodesType;
|
|
84
82
|
}) => void;
|
|
85
83
|
} | undefined, onComplete: () => void): (err: unknown) => void;
|
|
86
84
|
export declare function getCardBrandImage(brandName: string): string;
|
|
@@ -97,4 +95,5 @@ export declare function getOverDraftInfoBanner(banners?: Array<InfoBanner>): Inf
|
|
|
97
95
|
export declare function isValidUrl(urlChallenge: string): boolean;
|
|
98
96
|
export declare function calculateTopMargin(navigationStyle: string, statusBarHeight: number, navBarHeight: number): number;
|
|
99
97
|
export declare function getWindowByName(frames: Window, windowName: string): Window | undefined;
|
|
98
|
+
export declare function isPaymentMethodDisabled(paymentMethod: PaymentMethod, ignoreBankMaintenanceFlag?: boolean): boolean;
|
|
100
99
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const errorCodes: Map<number,
|
|
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;
|
package/dist/utils/storage.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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 {
|
|
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):
|
|
11
|
+
export declare function createErrorCodeForFailCallBack(res: PPFetchResult<ResponseBase>, api: API_TYPES | API_TYPES_NEVER_RETURN): ErrorCodesType;
|