@apps-in-toss/framework 0.0.7 → 0.0.9

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.
@@ -1,4 +1,5 @@
1
1
  import { BedrockPluginCore } from 'react-native-bedrock/config';
2
+ import typia, { tags } from 'typia';
2
3
 
3
4
  type PermissionReadWrite = 'read' | 'write';
4
5
  type PermissionAccess = 'access';
@@ -23,14 +24,69 @@ type CameraPermission = {
23
24
  access: PermissionAccess;
24
25
  };
25
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';
26
39
  type AppManifest = {
27
40
  appName: string;
28
41
  permissions: Permission[];
42
+ oauth: {
43
+ scopes: OAuthScope[];
44
+ };
45
+ _metadata: {
46
+ bundleFiles: string[];
47
+ deploymentId: string & tags.Format<'uuid'>;
48
+ };
29
49
  };
50
+ declare const validateAppManifest: (input: unknown) => typia.IValidation<AppManifest>;
30
51
 
31
52
  interface AppsInTossPluginOptions {
32
- permissions: Permission[];
53
+ permissions: AppManifest['permissions'];
54
+ oauth: AppManifest['oauth'];
33
55
  }
56
+ declare function appsInTossAppJson(options: AppsInTossPluginOptions): Promise<BedrockPluginCore>;
34
57
  declare function appsInToss(options: AppsInTossPluginOptions): (BedrockPluginCore | Promise<BedrockPluginCore>)[];
35
58
 
36
- export { type AppManifest, type AppsInTossPluginOptions, type Permission, appsInToss };
59
+ interface CompileHbcOptions {
60
+ outdir: string;
61
+ filePath: string;
62
+ }
63
+ type CompileHbcFunc = (options: CompileHbcOptions) => Promise<{
64
+ outfile: string;
65
+ }>;
66
+
67
+ interface CreateCompressedBytecodeDependencies {
68
+ compileHbcFn: CompileHbcFunc;
69
+ }
70
+
71
+ type BuildResult = {
72
+ jsFile: string;
73
+ platform: 'ios' | 'android';
74
+ };
75
+ interface CreateArtifactOptions {
76
+ inputJsFiles: {
77
+ path: string;
78
+ platform: 'ios' | 'android';
79
+ }[];
80
+ reactNativeVersion: `${string}_${string}_${string}`;
81
+ appJsonPath: string;
82
+ outfile: string;
83
+ deploymentId: string;
84
+ additionalFilesToZip?: {
85
+ path: string;
86
+ name: string;
87
+ }[];
88
+ }
89
+ declare function validateZip(zipPath: string): Promise<void>;
90
+ declare function createArtifact(options: CreateArtifactOptions, deps: CreateCompressedBytecodeDependencies): Promise<string>;
91
+
92
+ export { type AppManifest, type AppsInTossPluginOptions, type BuildResult, type CreateArtifactOptions, type OAuthScope, type Permission, appsInToss, appsInTossAppJson, createArtifact, validateAppManifest, validateZip };
@@ -1,4 +1,5 @@
1
1
  import { BedrockPluginCore } from 'react-native-bedrock/config';
2
+ import typia, { tags } from 'typia';
2
3
 
3
4
  type PermissionReadWrite = 'read' | 'write';
4
5
  type PermissionAccess = 'access';
@@ -23,14 +24,69 @@ type CameraPermission = {
23
24
  access: PermissionAccess;
24
25
  };
25
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';
26
39
  type AppManifest = {
27
40
  appName: string;
28
41
  permissions: Permission[];
42
+ oauth: {
43
+ scopes: OAuthScope[];
44
+ };
45
+ _metadata: {
46
+ bundleFiles: string[];
47
+ deploymentId: string & tags.Format<'uuid'>;
48
+ };
29
49
  };
50
+ declare const validateAppManifest: (input: unknown) => typia.IValidation<AppManifest>;
30
51
 
31
52
  interface AppsInTossPluginOptions {
32
- permissions: Permission[];
53
+ permissions: AppManifest['permissions'];
54
+ oauth: AppManifest['oauth'];
33
55
  }
56
+ declare function appsInTossAppJson(options: AppsInTossPluginOptions): Promise<BedrockPluginCore>;
34
57
  declare function appsInToss(options: AppsInTossPluginOptions): (BedrockPluginCore | Promise<BedrockPluginCore>)[];
35
58
 
36
- export { type AppManifest, type AppsInTossPluginOptions, type Permission, appsInToss };
59
+ interface CompileHbcOptions {
60
+ outdir: string;
61
+ filePath: string;
62
+ }
63
+ type CompileHbcFunc = (options: CompileHbcOptions) => Promise<{
64
+ outfile: string;
65
+ }>;
66
+
67
+ interface CreateCompressedBytecodeDependencies {
68
+ compileHbcFn: CompileHbcFunc;
69
+ }
70
+
71
+ type BuildResult = {
72
+ jsFile: string;
73
+ platform: 'ios' | 'android';
74
+ };
75
+ interface CreateArtifactOptions {
76
+ inputJsFiles: {
77
+ path: string;
78
+ platform: 'ios' | 'android';
79
+ }[];
80
+ reactNativeVersion: `${string}_${string}_${string}`;
81
+ appJsonPath: string;
82
+ outfile: string;
83
+ deploymentId: string;
84
+ additionalFilesToZip?: {
85
+ path: string;
86
+ name: string;
87
+ }[];
88
+ }
89
+ declare function validateZip(zipPath: string): Promise<void>;
90
+ declare function createArtifact(options: CreateArtifactOptions, deps: CreateCompressedBytecodeDependencies): Promise<string>;
91
+
92
+ export { type AppManifest, type AppsInTossPluginOptions, type BuildResult, type CreateArtifactOptions, type OAuthScope, type Permission, appsInToss, appsInTossAppJson, createArtifact, validateAppManifest, validateZip };