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
|
@@ -1,159 +1,253 @@
|
|
|
1
1
|
import type { BaseNotificationBackend } from 'vintasend/src/services/notification-backends/base-notification-backend';
|
|
2
2
|
import type { ContextGenerator } from 'vintasend/src/services/notification-context-registry';
|
|
3
|
+
import type { Identifier } from 'vintasend/src/types/identifier';
|
|
3
4
|
import type { InputJsonValue, JsonValue } from 'vintasend/src/types/json-values';
|
|
4
5
|
import type { Notification, NotificationInput } from 'vintasend/src/types/notification';
|
|
5
6
|
import type { NotificationStatus } from 'vintasend/src/types/notification-status';
|
|
6
7
|
import type { NotificationType } from 'vintasend/src/types/notification-type';
|
|
7
|
-
import type { Identifier } from 'vintasend/src/types/identifier';
|
|
8
8
|
export declare const NotificationStatusEnum: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
readonly PENDING_SEND: 'PENDING_SEND';
|
|
10
|
+
readonly SENT: 'SENT';
|
|
11
|
+
readonly FAILED: 'FAILED';
|
|
12
|
+
readonly READ: 'READ';
|
|
13
|
+
readonly CANCELLED: 'CANCELLED';
|
|
14
14
|
};
|
|
15
15
|
export declare const NotificationTypeEnum: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
readonly EMAIL: 'EMAIL';
|
|
17
|
+
readonly PUSH: 'PUSH';
|
|
18
|
+
readonly SMS: 'SMS';
|
|
19
|
+
readonly IN_APP: 'IN_APP';
|
|
20
20
|
};
|
|
21
21
|
export interface PrismaNotificationModel<IdType, UserId> {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
22
|
+
id: IdType;
|
|
23
|
+
userId: UserId;
|
|
24
|
+
notificationType: NotificationType;
|
|
25
|
+
title: string | null;
|
|
26
|
+
bodyTemplate: string;
|
|
27
|
+
contextName: string;
|
|
28
|
+
contextParameters: JsonValue;
|
|
29
|
+
sendAfter: Date | null;
|
|
30
|
+
subjectTemplate: string | null;
|
|
31
|
+
status: NotificationStatus;
|
|
32
|
+
contextUsed: JsonValue | null;
|
|
33
|
+
extraParams: JsonValue | null;
|
|
34
|
+
adapterUsed: string | null;
|
|
35
|
+
sentAt: Date | null;
|
|
36
|
+
readAt: Date | null;
|
|
37
|
+
createdAt: Date;
|
|
38
|
+
updatedAt: Date;
|
|
39
|
+
user?: {
|
|
40
|
+
email: string;
|
|
41
|
+
};
|
|
42
42
|
}
|
|
43
43
|
export interface NotificationPrismaClientInterface<NotificationIdType, UserIdType> {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
lte: Date;
|
|
52
|
-
} | null;
|
|
53
|
-
userId?: UserIdType;
|
|
54
|
-
readAt?: null;
|
|
55
|
-
};
|
|
56
|
-
skip?: number;
|
|
57
|
-
take?: number;
|
|
58
|
-
include?: {
|
|
59
|
-
user?: boolean;
|
|
60
|
-
};
|
|
61
|
-
}): Promise<PrismaNotificationModel<NotificationIdType, UserIdType>[]>;
|
|
62
|
-
create(args: {
|
|
63
|
-
data: BaseNotificationCreateInput<UserIdType>;
|
|
64
|
-
include?: {
|
|
65
|
-
user?: boolean;
|
|
66
|
-
};
|
|
67
|
-
}): Promise<PrismaNotificationModel<NotificationIdType, UserIdType>>;
|
|
68
|
-
update(args: {
|
|
69
|
-
where: {
|
|
70
|
-
id: NotificationIdType;
|
|
71
|
-
};
|
|
72
|
-
data: Partial<BaseNotificationUpdateInput<UserIdType>>;
|
|
73
|
-
include?: {
|
|
74
|
-
user?: boolean;
|
|
75
|
-
};
|
|
76
|
-
}): Promise<PrismaNotificationModel<NotificationIdType, UserIdType>>;
|
|
77
|
-
findUnique(args: {
|
|
78
|
-
where: {
|
|
79
|
-
id: NotificationIdType;
|
|
80
|
-
};
|
|
81
|
-
include?: {
|
|
82
|
-
user?: boolean;
|
|
44
|
+
notification: {
|
|
45
|
+
findMany(args: {
|
|
46
|
+
where?: {
|
|
47
|
+
status?:
|
|
48
|
+
| NotificationStatus
|
|
49
|
+
| {
|
|
50
|
+
not: NotificationStatus;
|
|
83
51
|
};
|
|
84
|
-
|
|
85
|
-
|
|
52
|
+
sendAfter?: {
|
|
53
|
+
lte: Date;
|
|
54
|
+
} | null;
|
|
55
|
+
userId?: UserIdType;
|
|
56
|
+
readAt?: null;
|
|
57
|
+
};
|
|
58
|
+
skip?: number;
|
|
59
|
+
take?: number;
|
|
60
|
+
include?: {
|
|
61
|
+
user?: boolean;
|
|
62
|
+
};
|
|
63
|
+
}): Promise<PrismaNotificationModel<NotificationIdType, UserIdType>[]>;
|
|
64
|
+
create(args: {
|
|
65
|
+
data: BaseNotificationCreateInput<UserIdType>;
|
|
66
|
+
include?: {
|
|
67
|
+
user?: boolean;
|
|
68
|
+
};
|
|
69
|
+
}): Promise<PrismaNotificationModel<NotificationIdType, UserIdType>>;
|
|
70
|
+
update(args: {
|
|
71
|
+
where: {
|
|
72
|
+
id: NotificationIdType;
|
|
73
|
+
};
|
|
74
|
+
data: Partial<BaseNotificationUpdateInput<UserIdType>>;
|
|
75
|
+
include?: {
|
|
76
|
+
user?: boolean;
|
|
77
|
+
};
|
|
78
|
+
}): Promise<PrismaNotificationModel<NotificationIdType, UserIdType>>;
|
|
79
|
+
findUnique(args: {
|
|
80
|
+
where: {
|
|
81
|
+
id: NotificationIdType;
|
|
82
|
+
};
|
|
83
|
+
include?: {
|
|
84
|
+
user?: boolean;
|
|
85
|
+
};
|
|
86
|
+
}): Promise<PrismaNotificationModel<NotificationIdType, UserIdType> | null>;
|
|
87
|
+
};
|
|
86
88
|
}
|
|
87
89
|
type NoExpand<T> = T extends unknown ? T : never;
|
|
88
|
-
type AtLeast<O extends object, K extends string> = NoExpand<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
type AtLeast<O extends object, K extends string> = NoExpand<
|
|
91
|
+
O extends unknown
|
|
92
|
+
?
|
|
93
|
+
| (K extends keyof O
|
|
94
|
+
? {
|
|
95
|
+
[P in K]: O[P];
|
|
96
|
+
} & O
|
|
97
|
+
: O)
|
|
98
|
+
| ({
|
|
99
|
+
[P in keyof O as P extends K ? K : never]-?: O[P];
|
|
100
|
+
} & O)
|
|
101
|
+
: never
|
|
102
|
+
>;
|
|
93
103
|
export interface BaseNotificationCreateInput<UserIdType> {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
user: {
|
|
105
|
+
connect?: AtLeast<
|
|
106
|
+
{
|
|
107
|
+
id?: UserIdType;
|
|
108
|
+
email?: string;
|
|
109
|
+
},
|
|
110
|
+
'id' | 'email'
|
|
111
|
+
>;
|
|
112
|
+
};
|
|
113
|
+
notificationType: NotificationType;
|
|
114
|
+
title?: string | null;
|
|
115
|
+
bodyTemplate: string;
|
|
116
|
+
contextName: string;
|
|
117
|
+
contextParameters: InputJsonValue;
|
|
118
|
+
sendAfter?: Date | null;
|
|
119
|
+
subjectTemplate?: string | null;
|
|
120
|
+
status?: NotificationStatus;
|
|
121
|
+
contextUsed?: InputJsonValue;
|
|
122
|
+
extraParams?: InputJsonValue;
|
|
123
|
+
adapterUsed?: string | null;
|
|
124
|
+
sentAt?: Date | null;
|
|
125
|
+
readAt?: Date | null;
|
|
113
126
|
}
|
|
114
127
|
export interface BaseNotificationUpdateInput<UserIdType> {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
user: {
|
|
129
|
+
connect?: AtLeast<
|
|
130
|
+
{
|
|
131
|
+
id?: UserIdType;
|
|
132
|
+
email?: string;
|
|
133
|
+
},
|
|
134
|
+
'id' | 'email'
|
|
135
|
+
>;
|
|
136
|
+
};
|
|
137
|
+
notificationType?: NotificationType;
|
|
138
|
+
title?: string | null;
|
|
139
|
+
bodyTemplate?: string;
|
|
140
|
+
contextName?: string;
|
|
141
|
+
contextParameters?: InputJsonValue;
|
|
142
|
+
sendAfter?: Date | null;
|
|
143
|
+
subjectTemplate?: string | null;
|
|
144
|
+
status?: NotificationStatus;
|
|
145
|
+
contextUsed?: InputJsonValue;
|
|
146
|
+
extraParams?: InputJsonValue;
|
|
147
|
+
adapterUsed?: string | null;
|
|
148
|
+
sentAt?: Date | null;
|
|
149
|
+
readAt?: Date | null;
|
|
134
150
|
}
|
|
135
|
-
export declare class PrismaNotificationBackend<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
151
|
+
export declare class PrismaNotificationBackend<
|
|
152
|
+
Client extends NotificationPrismaClientInterface<NotificationIdType, UserIdType>,
|
|
153
|
+
AvailableContexts extends Record<string, ContextGenerator>,
|
|
154
|
+
NotificationIdType extends Identifier = Identifier,
|
|
155
|
+
UserIdType extends Identifier = Identifier,
|
|
156
|
+
> implements BaseNotificationBackend<AvailableContexts, NotificationIdType, UserIdType>
|
|
157
|
+
{
|
|
158
|
+
private prismaClient;
|
|
159
|
+
constructor(prismaClient: Client);
|
|
160
|
+
serializeNotification(
|
|
161
|
+
notification: NonNullable<
|
|
162
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
163
|
+
>,
|
|
164
|
+
): Notification<AvailableContexts, NotificationIdType, UserIdType>;
|
|
165
|
+
deserializeNotification(
|
|
166
|
+
notification: NotificationInput<AvailableContexts, UserIdType>,
|
|
167
|
+
): BaseNotificationCreateInput<UserIdType>;
|
|
168
|
+
deserializeNotificationForUpdate(
|
|
169
|
+
notification: Partial<Notification<AvailableContexts, NotificationIdType, UserIdType>>,
|
|
170
|
+
): Partial<Parameters<typeof this.prismaClient.notification.update>[0]['data']>;
|
|
171
|
+
getAllPendingNotifications(): Promise<
|
|
172
|
+
Notification<AvailableContexts, NotificationIdType, UserIdType>[]
|
|
173
|
+
>;
|
|
174
|
+
getPendingNotifications(): Promise<
|
|
175
|
+
Notification<AvailableContexts, NotificationIdType, UserIdType>[]
|
|
176
|
+
>;
|
|
177
|
+
getAllFutureNotifications(): Promise<
|
|
178
|
+
Notification<AvailableContexts, NotificationIdType, UserIdType>[]
|
|
179
|
+
>;
|
|
180
|
+
getFutureNotifications(): Promise<
|
|
181
|
+
Notification<AvailableContexts, NotificationIdType, UserIdType>[]
|
|
182
|
+
>;
|
|
183
|
+
getAllFutureNotificationsFromUser(
|
|
184
|
+
userId: NonNullable<
|
|
185
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
186
|
+
>['userId'],
|
|
187
|
+
): Promise<Notification<AvailableContexts, NotificationIdType, UserIdType>[]>;
|
|
188
|
+
getFutureNotificationsFromUser(
|
|
189
|
+
userId: NonNullable<
|
|
190
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
191
|
+
>['userId'],
|
|
192
|
+
): Promise<Notification<AvailableContexts, NotificationIdType, UserIdType>[]>;
|
|
193
|
+
persistNotification(
|
|
194
|
+
notification: NotificationInput<AvailableContexts, UserIdType>,
|
|
195
|
+
): Promise<Notification<AvailableContexts, NotificationIdType, UserIdType>>;
|
|
196
|
+
persistNotificationUpdate(
|
|
197
|
+
notificationId: NonNullable<
|
|
198
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
199
|
+
>['id'],
|
|
200
|
+
notification: Partial<
|
|
201
|
+
Omit<Notification<AvailableContexts, NotificationIdType, UserIdType>, 'id'>
|
|
202
|
+
>,
|
|
203
|
+
): Promise<Notification<AvailableContexts, NotificationIdType, UserIdType>>;
|
|
204
|
+
markPendingAsSent(
|
|
205
|
+
notificationId: NonNullable<
|
|
206
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
207
|
+
>['id'],
|
|
208
|
+
): Promise<Notification<AvailableContexts, NotificationIdType, UserIdType>>;
|
|
209
|
+
markPendingAsFailed(
|
|
210
|
+
notificationId: NonNullable<
|
|
211
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
212
|
+
>['id'],
|
|
213
|
+
): Promise<Notification<AvailableContexts, NotificationIdType, UserIdType>>;
|
|
214
|
+
markSentAsRead(
|
|
215
|
+
notificationId: NonNullable<
|
|
216
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
217
|
+
>['id'],
|
|
218
|
+
): Promise<Notification<AvailableContexts, NotificationIdType, UserIdType>>;
|
|
219
|
+
cancelNotification(
|
|
220
|
+
notificationId: NonNullable<
|
|
221
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
222
|
+
>['id'],
|
|
223
|
+
): Promise<void>;
|
|
224
|
+
getNotification(
|
|
225
|
+
notificationId: NonNullable<
|
|
226
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
227
|
+
>['id'],
|
|
228
|
+
_forUpdate: boolean,
|
|
229
|
+
): Promise<Notification<AvailableContexts, NotificationIdType, UserIdType> | null>;
|
|
230
|
+
filterAllInAppUnreadNotifications(
|
|
231
|
+
userId: NonNullable<
|
|
232
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
233
|
+
>['userId'],
|
|
234
|
+
): Promise<Notification<AvailableContexts, NotificationIdType, UserIdType>[]>;
|
|
235
|
+
filterInAppUnreadNotifications(
|
|
236
|
+
userId: NonNullable<
|
|
237
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
238
|
+
>['userId'],
|
|
239
|
+
page: number,
|
|
240
|
+
pageSize: number,
|
|
241
|
+
): Promise<Notification<AvailableContexts, NotificationIdType, UserIdType>[]>;
|
|
242
|
+
getUserEmailFromNotification(
|
|
243
|
+
notificationId: NonNullable<
|
|
244
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
245
|
+
>['id'],
|
|
246
|
+
): Promise<string | undefined>;
|
|
247
|
+
storeContextUsed(
|
|
248
|
+
notificationId: NonNullable<
|
|
249
|
+
Awaited<ReturnType<typeof this.prismaClient.notification.findUnique>>
|
|
250
|
+
>['id'],
|
|
251
|
+
context: InputJsonValue,
|
|
252
|
+
): Promise<void>;
|
|
158
253
|
}
|
|
159
|
-
export {};
|