alepha 0.7.4 → 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.
Files changed (99) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +44 -21
  3. package/cache/redis.cjs +4 -8
  4. package/cache/redis.d.ts +30 -91
  5. package/cache/redis.js +1 -1
  6. package/cache.cjs +4 -8
  7. package/cache.d.ts +190 -259
  8. package/cache.js +1 -1
  9. package/core.cjs +4 -8
  10. package/core.d.ts +950 -925
  11. package/core.js +1 -1
  12. package/datetime.cjs +4 -8
  13. package/datetime.d.ts +151 -140
  14. package/datetime.js +1 -1
  15. package/lock/redis.cjs +7 -49
  16. package/lock/redis.d.ts +17 -14
  17. package/lock/redis.js +1 -47
  18. package/lock.cjs +4 -8
  19. package/lock.d.ts +117 -170
  20. package/lock.js +1 -1
  21. package/package.json +70 -40
  22. package/postgres.cjs +4 -8
  23. package/postgres.d.ts +1314 -4400
  24. package/postgres.js +1 -1
  25. package/queue/redis.cjs +8 -0
  26. package/queue/redis.d.ts +31 -0
  27. package/queue/redis.js +1 -0
  28. package/queue.cjs +4 -8
  29. package/queue.d.ts +162 -205
  30. package/queue.js +1 -1
  31. package/react/auth.cjs +4 -8
  32. package/react/auth.d.ts +167 -280
  33. package/react/auth.js +1 -1
  34. package/react.cjs +4 -8
  35. package/react.d.ts +530 -570
  36. package/react.js +1 -1
  37. package/redis.cjs +4 -8
  38. package/redis.d.ts +59 -132
  39. package/redis.js +1 -1
  40. package/retry.cjs +4 -8
  41. package/retry.d.ts +34 -31
  42. package/retry.js +1 -1
  43. package/scheduler.cjs +4 -8
  44. package/scheduler.d.ts +128 -155
  45. package/scheduler.js +1 -1
  46. package/security.cjs +4 -8
  47. package/security.d.ts +472 -595
  48. package/security.js +1 -1
  49. package/server/cache.cjs +4 -8
  50. package/server/cache.d.ts +73 -39
  51. package/server/cache.js +1 -1
  52. package/server/cookies.cjs +4 -8
  53. package/server/cookies.d.ts +46 -41
  54. package/server/cookies.js +1 -1
  55. package/server/static.cjs +4 -8
  56. package/server/static.d.ts +98 -95
  57. package/server/static.js +1 -1
  58. package/server/swagger.cjs +4 -8
  59. package/server/swagger.d.ts +106 -92
  60. package/server/swagger.js +1 -1
  61. package/server.cjs +4 -8
  62. package/server.d.ts +754 -1025
  63. package/server.js +1 -1
  64. package/testing.cjs +8 -0
  65. package/testing.d.ts +1 -0
  66. package/testing.js +1 -0
  67. package/topic/redis.cjs +8 -0
  68. package/topic/redis.d.ts +45 -0
  69. package/topic/redis.js +1 -0
  70. package/topic.cjs +4 -8
  71. package/topic.d.ts +171 -163
  72. package/topic.js +1 -1
  73. package/vite.cjs +4 -8
  74. package/vite.d.ts +91 -84
  75. package/vite.js +1 -1
  76. package/assets/logo.png +0 -0
  77. package/src/cache/redis.ts +0 -1
  78. package/src/cache.ts +0 -1
  79. package/src/core.ts +0 -1
  80. package/src/datetime.ts +0 -1
  81. package/src/lock/redis.ts +0 -1
  82. package/src/lock.ts +0 -1
  83. package/src/postgres.ts +0 -1
  84. package/src/queue/redis.ts +0 -1
  85. package/src/queue.ts +0 -1
  86. package/src/react/auth.ts +0 -1
  87. package/src/react.ts +0 -1
  88. package/src/redis.ts +0 -1
  89. package/src/retry.ts +0 -1
  90. package/src/scheduler.ts +0 -1
  91. package/src/security.ts +0 -1
  92. package/src/server/cache.ts +0 -1
  93. package/src/server/cookies.ts +0 -1
  94. package/src/server/static.ts +0 -1
  95. package/src/server/swagger.ts +0 -1
  96. package/src/server.ts +0 -1
  97. package/src/topic/redis.ts +0 -1
  98. package/src/topic.ts +0 -1
  99. 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,21 +1,44 @@
1
- <div align="center">
2
-
3
- <img src="./assets/logo.png" alt="Logo" style="width: 256px"/>
4
-
5
- <h1>Alepha</h1>
6
-
7
- <p style="max-width: 512px">
8
- 🚧
9
- </p>
10
-
11
- </div>
12
-
13
- [![npm](https://img.shields.io/npm/v/alepha.svg)](https://www.npmjs.com/package/alepha)
14
- [![license](https://img.shields.io/npm/l/alepha.svg)](https://www.npmjs.com/package/alepha)
15
- [![downloads](https://img.shields.io/npm/dt/alepha.svg)](https://www.npmjs.com/package/alepha)
16
-
17
- ## Installation
18
-
19
- ```bash
20
- npm install alepha
21
- ```
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
- var cacheRedis = require('@alepha/cache-redis');
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 cacheRedis[k]; }
6
+ get: function () { return m[k]; }
11
7
  });
12
- });
8
+ });
package/cache/redis.d.ts CHANGED
@@ -1,94 +1,32 @@
1
- import * as _alepha_core from '@alepha/core';
2
- import { Static, Alepha, Module } from '@alepha/core';
3
- import { CacheProvider } from '@alepha/cache';
4
- import { RedisProvider } from '@alepha/redis';
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
- /** Symbol key applied to readonly types */
7
- declare const ReadonlyKind: unique symbol;
8
- /** Symbol key applied to optional types */
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
- interface Env extends Partial<Static<typeof envSchema>> {
75
- }
12
+ interface Env extends Partial<Static<typeof envSchema>> {}
76
13
  }
77
14
  declare class RedisCacheProvider implements CacheProvider {
78
- protected readonly log: _alepha_core.Logger;
79
- protected readonly redisProvider: RedisProvider;
80
- protected readonly env: {
81
- REDIS_CACHE_PREFIX?: string | undefined;
82
- };
83
- protected readonly alepha: Alepha;
84
- get(name: string, key: string): Promise<Buffer | undefined>;
85
- set(name: string, key: string, value: Buffer | string, ttl?: number): Promise<Buffer>;
86
- del(name: string, ...keys: string[]): Promise<void>;
87
- has(name: string, key: string): Promise<boolean>;
88
- keys(name: string): Promise<string[]>;
89
- protected prefix(...path: string[]): string;
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
  *
@@ -97,9 +35,10 @@ declare class RedisCacheProvider implements CacheProvider {
97
35
  * @see {@link RedisCacheProvider}
98
36
  * @module alepha.cache.redis
99
37
  */
100
- declare class AlephaRedisCache implements Module {
101
- readonly name = "alepha.cache.redis";
102
- readonly $services: (alepha: Alepha) => Alepha;
38
+ declare class AlephaCacheRedis implements Module {
39
+ readonly name = "alepha.cache.redis";
40
+ readonly $services: (alepha: Alepha) => Alepha;
103
41
  }
104
-
105
- export { AlephaRedisCache, RedisCacheProvider };
42
+ //#endregion
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
- var cache = require('@alepha/cache');
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 cache[k]; }
6
+ get: function () { return m[k]; }
11
7
  });
12
- });
8
+ });