alepha 0.7.5 → 0.7.7
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/cache/redis.cjs +4 -8
- package/cache/redis.d.ts +28 -89
- package/cache/redis.js +1 -1
- package/cache.cjs +4 -8
- package/cache.d.ts +189 -265
- package/cache.js +1 -1
- package/core.cjs +4 -8
- package/core.d.ts +951 -929
- package/core.js +1 -1
- package/datetime.cjs +4 -8
- package/datetime.d.ts +151 -146
- package/datetime.js +1 -1
- package/lock/redis.cjs +7 -49
- package/lock/redis.d.ts +15 -12
- 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 +105 -39
- package/postgres.cjs +4 -8
- package/postgres.d.ts +1410 -4433
- 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 +161 -282
- package/react/auth.js +1 -1
- package/react/head.cjs +8 -0
- package/react/head.d.ts +86 -0
- package/react/head.js +1 -0
- package/react.cjs +4 -8
- package/react.d.ts +468 -559
- 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 +124 -182
- package/scheduler.js +1 -1
- package/security.cjs +4 -8
- package/security.d.ts +459 -595
- package/security.js +1 -1
- package/server/cache.cjs +4 -8
- package/server/cache.d.ts +43 -40
- package/server/cache.js +1 -1
- package/server/cookies.cjs +4 -8
- package/server/cookies.d.ts +49 -41
- package/server/cookies.js +1 -1
- package/server/cors.cjs +8 -0
- package/server/cors.d.ts +25 -0
- package/server/cors.js +1 -0
- package/server/health.cjs +8 -0
- package/server/health.d.ts +42 -0
- package/server/health.js +1 -0
- package/server/links.cjs +8 -0
- package/server/links.d.ts +188 -0
- package/server/links.js +1 -0
- package/server/proxy.cjs +8 -0
- package/server/proxy.d.ts +41 -0
- package/server/proxy.js +1 -0
- 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 +96 -92
- package/server/swagger.js +1 -1
- package/server.cjs +4 -8
- package/server.d.ts +602 -1087
- 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 +161 -169
- package/topic.js +1 -1
- package/vite.cjs +4 -8
- package/vite.d.ts +89 -82
- package/vite.js +1 -1
- 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/static.d.ts
CHANGED
|
@@ -1,109 +1,112 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { KIND, OPTIONS
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import * as _alepha_core0 from "@alepha/core";
|
|
2
|
+
import { Alepha, KIND, OPTIONS } from "@alepha/core";
|
|
3
|
+
import { DateTimeProvider, DurationLike } from "@alepha/datetime";
|
|
4
|
+
import { ServerHandler, ServerRouterProvider } from "@alepha/server";
|
|
5
5
|
|
|
6
|
+
//#region src/descriptors/$serve.d.ts
|
|
6
7
|
declare const KEY = "SERVE";
|
|
7
8
|
interface ServeDescriptorOptions {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Prefix for the served path.
|
|
11
|
+
*
|
|
12
|
+
* @default "/"
|
|
13
|
+
*/
|
|
14
|
+
path?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Path to the directory to serve.
|
|
17
|
+
*
|
|
18
|
+
* @default process.cwd()
|
|
19
|
+
*/
|
|
20
|
+
root?: string;
|
|
21
|
+
/**
|
|
22
|
+
* If true, descriptor will be ignored.
|
|
23
|
+
*
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to keep dot files (e.g. `.gitignore`, `.env`) in the served directory.
|
|
29
|
+
*
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
ignoreDotEnvFiles?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to use the index.html file when the path is a directory.
|
|
35
|
+
*
|
|
36
|
+
* @default true
|
|
37
|
+
*/
|
|
38
|
+
indexFallback?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Force all requests "not found" to be served with the index.html file.
|
|
41
|
+
* This is useful for single-page applications (SPAs) that use client-side only routing.
|
|
42
|
+
*/
|
|
43
|
+
historyApiFallback?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Optional name of the descriptor.
|
|
46
|
+
* This is used for logging and debugging purposes.
|
|
47
|
+
*
|
|
48
|
+
* @default Key name.
|
|
49
|
+
*/
|
|
50
|
+
name?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Whether to use cache control headers.
|
|
53
|
+
*
|
|
54
|
+
* @default {}
|
|
55
|
+
*/
|
|
56
|
+
cacheControl?: Partial<CacheControlOptions> | false;
|
|
56
57
|
}
|
|
57
58
|
interface CacheControlOptions {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Whether to use cache control headers.
|
|
61
|
+
*
|
|
62
|
+
* @default [.js, .css]
|
|
63
|
+
*/
|
|
64
|
+
fileTypes: string[];
|
|
65
|
+
/**
|
|
66
|
+
* The maximum age of the cache in seconds.
|
|
67
|
+
*
|
|
68
|
+
* @default 60 * 60 * 24 * 2 // 2 days
|
|
69
|
+
*/
|
|
70
|
+
maxAge: DurationLike;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to use immutable cache control headers.
|
|
73
|
+
*
|
|
74
|
+
* @default true
|
|
75
|
+
*/
|
|
76
|
+
immutable: boolean;
|
|
76
77
|
}
|
|
77
78
|
interface ServeDescriptor {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
[KIND]: typeof KEY;
|
|
80
|
+
[OPTIONS]: ServeDescriptorOptions;
|
|
81
|
+
list(): string[];
|
|
81
82
|
}
|
|
82
83
|
declare const $serve: {
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
(options?: ServeDescriptorOptions): ServeDescriptor;
|
|
85
|
+
[KIND]: string;
|
|
85
86
|
};
|
|
86
|
-
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/providers/ServerStaticProvider.d.ts
|
|
87
89
|
declare class ServerStaticProvider {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
90
|
+
protected readonly alepha: Alepha;
|
|
91
|
+
protected readonly routerProvider: ServerRouterProvider;
|
|
92
|
+
protected readonly dateTimeProvider: DateTimeProvider;
|
|
93
|
+
protected readonly log: _alepha_core0.Logger;
|
|
94
|
+
protected readonly directories: ServeDirectory[];
|
|
95
|
+
protected readonly configure: _alepha_core0.HookDescriptor<"configure">;
|
|
96
|
+
list(name: string): string[];
|
|
97
|
+
serve(options: ServeDescriptorOptions): Promise<void>;
|
|
98
|
+
createFileHandler(filepath: string, options: ServeDescriptorOptions): Promise<ServerHandler>;
|
|
99
|
+
protected getCacheFileTypes(): string[];
|
|
100
|
+
protected getCacheControl(filename: string, options: ServeDescriptorOptions): {
|
|
101
|
+
maxAge: number;
|
|
102
|
+
immutable: boolean;
|
|
103
|
+
} | undefined;
|
|
104
|
+
getAllFiles(dir: string, ignoreDotEnvFiles?: boolean): Promise<string[]>;
|
|
103
105
|
}
|
|
104
106
|
interface ServeDirectory {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
options: ServeDescriptorOptions;
|
|
108
|
+
files: string[];
|
|
107
109
|
}
|
|
108
|
-
|
|
109
|
-
export { $serve,
|
|
110
|
+
//#endregion
|
|
111
|
+
export { $serve, CacheControlOptions, ServeDescriptor, ServeDescriptorOptions, ServeDirectory, ServerStaticProvider };
|
|
112
|
+
//# sourceMappingURL=index.d.ts.map
|
package/server/static.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@alepha/server-static'
|
|
1
|
+
export * from '@alepha/server-static'
|
package/server/swagger.cjs
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(serverSwagger).forEach(function (k) {
|
|
2
|
+
var m = require('@alepha/server-swagger');
|
|
3
|
+
Object.keys(m).forEach(function (k) {
|
|
8
4
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
5
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
6
|
+
get: function () { return m[k]; }
|
|
11
7
|
});
|
|
12
|
-
});
|
|
8
|
+
});
|
package/server/swagger.d.ts
CHANGED
|
@@ -1,105 +1,108 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { KIND,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import * as _alepha_core0 from "@alepha/core";
|
|
2
|
+
import { Alepha, KIND, Module, OPTIONS, TObject } from "@alepha/core";
|
|
3
|
+
import { ServerActionDescriptorProvider, ServerRouteAction, ServerRouterProvider } from "@alepha/server";
|
|
4
|
+
import { ServerStaticProvider } from "@alepha/server-static";
|
|
5
|
+
import { OpenAPIV3 } from "openapi-types";
|
|
6
6
|
|
|
7
|
+
//#region src/descriptors/$swagger.d.ts
|
|
7
8
|
interface SwaggerDescriptorOptions {
|
|
8
|
-
|
|
9
|
+
info: OpenAPIV3.InfoObject;
|
|
10
|
+
/**
|
|
11
|
+
* @default: "/docs"
|
|
12
|
+
*/
|
|
13
|
+
prefix?: string;
|
|
14
|
+
/**
|
|
15
|
+
* If true, docs will be disabled.
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
excludeTags?: string[];
|
|
19
|
+
ui?: boolean | SwaggerUiOptions;
|
|
20
|
+
rewrite?: (doc: OpenAPIV3.Document) => void;
|
|
21
|
+
}
|
|
22
|
+
interface SwaggerUiOptions {
|
|
23
|
+
root?: string;
|
|
24
|
+
initOAuth?: {
|
|
9
25
|
/**
|
|
10
|
-
*
|
|
26
|
+
* Default clientId.
|
|
11
27
|
*/
|
|
12
|
-
|
|
28
|
+
clientId?: string;
|
|
13
29
|
/**
|
|
14
|
-
*
|
|
30
|
+
* realm query parameter (for oauth1) added to authorizationUrl and tokenUrl.
|
|
15
31
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
*/
|
|
42
|
-
scopeSeparator?: string;
|
|
43
|
-
/**
|
|
44
|
-
* string array or scope separator (i.e. space) separated string of
|
|
45
|
-
* initially selected oauth scopes
|
|
46
|
-
*
|
|
47
|
-
* @default []
|
|
48
|
-
*/
|
|
49
|
-
scopes?: string | string[];
|
|
50
|
-
/**
|
|
51
|
-
* Additional query parameters added to authorizationUrl and tokenUrl.
|
|
52
|
-
* MUST be an object
|
|
53
|
-
*/
|
|
54
|
-
additionalQueryStringParams?: {
|
|
55
|
-
[key: string]: any;
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* Only activated for the accessCode flow. During the authorization_code
|
|
59
|
-
* request to the tokenUrl, pass the Client Password using the HTTP Basic
|
|
60
|
-
* Authentication scheme (Authorization header with Basic
|
|
61
|
-
* base64encode(client_id + client_secret)).
|
|
62
|
-
*
|
|
63
|
-
* @default false
|
|
64
|
-
*/
|
|
65
|
-
useBasicAuthenticationWithAccessCodeGrant?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Only applies to Authorization Code flows. Proof Key for Code Exchange
|
|
68
|
-
* brings enhanced security for OAuth public clients.
|
|
69
|
-
*
|
|
70
|
-
* @default false
|
|
71
|
-
*/
|
|
72
|
-
usePkceWithAuthorizationCodeGrant?: boolean;
|
|
32
|
+
realm?: string;
|
|
33
|
+
/**
|
|
34
|
+
* application name, displayed in authorization popup.
|
|
35
|
+
*/
|
|
36
|
+
appName?: string;
|
|
37
|
+
/**
|
|
38
|
+
* scope separator for passing scopes, encoded before calling, default
|
|
39
|
+
* value is a space (encoded value %20).
|
|
40
|
+
*
|
|
41
|
+
* @default ' '
|
|
42
|
+
*/
|
|
43
|
+
scopeSeparator?: string;
|
|
44
|
+
/**
|
|
45
|
+
* string array or scope separator (i.e. space) separated string of
|
|
46
|
+
* initially selected oauth scopes
|
|
47
|
+
*
|
|
48
|
+
* @default []
|
|
49
|
+
*/
|
|
50
|
+
scopes?: string | string[];
|
|
51
|
+
/**
|
|
52
|
+
* Additional query parameters added to authorizationUrl and tokenUrl.
|
|
53
|
+
* MUST be an object
|
|
54
|
+
*/
|
|
55
|
+
additionalQueryStringParams?: {
|
|
56
|
+
[key: string]: any;
|
|
73
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* Only activated for the accessCode flow. During the authorization_code
|
|
60
|
+
* request to the tokenUrl, pass the Client Password using the HTTP Basic
|
|
61
|
+
* Authentication scheme (Authorization header with Basic
|
|
62
|
+
* base64encode(client_id + client_secret)).
|
|
63
|
+
*
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
useBasicAuthenticationWithAccessCodeGrant?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Only applies to Authorization Code flows. Proof Key for Code Exchange
|
|
69
|
+
* brings enhanced security for OAuth public clients.
|
|
70
|
+
*
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
usePkceWithAuthorizationCodeGrant?: boolean;
|
|
74
|
+
};
|
|
74
75
|
}
|
|
75
76
|
interface SwaggerDescriptor {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
[KIND]: "SWAGGER";
|
|
78
|
+
[OPTIONS]: SwaggerDescriptorOptions;
|
|
79
|
+
json(): OpenAPIV3.Document;
|
|
79
80
|
}
|
|
80
81
|
declare const $swagger: {
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
(options: SwaggerDescriptorOptions): SwaggerDescriptor;
|
|
83
|
+
[KIND]: string;
|
|
83
84
|
};
|
|
84
|
-
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/ServerSwaggerProvider.d.ts
|
|
85
87
|
declare class ServerSwaggerProvider {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
88
|
+
protected readonly serverActionProvider: ServerActionDescriptorProvider;
|
|
89
|
+
protected readonly serverStaticProvider: ServerStaticProvider;
|
|
90
|
+
protected readonly serverRouterProvider: ServerRouterProvider;
|
|
91
|
+
protected readonly alepha: Alepha;
|
|
92
|
+
protected readonly configure: _alepha_core0.HookDescriptor<"configure">;
|
|
93
|
+
protected configureOpenApi(doc: SwaggerDescriptorOptions): any;
|
|
94
|
+
isBodyMultipart(schema: TObject): boolean;
|
|
95
|
+
replacePathParams(url: string): string;
|
|
96
|
+
getResponseSchema(route: ServerRouteAction): {
|
|
97
|
+
type?: string;
|
|
98
|
+
schema?: any;
|
|
99
|
+
status: number;
|
|
100
|
+
} | undefined;
|
|
101
|
+
protected configureSwaggerApi(prefix: string, json: OpenAPIV3.Document): Promise<void>;
|
|
102
|
+
protected configureSwaggerUi(prefix: string, options: SwaggerDescriptorOptions): Promise<void>;
|
|
101
103
|
}
|
|
102
|
-
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/index.d.ts
|
|
103
106
|
/**
|
|
104
107
|
* Alepha Server Swagger Module
|
|
105
108
|
*
|
|
@@ -111,8 +114,9 @@ declare class ServerSwaggerProvider {
|
|
|
111
114
|
* @module alepha.server.swagger
|
|
112
115
|
*/
|
|
113
116
|
declare class AlephaServerSwagger implements Module {
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
readonly name = "alepha.server.swagger";
|
|
118
|
+
readonly $services: (alepha: Alepha) => Alepha;
|
|
116
119
|
}
|
|
117
|
-
|
|
118
|
-
export { $swagger, AlephaServerSwagger, ServerSwaggerProvider,
|
|
120
|
+
//#endregion
|
|
121
|
+
export { $swagger, AlephaServerSwagger, ServerSwaggerProvider, SwaggerDescriptor, SwaggerDescriptorOptions, SwaggerUiOptions };
|
|
122
|
+
//# sourceMappingURL=index.d.ts.map
|
package/server/swagger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@alepha/server-swagger'
|
|
1
|
+
export * from '@alepha/server-swagger'
|
package/server.cjs
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(server).forEach(function (k) {
|
|
2
|
+
var m = require('@alepha/server');
|
|
3
|
+
Object.keys(m).forEach(function (k) {
|
|
8
4
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
5
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
6
|
+
get: function () { return m[k]; }
|
|
11
7
|
});
|
|
12
|
-
});
|
|
8
|
+
});
|