alepha 0.11.5 → 0.11.6

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/email.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as _alepha_core1 from "alepha";
2
+ import { Descriptor, InstantiableClass, KIND } from "alepha";
2
3
  import * as _alepha_logger0 from "alepha/logger";
3
4
  import { Transporter } from "nodemailer";
4
5
 
@@ -22,6 +23,43 @@ type EmailSendOptions = {
22
23
  body: string;
23
24
  };
24
25
  //#endregion
26
+ //#region src/descriptors/$email.d.ts
27
+ declare const $email: {
28
+ (options?: EmailDescriptorOptions): EmailDescriptor;
29
+ [KIND]: typeof EmailDescriptor;
30
+ };
31
+ interface EmailDescriptorOptions {
32
+ name?: string;
33
+ provider?: InstantiableClass<EmailProvider> | "memory";
34
+ }
35
+ /**
36
+ * Email descriptor for sending emails through various providers.
37
+ *
38
+ * Usage:
39
+ * ```typescript
40
+ * class MyService {
41
+ * private readonly welcomeEmail = $email({ name: "welcome" });
42
+ *
43
+ * async sendWelcome(userEmail: string, userName: string) {
44
+ * await this.welcomeEmail.send({
45
+ * to: userEmail,
46
+ * subject: "Welcome!",
47
+ * body: `<p>Hello ${userName}!</p>`
48
+ * });
49
+ * }
50
+ * }
51
+ * ```
52
+ */
53
+ declare class EmailDescriptor extends Descriptor<EmailDescriptorOptions> {
54
+ protected readonly provider: EmailProvider;
55
+ get name(): string;
56
+ /**
57
+ * Send an email using the configured provider.
58
+ */
59
+ send(options: EmailSendOptions): Promise<void>;
60
+ protected $provider(): EmailProvider;
61
+ }
62
+ //#endregion
25
63
  //#region src/errors/EmailError.d.ts
26
64
  declare class EmailError extends Error {
27
65
  constructor(message: string, cause?: Error);
@@ -126,6 +164,11 @@ declare module "alepha" {
126
164
  provider: EmailProvider;
127
165
  abort(): void;
128
166
  };
167
+ "email:sent": {
168
+ to: string | string[];
169
+ template: string;
170
+ provider: EmailProvider;
171
+ };
129
172
  }
130
173
  }
131
174
  /**
@@ -138,7 +181,7 @@ declare module "alepha" {
138
181
  * @see {@link EmailProvider}
139
182
  * @module alepha.email
140
183
  */
141
- declare const AlephaEmail: _alepha_core1.Service<_alepha_core1.Module<{}>>;
184
+ declare const AlephaEmail: _alepha_core1.Service<_alepha_core1.Module>;
142
185
  //#endregion
143
- export { AlephaEmail, EmailError, EmailProvider, EmailRecord, EmailSendOptions, LocalEmailProvider, LocalEmailProviderOptions, MemoryEmailProvider, NodemailerEmailProvider, NodemailerEmailProviderOptions };
186
+ export { $email, AlephaEmail, EmailDescriptor, EmailDescriptorOptions, EmailError, EmailProvider, EmailRecord, EmailSendOptions, LocalEmailProvider, LocalEmailProviderOptions, MemoryEmailProvider, NodemailerEmailProvider, NodemailerEmailProviderOptions };
144
187
  //# sourceMappingURL=index.d.ts.map
