generator-kodly-react-app 1.0.6 → 1.0.10

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.
Files changed (101) hide show
  1. package/generators/app/index.js +63 -11
  2. package/generators/app/templates/.env.dev +4 -0
  3. package/generators/app/templates/.env.sandbox +4 -0
  4. package/generators/app/templates/STRUCTURE.md +661 -0
  5. package/generators/app/templates/components.json +22 -0
  6. package/generators/app/templates/index.html +14 -6
  7. package/generators/app/templates/openapi-ts.config.ts +29 -0
  8. package/generators/app/templates/package.json +46 -26
  9. package/generators/app/templates/public/favicon.svg +4 -0
  10. package/generators/app/templates/src/app.tsx +8 -8
  11. package/generators/app/templates/src/components/layout/language-switcher.tsx +40 -0
  12. package/generators/app/templates/src/components/layout/theme-switcher.tsx +37 -0
  13. package/generators/app/templates/src/components/theme/theme-provider.tsx +22 -28
  14. package/generators/app/templates/src/components/ui/button.tsx +34 -32
  15. package/generators/app/templates/src/components/ui/card.tsx +76 -0
  16. package/generators/app/templates/src/components/ui/field.tsx +242 -0
  17. package/generators/app/templates/src/components/ui/form.tsx +129 -0
  18. package/generators/app/templates/src/components/ui/input-group.tsx +170 -0
  19. package/generators/app/templates/src/components/ui/input.tsx +19 -21
  20. package/generators/app/templates/src/components/ui/label.tsx +24 -0
  21. package/generators/app/templates/src/components/ui/select.tsx +184 -0
  22. package/generators/app/templates/src/components/ui/separator.tsx +31 -0
  23. package/generators/app/templates/src/components/ui/textarea.tsx +22 -0
  24. package/generators/app/templates/src/index.css +83 -26
  25. package/generators/app/templates/src/lib/api/client.ts +4 -5
  26. package/generators/app/templates/src/lib/i18n.ts +31 -16
  27. package/generators/app/templates/src/lib/routes.ts +14 -0
  28. package/generators/app/templates/src/lib/utils/error-handler.ts +7 -2
  29. package/generators/app/templates/src/lib/utils/init-form-schema.ts +12 -0
  30. package/generators/app/templates/src/lib/utils.ts +3 -4
  31. package/generators/app/templates/src/locales/en/common.json +5 -0
  32. package/generators/app/templates/src/locales/en/theme.json +5 -0
  33. package/generators/app/templates/src/locales/index.ts +31 -0
  34. package/generators/app/templates/src/locales/ja/common.json +5 -0
  35. package/generators/app/templates/src/locales/ja/theme.json +6 -0
  36. package/generators/app/templates/src/main.tsx +19 -15
  37. package/generators/app/templates/src/modules/app/layouts/app-layout.tsx +37 -0
  38. package/generators/app/templates/src/modules/app/locales/app-en.json +9 -0
  39. package/generators/app/templates/src/modules/app/locales/app-ja.json +9 -0
  40. package/generators/app/templates/src/modules/auth/components/forgot-password-form.tsx +74 -0
  41. package/generators/app/templates/src/modules/auth/components/login-form.tsx +95 -0
  42. package/generators/app/templates/src/modules/auth/components/reset-password-form.tsx +112 -0
  43. package/generators/app/templates/src/modules/auth/components/signup-form.tsx +92 -0
  44. package/generators/app/templates/src/modules/auth/contexts/auth-context.tsx +11 -0
  45. package/generators/app/templates/src/modules/auth/hooks/use-auth-hook.ts +175 -0
  46. package/generators/app/templates/src/modules/auth/layouts/auth-layout.tsx +28 -0
  47. package/generators/app/templates/src/modules/auth/locales/auth-en.json +105 -0
  48. package/generators/app/templates/src/modules/auth/locales/auth-ja.json +105 -0
  49. package/generators/app/templates/src/modules/landing/components/auth-hero.tsx +34 -0
  50. package/generators/app/templates/src/modules/landing/components/welcome-hero.tsx +24 -0
  51. package/generators/app/templates/src/modules/landing/landing-page-layout.tsx +24 -0
  52. package/generators/app/templates/src/modules/landing/landing-page.tsx +17 -0
  53. package/generators/app/templates/src/modules/landing/layouts/landing-page-layout.tsx +24 -0
  54. package/generators/app/templates/src/modules/landing/locales/landing-en.json +12 -0
  55. package/generators/app/templates/src/modules/landing/locales/landing-ja.json +11 -0
  56. package/generators/app/templates/src/openapi-client-config.ts +6 -0
  57. package/generators/app/templates/src/routeTree.gen.ts +268 -3
  58. package/generators/app/templates/src/router.tsx +2 -2
  59. package/generators/app/templates/src/routes/__root.tsx +3 -3
  60. package/generators/app/templates/src/routes/_landing/index.tsx +10 -0
  61. package/generators/app/templates/src/routes/_landing/route.tsx +14 -0
  62. package/generators/app/templates/src/routes/app/index.tsx +4 -21
  63. package/generators/app/templates/src/routes/app/route.tsx +12 -8
  64. package/generators/app/templates/src/routes/auth/forgot-password.tsx +10 -0
  65. package/generators/app/templates/src/routes/auth/login.tsx +6 -7
  66. package/generators/app/templates/src/routes/auth/reset-password.tsx +15 -0
  67. package/generators/app/templates/src/routes/auth/route.tsx +23 -6
  68. package/generators/app/templates/src/routes/auth/signup.tsx +11 -0
  69. package/generators/app/templates/src/sdk/@tanstack/react-query.gen.ts +91 -0
  70. package/generators/app/templates/src/sdk/client/client.gen.ts +167 -0
  71. package/generators/app/templates/src/sdk/client/index.ts +23 -0
  72. package/generators/app/templates/src/sdk/client/types.gen.ts +197 -0
  73. package/generators/app/templates/src/sdk/client/utils.gen.ts +213 -0
  74. package/generators/app/templates/src/sdk/client.gen.ts +18 -0
  75. package/generators/app/templates/src/sdk/core/auth.gen.ts +42 -0
  76. package/generators/app/templates/src/sdk/core/bodySerializer.gen.ts +100 -0
  77. package/generators/app/templates/src/sdk/core/params.gen.ts +176 -0
  78. package/generators/app/templates/src/sdk/core/pathSerializer.gen.ts +181 -0
  79. package/generators/app/templates/src/sdk/core/queryKeySerializer.gen.ts +136 -0
  80. package/generators/app/templates/src/sdk/core/serverSentEvents.gen.ts +266 -0
  81. package/generators/app/templates/src/sdk/core/types.gen.ts +118 -0
  82. package/generators/app/templates/src/sdk/core/utils.gen.ts +143 -0
  83. package/generators/app/templates/src/sdk/index.ts +4 -0
  84. package/generators/app/templates/src/sdk/schemas.gen.ts +195 -0
  85. package/generators/app/templates/src/sdk/sdk.gen.ts +80 -0
  86. package/generators/app/templates/src/sdk/types.gen.ts +158 -0
  87. package/generators/app/templates/src/sdk/zod.gen.ts +148 -0
  88. package/generators/app/templates/src/vite-env.d.ts +2 -1
  89. package/generators/app/templates/tsconfig.json +1 -1
  90. package/generators/app/templates/vite.config.js +35 -21
  91. package/generators/constants.js +9 -9
  92. package/package.json +3 -2
  93. package/generators/app/templates/.env.example +0 -5
  94. package/generators/app/templates/README.md +0 -57
  95. package/generators/app/templates/src/locales/en.json +0 -18
  96. package/generators/app/templates/src/modules/auth/auth-context.tsx +0 -13
  97. package/generators/app/templates/src/modules/auth/login/login-form.tsx +0 -49
  98. package/generators/app/templates/src/modules/auth/login/login-page.tsx +0 -12
  99. package/generators/app/templates/src/modules/auth/use-auth-hook.ts +0 -87
  100. package/generators/app/templates/src/routes/index.tsx +0 -12
  101. package/generators/app/templates/types.d.ts +0 -3
