@idevconn/create-icore 0.6.3 → 0.7.1

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 (87) hide show
  1. package/dist/cli.js +384 -276
  2. package/dist/index.cjs +385 -277
  3. package/dist/index.d.cts +3 -3
  4. package/dist/index.d.ts +3 -3
  5. package/dist/index.js +382 -274
  6. package/package.json +1 -1
  7. package/templates/.yarn/releases/yarn-4.16.0.cjs +944 -0
  8. package/templates/.yarnrc.yml +1 -1
  9. package/templates/apps/api/src/app/storage/storage.controller.ts +28 -0
  10. package/templates/apps/microservices/auth/src/app/app.module.ts +20 -2
  11. package/templates/apps/microservices/notes/src/app/app.module.ts +17 -2
  12. package/templates/apps/microservices/upload/src/app/app.module.ts +17 -2
  13. package/templates/apps/microservices/upload/src/app/storage.controller.ts +7 -0
  14. package/templates/apps/templates/client-antd/src/components/auth/AuthBrandPanel.tsx +59 -0
  15. package/templates/apps/templates/client-antd/src/components/auth/CheckEmailScreen.tsx +28 -0
  16. package/templates/apps/templates/client-antd/src/components/auth/LoginForm.tsx +116 -0
  17. package/templates/apps/templates/client-antd/src/components/auth/MagicLinkForm.tsx +95 -0
  18. package/templates/apps/templates/client-antd/src/components/auth/RegisterForm.tsx +98 -0
  19. package/templates/apps/templates/client-antd/src/globals.less +6 -0
  20. package/templates/apps/templates/client-antd/src/main.tsx +1 -1
  21. package/templates/apps/templates/client-antd/src/routes/login.tsx +45 -181
  22. package/templates/apps/templates/client-mui/src/components/auth/AuthBrandPanel.tsx +59 -0
  23. package/templates/apps/templates/client-mui/src/components/auth/CheckEmailScreen.tsx +28 -0
  24. package/templates/apps/templates/client-mui/src/components/auth/LoginForm.tsx +141 -0
  25. package/templates/apps/templates/client-mui/src/components/auth/MagicLinkForm.tsx +106 -0
  26. package/templates/apps/templates/client-mui/src/components/auth/RegisterForm.tsx +113 -0
  27. package/templates/apps/templates/client-mui/src/main.tsx +1 -1
  28. package/templates/apps/templates/client-mui/src/routes/login.tsx +50 -186
  29. package/templates/apps/templates/client-shadcn/src/components/auth/AuthBrandPanel.tsx +52 -0
  30. package/templates/apps/templates/client-shadcn/src/components/auth/CheckEmailScreen.tsx +29 -0
  31. package/templates/apps/templates/client-shadcn/src/components/auth/LoginForm.tsx +161 -0
  32. package/templates/apps/templates/client-shadcn/src/components/auth/MagicLinkForm.tsx +110 -0
  33. package/templates/apps/templates/client-shadcn/src/components/auth/RegisterForm.tsx +107 -0
  34. package/templates/apps/templates/client-shadcn/src/components/layout/LayoutHeader.tsx +31 -10
  35. package/templates/apps/templates/client-shadcn/src/components/layout/LayoutSider.tsx +22 -27
  36. package/templates/apps/templates/client-shadcn/src/components/ui/card.tsx +1 -1
  37. package/templates/apps/templates/client-shadcn/src/globals.css +39 -13
  38. package/templates/apps/templates/client-shadcn/src/routes/auth.callback.tsx +1 -1
  39. package/templates/apps/templates/client-shadcn/src/routes/login.tsx +55 -165
  40. package/templates/libs/auth-strategies/mongodb/CHANGELOG.md +8 -0
  41. package/templates/libs/auth-strategies/mongodb/README.md +11 -0
  42. package/templates/libs/auth-strategies/mongodb/eslint.config.mjs +19 -0
  43. package/templates/libs/auth-strategies/mongodb/jest.config.cts +10 -0
  44. package/templates/libs/auth-strategies/mongodb/package.json +16 -0
  45. package/templates/libs/auth-strategies/mongodb/project.json +19 -0
  46. package/templates/libs/auth-strategies/mongodb/src/index.ts +1 -0
  47. package/templates/libs/auth-strategies/mongodb/src/lib/__tests__/mongodb-auth.strategy.unit.test.ts +42 -0
  48. package/templates/libs/auth-strategies/mongodb/src/lib/auth-mongodb.spec.ts +7 -0
  49. package/templates/libs/auth-strategies/mongodb/src/lib/auth-mongodb.ts +3 -0
  50. package/templates/libs/auth-strategies/mongodb/src/lib/mongodb-auth.strategy.ts +188 -0
  51. package/templates/libs/auth-strategies/mongodb/tsconfig.json +23 -0
  52. package/templates/libs/auth-strategies/mongodb/tsconfig.lib.json +10 -0
  53. package/templates/libs/auth-strategies/mongodb/tsconfig.spec.json +16 -0
  54. package/templates/libs/db-strategies/mongodb/CHANGELOG.md +7 -0
  55. package/templates/libs/db-strategies/mongodb/README.md +11 -0
  56. package/templates/libs/db-strategies/mongodb/eslint.config.mjs +19 -0
  57. package/templates/libs/db-strategies/mongodb/jest.config.cts +10 -0
  58. package/templates/libs/db-strategies/mongodb/package.json +14 -0
  59. package/templates/libs/db-strategies/mongodb/project.json +19 -0
  60. package/templates/libs/db-strategies/mongodb/src/index.ts +1 -0
  61. package/templates/libs/db-strategies/mongodb/src/lib/__tests__/mongodb-db.strategy.unit.test.ts +38 -0
  62. package/templates/libs/db-strategies/mongodb/src/lib/mongodb-db.strategy.ts +108 -0
  63. package/templates/libs/db-strategies/mongodb/src/lib/mongodb.spec.ts +7 -0
  64. package/templates/libs/db-strategies/mongodb/src/lib/mongodb.ts +3 -0
  65. package/templates/libs/db-strategies/mongodb/tsconfig.json +23 -0
  66. package/templates/libs/db-strategies/mongodb/tsconfig.lib.json +10 -0
  67. package/templates/libs/db-strategies/mongodb/tsconfig.spec.json +16 -0
  68. package/templates/libs/shared/src/strategies/storage.ts +3 -0
  69. package/templates/libs/storage-strategies/mongodb/CHANGELOG.md +8 -0
  70. package/templates/libs/storage-strategies/mongodb/README.md +11 -0
  71. package/templates/libs/storage-strategies/mongodb/eslint.config.mjs +19 -0
  72. package/templates/libs/storage-strategies/mongodb/jest.config.cts +10 -0
  73. package/templates/libs/storage-strategies/mongodb/package.json +14 -0
  74. package/templates/libs/storage-strategies/mongodb/project.json +19 -0
  75. package/templates/libs/storage-strategies/mongodb/src/index.ts +1 -0
  76. package/templates/libs/storage-strategies/mongodb/src/lib/__tests__/mongodb-storage.strategy.unit.test.ts +38 -0
  77. package/templates/libs/storage-strategies/mongodb/src/lib/mongodb-storage.strategy.ts +93 -0
  78. package/templates/libs/storage-strategies/mongodb/src/lib/storage-mongodb.spec.ts +7 -0
  79. package/templates/libs/storage-strategies/mongodb/src/lib/storage-mongodb.ts +3 -0
  80. package/templates/libs/storage-strategies/mongodb/tsconfig.json +23 -0
  81. package/templates/libs/storage-strategies/mongodb/tsconfig.lib.json +10 -0
  82. package/templates/libs/storage-strategies/mongodb/tsconfig.spec.json +16 -0
  83. package/templates/libs/template-shared/src/lib/i18n/keys.ts +216 -56
  84. package/templates/libs/template-shared/src/lib/stores/theme.store.ts +1 -6
  85. package/templates/libs/upload-client/src/lib/upload-client.service.ts +7 -0
  86. package/templates/tsconfig.base.json +4 -1
  87. package/templates/.yarn/releases/yarn-4.15.0.cjs +0 -940
