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,65 +1,99 @@
1
- import * as z from "zod";
2
- export declare const loginSchema: z.ZodObject<{
1
+ import type * as z from 'zod';
2
+ export declare const loginSchema: z.ZodObject<
3
+ {
3
4
  email: z.ZodString;
4
5
  password: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
+ },
7
+ 'strip',
8
+ z.ZodTypeAny,
9
+ {
6
10
  email: string;
7
11
  password: string;
8
- }, {
12
+ },
13
+ {
9
14
  email: string;
10
15
  password: string;
11
- }>;
12
- export declare const signupSchema: z.ZodObject<{
16
+ }
17
+ >;
18
+ export declare const signupSchema: z.ZodObject<
19
+ {
13
20
  firstName: z.ZodString;
14
21
  lastName: z.ZodString;
15
22
  email: z.ZodString;
16
23
  password: z.ZodString;
17
- }, "strip", z.ZodTypeAny, {
24
+ },
25
+ 'strip',
26
+ z.ZodTypeAny,
27
+ {
18
28
  email: string;
19
29
  password: string;
20
30
  firstName: string;
21
31
  lastName: string;
22
- }, {
32
+ },
33
+ {
23
34
  email: string;
24
35
  password: string;
25
36
  firstName: string;
26
37
  lastName: string;
27
- }>;
28
- export declare const passwordResetSchema: z.ZodEffects<z.ZodObject<{
29
- token: z.ZodString;
30
- password: z.ZodString;
31
- confirmPassword: z.ZodString;
32
- }, "strip", z.ZodTypeAny, {
33
- password: string;
34
- token: string;
35
- confirmPassword: string;
36
- }, {
37
- password: string;
38
- token: string;
39
- confirmPassword: string;
40
- }>, {
38
+ }
39
+ >;
40
+ export declare const passwordResetSchema: z.ZodEffects<
41
+ z.ZodObject<
42
+ {
43
+ token: z.ZodString;
44
+ password: z.ZodString;
45
+ confirmPassword: z.ZodString;
46
+ },
47
+ 'strip',
48
+ z.ZodTypeAny,
49
+ {
50
+ password: string;
51
+ token: string;
52
+ confirmPassword: string;
53
+ },
54
+ {
55
+ password: string;
56
+ token: string;
57
+ confirmPassword: string;
58
+ }
59
+ >,
60
+ {
41
61
  password: string;
42
62
  token: string;
43
63
  confirmPassword: string;
44
- }, {
64
+ },
65
+ {
45
66
  password: string;
46
67
  token: string;
47
68
  confirmPassword: string;
48
- }>;
49
- export declare const verifyEmailSchema: z.ZodObject<{
69
+ }
70
+ >;
71
+ export declare const verifyEmailSchema: z.ZodObject<
72
+ {
50
73
  token: z.ZodString;
51
- }, "strip", z.ZodTypeAny, {
74
+ },
75
+ 'strip',
76
+ z.ZodTypeAny,
77
+ {
52
78
  token: string;
53
- }, {
79
+ },
80
+ {
54
81
  token: string;
55
- }>;
56
- export declare const forgotPasswordSchema: z.ZodObject<{
82
+ }
83
+ >;
84
+ export declare const forgotPasswordSchema: z.ZodObject<
85
+ {
57
86
  email: z.ZodString;
58
- }, "strip", z.ZodTypeAny, {
87
+ },
88
+ 'strip',
89
+ z.ZodTypeAny,
90
+ {
59
91
  email: string;
60
- }, {
92
+ },
93
+ {
61
94
  email: string;
62
- }>;
95
+ }
96
+ >;
63
97
  export type LoginValues = z.infer<typeof loginSchema>;
64
98
  export type SignupValues = z.infer<typeof signupSchema>;
65
99
  export type PasswordResetValues = z.infer<typeof passwordResetSchema>;
