@guren/server 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{McpServiceProvider-7BB5FPF3.js → McpServiceProvider-GRDYNEQG.js} +1 -1
- package/dist/auth/AuthManager.d.ts +30 -0
- package/dist/auth/AuthenticatableModel.d.ts +25 -0
- package/dist/auth/RequestAuthContext.d.ts +24 -0
- package/dist/auth/SessionGuard.d.ts +31 -0
- package/dist/auth/api-token.d.ts +299 -0
- package/dist/auth/email-verification.d.ts +203 -0
- package/dist/auth/index.d.ts +18 -110
- package/dist/auth/index.js +3 -1
- package/dist/auth/oauth/index.d.ts +239 -0
- package/dist/auth/password/DefaultHasher.d.ts +13 -0
- package/dist/auth/password/NodeHasher.d.ts +22 -0
- package/dist/auth/password/PasswordHasher.d.ts +5 -0
- package/dist/auth/password/ScryptHasher.d.ts +26 -0
- package/dist/auth/password-reset.d.ts +91 -0
- package/dist/auth/providers/ModelUserProvider.d.ts +36 -0
- package/dist/auth/providers/UserProvider.d.ts +9 -0
- package/dist/auth/types.d.ts +102 -0
- package/dist/auth/utils.d.ts +39 -0
- package/dist/{Gate-CynjZCtS.d.ts → authorization/Gate.d.ts} +30 -111
- package/dist/authorization/Policy.d.ts +77 -0
- package/dist/authorization/index.d.ts +5 -129
- package/dist/authorization/index.js +3 -1
- package/dist/authorization/middleware.d.ts +49 -0
- package/dist/authorization/types.d.ts +108 -0
- package/dist/broadcasting/BroadcastManager.d.ts +205 -0
- package/dist/broadcasting/channels/Channel.d.ts +28 -0
- package/dist/broadcasting/channels/PresenceChannel.d.ts +72 -0
- package/dist/broadcasting/channels/PrivateChannel.d.ts +32 -0
- package/dist/broadcasting/channels/index.d.ts +3 -0
- package/dist/broadcasting/drivers/MemoryDriver.d.ts +93 -0
- package/dist/broadcasting/drivers/RedisDriver.d.ts +112 -0
- package/dist/broadcasting/drivers/index.d.ts +2 -0
- package/dist/broadcasting/index.d.ts +6 -233
- package/dist/broadcasting/index.js +1 -1
- package/dist/broadcasting/typed.d.ts +23 -0
- package/dist/broadcasting/types.d.ts +155 -0
- package/dist/cache/CacheManager.d.ts +87 -0
- package/dist/cache/TaggedCache.d.ts +62 -0
- package/dist/cache/index.d.ts +6 -233
- package/dist/cache/index.js +1 -1
- package/dist/cache/stores/FileStore.d.ts +64 -0
- package/dist/cache/stores/MemoryStore.d.ts +52 -0
- package/dist/cache/stores/RedisStore.d.ts +53 -0
- package/dist/{CacheManager-BmDzUKrF.d.ts → cache/types.d.ts} +26 -99
- package/dist/{chunk-TVY72CLV.js → chunk-4VE3LYOM.js} +3 -2
- package/dist/{chunk-FZD2AKJI.js → chunk-7OB2YXRE.js} +56 -28
- package/dist/{chunk-J6ETA476.js → chunk-BUQXOZCT.js} +93 -5
- package/dist/{chunk-DSDX3ASM.js → chunk-CDZUNKI6.js} +65 -83
- package/dist/{chunk-CWI4AJ47.js → chunk-HPET6XY5.js} +13 -9
- package/dist/{chunk-A3ISJVEV.js → chunk-HR2KZ3WL.js} +23 -5
- package/dist/{chunk-5SZTEZ22.js → chunk-PZKUDFMW.js} +11 -8
- package/dist/console/Command.d.ts +179 -0
- package/dist/{ConsoleKernel-CJg975mp.d.ts → console/ConsoleKernel.d.ts} +4 -6
- package/dist/console/Input.d.ts +140 -0
- package/dist/console/Output.d.ts +161 -0
- package/dist/console/index.d.ts +5 -0
- package/dist/console/types.d.ts +106 -0
- package/dist/container/Container.d.ts +148 -0
- package/dist/container/ServiceProvider.d.ts +103 -0
- package/dist/container/bindings.d.ts +55 -0
- package/dist/container/defineModule.d.ts +88 -0
- package/dist/container/definePlugin.d.ts +62 -0
- package/dist/container/index.d.ts +8 -0
- package/dist/container/types.d.ts +73 -0
- package/dist/database/Factory.d.ts +82 -0
- package/dist/database/Seeder.d.ts +35 -0
- package/dist/database/SeederRunner.d.ts +41 -0
- package/dist/database/index.d.ts +4 -0
- package/dist/database/types.d.ts +49 -0
- package/dist/discovery/AutoDiscovery.d.ts +113 -0
- package/dist/discovery/index.d.ts +2 -0
- package/dist/docs-viewer/DocsViewerServiceProvider.d.ts +12 -0
- package/dist/docs-viewer/endpoint.d.ts +19 -0
- package/dist/encryption/Encrypter.d.ts +96 -0
- package/dist/encryption/Hash.d.ts +69 -0
- package/dist/encryption/MessageSigner.d.ts +21 -0
- package/dist/encryption/Random.d.ts +119 -0
- package/dist/encryption/app-key.d.ts +12 -0
- package/dist/encryption/index.d.ts +10 -222
- package/dist/encryption/signed-url.d.ts +9 -0
- package/dist/encryption/types.d.ts +103 -0
- package/dist/errors/ExceptionHandler.d.ts +118 -0
- package/dist/errors/HttpException.d.ts +106 -0
- package/dist/errors/debug-page.d.ts +22 -0
- package/dist/errors/error-page.d.ts +1 -0
- package/dist/errors/exceptions/AuthenticationException.d.ts +32 -0
- package/dist/errors/exceptions/AuthorizationException.d.ts +32 -0
- package/dist/errors/exceptions/MethodNotAllowedException.d.ts +31 -0
- package/dist/errors/exceptions/NotFoundHttpException.d.ts +36 -0
- package/dist/errors/exceptions/ValidationException.d.ts +60 -0
- package/dist/errors/exceptions/index.d.ts +5 -0
- package/dist/errors/index.d.ts +5 -0
- package/dist/errors/types.d.ts +43 -0
- package/dist/events/Event.d.ts +33 -0
- package/dist/{EventManager-CmIoLt7r.d.ts → events/EventManager.d.ts} +4 -86
- package/dist/events/Listener.d.ts +79 -0
- package/dist/events/builtin.d.ts +73 -0
- package/dist/events/index.d.ts +6 -155
- package/dist/events/types.d.ts +48 -0
- package/dist/facades/index.d.ts +31 -0
- package/dist/health/HealthCheck.d.ts +34 -0
- package/dist/health/HealthManager.d.ts +53 -0
- package/dist/health/checks/CacheCheck.d.ts +35 -0
- package/dist/health/checks/CustomCheck.d.ts +23 -0
- package/dist/health/checks/DatabaseCheck.d.ts +33 -0
- package/dist/health/checks/MemoryCheck.d.ts +32 -0
- package/dist/health/checks/RedisCheck.d.ts +27 -0
- package/dist/health/checks/StorageCheck.d.ts +35 -0
- package/dist/health/checks/index.d.ts +12 -0
- package/dist/health/index.d.ts +5 -185
- package/dist/health/types.d.ts +52 -0
- package/dist/hot-reload/hot-disposables.d.ts +96 -0
- package/dist/hot-reload/testing.d.ts +14 -0
- package/dist/http/Application.d.ts +187 -0
- package/dist/http/FormRequest.d.ts +73 -0
- package/dist/http/dev-assets.d.ts +51 -0
- package/dist/http/dev-banner.d.ts +7 -0
- package/dist/http/inertia-assets.d.ts +22 -0
- package/dist/http/middleware/auth.d.ts +13 -0
- package/dist/http/middleware/capabilities.d.ts +22 -0
- package/dist/http/middleware/cors.d.ts +40 -0
- package/dist/http/middleware/csp.d.ts +59 -0
- package/dist/http/middleware/csrf.d.ts +121 -0
- package/dist/http/middleware/detect-locale.d.ts +65 -0
- package/dist/http/middleware/force-https.d.ts +34 -0
- package/dist/http/middleware/host-authorization.d.ts +24 -0
- package/dist/http/middleware/index.d.ts +19 -0
- package/dist/http/middleware/loopback-guard.d.ts +38 -0
- package/dist/{rate-limit-D9J2b4S1.d.ts → http/middleware/rate-limit.d.ts} +22 -50
- package/dist/http/middleware/redirect-safety.d.ts +29 -0
- package/dist/http/middleware/request-id.d.ts +19 -0
- package/dist/http/middleware/request-logging.d.ts +16 -0
- package/dist/http/middleware/security-headers.d.ts +49 -0
- package/dist/http/middleware/session.d.ts +93 -0
- package/dist/http/middleware/validation.d.ts +94 -0
- package/dist/http/public-assets.d.ts +15 -0
- package/dist/http/request.d.ts +24 -0
- package/dist/http/resources/CursorPaginator.d.ts +106 -0
- package/dist/http/resources/Paginator.d.ts +130 -0
- package/dist/http/resources/Resource.d.ts +67 -0
- package/dist/http/resources/ResourceCollection.d.ts +60 -0
- package/dist/http/resources/index.d.ts +6 -0
- package/dist/http/resources/types.d.ts +91 -0
- package/dist/http/validation/Validator.d.ts +128 -0
- package/dist/http/validation/index.d.ts +3 -0
- package/dist/http/validation/rules.d.ts +196 -0
- package/dist/http/validation/types.d.ts +96 -0
- package/dist/http/vite-dev-server.d.ts +27 -0
- package/dist/i18n/I18nManager.d.ts +114 -0
- package/dist/i18n/Translator.d.ts +80 -0
- package/dist/i18n/index.d.ts +6 -101
- package/dist/i18n/index.js +5 -3
- package/dist/i18n/loaders/JsonLoader.d.ts +47 -0
- package/dist/i18n/loaders/MemoryLoader.d.ts +37 -0
- package/dist/i18n/pluralization.d.ts +19 -0
- package/dist/i18n/types.d.ts +106 -0
- package/dist/index.d.ts +69 -2605
- package/dist/index.js +332 -152
- package/dist/lambda/index.d.ts +17 -37
- package/dist/logging/LogManager.d.ts +83 -0
- package/dist/logging/Logger.d.ts +76 -0
- package/dist/logging/channels/ConsoleChannel.d.ts +11 -0
- package/dist/logging/channels/DailyFileChannel.d.ts +20 -0
- package/dist/logging/channels/FileChannel.d.ts +15 -0
- package/dist/logging/index.d.ts +8 -50
- package/dist/logging/types.d.ts +96 -0
- package/dist/mail/Mail.d.ts +138 -0
- package/dist/mail/MailManager.d.ts +79 -0
- package/dist/mail/address.d.ts +8 -0
- package/dist/mail/index.d.ts +7 -316
- package/dist/mail/transports/LogTransport.d.ts +19 -0
- package/dist/mail/transports/MemoryTransport.d.ts +84 -0
- package/dist/mail/transports/ResendTransport.d.ts +32 -0
- package/dist/mail/transports/SmtpTransport.d.ts +40 -0
- package/dist/{MailManager-DpMvYiP9.d.ts → mail/types.d.ts} +11 -92
- package/dist/mcp/McpServiceProvider.d.ts +17 -0
- package/dist/mcp/create-mcp-server.d.ts +144 -0
- package/dist/mcp/endpoint.d.ts +29 -0
- package/dist/mcp/index.d.ts +3 -185
- package/dist/mcp/index.js +1 -1
- package/dist/mvc/Controller.d.ts +326 -0
- package/dist/mvc/Router.d.ts +239 -0
- package/dist/mvc/ViewEngine.d.ts +11 -0
- package/dist/mvc/inertia/InertiaEngine.d.ts +114 -0
- package/dist/mvc/inertia/shared.d.ts +90 -0
- package/dist/mvc/mount-route.d.ts +10 -0
- package/dist/notifications/Notification.d.ts +99 -0
- package/dist/notifications/NotificationManager.d.ts +150 -0
- package/dist/notifications/channels/DatabaseChannel.d.ts +55 -0
- package/dist/notifications/channels/MailChannel.d.ts +45 -0
- package/dist/notifications/channels/MemoryChannel.d.ts +85 -0
- package/dist/notifications/channels/SlackChannel.d.ts +73 -0
- package/dist/notifications/channels/index.d.ts +4 -0
- package/dist/notifications/index.d.ts +6 -322
- package/dist/notifications/notifiable-type.d.ts +10 -0
- package/dist/notifications/registry.d.ts +39 -0
- package/dist/notifications/types.d.ts +162 -0
- package/dist/providers/AuthServiceProvider.d.ts +7 -0
- package/dist/providers/AuthorizationServiceProvider.d.ts +9 -0
- package/dist/providers/BroadcastServiceProvider.d.ts +7 -0
- package/dist/providers/CacheServiceProvider.d.ts +7 -0
- package/dist/providers/EncryptionServiceProvider.d.ts +7 -0
- package/dist/providers/ErrorServiceProvider.d.ts +9 -0
- package/dist/providers/EventServiceProvider.d.ts +7 -0
- package/dist/providers/HealthServiceProvider.d.ts +7 -0
- package/dist/providers/I18nServiceProvider.d.ts +27 -0
- package/dist/providers/InertiaServiceProvider.d.ts +20 -0
- package/dist/providers/LogServiceProvider.d.ts +7 -0
- package/dist/providers/MailServiceProvider.d.ts +7 -0
- package/dist/providers/NotificationServiceProvider.d.ts +8 -0
- package/dist/providers/OAuthServiceProvider.d.ts +7 -0
- package/dist/providers/QueueServiceProvider.d.ts +7 -0
- package/dist/providers/SchedulingServiceProvider.d.ts +7 -0
- package/dist/providers/StorageServiceProvider.d.ts +7 -0
- package/dist/providers/index.d.ts +17 -0
- package/dist/queue/FailedJobReporter.d.ts +40 -0
- package/dist/queue/Job.d.ts +140 -0
- package/dist/queue/QueueManager.d.ts +79 -0
- package/dist/queue/Worker.d.ts +99 -0
- package/dist/queue/drivers/MemoryDriver.d.ts +60 -0
- package/dist/queue/drivers/RedisDriver.d.ts +96 -0
- package/dist/queue/drivers/SqsDriver.d.ts +108 -0
- package/dist/queue/drivers/SyncDriver.d.ts +28 -0
- package/dist/queue/index.d.ts +9 -453
- package/dist/queue/types.d.ts +171 -0
- package/dist/redis/RedisApiTokenStore.d.ts +78 -0
- package/dist/redis/RedisEmailVerificationStore.d.ts +54 -0
- package/dist/redis/RedisOAuthStateStore.d.ts +26 -0
- package/dist/redis/RedisPasswordResetStore.d.ts +57 -0
- package/dist/redis/RedisRateLimitStore.d.ts +77 -0
- package/dist/redis/RedisSessionStore.d.ts +61 -0
- package/dist/redis/client.d.ts +41 -0
- package/dist/redis/index.d.ts +14 -356
- package/dist/redis/index.js +5 -2
- package/dist/redis/scan-keys.d.ts +6 -0
- package/dist/runtime/index.d.ts +8 -95
- package/dist/runtime/index.js +1 -1
- package/dist/scheduling/CronParser.d.ts +37 -0
- package/dist/scheduling/Schedule.d.ts +229 -0
- package/dist/scheduling/ScheduledTask.d.ts +47 -0
- package/dist/scheduling/Scheduler.d.ts +99 -0
- package/dist/scheduling/index.d.ts +5 -41
- package/dist/scheduling/types.d.ts +97 -0
- package/dist/storage/StorageManager.d.ts +65 -0
- package/dist/storage/drivers/LocalDriver.d.ts +55 -0
- package/dist/storage/drivers/MemoryDriver.d.ts +66 -0
- package/dist/storage/drivers/S3Driver.d.ts +72 -0
- package/dist/storage/index.d.ts +5 -197
- package/dist/{StorageManager-oZTHqaza.d.ts → storage/types.d.ts} +10 -77
- package/dist/support/error-polyfill.d.ts +9 -0
- package/dist/support/import-map.d.ts +13 -0
- package/dist/support/redirect-target.d.ts +11 -0
- package/dist/support/stack-frames.d.ts +56 -0
- package/dist/support/trim-slashes.d.ts +11 -0
- package/dist/vite/index.d.ts +2 -35
- package/dist/vite/index.js +0 -3
- package/dist/vite/plugin.d.ts +34 -0
- package/package.json +3 -3
- package/dist/AuthManager-DBP4KYsx.d.ts +0 -79
- package/dist/BroadcastManager-D8KoJxiV.d.ts +0 -492
- package/dist/HealthManager-DUyMIzsZ.d.ts +0 -141
- package/dist/I18nManager-BiSoczfV.d.ts +0 -275
- package/dist/LogManager-7mxnkaPM.d.ts +0 -256
- package/dist/Scheduler-pZiT8i57.d.ts +0 -471
- package/dist/api-token-D24VPr_E.d.ts +0 -663
- package/dist/app-key-CsBfRC_Q.d.ts +0 -214
- package/dist/email-verification-Dx426KLn.d.ts +0 -336
- package/dist/index-9_Jzj5jo.d.ts +0 -7
- package/dist/validation-yAL53e1S.d.ts +0 -2610
package/dist/lambda/index.d.ts
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { C as ConsoleKernel } from '../ConsoleKernel-CJg975mp.js';
|
|
6
|
-
import 'hono';
|
|
7
|
-
import '../api-token-D24VPr_E.js';
|
|
8
|
-
import '../AuthManager-DBP4KYsx.js';
|
|
9
|
-
import '@guren/orm';
|
|
10
|
-
import 'vite';
|
|
11
|
-
import '../EventManager-CmIoLt7r.js';
|
|
12
|
-
import '../CacheManager-BmDzUKrF.js';
|
|
13
|
-
import '../MailManager-DpMvYiP9.js';
|
|
14
|
-
import '../LogManager-7mxnkaPM.js';
|
|
15
|
-
import '../I18nManager-BiSoczfV.js';
|
|
16
|
-
import '../BroadcastManager-D8KoJxiV.js';
|
|
17
|
-
import '../index-9_Jzj5jo.js';
|
|
18
|
-
import '../app-key-CsBfRC_Q.js';
|
|
19
|
-
import '../StorageManager-oZTHqaza.js';
|
|
20
|
-
import '../HealthManager-DUyMIzsZ.js';
|
|
21
|
-
import '../Gate-CynjZCtS.js';
|
|
22
|
-
|
|
1
|
+
import type { Application } from '../http/Application.js';
|
|
2
|
+
import type { Scheduler } from '../scheduling/Scheduler.js';
|
|
3
|
+
import type { ConsoleKernel } from '../console/ConsoleKernel.js';
|
|
4
|
+
export type { APIGatewayProxyResult, LambdaEvent } from 'hono/aws-lambda';
|
|
23
5
|
/**
|
|
24
6
|
* SQS event record from AWS Lambda.
|
|
25
7
|
*/
|
|
26
|
-
interface SqsRecord {
|
|
8
|
+
export interface SqsRecord {
|
|
27
9
|
messageId: string;
|
|
28
10
|
receiptHandle: string;
|
|
29
11
|
body: string;
|
|
@@ -37,19 +19,19 @@ interface SqsRecord {
|
|
|
37
19
|
/**
|
|
38
20
|
* SQS event payload from AWS Lambda.
|
|
39
21
|
*/
|
|
40
|
-
interface SqsEvent {
|
|
22
|
+
export interface SqsEvent {
|
|
41
23
|
Records: SqsRecord[];
|
|
42
24
|
}
|
|
43
25
|
/**
|
|
44
26
|
* SQS batch item failure for partial batch response.
|
|
45
27
|
*/
|
|
46
|
-
interface SqsBatchItemFailure {
|
|
28
|
+
export interface SqsBatchItemFailure {
|
|
47
29
|
itemIdentifier: string;
|
|
48
30
|
}
|
|
49
31
|
/**
|
|
50
32
|
* SQS batch response with partial failures.
|
|
51
33
|
*/
|
|
52
|
-
interface SqsBatchResponse {
|
|
34
|
+
export interface SqsBatchResponse {
|
|
53
35
|
batchItemFailures: SqsBatchItemFailure[];
|
|
54
36
|
}
|
|
55
37
|
/**
|
|
@@ -64,7 +46,7 @@ interface SqsBatchResponse {
|
|
|
64
46
|
* export const handler = createLambdaHandler(app)
|
|
65
47
|
* ```
|
|
66
48
|
*/
|
|
67
|
-
declare function createLambdaHandler(app: Application): <L extends
|
|
49
|
+
export declare function createLambdaHandler(app: Application): <L extends import("hono/aws-lambda").LambdaEvent>(event: L, lambdaContext?: import("hono/aws-lambda").LambdaContext) => Promise<import("hono/aws-lambda").APIGatewayProxyResult & (L extends {
|
|
68
50
|
multiValueHeaders: Record<string, string[]>;
|
|
69
51
|
} ? {
|
|
70
52
|
headers?: undefined;
|
|
@@ -88,7 +70,7 @@ declare function createLambdaHandler(app: Application): <L extends hono_aws_lamb
|
|
|
88
70
|
* export const queue = createSqsHandler()
|
|
89
71
|
* ```
|
|
90
72
|
*/
|
|
91
|
-
declare function createSqsHandler(): (event: SqsEvent) => Promise<SqsBatchResponse>;
|
|
73
|
+
export declare function createSqsHandler(): (event: SqsEvent) => Promise<SqsBatchResponse>;
|
|
92
74
|
/**
|
|
93
75
|
* Create an AWS Lambda handler for running scheduled tasks via EventBridge.
|
|
94
76
|
*
|
|
@@ -100,11 +82,11 @@ declare function createSqsHandler(): (event: SqsEvent) => Promise<SqsBatchRespon
|
|
|
100
82
|
* export const schedule = createScheduleHandler(scheduler)
|
|
101
83
|
* ```
|
|
102
84
|
*/
|
|
103
|
-
declare function createScheduleHandler(scheduler: Scheduler): () => Promise<void>;
|
|
85
|
+
export declare function createScheduleHandler(scheduler: Scheduler): () => Promise<void>;
|
|
104
86
|
/**
|
|
105
87
|
* Console command event payload for Lambda.
|
|
106
88
|
*/
|
|
107
|
-
interface ConsoleEvent {
|
|
89
|
+
export interface ConsoleEvent {
|
|
108
90
|
/**
|
|
109
91
|
* Command string to execute (e.g. "db:migrate", "users:create john@example.com --admin").
|
|
110
92
|
*/
|
|
@@ -113,7 +95,7 @@ interface ConsoleEvent {
|
|
|
113
95
|
/**
|
|
114
96
|
* Console command result from Lambda.
|
|
115
97
|
*/
|
|
116
|
-
interface ConsoleResult {
|
|
98
|
+
export interface ConsoleResult {
|
|
117
99
|
exitCode: number;
|
|
118
100
|
}
|
|
119
101
|
/**
|
|
@@ -130,22 +112,22 @@ interface ConsoleResult {
|
|
|
130
112
|
* export const console = createConsoleHandler(kernel)
|
|
131
113
|
* ```
|
|
132
114
|
*/
|
|
133
|
-
declare function createConsoleHandler(kernel: ConsoleKernel): (event: ConsoleEvent) => Promise<ConsoleResult>;
|
|
115
|
+
export declare function createConsoleHandler(kernel: ConsoleKernel): (event: ConsoleEvent) => Promise<ConsoleResult>;
|
|
134
116
|
/**
|
|
135
117
|
* Detect if the current process is running inside AWS Lambda.
|
|
136
118
|
*
|
|
137
119
|
* Checks for the `AWS_LAMBDA_FUNCTION_NAME` environment variable,
|
|
138
120
|
* which AWS sets automatically in all Lambda runtimes.
|
|
139
121
|
*/
|
|
140
|
-
declare function isLambda(): boolean;
|
|
122
|
+
export declare function isLambda(): boolean;
|
|
141
123
|
/**
|
|
142
124
|
* Get Lambda environment metadata, or null if not running on Lambda.
|
|
143
125
|
*/
|
|
144
|
-
declare function getLambdaContext(): LambdaRuntimeContext | null;
|
|
126
|
+
export declare function getLambdaContext(): LambdaRuntimeContext | null;
|
|
145
127
|
/**
|
|
146
128
|
* Lambda runtime context metadata.
|
|
147
129
|
*/
|
|
148
|
-
interface LambdaRuntimeContext {
|
|
130
|
+
export interface LambdaRuntimeContext {
|
|
149
131
|
functionName: string;
|
|
150
132
|
functionVersion: string;
|
|
151
133
|
memorySize: number;
|
|
@@ -154,5 +136,3 @@ interface LambdaRuntimeContext {
|
|
|
154
136
|
logStream?: string;
|
|
155
137
|
tmpDir: string;
|
|
156
138
|
}
|
|
157
|
-
|
|
158
|
-
export { type ConsoleEvent, type ConsoleResult, type LambdaRuntimeContext, type SqsBatchItemFailure, type SqsBatchResponse, type SqsEvent, type SqsRecord, createConsoleHandler, createLambdaHandler, createScheduleHandler, createSqsHandler, getLambdaContext, isLambda };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { LogConfig, LogChannelFactory } from './types.js';
|
|
2
|
+
import { Logger } from './Logger.js';
|
|
3
|
+
/**
|
|
4
|
+
* Log manager for managing multiple logging channels.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* const log = new LogManager({
|
|
9
|
+
* default: 'stack',
|
|
10
|
+
* channels: {
|
|
11
|
+
* console: { driver: 'console', level: 'debug' },
|
|
12
|
+
* file: { driver: 'daily', path: './storage/logs/app.log', days: 14 },
|
|
13
|
+
* stack: { driver: 'stack', channels: ['console', 'file'] },
|
|
14
|
+
* }
|
|
15
|
+
* })
|
|
16
|
+
*
|
|
17
|
+
* log.info('User logged in', { userId: user.id })
|
|
18
|
+
* log.error('Payment failed', { orderId, error: error.message })
|
|
19
|
+
*
|
|
20
|
+
* const requestLog = log.withContext({ requestId: ctx.requestId })
|
|
21
|
+
* requestLog.info('Processing request')
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class LogManager {
|
|
25
|
+
private readonly config;
|
|
26
|
+
private readonly channelFactories;
|
|
27
|
+
private readonly channelInstances;
|
|
28
|
+
private readonly loggers;
|
|
29
|
+
private readonly loggerOptions;
|
|
30
|
+
constructor(config: LogConfig);
|
|
31
|
+
private registerDefaultDrivers;
|
|
32
|
+
private createStackChannel;
|
|
33
|
+
/**
|
|
34
|
+
* Register a custom channel driver.
|
|
35
|
+
*/
|
|
36
|
+
registerDriver(name: string, factory: LogChannelFactory): void;
|
|
37
|
+
/**
|
|
38
|
+
* Get a logger for a specific channel.
|
|
39
|
+
*/
|
|
40
|
+
channel(name?: string): Logger;
|
|
41
|
+
/**
|
|
42
|
+
* Get a logger that writes to multiple channels.
|
|
43
|
+
*/
|
|
44
|
+
stack(channelNames: string[]): Logger;
|
|
45
|
+
private resolveChannel;
|
|
46
|
+
/**
|
|
47
|
+
* Create a logger with additional context using the default channel.
|
|
48
|
+
*/
|
|
49
|
+
withContext(context: Record<string, unknown>): Logger;
|
|
50
|
+
emergency(message: string, context?: Record<string, unknown>): void;
|
|
51
|
+
alert(message: string, context?: Record<string, unknown>): void;
|
|
52
|
+
critical(message: string, context?: Record<string, unknown>): void;
|
|
53
|
+
error(message: string, context?: Record<string, unknown>): void;
|
|
54
|
+
warning(message: string, context?: Record<string, unknown>): void;
|
|
55
|
+
warn(message: string, context?: Record<string, unknown>): void;
|
|
56
|
+
notice(message: string, context?: Record<string, unknown>): void;
|
|
57
|
+
info(message: string, context?: Record<string, unknown>): void;
|
|
58
|
+
debug(message: string, context?: Record<string, unknown>): void;
|
|
59
|
+
/**
|
|
60
|
+
* Close all channel instances.
|
|
61
|
+
*/
|
|
62
|
+
close(): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Get the default channel name.
|
|
65
|
+
*/
|
|
66
|
+
getDefaultChannel(): string;
|
|
67
|
+
/**
|
|
68
|
+
* Get available channel names.
|
|
69
|
+
*/
|
|
70
|
+
getChannelNames(): string[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Create a log manager instance.
|
|
74
|
+
*/
|
|
75
|
+
export declare function createLogManager(config: LogConfig): LogManager;
|
|
76
|
+
/**
|
|
77
|
+
* Set the global log manager instance.
|
|
78
|
+
*/
|
|
79
|
+
export declare function setLogManager(manager: LogManager): void;
|
|
80
|
+
/**
|
|
81
|
+
* Get the global log manager instance.
|
|
82
|
+
*/
|
|
83
|
+
export declare function getLogManager(): LogManager;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { LogChannel, LogLevel, LogContext } from './types.js';
|
|
2
|
+
export interface LoggerOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Keys whose values should be replaced with the replacement string.
|
|
5
|
+
* Matching is case-insensitive and recursive.
|
|
6
|
+
*/
|
|
7
|
+
filterKeys?: string[];
|
|
8
|
+
/** Replacement string for filtered values. Default: '[FILTERED]' */
|
|
9
|
+
replacement?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Recursively replace values of sensitive keys in a log context object.
|
|
13
|
+
*/
|
|
14
|
+
export declare function filterSensitiveData(data: Record<string, unknown>, filterKeys: string[], replacement?: string): Record<string, unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* Logger instance for writing log entries.
|
|
17
|
+
*/
|
|
18
|
+
export declare class Logger {
|
|
19
|
+
private readonly channels;
|
|
20
|
+
private readonly baseContext;
|
|
21
|
+
private readonly filterKeys;
|
|
22
|
+
private readonly replacement;
|
|
23
|
+
constructor(channels: LogChannel[], context?: LogContext, options?: LoggerOptions);
|
|
24
|
+
/**
|
|
25
|
+
* Log at emergency level (system is unusable).
|
|
26
|
+
*/
|
|
27
|
+
emergency(message: string, context?: LogContext): void;
|
|
28
|
+
/**
|
|
29
|
+
* Log at alert level (action must be taken immediately).
|
|
30
|
+
*/
|
|
31
|
+
alert(message: string, context?: LogContext): void;
|
|
32
|
+
/**
|
|
33
|
+
* Log at critical level (critical conditions).
|
|
34
|
+
*/
|
|
35
|
+
critical(message: string, context?: LogContext): void;
|
|
36
|
+
/**
|
|
37
|
+
* Log at error level (error conditions).
|
|
38
|
+
*/
|
|
39
|
+
error(message: string, context?: LogContext): void;
|
|
40
|
+
/**
|
|
41
|
+
* Log at warning level (warning conditions).
|
|
42
|
+
*/
|
|
43
|
+
warning(message: string, context?: LogContext): void;
|
|
44
|
+
/**
|
|
45
|
+
* Alias for warning().
|
|
46
|
+
*/
|
|
47
|
+
warn(message: string, context?: LogContext): void;
|
|
48
|
+
/**
|
|
49
|
+
* Log at notice level (normal but significant conditions).
|
|
50
|
+
*/
|
|
51
|
+
notice(message: string, context?: LogContext): void;
|
|
52
|
+
/**
|
|
53
|
+
* Log at info level (informational messages).
|
|
54
|
+
*/
|
|
55
|
+
info(message: string, context?: LogContext): void;
|
|
56
|
+
/**
|
|
57
|
+
* Log at debug level (debug-level messages).
|
|
58
|
+
*/
|
|
59
|
+
debug(message: string, context?: LogContext): void;
|
|
60
|
+
/**
|
|
61
|
+
* Log a message at the specified level.
|
|
62
|
+
*/
|
|
63
|
+
log(level: LogLevel, message: string, context?: LogContext): void;
|
|
64
|
+
/**
|
|
65
|
+
* Create a new logger with additional context.
|
|
66
|
+
*/
|
|
67
|
+
withContext(context: LogContext): Logger;
|
|
68
|
+
/**
|
|
69
|
+
* Create a child logger with additional context (alias for withContext).
|
|
70
|
+
*/
|
|
71
|
+
child(context: LogContext): Logger;
|
|
72
|
+
/**
|
|
73
|
+
* Close all channels.
|
|
74
|
+
*/
|
|
75
|
+
close(): Promise<void>;
|
|
76
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LogChannel, LogEntry, ConsoleChannelConfig } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Console log channel.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ConsoleChannel implements LogChannel {
|
|
6
|
+
private readonly config;
|
|
7
|
+
private readonly minLevel;
|
|
8
|
+
constructor(config: ConsoleChannelConfig);
|
|
9
|
+
log(entry: LogEntry): void;
|
|
10
|
+
private format;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LogChannel, LogEntry, DailyFileChannelConfig } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Daily rotating file log channel.
|
|
4
|
+
*/
|
|
5
|
+
export declare class DailyFileChannel implements LogChannel {
|
|
6
|
+
private readonly config;
|
|
7
|
+
private readonly minLevel;
|
|
8
|
+
private currentDate;
|
|
9
|
+
private currentFilePath;
|
|
10
|
+
constructor(config: DailyFileChannelConfig);
|
|
11
|
+
log(entry: LogEntry): void;
|
|
12
|
+
private write;
|
|
13
|
+
private rotate;
|
|
14
|
+
private getFilePath;
|
|
15
|
+
private getDateString;
|
|
16
|
+
private ensureDirectory;
|
|
17
|
+
private cleanup;
|
|
18
|
+
private format;
|
|
19
|
+
close(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LogChannel, LogEntry, FileChannelConfig } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* File log channel.
|
|
4
|
+
*/
|
|
5
|
+
export declare class FileChannel implements LogChannel {
|
|
6
|
+
private readonly config;
|
|
7
|
+
private readonly minLevel;
|
|
8
|
+
private initialized;
|
|
9
|
+
constructor(config: FileChannelConfig);
|
|
10
|
+
log(entry: LogEntry): void;
|
|
11
|
+
private write;
|
|
12
|
+
private ensureDirectory;
|
|
13
|
+
private format;
|
|
14
|
+
close(): void;
|
|
15
|
+
}
|
package/dist/logging/index.d.ts
CHANGED
|
@@ -1,50 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
private readonly minLevel;
|
|
10
|
-
constructor(config: ConsoleChannelConfig);
|
|
11
|
-
log(entry: LogEntry): void;
|
|
12
|
-
private format;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* File log channel.
|
|
17
|
-
*/
|
|
18
|
-
declare class FileChannel implements LogChannel {
|
|
19
|
-
private readonly config;
|
|
20
|
-
private readonly minLevel;
|
|
21
|
-
private initialized;
|
|
22
|
-
constructor(config: FileChannelConfig);
|
|
23
|
-
log(entry: LogEntry): void;
|
|
24
|
-
private write;
|
|
25
|
-
private ensureDirectory;
|
|
26
|
-
private format;
|
|
27
|
-
close(): void;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Daily rotating file log channel.
|
|
32
|
-
*/
|
|
33
|
-
declare class DailyFileChannel implements LogChannel {
|
|
34
|
-
private readonly config;
|
|
35
|
-
private readonly minLevel;
|
|
36
|
-
private currentDate;
|
|
37
|
-
private currentFilePath;
|
|
38
|
-
constructor(config: DailyFileChannelConfig);
|
|
39
|
-
log(entry: LogEntry): void;
|
|
40
|
-
private write;
|
|
41
|
-
private rotate;
|
|
42
|
-
private getFilePath;
|
|
43
|
-
private getDateString;
|
|
44
|
-
private ensureDirectory;
|
|
45
|
-
private cleanup;
|
|
46
|
-
private format;
|
|
47
|
-
close(): void;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { ConsoleChannel, ConsoleChannelConfig, DailyFileChannel, DailyFileChannelConfig, FileChannel, FileChannelConfig, LogChannel, LogEntry };
|
|
1
|
+
export type { LogLevel, LogContext, LogEntry, LogChannel, LogChannelFactory, LogChannelConfig, ConsoleChannelConfig, FileChannelConfig, DailyFileChannelConfig, StackChannelConfig, LogConfig, LogFormatter, } from './types.js';
|
|
2
|
+
export { LOG_LEVEL_PRIORITY } from './types.js';
|
|
3
|
+
export { Logger, filterSensitiveData } from './Logger.js';
|
|
4
|
+
export type { LoggerOptions } from './Logger.js';
|
|
5
|
+
export { LogManager, createLogManager, setLogManager, getLogManager, } from './LogManager.js';
|
|
6
|
+
export { ConsoleChannel } from './channels/ConsoleChannel.js';
|
|
7
|
+
export { FileChannel } from './channels/FileChannel.js';
|
|
8
|
+
export { DailyFileChannel } from './channels/DailyFileChannel.js';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log level types (RFC 5424 severity levels).
|
|
3
|
+
*/
|
|
4
|
+
export type LogLevel = 'emergency' | 'alert' | 'critical' | 'error' | 'warning' | 'notice' | 'info' | 'debug';
|
|
5
|
+
/**
|
|
6
|
+
* Log level priority (lower = more severe).
|
|
7
|
+
*/
|
|
8
|
+
export declare const LOG_LEVEL_PRIORITY: Record<LogLevel, number>;
|
|
9
|
+
/**
|
|
10
|
+
* Log context (additional data attached to log entries).
|
|
11
|
+
*/
|
|
12
|
+
export type LogContext = Record<string, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Log entry structure.
|
|
15
|
+
*/
|
|
16
|
+
export interface LogEntry {
|
|
17
|
+
level: LogLevel;
|
|
18
|
+
message: string;
|
|
19
|
+
context: LogContext;
|
|
20
|
+
timestamp: Date;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Log channel interface.
|
|
24
|
+
*/
|
|
25
|
+
export interface LogChannel {
|
|
26
|
+
/**
|
|
27
|
+
* Write a log entry.
|
|
28
|
+
*/
|
|
29
|
+
log(entry: LogEntry): void | Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Close the channel (cleanup resources).
|
|
32
|
+
*/
|
|
33
|
+
close?(): void | Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Log channel factory.
|
|
37
|
+
*/
|
|
38
|
+
export type LogChannelFactory = (config: LogChannelConfig) => LogChannel;
|
|
39
|
+
/**
|
|
40
|
+
* Base channel configuration.
|
|
41
|
+
*/
|
|
42
|
+
export interface LogChannelConfig {
|
|
43
|
+
driver: string;
|
|
44
|
+
level?: LogLevel;
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Console channel configuration.
|
|
49
|
+
*/
|
|
50
|
+
export interface ConsoleChannelConfig extends LogChannelConfig {
|
|
51
|
+
driver: 'console';
|
|
52
|
+
colors?: boolean;
|
|
53
|
+
timestamps?: boolean;
|
|
54
|
+
format?: 'text' | 'json';
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* File channel configuration.
|
|
58
|
+
*/
|
|
59
|
+
export interface FileChannelConfig extends LogChannelConfig {
|
|
60
|
+
driver: 'file';
|
|
61
|
+
path: string;
|
|
62
|
+
format?: 'text' | 'json';
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Daily file channel configuration.
|
|
66
|
+
*/
|
|
67
|
+
export interface DailyFileChannelConfig extends LogChannelConfig {
|
|
68
|
+
driver: 'daily';
|
|
69
|
+
path: string;
|
|
70
|
+
days?: number;
|
|
71
|
+
format?: 'text' | 'json';
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Stack channel configuration.
|
|
75
|
+
*/
|
|
76
|
+
export interface StackChannelConfig extends LogChannelConfig {
|
|
77
|
+
driver: 'stack';
|
|
78
|
+
channels: string[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Log manager configuration.
|
|
82
|
+
*/
|
|
83
|
+
export interface LogConfig {
|
|
84
|
+
default: string;
|
|
85
|
+
channels: Record<string, LogChannelConfig>;
|
|
86
|
+
/** Keys whose values are replaced with '[FILTERED]' in log context. */
|
|
87
|
+
filterKeys?: string[];
|
|
88
|
+
/** Replacement string for filtered values. Default: '[FILTERED]' */
|
|
89
|
+
filterReplacement?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Log formatter.
|
|
93
|
+
*/
|
|
94
|
+
export interface LogFormatter {
|
|
95
|
+
format(entry: LogEntry): string;
|
|
96
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { MailAddress, MailAttachment, MailMessage, SendResult } from './types.js';
|
|
2
|
+
import type { MailManager } from './MailManager.js';
|
|
3
|
+
/**
|
|
4
|
+
* Fluent mail builder for composing and sending emails.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { mail, createMailManager } from '@guren/server/mail'
|
|
9
|
+
*
|
|
10
|
+
* const manager = createMailManager({ ... })
|
|
11
|
+
*
|
|
12
|
+
* // Send a simple email
|
|
13
|
+
* await mail(manager)
|
|
14
|
+
* .to('user@example.com')
|
|
15
|
+
* .subject('Hello!')
|
|
16
|
+
* .text('Hello World!')
|
|
17
|
+
* .send()
|
|
18
|
+
*
|
|
19
|
+
* // Send an HTML email with template
|
|
20
|
+
* await mail(manager)
|
|
21
|
+
* .to('user@example.com')
|
|
22
|
+
* .subject('Welcome!')
|
|
23
|
+
* .html('<h1>Welcome to our app!</h1>')
|
|
24
|
+
* .attach({ filename: 'guide.pdf', path: './guide.pdf' })
|
|
25
|
+
* .send()
|
|
26
|
+
*
|
|
27
|
+
* // Queue the email for async sending
|
|
28
|
+
* await mail(manager)
|
|
29
|
+
* .to('user@example.com')
|
|
30
|
+
* .subject('Report')
|
|
31
|
+
* .html('<p>Your report is ready</p>')
|
|
32
|
+
* .queue('emails')
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare class Mail {
|
|
36
|
+
private readonly manager;
|
|
37
|
+
private message;
|
|
38
|
+
private transportName?;
|
|
39
|
+
constructor(manager: MailManager);
|
|
40
|
+
/**
|
|
41
|
+
* Set the sender address.
|
|
42
|
+
*/
|
|
43
|
+
from(address: string | MailAddress): this;
|
|
44
|
+
/**
|
|
45
|
+
* Add a recipient.
|
|
46
|
+
*/
|
|
47
|
+
to(address: string | MailAddress): this;
|
|
48
|
+
/**
|
|
49
|
+
* Add multiple recipients.
|
|
50
|
+
*/
|
|
51
|
+
toMany(addresses: (string | MailAddress)[]): this;
|
|
52
|
+
/**
|
|
53
|
+
* Add a CC recipient.
|
|
54
|
+
*/
|
|
55
|
+
cc(address: string | MailAddress): this;
|
|
56
|
+
/**
|
|
57
|
+
* Add a BCC recipient.
|
|
58
|
+
*/
|
|
59
|
+
bcc(address: string | MailAddress): this;
|
|
60
|
+
/**
|
|
61
|
+
* Set the reply-to address.
|
|
62
|
+
*/
|
|
63
|
+
replyTo(address: string | MailAddress): this;
|
|
64
|
+
/**
|
|
65
|
+
* Set the subject.
|
|
66
|
+
*/
|
|
67
|
+
subject(subject: string): this;
|
|
68
|
+
/**
|
|
69
|
+
* Set the plain text body.
|
|
70
|
+
*/
|
|
71
|
+
text(content: string): this;
|
|
72
|
+
/**
|
|
73
|
+
* Set the HTML body.
|
|
74
|
+
*/
|
|
75
|
+
html(content: string): this;
|
|
76
|
+
/**
|
|
77
|
+
* Render a React component as HTML body.
|
|
78
|
+
* Requires @react-email/render to be installed.
|
|
79
|
+
*
|
|
80
|
+
* @param component - React component function
|
|
81
|
+
* @param props - Props to pass to the component
|
|
82
|
+
*/
|
|
83
|
+
template<P extends Record<string, unknown>>(component: (props: P) => unknown, props: P): Promise<this>;
|
|
84
|
+
/**
|
|
85
|
+
* Add an attachment.
|
|
86
|
+
*/
|
|
87
|
+
attach(attachment: MailAttachment): this;
|
|
88
|
+
/**
|
|
89
|
+
* Add a custom header.
|
|
90
|
+
* Rejects CR/LF characters to prevent SMTP header injection.
|
|
91
|
+
*/
|
|
92
|
+
header(key: string, value: string): this;
|
|
93
|
+
/**
|
|
94
|
+
* Specify which transport to use.
|
|
95
|
+
*/
|
|
96
|
+
via(transport: string): this;
|
|
97
|
+
/**
|
|
98
|
+
* Build the final message.
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* Mailable subclasses define their content in build() (subject, body, ...).
|
|
102
|
+
* It runs automatically before sending, so `new WelcomeMail(manager).to(x).send()`
|
|
103
|
+
* works without a manual build() call.
|
|
104
|
+
*/
|
|
105
|
+
protected build?(): this;
|
|
106
|
+
private hasRunBuild;
|
|
107
|
+
private runBuildOnce;
|
|
108
|
+
buildMessage(): MailMessage;
|
|
109
|
+
/**
|
|
110
|
+
* Send the email immediately.
|
|
111
|
+
*/
|
|
112
|
+
send(): Promise<SendResult>;
|
|
113
|
+
/**
|
|
114
|
+
* Queue the email for async sending.
|
|
115
|
+
*/
|
|
116
|
+
queue(queueName?: string): Promise<string>;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Set the global mail manager for queue jobs.
|
|
120
|
+
*/
|
|
121
|
+
export declare function setMailManager(manager: MailManager): void;
|
|
122
|
+
/**
|
|
123
|
+
* Get the global mail manager.
|
|
124
|
+
*/
|
|
125
|
+
export declare function getMailManager(): MailManager | null;
|
|
126
|
+
/**
|
|
127
|
+
* Create a new mail builder.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* await mail(manager)
|
|
132
|
+
* .to('user@example.com')
|
|
133
|
+
* .subject('Hello')
|
|
134
|
+
* .text('Hello World!')
|
|
135
|
+
* .send()
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
export declare function mail(manager: MailManager): Mail;
|