alepha 0.7.0 → 0.7.2

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 (100) hide show
  1. package/README.md +14 -3
  2. package/assets/logo.png +0 -0
  3. package/cache.cjs +0 -1
  4. package/cache.d.ts +30 -13
  5. package/cache.js +0 -1
  6. package/core.cjs +0 -1
  7. package/core.d.ts +465 -196
  8. package/core.js +0 -1
  9. package/datetime.cjs +0 -1
  10. package/datetime.d.ts +68 -79
  11. package/datetime.js +0 -1
  12. package/lock.cjs +0 -1
  13. package/lock.d.ts +3 -14
  14. package/lock.js +0 -1
  15. package/package.json +54 -53
  16. package/postgres.cjs +0 -1
  17. package/postgres.d.ts +3250 -288
  18. package/postgres.js +0 -1
  19. package/queue.cjs +0 -1
  20. package/queue.d.ts +2 -2
  21. package/queue.js +0 -1
  22. package/react/auth.cjs +0 -1
  23. package/react/auth.d.ts +12 -5
  24. package/react/auth.js +0 -1
  25. package/react.cjs +0 -1
  26. package/react.d.ts +317 -206
  27. package/react.js +0 -1
  28. package/redis.cjs +0 -1
  29. package/redis.d.ts +10 -8
  30. package/redis.js +0 -1
  31. package/retry.cjs +12 -0
  32. package/retry.d.ts +68 -0
  33. package/retry.js +1 -0
  34. package/scheduler.cjs +0 -1
  35. package/scheduler.js +0 -1
  36. package/security.cjs +0 -1
  37. package/security.d.ts +82 -35
  38. package/security.js +0 -1
  39. package/server/cookies.cjs +0 -1
  40. package/server/cookies.d.ts +1 -1
  41. package/server/cookies.js +0 -1
  42. package/server/metrics.cjs +0 -1
  43. package/server/metrics.js +0 -1
  44. package/server/static.cjs +0 -1
  45. package/server/static.d.ts +1 -0
  46. package/server/static.js +0 -1
  47. package/server/swagger.cjs +0 -1
  48. package/server/swagger.js +0 -1
  49. package/server.cjs +0 -1
  50. package/server.d.ts +402 -327
  51. package/server.js +0 -1
  52. package/src/retry.ts +1 -0
  53. package/topic.cjs +0 -1
  54. package/topic.d.ts +3 -20
  55. package/topic.js +0 -1
  56. package/vite.cjs +0 -1
  57. package/vite.d.ts +57 -38
  58. package/vite.js +0 -1
  59. package/cache.cjs.map +0 -1
  60. package/cache.js.map +0 -1
  61. package/core.cjs.map +0 -1
  62. package/core.js.map +0 -1
  63. package/datetime.cjs.map +0 -1
  64. package/datetime.js.map +0 -1
  65. package/lock.cjs.map +0 -1
  66. package/lock.js.map +0 -1
  67. package/postgres.cjs.map +0 -1
  68. package/postgres.js.map +0 -1
  69. package/queue.cjs.map +0 -1
  70. package/queue.js.map +0 -1
  71. package/react/auth.cjs.map +0 -1
  72. package/react/auth.js.map +0 -1
  73. package/react.cjs.map +0 -1
  74. package/react.js.map +0 -1
  75. package/redis.cjs.map +0 -1
  76. package/redis.js.map +0 -1
  77. package/scheduler.cjs.map +0 -1
  78. package/scheduler.js.map +0 -1
  79. package/security.cjs.map +0 -1
  80. package/security.js.map +0 -1
  81. package/server/cookies.cjs.map +0 -1
  82. package/server/cookies.js.map +0 -1
  83. package/server/metrics.cjs.map +0 -1
  84. package/server/metrics.js.map +0 -1
  85. package/server/proxy.cjs +0 -13
  86. package/server/proxy.cjs.map +0 -1
  87. package/server/proxy.d.ts +0 -1
  88. package/server/proxy.js +0 -2
  89. package/server/proxy.js.map +0 -1
  90. package/server/static.cjs.map +0 -1
  91. package/server/static.js.map +0 -1
  92. package/server/swagger.cjs.map +0 -1
  93. package/server/swagger.js.map +0 -1
  94. package/server.cjs.map +0 -1
  95. package/server.js.map +0 -1
  96. package/src/server/proxy.ts +0 -1
  97. package/topic.cjs.map +0 -1
  98. package/topic.js.map +0 -1
  99. package/vite.cjs.map +0 -1
  100. package/vite.js.map +0 -1
package/server.js CHANGED
@@ -1,2 +1 @@
1
1
  export * from '@alepha/server';
2
- //# sourceMappingURL=server.js.map
package/src/retry.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "@alepha/retry";
package/topic.cjs CHANGED
@@ -10,4 +10,3 @@ Object.keys(topic).forEach(function (k) {
10
10
  get: function () { return topic[k]; }
11
11
  });
12
12
  });