@@ -1,67 +1,87 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
1
+ var __createBinding =
2
+ (this && this.__createBinding) ||
3
+ (Object.create
4
+ ? (o, m, k, k2) => {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: () => m[k] };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }
12
+ : (o, m, k, k2) => {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ });
16
+ var __setModuleDefault =
17
+ (this && this.__setModuleDefault) ||
18
+ (Object.create
19
+ ? (o, v) => {
20
+ Object.defineProperty(o, 'default', { enumerable: true, value: v });
21
+ }
22
+ : (o, v) => {
23
+ o['default'] = v;
24
+ });
25
+ var __importStar =
26
+ (this && this.__importStar) ||
27
+ (() => {
28
+ var ownKeys = (o) => {
29
+ ownKeys =
30
+ Object.getOwnPropertyNames ||
31
+ ((o) => {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ });
36
+ return ownKeys(o);
26
37
  };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
38
+ return (mod) => {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null)
42
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++)
43
+ if (k[i] !== 'default') __createBinding(result, mod, k[i]);
44
+ __setModuleDefault(result, mod);
45
+ return result;
33
46
  };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.forgotPasswordSchema = exports.verifyEmailSchema = exports.passwordResetSchema = exports.signupSchema = exports.loginSchema = void 0;
37
- const z = __importStar(require("zod"));
47
+ })();
48
+ Object.defineProperty(exports, '__esModule', { value: true });
49
+ exports.forgotPasswordSchema =
50
+ exports.verifyEmailSchema =
51
+ exports.passwordResetSchema =
52
+ exports.signupSchema =
53
+ exports.loginSchema =
54
+ void 0;
55
+ const z = __importStar(require('zod'));
38
56
  exports.loginSchema = z.object({
39
- email: z.string().email("Please enter a valid email address"),
40
- password: z.string().min(1, "Password is required"),
57
+ email: z.string().email('Please enter a valid email address'),
58
+ password: z.string().min(1, 'Password is required'),
41
59
  });
42
60
  exports.signupSchema = z.object({
43
- firstName: z.string().min(2, "First name must be at least 2 characters"),
44
- lastName: z.string().min(2, "Last name must be at least 2 characters"),
45
- email: z.string().email("Please enter a valid email address"),
46
- password: z
47
- .string()
48
- .min(8, "Password must be at least 8 characters")
49
- .max(100, "Password is too long")
61
+ firstName: z.string().min(2, 'First name must be at least 2 characters'),
62
+ lastName: z.string().min(2, 'Last name must be at least 2 characters'),
63
+ email: z.string().email('Please enter a valid email address'),
64
+ password: z
65
+ .string()
66
+ .min(8, 'Password must be at least 8 characters')
67
+ .max(100, 'Password is too long'),
50
68
  });
51
- exports.passwordResetSchema = z.object({
69
+ exports.passwordResetSchema = z
70
+ .object({
52
71
  token: z.string(),
53
72
  password: z
54
- .string()
55
- .min(8, "Password must be at least 8 characters")
56
- .max(100, "Password is too long"),
57
- confirmPassword: z.string()
58
- }).refine((data) => data.password === data.confirmPassword, {
73
+ .string()
74
+ .min(8, 'Password must be at least 8 characters')
75
+ .max(100, 'Password is too long'),
76
+ confirmPassword: z.string(),
77
+ })
78
+ .refine((data) => data.password === data.confirmPassword, {
59
79
  message: "Passwords don't match",
60
- path: ["confirmPassword"],
61
- });
80
+ path: ['confirmPassword'],
81
+ });
62
82
  exports.verifyEmailSchema = z.object({
63
- token: z.string(),
83
+ token: z.string(),
64
84
  });
65
85
  exports.forgotPasswordSchema = z.object({
66
- email: z.string().email("Please enter a valid email address"),
86
+ email: z.string().email('Please enter a valid email address'),
67
87
  });
@@ -1,21 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.hashPassword = hashPassword;
4
3
  exports.verifyPassword = verifyPassword;
5
4
  exports.generateToken = generateToken;
6
5
  exports.verifyToken = verifyToken;
7
- const bcryptjs_1 = require("bcryptjs");
8
- const jsonwebtoken_1 = require("jsonwebtoken");
6
+ const bcryptjs_1 = require('bcryptjs');
7
+ const jsonwebtoken_1 = require('jsonwebtoken');
9
8
  const JWT_SECRET = process.env.JWT_SECRET || 'your-secret-key';