package/fake.d.ts CHANGED
@@ -67,7 +67,7 @@ declare class FakeProvider {
67
67
  * @see {@link FakeProvider}
68
68
  * @module alepha.fake
69
69
  */
70
- declare const AlephaFake: _alepha_core0.Service<_alepha_core0.Module<{}>>;
70
+ declare const AlephaFake: _alepha_core0.Service<_alepha_core0.Module>;
71
71
  //#endregion
72
72
  export { AlephaFake, FakeOptions, FakeProvider };
73
73
  //# sourceMappingURL=index.d.ts.map
package/file.d.ts CHANGED
@@ -522,7 +522,7 @@ declare class NodeFileSystem implements FileSystem {
522
522
  * @see {@link NodeFileSystem}
523
523
  * @module alepha.file
524
524
  */
525
- declare const AlephaFile: _alepha_core0.Service<_alepha_core0.Module<{}>>;
525
+ declare const AlephaFile: _alepha_core0.Service<_alepha_core0.Module>;
526
526
  //#endregion
527
527
  export { AlephaFile, CpOptions, CreateFileFromArrayBufferOptions, CreateFileFromBufferOptions, CreateFileFromStreamOptions, CreateFileFromTextOptions, CreateFileFromUrlOptions, CreateFileFromWebFileOptions, CreateFileOptions, FileSystem, FileTypeResult, LsOptions, MkdirOptions, NodeFileSystem, RmOptions, bufferToArrayBuffer, createFile, createFileFromBuffer, createFileFromStream, createFileFromUrl, createFileFromWebFile, detectFileType, getContentType, isReadableStream, mimeMap, streamToBuffer };
528
528
  //# sourceMappingURL=index.d.ts.map
package/lock/redis.d.ts CHANGED
@@ -18,7 +18,7 @@ declare class RedisLockProvider implements LockProvider {
18
18
  * @see {@link RedisLockProvider}
19
19
  * @module alepha.lock.redis
20
20
  */
21
- declare const AlephaLockRedis: _alepha_core0.Service<_alepha_core0.Module<{}>>;
21
+ declare const AlephaLockRedis: _alepha_core0.Service<_alepha_core0.Module>;
22
22
  //#endregion
23
23
  export { AlephaLockRedis, RedisLockProvider };
24
24
  //# sourceMappingURL=index.d.ts.map
package/lock.d.ts CHANGED
@@ -546,7 +546,7 @@ declare class MemoryLockProvider implements LockProvider {
546
546
  * @see {@link $lock}
547
547
  * @module alepha.lock
548
548
  */
549
- declare const AlephaLock: _alepha_core1.Service<_alepha_core1.Module<{}>>;
549
+ declare const AlephaLock: _alepha_core1.Service<_alepha_core1.Module>;
550
550
  //#endregion
551
551
  export { $lock, AlephaLock, LockDescriptor, LockDescriptorOptions, LockProvider, LockResult, LockTopicProvider, MemoryLockProvider };
552
552
  //# sourceMappingURL=index.d.ts.map
package/logger.d.ts CHANGED
@@ -223,7 +223,7 @@ declare class SimpleFormatterProvider extends LogFormatterProvider {
223
223
  *
224
224
  * Log level is also available in the state as `logLevel`, which can be used to dynamically change the log level at runtime.
225
225
  * ```ts
226
- * alepha.state.set("logLevel", "debug");
226
+ * alepha.state.set("alepha.logger.level", "debug");
227
227
  * ```
228
228
  *
229
229
  * Log level is $module aware, meaning you can set different log levels for different modules.
@@ -240,7 +240,7 @@ declare class SimpleFormatterProvider extends LogFormatterProvider {
240
240
  * - Empty parts are gracefully skipped: `LOG_LEVEL=",,debug,,"` works fine
241
241
  * - Better error messages: "Invalid log level 'bad' for module pattern 'alepha'"
242
242
  */
243
- declare const AlephaLogger: _alepha_core0.Service<_alepha_core0.Module<{}>>;
243
+ declare const AlephaLogger: _alepha_core0.Service<_alepha_core0.Module>;
244
244
  declare const envSchema: _alepha_core0.TObject<{
245
245
  /**
246
246
  * Default log level for the application.
@@ -270,7 +270,10 @@ declare const envSchema: _alepha_core0.TObject<{
270
270
  declare module "alepha" {
271
271
  interface Env extends Partial<Static<typeof envSchema>> {}
272
272
  interface State {
273
- logLevel?: string;
273
+ /**
274
+ * Current log level for the application or specific modules.
275
+ */
276
+ "alepha.logger.level"?: string;
274
277
  }
275
278
  interface Hooks {
276
279
  log: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alepha",
3
- "version": "0.11.5",
3
+ "version": "0.11.6",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
@@ -15,56 +15,56 @@
15
15
  "main": "./core.js",
16
16
  "types": "./core.d.ts",
17
17
  "dependencies": {
18
- "@alepha/api-files": "0.11.5",
19
- "@alepha/api-jobs": "0.11.5",
20
- "@alepha/api-notifications": "0.11.5",
21
- "@alepha/api-users": "0.11.5",
22
- "@alepha/api-verifications": "0.11.5",
23
- "@alepha/batch": "0.11.5",
24
- "@alepha/bucket": "0.11.5",
25
- "@alepha/cache": "0.11.5",
26
- "@alepha/cache-redis": "0.11.5",
27
- "@alepha/command": "0.11.5",
28
- "@alepha/core": "0.11.5",
29
- "@alepha/datetime": "0.11.5",
30
- "@alepha/devtools": "0.11.5",
31
- "@alepha/email": "0.11.5",
32
- "@alepha/fake": "0.11.5",
33
- "@alepha/file": "0.11.5",
34
- "@alepha/lock": "0.11.5",
35
- "@alepha/lock-redis": "0.11.5",
36
- "@alepha/logger": "0.11.5",
37
- "@alepha/postgres": "0.11.5",
38
- "@alepha/queue": "0.11.5",
39
- "@alepha/queue-redis": "0.11.5",
40
- "@alepha/react": "0.11.5",
41
- "@alepha/react-auth": "0.11.5",
42
- "@alepha/react-form": "0.11.5",
43
- "@alepha/react-head": "0.11.5",
44
- "@alepha/react-i18n": "0.11.5",
45
- "@alepha/redis": "0.11.5",
46
- "@alepha/retry": "0.11.5",
47
- "@alepha/router": "0.11.5",
48
- "@alepha/scheduler": "0.11.5",
49
- "@alepha/security": "0.11.5",
50
- "@alepha/server": "0.11.5",
51
- "@alepha/server-cache": "0.11.5",
52
- "@alepha/server-compress": "0.11.5",
53
- "@alepha/server-cookies": "0.11.5",
54
- "@alepha/server-cors": "0.11.5",
55
- "@alepha/server-health": "0.11.5",
56
- "@alepha/server-helmet": "0.11.5",
57
- "@alepha/server-links": "0.11.5",
58
- "@alepha/server-metrics": "0.11.5",
59
- "@alepha/server-multipart": "0.11.5",
60
- "@alepha/server-proxy": "0.11.5",
61
- "@alepha/server-security": "0.11.5",
62
- "@alepha/server-static": "0.11.5",
63
- "@alepha/server-swagger": "0.11.5",
64
- "@alepha/topic": "0.11.5",
65
- "@alepha/topic-redis": "0.11.5",
66
- "@alepha/ui": "0.11.5",
67
- "@alepha/vite": "0.11.5",
18
+ "@alepha/api-files": "0.11.6",
19
+ "@alepha/api-jobs": "0.11.6",
20
+ "@alepha/api-notifications": "0.11.6",
21
+ "@alepha/api-users": "0.11.6",
22
+ "@alepha/api-verifications": "0.11.6",
23
+ "@alepha/batch": "0.11.6",
24
+ "@alepha/bucket": "0.11.6",
25
+ "@alepha/cache": "0.11.6",
26
+ "@alepha/cache-redis": "0.11.6",
27
+ "@alepha/command": "0.11.6",
28
+ "@alepha/core": "0.11.6",
29
+ "@alepha/datetime": "0.11.6",
30
+ "@alepha/devtools": "0.11.6",
31
+ "@alepha/email": "0.11.6",
32
+ "@alepha/fake": "0.11.6",
33
+ "@alepha/file": "0.11.6",
34
+ "@alepha/lock": "0.11.6",
35
+ "@alepha/lock-redis": "0.11.6",
36
+ "@alepha/logger": "0.11.6",
37
+ "@alepha/postgres": "0.11.6",
38
+ "@alepha/queue": "0.11.6",
39
+ "@alepha/queue-redis": "0.11.6",
40
+ "@alepha/react": "0.11.6",
41
+ "@alepha/react-auth": "0.11.6",
42
+ "@alepha/react-form": "0.11.6",
43
+ "@alepha/react-head": "0.11.6",
44
+ "@alepha/react-i18n": "0.11.6",
45
+ "@alepha/redis": "0.11.6",
46
+ "@alepha/retry": "0.11.6",
47
+ "@alepha/router": "0.11.6",
48
+ "@alepha/scheduler": "0.11.6",
49
+ "@alepha/security": "0.11.6",
50
+ "@alepha/server": "0.11.6",
51
+ "@alepha/server-cache": "0.11.6",
52
+ "@alepha/server-compress": "0.11.6",
53
+ "@alepha/server-cookies": "0.11.6",
54
+ "@alepha/server-cors": "0.11.6",
55
+ "@alepha/server-health": "0.11.6",
56
+ "@alepha/server-helmet": "0.11.6",
57
+ "@alepha/server-links": "0.11.6",
58
+ "@alepha/server-metrics": "0.11.6",
59
+ "@alepha/server-multipart": "0.11.6",
60
+ "@alepha/server-proxy": "0.11.6",
61
+ "@alepha/server-security": "0.11.6",
62
+ "@alepha/server-static": "0.11.6",
63
+ "@alepha/server-swagger": "0.11.6",
64
+ "@alepha/topic": "0.11.6",
65
+ "@alepha/topic-redis": "0.11.6",
66
+ "@alepha/ui": "0.11.6",
67
+ "@alepha/vite": "0.11.6",
68
68
  "react": "^19.2.0",
69
69
  "react-dom": "^19.2.0"
70
70
  },