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/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Feunard
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Feunard
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
<h1 >
|
|
4
|
-
<img
|
|
5
|
-
src="https://raw.githubusercontent.com/feunard/alepha/main/assets/logo.png"
|
|
6
|
-
width="128"
|
|
7
|
-
height="128"
|
|
8
|
-
alt="Logo"
|
|
9
|
-
valign="middle"
|
|
10
|
-
/>
|
|
11
|
-
Alepha
|
|
12
|
-
</h1>
|
|
13
|
-
<p style="max-width: 512px">
|
|
14
|
-
🚧
|
|
15
|
-
</p>
|
|
16
|
-
<a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/v/alepha.svg" alt="npm"/></a>
|
|
17
|
-
<a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/l/alepha.svg" alt="npm"/></a>
|
|
18
|
-
<a href="https://codecov.io/gh/feunard/alepha"><img src="https://codecov.io/gh/feunard/alepha/graph/badge.svg?token=ZDLWI514CP" alt="npm"/></a>
|
|
19
|
-
<a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/dt/alepha.svg" alt="npm"/></a>
|
|
20
|
-
<a href="https://github.com/feunard/alepha"><img src="https://img.shields.io/github/stars/feunard/alepha.svg?style=social" alt="GitHub stars"/></a>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
## Installation
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm install alepha
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Usage
|
|
30
|
-
|
|
31
|
-
Minimalist http server with a single endpoint.
|
|
32
|
-
|
|
33
|
-
```ts
|
|
34
|
-
import { run } from "alepha";
|
|
35
|
-
import { $action } from "alepha/server";
|
|
36
|
-
|
|
37
|
-
class App {
|
|
38
|
-
hello = $action({
|
|
39
|
-
handler: () => "Hello world!",
|
|
40
|
-
})
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
run(App);
|
|
44
|
-
```
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<h1 >
|
|
4
|
+
<img
|
|
5
|
+
src="https://raw.githubusercontent.com/feunard/alepha/main/assets/logo.png"
|
|
6
|
+
width="128"
|
|
7
|
+
height="128"
|
|
8
|
+
alt="Logo"
|
|
9
|
+
valign="middle"
|
|
10
|
+
/>
|
|
11
|
+
Alepha
|
|
12
|
+
</h1>
|
|
13
|
+
<p style="max-width: 512px">
|
|
14
|
+
🚧
|
|
15
|
+
</p>
|
|
16
|
+
<a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/v/alepha.svg" alt="npm"/></a>
|
|
17
|
+
<a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/l/alepha.svg" alt="npm"/></a>
|
|
18
|
+
<a href="https://codecov.io/gh/feunard/alepha"><img src="https://codecov.io/gh/feunard/alepha/graph/badge.svg?token=ZDLWI514CP" alt="npm"/></a>
|
|
19
|
+
<a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/dt/alepha.svg" alt="npm"/></a>
|
|
20
|
+
<a href="https://github.com/feunard/alepha"><img src="https://img.shields.io/github/stars/feunard/alepha.svg?style=social" alt="GitHub stars"/></a>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install alepha
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
Minimalist http server with a single endpoint.
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { run } from "alepha";
|
|
35
|
+
import { $action } from "alepha/server";
|
|
36
|
+
|
|
37
|
+
class App {
|
|
38
|
+
hello = $action({
|
|
39
|
+
handler: () => "Hello world!",
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
run(App);
|
|
44
|
+
```
|
package/cache/redis.cjs
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(cacheRedis).forEach(function (k) {
|
|
2
|
+
var m = require('@alepha/cache-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/cache/redis.d.ts
CHANGED
|
@@ -1,94 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { RedisProvider } from
|
|
1
|
+
import { CacheProvider } from "@alepha/cache";
|
|
2
|
+
import * as _alepha_core2 from "@alepha/core";
|
|
3
|
+
import { Alepha, Module, Static } from "@alepha/core";
|
|
4
|
+
import { RedisProvider } from "@alepha/redis";
|
|
5
|
+
import * as _sinclair_typebox0 from "@sinclair/typebox";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
declare const
|
|
8
|
-
|
|
9
|
-
declare const OptionalKind: unique symbol;
|
|
10
|
-
/** Symbol key applied to types */
|
|
11
|
-
declare const Hint: unique symbol;
|
|
12
|
-
/** Symbol key applied to types */
|
|
13
|
-
declare const Kind: unique symbol;
|
|
14
|
-
|
|
15
|
-
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);
|
|
16
|
-
type StringContentEncodingOption = '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64' | ({} & string);
|
|
17
|
-
interface StringOptions extends SchemaOptions {
|
|
18
|
-
/** The maximum string length */
|
|
19
|
-
maxLength?: number;
|
|
20
|
-
/** The minimum string length */
|
|
21
|
-
minLength?: number;
|
|
22
|
-
/** A regular expression pattern this string should match */
|
|
23
|
-
pattern?: string;
|
|
24
|
-
/** A format this string should match */
|
|
25
|
-
format?: StringFormatOption;
|
|
26
|
-
/** The content encoding for this string */
|
|
27
|
-
contentEncoding?: StringContentEncodingOption;
|
|
28
|
-
/** The content media type for this string */
|
|
29
|
-
contentMediaType?: string;
|
|
30
|
-
}
|
|
31
|
-
interface TString extends TSchema, StringOptions {
|
|
32
|
-
[Kind]: 'String';
|
|
33
|
-
static: string;
|
|
34
|
-
type: 'string';
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
type TOptional<T extends TSchema> = T & {
|
|
38
|
-
[OptionalKind]: 'Optional';
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
interface SchemaOptions {
|
|
42
|
-
$schema?: string;
|
|
43
|
-
/** Id for this schema */
|
|
44
|
-
$id?: string;
|
|
45
|
-
/** Title of this schema */
|
|
46
|
-
title?: string;
|
|
47
|
-
/** Description of this schema */
|
|
48
|
-
description?: string;
|
|
49
|
-
/** Default value for this schema */
|
|
50
|
-
default?: any;
|
|
51
|
-
/** Example values matching this schema */
|
|
52
|
-
examples?: any;
|
|
53
|
-
/** Optional annotation for readOnly */
|
|
54
|
-
readOnly?: boolean;
|
|
55
|
-
/** Optional annotation for writeOnly */
|
|
56
|
-
writeOnly?: boolean;
|
|
57
|
-
[prop: string]: any;
|
|
58
|
-
}
|
|
59
|
-
interface TKind {
|
|
60
|
-
[Kind]: string;
|
|
61
|
-
}
|
|
62
|
-
interface TSchema extends TKind, SchemaOptions {
|
|
63
|
-
[ReadonlyKind]?: string;
|
|
64
|
-
[OptionalKind]?: string;
|
|
65
|
-
[Hint]?: string;
|
|
66
|
-
params: unknown[];
|
|
67
|
-
static: unknown;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
declare const envSchema: _alepha_core.TObject<{
|
|
71
|
-
REDIS_CACHE_PREFIX: TOptional<TString>;
|
|
7
|
+
//#region src/providers/RedisCacheProvider.d.ts
|
|
8
|
+
declare const envSchema: _alepha_core2.TObject<{
|
|
9
|
+
REDIS_CACHE_PREFIX: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
72
10
|
}>;
|
|
73
11
|
declare module "alepha" {
|
|
74
|
-
|
|
75
|
-
}
|
|
12
|
+
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
76
13
|
}
|
|
77
14
|
declare class RedisCacheProvider implements CacheProvider {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
15
|
+
protected readonly log: _alepha_core2.Logger;
|
|
16
|
+
protected readonly redisProvider: RedisProvider;
|
|
17
|
+
protected readonly env: {
|
|
18
|
+
REDIS_CACHE_PREFIX?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
protected readonly alepha: Alepha;
|
|
21
|
+
get(name: string, key: string): Promise<Uint8Array | undefined>;
|
|
22
|
+
set(name: string, key: string, value: Uint8Array | string, ttl?: number): Promise<Uint8Array>;
|
|
23
|
+
del(name: string, ...keys: string[]): Promise<void>;
|
|
24
|
+
has(name: string, key: string): Promise<boolean>;
|
|
25
|
+
keys(name: string): Promise<string[]>;
|
|
26
|
+
protected prefix(...path: string[]): string;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/index.d.ts
|
|
92
30
|
/**
|
|
93
31
|
* Alepha Cache Redis Module
|
|
94
32
|
*
|
|
@@ -98,8 +36,9 @@ declare class RedisCacheProvider implements CacheProvider {
|
|
|
98
36
|
* @module alepha.cache.redis
|
|
99
37
|
*/
|
|
100
38
|
declare class AlephaCacheRedis implements Module {
|
|
101
|
-
|
|
102
|
-
|
|
39
|
+
readonly name = "alepha.cache.redis";
|
|
40
|
+
readonly $services: (alepha: Alepha) => Alepha;
|
|
103
41
|
}
|
|
104
|
-
|
|
42
|
+
//#endregion
|
|
105
43
|
export { AlephaCacheRedis, RedisCacheProvider };
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
package/cache/redis.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@alepha/cache-redis'
|
|
1
|
+
export * from '@alepha/cache-redis'
|
package/cache.cjs
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(cache).forEach(function (k) {
|
|
2
|
+
var m = require('@alepha/cache');
|
|
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
|
+
});
|