@apps-in-toss/native-modules 1.0.3 → 1.1.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/VisibilityChangedByTransparentServiceWebEvent-D6XJvPVh.d.cts +20 -0
- package/dist/VisibilityChangedByTransparentServiceWebEvent-D6XJvPVh.d.ts +20 -0
- package/dist/bridges-meta.json +24 -12
- package/dist/chunk-YS54L7RG.js +209 -0
- package/dist/index.cjs +167 -122
- package/dist/index.d.cts +635 -589
- package/dist/index.d.ts +635 -589
- package/dist/index.js +167 -122
- package/dist/private.cjs +236 -0
- package/dist/private.d.cts +17 -0
- package/dist/private.d.ts +17 -0
- package/dist/private.js +11 -0
- package/package.json +3 -2
- package/src/AppsInTossModule/native-event-emitter/StartUpdateLocationPermissionError.ts +1 -0
- package/src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts +3 -3
- package/src/AppsInTossModule/native-event-emitter/index.ts +1 -0
- package/src/AppsInTossModule/native-event-emitter/internal/appBridge.ts +7 -1
- package/src/AppsInTossModule/native-event-emitter/startUpdateLocation.ts +64 -44
- package/src/AppsInTossModule/native-modules/AppsInTossModule.ts +22 -27
- package/src/AppsInTossModule/native-modules/getPermission.ts +1 -1
- package/src/AppsInTossModule/native-modules/index.ts +9 -6
- package/src/AppsInTossModule/native-modules/permissions/createPermissionFunction.ts +25 -0
- package/src/AppsInTossModule/native-modules/permissions/fetchAlbumPhotos/fetchAlbumPhotos.ts +109 -0
- package/src/AppsInTossModule/native-modules/{fetchContacts.ts → permissions/fetchContacts/fetchContacts.ts} +51 -40
- package/src/AppsInTossModule/native-modules/permissions/getClipboardText/getClipboardText.ts +87 -0
- package/src/AppsInTossModule/native-modules/permissions/getCurrentLocation/getCurrentLocation.ts +88 -0
- package/src/AppsInTossModule/native-modules/permissions/openCamera/openCamera.ts +99 -0
- package/src/AppsInTossModule/native-modules/{openPermissionDialog.ts → permissions/openPermissionDialog.ts} +3 -3
- package/src/AppsInTossModule/native-modules/{requestPermission.ts → permissions/requestPermission.ts} +2 -2
- package/src/AppsInTossModule/native-modules/permissions/setClipboardText/setClipboardText.ts +75 -0
- package/src/AppsInTossModule/native-modules/saveBase64Data.ts +1 -1
- package/src/async-bridges.ts +9 -6
- package/src/types.ts +0 -106
- package/src/AppsInTossModule/native-modules/fetchAlbumPhotos.ts +0 -88
- package/src/AppsInTossModule/native-modules/getClipboardText.ts +0 -47
- package/src/AppsInTossModule/native-modules/getCurrentLocation.ts +0 -65
- package/src/AppsInTossModule/native-modules/openCamera.ts +0 -81
- package/src/AppsInTossModule/native-modules/setClipboardText.ts +0 -39
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ var HomeIconButtonClickHandleEvent = class extends GraniteEventDefinition2 {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
27
|
+
import { GetCurrentLocationPermissionError } from "@apps-in-toss/types";
|
|
27
28
|
import { GraniteEventDefinition as GraniteEventDefinition3 } from "@granite-js/react-native";
|
|
28
29
|
|
|
29
30
|
// src/AppsInTossModule/native-modules/AppsInTossModule.ts
|
|
@@ -32,17 +33,17 @@ var Module = TurboModuleRegistry.getEnforcing("AppsInTossModule");
|
|
|
32
33
|
var AppsInTossModuleInstance = Module;
|
|
33
34
|
var AppsInTossModule = Module;
|
|
34
35
|
|
|
36
|
+
// src/AppsInTossModule/native-modules/permissions/openPermissionDialog.ts
|
|
37
|
+
function openPermissionDialog(permission) {
|
|
38
|
+
return AppsInTossModule.openPermissionDialog(permission);
|
|
39
|
+
}
|
|
40
|
+
|
|
35
41
|
// src/AppsInTossModule/native-modules/getPermission.ts
|
|
36
42
|
function getPermission(permission) {
|
|
37
43
|
return AppsInTossModule.getPermission(permission);
|
|
38
44
|
}
|
|
39
45
|
|
|
40
|
-
// src/AppsInTossModule/native-modules/
|
|
41
|
-
function openPermissionDialog(permission) {
|
|
42
|
-
return AppsInTossModule.openPermissionDialog(permission);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// src/AppsInTossModule/native-modules/requestPermission.ts
|
|
46
|
+
// src/AppsInTossModule/native-modules/permissions/requestPermission.ts
|
|
46
47
|
async function requestPermission(permission) {
|
|
47
48
|
const permissionStatus = await getPermission(permission);
|
|
48
49
|
switch (permissionStatus) {
|
|
@@ -75,7 +76,7 @@ var UpdateLocationEvent = class extends GraniteEventDefinition3 {
|
|
|
75
76
|
listener(options, onEvent, onError) {
|
|
76
77
|
requestPermission({ name: "geolocation", access: "access" }).then((permissionStatus) => {
|
|
77
78
|
if (permissionStatus === "denied") {
|
|
78
|
-
onError(new
|
|
79
|
+
onError(new GetCurrentLocationPermissionError());
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
81
82
|
void AppsInTossModuleInstance.startUpdateLocation(options).catch(onError);
|
|
@@ -106,7 +107,12 @@ function invokeAppBridgeCallback(id, ...args) {
|
|
|
106
107
|
function invokeAppBridgeMethod(methodName, params, callbacks) {
|
|
107
108
|
const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
|
|
108
109
|
const { callbackMap, unregisterAll } = registerCallbacks(appBridgeCallbacks);
|
|
109
|
-
const
|
|
110
|
+
const method = AppsInTossModuleInstance[methodName];
|
|
111
|
+
if (method == null) {
|
|
112
|
+
onError(new Error(`'${methodName}' is not defined in AppsInTossModule`));
|
|
113
|
+
return unregisterAll;
|
|
114
|
+
}
|
|
115
|
+
const promise = method({
|
|
110
116
|
params,
|
|
111
117
|
callbacks: callbackMap
|
|
112
118
|
});
|
|
@@ -211,9 +217,12 @@ var appsInTossEvent = new GraniteEvent([
|
|
|
211
217
|
new VisibilityChangedByTransparentServiceWebEvent()
|
|
212
218
|
]);
|
|
213
219
|
|
|
214
|
-
// src/AppsInTossModule/native-
|
|
215
|
-
|
|
216
|
-
|
|
220
|
+
// src/AppsInTossModule/native-modules/ads/googleAdMob.ts
|
|
221
|
+
import { noop } from "es-toolkit";
|
|
222
|
+
|
|
223
|
+
// src/AppsInTossModule/native-modules/getOperationalEnvironment.ts
|
|
224
|
+
function getOperationalEnvironment() {
|
|
225
|
+
return AppsInTossModule.operationalEnvironment;
|
|
217
226
|
}
|
|
218
227
|
|
|
219
228
|
// src/AppsInTossModule/native-modules/isMinVersionSupported.ts
|
|
@@ -307,42 +316,6 @@ function isMinVersionSupported(minVersions) {
|
|
|
307
316
|
return compareVersions(currentVersion, minVersion) >= 0;
|
|
308
317
|
}
|
|
309
318
|
|
|
310
|
-
// src/AppsInTossModule/native-event-emitter/contactsViral.ts
|
|
311
|
-
function contactsViral(params) {
|
|
312
|
-
const isSupported = isMinVersionSupported({
|
|
313
|
-
android: "5.223.0",
|
|
314
|
-
ios: "5.223.0"
|
|
315
|
-
});
|
|
316
|
-
if (!isSupported) {
|
|
317
|
-
return () => {
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
const { onEvent, onError, options } = params;
|
|
321
|
-
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("contactsViral", options, {
|
|
322
|
-
onRewardFromContactsViral: (result) => {
|
|
323
|
-
onEvent({ type: "sendViral", data: result });
|
|
324
|
-
},
|
|
325
|
-
onSuccess: (result) => {
|
|
326
|
-
onEvent({ type: "close", data: result });
|
|
327
|
-
},
|
|
328
|
-
onError
|
|
329
|
-
});
|
|
330
|
-
return unregisterCallbacks;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
// src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
334
|
-
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
335
|
-
return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
// src/AppsInTossModule/native-modules/ads/googleAdMob.ts
|
|
339
|
-
import { noop } from "es-toolkit";
|
|
340
|
-
|
|
341
|
-
// src/AppsInTossModule/native-modules/getOperationalEnvironment.ts
|
|
342
|
-
function getOperationalEnvironment() {
|
|
343
|
-
return AppsInTossModule.operationalEnvironment;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
319
|
// src/AppsInTossModule/native-modules/ads/googleAdMob.ts
|
|
347
320
|
function loadAdMobInterstitialAd(params) {
|
|
348
321
|
if (!loadAdMobInterstitialAd.isSupported()) {
|
|
@@ -546,54 +519,118 @@ async function eventLog(params) {
|
|
|
546
519
|
});
|
|
547
520
|
}
|
|
548
521
|
|
|
549
|
-
// src/AppsInTossModule/native-modules/fetchAlbumPhotos.ts
|
|
550
|
-
|
|
551
|
-
var DEFAULT_MAX_WIDTH = 1024;
|
|
552
|
-
async function fetchAlbumPhotos(options) {
|
|
553
|
-
const permissionStatus = await requestPermission({ name: "photos", access: "read" });
|
|
554
|
-
if (permissionStatus === "denied") {
|
|
555
|
-
throw new Error("\uC0AC\uC9C4\uCCA9 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
556
|
-
}
|
|
557
|
-
const albumPhotos = await AppsInTossModule.fetchAlbumPhotos({
|
|
558
|
-
...options,
|
|
559
|
-
maxCount: options.maxCount ?? DEFAULT_MAX_COUNT,
|
|
560
|
-
maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH
|
|
561
|
-
});
|
|
562
|
-
return albumPhotos;
|
|
563
|
-
}
|
|
522
|
+
// src/AppsInTossModule/native-modules/permissions/fetchAlbumPhotos/fetchAlbumPhotos.ts
|
|
523
|
+
import { FetchAlbumPhotosPermissionError } from "@apps-in-toss/types";
|
|
564
524
|
|
|
565
|
-
// src/AppsInTossModule/native-modules/
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
525
|
+
// src/AppsInTossModule/native-modules/permissions/createPermissionFunction.ts
|
|
526
|
+
function createPermissionFunction({
|
|
527
|
+
handler,
|
|
528
|
+
permission,
|
|
529
|
+
error
|
|
530
|
+
}) {
|
|
531
|
+
const permissionFunction = async (...args) => {
|
|
532
|
+
const permissionStatus = await requestPermission(permission);
|
|
533
|
+
if (permissionStatus === "denied") {
|
|
534
|
+
throw new error();
|
|
535
|
+
}
|
|
536
|
+
return handler(...args);
|
|
576
537
|
};
|
|
538
|
+
permissionFunction.getPermission = () => getPermission(permission);
|
|
539
|
+
permissionFunction.openPermissionDialog = () => openPermissionDialog(permission);
|
|
540
|
+
return permissionFunction;
|
|
577
541
|
}
|
|
578
542
|
|
|
579
|
-
// src/AppsInTossModule/native-modules/
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
543
|
+
// src/AppsInTossModule/native-modules/permissions/fetchAlbumPhotos/fetchAlbumPhotos.ts
|
|
544
|
+
var DEFAULT_MAX_COUNT = 10;
|
|
545
|
+
var DEFAULT_MAX_WIDTH = 1024;
|
|
546
|
+
var fetchAlbumPhotos = createPermissionFunction({
|
|
547
|
+
handler: async (options) => {
|
|
548
|
+
return AppsInTossModule.fetchAlbumPhotos({
|
|
549
|
+
...options,
|
|
550
|
+
maxCount: options?.maxCount ?? DEFAULT_MAX_COUNT,
|
|
551
|
+
maxWidth: options?.maxWidth ?? DEFAULT_MAX_WIDTH
|
|
552
|
+
});
|
|
553
|
+
},
|
|
554
|
+
permission: {
|
|
555
|
+
name: "photos",
|
|
556
|
+
access: "read"
|
|
557
|
+
},
|
|
558
|
+
error: FetchAlbumPhotosPermissionError
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
// src/AppsInTossModule/native-modules/permissions/fetchContacts/fetchContacts.ts
|
|
562
|
+
import { FetchContactsPermissionError } from "@apps-in-toss/types";
|
|
563
|
+
var fetchContacts = createPermissionFunction({
|
|
564
|
+
handler: async (options) => {
|
|
565
|
+
const contacts = await AppsInTossModule.fetchContacts(options);
|
|
566
|
+
return {
|
|
567
|
+
result: contacts.result,
|
|
568
|
+
nextOffset: contacts.nextOffset ?? null,
|
|
569
|
+
done: contacts.done
|
|
570
|
+
};
|
|
571
|
+
},
|
|
572
|
+
permission: {
|
|
573
|
+
name: "contacts",
|
|
574
|
+
access: "read"
|
|
575
|
+
},
|
|
576
|
+
error: FetchContactsPermissionError
|
|
577
|
+
});
|
|
578
|
+
|
|
579
|
+
// src/AppsInTossModule/native-modules/permissions/getClipboardText/getClipboardText.ts
|
|
580
|
+
import { GetClipboardTextPermissionError } from "@apps-in-toss/types";
|
|
581
|
+
var getClipboardText = createPermissionFunction({
|
|
582
|
+
handler: () => {
|
|
583
|
+
return AppsInTossModule.getClipboardText({});
|
|
584
|
+
},
|
|
585
|
+
permission: {
|
|
586
|
+
name: "clipboard",
|
|
587
|
+
access: "read"
|
|
588
|
+
},
|
|
589
|
+
error: GetClipboardTextPermissionError
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
// src/AppsInTossModule/native-modules/permissions/getCurrentLocation/getCurrentLocation.ts
|
|
593
|
+
import { GetCurrentLocationPermissionError as GetCurrentLocationPermissionError2 } from "@apps-in-toss/types";
|
|
594
|
+
var getCurrentLocation = createPermissionFunction({
|
|
595
|
+
handler: async (options) => {
|
|
596
|
+
return AppsInTossModule.getCurrentLocation(options);
|
|
597
|
+
},
|
|
598
|
+
permission: {
|
|
599
|
+
name: "geolocation",
|
|
600
|
+
access: "access"
|
|
601
|
+
},
|
|
602
|
+
error: GetCurrentLocationPermissionError2
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
// src/AppsInTossModule/native-modules/permissions/setClipboardText/setClipboardText.ts
|
|
606
|
+
import { SetClipboardTextPermissionError } from "@apps-in-toss/types";
|
|
607
|
+
var setClipboardText = createPermissionFunction({
|
|
608
|
+
handler: (text) => {
|
|
609
|
+
return AppsInTossModule.setClipboardText({ text });
|
|
610
|
+
},
|
|
611
|
+
permission: {
|
|
612
|
+
name: "clipboard",
|
|
613
|
+
access: "write"
|
|
614
|
+
},
|
|
615
|
+
error: SetClipboardTextPermissionError
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
// src/AppsInTossModule/native-modules/permissions/openCamera/openCamera.ts
|
|
619
|
+
import { OpenCameraPermissionError } from "@apps-in-toss/types";
|
|
620
|
+
var openCamera = createPermissionFunction({
|
|
621
|
+
handler: (options) => {
|
|
622
|
+
return AppsInTossModule.openCamera({
|
|
623
|
+
base64: false,
|
|
624
|
+
maxWidth: 1024,
|
|
625
|
+
...options
|
|
626
|
+
});
|
|
627
|
+
},
|
|
628
|
+
permission: {
|
|
629
|
+
name: "camera",
|
|
630
|
+
access: "access"
|
|
631
|
+
},
|
|
632
|
+
error: OpenCameraPermissionError
|
|
633
|
+
});
|
|
597
634
|
|
|
598
635
|
// src/AppsInTossModule/native-modules/getDeviceId.ts
|
|
599
636
|
function getDeviceId() {
|
|
@@ -640,16 +677,6 @@ var IAP = {
|
|
|
640
677
|
getProductItemList
|
|
641
678
|
};
|
|
642
679
|
|
|
643
|
-
// src/AppsInTossModule/native-modules/openCamera.ts
|
|
644
|
-
async function openCamera(options) {
|
|
645
|
-
const permissionStatus = await requestPermission({ name: "camera", access: "access" });
|
|
646
|
-
if (permissionStatus === "denied") {
|
|
647
|
-
throw new Error("\uCE74\uBA54\uB77C \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
648
|
-
}
|
|
649
|
-
const photo = await AppsInTossModule.openCamera({ base64: false, maxWidth: 1024, ...options });
|
|
650
|
-
return photo;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
680
|
// src/AppsInTossModule/native-modules/saveBase64Data.ts
|
|
654
681
|
async function saveBase64Data(params) {
|
|
655
682
|
const isSupported = isMinVersionSupported({
|
|
@@ -663,15 +690,6 @@ async function saveBase64Data(params) {
|
|
|
663
690
|
await AppsInTossModule.saveBase64Data(params);
|
|
664
691
|
}
|
|
665
692
|
|
|
666
|
-
// src/AppsInTossModule/native-modules/setClipboardText.ts
|
|
667
|
-
async function setClipboardText(text) {
|
|
668
|
-
const permissionStatus = await requestPermission({ name: "clipboard", access: "write" });
|
|
669
|
-
if (permissionStatus === "denied") {
|
|
670
|
-
throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
|
|
671
|
-
}
|
|
672
|
-
return AppsInTossModule.setClipboardText({ text });
|
|
673
|
-
}
|
|
674
|
-
|
|
675
693
|
// src/AppsInTossModule/native-modules/setDeviceOrientation.ts
|
|
676
694
|
async function setDeviceOrientation(options) {
|
|
677
695
|
const isSupported = isMinVersionSupported({
|
|
@@ -749,6 +767,29 @@ async function submitGameCenterLeaderBoardScore(params) {
|
|
|
749
767
|
return AppsInTossModule.submitGameCenterLeaderBoardScore(params);
|
|
750
768
|
}
|
|
751
769
|
|
|
770
|
+
// src/AppsInTossModule/native-event-emitter/contactsViral.ts
|
|
771
|
+
function contactsViral(params) {
|
|
772
|
+
const isSupported = isMinVersionSupported({
|
|
773
|
+
android: "5.223.0",
|
|
774
|
+
ios: "5.223.0"
|
|
775
|
+
});
|
|
776
|
+
if (!isSupported) {
|
|
777
|
+
return () => {
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
const { onEvent, onError, options } = params;
|
|
781
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("contactsViral", options, {
|
|
782
|
+
onRewardFromContactsViral: (result) => {
|
|
783
|
+
onEvent({ type: "sendViral", data: result });
|
|
784
|
+
},
|
|
785
|
+
onSuccess: (result) => {
|
|
786
|
+
onEvent({ type: "close", data: result });
|
|
787
|
+
},
|
|
788
|
+
onError
|
|
789
|
+
});
|
|
790
|
+
return unregisterCallbacks;
|
|
791
|
+
}
|
|
792
|
+
|
|
752
793
|
// src/AppsInTossModule/native-modules/index.ts
|
|
753
794
|
var TossPay = {
|
|
754
795
|
checkoutPayment
|
|
@@ -762,6 +803,21 @@ var GoogleAdMob = {
|
|
|
762
803
|
showAppsInTossAdMob
|
|
763
804
|
};
|
|
764
805
|
|
|
806
|
+
// src/AppsInTossModule/native-event-emitter/startUpdateLocation.ts
|
|
807
|
+
function startUpdateLocation(eventParams) {
|
|
808
|
+
return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
|
|
809
|
+
}
|
|
810
|
+
startUpdateLocation.openPermissionDialog = getCurrentLocation.openPermissionDialog;
|
|
811
|
+
startUpdateLocation.getPermission = getCurrentLocation.getPermission;
|
|
812
|
+
|
|
813
|
+
// src/AppsInTossModule/native-event-emitter/StartUpdateLocationPermissionError.ts
|
|
814
|
+
import { StartUpdateLocationPermissionError } from "@apps-in-toss/types";
|
|
815
|
+
|
|
816
|
+
// src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
817
|
+
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
818
|
+
return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
819
|
+
}
|
|
820
|
+
|
|
765
821
|
// src/BedrockModule/native-modules/natives/BedrockModule.ts
|
|
766
822
|
import { NativeModules } from "react-native";
|
|
767
823
|
var BedrockModule = NativeModules.BedrockModule;
|
|
@@ -838,17 +894,6 @@ function getPlatformOS() {
|
|
|
838
894
|
import { NativeModules as NativeModules2 } from "react-native";
|
|
839
895
|
var BedrockCoreModule = NativeModules2.BedrockCoreModule;
|
|
840
896
|
|
|
841
|
-
// src/types.ts
|
|
842
|
-
var Accuracy = /* @__PURE__ */ ((Accuracy2) => {
|
|
843
|
-
Accuracy2[Accuracy2["Lowest"] = 1] = "Lowest";
|
|
844
|
-
Accuracy2[Accuracy2["Low"] = 2] = "Low";
|
|
845
|
-
Accuracy2[Accuracy2["Balanced"] = 3] = "Balanced";
|
|
846
|
-
Accuracy2[Accuracy2["High"] = 4] = "High";
|
|
847
|
-
Accuracy2[Accuracy2["Highest"] = 5] = "Highest";
|
|
848
|
-
Accuracy2[Accuracy2["BestForNavigation"] = 6] = "BestForNavigation";
|
|
849
|
-
return Accuracy2;
|
|
850
|
-
})(Accuracy || {});
|
|
851
|
-
|
|
852
897
|
// src/AppsInTossModule/native-modules/tossCore.ts
|
|
853
898
|
import { NativeModules as NativeModules3 } from "react-native";
|
|
854
899
|
var TossCoreModule = NativeModules3.TossCoreModule;
|
|
@@ -872,7 +917,6 @@ var INTERNAL__module = {
|
|
|
872
917
|
tossCoreEventLog
|
|
873
918
|
};
|
|
874
919
|
export {
|
|
875
|
-
Accuracy,
|
|
876
920
|
AppsInTossModule,
|
|
877
921
|
BedrockCoreModule,
|
|
878
922
|
BedrockModule,
|
|
@@ -881,6 +925,7 @@ export {
|
|
|
881
925
|
AppsInTossModuleInstance as INTERNAL__AppsInTossModule,
|
|
882
926
|
INTERNAL__appBridgeHandler,
|
|
883
927
|
INTERNAL__module,
|
|
928
|
+
StartUpdateLocationPermissionError,
|
|
884
929
|
Storage,
|
|
885
930
|
TossPay,
|
|
886
931
|
appLogin,
|
package/dist/private.cjs
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/private.ts
|
|
21
|
+
var private_exports = {};
|
|
22
|
+
__export(private_exports, {
|
|
23
|
+
onVisibilityChangedByTransparentServiceWeb: () => onVisibilityChangedByTransparentServiceWeb
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(private_exports);
|
|
26
|
+
|
|
27
|
+
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
28
|
+
var import_react_native7 = require("@granite-js/react-native");
|
|
29
|
+
|
|
30
|
+
// src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
|
|
31
|
+
var import_react_native = require("@granite-js/react-native");
|
|
32
|
+
var EntryMessageExitedEvent = class extends import_react_native.GraniteEventDefinition {
|
|
33
|
+
name = "entryMessageExited";
|
|
34
|
+
remove() {
|
|
35
|
+
}
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
|
+
listener(_) {
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
42
|
+
var import_react_native4 = require("@granite-js/react-native");
|
|
43
|
+
|
|
44
|
+
// src/AppsInTossModule/native-modules/AppsInTossModule.ts
|
|
45
|
+
var import_react_native2 = require("react-native");
|
|
46
|
+
var Module = import_react_native2.TurboModuleRegistry.getEnforcing("AppsInTossModule");
|
|
47
|
+
var AppsInTossModuleInstance = Module;
|
|
48
|
+
var AppsInTossModule = Module;
|
|
49
|
+
|
|
50
|
+
// src/AppsInTossModule/native-modules/getPermission.ts
|
|
51
|
+
function getPermission(permission) {
|
|
52
|
+
return AppsInTossModule.getPermission(permission);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// src/AppsInTossModule/native-modules/openPermissionDialog.ts
|
|
56
|
+
function openPermissionDialog(permission) {
|
|
57
|
+
return AppsInTossModule.openPermissionDialog(permission);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// src/AppsInTossModule/native-modules/requestPermission.ts
|
|
61
|
+
async function requestPermission(permission) {
|
|
62
|
+
const permissionStatus = await getPermission(permission);
|
|
63
|
+
switch (permissionStatus) {
|
|
64
|
+
case "allowed":
|
|
65
|
+
case "denied":
|
|
66
|
+
return permissionStatus;
|
|
67
|
+
default:
|
|
68
|
+
return openPermissionDialog(permission);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts
|
|
73
|
+
var import_react_native3 = require("react-native");
|
|
74
|
+
var nativeEventEmitter = new import_react_native3.NativeEventEmitter(AppsInTossModuleInstance);
|
|
75
|
+
|
|
76
|
+
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
77
|
+
var UpdateLocationEvent = class extends import_react_native4.GraniteEventDefinition {
|
|
78
|
+
name = "updateLocationEvent";
|
|
79
|
+
subscriptionCount = 0;
|
|
80
|
+
ref = {
|
|
81
|
+
remove: () => {
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
remove() {
|
|
85
|
+
if (--this.subscriptionCount === 0) {
|
|
86
|
+
AppsInTossModuleInstance.stopUpdateLocation({});
|
|
87
|
+
}
|
|
88
|
+
this.ref.remove();
|
|
89
|
+
}
|
|
90
|
+
listener(options, onEvent, onError) {
|
|
91
|
+
requestPermission({ name: "geolocation", access: "access" }).then((permissionStatus) => {
|
|
92
|
+
if (permissionStatus === "denied") {
|
|
93
|
+
onError(new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694."));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
void AppsInTossModuleInstance.startUpdateLocation(options).catch(onError);
|
|
97
|
+
const subscription = nativeEventEmitter.addListener("updateLocation", onEvent);
|
|
98
|
+
this.ref = {
|
|
99
|
+
remove: () => subscription?.remove()
|
|
100
|
+
};
|
|
101
|
+
this.subscriptionCount++;
|
|
102
|
+
}).catch(onError);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
107
|
+
var import_react_native5 = require("@granite-js/react-native");
|
|
108
|
+
|
|
109
|
+
// src/utils/generateUUID.ts
|
|
110
|
+
function generateUUID(placeholder) {
|
|
111
|
+
return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// src/AppsInTossModule/native-event-emitter/internal/appBridge.ts
|
|
115
|
+
var INTERNAL__callbacks = /* @__PURE__ */ new Map();
|
|
116
|
+
function invokeAppBridgeCallback(id, ...args) {
|
|
117
|
+
const callback = INTERNAL__callbacks.get(id);
|
|
118
|
+
callback?.call(null, ...args);
|
|
119
|
+
return Boolean(callback);
|
|
120
|
+
}
|
|
121
|
+
function invokeAppBridgeMethod(methodName, params, callbacks) {
|
|
122
|
+
const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
|
|
123
|
+
const { callbackMap, unregisterAll } = registerCallbacks(appBridgeCallbacks);
|
|
124
|
+
const promise = AppsInTossModuleInstance[methodName]({
|
|
125
|
+
params,
|
|
126
|
+
callbacks: callbackMap
|
|
127
|
+
});
|
|
128
|
+
void promise.then(onSuccess).catch(onError);
|
|
129
|
+
return unregisterAll;
|
|
130
|
+
}
|
|
131
|
+
function registerCallbacks(callbacks) {
|
|
132
|
+
const callbackMap = {};
|
|
133
|
+
for (const [callbackName, callback] of Object.entries(callbacks)) {
|
|
134
|
+
const id = registerCallback(callback, callbackName);
|
|
135
|
+
callbackMap[callbackName] = id;
|
|
136
|
+
}
|
|
137
|
+
const unregisterAll = () => {
|
|
138
|
+
Object.values(callbackMap).forEach(unregisterCallback);
|
|
139
|
+
};
|
|
140
|
+
return { callbackMap, unregisterAll };
|
|
141
|
+
}
|
|
142
|
+
function registerCallback(callback, name = "unnamed") {
|
|
143
|
+
const uniqueId = generateUUID();
|
|
144
|
+
const callbackId = `${uniqueId}__${name}`;
|
|
145
|
+
INTERNAL__callbacks.set(callbackId, callback);
|
|
146
|
+
return callbackId;
|
|
147
|
+
}
|
|
148
|
+
function unregisterCallback(id) {
|
|
149
|
+
INTERNAL__callbacks.delete(id);
|
|
150
|
+
}
|
|
151
|
+
function getCallbackIds() {
|
|
152
|
+
return Array.from(INTERNAL__callbacks.keys());
|
|
153
|
+
}
|
|
154
|
+
var INTERNAL__appBridgeHandler = {
|
|
155
|
+
invokeAppBridgeCallback,
|
|
156
|
+
invokeAppBridgeMethod,
|
|
157
|
+
registerCallback,
|
|
158
|
+
unregisterCallback,
|
|
159
|
+
getCallbackIds
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
163
|
+
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
164
|
+
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native5.GraniteEventDefinition {
|
|
165
|
+
static INTERNAL__appBridgeSubscription;
|
|
166
|
+
name = "appBridgeCallbackEvent";
|
|
167
|
+
constructor() {
|
|
168
|
+
super();
|
|
169
|
+
this.registerAppBridgeCallbackEventListener();
|
|
170
|
+
}
|
|
171
|
+
remove() {
|
|
172
|
+
}
|
|
173
|
+
listener() {
|
|
174
|
+
}
|
|
175
|
+
registerAppBridgeCallbackEventListener() {
|
|
176
|
+
if (_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription != null) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription = UNSAFE__nativeEventEmitter.addListener(
|
|
180
|
+
"appBridgeCallback",
|
|
181
|
+
this.ensureInvokeAppBridgeCallback
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
ensureInvokeAppBridgeCallback(result) {
|
|
185
|
+
if (typeof result === "object" && typeof result.name === "string") {
|
|
186
|
+
INTERNAL__appBridgeHandler.invokeAppBridgeCallback(result.name, result.params);
|
|
187
|
+
} else {
|
|
188
|
+
console.warn("Invalid app bridge callback result:", result);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
// src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
194
|
+
var import_react_native6 = require("@granite-js/react-native");
|
|
195
|
+
var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_native6.GraniteEventDefinition {
|
|
196
|
+
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
197
|
+
subscription = null;
|
|
198
|
+
remove() {
|
|
199
|
+
this.subscription?.remove();
|
|
200
|
+
this.subscription = null;
|
|
201
|
+
}
|
|
202
|
+
listener(options, onEvent, onError) {
|
|
203
|
+
const subscription = nativeEventEmitter.addListener("visibilityChangedByTransparentServiceWeb", (params) => {
|
|
204
|
+
if (this.isVisibilityChangedByTransparentServiceWebResult(params)) {
|
|
205
|
+
if (params.callbackId === options.callbackId) {
|
|
206
|
+
onEvent(params.isVisible);
|
|
207
|
+
}
|
|
208
|
+
} else {
|
|
209
|
+
onError(new Error("Invalid visibility changed by transparent service web result"));
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
this.subscription = subscription;
|
|
213
|
+
}
|
|
214
|
+
isVisibilityChangedByTransparentServiceWebResult(params) {
|
|
215
|
+
return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
// src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
|
|
220
|
+
var appsInTossEvent = new import_react_native7.GraniteEvent([
|
|
221
|
+
new AppBridgeCallbackEvent(),
|
|
222
|
+
new UpdateLocationEvent(),
|
|
223
|
+
new EntryMessageExitedEvent(),
|
|
224
|
+
// Internal events
|
|
225
|
+
new AppBridgeCallbackEvent(),
|
|
226
|
+
new VisibilityChangedByTransparentServiceWebEvent()
|
|
227
|
+
]);
|
|
228
|
+
|
|
229
|
+
// src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
230
|
+
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
231
|
+
return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
232
|
+
}
|
|
233
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
234
|
+
0 && (module.exports = {
|
|
235
|
+
onVisibilityChangedByTransparentServiceWeb
|
|
236
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EmitterSubscription } from 'react-native';
|
|
2
|
+
import { E as EventEmitterSchema, a as VisibilityChangedByTransparentServiceWebOptions } from './VisibilityChangedByTransparentServiceWebEvent-D6XJvPVh.cjs';
|
|
3
|
+
import '@granite-js/react-native';
|
|
4
|
+
|
|
5
|
+
interface OnVisibilityChangedByTransparentServiceWebSubscription extends EmitterSubscription {
|
|
6
|
+
remove: () => void;
|
|
7
|
+
}
|
|
8
|
+
type OnVisibilityChangedByTransparentServiceWebEventEmitter = EventEmitterSchema<'visibilityChangedByTransparentServiceWeb', [
|
|
9
|
+
boolean
|
|
10
|
+
]>;
|
|
11
|
+
declare function onVisibilityChangedByTransparentServiceWeb(eventParams: {
|
|
12
|
+
options: VisibilityChangedByTransparentServiceWebOptions;
|
|
13
|
+
onEvent: (isVisible: boolean) => void;
|
|
14
|
+
onError: (error: unknown) => void;
|
|
15
|
+
}): () => void;
|
|
16
|
+
|
|
17
|
+
export { type OnVisibilityChangedByTransparentServiceWebEventEmitter, type OnVisibilityChangedByTransparentServiceWebSubscription, onVisibilityChangedByTransparentServiceWeb };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EmitterSubscription } from 'react-native';
|
|
2
|
+
import { E as EventEmitterSchema, a as VisibilityChangedByTransparentServiceWebOptions } from './VisibilityChangedByTransparentServiceWebEvent-D6XJvPVh.js';
|
|
3
|
+
import '@granite-js/react-native';
|
|
4
|
+
|
|
5
|
+
interface OnVisibilityChangedByTransparentServiceWebSubscription extends EmitterSubscription {
|
|
6
|
+
remove: () => void;
|
|
7
|
+
}
|
|
8
|
+
type OnVisibilityChangedByTransparentServiceWebEventEmitter = EventEmitterSchema<'visibilityChangedByTransparentServiceWeb', [
|
|
9
|
+
boolean
|
|
10
|
+
]>;
|
|
11
|
+
declare function onVisibilityChangedByTransparentServiceWeb(eventParams: {
|
|
12
|
+
options: VisibilityChangedByTransparentServiceWebOptions;
|
|
13
|
+
onEvent: (isVisible: boolean) => void;
|
|
14
|
+
onError: (error: unknown) => void;
|
|
15
|
+
}): () => void;
|
|
16
|
+
|
|
17
|
+
export { type OnVisibilityChangedByTransparentServiceWebEventEmitter, type OnVisibilityChangedByTransparentServiceWebSubscription, onVisibilityChangedByTransparentServiceWeb };
|
package/dist/private.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
appsInTossEvent
|
|
3
|
+
} from "./chunk-YS54L7RG.js";
|
|
4
|
+
|
|
5
|
+
// src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
|
|
6
|
+
function onVisibilityChangedByTransparentServiceWeb(eventParams) {
|
|
7
|
+
return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
onVisibilityChangedByTransparentServiceWeb
|
|
11
|
+
};
|