@@ -1,57 +1,217 @@
1
+ const en = {
2
+ common: {
3
+ loading: 'Loading…',
4
+ save: 'Save',
5
+ cancel: 'Cancel',
6
+ logout: 'Log out',
7
+ },
8
+ auth: {
9
+ email: 'Email',
10
+ password: 'Password',
11
+ confirmPassword: 'Confirm password',
12
+ passwordMismatch: 'Passwords do not match',
13
+ login: 'Log in',
14
+ loginTitle: 'Welcome back',
15
+ loginSubtitle: 'Sign in to your account',
16
+ register: 'Sign up',
17
+ registerTitle: 'Create an account',
18
+ registerSubtitle: 'Start your journey with iCore',
19
+ switchToLogin: 'Already have an account?',
20
+ switchToLoginLink: 'Log in',
21
+ switchToRegister: "Don't have an account?",
22
+ switchToRegisterLink: 'Sign up',
23
+ withPassword: 'Password',
24
+ withMagicLink: 'Magic link',
25
+ sendMagicLink: 'Send magic link',
26
+ magicLinkSent: 'Check your inbox',
27
+ magicLinkSentDescription: 'We sent a sign-in link to {{email}}.',
28
+ magicLinkUseDifferentEmail: 'Use a different email',
29
+ checkEmail: 'Verify your email',
30
+ checkEmailDescription:
31
+ 'We sent a confirmation link to {{email}}. Click it to activate your account.',
32
+ backToLogin: 'Back to log in',
33
+ resendEmail: 'Resend email',
34
+ callbackVerifying: 'Verifying…',
35
+ callbackFailed: 'Verification failed. The link may have expired.',
36
+ callbackMissingToken: 'Missing or invalid link token.',
37
+ continueWithGoogle: 'Continue with Google',
38
+ continueWithGithub: 'Continue with GitHub',
39
+ oauthFailed: 'Sign-in failed',
40
+ oauthCallbackMissingTokens: 'Missing tokens on callback',
41
+ orContinueWith: 'or continue with',
42
+ },
43
+ nav: {
44
+ dashboard: 'Dashboard',
45
+ profile: 'Profile',
46
+ notes: 'Notes',
47
+ },
48
+ profile: {
49
+ title: 'Profile',
50
+ hint: 'Edit your account details.',
51
+ },
52
+ notes: {
53
+ title: 'Notes',
54
+ new: 'New note',
55
+ edit: 'Edit',
56
+ delete: 'Delete',
57
+ empty: 'No notes yet.',
58
+ noteTitle: 'Title',
59
+ noteBody: 'Body',
60
+ save: 'Save',
61
+ cancel: 'Cancel',
62
+ confirmDelete: 'Delete this note?',
63
+ saved: 'Note saved',
64
+ deleted: 'Note deleted',
65
+ },
66
+ error: {
67
+ accessDenied: 'Access denied',
68
+ unknown: 'Something went wrong.',
69
+ },
70
+ };
71
+
72
+ const ru = {
73
+ common: {
74
+ loading: 'Загрузка…',
75
+ save: 'Сохранить',
76
+ cancel: 'Отмена',
77
+ logout: 'Выйти',
78
+ },
79
+ auth: {
80
+ email: 'Email',
81
+ password: 'Пароль',
82
+ confirmPassword: 'Подтвердите пароль',
83
+ passwordMismatch: 'Пароли не совпадают',
84
+ login: 'Войти',
85
+ loginTitle: 'С возвращением',
86
+ loginSubtitle: 'Войдите в свой аккаунт',
87
+ register: 'Регистрация',
88
+ registerTitle: 'Создать аккаунт',
89
+ registerSubtitle: 'Начните работу с iCore',
90
+ switchToLogin: 'Уже есть аккаунт?',
91
+ switchToLoginLink: 'Войти',
92
+ switchToRegister: 'Нет аккаунта?',
93
+ switchToRegisterLink: 'Зарегистрироваться',
94
+ withPassword: 'Пароль',
95
+ withMagicLink: 'Магическая ссылка',
96
+ sendMagicLink: 'Отправить ссылку',
97
+ magicLinkSent: 'Проверьте почту',
98
+ magicLinkSentDescription: 'Мы отправили ссылку для входа на {{email}}.',
99
+ magicLinkUseDifferentEmail: 'Использовать другой email',
100
+ checkEmail: 'Подтвердите email',
101
+ checkEmailDescription:
102
+ 'Мы отправили ссылку для подтверждения на {{email}}. Нажмите её для активации аккаунта.',
103
+ backToLogin: 'Вернуться к входу',
104
+ resendEmail: 'Отправить повторно',
105
+ callbackVerifying: 'Проверка…',
106
+ callbackFailed: 'Ошибка проверки. Ссылка могла устареть.',
107
+ callbackMissingToken: 'Отсутствует или недействительный токен.',
108
+ continueWithGoogle: 'Войти через Google',
109
+ continueWithGithub: 'Войти через GitHub',
110
+ oauthFailed: 'Ошибка входа',
111
+ oauthCallbackMissingTokens: 'Отсутствуют токены',
112
+ orContinueWith: 'или продолжить через',
113
+ },
114
+ nav: {
115
+ dashboard: 'Главная',
116
+ profile: 'Профиль',
117
+ notes: 'Заметки',
118
+ },
119
+ profile: {
120
+ title: 'Профиль',
121
+ hint: 'Редактируйте данные аккаунта.',
122
+ },
123
+ notes: {
124
+ title: 'Заметки',
125
+ new: 'Новая заметка',
126
+ edit: 'Редактировать',
127
+ delete: 'Удалить',
128
+ empty: 'Нет заметок.',
129
+ noteTitle: 'Заголовок',
130
+ noteBody: 'Содержание',
131
+ save: 'Сохранить',
132
+ cancel: 'Отмена',
133
+ confirmDelete: 'Удалить эту заметку?',
134
+ saved: 'Заметка сохранена',
135
+ deleted: 'Заметка удалена',
136
+ },
137
+ error: {
138
+ accessDenied: 'Доступ запрещён',
139
+ unknown: 'Что-то пошло не так.',
140
+ },
141
+ };
142
+
143
+ const he = {
144
+ common: {
145
+ loading: '...טוען',
146
+ save: 'שמור',
147
+ cancel: 'בטל',
148
+ logout: 'התנתק',
149
+ },
150
+ auth: {
151
+ email: 'אימייל',
152
+ password: 'סיסמה',
153
+ confirmPassword: 'אימות סיסמה',
154
+ passwordMismatch: 'הסיסמאות אינן תואמות',
155
+ login: 'כניסה',
156
+ loginTitle: 'ברוך שובך',
157
+ loginSubtitle: 'התחבר לחשבונך',
158
+ register: 'הרשמה',
159
+ registerTitle: 'יצירת חשבון',
160
+ registerSubtitle: 'התחל את המסע שלך עם iCore',
161
+ switchToLogin: 'כבר יש לך חשבון?',
162
+ switchToLoginLink: 'כניסה',
163
+ switchToRegister: 'אין לך חשבון?',
164
+ switchToRegisterLink: 'הרשמה',
165
+ withPassword: 'סיסמה',
166
+ withMagicLink: 'קישור קסם',
167
+ sendMagicLink: 'שלח קישור',
168
+ magicLinkSent: 'בדוק את תיבת הדואר',
169
+ magicLinkSentDescription: 'שלחנו קישור כניסה אל {{email}}.',
170
+ magicLinkUseDifferentEmail: 'השתמש באימייל אחר',
171
+ checkEmail: 'אמת את האימייל',
172
+ checkEmailDescription: 'שלחנו קישור אישור אל {{email}}. לחץ עליו להפעלת החשבון.',
173
+ backToLogin: 'חזרה לכניסה',
174
+ resendEmail: 'שלח שוב',
175
+ callbackVerifying: '...מאמת',
176
+ callbackFailed: 'אימות נכשל. הקישור עשוי להיות פג תוקף.',
177
+ callbackMissingToken: 'טוקן חסר או לא תקין.',
178
+ continueWithGoogle: 'המשך עם Google',
179
+ continueWithGithub: 'המשך עם GitHub',
180
+ oauthFailed: 'כניסה נכשלה',
181
+ oauthCallbackMissingTokens: 'טוקנים חסרים',
182
+ orContinueWith: 'או המשך עם',
183
+ },
184
+ nav: {
185
+ dashboard: 'לוח בקרה',
186
+ profile: 'פרופיל',
187
+ notes: 'הערות',
188
+ },
189
+ profile: {
190
+ title: 'פרופיל',
191
+ hint: 'ערוך את פרטי החשבון.',
192
+ },
193
+ notes: {
194
+ title: 'הערות',
195
+ new: 'הערה חדשה',
196
+ edit: 'ערוך',
197
+ delete: 'מחק',
198
+ empty: 'אין הערות עדיין.',
199
+ noteTitle: 'כותרת',
200
+ noteBody: 'תוכן',
201
+ save: 'שמור',
202
+ cancel: 'בטל',
203
+ confirmDelete: 'למחוק את ההערה הזו?',
204
+ saved: 'הערה נשמרה',
205
+ deleted: 'הערה נמחקה',
206
+ },
207
+ error: {
208
+ accessDenied: 'גישה נדחתה',
209
+ unknown: 'משהו השתבש.',
210
+ },
211
+ };
212
+
1
213
  export const ICORE_LOCALES = {
2
- en: {
3
- common: {
4
- loading: 'Loading…',
5
- save: 'Save',
6
- cancel: 'Cancel',
7
- logout: 'Log out',
8
- },
9
- auth: {
10
- email: 'Email',
11
- password: 'Password',
12
- login: 'Log in',
13
- register: 'Sign up',
14
- switchToLogin: 'Have an account? Log in',
15
- switchToRegister: 'No account yet? Sign up',
16
- withPassword: 'With password',
17
- withMagicLink: 'Magic link',
18
- sendMagicLink: 'Send link',
19
- magicLinkSent: 'Check your email',
20
- magicLinkSentDescription: 'We sent a sign-in link to {{email}}.',
21
- magicLinkUseDifferentEmail: 'Use a different email',
22
- callbackVerifying: 'Verifying…',
23
- callbackFailed: 'Verification failed',
24
- callbackMissingToken: 'Missing magic-link token',
25
- continueWithGoogle: 'Continue with Google',
26
- continueWithGithub: 'Continue with GitHub',
27
- oauthFailed: 'Sign-in failed',
28
- oauthCallbackMissingTokens: 'Missing tokens on callback',
29
- },
30
- nav: {
31
- dashboard: 'Dashboard',
32
- profile: 'Profile',
33
- },
34
- profile: {
35
- title: 'Profile',
36
- hint: 'Edit your account details.',
37
- },
38
- notes: {
39
- title: 'Notes',
40
- new: 'New note',
41
- edit: 'Edit',
42
- delete: 'Delete',
43
- empty: 'No notes yet.',
44
- noteTitle: 'Title',
45
- noteBody: 'Body',
46
- save: 'Save',
47
- cancel: 'Cancel',
48
- confirmDelete: 'Delete this note?',
49
- saved: 'Note saved',
50
- deleted: 'Note deleted',
51
- },
52
- error: {
53
- accessDenied: 'Access denied',
54
- unknown: 'Something went wrong.',
55
- },
56
- },
57
- } as const;
214
+ en: { translation: en },
215
+ ru: { translation: ru },
216
+ he: { translation: he },
217
+ };
@@ -9,15 +9,10 @@ interface ThemeState {
9
9
  toggle: () => void;
10
10
  }