@@ -0,0 +1,195 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ export const AuthResponseDtoUserDetailDtoSchema = {
4
+ type: 'object',
5
+ properties: {
6
+ token: {
7
+ type: [
8
+ 'string',
9
+ 'null'
10
+ ]
11
+ },
12
+ data: {
13
+ type: 'null',
14
+ $ref: '#/components/schemas/UserDetailDto'
15
+ },
16
+ roleName: {
17
+ type: [
18
+ 'string',
19
+ 'null'
20
+ ]
21
+ },
22
+ modulePermissions: {
23
+ type: [
24
+ 'array',
25
+ 'null'
26
+ ],
27
+ items: {
28
+ $ref: '#/components/schemas/ModulePermission'
29
+ }
30
+ }
31
+ }
32
+ } as const;
33
+
34
+ export const ModuleDefinitionSchema = {} as const;
35
+
36
+ export const ModulePermissionSchema = {
37
+ type: 'object',
38
+ properties: {
39
+ module: {
40
+ $ref: '#/components/schemas/ModuleDefinition'
41
+ },
42
+ permissions: {
43
+ type: 'array',
44
+ items: {
45
+ $ref: '#/components/schemas/PermissionDefinition'
46
+ },
47
+ maxItems: 512,
48
+ minItems: 0
49
+ }
50
+ },
51
+ required: [
52
+ 'module',
53
+ 'permissions'
54
+ ]
55
+ } as const;
56
+
57
+ export const PermissionDefinitionSchema = {} as const;
58
+
59
+ export const RestResponseAuthResponseDtoUserDetailDtoSchema = {
60
+ type: 'object',
61
+ properties: {
62
+ message: {
63
+ type: [
64
+ 'string',
65
+ 'null'
66
+ ]
67
+ },
68
+ status: {
69
+ type: [
70
+ 'boolean',
71
+ 'null'
72
+ ]
73
+ },
74
+ data: {
75
+ type: 'null',
76
+ $ref: '#/components/schemas/AuthResponseDtoUserDetailDto'
77
+ }
78
+ }
79
+ } as const;
80
+
81
+ export const UserDetailDtoSchema = {
82
+ type: 'object',
83
+ properties: {
84
+ id: {
85
+ type: 'string'
86
+ },
87
+ slug: {
88
+ type: 'string'
89
+ },
90
+ email: {
91
+ type: 'string',
92
+ format: 'email',
93
+ maxLength: 256,
94
+ minLength: 1
95
+ }
96
+ },
97
+ required: [
98
+ 'email',
99
+ 'id',
100
+ 'slug'
101
+ ]
102
+ } as const;
103
+
104
+ export const RestResponseStringSchema = {
105
+ type: 'object',
106
+ properties: {
107
+ message: {
108
+ type: [
109
+ 'string',
110
+ 'null'
111
+ ]
112
+ },
113
+ status: {
114
+ type: [
115
+ 'boolean',
116
+ 'null'
117
+ ]
118
+ },
119
+ data: {
120
+ type: [
121
+ 'string',
122
+ 'null'
123
+ ]
124
+ }
125
+ }
126
+ } as const;
127
+
128
+ export const UserResetPasswordDtoSchema = {
129
+ type: 'object',
130
+ properties: {
131
+ email: {
132
+ type: 'string',
133
+ format: 'email',
134
+ maxLength: 256,
135
+ minLength: 1
136
+ },
137
+ password: {
138
+ type: 'string',
139
+ format: 'password',
140
+ maxLength: 32,
141
+ minLength: 6
142
+ },
143
+ otp: {
144
+ type: 'string',
145
+ maxLength: 12,
146
+ minLength: 4
147
+ }
148
+ },
149
+ required: [
150
+ 'email',
151
+ 'otp',
152
+ 'password'
153
+ ]
154
+ } as const;
155
+
156
+ export const UserSignupDtoSchema = {
157
+ type: 'object',
158
+ properties: {
159
+ password: {
160
+ type: 'string'
161
+ },
162
+ email: {
163
+ type: 'string',
164
+ format: 'email',
165
+ maxLength: 256,
166
+ minLength: 1
167
+ }
168
+ },
169
+ required: [
170
+ 'email',
171
+ 'password'
172
+ ]
173
+ } as const;
174
+
175
+ export const UserLoginDtoSchema = {
176
+ type: 'object',
177
+ properties: {
178
+ email: {
179
+ type: 'string',
180
+ format: 'email',
181
+ maxLength: 256,
182
+ minLength: 1
183
+ },
184
+ password: {
185
+ type: 'string',
186
+ format: 'password',
187
+ maxLength: 32,
188
+ minLength: 6
189
+ }
190
+ },
191
+ required: [
192
+ 'email',
193
+ 'password'
194
+ ]
195
+ } as const;
@@ -0,0 +1,80 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import type { Client, Options as Options2, TDataShape } from './client';
4
+ import { client } from './client.gen';
5
+ import type { LoginUserAuthData, LoginUserAuthResponses, LogoutUserAuthData, LogoutUserAuthResponses, RegisterUserAuthData, RegisterUserAuthResponses, ResetPasswordUserAuthData, ResetPasswordUserAuthResponses, SendOtpUserAuthData, SendOtpUserAuthResponses, ValidateTokenUserAuthData, ValidateTokenUserAuthResponses } from './types.gen';
6
+ import { zLoginUserAuthData, zLoginUserAuthResponse, zLogoutUserAuthData, zLogoutUserAuthResponse, zRegisterUserAuthData, zRegisterUserAuthResponse, zResetPasswordUserAuthData, zResetPasswordUserAuthResponse, zSendOtpUserAuthData, zSendOtpUserAuthResponse, zValidateTokenUserAuthData, zValidateTokenUserAuthResponse } from './zod.gen';
7
+
8
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
9
+ /**
10
+ * You can provide a client instance returned by `createClient()` instead of
11
+ * individual options. This might be also useful if you want to implement a
12
+ * custom client.
13
+ */
14
+ client?: Client;
15
+ /**
16
+ * You can pass arbitrary values through the `meta` object. This can be
17
+ * used to access values that aren't defined as part of the SDK function.
18
+ */
19
+ meta?: Record<string, unknown>;
20
+ };
21
+
22
+ export const validateTokenUserAuth = <ThrowOnError extends boolean = false>(options?: Options<ValidateTokenUserAuthData, ThrowOnError>) => (options?.client ?? client).post<ValidateTokenUserAuthResponses, unknown, ThrowOnError>({
23
+ requestValidator: async (data) => await zValidateTokenUserAuthData.parseAsync(data),
24
+ responseValidator: async (data) => await zValidateTokenUserAuthResponse.parseAsync(data),
25
+ security: [{ name: 'X-AUTH-TOKEN', type: 'apiKey' }],
26
+ url: '/api/v1/auth/user/validate-token',
27
+ ...options
28
+ });
29
+
30
+ export const sendOtpUserAuth = <ThrowOnError extends boolean = false>(options: Options<SendOtpUserAuthData, ThrowOnError>) => (options.client ?? client).post<SendOtpUserAuthResponses, unknown, ThrowOnError>({
31
+ requestValidator: async (data) => await zSendOtpUserAuthData.parseAsync(data),
32
+ responseValidator: async (data) => await zSendOtpUserAuthResponse.parseAsync(data),
33
+ security: [{ name: 'X-AUTH-TOKEN', type: 'apiKey' }],
34
+ url: '/api/v1/auth/user/send-otp',
35
+ ...options
36
+ });
37
+
38
+ export const resetPasswordUserAuth = <ThrowOnError extends boolean = false>(options: Options<ResetPasswordUserAuthData, ThrowOnError>) => (options.client ?? client).post<ResetPasswordUserAuthResponses, unknown, ThrowOnError>({
39
+ requestValidator: async (data) => await zResetPasswordUserAuthData.parseAsync(data),
40
+ responseValidator: async (data) => await zResetPasswordUserAuthResponse.parseAsync(data),
41
+ security: [{ name: 'X-AUTH-TOKEN', type: 'apiKey' }],
42
+ url: '/api/v1/auth/user/reset',
43
+ ...options,
44
+ headers: {
45
+ 'Content-Type': 'application/json',
46
+ ...options.headers
47
+ }
48
+ });
49
+
50
+ export const registerUserAuth = <ThrowOnError extends boolean = false>(options: Options<RegisterUserAuthData, ThrowOnError>) => (options.client ?? client).post<RegisterUserAuthResponses, unknown, ThrowOnError>({
51
+ requestValidator: async (data) => await zRegisterUserAuthData.parseAsync(data),
52
+ responseValidator: async (data) => await zRegisterUserAuthResponse.parseAsync(data),
53
+ security: [{ name: 'X-AUTH-TOKEN', type: 'apiKey' }],
54
+ url: '/api/v1/auth/user/register',
55
+ ...options,
56
+ headers: {
57
+ 'Content-Type': 'application/json',
58
+ ...options.headers
59
+ }
60
+ });
61
+
62
+ export const logoutUserAuth = <ThrowOnError extends boolean = false>(options?: Options<LogoutUserAuthData, ThrowOnError>) => (options?.client ?? client).post<LogoutUserAuthResponses, unknown, ThrowOnError>({
63
+ requestValidator: async (data) => await zLogoutUserAuthData.parseAsync(data),
64
+ responseValidator: async (data) => await zLogoutUserAuthResponse.parseAsync(data),
65
+ security: [{ name: 'X-AUTH-TOKEN', type: 'apiKey' }],
66
+ url: '/api/v1/auth/user/logout',
67
+ ...options
68
+ });
69
+
70
+ export const loginUserAuth = <ThrowOnError extends boolean = false>(options: Options<LoginUserAuthData, ThrowOnError>) => (options.client ?? client).post<LoginUserAuthResponses, unknown, ThrowOnError>({
71
+ requestValidator: async (data) => await zLoginUserAuthData.parseAsync(data),
72
+ responseValidator: async (data) => await zLoginUserAuthResponse.parseAsync(data),
73
+ security: [{ name: 'X-AUTH-TOKEN', type: 'apiKey' }],
74
+ url: '/api/v1/auth/user/login',
75
+ ...options,
76
+ headers: {
77
+ 'Content-Type': 'application/json',
78
+ ...options.headers
79
+ }
80
+ });
@@ -0,0 +1,158 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ export type ClientOptions = {
4
+ baseURL: 'https://sandbox.beta.kodly.dev/proxy/95-2' | (string & {});
5
+ };
6
+
7
+ export type AuthResponseDtoUserDetailDto = {
8
+ token?: string | null;
9
+ data?: UserDetailDto;
10
+ roleName?: string | null;
11
+ modulePermissions?: Array<ModulePermission> | null;
12
+ };
13
+
14
+ export type ModuleDefinition = unknown;
15
+
16
+ export type ModulePermission = {
17
+ module: ModuleDefinition;
18
+ permissions: Array<PermissionDefinition>;
19
+ };
20
+
21
+ export type PermissionDefinition = unknown;
22
+
23
+ export type RestResponseAuthResponseDtoUserDetailDto = {
24
+ message?: string | null;
25
+ status?: boolean | null;
26
+ data?: AuthResponseDtoUserDetailDto;
27
+ };
28
+
29
+ export type UserDetailDto = {
30
+ id: string;
31
+ slug: string;
32
+ email: string;
33
+ };
34
+
35
+ export type RestResponseString = {
36
+ message?: string | null;
37
+ status?: boolean | null;
38
+ data?: string | null;
39
+ };
40
+
41
+ export type UserResetPasswordDto = {
42
+ email: string;
43
+ password: string;
44
+ otp: string;
45
+ };
46
+
47
+ export type UserSignupDto = {
48
+ password: string;
49
+ email: string;
50
+ };
51
+
52
+ export type UserLoginDto = {
53
+ email: string;
54
+ password: string;
55
+ };
56
+
57
+ export type ValidateTokenUserAuthData = {
58
+ body?: never;
59
+ path?: never;
60
+ query?: never;
61
+ url: '/api/v1/auth/user/validate-token';
62
+ };
63
+
64
+ export type ValidateTokenUserAuthResponses = {
65
+ /**
66
+ * OK
67
+ */
68
+ 200: RestResponseAuthResponseDtoUserDetailDto;
69
+ };
70
+
71
+ export type ValidateTokenUserAuthResponse = ValidateTokenUserAuthResponses[keyof ValidateTokenUserAuthResponses];
72
+
73
+ export type SendOtpUserAuthData = {
74
+ body?: never;
75
+ path?: never;
76
+ query: {
77
+ authId: string;
78
+ };
79
+ url: '/api/v1/auth/user/send-otp';
80
+ };
81
+
82
+ export type SendOtpUserAuthResponses = {
83
+ /**
84
+ * OK
85
+ */
86
+ 200: RestResponseString;
87
+ };
88
+
89
+ export type SendOtpUserAuthResponse = SendOtpUserAuthResponses[keyof SendOtpUserAuthResponses];
90
+
91
+ export type ResetPasswordUserAuthData = {
92
+ body: UserResetPasswordDto;
93
+ path?: never;
94
+ query?: never;
95
+ url: '/api/v1/auth/user/reset';
96
+ };
97
+
98
+ export type ResetPasswordUserAuthResponses = {
99
+ /**
100
+ * OK
101
+ */
102
+ 200: RestResponseString;
103
+ };
104
+
105
+ export type ResetPasswordUserAuthResponse = ResetPasswordUserAuthResponses[keyof ResetPasswordUserAuthResponses];
106
+
107
+ export type RegisterUserAuthData = {
108
+ body: UserSignupDto;
109
+ path?: never;
110
+ query?: never;
111
+ url: '/api/v1/auth/user/register';
112
+ };
113
+
114
+ export type RegisterUserAuthResponses = {
115
+ /**
116
+ * OK
117
+ */
118
+ 200: RestResponseAuthResponseDtoUserDetailDto;
119
+ };
120
+
121
+ export type RegisterUserAuthResponse = RegisterUserAuthResponses[keyof RegisterUserAuthResponses];
122
+
123
+ export type LogoutUserAuthData = {
124
+ body?: never;
125
+ headers?: {
126
+ 'x-auth-token'?: string;
127
+ };
128
+ path?: never;
129
+ query?: never;
130
+ url: '/api/v1/auth/user/logout';
131
+ };
132
+
133
+ export type LogoutUserAuthResponses = {
134
+ /**
135
+ * OK
136
+ */
137
+ 200: {
138
+ [key: string]: unknown;
139
+ };
140
+ };
141
+
142
+ export type LogoutUserAuthResponse = LogoutUserAuthResponses[keyof LogoutUserAuthResponses];
143
+
144
+ export type LoginUserAuthData = {
145
+ body: UserLoginDto;
146
+ path?: never;
147
+ query?: never;
148
+ url: '/api/v1/auth/user/login';
149
+ };
150
+
151
+ export type LoginUserAuthResponses = {
152
+ /**
153
+ * OK
154
+ */
155
+ 200: RestResponseAuthResponseDtoUserDetailDto;
156
+ };
157
+
158
+ export type LoginUserAuthResponse = LoginUserAuthResponses[keyof LoginUserAuthResponses];
@@ -0,0 +1,148 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import { z } from 'zod';
4
+
5
+ export const zModuleDefinition = z.unknown();
6
+
7
+ export const zPermissionDefinition = z.unknown();
8
+
9
+ export const zModulePermission = z.object({
10
+ module: zModuleDefinition,
11
+ permissions: z.array(zPermissionDefinition).min(0).max(512)
12
+ });
13
+
14
+ export const zUserDetailDto = z.object({
15
+ id: z.string(),
16
+ slug: z.string(),
17
+ email: z.email().min(1).max(256)
18
+ });
19
+
20
+ export const zAuthResponseDtoUserDetailDto = z.object({
21
+ token: z.optional(z.union([
22
+ z.string(),
23
+ z.null()
24
+ ])),
25
+ data: z.optional(zUserDetailDto),
26
+ roleName: z.optional(z.union([
27
+ z.string(),
28
+ z.null()
29
+ ])),
30
+ modulePermissions: z.optional(z.union([
31
+ z.array(zModulePermission),
32
+ z.null()
33
+ ]))
34
+ });
35
+
36
+ export const zRestResponseAuthResponseDtoUserDetailDto = z.object({
37
+ message: z.optional(z.union([
38
+ z.string(),
39
+ z.null()
40
+ ])),
41
+ status: z.optional(z.union([
42
+ z.boolean(),
43
+ z.null()
44
+ ])),
45
+ data: z.optional(zAuthResponseDtoUserDetailDto)
46
+ });
47
+
48
+ export const zRestResponseString = z.object({
49
+ message: z.optional(z.union([
50
+ z.string(),
51
+ z.null()
52
+ ])),
53
+ status: z.optional(z.union([
54
+ z.boolean(),
55
+ z.null()
56
+ ])),
57
+ data: z.optional(z.union([
58
+ z.string(),
59
+ z.null()
60
+ ]))
61
+ });
62
+
63
+ export const zUserResetPasswordDto = z.object({
64
+ email: z.email().min(1).max(256),
65
+ password: z.string().min(6).max(32),
66
+ otp: z.string().min(4).max(12)
67
+ });
68
+
69
+ export const zUserSignupDto = z.object({
70
+ password: z.string(),
71
+ email: z.email().min(1).max(256)
72
+ });
73
+
74
+ export const zUserLoginDto = z.object({
75
+ email: z.email().min(1).max(256),
76
+ password: z.string().min(6).max(32)
77
+ });
78
+
79
+ export const zValidateTokenUserAuthData = z.object({
80
+ body: z.optional(z.never()),
81
+ path: z.optional(z.never()),
82
+ query: z.optional(z.never())
83
+ });
84
+
85
+ /**
86
+ * OK
87
+ */
88
+ export const zValidateTokenUserAuthResponse = zRestResponseAuthResponseDtoUserDetailDto;
89
+
90
+ export const zSendOtpUserAuthData = z.object({
91
+ body: z.optional(z.never()),
92
+ path: z.optional(z.never()),
93
+ query: z.object({
94
+ authId: z.string()
95
+ })
96
+ });
97
+
98
+ /**
99
+ * OK
100
+ */
101
+ export const zSendOtpUserAuthResponse = zRestResponseString;
102
+
103
+ export const zResetPasswordUserAuthData = z.object({
104
+ body: zUserResetPasswordDto,
105
+ path: z.optional(z.never()),
106
+ query: z.optional(z.never())
107
+ });
108
+
109
+ /**
110
+ * OK
111
+ */
112
+ export const zResetPasswordUserAuthResponse = zRestResponseString;
113
+
114
+ export const zRegisterUserAuthData = z.object({
115
+ body: zUserSignupDto,
116
+ path: z.optional(z.never()),
117
+ query: z.optional(z.never())
118
+ });
119
+
120
+ /**
121
+ * OK
122
+ */
123
+ export const zRegisterUserAuthResponse = zRestResponseAuthResponseDtoUserDetailDto;
124
+
125
+ export const zLogoutUserAuthData = z.object({
126
+ body: z.optional(z.never()),
127
+ path: z.optional(z.never()),
128
+ query: z.optional(z.never()),
129
+ headers: z.optional(z.object({
130
+ 'x-auth-token': z.optional(z.string()).default('')
131
+ }))
132
+ });
133
+
134
+ /**
135
+ * OK
136
+ */
137
+ export const zLogoutUserAuthResponse = z.record(z.string(), z.unknown());
138
+
139
+ export const zLoginUserAuthData = z.object({
140
+ body: zUserLoginDto,
141
+ path: z.optional(z.never()),
142
+ query: z.optional(z.never())
143
+ });
144
+
145
+ /**
146
+ * OK
147
+ */
148
+ export const zLoginUserAuthResponse = zRestResponseAuthResponseDtoUserDetailDto;
@@ -1,8 +1,9 @@
1
1
  /// <reference types="vite/client" />
