@develit-services/notification 0.0.18 → 0.0.20
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/dist/@types.cjs +25 -0
- package/dist/@types.d.cts +70 -0
- package/dist/@types.d.mts +70 -0
- package/dist/@types.d.ts +70 -0
- package/dist/@types.mjs +14 -0
- package/dist/export/worker.cjs +11 -225
- package/dist/export/worker.d.cts +4 -196
- package/dist/export/worker.d.mts +4 -196
- package/dist/export/worker.d.ts +4 -196
- package/dist/export/worker.mjs +5 -214
- package/dist/export/wrangler.d.cts +1 -28
- package/dist/export/wrangler.d.mts +1 -28
- package/dist/export/wrangler.d.ts +1 -28
- package/dist/shared/notification.B2I1pTPy.d.cts +32 -0
- package/dist/shared/notification.B2I1pTPy.d.mts +32 -0
- package/dist/shared/notification.B2I1pTPy.d.ts +32 -0
- package/dist/shared/notification.B8IIgYsS.cjs +220 -0
- package/dist/shared/notification.Bc0Z2CT6.d.cts +199 -0
- package/dist/shared/notification.Bc0Z2CT6.d.mts +199 -0
- package/dist/shared/notification.Bc0Z2CT6.d.ts +199 -0
- package/dist/shared/notification.D1sgZDH0.mjs +205 -0
- package/package.json +6 -1
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import z$1, { z } from 'zod';
|
|
2
|
+
import { z as z$2 } from 'zod/v4';
|
|
3
|
+
import { InternalError } from '@develit-io/backend-sdk';
|
|
4
|
+
|
|
5
|
+
declare const iContactSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
6
|
+
email: z.ZodString;
|
|
7
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
8
|
+
}, z.core.$strip>]>;
|
|
9
|
+
declare const iEmailSchema: z.ZodObject<{
|
|
10
|
+
to: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
11
|
+
email: z.ZodString;
|
|
12
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
13
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
14
|
+
email: z.ZodString;
|
|
15
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
16
|
+
}, z.core.$strip>]>>]>;
|
|
17
|
+
replyTo: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
18
|
+
email: z.ZodString;
|
|
19
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
20
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
21
|
+
email: z.ZodString;
|
|
22
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
23
|
+
}, z.core.$strip>]>>]>>;
|
|
24
|
+
cc: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
25
|
+
email: z.ZodString;
|
|
26
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
27
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
28
|
+
email: z.ZodString;
|
|
29
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
30
|
+
}, z.core.$strip>]>>]>>;
|
|
31
|
+
bcc: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
32
|
+
email: z.ZodString;
|
|
33
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
34
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
35
|
+
email: z.ZodString;
|
|
36
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
37
|
+
}, z.core.$strip>]>>]>>;
|
|
38
|
+
from: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
39
|
+
email: z.ZodString;
|
|
40
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
41
|
+
}, z.core.$strip>]>>;
|
|
42
|
+
subject: z.ZodString;
|
|
43
|
+
text: z.ZodOptional<z.ZodString>;
|
|
44
|
+
html: z.ZodOptional<z.ZodString>;
|
|
45
|
+
templateId: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
templateVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
type IContact = z.infer<typeof iContactSchema>;
|
|
49
|
+
type IEmail = z.infer<typeof iEmailSchema>;
|
|
50
|
+
|
|
51
|
+
declare abstract class IEmailConnector {
|
|
52
|
+
static providerName: string;
|
|
53
|
+
API_KEY: string;
|
|
54
|
+
SMTP_HOST: string;
|
|
55
|
+
SENDER: IContact;
|
|
56
|
+
protected constructor({ API_KEY, SMTP_HOST, SENDER, }: {
|
|
57
|
+
API_KEY: string;
|
|
58
|
+
SMTP_HOST: string;
|
|
59
|
+
SENDER: IContact;
|
|
60
|
+
});
|
|
61
|
+
abstract sendEmail(email: IEmail): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare const sendEmailInputSchema: z$1.ZodObject<{
|
|
65
|
+
email: z$1.ZodObject<{
|
|
66
|
+
to: z$1.ZodUnion<readonly [z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
67
|
+
email: z$1.ZodString;
|
|
68
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
69
|
+
}, z$1.core.$strip>]>, z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
70
|
+
email: z$1.ZodString;
|
|
71
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
72
|
+
}, z$1.core.$strip>]>>]>;
|
|
73
|
+
replyTo: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
74
|
+
email: z$1.ZodString;
|
|
75
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
76
|
+
}, z$1.core.$strip>]>, z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
77
|
+
email: z$1.ZodString;
|
|
78
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
79
|
+
}, z$1.core.$strip>]>>]>>;
|
|
80
|
+
cc: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
81
|
+
email: z$1.ZodString;
|
|
82
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
83
|
+
}, z$1.core.$strip>]>, z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
84
|
+
email: z$1.ZodString;
|
|
85
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
86
|
+
}, z$1.core.$strip>]>>]>>;
|
|
87
|
+
bcc: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
88
|
+
email: z$1.ZodString;
|
|
89
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
90
|
+
}, z$1.core.$strip>]>, z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
91
|
+
email: z$1.ZodString;
|
|
92
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
93
|
+
}, z$1.core.$strip>]>>]>>;
|
|
94
|
+
from: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
95
|
+
email: z$1.ZodString;
|
|
96
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
97
|
+
}, z$1.core.$strip>]>>;
|
|
98
|
+
subject: z$1.ZodString;
|
|
99
|
+
text: z$1.ZodOptional<z$1.ZodString>;
|
|
100
|
+
html: z$1.ZodOptional<z$1.ZodString>;
|
|
101
|
+
templateId: z$1.ZodOptional<z$1.ZodNumber>;
|
|
102
|
+
templateVariables: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
103
|
+
}, z$1.core.$strip>;
|
|
104
|
+
metadata: z$1.ZodObject<{
|
|
105
|
+
userAgent: z$1.ZodOptional<z$1.ZodString>;
|
|
106
|
+
ip: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodIPv4, z$1.ZodIPv6]>>;
|
|
107
|
+
initiator: z$1.ZodObject<{
|
|
108
|
+
service: z$1.ZodString;
|
|
109
|
+
userId: z$1.ZodOptional<z$1.ZodString>;
|
|
110
|
+
}, z$1.core.$strip>;
|
|
111
|
+
}, z$1.core.$strip>;
|
|
112
|
+
}, z$1.core.$strip>;
|
|
113
|
+
interface SendEmailInput extends z$1.infer<typeof sendEmailInputSchema> {
|
|
114
|
+
}
|
|
115
|
+
interface SendEmailOutput {
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare const sendSlackInputSchema: z$2.ZodObject<{
|
|
119
|
+
slack: z$2.ZodObject<{
|
|
120
|
+
message: z$2.ZodString;
|
|
121
|
+
}, z$2.core.$strip>;
|
|
122
|
+
metadata: z$2.ZodObject<{
|
|
123
|
+
userAgent: z$2.ZodOptional<z$2.ZodString>;
|
|
124
|
+
ip: z$2.ZodOptional<z$2.ZodUnion<[z$2.ZodIPv4, z$2.ZodIPv6]>>;
|
|
125
|
+
initiator: z$2.ZodObject<{
|
|
126
|
+
service: z$2.ZodString;
|
|
127
|
+
userId: z$2.ZodOptional<z$2.ZodString>;
|
|
128
|
+
}, z$2.core.$strip>;
|
|
129
|
+
}, z$2.core.$strip>;
|
|
130
|
+
}, z$2.core.$strip>;
|
|
131
|
+
interface SendSlackInput extends z$2.infer<typeof sendSlackInputSchema> {
|
|
132
|
+
}
|
|
133
|
+
interface SendSlackOutput {
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
declare const sendSmsInputSchema: z.ZodObject<{
|
|
137
|
+
sms: z.ZodObject<{
|
|
138
|
+
message: z.ZodString;
|
|
139
|
+
to: z.ZodString;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
metadata: z.ZodObject<{
|
|
142
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
143
|
+
ip: z.ZodOptional<z.ZodUnion<[z.ZodIPv4, z.ZodIPv6]>>;
|
|
144
|
+
initiator: z.ZodObject<{
|
|
145
|
+
service: z.ZodString;
|
|
146
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
interface SendSmsInput extends z.infer<typeof sendSmsInputSchema> {
|
|
151
|
+
}
|
|
152
|
+
interface SendSmsOutput {
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
interface IPushNotification {
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface NotificationQueueMessage {
|
|
159
|
+
type: 'email' | 'sms' | 'pushNotification' | 'slack';
|
|
160
|
+
metadata: {
|
|
161
|
+
userAgent?: string;
|
|
162
|
+
ip?: string;
|
|
163
|
+
initiator: {
|
|
164
|
+
service: string;
|
|
165
|
+
userId?: string;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
payload: {
|
|
169
|
+
email?: IEmail;
|
|
170
|
+
sms?: ISms;
|
|
171
|
+
pushNotification?: IPushNotification;
|
|
172
|
+
slack?: ISlack;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
interface ISms {
|
|
177
|
+
message: string;
|
|
178
|
+
to: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare abstract class ISmsConnector {
|
|
182
|
+
static providerName: string;
|
|
183
|
+
ACCOUNT_ID: string;
|
|
184
|
+
AUTH_TOKEN: string;
|
|
185
|
+
SERVICE_ID: string;
|
|
186
|
+
protected constructor({ ACCOUNT_ID, AUTH_TOKEN, SERVICE_ID, }: {
|
|
187
|
+
ACCOUNT_ID: string;
|
|
188
|
+
AUTH_TOKEN: string;
|
|
189
|
+
SERVICE_ID: string;
|
|
190
|
+
});
|
|
191
|
+
abstract sendSms(sms: ISms): Promise<InternalError | void>;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
interface ISlack {
|
|
195
|
+
message: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export { IEmailConnector as I, ISmsConnector as a, iContactSchema as j, iEmailSchema as k, sendSlackInputSchema as l, sendSmsInputSchema as m, sendEmailInputSchema as s };
|
|
199
|
+
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f, IContact as g, IEmail as h, ISms as i, IPushNotification as n, ISlack as o };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import z$1, { z } from 'zod';
|
|
2
|
+
import { z as z$2 } from 'zod/v4';
|
|
3
|
+
import { InternalError } from '@develit-io/backend-sdk';
|
|
4
|
+
|
|
5
|
+
declare const iContactSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
6
|
+
email: z.ZodString;
|
|
7
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
8
|
+
}, z.core.$strip>]>;
|
|
9
|
+
declare const iEmailSchema: z.ZodObject<{
|
|
10
|
+
to: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
11
|
+
email: z.ZodString;
|
|
12
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
13
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
14
|
+
email: z.ZodString;
|
|
15
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
16
|
+
}, z.core.$strip>]>>]>;
|
|
17
|
+
replyTo: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
18
|
+
email: z.ZodString;
|
|
19
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
20
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
21
|
+
email: z.ZodString;
|
|
22
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
23
|
+
}, z.core.$strip>]>>]>>;
|
|
24
|
+
cc: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
25
|
+
email: z.ZodString;
|
|
26
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
27
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
28
|
+
email: z.ZodString;
|
|
29
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
30
|
+
}, z.core.$strip>]>>]>>;
|
|
31
|
+
bcc: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
32
|
+
email: z.ZodString;
|
|
33
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
34
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
35
|
+
email: z.ZodString;
|
|
36
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
37
|
+
}, z.core.$strip>]>>]>>;
|
|
38
|
+
from: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
39
|
+
email: z.ZodString;
|
|
40
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
41
|
+
}, z.core.$strip>]>>;
|
|
42
|
+
subject: z.ZodString;
|
|
43
|
+
text: z.ZodOptional<z.ZodString>;
|
|
44
|
+
html: z.ZodOptional<z.ZodString>;
|
|
45
|
+
templateId: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
templateVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
type IContact = z.infer<typeof iContactSchema>;
|
|
49
|
+
type IEmail = z.infer<typeof iEmailSchema>;
|
|
50
|
+
|
|
51
|
+
declare abstract class IEmailConnector {
|
|
52
|
+
static providerName: string;
|
|
53
|
+
API_KEY: string;
|
|
54
|
+
SMTP_HOST: string;
|
|
55
|
+
SENDER: IContact;
|
|
56
|
+
protected constructor({ API_KEY, SMTP_HOST, SENDER, }: {
|
|
57
|
+
API_KEY: string;
|
|
58
|
+
SMTP_HOST: string;
|
|
59
|
+
SENDER: IContact;
|
|
60
|
+
});
|
|
61
|
+
abstract sendEmail(email: IEmail): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare const sendEmailInputSchema: z$1.ZodObject<{
|
|
65
|
+
email: z$1.ZodObject<{
|
|
66
|
+
to: z$1.ZodUnion<readonly [z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
67
|
+
email: z$1.ZodString;
|
|
68
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
69
|
+
}, z$1.core.$strip>]>, z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
70
|
+
email: z$1.ZodString;
|
|
71
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
72
|
+
}, z$1.core.$strip>]>>]>;
|
|
73
|
+
replyTo: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
74
|
+
email: z$1.ZodString;
|
|
75
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
76
|
+
}, z$1.core.$strip>]>, z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
77
|
+
email: z$1.ZodString;
|
|
78
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
79
|
+
}, z$1.core.$strip>]>>]>>;
|
|
80
|
+
cc: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
81
|
+
email: z$1.ZodString;
|
|
82
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
83
|
+
}, z$1.core.$strip>]>, z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
84
|
+
email: z$1.ZodString;
|
|
85
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
86
|
+
}, z$1.core.$strip>]>>]>>;
|
|
87
|
+
bcc: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
88
|
+
email: z$1.ZodString;
|
|
89
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
90
|
+
}, z$1.core.$strip>]>, z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
91
|
+
email: z$1.ZodString;
|
|
92
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
93
|
+
}, z$1.core.$strip>]>>]>>;
|
|
94
|
+
from: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
95
|
+
email: z$1.ZodString;
|
|
96
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
97
|
+
}, z$1.core.$strip>]>>;
|
|
98
|
+
subject: z$1.ZodString;
|
|
99
|
+
text: z$1.ZodOptional<z$1.ZodString>;
|
|
100
|
+
html: z$1.ZodOptional<z$1.ZodString>;
|
|
101
|
+
templateId: z$1.ZodOptional<z$1.ZodNumber>;
|
|
102
|
+
templateVariables: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
103
|
+
}, z$1.core.$strip>;
|
|
104
|
+
metadata: z$1.ZodObject<{
|
|
105
|
+
userAgent: z$1.ZodOptional<z$1.ZodString>;
|
|
106
|
+
ip: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodIPv4, z$1.ZodIPv6]>>;
|
|
107
|
+
initiator: z$1.ZodObject<{
|
|
108
|
+
service: z$1.ZodString;
|
|
109
|
+
userId: z$1.ZodOptional<z$1.ZodString>;
|
|
110
|
+
}, z$1.core.$strip>;
|
|
111
|
+
}, z$1.core.$strip>;
|
|
112
|
+
}, z$1.core.$strip>;
|
|
113
|
+
interface SendEmailInput extends z$1.infer<typeof sendEmailInputSchema> {
|
|
114
|
+
}
|
|
115
|
+
interface SendEmailOutput {
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare const sendSlackInputSchema: z$2.ZodObject<{
|
|
119
|
+
slack: z$2.ZodObject<{
|
|
120
|
+
message: z$2.ZodString;
|
|
121
|
+
}, z$2.core.$strip>;
|
|
122
|
+
metadata: z$2.ZodObject<{
|
|
123
|
+
userAgent: z$2.ZodOptional<z$2.ZodString>;
|
|
124
|
+
ip: z$2.ZodOptional<z$2.ZodUnion<[z$2.ZodIPv4, z$2.ZodIPv6]>>;
|
|
125
|
+
initiator: z$2.ZodObject<{
|
|
126
|
+
service: z$2.ZodString;
|
|
127
|
+
userId: z$2.ZodOptional<z$2.ZodString>;
|
|
128
|
+
}, z$2.core.$strip>;
|
|
129
|
+
}, z$2.core.$strip>;
|
|
130
|
+
}, z$2.core.$strip>;
|
|
131
|
+
interface SendSlackInput extends z$2.infer<typeof sendSlackInputSchema> {
|
|
132
|
+
}
|
|
133
|
+
interface SendSlackOutput {
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
declare const sendSmsInputSchema: z.ZodObject<{
|
|
137
|
+
sms: z.ZodObject<{
|
|
138
|
+
message: z.ZodString;
|
|
139
|
+
to: z.ZodString;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
metadata: z.ZodObject<{
|
|
142
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
143
|
+
ip: z.ZodOptional<z.ZodUnion<[z.ZodIPv4, z.ZodIPv6]>>;
|
|
144
|
+
initiator: z.ZodObject<{
|
|
145
|
+
service: z.ZodString;
|
|
146
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
interface SendSmsInput extends z.infer<typeof sendSmsInputSchema> {
|
|
151
|
+
}
|
|
152
|
+
interface SendSmsOutput {
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
interface IPushNotification {
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface NotificationQueueMessage {
|
|
159
|
+
type: 'email' | 'sms' | 'pushNotification' | 'slack';
|
|
160
|
+
metadata: {
|
|
161
|
+
userAgent?: string;
|
|
162
|
+
ip?: string;
|
|
163
|
+
initiator: {
|
|
164
|
+
service: string;
|
|
165
|
+
userId?: string;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
payload: {
|
|
169
|
+
email?: IEmail;
|
|
170
|
+
sms?: ISms;
|
|
171
|
+
pushNotification?: IPushNotification;
|
|
172
|
+
slack?: ISlack;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
interface ISms {
|
|
177
|
+
message: string;
|
|
178
|
+
to: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare abstract class ISmsConnector {
|
|
182
|
+
static providerName: string;
|
|
183
|
+
ACCOUNT_ID: string;
|
|
184
|
+
AUTH_TOKEN: string;
|
|
185
|
+
SERVICE_ID: string;
|
|
186
|
+
protected constructor({ ACCOUNT_ID, AUTH_TOKEN, SERVICE_ID, }: {
|
|
187
|
+
ACCOUNT_ID: string;
|
|
188
|
+
AUTH_TOKEN: string;
|
|
189
|
+
SERVICE_ID: string;
|
|
190
|
+
});
|
|
191
|
+
abstract sendSms(sms: ISms): Promise<InternalError | void>;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
interface ISlack {
|
|
195
|
+
message: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export { IEmailConnector as I, ISmsConnector as a, iContactSchema as j, iEmailSchema as k, sendSlackInputSchema as l, sendSmsInputSchema as m, sendEmailInputSchema as s };
|
|
199
|
+
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f, IContact as g, IEmail as h, ISms as i, IPushNotification as n, ISlack as o };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import z$1, { z } from 'zod';
|
|
2
|
+
import { z as z$2 } from 'zod/v4';
|
|
3
|
+
import { InternalError } from '@develit-io/backend-sdk';
|
|
4
|
+
|
|
5
|
+
declare const iContactSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
6
|
+
email: z.ZodString;
|
|
7
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
8
|
+
}, z.core.$strip>]>;
|
|
9
|
+
declare const iEmailSchema: z.ZodObject<{
|
|
10
|
+
to: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
11
|
+
email: z.ZodString;
|
|
12
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
13
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
14
|
+
email: z.ZodString;
|
|
15
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
16
|
+
}, z.core.$strip>]>>]>;
|
|
17
|
+
replyTo: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
18
|
+
email: z.ZodString;
|
|
19
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
20
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
21
|
+
email: z.ZodString;
|
|
22
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
23
|
+
}, z.core.$strip>]>>]>>;
|
|
24
|
+
cc: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
25
|
+
email: z.ZodString;
|
|
26
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
27
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
28
|
+
email: z.ZodString;
|
|
29
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
30
|
+
}, z.core.$strip>]>>]>>;
|
|
31
|
+
bcc: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
32
|
+
email: z.ZodString;
|
|
33
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
34
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
35
|
+
email: z.ZodString;
|
|
36
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
37
|
+
}, z.core.$strip>]>>]>>;
|
|
38
|
+
from: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
39
|
+
email: z.ZodString;
|
|
40
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
41
|
+
}, z.core.$strip>]>>;
|
|
42
|
+
subject: z.ZodString;
|
|
43
|
+
text: z.ZodOptional<z.ZodString>;
|
|
44
|
+
html: z.ZodOptional<z.ZodString>;
|
|
45
|
+
templateId: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
templateVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
type IContact = z.infer<typeof iContactSchema>;
|
|
49
|
+
type IEmail = z.infer<typeof iEmailSchema>;
|
|
50
|
+
|
|
51
|
+
declare abstract class IEmailConnector {
|
|
52
|
+
static providerName: string;
|
|
53
|
+
API_KEY: string;
|
|
54
|
+
SMTP_HOST: string;
|
|
55
|
+
SENDER: IContact;
|
|
56
|
+
protected constructor({ API_KEY, SMTP_HOST, SENDER, }: {
|
|
57
|
+
API_KEY: string;
|
|
58
|
+
SMTP_HOST: string;
|
|
59
|
+
SENDER: IContact;
|
|
60
|
+
});
|
|
61
|
+
abstract sendEmail(email: IEmail): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare const sendEmailInputSchema: z$1.ZodObject<{
|
|
65
|
+
email: z$1.ZodObject<{
|
|
66
|
+
to: z$1.ZodUnion<readonly [z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
67
|
+
email: z$1.ZodString;
|
|
68
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
69
|
+
}, z$1.core.$strip>]>, z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
70
|
+
email: z$1.ZodString;
|
|
71
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
72
|
+
}, z$1.core.$strip>]>>]>;
|
|
73
|
+
replyTo: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
74
|
+
email: z$1.ZodString;
|
|
75
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
76
|
+
}, z$1.core.$strip>]>, z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
77
|
+
email: z$1.ZodString;
|
|
78
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
79
|
+
}, z$1.core.$strip>]>>]>>;
|
|
80
|
+
cc: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
81
|
+
email: z$1.ZodString;
|
|
82
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
83
|
+
}, z$1.core.$strip>]>, z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
84
|
+
email: z$1.ZodString;
|
|
85
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
86
|
+
}, z$1.core.$strip>]>>]>>;
|
|
87
|
+
bcc: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
88
|
+
email: z$1.ZodString;
|
|
89
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
90
|
+
}, z$1.core.$strip>]>, z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
91
|
+
email: z$1.ZodString;
|
|
92
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
93
|
+
}, z$1.core.$strip>]>>]>>;
|
|
94
|
+
from: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
|
|
95
|
+
email: z$1.ZodString;
|
|
96
|
+
name: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodUndefined]>;
|
|
97
|
+
}, z$1.core.$strip>]>>;
|
|
98
|
+
subject: z$1.ZodString;
|
|
99
|
+
text: z$1.ZodOptional<z$1.ZodString>;
|
|
100
|
+
html: z$1.ZodOptional<z$1.ZodString>;
|
|
101
|
+
templateId: z$1.ZodOptional<z$1.ZodNumber>;
|
|
102
|
+
templateVariables: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
103
|
+
}, z$1.core.$strip>;
|
|
104
|
+
metadata: z$1.ZodObject<{
|
|
105
|
+
userAgent: z$1.ZodOptional<z$1.ZodString>;
|
|
106
|
+
ip: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodIPv4, z$1.ZodIPv6]>>;
|
|
107
|
+
initiator: z$1.ZodObject<{
|
|
108
|
+
service: z$1.ZodString;
|
|
109
|
+
userId: z$1.ZodOptional<z$1.ZodString>;
|
|
110
|
+
}, z$1.core.$strip>;
|
|
111
|
+
}, z$1.core.$strip>;
|
|
112
|
+
}, z$1.core.$strip>;
|
|
113
|
+
interface SendEmailInput extends z$1.infer<typeof sendEmailInputSchema> {
|
|
114
|
+
}
|
|
115
|
+
interface SendEmailOutput {
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare const sendSlackInputSchema: z$2.ZodObject<{
|
|
119
|
+
slack: z$2.ZodObject<{
|
|
120
|
+
message: z$2.ZodString;
|
|
121
|
+
}, z$2.core.$strip>;
|
|
122
|
+
metadata: z$2.ZodObject<{
|
|
123
|
+
userAgent: z$2.ZodOptional<z$2.ZodString>;
|
|
124
|
+
ip: z$2.ZodOptional<z$2.ZodUnion<[z$2.ZodIPv4, z$2.ZodIPv6]>>;
|
|
125
|
+
initiator: z$2.ZodObject<{
|
|
126
|
+
service: z$2.ZodString;
|
|
127
|
+
userId: z$2.ZodOptional<z$2.ZodString>;
|
|
128
|
+
}, z$2.core.$strip>;
|
|
129
|
+
}, z$2.core.$strip>;
|
|
130
|
+
}, z$2.core.$strip>;
|
|
131
|
+
interface SendSlackInput extends z$2.infer<typeof sendSlackInputSchema> {
|
|
132
|
+
}
|
|
133
|
+
interface SendSlackOutput {
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
declare const sendSmsInputSchema: z.ZodObject<{
|
|
137
|
+
sms: z.ZodObject<{
|
|
138
|
+
message: z.ZodString;
|
|
139
|
+
to: z.ZodString;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
metadata: z.ZodObject<{
|
|
142
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
143
|
+
ip: z.ZodOptional<z.ZodUnion<[z.ZodIPv4, z.ZodIPv6]>>;
|
|
144
|
+
initiator: z.ZodObject<{
|
|
145
|
+
service: z.ZodString;
|
|
146
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
interface SendSmsInput extends z.infer<typeof sendSmsInputSchema> {
|
|
151
|
+
}
|
|
152
|
+
interface SendSmsOutput {
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
interface IPushNotification {
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface NotificationQueueMessage {
|
|
159
|
+
type: 'email' | 'sms' | 'pushNotification' | 'slack';
|
|
160
|
+
metadata: {
|
|
161
|
+
userAgent?: string;
|
|
162
|
+
ip?: string;
|
|
163
|
+
initiator: {
|
|
164
|
+
service: string;
|
|
165
|
+
userId?: string;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
payload: {
|
|
169
|
+
email?: IEmail;
|
|
170
|
+
sms?: ISms;
|
|
171
|
+
pushNotification?: IPushNotification;
|
|
172
|
+
slack?: ISlack;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
interface ISms {
|
|
177
|
+
message: string;
|
|
178
|
+
to: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare abstract class ISmsConnector {
|
|
182
|
+
static providerName: string;
|
|
183
|
+
ACCOUNT_ID: string;
|
|
184
|
+
AUTH_TOKEN: string;
|
|
185
|
+
SERVICE_ID: string;
|
|
186
|
+
protected constructor({ ACCOUNT_ID, AUTH_TOKEN, SERVICE_ID, }: {
|
|
187
|
+
ACCOUNT_ID: string;
|
|
188
|
+
AUTH_TOKEN: string;
|
|
189
|
+
SERVICE_ID: string;
|
|
190
|
+
});
|
|
191
|
+
abstract sendSms(sms: ISms): Promise<InternalError | void>;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
interface ISlack {
|
|
195
|
+
message: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export { IEmailConnector as I, ISmsConnector as a, iContactSchema as j, iEmailSchema as k, sendSlackInputSchema as l, sendSmsInputSchema as m, sendEmailInputSchema as s };
|
|
199
|
+
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f, IContact as g, IEmail as h, ISms as i, IPushNotification as n, ISlack as o };
|