alepha 0.7.5 → 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 -44
- 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 +950 -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 +70 -39
- package/postgres.cjs +4 -8
- package/postgres.d.ts +1314 -4398
- 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 +166 -282
- package/react/auth.js +1 -1
- package/react.cjs +4 -8
- package/react.d.ts +509 -551
- 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 +125 -182
- 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 +41 -38
- 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 +96 -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 +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/react.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@alepha/react'
|
|
1
|
+
export * from '@alepha/react'
|
package/redis.cjs
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(redis).forEach(function (k) {
|
|
2
|
+
var m = require('@alepha/redis');
|
|
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/redis.d.ts
CHANGED
|
@@ -1,144 +1,71 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import * as _alepha_core7 from "@alepha/core";
|
|
2
|
+
import * as _alepha_core0 from "@alepha/core";
|
|
3
|
+
import { Alepha, Static } from "@alepha/core";
|
|
4
|
+
import { RedisClientType, SetOptions, createClient } from "@redis/client";
|
|
5
|
+
import * as _sinclair_typebox3 from "@sinclair/typebox";
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
declare const Hint: unique symbol;
|
|
11
|
-
/** Symbol key applied to types */
|
|
12
|
-
declare const Kind: unique symbol;
|
|
13
|
-
|
|
14
|
-
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);
|
|
15
|
-
type StringContentEncodingOption = '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64' | ({} & string);
|
|
16
|
-
interface StringOptions extends SchemaOptions {
|
|
17
|
-
/** The maximum string length */
|
|
18
|
-
maxLength?: number;
|
|
19
|
-
/** The minimum string length */
|
|
20
|
-
minLength?: number;
|
|
21
|
-
/** A regular expression pattern this string should match */
|
|
22
|
-
pattern?: string;
|
|
23
|
-
/** A format this string should match */
|
|
24
|
-
format?: StringFormatOption;
|
|
25
|
-
/** The content encoding for this string */
|
|
26
|
-
contentEncoding?: StringContentEncodingOption;
|
|
27
|
-
/** The content media type for this string */
|
|
28
|
-
contentMediaType?: string;
|
|
29
|
-
}
|
|
30
|
-
interface TString extends TSchema, StringOptions {
|
|
31
|
-
[Kind]: 'String';
|
|
32
|
-
static: string;
|
|
33
|
-
type: 'string';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
interface NumberOptions extends SchemaOptions {
|
|
37
|
-
exclusiveMaximum?: number;
|
|
38
|
-
exclusiveMinimum?: number;
|
|
39
|
-
maximum?: number;
|
|
40
|
-
minimum?: number;
|
|
41
|
-
multipleOf?: number;
|
|
42
|
-
}
|
|
43
|
-
interface TNumber extends TSchema, NumberOptions {
|
|
44
|
-
[Kind]: 'Number';
|
|
45
|
-
static: number;
|
|
46
|
-
type: 'number';
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
type TOptional<T extends TSchema> = T & {
|
|
50
|
-
[OptionalKind]: 'Optional';
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
interface SchemaOptions {
|
|
54
|
-
$schema?: string;
|
|
55
|
-
/** Id for this schema */
|
|
56
|
-
$id?: string;
|
|
57
|
-
/** Title of this schema */
|
|
58
|
-
title?: string;
|
|
59
|
-
/** Description of this schema */
|
|
60
|
-
description?: string;
|
|
61
|
-
/** Default value for this schema */
|
|
62
|
-
default?: any;
|
|
63
|
-
/** Example values matching this schema */
|
|
64
|
-
examples?: any;
|
|
65
|
-
/** Optional annotation for readOnly */
|
|
66
|
-
readOnly?: boolean;
|
|
67
|
-
/** Optional annotation for writeOnly */
|
|
68
|
-
writeOnly?: boolean;
|
|
69
|
-
[prop: string]: any;
|
|
70
|
-
}
|
|
71
|
-
interface TKind {
|
|
72
|
-
[Kind]: string;
|
|
73
|
-
}
|
|
74
|
-
interface TSchema extends TKind, SchemaOptions {
|
|
75
|
-
[ReadonlyKind]?: string;
|
|
76
|
-
[OptionalKind]?: string;
|
|
77
|
-
[Hint]?: string;
|
|
78
|
-
params: unknown[];
|
|
79
|
-
static: unknown;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
declare const envSchema: _alepha_core.TObject<{
|
|
83
|
-
REDIS_PORT: TNumber;
|
|
84
|
-
REDIS_HOST: TString;
|
|
85
|
-
REDIS_PASSWORD: TOptional<TString>;
|
|
7
|
+
//#region src/providers/RedisProvider.d.ts
|
|
8
|
+
declare const envSchema: _alepha_core7.TObject<{
|
|
9
|
+
REDIS_PORT: _sinclair_typebox3.TNumber;
|
|
10
|
+
REDIS_HOST: _sinclair_typebox3.TString;
|
|
11
|
+
REDIS_PASSWORD: _sinclair_typebox3.TOptional<_sinclair_typebox3.TString>;
|
|
86
12
|
}>;
|
|
87
13
|
declare module "alepha" {
|
|
88
|
-
|
|
89
|
-
}
|
|
14
|
+
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
90
15
|
}
|
|
91
16
|
type RedisClient = RedisClientType<{}, {}, {}, 3, {
|
|
92
|
-
|
|
17
|
+
36: BufferConstructor;
|
|
93
18
|
}>;
|
|
94
19
|
type RedisClientOptions = Parameters<typeof createClient>[0];
|
|
95
20
|
type RedisSetOptions = SetOptions;
|
|
96
21
|
declare class RedisProvider {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
22
|
+
protected readonly log: _alepha_core7.Logger;
|
|
23
|
+
protected readonly alepha: Alepha;
|
|
24
|
+
protected readonly env: {
|
|
25
|
+
REDIS_PASSWORD?: string | undefined;
|
|
26
|
+
REDIS_PORT: number;
|
|
27
|
+
REDIS_HOST: string;
|
|
28
|
+
};
|
|
29
|
+
protected readonly client: RedisClient;
|
|
30
|
+
get publisher(): RedisClient;
|
|
31
|
+
protected readonly start: _alepha_core7.HookDescriptor<"start">;
|
|
32
|
+
protected readonly stop: _alepha_core7.HookDescriptor<"stop">;
|
|
33
|
+
/**
|
|
34
|
+
* Connect to the Redis server.
|
|
35
|
+
*/
|
|
36
|
+
connect(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Close the connection to the Redis server.
|
|
39
|
+
*/
|
|
40
|
+
close(): Promise<void>;
|
|
41
|
+
duplicate(options?: Partial<RedisClientOptions>): RedisClient;
|
|
42
|
+
get(key: string): Promise<Buffer | undefined>;
|
|
43
|
+
set(key: string, value: Buffer | string, options?: RedisSetOptions): Promise<Buffer>;
|
|
44
|
+
has(key: string): Promise<boolean>;
|
|
45
|
+
keys(pattern: string): Promise<string[]>;
|
|
46
|
+
del(keys: string[]): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Redis subscriber client factory method.
|
|
49
|
+
*/
|
|
50
|
+
protected createClient(): RedisClient;
|
|
126
51
|
}
|
|
127
|
-
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/providers/RedisSubscriberProvider.d.ts
|
|
128
54
|
declare class RedisSubscriberProvider {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
55
|
+
protected readonly log: _alepha_core0.Logger;
|
|
56
|
+
protected readonly alepha: Alepha;
|
|
57
|
+
protected readonly redisProvider: RedisProvider;
|
|
58
|
+
protected readonly client: RedisClient;
|
|
59
|
+
get subscriber(): RedisClient;
|
|
60
|
+
protected readonly start: _alepha_core0.HookDescriptor<"start">;
|
|
61
|
+
protected readonly stop: _alepha_core0.HookDescriptor<"stop">;
|
|
62
|
+
connect(): Promise<void>;
|
|
63
|
+
close(): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Redis subscriber client factory method.
|
|
66
|
+
*/
|
|
67
|
+
protected createClient(): RedisClient;
|
|
142
68
|
}
|
|
143
|
-
|
|
144
|
-
export {
|
|
69
|
+
//#endregion
|
|
70
|
+
export { RedisClient, RedisClientOptions, RedisProvider, RedisSetOptions, RedisSubscriberProvider };
|
|
71
|
+
//# sourceMappingURL=index.d.ts.map
|
package/redis.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@alepha/redis'
|
|
1
|
+
export * from '@alepha/redis'
|
package/retry.cjs
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(retry).forEach(function (k) {
|
|
2
|
+
var m = require('@alepha/retry');
|
|
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/retry.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { MaybePromise } from
|
|
1
|
+
import { MaybePromise } from "@alepha/core";
|
|
2
|
+
|
|
3
|
+
//#region src/descriptors/$retry.d.ts
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* `$retry` creates a retry descriptor.
|
|
@@ -34,35 +36,36 @@ declare const $retry: <T extends (...args: any[]) => any>(opts: RetryDescriptorO
|
|
|
34
36
|
* Retry Descriptor options.
|
|
35
37
|
*/
|
|
36
38
|
interface RetryDescriptorOptions<T extends (...args: any[]) => any> {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Maximum number of attempts.
|
|
41
|
+
*
|
|
42
|
+
* @default 3
|
|
43
|
+
*/
|
|
44
|
+
max?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Delay in milliseconds.
|
|
47
|
+
*
|
|
48
|
+
* @default 0
|
|
49
|
+
*/
|
|
50
|
+
delay?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Optional condition to determine when to retry.
|
|
53
|
+
*/
|
|
54
|
+
when?: (error: Error) => boolean;
|
|
55
|
+
/**
|
|
56
|
+
* The function to retry.
|
|
57
|
+
*/
|
|
58
|
+
handler: T;
|
|
59
|
+
/**
|
|
60
|
+
* Optional error handler.
|
|
61
|
+
*
|
|
62
|
+
* This will be called when an error occurs.
|
|
63
|
+
*
|
|
64
|
+
* @default undefined
|
|
65
|
+
*/
|
|
66
|
+
onError?: (error: Error, attempt: number, ...parameters: Parameters<T>) => void;
|
|
65
67
|
}
|
|
66
68
|
type RetryDescriptor<T extends (...args: any[]) => any> = (...parameters: Parameters<T>) => MaybePromise<ReturnType<T>>;
|
|
67
|
-
|
|
68
|
-
export { $retry,
|
|
69
|
+
//#endregion
|
|
70
|
+
export { $retry, RetryDescriptor, RetryDescriptorOptions };
|
|
71
|
+
//# sourceMappingURL=index.d.ts.map
|
package/retry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@alepha/retry'
|
|
1
|
+
export * from '@alepha/retry'
|
package/scheduler.cjs
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(scheduler).forEach(function (k) {
|
|
2
|
+
var m = require('@alepha/scheduler');
|
|
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
|
+
});
|