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.
- package/README.md +227 -12
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/next.config.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/next.config.js +9 -4
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/forgot-password-notification-context.d.ts +6 -6
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/forgot-password-notification-context.js +16 -17
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/route.d.ts +7 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/route.js +105 -79
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/login/route.d.ts +4 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/login/route.js +96 -66
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/reset-password/route.d.ts +7 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/reset-password/route.js +95 -71
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/email-verification-notification-context.d.ts +6 -6
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/email-verification-notification-context.js +18 -18
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/route.d.ts +4 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/route.js +124 -96
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/verify-email/route.d.ts +7 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/verify-email/route.js +94 -70
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/login/page.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/login/page.js +67 -55
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/reset-password/[token]/page.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/reset-password/[token]/page.js +76 -63
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/signup/page.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/signup/page.js +87 -63
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email/[token]/page.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email/[token]/page.js +50 -35
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email-sent/page.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email-sent/page.js +12 -12
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/layout.d.ts +7 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/layout.js +15 -16
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/page.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/page.js +65 -21
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/AuthLayout.d.ts +7 -4
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/AuthLayout.js +7 -8
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/accordion.d.ts +18 -6
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/accordion.js +86 -48
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert-dialog.d.ts +58 -14
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert-dialog.js +135 -53
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert.d.ts +21 -7
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert.js +85 -49
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/avatar.d.ts +14 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/avatar.js +77 -40
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/button.d.ts +25 -9
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/button.js +80 -58
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/card.d.ts +19 -7
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/card.js +98 -48
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/checkbox.d.ts +6 -3
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/checkbox.js +66 -42
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/collapsible.d.ts +10 -4
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/collapsible.js +48 -35
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dialog.d.ts +40 -13
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dialog.js +116 -50
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dropdown-menu.d.ts +83 -19
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dropdown-menu.js +170 -68
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/form.d.ts +53 -21
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/form.js +137 -83
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/input.d.ts +8 -2
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/input.js +60 -37
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/label.d.ts +10 -4
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/label.js +61 -40
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/menubar.d.ts +77 -23
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/menubar.js +188 -64
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/select.d.ts +48 -12
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/select.js +148 -66
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/textarea.d.ts +8 -2
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/textarea.js +59 -37
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/auth.d.ts +10 -10
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/auth.js +54 -55
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/core.d.ts +14 -11
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/core.js +1 -2
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/email.js +0 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/logger.d.ts +3 -3
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/logger.js +9 -10
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/schemas/auth.d.ts +66 -32
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/schemas/auth.js +74 -54
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/auth.js +7 -8
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications-with-queue.d.ts +14 -4
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications-with-queue.js +14 -10
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications.d.ts +11 -7
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications.js +39 -26
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/temporal-queue-service.d.ts +11 -8
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/temporal-queue-service.js +14 -15
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/temporal.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/temporal.js +9 -10
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/utils.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/utils.js +4 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/activities.d.ts +6 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/activities.js +14 -14
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/config.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/config.js +2 -3
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/constants.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/constants.js +1 -2
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/worker.js +20 -22
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/workflows.d.ts +3 -2
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/workflows.js +10 -9
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/tailwind.config.d.ts +74 -74
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/tailwind.config.js +80 -81
- package/dist/implementations/vintasend-nodemailer/src/index.js +6 -4
- package/dist/implementations/vintasend-nodemailer/src/nodemailer-notification-adapter.d.ts +36 -14
- package/dist/implementations/vintasend-nodemailer/src/nodemailer-notification-adapter.js +26 -28
- package/dist/implementations/vintasend-prisma/src/index.js +6 -4
- package/dist/implementations/vintasend-prisma/src/prisma-notification-backend.d.ts +232 -138
- package/dist/implementations/vintasend-prisma/src/prisma-notification-backend.js +275 -262
- package/dist/implementations/vintasend-pug/src/index.js +6 -4
- package/dist/implementations/vintasend-pug/src/pug-email-template-renderer.d.ts +18 -7
- package/dist/implementations/vintasend-pug/src/pug-email-template-renderer.js +19 -21
- package/dist/implementations/vintasend-winston/src/index.js +6 -4
- package/dist/implementations/vintasend-winston/src/winston-logger.d.ts +6 -6
- package/dist/implementations/vintasend-winston/src/winston-logger.js +65 -50
- package/dist/index.d.ts +13 -5
- package/dist/index.js +13 -1
- package/dist/services/attachment-manager/base-attachment-manager.d.ts +42 -0
- package/dist/services/attachment-manager/base-attachment-manager.js +115 -0
- package/dist/services/attachment-manager/local-file-attachment-manager.d.ts +58 -0
- package/dist/services/attachment-manager/local-file-attachment-manager.js +192 -0
- package/dist/services/notification-adapters/base-notification-adapter.d.ts +36 -4
- package/dist/services/notification-adapters/base-notification-adapter.js +73 -4
- package/dist/services/notification-backends/base-notification-backend.d.ts +54 -11
- package/dist/services/notification-backends/base-notification-backend.js +12 -0
- package/dist/services/notification-context-generators-map.d.ts +1 -1
- package/dist/services/notification-context-registry.d.ts +14 -9
- package/dist/services/notification-context-registry.js +30 -31
- package/dist/services/notification-queue-service/base-notification-queue-service.d.ts +1 -1
- package/dist/services/notification-service.d.ts +73 -13
- package/dist/services/notification-service.js +125 -8
- package/dist/services/notification-template-renderers/base-email-template-renderer.d.ts +3 -3
- package/dist/services/notification-template-renderers/base-notification-template-renderer.d.ts +2 -2
- package/dist/types/attachment.d.ts +42 -0
- package/dist/types/attachment.js +7 -0
- package/dist/types/notification-type-config.d.ts +2 -2
- package/dist/types/notification.d.ts +21 -0
- package/dist/types/one-off-notification.d.ts +72 -0
- package/dist/types/one-off-notification.js +2 -0
- package/package.json +13 -11
package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/constants.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const NOTIFICATIONS_QUEUE =
|
|
1
|
+
export declare const NOTIFICATIONS_QUEUE = 'NOTIFICATIONS_QUEUE';
|
package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/worker.js
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
24
|
-
|
|
20
|
+
runWorker().catch((err) => {
|
|
21
|
+
console.error(err);
|
|
22
|
+
process.exit(1);
|
|
25
23
|
});
|
package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/workflows.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { getNotificationService } from '../../lib/services/notifications';
|
|
2
|
-
type NotificationIdType = Parameters<
|
|
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 {};
|
package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/workflows.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
|
|
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(
|
|
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
|
-
|
|
7
|
+
startToCloseTimeout: '1 minute',
|
|
9
8
|
});
|
|
10
9
|
async function sendNotificationWorkflow(notificationId) {
|
|
11
|
-
|
|
10
|
+
await sendNotification(notificationId);
|
|
12
11
|
}
|
|
13
12
|
async function sendAllPendingNotificationsWorkflow() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
76
|
+
};
|
|
77
|
+
plugins: any[];
|
|
78
78
|
};
|
|
79
79
|
export default _default;
|
|
@@ -1,84 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
2
|
exports.default = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
81
|
+
},
|
|
82
|
+
plugins: [require('tailwindcss-animate')],
|
|
84
83
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
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(
|
|
5
|
-
Object.defineProperty(exports,
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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(
|
|
5
|
+
const nodemailer_1 = __importDefault(require('nodemailer'));
|
|
8
6
|
class NodemailerNotificationAdapter {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
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(
|
|
5
|
-
Object.defineProperty(exports,
|
|
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
|
+
});
|