alepha 0.10.1 → 0.10.2
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/README.md +128 -29
- package/batch.d.ts +1 -1
- package/bucket.d.ts +1 -1
- package/cache/redis.d.ts +1 -1
- package/cache.d.ts +1 -1
- package/command.d.ts +1 -1
- package/core.d.ts +20 -11
- package/datetime.d.ts +1 -1
- package/email.d.ts +6 -6
- package/lock/redis.d.ts +1 -1
- package/lock.d.ts +1 -1
- package/logger.d.ts +1 -1
- package/package.json +44 -44
- package/postgres.d.ts +71 -383
- package/queue/redis.d.ts +1 -1
- package/queue.d.ts +1 -1
- package/react/auth.d.ts +1 -1
- package/react/form.d.ts +1 -1
- package/react/head.d.ts +1 -1
- package/react/i18n.d.ts +1 -1
- package/react.d.ts +6 -6
- package/redis.d.ts +1 -1
- package/scheduler.d.ts +1 -1
- package/security.d.ts +5 -5
- package/server/cache.d.ts +1 -1
- package/server/compress.d.ts +1 -1
- package/server/cookies.d.ts +1 -1
- package/server/cors.d.ts +1 -1
- package/server/health.d.ts +1 -1
- package/server/helmet.d.ts +1 -1
- package/server/links.d.ts +30 -30
- package/server/metrics.d.ts +1 -1
- package/server/multipart.d.ts +1 -1
- package/server/proxy.d.ts +1 -1
- package/server/security.d.ts +1 -1
- package/server/static.d.ts +1 -1
- package/server/swagger.d.ts +14 -1
- package/server.d.ts +35 -390
- package/topic/redis.d.ts +1 -1
- package/topic.d.ts +1 -1
package/README.md
CHANGED
|
@@ -34,7 +34,9 @@ npm install alepha
|
|
|
34
34
|
|
|
35
35
|
## What is this?
|
|
36
36
|
|
|
37
|
-
Alepha is an opinionated framework that handles everything from database to frontend.
|
|
37
|
+
Alepha is an opinionated framework that handles everything from database to frontend.
|
|
38
|
+
|
|
39
|
+
It uses a descriptor-based architecture (`$action`, `$page`, `$repository`, etc.) and enforces type safety across the entire stack.
|
|
38
40
|
|
|
39
41
|
```ts
|
|
40
42
|
import { run } from "alepha";
|
|
@@ -49,63 +51,169 @@ class App {
|
|
|
49
51
|
run(App);
|
|
50
52
|
```
|
|
51
53
|
|
|
54
|
+
👉 For more information, please visit the [documentation](https://feunard.github.io/alepha/).
|
|
55
|
+
|
|
52
56
|
## Examples
|
|
53
57
|
|
|
54
58
|
### Type-safe API endpoint
|
|
55
59
|
|
|
56
60
|
```ts
|
|
61
|
+
// app.ts
|
|
62
|
+
import { run, t } from "alepha";
|
|
57
63
|
import { $action } from "alepha/server";
|
|
58
|
-
import {
|
|
64
|
+
import { $swagger } from "alepha/server/swagger";
|
|
59
65
|
|
|
60
|
-
class
|
|
61
|
-
|
|
66
|
+
class Api {
|
|
67
|
+
docs = $swagger({
|
|
68
|
+
info: {
|
|
69
|
+
title: "My API",
|
|
70
|
+
version: "1.0.0",
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
sayHello = $action({
|
|
75
|
+
path: "/hello/:name",
|
|
62
76
|
schema: {
|
|
63
|
-
params: t.object({
|
|
77
|
+
params: t.object({
|
|
78
|
+
name: t.string()
|
|
79
|
+
}),
|
|
64
80
|
response: t.object({
|
|
65
|
-
|
|
66
|
-
email: t.string()
|
|
81
|
+
message: t.string(),
|
|
67
82
|
})
|
|
68
83
|
},
|
|
69
84
|
handler: async ({ params }) => {
|
|
70
|
-
return {
|
|
85
|
+
return { message: `Hello ${params.name} !` };
|
|
71
86
|
}
|
|
72
87
|
});
|
|
73
88
|
}
|
|
89
|
+
|
|
90
|
+
run(Api);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
node app.ts
|
|
74
95
|
```
|
|
75
96
|
|
|
76
97
|
### Database with Drizzle ORM
|
|
77
98
|
|
|
99
|
+
Drizzle ORM is a type-safe ORM for TypeScript, bundled inside Alepha.
|
|
100
|
+
|
|
101
|
+
Drizzle Kit CLI is required as dev dependencies:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm install -D drizzle-kit
|
|
105
|
+
```
|
|
106
|
+
|
|
78
107
|
```ts
|
|
79
|
-
|
|
80
|
-
import {
|
|
108
|
+
// app.ts
|
|
109
|
+
import { $hook, run, t } from "alepha";
|
|
110
|
+
import { $entity, $repository, pg } from "alepha/postgres";
|
|
111
|
+
import { $logger } from "alepha/logger";
|
|
81
112
|
|
|
82
113
|
export const users = $entity({
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
114
|
+
name: "users",
|
|
115
|
+
schema: t.object({
|
|
116
|
+
id: pg.primaryKey(),
|
|
117
|
+
name: t.string(),
|
|
118
|
+
}),
|
|
86
119
|
});
|
|
87
120
|
|
|
88
|
-
type CreateUser = Static<typeof users.$insertSchema>;
|
|
89
121
|
|
|
90
|
-
class
|
|
122
|
+
class Db {
|
|
123
|
+
log = $logger();
|
|
91
124
|
users = $repository(users);
|
|
92
125
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
126
|
+
ready = $hook({
|
|
127
|
+
on: "ready",
|
|
128
|
+
handler: async () => {
|
|
129
|
+
await this.users.create({
|
|
130
|
+
name: "John Doe",
|
|
131
|
+
})
|
|
132
|
+
this.log.info("Users:", await this.users.find())
|
|
133
|
+
}
|
|
134
|
+
})
|
|
96
135
|
}
|
|
136
|
+
|
|
137
|
+
run(Db)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
node app.ts
|
|
97
142
|
```
|
|
98
143
|
|
|
99
144
|
### React SSR Page
|
|
100
145
|
|
|
146
|
+
Alepha has built-in React **CSR** & **SSR** support.
|
|
147
|
+
|
|
148
|
+
[React](https://react.dev) is required as a `dependency`:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npm install react react-dom
|
|
152
|
+
npm install -D @types/react
|
|
153
|
+
```
|
|
154
|
+
|
|
101
155
|
```tsx
|
|
156
|
+
// app.tsx
|
|
157
|
+
import { run, t } from "alepha";
|
|
102
158
|
import { $page } from "alepha/react";
|
|
159
|
+
import { useState } from "react";
|
|
160
|
+
|
|
161
|
+
const Hello = (props: { start: number }) => {
|
|
162
|
+
const [ count, setCount ] = useState(props.start);
|
|
163
|
+
return <button onClick={() => setCount(count + 1)}>Clicked: {count}</button>
|
|
164
|
+
}
|
|
103
165
|
|
|
104
166
|
class HomePage {
|
|
105
167
|
index = $page({
|
|
106
|
-
|
|
168
|
+
schema: {
|
|
169
|
+
query: t.object({
|
|
170
|
+
s: t.number({ default: 0 }),
|
|
171
|
+
})
|
|
172
|
+
},
|
|
173
|
+
component: Hello,
|
|
174
|
+
resolve: (req) => {
|
|
175
|
+
return { start: req.query.s };
|
|
176
|
+
},
|
|
107
177
|
});
|
|
108
178
|
}
|
|
179
|
+
|
|
180
|
+
run(HomePage);
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
[Vite](https://vite.dev) is required as a `devDependencies`:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
npm install -D vite
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
// vite.config.ts
|
|
191
|
+
import { viteAlepha } from "alepha/vite";
|
|
192
|
+
import { defineConfig } from "vite";
|
|
193
|
+
|
|
194
|
+
export default defineConfig({
|
|
195
|
+
plugins: [
|
|
196
|
+
viteAlepha()
|
|
197
|
+
]
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
```html
|
|
202
|
+
<!-- index.html -->
|
|
203
|
+
<!DOCTYPE html>
|
|
204
|
+
<html lang="en">
|
|
205
|
+
<head>
|
|
206
|
+
<meta charset="UTF-8">
|
|
207
|
+
<title>App</title>
|
|
208
|
+
</head>
|
|
209
|
+
<body>
|
|
210
|
+
<script type="module" src="app.tsx"></script>
|
|
211
|
+
</body>
|
|
212
|
+
</html>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
npx vite
|
|
109
217
|
```
|
|
110
218
|
|
|
111
219
|
## Core Concepts
|
|
@@ -116,16 +224,7 @@ class HomePage {
|
|
|
116
224
|
- **Convention over Config**: Minimal boilerplate, sensible defaults
|
|
117
225
|
- **Full-Stack**: React SSR, Vite, class-based router with type-safe routing
|
|
118
226
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
- Node.js 22+
|
|
122
|
-
- TypeScript
|
|
123
|
-
- React (SSR)
|
|
124
|
-
- Vite
|
|
125
|
-
- Drizzle ORM
|
|
126
|
-
- PostgreSQL
|
|
127
|
-
|
|
128
|
-
👉 For more information, please visit the [documentation](https://feunard.github.io/alepha/).
|
|
227
|
+
Plenty of other features are available, please check the [documentation](https://feunard.github.io/alepha/).
|
|
129
228
|
|
|
130
229
|
## License
|
|
131
230
|
|
package/batch.d.ts
CHANGED
|
@@ -579,7 +579,7 @@ declare class BatchDescriptor<TItem extends TSchema, TResponse = any> extends De
|
|
|
579
579
|
* @see {@link $batch}
|
|
580
580
|
* @module alepha.batch
|
|
581
581
|
*/
|
|
582
|
-
declare const AlephaBatch: _alepha_core1.Service<_alepha_core1.Module
|
|
582
|
+
declare const AlephaBatch: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
583
583
|
//#endregion
|
|
584
584
|
export { $batch, AlephaBatch, BatchDescriptor, BatchDescriptorOptions };
|
|
585
585
|
//# sourceMappingURL=index.d.ts.map
|
package/bucket.d.ts
CHANGED
|
@@ -618,7 +618,7 @@ declare module "alepha" {
|
|
|
618
618
|
* @see {@link FileStorageProvider}
|
|
619
619
|
* @module alepha.bucket
|
|
620
620
|
*/
|
|
621
|
-
declare const AlephaBucket: _alepha_core1.Service<_alepha_core1.Module
|
|
621
|
+
declare const AlephaBucket: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
622
622
|
//#endregion
|
|
623
623
|
export { $bucket, AlephaBucket, BucketDescriptor, BucketDescriptorOptions, BucketFileOptions, FileNotFoundError, FileStorageProvider, LocalFileStorageProvider, MemoryFileStorageProvider, fileMetadataSchema };
|
|
624
624
|
//# sourceMappingURL=index.d.ts.map
|
package/cache/redis.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ declare class RedisCacheProvider implements CacheProvider {
|
|
|
33
33
|
* @see {@link RedisCacheProvider}
|
|
34
34
|
* @module alepha.cache.redis
|
|
35
35
|
*/
|
|
36
|
-
declare const AlephaCacheRedis: _alepha_core1.Service<_alepha_core1.Module
|
|
36
|
+
declare const AlephaCacheRedis: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { AlephaCacheRedis, RedisCacheProvider };
|
|
39
39
|
//# sourceMappingURL=index.d.ts.map
|
package/cache.d.ts
CHANGED
|
@@ -277,7 +277,7 @@ declare class MemoryCacheProvider implements CacheProvider {
|
|
|
277
277
|
* @see {@link CacheProvider}
|
|
278
278
|
* @module alepha.cache
|
|
279
279
|
*/
|
|
280
|
-
declare const AlephaCache: _alepha_core0.Service<_alepha_core0.Module
|
|
280
|
+
declare const AlephaCache: _alepha_core0.Service<_alepha_core0.Module<{}>>;
|
|
281
281
|
//#endregion
|
|
282
282
|
export { $cache, AlephaCache, CacheDescriptor, CacheDescriptorFn, CacheDescriptorOptions, CacheProvider, MemoryCacheProvider };
|
|
283
283
|
//# sourceMappingURL=index.d.ts.map
|
package/command.d.ts
CHANGED
|
@@ -220,7 +220,7 @@ declare class CliProvider {
|
|
|
220
220
|
* @see {@link $command}
|
|
221
221
|
* @module alepha.command
|
|
222
222
|
*/
|
|
223
|
-
declare const AlephaCommand: _alepha_core1.Service<_alepha_core1.Module
|
|
223
|
+
declare const AlephaCommand: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
224
224
|
declare module "typebox" {
|
|
225
225
|
interface StringOptions {
|
|
226
226
|
/**
|
package/core.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { AsyncLocalStorage } from "node:async_hooks";
|
|
|
2
2
|
import { Validator } from "typebox/compile";
|
|
3
3
|
import * as TypeBox from "typebox";
|
|
4
4
|
import { Static, Static as Static$1, StaticDecode, StaticEncode, TAny, TAny as TAny$1, TArray, TArray as TArray$1, TArrayOptions, TBigInt, TBoolean, TBoolean as TBoolean$1, TInteger, TInteger as TInteger$1, TKeysToIndexer, TNull, TNull as TNull$1, TNumber, TNumber as TNumber$1, TNumberOptions, TNumberOptions as TNumberOptions$1, TObject, TObject as TObject$1, TObjectOptions, TObjectOptions as TObjectOptions$1, TOptional, TOptionalAdd, TOptionalAdd as TOptionalAdd$1, TPick, TProperties, TProperties as TProperties$1, TRecord, TRecord as TRecord$1, TSchema, TSchema as TSchema$1, TSchemaOptions, TString, TString as TString$1, TStringOptions, TStringOptions as TStringOptions$1, TTuple, TUnion, TUnion as TUnion$1, TUnsafe, TVoid } from "typebox";
|
|
5
|
-
import
|
|
5
|
+
import TypeBoxFormat from "typebox/format";
|
|
6
6
|
import * as TypeBoxValue from "typebox/value";
|
|
7
7
|
import { Readable } from "node:stream";
|
|
8
8
|
import { ReadableStream as ReadableStream$1 } from "node:stream/web";
|
|
@@ -189,8 +189,8 @@ interface InjectOptions<T extends object = any> {
|
|
|
189
189
|
* Modules are more useful when the application grows and needs to be structured.
|
|
190
190
|
* If we speak with `$actions`, a module should be used when you have more than 30 actions in a single module.
|
|
191
191
|
*/
|
|
192
|
-
declare const $module: (options: ModuleDescriptorOptions) => Service<Module
|
|
193
|
-
interface ModuleDescriptorOptions {
|
|
192
|
+
declare const $module: <T extends object = {}>(options: ModuleDescriptorOptions<T>) => Service<Module<T>>;
|
|
193
|
+
interface ModuleDescriptorOptions<T extends object> {
|
|
194
194
|
/**
|
|
195
195
|
* Name of the module.
|
|
196
196
|
*
|
|
@@ -210,15 +210,16 @@ interface ModuleDescriptorOptions {
|
|
|
210
210
|
* You can override this behavior by providing a register function.
|
|
211
211
|
* It's useful when you want to register services conditionally or in a specific order.
|
|
212
212
|
*/
|
|
213
|
-
register?: (alepha: Alepha) => void;
|
|
213
|
+
register?: (alepha: Alepha, options: T) => void;
|
|
214
214
|
}
|
|
215
215
|
/**
|
|
216
216
|
* Base class for all modules.
|
|
217
217
|
*/
|
|
218
|
-
declare abstract class Module {
|
|
219
|
-
abstract readonly
|
|
218
|
+
declare abstract class Module<T extends object = {}> {
|
|
219
|
+
abstract readonly config: ModuleDescriptorOptions<T>;
|
|
220
220
|
abstract register(alepha: Alepha): void;
|
|
221
221
|
static NAME_REGEX: RegExp;
|
|
222
|
+
options: T;
|
|
222
223
|
/**
|
|
223
224
|
* Check if a Service is a Module.
|
|
224
225
|
*/
|
|
@@ -404,6 +405,11 @@ type StreamLike = ReadableStream | ReadableStream$1 | Readable | NodeJS.Readable
|
|
|
404
405
|
type TStream = TUnsafe<StreamLike>;
|
|
405
406
|
//#endregion
|
|
406
407
|
//#region src/providers/TypeProvider.d.ts
|
|
408
|
+
declare const isUUID: typeof TypeBoxFormat.IsUuid;
|
|
409
|
+
declare const isDateTime: typeof TypeBoxFormat.IsDateTime;
|
|
410
|
+
declare const isDate: typeof TypeBoxFormat.IsDate;
|
|
411
|
+
declare const isEmail: typeof TypeBoxFormat.IsEmail;
|
|
412
|
+
declare const isURL: typeof TypeBoxFormat.IsUrl;
|
|
407
413
|
declare class TypeGuard {
|
|
408
414
|
isSchema: typeof TypeBox.IsSchema;
|
|
409
415
|
isObject: typeof TypeBox.IsObject;
|
|
@@ -438,7 +444,7 @@ declare module "typebox" {
|
|
|
438
444
|
}
|
|
439
445
|
}
|
|
440
446
|
declare class TypeProvider {
|
|
441
|
-
static format: typeof
|
|
447
|
+
static format: typeof TypeBoxFormat;
|
|
442
448
|
static isValidBigInt(value: string | number): boolean;
|
|
443
449
|
/**
|
|
444
450
|
* Default maximum length for strings.
|
|
@@ -976,11 +982,14 @@ declare class Alepha {
|
|
|
976
982
|
* > If you are interested in configuring a service, use Alepha#configure() instead.
|
|
977
983
|
*
|
|
978
984
|
* @param serviceEntry - The service to register in the container.
|
|
985
|
+
* @param configure - Optional configuration object to merge with the service's options.
|
|
979
986
|
* @return Current instance of Alepha.
|
|
980
987
|
*/
|
|
981
|
-
with<T extends
|
|
988
|
+
with<T extends {
|
|
989
|
+
options?: object;
|
|
990
|
+
} & object>(serviceEntry: ServiceEntry<T> | {
|
|
982
991
|
default: ServiceEntry<T>;
|
|
983
|
-
}): this;
|
|
992
|
+
}, configure?: Partial<T["options"]>): this;
|
|
984
993
|
/**
|
|
985
994
|
* Get an instance of the specified service from the container.
|
|
986
995
|
*
|
|
@@ -1005,7 +1014,7 @@ declare class Alepha {
|
|
|
1005
1014
|
* ```
|
|
1006
1015
|
*/
|
|
1007
1016
|
configure<T extends {
|
|
1008
|
-
options
|
|
1017
|
+
options?: object;
|
|
1009
1018
|
}>(service: Service<T>, state: Partial<T["options"]>): this;
|
|
1010
1019
|
/**
|
|
1011
1020
|
* Casts the given value to the specified schema.
|
|
@@ -1390,5 +1399,5 @@ declare global {
|
|
|
1390
1399
|
*/
|
|
1391
1400
|
declare const run: (entry: Alepha | Service | Array<Service>, opts?: RunOptions) => void;
|
|
1392
1401
|
//#endregion
|
|
1393
|
-
export { $cursor, $env, $hook, $inject, $module, AbstractClass, Alepha, AlephaError, AlephaStringOptions, AlsProvider, AppNotStartedError, Async, AsyncFn, AsyncLocalStorageData, CircularDependencyError, ContainerLockedError, CursorDescriptor, Descriptor, DescriptorArgs, DescriptorConfig, DescriptorFactory, DescriptorFactoryLike, Env, FileLike, Hook, HookDescriptor, HookOptions, Hooks, InjectDescriptor, InjectOptions, InstantiableClass, KIND, LogLevel, LoggerInterface, MaybePromise, Module, ModuleDescriptorOptions, OPTIONS, Service, ServiceEntry, ServiceSubstitution, State, StateManager, type Static, type StaticDecode, type StaticEncode, StreamLike, type TAny, type TArray, type TBigInt, type TBoolean, TFile, type TInteger, type TKeysToIndexer, type TNull, type TNumber, type TNumberOptions, type TObject, type TObjectOptions, type TOptional, type TOptionalAdd, type TPick, type TProperties, type TRecord, type TSchema, TStream, type TString, type TStringOptions, type TTuple, type TUnion, type TVoid, TextLength, TooLateSubstitutionError, TypeBox, TypeBoxError, TypeBoxValue, TypeGuard, TypeProvider, WithModule, __alephaRef, createDescriptor, isFileLike, isTypeFile, run, t };
|
|
1402
|
+
export { $cursor, $env, $hook, $inject, $module, AbstractClass, Alepha, AlephaError, AlephaStringOptions, AlsProvider, AppNotStartedError, Async, AsyncFn, AsyncLocalStorageData, CircularDependencyError, ContainerLockedError, CursorDescriptor, Descriptor, DescriptorArgs, DescriptorConfig, DescriptorFactory, DescriptorFactoryLike, Env, FileLike, Hook, HookDescriptor, HookOptions, Hooks, InjectDescriptor, InjectOptions, InstantiableClass, KIND, LogLevel, LoggerInterface, MaybePromise, Module, ModuleDescriptorOptions, OPTIONS, Service, ServiceEntry, ServiceSubstitution, State, StateManager, type Static, type StaticDecode, type StaticEncode, StreamLike, type TAny, type TArray, type TBigInt, type TBoolean, TFile, type TInteger, type TKeysToIndexer, type TNull, type TNumber, type TNumberOptions, type TObject, type TObjectOptions, type TOptional, type TOptionalAdd, type TPick, type TProperties, type TRecord, type TSchema, TStream, type TString, type TStringOptions, type TTuple, type TUnion, type TVoid, TextLength, TooLateSubstitutionError, TypeBox, TypeBoxError, TypeBoxFormat, TypeBoxValue, TypeGuard, TypeProvider, WithModule, __alephaRef, createDescriptor, isDate, isDateTime, isEmail, isFileLike, isTypeFile, isURL, isUUID, run, t };
|
|
1394
1403
|
//# sourceMappingURL=index.d.ts.map
|
package/datetime.d.ts
CHANGED
|
@@ -132,7 +132,7 @@ declare class IntervalDescriptor extends Descriptor<IntervalDescriptorOptions> {
|
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region src/index.d.ts
|
|
135
|
-
declare const AlephaDateTime: _alepha_core1.Service<_alepha_core1.Module
|
|
135
|
+
declare const AlephaDateTime: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
136
136
|
//#endregion
|
|
137
137
|
export { $interval, AlephaDateTime, DateTime, DateTimeApi, DateTimeProvider, Duration, DurationLike, Interval, IntervalDescriptor, IntervalDescriptorOptions, Timeout };
|
|
138
138
|
//# sourceMappingURL=index.d.ts.map
|
package/email.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _alepha_core1 from "alepha";
|
|
2
2
|
import { Descriptor, KIND, Service, Static, TSchema } from "alepha";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alepha_logger0 from "alepha/logger";
|
|
4
4
|
import { Transporter } from "nodemailer";
|
|
5
5
|
|
|
6
6
|
//#region src/providers/EmailProvider.d.ts
|
|
@@ -30,7 +30,7 @@ interface EmailRecord {
|
|
|
30
30
|
sentAt: Date;
|
|
31
31
|
}
|
|
32
32
|
declare class MemoryEmailProvider implements EmailProvider {
|
|
33
|
-
protected readonly log:
|
|
33
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
34
34
|
protected emails: EmailRecord[];
|
|
35
35
|
send(to: string, subject: string, body: string): Promise<void>;
|
|
36
36
|
/**
|
|
@@ -224,7 +224,7 @@ interface EmailDescriptorOptions<T extends TSchema> {
|
|
|
224
224
|
provider?: Service<EmailProvider> | "memory";
|
|
225
225
|
}
|
|
226
226
|
declare class EmailDescriptor<T extends TSchema> extends Descriptor<EmailDescriptorOptions<T>> {
|
|
227
|
-
protected readonly log:
|
|
227
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
228
228
|
protected readonly templateService: TemplateService;
|
|
229
229
|
readonly provider: EmailProvider | MemoryEmailProvider;
|
|
230
230
|
get name(): string;
|
|
@@ -252,7 +252,7 @@ interface LocalEmailProviderOptions {
|
|
|
252
252
|
directory?: string;
|
|
253
253
|
}
|
|
254
254
|
declare class LocalEmailProvider implements EmailProvider {
|
|
255
|
-
protected readonly log:
|
|
255
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
256
256
|
protected readonly directory: string;
|
|
257
257
|
constructor(options?: LocalEmailProviderOptions);
|
|
258
258
|
send(to: string, subject: string, body: string): Promise<void>;
|
|
@@ -292,7 +292,7 @@ declare class NodemailerEmailProvider implements EmailProvider {
|
|
|
292
292
|
EMAIL_FROM: string;
|
|
293
293
|
EMAIL_SECURE: boolean;
|
|
294
294
|
};
|
|
295
|
-
protected readonly log:
|
|
295
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
296
296
|
protected transporter: Transporter;
|
|
297
297
|
protected fromAddress: string;
|
|
298
298
|
readonly options: NodemailerEmailProviderOptions;
|
|
@@ -322,7 +322,7 @@ declare class NodemailerEmailProvider implements EmailProvider {
|
|
|
322
322
|
* @see {@link EmailProvider}
|
|
323
323
|
* @module alepha.email
|
|
324
324
|
*/
|
|
325
|
-
declare const AlephaEmail: _alepha_core1.Service<_alepha_core1.Module
|
|
325
|
+
declare const AlephaEmail: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
326
326
|
//#endregion
|
|
327
327
|
export { $email, AlephaEmail, EmailDescriptor, EmailDescriptorOptions, EmailError, EmailProvider, EmailRecord, LocalEmailProvider, LocalEmailProviderOptions, MemoryEmailProvider, NodemailerEmailProvider, NodemailerEmailProviderOptions, TemplateService };
|
|
328
328
|
//# 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
|
@@ -215,7 +215,7 @@ declare class SimpleFormatterProvider extends LogFormatterProvider {
|
|
|
215
215
|
* - Empty parts are gracefully skipped: `LOG_LEVEL=",,debug,,"` works fine
|
|
216
216
|
* - Better error messages: "Invalid log level 'bad' for module pattern 'alepha'"
|
|
217
217
|
*/
|
|
218
|
-
declare const AlephaLogger: _alepha_core0.Service<_alepha_core0.Module
|
|
218
|
+
declare const AlephaLogger: _alepha_core0.Service<_alepha_core0.Module<{}>>;
|
|
219
219
|
declare const envSchema: _alepha_core0.TObject<{
|
|
220
220
|
/**
|
|
221
221
|
* Default log level for the application.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alepha",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.0.0"
|
|
@@ -15,51 +15,51 @@
|
|
|
15
15
|
"main": "./core.js",
|
|
16
16
|
"types": "./core.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@alepha/batch": "0.10.
|
|
19
|
-
"@alepha/bucket": "0.10.
|
|
20
|
-
"@alepha/cache": "0.10.
|
|
21
|
-
"@alepha/cache-redis": "0.10.
|
|
22
|
-
"@alepha/command": "0.10.
|
|
23
|
-
"@alepha/core": "0.10.
|
|
24
|
-
"@alepha/datetime": "0.10.
|
|
25
|
-
"@alepha/email": "0.10.
|
|
26
|
-
"@alepha/file": "0.10.
|
|
27
|
-
"@alepha/lock": "0.10.
|
|
28
|
-
"@alepha/lock-redis": "0.10.
|
|
29
|
-
"@alepha/logger": "0.10.
|
|
30
|
-
"@alepha/postgres": "0.10.
|
|
31
|
-
"@alepha/queue": "0.10.
|
|
32
|
-
"@alepha/queue-redis": "0.10.
|
|
33
|
-
"@alepha/react": "0.10.
|
|
34
|
-
"@alepha/react-auth": "0.10.
|
|
35
|
-
"@alepha/react-form": "0.10.
|
|
36
|
-
"@alepha/react-head": "0.10.
|
|
37
|
-
"@alepha/react-i18n": "0.10.
|
|
38
|
-
"@alepha/redis": "0.10.
|
|
39
|
-
"@alepha/retry": "0.10.
|
|
40
|
-
"@alepha/router": "0.10.
|
|
41
|
-
"@alepha/scheduler": "0.10.
|
|
42
|
-
"@alepha/security": "0.10.
|
|
43
|
-
"@alepha/server": "0.10.
|
|
44
|
-
"@alepha/server-cache": "0.10.
|
|
45
|
-
"@alepha/server-compress": "0.10.
|
|
46
|
-
"@alepha/server-cookies": "0.10.
|
|
47
|
-
"@alepha/server-cors": "0.10.
|
|
48
|
-
"@alepha/server-health": "0.10.
|
|
49
|
-
"@alepha/server-helmet": "0.10.
|
|
50
|
-
"@alepha/server-links": "0.10.
|
|
51
|
-
"@alepha/server-metrics": "0.10.
|
|
52
|
-
"@alepha/server-multipart": "0.10.
|
|
53
|
-
"@alepha/server-proxy": "0.10.
|
|
54
|
-
"@alepha/server-security": "0.10.
|
|
55
|
-
"@alepha/server-static": "0.10.
|
|
56
|
-
"@alepha/server-swagger": "0.10.
|
|
57
|
-
"@alepha/topic": "0.10.
|
|
58
|
-
"@alepha/topic-redis": "0.10.
|
|
59
|
-
"@alepha/vite": "0.10.
|
|
18
|
+
"@alepha/batch": "0.10.2",
|
|
19
|
+
"@alepha/bucket": "0.10.2",
|
|
20
|
+
"@alepha/cache": "0.10.2",
|
|
21
|
+
"@alepha/cache-redis": "0.10.2",
|
|
22
|
+
"@alepha/command": "0.10.2",
|
|
23
|
+
"@alepha/core": "0.10.2",
|
|
24
|
+
"@alepha/datetime": "0.10.2",
|
|
25
|
+
"@alepha/email": "0.10.2",
|
|
26
|
+
"@alepha/file": "0.10.2",
|
|
27
|
+
"@alepha/lock": "0.10.2",
|
|
28
|
+
"@alepha/lock-redis": "0.10.2",
|
|
29
|
+
"@alepha/logger": "0.10.2",
|
|
30
|
+
"@alepha/postgres": "0.10.2",
|
|
31
|
+
"@alepha/queue": "0.10.2",
|
|
32
|
+
"@alepha/queue-redis": "0.10.2",
|
|
33
|
+
"@alepha/react": "0.10.2",
|
|
34
|
+
"@alepha/react-auth": "0.10.2",
|
|
35
|
+
"@alepha/react-form": "0.10.2",
|
|
36
|
+
"@alepha/react-head": "0.10.2",
|
|
37
|
+
"@alepha/react-i18n": "0.10.2",
|
|
38
|
+
"@alepha/redis": "0.10.2",
|
|
39
|
+
"@alepha/retry": "0.10.2",
|
|
40
|
+
"@alepha/router": "0.10.2",
|
|
41
|
+
"@alepha/scheduler": "0.10.2",
|
|
42
|
+
"@alepha/security": "0.10.2",
|
|
43
|
+
"@alepha/server": "0.10.2",
|
|
44
|
+
"@alepha/server-cache": "0.10.2",
|
|
45
|
+
"@alepha/server-compress": "0.10.2",
|
|
46
|
+
"@alepha/server-cookies": "0.10.2",
|
|
47
|
+
"@alepha/server-cors": "0.10.2",
|
|
48
|
+
"@alepha/server-health": "0.10.2",
|
|
49
|
+
"@alepha/server-helmet": "0.10.2",
|
|
50
|
+
"@alepha/server-links": "0.10.2",
|
|
51
|
+
"@alepha/server-metrics": "0.10.2",
|
|
52
|
+
"@alepha/server-multipart": "0.10.2",
|
|
53
|
+
"@alepha/server-proxy": "0.10.2",
|
|
54
|
+
"@alepha/server-security": "0.10.2",
|
|
55
|
+
"@alepha/server-static": "0.10.2",
|
|
56
|
+
"@alepha/server-swagger": "0.10.2",
|
|
57
|
+
"@alepha/topic": "0.10.2",
|
|
58
|
+
"@alepha/topic-redis": "0.10.2",
|
|
59
|
+
"@alepha/vite": "0.10.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"tsdown": "^0.15.
|
|
62
|
+
"tsdown": "^0.15.6"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "node build.ts"
|