10
9
  async function hashPassword(password) {
11
- return (0, bcryptjs_1.hash)(password, 12);
10
+ return (0, bcryptjs_1.hash)(password, 12);
12
11
  }
13
12
  async function verifyPassword(password, hashedPassword) {
14
- return (0, bcryptjs_1.compare)(password, hashedPassword);
13
+ return (0, bcryptjs_1.compare)(password, hashedPassword);
15
14
  }
16
15
  function generateToken(payload, expiresIn = '1d') {
17
- return (0, jsonwebtoken_1.sign)(payload, JWT_SECRET, { expiresIn });
16
+ return (0, jsonwebtoken_1.sign)(payload, JWT_SECRET, { expiresIn });
18
17
  }
19
18
  function verifyToken(token) {
20
- return (0, jsonwebtoken_1.verify)(token, JWT_SECRET);
19
+ return (0, jsonwebtoken_1.verify)(token, JWT_SECRET);
21
20
  }
@@ -1,4 +1,14 @@
1
- export declare function getNotificationServiceWithQueue(): Promise<import("vintasend/src/services/notification-service").NotificationService<{
2
- readonly forgotPassword: import("../../app/api/auth/forgot-password/forgot-password-notification-context").ForgotPasswordContextGenerator;
3
- readonly emailVerification: import("../../app/api/auth/signup/email-verification-notification-context").EmailVerificationNotificationContextGenerator;
4
- }, number, number>>;
1
+ export declare function getNotificationServiceWithQueue(): Promise<
2
+ import('vintasend/src/services/notification-service').NotificationService<
3
+ {
4
+ readonly forgotPassword: import(
5
+ '../../app/api/auth/forgot-password/forgot-password-notification-context',
6
+ ).ForgotPasswordContextGenerator;
7
+ readonly emailVerification: import(
8
+ '../../app/api/auth/signup/email-verification-notification-context',
9
+ ).EmailVerificationNotificationContextGenerator;
10
+ },
11
+ number,
12
+ number
13
+ >
14
+ >;
@@ -1,13 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.getNotificationServiceWithQueue = getNotificationServiceWithQueue;
4
- const notifications_1 = require("./notifications");
5
- const temporal_queue_service_1 = require("./temporal-queue-service");
6
- const constants_1 = require("../../workers/notifications/constants");
7
- const temporal_1 = require("../temporal");
3
+ const notifications_1 = require('./notifications');
4
+ const temporal_queue_service_1 = require('./temporal-queue-service');
5
+ const constants_1 = require('../../workers/notifications/constants');
6
+ const temporal_1 = require('../temporal');
8
7
  async function getNotificationServiceWithQueue() {
9
- const notificationService = (0, notifications_1.getNotificationService)();
10
- const temporalClient = await (0, temporal_1.getTemporalClient)();
11
- notificationService.registerQueueService(new temporal_queue_service_1.TemporalQueueService(temporalClient, constants_1.NOTIFICATIONS_QUEUE));
12
- return notificationService;
8
+ const notificationService = (0, notifications_1.getNotificationService)();
9
+ const temporalClient = await (0, temporal_1.getTemporalClient)();
10
+ notificationService.registerQueueService(
11
+ new temporal_queue_service_1.TemporalQueueService(
12
+ temporalClient,
13
+ constants_1.NOTIFICATIONS_QUEUE,
14
+ ),
15
+ );
16
+ return notificationService;
13
17
  }
@@ -1,12 +1,16 @@
1
- import { NotificationService } from 'vintasend/src/services/notification-service';
2
- import { ForgotPasswordContextGenerator } from '../../app/api/auth/forgot-password/forgot-password-notification-context';
3
- import { EmailVerificationNotificationContextGenerator } from '../../app/api/auth/signup/email-verification-notification-context';
1
+ import type { NotificationService } from 'vintasend/src/services/notification-service';
2
+ import type { ForgotPasswordContextGenerator } from '../../app/api/auth/forgot-password/forgot-password-notification-context';
3
+ import type { EmailVerificationNotificationContextGenerator } from '../../app/api/auth/signup/email-verification-notification-context';
4
4
  export declare const contextGeneratorsMap: {
5
- readonly forgotPassword: ForgotPasswordContextGenerator;
6
- readonly emailVerification: EmailVerificationNotificationContextGenerator;
5
+ readonly forgotPassword: ForgotPasswordContextGenerator;
6
+ readonly emailVerification: EmailVerificationNotificationContextGenerator;
7
7
  };
