alepha 0.8.1 → 0.9.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 +47 -17
- package/batch.d.ts +83 -117
- package/bucket.cjs +8 -0
- package/bucket.d.ts +194 -0
- package/bucket.js +1 -0
- package/cache/redis.d.ts +14 -14
- package/cache.d.ts +101 -238
- package/command.d.ts +79 -70
- package/core.d.ts +1012 -855
- package/datetime.d.ts +90 -116
- package/file.d.ts +23 -13
- package/lock/redis.d.ts +11 -11
- package/lock.d.ts +121 -111
- package/package.json +54 -40
- package/postgres.d.ts +218 -393
- package/queue/redis.d.ts +13 -13
- package/queue.d.ts +84 -198
- package/react/auth.d.ts +47 -53
- package/react/head.d.ts +4 -7
- package/react.d.ts +48 -183
- package/redis.d.ts +31 -16
- package/retry.d.ts +70 -59
- package/router.d.ts +9 -9
- package/scheduler.d.ts +54 -93
- package/security.d.ts +95 -276
- package/server/cache.d.ts +22 -28
- package/server/compress.d.ts +16 -7
- package/server/cookies.d.ts +65 -233
- package/server/cors.d.ts +15 -13
- package/server/health.d.ts +23 -23
- package/server/helmet.d.ts +17 -18
- package/server/links.d.ts +108 -88
- package/server/metrics.d.ts +25 -21
- package/server/multipart.d.ts +12 -14
- package/server/proxy.d.ts +22 -17
- package/server/security.cjs +8 -0
- package/server/security.d.ts +92 -0
- package/server/security.js +1 -0
- package/server/static.d.ts +63 -67
- package/server/swagger.d.ts +73 -62
- package/server.d.ts +253 -448
- package/topic/redis.d.ts +25 -24
- package/topic.d.ts +68 -115
package/server/static.d.ts
CHANGED
|
@@ -1,91 +1,89 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _alepha_core0$1 from "alepha";
|
|
2
|
+
import * as _alepha_core0 from "alepha";
|
|
3
|
+
import { Alepha, Descriptor, KIND, Logger } from "alepha";
|
|
2
4
|
import { ServerHandler, ServerRouterProvider } from "alepha/server";
|
|
3
5
|
import { DateTimeProvider, DurationLike } from "alepha/datetime";
|
|
4
6
|
|
|
5
7
|
//#region src/descriptors/$serve.d.ts
|
|
6
|
-
declare const KEY = "SERVE";
|
|
7
8
|
/**
|
|
8
|
-
* Create a new static file handler.
|
|
9
|
-
*/
|
|
9
|
+
* Create a new static file handler.
|
|
10
|
+
*/
|
|
10
11
|
declare const $serve: {
|
|
11
12
|
(options?: ServeDescriptorOptions): ServeDescriptor;
|
|
12
|
-
[KIND]:
|
|
13
|
+
[KIND]: typeof ServeDescriptor;
|
|
13
14
|
};
|
|
14
15
|
interface ServeDescriptorOptions {
|
|
15
16
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
* Prefix for the served path.
|
|
18
|
+
*
|
|
19
|
+
* @default "/"
|
|
20
|
+
*/
|
|
20
21
|
path?: string;
|
|
21
22
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
* Path to the directory to serve.
|
|
24
|
+
*
|
|
25
|
+
* @default process.cwd()
|
|
26
|
+
*/
|
|
26
27
|
root?: string;
|
|
27
28
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
* If true, descriptor will be ignored.
|
|
30
|
+
*
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
32
33
|
disabled?: boolean;
|
|
33
34
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
* Whether to keep dot files (e.g. `.gitignore`, `.env`) in the served directory.
|
|
36
|
+
*
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
38
39
|
ignoreDotEnvFiles?: boolean;
|
|
39
40
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
* Whether to use the index.html file when the path is a directory.
|
|
42
|
+
*
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
44
45
|
indexFallback?: boolean;
|
|
45
46
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
* Force all requests "not found" to be served with the index.html file.
|
|
48
|
+
* This is useful for single-page applications (SPAs) that use client-side only routing.
|
|
49
|
+
*/
|
|
49
50
|
historyApiFallback?: boolean;
|
|
50
51
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
* Optional name of the descriptor.
|
|
53
|
+
* This is used for logging and debugging purposes.
|
|
54
|
+
*
|
|
55
|
+
* @default Key name.
|
|
56
|
+
*/
|
|
56
57
|
name?: string;
|
|
57
58
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
* Whether to use cache control headers.
|
|
60
|
+
*
|
|
61
|
+
* @default {}
|
|
62
|
+
*/
|
|
62
63
|
cacheControl?: Partial<CacheControlOptions> | false;
|
|
63
64
|
}
|
|
64
65
|
interface CacheControlOptions {
|
|
65
66
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
* Whether to use cache control headers.
|
|
68
|
+
*
|
|
69
|
+
* @default [.js, .css]
|
|
70
|
+
*/
|
|
70
71
|
fileTypes: string[];
|
|
71
72
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
* The maximum age of the cache in seconds.
|
|
74
|
+
*
|
|
75
|
+
* @default 60 * 60 * 24 * 2 // 2 days
|
|
76
|
+
*/
|
|
76
77
|
maxAge: DurationLike;
|
|
77
78
|
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
* Whether to use immutable cache control headers.
|
|
80
|
+
*
|
|
81
|
+
* @default true
|
|
82
|
+
*/
|
|
82
83
|
immutable: boolean;
|
|
83
84
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
[OPTIONS]: ServeDescriptorOptions;
|
|
87
|
-
list(): string[];
|
|
88
|
-
}
|
|
85
|
+
declare class ServeDescriptor extends Descriptor<ServeDescriptorOptions> {}
|
|
86
|
+
//# sourceMappingURL=$serve.d.ts.map
|
|
89
87
|
//#endregion
|
|
90
88
|
//#region src/providers/ServerStaticProvider.d.ts
|
|
91
89
|
declare class ServerStaticProvider {
|
|
@@ -94,9 +92,8 @@ declare class ServerStaticProvider {
|
|
|
94
92
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
95
93
|
protected readonly log: Logger;
|
|
96
94
|
protected readonly directories: ServeDirectory[];
|
|
97
|
-
protected readonly configure: HookDescriptor<"configure">;
|
|
98
|
-
|
|
99
|
-
serve(options: ServeDescriptorOptions): Promise<void>;
|
|
95
|
+
protected readonly configure: _alepha_core0$1.HookDescriptor<"configure">;
|
|
96
|
+
createStaticServer(options: ServeDescriptorOptions): Promise<void>;
|
|
100
97
|
createFileHandler(filepath: string, options: ServeDescriptorOptions): Promise<ServerHandler>;
|
|
101
98
|
protected getCacheFileTypes(): string[];
|
|
102
99
|
protected getCacheControl(filename: string, options: ServeDescriptorOptions): {
|
|
@@ -109,19 +106,18 @@ interface ServeDirectory {
|
|
|
109
106
|
options: ServeDescriptorOptions;
|
|
110
107
|
files: string[];
|
|
111
108
|
}
|
|
109
|
+
//# sourceMappingURL=ServerStaticProvider.d.ts.map
|
|
112
110
|
//#endregion
|
|
113
111
|
//#region src/index.d.ts
|
|
114
|
-
// ---------------------------------------------------------------------------------------------------------------------
|
|
115
112
|
/**
|
|
116
|
-
* Create static file server with `$static()`.
|
|
117
|
-
*
|
|
118
|
-
* @see {@link ServerStaticProvider}
|
|
119
|
-
* @module alepha.server.static
|
|
120
|
-
*/
|
|
121
|
-
declare
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
113
|
+
* Create static file server with `$static()`.
|
|
114
|
+
*
|
|
115
|
+
* @see {@link ServerStaticProvider}
|
|
116
|
+
* @module alepha.server.static
|
|
117
|
+
*/
|
|
118
|
+
declare const AlephaServerStatic: _alepha_core0.ModuleDescriptor;
|
|
119
|
+
//# sourceMappingURL=index.d.ts.map
|
|
120
|
+
|
|
125
121
|
//#endregion
|
|
126
122
|
export { $serve, AlephaServerStatic, CacheControlOptions, ServeDescriptor, ServeDescriptorOptions, ServeDirectory, ServerStaticProvider };
|
|
127
123
|
//# sourceMappingURL=index.d.ts.map
|
package/server/swagger.d.ts
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as _alepha_core0$1 from "alepha";
|
|
2
|
+
import * as _alepha_core0 from "alepha";
|
|
3
|
+
import { Alepha, Descriptor, KIND, TObject } from "alepha";
|
|
4
|
+
import { ActionDescriptor, RequestConfigSchema, ServerRouterProvider } from "alepha/server";
|
|
3
5
|
import { ServerStaticProvider } from "alepha/server/static";
|
|
4
6
|
import { OpenAPIV3 } from "openapi-types";
|
|
5
7
|
|
|
6
8
|
//#region src/descriptors/$swagger.d.ts
|
|
7
9
|
/**
|
|
8
|
-
* Create a new OpenAPI.
|
|
9
|
-
*/
|
|
10
|
+
* Create a new OpenAPI.
|
|
11
|
+
*/
|
|
10
12
|
declare const $swagger: {
|
|
11
13
|
(options: SwaggerDescriptorOptions): SwaggerDescriptor;
|
|
12
|
-
[KIND]:
|
|
14
|
+
[KIND]: typeof SwaggerDescriptor;
|
|
13
15
|
};
|
|
14
16
|
interface SwaggerDescriptorOptions {
|
|
15
17
|
info: OpenAPIV3.InfoObject;
|
|
16
18
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
* @default: "/docs"
|
|
20
|
+
*/
|
|
19
21
|
prefix?: string;
|
|
20
22
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
* If true, docs will be disabled.
|
|
24
|
+
*/
|
|
23
25
|
disabled?: boolean;
|
|
24
26
|
excludeTags?: string[];
|
|
25
27
|
ui?: boolean | SwaggerUiOptions;
|
|
@@ -29,95 +31,104 @@ interface SwaggerUiOptions {
|
|
|
29
31
|
root?: string;
|
|
30
32
|
initOAuth?: {
|
|
31
33
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
* Default clientId.
|
|
35
|
+
*/
|
|
34
36
|
clientId?: string;
|
|
35
37
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
* realm query parameter (for oauth1) added to authorizationUrl and tokenUrl.
|
|
39
|
+
*/
|
|
38
40
|
realm?: string;
|
|
39
41
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
* application name, displayed in authorization popup.
|
|
43
|
+
*/
|
|
42
44
|
appName?: string;
|
|
43
45
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
* scope separator for passing scopes, encoded before calling, default
|
|
47
|
+
* value is a space (encoded value %20).
|
|
48
|
+
*
|
|
49
|
+
* @default ' '
|
|
50
|
+
*/
|
|
49
51
|
scopeSeparator?: string;
|
|
50
52
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
* string array or scope separator (i.e. space) separated string of
|
|
54
|
+
* initially selected oauth scopes
|
|
55
|
+
*
|
|
56
|
+
* @default []
|
|
57
|
+
*/
|
|
56
58
|
scopes?: string | string[];
|
|
57
59
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
* Additional query parameters added to authorizationUrl and tokenUrl.
|
|
61
|
+
* MUST be an object
|
|
62
|
+
*/
|
|
61
63
|
additionalQueryStringParams?: {
|
|
62
64
|
[key: string]: any;
|
|
63
65
|
};
|
|
64
66
|
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
* Only activated for the accessCode flow. During the authorization_code
|
|
68
|
+
* request to the tokenUrl, pass the Client Password using the HTTP Basic
|
|
69
|
+
* Authentication scheme (Authorization header with Basic
|
|
70
|
+
* base64encode(client_id + client_secret)).
|
|
71
|
+
*
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
72
74
|
useBasicAuthenticationWithAccessCodeGrant?: boolean;
|
|
73
75
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
* Only applies to Authorization Code flows. Proof Key for Code Exchange
|
|
77
|
+
* brings enhanced security for OAuth public clients.
|
|
78
|
+
*
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
79
81
|
usePkceWithAuthorizationCodeGrant?: boolean;
|
|
80
82
|
};
|
|
81
83
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
[OPTIONS]: SwaggerDescriptorOptions;
|
|
85
|
-
json(): OpenAPIV3.Document;
|
|
86
|
-
}
|
|
84
|
+
declare class SwaggerDescriptor extends Descriptor<SwaggerDescriptorOptions> {}
|
|
85
|
+
//# sourceMappingURL=$swagger.d.ts.map
|
|
87
86
|
//#endregion
|
|
88
87
|
//#region src/ServerSwaggerProvider.d.ts
|
|
89
88
|
declare class ServerSwaggerProvider {
|
|
90
|
-
protected readonly serverActionProvider: ServerActionDescriptorProvider;
|
|
91
89
|
protected readonly serverStaticProvider: ServerStaticProvider;
|
|
92
90
|
protected readonly serverRouterProvider: ServerRouterProvider;
|
|
93
91
|
protected readonly alepha: Alepha;
|
|
94
|
-
|
|
95
|
-
protected
|
|
92
|
+
json?: OpenAPIV3.Document;
|
|
93
|
+
protected readonly configure: _alepha_core0$1.HookDescriptor<"configure">;
|
|
94
|
+
createSwagger(options: SwaggerDescriptorOptions): Promise<OpenAPIV3.Document | undefined>;
|
|
95
|
+
protected configureOpenApi(actions: ActionDescriptor<RequestConfigSchema>[], doc: SwaggerDescriptorOptions): OpenAPIV3.Document;
|
|
96
96
|
isBodyMultipart(schema: TObject): boolean;
|
|
97
97
|
replacePathParams(url: string): string;
|
|
98
|
-
getResponseSchema(route:
|
|
98
|
+
getResponseSchema(route: ActionDescriptor<RequestConfigSchema>): {
|
|
99
99
|
type?: string;
|
|
100
100
|
schema?: any;
|
|
101
101
|
status: number;
|
|
102
102
|
} | undefined;
|
|
103
|
-
protected configureSwaggerApi(prefix: string, json: OpenAPIV3.Document):
|
|
103
|
+
protected configureSwaggerApi(prefix: string, json: OpenAPIV3.Document): void;
|
|
104
104
|
protected configureSwaggerUi(prefix: string, options: SwaggerDescriptorOptions): Promise<void>;
|
|
105
105
|
}
|
|
106
|
+
//# sourceMappingURL=ServerSwaggerProvider.d.ts.map
|
|
106
107
|
//#endregion
|
|
107
108
|
//#region src/index.d.ts
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
*
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
*
|
|
116
|
-
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
readonly $services: (alepha: Alepha) => Alepha;
|
|
109
|
+
declare module "alepha/server" {
|
|
110
|
+
interface ActionDescriptorOptions<TConfig extends RequestConfigSchema> {
|
|
111
|
+
/**
|
|
112
|
+
* Short description of the route.
|
|
113
|
+
*/
|
|
114
|
+
summary?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Don't include this action in the Swagger documentation.
|
|
117
|
+
*/
|
|
118
|
+
hide?: boolean;
|
|
119
|
+
}
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Plugin for Alepha Server that provides Swagger documentation capabilities.
|
|
123
|
+
* It generates OpenAPI v3 documentation for the server's endpoints ($action).
|
|
124
|
+
* It also provides a Swagger UI for interactive API documentation.
|
|
125
|
+
*
|
|
126
|
+
* @see {@link ServerSwaggerProvider}
|
|
127
|
+
* @module alepha.server.swagger
|
|
128
|
+
*/
|
|
129
|
+
declare const AlephaServerSwagger: _alepha_core0.ModuleDescriptor;
|
|
130
|
+
//# sourceMappingURL=index.d.ts.map
|
|
131
|
+
|
|
121
132
|
//#endregion
|
|
122
133
|
export { $swagger, AlephaServerSwagger, ServerSwaggerProvider, SwaggerDescriptor, SwaggerDescriptorOptions, SwaggerUiOptions };
|
|
123
134
|
//# sourceMappingURL=index.d.ts.map
|