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 +1 @@
1
- export declare const NOTIFICATIONS_QUEUE = "NOTIFICATIONS_QUEUE";
1
+ export declare const NOTIFICATIONS_QUEUE = 'NOTIFICATIONS_QUEUE';
@@ -1,4 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.NOTIFICATIONS_QUEUE = void 0;
4
3
  exports.NOTIFICATIONS_QUEUE = 'NOTIFICATIONS_QUEUE';
@@ -1,25 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const worker_1 = require("@temporalio/worker");
4
- const activities_js_1 = require("./activities.js");
5
- const constants_js_1 = require("./constants.js");
6
- const config_js_1 = require("./config.js");
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ const worker_1 = require('@temporalio/worker');
3
+ const activities_js_1 = require('./activities.js');
4
+ const constants_js_1 = require('./constants.js');
5
+ const config_js_1 = require('./config.js');
7
6
  async function runWorker() {
8
- const connection = await worker_1.NativeConnection.connect(config_js_1.CONNECTION_CONFIG);
9
- try {
10
- const worker = await worker_1.Worker.create({
11
- workflowsPath: require.resolve('./workflows'),
12
- activities: activities_js_1.emailActivities,
13
- taskQueue: constants_js_1.NOTIFICATIONS_QUEUE,
14
- connection,
15
- });
16
- await worker.run();
17
- }
18
- finally {
19
- connection.close();
20
- }
7
+ const connection = await worker_1.NativeConnection.connect(config_js_1.CONNECTION_CONFIG);
8
+ try {
9
+ const worker = await worker_1.Worker.create({
10
+ workflowsPath: require.resolve('./workflows'),
11
+ activities: activities_js_1.emailActivities,
12
+ taskQueue: constants_js_1.NOTIFICATIONS_QUEUE,
13
+ connection,
14
+ });
15
+ await worker.run();
16
+ } finally {
17
+ connection.close();
18
+ }
21
19
  }
