vintasend 0.2.3 → 0.4.0

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 (133) hide show
  1. package/README.md +227 -12
  2. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/next.config.d.ts +1 -1
  3. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/next.config.js +9 -4
  4. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/forgot-password-notification-context.d.ts +6 -6
  5. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/forgot-password-notification-context.js +16 -17
  6. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/route.d.ts +7 -5
  7. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/route.js +105 -79
  8. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/login/route.d.ts +4 -5
  9. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/login/route.js +96 -66
  10. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/reset-password/route.d.ts +7 -5
  11. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/reset-password/route.js +95 -71
  12. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/email-verification-notification-context.d.ts +6 -6
  13. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/email-verification-notification-context.js +18 -18
  14. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/route.d.ts +4 -5
  15. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/route.js +124 -96
  16. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/verify-email/route.d.ts +7 -5
  17. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/verify-email/route.js +94 -70
  18. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/login/page.d.ts +1 -1
  19. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/login/page.js +67 -55
  20. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/reset-password/[token]/page.d.ts +1 -1
  21. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/reset-password/[token]/page.js +76 -63
  22. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/signup/page.d.ts +1 -1
  23. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/signup/page.js +87 -63
  24. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email/[token]/page.d.ts +1 -1
  25. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email/[token]/page.js +50 -35
  26. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email-sent/page.d.ts +1 -1
  27. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email-sent/page.js +12 -12
  28. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/layout.d.ts +7 -5
  29. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/layout.js +15 -16
  30. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/page.d.ts +1 -1
  31. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/page.js +65 -21
  32. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/AuthLayout.d.ts +7 -4
  33. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/AuthLayout.js +7 -8
  34. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/accordion.d.ts +18 -6
  35. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/accordion.js +86 -48
  36. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert-dialog.d.ts +58 -14
  37. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert-dialog.js +135 -53
  38. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert.d.ts +21 -7
  39. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert.js +85 -49
  40. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/avatar.d.ts +14 -5
  41. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/avatar.js +77 -40
  42. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/button.d.ts +25 -9
  43. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/button.js +80 -58
  44. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/card.d.ts +19 -7
  45. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/card.js +98 -48
  46. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/checkbox.d.ts +6 -3
  47. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/checkbox.js +66 -42
  48. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/collapsible.d.ts +10 -4
  49. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/collapsible.js +48 -35
  50. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dialog.d.ts +40 -13
  51. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dialog.js +116 -50
  52. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dropdown-menu.d.ts +83 -19
  53. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dropdown-menu.js +170 -68
  54. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/form.d.ts +53 -21
  55. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/form.js +137 -83
  56. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/input.d.ts +8 -2
  57. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/input.js +60 -37
  58. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/label.d.ts +10 -4
  59. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/label.js +61 -40
  60. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/menubar.d.ts +77 -23
  61. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/menubar.js +188 -64
  62. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/select.d.ts +48 -12
  63. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/select.js +148 -66
  64. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/textarea.d.ts +8 -2
  65. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/textarea.js +59 -37
  66. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/auth.d.ts +10 -10
  67. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/auth.js +54 -55
  68. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/core.d.ts +14 -11
  69. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/core.js +1 -2
  70. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/email.js +0 -1
  71. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/logger.d.ts +3 -3
  72. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/logger.js +9 -10
  73. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/schemas/auth.d.ts +66 -32
  74. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/schemas/auth.js +74 -54
  75. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/auth.js +7 -8
  76. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications-with-queue.d.ts +14 -4
  77. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications-with-queue.js +14 -10
  78. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications.d.ts +11 -7
  79. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications.js +39 -26
  80. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/temporal-queue-service.d.ts +11 -8
  81. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/temporal-queue-service.js +14 -15
  82. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/temporal.d.ts +1 -1
  83. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/temporal.js +9 -10
  84. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/utils.d.ts +1 -1
  85. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/utils.js +4 -5
  86. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/activities.d.ts +6 -5
  87. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/activities.js +14 -14
  88. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/config.d.ts +1 -1
  89. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/config.js +2 -3
  90. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/constants.d.ts +1 -1
  91. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/constants.js +1 -2
  92. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/worker.js +20 -22
  93. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/workflows.d.ts +3 -2
  94. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/workflows.js +10 -9
  95. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/tailwind.config.d.ts +74 -74
  96. package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/tailwind.config.js +80 -81
  97. package/dist/implementations/vintasend-nodemailer/src/index.js +6 -4
  98. package/dist/implementations/vintasend-nodemailer/src/nodemailer-notification-adapter.d.ts +36 -14
  99. package/dist/implementations/vintasend-nodemailer/src/nodemailer-notification-adapter.js +26 -28
  100. package/dist/implementations/vintasend-prisma/src/index.js +6 -4
  101. package/dist/implementations/vintasend-prisma/src/prisma-notification-backend.d.ts +232 -138
  102. package/dist/implementations/vintasend-prisma/src/prisma-notification-backend.js +275 -262
  103. package/dist/implementations/vintasend-pug/src/index.js +6 -4
  104. package/dist/implementations/vintasend-pug/src/pug-email-template-renderer.d.ts +18 -7
  105. package/dist/implementations/vintasend-pug/src/pug-email-template-renderer.js +19 -21
  106. package/dist/implementations/vintasend-winston/src/index.js +6 -4
  107. package/dist/implementations/vintasend-winston/src/winston-logger.d.ts +6 -6
  108. package/dist/implementations/vintasend-winston/src/winston-logger.js +65 -50
  109. package/dist/index.d.ts +13 -5
  110. package/dist/index.js +13 -1
  111. package/dist/services/attachment-manager/base-attachment-manager.d.ts +42 -0
  112. package/dist/services/attachment-manager/base-attachment-manager.js +115 -0
  113. package/dist/services/attachment-manager/local-file-attachment-manager.d.ts +58 -0
  114. package/dist/services/attachment-manager/local-file-attachment-manager.js +192 -0
  115. package/dist/services/notification-adapters/base-notification-adapter.d.ts +36 -4
  116. package/dist/services/notification-adapters/base-notification-adapter.js +73 -4
  117. package/dist/services/notification-backends/base-notification-backend.d.ts +54 -11
  118. package/dist/services/notification-backends/base-notification-backend.js +12 -0
  119. package/dist/services/notification-context-generators-map.d.ts +1 -1
  120. package/dist/services/notification-context-registry.d.ts +14 -9
  121. package/dist/services/notification-context-registry.js +30 -31
  122. package/dist/services/notification-queue-service/base-notification-queue-service.d.ts +1 -1
  123. package/dist/services/notification-service.d.ts +73 -13
  124. package/dist/services/notification-service.js +125 -8
  125. package/dist/services/notification-template-renderers/base-email-template-renderer.d.ts +3 -3
  126. package/dist/services/notification-template-renderers/base-notification-template-renderer.d.ts +2 -2
  127. package/dist/types/attachment.d.ts +42 -0
  128. package/dist/types/attachment.js +7 -0
  129. package/dist/types/notification-type-config.d.ts +2 -2
  130. package/dist/types/notification.d.ts +21 -0
  131. package/dist/types/one-off-notification.d.ts +72 -0
  132. package/dist/types/one-off-notification.js +2 -0
  133. package/package.json +13 -11
