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