@paypay/mini-app-js-sdk 2.14.0 → 2.16.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/coreIframe.d.ts +0 -1
- package/dist/client/index.d.ts +12 -6
- package/dist/client/supportedFunctionsList.d.ts +1 -1
- package/dist/composition-api/useGetUserAddress.d.ts +1 -1
- package/dist/composition-api/useInpuAddress.d.ts +1 -1
- package/dist/composition-api/useKycPassport.d.ts +1 -1
- package/dist/composition-api/useMakePayment.d.ts +1 -1
- package/dist/composition-api/useRegisterEmail.d.ts +2 -1
- package/dist/composition-api/useShowUpdateWarning.d.ts +1 -1
- package/dist/composition-api/useShowUpdateWarningKycPassport.d.ts +2 -2
- package/dist/composition-api/useTopup.d.ts +1 -1
- package/dist/core/coreFunctions/getPaymentSettings.d.ts +22 -0
- package/dist/core/coreFunctions/index.d.ts +1 -0
- package/dist/core/coreUtils.d.ts +4 -2
- package/dist/core/sentry.d.ts +1 -0
- package/dist/environment-variables.d.ts +5 -0
- package/dist/mini-app-api.d.ts +31 -4
- package/dist/mini-app-js-sdk.browser.js +1 -1
- package/dist/mini-app-js-sdk.es.js +5582 -77
- package/dist/model/OPAErrorCodes.d.ts +4 -0
- package/dist/model/bridge/checkAccessToken.d.ts +4 -2
- package/dist/model/bridge/checkPaymentMethod.d.ts +1 -1
- package/dist/model/bridge/getAuthStatus.d.ts +1 -1
- package/dist/model/bridge/getBalance.d.ts +1 -1
- package/dist/model/bridge/getBankInfo.d.ts +2 -2
- package/dist/model/bridge/getDeviceInformation.d.ts +2 -2
- package/dist/model/bridge/getKycInformation.d.ts +1 -1
- package/dist/model/bridge/getKycPassportInfo.d.ts +1 -1
- package/dist/model/bridge/getLoginUrl.d.ts +2 -1
- package/dist/model/bridge/getPermissionStatus.d.ts +1 -1
- package/dist/model/bridge/getPlatformInformation.d.ts +2 -2
- package/dist/model/bridge/getTopBarHeight.d.ts +2 -2
- package/dist/model/bridge/getTransactionInfo.d.ts +2 -0
- package/dist/model/bridge/getTransactions.d.ts +2 -0
- package/dist/model/bridge/getUAID.d.ts +2 -2
- package/dist/model/bridge/getUserAddress.d.ts +1 -1
- package/dist/model/bridge/getUserLocation.d.ts +1 -1
- package/dist/model/bridge/getUserPaymentFeatureSettings.d.ts +1 -1
- package/dist/model/bridge/getUserProfile.d.ts +2 -2
- package/dist/model/bridge/init.d.ts +1 -1
- package/dist/model/bridge/initKycPassport.d.ts +1 -1
- package/dist/model/bridge/inputAddress.d.ts +1 -1
- package/dist/model/bridge/logout.d.ts +2 -2
- package/dist/model/bridge/makePayment.d.ts +2 -2
- package/dist/model/bridge/openWebview.d.ts +1 -1
- package/dist/model/bridge/registerEmail.d.ts +2 -1
- package/dist/model/bridge/registerKyc.d.ts +1 -1
- package/dist/model/bridge/showUpdateWarning.d.ts +1 -1
- package/dist/model/bridge/startMultiFactorAuth.d.ts +1 -1
- package/dist/model/bridge/topup.d.ts +1 -1
- package/dist/model/bridge/verifyMultiFactorAuthResult.d.ts +1 -1
- package/dist/model/makePayment.d.ts +18 -17
- package/dist/model/miniAppError.d.ts +4 -1
- package/dist/model/permission.d.ts +2 -22
- package/dist/package/button/index.d.ts +3 -3
- package/dist/resources/en.d.ts +2 -0
- package/dist/resources/ja.d.ts +2 -0
- package/dist/types/checkPaymentMethod.d.ts +20 -0
- package/dist/types/getAuthStatus.d.ts +22 -0
- package/dist/types/getBalance.d.ts +31 -0
- package/dist/types/getBankInfo.d.ts +32 -0
- package/dist/types/getDeviceInformation.d.ts +3 -0
- package/dist/types/getKycInformation.d.ts +50 -0
- package/dist/types/getKycPassportInfo.d.ts +21 -0
- package/dist/types/getPermissionStatus.d.ts +68 -0
- package/dist/types/getPlatformInformation.d.ts +7 -0
- package/dist/types/getTopBarHeight.d.ts +3 -0
- package/dist/types/getTransactionInfo.d.ts +32 -0
- package/dist/types/getTransactions.d.ts +16 -0
- package/dist/types/getUAID.d.ts +3 -0
- package/dist/types/getUserAddress.d.ts +39 -0
- package/dist/types/getUserLocation.d.ts +13 -0
- package/dist/types/getUserPaymentFeatureSettings.d.ts +16 -0
- package/dist/types/getUserProfile.d.ts +25 -0
- package/dist/types/init.d.ts +41 -0
- package/dist/types/initKycPassport.d.ts +12 -0
- package/dist/types/logout.d.ts +3 -0
- package/dist/types/makePayment.d.ts +46 -0
- package/dist/types/openWebview.d.ts +11 -0
- package/dist/types/registerEmail.d.ts +5 -0
- package/dist/types/registerKycParams.d.ts +8 -0
- package/dist/types/showUpdateWarning.d.ts +12 -0
- package/dist/types/startMultiFactorAuth.d.ts +10 -0
- package/dist/types/topup.d.ts +18 -0
- package/dist/types/verifyMultiFactorAuthResult.d.ts +15 -0
- package/dist/types.d.ts +10 -211
- package/dist/utils/analytics.d.ts +2 -1
- package/dist/utils/api.d.ts +13 -13
- package/dist/utils/fetch.d.ts +8 -2
- package/dist/utils/getLanguage.d.ts +2 -0
- package/dist/utils/helper.d.ts +3 -2
- package/dist/utils/storage.d.ts +3 -2
- package/dist/utils/windowBridge.d.ts +4 -1
- package/dist/views/registerPaymentFeatures/types.d.ts +4 -4
- package/package.json +5 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PPFunctionNameType } from '../types';
|
|
2
|
+
import { PPEnvType } from '../types/init';
|
|
2
3
|
export declare function logSDKEvent(eventName: string, eventParams: {
|
|
3
4
|
event_category: string;
|
|
4
5
|
event_label?: string;
|
|
@@ -6,5 +7,5 @@ export declare function logSDKEvent(eventName: string, eventParams: {
|
|
|
6
7
|
event_action?: string;
|
|
7
8
|
error_value?: string;
|
|
8
9
|
event_label2?: unknown;
|
|
9
|
-
}): void;
|
|
10
|
+
}, env?: PPEnvType): void;
|
|
10
11
|
export declare function handleLogSDKEvent(name: PPFunctionNameType, eventActionSuffix: string, errorValue?: string, params?: unknown): void;
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { MiniAppErrorType } from '../model/miniAppError';
|
|
2
2
|
import { UIComponentsError } from '../model/uiComponents';
|
|
3
|
-
import {
|
|
3
|
+
import { CashbackResponse, SmartPayParams } from '../types';
|
|
4
|
+
import { Address, NewAddress } from '../types/getUserAddress';
|
|
5
|
+
import { MakePaymentParams } from '../types/makePayment';
|
|
6
|
+
import { GetKycPassportInfoResult } from '../types/getKycPassportInfo';
|
|
7
|
+
import { InitKycPassportParams } from '../types/initKycPassport';
|
|
4
8
|
export declare type TopupQuery = {
|
|
5
9
|
merchant?: string;
|
|
6
10
|
agreeSimilarTransaction?: boolean;
|
|
@@ -75,19 +79,24 @@ export declare type WalletInfo = {
|
|
|
75
79
|
};
|
|
76
80
|
export declare function topup(queryParams: TopupQuery, body: TopupBody, paymentParams?: MakePaymentParams): Promise<{
|
|
77
81
|
ppFetchResult: "notAuthorized";
|
|
82
|
+
errorCode: MiniAppErrorType.notAuthorized;
|
|
78
83
|
body: null;
|
|
79
84
|
} | {
|
|
80
85
|
ppFetchResult: "fetchError";
|
|
86
|
+
errorCode: MiniAppErrorType.serverError;
|
|
81
87
|
body: null;
|
|
82
88
|
} | {
|
|
83
89
|
ppFetchResult: "timeout";
|
|
90
|
+
errorCode: MiniAppErrorType.timeOut;
|
|
84
91
|
body: null;
|
|
85
92
|
} | {
|
|
86
93
|
ppFetchResult: "tokenExpired";
|
|
94
|
+
errorCode: MiniAppErrorType.tokenExpired;
|
|
87
95
|
statusCode: number;
|
|
88
96
|
body?: null | undefined;
|
|
89
97
|
} | {
|
|
90
|
-
ppFetchResult: "
|
|
98
|
+
ppFetchResult: "apiError";
|
|
99
|
+
errorCode: MiniAppErrorType;
|
|
91
100
|
statusCode: number;
|
|
92
101
|
body: ({
|
|
93
102
|
signed: {
|
|
@@ -236,22 +245,13 @@ export declare type VerifyKycPassportResponse = {
|
|
|
236
245
|
resultInfo?: {
|
|
237
246
|
code?: string;
|
|
238
247
|
};
|
|
239
|
-
jws
|
|
248
|
+
jws: string;
|
|
240
249
|
};
|
|
241
250
|
unsigned: {
|
|
242
251
|
resultInfo?: {
|
|
243
252
|
code?: string;
|
|
244
253
|
};
|
|
245
|
-
data
|
|
246
|
-
status?: string;
|
|
247
|
-
kycAt?: string;
|
|
248
|
-
type?: string;
|
|
249
|
-
eKycDocuments?: string;
|
|
250
|
-
kycInfo?: unknown;
|
|
251
|
-
kycPassportMethod?: string;
|
|
252
|
-
nonce: string;
|
|
253
|
-
possessionAuthResult: 'SUCCESS' | 'FAILED';
|
|
254
|
-
};
|
|
254
|
+
data: GetKycPassportInfoResult;
|
|
255
255
|
};
|
|
256
256
|
};
|
|
257
257
|
export declare function getInitKycPassport(params: InitKycPassportParams): Promise<import("./fetch").PPFetchResult<KycTypeResponse, Record<string, unknown>>>;
|
package/dist/utils/fetch.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MiniAppErrorType } from '../model/miniAppError';
|
|
1
2
|
import { UIComponentsError } from '../model/uiComponents';
|
|
2
3
|
declare const createHeaderMiniAppApi: (urlEndpoint: string, authorizationRequired?: boolean, customHeaders?: Record<string, string> | undefined) => Headers | undefined;
|
|
3
4
|
export declare type ErrorResponse = {
|
|
@@ -8,7 +9,7 @@ export declare type ErrorResponse = {
|
|
|
8
9
|
declare type PPFetchOptions = {
|
|
9
10
|
method: string;
|
|
10
11
|
url: string;
|
|
11
|
-
params?: Record<string, string | number | boolean | undefined>;
|
|
12
|
+
params?: Record<string, string | string[] | number | number[] | boolean | undefined>;
|
|
12
13
|
data?: unknown;
|
|
13
14
|
headers?: Record<string, string>;
|
|
14
15
|
suppressRefresh?: boolean;
|
|
@@ -51,20 +52,25 @@ export declare type PPFetchResult<T, E = Record<string, unknown>> = {
|
|
|
51
52
|
statusCode: number;
|
|
52
53
|
body: T;
|
|
53
54
|
} | {
|
|
54
|
-
ppFetchResult: '
|
|
55
|
+
ppFetchResult: 'apiError';
|
|
56
|
+
errorCode: MiniAppErrorType;
|
|
55
57
|
statusCode: number;
|
|
56
58
|
body: APIBaseResponse & E;
|
|
57
59
|
} | {
|
|
58
60
|
ppFetchResult: 'notAuthorized';
|
|
61
|
+
errorCode: MiniAppErrorType.notAuthorized;
|
|
59
62
|
body: null;
|
|
60
63
|
} | {
|
|
61
64
|
ppFetchResult: 'fetchError';
|
|
65
|
+
errorCode: MiniAppErrorType.serverError;
|
|
62
66
|
body: null;
|
|
63
67
|
} | {
|
|
64
68
|
ppFetchResult: 'timeout';
|
|
69
|
+
errorCode: MiniAppErrorType.timeOut;
|
|
65
70
|
body: null;
|
|
66
71
|
} | {
|
|
67
72
|
ppFetchResult: 'tokenExpired';
|
|
73
|
+
errorCode: MiniAppErrorType.tokenExpired;
|
|
68
74
|
statusCode: number;
|
|
69
75
|
body?: null;
|
|
70
76
|
};
|
package/dist/utils/helper.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { MiniAppErrorType } from '../model/miniAppError';
|
|
|
2
2
|
import { BankInfo, CreditCardInfo, SbidBankInfo, PayLaterCCInfo } from '../model/makePayment';
|
|
3
3
|
import { UIComponentsErrorButton } from '../model/uiComponents';
|
|
4
4
|
import { ErrorSheetButton } from '../types';
|
|
5
|
+
import { FontSize } from '../types/getPlatformInformation';
|
|
5
6
|
export declare function isDef<T>(val: T): val is NonNullable<T>;
|
|
6
7
|
export declare function isFunction(val: unknown): val is () => void;
|
|
7
8
|
export declare function isNumeric(val: string | number): val is string;
|
|
@@ -44,7 +45,6 @@ export declare function getEventLabel(merchant?: string | null): string;
|
|
|
44
45
|
export declare function getEventCategory(): string;
|
|
45
46
|
export declare function semVerCompare(a: string, b: string): boolean;
|
|
46
47
|
export declare function checkVersion(minVersion: string): boolean;
|
|
47
|
-
declare type FontSize = 'REGULAR' | 'LARGE' | 'EXTRA_LARGE';
|
|
48
48
|
export declare function getPlatformFontSize(): FontSize;
|
|
49
49
|
export declare function delay(time?: number): Promise<boolean>;
|
|
50
50
|
export declare const createErrorCode: (errorCode: MiniAppErrorType, jws?: string | null | undefined) => {
|
|
@@ -55,7 +55,7 @@ export declare function updateLocalisedString(data: string, target: string, valu
|
|
|
55
55
|
export declare function handleHeightResize(el: HTMLElement, windowHeight: number, isScrollable: boolean, offsetHeight: number): boolean;
|
|
56
56
|
export declare function getPaymentMethodStatus(isExpired: boolean, paymentMethodInfo?: BankInfo | CreditCardInfo | SbidBankInfo | PayLaterCCInfo): unknown;
|
|
57
57
|
export declare function filterErrorButtonList(buttonList: UIComponentsErrorButton[] | null): UIComponentsErrorButton[] | undefined;
|
|
58
|
-
export declare function getFailErrorCode(ppFetchResult: string): MiniAppErrorType.timeOut | MiniAppErrorType.serverError | MiniAppErrorType.
|
|
58
|
+
export declare function getFailErrorCode(ppFetchResult: string): MiniAppErrorType.timeOut | MiniAppErrorType.serverError | MiniAppErrorType.tokenExpired | MiniAppErrorType.notAuthorized;
|
|
59
59
|
export declare function getStoreUrl(): "https://play.google.com/store/apps/details?id=jp.ne.paypay.android.app" | "https://itunes.apple.com/app/id1435783608";
|
|
60
60
|
export declare function generateCodeVerifier(length?: number): string;
|
|
61
61
|
export declare function generateCodeChallenge(codeVerifier: string): Promise<string>;
|
|
@@ -68,4 +68,5 @@ export declare function reconstructKycPassportCallbackUrl(url: string, type: str
|
|
|
68
68
|
export declare function getValueFromUA(paramName: string): string | undefined;
|
|
69
69
|
export declare function replaceStringPlaceholders(str: string, values: Record<string, string>): string;
|
|
70
70
|
export declare function validateUrl(url: string): boolean;
|
|
71
|
+
export declare function constructUrl(baseUrl: string, params: Record<string, string | string[] | number | number[] | boolean | undefined>): string;
|
|
71
72
|
export {};
|
package/dist/utils/storage.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PpLocalStorageKey } from '../types';
|
|
2
|
+
import { PPEnvType } from '../types/init';
|
|
2
3
|
export declare function getKeyWithClientId(baseKey: PpLocalStorageKey): string;
|
|
3
4
|
export declare function getAccessToken(): string | null;
|
|
4
5
|
export declare function saveLocalStorage(key: string, value: string): void;
|
|
@@ -12,8 +13,8 @@ export declare function getRefreshToken(): string;
|
|
|
12
13
|
export declare function saveRefreshToken(token: string): void;
|
|
13
14
|
export declare function getConsumedOtt(): string | null;
|
|
14
15
|
export declare function saveConsumedOtt(ott: string): void;
|
|
15
|
-
export declare function saveEnv(env
|
|
16
|
-
export declare function getEnv():
|
|
16
|
+
export declare function saveEnv(env?: PPEnvType): void;
|
|
17
|
+
export declare function getEnv(): PPEnvType | null;
|
|
17
18
|
export declare function isProdEnv(): boolean;
|
|
18
19
|
export declare function getClientUUID(): string;
|
|
19
20
|
export declare function getDeviceUUIDFromNative(): string;
|
|
@@ -5,18 +5,21 @@ export declare type WindowBridgeFunctions<T extends FunctionsCollection> = {
|
|
|
5
5
|
[K in keyof T]: Parameters<T[K]>[0] extends undefined ? () => Promise<Awaited<ReturnType<T[K]>>> : (params: Parameters<T[K]>[0]) => Promise<Awaited<ReturnType<T[K]>>>;
|
|
6
6
|
};
|
|
7
7
|
export declare class WindowBridge {
|
|
8
|
-
private static _instance
|
|
8
|
+
private static _instance?;
|
|
9
9
|
private deferredCallbacks;
|
|
10
10
|
private functions;
|
|
11
11
|
private allowedOrigins?;
|
|
12
12
|
private constructor();
|
|
13
13
|
private subscribeToMessageEvent;
|
|
14
|
+
private unsubscribeToMessageEvent;
|
|
15
|
+
private messageEventHandler;
|
|
14
16
|
private handleRequest;
|
|
15
17
|
private handleResponse;
|
|
16
18
|
private sendErrorResponse;
|
|
17
19
|
private sendSuccessResponse;
|
|
18
20
|
private sendResponse;
|
|
19
21
|
static init(functions: FunctionsCollection, allowedOrigins?: Array<string>): WindowBridge;
|
|
22
|
+
static destroy(): void;
|
|
20
23
|
static getBridge(): WindowBridge;
|
|
21
24
|
static getTargetWindowFunctionProxy<T extends FunctionsCollection = FunctionsCollection>(getTargetWindow: GetTargetWindowFunctionType, targetWindowOrigin: string): T;
|
|
22
25
|
getTargetWindowFunctionProxy<T extends FunctionsCollection = FunctionsCollection>(getTargetWindow: GetTargetWindowFunctionType, targetWindowOrigin: string): T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PaymentMethod,
|
|
1
|
+
import { PaymentMethod, PaymentMethodNameType } from '../../model/makePayment';
|
|
2
2
|
import { ConsultPaymentFeatureType, PaymentFeatureType } from '../../types';
|
|
3
3
|
export declare const AutoTopupModeType: {
|
|
4
4
|
readonly POST_AUTO_TOPUP: "PostAutoTopup";
|
|
@@ -27,7 +27,7 @@ export declare type UpdatePreTransactionAutoTopupConfigurationParams = {
|
|
|
27
27
|
isEnabled: boolean;
|
|
28
28
|
minimumTopupAmount: number;
|
|
29
29
|
paymentMethodId: string;
|
|
30
|
-
methodType:
|
|
30
|
+
methodType: PaymentMethodNameType;
|
|
31
31
|
ccType?: string;
|
|
32
32
|
isAuthenticated?: boolean;
|
|
33
33
|
};
|
|
@@ -54,13 +54,13 @@ declare type PostTransactionAutoTopupConfiguration = {
|
|
|
54
54
|
topupAmount?: number;
|
|
55
55
|
currency?: Currency;
|
|
56
56
|
paymentMethodId: string;
|
|
57
|
-
methodType:
|
|
57
|
+
methodType: PaymentMethodNameType;
|
|
58
58
|
};
|
|
59
59
|
declare type PreTransactionAutoTopupConfiguration = {
|
|
60
60
|
isEnabled: boolean;
|
|
61
61
|
minimumTopupAmount?: number;
|
|
62
62
|
paymentMethodId?: string;
|
|
63
|
-
methodType:
|
|
63
|
+
methodType: PaymentMethodNameType;
|
|
64
64
|
};
|
|
65
65
|
declare type DescriptionInfo = {
|
|
66
66
|
text: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paypay/mini-app-js-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn build:client && yarn build:core && yarn build:init",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"build:core": "vite build --config vite.config.core.ts",
|
|
11
11
|
"build:init": "vite build --config vite.config.init.ts",
|
|
12
12
|
"build:miniAppPackage": "rollup -c",
|
|
13
|
+
"build:coreEntryPoint": "rollup -c",
|
|
13
14
|
"dev": "run-p dev:client dev:core",
|
|
14
15
|
"dev:client": "vite --host 0.0.0.0",
|
|
15
16
|
"dev:core": "vite --config vite.config.core.ts",
|
|
@@ -41,7 +42,10 @@
|
|
|
41
42
|
"@braintree/browser-detection": "^1.16.0",
|
|
42
43
|
"@braintree/sanitize-url": "^6.0.2",
|
|
43
44
|
"@pinia/testing": "^0.0.12",
|
|
45
|
+
"@rollup/plugin-html": "^1.0.2",
|
|
44
46
|
"@rollup/plugin-replace": "^3.0.0",
|
|
47
|
+
"@rollup/plugin-terser": "^0.4.3",
|
|
48
|
+
"@sentry/browser": "^7.74.1",
|
|
45
49
|
"@testing-library/jest-dom": "^5.16.2",
|
|
46
50
|
"@testing-library/vue": "^6.4.2",
|
|
47
51
|
"@types/ip": "^1.1.0",
|