@@ -1,74 +1,86 @@
1
- "use strict";
2
1
  'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
2
+ Object.defineProperty(exports, '__esModule', { value: true });
4
3
  exports.default = ResetPassword;
5
- const react_1 = require("react");
6
- const navigation_1 = require("next/navigation");
7
- const zod_1 = require("@hookform/resolvers/zod");
8
- const react_hook_form_1 = require("react-hook-form");
9
- const alert_1 = require("../../../../components/ui/alert");
10
- const form_1 = require("../../../../components/ui/form");
11
- const input_1 = require("../../../../components/ui/input");
12
- const button_1 = require("../../../../components/ui/button");
13
- const auth_1 = require("../../../../lib/schemas/auth");
14
- const auth_2 = require("../../../../lib/api-clients/auth");
15
- const AuthLayout_1 = require("../../../../components/AuthLayout");
4
+ const react_1 = require('react');
5
+ const navigation_1 = require('next/navigation');
6
+ const zod_1 = require('@hookform/resolvers/zod');
7
+ const react_hook_form_1 = require('react-hook-form');
8
+ const alert_1 = require('../../../../components/ui/alert');
9
+ const form_1 = require('../../../../components/ui/form');
10
+ const input_1 = require('../../../../components/ui/input');
11
+ const button_1 = require('../../../../components/ui/button');
12
+ const auth_1 = require('../../../../lib/schemas/auth');
13
+ const auth_2 = require('../../../../lib/api-clients/auth');
14
+ const AuthLayout_1 = require('../../../../components/AuthLayout');
16
15
  function ResetPassword() {
17
- const [status, setStatus] = (0, react_1.useState)('idle');
18
- const [message, setMessage] = (0, react_1.useState)('');
19
- const params = (0, navigation_1.useParams)();
20
- const router = (0, navigation_1.useRouter)();
21
- const form = (0, react_hook_form_1.useForm)({
22
- resolver: (0, zod_1.zodResolver)(auth_1.passwordResetSchema),
23
- defaultValues: {
24
- password: "",
25
- confirmPassword: "",
26
- },
27
- });
28
- const onSubmit = async (data) => {
29
- setStatus('loading');
30
- try {
31
- const response = await auth_2.authApi.resetPassword({
32
- token: params.token,
33
- password: data.password,
34
- confirmPassword: data.confirmPassword,
35
- });
36
- if (response.success) {
37
- setStatus('success');
38
- setMessage('Password reset successfully!');
39
- setTimeout(() => {
40
- router.push('/login');
41
- }, 3000);
42
- }
43
- else {
44
- setStatus('error');
45
- setMessage(response.error || 'Failed to reset password. The link may be invalid or expired.');
46
- }
47
- }
48
- catch (error) {
49
- setStatus('error');
50
- setMessage('An error occurred. Please try again.');
51
- form.setError('password', { message: error });
52
- }
53
- };
54
- return (<AuthLayout_1.AuthLayout title="Reset Password">
16
+ const [status, setStatus] = (0, react_1.useState)('idle');
17
+ const [message, setMessage] = (0, react_1.useState)('');
18
+ const params = (0, navigation_1.useParams)();
19
+ const router = (0, navigation_1.useRouter)();
20
+ const form = (0, react_hook_form_1.useForm)({
21
+ resolver: (0, zod_1.zodResolver)(auth_1.passwordResetSchema),
22
+ defaultValues: {
23
+ password: '',
24
+ confirmPassword: '',
25
+ },
26
+ });
27
+ const onSubmit = async (data) => {
28
+ setStatus('loading');
29
+ try {
30
+ const response = await auth_2.authApi.resetPassword({
31
+ token: params.token,
32
+ password: data.password,
33
+ confirmPassword: data.confirmPassword,
34
+ });
35
+ if (response.success) {
36
+ setStatus('success');
37
+ setMessage('Password reset successfully!');
38
+ setTimeout(() => {
39
+ router.push('/login');
40
+ }, 3000);
41
+ } else {
42
+ setStatus('error');
43
+ setMessage(
44
+ response.error || 'Failed to reset password. The link may be invalid or expired.',
45
+ );
46
+ }
47
+ } catch (error) {
48
+ setStatus('error');
49
+ setMessage('An error occurred. Please try again.');
50
+ form.setError('password', { message: error });
51
+ }
52
+ };
53
+ return (
54
+ <AuthLayout_1.AuthLayout title="Reset Password">
55
55
  <form_1.Form {...form}>
56
56
  <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
57
- <form_1.FormField control={form.control} name="password" render={({ field }) => (<form_1.FormItem>
57
+ <form_1.FormField
58
+ control={form.control}
59
+ name="password"
60
+ render={({ field }) => (
61
+ <form_1.FormItem>
58
62
  <form_1.FormLabel>New Password</form_1.FormLabel>
59
63
  <form_1.FormControl>
60
- <input_1.Input type="password" {...field}/>
64
+ <input_1.Input type="password" {...field} />
61
65
  </form_1.FormControl>
62
66
  <form_1.FormMessage />
63
- </form_1.FormItem>)}/>
67
+ </form_1.FormItem>
68
+ )}
69
+ />
64
70
 
65
- <form_1.FormField control={form.control} name="confirmPassword" render={({ field }) => (<form_1.FormItem>
71
+ <form_1.FormField
72
+ control={form.control}
73
+ name="confirmPassword"
74
+ render={({ field }) => (
75
+ <form_1.FormItem>
66
76
  <form_1.FormLabel>Confirm Password</form_1.FormLabel>
67
77
  <form_1.FormControl>
68
- <input_1.Input type="password" {...field}/>
78
+ <input_1.Input type="password" {...field} />
69
79
  </form_1.FormControl>
70
80
  <form_1.FormMessage />
71
- </form_1.FormItem>)}/>
81
+ </form_1.FormItem>
82
+ )}
83
+ />
72
84
 
73
85
  <button_1.Button type="submit" disabled={status === 'loading'} className="w-full">
74
86
  {status === 'loading' ? 'Resetting...' : 'Reset Password'}
@@ -76,11 +88,12 @@ function ResetPassword() {
76
88
  </form>
77
89
  </form_1.Form>
78
90
 
79
- {status !== 'idle' && (<alert_1.Alert variant={status === 'success' ? 'default' : 'destructive'} className="mt-6">
80
- <alert_1.AlertTitle>
81
- {status === 'success' ? 'Success' : 'Error'}
82
- </alert_1.AlertTitle>
91
+ {status !== 'idle' && (
92
+ <alert_1.Alert variant={status === 'success' ? 'default' : 'destructive'} className="mt-6">
93
+ <alert_1.AlertTitle>{status === 'success' ? 'Success' : 'Error'}</alert_1.AlertTitle>
83
94
  <alert_1.AlertDescription>{message}</alert_1.AlertDescription>
84
- </alert_1.Alert>)}
85
- </AuthLayout_1.AuthLayout>);
95
+ </alert_1.Alert>
96
+ )}
97
+ </AuthLayout_1.AuthLayout>
98
+ );
86
99
  }
@@ -1 +1 @@
1
- export default function SignUpPage(): import("react").JSX.Element;
1
+ export default function SignUpPage(): import('react').JSX.Element;
@@ -1,90 +1,113 @@
1
- "use strict";
2
1
  'use client';
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
2
+ var __importDefault =
3
+ (this && this.__importDefault) || ((mod) => (mod && mod.__esModule ? mod : { default: mod }));
4
+ Object.defineProperty(exports, '__esModule', { value: true });
7
5
  exports.default = SignUpPage;
8
- const react_1 = require("react");
9
- const navigation_1 = require("next/navigation");
10
- const link_1 = __importDefault(require("next/link"));
11
- const zod_1 = require("@hookform/resolvers/zod");
12
- const react_hook_form_1 = require("react-hook-form");
13
- const button_1 = require("../../../components/ui/button");
14
- const input_1 = require("../../../components/ui/input");
15
- const alert_1 = require("../../../components/ui/alert");
16
- const form_1 = require("../../../components/ui/form");
17
- const auth_1 = require("../../../lib/schemas/auth");
18
- const auth_2 = require("../../../lib/api-clients/auth");
19
- const AuthLayout_1 = require("../../../components/AuthLayout");
6
+ const react_1 = require('react');
7
+ const navigation_1 = require('next/navigation');
8
+ const link_1 = __importDefault(require('next/link'));
9
+ const zod_1 = require('@hookform/resolvers/zod');
10
+ const react_hook_form_1 = require('react-hook-form');
11
+ const button_1 = require('../../../components/ui/button');
12
+ const input_1 = require('../../../components/ui/input');
13
+ const alert_1 = require('../../../components/ui/alert');
14
+ const form_1 = require('../../../components/ui/form');
15
+ const auth_1 = require('../../../lib/schemas/auth');
16
+ const auth_2 = require('../../../lib/api-clients/auth');
17
+ const AuthLayout_1 = require('../../../components/AuthLayout');
20
18
  function SignUpPage() {
21
- const router = (0, navigation_1.useRouter)();
22
- const [error, setError] = (0, react_1.useState)('');
23
- const [loading, setLoading] = (0, react_1.useState)(false);
24
- const form = (0, react_hook_form_1.useForm)({
25
- resolver: (0, zod_1.zodResolver)(auth_1.signupSchema),
26
- defaultValues: {
27
- firstName: "",
28
- lastName: "",
29
- email: "",
30
- password: "",
31
- },
32
- });
33
- async function onSubmit(data) {
34
- setError('');
35
- setLoading(true);
36
- try {
37
- const response = await auth_2.authApi.signup(data);
38
- if (!response.success) {
39
- throw new Error(response.error || 'Registration failed');
40
- }
41
- router.push('/auth/verify-email-sent');
42
- }
43
- catch (err) {
44
- setError(err instanceof Error ? err.message : 'Registration failed');
45
- }
46
- finally {
47
- setLoading(false);
48
- }
19
+ const router = (0, navigation_1.useRouter)();
20
+ const [error, setError] = (0, react_1.useState)('');
21
+ const [loading, setLoading] = (0, react_1.useState)(false);
22
+ const form = (0, react_hook_form_1.useForm)({
23
+ resolver: (0, zod_1.zodResolver)(auth_1.signupSchema),
24
+ defaultValues: {
25
+ firstName: '',
26
+ lastName: '',
27
+ email: '',
28
+ password: '',
29
+ },
30
+ });
31
+ async function onSubmit(data) {
32
+ setError('');
33
+ setLoading(true);
34
+ try {
35
+ const response = await auth_2.authApi.signup(data);
36
+ if (!response.success) {
37
+ throw new Error(response.error || 'Registration failed');
38
+ }
39
+ router.push('/auth/verify-email-sent');
40
+ } catch (err) {
41
+ setError(err instanceof Error ? err.message : 'Registration failed');
42
+ } finally {
43
+ setLoading(false);
49
44
  }
50
- return (<AuthLayout_1.AuthLayout title="Create Account">
51
- {error && (<alert_1.Alert variant="destructive" className="mb-4">
52
- <alert_1.AlertDescription>{error}</alert_1.AlertDescription>
53
- </alert_1.Alert>)}
54
-
45
+ }
46
+ return (
47
+ <AuthLayout_1.AuthLayout title="Create Account">
48
+ {error && (
49
+ <alert_1.Alert variant="destructive" className="mb-4">
50
+ <alert_1.AlertDescription>{error}</alert_1.AlertDescription>
51
+ </alert_1.Alert>
52
+ )}
53
+
55
54
  <form_1.Form {...form}>
56
55
  <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
57
- <form_1.FormField control={form.control} name="firstName" render={({ field }) => (<form_1.FormItem>
56
+ <form_1.FormField
57
+ control={form.control}
58
+ name="firstName"
59
+ render={({ field }) => (
60
+ <form_1.FormItem>
58
61
  <form_1.FormLabel>First Name</form_1.FormLabel>
59
62
  <form_1.FormControl>
60
- <input_1.Input {...field}/>
63
+ <input_1.Input {...field} />
61
64
  </form_1.FormControl>
62
65
  <form_1.FormMessage />
63
- </form_1.FormItem>)}/>
66
+ </form_1.FormItem>
67
+ )}
68
+ />
64
69
 
65
- <form_1.FormField control={form.control} name="lastName" render={({ field }) => (<form_1.FormItem>
70
+ <form_1.FormField
71
+ control={form.control}
72
+ name="lastName"
73
+ render={({ field }) => (
74
+ <form_1.FormItem>
66
75
  <form_1.FormLabel>Last Name</form_1.FormLabel>
67
76
  <form_1.FormControl>
68
- <input_1.Input {...field}/>
77
+ <input_1.Input {...field} />
69
78
  </form_1.FormControl>
70
79
  <form_1.FormMessage />
71
- </form_1.FormItem>)}/>
80
+ </form_1.FormItem>
81
+ )}
82
+ />
72
83
 
73
- <form_1.FormField control={form.control} name="email" render={({ field }) => (<form_1.FormItem>
84
+ <form_1.FormField
85
+ control={form.control}
86
+ name="email"
87
+ render={({ field }) => (
88
+ <form_1.FormItem>
74
89
  <form_1.FormLabel>Email</form_1.FormLabel>
75
90
  <form_1.FormControl>
76
- <input_1.Input type="email" {...field}/>
91
+ <input_1.Input type="email" {...field} />
77
92
  </form_1.FormControl>
78
93
  <form_1.FormMessage />
79
- </form_1.FormItem>)}/>
94
+ </form_1.FormItem>
95
+ )}
96
+ />
80
97
 
81
- <form_1.FormField control={form.control} name="password" render={({ field }) => (<form_1.FormItem>
98
+ <form_1.FormField
99
+ control={form.control}
100
+ name="password"
101
+ render={({ field }) => (
102
+ <form_1.FormItem>
82
103
  <form_1.FormLabel>Password</form_1.FormLabel>
83
104
  <form_1.FormControl>
84
- <input_1.Input type="password" {...field}/>
105
+ <input_1.Input type="password" {...field} />
85
106
  </form_1.FormControl>
86
107
  <form_1.FormMessage />
87
- </form_1.FormItem>)}/>
108
+ </form_1.FormItem>
109
+ )}
110
+ />
88
111
 
89
112
  <button_1.Button type="submit" className="w-full" disabled={loading}>
90
113
  {loading ? 'Creating account...' : 'Sign Up'}
@@ -98,5 +121,6 @@ function SignUpPage() {
98
121
  Login
99
122
  </link_1.default>
100
123
  </p>
101
- </AuthLayout_1.AuthLayout>);
124
+ </AuthLayout_1.AuthLayout>
125
+ );
102
126
  }
@@ -1 +1 @@
1
- export default function VerifyEmail(): import("react").JSX.Element;
1
+ export default function VerifyEmail(): import('react').JSX.Element;
@@ -1,39 +1,54 @@
1
- "use strict";
2
1
  'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
2
+ Object.defineProperty(exports, '__esModule', { value: true });
4
3
  exports.default = VerifyEmail;
5
- const react_1 = require("react");
6
- const navigation_1 = require("next/navigation");
7
- const alert_1 = require("../../../../components/ui/alert");
8
- const auth_1 = require("../../../../lib/api-clients/auth");
9
- const AuthLayout_1 = require("../../../../components/AuthLayout");
4
+ const react_1 = require('react');
5
+ const navigation_1 = require('next/navigation');
6
+ const alert_1 = require('../../../../components/ui/alert');
7
+ const auth_1 = require('../../../../lib/api-clients/auth');
8
+ const AuthLayout_1 = require('../../../../components/AuthLayout');
10
9
  function VerifyEmail() {
11
- const [status, setStatus] = (0, react_1.useState)('loading');
12
- const params = (0, navigation_1.useParams)();
13
- const router = (0, navigation_1.useRouter)();
14
- (0, react_1.useEffect)(() => {
15
- const verifyEmail = async () => {
16
- try {
17
- const response = await auth_1.authApi.verifyEmail(params.token);
18
- if (response.success) {
19
- setStatus('success');
20
- setTimeout(() => {
21
- router.push('/auth/login');
22
- }, 3000);
23
- }
24
- else {
25
- setStatus('error');
26
- }
27
- }
28
- catch (_error) {
29
- setStatus('error');
30
- }
31
- };
32
- verifyEmail();
33
- }, [params.token, router]);
34
- return (<AuthLayout_1.AuthLayout title="Verify Email">
35
- {status === 'loading' && (<alert_1.Alert variant="default"><alert_1.AlertDescription>Verifying your email address...</alert_1.AlertDescription></alert_1.Alert>)}
36
- {status === 'success' && (<alert_1.Alert variant="default"><alert_1.AlertDescription>Email verified successfully! Redirecting to login...</alert_1.AlertDescription></alert_1.Alert>)}
37
- {status === 'error' && (<alert_1.Alert variant="destructive"><alert_1.AlertDescription>Failed to verify email. The link may be invalid or expired.</alert_1.AlertDescription></alert_1.Alert>)}
38
- </AuthLayout_1.AuthLayout>);
10
+ const [status, setStatus] = (0, react_1.useState)('loading');
11
+ const params = (0, navigation_1.useParams)();
12
+ const router = (0, navigation_1.useRouter)();
13
+ (0, react_1.useEffect)(() => {
14
+ const verifyEmail = async () => {
15
+ try {
16
+ const response = await auth_1.authApi.verifyEmail(params.token);
17
+ if (response.success) {
18
+ setStatus('success');
19
+ setTimeout(() => {
20
+ router.push('/auth/login');
21
+ }, 3000);
22
+ } else {
23
+ setStatus('error');
24
+ }
25
+ } catch (_error) {
26
+ setStatus('error');
27
+ }
28
+ };
29
+ verifyEmail();
30
+ }, [params.token, router]);
31
+ return (
32
+ <AuthLayout_1.AuthLayout title="Verify Email">
33
+ {status === 'loading' && (
34
+ <alert_1.Alert variant="default">
35
+ <alert_1.AlertDescription>Verifying your email address...</alert_1.AlertDescription>
36
+ </alert_1.Alert>
37
+ )}
38
+ {status === 'success' && (
39
+ <alert_1.Alert variant="default">
40
+ <alert_1.AlertDescription>
41
+ Email verified successfully! Redirecting to login...
42
+ </alert_1.AlertDescription>
43
+ </alert_1.Alert>
44
+ )}
45
+ {status === 'error' && (
46
+ <alert_1.Alert variant="destructive">
47
+ <alert_1.AlertDescription>
48
+ Failed to verify email. The link may be invalid or expired.
49
+ </alert_1.AlertDescription>
50
+ </alert_1.Alert>
51
+ )}
52
+ </AuthLayout_1.AuthLayout>
53
+ );
39
54
  }
@@ -1 +1 @@
1
- export default function VerifyEmailSentPage(): import("react").JSX.Element;
1
+ export default function VerifyEmailSentPage(): import('react').JSX.Element;
@@ -1,18 +1,17 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ var __importDefault =
2
+ (this && this.__importDefault) || ((mod) => (mod && mod.__esModule ? mod : { default: mod }));
3
+ Object.defineProperty(exports, '__esModule', { value: true });
6
4
  exports.default = VerifyEmailSentPage;
7
- const link_1 = __importDefault(require("next/link"));
8
- const alert_1 = require("../../../components/ui/alert");
9
- const AuthLayout_1 = require("../../../components/AuthLayout");
5
+ const link_1 = __importDefault(require('next/link'));
6
+ const alert_1 = require('../../../components/ui/alert');
7
+ const AuthLayout_1 = require('../../../components/AuthLayout');
10
8
  function VerifyEmailSentPage() {
11
- return (<AuthLayout_1.AuthLayout title="Check Your Email">
9
+ return (
10
+ <AuthLayout_1.AuthLayout title="Check Your Email">
12
11
  <alert_1.Alert>
13
12
  <alert_1.AlertDescription>
14
- We've sent you a verification link. Please check your inbox and click the
15
- link to activate your account.
13
+ We've sent you a verification link. Please check your inbox and click the link to activate
14
+ your account.
16
15
  </alert_1.AlertDescription>
17
16
  </alert_1.Alert>
18
17
  <p className="text-center text-sm text-gray-600 mt-4">
@@ -25,5 +24,6 @@ function VerifyEmailSentPage() {
25
24
  return to login
26
25
  </link_1.default>
27
26
  </p>
28
- </AuthLayout_1.AuthLayout>);
27
+ </AuthLayout_1.AuthLayout>
28
+ );
29
29
  }
@@ -1,6 +1,8 @@
1
- import type { Metadata } from "next";
2
- import "./globals.css";
1
+ import type { Metadata } from 'next';
2
+ import './globals.css';
3
3
  export declare const metadata: Metadata;
4
- export default function RootLayout({ children, }: Readonly<{
5
- children: React.ReactNode;
6
- }>): import("react").JSX.Element;
4
+ export default function RootLayout({
5
+ children,
6
+ }: Readonly<{
7
+ children: React.ReactNode;
8
+ }>): import('react').JSX.Element;
@@ -1,25 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.metadata = void 0;
4
3
  exports.default = RootLayout;
5
- const google_1 = require("next/font/google");
6
- require("./globals.css");
4
+ const google_1 = require('next/font/google');
5
+ require('./globals.css');
7
6
  const geistSans = (0, google_1.Geist)({
8
- variable: "--font-geist-sans",
9
- subsets: ["latin"],
7
+ variable: '--font-geist-sans',
8
+ subsets: ['latin'],
10
9
  });
11
10
  const geistMono = (0, google_1.Geist_Mono)({
12
- variable: "--font-geist-mono",
13
- subsets: ["latin"],
11
+ variable: '--font-geist-mono',
12
+ subsets: ['latin'],
14
13
  });
15
14
  exports.metadata = {
16
- title: "Create Next App",
17
- description: "Generated by create next app",
15
+ title: 'Create Next App',
16
+ description: 'Generated by create next app',
18
17
  };
19
- function RootLayout({ children, }) {
20
- return (<html lang="en">
21
- <body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
22
- {children}
23
- </body>
24
- </html>);
18
+ function RootLayout({ children }) {
19
+ return (
20
+ <html lang="en">
21
+ <body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>{children}</body>
22
+ </html>
23
+ );
25
24
  }
@@ -1 +1 @@
1
- export default function Home(): import("react").JSX.Element;
1
+ export default function Home(): import('react').JSX.Element;