22
- runWorker().catch(err => {
23
- console.error(err);
24
- process.exit(1);
20
+ runWorker().catch((err) => {
21
+ console.error(err);
22
+ process.exit(1);
25
23
  });
@@ -1,5 +1,6 @@
1
1
  import type { getNotificationService } from '../../lib/services/notifications';
2
- type NotificationIdType = Parameters<ReturnType<typeof getNotificationService>['getNotification']>[0];
2
+ type NotificationIdType = Parameters<
3
+ ReturnType<typeof getNotificationService>['getNotification']
4
+ >[0];
3
5
  export declare function sendNotificationWorkflow(notificationId: NotificationIdType): Promise<void>;
4
6
  export declare function sendAllPendingNotificationsWorkflow(): Promise<void>;
5
- export {};
@@ -1,18 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.sendNotificationWorkflow = sendNotificationWorkflow;
4
3
  exports.sendAllPendingNotificationsWorkflow = sendAllPendingNotificationsWorkflow;
5
- const workflow_1 = require("@temporalio/workflow");
4
+ const workflow_1 = require('@temporalio/workflow');
6
5
  // Configure activities with a timeout (adjust as needed)
7
6
  const { sendNotification, getAllPendingNotifications } = (0, workflow_1.proxyActivities)({
8
- startToCloseTimeout: '1 minute',
7
+ startToCloseTimeout: '1 minute',
9
8
  });
10
9
  async function sendNotificationWorkflow(notificationId) {
11
- await sendNotification(notificationId);
10
+ await sendNotification(notificationId);
12
11
  }
13
12
  async function sendAllPendingNotificationsWorkflow() {
14
- const pendingNotificationIds = await getAllPendingNotifications();
15
- await Promise.all(pendingNotificationIds
16
- .filter((notificationId) => notificationId !== undefined)
17
- .map((notificationId) => sendNotification(notificationId)));
13
+ const pendingNotificationIds = await getAllPendingNotifications();
14
+ await Promise.all(
15
+ pendingNotificationIds
16
+ .filter((notificationId) => notificationId !== undefined)
17
+ .map((notificationId) => sendNotification(notificationId)),
18
+ );
18
19
  }
@@ -1,79 +1,79 @@
1
1
  declare const _default: {
2
- darkMode: ["class"];
3
- content: string[];
4
- theme: {
5
- extend: {
6
- colors: {
7
- background: string;
8
- foreground: string;
9
- card: {
10
- DEFAULT: string;
11
- foreground: string;
12
- };
13
- popover: {
14
- DEFAULT: string;
15
- foreground: string;
16
- };
17
- primary: {
18
- DEFAULT: string;
19
- foreground: string;
20
- };
21
- secondary: {
22
- DEFAULT: string;
23
- foreground: string;
24
- };
25
- muted: {
26
- DEFAULT: string;
27
- foreground: string;
28
- };
29
- accent: {
30
- DEFAULT: string;
31
- foreground: string;
32
- };
33
- destructive: {
34
- DEFAULT: string;
35
- foreground: string;
36
- };
37
- border: string;
38
- input: string;
39
- ring: string;
40
- chart: {
41
- '1': string;
42
- '2': string;
43
- '3': string;
44
- '4': string;
45
- '5': string;
46
- };
47
- };
48
- borderRadius: {
49
- lg: string;
50
- md: string;
51
- sm: string;
52
- };
53
- keyframes: {
54
- 'accordion-down': {
55
- from: {
56
- height: string;
57
- };
58
- to: {
59
- height: string;
60
- };
61
- };
62
- 'accordion-up': {
63
- from: {
64
- height: string;
65
- };
66
- to: {
67
- height: string;
68
- };
69
- };
70
- };
71
- animation: {
72
- 'accordion-down': string;
73
- 'accordion-up': string;
74
- };
2
+ darkMode: ['class'];
3
+ content: string[];
4
+ theme: {
5
+ extend: {
6
+ colors: {
7
+ background: string;
8
+ foreground: string;
9
+ card: {
10
+ DEFAULT: string;
11
+ foreground: string;
75
12
  };
13
+ popover: {
14
+ DEFAULT: string;
15
+ foreground: string;
16
+ };
17
+ primary: {
18
+ DEFAULT: string;
19
+ foreground: string;
20
+ };
21
+ secondary: {
22
+ DEFAULT: string;
23
+ foreground: string;
24
+ };
25
+ muted: {
26
+ DEFAULT: string;
27
+ foreground: string;
28
+ };
29
+ accent: {
30
+ DEFAULT: string;
31
+ foreground: string;
32
+ };
33
+ destructive: {
34
+ DEFAULT: string;
35
+ foreground: string;
36
+ };
37
+ border: string;
38
+ input: string;
39
+ ring: string;
40
+ chart: {
41
+ '1': string;
42
+ '2': string;
43
+ '3': string;
44
+ '4': string;
45
+ '5': string;
46
+ };
47
+ };
48
+ borderRadius: {
49
+ lg: string;
50
+ md: string;
51
+ sm: string;
52
+ };
53
+ keyframes: {
54
+ 'accordion-down': {
55
+ from: {
56
+ height: string;
57
+ };
58
+ to: {
59
+ height: string;
60
+ };
61
+ };
62
+ 'accordion-up': {
63
+ from: {
64
+ height: string;
65
+ };
66
+ to: {
67
+ height: string;
68
+ };
69
+ };
70
+ };
71
+ animation: {
72
+ 'accordion-down': string;
73
+ 'accordion-up': string;
74
+ };
76
75
  };
77
- plugins: any[];
76
+ };
77
+ plugins: any[];
78
78
  };
79
79
  export default _default;
@@ -1,84 +1,83 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.default = {
4
- darkMode: ["class"],
5
- content: [
6
- "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
7
- "./src/components/**/*.{js,ts,jsx,tsx,mdx}",
8
- "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
9
- ],
10
- theme: {
11
- extend: {
12
- colors: {
13
- background: 'hsl(var(--background))',
14
- foreground: 'hsl(var(--foreground))',
15
- card: {
16
- DEFAULT: 'hsl(var(--card))',
17
- foreground: 'hsl(var(--card-foreground))'
18
- },
19
- popover: {
20
- DEFAULT: 'hsl(var(--popover))',
21
- foreground: 'hsl(var(--popover-foreground))'
22
- },
23
- primary: {
24
- DEFAULT: 'hsl(var(--primary))',
25
- foreground: 'hsl(var(--primary-foreground))'
26
- },
27
- secondary: {
28
- DEFAULT: 'hsl(var(--secondary))',
29
- foreground: 'hsl(var(--secondary-foreground))'
30
- },
31
- muted: {
32
- DEFAULT: 'hsl(var(--muted))',
33
- foreground: 'hsl(var(--muted-foreground))'
34
- },
35
- accent: {
36
- DEFAULT: 'hsl(var(--accent))',
37
- foreground: 'hsl(var(--accent-foreground))'
38
- },
39
- destructive: {
40
- DEFAULT: 'hsl(var(--destructive))',
41
- foreground: 'hsl(var(--destructive-foreground))'
42
- },
43
- border: 'hsl(var(--border))',
44
- input: 'hsl(var(--input))',
45
- ring: 'hsl(var(--ring))',
46
- chart: {
47
- '1': 'hsl(var(--chart-1))',
48
- '2': 'hsl(var(--chart-2))',
49
- '3': 'hsl(var(--chart-3))',
50
- '4': 'hsl(var(--chart-4))',
51
- '5': 'hsl(var(--chart-5))'
52
- }
53
- },
54
- borderRadius: {
55
- lg: 'var(--radius)',
56
- md: 'calc(var(--radius) - 2px)',
57
- sm: 'calc(var(--radius) - 4px)'
58
- },
59
- keyframes: {
60
- 'accordion-down': {
61
- from: {
62
- height: '0'
63
- },
64
- to: {
65
- height: 'var(--radix-accordion-content-height)'
66
- }
67
- },
68
- 'accordion-up': {
69
- from: {
70
- height: 'var(--radix-accordion-content-height)'
71
- },
72
- to: {
73
- height: '0'
74
- }
75
- }
76
- },
77
- animation: {
78
- 'accordion-down': 'accordion-down 0.2s ease-out',
79
- 'accordion-up': 'accordion-up 0.2s ease-out'
80
- }
81
- }
3
+ darkMode: ['class'],
4
+ content: [
5
+ './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
6
+ './src/components/**/*.{js,ts,jsx,tsx,mdx}',
7
+ './src/app/**/*.{js,ts,jsx,tsx,mdx}',
8
+ ],
9
+ theme: {
10
+ extend: {
11
+ colors: {
12
+ background: 'hsl(var(--background))',
13
+ foreground: 'hsl(var(--foreground))',
14
+ card: {
15
+ DEFAULT: 'hsl(var(--card))',
16
+ foreground: 'hsl(var(--card-foreground))',
17
+ },
18
+ popover: {
19
+ DEFAULT: 'hsl(var(--popover))',
20
+ foreground: 'hsl(var(--popover-foreground))',
21
+ },
22
+ primary: {
23
+ DEFAULT: 'hsl(var(--primary))',
24
+ foreground: 'hsl(var(--primary-foreground))',
25
+ },
26
+ secondary: {
27
+ DEFAULT: 'hsl(var(--secondary))',
28
+ foreground: 'hsl(var(--secondary-foreground))',
29
+ },
30
+ muted: {
31
+ DEFAULT: 'hsl(var(--muted))',
32
+ foreground: 'hsl(var(--muted-foreground))',
33
+ },
34
+ accent: {
35
+ DEFAULT: 'hsl(var(--accent))',
36
+ foreground: 'hsl(var(--accent-foreground))',
37
+ },
38
+ destructive: {
39
+ DEFAULT: 'hsl(var(--destructive))',
40
+ foreground: 'hsl(var(--destructive-foreground))',
41
+ },
42
+ border: 'hsl(var(--border))',
43
+ input: 'hsl(var(--input))',
44
+ ring: 'hsl(var(--ring))',
45
+ chart: {
46
+ 1: 'hsl(var(--chart-1))',
47
+ 2: 'hsl(var(--chart-2))',
48
+ 3: 'hsl(var(--chart-3))',
49
+ 4: 'hsl(var(--chart-4))',
50
+ 5: 'hsl(var(--chart-5))',
51
+ },
52
+ },
53
+ borderRadius: {
54
+ lg: 'var(--radius)',
55
+ md: 'calc(var(--radius) - 2px)',
56
+ sm: 'calc(var(--radius) - 4px)',
57
+ },
58
+ keyframes: {
59
+ 'accordion-down': {
60
+ from: {
61
+ height: '0',
62
+ },
63
+ to: {
64
+ height: 'var(--radix-accordion-content-height)',
65
+ },
66
+ },
67
+ 'accordion-up': {
68
+ from: {
69
+ height: 'var(--radix-accordion-content-height)',
70
+ },
71
+ to: {
72
+ height: '0',
73
+ },
74
+ },
75
+ },
76
+ animation: {
77
+ 'accordion-down': 'accordion-down 0.2s ease-out',
78
+ 'accordion-up': 'accordion-up 0.2s ease-out',
79
+ },
82
80
  },
83
- plugins: [require("tailwindcss-animate")],
81
+ },
82
+ plugins: [require('tailwindcss-animate')],
84
83
  };
@@ -1,5 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.NodemailerNotificationAdapter = void 0;
4
- var nodemailer_notification_adapter_1 = require("./nodemailer-notification-adapter");
5
- Object.defineProperty(exports, "NodemailerNotificationAdapter", { enumerable: true, get: function () { return nodemailer_notification_adapter_1.NodemailerNotificationAdapter; } });
3
+ var nodemailer_notification_adapter_1 = require('./nodemailer-notification-adapter');
4
+ Object.defineProperty(exports, 'NodemailerNotificationAdapter', {
5
+ enumerable: true,
6
+ get: () => nodemailer_notification_adapter_1.NodemailerNotificationAdapter,
7
+ });
@@ -1,19 +1,41 @@
1
- import nodemailer from 'nodemailer';
1
+ import type nodemailer from 'nodemailer';
2
2
  import type { BaseNotificationAdapter } from 'vintasend/src/services/notification-adapters/base-notification-adapter';
3
- import type { BaseEmailTemplateRenderer } from 'vintasend/src/services/notification-template-renderers/base-email-template-renderer';
4
3
  import type { BaseNotificationBackend } from 'vintasend/src/services/notification-backends/base-notification-backend';
5
- import type { Notification } from 'vintasend/src/types/notification';
6
- import type { JsonObject } from 'vintasend/src/types/json-values';
7
- import type { NotificationType } from 'vintasend/src/types/notification-type';
8
4
  import type { ContextGenerator } from 'vintasend/src/services/notification-context-registry';
5
+ import type { BaseEmailTemplateRenderer } from 'vintasend/src/services/notification-template-renderers/base-email-template-renderer';
9
6
  import type { Identifier } from 'vintasend/src/types/identifier';
10
- export declare class NodemailerNotificationAdapter<TemplateRenderer extends BaseEmailTemplateRenderer<AvailableContexts>, Backend extends BaseNotificationBackend<AvailableContexts>, AvailableContexts extends Record<string, ContextGenerator>, NotificationIdType extends Identifier = Identifier, UserIdType extends Identifier = Identifier> implements BaseNotificationAdapter<TemplateRenderer, Backend, AvailableContexts, NotificationIdType, UserIdType> {
11
- templateRenderer: TemplateRenderer;
12
- backend: Backend;
13
- readonly enqueueNotifications: boolean;
14
- private transporter;
15
- readonly notificationType: NotificationType;
16
- readonly key = "nodemailer";
17
- constructor(templateRenderer: TemplateRenderer, backend: Backend, enqueueNotifications: boolean, transportOptions: Parameters<typeof nodemailer.createTransport>[0]);
18
- send(notification: Notification<AvailableContexts, NotificationIdType, UserIdType>, context: JsonObject): Promise<void>;
7
+ import type { JsonObject } from 'vintasend/src/types/json-values';
8
+ import type { Notification } from 'vintasend/src/types/notification';
9
+ import type { NotificationType } from 'vintasend/src/types/notification-type';
10
+ export declare class NodemailerNotificationAdapter<
11
+ TemplateRenderer extends BaseEmailTemplateRenderer<AvailableContexts>,
12
+ Backend extends BaseNotificationBackend<AvailableContexts>,
13
+ AvailableContexts extends Record<string, ContextGenerator>,
14
+ NotificationIdType extends Identifier = Identifier,
15
+ UserIdType extends Identifier = Identifier,
16
+ > implements
17
+ BaseNotificationAdapter<
18
+ TemplateRenderer,
19
+ Backend,
20
+ AvailableContexts,
21
+ NotificationIdType,
22
+ UserIdType
23
+ >
24
+ {
25
+ templateRenderer: TemplateRenderer;
26
+ backend: Backend;
27
+ readonly enqueueNotifications: boolean;
28
+ private transporter;
29
+ readonly notificationType: NotificationType;
30
+ readonly key = 'nodemailer';
31
+ constructor(
32
+ templateRenderer: TemplateRenderer,
33
+ backend: Backend,
34
+ enqueueNotifications: boolean,
35
+ transportOptions: Parameters<typeof nodemailer.createTransport>[0],
36
+ );
37
+ send(
38
+ notification: Notification<AvailableContexts, NotificationIdType, UserIdType>,
39
+ context: JsonObject,
40
+ ): Promise<void>;
19
41
  }
@@ -1,34 +1,32 @@
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.NodemailerNotificationAdapter = void 0;
7
- const nodemailer_1 = __importDefault(require("nodemailer"));
5
+ const nodemailer_1 = __importDefault(require('nodemailer'));
8
6
  class NodemailerNotificationAdapter {
9
- constructor(templateRenderer, backend, enqueueNotifications, transportOptions) {
10
- this.templateRenderer = templateRenderer;
11
- this.backend = backend;
12
- this.enqueueNotifications = enqueueNotifications;
13
- this.notificationType = 'EMAIL';
14
- this.key = 'nodemailer';
15
- this.transporter = nodemailer_1.default.createTransport(transportOptions);
7
+ constructor(templateRenderer, backend, enqueueNotifications, transportOptions) {
8
+ this.templateRenderer = templateRenderer;
9
+ this.backend = backend;
10
+ this.enqueueNotifications = enqueueNotifications;
11
+ this.notificationType = 'EMAIL';
12
+ this.key = 'nodemailer';
13
+ this.transporter = nodemailer_1.default.createTransport(transportOptions);
14
+ }
15
+ async send(notification, context) {
16
+ const template = await this.templateRenderer.render(notification, context);
17
+ if (!notification.id) {
18
+ throw new Error('Notification ID is required');
16
19
  }
17
- async send(notification, context) {
18
- const template = await this.templateRenderer.render(notification, context);
19
- if (!notification.id) {
20
- throw new Error('Notification ID is required');
21
- }
22
- const userEmail = await this.backend.getUserEmailFromNotification(notification.id);
23
- if (!userEmail) {
24
- throw new Error('User email not found');
25
- }
26
- const mailOptions = {
27
- to: userEmail,
28
- subject: template.subject,
29
- html: template.body,
30
- };
31
- await this.transporter.sendMail(mailOptions);
20
+ const userEmail = await this.backend.getUserEmailFromNotification(notification.id);
21
+ if (!userEmail) {
22
+ throw new Error('User email not found');
32
23
  }
24
+ const mailOptions = {
25
+ to: userEmail,
26
+ subject: template.subject,
27
+ html: template.body,
28
+ };
29
+ await this.transporter.sendMail(mailOptions);
30
+ }
33
31
  }
34
32
  exports.NodemailerNotificationAdapter = NodemailerNotificationAdapter;
@@ -1,5 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperty(exports, '__esModule', { value: true });
3
2
  exports.PrismaNotificationBackend = void 0;
4
- var prisma_notification_backend_1 = require("./prisma-notification-backend");
5
- Object.defineProperty(exports, "PrismaNotificationBackend", { enumerable: true, get: function () { return prisma_notification_backend_1.PrismaNotificationBackend; } });
3
+ var prisma_notification_backend_1 = require('./prisma-notification-backend');
4
+ Object.defineProperty(exports, 'PrismaNotificationBackend', {
5
+ enumerable: true,
6
+ get: () => prisma_notification_backend_1.PrismaNotificationBackend,
7
+ });