@guren/server 0.2.0-alpha.7 → 1.0.0-rc.9
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/Application-DtWDHXr1.d.ts +2110 -0
- package/dist/BroadcastManager-AkIWUGJo.d.ts +466 -0
- package/dist/CacheManager-BkvHEOZX.d.ts +244 -0
- package/dist/ConsoleKernel-CqCVrdZs.d.ts +207 -0
- package/dist/EventManager-CmIoLt7r.d.ts +207 -0
- package/dist/Gate-CNkBYf8m.d.ts +268 -0
- package/dist/HealthManager-DUyMIzsZ.d.ts +141 -0
- package/dist/I18nManager-Dtgzsf5n.d.ts +270 -0
- package/dist/LogManager-7mxnkaPM.d.ts +256 -0
- package/dist/MailManager-DpMvYiP9.d.ts +292 -0
- package/dist/Scheduler-BstvSca7.d.ts +469 -0
- package/dist/StorageManager-oZTHqaza.d.ts +337 -0
- package/dist/api-token-JOif2CtG.d.ts +1792 -0
- package/dist/app-key-CsBfRC_Q.d.ts +214 -0
- package/dist/auth/index.d.ts +418 -0
- package/dist/auth/index.js +6742 -0
- package/dist/authorization/index.d.ts +129 -0
- package/dist/authorization/index.js +621 -0
- package/dist/broadcasting/index.d.ts +233 -0
- package/dist/broadcasting/index.js +907 -0
- package/dist/cache/index.d.ts +233 -0
- package/dist/cache/index.js +817 -0
- package/dist/encryption/index.d.ts +222 -0
- package/dist/encryption/index.js +602 -0
- package/dist/events/index.d.ts +155 -0
- package/dist/events/index.js +330 -0
- package/dist/health/index.d.ts +185 -0
- package/dist/health/index.js +379 -0
- package/dist/i18n/index.d.ts +101 -0
- package/dist/i18n/index.js +597 -0
- package/dist/index-9_Jzj5jo.d.ts +7 -0
- package/dist/index.d.ts +2628 -619
- package/dist/index.js +22229 -3116
- package/dist/lambda/index.d.ts +156 -0
- package/dist/lambda/index.js +91 -0
- package/dist/logging/index.d.ts +50 -0
- package/dist/logging/index.js +557 -0
- package/dist/mail/index.d.ts +288 -0
- package/dist/mail/index.js +695 -0
- package/dist/mcp/index.d.ts +139 -0
- package/dist/mcp/index.js +382 -0
- package/dist/notifications/index.d.ts +271 -0
- package/dist/notifications/index.js +741 -0
- package/dist/queue/index.d.ts +423 -0
- package/dist/queue/index.js +958 -0
- package/dist/runtime/index.d.ts +93 -0
- package/dist/runtime/index.js +834 -0
- package/dist/scheduling/index.d.ts +41 -0
- package/dist/scheduling/index.js +836 -0
- package/dist/storage/index.d.ts +196 -0
- package/dist/storage/index.js +832 -0
- package/dist/vite/index.js +203 -3
- package/package.json +93 -6
- package/dist/chunk-FK2XQSBF.js +0 -160
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email address with optional display name.
|
|
3
|
+
*/
|
|
4
|
+
interface MailAddress {
|
|
5
|
+
/**
|
|
6
|
+
* Email address.
|
|
7
|
+
*/
|
|
8
|
+
email: string;
|
|
9
|
+
/**
|
|
10
|
+
* Display name.
|
|
11
|
+
*/
|
|
12
|
+
name?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Email attachment.
|
|
16
|
+
*/
|
|
17
|
+
interface MailAttachment {
|
|
18
|
+
/**
|
|
19
|
+
* Filename shown to recipient.
|
|
20
|
+
*/
|
|
21
|
+
filename: string;
|
|
22
|
+
/**
|
|
23
|
+
* Attachment content (Buffer or string).
|
|
24
|
+
*/
|
|
25
|
+
content?: Buffer | string;
|
|
26
|
+
/**
|
|
27
|
+
* Path to file to attach.
|
|
28
|
+
*/
|
|
29
|
+
path?: string;
|
|
30
|
+
/**
|
|
31
|
+
* MIME type.
|
|
32
|
+
*/
|
|
33
|
+
contentType?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Content-ID for inline attachments.
|
|
36
|
+
*/
|
|
37
|
+
cid?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Email message structure.
|
|
41
|
+
*/
|
|
42
|
+
interface MailMessage {
|
|
43
|
+
/**
|
|
44
|
+
* Sender address.
|
|
45
|
+
*/
|
|
46
|
+
from?: MailAddress;
|
|
47
|
+
/**
|
|
48
|
+
* Primary recipients.
|
|
49
|
+
*/
|
|
50
|
+
to: MailAddress[];
|
|
51
|
+
/**
|
|
52
|
+
* Carbon copy recipients.
|
|
53
|
+
*/
|
|
54
|
+
cc?: MailAddress[];
|
|
55
|
+
/**
|
|
56
|
+
* Blind carbon copy recipients.
|
|
57
|
+
*/
|
|
58
|
+
bcc?: MailAddress[];
|
|
59
|
+
/**
|
|
60
|
+
* Reply-to address.
|
|
61
|
+
*/
|
|
62
|
+
replyTo?: MailAddress;
|
|
63
|
+
/**
|
|
64
|
+
* Email subject.
|
|
65
|
+
*/
|
|
66
|
+
subject: string;
|
|
67
|
+
/**
|
|
68
|
+
* Plain text body.
|
|
69
|
+
*/
|
|
70
|
+
text?: string;
|
|
71
|
+
/**
|
|
72
|
+
* HTML body.
|
|
73
|
+
*/
|
|
74
|
+
html?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Attachments.
|
|
77
|
+
*/
|
|
78
|
+
attachments?: MailAttachment[];
|
|
79
|
+
/**
|
|
80
|
+
* Custom headers.
|
|
81
|
+
*/
|
|
82
|
+
headers?: Record<string, string>;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Result of sending an email.
|
|
86
|
+
*/
|
|
87
|
+
interface SendResult {
|
|
88
|
+
/**
|
|
89
|
+
* Whether the email was sent successfully.
|
|
90
|
+
*/
|
|
91
|
+
success: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Message ID from the mail server.
|
|
94
|
+
*/
|
|
95
|
+
messageId?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Response from the mail server.
|
|
98
|
+
*/
|
|
99
|
+
response?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Error message if sending failed.
|
|
102
|
+
*/
|
|
103
|
+
error?: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Mail transport interface.
|
|
107
|
+
* Implement this to create custom email providers.
|
|
108
|
+
*/
|
|
109
|
+
interface MailTransport {
|
|
110
|
+
/**
|
|
111
|
+
* Transport name.
|
|
112
|
+
*/
|
|
113
|
+
readonly name: string;
|
|
114
|
+
/**
|
|
115
|
+
* Send an email message.
|
|
116
|
+
*/
|
|
117
|
+
send(message: MailMessage): Promise<SendResult>;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Mail transport factory function.
|
|
121
|
+
*/
|
|
122
|
+
type MailTransportFactory = () => MailTransport;
|
|
123
|
+
/**
|
|
124
|
+
* Mail transport configuration.
|
|
125
|
+
*/
|
|
126
|
+
interface MailTransportConfig {
|
|
127
|
+
/**
|
|
128
|
+
* Transport driver name.
|
|
129
|
+
*/
|
|
130
|
+
driver: string;
|
|
131
|
+
/**
|
|
132
|
+
* Driver-specific options.
|
|
133
|
+
*/
|
|
134
|
+
[key: string]: unknown;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Mail configuration.
|
|
138
|
+
*/
|
|
139
|
+
interface MailConfig {
|
|
140
|
+
/**
|
|
141
|
+
* Default transport name.
|
|
142
|
+
* @default 'smtp'
|
|
143
|
+
*/
|
|
144
|
+
default?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Default from address.
|
|
147
|
+
*/
|
|
148
|
+
from?: MailAddress;
|
|
149
|
+
/**
|
|
150
|
+
* Transport configurations.
|
|
151
|
+
*/
|
|
152
|
+
transports?: Record<string, MailTransportConfig>;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* SMTP transport options.
|
|
156
|
+
*/
|
|
157
|
+
interface SmtpTransportOptions {
|
|
158
|
+
/**
|
|
159
|
+
* SMTP server host.
|
|
160
|
+
*/
|
|
161
|
+
host: string;
|
|
162
|
+
/**
|
|
163
|
+
* SMTP server port.
|
|
164
|
+
* @default 587
|
|
165
|
+
*/
|
|
166
|
+
port?: number;
|
|
167
|
+
/**
|
|
168
|
+
* Use TLS.
|
|
169
|
+
* @default false
|
|
170
|
+
*/
|
|
171
|
+
secure?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Authentication credentials.
|
|
174
|
+
*/
|
|
175
|
+
auth?: {
|
|
176
|
+
user: string;
|
|
177
|
+
pass: string;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Connection pool.
|
|
181
|
+
* @default true
|
|
182
|
+
*/
|
|
183
|
+
pool?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Maximum connections.
|
|
186
|
+
* @default 5
|
|
187
|
+
*/
|
|
188
|
+
maxConnections?: number;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Resend transport options.
|
|
192
|
+
*/
|
|
193
|
+
interface ResendTransportOptions {
|
|
194
|
+
/**
|
|
195
|
+
* Resend API key.
|
|
196
|
+
*/
|
|
197
|
+
apiKey: string;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Memory transport options (for testing).
|
|
201
|
+
*/
|
|
202
|
+
interface MemoryTransportOptions {
|
|
203
|
+
/**
|
|
204
|
+
* Whether to simulate failures.
|
|
205
|
+
*/
|
|
206
|
+
simulateFailure?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Error message when simulating failures.
|
|
209
|
+
*/
|
|
210
|
+
failureMessage?: string;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Mail manager for handling multiple transports.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```ts
|
|
218
|
+
* const mailManager = new MailManager({
|
|
219
|
+
* default: 'smtp',
|
|
220
|
+
* from: { email: 'noreply@example.com', name: 'MyApp' },
|
|
221
|
+
* transports: {
|
|
222
|
+
* smtp: {
|
|
223
|
+
* driver: 'smtp',
|
|
224
|
+
* host: 'smtp.example.com',
|
|
225
|
+
* port: 587,
|
|
226
|
+
* auth: { user: 'user', pass: 'pass' },
|
|
227
|
+
* },
|
|
228
|
+
* resend: {
|
|
229
|
+
* driver: 'resend',
|
|
230
|
+
* apiKey: 'your-api-key',
|
|
231
|
+
* },
|
|
232
|
+
* },
|
|
233
|
+
* })
|
|
234
|
+
*
|
|
235
|
+
* // Get the default transport
|
|
236
|
+
* const transport = mailManager.transport()
|
|
237
|
+
*
|
|
238
|
+
* // Get a specific transport
|
|
239
|
+
* const resendTransport = mailManager.transport('resend')
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
declare class MailManager {
|
|
243
|
+
private readonly defaultTransportName;
|
|
244
|
+
private readonly defaultFrom?;
|
|
245
|
+
private readonly transportFactories;
|
|
246
|
+
private readonly resolvedTransports;
|
|
247
|
+
constructor(config?: MailConfig);
|
|
248
|
+
/**
|
|
249
|
+
* Register built-in transport drivers.
|
|
250
|
+
*/
|
|
251
|
+
private registerBuiltinDrivers;
|
|
252
|
+
private driverFactories;
|
|
253
|
+
/**
|
|
254
|
+
* Register a driver factory.
|
|
255
|
+
*/
|
|
256
|
+
private registerDriverFactory;
|
|
257
|
+
/**
|
|
258
|
+
* Register a transport from configuration.
|
|
259
|
+
*/
|
|
260
|
+
private registerTransportFromConfig;
|
|
261
|
+
/**
|
|
262
|
+
* Get a mail transport by name.
|
|
263
|
+
* Returns the default transport if no name is specified.
|
|
264
|
+
*/
|
|
265
|
+
transport(name?: string): MailTransport;
|
|
266
|
+
/**
|
|
267
|
+
* Register a custom transport.
|
|
268
|
+
*/
|
|
269
|
+
registerTransport(name: string, factory: MailTransportFactory): void;
|
|
270
|
+
/**
|
|
271
|
+
* Check if a transport is registered.
|
|
272
|
+
*/
|
|
273
|
+
hasTransport(name: string): boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Get the default transport name.
|
|
276
|
+
*/
|
|
277
|
+
getDefaultTransportName(): string;
|
|
278
|
+
/**
|
|
279
|
+
* Get the default from address.
|
|
280
|
+
*/
|
|
281
|
+
getDefaultFrom(): MailAddress | undefined;
|
|
282
|
+
/**
|
|
283
|
+
* Get all registered transport names.
|
|
284
|
+
*/
|
|
285
|
+
getTransportNames(): string[];
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Create a mail manager with configuration.
|
|
289
|
+
*/
|
|
290
|
+
declare function createMailManager(config?: MailConfig): MailManager;
|
|
291
|
+
|
|
292
|
+
export { MailManager as M, type ResendTransportOptions as R, type SendResult as S, type MailAddress as a, type MailAttachment as b, type MailConfig as c, type MailMessage as d, type MailTransport as e, type MailTransportConfig as f, type MailTransportFactory as g, type MemoryTransportOptions as h, type SmtpTransportOptions as i, createMailManager as j };
|