@paypay/mini-app-js-sdk 2.14.0 → 2.15.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 +1 -0
- package/dist/client/supportedFunctionsList.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 +1 -0
- package/dist/mini-app-api.d.ts +6 -1
- package/dist/mini-app-js-sdk.browser.js +1 -1
- package/dist/mini-app-js-sdk.es.js +5581 -65
- package/dist/model/bridge/getTransactionInfo.d.ts +2 -0
- package/dist/model/bridge/getTransactions.d.ts +2 -0
- package/dist/model/bridge/makePayment.d.ts +1 -1
- package/dist/model/miniAppError.d.ts +3 -1
- package/dist/model/permission.d.ts +1 -0
- package/dist/package/button/index.d.ts +2 -2
- package/dist/types.d.ts +18 -0
- package/dist/utils/api.d.ts +6 -1
- package/dist/utils/fetch.d.ts +8 -2
- package/dist/utils/helper.d.ts +2 -1
- package/dist/utils/windowBridge.d.ts +4 -1
- package/package.json +4 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MakePaymentParams } from '../../types';
|
|
2
|
-
export declare const makePayment: (params: MakePaymentParams) =>
|
|
2
|
+
export declare const makePayment: (params: MakePaymentParams) => void;
|
|
@@ -62,7 +62,9 @@ export declare enum MiniAppErrorType {
|
|
|
62
62
|
noLocationData = "NO_LOCATION_DATA",
|
|
63
63
|
functionNotFound = "FUNCTION_NOT_FOUND",
|
|
64
64
|
originNotAllowed = "ORIGIN_NOT_ALLOWED",
|
|
65
|
-
messageSendingFailed = "MESSAGE_SENDING_FAILED"
|
|
65
|
+
messageSendingFailed = "MESSAGE_SENDING_FAILED",
|
|
66
|
+
transactionNotFound = "TRANSACTION_NOT_FOUND",
|
|
67
|
+
unexpectedOperation = "UNEXPECTED_OP"
|
|
66
68
|
}
|
|
67
69
|
export declare class MiniAppError extends Error {
|
|
68
70
|
constructor(type: MiniAppErrorType);
|
|
@@ -18,6 +18,7 @@ export declare const PermissionName: {
|
|
|
18
18
|
mini_app_user_phone_album: string;
|
|
19
19
|
mini_app_bank_information: string;
|
|
20
20
|
mini_app_cashback_information: string;
|
|
21
|
+
mini_app_transaction: string;
|
|
21
22
|
};
|
|
22
23
|
export declare const checkPermission: (permissionNames: string[] | string) => Promise<PermissionStatus>;
|
|
23
24
|
export declare function getUserGrantedPermission(): Promise<string[]>;
|
|
@@ -82,11 +82,11 @@ export declare const PButton: import("vue").DefineComponent<{
|
|
|
82
82
|
}, {
|
|
83
83
|
type: ButtonType;
|
|
84
84
|
name: string;
|
|
85
|
-
|
|
85
|
+
size: ButtonSize;
|
|
86
86
|
class: string | Record<string, any>;
|
|
87
|
+
loading: boolean;
|
|
87
88
|
disabled: boolean;
|
|
88
89
|
block: boolean;
|
|
89
|
-
size: ButtonSize;
|
|
90
90
|
tabIndex: number;
|
|
91
91
|
disabledClassName: string;
|
|
92
92
|
noMargin: boolean;
|
package/dist/types.d.ts
CHANGED
|
@@ -493,6 +493,11 @@ export declare type BalanceType = {
|
|
|
493
493
|
totalBalance?: {
|
|
494
494
|
amount?: number;
|
|
495
495
|
};
|
|
496
|
+
details?: {
|
|
497
|
+
money?: number;
|
|
498
|
+
moneyLite?: number;
|
|
499
|
+
point?: number;
|
|
500
|
+
};
|
|
496
501
|
};
|
|
497
502
|
};
|
|
498
503
|
};
|
|
@@ -709,4 +714,17 @@ declare global {
|
|
|
709
714
|
_ppsl?: boolean;
|
|
710
715
|
}
|
|
711
716
|
}
|
|
717
|
+
export interface GetTransactionInfoParams extends NativeParams<MiniAppResult> {
|
|
718
|
+
orderId: string;
|
|
719
|
+
orderType?: string;
|
|
720
|
+
}
|
|
721
|
+
export interface GetTransactionsParams extends NativeParams<MiniAppResult> {
|
|
722
|
+
types?: string | string[];
|
|
723
|
+
statuses?: string | string[];
|
|
724
|
+
mids?: string | string[];
|
|
725
|
+
startDate?: string;
|
|
726
|
+
endDate?: string;
|
|
727
|
+
cursor?: string;
|
|
728
|
+
size?: number;
|
|
729
|
+
}
|
|
712
730
|
export {};
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -75,19 +75,24 @@ export declare type WalletInfo = {
|
|
|
75
75
|
};
|
|
76
76
|
export declare function topup(queryParams: TopupQuery, body: TopupBody, paymentParams?: MakePaymentParams): Promise<{
|
|
77
77
|
ppFetchResult: "notAuthorized";
|
|
78
|
+
errorCode: MiniAppErrorType.notAuthorized;
|
|
78
79
|
body: null;
|
|
79
80
|
} | {
|
|
80
81
|
ppFetchResult: "fetchError";
|
|
82
|
+
errorCode: MiniAppErrorType.serverError;
|
|
81
83
|
body: null;
|
|
82
84
|
} | {
|
|
83
85
|
ppFetchResult: "timeout";
|
|
86
|
+
errorCode: MiniAppErrorType.timeOut;
|
|
84
87
|
body: null;
|
|
85
88
|
} | {
|
|
86
89
|
ppFetchResult: "tokenExpired";
|
|
90
|
+
errorCode: MiniAppErrorType.tokenExpired;
|
|
87
91
|
statusCode: number;
|
|
88
92
|
body?: null | undefined;
|
|
89
93
|
} | {
|
|
90
|
-
ppFetchResult: "
|
|
94
|
+
ppFetchResult: "apiError";
|
|
95
|
+
errorCode: MiniAppErrorType;
|
|
91
96
|
statusCode: number;
|
|
92
97
|
body: ({
|
|
93
98
|
signed: {
|
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
|
@@ -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 {};
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paypay/mini-app-js-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.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,9 @@
|
|
|
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",
|
|
45
48
|
"@testing-library/jest-dom": "^5.16.2",
|
|
46
49
|
"@testing-library/vue": "^6.4.2",
|
|
47
50
|
"@types/ip": "^1.1.0",
|