13
- //# sourceMappingURL=topic.cjs.map
package/topic.d.ts CHANGED
@@ -54,20 +54,20 @@ declare class TopicProvider {
54
54
  * @param topic - The topic to publish to.
55
55
  * @param message - The message to publish.
56
56
  */
57
- publish(topic: string, message: string): Promise<void>;
57
+ publish(_topic: string, _message: string): Promise<void>;
58
58
  /**
59
59
  * Subscribe to a topic.
60
60
  *
61
61
  * @param topic - The topic to subscribe to.
62
62
  * @param callback - The callback to call when a message is received.
63
63
  */
64
- subscribe(topic: string, callback: SubscribeCallback): Promise<UnSubscribeFn>;
64
+ subscribe(_topic: string, _callback: SubscribeCallback): Promise<UnSubscribeFn>;
65
65
  /**
66
66
  * Unsubscribe from a topic.
67
67
  *
68
68
  * @param topic - The topic to unsubscribe from.
69
69
  */
70
- unsubscribe(topic: string): Promise<void>;
70
+ unsubscribe(_topic: string): Promise<void>;
71
71
  }
72
72
  type SubscribeCallback = (message: string) => Promise<void> | void;
73
73
  type UnSubscribeFn = () => Promise<void>;
@@ -184,38 +184,21 @@ declare class RedisTopicProvider implements TopicProvider {
184
184
  };
185
185
  protected readonly redisProvider: RedisProvider;
186
186
  protected readonly redisSubscriberProvider: RedisSubscriberProvider;
187
- protected readonly subscriptions: Record<string, SubscribeCallback[]>;
188
187
  protected readonly log: _alepha_core.Logger;
189
- protected readonly start: _alepha_core.HookDescriptor<"start">;
190
188
  protected readonly stop: _alepha_core.HookDescriptor<"stop">;
191
189
  prefix(queue: string): string;
192
190
  /**
193
191
  * Publish a message to a topic.
194
- *
195
- * @param topic
196
- * @param message
197
192
  */
198
193
  publish(topic: string, message: string): Promise<void>;
199
194
  /**
200
195
  * Subscribe to a topic.
201
- *
202
- * @param name
203
- * @param callback
204
196
  */
205
197
  subscribe(name: string, callback: SubscribeCallback): Promise<UnSubscribeFn>;
206
198
  /**
207
199
  * Unsubscribe from a topic.
208
- *
209
- * @param name
210
- * @param callback
211
200
  */
212
201
  unsubscribe(name: string, callback?: SubscribeCallback): Promise<void>;
213
- /**
214
- * Listen for messages.
215
- *
216
- * @protected
217
- */
218
- protected listen(): void;
219
202
  }
220
203
 
221
204
  declare class TopicDescriptorProvider {
package/topic.js CHANGED
@@ -1,2 +1 @@
1
1
  export * from '@alepha/topic';
2
- //# sourceMappingURL=topic.js.map
package/vite.cjs CHANGED
@@ -10,4 +10,3 @@ Object.keys(vite).forEach(function (k) {
10
10
  get: function () { return vite[k]; }
11
11
  });
12
12
  });
13
- //# sourceMappingURL=vite.cjs.map
package/vite.d.ts CHANGED
@@ -1,42 +1,39 @@
1
- import viteReactPlugin from '@vitejs/plugin-react';
1
+ import { Alepha } from '@alepha/core';
2
2
  import { UserConfig, Plugin } from 'vite';
3
+ import { BrotliOptions, ZlibOptions } from 'node:zlib';
3
4
 
4
5
  interface ViteAlephaBuildOptions {
5
6
  /**
6
7
  * The entry point for the application. This is the file that will be executed when the application is run.
7
8
  *
8
- * @default 'src/index.ts'
9
+ * @default 'src/index.server.ts'
9
10
  */
10
11
  entry?: string;
11
12
  /**
13
+ * If true, the build will be optimized for Vercel deployment.
12
14
  *
13
- */
14
- vercel?: boolean | {
15
- projectId: string;
16
- orgId: string;
17
- settings: any;
18
- };
19
- /**
20
- * A list of modules that should not be externalized in the build process.
15
+ * If `VERCEL_PROJECT_ID` and `VERCEL_ORG_ID` environment variables are set, .vercel will be generated with the correct configuration.
21
16
  *
22
- * @default true
17
+ * @default false
23
18
  */
24
- noExternal?: string | RegExp | (string | RegExp)[] | true;
19
+ vercel?: boolean;
25
20
  /**
26
21
  * Vite server options to override the default server configuration.
27
22
  */
28
- server?: UserConfig;
23
+ server?: false | UserConfig;
24
+ client?: false;
25
+ /**
26
+ * If true, all compatible pages will be pre-rendered.
27
+ */
28
+ prerender?: boolean;
29
29
  }
30
- /**
31
- *
32
- */
33
- declare function viteAlephaBuild(options?: ViteAlephaBuildOptions): Plugin;
30
+ declare function viteAlephaBuild(options?: ViteAlephaBuildOptions): Promise<Plugin>;
34
31
 
