alepha 0.11.4 → 0.11.5

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/devtools.d.ts CHANGED
@@ -1 +1,370 @@
1
- export * from '@alepha/devtools';
1
+ import * as _alepha_core1 from "alepha";
2
+ import { Alepha, Static } from "alepha";
3
+ import * as _alepha_logger0 from "alepha/logger";
4
+ import { LogEntry } from "alepha/logger";
5
+ import * as _alepha_server0 from "alepha/server";
6
+ import { ServerProvider } from "alepha/server";
7
+ import * as _alepha_server_static0 from "alepha/server/static";
8
+ import * as typebox156 from "typebox";
9
+ import * as dayjs0 from "dayjs";
10
+
11
+ //#region src/schemas/DevActionMetadata.d.ts
12
+ declare const devActionMetadataSchema: typebox156.TObject<{
13
+ name: typebox156.TString;
14
+ group: typebox156.TString;
15
+ method: typebox156.TString;
16
+ path: typebox156.TString;
17
+ prefix: typebox156.TString;
18
+ fullPath: typebox156.TString;
19
+ description: typebox156.TOptional<typebox156.TString>;
20
+ summary: typebox156.TOptional<typebox156.TString>;
21
+ disabled: typebox156.TOptional<typebox156.TBoolean>;
22
+ secure: typebox156.TOptional<typebox156.TBoolean>;
23
+ hide: typebox156.TOptional<typebox156.TBoolean>;
24
+ body: typebox156.TOptional<typebox156.TAny>;
25
+ params: typebox156.TOptional<typebox156.TAny>;
26
+ query: typebox156.TOptional<typebox156.TAny>;
27
+ response: typebox156.TOptional<typebox156.TAny>;
28
+ bodyContentType: typebox156.TOptional<typebox156.TString>;
29
+ }>;
30
+ type DevActionMetadata = Static<typeof devActionMetadataSchema>;
31
+ //#endregion
32
+ //#region src/schemas/DevBucketMetadata.d.ts
33
+ declare const devBucketMetadataSchema: typebox156.TObject<{
34
+ name: typebox156.TString;
35
+ description: typebox156.TOptional<typebox156.TString>;
36
+ mimeTypes: typebox156.TOptional<typebox156.TArray<typebox156.TString>>;
37
+ maxSize: typebox156.TOptional<typebox156.TNumber>;
38
+ provider: typebox156.TString;
39
+ }>;
40
+ type DevBucketMetadata = Static<typeof devBucketMetadataSchema>;
41
+ //#endregion
42
+ //#region src/schemas/DevCacheMetadata.d.ts
43
+ declare const devCacheMetadataSchema: typebox156.TObject<{
44
+ name: typebox156.TString;
45
+ ttl: typebox156.TOptional<typebox156.TAny>;
46
+ disabled: typebox156.TOptional<typebox156.TBoolean>;
47
+ provider: typebox156.TString;
48
+ }>;
49
+ type DevCacheMetadata = Static<typeof devCacheMetadataSchema>;
50
+ //#endregion
51
+ //#region src/schemas/DevMetadata.d.ts
52
+ declare const devMetadataSchema: typebox156.TObject<{
53
+ actions: typebox156.TArray<typebox156.TObject<{
54
+ name: typebox156.TString;
55
+ group: typebox156.TString;
56
+ method: typebox156.TString;
57
+ path: typebox156.TString;
58
+ prefix: typebox156.TString;
59
+ fullPath: typebox156.TString;
60
+ description: typebox156.TOptional<typebox156.TString>;
61
+ summary: typebox156.TOptional<typebox156.TString>;
62
+ disabled: typebox156.TOptional<typebox156.TBoolean>;
63
+ secure: typebox156.TOptional<typebox156.TBoolean>;
64
+ hide: typebox156.TOptional<typebox156.TBoolean>;
65
+ body: typebox156.TOptional<typebox156.TAny>;
66
+ params: typebox156.TOptional<typebox156.TAny>;
67
+ query: typebox156.TOptional<typebox156.TAny>;
68
+ response: typebox156.TOptional<typebox156.TAny>;
69
+ bodyContentType: typebox156.TOptional<typebox156.TString>;
70
+ }>>;
71
+ queues: typebox156.TArray<typebox156.TObject<{
72
+ name: typebox156.TString;
73
+ description: typebox156.TOptional<typebox156.TString>;
74
+ schema: typebox156.TOptional<typebox156.TAny>;
75
+ provider: typebox156.TString;
76
+ }>>;
77
+ schedulers: typebox156.TArray<typebox156.TObject<{
78
+ name: typebox156.TString;
79
+ description: typebox156.TOptional<typebox156.TString>;
80
+ cron: typebox156.TOptional<typebox156.TString>;
81
+ interval: typebox156.TOptional<typebox156.TAny>;
82
+ lock: typebox156.TOptional<typebox156.TBoolean>;
83
+ }>>;
84
+ topics: typebox156.TArray<typebox156.TObject<{
85
+ name: typebox156.TString;
86
+ description: typebox156.TOptional<typebox156.TString>;
87
+ schema: typebox156.TOptional<typebox156.TAny>;
88
+ provider: typebox156.TString;
89
+ }>>;
90
+ buckets: typebox156.TArray<typebox156.TObject<{
91
+ name: typebox156.TString;
92
+ description: typebox156.TOptional<typebox156.TString>;
93
+ mimeTypes: typebox156.TOptional<typebox156.TArray<typebox156.TString>>;
94
+ maxSize: typebox156.TOptional<typebox156.TNumber>;
95
+ provider: typebox156.TString;
96
+ }>>;
97
+ realms: typebox156.TArray<typebox156.TObject<{
98
+ name: typebox156.TString;
99
+ description: typebox156.TOptional<typebox156.TString>;
100
+ roles: typebox156.TOptional<typebox156.TArray<typebox156.TAny>>;
101
+ type: typebox156.TUnsafe<"internal" | "external">;
102
+ settings: typebox156.TOptional<typebox156.TObject<{
103
+ accessTokenExpiration: typebox156.TOptional<typebox156.TAny>;
104
+ refreshTokenExpiration: typebox156.TOptional<typebox156.TAny>;
105
+ hasOnCreateSession: typebox156.TBoolean;
106
+ hasOnRefreshSession: typebox156.TBoolean;
107
+ hasOnDeleteSession: typebox156.TBoolean;
108
+ }>>;
109
+ }>>;
110
+ caches: typebox156.TArray<typebox156.TObject<{
111
+ name: typebox156.TString;
112
+ ttl: typebox156.TOptional<typebox156.TAny>;
113
+ disabled: typebox156.TOptional<typebox156.TBoolean>;
114
+ provider: typebox156.TString;
115
+ }>>;
116
+ pages: typebox156.TArray<typebox156.TObject<{
117
+ name: typebox156.TString;
118
+ description: typebox156.TOptional<typebox156.TString>;
119
+ path: typebox156.TOptional<typebox156.TString>;
120
+ params: typebox156.TOptional<typebox156.TAny>;
121
+ query: typebox156.TOptional<typebox156.TAny>;
122
+ hasComponent: typebox156.TBoolean;
123
+ hasLazy: typebox156.TBoolean;
124
+ hasResolve: typebox156.TBoolean;
125
+ hasChildren: typebox156.TBoolean;
126
+ hasParent: typebox156.TBoolean;
127
+ hasErrorHandler: typebox156.TBoolean;
128
+ static: typebox156.TOptional<typebox156.TBoolean>;
129
+ cache: typebox156.TOptional<typebox156.TAny>;
130
+ client: typebox156.TOptional<typebox156.TAny>;
131
+ animation: typebox156.TOptional<typebox156.TAny>;
132
+ }>>;
133
+ providers: typebox156.TArray<typebox156.TObject<{
134
+ name: typebox156.TString;
135
+ module: typebox156.TOptional<typebox156.TString>;
136
+ dependencies: typebox156.TArray<typebox156.TString>;
137
+ aliases: typebox156.TOptional<typebox156.TArray<typebox156.TString>>;
138
+ }>>;
139
+ modules: typebox156.TArray<typebox156.TObject<{
140
+ name: typebox156.TString;
141
+ providers: typebox156.TArray<typebox156.TString>;
142
+ }>>;
143
+ }>;
144
+ type DevMetadata = Static<typeof devMetadataSchema>;
145
+ //#endregion
146
+ //#region src/schemas/DevModuleMetadata.d.ts
147
+ declare const devModuleMetadataSchema: typebox156.TObject<{
148
+ name: typebox156.TString;
149
+ providers: typebox156.TArray<typebox156.TString>;
150
+ }>;
151
+ type DevModuleMetadata = Static<typeof devModuleMetadataSchema>;
152
+ //#endregion
153
+ //#region src/schemas/DevPageMetadata.d.ts
154
+ declare const devPageMetadataSchema: typebox156.TObject<{
155
+ name: typebox156.TString;
156
+ description: typebox156.TOptional<typebox156.TString>;
157
+ path: typebox156.TOptional<typebox156.TString>;
158
+ params: typebox156.TOptional<typebox156.TAny>;
159
+ query: typebox156.TOptional<typebox156.TAny>;
160
+ hasComponent: typebox156.TBoolean;
161
+ hasLazy: typebox156.TBoolean;
162
+ hasResolve: typebox156.TBoolean;
163
+ hasChildren: typebox156.TBoolean;
164
+ hasParent: typebox156.TBoolean;
165
+ hasErrorHandler: typebox156.TBoolean;
166
+ static: typebox156.TOptional<typebox156.TBoolean>;
167
+ cache: typebox156.TOptional<typebox156.TAny>;
168
+ client: typebox156.TOptional<typebox156.TAny>;
169
+ animation: typebox156.TOptional<typebox156.TAny>;
170
+ }>;
171
+ type DevPageMetadata = Static<typeof devPageMetadataSchema>;
172
+ //#endregion
173
+ //#region src/schemas/DevProviderMetadata.d.ts
174
+ declare const devProviderMetadataSchema: typebox156.TObject<{
175
+ name: typebox156.TString;
176
+ module: typebox156.TOptional<typebox156.TString>;
177
+ dependencies: typebox156.TArray<typebox156.TString>;
178
+ aliases: typebox156.TOptional<typebox156.TArray<typebox156.TString>>;
179
+ }>;
180
+ type DevProviderMetadata = Static<typeof devProviderMetadataSchema>;
181
+ //#endregion
182
+ //#region src/schemas/DevQueueMetadata.d.ts
183
+ declare const devQueueMetadataSchema: typebox156.TObject<{
184
+ name: typebox156.TString;
185
+ description: typebox156.TOptional<typebox156.TString>;
186
+ schema: typebox156.TOptional<typebox156.TAny>;
187
+ provider: typebox156.TString;
188
+ }>;
189
+ type DevQueueMetadata = Static<typeof devQueueMetadataSchema>;
190
+ //#endregion
191
+ //#region src/schemas/DevRealmMetadata.d.ts
192
+ declare const devRealmMetadataSchema: typebox156.TObject<{
193
+ name: typebox156.TString;
194
+ description: typebox156.TOptional<typebox156.TString>;
195
+ roles: typebox156.TOptional<typebox156.TArray<typebox156.TAny>>;
196
+ type: typebox156.TUnsafe<"internal" | "external">;
197
+ settings: typebox156.TOptional<typebox156.TObject<{
198
+ accessTokenExpiration: typebox156.TOptional<typebox156.TAny>;
199
+ refreshTokenExpiration: typebox156.TOptional<typebox156.TAny>;
200
+ hasOnCreateSession: typebox156.TBoolean;
201
+ hasOnRefreshSession: typebox156.TBoolean;
202
+ hasOnDeleteSession: typebox156.TBoolean;
203
+ }>>;
204
+ }>;
205
+ type DevRealmMetadata = Static<typeof devRealmMetadataSchema>;
206
+ //#endregion
207
+ //#region src/schemas/DevSchedulerMetadata.d.ts
208
+ declare const devSchedulerMetadataSchema: typebox156.TObject<{
209
+ name: typebox156.TString;
210
+ description: typebox156.TOptional<typebox156.TString>;
211
+ cron: typebox156.TOptional<typebox156.TString>;
212
+ interval: typebox156.TOptional<typebox156.TAny>;
213
+ lock: typebox156.TOptional<typebox156.TBoolean>;
214
+ }>;
215
+ type DevSchedulerMetadata = Static<typeof devSchedulerMetadataSchema>;
216
+ //#endregion
217
+ //#region src/schemas/DevTopicMetadata.d.ts
218
+ declare const devTopicMetadataSchema: typebox156.TObject<{
219
+ name: typebox156.TString;
220
+ description: typebox156.TOptional<typebox156.TString>;
221
+ schema: typebox156.TOptional<typebox156.TAny>;
222
+ provider: typebox156.TString;
223
+ }>;
224
+ type DevTopicMetadata = Static<typeof devTopicMetadataSchema>;
225
+ //#endregion
226
+ //#region src/DevCollectorProvider.d.ts
227
+ declare class DevCollectorProvider {
228
+ protected readonly alepha: Alepha;
229
+ protected readonly serverProvider: ServerProvider;
230
+ protected readonly log: _alepha_logger0.Logger;
231
+ protected readonly logs: LogEntry[];
232
+ protected readonly maxLogs = 10000;
233
+ protected readonly onStart: _alepha_core1.HookDescriptor<"start">;
234
+ protected readonly onLog: _alepha_core1.HookDescriptor<"log">;
235
+ protected readonly uiRoute: _alepha_server_static0.ServeDescriptor;
236
+ protected readonly metadataRoute: _alepha_server0.RouteDescriptor<{
237
+ response: typebox156.TObject<{
238
+ actions: typebox156.TArray<typebox156.TObject<{
239
+ name: typebox156.TString;
240
+ group: typebox156.TString;
241
+ method: typebox156.TString;
242
+ path: typebox156.TString;
243
+ prefix: typebox156.TString;
244
+ fullPath: typebox156.TString;
245
+ description: typebox156.TOptional<typebox156.TString>;
246
+ summary: typebox156.TOptional<typebox156.TString>;
247
+ disabled: typebox156.TOptional<typebox156.TBoolean>;
248
+ secure: typebox156.TOptional<typebox156.TBoolean>;
249
+ hide: typebox156.TOptional<typebox156.TBoolean>;
250
+ body: typebox156.TOptional<typebox156.TAny>;
251
+ params: typebox156.TOptional<typebox156.TAny>;
252
+ query: typebox156.TOptional<typebox156.TAny>;
253
+ response: typebox156.TOptional<typebox156.TAny>;
254
+ bodyContentType: typebox156.TOptional<typebox156.TString>;
255
+ }>>;
256
+ queues: typebox156.TArray<typebox156.TObject<{
257
+ name: typebox156.TString;
258
+ description: typebox156.TOptional<typebox156.TString>;
259
+ schema: typebox156.TOptional<typebox156.TAny>;
260
+ provider: typebox156.TString;
261
+ }>>;
262
+ schedulers: typebox156.TArray<typebox156.TObject<{
263
+ name: typebox156.TString;
264
+ description: typebox156.TOptional<typebox156.TString>;
265
+ cron: typebox156.TOptional<typebox156.TString>;
266
+ interval: typebox156.TOptional<typebox156.TAny>;
267
+ lock: typebox156.TOptional<typebox156.TBoolean>;
268
+ }>>;
269
+ topics: typebox156.TArray<typebox156.TObject<{
270
+ name: typebox156.TString;
271
+ description: typebox156.TOptional<typebox156.TString>;
272
+ schema: typebox156.TOptional<typebox156.TAny>;
273
+ provider: typebox156.TString;
274
+ }>>;
275
+ buckets: typebox156.TArray<typebox156.TObject<{
276
+ name: typebox156.TString;
277
+ description: typebox156.TOptional<typebox156.TString>;
278
+ mimeTypes: typebox156.TOptional<typebox156.TArray<typebox156.TString>>;
279
+ maxSize: typebox156.TOptional<typebox156.TNumber>;
280
+ provider: typebox156.TString;
281
+ }>>;
282
+ realms: typebox156.TArray<typebox156.TObject<{
283
+ name: typebox156.TString;
284
+ description: typebox156.TOptional<typebox156.TString>;
285
+ roles: typebox156.TOptional<typebox156.TArray<typebox156.TAny>>;
286
+ type: typebox156.TUnsafe<"internal" | "external">;
287
+ settings: typebox156.TOptional<typebox156.TObject<{
288
+ accessTokenExpiration: typebox156.TOptional<typebox156.TAny>;
289
+ refreshTokenExpiration: typebox156.TOptional<typebox156.TAny>;
290
+ hasOnCreateSession: typebox156.TBoolean;
291
+ hasOnRefreshSession: typebox156.TBoolean;
292
+ hasOnDeleteSession: typebox156.TBoolean;
293
+ }>>;
294
+ }>>;
295
+ caches: typebox156.TArray<typebox156.TObject<{
296
+ name: typebox156.TString;
297
+ ttl: typebox156.TOptional<typebox156.TAny>;
298
+ disabled: typebox156.TOptional<typebox156.TBoolean>;
299
+ provider: typebox156.TString;
300
+ }>>;
301
+ pages: typebox156.TArray<typebox156.TObject<{
302
+ name: typebox156.TString;
303
+ description: typebox156.TOptional<typebox156.TString>;
304
+ path: typebox156.TOptional<typebox156.TString>;
305
+ params: typebox156.TOptional<typebox156.TAny>;
306
+ query: typebox156.TOptional<typebox156.TAny>;
307
+ hasComponent: typebox156.TBoolean;
308
+ hasLazy: typebox156.TBoolean;
309
+ hasResolve: typebox156.TBoolean;
310
+ hasChildren: typebox156.TBoolean;
311
+ hasParent: typebox156.TBoolean;
312
+ hasErrorHandler: typebox156.TBoolean;
313
+ static: typebox156.TOptional<typebox156.TBoolean>;
314
+ cache: typebox156.TOptional<typebox156.TAny>;
315
+ client: typebox156.TOptional<typebox156.TAny>;
316
+ animation: typebox156.TOptional<typebox156.TAny>;
317
+ }>>;
318
+ providers: typebox156.TArray<typebox156.TObject<{
319
+ name: typebox156.TString;
320
+ module: typebox156.TOptional<typebox156.TString>;
321
+ dependencies: typebox156.TArray<typebox156.TString>;
322
+ aliases: typebox156.TOptional<typebox156.TArray<typebox156.TString>>;
323
+ }>>;
324
+ modules: typebox156.TArray<typebox156.TObject<{
325
+ name: typebox156.TString;
326
+ providers: typebox156.TArray<typebox156.TString>;
327
+ }>>;
328
+ }>;
329
+ }>;
330
+ protected readonly logsRoute: _alepha_server0.RouteDescriptor<{
331
+ response: typebox156.TArray<typebox156.TObject<{
332
+ level: typebox156.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
333
+ message: typebox156.TString;
334
+ service: typebox156.TString;
335
+ module: typebox156.TString;
336
+ context: typebox156.TOptional<typebox156.TString>;
337
+ app: typebox156.TOptional<typebox156.TString>;
338
+ data: typebox156.TOptional<typebox156.TAny>;
339
+ timestamp: typebox156.TCodec<typebox156.TString, dayjs0.Dayjs>;
340
+ }>>;
341
+ }>;
342
+ getLogs(): LogEntry[];
343
+ getActions(): DevActionMetadata[];
344
+ getQueues(): DevQueueMetadata[];
345
+ getSchedulers(): DevSchedulerMetadata[];
346
+ getTopics(): DevTopicMetadata[];
347
+ getBuckets(): DevBucketMetadata[];
348
+ getRealms(): DevRealmMetadata[];
349
+ getCaches(): DevCacheMetadata[];
350
+ getPages(): DevPageMetadata[];
351
+ getProviders(): DevProviderMetadata[];
352
+ getModules(): DevModuleMetadata[];
353
+ getMetadata(): DevMetadata;
354
+ protected getProviderName(provider?: "memory" | any): string;
355
+ }
356
+ //#endregion
357
+ //#region src/index.d.ts
358
+ /**
359
+ * Developer tools module for monitoring and debugging Alepha applications.
360
+ *
361
+ * This module provides comprehensive data collection capabilities for tracking application behavior,
362
+ * performance metrics, and debugging information in real-time.
363
+ *
364
+ * @see {@link DevCollectorProvider}
365
+ * @module alepha.devtools
366
+ */
367
+ declare const AlephaDevtools: _alepha_core1.Service<_alepha_core1.Module<{}>>;
368
+ //#endregion
369
+ export { AlephaDevtools, DevActionMetadata, DevBucketMetadata, DevCacheMetadata, DevCollectorProvider, DevMetadata, DevModuleMetadata, DevPageMetadata, DevProviderMetadata, DevQueueMetadata, DevRealmMetadata, DevSchedulerMetadata, DevTopicMetadata, devActionMetadataSchema, devBucketMetadataSchema, devCacheMetadataSchema, devMetadataSchema, devModuleMetadataSchema, devPageMetadataSchema, devProviderMetadataSchema, devQueueMetadataSchema, devRealmMetadataSchema, devSchedulerMetadataSchema, devTopicMetadataSchema };
370
+ //# sourceMappingURL=index.d.ts.map
package/email.d.ts CHANGED
@@ -1 +1,144 @@
1
- export * from '@alepha/email';
1
+ import * as _alepha_core1 from "alepha";
2
+ import * as _alepha_logger0 from "alepha/logger";
3
+ import { Transporter } from "nodemailer";
4
+
5
+ //#region src/providers/EmailProvider.d.ts
6
+ /**
7
+ * Email provider interface.
8
+ *
9
+ * All methods are asynchronous and return promises.
10
+ */
11
+ declare abstract class EmailProvider {
12
+ /**
13
+ * Send an email.
14
+ *
15
+ * @return Promise that resolves when the email is sent.
16
+ */
17
+ abstract send(options: EmailSendOptions): Promise<void>;
18
+ }
19
+ type EmailSendOptions = {
20
+ to: string | string[];
21
+ subject: string;
22
+ body: string;
23
+ };
24
+ //#endregion
25
+ //#region src/errors/EmailError.d.ts
26
+ declare class EmailError extends Error {
27
+ constructor(message: string, cause?: Error);
28
+ }
29
+ //#endregion
30
+ //#region src/providers/LocalEmailProvider.d.ts
31
+ interface LocalEmailProviderOptions {
32
+ /**
33
+ * Directory to save email files.
34
+ * @default "node_modules/.email" (relative to project root)
35
+ */
36
+ directory?: string;
37
+ }
38
+ declare class LocalEmailProvider implements EmailProvider {
39
+ protected readonly log: _alepha_logger0.Logger;
40
+ protected readonly directory: string;
41
+ constructor(options?: LocalEmailProviderOptions);
42
+ send(options: EmailSendOptions): Promise<void>;
43
+ createEmailHtml(options: {
44
+ to: string;
45
+ subject: string;
46
+ body: string;
47
+ }): string;
48
+ escapeHtml(text: string): string;
49
+ }
50
+ //#endregion
51
+ //#region src/providers/MemoryEmailProvider.d.ts
52
+ interface EmailRecord {
53
+ to: string;
54
+ subject: string;
55
+ body: string;
56
+ sentAt: Date;
57
+ }
58
+ declare class MemoryEmailProvider implements EmailProvider {
59
+ protected readonly log: _alepha_logger0.Logger;
60
+ records: EmailRecord[];
61
+ send(options: EmailSendOptions): Promise<void>;
62
+ /**
63
+ * Get the last email sent (for testing purposes).
64
+ */
65
+ get last(): EmailRecord | undefined;
66
+ }
67
+ //#endregion
68
+ //#region src/providers/NodemailerEmailProvider.d.ts
69
+ interface NodemailerEmailProviderOptions {
70
+ /**
71
+ * Custom transporter configuration.
72
+ * If provided, will override environment variables.
73
+ */
74
+ transporter?: Transporter;
75
+ /**
76
+ * Custom from email address.
77
+ * If not provided, will use EMAIL_FROM from environment.
78
+ */
79
+ from?: string;
80
+ /**
81
+ * Additional nodemailer options.
82
+ */
83
+ options?: {
84
+ pool?: boolean;
85
+ maxConnections?: number;
86
+ maxMessages?: number;
87
+ rateDelta?: number;
88
+ rateLimit?: number;
89
+ };
90
+ }
91
+ declare class NodemailerEmailProvider implements EmailProvider {
92
+ protected readonly env: {
93
+ EMAIL_HOST: string;
94
+ EMAIL_PORT: number;
95
+ EMAIL_USER: string;
96
+ EMAIL_PASS: string;
97
+ EMAIL_FROM: string;
98
+ EMAIL_SECURE: boolean;
99
+ };
100
+ protected readonly log: _alepha_logger0.Logger;
101
+ protected transporter: Transporter;
102
+ protected fromAddress: string;
103
+ readonly options: NodemailerEmailProviderOptions;
104
+ constructor();
105
+ send(options: EmailSendOptions): Promise<void>;
106
+ protected createTransporter(): Transporter;
107
+ /**
108
+ * Verify the connection to the email server.
109
+ */
110
+ verify(): Promise<boolean>;
111
+ /**
112
+ * Close the transporter connection.
113
+ */
114
+ close(): void;
115
+ protected readonly onStart: _alepha_core1.HookDescriptor<"start">;
116
+ protected readonly onStop: _alepha_core1.HookDescriptor<"stop">;
117
+ }
118
+ //#endregion
119
+ //#region src/index.d.ts
120
+ declare module "alepha" {
121
+ interface Hooks {
122
+ "email:sending": {
123
+ to: string | string[];
124
+ template: string;
125
+ variables: Record<string, unknown>;
126
+ provider: EmailProvider;
127
+ abort(): void;
128
+ };
129
+ }
130
+ }
131
+ /**
132
+ * Provides email sending capabilities for Alepha applications with multiple provider backends.
133
+ *
134
+ * The email module enables declarative email sending through the `$email` descriptor, allowing you to send
135
+ * emails through different providers: memory (for testing), local file system, or SMTP via Nodemailer.
136
+ * It supports HTML email content and automatic provider selection based on environment configuration.
137
+ *
138
+ * @see {@link EmailProvider}
139
+ * @module alepha.email
140
+ */
141
+ declare const AlephaEmail: _alepha_core1.Service<_alepha_core1.Module<{}>>;
142
+ //#endregion
143
+ export { AlephaEmail, EmailError, EmailProvider, EmailRecord, EmailSendOptions, LocalEmailProvider, LocalEmailProviderOptions, MemoryEmailProvider, NodemailerEmailProvider, NodemailerEmailProviderOptions };
144
+ //# sourceMappingURL=index.d.ts.map
package/fake.d.ts CHANGED
@@ -1 +1,73 @@
1
- export * from '@alepha/fake';
1
+ import * as _alepha_core0 from "alepha";
2
+ import { StaticDecode, TSchema } from "alepha";
3
+
4
+ //#region src/providers/FakeProvider.d.ts
5
+ interface FakeOptions {
6
+ /**
7
+ * Faker locale to use for generating fake data.
8
+ * @default "en"
9
+ */
10
+ locale?: string;
11
+ /**
12
+ * Seed for deterministic fake data generation.
13
+ */
14
+ seed?: number;
15
+ }
16
+ /**
17
+ * Generate fake data from TypeBox schemas using faker.js.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const fake = new FakeProvider();
22
+ * const userSchema = t.object({
23
+ * id: t.uuid(),
24
+ * name: t.text(),
25
+ * email: t.email(),
26
+ * });
27
+ * const fakeUser = fake.generate(userSchema);
28
+ * ```
29
+ */
30
+ declare class FakeProvider {
31
+ private readonly faker;
32
+ private readonly guard;
33
+ constructor(options?: FakeOptions);
34
+ /**
35
+ * Generate fake data matching the given TypeBox schema.
36
+ */
37
+ generate<T extends TSchema>(schema: T): StaticDecode<T>;
38
+ /**
39
+ * Generate multiple fake data items.
40
+ */
41
+ generateMany<T extends TSchema>(schema: T, count: number): StaticDecode<T>[];
42
+ private generateValue;
43
+ private generateString;
44
+ private generateNumber;
45
+ private generateInteger;
46
+ private generateBigInt;
47
+ private generateBoolean;
48
+ private generateArray;
49
+ private generateObject;
50
+ /**
51
+ * Generate a value with context from the property key name.
52
+ * This helps generate more realistic fake data based on field names.
53
+ */
54
+ private generateValueWithContext;
55
+ private generateRecord;
56
+ }
57
+ //#endregion
58
+ //#region src/index.d.ts
59
+ /**
60
+ * Provides fake data generation capabilities for Alepha applications using faker.js and TypeBox schemas.
61
+ *
62
+ * The fake module enables declarative fake data generation from TypeBox schemas, making it easy to create
63
+ * realistic test data, seed databases, or generate mock responses. It intelligently uses property key names
64
+ * to generate contextually appropriate data (e.g., "email" generates an email address, "firstName" generates
65
+ * a first name).
66
+ *
67
+ * @see {@link FakeProvider}
68
+ * @module alepha.fake
69
+ */
70
+ declare const AlephaFake: _alepha_core0.Service<_alepha_core0.Module<{}>>;
71
+ //#endregion
72
+ export { AlephaFake, FakeOptions, FakeProvider };
73
+ //# sourceMappingURL=index.d.ts.map