@paypay/mini-app-js-sdk 2.22.0 → 2.24.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/core/clientState.d.ts +10 -0
- package/dist/core/coreFunctions/fetchCoupons.d.ts +2 -2
- package/dist/core/coreFunctions/getLoginUrl.d.ts +4 -4
- package/dist/core/coreUtils.d.ts +3 -5
- package/dist/core/coupon/couponFunctions/renderCoupons.d.ts +3 -3
- package/dist/core/index.d.ts +2 -2
- package/dist/core/sentry.d.ts +0 -2
- package/dist/jsbridge-core/lib/reconstructParams.d.ts +1 -1
- package/dist/mini-app-api.d.ts +4 -3
- package/dist/mini-app-js-sdk.browser.js +1 -1
- package/dist/mini-app-js-sdk.es.js +1374 -1371
- package/dist/model/bridge/getAppDetail.d.ts +1 -1
- package/dist/model/bridge/getAuthStatus.d.ts +1 -2
- package/dist/model/bridge/init.d.ts +1 -2
- package/dist/model/bridge/render.d.ts +2 -2
- package/dist/model/bridge/renderLoginButton.d.ts +2 -2
- package/dist/model/bridge/renderPayButton.d.ts +2 -2
- package/dist/package/button/index.d.ts +2 -2
- package/dist/types.d.ts +0 -3
- package/dist/utils/analytics.d.ts +4 -0
- package/dist/utils/fetch.d.ts +1 -1
- package/dist/utils/helper.d.ts +3 -1
- package/dist/utils/storage.d.ts +5 -11
- package/dist/views/coupon/components/CouponAction/index.d.ts +17 -1
- package/dist/views/coupon/index.d.ts +11 -3
- package/dist/views/coupon/types.d.ts +2 -0
- package/package.json +8 -6
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { GetAuthStatusParams } from '../../types/getAuthStatus';
|
|
2
|
-
|
|
3
|
-
export declare function getAuthStatus(params: GetAuthStatusParams, context: MiniAppFunctionContext): Promise<void>;
|
|
2
|
+
export declare function getAuthStatus(params: GetAuthStatusParams): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getRenderButtonInfo(params: RenderSmartButtonParams
|
|
1
|
+
import { RenderSmartButtonParams } from '../../types';
|
|
2
|
+
export declare function getRenderButtonInfo(params: RenderSmartButtonParams): Promise<{
|
|
3
3
|
data: import('../../types').SmartButtonParam;
|
|
4
4
|
preferredLanguage: string;
|
|
5
5
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getRenderLoginInfo(params: RenderSmartButtonParams
|
|
1
|
+
import { RenderSmartButtonParams, SmartButtonParam } from '../../types';
|
|
2
|
+
export declare function getRenderLoginInfo(params: RenderSmartButtonParams): Promise<{
|
|
3
3
|
data: SmartButtonParam;
|
|
4
4
|
preferredLanguage: string;
|
|
5
5
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getRenderPayInfo(params: RenderSmartButtonParams
|
|
1
|
+
import { RenderSmartButtonParams, SmartButtonParam } from '../../types';
|
|
2
|
+
export declare function getRenderPayInfo(params: RenderSmartButtonParams): Promise<{
|
|
3
3
|
renderParams: RenderSmartButtonParams;
|
|
4
4
|
data: SmartButtonParam;
|
|
5
5
|
preferredLanguage: string;
|
|
@@ -81,10 +81,10 @@ export declare const PButton: import("vue").DefineComponent<{
|
|
|
81
81
|
onClick?: (() => any) | undefined;
|
|
82
82
|
}, {
|
|
83
83
|
type: ButtonType;
|
|
84
|
-
class: string | Record<string, any>;
|
|
85
|
-
loading: boolean;
|
|
86
84
|
name: string;
|
|
87
85
|
size: ButtonSize;
|
|
86
|
+
class: string | Record<string, any>;
|
|
87
|
+
loading: boolean;
|
|
88
88
|
disabled: boolean;
|
|
89
89
|
block: boolean;
|
|
90
90
|
tabIndex: number;
|
package/dist/types.d.ts
CHANGED
|
@@ -6,9 +6,6 @@ import { MiniAppErrorType } from './model/miniAppError';
|
|
|
6
6
|
declare global {
|
|
7
7
|
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
8
8
|
}
|
|
9
|
-
export interface MiniAppFunctionContext {
|
|
10
|
-
clientOrigin: string;
|
|
11
|
-
}
|
|
12
9
|
export declare type MiniAppResult = Record<string, unknown>;
|
|
13
10
|
export interface MiniAppErrorResultType {
|
|
14
11
|
errorCode: MiniAppErrorType;
|
|
@@ -21,4 +21,8 @@ export declare function getEventCategory(params?: {
|
|
|
21
21
|
}): string;
|
|
22
22
|
export declare function logSDKEvent(eventName: string, eventParams: Omit<EventParams, 'env'>, { env, sendImmediately }?: Options): void;
|
|
23
23
|
export declare function handleLogSDKEvent(name: PPFunctionNameType, eventActionSuffix: string, errorValue?: string, params?: unknown): void;
|
|
24
|
+
export declare function test_initClientState(params: {
|
|
25
|
+
clientId: string;
|
|
26
|
+
clientOrigin: string;
|
|
27
|
+
}): void;
|
|
24
28
|
export {};
|
package/dist/utils/fetch.d.ts
CHANGED
|
@@ -75,5 +75,5 @@ export declare type PPFetchResult<T, E = Record<string, unknown>> = {
|
|
|
75
75
|
body?: null;
|
|
76
76
|
};
|
|
77
77
|
export declare function ppFetch2<T, E = Record<string, unknown>>(options: PPFetchOptions): Promise<PPFetchResult<T, E>>;
|
|
78
|
-
export declare function fetchRefreshToken(refreshToken?: string, clientOrigin?: string): Promise<boolean>;
|
|
78
|
+
export declare function fetchRefreshToken(refreshToken: string, clientId?: string, clientOrigin?: string): Promise<boolean>;
|
|
79
79
|
export { createHeaderMiniAppApi };
|
package/dist/utils/helper.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { BankInfo, CreditCardInfo, SbidBankInfo, PayLaterCCInfo } from '../model
|
|
|
3
3
|
import { UIComponentsErrorButton } from '../model/uiComponents';
|
|
4
4
|
import { ErrorSheetButton } from '../types';
|
|
5
5
|
import { FontSize } from '../types/getPlatformInformation';
|
|
6
|
+
import { NativeParams } from '../jsbridge-core/jsbridge';
|
|
7
|
+
import { App } from 'vue';
|
|
6
8
|
export declare function isDef<T>(val: T): val is NonNullable<T>;
|
|
7
9
|
export declare function isFunction(val: unknown): val is () => void;
|
|
8
10
|
export declare function isNumeric(val: string | number): val is string;
|
|
@@ -59,7 +61,6 @@ export declare function generateCodeVerifier(length?: number): string;
|
|
|
59
61
|
export declare function generateCodeChallenge(codeVerifier: string): Promise<string>;
|
|
60
62
|
export declare function openUrl(linkUrl: string): void;
|
|
61
63
|
export declare function getButtonType(button: UIComponentsErrorButton | ErrorSheetButton, onlyButton?: boolean): "success" | "default" | "link" | "primary" | "warning" | "danger" | "outLined";
|
|
62
|
-
export declare function saveUserData(): void;
|
|
63
64
|
export declare function getRandomString(): string;
|
|
64
65
|
export declare function isAlphabet(value: string): boolean;
|
|
65
66
|
export declare function reconstructKycPassportCallbackUrl(url: string, type: string): string;
|
|
@@ -67,4 +68,5 @@ export declare function getValueFromUA(paramName: string): string | undefined;
|
|
|
67
68
|
export declare function replaceStringPlaceholders(str: string, values: Record<string, string>): string;
|
|
68
69
|
export declare function validateUrl(url: string): boolean;
|
|
69
70
|
export declare function constructUrl(baseUrl: string, params: Record<string, string | string[] | number | number[] | boolean | undefined>): string;
|
|
71
|
+
export declare function makeDefaultErrorHandler(app: App, params: NativeParams<never> | undefined): (err: unknown) => void;
|
|
70
72
|
export {};
|
package/dist/utils/storage.d.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { PpLocalStorageKey } from '../types';
|
|
2
1
|
import { PPEnvType } from '../types/init';
|
|
3
|
-
export declare function getKeyWithClientId(baseKey: PpLocalStorageKey): string;
|
|
4
2
|
export declare function getAccessToken(): string | null;
|
|
5
|
-
export declare function saveLocalStorage(key: string, value: string): void;
|
|
6
|
-
export declare function getLocalStorage(key: string): string | null;
|
|
7
|
-
export declare function removeLocalStorage(key: string): void;
|
|
8
3
|
export declare function saveClaimCouponImmediately(couponId: string): void;
|
|
9
4
|
export declare function getClaimCouponImmediately(couponId: string): string | null;
|
|
10
5
|
export declare function removeClaimCouponImmediately(couponId: string): void;
|
|
11
6
|
export declare function saveAccessToken(token: string): void;
|
|
12
|
-
export declare function getRefreshToken(): string;
|
|
7
|
+
export declare function getRefreshToken(): string | null;
|
|
13
8
|
export declare function saveRefreshToken(token: string): void;
|
|
14
9
|
export declare function getConsumedOtt(): string | null;
|
|
15
10
|
export declare function saveConsumedOtt(ott: string): void;
|
|
@@ -28,18 +23,17 @@ export declare function getLastPayment(): string | null;
|
|
|
28
23
|
export declare function saveLastTopup(topup: string): void;
|
|
29
24
|
export declare function getLastTopup(): string;
|
|
30
25
|
export declare function saveAppDetail(appDetail: string): void;
|
|
31
|
-
export declare function getAppDetail(): string | null;
|
|
26
|
+
export declare function getAppDetail(clientId?: string): string | null;
|
|
32
27
|
export declare function removeAppDetail(): void;
|
|
33
28
|
export declare function saveAppConfig(appConfig: string): void;
|
|
34
29
|
export declare function getAppConfig(): string | null;
|
|
35
|
-
export declare function getClientId(): string | null;
|
|
36
|
-
export declare function saveClientId(id: string): void;
|
|
37
30
|
export declare function getUserInfo(): string | null;
|
|
38
31
|
export declare function saveUserInfo(userData: string): void;
|
|
39
32
|
export declare function removeCodeVerifier(): void;
|
|
40
|
-
export declare function
|
|
41
|
-
export declare function
|
|
33
|
+
export declare function saveAuthorizedClientOrigin(clientId: string, origin: string): void;
|
|
34
|
+
export declare function getAuthorizedClientOrigin(clientId: string): string | null;
|
|
42
35
|
export declare function saveClientVersion(clientVersion: string): void;
|
|
43
36
|
export declare function getClientVersion(): string;
|
|
44
37
|
export declare function saveDebugMode(isDebugMode: boolean): void;
|
|
45
38
|
export declare function getDebugMode(): boolean;
|
|
39
|
+
export declare function removeLogInData(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import { Translation } from '../../../../types';
|
|
2
|
+
import { RedirectType, Translation } from '../../../../types';
|
|
3
3
|
import { FormattedCoupon } from '../../types';
|
|
4
4
|
declare const CouponAction: import("vue").DefineComponent<{
|
|
5
5
|
coupon: {
|
|
@@ -18,6 +18,14 @@ declare const CouponAction: import("vue").DefineComponent<{
|
|
|
18
18
|
type: PropType<Translation>;
|
|
19
19
|
required: true;
|
|
20
20
|
};
|
|
21
|
+
postLoginRedirectUrl: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
postLoginRedirectType: {
|
|
26
|
+
type: PropType<RedirectType>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
21
29
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
30
|
coupon: {
|
|
23
31
|
type: PropType<FormattedCoupon>;
|
|
@@ -35,5 +43,13 @@ declare const CouponAction: import("vue").DefineComponent<{
|
|
|
35
43
|
type: PropType<Translation>;
|
|
36
44
|
required: true;
|
|
37
45
|
};
|
|
46
|
+
postLoginRedirectUrl: {
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
required: true;
|
|
49
|
+
};
|
|
50
|
+
postLoginRedirectType: {
|
|
51
|
+
type: PropType<RedirectType>;
|
|
52
|
+
required: true;
|
|
53
|
+
};
|
|
38
54
|
}>>, {}>;
|
|
39
55
|
export default CouponAction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import { Locale, Translation } from '../../types';
|
|
2
|
+
import { Locale, RedirectType, Translation } from '../../types';
|
|
3
3
|
import { FormattedCoupon } from './types';
|
|
4
4
|
export declare const CouponView: import("vue").DefineComponent<{
|
|
5
5
|
coupon: {
|
|
@@ -22,10 +22,14 @@ export declare const CouponView: import("vue").DefineComponent<{
|
|
|
22
22
|
type: PropType<Translation>;
|
|
23
23
|
required: true;
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
postLoginRedirectUrl: {
|
|
26
26
|
type: StringConstructor;
|
|
27
27
|
required: true;
|
|
28
28
|
};
|
|
29
|
+
postLoginRedirectType: {
|
|
30
|
+
type: PropType<RedirectType>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
29
33
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
30
34
|
coupon: {
|
|
31
35
|
type: PropType<FormattedCoupon>;
|
|
@@ -47,8 +51,12 @@ export declare const CouponView: import("vue").DefineComponent<{
|
|
|
47
51
|
type: PropType<Translation>;
|
|
48
52
|
required: true;
|
|
49
53
|
};
|
|
50
|
-
|
|
54
|
+
postLoginRedirectUrl: {
|
|
51
55
|
type: StringConstructor;
|
|
52
56
|
required: true;
|
|
53
57
|
};
|
|
58
|
+
postLoginRedirectType: {
|
|
59
|
+
type: PropType<RedirectType>;
|
|
60
|
+
required: true;
|
|
61
|
+
};
|
|
54
62
|
}>>, {}>;
|
|
@@ -10,6 +10,7 @@ export interface Coupon {
|
|
|
10
10
|
usageType: 'FIXED' | 'UNLIMITED';
|
|
11
11
|
couponDetailsUrl: string;
|
|
12
12
|
loginUrl?: string;
|
|
13
|
+
loginUrlExpiresAt: number;
|
|
13
14
|
redemptionCountLimit: number;
|
|
14
15
|
minTransactionAmount: number;
|
|
15
16
|
maxCashbackAmount?: number;
|
|
@@ -27,6 +28,7 @@ export interface FormattedCoupon {
|
|
|
27
28
|
claimStatus: ClaimStatus;
|
|
28
29
|
couponId: string;
|
|
29
30
|
loginUrl?: string;
|
|
31
|
+
loginUrlExpiresAt: number;
|
|
30
32
|
couponDetailsUrl: string;
|
|
31
33
|
}
|
|
32
34
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paypay/mini-app-js-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.24.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn build:client && yarn build:core && yarn build:init",
|
|
@@ -21,9 +21,10 @@
|
|
|
21
21
|
"upgrade": "yarn upgrade-interactive",
|
|
22
22
|
"test": "jest --silent --coverage",
|
|
23
23
|
"test:watch": "jest --watch",
|
|
24
|
-
"e2e:
|
|
25
|
-
"e2e:
|
|
26
|
-
"e2e:
|
|
24
|
+
"e2e:sp": "SDK=SP playwright test",
|
|
25
|
+
"e2e:sp:update": "yarn e2e:sp --update-snapshots",
|
|
26
|
+
"e2e:ma": "SDK=MA playwright test",
|
|
27
|
+
"e2e:ma:update": "yarn e2e:sp --update-snapshots",
|
|
27
28
|
"preview": "yarn dev:client & vite preview --config vite.config.core.ts --port 3100"
|
|
28
29
|
},
|
|
29
30
|
"license": "MIT",
|
|
@@ -69,6 +70,7 @@
|
|
|
69
70
|
"@vue/test-utils": "^2.0.0-rc.21",
|
|
70
71
|
"acorn-jsx": "^5.3.2",
|
|
71
72
|
"babel-jest": "^26.6.3",
|
|
73
|
+
"dotenv": "^16.3.2",
|
|
72
74
|
"eslint": "^8.38.0",
|
|
73
75
|
"eslint-config-prettier": "^8.8.0",
|
|
74
76
|
"eslint-plugin-prettier": "^4.2.1",
|
|
@@ -96,7 +98,7 @@
|
|
|
96
98
|
"stylelint": "^14.9.1",
|
|
97
99
|
"terser": "^5.18.1",
|
|
98
100
|
"ts-jest": "^26.5.6",
|
|
99
|
-
"typescript": "~4.
|
|
101
|
+
"typescript": "~4.9.5",
|
|
100
102
|
"ua-parser-js": "^1.0.2",
|
|
101
103
|
"uuid": "^8.3.2",
|
|
102
104
|
"vite": "^4.4.9",
|
|
@@ -105,7 +107,7 @@
|
|
|
105
107
|
"vue": "^3.2.39",
|
|
106
108
|
"vue-eslint-parser": "^9.1.1",
|
|
107
109
|
"vue-jest": "5.0.0-alpha.9",
|
|
108
|
-
"vue-tsc": "^1.
|
|
110
|
+
"vue-tsc": "^1.8.27"
|
|
109
111
|
},
|
|
110
112
|
"files": [
|
|
111
113
|
"dist"
|