@hylid/custom-jsapi 3.3.0-alpha.9 → 4.0.0-alpha.2
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/lib/bridge.d.ts +3 -1
- package/lib/bridge.js +34 -0
- package/lib/common/alipay/getAppScanLink.d.ts +1 -0
- package/lib/common/alipay/getAppScanLink.js +3 -0
- package/lib/common/alipay/getGeneralAppInfo.d.ts +2 -0
- package/lib/common/alipay/getGeneralAppInfo.js +14 -0
- package/lib/common/alipay/index.d.ts +2 -0
- package/lib/common/alipay/index.js +3 -1
- package/lib/common/alipayhk/getAppScanLink.d.ts +2 -0
- package/lib/common/alipayhk/getAppScanLink.js +39 -0
- package/lib/common/alipayhk/getCallAppLink.js +1 -2
- package/lib/common/alipayhk/getGeneralAppInfo.d.ts +2 -0
- package/lib/common/alipayhk/getGeneralAppInfo.js +13 -0
- package/lib/common/alipayhk/index.d.ts +2 -0
- package/lib/common/alipayhk/index.js +3 -1
- package/lib/common/dana/getGeneralAppInfo.d.ts +2 -0
- package/lib/common/dana/getGeneralAppInfo.js +13 -0
- package/lib/common/dana/index.d.ts +1 -0
- package/lib/common/dana/index.js +2 -1
- package/lib/common/gcash/getGeneralAppInfo.d.ts +2 -0
- package/lib/common/gcash/getGeneralAppInfo.js +13 -0
- package/lib/common/gcash/index.d.ts +1 -0
- package/lib/common/gcash/index.js +2 -1
- package/lib/common/mpay/getAppScanLink.d.ts +1 -0
- package/lib/common/mpay/getAppScanLink.js +2 -0
- package/lib/common/mpay/getCallAppLink.d.ts +2 -0
- package/lib/common/mpay/getCallAppLink.js +30 -0
- package/lib/common/mpay/getGeneralAppInfo.d.ts +2 -0
- package/lib/common/mpay/getGeneralAppInfo.js +13 -0
- package/lib/common/mpay/index.d.ts +3 -0
- package/lib/common/mpay/index.js +3 -0
- package/lib/common/tngd/getGeneralAppInfo.d.ts +2 -0
- package/lib/common/tngd/getGeneralAppInfo.js +13 -0
- package/lib/common/tngd/index.d.ts +1 -0
- package/lib/common/tngd/index.js +2 -1
- package/lib/common/toss/getGeneralAppInfo.d.ts +2 -0
- package/lib/common/toss/getGeneralAppInfo.js +13 -0
- package/lib/common/toss/index.d.ts +1 -0
- package/lib/common/toss/index.js +2 -1
- package/lib/common/truemoney/getGeneralAppInfo.d.ts +2 -0
- package/lib/common/truemoney/getGeneralAppInfo.js +13 -0
- package/lib/common/truemoney/index.d.ts +1 -0
- package/lib/common/truemoney/index.js +2 -1
- package/package.json +4 -4
package/lib/bridge.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { HyCustomJSAPI } from '@hylid/types';
|
|
1
|
+
import { HyCustomJSAPI, GetGeneralAppInfo } from '@hylid/types';
|
|
2
2
|
export declare const getCallAppLink: HyCustomJSAPI['getCallAppLink'];
|
|
3
|
+
export declare const getAppScanLink: HyCustomJSAPI['getAppScanLink'];
|
|
4
|
+
export declare const getGeneralAppInfo: GetGeneralAppInfo;
|
package/lib/bridge.js
CHANGED
|
@@ -4,9 +4,21 @@ import { getCallAppLink as alipayGetCallAppLink } from "./common/alipay";
|
|
|
4
4
|
import { getCallAppLink as alipayhkGetCallAppLink } from "./common/alipayhk";
|
|
5
5
|
import { getCallAppLink as danaGetCallAppLink } from "./common/dana";
|
|
6
6
|
import { getCallAppLink as gcashGetCallAppLink } from "./common/gcash";
|
|
7
|
+
import { getCallAppLink as mpayGetCallAppLink } from "./common/mpay";
|
|
7
8
|
import { getCallAppLink as tngdGetCallAppLink } from "./common/tngd";
|
|
8
9
|
import { getCallAppLink as tossGetCallAppLink } from "./common/toss";
|
|
9
10
|
import { getCallAppLink as truemoneyGetCallAppLink } from "./common/truemoney";
|
|
11
|
+
import { getAppScanLink as alipayGetAppScanLink } from "./common/alipay/getAppScanLink";
|
|
12
|
+
import { getAppScanLink as alipayhkGetAppScanLink } from "./common/alipayhk/getAppScanLink";
|
|
13
|
+
import { getAppScanLink as mpayGetAppScanLink } from "./common/mpay/getAppScanLink";
|
|
14
|
+
import { getGeneralAppInfo as alipayGetGeneralAppInfo } from "./common/alipay/getGeneralAppInfo";
|
|
15
|
+
import { getGeneralAppInfo as alipayhkGetGeneralAppInfo } from "./common/alipayhk/getGeneralAppInfo";
|
|
16
|
+
import { getGeneralAppInfo as danaGetGeneralAppInfo } from "./common/dana/getGeneralAppInfo";
|
|
17
|
+
import { getGeneralAppInfo as gcashGetGeneralAppInfo } from "./common/gcash/getGeneralAppInfo";
|
|
18
|
+
import { getGeneralAppInfo as mpayGetGeneralAppInfo } from "./common/mpay/getGeneralAppInfo";
|
|
19
|
+
import { getGeneralAppInfo as tngdGetGeneralAppInfo } from "./common/tngd/getGeneralAppInfo";
|
|
20
|
+
import { getGeneralAppInfo as tossGetGeneralAppInfo } from "./common/toss/getGeneralAppInfo";
|
|
21
|
+
import { getGeneralAppInfo as truemoneyGetGeneralAppInfo } from "./common/truemoney/getGeneralAppInfo";
|
|
10
22
|
export var getCallAppLink = function getCallAppLink() {
|
|
11
23
|
var args = [];
|
|
12
24
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -16,8 +28,30 @@ export var getCallAppLink = function getCallAppLink() {
|
|
|
16
28
|
if (clientEnv.isALIPAYHK) return alipayhkGetCallAppLink.apply(void 0, args);
|
|
17
29
|
if (clientEnv.isDANA) return danaGetCallAppLink.apply(void 0, args);
|
|
18
30
|
if (clientEnv.isGCASH) return gcashGetCallAppLink.apply(void 0, args);
|
|
31
|
+
if (clientEnv.isMPAY) return mpayGetCallAppLink.apply(void 0, args);
|
|
19
32
|
if (clientEnv.isTNGD) return tngdGetCallAppLink.apply(void 0, args);
|
|
20
33
|
if (clientEnv.isTOSSPAY) return tossGetCallAppLink.apply(void 0, args);
|
|
21
34
|
if (clientEnv.isTRUEMONEY) return truemoneyGetCallAppLink.apply(void 0, args);
|
|
22
35
|
return notFound('getCallAppLink');
|
|
36
|
+
};
|
|
37
|
+
export var getAppScanLink = function getAppScanLink() {
|
|
38
|
+
var args = [];
|
|
39
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
40
|
+
args[_i] = arguments[_i];
|
|
41
|
+
}
|
|
42
|
+
if (clientEnv.isALIPAY) return alipayGetAppScanLink.apply(void 0, args);
|
|
43
|
+
if (clientEnv.isALIPAYHK) return alipayhkGetAppScanLink.apply(void 0, args);
|
|
44
|
+
if (clientEnv.isMPAY) return mpayGetAppScanLink.apply(void 0, args);
|
|
45
|
+
return notFound('getAppScanLink');
|
|
46
|
+
};
|
|
47
|
+
export var getGeneralAppInfo = function getGeneralAppInfo() {
|
|
48
|
+
if (clientEnv.isALIPAY) return alipayGetGeneralAppInfo();
|
|
49
|
+
if (clientEnv.isALIPAYHK) return alipayhkGetGeneralAppInfo();
|
|
50
|
+
if (clientEnv.isDANA) return danaGetGeneralAppInfo();
|
|
51
|
+
if (clientEnv.isGCASH) return gcashGetGeneralAppInfo();
|
|
52
|
+
if (clientEnv.isMPAY) return mpayGetGeneralAppInfo();
|
|
53
|
+
if (clientEnv.isTNGD) return tngdGetGeneralAppInfo();
|
|
54
|
+
if (clientEnv.isTOSSPAY) return tossGetGeneralAppInfo();
|
|
55
|
+
if (clientEnv.isTRUEMONEY) return truemoneyGetGeneralAppInfo();
|
|
56
|
+
return notFound('getGeneralAppInfo');
|
|
23
57
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getAppScanLink: (params: import("@hylid/types/lib/custom/appLink").AppLinkParams) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export var getGeneralAppInfo = function getGeneralAppInfo() {
|
|
2
|
+
var androidAppId = 'com.eg.android.AlipayGphone';
|
|
3
|
+
var iOSAppId = 'id333206289';
|
|
4
|
+
return {
|
|
5
|
+
walletLogo: 'https://cdn.marmot-cloud.com/storage/2024/08/26/f74bd9e9-574d-4885-b2fd-5fe4c7686d2e.png',
|
|
6
|
+
walletName: '支付宝',
|
|
7
|
+
appIcon: 'https://mdn.alipayobjects.com/huamei_h92na1/afts/img/A*cr4XSo2bHXUAAAAAAAAAAAAADh2VAQ/original',
|
|
8
|
+
iosDownloadLink: "itms-apps://itunes.apple.com/app/".concat(iOSAppId),
|
|
9
|
+
androidDownloadLink: "market://details?id=".concat(androidAppId),
|
|
10
|
+
iOSAppId: iOSAppId,
|
|
11
|
+
androidAppId: androidAppId,
|
|
12
|
+
pspId: '1022088000000000001'
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
import { stringify } from 'qs-es5';
|
|
12
|
+
import { getCallAppPage } from "../../utils";
|
|
13
|
+
export var getAppScanLink = function getAppScanLink(opt) {
|
|
14
|
+
var _a = opt || {},
|
|
15
|
+
appId = _a.appId,
|
|
16
|
+
query = _a.query,
|
|
17
|
+
debugConfig = _a.debugConfig;
|
|
18
|
+
var params = {
|
|
19
|
+
appId: appId,
|
|
20
|
+
// griver android 存在多次解码导致参数丢失,这里多进行一次编码,进行兼容处理
|
|
21
|
+
page: getCallAppPage(opt, true)
|
|
22
|
+
};
|
|
23
|
+
if (debugConfig === null || debugConfig === void 0 ? void 0 : debugConfig.version) {
|
|
24
|
+
var token = debugConfig.token,
|
|
25
|
+
version = debugConfig.version;
|
|
26
|
+
params = __assign(__assign({}, params), {
|
|
27
|
+
nbsource: 'debug',
|
|
28
|
+
nbsn: 'INSTALL',
|
|
29
|
+
nbsv: version,
|
|
30
|
+
token: token
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (query) {
|
|
34
|
+
params = __assign(__assign({}, params), {
|
|
35
|
+
query: stringify(query)
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return 'alipayhk://platformapi/startapp?' + stringify(params);
|
|
39
|
+
};
|
|
@@ -17,8 +17,7 @@ export var getCallAppLink = function getCallAppLink(opt) {
|
|
|
17
17
|
debugConfig = _a.debugConfig;
|
|
18
18
|
var params = {
|
|
19
19
|
appId: appId,
|
|
20
|
-
|
|
21
|
-
page: getCallAppPage(opt, true)
|
|
20
|
+
page: getCallAppPage(opt)
|
|
22
21
|
};
|
|
23
22
|
if (debugConfig === null || debugConfig === void 0 ? void 0 : debugConfig.version) {
|
|
24
23
|
var token = debugConfig.token,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export var getGeneralAppInfo = function getGeneralAppInfo() {
|
|
2
|
+
var androidAppId = 'hk.alipay.wallet';
|
|
3
|
+
var iOSAppId = 'id1210638245';
|
|
4
|
+
return {
|
|
5
|
+
walletLogo: 'https://cdn.marmot-cloud.com/storage/2024/08/26/9ae14cb8-c6c2-4a08-9ec5-063d3c5e903a.png',
|
|
6
|
+
walletName: 'AlipayHK',
|
|
7
|
+
iosDownloadLink: "itms-apps://itunes.apple.com/app/".concat(iOSAppId),
|
|
8
|
+
androidDownloadLink: "market://details?id=".concat(androidAppId),
|
|
9
|
+
iOSAppId: iOSAppId,
|
|
10
|
+
androidAppId: androidAppId,
|
|
11
|
+
pspId: '1022160000000000000'
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export var getGeneralAppInfo = function getGeneralAppInfo() {
|
|
2
|
+
var androidAppId = 'id.dana';
|
|
3
|
+
var iOSAppId = 'id1437123008';
|
|
4
|
+
return {
|
|
5
|
+
walletLogo: 'https://cdn.marmot-cloud.com/storage/2024/08/26/38e3c3d4-aa12-4d5a-9a9b-bd158f4b4382.png',
|
|
6
|
+
walletName: 'DANA',
|
|
7
|
+
iosDownloadLink: "itms-apps://itunes.apple.com/app/".concat(iOSAppId),
|
|
8
|
+
androidDownloadLink: "market://details?id=".concat(androidAppId),
|
|
9
|
+
iOSAppId: iOSAppId,
|
|
10
|
+
androidAppId: androidAppId,
|
|
11
|
+
pspId: '' // TODO: 待补充
|
|
12
|
+
};
|
|
13
|
+
};
|
package/lib/common/dana/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./getCallAppLink";
|
|
1
|
+
export * from "./getCallAppLink";
|
|
2
|
+
export * from "./getGeneralAppInfo";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export var getGeneralAppInfo = function getGeneralAppInfo() {
|
|
2
|
+
var androidAppId = 'com.globe.gcash.android';
|
|
3
|
+
var iOSAppId = 'id520020791';
|
|
4
|
+
return {
|
|
5
|
+
walletLogo: 'https://cdn.marmot-cloud.com/storage/2024/08/26/7e20ab56-f44e-4c2e-9897-4b74d9aeff09.png',
|
|
6
|
+
walletName: 'GCASH',
|
|
7
|
+
iosDownloadLink: "itms-apps://itunes.apple.com/app/".concat(iOSAppId),
|
|
8
|
+
androidDownloadLink: "market://details?id=".concat(androidAppId),
|
|
9
|
+
iOSAppId: iOSAppId,
|
|
10
|
+
androidAppId: androidAppId,
|
|
11
|
+
pspId: '1022170000000000000'
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./getCallAppLink";
|
|
1
|
+
export * from "./getCallAppLink";
|
|
2
|
+
export * from "./getGeneralAppInfo";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getAppScanLink: (params: import("@hylid/types/lib/custom/appLink").AppLinkParams) => string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
import { stringify } from 'qs-es5';
|
|
12
|
+
import { getCallAppPage } from "../../utils";
|
|
13
|
+
export var getCallAppLink = function getCallAppLink(opt) {
|
|
14
|
+
var _a = opt || {},
|
|
15
|
+
appId = _a.appId,
|
|
16
|
+
query = _a.query;
|
|
17
|
+
var params = {
|
|
18
|
+
aid: appId,
|
|
19
|
+
page: getCallAppPage(opt)
|
|
20
|
+
};
|
|
21
|
+
if (query) {
|
|
22
|
+
params = __assign(__assign({}, params), {
|
|
23
|
+
query: stringify(query)
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return 'mpayshare://platformapi/startApp?pid=tiny&' + stringify(params);
|
|
27
|
+
};
|
|
28
|
+
// 中转页:https://share.macaupass.com/callApp/index.html?pid=tiny&aid=生产ID
|
|
29
|
+
// AL/UL:https://jump.macaupass.com/startapp/downMPay/index.html?pid=tiny&aid=生产ID
|
|
30
|
+
// Scheme:mpayshare://platformapi/startApp?pid=tiny&aid=生产ID
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export var getGeneralAppInfo = function getGeneralAppInfo() {
|
|
2
|
+
var androidAppId = '';
|
|
3
|
+
var iOSAppId = '';
|
|
4
|
+
return {
|
|
5
|
+
walletLogo: 'https://cdn.marmot-cloud.com/storage/2024/08/26/c7dfdf58-7cb9-4c75-b914-4e28ffb825c6.png',
|
|
6
|
+
walletName: 'MPay',
|
|
7
|
+
iosDownloadLink: 'https://jump.macaupass.com/startapp/downMPay/index.html',
|
|
8
|
+
androidDownloadLink: 'https://jump.macaupass.com/startapp/downMPay/index.html',
|
|
9
|
+
iOSAppId: iOSAppId,
|
|
10
|
+
androidAppId: androidAppId,
|
|
11
|
+
pspId: 'A111253100000000'
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export var getGeneralAppInfo = function getGeneralAppInfo() {
|
|
2
|
+
var androidAppId = 'my.com.tngdigital.ewallet';
|
|
3
|
+
var iOSAppId = 'id1344696702';
|
|
4
|
+
return {
|
|
5
|
+
walletLogo: 'https://cdn.marmot-cloud.com/storage/2024/08/26/2701596a-8290-44a4-b759-5e8b5e7eb94a.png',
|
|
6
|
+
walletName: 'TNG eWallet',
|
|
7
|
+
iosDownloadLink: "itms-apps://itunes.apple.com/app/".concat(iOSAppId),
|
|
8
|
+
androidDownloadLink: "market://details?id=".concat(androidAppId),
|
|
9
|
+
iOSAppId: iOSAppId,
|
|
10
|
+
androidAppId: androidAppId,
|
|
11
|
+
pspId: '1022171000000000001'
|
|
12
|
+
};
|
|
13
|
+
};
|
package/lib/common/tngd/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./getCallAppLink";
|
|
1
|
+
export * from "./getCallAppLink";
|
|
2
|
+
export * from "./getGeneralAppInfo";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export var getGeneralAppInfo = function getGeneralAppInfo() {
|
|
2
|
+
var androidAppId = 'viva.republica.toss';
|
|
3
|
+
var iOSAppId = 'id839333328';
|
|
4
|
+
return {
|
|
5
|
+
walletLogo: 'https://cdn.marmot-cloud.com/storage/iquic-mng/prod/common/png/b404bfa1-306d-4c9b-acdd-f5c1011b6844.png',
|
|
6
|
+
walletName: 'Toss',
|
|
7
|
+
iosDownloadLink: "itms-apps://itunes.apple.com/app/".concat(iOSAppId),
|
|
8
|
+
androidDownloadLink: "market://details?id=".concat(androidAppId),
|
|
9
|
+
iOSAppId: iOSAppId,
|
|
10
|
+
androidAppId: androidAppId,
|
|
11
|
+
pspId: 'A111254300000000'
|
|
12
|
+
};
|
|
13
|
+
};
|
package/lib/common/toss/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./getCallAppLink";
|
|
1
|
+
export * from "./getCallAppLink";
|
|
2
|
+
export * from "./getGeneralAppInfo";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export var getGeneralAppInfo = function getGeneralAppInfo() {
|
|
2
|
+
var androidAppId = 'th.co.truemoney.wallet';
|
|
3
|
+
var iOSAppId = 'id1345776130';
|
|
4
|
+
return {
|
|
5
|
+
walletLogo: 'https://cdn.marmot-cloud.com/storage/2024/08/26/f03c335e-4234-4d4d-9237-f1fab935c275.png',
|
|
6
|
+
walletName: 'TrueMoney',
|
|
7
|
+
iosDownloadLink: "itms-apps://itunes.apple.com/app/".concat(iOSAppId),
|
|
8
|
+
androidDownloadLink: "market://details?id=".concat(androidAppId),
|
|
9
|
+
iOSAppId: iOSAppId,
|
|
10
|
+
androidAppId: androidAppId,
|
|
11
|
+
pspId: '1022167000000000001'
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./getCallAppLink";
|
|
1
|
+
export * from "./getCallAppLink";
|
|
2
|
+
export * from "./getGeneralAppInfo";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hylid/custom-jsapi",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.2",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib"
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@hylid/call": "^
|
|
13
|
-
"@hylid/env": "^
|
|
14
|
-
"@hylid/types": "^
|
|
12
|
+
"@hylid/call": "^4.0.0-alpha.2",
|
|
13
|
+
"@hylid/env": "^4.0.0-alpha.2",
|
|
14
|
+
"@hylid/types": "^4.0.0-alpha.2",
|
|
15
15
|
"qs-es5": "^6.8.4"
|
|
16
16
|
},
|
|
17
17
|
"license": "MIT",
|