alepha 0.10.5 → 0.10.7

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.
@@ -0,0 +1,377 @@
1
+ import * as _alepha_core1 from "alepha";
2
+ import { Alepha, Descriptor, KIND, Static, TObject } from "alepha";
3
+ import * as _alepha_batch0 from "alepha/batch";
4
+ import { DateTimeProvider } from "alepha/datetime";
5
+ import * as _alepha_logger0 from "alepha/logger";
6
+ import * as _alepha_postgres84 from "alepha/postgres";
7
+ import * as _alepha_queue0 from "alepha/queue";
8
+ import { EmailProvider } from "alepha/email";
9
+ import * as typebox93 from "typebox";
10
+
11
+ //#region src/controllers/NotificationController.d.ts
12
+ declare class NotificationController {}
13
+ //#endregion
14
+ //#region src/entities/notifications.d.ts
15
+ declare const notifications: _alepha_postgres84.PgTableWithColumnsAndSchema<_alepha_postgres84.PgTableConfig<"notifications", typebox93.TObject<{
16
+ id: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_PRIMARY_KEY>, typeof _alepha_postgres84.PG_DEFAULT>;
17
+ version: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TInteger, typeof _alepha_postgres84.PG_VERSION>, typeof _alepha_postgres84.PG_DEFAULT>;
18
+ createdAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_CREATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
19
+ updatedAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_UPDATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
20
+ type: typebox93.TUnsafe<"email" | "sms">;
21
+ template: typebox93.TString;
22
+ category: typebox93.TOptional<typebox93.TString>;
23
+ critical: typebox93.TOptional<typebox93.TBoolean>;
24
+ sensitive: typebox93.TOptional<typebox93.TBoolean>;
25
+ contact: typebox93.TString;
26
+ variables: typebox93.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
27
+ scheduledAt: typebox93.TOptional<typebox93.TString>;
28
+ sentAt: typebox93.TOptional<typebox93.TString>;
29
+ error: typebox93.TOptional<typebox93.TObject<{
30
+ at: typebox93.TString;
31
+ name: typebox93.TString;
32
+ message: typebox93.TString;
33
+ }>>;
34
+ }>, _alepha_postgres84.FromSchema<typebox93.TObject<{
35
+ id: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_PRIMARY_KEY>, typeof _alepha_postgres84.PG_DEFAULT>;
36
+ version: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TInteger, typeof _alepha_postgres84.PG_VERSION>, typeof _alepha_postgres84.PG_DEFAULT>;
37
+ createdAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_CREATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
38
+ updatedAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_UPDATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
39
+ type: typebox93.TUnsafe<"email" | "sms">;
40
+ template: typebox93.TString;
41
+ category: typebox93.TOptional<typebox93.TString>;
42
+ critical: typebox93.TOptional<typebox93.TBoolean>;
43
+ sensitive: typebox93.TOptional<typebox93.TBoolean>;
44
+ contact: typebox93.TString;
45
+ variables: typebox93.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
46
+ scheduledAt: typebox93.TOptional<typebox93.TString>;
47
+ sentAt: typebox93.TOptional<typebox93.TString>;
48
+ error: typebox93.TOptional<typebox93.TObject<{
49
+ at: typebox93.TString;
50
+ name: typebox93.TString;
51
+ message: typebox93.TString;
52
+ }>>;
53
+ }>>>, typebox93.TObject<{
54
+ id: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_PRIMARY_KEY>, typeof _alepha_postgres84.PG_DEFAULT>;
55
+ version: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TInteger, typeof _alepha_postgres84.PG_VERSION>, typeof _alepha_postgres84.PG_DEFAULT>;
56
+ createdAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_CREATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
57
+ updatedAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_UPDATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
58
+ type: typebox93.TUnsafe<"email" | "sms">;
59
+ template: typebox93.TString;
60
+ category: typebox93.TOptional<typebox93.TString>;
61
+ critical: typebox93.TOptional<typebox93.TBoolean>;
62
+ sensitive: typebox93.TOptional<typebox93.TBoolean>;
63
+ contact: typebox93.TString;
64
+ variables: typebox93.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
65
+ scheduledAt: typebox93.TOptional<typebox93.TString>;
66
+ sentAt: typebox93.TOptional<typebox93.TString>;
67
+ error: typebox93.TOptional<typebox93.TObject<{
68
+ at: typebox93.TString;
69
+ name: typebox93.TString;
70
+ message: typebox93.TString;
71
+ }>>;
72
+ }>>;
73
+ type NotificationEntity = Static<typeof notifications.$schema>;
74
+ //#endregion
75
+ //#region src/providers/SmsProvider.d.ts
76
+ declare abstract class SmsProvider {
77
+ abstract send(options: SmsSendOptions): Promise<void>;
78
+ }
79
+ interface SmsSendOptions {
80
+ to: string;
81
+ message: string;
82
+ }
83
+ //#endregion
84
+ //#region src/services/NotificationSenderService.d.ts
85
+ declare class NotificationSenderService {
86
+ protected readonly alepha: Alepha;
87
+ protected readonly log: _alepha_logger0.Logger;
88
+ protected readonly notificationRepository: _alepha_postgres84.RepositoryDescriptor<_alepha_postgres84.PgTableConfig<"notifications", typebox93.TObject<{
89
+ id: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_PRIMARY_KEY>, typeof _alepha_postgres84.PG_DEFAULT>;
90
+ version: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TInteger, typeof _alepha_postgres84.PG_VERSION>, typeof _alepha_postgres84.PG_DEFAULT>;
91
+ createdAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_CREATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
92
+ updatedAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_UPDATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
93
+ type: typebox93.TUnsafe<"email" | "sms">;
94
+ template: typebox93.TString;
95
+ category: typebox93.TOptional<typebox93.TString>;
96
+ critical: typebox93.TOptional<typebox93.TBoolean>;
97
+ sensitive: typebox93.TOptional<typebox93.TBoolean>;
98
+ contact: typebox93.TString;
99
+ variables: typebox93.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
100
+ scheduledAt: typebox93.TOptional<typebox93.TString>;
101
+ sentAt: typebox93.TOptional<typebox93.TString>;
102
+ error: typebox93.TOptional<typebox93.TObject<{
103
+ at: typebox93.TString;
104
+ name: typebox93.TString;
105
+ message: typebox93.TString;
106
+ }>>;
107
+ }>, _alepha_postgres84.FromSchema<typebox93.TObject<{
108
+ id: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_PRIMARY_KEY>, typeof _alepha_postgres84.PG_DEFAULT>;
109
+ version: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TInteger, typeof _alepha_postgres84.PG_VERSION>, typeof _alepha_postgres84.PG_DEFAULT>;
110
+ createdAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_CREATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
111
+ updatedAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_UPDATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
112
+ type: typebox93.TUnsafe<"email" | "sms">;
113
+ template: typebox93.TString;
114
+ category: typebox93.TOptional<typebox93.TString>;
115
+ critical: typebox93.TOptional<typebox93.TBoolean>;
116
+ sensitive: typebox93.TOptional<typebox93.TBoolean>;
117
+ contact: typebox93.TString;
118
+ variables: typebox93.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
119
+ scheduledAt: typebox93.TOptional<typebox93.TString>;
120
+ sentAt: typebox93.TOptional<typebox93.TString>;
121
+ error: typebox93.TOptional<typebox93.TObject<{
122
+ at: typebox93.TString;
123
+ name: typebox93.TString;
124
+ message: typebox93.TString;
125
+ }>>;
126
+ }>>>, typebox93.TObject<{
127
+ id: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_PRIMARY_KEY>, typeof _alepha_postgres84.PG_DEFAULT>;
128
+ version: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TInteger, typeof _alepha_postgres84.PG_VERSION>, typeof _alepha_postgres84.PG_DEFAULT>;
129
+ createdAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_CREATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
130
+ updatedAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_UPDATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
131
+ type: typebox93.TUnsafe<"email" | "sms">;
132
+ template: typebox93.TString;
133
+ category: typebox93.TOptional<typebox93.TString>;
134
+ critical: typebox93.TOptional<typebox93.TBoolean>;
135
+ sensitive: typebox93.TOptional<typebox93.TBoolean>;
136
+ contact: typebox93.TString;
137
+ variables: typebox93.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
138
+ scheduledAt: typebox93.TOptional<typebox93.TString>;
139
+ sentAt: typebox93.TOptional<typebox93.TString>;
140
+ error: typebox93.TOptional<typebox93.TObject<{
141
+ at: typebox93.TString;
142
+ name: typebox93.TString;
143
+ message: typebox93.TString;
144
+ }>>;
145
+ }>>;
146
+ protected readonly dateTimeProvider: DateTimeProvider;
147
+ protected readonly emailProvider: EmailProvider;
148
+ protected readonly smsProvider: SmsProvider;
149
+ send(notificationId: string | NotificationEntity): Promise<void>;
150
+ renderSms(notification: NotificationEntity): {
151
+ to: string;
152
+ message: string;
153
+ };
154
+ renderEmail(notification: NotificationEntity): {
155
+ to: string;
156
+ subject: string;
157
+ body: string;
158
+ };
159
+ protected load(notification: NotificationEntity): {
160
+ template: NotificationDescriptor<typebox93.TObject<typebox93.TProperties>>;
161
+ variables: Record<string, any>;
162
+ contact: string;
163
+ };
164
+ }
165
+ //#endregion
166
+ //#region src/queues/NotificationQueues.d.ts
167
+ declare class NotificationQueues {
168
+ protected readonly notificationSenderService: NotificationSenderService;
169
+ readonly processNotification: _alepha_queue0.QueueDescriptor<typebox93.TObject<{
170
+ notificationId: typebox93.TString;
171
+ }>>;
172
+ }
173
+ //#endregion
174
+ //#region src/schemas/notificationCreateSchema.d.ts
175
+ declare const notificationCreateSchema: typebox93.TObject<{
176
+ type: typebox93.TUnsafe<"email" | "sms">;
177
+ template: typebox93.TString;
178
+ contact: typebox93.TString;
179
+ variables: typebox93.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
180
+ }>;
181
+ type NotificationCreate = Static<typeof notificationCreateSchema>;
182
+ //#endregion
183
+ //#region src/services/NotificationService.d.ts
184
+ declare const envSchema: _alepha_core1.TObject<{
185
+ NOTIFICATION_IMMEDIATE: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
186
+ }>;
187
+ declare module "alepha" {
188
+ interface Env extends Partial<Static<typeof envSchema>> {}
189
+ }
190
+ declare class NotificationService {
191
+ protected readonly alepha: Alepha;
192
+ protected readonly log: _alepha_logger0.Logger;
193
+ protected readonly env: {
194
+ NOTIFICATION_IMMEDIATE?: boolean | undefined;
195
+ };
196
+ protected readonly notificationRepository: _alepha_postgres84.RepositoryDescriptor<_alepha_postgres84.PgTableConfig<"notifications", _alepha_core1.TObject<{
197
+ id: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_PRIMARY_KEY>, typeof _alepha_postgres84.PG_DEFAULT>;
198
+ version: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TInteger, typeof _alepha_postgres84.PG_VERSION>, typeof _alepha_postgres84.PG_DEFAULT>;
199
+ createdAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_CREATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
200
+ updatedAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_UPDATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
201
+ type: typebox93.TUnsafe<"email" | "sms">;
202
+ template: typebox93.TString;
203
+ category: _alepha_core1.TOptional<typebox93.TString>;
204
+ critical: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
205
+ sensitive: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
206
+ contact: typebox93.TString;
207
+ variables: _alepha_core1.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
208
+ scheduledAt: _alepha_core1.TOptional<typebox93.TString>;
209
+ sentAt: _alepha_core1.TOptional<typebox93.TString>;
210
+ error: _alepha_core1.TOptional<_alepha_core1.TObject<{
211
+ at: typebox93.TString;
212
+ name: typebox93.TString;
213
+ message: typebox93.TString;
214
+ }>>;
215
+ }>, _alepha_postgres84.FromSchema<_alepha_core1.TObject<{
216
+ id: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_PRIMARY_KEY>, typeof _alepha_postgres84.PG_DEFAULT>;
217
+ version: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TInteger, typeof _alepha_postgres84.PG_VERSION>, typeof _alepha_postgres84.PG_DEFAULT>;
218
+ createdAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_CREATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
219
+ updatedAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_UPDATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
220
+ type: typebox93.TUnsafe<"email" | "sms">;
221
+ template: typebox93.TString;
222
+ category: _alepha_core1.TOptional<typebox93.TString>;
223
+ critical: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
224
+ sensitive: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
225
+ contact: typebox93.TString;
226
+ variables: _alepha_core1.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
227
+ scheduledAt: _alepha_core1.TOptional<typebox93.TString>;
228
+ sentAt: _alepha_core1.TOptional<typebox93.TString>;
229
+ error: _alepha_core1.TOptional<_alepha_core1.TObject<{
230
+ at: typebox93.TString;
231
+ name: typebox93.TString;
232
+ message: typebox93.TString;
233
+ }>>;
234
+ }>>>, _alepha_core1.TObject<{
235
+ id: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_PRIMARY_KEY>, typeof _alepha_postgres84.PG_DEFAULT>;
236
+ version: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TInteger, typeof _alepha_postgres84.PG_VERSION>, typeof _alepha_postgres84.PG_DEFAULT>;
237
+ createdAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_CREATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
238
+ updatedAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_UPDATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
239
+ type: typebox93.TUnsafe<"email" | "sms">;
240
+ template: typebox93.TString;
241
+ category: _alepha_core1.TOptional<typebox93.TString>;
242
+ critical: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
243
+ sensitive: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
244
+ contact: typebox93.TString;
245
+ variables: _alepha_core1.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
246
+ scheduledAt: _alepha_core1.TOptional<typebox93.TString>;
247
+ sentAt: _alepha_core1.TOptional<typebox93.TString>;
248
+ error: _alepha_core1.TOptional<_alepha_core1.TObject<{
249
+ at: typebox93.TString;
250
+ name: typebox93.TString;
251
+ message: typebox93.TString;
252
+ }>>;
253
+ }>>;
254
+ protected readonly dateTimeProvider: DateTimeProvider;
255
+ protected readonly notificationQueues: NotificationQueues;
256
+ protected readonly notificationSenderService: NotificationSenderService;
257
+ readonly notificationBatch: _alepha_batch0.BatchDescriptor<_alepha_core1.TObject<{
258
+ type: typebox93.TUnsafe<"email" | "sms">;
259
+ template: typebox93.TString;
260
+ contact: typebox93.TString;
261
+ variables: _alepha_core1.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
262
+ }>, Promise<void>>;
263
+ findNotificationById(id: string): Promise<_alepha_postgres84.PgStatic<_alepha_core1.TObject<{
264
+ id: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_PRIMARY_KEY>, typeof _alepha_postgres84.PG_DEFAULT>;
265
+ version: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TInteger, typeof _alepha_postgres84.PG_VERSION>, typeof _alepha_postgres84.PG_DEFAULT>;
266
+ createdAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_CREATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
267
+ updatedAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_UPDATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
268
+ type: typebox93.TUnsafe<"email" | "sms">;
269
+ template: typebox93.TString;
270
+ category: _alepha_core1.TOptional<typebox93.TString>;
271
+ critical: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
272
+ sensitive: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
273
+ contact: typebox93.TString;
274
+ variables: _alepha_core1.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
275
+ scheduledAt: _alepha_core1.TOptional<typebox93.TString>;
276
+ sentAt: _alepha_core1.TOptional<typebox93.TString>;
277
+ error: _alepha_core1.TOptional<_alepha_core1.TObject<{
278
+ at: typebox93.TString;
279
+ name: typebox93.TString;
280
+ message: typebox93.TString;
281
+ }>>;
282
+ }>, _alepha_postgres84.PgRelationMap<_alepha_core1.TObject<{
283
+ id: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_PRIMARY_KEY>, typeof _alepha_postgres84.PG_DEFAULT>;
284
+ version: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TInteger, typeof _alepha_postgres84.PG_VERSION>, typeof _alepha_postgres84.PG_DEFAULT>;
285
+ createdAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_CREATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
286
+ updatedAt: _alepha_postgres84.PgAttr<_alepha_postgres84.PgAttr<typebox93.TString, typeof _alepha_postgres84.PG_UPDATED_AT>, typeof _alepha_postgres84.PG_DEFAULT>;
287
+ type: typebox93.TUnsafe<"email" | "sms">;
288
+ template: typebox93.TString;
289
+ category: _alepha_core1.TOptional<typebox93.TString>;
290
+ critical: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
291
+ sensitive: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
292
+ contact: typebox93.TString;
293
+ variables: _alepha_core1.TOptional<typebox93.TRecord<"^.*$", typebox93.TAny>>;
294
+ scheduledAt: _alepha_core1.TOptional<typebox93.TString>;
295
+ sentAt: _alepha_core1.TOptional<typebox93.TString>;
296
+ error: _alepha_core1.TOptional<_alepha_core1.TObject<{
297
+ at: typebox93.TString;
298
+ name: typebox93.TString;
299
+ message: typebox93.TString;
300
+ }>>;
301
+ }>>>>;
302
+ /**
303
+ * Create a new notification.
304
+ */
305
+ createNotification(entry: NotificationCreate, now?: boolean): Promise<void>;
306
+ }
307
+ //#endregion
308
+ //#region src/descriptors/$notification.d.ts
309
+ declare const $notification: {
310
+ <T extends TObject>(options: NotificationDescriptorOptions<T>): NotificationDescriptor<T>;
311
+ [KIND]: typeof NotificationDescriptor;
312
+ };
313
+ interface NotificationDescriptorOptions<T$1 extends TObject> extends NotificationMessage<T$1> {
314
+ name?: string;
315
+ description?: string;
316
+ category?: string;
317
+ critical?: boolean;
318
+ sensitive?: boolean;
319
+ translations?: {
320
+ [lang: string]: NotificationMessage<T$1>;
321
+ };
322
+ schema: T$1;
323
+ }
324
+ declare class NotificationDescriptor<T$1 extends TObject> extends Descriptor<NotificationDescriptorOptions<T$1>> {
325
+ protected readonly notificationService: NotificationService;
326
+ get name(): string;
327
+ push(options: NotificationPushOptions<T$1>): Promise<void>;
328
+ configure(options: Partial<NotificationDescriptorOptions<T$1>>): void;
329
+ }
330
+ interface NotificationPushOptions<T$1 extends TObject> {
331
+ variables: Static<T$1>;
332
+ contact: string;
333
+ }
334
+ interface NotificationMessage<T$1 extends TObject> {
335
+ email?: {
336
+ subject: string;
337
+ body: string | ((variables: Static<T$1>) => string);
338
+ };
339
+ sms?: {
340
+ message: string | ((variables: Static<T$1>) => string);
341
+ };
342
+ }
343
+ //#endregion
344
+ //#region src/jobs/NotificationJobs.d.ts
345
+ declare class NotificationJobs {}
346
+ //#endregion
347
+ //#region src/providers/MemorySmsProvider.d.ts
348
+ interface SmsRecord {
349
+ to: string;
350
+ message: string;
351
+ sentAt: Date;
352
+ }
353
+ declare class MemorySmsProvider extends SmsProvider {
354
+ protected records: SmsRecord[];
355
+ send(options: SmsSendOptions): Promise<void>;
356
+ }
357
+ //#endregion
358
+ //#region src/schemas/notificationContactPreferencesSchema.d.ts
359
+ declare const notificationContactPreferencesSchema: typebox93.TObject<{
360
+ language: typebox93.TOptional<typebox93.TString>;
361
+ exclude: typebox93.TArray<typebox93.TString>;
362
+ }>;
363
+ type NotificationContactPreferences = Static<typeof notificationContactPreferencesSchema>;
364
+ //#endregion
365
+ //#region src/index.d.ts
366
+ /**
367
+ * Provides notification management API endpoints for Alepha applications.
368
+ *
369
+ * This module includes notification sending, retrieval, status tracking,
370
+ * and user notification preferences management.
371
+ *
372
+ * @module alepha.api.notifications
373
+ */
374
+ declare const AlephaApiNotifications: _alepha_core1.Service<_alepha_core1.Module<{}>>;
375
+ //#endregion
376
+ export { $notification, AlephaApiNotifications, MemorySmsProvider, NotificationContactPreferences, NotificationController, NotificationCreate, NotificationDescriptor, NotificationDescriptorOptions, NotificationEntity, NotificationJobs, NotificationMessage, NotificationPushOptions, NotificationQueues, NotificationSenderService, NotificationService, SmsProvider, SmsRecord, SmsSendOptions, notificationContactPreferencesSchema, notificationCreateSchema, notifications };
377
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ export * from '@alepha/api-notifications'