alepha 0.10.0 → 0.10.1
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 +90 -5
- package/batch.d.ts +1 -1
- package/command.d.ts +47 -8
- package/datetime.d.ts +2 -1
- package/package.json +44 -44
- package/postgres.d.ts +17 -10
- package/react.d.ts +28 -28
- package/server/compress.d.ts +4 -4
- package/server/links.d.ts +29 -29
- package/server.d.ts +20 -20
package/README.md
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
Alepha
|
|
11
11
|
</h1>
|
|
12
12
|
<p style="max-width: 512px">
|
|
13
|
-
🚧
|
|
14
13
|
</p>
|
|
15
14
|
<a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/v/alepha.svg" alt="npm"/></a>
|
|
16
15
|
<a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/l/alepha.svg" alt="npm"/></a>
|
|
@@ -19,17 +18,23 @@ Alepha
|
|
|
19
18
|
<a href="https://github.com/feunard/alepha"><img src="https://img.shields.io/github/stars/feunard/alepha.svg?style=social" alt="GitHub stars"/></a>
|
|
20
19
|
</div>
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
A convention-driven TypeScript framework for building type-safe full-stack applications.
|
|
23
22
|
|
|
24
|
-
##
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx @alepha/cli create my-app
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Or manually:
|
|
25
30
|
|
|
26
31
|
```bash
|
|
27
32
|
npm install alepha
|
|
28
33
|
```
|
|
29
34
|
|
|
30
|
-
##
|
|
35
|
+
## What is this?
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
Alepha is an opinionated framework that handles everything from database to frontend. It uses a descriptor-based architecture (`$action`, `$page`, `$repository`, etc.) and enforces type safety across the entire stack.
|
|
33
38
|
|
|
34
39
|
```ts
|
|
35
40
|
import { run } from "alepha";
|
|
@@ -44,4 +49,84 @@ class App {
|
|
|
44
49
|
run(App);
|
|
45
50
|
```
|
|
46
51
|
|
|
52
|
+
## Examples
|
|
53
|
+
|
|
54
|
+
### Type-safe API endpoint
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { $action } from "alepha/server";
|
|
58
|
+
import { t } from "alepha/core";
|
|
59
|
+
|
|
60
|
+
class UserController {
|
|
61
|
+
getUser = $action({
|
|
62
|
+
schema: {
|
|
63
|
+
params: t.object({ id: t.string() }),
|
|
64
|
+
response: t.object({
|
|
65
|
+
name: t.string(),
|
|
66
|
+
email: t.string()
|
|
67
|
+
})
|
|
68
|
+
},
|
|
69
|
+
handler: async ({ params }) => {
|
|
70
|
+
return { name: "John", email: "john@example.com" };
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Database with Drizzle ORM
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import {$entity, $repository, pg} from "alepha/postgres";
|
|
80
|
+
import {t, Static} from "alepha";
|
|
81
|
+
|
|
82
|
+
export const users = $entity({
|
|
83
|
+
id: pg.primaryKey(),
|
|
84
|
+
name: t.string(),
|
|
85
|
+
email: t.string()
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
type CreateUser = Static<typeof users.$insertSchema>;
|
|
89
|
+
|
|
90
|
+
class UserService {
|
|
91
|
+
users = $repository(users);
|
|
92
|
+
|
|
93
|
+
async create(data: CreateUser) {
|
|
94
|
+
return await this.users.create(data);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### React SSR Page
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
import { $page } from "alepha/react";
|
|
103
|
+
|
|
104
|
+
class HomePage {
|
|
105
|
+
index = $page({
|
|
106
|
+
component: () => <div>Hello from React SSR!</div>
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Core Concepts
|
|
112
|
+
|
|
113
|
+
- **Descriptors**: Define your app logic with `$action`, `$page`, `$repository`, `$cache`, `$email`, etc.
|
|
114
|
+
- **Type Safety**: TypeBox schemas validate data from DB to API to frontend
|
|
115
|
+
- **DI Container**: Built-in dependency injection using `$inject()`
|
|
116
|
+
- **Convention over Config**: Minimal boilerplate, sensible defaults
|
|
117
|
+
- **Full-Stack**: React SSR, Vite, class-based router with type-safe routing
|
|
118
|
+
|
|
119
|
+
## Stack
|
|
120
|
+
|
|
121
|
+
- Node.js 22+
|
|
122
|
+
- TypeScript
|
|
123
|
+
- React (SSR)
|
|
124
|
+
- Vite
|
|
125
|
+
- Drizzle ORM
|
|
126
|
+
- PostgreSQL
|
|
127
|
+
|
|
47
128
|
👉 For more information, please visit the [documentation](https://feunard.github.io/alepha/).
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
MIT
|
package/batch.d.ts
CHANGED
|
@@ -533,7 +533,7 @@ declare class BatchDescriptor<TItem extends TSchema, TResponse = any> extends De
|
|
|
533
533
|
protected readonly dateTime: DateTimeProvider;
|
|
534
534
|
protected readonly partitions: Map<any, any>;
|
|
535
535
|
protected activeHandlers: PromiseWithResolvers<void>[];
|
|
536
|
-
protected retry: _alepha_retry0.RetryDescriptorFn<(items: typebox0.StaticType<"Encode", {}, {}, TItem>[]) => TResponse>;
|
|
536
|
+
protected retry: _alepha_retry0.RetryDescriptorFn<(items: typebox0.StaticType<[], "Encode", {}, {}, TItem>[]) => TResponse>;
|
|
537
537
|
/**
|
|
538
538
|
* Pushes an item into the batch. The item will be processed
|
|
539
539
|
* asynchronously with other items when the batch is flushed.
|
package/command.d.ts
CHANGED
|
@@ -1,10 +1,51 @@
|
|
|
1
1
|
import * as _alepha_core1 from "alepha";
|
|
2
|
-
import { Alepha, AlephaError, Async, Descriptor, KIND, Static, TObject, TSchema } from "alepha";
|
|
2
|
+
import { Alepha, AlephaError, Async, Descriptor, KIND, Static, TObject, TSchema, TString } from "alepha";
|
|
3
|
+
import * as _alepha_logger0 from "alepha/logger";
|
|
3
4
|
import * as fs from "node:fs/promises";
|
|
4
5
|
import { glob } from "node:fs/promises";
|
|
5
|
-
import * as
|
|
6
|
+
import * as readline_promises0 from "readline/promises";
|
|
6
7
|
import * as typebox0 from "typebox";
|
|
7
8
|
|
|
9
|
+
//#region src/helpers/Asker.d.ts
|
|
10
|
+
interface AskOptions<T extends TSchema = TString> {
|
|
11
|
+
/**
|
|
12
|
+
* Response schema expected.
|
|
13
|
+
*
|
|
14
|
+
* Recommended schemas:
|
|
15
|
+
* - t.string() - for free text input
|
|
16
|
+
* - t.number() - for numeric input
|
|
17
|
+
* - t.boolean() - for yes/no input (accepts "true", "false", "1", "0")
|
|
18
|
+
* - t.enum(["option1", "option2"]) - for predefined options
|
|
19
|
+
*
|
|
20
|
+
* You can use schema.default to provide a default value.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* ask("What is your name?", { schema: t.string({ default: "John Doe" }) })
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @default TString
|
|
28
|
+
*/
|
|
29
|
+
schema?: T;
|
|
30
|
+
/**
|
|
31
|
+
* Custom validation function.
|
|
32
|
+
* Throws an AlephaError in case of validation failure.
|
|
33
|
+
*/
|
|
34
|
+
validate?: (value: Static<T>) => void;
|
|
35
|
+
}
|
|
36
|
+
interface AskMethod {
|
|
37
|
+
<T extends TSchema = TString>(question: string, options?: AskOptions<T>): Promise<Static<T>>;
|
|
38
|
+
}
|
|
39
|
+
declare class Asker {
|
|
40
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
41
|
+
readonly ask: AskMethod;
|
|
42
|
+
protected readonly alepha: Alepha;
|
|
43
|
+
constructor();
|
|
44
|
+
protected createAskMethod(): AskMethod;
|
|
45
|
+
protected prompt<T extends TSchema = TString>(question: string, options: AskOptions<T>): Promise<Static<T>>;
|
|
46
|
+
protected createPromptInterface(): readline_promises0.Interface;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
8
49
|
//#region src/helpers/Runner.d.ts
|
|
9
50
|
type Task = {
|
|
10
51
|
name: string;
|
|
@@ -19,13 +60,9 @@ interface RunOptions {
|
|
|
19
60
|
* Rename the command for logging purposes.
|
|
20
61
|
*/
|
|
21
62
|
alias?: string;
|
|
22
|
-
/**
|
|
23
|
-
* If true, the command will not be logged.
|
|
24
|
-
*/
|
|
25
|
-
silent?: boolean;
|
|
26
63
|
}
|
|
27
64
|
interface RunnerMethod {
|
|
28
|
-
(cmd: string | Array<string | Task>,
|
|
65
|
+
(cmd: string | Task | Array<string | Task>, options?: RunOptions | (() => any)): Promise<string>;
|
|
29
66
|
rm: (glob: string | string[], options?: RunOptions) => Promise<string>;
|
|
30
67
|
cp: (source: string, dest: string, options?: RunOptions) => Promise<string>;
|
|
31
68
|
}
|
|
@@ -116,6 +153,7 @@ interface CommandHandlerArgs<T extends TObject, A extends TSchema = TSchema> {
|
|
|
116
153
|
flags: Static<T>;
|
|
117
154
|
args: A extends TSchema ? Static<A> : undefined;
|
|
118
155
|
run: RunnerMethod;
|
|
156
|
+
ask: AskMethod;
|
|
119
157
|
glob: typeof glob;
|
|
120
158
|
fs: typeof fs;
|
|
121
159
|
}
|
|
@@ -141,6 +179,7 @@ declare class CliProvider {
|
|
|
141
179
|
protected readonly alepha: Alepha;
|
|
142
180
|
protected readonly log: _alepha_logger0.Logger;
|
|
143
181
|
protected readonly runner: Runner;
|
|
182
|
+
protected readonly asker: Asker;
|
|
144
183
|
options: {
|
|
145
184
|
name: string;
|
|
146
185
|
description: string;
|
|
@@ -195,5 +234,5 @@ declare module "typebox" {
|
|
|
195
234
|
//# sourceMappingURL=index.d.ts.map
|
|
196
235
|
|
|
197
236
|
//#endregion
|
|
198
|
-
export { $command, AlephaCommand, CliProvider, CommandDescriptor, CommandDescriptorOptions, CommandError, CommandHandlerArgs, RunOptions, Runner, RunnerMethod, Task };
|
|
237
|
+
export { $command, AlephaCommand, AskMethod, AskOptions, Asker, CliProvider, CommandDescriptor, CommandDescriptorOptions, CommandError, CommandHandlerArgs, RunOptions, Runner, RunnerMethod, Task };
|
|
199
238
|
//# sourceMappingURL=index.d.ts.map
|
package/datetime.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as _alepha_core1 from "alepha";
|
|
2
2
|
import { Alepha, Descriptor, KIND } from "alepha";
|
|
3
|
+
import "dayjs/plugin/relativeTime.js";
|
|
4
|
+
import dayjsDuration from "dayjs/plugin/duration.js";
|
|
3
5
|
import * as _alepha_logger0 from "alepha/logger";
|
|
4
6
|
import dayjs, { Dayjs, ManipulateType } from "dayjs";
|
|
5
|
-
import dayjsDuration from "dayjs/plugin/duration.js";
|
|
6
7
|
|
|
7
8
|
//#region src/providers/DateTimeProvider.d.ts
|
|
8
9
|
type DateTimeApi = typeof dayjs;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alepha",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
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.1",
|
|
19
|
+
"@alepha/bucket": "0.10.1",
|
|
20
|
+
"@alepha/cache": "0.10.1",
|
|
21
|
+
"@alepha/cache-redis": "0.10.1",
|
|
22
|
+
"@alepha/command": "0.10.1",
|
|
23
|
+
"@alepha/core": "0.10.1",
|
|
24
|
+
"@alepha/datetime": "0.10.1",
|
|
25
|
+
"@alepha/email": "0.10.1",
|
|
26
|
+
"@alepha/file": "0.10.1",
|
|
27
|
+
"@alepha/lock": "0.10.1",
|
|
28
|
+
"@alepha/lock-redis": "0.10.1",
|
|
29
|
+
"@alepha/logger": "0.10.1",
|
|
30
|
+
"@alepha/postgres": "0.10.1",
|
|
31
|
+
"@alepha/queue": "0.10.1",
|
|
32
|
+
"@alepha/queue-redis": "0.10.1",
|
|
33
|
+
"@alepha/react": "0.10.1",
|
|
34
|
+
"@alepha/react-auth": "0.10.1",
|
|
35
|
+
"@alepha/react-form": "0.10.1",
|
|
36
|
+
"@alepha/react-head": "0.10.1",
|
|
37
|
+
"@alepha/react-i18n": "0.10.1",
|
|
38
|
+
"@alepha/redis": "0.10.1",
|
|
39
|
+
"@alepha/retry": "0.10.1",
|
|
40
|
+
"@alepha/router": "0.10.1",
|
|
41
|
+
"@alepha/scheduler": "0.10.1",
|
|
42
|
+
"@alepha/security": "0.10.1",
|
|
43
|
+
"@alepha/server": "0.10.1",
|
|
44
|
+
"@alepha/server-cache": "0.10.1",
|
|
45
|
+
"@alepha/server-compress": "0.10.1",
|
|
46
|
+
"@alepha/server-cookies": "0.10.1",
|
|
47
|
+
"@alepha/server-cors": "0.10.1",
|
|
48
|
+
"@alepha/server-health": "0.10.1",
|
|
49
|
+
"@alepha/server-helmet": "0.10.1",
|
|
50
|
+
"@alepha/server-links": "0.10.1",
|
|
51
|
+
"@alepha/server-metrics": "0.10.1",
|
|
52
|
+
"@alepha/server-multipart": "0.10.1",
|
|
53
|
+
"@alepha/server-proxy": "0.10.1",
|
|
54
|
+
"@alepha/server-security": "0.10.1",
|
|
55
|
+
"@alepha/server-static": "0.10.1",
|
|
56
|
+
"@alepha/server-swagger": "0.10.1",
|
|
57
|
+
"@alepha/topic": "0.10.1",
|
|
58
|
+
"@alepha/topic-redis": "0.10.1",
|
|
59
|
+
"@alepha/vite": "0.10.1"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"tsdown": "^0.15.
|
|
62
|
+
"tsdown": "^0.15.5"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "node build.ts"
|
package/postgres.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _alepha_core1 from "alepha";
|
|
2
2
|
import { Alepha, AlephaError, Descriptor, KIND, Service, Static, TArray, TBigInt, TBoolean, TInteger, TKeysToIndexer, TNull, TNumber, TNumberOptions, TObject, TObjectOptions, TOptional, TOptionalAdd, TPick, TRecord, TSchema as TSchema$1, TString, TStringOptions, TUnion } from "alepha";
|
|
3
|
-
import * as
|
|
3
|
+
import * as drizzle_orm7 from "drizzle-orm";
|
|
4
4
|
import { BuildColumns, BuildExtraConfigColumns, SQL, SQLWrapper, TableConfig, sql } from "drizzle-orm";
|
|
5
5
|
import * as pg$1 from "drizzle-orm/pg-core";
|
|
6
6
|
import { AnyPgColumn, LockConfig, LockStrength, PgColumn, PgColumnBuilderBase, PgDatabase, PgInsertValue, PgSequenceOptions, PgTableExtraConfigValue, PgTableWithColumns, PgTransaction, PgTransactionConfig, SelectedFields, TableConfig as TableConfig$1, UpdateDeleteAction } from "drizzle-orm/pg-core";
|
|
@@ -104,14 +104,14 @@ declare const schemaToPgColumns: <T extends TObject>(schema: T) => FromSchema<T>
|
|
|
104
104
|
* @param value The value of the field.
|
|
105
105
|
* @returns The PG column.
|
|
106
106
|
*/
|
|
107
|
-
declare const mapFieldToColumn: (name: string, value: TSchema$1) => pg$1.PgSerialBuilderInitial<string> | pg$1.PgIntegerBuilderInitial<string> |
|
|
107
|
+
declare const mapFieldToColumn: (name: string, value: TSchema$1) => pg$1.PgSerialBuilderInitial<string> | pg$1.PgIntegerBuilderInitial<string> | drizzle_orm7.IsIdentity<pg$1.PgBigInt64BuilderInitial<"">, "byDefault"> | drizzle_orm7.IsIdentity<pg$1.PgBigInt64BuilderInitial<"">, "always"> | pg$1.PgBigInt53BuilderInitial<string> | pg$1.PgNumericBuilderInitial<string> | pg$1.PgTimestampBuilderInitial<string> | pg$1.PgUUIDBuilderInitial<string> | pg$1.PgCustomColumnBuilder<{
|
|
108
108
|
name: string;
|
|
109
109
|
dataType: "custom";
|
|
110
110
|
columnType: "PgCustomColumn";
|
|
111
111
|
data: Buffer<ArrayBufferLike>;
|
|
112
112
|
driverParam: unknown;
|
|
113
113
|
enumValues: undefined;
|
|
114
|
-
}> | pg$1.PgTimestampStringBuilderInitial<string> | pg$1.PgDateStringBuilderInitial<string> | pg$1.PgTextBuilderInitial<string, [string, ...string[]]> | pg$1.PgBooleanBuilderInitial<string> |
|
|
114
|
+
}> | pg$1.PgTimestampStringBuilderInitial<string> | pg$1.PgDateStringBuilderInitial<string> | pg$1.PgTextBuilderInitial<string, [string, ...string[]]> | pg$1.PgBooleanBuilderInitial<string> | drizzle_orm7.$Type<pg$1.PgCustomColumnBuilder<{
|
|
115
115
|
name: string;
|
|
116
116
|
dataType: "custom";
|
|
117
117
|
columnType: "PgCustomColumn";
|
|
@@ -126,7 +126,14 @@ declare const mapFieldToColumn: (name: string, value: TSchema$1) => pg$1.PgSeria
|
|
|
126
126
|
[x: string]: unknown;
|
|
127
127
|
[x: number]: unknown;
|
|
128
128
|
[x: symbol]: unknown;
|
|
129
|
-
}> |
|
|
129
|
+
}> | drizzle_orm7.$Type<pg$1.PgCustomColumnBuilder<{
|
|
130
|
+
name: string;
|
|
131
|
+
dataType: "custom";
|
|
132
|
+
columnType: "PgCustomColumn";
|
|
133
|
+
data: Record<string, unknown>;
|
|
134
|
+
driverParam: string;
|
|
135
|
+
enumValues: undefined;
|
|
136
|
+
}>, Record<string, unknown>> | drizzle_orm7.$Type<pg$1.PgCustomColumnBuilder<{
|
|
130
137
|
name: string;
|
|
131
138
|
dataType: "custom";
|
|
132
139
|
columnType: "PgCustomColumn";
|
|
@@ -1659,7 +1666,7 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1659
1666
|
/**
|
|
1660
1667
|
* Getter for the database connection from the database provider.
|
|
1661
1668
|
*/
|
|
1662
|
-
protected get db(): PgDatabase<any, Record<string, never>,
|
|
1669
|
+
protected get db(): PgDatabase<any, Record<string, never>, drizzle_orm7.ExtractTablesWithRelations<Record<string, never>>>;
|
|
1663
1670
|
/**
|
|
1664
1671
|
* Execute a SQL query.
|
|
1665
1672
|
*/
|
|
@@ -1684,10 +1691,10 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1684
1691
|
*
|
|
1685
1692
|
* @returns The SELECT query builder.
|
|
1686
1693
|
*/
|
|
1687
|
-
protected select(opts?: StatementOptions): pg$1.PgSelectBase<string, Record<string, PgColumn<
|
|
1694
|
+
protected select(opts?: StatementOptions): pg$1.PgSelectBase<string, Record<string, PgColumn<drizzle_orm7.ColumnBaseConfig<drizzle_orm7.ColumnDataType, string>, {}, {}>>, "single", Record<string, "not-null">, false, never, {
|
|
1688
1695
|
[x: string]: unknown;
|
|
1689
1696
|
}[], {
|
|
1690
|
-
[x: string]: PgColumn<
|
|
1697
|
+
[x: string]: PgColumn<drizzle_orm7.ColumnBaseConfig<drizzle_orm7.ColumnDataType, string>, {}, {}>;
|
|
1691
1698
|
}>;
|
|
1692
1699
|
protected selectDistinct(opts: StatementOptions | undefined, fields: SelectedFields): pg$1.PgSelectBase<string, SelectedFields, "partial", Record<string, "not-null">, false, never, {
|
|
1693
1700
|
[x: string]: unknown;
|
|
@@ -1874,7 +1881,7 @@ declare class RepositoryDescriptor<EntityTableConfig extends TableConfig, Entity
|
|
|
1874
1881
|
*/
|
|
1875
1882
|
protected getPrimaryKey(schema: TObject): {
|
|
1876
1883
|
key: string;
|
|
1877
|
-
col: PgColumn<
|
|
1884
|
+
col: PgColumn<drizzle_orm7.ColumnBaseConfig<drizzle_orm7.ColumnDataType, string>, {}, {}>;
|
|
1878
1885
|
type: TSchema$1;
|
|
1879
1886
|
};
|
|
1880
1887
|
}
|
|
@@ -2999,7 +3006,7 @@ declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<typebox1.TInteger, typeof PG_
|
|
|
2999
3006
|
/**
|
|
3000
3007
|
* Postgres schema type.
|
|
3001
3008
|
*/
|
|
3002
|
-
declare const schema: <TDocument extends TSchema$1>(name: string, document: TDocument) =>
|
|
3009
|
+
declare const schema: <TDocument extends TSchema$1>(name: string, document: TDocument) => drizzle_orm7.$Type<pg$1.PgCustomColumnBuilder<{
|
|
3003
3010
|
name: string;
|
|
3004
3011
|
dataType: "custom";
|
|
3005
3012
|
columnType: "PgCustomColumn";
|
|
@@ -3051,5 +3058,5 @@ declare const schema: <TDocument extends TSchema$1>(name: string, document: TDoc
|
|
|
3051
3058
|
*/
|
|
3052
3059
|
declare const AlephaPostgres: _alepha_core1.Service<_alepha_core1.Module>;
|
|
3053
3060
|
//#endregion
|
|
3054
|
-
export { $entity, $repository, $sequence, $transaction, AlephaPostgres, DrizzleKitProvider, Entity, EntityDescriptorOptions, FilterOperators, FromSchema, NodePostgresProvider, NodePostgresProviderOptions, PG_CREATED_AT, PG_DEFAULT, PG_DELETED_AT, PG_IDENTITY, PG_PRIMARY_KEY, PG_REF, PG_SCHEMA, PG_SERIAL, PG_UPDATED_AT, PG_VERSION, Page, PageQuery, PgDefault, PgEntityNotFoundError, PgIdentityOptions, PgPrimaryKey, PgQuery, PgQueryResult, PgQueryWhere, PgQueryWhereOrSQL, PgRef, PgRefOptions, PgSymbolKeys, PgSymbols, PgTableConfig, PgTableWithColumnsAndSchema, PostgresProvider, PostgresTypeProvider, RepositoryDescriptor, RepositoryDescriptorOptions, RepositoryProvider, SQLLike, SequenceDescriptor, SequenceDescriptorOptions, StatementOptions, TObjectInsert, TPage, TransactionContext, TransactionDescriptorOptions, camelToSnakeCase,
|
|
3061
|
+
export { $entity, $repository, $sequence, $transaction, AlephaPostgres, DrizzleKitProvider, Entity, EntityDescriptorOptions, FilterOperators, FromSchema, NodePostgresProvider, NodePostgresProviderOptions, PG_CREATED_AT, PG_DEFAULT, PG_DELETED_AT, PG_IDENTITY, PG_PRIMARY_KEY, PG_REF, PG_SCHEMA, PG_SERIAL, PG_UPDATED_AT, PG_VERSION, Page, PageQuery, PgDefault, PgEntityNotFoundError, PgIdentityOptions, PgPrimaryKey, PgQuery, PgQueryResult, PgQueryWhere, PgQueryWhereOrSQL, PgRef, PgRefOptions, PgSymbolKeys, PgSymbols, PgTableConfig, PgTableWithColumnsAndSchema, PostgresProvider, PostgresTypeProvider, RepositoryDescriptor, RepositoryDescriptorOptions, RepositoryProvider, SQLLike, SequenceDescriptor, SequenceDescriptorOptions, StatementOptions, TObjectInsert, TPage, TransactionContext, TransactionDescriptorOptions, camelToSnakeCase, drizzle_orm7 as drizzle, insertSchema, legacyIdSchema, mapFieldToColumn, mapStringToColumn, pageQuerySchema, pageSchema, pg, schema, schemaToPgColumns, sql };
|
|
3055
3062
|
//# sourceMappingURL=index.d.ts.map
|
package/react.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alepha_core5 from "alepha";
|
|
2
2
|
import { Alepha, Async, Descriptor, Hooks, KIND, Service, State, Static, TObject, TSchema } from "alepha";
|
|
3
3
|
import { RequestConfigSchema, ServerHandler, ServerProvider, ServerRequest, ServerRouterProvider, ServerTimingProvider } from "alepha/server";
|
|
4
4
|
import { ServerRouteCache } from "alepha/server/cache";
|
|
5
5
|
import { ClientScope, HttpVirtualClient, LinkProvider, VirtualAction } from "alepha/server/links";
|
|
6
|
-
import * as
|
|
6
|
+
import * as _alepha_logger0 from "alepha/logger";
|
|
7
7
|
import * as react0 from "react";
|
|
8
8
|
import React, { AnchorHTMLAttributes, CSSProperties, ErrorInfo, FC, PropsWithChildren, ReactNode } from "react";
|
|
9
|
-
import * as
|
|
9
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
10
10
|
import { ServerStaticProvider } from "alepha/server/static";
|
|
11
11
|
import { DateTimeProvider } from "alepha/datetime";
|
|
12
12
|
import { Route, RouterProvider } from "alepha/router";
|
|
@@ -40,14 +40,14 @@ declare class Redirection extends Error {
|
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/providers/ReactPageProvider.d.ts
|
|
43
|
-
declare const envSchema$2:
|
|
44
|
-
REACT_STRICT_MODE:
|
|
43
|
+
declare const envSchema$2: _alepha_core5.TObject<{
|
|
44
|
+
REACT_STRICT_MODE: _alepha_core5.TBoolean;
|
|
45
45
|
}>;
|
|
46
46
|
declare module "alepha" {
|
|
47
47
|
interface Env extends Partial<Static<typeof envSchema$2>> {}
|
|
48
48
|
}
|
|
49
49
|
declare class ReactPageProvider {
|
|
50
|
-
protected readonly log:
|
|
50
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
51
51
|
protected readonly env: {
|
|
52
52
|
REACT_STRICT_MODE: boolean;
|
|
53
53
|
};
|
|
@@ -83,7 +83,7 @@ declare class ReactPageProvider {
|
|
|
83
83
|
}, params?: Record<string, any>): string;
|
|
84
84
|
compile(path: string, params?: Record<string, string>): string;
|
|
85
85
|
protected renderView(index: number, path: string, view: ReactNode | undefined, page: PageRoute): ReactNode;
|
|
86
|
-
protected readonly configure:
|
|
86
|
+
protected readonly configure: _alepha_core5.HookDescriptor<"configure">;
|
|
87
87
|
protected map(pages: Array<PageDescriptor>, target: PageDescriptor): PageRouteEntry;
|
|
88
88
|
add(entry: PageRouteEntry): void;
|
|
89
89
|
protected createMatch(page: PageRoute): string;
|
|
@@ -489,18 +489,18 @@ interface BrowserRoute extends Route {
|
|
|
489
489
|
page: PageRoute;
|
|
490
490
|
}
|
|
491
491
|
declare class ReactBrowserRouterProvider extends RouterProvider<BrowserRoute> {
|
|
492
|
-
protected readonly log:
|
|
492
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
493
493
|
protected readonly alepha: Alepha;
|
|
494
494
|
protected readonly pageApi: ReactPageProvider;
|
|
495
495
|
add(entry: PageRouteEntry): void;
|
|
496
|
-
protected readonly configure:
|
|
496
|
+
protected readonly configure: _alepha_core5.HookDescriptor<"configure">;
|
|
497
497
|
transition(url: URL, previous?: PreviousLayerData[], meta?: {}): Promise<string | void>;
|
|
498
498
|
root(state: ReactRouterState): ReactNode;
|
|
499
499
|
}
|
|
500
500
|
//#endregion
|
|
501
501
|
//#region src/providers/ReactBrowserProvider.d.ts
|
|
502
|
-
declare const envSchema$1:
|
|
503
|
-
REACT_ROOT_ID:
|
|
502
|
+
declare const envSchema$1: _alepha_core5.TObject<{
|
|
503
|
+
REACT_ROOT_ID: _alepha_core5.TString;
|
|
504
504
|
}>;
|
|
505
505
|
declare module "alepha" {
|
|
506
506
|
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
@@ -512,7 +512,7 @@ declare class ReactBrowserProvider {
|
|
|
512
512
|
protected readonly env: {
|
|
513
513
|
REACT_ROOT_ID: string;
|
|
514
514
|
};
|
|
515
|
-
protected readonly log:
|
|
515
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
516
516
|
protected readonly client: LinkProvider;
|
|
517
517
|
protected readonly alepha: Alepha;
|
|
518
518
|
protected readonly router: ReactBrowserRouterProvider;
|
|
@@ -546,8 +546,8 @@ declare class ReactBrowserProvider {
|
|
|
546
546
|
* Get embedded layers from the server.
|
|
547
547
|
*/
|
|
548
548
|
protected getHydrationState(): ReactHydrationState | undefined;
|
|
549
|
-
protected readonly onTransitionEnd:
|
|
550
|
-
readonly ready:
|
|
549
|
+
protected readonly onTransitionEnd: _alepha_core5.HookDescriptor<"react:transition:end">;
|
|
550
|
+
readonly ready: _alepha_core5.HookDescriptor<"ready">;
|
|
551
551
|
}
|
|
552
552
|
interface RouterGoOptions {
|
|
553
553
|
replace?: boolean;
|
|
@@ -619,25 +619,25 @@ interface ErrorViewerProps {
|
|
|
619
619
|
declare const ErrorViewer: ({
|
|
620
620
|
error,
|
|
621
621
|
alepha
|
|
622
|
-
}: ErrorViewerProps) =>
|
|
622
|
+
}: ErrorViewerProps) => react_jsx_runtime2.JSX.Element;
|
|
623
623
|
//#endregion
|
|
624
624
|
//#region src/components/Link.d.ts
|
|
625
625
|
interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
626
626
|
href: string;
|
|
627
627
|
}
|
|
628
|
-
declare const Link: (props: LinkProps) =>
|
|
628
|
+
declare const Link: (props: LinkProps) => react_jsx_runtime2.JSX.Element;
|
|
629
629
|
//#endregion
|
|
630
630
|
//#region src/components/NestedView.d.ts
|
|
631
631
|
interface NestedViewProps {
|
|
632
632
|
children?: ReactNode;
|
|
633
633
|
errorBoundary?: false | ((error: Error) => ReactNode);
|
|
634
634
|
}
|
|
635
|
-
declare const _default: react0.MemoExoticComponent<(props: NestedViewProps) =>
|
|
635
|
+
declare const _default: react0.MemoExoticComponent<(props: NestedViewProps) => react_jsx_runtime2.JSX.Element>;
|
|
636
636
|
//#endregion
|
|
637
637
|
//#region src/components/NotFound.d.ts
|
|
638
638
|
declare function NotFoundPage(props: {
|
|
639
639
|
style?: CSSProperties;
|
|
640
|
-
}):
|
|
640
|
+
}): react_jsx_runtime2.JSX.Element;
|
|
641
641
|
//#endregion
|
|
642
642
|
//#region src/contexts/AlephaContext.d.ts
|
|
643
643
|
declare const AlephaContext: react0.Context<Alepha | undefined>;
|
|
@@ -795,12 +795,12 @@ declare const ssrSchemaLoading: (alepha: Alepha, name: string) => RequestConfigS
|
|
|
795
795
|
declare const useStore: <Key extends keyof State>(key: Key, defaultValue?: State[Key]) => [State[Key], (value: State[Key]) => void];
|
|
796
796
|
//#endregion
|
|
797
797
|
//#region src/providers/ReactServerProvider.d.ts
|
|
798
|
-
declare const envSchema:
|
|
799
|
-
REACT_SERVER_DIST:
|
|
800
|
-
REACT_SERVER_PREFIX:
|
|
801
|
-
REACT_SSR_ENABLED:
|
|
802
|
-
REACT_ROOT_ID:
|
|
803
|
-
REACT_SERVER_TEMPLATE:
|
|
798
|
+
declare const envSchema: _alepha_core5.TObject<{
|
|
799
|
+
REACT_SERVER_DIST: _alepha_core5.TString;
|
|
800
|
+
REACT_SERVER_PREFIX: _alepha_core5.TString;
|
|
801
|
+
REACT_SSR_ENABLED: _alepha_core5.TOptional<_alepha_core5.TBoolean>;
|
|
802
|
+
REACT_ROOT_ID: _alepha_core5.TString;
|
|
803
|
+
REACT_SERVER_TEMPLATE: _alepha_core5.TOptional<_alepha_core5.TString>;
|
|
804
804
|
}>;
|
|
805
805
|
declare module "alepha" {
|
|
806
806
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -809,7 +809,7 @@ declare module "alepha" {
|
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
811
|
declare class ReactServerProvider {
|
|
812
|
-
protected readonly log:
|
|
812
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
813
813
|
protected readonly alepha: Alepha;
|
|
814
814
|
protected readonly pageApi: ReactPageProvider;
|
|
815
815
|
protected readonly serverProvider: ServerProvider;
|
|
@@ -819,13 +819,13 @@ declare class ReactServerProvider {
|
|
|
819
819
|
protected readonly env: {
|
|
820
820
|
REACT_SSR_ENABLED?: boolean | undefined;
|
|
821
821
|
REACT_SERVER_TEMPLATE?: string | undefined;
|
|
822
|
+
REACT_ROOT_ID: string;
|
|
822
823
|
REACT_SERVER_DIST: string;
|
|
823
824
|
REACT_SERVER_PREFIX: string;
|
|
824
|
-
REACT_ROOT_ID: string;
|
|
825
825
|
};
|
|
826
826
|
protected readonly ROOT_DIV_REGEX: RegExp;
|
|
827
827
|
protected preprocessedTemplate: PreprocessedTemplate | null;
|
|
828
|
-
readonly onConfigure:
|
|
828
|
+
readonly onConfigure: _alepha_core5.HookDescriptor<"configure">;
|
|
829
829
|
get template(): string;
|
|
830
830
|
protected registerPages(templateLoader: TemplateLoader): Promise<void>;
|
|
831
831
|
protected getPublicDirectory(): string;
|
|
@@ -898,7 +898,7 @@ declare module "alepha" {
|
|
|
898
898
|
* @see {@link $page}
|
|
899
899
|
* @module alepha.react
|
|
900
900
|
*/
|
|
901
|
-
declare const AlephaReact:
|
|
901
|
+
declare const AlephaReact: _alepha_core5.Service<_alepha_core5.Module>;
|
|
902
902
|
//#endregion
|
|
903
903
|
export { $page, AlephaContext, AlephaReact, AnchorProps, ClientOnly, CreateLayersResult, ErrorBoundary, ErrorHandler, ErrorViewer, Layer, Link, LinkProps, _default as NestedView, NotFoundPage as NotFound, PageAnimation, PageConfigSchema, PageDescriptor, PageDescriptorOptions, PageDescriptorRenderOptions, PageDescriptorRenderResult, PageRequestConfig, PageResolve, PageRoute, PageRouteEntry, PreviousLayerData, ReactBrowserProvider, ReactBrowserRendererOptions, ReactHydrationState, ReactPageProvider, ReactRouter, ReactRouterState, ReactServerProvider, Redirection, RouterGoOptions, RouterLayerContext, RouterLayerContextValue, RouterRenderOptions, RouterStackItem, TPropsDefault, TPropsParentDefault, TransitionOptions, UseActiveHook, UseActiveOptions, UseQueryParamsHookOptions, UseSchemaReturn, VirtualRouter, isPageRoute, ssrSchemaLoading, useActive, useAlepha, useClient, useInject, useQueryParams, useRouter, useRouterEvents, useRouterState, useSchema, useStore };
|
|
904
904
|
//# sourceMappingURL=index.d.ts.map
|
package/server/compress.d.ts
CHANGED
|
@@ -5,16 +5,16 @@ import { Transform } from "node:stream";
|
|
|
5
5
|
|
|
6
6
|
//#region src/providers/ServerCompressProvider.d.ts
|
|
7
7
|
declare class ServerCompressProvider {
|
|
8
|
-
compressors: Record<string, {
|
|
8
|
+
static compressors: Record<string, {
|
|
9
9
|
compress: (...args: any[]) => Promise<Buffer>;
|
|
10
10
|
stream: (options?: any) => Transform;
|
|
11
11
|
} | undefined>;
|
|
12
12
|
options: ServerCompressProviderOptions;
|
|
13
13
|
readonly onResponse: HookDescriptor<"server:onResponse">;
|
|
14
14
|
protected isAllowedContentType(contentType: string | undefined): boolean;
|
|
15
|
-
protected compress(encoding: keyof typeof
|
|
16
|
-
protected getParams(encoding: keyof typeof
|
|
17
|
-
protected setHeaders(response: ServerResponse, encoding: keyof typeof
|
|
15
|
+
protected compress(encoding: keyof typeof ServerCompressProvider.compressors, response: ServerResponse): Promise<void>;
|
|
16
|
+
protected getParams(encoding: keyof typeof ServerCompressProvider.compressors): Record<number, any>;
|
|
17
|
+
protected setHeaders(response: ServerResponse, encoding: keyof typeof ServerCompressProvider.compressors): void;
|
|
18
18
|
}
|
|
19
19
|
interface ServerCompressProviderOptions {
|
|
20
20
|
allowedContentTypes: string[];
|
package/server/links.d.ts
CHANGED
|
@@ -7,26 +7,26 @@ import * as _alepha_logger0 from "alepha/logger";
|
|
|
7
7
|
import * as _alepha_retry0 from "alepha/retry";
|
|
8
8
|
import { ProxyDescriptorOptions, ServerProxyProvider } from "alepha/server/proxy";
|
|
9
9
|
import { ServiceAccountDescriptor, UserAccountToken } from "alepha/security";
|
|
10
|
-
import * as
|
|
10
|
+
import * as typebox18 from "typebox";
|
|
11
11
|
|
|
12
12
|
//#region src/schemas/apiLinksResponseSchema.d.ts
|
|
13
|
-
declare const apiLinkSchema:
|
|
14
|
-
name:
|
|
15
|
-
group:
|
|
16
|
-
path:
|
|
17
|
-
method:
|
|
18
|
-
requestBodyType:
|
|
19
|
-
service:
|
|
13
|
+
declare const apiLinkSchema: typebox18.TObject<{
|
|
14
|
+
name: typebox18.TString;
|
|
15
|
+
group: typebox18.TOptional<typebox18.TString>;
|
|
16
|
+
path: typebox18.TString;
|
|
17
|
+
method: typebox18.TOptional<typebox18.TString>;
|
|
18
|
+
requestBodyType: typebox18.TOptional<typebox18.TString>;
|
|
19
|
+
service: typebox18.TOptional<typebox18.TString>;
|
|
20
20
|
}>;
|
|
21
|
-
declare const apiLinksResponseSchema:
|
|
22
|
-
prefix:
|
|
23
|
-
links:
|
|
24
|
-
name:
|
|
25
|
-
group:
|
|
26
|
-
path:
|
|
27
|
-
method:
|
|
28
|
-
requestBodyType:
|
|
29
|
-
service:
|
|
21
|
+
declare const apiLinksResponseSchema: typebox18.TObject<{
|
|
22
|
+
prefix: typebox18.TOptional<typebox18.TString>;
|
|
23
|
+
links: typebox18.TArray<typebox18.TObject<{
|
|
24
|
+
name: typebox18.TString;
|
|
25
|
+
group: typebox18.TOptional<typebox18.TString>;
|
|
26
|
+
path: typebox18.TString;
|
|
27
|
+
method: typebox18.TOptional<typebox18.TString>;
|
|
28
|
+
requestBodyType: typebox18.TOptional<typebox18.TString>;
|
|
29
|
+
service: typebox18.TOptional<typebox18.TString>;
|
|
30
30
|
}>>;
|
|
31
31
|
}>;
|
|
32
32
|
type ApiLinksResponse = Static<typeof apiLinksResponseSchema>;
|
|
@@ -257,15 +257,15 @@ declare class ServerLinksProvider {
|
|
|
257
257
|
* This is based on the user's permissions.
|
|
258
258
|
*/
|
|
259
259
|
readonly links: _alepha_server0.RouteDescriptor<{
|
|
260
|
-
response:
|
|
261
|
-
prefix:
|
|
262
|
-
links:
|
|
263
|
-
name:
|
|
264
|
-
group:
|
|
265
|
-
path:
|
|
266
|
-
method:
|
|
267
|
-
requestBodyType:
|
|
268
|
-
service:
|
|
260
|
+
response: typebox18.TObject<{
|
|
261
|
+
prefix: typebox18.TOptional<typebox18.TString>;
|
|
262
|
+
links: typebox18.TArray<typebox18.TObject<{
|
|
263
|
+
name: typebox18.TString;
|
|
264
|
+
group: typebox18.TOptional<typebox18.TString>;
|
|
265
|
+
path: typebox18.TString;
|
|
266
|
+
method: typebox18.TOptional<typebox18.TString>;
|
|
267
|
+
requestBodyType: typebox18.TOptional<typebox18.TString>;
|
|
268
|
+
service: typebox18.TOptional<typebox18.TString>;
|
|
269
269
|
}>>;
|
|
270
270
|
}>;
|
|
271
271
|
}>;
|
|
@@ -276,10 +276,10 @@ declare class ServerLinksProvider {
|
|
|
276
276
|
* I mean for 150+ links, you got 50ms of serialization time.
|
|
277
277
|
*/
|
|
278
278
|
readonly schema: _alepha_server0.RouteDescriptor<{
|
|
279
|
-
params:
|
|
280
|
-
name:
|
|
279
|
+
params: typebox18.TObject<{
|
|
280
|
+
name: typebox18.TString;
|
|
281
281
|
}>;
|
|
282
|
-
response:
|
|
282
|
+
response: typebox18.TRecord<string, typebox18.TAny>;
|
|
283
283
|
}>;
|
|
284
284
|
getSchemaByName(name: string, options?: GetApiLinksOptions): Promise<RequestConfigSchema>;
|
|
285
285
|
/**
|
package/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alepha_core7 from "alepha";
|
|
2
2
|
import { Alepha, AlephaError, Async, Descriptor, FileLike, KIND, Static, StreamLike, TArray, TFile, TObject, TRecord, TSchema, TStream, TString, TVoid } from "alepha";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alepha_logger2 from "alepha/logger";
|
|
4
4
|
import { Readable } from "node:stream";
|
|
5
5
|
import { ReadableStream } from "node:stream/web";
|
|
6
6
|
import { Route, RouterProvider } from "alepha/router";
|
|
@@ -176,13 +176,13 @@ declare class ServerRequestParser {
|
|
|
176
176
|
//#region src/providers/ServerTimingProvider.d.ts
|
|
177
177
|
type TimingMap = Record<string, [number, number]>;
|
|
178
178
|
declare class ServerTimingProvider {
|
|
179
|
-
protected readonly log:
|
|
179
|
+
protected readonly log: _alepha_logger2.Logger;
|
|
180
180
|
protected readonly alepha: Alepha;
|
|
181
181
|
options: {
|
|
182
182
|
disabled: boolean;
|
|
183
183
|
};
|
|
184
|
-
readonly onRequest:
|
|
185
|
-
readonly onResponse:
|
|
184
|
+
readonly onRequest: _alepha_core7.HookDescriptor<"server:onRequest">;
|
|
185
|
+
readonly onResponse: _alepha_core7.HookDescriptor<"server:onResponse">;
|
|
186
186
|
protected get handlerName(): string;
|
|
187
187
|
beginTiming(name: string): void;
|
|
188
188
|
endTiming(name: string): void;
|
|
@@ -222,7 +222,7 @@ declare class ServerRouterProvider extends RouterProvider<ServerRouteMatcher> {
|
|
|
222
222
|
//#endregion
|
|
223
223
|
//#region src/services/HttpClient.d.ts
|
|
224
224
|
declare class HttpClient {
|
|
225
|
-
protected readonly log:
|
|
225
|
+
protected readonly log: _alepha_logger2.Logger;
|
|
226
226
|
protected readonly alepha: Alepha;
|
|
227
227
|
readonly cache: _alepha_cache0.CacheDescriptorFn<HttpClientCache, any[]>;
|
|
228
228
|
protected readonly pendingRequests: HttpClientPendingRequests;
|
|
@@ -899,7 +899,7 @@ interface ActionDescriptorOptions<TConfig extends RequestConfigSchema> extends O
|
|
|
899
899
|
handler: ServerActionHandler<TConfig>;
|
|
900
900
|
}
|
|
901
901
|
declare class ActionDescriptor<TConfig extends RequestConfigSchema> extends Descriptor<ActionDescriptorOptions<TConfig>> {
|
|
902
|
-
protected readonly log:
|
|
902
|
+
protected readonly log: _alepha_logger2.Logger;
|
|
903
903
|
protected readonly env: {
|
|
904
904
|
SERVER_API_PREFIX: string;
|
|
905
905
|
};
|
|
@@ -1068,9 +1068,9 @@ declare const okSchema: typebox0.TObject<{
|
|
|
1068
1068
|
type Ok = Static<typeof okSchema>;
|
|
1069
1069
|
//#endregion
|
|
1070
1070
|
//#region src/providers/NodeHttpServerProvider.d.ts
|
|
1071
|
-
declare const envSchema:
|
|
1072
|
-
SERVER_PORT:
|
|
1073
|
-
SERVER_HOST:
|
|
1071
|
+
declare const envSchema: _alepha_core7.TObject<{
|
|
1072
|
+
SERVER_PORT: _alepha_core7.TInteger;
|
|
1073
|
+
SERVER_HOST: _alepha_core7.TString;
|
|
1074
1074
|
}>;
|
|
1075
1075
|
declare module "alepha" {
|
|
1076
1076
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -1078,31 +1078,31 @@ declare module "alepha" {
|
|
|
1078
1078
|
declare class NodeHttpServerProvider extends ServerProvider {
|
|
1079
1079
|
protected readonly alepha: Alepha;
|
|
1080
1080
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
1081
|
-
protected readonly log:
|
|
1081
|
+
protected readonly log: _alepha_logger2.Logger;
|
|
1082
1082
|
protected readonly env: {
|
|
1083
1083
|
SERVER_PORT: number;
|
|
1084
1084
|
SERVER_HOST: string;
|
|
1085
1085
|
};
|
|
1086
1086
|
protected readonly router: ServerRouterProvider;
|
|
1087
1087
|
protected readonly server: http0.Server<typeof IncomingMessage, typeof ServerResponse$1>;
|
|
1088
|
-
protected readonly onNodeRequest:
|
|
1088
|
+
protected readonly onNodeRequest: _alepha_core7.HookDescriptor<"node:request">;
|
|
1089
1089
|
handle(req: IncomingMessage, res: ServerResponse$1): Promise<void>;
|
|
1090
1090
|
createRouterRequest(req: IncomingMessage, res: ServerResponse$1, params?: Record<string, string>): ServerRawRequest;
|
|
1091
1091
|
getProtocol(req: IncomingMessage): "http" | "https";
|
|
1092
1092
|
get hostname(): string;
|
|
1093
|
-
readonly start:
|
|
1094
|
-
protected readonly stop:
|
|
1093
|
+
readonly start: _alepha_core7.HookDescriptor<"start">;
|
|
1094
|
+
protected readonly stop: _alepha_core7.HookDescriptor<"stop">;
|
|
1095
1095
|
protected listen(): Promise<void>;
|
|
1096
1096
|
protected close(): Promise<void>;
|
|
1097
1097
|
}
|
|
1098
1098
|
//#endregion
|
|
1099
1099
|
//#region src/providers/ServerLoggerProvider.d.ts
|
|
1100
1100
|
declare class ServerLoggerProvider {
|
|
1101
|
-
protected readonly log:
|
|
1101
|
+
protected readonly log: _alepha_logger2.Logger;
|
|
1102
1102
|
protected readonly alepha: Alepha;
|
|
1103
|
-
readonly onRequest:
|
|
1104
|
-
readonly onError:
|
|
1105
|
-
readonly onResponse:
|
|
1103
|
+
readonly onRequest: _alepha_core7.HookDescriptor<"server:onRequest">;
|
|
1104
|
+
readonly onError: _alepha_core7.HookDescriptor<"server:onError">;
|
|
1105
|
+
readonly onResponse: _alepha_core7.HookDescriptor<"server:onResponse">;
|
|
1106
1106
|
}
|
|
1107
1107
|
//#endregion
|
|
1108
1108
|
//#region src/providers/ServerNotReadyProvider.d.ts
|
|
@@ -1115,7 +1115,7 @@ declare class ServerLoggerProvider {
|
|
|
1115
1115
|
*/
|
|
1116
1116
|
declare class ServerNotReadyProvider {
|
|
1117
1117
|
protected readonly alepha: Alepha;
|
|
1118
|
-
readonly onRequest:
|
|
1118
|
+
readonly onRequest: _alepha_core7.HookDescriptor<"server:onRequest">;
|
|
1119
1119
|
}
|
|
1120
1120
|
//#endregion
|
|
1121
1121
|
//#region src/index.d.ts
|
|
@@ -1183,7 +1183,7 @@ declare module "alepha" {
|
|
|
1183
1183
|
* @see {@link $action}
|
|
1184
1184
|
* @module alepha.server
|
|
1185
1185
|
*/
|
|
1186
|
-
declare const AlephaServer:
|
|
1186
|
+
declare const AlephaServer: _alepha_core7.Service<_alepha_core7.Module>;
|
|
1187
1187
|
//#endregion
|
|
1188
1188
|
export { $action, $route, ActionDescriptor, ActionDescriptorOptions, AlephaServer, BadRequestError, ClientRequestEntry, ClientRequestEntryContainer, ClientRequestOptions, ClientRequestResponse, ConflictError, ErrorSchema, FetchActionArgs, FetchOptions, FetchResponse, ForbiddenError, HttpAction, HttpClient, HttpClientPendingRequests, HttpError, HttpErrorLike, NodeHttpServerProvider, NotFoundError, Ok, RequestConfigSchema, ResponseBodyType, ResponseKind, RouteDescriptor, RouteDescriptorOptions, RouteMethod, ServerActionHandler, ServerActionRequest, ServerHandler, ServerLoggerProvider, ServerNotReadyProvider, ServerProvider, ServerRawRequest, ServerReply, ServerRequest, ServerRequestConfig, ServerRequestConfigEntry, ServerResponse, ServerResponseBody, ServerRoute, ServerRouteMatcher, ServerRouteRequestHandler, ServerRouterProvider, ServerTimingProvider, TRequestBody, TResponseBody, UnauthorizedError, ValidationError, errorNameByStatus, errorSchema, isHttpError, isMultipart, okSchema, routeMethods };
|
|
1189
1189
|
//# sourceMappingURL=index.d.ts.map
|