alepha 0.7.7 → 0.8.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/LICENSE +21 -21
- package/README.md +7 -34
- package/batch.cjs +8 -0
- package/batch.d.ts +147 -0
- package/batch.js +1 -0
- package/cache/redis.d.ts +13 -18
- package/cache.d.ts +183 -119
- package/command.cjs +8 -0
- package/command.d.ts +152 -0
- package/command.js +1 -0
- package/core.d.ts +846 -838
- package/datetime.d.ts +78 -78
- package/file.cjs +8 -0
- package/file.d.ts +46 -0
- package/file.js +1 -0
- package/lock/redis.d.ts +10 -12
- package/lock.d.ts +73 -80
- package/package.json +86 -34
- package/postgres.d.ts +348 -170
- package/queue/redis.d.ts +13 -13
- package/queue.d.ts +107 -18
- package/react/auth.d.ts +22 -16
- package/react/head.d.ts +10 -4
- package/react.d.ts +206 -49
- package/redis.d.ts +23 -27
- package/retry.d.ts +75 -54
- package/router.cjs +8 -0
- package/router.d.ts +45 -0
- package/router.js +1 -0
- package/scheduler.d.ts +15 -16
- package/security.d.ts +229 -40
- package/server/cache.d.ts +7 -8
- package/server/compress.cjs +8 -0
- package/server/compress.d.ts +26 -0
- package/server/compress.js +1 -0
- package/server/cookies.d.ts +249 -18
- package/server/cors.d.ts +7 -3
- package/server/health.d.ts +21 -24
- package/server/helmet.cjs +8 -0
- package/server/helmet.d.ts +70 -0
- package/server/helmet.js +1 -0
- package/server/links.d.ts +87 -93
- package/server/metrics.cjs +8 -0
- package/server/metrics.d.ts +35 -0
- package/server/metrics.js +1 -0
- package/server/multipart.cjs +8 -0
- package/server/multipart.d.ts +46 -0
- package/server/multipart.js +1 -0
- package/server/proxy.d.ts +11 -11
- package/server/static.d.ts +70 -55
- package/server/swagger.d.ts +55 -54
- package/server.d.ts +273 -123
- package/topic/redis.d.ts +22 -23
- package/topic.d.ts +26 -19
- package/vite.d.ts +59 -36
package/server/swagger.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ServerStaticProvider } from "@alepha/server-static";
|
|
1
|
+
import { Alepha, HookDescriptor, KIND, Module, OPTIONS, TObject } from "alepha";
|
|
2
|
+
import { ServerActionDescriptorProvider, ServerRouteAction, ServerRouterProvider } from "alepha/server";
|
|
3
|
+
import { ServerStaticProvider } from "alepha/server/static";
|
|
5
4
|
import { OpenAPIV3 } from "openapi-types";
|
|
6
5
|
|
|
7
6
|
//#region src/descriptors/$swagger.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Create a new OpenAPI.
|
|
9
|
+
*/
|
|
10
|
+
declare const $swagger: {
|
|
11
|
+
(options: SwaggerDescriptorOptions): SwaggerDescriptor;
|
|
12
|
+
[KIND]: string;
|
|
13
|
+
};
|
|
8
14
|
interface SwaggerDescriptorOptions {
|
|
9
15
|
info: OpenAPIV3.InfoObject;
|
|
10
16
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
* @default: "/docs"
|
|
18
|
+
*/
|
|
13
19
|
prefix?: string;
|
|
14
20
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
* If true, docs will be disabled.
|
|
22
|
+
*/
|
|
17
23
|
disabled?: boolean;
|
|
18
24
|
excludeTags?: string[];
|
|
19
25
|
ui?: boolean | SwaggerUiOptions;
|
|
@@ -23,53 +29,53 @@ interface SwaggerUiOptions {
|
|
|
23
29
|
root?: string;
|
|
24
30
|
initOAuth?: {
|
|
25
31
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
* Default clientId.
|
|
33
|
+
*/
|
|
28
34
|
clientId?: string;
|
|
29
35
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
* realm query parameter (for oauth1) added to authorizationUrl and tokenUrl.
|
|
37
|
+
*/
|
|
32
38
|
realm?: string;
|
|
33
39
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
* application name, displayed in authorization popup.
|
|
41
|
+
*/
|
|
36
42
|
appName?: string;
|
|
37
43
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
* scope separator for passing scopes, encoded before calling, default
|
|
45
|
+
* value is a space (encoded value %20).
|
|
46
|
+
*
|
|
47
|
+
* @default ' '
|
|
48
|
+
*/
|
|
43
49
|
scopeSeparator?: string;
|
|
44
50
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
* string array or scope separator (i.e. space) separated string of
|
|
52
|
+
* initially selected oauth scopes
|
|
53
|
+
*
|
|
54
|
+
* @default []
|
|
55
|
+
*/
|
|
50
56
|
scopes?: string | string[];
|
|
51
57
|
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
* Additional query parameters added to authorizationUrl and tokenUrl.
|
|
59
|
+
* MUST be an object
|
|
60
|
+
*/
|
|
55
61
|
additionalQueryStringParams?: {
|
|
56
62
|
[key: string]: any;
|
|
57
63
|
};
|
|
58
64
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
* Only activated for the accessCode flow. During the authorization_code
|
|
66
|
+
* request to the tokenUrl, pass the Client Password using the HTTP Basic
|
|
67
|
+
* Authentication scheme (Authorization header with Basic
|
|
68
|
+
* base64encode(client_id + client_secret)).
|
|
69
|
+
*
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
66
72
|
useBasicAuthenticationWithAccessCodeGrant?: boolean;
|
|
67
73
|
/**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
* Only applies to Authorization Code flows. Proof Key for Code Exchange
|
|
75
|
+
* brings enhanced security for OAuth public clients.
|
|
76
|
+
*
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
73
79
|
usePkceWithAuthorizationCodeGrant?: boolean;
|
|
74
80
|
};
|
|
75
81
|
}
|
|
@@ -78,10 +84,6 @@ interface SwaggerDescriptor {
|
|
|
78
84
|
[OPTIONS]: SwaggerDescriptorOptions;
|
|
79
85
|
json(): OpenAPIV3.Document;
|
|
80
86
|
}
|
|
81
|
-
declare const $swagger: {
|
|
82
|
-
(options: SwaggerDescriptorOptions): SwaggerDescriptor;
|
|
83
|
-
[KIND]: string;
|
|
84
|
-
};
|
|
85
87
|
//#endregion
|
|
86
88
|
//#region src/ServerSwaggerProvider.d.ts
|
|
87
89
|
declare class ServerSwaggerProvider {
|
|
@@ -89,8 +91,8 @@ declare class ServerSwaggerProvider {
|
|
|
89
91
|
protected readonly serverStaticProvider: ServerStaticProvider;
|
|
90
92
|
protected readonly serverRouterProvider: ServerRouterProvider;
|
|
91
93
|
protected readonly alepha: Alepha;
|
|
92
|
-
protected readonly configure:
|
|
93
|
-
protected configureOpenApi(doc: SwaggerDescriptorOptions):
|
|
94
|
+
protected readonly configure: HookDescriptor<"configure">;
|
|
95
|
+
protected configureOpenApi(doc: SwaggerDescriptorOptions): OpenAPIV3.Document;
|
|
94
96
|
isBodyMultipart(schema: TObject): boolean;
|
|
95
97
|
replacePathParams(url: string): string;
|
|
96
98
|
getResponseSchema(route: ServerRouteAction): {
|
|
@@ -103,16 +105,15 @@ declare class ServerSwaggerProvider {
|
|
|
103
105
|
}
|
|
104
106
|
//#endregion
|
|
105
107
|
//#region src/index.d.ts
|
|
108
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
106
109
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
* @module alepha.server.swagger
|
|
115
|
-
*/
|
|
110
|
+
* Plugin for Alepha Server that provides Swagger documentation capabilities.
|
|
111
|
+
* It generates OpenAPI v3 documentation for the server's endpoints ($action).
|
|
112
|
+
* It also provides a Swagger UI for interactive API documentation.
|
|
113
|
+
*
|
|
114
|
+
* @see {@link ServerSwaggerProvider}
|
|
115
|
+
* @module alepha.server.swagger
|
|
116
|
+
*/
|
|
116
117
|
declare class AlephaServerSwagger implements Module {
|
|
117
118
|
readonly name = "alepha.server.swagger";
|
|
118
119
|
readonly $services: (alepha: Alepha) => Alepha;
|