8
8
  export type ContextMap = typeof contextGeneratorsMap;
9
- export declare function getNotificationService(): NotificationService<{
9
+ export declare function getNotificationService(): NotificationService<
10
+ {
10
11
  readonly forgotPassword: ForgotPasswordContextGenerator;
11
12
  readonly emailVerification: EmailVerificationNotificationContextGenerator;
12
- }, number, number>;
13
+ },
14
+ number,
15
+ number
16
+ >;
@@ -1,32 +1,45 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.contextGeneratorsMap = void 0;
4
3
  exports.getNotificationService = getNotificationService;
5
- const client_1 = require("@prisma/client");
6
- const notification_service_1 = require("vintasend/src/services/notification-service");
7
- const notification_context_registry_1 = require("vintasend/src/services/notification-context-registry");
8
- const prisma_notification_backend_1 = require("vintasend-prisma/prisma-notification-backend");
9
- const pug_email_template_renderer_1 = require("vintasend-pug/pug-email-template-renderer");
10
- const vintasend_nodemailer_1 = require("vintasend-nodemailer");
11
- const winston_logger_1 = require("vintasend-winston/winston-logger");
12
- const forgot_password_notification_context_1 = require("../../app/api/auth/forgot-password/forgot-password-notification-context");
13
- const email_verification_notification_context_1 = require("../../app/api/auth/signup/email-verification-notification-context");
14
- const logger_js_1 = require("../logger.js");
4
+ const client_1 = require('@prisma/client');
5
+ const notification_service_1 = require('vintasend/src/services/notification-service');
6
+ const notification_context_registry_1 = require('vintasend/src/services/notification-context-registry');
7
+ const prisma_notification_backend_1 = require('vintasend-prisma/prisma-notification-backend');
8
+ const pug_email_template_renderer_1 = require('vintasend-pug/pug-email-template-renderer');
9
+ const vintasend_nodemailer_1 = require('vintasend-nodemailer');
10
+ const winston_logger_1 = require('vintasend-winston/winston-logger');
11
+ const forgot_password_notification_context_1 = require('../../app/api/auth/forgot-password/forgot-password-notification-context');
12
+ const email_verification_notification_context_1 = require('../../app/api/auth/signup/email-verification-notification-context');
13
+ const logger_js_1 = require('../logger.js');
15
14
  exports.contextGeneratorsMap = {
16
- forgotPassword: new forgot_password_notification_context_1.ForgotPasswordContextGenerator(),
17
- emailVerification: new email_verification_notification_context_1.EmailVerificationNotificationContextGenerator(),
15
+ forgotPassword: new forgot_password_notification_context_1.ForgotPasswordContextGenerator(),
16
+ emailVerification:
17
+ new email_verification_notification_context_1.EmailVerificationNotificationContextGenerator(),
18
18
  };
19
19
  function getNotificationService() {
20
- const prisma = new client_1.PrismaClient();
21
- const notificationBackend = new prisma_notification_backend_1.PrismaNotificationBackend(prisma);
22
- return new notification_service_1.NotificationService([new vintasend_nodemailer_1.NodemailerNotificationAdapter(new pug_email_template_renderer_1.PugEmailTemplateRenderer(), notificationBackend, true, {
23
- host: process.env.SMTP_HOST,
24
- port: process.env.SMTP_PORT || 587,
25
- secure: false, // true for port 465, false for other ports
26
- auth: {
27
- user: process.env.SMTP_USER,
28
- pass: process.env.SMTP_PASSWORD,
29
- },
30
- })], notificationBackend, new winston_logger_1.WinstonLogger(logger_js_1.loggerOptions));
20
+ const prisma = new client_1.PrismaClient();
21
+ const notificationBackend = new prisma_notification_backend_1.PrismaNotificationBackend(prisma);
22
+ return new notification_service_1.NotificationService(
23
+ [
24
+ new vintasend_nodemailer_1.NodemailerNotificationAdapter(
25
+ new pug_email_template_renderer_1.PugEmailTemplateRenderer(),
26
+ notificationBackend,
27
+ true,
28
+ {
29
+ host: process.env.SMTP_HOST,
30
+ port: process.env.SMTP_PORT || 587,
31
+ secure: false, // true for port 465, false for other ports
32
+ auth: {
33
+ user: process.env.SMTP_USER,
34
+ pass: process.env.SMTP_PASSWORD,
35
+ },
36
+ },
37
+ ),
38
+ ],
39
+ notificationBackend,
40
+ new winston_logger_1.WinstonLogger(logger_js_1.loggerOptions),
41
+ );
31
42
  }
