alepha 0.7.3 → 0.7.5

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/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _alepha_core from '@alepha/core';
2
- import { Static as Static$1, TObject as TObject$1, TSchema as TSchema$2, Async, StreamLike, Alepha, FileLike, OPTIONS, KIND, Service } from '@alepha/core';
2
+ import { Static as Static$1, TObject as TObject$1, TSchema as TSchema$2, Async, StreamLike, Alepha, FileLike, OPTIONS, KIND, Module } from '@alepha/core';
3
3
  export { KIND } from '@alepha/core';
4
4
  import { UserAccountToken, Permission, ServiceAccountDescriptor as ServiceAccountDescriptor$1, SecurityProvider, JwtProvider } from '@alepha/security';
5
5
  import { IncomingMessage, ServerResponse as ServerResponse$1 } from 'node:http';
@@ -1120,8 +1120,6 @@ type Ok = Static$1<typeof okSchema>;
1120
1120
  declare const envSchema: _alepha_core.TObject<{
1121
1121
  SERVER_LINKS_ENABLED: TBoolean;
1122
1122
  SERVER_HEALTH_ENABLED: TBoolean;
1123
- SERVER_NOT_READY_ENABLED: TBoolean;
1124
- SERVER_TIMING_ENABLED: TOptional<TBoolean>;
1125
1123
  }>;
