@apps-in-toss/framework 0.0.0-dev.1741252452371 → 0.0.0-dev.1741346821380

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/index.cjs CHANGED
@@ -32,6 +32,7 @@ var src_exports = {};
32
32
  __export(src_exports, {
33
33
  Accuracy: () => Accuracy2,
34
34
  WebView: () => WebView,
35
+ appLogin: () => appLogin,
35
36
  env: () => env,
36
37
  fetchAlbumPhotos: () => fetchAlbumPhotos,
37
38
  fetchContacts: () => fetchContacts,
@@ -126,6 +127,7 @@ function startUpdateLocation(eventParams) {
126
127
  // src/native-modules/index.ts
127
128
  var native_modules_exports = {};
128
129
  __export(native_modules_exports, {
130
+ appLogin: () => appLogin,
129
131
  fetchAlbumPhotos: () => fetchAlbumPhotos,
130
132
  fetchContacts: () => fetchContacts,
131
133
  getClipboardText: () => getClipboardText,
@@ -210,6 +212,11 @@ async function openCamera(options) {
210
212
  return photo;
211
213
  }
212
214
 
215
+ // src/native-modules/appLogin.ts
216
+ async function appLogin() {
217
+ return AppsInTossModule.appLogin({});
218
+ }
219
+
213
220
  // src/components/WebView.tsx
214
221
  var import_react_native_webview = require("@react-native-bedrock/native/react-native-webview");
215
222
  var import_react = require("react");
@@ -295,6 +302,7 @@ var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
295
302
  0 && (module.exports = {
296
303
  Accuracy,
297
304
  WebView,
305
+ appLogin,
298
306
  env,
299
307
  fetchAlbumPhotos,
300
308
  fetchContacts,
package/dist/index.d.cts CHANGED
@@ -352,7 +352,7 @@ interface FetchAlbumPhotosOptions {
352
352
  * @param {number} [options.maxCount=10] 가져올 사진의 최대 개수를 설정해요. 숫자로 입력하며 기본값은 10이에요.
353
353
  * @param {number} [options.maxWidth=1024] 사진의 최대 폭을 제한해요. 단위는 픽셀이며 기본값은 `1024`이에요.
354
354
  * @param {boolean} [options.base64=false] 이미지를 base64 형식으로 반환할지 설정해요. 기본값은 `false`예요.
355
- * @returns {Promise<AlbumResponse[]>}
355
+ * @returns {Promise<ImageResponse[]>}
356
356
  * 앨범 사진의 고유 ID와 데이터 URI를 포함한 배열을 반환해요.
357
357
  *
358
358
  * @example
@@ -513,6 +513,36 @@ interface OpenCameraOptions {
513
513
  */
514
514
  declare function openCamera(options?: OpenCameraOptions): Promise<ImageResponse>;
515
515
 
516
+ /**
517
+ * @public
518
+ * @tag AppsInTossModule
519
+ * @category AppsInTossModules
520
+ * @kind function
521
+ * @name appLogin
522
+ * @description 토스 인증으로 로그인해요. 로그인이 완료되면 다시 토스 앱으로 이동해요.
523
+ * @example
524
+ *
525
+ * ### 토스 인증을 통해 로그인을 하는 예제
526
+ *
527
+ * ```tsx
528
+ * import { Button } from 'react-native';
529
+ * import { appLogin } from '@apps-in-toss/framework';
530
+ *
531
+ * function Page() {
532
+ * const handleLogin = async () => {
533
+ * const { authorizationCode } = await appLogin();
534
+ *
535
+ * // 획득한 인가 코드(`authorizationCode`)를 서버로 전달해요.
536
+ * }
537
+ *
538
+ * return <Button title="로그인" onPress={handleLogin} />;
539
+ * }
540
+ * ```
541
+ */
542
+ declare function appLogin(): Promise<{
543
+ authorizationCode: string;
544
+ }>;
545
+
516
546
  interface WebViewProps extends Omit<WebViewProps$1, 'source' | 'sharedCookiesEnabled' | 'thirdPartyCookiesEnabled' | 'injectedJavaScriptBeforeContentLoaded'> {
517
547
  localhostPort?: number;
518
548
  }
@@ -569,4 +599,4 @@ declare const env: {
569
599
  getDeploymentId: () => string | undefined;
570
600
  };
571
601
 
572
- export { Accuracy, type ContactEntity, type FetchAlbumPhotosOptions, type GetCurrentLocationOptions, type ImageResponse, type Location, type OpenCameraOptions, type StartUpdateLocationOptions, type StartUpdateLocationSubscription, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, env, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, openCamera, setClipboardText, startUpdateLocation, useGeolocation };
602
+ export { Accuracy, type ContactEntity, type FetchAlbumPhotosOptions, type GetCurrentLocationOptions, type ImageResponse, type Location, type OpenCameraOptions, type StartUpdateLocationOptions, type StartUpdateLocationSubscription, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, appLogin, env, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, openCamera, setClipboardText, startUpdateLocation, useGeolocation };
package/dist/index.d.ts CHANGED
@@ -352,7 +352,7 @@ interface FetchAlbumPhotosOptions {
352
352
  * @param {number} [options.maxCount=10] 가져올 사진의 최대 개수를 설정해요. 숫자로 입력하며 기본값은 10이에요.
353
353
  * @param {number} [options.maxWidth=1024] 사진의 최대 폭을 제한해요. 단위는 픽셀이며 기본값은 `1024`이에요.
354
354
  * @param {boolean} [options.base64=false] 이미지를 base64 형식으로 반환할지 설정해요. 기본값은 `false`예요.
355
- * @returns {Promise<AlbumResponse[]>}
355
+ * @returns {Promise<ImageResponse[]>}
356
356
  * 앨범 사진의 고유 ID와 데이터 URI를 포함한 배열을 반환해요.
357
357
  *
358
358
  * @example
@@ -513,6 +513,36 @@ interface OpenCameraOptions {
513
513
  */
514
514
  declare function openCamera(options?: OpenCameraOptions): Promise<ImageResponse>;
515
515
 
516
+ /**
517
+ * @public
518
+ * @tag AppsInTossModule
519
+ * @category AppsInTossModules
520
+ * @kind function
521
+ * @name appLogin
522
+ * @description 토스 인증으로 로그인해요. 로그인이 완료되면 다시 토스 앱으로 이동해요.
523
+ * @example
524
+ *
525
+ * ### 토스 인증을 통해 로그인을 하는 예제
526
+ *
527
+ * ```tsx
528
+ * import { Button } from 'react-native';
529
+ * import { appLogin } from '@apps-in-toss/framework';
530
+ *
531
+ * function Page() {
532
+ * const handleLogin = async () => {
533
+ * const { authorizationCode } = await appLogin();
534
+ *
535
+ * // 획득한 인가 코드(`authorizationCode`)를 서버로 전달해요.
536
+ * }
537
+ *
538
+ * return <Button title="로그인" onPress={handleLogin} />;
539
+ * }
540
+ * ```
541
+ */
542
+ declare function appLogin(): Promise<{
543
+ authorizationCode: string;
544
+ }>;
545
+
516
546
  interface WebViewProps extends Omit<WebViewProps$1, 'source' | 'sharedCookiesEnabled' | 'thirdPartyCookiesEnabled' | 'injectedJavaScriptBeforeContentLoaded'> {
517
547
  localhostPort?: number;
518
548
  }
@@ -569,4 +599,4 @@ declare const env: {
569
599
  getDeploymentId: () => string | undefined;
570
600
  };
571
601
 
572
- export { Accuracy, type ContactEntity, type FetchAlbumPhotosOptions, type GetCurrentLocationOptions, type ImageResponse, type Location, type OpenCameraOptions, type StartUpdateLocationOptions, type StartUpdateLocationSubscription, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, env, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, openCamera, setClipboardText, startUpdateLocation, useGeolocation };
602
+ export { Accuracy, type ContactEntity, type FetchAlbumPhotosOptions, type GetCurrentLocationOptions, type ImageResponse, type Location, type OpenCameraOptions, type StartUpdateLocationOptions, type StartUpdateLocationSubscription, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, appLogin, env, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, openCamera, setClipboardText, startUpdateLocation, useGeolocation };
package/dist/index.js CHANGED
@@ -86,6 +86,7 @@ function startUpdateLocation(eventParams) {
86
86
  // src/native-modules/index.ts
87
87
  var native_modules_exports = {};
88
88
  __export(native_modules_exports, {
89
+ appLogin: () => appLogin,
89
90
  fetchAlbumPhotos: () => fetchAlbumPhotos,
90
91
  fetchContacts: () => fetchContacts,
91
92
  getClipboardText: () => getClipboardText,
@@ -170,6 +171,11 @@ async function openCamera(options) {
170
171
  return photo;
171
172
  }
172
173
 
174
+ // src/native-modules/appLogin.ts
175
+ async function appLogin() {
176
+ return AppsInTossModule.appLogin({});
177
+ }
178
+
173
179
  // src/components/WebView.tsx
174
180
  import {
175
181
  WebView as OriginalWebView
@@ -256,6 +262,7 @@ var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
256
262
  export {
257
263
  Accuracy2 as Accuracy,
258
264
  WebView,
265
+ appLogin,
259
266
  env,
260
267
  fetchAlbumPhotos,
261
268
  fetchContacts,