@apps-in-toss/framework 0.0.11 → 0.0.13

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
@@ -199,14 +199,6 @@ async function fetchAlbumPhotos(options) {
199
199
  maxCount: options.maxCount ?? DEFAULT_MAX_COUNT,
200
200
  maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH
201
201
  });
202
- if (options.base64) {
203
- return albumPhotos.map((photo) => {
204
- return {
205
- ...photo,
206
- dataUri: `data:image/jpeg;base64,${photo.dataUri}`
207
- };
208
- });
209
- }
210
202
  return albumPhotos;
211
203
  }
212
204
 
@@ -265,6 +257,11 @@ __export(constant_bridges_exports, {
265
257
  getOperationalEnvironment: () => getOperationalEnvironment
266
258
  });
267
259
 
260
+ // src/env.ts
261
+ var env = {
262
+ getDeploymentId: () => __DEV__ ? "local" : global.__appsInToss?.deploymentId
263
+ };
264
+
268
265
  // src/event-bridges.ts
269
266
  var event_bridges_exports = {};
270
267
  __export(event_bridges_exports, {
@@ -278,7 +275,12 @@ function WebView({ local, onMessage, ...props }) {
278
275
  if (__DEV__) {
279
276
  return `http://${local.host}:${local.port}`;
280
277
  }
281
- return AppsInTossModule.getWebBundleURL({}).url;
278
+ const url = new URL(AppsInTossModule.getWebBundleURL({}).url);
279
+ const deploymentId = env.getDeploymentId();
280
+ if (deploymentId) {
281
+ url.searchParams.set("_deploymentId", deploymentId);
282
+ }
283
+ return url.toString();
282
284
  }, [local]);
283
285
  const handler = (0, import_react_native_bedrock4.useBridgeHandler)({
284
286
  onMessage,
@@ -302,9 +304,13 @@ function WebView({ local, onMessage, ...props }) {
302
304
  {
303
305
  ref: handler.ref,
304
306
  ...props,
305
- source: { uri },
307
+ source: {
308
+ uri
309
+ },
306
310
  sharedCookiesEnabled: true,
307
311
  thirdPartyCookiesEnabled: true,
312
+ cacheEnabled: false,
313
+ cacheMode: "LOAD_NO_CACHE",
308
314
  onMessage: handler.onMessage,
309
315
  injectedJavaScript: handler.injectedJavaScript,
310
316
  injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript
@@ -335,11 +341,6 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
335
341
  return location;
336
342
  }
337
343
 
338
- // src/env.ts
339
- var env = {
340
- getDeploymentId: () => __DEV__ ? "local" : global.__appsInToss?.deploymentId
341
- };
342
-
343
344
  // src/types.ts
344
345
  var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
345
346
  Accuracy3[Accuracy3["Lowest"] = 1] = "Lowest";
package/dist/index.d.cts CHANGED
@@ -300,17 +300,36 @@ interface ContactEntity {
300
300
  * - `nextOffset`: 다음 호출에 사용할 오프셋 값이에요. 더 가져올 연락처가 없으면 `null`이에요.
301
301
  * - `done`: 모든 연락처를 다 가져왔는지 여부를 나타내요. 모두 가져왔다면 `true`예요.
302
302
  *
303
+ * @signature
304
+ * ```typescript
305
+ * function fetchContacts({ size, offset, query }: {
306
+ * size: number;
307
+ * offset: number;
308
+ * query?: {
309
+ * contains?: string;
310
+ * };
311
+ * }): Promise<{
312
+ * result: ContactEntity[];
313
+ * nextOffset: number | null;
314
+ * done: boolean;
315
+ * }>;
316
+ * ```
317
+ *
303
318
  * @example
304
319
  * ### 특정 문자열이 포함된 연락처 목록 가져오기
305
320
  *
306
321
  * ```tsx
307
322
  * import React, { useState } from 'react';
308
323
  * import { View, Text, Button } from 'react-native';
309
- * import { fetchContacts } from '@apps-in-toss/framework';
324
+ * import { fetchContacts, ContactEntity } from '@apps-in-toss/framework';
310
325
  *
311
326
  * // 특정 문자열을 포함한 연락처 목록을 가져와 화면에 표시하는 컴포넌트
312
327
  * function ContactsList() {
313
- * const [contacts, setContacts] = useState({
328
+ * const [contacts, setContacts] = useState<{
329
+ * result: ContactEntity[];
330
+ * nextOffset: number | null;
331
+ * done: boolean;
332
+ * }>({
314
333
  * result: [],
315
334
  * nextOffset: null,
316
335
  * done: false,
@@ -326,7 +345,7 @@ interface ContactEntity {
326
345
  * const response = await fetchContacts({
327
346
  * size: 10,
328
347
  * offset: contacts.nextOffset ?? 0,
329
- * query: { contains: '홍길동' },
348
+ * query: { contains: '' },
330
349
  * });
331
350
  * setContacts((prev) => ({
332
351
  * result: [...prev.result, ...response.result],
@@ -399,6 +418,8 @@ interface FetchAlbumPhotosOptions {
399
418
  * import { View, Image, Button } from 'react-native';
400
419
  * import { fetchAlbumPhotos } from '@apps-in-toss/framework';
401
420
  *
421
+ * const base64 = true;
422
+ *
402
423
  * // 앨범 사진 목록을 가져와 화면에 표시하는 컴포넌트
403
424
  * function AlbumPhotoList() {
404
425
  * const [albumPhotos, setAlbumPhotos] = useState([]);
@@ -406,7 +427,7 @@ interface FetchAlbumPhotosOptions {
406
427
  * const handlePress = async () => {
407
428
  * try {
408
429
  * const response = await fetchAlbumPhotos({
409
- * base64: true,
430
+ * base64,
410
431
  * maxWidth: 360,
411
432
  * });
412
433
  * setAlbumPhotos((prev) => ([...prev, ...response]));
@@ -417,9 +438,12 @@ interface FetchAlbumPhotosOptions {
417
438
  *
418
439
  * return (
419
440
  * <View>
420
- * {albumPhotos.map((image) => (
421
- * <Image source={{ uri: image.dataUri }} key={image.id} />
422
- * ))}
441
+ * {albumPhotos.map((image) => {
442
+ * // base64 형식으로 반환된 이미지를 표시하려면 데이터 URL 스키마 Prefix를 붙여야해요.
443
+ * const imageUri = base64 ? 'data:image/jpeg;base64,' + image.dataUri : image.dataUri;
444
+ *
445
+ * return <Image source={{ uri: imageUri }} key={image.id} />;
446
+ * })}
423
447
  * <Button title="앨범 가져오기" onPress={handlePress} />
424
448
  * </View>
425
449
  * );
@@ -517,23 +541,28 @@ interface OpenCameraOptions {
517
541
  * import { View, Text, Button, Image } from 'react-native';
518
542
  * import { openCamera } from '@apps-in-toss/framework';
519
543
  *
544
+ * const base64 = true;
545
+ *
520
546
  * // 카메라를 실행하고 촬영된 이미지를 화면에 표시하는 컴포넌트
521
547
  * function Camera() {
522
548
  * const [image, setImage] = useState(null);
523
549
  *
524
550
  * const handlePress = async () => {
525
551
  * try {
526
- * const response = await openCamera({ base64: false });
552
+ * const response = await openCamera({ base64 });
527
553
  * setImage(response);
528
554
  * } catch (error) {
529
555
  * console.error('사진을 가져오는 데 실패했어요:', error);
530
556
  * }
531
557
  * };
532
558
  *
559
+ * // base64 형식으로 반환된 이미지를 표시하려면 데이터 URL 스키마 Prefix를 붙여야해요.
560
+ * const imageUri = base64 ? 'data:image/jpeg;base64,' + image.dataUri : image.dataUri;
561
+ *
533
562
  * return (
534
563
  * <View>
535
564
  * {image ? (
536
- * <Image source={{ uri: image.dataUri }} style={{ width: 200, height: 200 }} />
565
+ * <Image source={{ uri: imageUri }} style={{ width: 200, height: 200 }} />
537
566
  * ) : (
538
567
  * <Text>사진이 없어요</Text>
539
568
  * )}
@@ -608,7 +637,7 @@ declare function appLogin(): Promise<{
608
637
  */
609
638
  declare function getOperationalEnvironment(): 'toss' | 'sandbox';
610
639
 
611
- interface WebViewProps extends Omit<WebViewProps$1, 'source' | 'sharedCookiesEnabled' | 'thirdPartyCookiesEnabled' | 'injectedJavaScriptBeforeContentLoaded'> {
640
+ interface WebViewProps extends Omit<WebViewProps$1, 'cacheEnabled' | 'source' | 'sharedCookiesEnabled' | 'thirdPartyCookiesEnabled' | 'injectedJavaScriptBeforeContentLoaded'> {
612
641
  local: {
613
642
  port: number;
614
643
  host: number;
package/dist/index.d.ts CHANGED
@@ -300,17 +300,36 @@ interface ContactEntity {
300
300
  * - `nextOffset`: 다음 호출에 사용할 오프셋 값이에요. 더 가져올 연락처가 없으면 `null`이에요.
301
301
  * - `done`: 모든 연락처를 다 가져왔는지 여부를 나타내요. 모두 가져왔다면 `true`예요.
302
302
  *
303
+ * @signature
304
+ * ```typescript
305
+ * function fetchContacts({ size, offset, query }: {
306
+ * size: number;
307
+ * offset: number;
308
+ * query?: {
309
+ * contains?: string;
310
+ * };
311
+ * }): Promise<{
312
+ * result: ContactEntity[];
313
+ * nextOffset: number | null;
314
+ * done: boolean;
315
+ * }>;
316
+ * ```
317
+ *
303
318
  * @example
304
319
  * ### 특정 문자열이 포함된 연락처 목록 가져오기
305
320
  *
306
321
  * ```tsx
307
322
  * import React, { useState } from 'react';
308
323
  * import { View, Text, Button } from 'react-native';
309
- * import { fetchContacts } from '@apps-in-toss/framework';
324
+ * import { fetchContacts, ContactEntity } from '@apps-in-toss/framework';
310
325
  *
311
326
  * // 특정 문자열을 포함한 연락처 목록을 가져와 화면에 표시하는 컴포넌트
312
327
  * function ContactsList() {
313
- * const [contacts, setContacts] = useState({
328
+ * const [contacts, setContacts] = useState<{
329
+ * result: ContactEntity[];
330
+ * nextOffset: number | null;
331
+ * done: boolean;
332
+ * }>({
314
333
  * result: [],
315
334
  * nextOffset: null,
316
335
  * done: false,
@@ -326,7 +345,7 @@ interface ContactEntity {
326
345
  * const response = await fetchContacts({
327
346
  * size: 10,
328
347
  * offset: contacts.nextOffset ?? 0,
329
- * query: { contains: '홍길동' },
348
+ * query: { contains: '' },
330
349
  * });
331
350
  * setContacts((prev) => ({
332
351
  * result: [...prev.result, ...response.result],
@@ -399,6 +418,8 @@ interface FetchAlbumPhotosOptions {
399
418
  * import { View, Image, Button } from 'react-native';
400
419
  * import { fetchAlbumPhotos } from '@apps-in-toss/framework';
401
420
  *
421
+ * const base64 = true;
422
+ *
402
423
  * // 앨범 사진 목록을 가져와 화면에 표시하는 컴포넌트
403
424
  * function AlbumPhotoList() {
404
425
  * const [albumPhotos, setAlbumPhotos] = useState([]);
@@ -406,7 +427,7 @@ interface FetchAlbumPhotosOptions {
406
427
  * const handlePress = async () => {
407
428
  * try {
408
429
  * const response = await fetchAlbumPhotos({
409
- * base64: true,
430
+ * base64,
410
431
  * maxWidth: 360,
411
432
  * });
412
433
  * setAlbumPhotos((prev) => ([...prev, ...response]));
@@ -417,9 +438,12 @@ interface FetchAlbumPhotosOptions {
417
438
  *
418
439
  * return (
419
440
  * <View>
420
- * {albumPhotos.map((image) => (
421
- * <Image source={{ uri: image.dataUri }} key={image.id} />
422
- * ))}
441
+ * {albumPhotos.map((image) => {
442
+ * // base64 형식으로 반환된 이미지를 표시하려면 데이터 URL 스키마 Prefix를 붙여야해요.
443
+ * const imageUri = base64 ? 'data:image/jpeg;base64,' + image.dataUri : image.dataUri;
444
+ *
445
+ * return <Image source={{ uri: imageUri }} key={image.id} />;
446
+ * })}
423
447
  * <Button title="앨범 가져오기" onPress={handlePress} />
424
448
  * </View>
425
449
  * );
@@ -517,23 +541,28 @@ interface OpenCameraOptions {
517
541
  * import { View, Text, Button, Image } from 'react-native';
518
542
  * import { openCamera } from '@apps-in-toss/framework';
519
543
  *
544
+ * const base64 = true;
545
+ *
520
546
  * // 카메라를 실행하고 촬영된 이미지를 화면에 표시하는 컴포넌트
521
547
  * function Camera() {
522
548
  * const [image, setImage] = useState(null);
523
549
  *
524
550
  * const handlePress = async () => {
525
551
  * try {
526
- * const response = await openCamera({ base64: false });
552
+ * const response = await openCamera({ base64 });
527
553
  * setImage(response);
528
554
  * } catch (error) {
529
555
  * console.error('사진을 가져오는 데 실패했어요:', error);
530
556
  * }
531
557
  * };
532
558
  *
559
+ * // base64 형식으로 반환된 이미지를 표시하려면 데이터 URL 스키마 Prefix를 붙여야해요.
560
+ * const imageUri = base64 ? 'data:image/jpeg;base64,' + image.dataUri : image.dataUri;
561
+ *
533
562
  * return (
534
563
  * <View>
535
564
  * {image ? (
536
- * <Image source={{ uri: image.dataUri }} style={{ width: 200, height: 200 }} />
565
+ * <Image source={{ uri: imageUri }} style={{ width: 200, height: 200 }} />
537
566
  * ) : (
538
567
  * <Text>사진이 없어요</Text>
539
568
  * )}
@@ -608,7 +637,7 @@ declare function appLogin(): Promise<{
608
637
  */
609
638
  declare function getOperationalEnvironment(): 'toss' | 'sandbox';
610
639
 
611
- interface WebViewProps extends Omit<WebViewProps$1, 'source' | 'sharedCookiesEnabled' | 'thirdPartyCookiesEnabled' | 'injectedJavaScriptBeforeContentLoaded'> {
640
+ interface WebViewProps extends Omit<WebViewProps$1, 'cacheEnabled' | 'source' | 'sharedCookiesEnabled' | 'thirdPartyCookiesEnabled' | 'injectedJavaScriptBeforeContentLoaded'> {
612
641
  local: {
613
642
  port: number;
614
643
  host: number;
package/dist/index.js CHANGED
@@ -156,14 +156,6 @@ async function fetchAlbumPhotos(options) {
156
156
  maxCount: options.maxCount ?? DEFAULT_MAX_COUNT,
157
157
  maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH
158
158
  });
159
- if (options.base64) {
160
- return albumPhotos.map((photo) => {
161
- return {
162
- ...photo,
163
- dataUri: `data:image/jpeg;base64,${photo.dataUri}`
164
- };
165
- });
166
- }
167
159
  return albumPhotos;
168
160
  }
169
161
 
@@ -224,6 +216,11 @@ __export(constant_bridges_exports, {
224
216
  getOperationalEnvironment: () => getOperationalEnvironment
225
217
  });
226
218
 
219
+ // src/env.ts
220
+ var env = {
221
+ getDeploymentId: () => __DEV__ ? "local" : global.__appsInToss?.deploymentId
222
+ };
223
+
227
224
  // src/event-bridges.ts
228
225
  var event_bridges_exports = {};
229
226
  __export(event_bridges_exports, {
@@ -237,7 +234,12 @@ function WebView({ local, onMessage, ...props }) {
237
234
  if (__DEV__) {
238
235
  return `http://${local.host}:${local.port}`;
239
236
  }
240
- return AppsInTossModule.getWebBundleURL({}).url;
237
+ const url = new URL(AppsInTossModule.getWebBundleURL({}).url);
238
+ const deploymentId = env.getDeploymentId();
239
+ if (deploymentId) {
240
+ url.searchParams.set("_deploymentId", deploymentId);
241
+ }
242
+ return url.toString();
241
243
  }, [local]);
242
244
  const handler = useBridgeHandler({
243
245
  onMessage,
@@ -261,9 +263,13 @@ function WebView({ local, onMessage, ...props }) {
261
263
  {
262
264
  ref: handler.ref,
263
265
  ...props,
264
- source: { uri },
266
+ source: {
267
+ uri
268
+ },
265
269
  sharedCookiesEnabled: true,
266
270
  thirdPartyCookiesEnabled: true,
271
+ cacheEnabled: false,
272
+ cacheMode: "LOAD_NO_CACHE",
267
273
  onMessage: handler.onMessage,
268
274
  injectedJavaScript: handler.injectedJavaScript,
269
275
  injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript
@@ -294,11 +300,6 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
294
300
  return location;
295
301
  }
296
302
 
297
- // src/env.ts
298
- var env = {
299
- getDeploymentId: () => __DEV__ ? "local" : global.__appsInToss?.deploymentId
300
- };
301
-
302
303
  // src/types.ts
303
304
  var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
304
305
  Accuracy3[Accuracy3["Lowest"] = 1] = "Lowest";
@@ -32790,14 +32790,13 @@ init_cjs_shims();
32790
32790
  var __typia_transform__isFormatUuid = __toESM(require_isFormatUuid(), 1);
32791
32791
  var __typia_transform__validateReport = __toESM(require_validateReport(), 1);
32792
32792
  var validateAppManifest = /* @__PURE__ */ (() => {
32793
- const _io0 = (input) => "string" === typeof input.appName && (Array.isArray(input.permissions) && input.permissions.every((elem) => "object" === typeof elem && null !== elem && _iu0(elem))) && ("object" === typeof input.oauth && null !== input.oauth && _io6(input.oauth)) && ("object" === typeof input._metadata && null !== input._metadata && _io7(input._metadata));
32793
+ const _io0 = (input) => "string" === typeof input.appName && (Array.isArray(input.permissions) && input.permissions.every((elem) => "object" === typeof elem && null !== elem && _iu0(elem))) && ("object" === typeof input._metadata && null !== input._metadata && _io6(input._metadata));
32794
32794
  const _io1 = (input) => "clipboard" === input.name && ("read" === input.access || "write" === input.access);
32795
32795
  const _io2 = (input) => "geolocation" === input.name && "access" === input.access;
32796
32796
  const _io3 = (input) => "contacts" === input.name && ("read" === input.access || "write" === input.access);
32797
32797
  const _io4 = (input) => "photos" === input.name && ("read" === input.access || "write" === input.access);
32798
32798
  const _io5 = (input) => "camera" === input.name && "access" === input.access;
32799
- const _io6 = (input) => Array.isArray(input.scopes) && input.scopes.every((elem) => "user_name" === elem || "user_phone" === elem || "user_birthday" === elem || "user_ci" === elem || "user_gender" === elem || "user_nationality" === elem || "user_email" === elem);
32800
- const _io7 = (input) => Array.isArray(input.bundleFiles) && input.bundleFiles.every((elem) => "string" === typeof elem) && ("string" === typeof input.deploymentId && __typia_transform__isFormatUuid._isFormatUuid(input.deploymentId));
32799
+ const _io6 = (input) => Array.isArray(input.bundleFiles) && input.bundleFiles.every((elem) => "string" === typeof elem) && ("string" === typeof input.deploymentId && __typia_transform__isFormatUuid._isFormatUuid(input.deploymentId));
32801
32800
  const _iu0 = (input) => (() => {
32802
32801
  if ("camera" === input.name)
32803
32802
  return _io5(input);
@@ -32820,33 +32819,25 @@ var validateAppManifest = /* @__PURE__ */ (() => {
32820
32819
  path: _path + ".permissions",
32821
32820
  expected: "Array<Permission>",
32822
32821
  value: input.permissions
32823
- })) && input.permissions.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
32824
- path: _path + ".permissions[" + _index4 + "]",
32822
+ })) && input.permissions.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
32823
+ path: _path + ".permissions[" + _index3 + "]",
32825
32824
  expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
32826
32825
  value: elem
32827
- })) && _vu0(elem, _path + ".permissions[" + _index4 + "]", _exceptionable) || _report(_exceptionable, {
32828
- path: _path + ".permissions[" + _index4 + "]",
32826
+ })) && _vu0(elem, _path + ".permissions[" + _index3 + "]", _exceptionable) || _report(_exceptionable, {
32827
+ path: _path + ".permissions[" + _index3 + "]",
32829
32828
  expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
32830
32829
  value: elem
32831
32830
  })).every((flag) => flag) || _report(_exceptionable, {
32832
32831
  path: _path + ".permissions",
32833
32832
  expected: "Array<Permission>",
32834
32833
  value: input.permissions
32835
- }), ("object" === typeof input.oauth && null !== input.oauth || _report(_exceptionable, {
32836
- path: _path + ".oauth",
32837
- expected: "__type",
32838
- value: input.oauth
32839
- })) && _vo6(input.oauth, _path + ".oauth", _exceptionable) || _report(_exceptionable, {
32840
- path: _path + ".oauth",
32841
- expected: "__type",
32842
- value: input.oauth
32843
32834
  }), ("object" === typeof input._metadata && null !== input._metadata || _report(_exceptionable, {
32844
32835
  path: _path + "._metadata",
32845
- expected: "__type.o1",
32836
+ expected: "__type",
32846
32837
  value: input._metadata
32847
- })) && _vo7(input._metadata, _path + "._metadata", _exceptionable) || _report(_exceptionable, {
32838
+ })) && _vo6(input._metadata, _path + "._metadata", _exceptionable) || _report(_exceptionable, {
32848
32839
  path: _path + "._metadata",
32849
- expected: "__type.o1",
32840
+ expected: "__type",
32850
32841
  value: input._metadata
32851
32842
  })].every((flag) => flag);
32852
32843
  const _vo1 = (input, _path, _exceptionable = true) => ["clipboard" === input.name || _report(_exceptionable, {
@@ -32894,25 +32885,12 @@ var validateAppManifest = /* @__PURE__ */ (() => {
32894
32885
  expected: '"access"',
32895
32886
  value: input.access
32896
32887
  })].every((flag) => flag);
32897
- const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.scopes) || _report(_exceptionable, {
32898
- path: _path + ".scopes",
32899
- expected: "Array<OAuthScope>",
32900
- value: input.scopes
32901
- })) && input.scopes.map((elem, _index5) => "user_name" === elem || "user_phone" === elem || "user_birthday" === elem || "user_ci" === elem || "user_gender" === elem || "user_nationality" === elem || "user_email" === elem || _report(_exceptionable, {
32902
- path: _path + ".scopes[" + _index5 + "]",
32903
- expected: '("user_birthday" | "user_ci" | "user_email" | "user_gender" | "user_name" | "user_nationality" | "user_phone")',
32904
- value: elem
32905
- })).every((flag) => flag) || _report(_exceptionable, {
32906
- path: _path + ".scopes",
32907
- expected: "Array<OAuthScope>",
32908
- value: input.scopes
32909
- })].every((flag) => flag);
32910
- const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.bundleFiles) || _report(_exceptionable, {
32888
+ const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.bundleFiles) || _report(_exceptionable, {
32911
32889
  path: _path + ".bundleFiles",
32912
32890
  expected: "Array<string>",
32913
32891
  value: input.bundleFiles
32914
- })) && input.bundleFiles.map((elem, _index6) => "string" === typeof elem || _report(_exceptionable, {
32915
- path: _path + ".bundleFiles[" + _index6 + "]",
32892
+ })) && input.bundleFiles.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
32893
+ path: _path + ".bundleFiles[" + _index4 + "]",
32916
32894
  expected: "string",
32917
32895
  value: elem
32918
32896
  })).every((flag) => flag) || _report(_exceptionable, {
@@ -33008,22 +32986,6 @@ async function createArtifact(options, deps) {
33008
32986
  return outfile;
33009
32987
  }
33010
32988
 
33011
- // src/plugins/utils/createServerOAuthMiddleware.ts
33012
- init_cjs_shims();
33013
- function createServerOAuthMiddleware(oauth) {
33014
- const scope = oauth.scopes.sort().join(";");
33015
- return (req, res, next) => {
33016
- if (req.method === "GET" && req.url === "/oauth/scope") {
33017
- res.writeHead(200, {
33018
- "Content-Length": Buffer.byteLength(scope),
33019
- "Content-Type": "text/plain"
33020
- }).end(scope);
33021
- return;
33022
- }
33023
- next();
33024
- };
33025
- }
33026
-
33027
32989
  // src/plugins/utils/createServerPermissionsMiddleware.ts
33028
32990
  init_cjs_shims();
33029
32991
  function createServerPermissionsMiddleware(permissions) {
@@ -33470,10 +33432,7 @@ function appsInTossDevServer(options) {
33470
33432
  config: {
33471
33433
  mpack: {
33472
33434
  devServer: {
33473
- middlewares: [
33474
- createServerPermissionsMiddleware(options.permissions),
33475
- createServerOAuthMiddleware(options.oauth)
33476
- ],
33435
+ middlewares: [createServerPermissionsMiddleware(options.permissions)],
33477
33436
  routegen: {
33478
33437
  enabled: false
33479
33438
  }
@@ -33488,8 +33447,7 @@ async function appsInTossAppJson(options) {
33488
33447
  const appJsonPath = import_path4.default.join(packageRoot, ".bedrock", APP_MANIFEST_NAME);
33489
33448
  const appJsonObject = {
33490
33449
  appName,
33491
- permissions: options.permissions,
33492
- oauth: options.oauth
33450
+ permissions: options.permissions
33493
33451
  };
33494
33452
  await import_fs3.default.promises.mkdir(import_path4.default.dirname(appJsonPath), { recursive: true });
33495
33453
  try {
@@ -33497,8 +33455,7 @@ async function appsInTossAppJson(options) {
33497
33455
  const existingAppJsonObject = JSON.parse(existingAppJson);
33498
33456
  Object.assign(appJsonObject, existingAppJsonObject, {
33499
33457
  appName,
33500
- permissions: appJsonObject.permissions,
33501
- oauth: appJsonObject.oauth
33458
+ permissions: appJsonObject.permissions
33502
33459
  });
33503
33460
  } catch (error) {
33504
33461
  }
@@ -24,24 +24,9 @@ type CameraPermission = {
24
24
  access: PermissionAccess;
25
25
  };
26
26
  type Permission = ClipboardPermission | GeolocationPermission | ContactsPermission | PhotosPermission | CameraPermission;
27
- /**
28
- * OAuth 인증시 사용할 수 있는 Scope 값이에요.
29
- *
30
- * - `user_name`: 유저 이름이에요.
31
- * - `user_phone`: 유저 휴대폰 번호예요.
32
- * - `user_birthday`: 유저 생년월일이에요.
33
- * - `user_ci`: 유저를 식별하는 키인 CI(Connection Information) 값이에요.
34
- * - `user_gender`: 유저의 성별이에요.
35
- * - `user_nationality`: 유저의 국적이에요.
36
- * - `user_email`: 유저의 이메일이에요. 토스 회원의 email이 존재하지 않는 경우 null 응답을 반환해요.
37
- */
38
- type OAuthScope = 'user_name' | 'user_phone' | 'user_birthday' | 'user_ci' | 'user_gender' | 'user_nationality' | 'user_email';
39
27
  type AppManifest = {
40
28
  appName: string;
41
29
  permissions: Permission[];
42
- oauth: {
43
- scopes: OAuthScope[];
44
- };
45
30
  _metadata: {
46
31
  bundleFiles: string[];
47
32
  deploymentId: string & tags.Format<'uuid'>;
@@ -51,7 +36,6 @@ declare const validateAppManifest: (input: unknown) => typia.IValidation<AppMani
51
36
 
52
37
  interface AppsInTossPluginOptions {
53
38
  permissions: AppManifest['permissions'];
54
- oauth: AppManifest['oauth'];
55
39
  }
56
40
  declare function appsInTossAppJson(options: AppsInTossPluginOptions): Promise<BedrockPluginCore>;
57
41
  declare function appsInToss(options: AppsInTossPluginOptions): (BedrockPluginCore | Promise<BedrockPluginCore>)[];
@@ -89,4 +73,4 @@ interface CreateArtifactOptions {
89
73
  declare function validateZip(zipPath: string): Promise<void>;
90
74
  declare function createArtifact(options: CreateArtifactOptions, deps: CreateCompressedBytecodeDependencies): Promise<string>;
91
75
 
92
- export { type AppManifest, type AppsInTossPluginOptions, type BuildResult, type CreateArtifactOptions, type OAuthScope, type Permission, appsInToss, appsInTossAppJson, createArtifact, validateAppManifest, validateZip };
76
+ export { type AppManifest, type AppsInTossPluginOptions, type BuildResult, type CreateArtifactOptions, type Permission, appsInToss, appsInTossAppJson, createArtifact, validateAppManifest, validateZip };
@@ -24,24 +24,9 @@ type CameraPermission = {
24
24
  access: PermissionAccess;
25
25
  };
26
26
  type Permission = ClipboardPermission | GeolocationPermission | ContactsPermission | PhotosPermission | CameraPermission;
27
- /**
28
- * OAuth 인증시 사용할 수 있는 Scope 값이에요.
29
- *
30
- * - `user_name`: 유저 이름이에요.
31
- * - `user_phone`: 유저 휴대폰 번호예요.
32
- * - `user_birthday`: 유저 생년월일이에요.
33
- * - `user_ci`: 유저를 식별하는 키인 CI(Connection Information) 값이에요.
34
- * - `user_gender`: 유저의 성별이에요.
35
- * - `user_nationality`: 유저의 국적이에요.
36
- * - `user_email`: 유저의 이메일이에요. 토스 회원의 email이 존재하지 않는 경우 null 응답을 반환해요.
37
- */
38
- type OAuthScope = 'user_name' | 'user_phone' | 'user_birthday' | 'user_ci' | 'user_gender' | 'user_nationality' | 'user_email';
39
27
  type AppManifest = {
40
28
  appName: string;
41
29
  permissions: Permission[];
42
- oauth: {
43
- scopes: OAuthScope[];
44
- };
45
30
  _metadata: {
46
31
  bundleFiles: string[];
47
32
  deploymentId: string & tags.Format<'uuid'>;
@@ -51,7 +36,6 @@ declare const validateAppManifest: (input: unknown) => typia.IValidation<AppMani
51
36
 
52
37
  interface AppsInTossPluginOptions {
53
38
  permissions: AppManifest['permissions'];
54
- oauth: AppManifest['oauth'];
55
39
  }
56
40
  declare function appsInTossAppJson(options: AppsInTossPluginOptions): Promise<BedrockPluginCore>;
57
41
  declare function appsInToss(options: AppsInTossPluginOptions): (BedrockPluginCore | Promise<BedrockPluginCore>)[];
@@ -89,4 +73,4 @@ interface CreateArtifactOptions {
89
73
  declare function validateZip(zipPath: string): Promise<void>;
90
74
  declare function createArtifact(options: CreateArtifactOptions, deps: CreateCompressedBytecodeDependencies): Promise<string>;
91
75
 
92
- export { type AppManifest, type AppsInTossPluginOptions, type BuildResult, type CreateArtifactOptions, type OAuthScope, type Permission, appsInToss, appsInTossAppJson, createArtifact, validateAppManifest, validateZip };
76
+ export { type AppManifest, type AppsInTossPluginOptions, type BuildResult, type CreateArtifactOptions, type Permission, appsInToss, appsInTossAppJson, createArtifact, validateAppManifest, validateZip };
@@ -32791,14 +32791,13 @@ init_esm_shims();
32791
32791
  var __typia_transform__isFormatUuid = __toESM(require_isFormatUuid(), 1);
32792
32792
  var __typia_transform__validateReport = __toESM(require_validateReport(), 1);
32793
32793
  var validateAppManifest = /* @__PURE__ */ (() => {
32794
- const _io0 = (input) => "string" === typeof input.appName && (Array.isArray(input.permissions) && input.permissions.every((elem) => "object" === typeof elem && null !== elem && _iu0(elem))) && ("object" === typeof input.oauth && null !== input.oauth && _io6(input.oauth)) && ("object" === typeof input._metadata && null !== input._metadata && _io7(input._metadata));
32794
+ const _io0 = (input) => "string" === typeof input.appName && (Array.isArray(input.permissions) && input.permissions.every((elem) => "object" === typeof elem && null !== elem && _iu0(elem))) && ("object" === typeof input._metadata && null !== input._metadata && _io6(input._metadata));
32795
32795
  const _io1 = (input) => "clipboard" === input.name && ("read" === input.access || "write" === input.access);
32796
32796
  const _io2 = (input) => "geolocation" === input.name && "access" === input.access;
32797
32797
  const _io3 = (input) => "contacts" === input.name && ("read" === input.access || "write" === input.access);
32798
32798
  const _io4 = (input) => "photos" === input.name && ("read" === input.access || "write" === input.access);
32799
32799
  const _io5 = (input) => "camera" === input.name && "access" === input.access;
32800
- const _io6 = (input) => Array.isArray(input.scopes) && input.scopes.every((elem) => "user_name" === elem || "user_phone" === elem || "user_birthday" === elem || "user_ci" === elem || "user_gender" === elem || "user_nationality" === elem || "user_email" === elem);
32801
- const _io7 = (input) => Array.isArray(input.bundleFiles) && input.bundleFiles.every((elem) => "string" === typeof elem) && ("string" === typeof input.deploymentId && __typia_transform__isFormatUuid._isFormatUuid(input.deploymentId));
32800
+ const _io6 = (input) => Array.isArray(input.bundleFiles) && input.bundleFiles.every((elem) => "string" === typeof elem) && ("string" === typeof input.deploymentId && __typia_transform__isFormatUuid._isFormatUuid(input.deploymentId));
32802
32801
  const _iu0 = (input) => (() => {
32803
32802
  if ("camera" === input.name)
32804
32803
  return _io5(input);
@@ -32821,33 +32820,25 @@ var validateAppManifest = /* @__PURE__ */ (() => {
32821
32820
  path: _path + ".permissions",
32822
32821
  expected: "Array<Permission>",
32823
32822
  value: input.permissions
32824
- })) && input.permissions.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
32825
- path: _path + ".permissions[" + _index4 + "]",
32823
+ })) && input.permissions.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
32824
+ path: _path + ".permissions[" + _index3 + "]",
32826
32825
  expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
32827
32826
  value: elem
32828
- })) && _vu0(elem, _path + ".permissions[" + _index4 + "]", _exceptionable) || _report(_exceptionable, {
32829
- path: _path + ".permissions[" + _index4 + "]",
32827
+ })) && _vu0(elem, _path + ".permissions[" + _index3 + "]", _exceptionable) || _report(_exceptionable, {
32828
+ path: _path + ".permissions[" + _index3 + "]",
32830
32829
  expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
32831
32830
  value: elem
32832
32831
  })).every((flag) => flag) || _report(_exceptionable, {
32833
32832
  path: _path + ".permissions",
32834
32833
  expected: "Array<Permission>",
32835
32834
  value: input.permissions
32836
- }), ("object" === typeof input.oauth && null !== input.oauth || _report(_exceptionable, {
32837
- path: _path + ".oauth",
32838
- expected: "__type",
32839
- value: input.oauth
32840
- })) && _vo6(input.oauth, _path + ".oauth", _exceptionable) || _report(_exceptionable, {
32841
- path: _path + ".oauth",
32842
- expected: "__type",
32843
- value: input.oauth
32844
32835
  }), ("object" === typeof input._metadata && null !== input._metadata || _report(_exceptionable, {
32845
32836
  path: _path + "._metadata",
32846
- expected: "__type.o1",
32837
+ expected: "__type",
32847
32838
  value: input._metadata
32848
- })) && _vo7(input._metadata, _path + "._metadata", _exceptionable) || _report(_exceptionable, {
32839
+ })) && _vo6(input._metadata, _path + "._metadata", _exceptionable) || _report(_exceptionable, {
32849
32840
  path: _path + "._metadata",
32850
- expected: "__type.o1",
32841
+ expected: "__type",
32851
32842
  value: input._metadata
32852
32843
  })].every((flag) => flag);
32853
32844
  const _vo1 = (input, _path, _exceptionable = true) => ["clipboard" === input.name || _report(_exceptionable, {
@@ -32895,25 +32886,12 @@ var validateAppManifest = /* @__PURE__ */ (() => {
32895
32886
  expected: '"access"',
32896
32887
  value: input.access
32897
32888
  })].every((flag) => flag);
32898
- const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.scopes) || _report(_exceptionable, {
32899
- path: _path + ".scopes",
32900
- expected: "Array<OAuthScope>",
32901
- value: input.scopes
32902
- })) && input.scopes.map((elem, _index5) => "user_name" === elem || "user_phone" === elem || "user_birthday" === elem || "user_ci" === elem || "user_gender" === elem || "user_nationality" === elem || "user_email" === elem || _report(_exceptionable, {
32903
- path: _path + ".scopes[" + _index5 + "]",
32904
- expected: '("user_birthday" | "user_ci" | "user_email" | "user_gender" | "user_name" | "user_nationality" | "user_phone")',
32905
- value: elem
32906
- })).every((flag) => flag) || _report(_exceptionable, {
32907
- path: _path + ".scopes",
32908
- expected: "Array<OAuthScope>",
32909
- value: input.scopes
32910
- })].every((flag) => flag);
32911
- const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.bundleFiles) || _report(_exceptionable, {
32889
+ const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.bundleFiles) || _report(_exceptionable, {
32912
32890
  path: _path + ".bundleFiles",
32913
32891
  expected: "Array<string>",
32914
32892
  value: input.bundleFiles
32915
- })) && input.bundleFiles.map((elem, _index6) => "string" === typeof elem || _report(_exceptionable, {
32916
- path: _path + ".bundleFiles[" + _index6 + "]",
32893
+ })) && input.bundleFiles.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
32894
+ path: _path + ".bundleFiles[" + _index4 + "]",
32917
32895
  expected: "string",
32918
32896
  value: elem
32919
32897
  })).every((flag) => flag) || _report(_exceptionable, {
@@ -33009,22 +32987,6 @@ async function createArtifact(options, deps) {
33009
32987
  return outfile;
33010
32988
  }
33011
32989
 
33012
- // src/plugins/utils/createServerOAuthMiddleware.ts
33013
- init_esm_shims();
33014
- function createServerOAuthMiddleware(oauth) {
33015
- const scope = oauth.scopes.sort().join(";");
33016
- return (req, res, next) => {
33017
- if (req.method === "GET" && req.url === "/oauth/scope") {
33018
- res.writeHead(200, {
33019
- "Content-Length": Buffer.byteLength(scope),
33020
- "Content-Type": "text/plain"
33021
- }).end(scope);
33022
- return;
33023
- }
33024
- next();
33025
- };
33026
- }
33027
-
33028
32990
  // src/plugins/utils/createServerPermissionsMiddleware.ts
33029
32991
  init_esm_shims();
33030
32992
  function createServerPermissionsMiddleware(permissions) {
@@ -33471,10 +33433,7 @@ function appsInTossDevServer(options) {
33471
33433
  config: {
33472
33434
  mpack: {
33473
33435
  devServer: {
33474
- middlewares: [
33475
- createServerPermissionsMiddleware(options.permissions),
33476
- createServerOAuthMiddleware(options.oauth)
33477
- ],
33436
+ middlewares: [createServerPermissionsMiddleware(options.permissions)],
33478
33437
  routegen: {
33479
33438
  enabled: false
33480
33439
  }
@@ -33489,8 +33448,7 @@ async function appsInTossAppJson(options) {
33489
33448
  const appJsonPath = path12.join(packageRoot, ".bedrock", APP_MANIFEST_NAME);
33490
33449
  const appJsonObject = {
33491
33450
  appName,
33492
- permissions: options.permissions,
33493
- oauth: options.oauth
33451
+ permissions: options.permissions
33494
33452
  };
33495
33453
  await fs5.promises.mkdir(path12.dirname(appJsonPath), { recursive: true });
33496
33454
  try {
@@ -33498,8 +33456,7 @@ async function appsInTossAppJson(options) {
33498
33456
  const existingAppJsonObject = JSON.parse(existingAppJson);
33499
33457
  Object.assign(appJsonObject, existingAppJsonObject, {
33500
33458
  appName,
33501
- permissions: appJsonObject.permissions,
33502
- oauth: appJsonObject.oauth
33459
+ permissions: appJsonObject.permissions
33503
33460
  });
33504
33461
  } catch (error) {
33505
33462
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/framework",
3
3
  "type": "module",
4
- "version": "0.0.11",
4
+ "version": "0.0.13",
5
5
  "description": "The framework for Apps In Toss",
6
6
  "scripts": {
7
7
  "prepack": "yarn build",
@@ -55,7 +55,7 @@
55
55
  "ait": "./bin/ait.js"
56
56
  },
57
57
  "dependencies": {
58
- "@apps-in-toss/cli": "0.0.11"
58
+ "@apps-in-toss/cli": "0.0.13"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@react-native-bedrock/mpack-next": "0.0.13",
@@ -90,5 +90,5 @@
90
90
  "publishConfig": {
91
91
  "access": "public"
92
92
  },
93
- "gitHead": "d0dfa84af3118a71ea3705c440e639fb5b1a010b"
93
+ "gitHead": "c5fa235b136ffaefc7687b35b473de5f6a1dca6f"
94
94
  }