35
32
  interface ViteAlephaDevOptions {
36
33
  /**
37
34
  * The entry point for the application. This is the file that will be executed when the application is run.
38
35
  *
39
- * @default 'src/index.ts'
36
+ * @default 'src/index.server.ts'
40
37
  */
41
38
  entry?: string;
42
39
  /**
@@ -45,46 +42,68 @@ interface ViteAlephaDevOptions {
45
42
  * @default false
46
43
  */
47
44
  debug?: boolean;
48
- /**
49
- * Enable or disable Vercel support
50
- */
51
- vercel?: boolean | {
52
- projectId: string;
53
- orgId: string;
54
- settings: any;
55
- };
56
45
  }
57
46
  /**
58
47
  *
59
48
  */
60
- declare function viteAlephaDev(options?: ViteAlephaDevOptions): Plugin;
49
+ declare function viteAlephaDev(options?: ViteAlephaDevOptions): Promise<Plugin>;
61
50
 
62
51
  type ViteAlephaOptions = ViteAlephaDevOptions & ViteAlephaBuildOptions;
63
- declare function viteAlepha(options?: ViteAlephaOptions): Plugin[];
52
+ declare function viteAlepha(options?: ViteAlephaOptions): (Plugin | Promise<Plugin>)[];
64
53
 
65
54
  interface ViteAlephaBuildVercelOptions {
66
55
  /**
67
- * The name of the output file.
56
+ * The directory where the build output will be placed.
68
57
  *
69
- * @default 'index'
58
+ * @default "dist"
70
59
  */
71
- filename?: string;
60
+ distDir?: string;
72
61
  /**
73
62
  * The name of the client directory.
74
63
  *
75
- * @default 'client'
64
+ * @default "public"
76
65
  */
77
- client?: string;
66
+ clientDir?: string;
78
67
  }
79
- /**
80
- *
81
- */
82
68
  declare function viteAlephaBuildVercel(opts?: ViteAlephaBuildVercelOptions): {
83
69
  name: string;
84
70
  apply: string;
85
71
  writeBundle(): void;
86
72
  };
87
73
 
88
- declare const viteReact: typeof viteReactPlugin;
74
+ interface ViteCompressOptions {
75
+ /**
76
+ * If true, the plugin will not compress the files.
77
+ *
78
+ * @default false
79
+ */
80
+ disabled?: boolean;
81
+ /**
82
+ * If true, the plugin will compress the files using brotli.
83
+ * Can also be an object with brotli options.
84
+ *
85
+ * @default true
86
+ */
87
+ brotli?: boolean | BrotliOptions;
88
+ /**
89
+ * If true, the plugin will compress the files using gzip.
90
+ * Can also be an object with gzip options.
91
+ *
92
+ * @default true
93
+ */
94
+ gzip?: boolean | ZlibOptions;
95
+ /**
96
+ * A filter to determine which files to compress.
97
+ * Can be a RegExp or a function that returns true for files to compress.
98
+ *
99
+ * @default /\.(js|mjs|cjs|css|wasm|svg)$/
100
+ */
101
+ filter?: RegExp | ((fileName: string) => boolean);
102
+ }
103
+ declare function viteCompress(options?: ViteCompressOptions): Plugin;
104
+
105
+ declare global {
106
+ var __alepha: Alepha;
107
+ }
89
108
 
90
- export { type ViteAlephaBuildOptions, type ViteAlephaBuildVercelOptions, type ViteAlephaDevOptions, type ViteAlephaOptions, viteAlepha, viteAlephaBuild, viteAlephaBuildVercel, viteAlephaDev, viteReact };
109
+ export { type ViteAlephaBuildOptions, type ViteAlephaBuildVercelOptions, type ViteAlephaDevOptions, type ViteAlephaOptions, type ViteCompressOptions, viteAlepha, viteAlephaBuild, viteAlephaBuildVercel, viteAlephaDev, viteCompress };
package/vite.js CHANGED
@@ -1,2 +1 @@
1
1
  export * from '@alepha/vite';
2
- //# sourceMappingURL=vite.js.map
package/cache.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/cache.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/core.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"core.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/core.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"core.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/datetime.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"datetime.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/datetime.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"datetime.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/lock.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"lock.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/lock.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"lock.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/postgres.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"postgres.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/postgres.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"postgres.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/queue.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"queue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/queue.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"queue.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/react/auth.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/react.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"react.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/react.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/redis.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/redis.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/scheduler.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"scheduler.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/scheduler.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"scheduler.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/security.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"security.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/security.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"security.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cookies.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cookies.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/server/proxy.cjs DELETED
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- var serverProxy = require('@alepha/server-proxy');
4
-
5
-
6
-
7
- Object.keys(serverProxy).forEach(function (k) {
8
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
9
- enumerable: true,
10
- get: function () { return serverProxy[k]; }
11
- });
12
- });
13
- //# sourceMappingURL=proxy.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proxy.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/server/proxy.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from '@alepha/server-proxy';
package/server/proxy.js DELETED
@@ -1,2 +0,0 @@
1
- export * from '@alepha/server-proxy';
2
- //# sourceMappingURL=proxy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proxy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"static.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"static.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"swagger.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"swagger.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/server.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/server.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export * from "@alepha/server-proxy";
package/topic.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"topic.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/topic.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"topic.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/vite.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/vite.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}