2
2
 
3
3
  interface ImportMetaEnv {
4
+ readonly MODE: string;
5
+ readonly BASE_URL: string;
4
6
  readonly VITE_API_BASE_URL: string;
5
- readonly VITE_BASE: string;
6
7
  }
7
8
 
8
9
  interface ImportMeta {
@@ -5,7 +5,7 @@
5
5
  "jsx": "react-jsx",
6
6
  "module": "ESNext",
7
7
  "lib": ["ES2022", "DOM", "DOM.Iterable"],
8
- "types": ["vite/client", "./types"],
8
+ "types": ["vite/client"],
9
9
 
10
10
  /* Bundler mode */
11
11
  "moduleResolution": "bundler",
@@ -1,29 +1,43 @@
1
- import { defineConfig } from 'vite';
1
+ import { defineConfig, loadEnv } from 'vite';
2
2
  import viteReact from '@vitejs/plugin-react';
3
3
  import { tanstackRouter } from '@tanstack/router-plugin/vite';
4
4
  import tailwindcss from '@tailwindcss/vite';
5
5
  import { resolve } from 'node:path';
6
6
 
7
- export default defineConfig({
8
- base: process.env.VITE_BASE || '/',
9
- plugins: [
10
- tanstackRouter({
11
- target: 'react',
12
- autoCodeSplitting: true,
13
- spa: {
14
- enabled: true,
7
+ export default defineConfig(({ mode }) => {
8
+ // Load env file based on `mode` in the current working directory.
9
+ // Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
10
+ const env = loadEnv(mode, process.cwd(), '');
11
+
12
+ return {
13
+ base: env.BASE_URL || '/',
14
+ plugins: [
15
+ tanstackRouter({
16
+ target: 'react',
17
+ autoCodeSplitting: true,
18
+ spa: {
19
+ enabled: true,
20
+ },
21
+ }),
22
+ viteReact({
23
+ babel: {
24
+ plugins: [['babel-plugin-react-compiler']],
25
+ },
26
+ }),
27
+ tailwindcss(),
28
+ ],
29
+ resolve: {
30
+ alias: {
31
+ '@': resolve(__dirname, './src'),
15
32
  },
16
- }),
17
- viteReact(),
18
- tailwindcss(),
19
- ],
20
- resolve: {
21
- alias: {
22
- '@': resolve(__dirname, './src'),
23
33
  },
24
- },
25
- server: {
26
- port: parseInt(process.env.PORT || '3000', 10),
27
- allowedHosts: ['sandbox.beta.kodly.dev'],
28
- },
34
+ server: {
35
+ port: parseInt(env.PORT || '3000', 10),
36
+ allowedHosts: [env.ALLOWED_HOSTS || 'localhost'],
37
+ },
38
+ build: {
39
+ // Raise chunk size warning threshold to reduce noise in CI builds.
40
+ chunkSizeWarningLimit: 1500,
41
+ },
42
+ };
29
43
  });
@@ -1,17 +1,17 @@
1
1
  const constants = {
2
- REACT_VERSION: '^19.2.0',
3
- REACT_DOM_VERSION: '^19.2.0',
4
- VITE_VERSION: '^7.2.4',
2
+ REACT_VERSION: '^19.2.1',
3
+ REACT_DOM_VERSION: '^19.2.1',
4
+ VITE_VERSION: '^7.2.6',
5
5
  TYPESCRIPT_VERSION: '^5.9.3',
6
- TANSTACK_ROUTER_VERSION: '^1.139.3',
7
- TANSTACK_ROUTER_PLUGIN_VERSION: '^1.139.3',
8
- TANSTACK_REACT_QUERY_VERSION: '^5.90.10',
9
- I18NEXT_VERSION: '^25.6.3',
6
+ TANSTACK_ROUTER_VERSION: '^1.139.14',
7
+ TANSTACK_ROUTER_PLUGIN_VERSION: '^1.139.14',
8
+ TANSTACK_REACT_QUERY_VERSION: '^5.90.12',
9
+ I18NEXT_VERSION: '^25.7.1',
10
10
  REACT_I18NEXT_VERSION: '^16.3.5',
11
11
  AXIOS_VERSION: '^1.13.2',
12
- JOTAI_VERSION: '^2.15.1',
12
+ JOTAI_VERSION: '^2.15.2',
13
13
  TAILWIND_VERSION: '^4.1.17',
14
- RADIX_UI_VERSION: '^1.4.3',
14
+ RADIX_UI_VERSION: '^1.2.4',
15
15
  DOTENV_VERSION: '^17.2.3',
16
16
  CROSS_ENV_VERSION: '^10.1.0',
17
17
  };