11
11
 
12
- function detectInitial(): ThemeMode {
13
- if (typeof window === 'undefined') return 'light';
14
- return window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
15
- }
16
-
17
12
  export const useThemeStore = create<ThemeState>()(
18
13
  persist(
19
14
  (set, get) => ({
20
- mode: detectInitial(),
15
+ mode: 'dark' as ThemeMode,
21
16
  setMode: (mode) => set({ mode }),
22
17
  toggle: () => set({ mode: get().mode === 'dark' ? 'light' : 'dark' }),
23
18
  }),
@@ -35,4 +35,11 @@ export class UploadClientService {
35
35
  list(userId: string, prefix?: string): Promise<StorageRef[]> {
36
36
  return firstValueFrom(this.client.send<StorageRef[]>('storage.list', { userId, prefix }));
37
37
  }
38
+
39
+ async downloadBuffer(userId: string, ref: StorageRef): Promise<Buffer | null> {
40
+ const b64 = await firstValueFrom(
41
+ this.client.send<string | null>('storage.downloadBuffer', { userId, ref }),
42
+ );
43
+ return b64 ? Buffer.from(b64, 'base64') : null;
44
+ }
38
45
  }
@@ -31,7 +31,10 @@
31
31
  "@icore/notes-client": ["./libs/notes-client/src/index.ts"],
32
32
  "@icore/jobs-client": ["./libs/jobs-client/src/index.ts"],
33
33
  "@icore/vite-plugins": ["./libs/vite-plugins/src/index.d.mts"],
34
- "@icore/firebase-admin": ["./libs/firebase-admin/src/index.ts"]
34
+ "@icore/firebase-admin": ["./libs/firebase-admin/src/index.ts"],
35
+ "@icore/db-mongodb": ["./libs/db-strategies/mongodb/src/index.ts"],
36
+ "@icore/storage-mongodb": ["./libs/storage-strategies/mongodb/src/index.ts"],
37
+ "@icore/auth-mongodb": ["./libs/auth-strategies/mongodb/src/index.ts"]
35
38
  }
36
39
  },
37
40
  "exclude": ["node_modules", "dist", ".nx"]