32
- notification_context_registry_1.NotificationContextRegistry.initialize(exports.contextGeneratorsMap);
43
+ notification_context_registry_1.NotificationContextRegistry.initialize(
44
+ exports.contextGeneratorsMap,
45
+ );
@@ -1,11 +1,14 @@
1
1
  import type { Client } from '@temporalio/client';
2
- import type { BaseNotificationQueueService } from "vintasend/src/services/notification-queue-service/base-notification-queue-service";
2
+ import type { BaseNotificationQueueService } from 'vintasend/src/services/notification-queue-service/base-notification-queue-service';
3
3
  import type { getNotificationService } from './notifications';
4
- type NotificationIdType = Parameters<ReturnType<typeof getNotificationService>['getNotification']>[0];
5
- export declare class TemporalQueueService implements BaseNotificationQueueService<NotificationIdType> {
6
- private client;
7
- private taskQueue;
8
- constructor(client: Client, taskQueue: string);
9
- enqueueNotification(notificationId: NotificationIdType): Promise<void>;
4
+ type NotificationIdType = Parameters<
5
+ ReturnType<typeof getNotificationService>['getNotification']
6
+ >[0];
7
+ export declare class TemporalQueueService
8
+ implements BaseNotificationQueueService<NotificationIdType>
9
+ {
10
+ private client;
11
+ private taskQueue;
12
+ constructor(client: Client, taskQueue: string);
13
+ enqueueNotification(notificationId: NotificationIdType): Promise<void>;
10
14
  }
11
- export {};
@@ -1,19 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.TemporalQueueService = void 0;
4
- const workflows_1 = require("../../workers/notifications/workflows");
3
+ const workflows_1 = require('../../workers/notifications/workflows');
5
4
  class TemporalQueueService {
6
- constructor(client, taskQueue) {
7
- this.client = client;
8
- this.taskQueue = taskQueue;
9
- }
10
- async enqueueNotification(notificationId) {
11
- await this.client.workflow.start(workflows_1.sendNotificationWorkflow, {
12
- taskQueue: this.taskQueue,
13
- workflowId: `sendNotification-${notificationId}`,
14
- args: [notificationId],
15
- });
16
- await this.client.connection.close();
17
- }
5
+ constructor(client, taskQueue) {
6
+ this.client = client;
7
+ this.taskQueue = taskQueue;
8
+ }
9
+ async enqueueNotification(notificationId) {
10
+ await this.client.workflow.start(workflows_1.sendNotificationWorkflow, {
11
+ taskQueue: this.taskQueue,
12
+ workflowId: `sendNotification-${notificationId}`,
13
+ args: [notificationId],
14
+ });
15
+ await this.client.connection.close();
16
+ }
18
17
  }
19
18
  exports.TemporalQueueService = TemporalQueueService;
@@ -1,2 +1,2 @@
1
- import { Client } from '@temporalio/client';
1
+ import type { Client } from '@temporalio/client';
2
2
  export declare function getTemporalClient(): Promise<Client>;
@@ -1,14 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.getTemporalClient = getTemporalClient;
4
- const client_1 = require("@temporalio/client");
5
- const config_1 = require("../workers/notifications/config");
3
+ const client_1 = require('@temporalio/client');
4
+ const config_1 = require('../workers/notifications/config');
6
5
  let connection = null;
7
6
  async function getTemporalClient() {
8
- if (!connection) {
9
- connection = await client_1.Connection.connect(config_1.CONNECTION_CONFIG);
10
- }
11
- return new client_1.Client({
12
- connection,
13
- });
7
+ if (!connection) {
8
+ connection = await client_1.Connection.connect(config_1.CONNECTION_CONFIG);
9
+ }
10
+ return new client_1.Client({
11
+ connection,
12
+ });
14
13
  }
@@ -1,2 +1,2 @@
1
- import { type ClassValue } from "clsx";
1
+ import type { ClassValue } from 'clsx';
2
2
  export declare function cn(...inputs: ClassValue[]): string;
@@ -1,8 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.cn = cn;
4
- const clsx_1 = require("clsx");
5
- const tailwind_merge_1 = require("tailwind-merge");
3
+ const clsx_1 = require('clsx');
4
+ const tailwind_merge_1 = require('tailwind-merge');
6
5
  function cn(...inputs) {
7
- return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
6
+ return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
8
7
  }
@@ -1,10 +1,11 @@
1
- import { getNotificationService } from '../../lib/services/notifications';
2
- type NotificationIdType = Parameters<ReturnType<typeof getNotificationService>['getNotification']>[0];
1
+ import type { getNotificationService } from '../../lib/services/notifications';
2
+ type NotificationIdType = Parameters<
3
+ ReturnType<typeof getNotificationService>['getNotification']
4
+ >[0];
3
5
  export declare function sendNotification(notificationId: NotificationIdType): Promise<void>;
4
6
  export declare const getAllPendingNotifications: () => Promise<NotificationIdType[]>;
5
7
  export declare const emailActivities: {
6
- sendNotification: typeof sendNotification;
7
- getAllPendingNotifications: () => Promise<NotificationIdType[]>;
8
+ sendNotification: typeof sendNotification;
9
+ getAllPendingNotifications: () => Promise<NotificationIdType[]>;
8
10
  };
9
11
  export type EmailActivities = typeof emailActivities;
10
- export {};
@@ -1,24 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.emailActivities = exports.getAllPendingNotifications = void 0;
4
3
  exports.sendNotification = sendNotification;
5
- const notifications_1 = require("../../lib/services/notifications");
4
+ const notifications_1 = require('../../lib/services/notifications');
6
5
  async function sendNotification(notificationId) {
7
- const notificationService = (0, notifications_1.getNotificationService)();
8
- if (!notificationId) {
9
- throw new Error("Notification ID is required");
10
- }
11
- await notificationService.delayedSend(notificationId);
6
+ const notificationService = (0, notifications_1.getNotificationService)();
7
+ if (!notificationId) {
8
+ throw new Error('Notification ID is required');
9
+ }
10
+ await notificationService.delayedSend(notificationId);
12
11
  }
13
- ;
14
12
  const getAllPendingNotifications = async () => {
15
- const notificationServices = (0, notifications_1.getNotificationService)();
16
- const pendingNotifications = await notificationServices.getPendingNotifications();
17
- return pendingNotifications.map((notification) => notification.id).filter((nid) => nid !== undefined);
13
+ const notificationServices = (0, notifications_1.getNotificationService)();
14
+ const pendingNotifications = await notificationServices.getPendingNotifications();
15
+ return pendingNotifications
16
+ .map((notification) => notification.id)
17
+ .filter((nid) => nid !== undefined);
18
18
  };
19
19
  exports.getAllPendingNotifications = getAllPendingNotifications;
20
20
  // Export as an object for Temporal activity registration
21
21
  exports.emailActivities = {
22
- sendNotification,
23
- getAllPendingNotifications: exports.getAllPendingNotifications,
22
+ sendNotification,
23
+ getAllPendingNotifications: exports.getAllPendingNotifications,
24
24
  };
@@ -1,4 +1,4 @@
1
1
  export declare const TEMPORAL_ADDRESS: string;
2
2
  export declare const CONNECTION_CONFIG: {
3
- address: string;
3
+ address: string;
4
4
  };
@@ -1,7 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.CONNECTION_CONFIG = exports.TEMPORAL_ADDRESS = void 0;
4
3
  exports.TEMPORAL_ADDRESS = process.env.TEMPORAL_ADDRESS || 'localhost:7233';
5
4
  exports.CONNECTION_CONFIG = {
6
- address: exports.TEMPORAL_ADDRESS,
5
+ address: exports.TEMPORAL_ADDRESS,
7
6
  };