@mpgd/adapter-ait 0.12.1 → 0.12.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/dist/host.js +13 -13
- package/dist/local-mock.js +3 -1
- package/dist/safe-area.js +2 -2
- package/dist/wrapper.js +1 -1
- package/package.json +5 -5
package/dist/host.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { getTossShareLink, getUserKeyForGame, grantPromotionRewardForGame as grantPromotionReward, IAP, isMinVersionSupported, loadFullScreenAd, openGameCenterLeaderboard, requestNotificationAgreement, share, showFullScreenAd, Storage, submitGameCenterLeaderBoardScore, TossAds, } from '@apps-in-toss/web-framework';
|
|
2
2
|
import { assertBridgeRequest, bridgeStorageLoadProtocol, } from '@mpgd/bridge';
|
|
3
3
|
import { dispatchAitLifecycleEvent } from './lifecycle.js';
|
|
4
|
-
const defaultAdTimeoutMs =
|
|
5
|
-
const defaultAdLoadQueueTimeoutMs =
|
|
6
|
-
const defaultAdDisplayStartTimeoutMs =
|
|
7
|
-
const defaultAdMaximumDisplayMs = 30 *
|
|
8
|
-
const defaultBannerRenderTimeoutMs =
|
|
4
|
+
const defaultAdTimeoutMs = 60_000;
|
|
5
|
+
const defaultAdLoadQueueTimeoutMs = 5_000;
|
|
6
|
+
const defaultAdDisplayStartTimeoutMs = 60_000;
|
|
7
|
+
const defaultAdMaximumDisplayMs = 30 * 60_000;
|
|
8
|
+
const defaultBannerRenderTimeoutMs = 15_000;
|
|
9
9
|
/** Leaves five seconds of headroom inside the native IAP 30-second grant callback. */
|
|
10
|
-
const defaultIapProductGrantTimeoutMs =
|
|
10
|
+
const defaultIapProductGrantTimeoutMs = 25_000;
|
|
11
11
|
/** Bounds abandoned checkout UI while still allowing the user to finish an interactive purchase. */
|
|
12
|
-
const defaultIapPurchaseSessionTimeoutMs = 30 *
|
|
12
|
+
const defaultIapPurchaseSessionTimeoutMs = 30 * 60_000;
|
|
13
13
|
/** A provider response is untrusted input; keep restore work bounded per launch. */
|
|
14
14
|
const maximumPendingIapOrders = 20;
|
|
15
15
|
const invalidBridgeRequestId = 'ait-invalid-request';
|
|
@@ -29,7 +29,7 @@ const maximumIndexedCompletedIapPurchaseAttempts = 64;
|
|
|
29
29
|
const pendingIapPurchaseAttemptRecoveryAgeMs = defaultIapPurchaseSessionTimeoutMs;
|
|
30
30
|
/** Rotates bounded pending-order recovery so an early rejected order cannot starve later work. */
|
|
31
31
|
const iapPendingOrderCursorStorageKey = 'mpgd:ait:pending-order-cursor:v1';
|
|
32
|
-
const defaultNotificationAgreementTimeoutMs =
|
|
32
|
+
const defaultNotificationAgreementTimeoutMs = 120_000;
|
|
33
33
|
const notificationTopics = new Set([
|
|
34
34
|
'daily-ready',
|
|
35
35
|
'streak-at-risk',
|
|
@@ -1374,7 +1374,7 @@ function parseAitIapCompletedPurchaseAttemptIndex(serialized) {
|
|
|
1374
1374
|
}
|
|
1375
1375
|
const keys = value.filter((key) => (typeof key === 'string'
|
|
1376
1376
|
&& key.startsWith(iapPurchaseAttemptStoragePrefix)
|
|
1377
|
-
&& key.length <=
|
|
1377
|
+
&& key.length <= 4_096));
|
|
1378
1378
|
return [...new Set(keys)].slice(-maximumIndexedCompletedIapPurchaseAttempts);
|
|
1379
1379
|
}
|
|
1380
1380
|
catch {
|
|
@@ -1821,7 +1821,7 @@ function safelyCleanupAitIapPurchase(cleanup) {
|
|
|
1821
1821
|
}
|
|
1822
1822
|
}
|
|
1823
1823
|
function isAitIapOrderId(value) {
|
|
1824
|
-
return value.length > 0 && value.length <=
|
|
1824
|
+
return value.length > 0 && value.length <= 2_048 && !/[\p{Cc}\p{Cf}]/u.test(value);
|
|
1825
1825
|
}
|
|
1826
1826
|
function isAitIapCancellation(error) {
|
|
1827
1827
|
if (isAbortError(error)) {
|
|
@@ -1834,7 +1834,7 @@ function isAitIapCancellation(error) {
|
|
|
1834
1834
|
return /CANCEL|ABORT/u.test(code);
|
|
1835
1835
|
}
|
|
1836
1836
|
function normalizeAitIapGrantTime(value) {
|
|
1837
|
-
if (value.length === 0 || value.length >
|
|
1837
|
+
if (value.length === 0 || value.length > 2_048 || /[\p{Cc}\p{Cf}]/u.test(value)) {
|
|
1838
1838
|
return new Date().toISOString();
|
|
1839
1839
|
}
|
|
1840
1840
|
const parsed = Date.parse(value);
|
|
@@ -1884,7 +1884,7 @@ function toAitIapProductInfo(nativeProduct, configured) {
|
|
|
1884
1884
|
}
|
|
1885
1885
|
function normalizeAitIapDisplayText(value) {
|
|
1886
1886
|
const normalized = value.trim();
|
|
1887
|
-
return normalized.length > 0 && normalized.length <=
|
|
1887
|
+
return normalized.length > 0 && normalized.length <= 2_048 && !/[\p{Cc}\p{Cf}]/u.test(normalized)
|
|
1888
1888
|
? normalized
|
|
1889
1889
|
: undefined;
|
|
1890
1890
|
}
|
|
@@ -1896,7 +1896,7 @@ function normalizeIapProducts(input) {
|
|
|
1896
1896
|
? normalizeAitIapConfigIdentifier(rawProduct.productId, 'productId', 128)
|
|
1897
1897
|
: undefined;
|
|
1898
1898
|
const sku = typeof rawProduct.sku === 'string'
|
|
1899
|
-
? normalizeAitIapConfigIdentifier(rawProduct.sku, 'sku',
|
|
1899
|
+
? normalizeAitIapConfigIdentifier(rawProduct.sku, 'sku', 2_048)
|
|
1900
1900
|
: undefined;
|
|
1901
1901
|
const currencyCode = normalizeAitIapCurrencyCode(rawProduct.currencyCode);
|
|
1902
1902
|
if (productId === undefined || sku === undefined || currencyCode === undefined) {
|
package/dist/local-mock.js
CHANGED
|
@@ -73,5 +73,7 @@ export const IAP = {
|
|
|
73
73
|
createOneTimePurchaseOrder: Object.assign((_callbacks) => noOpSubscription(), { isSupported: unsupported }),
|
|
74
74
|
getProductItemList: Object.assign(async () => ({ products: [] }), { isSupported: unsupported }),
|
|
75
75
|
getPendingOrders: Object.assign(async () => ({ orders: [] }), { isSupported: unsupported }),
|
|
76
|
-
completeProductGrant: Object.assign(async () => false, {
|
|
76
|
+
completeProductGrant: Object.assign(async () => false, {
|
|
77
|
+
isSupported: unsupported,
|
|
78
|
+
}),
|
|
77
79
|
};
|
package/dist/safe-area.js
CHANGED
|
@@ -16,8 +16,8 @@ export const aitSafeAreaCssVariables = Object.freeze({
|
|
|
16
16
|
navigationControlRight: '--mpgd-ait-navigation-control-right',
|
|
17
17
|
navigationContentTop: '--mpgd-ait-navigation-content-top',
|
|
18
18
|
});
|
|
19
|
-
const maximumSafeAreaInsetPx =
|
|
20
|
-
const maximumCssPixelOptionPx =
|
|
19
|
+
const maximumSafeAreaInsetPx = 4_096;
|
|
20
|
+
const maximumCssPixelOptionPx = 4_096;
|
|
21
21
|
/**
|
|
22
22
|
* Mirror the official AIT `SafeArea` snapshot into CSS custom properties and
|
|
23
23
|
* keep them current when the WebView changes presentation or orientation.
|
package/dist/wrapper.js
CHANGED
|
@@ -2,7 +2,7 @@ import { aitGameBundleBasePath, rewriteAitGameBundleUrl } from './wrapper-url';
|
|
|
2
2
|
const gameBundleBasePath = aitGameBundleBasePath;
|
|
3
3
|
const gameBundleIndexPath = `${gameBundleBasePath}index.html`;
|
|
4
4
|
const gameAssetAttribute = 'data-mpgd-ait-game-asset';
|
|
5
|
-
const resourceLoadTimeoutMs =
|
|
5
|
+
const resourceLoadTimeoutMs = 15_000;
|
|
6
6
|
const safeScriptAttributes = new Set([
|
|
7
7
|
'crossorigin',
|
|
8
8
|
'integrity',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpgd/adapter-ait",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "Apps in Toss WebView platform adapter for mpgd games.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"dist"
|
|
56
56
|
],
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@mpgd/bridge": "0.9.
|
|
59
|
-
"@mpgd/platform": "0.12.
|
|
58
|
+
"@mpgd/bridge": "0.9.1",
|
|
59
|
+
"@mpgd/platform": "0.12.1"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@apps-in-toss/web-framework": ">=3.0.0 <4"
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@apps-in-toss/web-framework": "3.
|
|
71
|
-
"ttsc": "0.
|
|
70
|
+
"@apps-in-toss/web-framework": "3.5.0",
|
|
71
|
+
"ttsc": "0.30.4",
|
|
72
72
|
"typescript": "7.0.2",
|
|
73
73
|
"vitest": "^4.0.0"
|
|
74
74
|
},
|