alepha 0.7.4 → 0.7.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/LICENSE +21 -21
- package/README.md +44 -21
- package/cache/redis.cjs +4 -8
- package/cache/redis.d.ts +30 -91
- package/cache/redis.js +1 -1
- package/cache.cjs +4 -8
- package/cache.d.ts +190 -259
- package/cache.js +1 -1
- package/core.cjs +4 -8
- package/core.d.ts +950 -925
- package/core.js +1 -1
- package/datetime.cjs +4 -8
- package/datetime.d.ts +151 -140
- package/datetime.js +1 -1
- package/lock/redis.cjs +7 -49
- package/lock/redis.d.ts +17 -14
- package/lock/redis.js +1 -47
- package/lock.cjs +4 -8
- package/lock.d.ts +117 -170
- package/lock.js +1 -1
- package/package.json +70 -40
- package/postgres.cjs +4 -8
- package/postgres.d.ts +1314 -4400
- package/postgres.js +1 -1
- package/queue/redis.cjs +8 -0
- package/queue/redis.d.ts +31 -0
- package/queue/redis.js +1 -0
- package/queue.cjs +4 -8
- package/queue.d.ts +162 -205
- package/queue.js +1 -1
- package/react/auth.cjs +4 -8
- package/react/auth.d.ts +167 -280
- package/react/auth.js +1 -1
- package/react.cjs +4 -8
- package/react.d.ts +530 -570
- package/react.js +1 -1
- package/redis.cjs +4 -8
- package/redis.d.ts +59 -132
- package/redis.js +1 -1
- package/retry.cjs +4 -8
- package/retry.d.ts +34 -31
- package/retry.js +1 -1
- package/scheduler.cjs +4 -8
- package/scheduler.d.ts +128 -155
- package/scheduler.js +1 -1
- package/security.cjs +4 -8
- package/security.d.ts +472 -595
- package/security.js +1 -1
- package/server/cache.cjs +4 -8
- package/server/cache.d.ts +73 -39
- package/server/cache.js +1 -1
- package/server/cookies.cjs +4 -8
- package/server/cookies.d.ts +46 -41
- package/server/cookies.js +1 -1
- package/server/static.cjs +4 -8
- package/server/static.d.ts +98 -95
- package/server/static.js +1 -1
- package/server/swagger.cjs +4 -8
- package/server/swagger.d.ts +106 -92
- package/server/swagger.js +1 -1
- package/server.cjs +4 -8
- package/server.d.ts +754 -1025
- package/server.js +1 -1
- package/testing.cjs +8 -0
- package/testing.d.ts +1 -0
- package/testing.js +1 -0
- package/topic/redis.cjs +8 -0
- package/topic/redis.d.ts +45 -0
- package/topic/redis.js +1 -0
- package/topic.cjs +4 -8
- package/topic.d.ts +171 -163
- package/topic.js +1 -1
- package/vite.cjs +4 -8
- package/vite.d.ts +91 -84
- package/vite.js +1 -1
- package/assets/logo.png +0 -0
- package/src/cache/redis.ts +0 -1
- package/src/cache.ts +0 -1
- package/src/core.ts +0 -1
- package/src/datetime.ts +0 -1
- package/src/lock/redis.ts +0 -1
- package/src/lock.ts +0 -1
- package/src/postgres.ts +0 -1
- package/src/queue/redis.ts +0 -1
- package/src/queue.ts +0 -1
- package/src/react/auth.ts +0 -1
- package/src/react.ts +0 -1
- package/src/redis.ts +0 -1
- package/src/retry.ts +0 -1
- package/src/scheduler.ts +0 -1
- package/src/security.ts +0 -1
- package/src/server/cache.ts +0 -1
- package/src/server/cookies.ts +0 -1
- package/src/server/static.ts +0 -1
- package/src/server/swagger.ts +0 -1
- package/src/server.ts +0 -1
- package/src/topic/redis.ts +0 -1
- package/src/topic.ts +0 -1
- package/src/vite.ts +0 -1
package/server.d.ts
CHANGED
|
@@ -1,795 +1,476 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import * as
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
type UnionStatic<T extends TSchema$1[], P extends unknown[]> = {
|
|
34
|
-
[K in keyof T]: T[K] extends TSchema$1 ? Static<T[K], P> : never;
|
|
35
|
-
}[number];
|
|
36
|
-
interface TUnion<T extends TSchema$1[] = TSchema$1[]> extends TSchema$1 {
|
|
37
|
-
[Kind$1]: 'Union';
|
|
38
|
-
static: UnionStatic<T, this['params']>;
|
|
39
|
-
anyOf: T;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
type StringFormatOption$1 = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex' | ({} & string);
|
|
43
|
-
type StringContentEncodingOption$1 = '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64' | ({} & string);
|
|
44
|
-
interface StringOptions$1 extends SchemaOptions$1 {
|
|
45
|
-
/** The maximum string length */
|
|
46
|
-
maxLength?: number;
|
|
47
|
-
/** The minimum string length */
|
|
48
|
-
minLength?: number;
|
|
49
|
-
/** A regular expression pattern this string should match */
|
|
50
|
-
pattern?: string;
|
|
51
|
-
/** A format this string should match */
|
|
52
|
-
format?: StringFormatOption$1;
|
|
53
|
-
/** The content encoding for this string */
|
|
54
|
-
contentEncoding?: StringContentEncodingOption$1;
|
|
55
|
-
/** The content media type for this string */
|
|
56
|
-
contentMediaType?: string;
|
|
57
|
-
}
|
|
58
|
-
interface TString$1 extends TSchema$1, StringOptions$1 {
|
|
59
|
-
[Kind$1]: 'String';
|
|
60
|
-
static: string;
|
|
61
|
-
type: 'string';
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
interface TBoolean extends TSchema$1 {
|
|
65
|
-
[Kind$1]: 'Boolean';
|
|
66
|
-
static: boolean;
|
|
67
|
-
type: 'boolean';
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface NumberOptions extends SchemaOptions$1 {
|
|
71
|
-
exclusiveMaximum?: number;
|
|
72
|
-
exclusiveMinimum?: number;
|
|
73
|
-
maximum?: number;
|
|
74
|
-
minimum?: number;
|
|
75
|
-
multipleOf?: number;
|
|
76
|
-
}
|
|
77
|
-
interface TNumber extends TSchema$1, NumberOptions {
|
|
78
|
-
[Kind$1]: 'Number';
|
|
79
|
-
static: number;
|
|
80
|
-
type: 'number';
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
interface IntegerOptions extends SchemaOptions$1 {
|
|
84
|
-
exclusiveMaximum?: number;
|
|
85
|
-
exclusiveMinimum?: number;
|
|
86
|
-
maximum?: number;
|
|
87
|
-
minimum?: number;
|
|
88
|
-
multipleOf?: number;
|
|
89
|
-
}
|
|
90
|
-
interface TInteger extends TSchema$1, IntegerOptions {
|
|
91
|
-
[Kind$1]: 'Integer';
|
|
92
|
-
static: number;
|
|
93
|
-
type: 'integer';
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
type TOptional<T extends TSchema$1> = T & {
|
|
97
|
-
[OptionalKind$1]: 'Optional';
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
type RecordStatic<Key extends TSchema$1, Type extends TSchema$1, P extends unknown[]> = (Evaluate<{
|
|
101
|
-
[_ in Assert<Static<Key>, PropertyKey>]: Static<Type, P>;
|
|
102
|
-
}>);
|
|
103
|
-
interface TRecord<Key extends TSchema$1 = TSchema$1, Type extends TSchema$1 = TSchema$1> extends TSchema$1 {
|
|
104
|
-
[Kind$1]: 'Record';
|
|
105
|
-
static: RecordStatic<Key, Type, this['params']>;
|
|
106
|
-
type: 'object';
|
|
107
|
-
patternProperties: {
|
|
108
|
-
[pattern: string]: Type;
|
|
109
|
-
};
|
|
110
|
-
additionalProperties: TAdditionalProperties;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/** Creates a static type from a TypeBox type */
|
|
114
|
-
type Static<Type extends TSchema$1, Params extends unknown[] = [], Result = (Type & {
|
|
115
|
-
params: Params;
|
|
116
|
-
})['static']> = Result;
|
|
117
|
-
|
|
118
|
-
type ReadonlyOptionalPropertyKeys<T extends TProperties> = {
|
|
119
|
-
[K in keyof T]: T[K] extends TReadonly<TSchema$1> ? (T[K] extends TOptional<T[K]> ? K : never) : never;
|
|
120
|
-
}[keyof T];
|
|
121
|
-
type ReadonlyPropertyKeys<T extends TProperties> = {
|
|
122
|
-
[K in keyof T]: T[K] extends TReadonly<TSchema$1> ? (T[K] extends TOptional<T[K]> ? never : K) : never;
|
|
123
|
-
}[keyof T];
|
|
124
|
-
type OptionalPropertyKeys<T extends TProperties> = {
|
|
125
|
-
[K in keyof T]: T[K] extends TOptional<TSchema$1> ? (T[K] extends TReadonly<T[K]> ? never : K) : never;
|
|
126
|
-
}[keyof T];
|
|
127
|
-
type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
|
|
128
|
-
type ObjectStaticProperties<T extends TProperties, R extends Record<keyof any, unknown>> = Evaluate<(Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>)>;
|
|
129
|
-
type ObjectStatic<T extends TProperties, P extends unknown[]> = ObjectStaticProperties<T, {
|
|
130
|
-
[K in keyof T]: Static<T[K], P>;
|
|
131
|
-
}>;
|
|
132
|
-
type TPropertyKey = string | number;
|
|
133
|
-
type TProperties = Record<TPropertyKey, TSchema$1>;
|
|
134
|
-
type TAdditionalProperties = undefined | TSchema$1 | boolean;
|
|
135
|
-
interface ObjectOptions extends SchemaOptions$1 {
|
|
136
|
-
/** Additional property constraints for this object */
|
|
137
|
-
additionalProperties?: TAdditionalProperties;
|
|
138
|
-
/** The minimum number of properties allowed on this object */
|
|
139
|
-
minProperties?: number;
|
|
140
|
-
/** The maximum number of properties allowed on this object */
|
|
141
|
-
maxProperties?: number;
|
|
142
|
-
}
|
|
143
|
-
interface TObject<T extends TProperties = TProperties> extends TSchema$1, ObjectOptions {
|
|
144
|
-
[Kind$1]: 'Object';
|
|
145
|
-
static: ObjectStatic<T, this['params']>;
|
|
146
|
-
additionalProperties?: TAdditionalProperties;
|
|
147
|
-
type: 'object';
|
|
148
|
-
properties: T;
|
|
149
|
-
required?: string[];
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
type Assert<T, E> = T extends E ? T : never;
|
|
153
|
-
type Evaluate<T> = T extends infer O ? {
|
|
154
|
-
[K in keyof O]: O[K];
|
|
155
|
-
} : never;
|
|
156
|
-
type Ensure<T> = T extends infer U ? U : never;
|
|
157
|
-
|
|
158
|
-
interface ArrayOptions extends SchemaOptions$1 {
|
|
159
|
-
/** The minimum number of items in this array */
|
|
160
|
-
minItems?: number;
|
|
161
|
-
/** The maximum number of items in this array */
|
|
162
|
-
maxItems?: number;
|
|
163
|
-
/** Should this schema contain unique items */
|
|
164
|
-
uniqueItems?: boolean;
|
|
165
|
-
/** A schema for which some elements should match */
|
|
166
|
-
contains?: TSchema$1;
|
|
167
|
-
/** A minimum number of contains schema matches */
|
|
168
|
-
minContains?: number;
|
|
169
|
-
/** A maximum number of contains schema matches */
|
|
170
|
-
maxContains?: number;
|
|
171
|
-
}
|
|
172
|
-
type ArrayStatic<T extends TSchema$1, P extends unknown[]> = Ensure<Static<T, P>[]>;
|
|
173
|
-
interface TArray<T extends TSchema$1 = TSchema$1> extends TSchema$1, ArrayOptions {
|
|
174
|
-
[Kind$1]: 'Array';
|
|
175
|
-
static: ArrayStatic<T, this['params']>;
|
|
176
|
-
type: 'array';
|
|
177
|
-
items: T;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
interface SchemaOptions$1 {
|
|
181
|
-
$schema?: string;
|
|
182
|
-
/** Id for this schema */
|
|
183
|
-
$id?: string;
|
|
184
|
-
/** Title of this schema */
|
|
185
|
-
title?: string;
|
|
186
|
-
/** Description of this schema */
|
|
187
|
-
description?: string;
|
|
188
|
-
/** Default value for this schema */
|
|
189
|
-
default?: any;
|
|
190
|
-
/** Example values matching this schema */
|
|
191
|
-
examples?: any;
|
|
192
|
-
/** Optional annotation for readOnly */
|
|
193
|
-
readOnly?: boolean;
|
|
194
|
-
/** Optional annotation for writeOnly */
|
|
195
|
-
writeOnly?: boolean;
|
|
196
|
-
[prop: string]: any;
|
|
197
|
-
}
|
|
198
|
-
interface TKind$1 {
|
|
199
|
-
[Kind$1]: string;
|
|
200
|
-
}
|
|
201
|
-
interface TSchema$1 extends TKind$1, SchemaOptions$1 {
|
|
202
|
-
[ReadonlyKind$1]?: string;
|
|
203
|
-
[OptionalKind$1]?: string;
|
|
204
|
-
[Hint$1]?: string;
|
|
205
|
-
params: unknown[];
|
|
206
|
-
static: unknown;
|
|
207
|
-
}
|
|
208
|
-
|
|
1
|
+
import * as _alepha_core5 from "@alepha/core";
|
|
2
|
+
import * as _alepha_core57 from "@alepha/core";
|
|
3
|
+
import * as _alepha_core61 from "@alepha/core";
|
|
4
|
+
import * as _alepha_core109 from "@alepha/core";
|
|
5
|
+
import * as _alepha_core43 from "@alepha/core";
|
|
6
|
+
import * as _alepha_core47 from "@alepha/core";
|
|
7
|
+
import * as _alepha_core49 from "@alepha/core";
|
|
8
|
+
import * as _alepha_core50 from "@alepha/core";
|
|
9
|
+
import * as _alepha_core54 from "@alepha/core";
|
|
10
|
+
import * as _alepha_core103 from "@alepha/core";
|
|
11
|
+
import * as _alepha_core3 from "@alepha/core";
|
|
12
|
+
import { Alepha, Async, FileLike, KIND, KIND as KIND$1, Module, OPTIONS, Static, StreamLike, TObject, TSchema } from "@alepha/core";
|
|
13
|
+
import { JwtProvider, Permission, SecurityProvider, ServiceAccountDescriptor, UserAccountToken } from "@alepha/security";
|
|
14
|
+
import { DateTimeProvider, DurationLike } from "@alepha/datetime";
|
|
15
|
+
import * as _alepha_cache6 from "@alepha/cache";
|
|
16
|
+
import * as _alepha_retry112 from "@alepha/retry";
|
|
17
|
+
import { Readable } from "node:stream";
|
|
18
|
+
import { ReadableStream } from "node:stream/web";
|
|
19
|
+
import { Route, RouterProvider } from "@alepha/router";
|
|
20
|
+
import { BusboyConfig } from "@fastify/busboy";
|
|
21
|
+
import { IncomingMessage, ServerResponse as ServerResponse$1 } from "node:http";
|
|
22
|
+
import * as _sinclair_typebox65 from "@sinclair/typebox";
|
|
23
|
+
import * as _sinclair_typebox15 from "@sinclair/typebox";
|
|
24
|
+
import * as _sinclair_typebox59 from "@sinclair/typebox";
|
|
25
|
+
import * as _sinclair_typebox21 from "@sinclair/typebox";
|
|
26
|
+
import * as _sinclair_typebox101 from "@sinclair/typebox";
|
|
27
|
+
import * as _sinclair_typebox91 from "@sinclair/typebox";
|
|
28
|
+
import * as _sinclair_typebox7 from "@sinclair/typebox";
|
|
29
|
+
import * as _sinclair_typebox1 from "@sinclair/typebox";
|
|
30
|
+
import * as http106 from "http";
|
|
31
|
+
|
|
32
|
+
//#region src/constants/routeMethods.d.ts
|
|
209
33
|
declare const routeMethods: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"];
|
|
210
34
|
type RouteMethod = (typeof routeMethods)[number];
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
SERVER_ALS_ENABLED: TBoolean;
|
|
214
|
-
}>;
|
|
215
|
-
declare module "alepha" {
|
|
216
|
-
interface Env extends Partial<Static$1<typeof envSchema$4>> {
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Main router for all routes on the server side.
|
|
221
|
-
*
|
|
222
|
-
* Remember:
|
|
223
|
-
* - $route => generic route
|
|
224
|
-
* - $action => action route (for API calls)
|
|
225
|
-
* - $page => React route (for SSR)
|
|
226
|
-
*/
|
|
227
|
-
declare class ServerRouterProvider extends RouterProvider<ServerRouteWithHandler> {
|
|
228
|
-
protected readonly alepha: Alepha;
|
|
229
|
-
protected readonly env: {
|
|
230
|
-
SERVER_ALS_ENABLED: boolean;
|
|
231
|
-
};
|
|
232
|
-
createRequestId(): string;
|
|
233
|
-
route<TConfig extends RequestConfigSchema = RequestConfigSchema>(route: ServerRoute<TConfig>): Promise<void>;
|
|
234
|
-
onRequest(route: ServerRoute, rawRequest: ServerRawRequest, responseType: ResponseType, withAls: boolean): Promise<ServerResponse>;
|
|
235
|
-
protected processRequest(request: ServerRequest, route: ServerRoute, responseType: ResponseType, withAls: boolean): Promise<{
|
|
236
|
-
status: number;
|
|
237
|
-
headers: Record<string, string> & {
|
|
238
|
-
"set-cookie"?: string[];
|
|
239
|
-
};
|
|
240
|
-
body: any;
|
|
241
|
-
}>;
|
|
242
|
-
protected runRouteHandler(route: ServerRoute, request: ServerRequest, responseType: ResponseType, withAls: boolean): Promise<void>;
|
|
243
|
-
protected getResponseType(schema?: RequestConfigSchema): ResponseType;
|
|
244
|
-
protected errorHandler(route: ServerRoute, request: ServerRequest, error: Error): Promise<void>;
|
|
245
|
-
validateRequest(route: {
|
|
246
|
-
schema?: RequestConfigSchema;
|
|
247
|
-
}, request: ServerRequestConfig): void;
|
|
248
|
-
serializeResponse(route: ServerRoute, reply: ServerReply, responseType: ResponseType): void;
|
|
249
|
-
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/interfaces/index.d.ts
|
|
250
37
|
interface RequestConfigSchema {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
38
|
+
body?: TSchema;
|
|
39
|
+
params?: TObject;
|
|
40
|
+
query?: TObject;
|
|
41
|
+
headers?: TObject;
|
|
42
|
+
response?: TSchema;
|
|
256
43
|
}
|
|
257
44
|
interface ServerRequestConfig<TConfig extends RequestConfigSchema = RequestConfigSchema> {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
45
|
+
body: TConfig["body"] extends TSchema ? Static<TConfig["body"]> : any;
|
|
46
|
+
headers: TConfig["headers"] extends TObject ? Static<TConfig["headers"]> : Record<string, string>;
|
|
47
|
+
params: TConfig["params"] extends TObject ? Static<TConfig["params"]> : Record<string, string>;
|
|
48
|
+
query: TConfig["query"] extends TObject ? Static<TConfig["query"]> : Record<string, string>;
|
|
262
49
|
}
|
|
263
50
|
type ServerRequestConfigEntry<TConfig extends RequestConfigSchema = RequestConfigSchema> = Partial<ServerRequestConfig<TConfig>>;
|
|
264
51
|
interface ServerRequest<TConfig extends RequestConfigSchema = RequestConfigSchema> extends ServerRequestConfig<TConfig> {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
};
|
|
52
|
+
method: RouteMethod;
|
|
53
|
+
url: URL;
|
|
54
|
+
metadata: Record<string, any>;
|
|
55
|
+
reply: ServerReply;
|
|
56
|
+
raw: {
|
|
57
|
+
node?: {
|
|
58
|
+
req: IncomingMessage;
|
|
59
|
+
res: ServerResponse$1;
|
|
274
60
|
};
|
|
275
|
-
|
|
61
|
+
};
|
|
62
|
+
user: UserAccountToken;
|
|
276
63
|
}
|
|
277
64
|
interface ServerRoute<TConfig extends RequestConfigSchema = RequestConfigSchema> extends Route {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
type ServerResponseBody<TConfig extends RequestConfigSchema = RequestConfigSchema> = TConfig["response"] extends TSchema
|
|
291
|
-
type
|
|
65
|
+
method?: RouteMethod;
|
|
66
|
+
handler: ServerHandler<TConfig>;
|
|
67
|
+
schema?: TConfig;
|
|
68
|
+
/**
|
|
69
|
+
* @see ServerLoggerProvider
|
|
70
|
+
*/
|
|
71
|
+
silent?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @see ServerSecurityProvider
|
|
74
|
+
*/
|
|
75
|
+
secure?: ServerRouteSecure;
|
|
76
|
+
}
|
|
77
|
+
type ServerResponseBody<TConfig extends RequestConfigSchema = RequestConfigSchema> = TConfig["response"] extends TSchema ? Static<TConfig["response"]> : ResponseBodyType;
|
|
78
|
+
type ResponseKind = "json" | "text" | "void" | "file" | "any";
|
|
292
79
|
type ResponseBodyType = string | Buffer | StreamLike | undefined | null | void;
|
|
293
80
|
type ServerHandler<TConfig extends RequestConfigSchema = RequestConfigSchema> = (request: ServerRequest<TConfig>) => Async<ServerResponseBody<TConfig>>;
|
|
294
81
|
type ServerMiddlewareHandler<TConfig extends RequestConfigSchema = RequestConfigSchema> = (request: ServerRequest<TConfig>) => Async<ServerResponseBody<TConfig> | undefined>;
|
|
295
82
|
interface ServerReply {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
83
|
+
headers: Record<string, string> & {
|
|
84
|
+
"set-cookie"?: string[];
|
|
85
|
+
};
|
|
86
|
+
status?: number;
|
|
87
|
+
body?: any;
|
|
88
|
+
redirect(url: string): void;
|
|
302
89
|
}
|
|
303
90
|
interface ServerResponse {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
91
|
+
body: string | Buffer | ArrayBuffer | Readable | ReadableStream;
|
|
92
|
+
headers: Record<string, string>;
|
|
93
|
+
status: number;
|
|
307
94
|
}
|
|
308
95
|
interface ServerRouteWithHandler extends Route {
|
|
309
|
-
|
|
96
|
+
handler: (request: ServerRawRequest) => Promise<ServerResponse>;
|
|
310
97
|
}
|
|
311
98
|
interface ServerRawRequest {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
};
|
|
99
|
+
method: RouteMethod;
|
|
100
|
+
url: URL;
|
|
101
|
+
headers: Record<string, string>;
|
|
102
|
+
query: Record<string, string>;
|
|
103
|
+
params: Record<string, string>;
|
|
104
|
+
raw: {
|
|
105
|
+
node?: {
|
|
106
|
+
req: IncomingMessage;
|
|
107
|
+
res: ServerResponse$1;
|
|
322
108
|
};
|
|
109
|
+
};
|
|
323
110
|
}
|
|
324
111
|
type ServerRouteSecure = boolean | {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
112
|
+
permissions?: string[];
|
|
113
|
+
roles?: string[];
|
|
114
|
+
realms?: string[];
|
|
115
|
+
organizations?: string[];
|
|
329
116
|
};
|
|
330
|
-
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/helpers/ActionDescriptorHelper.d.ts
|
|
331
119
|
declare class ActionDescriptorHelper {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
120
|
+
name(options: ActionDescriptorOptions, _instance: any, key: string): string;
|
|
121
|
+
path(options: ActionDescriptorOptions, _instance: any, key: string): string;
|
|
122
|
+
link(options: ActionDescriptorOptions, instance: any, key: string, prefix?: string): HttpClientLink;
|
|
123
|
+
method(options: {
|
|
124
|
+
method?: string;
|
|
125
|
+
schema?: any;
|
|
126
|
+
}): RouteMethod;
|
|
127
|
+
permission(options: ActionDescriptorOptions, instance: any, key: string): Permission;
|
|
128
|
+
group(options: ActionDescriptorOptions, instance: any): string;
|
|
129
|
+
isMultipart(options: {
|
|
130
|
+
schema?: RequestConfigSchema;
|
|
131
|
+
}): boolean;
|
|
132
|
+
bodyContentType(options: ActionDescriptorOptions): string | undefined;
|
|
133
|
+
protected short(name: string): string;
|
|
134
|
+
fetchLinks(_url: string): void;
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/schemas/apiLinksResponseSchema.d.ts
|
|
138
|
+
declare const apiLinkSchema: _sinclair_typebox65.TObject<{
|
|
139
|
+
name: _sinclair_typebox65.TString;
|
|
140
|
+
path: _sinclair_typebox65.TString;
|
|
141
|
+
method: _sinclair_typebox65.TOptional<_sinclair_typebox65.TString>;
|
|
142
|
+
group: _sinclair_typebox65.TOptional<_sinclair_typebox65.TString>;
|
|
143
|
+
requestBodyType: _sinclair_typebox65.TOptional<_sinclair_typebox65.TString>;
|
|
144
|
+
service: _sinclair_typebox65.TOptional<_sinclair_typebox65.TString>;
|
|
356
145
|
}>;
|
|
357
|
-
declare const apiLinksResponseSchema: TObject<{
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
146
|
+
declare const apiLinksResponseSchema: _sinclair_typebox65.TObject<{
|
|
147
|
+
prefix: _sinclair_typebox65.TOptional<_sinclair_typebox65.TString>;
|
|
148
|
+
links: _sinclair_typebox65.TArray<_sinclair_typebox65.TObject<{
|
|
149
|
+
name: _sinclair_typebox65.TString;
|
|
150
|
+
path: _sinclair_typebox65.TString;
|
|
151
|
+
method: _sinclair_typebox65.TOptional<_sinclair_typebox65.TString>;
|
|
152
|
+
group: _sinclair_typebox65.TOptional<_sinclair_typebox65.TString>;
|
|
153
|
+
requestBodyType: _sinclair_typebox65.TOptional<_sinclair_typebox65.TString>;
|
|
154
|
+
service: _sinclair_typebox65.TOptional<_sinclair_typebox65.TString>;
|
|
155
|
+
}>>;
|
|
367
156
|
}>;
|
|
368
|
-
type ApiLinksResponse = Static
|
|
369
|
-
type ApiLink = Static
|
|
370
|
-
|
|
157
|
+
type ApiLinksResponse = Static<typeof apiLinksResponseSchema>;
|
|
158
|
+
type ApiLink = Static<typeof apiLinkSchema>;
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/services/HttpClient.d.ts
|
|
371
161
|
declare class HttpClient {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
162
|
+
protected readonly log: _alepha_core5.Logger;
|
|
163
|
+
protected readonly alepha: Alepha;
|
|
164
|
+
protected readonly helper: ActionDescriptorHelper;
|
|
165
|
+
readonly cache: _alepha_cache6.CacheDescriptor<HttpClientCache, any[]>;
|
|
166
|
+
protected readonly pendingRequests: HttpClientPendingRequests;
|
|
167
|
+
readonly URL_LINKS = "/api/_links";
|
|
168
|
+
links?: Array<HttpClientLink>;
|
|
169
|
+
pushLink(link: HttpClientLink): void;
|
|
170
|
+
clear(): Promise<void>;
|
|
171
|
+
fetch<T>(url: string, request?: RequestInit, options?: FetchRunOptions): Promise<FetchResponse<T>>;
|
|
172
|
+
json<T = any>(url: string, options?: RequestInit): Promise<T>;
|
|
173
|
+
protected url(host: string, link: HttpClientLink, args: ServerRequestConfigEntry): string;
|
|
174
|
+
protected body(init: RequestInit, headers: Record<string, string>, link: HttpClientLink, args?: ServerRequestConfigEntry): Promise<void>;
|
|
175
|
+
protected responseData(response: Response, options: FetchRunOptions): Promise<any>;
|
|
176
|
+
protected isMaybeFile(response: Response): boolean;
|
|
177
|
+
protected createFileLike(response: Response, defaultFileName?: string): FileLike;
|
|
178
|
+
protected pathVariables(url: string, action: HttpClientLink, args?: ServerRequestConfigEntry): string;
|
|
179
|
+
protected queryParams(url: string, action: {
|
|
180
|
+
schema?: {
|
|
181
|
+
query?: TObject;
|
|
182
|
+
};
|
|
183
|
+
}, args?: ServerRequestConfigEntry): string;
|
|
184
|
+
/**
|
|
185
|
+
* Transform a link into a fetch-request then call fetch().
|
|
186
|
+
*/
|
|
187
|
+
fetchLink(args: FetchLinkArgs): Promise<FetchResponse>;
|
|
188
|
+
/**
|
|
189
|
+
* Create a proxy client.
|
|
190
|
+
* This allows to call actions as methods, e.g. `client.actionName()`.
|
|
191
|
+
*/
|
|
192
|
+
of<T extends object>(scope?: ClientScope): HttpVirtualClient<T>;
|
|
193
|
+
protected getLinkByName(name: string, options?: ClientScope): Promise<HttpClientLink>;
|
|
194
|
+
/**
|
|
195
|
+
* Resolve a link by its name and call it.
|
|
196
|
+
* - If link is local, it will call the local handler.
|
|
197
|
+
* - If link is remote, it will make a fetch request to the remote server.
|
|
198
|
+
*/
|
|
199
|
+
follow(name: string, config?: Partial<ServerRequestConfigEntry>, options?: ClientRequestOptions & ClientScope): Promise<any>;
|
|
200
|
+
protected followRemote(link: HttpClientLink, config?: Partial<ServerRequestConfigEntry>, options?: ClientRequestOptions): Promise<FetchResponse>;
|
|
201
|
+
can(name: string): boolean;
|
|
202
|
+
getLinks(force?: boolean): Promise<HttpClientLink[]>;
|
|
413
203
|
}
|
|
414
204
|
type HttpClientPendingRequests = Record<string, Promise<any> | undefined>;
|
|
415
205
|
interface FetchFactoryAdditionalOptions {
|
|
416
|
-
|
|
206
|
+
host?: string | (() => string);
|
|
417
207
|
}
|
|
418
208
|
interface FetchRunOptions {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
209
|
+
/**
|
|
210
|
+
* Key to identify the request in the pending requests.
|
|
211
|
+
*/
|
|
212
|
+
key?: string;
|
|
213
|
+
/**
|
|
214
|
+
* The schema to validate the response against.
|
|
215
|
+
*/
|
|
216
|
+
schema?: TSchema;
|
|
217
|
+
/**
|
|
218
|
+
* Built-in cache options.
|
|
219
|
+
*/
|
|
220
|
+
cache?: boolean | number | DurationLike;
|
|
431
221
|
}
|
|
432
222
|
interface HttpClientLink extends ApiLink {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
223
|
+
secured?: boolean;
|
|
224
|
+
prefix?: string;
|
|
225
|
+
host?: string;
|
|
226
|
+
service?: string;
|
|
227
|
+
schema?: RequestConfigSchema;
|
|
228
|
+
handler?: ServerHandler;
|
|
439
229
|
}
|
|
440
230
|
interface ClientScope {
|
|
441
|
-
|
|
442
|
-
|
|
231
|
+
group?: string;
|
|
232
|
+
service?: string;
|
|
443
233
|
}
|
|
444
|
-
type HttpVirtualClient<T> = {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
} : never;
|
|
449
|
-
};
|
|
234
|
+
type HttpVirtualClient<T> = { [K in keyof T as T[K] extends ActionDescriptor ? K : never]: T[K] extends ActionDescriptor<infer Schema> ? T[K] & {
|
|
235
|
+
can: () => boolean;
|
|
236
|
+
schema: Schema;
|
|
237
|
+
} : never };
|
|
450
238
|
interface HttpClientCache {
|
|
451
|
-
|
|
452
|
-
|
|
239
|
+
data: any;
|
|
240
|
+
etag?: string;
|
|
453
241
|
}
|
|
454
242
|
interface FetchResponse<T = any> {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
243
|
+
data: T;
|
|
244
|
+
status: number;
|
|
245
|
+
statusText: string;
|
|
246
|
+
headers: Headers;
|
|
247
|
+
raw?: Response;
|
|
460
248
|
}
|
|
461
249
|
interface FetchLinkArgs {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
250
|
+
link: HttpClientLink;
|
|
251
|
+
host?: string;
|
|
252
|
+
config?: ServerRequestConfigEntry;
|
|
253
|
+
options?: ClientRequestOptions;
|
|
466
254
|
}
|
|
467
|
-
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/descriptors/$action.d.ts
|
|
468
257
|
declare const KEY$2 = "ACTION";
|
|
469
258
|
interface ActionDescriptorOptions<TConfig extends RequestConfigSchema = RequestConfigSchema> extends Omit<ServerRoute, "handler" | "path" | "schema"> {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
259
|
+
/**
|
|
260
|
+
* Name the route.
|
|
261
|
+
*/
|
|
262
|
+
name?: string;
|
|
263
|
+
/**
|
|
264
|
+
* Namespace of the route, used for grouping.
|
|
265
|
+
*
|
|
266
|
+
* @default Class name containing the route.
|
|
267
|
+
*/
|
|
268
|
+
group?: string;
|
|
269
|
+
/**
|
|
270
|
+
* If false, disabled the security check for this route.
|
|
271
|
+
*
|
|
272
|
+
* @default true when SecurityModule is enabled, false otherwise.
|
|
273
|
+
* @deprecated
|
|
274
|
+
*/
|
|
275
|
+
security?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* Pathname of the route.
|
|
278
|
+
*/
|
|
279
|
+
path?: string;
|
|
280
|
+
/**
|
|
281
|
+
* Inherit options from another route.
|
|
282
|
+
*/
|
|
283
|
+
use?: {
|
|
284
|
+
[OPTIONS]: ActionDescriptorOptions<TConfig>;
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* The route method.
|
|
288
|
+
*
|
|
289
|
+
* @default "GET" or "POST" when schema body is defined.
|
|
290
|
+
*/
|
|
291
|
+
method?: RouteMethod;
|
|
292
|
+
/**
|
|
293
|
+
* The config schema of the route.
|
|
294
|
+
* - body: The request body schema.
|
|
295
|
+
* - params: Path variables schema.
|
|
296
|
+
* - query: The request query-params schema.
|
|
297
|
+
* - response: The response schema.
|
|
298
|
+
*/
|
|
299
|
+
schema?: TConfig;
|
|
300
|
+
/**
|
|
301
|
+
* Short description of the route.
|
|
302
|
+
*/
|
|
303
|
+
summary?: string;
|
|
304
|
+
/**
|
|
305
|
+
* Long description of the route.
|
|
306
|
+
*/
|
|
307
|
+
description?: string;
|
|
308
|
+
/**
|
|
309
|
+
* Disable the route. Useful with env variables do disable one specific route.
|
|
310
|
+
*/
|
|
311
|
+
disabled?: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Mark the route as private.
|
|
314
|
+
* - It won't be exposed in the API documentation.
|
|
315
|
+
* - It won't be exposed in _links.
|
|
316
|
+
*/
|
|
317
|
+
internal?: boolean;
|
|
318
|
+
/**
|
|
319
|
+
* Main route handler. This is where the route logic is implemented.
|
|
320
|
+
*/
|
|
321
|
+
handler?: ServerHandler<TConfig>;
|
|
533
322
|
}
|
|
534
323
|
interface ActionDescriptor<TConfig extends RequestConfigSchema = RequestConfigSchema> {
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
324
|
+
[KIND$1]: typeof KEY$2;
|
|
325
|
+
[OPTIONS]: ActionDescriptorOptions<TConfig>;
|
|
326
|
+
/**
|
|
327
|
+
* Fetch or just call local route when available.
|
|
328
|
+
*/
|
|
329
|
+
(config?: ClientRequestEntry<TConfig>, opts?: ClientRequestOptions): Promise<ClientRequestResponse<TConfig>>;
|
|
330
|
+
/**
|
|
331
|
+
* Just fetch the route. Skip any local route.
|
|
332
|
+
*/
|
|
333
|
+
fetch: (config?: ClientRequestEntry<TConfig>, opts?: ClientRequestOptions) => Promise<FetchResponse<ClientRequestResponse<TConfig>>>;
|
|
334
|
+
/**
|
|
335
|
+
* Name of the permission required to access this route.
|
|
336
|
+
*/
|
|
337
|
+
permission: () => string;
|
|
549
338
|
}
|
|
550
339
|
declare const $action: {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
};
|
|
554
|
-
type ClientRequestEntry<TConfig extends RequestConfigSchema = RequestConfigSchema, T = ClientRequestEntryContainer<TConfig>> = {
|
|
555
|
-
[K in keyof T as T[K] extends undefined ? never : K]: T[K];
|
|
340
|
+
<TConfig extends RequestConfigSchema>(options: ActionDescriptorOptions<TConfig>): ActionDescriptor<TConfig>;
|
|
341
|
+
[KIND$1]: string;
|
|
556
342
|
};
|
|
343
|
+
type ClientRequestEntry<TConfig extends RequestConfigSchema = RequestConfigSchema, T = ClientRequestEntryContainer<TConfig>> = { [K in keyof T as T[K] extends undefined ? never : K]: T[K] };
|
|
557
344
|
type ClientRequestEntryContainer<TConfig extends RequestConfigSchema = RequestConfigSchema> = {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
345
|
+
body: TConfig["body"] extends TSchema ? Static<TConfig["body"]> : undefined;
|
|
346
|
+
params: TConfig["params"] extends TSchema ? Static<TConfig["params"]> : undefined;
|
|
347
|
+
headers?: TConfig["headers"] extends TSchema ? Static<TConfig["headers"]> : undefined;
|
|
348
|
+
query?: TConfig["query"] extends TSchema ? Partial<Static<TConfig["query"]>> : undefined;
|
|
562
349
|
};
|
|
563
350
|
interface ClientRequestOptions extends FetchRunOptions {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
}
|
|
577
|
-
type ClientRequestResponse<TConfig extends RequestConfigSchema> = TConfig["response"] extends TSchema
|
|
578
|
-
|
|
351
|
+
/**
|
|
352
|
+
* Forward user from the previous request.
|
|
353
|
+
* If "system", use system user. @see {ServerSecurityProvider.localSystemUser}
|
|
354
|
+
* If "context", use the user from the current context (e.g. request).
|
|
355
|
+
*
|
|
356
|
+
* @default "system" is provided, else "context" is used.
|
|
357
|
+
*/
|
|
358
|
+
user?: UserAccountToken | "system" | "context";
|
|
359
|
+
/**
|
|
360
|
+
* Standard request fetch options.
|
|
361
|
+
*/
|
|
362
|
+
request?: RequestInit;
|
|
363
|
+
}
|
|
364
|
+
type ClientRequestResponse<TConfig extends RequestConfigSchema> = TConfig["response"] extends TSchema ? Static<TConfig["response"]> : any;
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region src/errors/HttpError.d.ts
|
|
579
367
|
declare class HttpError extends Error {
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
};
|
|
588
|
-
} | {
|
|
589
|
-
status: number;
|
|
590
|
-
error: string | undefined;
|
|
591
|
-
message: string;
|
|
592
|
-
cause?: undefined;
|
|
593
|
-
};
|
|
594
|
-
readonly status: number;
|
|
595
|
-
readonly error?: string;
|
|
596
|
-
readonly reason?: {
|
|
597
|
-
name: string;
|
|
598
|
-
message: string;
|
|
368
|
+
static toJSON(error: HttpError): {
|
|
369
|
+
status: number;
|
|
370
|
+
error: string | undefined;
|
|
371
|
+
message: string;
|
|
372
|
+
cause: {
|
|
373
|
+
name: string;
|
|
374
|
+
message: string;
|
|
599
375
|
};
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
376
|
+
} | {
|
|
377
|
+
status: number;
|
|
378
|
+
error: string | undefined;
|
|
379
|
+
message: string;
|
|
380
|
+
cause?: undefined;
|
|
381
|
+
};
|
|
382
|
+
readonly status: number;
|
|
383
|
+
readonly error?: string;
|
|
384
|
+
readonly reason?: {
|
|
385
|
+
name: string;
|
|
386
|
+
message: string;
|
|
387
|
+
};
|
|
388
|
+
constructor(options: {
|
|
389
|
+
error?: string;
|
|
390
|
+
message: string;
|
|
391
|
+
status: number;
|
|
392
|
+
cause?: {
|
|
393
|
+
name: string;
|
|
394
|
+
message: string;
|
|
395
|
+
} | unknown;
|
|
396
|
+
}, cause?: unknown);
|
|
609
397
|
}
|
|
610
398
|
declare const errorNameByStatus: Record<number, string>;
|
|
611
399
|
declare const isHttpError: (error: unknown) => error is HttpErrorLike;
|
|
612
400
|
interface HttpErrorLike extends Error {
|
|
613
|
-
|
|
401
|
+
status: number;
|
|
614
402
|
}
|
|
615
|
-
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/descriptors/$client.d.ts
|
|
616
405
|
declare const $client: <T extends object>(scope?: ClientScope) => HttpVirtualClient<T>;
|
|
617
|
-
|
|
406
|
+
//#endregion
|
|
407
|
+
//#region src/descriptors/$proxy.d.ts
|
|
618
408
|
type ProxyDescriptorOptions = {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
409
|
+
path: string;
|
|
410
|
+
target: string;
|
|
411
|
+
disabled?: boolean;
|
|
412
|
+
beforeRequest?: (request: ServerRequest, proxyRequest: RequestInit) => Async<void>;
|
|
413
|
+
afterResponse?: (request: ServerRequest, proxyResponse: Response) => Async<void>;
|
|
414
|
+
rewrite?: (url: URL) => void;
|
|
625
415
|
};
|
|
626
416
|
interface ProxyDescriptor {
|
|
627
|
-
|
|
628
|
-
|
|
417
|
+
[KIND$1]: "PROXY";
|
|
418
|
+
[OPTIONS]: ProxyDescriptorOptions;
|
|
629
419
|
}
|
|
630
420
|
declare const $proxy: {
|
|
631
|
-
|
|
632
|
-
|
|
421
|
+
(options: ProxyDescriptorOptions): ProxyDescriptor;
|
|
422
|
+
[KIND$1]: string;
|
|
633
423
|
};
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
* Represents a User Account extracted from JWT.
|
|
637
|
-
*/
|
|
638
|
-
interface UserAccountInfo {
|
|
639
|
-
/**
|
|
640
|
-
* ID of user account. Based on JWT.sub.
|
|
641
|
-
*/
|
|
642
|
-
id: string;
|
|
643
|
-
/**
|
|
644
|
-
* Represents the roles assigned to a user.
|
|
645
|
-
*/
|
|
646
|
-
roles?: string[];
|
|
647
|
-
/**
|
|
648
|
-
* User full name, if available.
|
|
649
|
-
*/
|
|
650
|
-
name?: string;
|
|
651
|
-
/**
|
|
652
|
-
* User email, if available.
|
|
653
|
-
*/
|
|
654
|
-
email?: string;
|
|
655
|
-
/**
|
|
656
|
-
* User profile picture URL, if available.
|
|
657
|
-
*/
|
|
658
|
-
picture?: string;
|
|
659
|
-
/**
|
|
660
|
-
* Organization ID, if available.
|
|
661
|
-
*/
|
|
662
|
-
organization?: string;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
/** Symbol key applied to readonly types */
|
|
666
|
-
declare const ReadonlyKind: unique symbol;
|
|
667
|
-
/** Symbol key applied to optional types */
|
|
668
|
-
declare const OptionalKind: unique symbol;
|
|
669
|
-
/** Symbol key applied to types */
|
|
670
|
-
declare const Hint: unique symbol;
|
|
671
|
-
/** Symbol key applied to types */
|
|
672
|
-
declare const Kind: unique symbol;
|
|
673
|
-
|
|
674
|
-
type StringFormatOption = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex' | ({} & string);
|
|
675
|
-
type StringContentEncodingOption = '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64' | ({} & string);
|
|
676
|
-
interface StringOptions extends SchemaOptions {
|
|
677
|
-
/** The maximum string length */
|
|
678
|
-
maxLength?: number;
|
|
679
|
-
/** The minimum string length */
|
|
680
|
-
minLength?: number;
|
|
681
|
-
/** A regular expression pattern this string should match */
|
|
682
|
-
pattern?: string;
|
|
683
|
-
/** A format this string should match */
|
|
684
|
-
format?: StringFormatOption;
|
|
685
|
-
/** The content encoding for this string */
|
|
686
|
-
contentEncoding?: StringContentEncodingOption;
|
|
687
|
-
/** The content media type for this string */
|
|
688
|
-
contentMediaType?: string;
|
|
689
|
-
}
|
|
690
|
-
interface TString extends TSchema, StringOptions {
|
|
691
|
-
[Kind]: 'String';
|
|
692
|
-
static: string;
|
|
693
|
-
type: 'string';
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
interface SchemaOptions {
|
|
697
|
-
$schema?: string;
|
|
698
|
-
/** Id for this schema */
|
|
699
|
-
$id?: string;
|
|
700
|
-
/** Title of this schema */
|
|
701
|
-
title?: string;
|
|
702
|
-
/** Description of this schema */
|
|
703
|
-
description?: string;
|
|
704
|
-
/** Default value for this schema */
|
|
705
|
-
default?: any;
|
|
706
|
-
/** Example values matching this schema */
|
|
707
|
-
examples?: any;
|
|
708
|
-
/** Optional annotation for readOnly */
|
|
709
|
-
readOnly?: boolean;
|
|
710
|
-
/** Optional annotation for writeOnly */
|
|
711
|
-
writeOnly?: boolean;
|
|
712
|
-
[prop: string]: any;
|
|
713
|
-
}
|
|
714
|
-
interface TKind {
|
|
715
|
-
[Kind]: string;
|
|
716
|
-
}
|
|
717
|
-
interface TSchema extends TKind, SchemaOptions {
|
|
718
|
-
[ReadonlyKind]?: string;
|
|
719
|
-
[OptionalKind]?: string;
|
|
720
|
-
[Hint]?: string;
|
|
721
|
-
params: unknown[];
|
|
722
|
-
static: unknown;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
declare const envSchema$3: _alepha_core.TObject<{
|
|
726
|
-
SECURITY_SECRET_KEY: TString;
|
|
727
|
-
}>;
|
|
728
|
-
interface ServiceAccountDescriptor {
|
|
729
|
-
token: () => Promise<string>;
|
|
730
|
-
}
|
|
731
|
-
declare module "alepha/core" {
|
|
732
|
-
interface Env extends Partial<Static$1<typeof envSchema$3>> {
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
declare module "@alepha/core" {
|
|
737
|
-
interface Hooks {
|
|
738
|
-
"security:user:created": {
|
|
739
|
-
realm: string;
|
|
740
|
-
user: UserAccountInfo;
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
|
|
424
|
+
//#endregion
|
|
425
|
+
//#region src/descriptors/$remote.d.ts
|
|
745
426
|
declare const KEY$1 = "REMOTE";
|
|
746
427
|
interface RemoteDescriptorOptions {
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
428
|
+
/**
|
|
429
|
+
* The URL of the remote service.
|
|
430
|
+
* You can use a function to generate the URL dynamically.
|
|
431
|
+
* You probably should use $inject(env) to get the URL from the environment.
|
|
432
|
+
*
|
|
433
|
+
* @example
|
|
434
|
+
* ```ts
|
|
435
|
+
* import { $remote } from "@alepha/server";
|
|
436
|
+
* import { $inject, t } from "@alepha/core";
|
|
437
|
+
*
|
|
438
|
+
* class App {
|
|
439
|
+
* env = $inject(t.object({
|
|
440
|
+
* REMOTE_URL: t.string({default: "http://localhost:3000"}),
|
|
441
|
+
* }));
|
|
442
|
+
* remote = $remote({
|
|
443
|
+
* url: this.env.REMOTE_URL,
|
|
444
|
+
* });
|
|
445
|
+
* }
|
|
446
|
+
* ```
|
|
447
|
+
*/
|
|
448
|
+
url: string | (() => string);
|
|
449
|
+
/**
|
|
450
|
+
* The name of the remote service.
|
|
451
|
+
*
|
|
452
|
+
* @default Member of the class containing the remote service.
|
|
453
|
+
*/
|
|
454
|
+
name?: string;
|
|
455
|
+
/**
|
|
456
|
+
* If true, all methods of the remote service will be exposed as actions in this context.
|
|
457
|
+
* > Note: Proxy will never use the service account, it just... proxies the request.
|
|
458
|
+
*/
|
|
459
|
+
proxy?: boolean | Partial<ProxyDescriptorOptions & {
|
|
460
|
+
/**
|
|
461
|
+
* If true, the remote service won't be available internally, only through the proxy.
|
|
462
|
+
*/
|
|
463
|
+
noInternal: boolean;
|
|
464
|
+
}>;
|
|
465
|
+
/**
|
|
466
|
+
* For communication between the server and the remote service with a security layer.
|
|
467
|
+
* This will be used for internal communication and will not be exposed to the client.
|
|
468
|
+
*/
|
|
469
|
+
serviceAccount?: ServiceAccountDescriptor;
|
|
789
470
|
}
|
|
790
471
|
interface RemoteDescriptor {
|
|
791
|
-
|
|
792
|
-
|
|
472
|
+
[KIND$1]: typeof KEY$1;
|
|
473
|
+
[OPTIONS]: RemoteDescriptorOptions;
|
|
793
474
|
}
|
|
794
475
|
/**
|
|
795
476
|
* $remote is a descriptor that allows you to define a remote service access.
|
|
@@ -801,242 +482,285 @@ interface RemoteDescriptor {
|
|
|
801
482
|
* You can add a service account if you want to use a security layer.
|
|
802
483
|
*/
|
|
803
484
|
declare const $remote: {
|
|
804
|
-
|
|
805
|
-
|
|
485
|
+
(options: RemoteDescriptorOptions): RemoteDescriptor;
|
|
486
|
+
[KIND$1]: string;
|
|
806
487
|
};
|
|
807
|
-
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region src/descriptors/$route.d.ts
|
|
808
490
|
declare const KEY = "ROUTE";
|
|
809
|
-
interface RouteDescriptorOptions<TConfig extends RequestConfigSchema = RequestConfigSchema> extends ServerRoute<TConfig> {
|
|
810
|
-
}
|
|
491
|
+
interface RouteDescriptorOptions<TConfig extends RequestConfigSchema = RequestConfigSchema> extends ServerRoute<TConfig> {}
|
|
811
492
|
type RouteDescriptor<TConfig extends RequestConfigSchema = RequestConfigSchema> = {
|
|
812
|
-
|
|
813
|
-
|
|
493
|
+
[KIND$1]: typeof KEY;
|
|
494
|
+
[OPTIONS]: RouteDescriptorOptions<TConfig>;
|
|
814
495
|
};
|
|
815
496
|
declare const $route: {
|
|
816
|
-
|
|
817
|
-
|
|
497
|
+
<TConfig extends RequestConfigSchema = RequestConfigSchema>(options: RouteDescriptorOptions<TConfig>): RouteDescriptor<TConfig>;
|
|
498
|
+
[KIND$1]: string;
|
|
818
499
|
};
|
|
819
|
-
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region src/errors/BadRequestError.d.ts
|
|
820
502
|
declare class BadRequestError extends HttpError {
|
|
821
|
-
|
|
503
|
+
constructor(message?: string, cause?: unknown);
|
|
822
504
|
}
|
|
823
|
-
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/errors/ConflictError.d.ts
|
|
824
507
|
declare class ConflictError extends HttpError {
|
|
825
|
-
|
|
508
|
+
constructor(message?: string, cause?: unknown);
|
|
826
509
|
}
|
|
827
|
-
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region src/errors/ForbiddenError.d.ts
|
|
828
512
|
declare class ForbiddenError extends HttpError {
|
|
829
|
-
|
|
513
|
+
constructor(message?: string, cause?: unknown);
|
|
830
514
|
}
|
|
831
|
-
|
|
515
|
+
//#endregion
|
|
516
|
+
//#region src/errors/NotFoundError.d.ts
|
|
832
517
|
declare class NotFoundError extends HttpError {
|
|
833
|
-
|
|
518
|
+
constructor(message?: string, cause?: unknown);
|
|
834
519
|
}
|
|
835
|
-
|
|
520
|
+
//#endregion
|
|
521
|
+
//#region src/errors/UnauthorizedError.d.ts
|
|
836
522
|
declare class UnauthorizedError extends HttpError {
|
|
837
|
-
|
|
523
|
+
constructor(message?: string, cause?: unknown);
|
|
838
524
|
}
|
|
839
|
-
|
|
525
|
+
//#endregion
|
|
526
|
+
//#region src/errors/ValidationError.d.ts
|
|
840
527
|
declare class ValidationError extends HttpError {
|
|
841
|
-
|
|
528
|
+
constructor(message?: string, cause?: unknown);
|
|
842
529
|
}
|
|
843
|
-
|
|
530
|
+
//#endregion
|
|
531
|
+
//#region src/providers/features/ServerHealthProvider.d.ts
|
|
844
532
|
/**
|
|
845
533
|
* Register `/health` endpoint.
|
|
846
534
|
*
|
|
847
535
|
* - Provides basic health information about the server.
|
|
848
536
|
*/
|
|
849
537
|
declare class ServerHealthProvider {
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
}>;
|
|
538
|
+
protected readonly dateTimeProvider: DateTimeProvider;
|
|
539
|
+
protected readonly alepha: Alepha;
|
|
540
|
+
readonly health: RouteDescriptor<{
|
|
541
|
+
response: _sinclair_typebox15.TObject<{
|
|
542
|
+
message: _sinclair_typebox15.TString;
|
|
543
|
+
uptime: _sinclair_typebox15.TNumber;
|
|
544
|
+
date: _sinclair_typebox15.TString;
|
|
545
|
+
ready: _sinclair_typebox15.TBoolean;
|
|
859
546
|
}>;
|
|
547
|
+
}>;
|
|
860
548
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
549
|
+
//#endregion
|
|
550
|
+
//#region src/providers/ServerRouterProvider.d.ts
|
|
551
|
+
/**
|
|
552
|
+
* Main router for all routes on the server side.
|
|
553
|
+
*
|
|
554
|
+
* - $route => generic route
|
|
555
|
+
* - $action => action route (for API calls)
|
|
556
|
+
* - $page => React route (for SSR)
|
|
557
|
+
*/
|
|
558
|
+
declare class ServerRouterProvider extends RouterProvider<ServerRouteWithHandler> {
|
|
559
|
+
protected readonly alepha: Alepha;
|
|
560
|
+
createRequestId(): string;
|
|
561
|
+
route<TConfig extends RequestConfigSchema = RequestConfigSchema>(route: ServerRoute<TConfig>): Promise<void>;
|
|
562
|
+
onRequest(route: ServerRoute, rawRequest: ServerRawRequest, responseKind: ResponseKind): Promise<ServerResponse>;
|
|
563
|
+
protected processRequest(request: ServerRequest, route: ServerRoute, responseKind: ResponseKind): Promise<{
|
|
564
|
+
status: number;
|
|
565
|
+
headers: Record<string, string> & {
|
|
566
|
+
"set-cookie"?: string[];
|
|
567
|
+
};
|
|
568
|
+
body: any;
|
|
569
|
+
}>;
|
|
570
|
+
protected runRouteHandler(route: ServerRoute, request: ServerRequest, responseKind: ResponseKind): Promise<void>;
|
|
571
|
+
protected getResponseType(schema?: RequestConfigSchema): ResponseKind;
|
|
572
|
+
protected errorHandler(route: ServerRoute, request: ServerRequest, error: Error): Promise<void>;
|
|
573
|
+
validateRequest(route: {
|
|
574
|
+
schema?: RequestConfigSchema;
|
|
575
|
+
}, request: ServerRequestConfig): void;
|
|
576
|
+
serializeResponse(route: ServerRoute, reply: ServerReply, responseKind: ResponseKind): void;
|
|
870
577
|
}
|
|
871
|
-
|
|
578
|
+
//#endregion
|
|
579
|
+
//#region src/providers/ProxyDescriptorProvider.d.ts
|
|
580
|
+
declare class ProxyDescriptorProvider {
|
|
581
|
+
protected readonly log: _alepha_core57.Logger;
|
|
582
|
+
protected readonly routerProvider: ServerRouterProvider;
|
|
583
|
+
protected readonly alepha: Alepha;
|
|
584
|
+
readonly configure: _alepha_core57.HookDescriptor<"configure">;
|
|
585
|
+
createProxyHandler(options: Omit<ProxyDescriptorOptions, "path">): ServerHandler;
|
|
586
|
+
proxy(options: ProxyDescriptorOptions): Promise<void>;
|
|
587
|
+
private getRawRequestBody;
|
|
588
|
+
}
|
|
589
|
+
//#endregion
|
|
590
|
+
//#region src/providers/platforms/ServerProvider.d.ts
|
|
872
591
|
declare class ServerProvider {
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
592
|
+
constructor();
|
|
593
|
+
get hostname(): string;
|
|
594
|
+
}
|
|
595
|
+
//#endregion
|
|
596
|
+
//#region src/providers/ServerActionDescriptorProvider.d.ts
|
|
597
|
+
declare const envSchema$2: _alepha_core61.TObject<{
|
|
598
|
+
SERVER_API_PREFIX: _sinclair_typebox59.TString;
|
|
599
|
+
SERVER_SECURITY_ENABLED: _sinclair_typebox59.TBoolean;
|
|
880
600
|
}>;
|
|
881
|
-
declare module "
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
interface State {
|
|
885
|
-
/**
|
|
886
|
-
* Real (or fake) user account, used for internal actions.
|
|
887
|
-
* If you define this, you assume that all actions are executed by this user by default.
|
|
888
|
-
* And to force a different user, you need to pass it explicitly in the options.
|
|
889
|
-
*/
|
|
890
|
-
"ServerSecurityProvider.localSystemUser"?: UserAccountToken;
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
declare class ServerActionDescriptorProvider {
|
|
894
|
-
protected readonly log: _alepha_core.Logger;
|
|
895
|
-
protected readonly alepha: Alepha;
|
|
896
|
-
protected readonly env: {
|
|
897
|
-
SERVER_API_PREFIX: string;
|
|
898
|
-
SERVER_SECURITY_ENABLED: boolean;
|
|
899
|
-
};
|
|
900
|
-
protected readonly client: HttpClient;
|
|
901
|
-
protected readonly serverProvider: ServerProvider;
|
|
902
|
-
protected readonly helper: ActionDescriptorHelper;
|
|
903
|
-
protected readonly routerProvider: ServerRouterProvider;
|
|
904
|
-
protected readonly actions: ServerRouteAction[];
|
|
905
|
-
getActions(): ServerRouteAction<RequestConfigSchema>[];
|
|
906
|
-
getPrefix(): string;
|
|
907
|
-
readonly configure: _alepha_core.HookDescriptor<"configure">;
|
|
908
|
-
registerAction(value: ActionDescriptor, key: string, instance: any, prefix?: string): Promise<void>;
|
|
909
|
-
/**
|
|
910
|
-
* Check a mock function for the specified route.
|
|
911
|
-
*
|
|
912
|
-
* This is mostly used for testing purposes.
|
|
913
|
-
*/
|
|
914
|
-
protected createLocalFunction(action: ActionDescriptorOptions, permission: Permission): (config?: ServerRequestConfigEntry, options?: ClientRequestOptions) => Promise<any>;
|
|
601
|
+
declare module "alepha" {
|
|
602
|
+
interface Env extends Partial<Static<typeof envSchema$2>> {}
|
|
603
|
+
interface State {
|
|
915
604
|
/**
|
|
916
|
-
*
|
|
917
|
-
*
|
|
605
|
+
* Real (or fake) user account, used for internal actions.
|
|
606
|
+
* If you define this, you assume that all actions are executed by this user by default.
|
|
607
|
+
* And to force a different user, you need to pass it explicitly in the options.
|
|
918
608
|
*/
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
609
|
+
"ServerSecurityProvider.localSystemUser"?: UserAccountToken;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
declare class ServerActionDescriptorProvider {
|
|
613
|
+
protected readonly log: _alepha_core61.Logger;
|
|
614
|
+
protected readonly alepha: Alepha;
|
|
615
|
+
protected readonly env: {
|
|
616
|
+
SERVER_API_PREFIX: string;
|
|
617
|
+
SERVER_SECURITY_ENABLED: boolean;
|
|
618
|
+
};
|
|
619
|
+
protected readonly client: HttpClient;
|
|
620
|
+
protected readonly serverProvider: ServerProvider;
|
|
621
|
+
protected readonly helper: ActionDescriptorHelper;
|
|
622
|
+
protected readonly routerProvider: ServerRouterProvider;
|
|
623
|
+
protected readonly actions: ServerRouteAction[];
|
|
624
|
+
getActions(): ServerRouteAction<RequestConfigSchema>[];
|
|
625
|
+
getPrefix(): string;
|
|
626
|
+
readonly configure: _alepha_core61.HookDescriptor<"configure">;
|
|
627
|
+
registerAction(value: ActionDescriptor, key: string, instance: any, prefix?: string): Promise<void>;
|
|
628
|
+
/**
|
|
629
|
+
* Check a mock function for the specified route.
|
|
630
|
+
*
|
|
631
|
+
* This is mostly used for testing purposes.
|
|
632
|
+
*/
|
|
633
|
+
protected createLocalFunction(action: ActionDescriptorOptions, permission: Permission): (config?: ServerRequestConfigEntry, options?: ClientRequestOptions) => Promise<any>;
|
|
634
|
+
/**
|
|
635
|
+
* Get the user account token for a local action call.
|
|
636
|
+
* It will check the options, context, and system user.
|
|
637
|
+
*/
|
|
638
|
+
protected getUserFromLocalFunctionContext(options: {
|
|
639
|
+
user?: UserAccountToken | "system" | "context";
|
|
640
|
+
}, permission: Permission, isRouteSecure: boolean): UserAccountToken | undefined;
|
|
922
641
|
}
|
|
923
642
|
declare const isServerAction: (value: any) => value is ServerRouteAction;
|
|
924
643
|
interface ServerRemote {
|
|
925
|
-
|
|
644
|
+
url: string;
|
|
645
|
+
name: string;
|
|
646
|
+
proxy: boolean;
|
|
647
|
+
internal: boolean;
|
|
648
|
+
links: (args: {
|
|
649
|
+
authorization?: string;
|
|
650
|
+
}) => Promise<ApiLinksResponse>;
|
|
651
|
+
schema: (args: {
|
|
926
652
|
name: string;
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
}) => Promise<ApiLinksResponse>;
|
|
932
|
-
schema: (args: {
|
|
933
|
-
name: string;
|
|
934
|
-
authorization?: string;
|
|
935
|
-
}) => Promise<any>;
|
|
936
|
-
serviceAccount?: ServiceAccountDescriptor$1;
|
|
937
|
-
prefix: string;
|
|
653
|
+
authorization?: string;
|
|
654
|
+
}) => Promise<any>;
|
|
655
|
+
serviceAccount?: ServiceAccountDescriptor;
|
|
656
|
+
prefix: string;
|
|
938
657
|
}
|
|
939
658
|
interface ServerRouteAction<TConfig extends RequestConfigSchema = RequestConfigSchema> extends ServerRoute<TConfig> {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
}
|
|
947
|
-
|
|
659
|
+
prefix: string;
|
|
660
|
+
method: RouteMethod;
|
|
661
|
+
name: string;
|
|
662
|
+
group: string;
|
|
663
|
+
permission: Permission;
|
|
664
|
+
options: ActionDescriptorOptions;
|
|
665
|
+
}
|
|
666
|
+
//#endregion
|
|
667
|
+
//#region src/providers/RemoteDescriptorProvider.d.ts
|
|
948
668
|
declare class RemoteDescriptorProvider {
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
}
|
|
977
|
-
|
|
669
|
+
static path: {
|
|
670
|
+
apiLinks: string;
|
|
671
|
+
};
|
|
672
|
+
protected readonly alepha: Alepha;
|
|
673
|
+
protected readonly client: HttpClient;
|
|
674
|
+
protected readonly proxyProvider: ProxyDescriptorProvider;
|
|
675
|
+
protected readonly remotes: Array<ServerRemote>;
|
|
676
|
+
protected readonly log: _alepha_core109.Logger;
|
|
677
|
+
getRemotes(): ServerRemote[];
|
|
678
|
+
readonly configure: _alepha_core109.HookDescriptor<"configure">;
|
|
679
|
+
readonly start: _alepha_core109.HookDescriptor<"start">;
|
|
680
|
+
registerRemote(value: RemoteDescriptor, key: string): Promise<void>;
|
|
681
|
+
protected readonly fetchLinks: _alepha_retry112.RetryDescriptor<(opts: {
|
|
682
|
+
service: string;
|
|
683
|
+
url: string;
|
|
684
|
+
authorization?: string;
|
|
685
|
+
}) => Promise<{
|
|
686
|
+
prefix?: string | undefined;
|
|
687
|
+
links: {
|
|
688
|
+
method?: string | undefined;
|
|
689
|
+
group?: string | undefined;
|
|
690
|
+
requestBodyType?: string | undefined;
|
|
691
|
+
service?: string | undefined;
|
|
692
|
+
name: string;
|
|
693
|
+
path: string;
|
|
694
|
+
}[];
|
|
695
|
+
}>>;
|
|
696
|
+
}
|
|
697
|
+
//#endregion
|
|
698
|
+
//#region src/providers/features/ServerLinksProvider.d.ts
|
|
978
699
|
declare class ServerLinksProvider {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
}>;
|
|
700
|
+
protected readonly alepha: Alepha;
|
|
701
|
+
protected readonly client: HttpClient;
|
|
702
|
+
protected readonly remoteProvider: RemoteDescriptorProvider;
|
|
703
|
+
protected readonly serverActionDescriptorProvider: ServerActionDescriptorProvider;
|
|
704
|
+
readonly links: RouteDescriptor<{
|
|
705
|
+
response: _sinclair_typebox21.TObject<{
|
|
706
|
+
prefix: _sinclair_typebox21.TOptional<_sinclair_typebox21.TString>;
|
|
707
|
+
links: _sinclair_typebox21.TArray<_sinclair_typebox21.TObject<{
|
|
708
|
+
name: _sinclair_typebox21.TString;
|
|
709
|
+
path: _sinclair_typebox21.TString;
|
|
710
|
+
method: _sinclair_typebox21.TOptional<_sinclair_typebox21.TString>;
|
|
711
|
+
group: _sinclair_typebox21.TOptional<_sinclair_typebox21.TString>;
|
|
712
|
+
requestBodyType: _sinclair_typebox21.TOptional<_sinclair_typebox21.TString>;
|
|
713
|
+
service: _sinclair_typebox21.TOptional<_sinclair_typebox21.TString>;
|
|
714
|
+
}>>;
|
|
995
715
|
}>;
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
response: TRecord<TString$1, TAny>;
|
|
716
|
+
}>;
|
|
717
|
+
readonly schema: RouteDescriptor<{
|
|
718
|
+
params: _sinclair_typebox21.TObject<{
|
|
719
|
+
name: _sinclair_typebox21.TString;
|
|
1001
720
|
}>;
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
721
|
+
response: _sinclair_typebox21.TRecord<_sinclair_typebox21.TString, _sinclair_typebox21.TAny>;
|
|
722
|
+
}>;
|
|
723
|
+
getLinks(options: {
|
|
724
|
+
user?: UserAccountToken;
|
|
725
|
+
authorization?: string;
|
|
726
|
+
}): Promise<ApiLinksResponse>;
|
|
727
|
+
}
|
|
728
|
+
//#endregion
|
|
729
|
+
//#region src/providers/features/ServerLoggerProvider.d.ts
|
|
1008
730
|
declare class ServerLoggerProvider {
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
}
|
|
1015
|
-
|
|
731
|
+
protected readonly log: _alepha_core43.Logger;
|
|
732
|
+
protected readonly alepha: Alepha;
|
|
733
|
+
readonly onRequest: _alepha_core43.HookDescriptor<"server:onRequest">;
|
|
734
|
+
readonly onError: _alepha_core43.HookDescriptor<"server:onError">;
|
|
735
|
+
readonly onResponse: _alepha_core43.HookDescriptor<"server:onResponse">;
|
|
736
|
+
}
|
|
737
|
+
//#endregion
|
|
738
|
+
//#region src/providers/features/ServerMultipartProvider.d.ts
|
|
1016
739
|
declare class ServerMultipartProvider {
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
740
|
+
protected readonly helper: ActionDescriptorHelper;
|
|
741
|
+
protected readonly alepha: Alepha;
|
|
742
|
+
readonly onRequest: _alepha_core47.HookDescriptor<"server:onRequest">;
|
|
743
|
+
readonly onSend: _alepha_core47.HookDescriptor<"server:onResponse">;
|
|
744
|
+
handleMultipartBodyFromNode(route: ServerRoute, stream: IncomingMessage): Promise<{
|
|
745
|
+
body: Record<string, any>;
|
|
746
|
+
cleanup: () => Promise<void>;
|
|
747
|
+
}>;
|
|
748
|
+
parseMultipart(req: IncomingMessage, config?: Omit<BusboyConfig, "headers">): Promise<MultipartResult>;
|
|
1026
749
|
}
|
|
1027
750
|
interface MultipartResult {
|
|
1028
|
-
|
|
1029
|
-
|
|
751
|
+
fields: Record<string, string | string[]>;
|
|
752
|
+
files: Record<string, HybridFile>;
|
|
1030
753
|
}
|
|
1031
754
|
interface HybridFile extends FileLike {
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
}
|
|
1039
|
-
|
|
755
|
+
cleanup(): Promise<void>;
|
|
756
|
+
_state: {
|
|
757
|
+
cleanup: boolean;
|
|
758
|
+
size: number;
|
|
759
|
+
tmpPath: string;
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
//#endregion
|
|
763
|
+
//#region src/providers/features/ServerNotReadyProvider.d.ts
|
|
1040
764
|
/**
|
|
1041
765
|
* On every request, this provider checks if the server is ready.
|
|
1042
766
|
*
|
|
@@ -1045,134 +769,139 @@ interface HybridFile extends FileLike {
|
|
|
1045
769
|
* The response also includes a `Retry-After` header indicating that the client should retry after 5 seconds.
|
|
1046
770
|
*/
|
|
1047
771
|
declare class ServerNotReadyProvider {
|
|
1048
|
-
|
|
1049
|
-
|
|
772
|
+
protected readonly alepha: Alepha;
|
|
773
|
+
readonly onRequest: _alepha_core49.HookDescriptor<"server:onRequest">;
|
|
1050
774
|
}
|
|
1051
|
-
|
|
775
|
+
//#endregion
|
|
776
|
+
//#region src/providers/features/ServerSecurityProvider.d.ts
|
|
1052
777
|
declare class ServerSecurityProvider {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
}
|
|
1061
|
-
|
|
778
|
+
protected readonly log: _alepha_core50.Logger;
|
|
779
|
+
protected readonly securityProvider: SecurityProvider;
|
|
780
|
+
protected readonly jwtProvider: JwtProvider;
|
|
781
|
+
protected readonly alepha: Alepha;
|
|
782
|
+
readonly onClientRequest: _alepha_core50.HookDescriptor<"client:onRequest">;
|
|
783
|
+
protected readonly onRequest: _alepha_core50.HookDescriptor<"server:onRequest">;
|
|
784
|
+
protected readonly onRoute: _alepha_core50.HookDescriptor<"server:onRoute">;
|
|
785
|
+
}
|
|
786
|
+
//#endregion
|
|
787
|
+
//#region src/providers/features/ServerTimingProvider.d.ts
|
|
1062
788
|
type TimingMap = Record<string, [number, number]>;
|
|
1063
789
|
declare class ServerTimingProvider {
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
790
|
+
protected readonly log: _alepha_core54.Logger;
|
|
791
|
+
protected readonly alepha: Alepha;
|
|
792
|
+
readonly onRequest: _alepha_core54.HookDescriptor<"server:onRequest">;
|
|
793
|
+
readonly onResponse: _alepha_core54.HookDescriptor<"server:onResponse">;
|
|
794
|
+
protected get handlerName(): string;
|
|
795
|
+
beginTiming(name: string): void;
|
|
796
|
+
endTiming(name: string): void;
|
|
797
|
+
protected setDuration(name: string, timing: TimingMap): void;
|
|
798
|
+
}
|
|
799
|
+
//#endregion
|
|
800
|
+
//#region src/providers/platforms/NodeHttpServerProvider.d.ts
|
|
801
|
+
declare const envSchema$1: _alepha_core103.TObject<{
|
|
802
|
+
SERVER_PORT: _sinclair_typebox101.TNumber;
|
|
803
|
+
SERVER_HOST: _sinclair_typebox101.TString;
|
|
1077
804
|
}>;
|
|
1078
|
-
declare module "
|
|
1079
|
-
|
|
1080
|
-
}
|
|
805
|
+
declare module "alepha/core" {
|
|
806
|
+
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
1081
807
|
}
|
|
1082
808
|
declare class NodeHttpServerProvider implements ServerProvider {
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
809
|
+
protected readonly alepha: Alepha;
|
|
810
|
+
protected readonly log: _alepha_core103.Logger;
|
|
811
|
+
protected readonly env: {
|
|
812
|
+
SERVER_PORT: number;
|
|
813
|
+
SERVER_HOST: string;
|
|
814
|
+
};
|
|
815
|
+
protected readonly router: ServerRouterProvider;
|
|
816
|
+
protected readonly server: http106.Server<typeof IncomingMessage, typeof ServerResponse$1>;
|
|
817
|
+
handle(req: IncomingMessage, res: ServerResponse$1): Promise<number | void>;
|
|
818
|
+
createRouterRequest(req: IncomingMessage, res: ServerResponse$1, params?: Record<string, string>): ServerRawRequest;
|
|
819
|
+
getProtocol(req: IncomingMessage): "http" | "https";
|
|
820
|
+
shouldHaveBody(method: string): boolean;
|
|
821
|
+
get hostname(): string;
|
|
822
|
+
readonly start: _alepha_core103.HookDescriptor<"start">;
|
|
823
|
+
protected readonly stop: _alepha_core103.HookDescriptor<"stop">;
|
|
824
|
+
protected listen(): Promise<void>;
|
|
825
|
+
protected close(): Promise<void>;
|
|
826
|
+
}
|
|
827
|
+
//#endregion
|
|
828
|
+
//#region src/schemas/errorSchema.d.ts
|
|
829
|
+
declare const errorSchema: _sinclair_typebox91.TObject<{
|
|
830
|
+
error: _sinclair_typebox91.TString;
|
|
831
|
+
status: _sinclair_typebox91.TNumber;
|
|
832
|
+
message: _sinclair_typebox91.TString;
|
|
833
|
+
details: _sinclair_typebox91.TOptional<_sinclair_typebox91.TString>;
|
|
834
|
+
cause: _sinclair_typebox91.TOptional<_sinclair_typebox91.TObject<{
|
|
835
|
+
name: _sinclair_typebox91.TString;
|
|
836
|
+
message: _sinclair_typebox91.TString;
|
|
837
|
+
}>>;
|
|
1111
838
|
}>;
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
type Ok = Static$1<typeof okSchema>;
|
|
1119
|
-
|
|
1120
|
-
declare const envSchema: _alepha_core.TObject<{
|
|
1121
|
-
SERVER_LINKS_ENABLED: TBoolean;
|
|
1122
|
-
SERVER_HEALTH_ENABLED: TBoolean;
|
|
839
|
+
//#endregion
|
|
840
|
+
//#region src/schemas/okSchema.d.ts
|
|
841
|
+
declare const okSchema: _sinclair_typebox7.TObject<{
|
|
842
|
+
ok: _sinclair_typebox7.TBoolean;
|
|
843
|
+
id: _sinclair_typebox7.TOptional<_sinclair_typebox7.TUnion<[_sinclair_typebox7.TString, _sinclair_typebox7.TInteger]>>;
|
|
844
|
+
count: _sinclair_typebox7.TOptional<_sinclair_typebox7.TNumber>;
|
|
1123
845
|
}>;
|
|
846
|
+
type Ok = Static<typeof okSchema>;
|
|
847
|
+
//#endregion
|
|
848
|
+
//#region src/index.d.ts
|
|
1124
849
|
declare module "@alepha/core" {
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
850
|
+
interface Hooks {
|
|
851
|
+
"server:onRoute": {
|
|
852
|
+
route: ServerRoute;
|
|
853
|
+
};
|
|
854
|
+
"server:onRequest": {
|
|
855
|
+
route: ServerRoute;
|
|
856
|
+
request: ServerRequest;
|
|
857
|
+
};
|
|
858
|
+
"server:onError": {
|
|
859
|
+
route: ServerRoute;
|
|
860
|
+
request: ServerRequest;
|
|
861
|
+
error: Error;
|
|
862
|
+
};
|
|
863
|
+
"server:onSend": {
|
|
864
|
+
route: ServerRoute;
|
|
865
|
+
request: ServerRequest;
|
|
866
|
+
};
|
|
867
|
+
"server:onResponse": {
|
|
868
|
+
route: ServerRoute;
|
|
869
|
+
request: ServerRequest;
|
|
870
|
+
response: ServerResponse;
|
|
871
|
+
};
|
|
872
|
+
"client:onRequest": {
|
|
873
|
+
route: HttpClientLink;
|
|
874
|
+
config: ServerRequestConfigEntry;
|
|
875
|
+
options: ClientRequestOptions;
|
|
876
|
+
headers: Record<string, string>;
|
|
877
|
+
request: RequestInit;
|
|
878
|
+
};
|
|
879
|
+
"client:beforeFetch": {
|
|
880
|
+
url: string;
|
|
881
|
+
options: FetchRunOptions;
|
|
882
|
+
request: RequestInit;
|
|
883
|
+
};
|
|
884
|
+
"client:onError": {
|
|
885
|
+
route?: HttpClientLink;
|
|
886
|
+
error: HttpError;
|
|
887
|
+
};
|
|
888
|
+
}
|
|
1164
889
|
}
|
|
890
|
+
declare const envSchema: _alepha_core3.TObject<{
|
|
891
|
+
SERVER_LINKS_ENABLED: _sinclair_typebox1.TBoolean;
|
|
892
|
+
SERVER_HEALTH_ENABLED: _sinclair_typebox1.TBoolean;
|
|
893
|
+
}>;
|
|
1165
894
|
declare module "@alepha/core" {
|
|
1166
|
-
|
|
1167
|
-
}
|
|
895
|
+
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
1168
896
|
}
|
|
1169
897
|
declare class AlephaServer implements Module {
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
export { $action, $client, $proxy, $remote, $route,
|
|
898
|
+
protected readonly env: {
|
|
899
|
+
SERVER_LINKS_ENABLED: boolean;
|
|
900
|
+
SERVER_HEALTH_ENABLED: boolean;
|
|
901
|
+
};
|
|
902
|
+
readonly name = "alepha.server";
|
|
903
|
+
readonly $services: (alepha: Alepha) => void;
|
|
904
|
+
}
|
|
905
|
+
//#endregion
|
|
906
|
+
export { $action, $client, $proxy, $remote, $route, ActionDescriptor, ActionDescriptorOptions, AlephaServer, ApiLink, ApiLinksResponse, BadRequestError, ClientRequestEntry, ClientRequestEntryContainer, ClientRequestOptions, ClientRequestResponse, ClientScope, ConflictError, FetchFactoryAdditionalOptions, FetchLinkArgs, FetchResponse, FetchRunOptions, ForbiddenError, HttpClient, HttpClientLink, HttpClientPendingRequests, HttpError, HttpErrorLike, HttpVirtualClient, KIND, NodeHttpServerProvider, NotFoundError, Ok, ProxyDescriptor, ProxyDescriptorOptions, ProxyDescriptorProvider, RemoteDescriptor, RemoteDescriptorOptions, RemoteDescriptorProvider, RequestConfigSchema, ResponseBodyType, ResponseKind, RouteDescriptor, RouteDescriptorOptions, RouteMethod, ServerActionDescriptorProvider, ServerHandler, ServerHealthProvider, ServerLinksProvider, ServerLoggerProvider, ServerMiddlewareHandler, ServerMultipartProvider, ServerNotReadyProvider, ServerProvider, ServerRawRequest, ServerRemote, ServerReply, ServerRequest, ServerRequestConfig, ServerRequestConfigEntry, ServerResponse, ServerResponseBody, ServerRoute, ServerRouteAction, ServerRouteSecure, ServerRouteWithHandler, ServerRouterProvider, ServerSecurityProvider, ServerTimingProvider, UnauthorizedError, ValidationError, apiLinkSchema, apiLinksResponseSchema, errorNameByStatus, errorSchema, isHttpError, isServerAction, okSchema, routeMethods };
|
|
907
|
+
//# sourceMappingURL=index.d.ts.map
|