1126
1124
  declare module "@alepha/core" {
1127
1125
  interface Hooks {
@@ -1168,16 +1166,13 @@ declare module "@alepha/core" {
1168
1166
  interface Env extends Partial<Static$1<typeof envSchema>> {
1169
1167
  }
1170
1168
  }
1171
- declare class ServerModule {
1172
- static plugins: Array<Service>;
1169
+ declare class AlephaServer implements Module {
1173
1170
  protected readonly env: {
1174
- SERVER_TIMING_ENABLED?: boolean | undefined;
1175
1171
  SERVER_LINKS_ENABLED: boolean;
1176
1172
  SERVER_HEALTH_ENABLED: boolean;
1177
- SERVER_NOT_READY_ENABLED: boolean;
1178
1173
  };
1179
- protected readonly alepha: Alepha;
1180
- constructor();
1174
+ readonly name = "alepha.server";
1175
+ readonly $services: (alepha: Alepha) => void;
1181
1176
  }
1182
1177
 
1183
- export { $action, $client, $proxy, $remote, $route, type ActionDescriptor, type ActionDescriptorOptions, type ApiLink, type ApiLinksResponse, BadRequestError, type ClientRequestEntry, type ClientRequestEntryContainer, type ClientRequestOptions, type ClientRequestResponse, type ClientScope, ConflictError, type FetchFactoryAdditionalOptions, type FetchLinkArgs, type FetchResponse, type FetchRunOptions, ForbiddenError, HttpClient, type HttpClientLink, type HttpClientPendingRequests, HttpError, type HttpErrorLike, type HttpVirtualClient, NodeHttpServerProvider, NotFoundError, type Ok, type ProxyDescriptor, type ProxyDescriptorOptions, ProxyDescriptorProvider, type RemoteDescriptor, type RemoteDescriptorOptions, RemoteDescriptorProvider, type RequestConfigSchema, type ResponseBodyType, type ResponseType, type RouteDescriptor, type RouteDescriptorOptions, type RouteMethod, ServerActionDescriptorProvider, type ServerHandler, ServerHealthProvider, ServerLinksProvider, ServerLoggerProvider, type ServerMiddlewareHandler, ServerModule, ServerMultipartProvider, ServerNotReadyProvider, ServerProvider, type ServerRawRequest, type ServerRemote, type ServerReply, type ServerRequest, type ServerRequestConfig, type ServerRequestConfigEntry, type ServerResponse, type ServerResponseBody, type ServerRoute, type ServerRouteAction, type ServerRouteSecure, type ServerRouteWithHandler, ServerRouterProvider, ServerSecurityProvider, ServerTimingProvider, UnauthorizedError, ValidationError, apiLinkSchema, apiLinksResponseSchema, errorNameByStatus, errorSchema, isHttpError, isServerAction, okSchema, routeMethods };
1178
+ export { $action, $client, $proxy, $remote, $route, type ActionDescriptor, type ActionDescriptorOptions, AlephaServer, type ApiLink, type ApiLinksResponse, BadRequestError, type ClientRequestEntry, type ClientRequestEntryContainer, type ClientRequestOptions, type ClientRequestResponse, type ClientScope, ConflictError, type FetchFactoryAdditionalOptions, type FetchLinkArgs, type FetchResponse, type FetchRunOptions, ForbiddenError, HttpClient, type HttpClientLink, type HttpClientPendingRequests, HttpError, type HttpErrorLike, type HttpVirtualClient, NodeHttpServerProvider, NotFoundError, type Ok, type ProxyDescriptor, type ProxyDescriptorOptions, ProxyDescriptorProvider, type RemoteDescriptor, type RemoteDescriptorOptions, RemoteDescriptorProvider, type RequestConfigSchema, type ResponseBodyType, type ResponseType, type RouteDescriptor, type RouteDescriptorOptions, type RouteMethod, ServerActionDescriptorProvider, type ServerHandler, ServerHealthProvider, ServerLinksProvider, ServerLoggerProvider, type ServerMiddlewareHandler, ServerMultipartProvider, ServerNotReadyProvider, ServerProvider, type ServerRawRequest, type ServerRemote, type ServerReply, type ServerRequest, type ServerRequestConfig, type ServerRequestConfigEntry, type ServerResponse, type ServerResponseBody, type ServerRoute, type ServerRouteAction, type ServerRouteSecure, type ServerRouteWithHandler, ServerRouterProvider, ServerSecurityProvider, ServerTimingProvider, UnauthorizedError, ValidationError, apiLinkSchema, apiLinksResponseSchema, errorNameByStatus, errorSchema, isHttpError, isServerAction, okSchema, routeMethods };
@@ -0,0 +1 @@
1
+ export * from "@alepha/cache-redis";
@@ -0,0 +1 @@
1
+ export * from "@alepha/lock-redis";
@@ -0,0 +1 @@
1
+ export * from "@alepha/queue-redis";
@@ -0,0 +1 @@
1
+ export * from "@alepha/topic-redis";
package/topic.d.ts CHANGED
@@ -1,50 +1,6 @@
1
1
  import * as _alepha_core from '@alepha/core';
2
- import { TSchema as TSchema$1, KIND, OPTIONS, Static, Alepha } from '@alepha/core';
2
+ import { TSchema, KIND, OPTIONS, Static, Alepha, Module } from '@alepha/core';
3
3
  import { DurationLike, DateTimeProvider } from '@alepha/datetime';
4
- import { RedisProvider, RedisSubscriberProvider } from '@alepha/redis';
5
-
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
- interface TUnsafe<T> extends TSchema {
16
- [Kind]: string;
17
- static: T;
18
- }
19
-
20
- interface SchemaOptions {
21
- $schema?: string;
22
- /** Id for this schema */
23
- $id?: string;
24
- /** Title of this schema */
25
- title?: string;
26
- /** Description of this schema */
27
- description?: string;
28
- /** Default value for this schema */
29
- default?: any;
30
- /** Example values matching this schema */
31
- examples?: any;
32
- /** Optional annotation for readOnly */
33
- readOnly?: boolean;
34
- /** Optional annotation for writeOnly */
35
- writeOnly?: boolean;
36
- [prop: string]: any;
37
- }
38
- interface TKind {
39
- [Kind]: string;
40
- }
41
- interface TSchema extends TKind, SchemaOptions {
42
- [ReadonlyKind]?: string;
43
- [OptionalKind]?: string;
44
- [Hint]?: string;
45
- params: unknown[];
46
- static: unknown;
47
- }
48
4
 
49
5
  declare class TopicProvider {
50
6
  constructor();
@@ -74,8 +30,8 @@ type UnSubscribeFn = () => Promise<void>;
74
30
 
75
31
  declare const KEY$1 = "TOPIC";
76
32
  interface TopicMessageSchema {
77
- headers?: TSchema$1;
78
- payload: TSchema$1;
33
+ headers?: TSchema;
34
+ payload: TSchema;
79
35
  }
80
36
  interface TopicDescriptorOptions<T extends TopicMessageSchema = TopicMessageSchema> {
81
37
  name?: string;
@@ -178,29 +134,6 @@ declare class MemoryTopicProvider implements TopicProvider {
178
134
  unsubscribe(topic: string): Promise<void>;
179
135
  }
180
136
 
181
- declare class RedisTopicProvider implements TopicProvider {
182
- protected readonly env: {
183
- REDIS_TOPIC_PREFIX: string;
184
- };
185
- protected readonly redisProvider: RedisProvider;
186
- protected readonly redisSubscriberProvider: RedisSubscriberProvider;
187
- protected readonly log: _alepha_core.Logger;
188
- protected readonly stop: _alepha_core.HookDescriptor<"stop">;
189
- prefix(queue: string): string;
190
- /**
191
- * Publish a message to a topic.
192
- */
193
- publish(topic: string, message: string): Promise<void>;
194
- /**
195
- * Subscribe to a topic.
196
- */
197
- subscribe(name: string, callback: SubscribeCallback): Promise<UnSubscribeFn>;
198
- /**
199
- * Unsubscribe from a topic.
200
- */
201
- unsubscribe(name: string, callback?: SubscribeCallback): Promise<void>;
202
- }
203
-
204
137
  declare class TopicDescriptorProvider {
205
138
  protected readonly log: _alepha_core.Logger;
206
139
  protected readonly alepha: Alepha;
@@ -267,19 +200,20 @@ declare class TopicDescriptorProvider {
267
200
  };
268
201
  }
269
202
 
270
- declare const envSchema: _alepha_core.TObject<{
271
- TOPIC_PROVIDER: TUnsafe<"memory" | "redis">;
272
- }>;
273
- declare module "alepha" {
274
- interface Env extends Partial<Static<typeof envSchema>> {
275
- }
276
- }
277
- declare class TopicModule {
278
- protected readonly alepha: Alepha;
279
- protected readonly env: {
280
- TOPIC_PROVIDER: "memory" | "redis";
281
- };
282
- constructor();
203
+ /**
204
+ * Alepha Topic Module
205
+ *
206
+ * Generic interface for pub/sub messaging.
207
+ * Gives you the ability to create topics and subscribers.
208
+ * This module provides only a memory implementation of the topic provider.
209
+ *
210
+ * @see {@link $topic}
211
+ * @see {@link $subscriber}
212
+ * @module alepha.topic
213
+ */
214
+ declare class AlephaTopic implements Module {
215
+ readonly name = "alepha.topic";
216
+ readonly $services: (alepha: Alepha) => Alepha;
283
217
  }
284
218
 
285
- export { $subscriber, $topic, MemoryTopicProvider, RedisTopicProvider, type SubscribeCallback, type SubscriberDescriptor, type SubscriberDescriptorOptions, type TopicDescriptor, type TopicDescriptorOptions, TopicDescriptorProvider, type TopicMessage, type TopicMessageSchema, TopicModule, TopicProvider, TopicTimeoutError, type TopicWaitOptions, type UnSubscribeFn };
219
+ export { $subscriber, $topic, AlephaTopic, MemoryTopicProvider, type SubscribeCallback, type SubscriberDescriptor, type SubscriberDescriptorOptions, type TopicDescriptor, type TopicDescriptorOptions, TopicDescriptorProvider, type TopicMessage, type TopicMessageSchema, TopicProvider, TopicTimeoutError, type TopicWaitOptions, type UnSubscribeFn };
package/vite.d.ts CHANGED
@@ -59,11 +59,11 @@ interface ViteAlephaBuildVercelOptions {
59
59
  */
60
60
  clientDir?: string;
61
61
  }
62
- declare function viteAlephaBuildVercel(opts?: ViteAlephaBuildVercelOptions): {
62
+ declare function viteAlephaBuildVercel(opts?: ViteAlephaBuildVercelOptions): Promise<{
63
63
  name: string;
64
64
  apply: string;
65
65
  writeBundle(): void;
66
- };
66
+ }>;
67
67
 
68
68
  interface ViteCompressOptions {
69
69
  /**
package/assets/logo.png DELETED
Binary file