@ait-co/devtools 0.1.95 → 0.1.96
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/mcp/cli.js +3 -3
- package/dist/mcp/server.js +1 -1
- package/dist/mock/index.d.ts +111 -175
- package/dist/mock/index.d.ts.map +1 -1
- package/dist/mock/index.js +37 -60
- package/dist/mock/index.js.map +1 -1
- package/dist/panel/index.js +51 -54
- package/dist/panel/index.js.map +1 -1
- package/package.json +1 -1
package/dist/mock/index.js
CHANGED
|
@@ -317,10 +317,6 @@ function waitForPromptResponse(type) {
|
|
|
317
317
|
//#endregion
|
|
318
318
|
//#region src/mock/permissions.ts
|
|
319
319
|
/**
|
|
320
|
-
* 권한 시스템 mock
|
|
321
|
-
* 각 디바이스 API (.getPermission, .openPermissionDialog)에 부착된다.
|
|
322
|
-
*/
|
|
323
|
-
/**
|
|
324
320
|
* web-framework 3.0+ 권한 에러 기반 클래스.
|
|
325
321
|
* `instanceof PermissionError`로 체크하는 코드와 호환된다.
|
|
326
322
|
*/
|
|
@@ -380,22 +376,28 @@ const permissionErrorMap = {
|
|
|
380
376
|
getClipboardText: GetClipboardTextPermissionError,
|
|
381
377
|
setClipboardText: SetClipboardTextPermissionError
|
|
382
378
|
};
|
|
383
|
-
async function getPermission(
|
|
384
|
-
return aitState.state.permissions[name];
|
|
379
|
+
async function getPermission(permission) {
|
|
380
|
+
return aitState.state.permissions[permission.name];
|
|
385
381
|
}
|
|
386
|
-
async function openPermissionDialog(
|
|
387
|
-
if (aitState.state.permissions[name] === "allowed") return "allowed";
|
|
388
|
-
aitState.patch("permissions", { [name]: "allowed" });
|
|
382
|
+
async function openPermissionDialog(permission) {
|
|
383
|
+
if (aitState.state.permissions[permission.name] === "allowed") return "allowed";
|
|
384
|
+
aitState.patch("permissions", { [permission.name]: "allowed" });
|
|
389
385
|
return "allowed";
|
|
390
386
|
}
|
|
391
387
|
async function requestPermission(permission) {
|
|
392
|
-
return openPermissionDialog(permission
|
|
388
|
+
return openPermissionDialog(permission);
|
|
393
389
|
}
|
|
394
390
|
/** 권한이 필요한 함수에 .getPermission(), .openPermissionDialog()를 부착 */
|
|
395
391
|
function withPermission(fn, permissionName) {
|
|
396
392
|
const enhanced = fn;
|
|
397
|
-
enhanced.getPermission = () => getPermission(
|
|
398
|
-
|
|
393
|
+
enhanced.getPermission = () => getPermission({
|
|
394
|
+
name: permissionName,
|
|
395
|
+
access: "access"
|
|
396
|
+
});
|
|
397
|
+
enhanced.openPermissionDialog = () => openPermissionDialog({
|
|
398
|
+
name: permissionName,
|
|
399
|
+
access: "access"
|
|
400
|
+
});
|
|
399
401
|
return enhanced;
|
|
400
402
|
}
|
|
401
403
|
/**
|
|
@@ -583,7 +585,8 @@ const _fetchAlbumItems = async (options) => {
|
|
|
583
585
|
if (mode === "prompt") return fetchAlbumItemsPrompt(maxCount);
|
|
584
586
|
return fetchAlbumItemsMock(maxCount, types);
|
|
585
587
|
};
|
|
586
|
-
const
|
|
588
|
+
const _fetchAlbumItemsWithPermission = withPermission(_fetchAlbumItems, "photos");
|
|
589
|
+
const fetchAlbumItems = Object.assign(_fetchAlbumItemsWithPermission, { isSupported: () => true });
|
|
587
590
|
//#endregion
|
|
588
591
|
//#region src/mock/device/clipboard.ts
|
|
589
592
|
/**
|
|
@@ -849,10 +852,11 @@ function getNetworkStatusByMode() {
|
|
|
849
852
|
* Base64로 인코딩된 PDF 데이터를 네이티브 PDF 뷰어로 여는 mock.
|
|
850
853
|
* mock 환경에서는 즉시 `'CLOSE'`를 반환한다.
|
|
851
854
|
*/
|
|
852
|
-
async
|
|
855
|
+
const _openPDFViewerImpl = async (_params) => {
|
|
853
856
|
await Promise.resolve();
|
|
854
857
|
return "CLOSE";
|
|
855
|
-
}
|
|
858
|
+
};
|
|
859
|
+
const openPDFViewer = Object.assign(_openPDFViewerImpl, { isSupported: () => true });
|
|
856
860
|
//#endregion
|
|
857
861
|
//#region src/mock/proxy.ts
|
|
858
862
|
/**
|
|
@@ -989,9 +993,6 @@ function safeSerialize(value) {
|
|
|
989
993
|
}
|
|
990
994
|
//#endregion
|
|
991
995
|
//#region src/mock/navigation/index.ts
|
|
992
|
-
/**
|
|
993
|
-
* 화면/네비게이션/이벤트 mock
|
|
994
|
-
*/
|
|
995
996
|
async function closeView() {
|
|
996
997
|
console.log("[@ait-co/devtools] closeView called");
|
|
997
998
|
window.history.back();
|
|
@@ -1073,10 +1074,10 @@ async function getNetworkStatus() {
|
|
|
1073
1074
|
if (modeResult) return modeResult;
|
|
1074
1075
|
return aitState.state.networkStatus;
|
|
1075
1076
|
}
|
|
1076
|
-
async
|
|
1077
|
+
const _getServerTimeImpl = async () => {
|
|
1077
1078
|
return Date.now();
|
|
1078
|
-
}
|
|
1079
|
-
getServerTime
|
|
1079
|
+
};
|
|
1080
|
+
const getServerTime = Object.assign(_getServerTimeImpl, { isSupported: () => true });
|
|
1080
1081
|
/**
|
|
1081
1082
|
* 현재 backEvent 구독자 수. graniteEvent.addEventListener('backEvent', …)가
|
|
1082
1083
|
* 증가시키고, 반환된 cleanup이 감소시킨다. 호스트 back 메시지 처리 시 인터셉트
|
|
@@ -1350,16 +1351,6 @@ function installBridges() {
|
|
|
1350
1351
|
}
|
|
1351
1352
|
//#endregion
|
|
1352
1353
|
//#region src/mock/ads/index.ts
|
|
1353
|
-
/**
|
|
1354
|
-
* 광고 mock (GoogleAdMob, TossAds, FullScreenAd)
|
|
1355
|
-
*
|
|
1356
|
-
* 변경 이력 (#196):
|
|
1357
|
-
* - slot 레지스트리로 TossAds destroy/destroyAll 누수 수정 (🟡→🟢)
|
|
1358
|
-
* - attachBanner BannerSlotCallbacks 발화 (onAdRendered/onAdImpression/onNoFill 등)
|
|
1359
|
-
* - initialize onInitialized/onInitializationFailed 발화
|
|
1360
|
-
* - AdMob reward 파라미터화 (state.ads.rewardUnitType/rewardAmount)
|
|
1361
|
-
* - 모든 호출 observe()로 sdkCallLog에 기록
|
|
1362
|
-
*/
|
|
1363
1354
|
function withIsSupported(fn) {
|
|
1364
1355
|
fn.isSupported = () => true;
|
|
1365
1356
|
return fn;
|
|
@@ -1380,7 +1371,7 @@ const GoogleAdMob = createMockProxy("GoogleAdMob", {
|
|
|
1380
1371
|
aitState.patch("ads", { isLoaded: true });
|
|
1381
1372
|
args.onEvent({
|
|
1382
1373
|
type: "loaded",
|
|
1383
|
-
data: {
|
|
1374
|
+
data: { responseInfo: { responseId: `mock-response-${args.options.adGroupId}` } }
|
|
1384
1375
|
});
|
|
1385
1376
|
}, 200);
|
|
1386
1377
|
return () => {};
|
|
@@ -1390,19 +1381,14 @@ const GoogleAdMob = createMockProxy("GoogleAdMob", {
|
|
|
1390
1381
|
args.onError(/* @__PURE__ */ new Error("Ad not loaded"));
|
|
1391
1382
|
return () => {};
|
|
1392
1383
|
}
|
|
1393
|
-
|
|
1394
|
-
setTimeout(() => args.onEvent({
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
unitType: rewardUnitType,
|
|
1402
|
-
unitAmount: rewardAmount
|
|
1403
|
-
}
|
|
1404
|
-
});
|
|
1405
|
-
}, 1e3);
|
|
1384
|
+
const { rewardUnitType, rewardAmount } = aitState.state.ads;
|
|
1385
|
+
setTimeout(() => args.onEvent({
|
|
1386
|
+
type: "userEarnedReward",
|
|
1387
|
+
data: {
|
|
1388
|
+
unitType: rewardUnitType,
|
|
1389
|
+
unitAmount: rewardAmount
|
|
1390
|
+
}
|
|
1391
|
+
}), 1e3);
|
|
1406
1392
|
setTimeout(() => {
|
|
1407
1393
|
args.onEvent({ type: "dismissed" });
|
|
1408
1394
|
aitState.patch("ads", { isLoaded: false });
|
|
@@ -1503,10 +1489,7 @@ const loadFullScreenAd = withIsSupported(observe("loadFullScreenAd", "faithful",
|
|
|
1503
1489
|
return;
|
|
1504
1490
|
}
|
|
1505
1491
|
aitState.patch("ads", { isLoaded: true });
|
|
1506
|
-
args.onEvent({
|
|
1507
|
-
type: "loaded",
|
|
1508
|
-
data: { adGroupId: args.options?.adGroupId }
|
|
1509
|
-
});
|
|
1492
|
+
args.onEvent({ type: "loaded" });
|
|
1510
1493
|
}, 200);
|
|
1511
1494
|
return () => {};
|
|
1512
1495
|
}));
|
|
@@ -1515,7 +1498,7 @@ const showFullScreenAd = withIsSupported(observe("showFullScreenAd", "faithful",
|
|
|
1515
1498
|
args.onError(/* @__PURE__ */ new Error("Ad not loaded"));
|
|
1516
1499
|
return () => {};
|
|
1517
1500
|
}
|
|
1518
|
-
setTimeout(() => args.onEvent({ type: "
|
|
1501
|
+
setTimeout(() => args.onEvent({ type: "clicked" }), 100);
|
|
1519
1502
|
setTimeout(() => args.onEvent({ type: "dismissed" }), 1500);
|
|
1520
1503
|
return () => {};
|
|
1521
1504
|
}));
|
|
@@ -1571,9 +1554,8 @@ async function getIsTossLoginIntegratedService() {
|
|
|
1571
1554
|
return aitState.state.auth.isTossLoginIntegrated;
|
|
1572
1555
|
}
|
|
1573
1556
|
async function getUserKeyForGame() {
|
|
1574
|
-
if (!aitState.state.auth.userKeyHash) return void 0;
|
|
1575
1557
|
return {
|
|
1576
|
-
hash: aitState.state.auth.userKeyHash,
|
|
1558
|
+
hash: aitState.state.auth.userKeyHash ?? "",
|
|
1577
1559
|
type: "HASH"
|
|
1578
1560
|
};
|
|
1579
1561
|
}
|
|
@@ -1589,9 +1571,6 @@ async function appsInTossSignTossCert(_params) {
|
|
|
1589
1571
|
}
|
|
1590
1572
|
//#endregion
|
|
1591
1573
|
//#region src/mock/game/index.ts
|
|
1592
|
-
/**
|
|
1593
|
-
* 게임/프로모션 mock
|
|
1594
|
-
*/
|
|
1595
1574
|
async function grantPromotionReward(params) {
|
|
1596
1575
|
console.log("[@ait-co/devtools] grantPromotionReward:", params.params);
|
|
1597
1576
|
return { key: `mock-reward-${Date.now()}` };
|
|
@@ -1633,9 +1612,6 @@ function contactsViral(params) {
|
|
|
1633
1612
|
}
|
|
1634
1613
|
//#endregion
|
|
1635
1614
|
//#region src/mock/iap/index.ts
|
|
1636
|
-
/**
|
|
1637
|
-
* IAP (인앱결제) mock
|
|
1638
|
-
*/
|
|
1639
1615
|
let orderCounter = 0;
|
|
1640
1616
|
function generateOrderId() {
|
|
1641
1617
|
return `mock-order-${++orderCounter}-${Date.now()}`;
|
|
@@ -1769,7 +1745,7 @@ const requestTossPayPaysBilling = Object.assign(async function requestTossPayPay
|
|
|
1769
1745
|
* `onError`는 `onEvent` 호출 자체가 throw할 때만 들어간다 (실제 SDK도 reject를
|
|
1770
1746
|
* error가 아닌 event type으로 표현한다).
|
|
1771
1747
|
*/
|
|
1772
|
-
|
|
1748
|
+
const _requestNotificationAgreementImpl = (params) => {
|
|
1773
1749
|
let cancelled = false;
|
|
1774
1750
|
Promise.resolve().then(async () => {
|
|
1775
1751
|
if (cancelled) return;
|
|
@@ -1784,7 +1760,8 @@ function requestNotificationAgreement(params) {
|
|
|
1784
1760
|
return () => {
|
|
1785
1761
|
cancelled = true;
|
|
1786
1762
|
};
|
|
1787
|
-
}
|
|
1763
|
+
};
|
|
1764
|
+
const requestNotificationAgreement = Object.assign(_requestNotificationAgreementImpl, { isSupported: () => true });
|
|
1788
1765
|
//#endregion
|
|
1789
1766
|
//#region src/mock/partner/index.ts
|
|
1790
1767
|
const partner = {
|