alepha 0.7.6 → 0.8.0
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 -44
- package/batch.cjs +8 -0
- package/batch.d.ts +114 -0
- package/batch.js +1 -0
- package/cache/redis.d.ts +15 -18
- package/cache.d.ts +115 -119
- package/command.cjs +8 -0
- package/command.d.ts +154 -0
- package/command.js +1 -0
- package/core.d.ts +800 -795
- package/datetime.d.ts +76 -76
- package/lock/redis.d.ts +12 -12
- package/lock.d.ts +70 -75
- package/package.json +102 -29
- package/postgres.d.ts +385 -278
- package/queue/redis.d.ts +15 -13
- package/queue.d.ts +16 -13
- package/react/auth.d.ts +16 -16
- package/react/head.cjs +8 -0
- package/react/head.d.ts +92 -0
- package/react/head.js +1 -0
- package/react.d.ts +90 -116
- package/redis.d.ts +20 -27
- package/retry.d.ts +74 -54
- package/scheduler.d.ts +14 -13
- package/security.d.ts +38 -41
- package/server/cache.d.ts +9 -7
- package/server/compress.cjs +8 -0
- package/server/compress.d.ts +26 -0
- package/server/compress.js +1 -0
- package/server/cookies.d.ts +71 -14
- package/server/cors.cjs +8 -0
- package/server/cors.d.ts +29 -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/helmet.cjs +8 -0
- package/server/helmet.d.ts +72 -0
- package/server/helmet.js +1 -0
- package/server/links.cjs +8 -0
- package/server/links.d.ts +179 -0
- package/server/links.js +1 -0
- package/server/metrics.cjs +8 -0
- package/server/metrics.d.ts +37 -0
- package/server/metrics.js +1 -0
- package/server/multipart.cjs +8 -0
- package/server/multipart.d.ts +48 -0
- package/server/multipart.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.d.ts +63 -51
- package/server/swagger.d.ts +50 -50
- package/server.d.ts +220 -437
- package/topic/redis.d.ts +24 -23
- package/topic.d.ts +9 -19
- package/vite.d.ts +8 -1
package/queue/redis.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { QueueProvider } from "
|
|
2
|
-
import { Alepha, Module } from "
|
|
3
|
-
import { RedisProvider } from "
|
|
1
|
+
import { QueueProvider } from "alepha/queue";
|
|
2
|
+
import { Alepha, Module, Static, TObject, TString } from "alepha";
|
|
3
|
+
import { RedisProvider } from "alepha/redis";
|
|
4
4
|
|
|
5
5
|
//#region src/providers/RedisQueueProvider.d.ts
|
|
6
|
+
declare const envSchema: TObject<{
|
|
7
|
+
REDIS_QUEUE_PREFIX: TString;
|
|
8
|
+
}>;
|
|
6
9
|
declare class RedisQueueProvider implements QueueProvider {
|
|
7
|
-
protected readonly env:
|
|
8
|
-
REDIS_QUEUE_PREFIX: string;
|
|
9
|
-
};
|
|
10
|
+
protected readonly env: Static<typeof envSchema>;
|
|
10
11
|
protected readonly redisProvider: RedisProvider;
|
|
11
12
|
prefix(queue: string): string;
|
|
12
13
|
push(queue: string, message: string): Promise<void>;
|
|
@@ -14,14 +15,15 @@ declare class RedisQueueProvider implements QueueProvider {
|
|
|
14
15
|
}
|
|
15
16
|
//#endregion
|
|
16
17
|
//#region src/index.d.ts
|
|
18
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
17
19
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
* Alepha Queue Redis Module
|
|
21
|
+
*
|
|
22
|
+
* Plugin for Alepha Queue that provides Redis queue capabilities.
|
|
23
|
+
*
|
|
24
|
+
* @see {@link RedisQueueProvider}
|
|
25
|
+
* @module alepha.queue.redis
|
|
26
|
+
*/
|
|
25
27
|
declare class AlephaQueueRedis implements Module {
|
|
26
28
|
readonly name = "alepha.queue.redis";
|
|
27
29
|
readonly $services: (alepha: Alepha) => Alepha;
|
package/queue.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as _alepha_core0 from "
|
|
2
|
-
import * as
|
|
3
|
-
import { Alepha, KIND, Module, OPTIONS, Static, TSchema } from "
|
|
4
|
-
import { DateTimeProvider } from "
|
|
5
|
-
import * as _sinclair_typebox1 from "@sinclair/typebox";
|
|
1
|
+
import * as _alepha_core0 from "alepha";
|
|
2
|
+
import * as _alepha_core1 from "alepha";
|
|
3
|
+
import { Alepha, KIND, Module, OPTIONS, Static, TSchema } from "alepha";
|
|
4
|
+
import { DateTimeProvider } from "alepha/datetime";
|
|
6
5
|
|
|
7
6
|
//#region src/providers/QueueProvider.d.ts
|
|
8
7
|
/**
|
|
@@ -27,6 +26,7 @@ declare abstract class QueueProvider {
|
|
|
27
26
|
*/
|
|
28
27
|
abstract pop(queue: string): Promise<string | undefined>;
|
|
29
28
|
}
|
|
29
|
+
//# sourceMappingURL=QueueProvider.d.ts.map
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/descriptors/$queue.d.ts
|
|
32
32
|
declare const KEY$1 = "QUEUE";
|
|
@@ -87,22 +87,23 @@ declare class MemoryQueueProvider implements QueueProvider {
|
|
|
87
87
|
push(queue: string, ...messages: string[]): Promise<void>;
|
|
88
88
|
pop(queue: string): Promise<string | undefined>;
|
|
89
89
|
}
|
|
90
|
+
//# sourceMappingURL=MemoryQueueProvider.d.ts.map
|
|
90
91
|
//#endregion
|
|
91
92
|
//#region src/providers/QueueDescriptorProvider.d.ts
|
|
92
|
-
declare const envSchema:
|
|
93
|
+
declare const envSchema: _alepha_core1.TObject<{
|
|
93
94
|
/**
|
|
94
95
|
* The interval in milliseconds to wait before checking for new messages.
|
|
95
96
|
*/
|
|
96
|
-
QUEUE_WORKER_INTERVAL:
|
|
97
|
+
QUEUE_WORKER_INTERVAL: _alepha_core1.TNumber;
|
|
97
98
|
/**
|
|
98
99
|
* The maximum interval in milliseconds to wait before checking for new messages.
|
|
99
100
|
*/
|
|
100
|
-
QUEUE_WORKER_MAX_INTERVAL:
|
|
101
|
+
QUEUE_WORKER_MAX_INTERVAL: _alepha_core1.TNumber;
|
|
101
102
|
/**
|
|
102
103
|
* The number of workers to run concurrently. Defaults to 1.
|
|
103
104
|
* Useful only if you are doing a lot of I/O.
|
|
104
105
|
*/
|
|
105
|
-
QUEUE_WORKER_CONCURRENCY:
|
|
106
|
+
QUEUE_WORKER_CONCURRENCY: _alepha_core1.TNumber;
|
|
106
107
|
}>;
|
|
107
108
|
declare module "alepha" {
|
|
108
109
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -116,7 +117,7 @@ interface QueueDescriptorProviderState {
|
|
|
116
117
|
workerIntervals: Record<number, number>;
|
|
117
118
|
}
|
|
118
119
|
declare class QueueDescriptorProvider {
|
|
119
|
-
protected readonly log:
|
|
120
|
+
protected readonly log: _alepha_core1.Logger;
|
|
120
121
|
protected readonly env: {
|
|
121
122
|
QUEUE_WORKER_INTERVAL: number;
|
|
122
123
|
QUEUE_WORKER_MAX_INTERVAL: number;
|
|
@@ -127,9 +128,9 @@ declare class QueueDescriptorProvider {
|
|
|
127
128
|
protected readonly memoryQueueProvider: MemoryQueueProvider;
|
|
128
129
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
129
130
|
protected readonly state: QueueDescriptorProviderState;
|
|
130
|
-
protected readonly configure:
|
|
131
|
-
protected readonly start:
|
|
132
|
-
protected readonly stop:
|
|
131
|
+
protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
|
|
132
|
+
protected readonly start: _alepha_core1.HookDescriptor<"start">;
|
|
133
|
+
protected readonly stop: _alepha_core1.HookDescriptor<"stop">;
|
|
133
134
|
getQueues(): QueueDescriptor<QueueMessageSchema>[];
|
|
134
135
|
getConsumers(): ConsumerDescriptorOptions<QueueMessageSchema>[];
|
|
135
136
|
/**
|
|
@@ -205,6 +206,8 @@ declare class AlephaQueue implements Module {
|
|
|
205
206
|
readonly name = "alepha.queue";
|
|
206
207
|
readonly $services: (alepha: Alepha) => Alepha;
|
|
207
208
|
}
|
|
209
|
+
//# sourceMappingURL=index.d.ts.map
|
|
210
|
+
|
|
208
211
|
//#endregion
|
|
209
212
|
export { $consumer, $queue, AlephaQueue, ConsumerDescriptor, ConsumerDescriptorOptions, MemoryQueueProvider, QueueDescriptor, QueueDescriptorOptions, QueueDescriptorProvider, QueueDescriptorProviderState, QueueMessageSchema, QueueProvider };
|
|
210
213
|
//# sourceMappingURL=index.d.ts.map
|
package/react/auth.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import * as _alepha_core1 from "
|
|
2
|
-
import * as _alepha_core52 from "
|
|
3
|
-
import { Alepha, Async, KIND, Module, OPTIONS } from "
|
|
4
|
-
import * as
|
|
5
|
-
import {
|
|
6
|
-
import * as
|
|
7
|
-
import {
|
|
1
|
+
import * as _alepha_core1 from "alepha";
|
|
2
|
+
import * as _alepha_core52 from "alepha";
|
|
3
|
+
import { Alepha, Async, KIND, Module, OPTIONS } from "alepha";
|
|
4
|
+
import * as _alepha_server_cookies7 from "alepha/server/cookies";
|
|
5
|
+
import { Cookies, ServerCookiesProvider } from "alepha/server/cookies";
|
|
6
|
+
import * as _alepha_server41 from "alepha/server";
|
|
7
|
+
import { HttpClient } from "alepha/server";
|
|
8
8
|
import { Configuration } from "openid-client";
|
|
9
|
-
import {
|
|
9
|
+
import { HttpVirtualClient } from "alepha/server/links";
|
|
10
|
+
import { UserAccountToken } from "alepha/security";
|
|
10
11
|
import * as _sinclair_typebox2 from "@sinclair/typebox";
|
|
11
12
|
|
|
12
13
|
//#region src/descriptors/$auth.d.ts
|
|
@@ -44,7 +45,7 @@ declare class ReactAuthProvider {
|
|
|
44
45
|
codeVerifier: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
45
46
|
redirectUri: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
46
47
|
}>>;
|
|
47
|
-
|
|
48
|
+
readonly tokens: _alepha_server_cookies7.CookieDescriptor<_sinclair_typebox2.TObject<{
|
|
48
49
|
provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
49
50
|
access_token: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
50
51
|
expires_in: _sinclair_typebox2.TOptional<_sinclair_typebox2.TNumber>;
|
|
@@ -59,7 +60,7 @@ declare class ReactAuthProvider {
|
|
|
59
60
|
email: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
60
61
|
picture: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
61
62
|
}>>;
|
|
62
|
-
readonly onRender: _alepha_core1.HookDescriptor<"react:server:render">;
|
|
63
|
+
readonly onRender: _alepha_core1.HookDescriptor<"react:server:render:begin">;
|
|
63
64
|
protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
|
|
64
65
|
protected getAccessTokenFromCookies(tokens: SessionTokens): Promise<string | undefined>;
|
|
65
66
|
/**
|
|
@@ -72,18 +73,12 @@ declare class ReactAuthProvider {
|
|
|
72
73
|
* @protected
|
|
73
74
|
*/
|
|
74
75
|
protected refresh(cookies: Cookies): Promise<SessionTokens | undefined>;
|
|
75
|
-
/**
|
|
76
|
-
*
|
|
77
|
-
*/
|
|
78
76
|
readonly login: _alepha_server41.RouteDescriptor<{
|
|
79
77
|
query: _sinclair_typebox2.TObject<{
|
|
80
78
|
redirect: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
81
79
|
provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
82
80
|
}>;
|
|
83
81
|
}>;
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
*/
|
|
87
82
|
readonly callback: _alepha_server41.RouteDescriptor<{
|
|
88
83
|
query: _sinclair_typebox2.TObject<{
|
|
89
84
|
provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
@@ -150,6 +145,7 @@ interface ReactUser {
|
|
|
150
145
|
name?: string;
|
|
151
146
|
email?: string;
|
|
152
147
|
}
|
|
148
|
+
//# sourceMappingURL=ReactAuthProvider.d.ts.map
|
|
153
149
|
//#endregion
|
|
154
150
|
//#region src/hooks/useAuth.d.ts
|
|
155
151
|
declare const useAuth: () => AuthHook;
|
|
@@ -159,6 +155,7 @@ interface AuthHook {
|
|
|
159
155
|
login: (provider?: string) => void;
|
|
160
156
|
can: <T extends object>(name: keyof HttpVirtualClient<T>) => boolean;
|
|
161
157
|
}
|
|
158
|
+
//# sourceMappingURL=useAuth.d.ts.map
|
|
162
159
|
//#endregion
|
|
163
160
|
//#region src/services/ReactAuth.d.ts
|
|
164
161
|
declare class ReactAuth {
|
|
@@ -176,6 +173,7 @@ declare class ReactAuth {
|
|
|
176
173
|
login(): void;
|
|
177
174
|
logout(): void;
|
|
178
175
|
}
|
|
176
|
+
//# sourceMappingURL=ReactAuth.d.ts.map
|
|
179
177
|
//#endregion
|
|
180
178
|
//#region src/index.d.ts
|
|
181
179
|
declare module "alepha/react" {
|
|
@@ -198,6 +196,8 @@ declare class AlephaReactAuth implements Module {
|
|
|
198
196
|
readonly name = "alepha.react.auth";
|
|
199
197
|
readonly $services: (alepha: Alepha) => void;
|
|
200
198
|
}
|
|
199
|
+
//# sourceMappingURL=index.d.ts.map
|
|
200
|
+
|
|
201
201
|
//#endregion
|
|
202
202
|
export { $auth, AccessToken, AlephaReactAuth, AuthDescriptor, AuthDescriptorOptions, AuthHook, AuthProvider, ReactAuth, ReactAuthProvider, ReactUser, SessionTokens, useAuth };
|
|
203
203
|
//# sourceMappingURL=index.d.ts.map
|
package/react/head.cjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var m = require('@alepha/react-head');
|
|
3
|
+
Object.keys(m).forEach(function (k) {
|
|
4
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function () { return m[k]; }
|
|
7
|
+
});
|
|
8
|
+
});
|
package/react/head.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { PageConfigSchema, PageReactContext, PageRoute, RouterState, TPropsDefault, TPropsParentDefault } from "alepha/react";
|
|
2
|
+
import * as _alepha_core1 from "alepha";
|
|
3
|
+
import { Alepha, Module } from "alepha";
|
|
4
|
+
|
|
5
|
+
//#region src/interfaces/Head.d.ts
|
|
6
|
+
interface Head extends SimpleHead {
|
|
7
|
+
description?: string;
|
|
8
|
+
keywords?: string[];
|
|
9
|
+
author?: string;
|
|
10
|
+
robots?: string;
|
|
11
|
+
themeColor?: string;
|
|
12
|
+
viewport?: string | {
|
|
13
|
+
width?: string;
|
|
14
|
+
height?: string;
|
|
15
|
+
initialScale?: string;
|
|
16
|
+
maximumScale?: string;
|
|
17
|
+
userScalable?: "no" | "yes" | "0" | "1";
|
|
18
|
+
interactiveWidget?: "resizes-visual" | "resizes-content" | "overlays-content";
|
|
19
|
+
};
|
|
20
|
+
og?: {
|
|
21
|
+
title?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
image?: string;
|
|
24
|
+
url?: string;
|
|
25
|
+
type?: string;
|
|
26
|
+
};
|
|
27
|
+
twitter?: {
|
|
28
|
+
card?: string;
|
|
29
|
+
title?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
image?: string;
|
|
32
|
+
site?: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
interface SimpleHead {
|
|
36
|
+
title?: string;
|
|
37
|
+
titleSeparator?: string;
|
|
38
|
+
htmlAttributes?: Record<string, string>;
|
|
39
|
+
bodyAttributes?: Record<string, string>;
|
|
40
|
+
meta?: Array<{
|
|
41
|
+
name: string;
|
|
42
|
+
content: string;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=Head.d.ts.map
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/hooks/useHead.d.ts
|
|
48
|
+
declare const useHead: (head?: Head | ((previous?: Head) => Head)) => void;
|
|
49
|
+
//# sourceMappingURL=useHead.d.ts.map
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/providers/HeadProvider.d.ts
|
|
52
|
+
declare class HeadProvider {
|
|
53
|
+
fillHead(state: RouterState, context: PageReactContext): void;
|
|
54
|
+
protected fillHeadByPage(page: PageRoute, context: PageReactContext, props: Record<string, any>): void;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=HeadProvider.d.ts.map
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/providers/ServerHeadProvider.d.ts
|
|
59
|
+
declare class ServerHeadProvider {
|
|
60
|
+
protected readonly headProvider: HeadProvider;
|
|
61
|
+
protected readonly onServerRenderEnd: _alepha_core1.HookDescriptor<"react:server:render:end">;
|
|
62
|
+
renderHead(template: string, head: SimpleHead): string;
|
|
63
|
+
protected mergeAttributes(existing: string, attrs: Record<string, string>): string;
|
|
64
|
+
protected parseAttributes(attrStr: string): Record<string, string>;
|
|
65
|
+
protected escapeHtml(str: string): string;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=ServerHeadProvider.d.ts.map
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/index.d.ts
|
|
70
|
+
declare module "alepha/react" {
|
|
71
|
+
interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = TPropsDefault, TPropsParent extends object = TPropsParentDefault> {
|
|
72
|
+
head?: Head | ((props: TProps, previous?: Head) => Head);
|
|
73
|
+
}
|
|
74
|
+
interface PageReactContext {
|
|
75
|
+
head: Head;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Alepha React Head Module
|
|
80
|
+
*
|
|
81
|
+
* @see {@link ServerHeadProvider}
|
|
82
|
+
* @module alepha.react.head
|
|
83
|
+
*/
|
|
84
|
+
declare class AlephaReactHead implements Module {
|
|
85
|
+
readonly name = "alepha.react.head";
|
|
86
|
+
readonly $services: (alepha: Alepha) => Alepha;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=index.d.ts.map
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
export { AlephaReactHead, Head, ServerHeadProvider, SimpleHead, useHead };
|
|
92
|
+
//# sourceMappingURL=index.d.ts.map
|
package/react/head.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@alepha/react-head'
|