alepha 0.10.4 → 0.10.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/README.md +7 -19
- package/api/files.d.ts +200 -125
- package/api/jobs.d.ts +170 -172
- package/api/users.d.ts +216 -215
- package/bucket.d.ts +81 -4
- package/command.d.ts +1 -1
- package/email.d.ts +5 -5
- package/package.json +48 -48
- package/postgres.d.ts +48 -5
- package/react/auth.d.ts +5 -0
- package/react.d.ts +28 -28
- package/security.d.ts +4 -7
- package/server/cache.d.ts +16 -7
- package/server/links.d.ts +2 -2
- package/server/security.d.ts +4 -6
- package/server.d.ts +20 -20
package/server/links.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "alepha/server/security";
|
|
1
|
+
import { ServerRouteSecure } from "alepha/server/security";
|
|
2
2
|
import * as _alepha_core2 from "alepha";
|
|
3
3
|
import { Alepha, Descriptor, KIND, Static } from "alepha";
|
|
4
4
|
import * as _alepha_server0 from "alepha/server";
|
|
@@ -81,7 +81,7 @@ declare class LinkProvider {
|
|
|
81
81
|
protected getLinkByName(name: string, options?: ClientScope): Promise<HttpClientLink>;
|
|
82
82
|
}
|
|
83
83
|
interface HttpClientLink extends ApiLink {
|
|
84
|
-
secured?: boolean;
|
|
84
|
+
secured?: boolean | ServerRouteSecure;
|
|
85
85
|
prefix?: string;
|
|
86
86
|
host?: string;
|
|
87
87
|
service?: string;
|
package/server/security.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ declare class ServerSecurityProvider {
|
|
|
13
13
|
protected readonly onConfigure: _alepha_core1.HookDescriptor<"configure">;
|
|
14
14
|
protected readonly onActionRequest: _alepha_core1.HookDescriptor<"action:onRequest">;
|
|
15
15
|
protected readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
|
|
16
|
+
protected check(user: UserAccountToken, secure: ServerRouteSecure): void;
|
|
16
17
|
/**
|
|
17
18
|
* Get the user account token for a local action call.
|
|
18
19
|
* There are three possible sources for the user:
|
|
@@ -30,11 +31,8 @@ declare class ServerSecurityProvider {
|
|
|
30
31
|
protected createTestUser(): UserAccountToken;
|
|
31
32
|
protected readonly onClientRequest: _alepha_core1.HookDescriptor<"client:onRequest">;
|
|
32
33
|
}
|
|
33
|
-
type ServerRouteSecure =
|
|
34
|
-
|
|
35
|
-
roles?: string[];
|
|
36
|
-
realms?: string[];
|
|
37
|
-
organizations?: string[];
|
|
34
|
+
type ServerRouteSecure = {
|
|
35
|
+
realm?: string;
|
|
38
36
|
};
|
|
39
37
|
//#endregion
|
|
40
38
|
//#region src/index.d.ts
|
|
@@ -62,7 +60,7 @@ declare module "alepha/server" {
|
|
|
62
60
|
* If true, the route will be protected by the security provider.
|
|
63
61
|
* All actions are secure by default, but you can disable it for specific actions.
|
|
64
62
|
*/
|
|
65
|
-
secure?: boolean;
|
|
63
|
+
secure?: boolean | ServerRouteSecure;
|
|
66
64
|
}
|
|
67
65
|
interface ClientRequestOptions extends FetchOptions {
|
|
68
66
|
/**
|
package/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alepha_core1 from "alepha";
|
|
2
2
|
import { Alepha, AlephaError, Async, Descriptor, FileLike, KIND, Static, StreamLike, TArray, TFile, TObject, TRecord, TSchema, TStream, TString, TVoid } from "alepha";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alepha_logger0 from "alepha/logger";
|
|
4
4
|
import { Readable } from "node:stream";
|
|
5
5
|
import { ReadableStream } from "node:stream/web";
|
|
6
6
|
import { Route, RouterProvider } from "alepha/router";
|
|
@@ -176,13 +176,13 @@ declare class ServerRequestParser {
|
|
|
176
176
|
//#region src/providers/ServerTimingProvider.d.ts
|
|
177
177
|
type TimingMap = Record<string, [number, number]>;
|
|
178
178
|
declare class ServerTimingProvider {
|
|
179
|
-
protected readonly log:
|
|
179
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
180
180
|
protected readonly alepha: Alepha;
|
|
181
181
|
options: {
|
|
182
182
|
disabled: boolean;
|
|
183
183
|
};
|
|
184
|
-
readonly onRequest:
|
|
185
|
-
readonly onResponse:
|
|
184
|
+
readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
|
|
185
|
+
readonly onResponse: _alepha_core1.HookDescriptor<"server:onResponse">;
|
|
186
186
|
protected get handlerName(): string;
|
|
187
187
|
beginTiming(name: string): void;
|
|
188
188
|
endTiming(name: string): void;
|
|
@@ -222,7 +222,7 @@ declare class ServerRouterProvider extends RouterProvider<ServerRouteMatcher> {
|
|
|
222
222
|
//#endregion
|
|
223
223
|
//#region src/services/HttpClient.d.ts
|
|
224
224
|
declare class HttpClient {
|
|
225
|
-
protected readonly log:
|
|
225
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
226
226
|
protected readonly alepha: Alepha;
|
|
227
227
|
readonly cache: _alepha_cache0.CacheDescriptorFn<HttpClientCache, any[]>;
|
|
228
228
|
protected readonly pendingRequests: HttpClientPendingRequests;
|
|
@@ -541,7 +541,7 @@ interface ActionDescriptorOptions<TConfig extends RequestConfigSchema> extends O
|
|
|
541
541
|
handler: ServerActionHandler<TConfig>;
|
|
542
542
|
}
|
|
543
543
|
declare class ActionDescriptor<TConfig extends RequestConfigSchema> extends Descriptor<ActionDescriptorOptions<TConfig>> {
|
|
544
|
-
protected readonly log:
|
|
544
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
545
545
|
protected readonly env: {
|
|
546
546
|
SERVER_API_PREFIX: string;
|
|
547
547
|
};
|
|
@@ -713,9 +713,9 @@ declare const okSchema: typebox0.TObject<{
|
|
|
713
713
|
type Ok = Static<typeof okSchema>;
|
|
714
714
|
//#endregion
|
|
715
715
|
//#region src/providers/NodeHttpServerProvider.d.ts
|
|
716
|
-
declare const envSchema:
|
|
717
|
-
SERVER_PORT:
|
|
718
|
-
SERVER_HOST:
|
|
716
|
+
declare const envSchema: _alepha_core1.TObject<{
|
|
717
|
+
SERVER_PORT: _alepha_core1.TInteger;
|
|
718
|
+
SERVER_HOST: _alepha_core1.TString;
|
|
719
719
|
}>;
|
|
720
720
|
declare module "alepha" {
|
|
721
721
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -723,31 +723,31 @@ declare module "alepha" {
|
|
|
723
723
|
declare class NodeHttpServerProvider extends ServerProvider {
|
|
724
724
|
protected readonly alepha: Alepha;
|
|
725
725
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
726
|
-
protected readonly log:
|
|
726
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
727
727
|
protected readonly env: {
|
|
728
728
|
SERVER_PORT: number;
|
|
729
729
|
SERVER_HOST: string;
|
|
730
730
|
};
|
|
731
731
|
protected readonly router: ServerRouterProvider;
|
|
732
732
|
protected readonly server: http0.Server<typeof IncomingMessage, typeof ServerResponse$1>;
|
|
733
|
-
protected readonly onNodeRequest:
|
|
733
|
+
protected readonly onNodeRequest: _alepha_core1.HookDescriptor<"node:request">;
|
|
734
734
|
handle(req: IncomingMessage, res: ServerResponse$1): Promise<void>;
|
|
735
735
|
createRouterRequest(req: IncomingMessage, res: ServerResponse$1, params?: Record<string, string>): ServerRawRequest;
|
|
736
736
|
getProtocol(req: IncomingMessage): "http" | "https";
|
|
737
737
|
get hostname(): string;
|
|
738
|
-
readonly start:
|
|
739
|
-
protected readonly stop:
|
|
738
|
+
readonly start: _alepha_core1.HookDescriptor<"start">;
|
|
739
|
+
protected readonly stop: _alepha_core1.HookDescriptor<"stop">;
|
|
740
740
|
protected listen(): Promise<void>;
|
|
741
741
|
protected close(): Promise<void>;
|
|
742
742
|
}
|
|
743
743
|
//#endregion
|
|
744
744
|
//#region src/providers/ServerLoggerProvider.d.ts
|
|
745
745
|
declare class ServerLoggerProvider {
|
|
746
|
-
protected readonly log:
|
|
746
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
747
747
|
protected readonly alepha: Alepha;
|
|
748
|
-
readonly onRequest:
|
|
749
|
-
readonly onError:
|
|
750
|
-
readonly onResponse:
|
|
748
|
+
readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
|
|
749
|
+
readonly onError: _alepha_core1.HookDescriptor<"server:onError">;
|
|
750
|
+
readonly onResponse: _alepha_core1.HookDescriptor<"server:onResponse">;
|
|
751
751
|
}
|
|
752
752
|
//#endregion
|
|
753
753
|
//#region src/providers/ServerNotReadyProvider.d.ts
|
|
@@ -760,7 +760,7 @@ declare class ServerLoggerProvider {
|
|
|
760
760
|
*/
|
|
761
761
|
declare class ServerNotReadyProvider {
|
|
762
762
|
protected readonly alepha: Alepha;
|
|
763
|
-
readonly onRequest:
|
|
763
|
+
readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
|
|
764
764
|
}
|
|
765
765
|
//#endregion
|
|
766
766
|
//#region src/index.d.ts
|
|
@@ -828,7 +828,7 @@ declare module "alepha" {
|
|
|
828
828
|
* @see {@link $action}
|
|
829
829
|
* @module alepha.server
|
|
830
830
|
*/
|
|
831
|
-
declare const AlephaServer:
|
|
831
|
+
declare const AlephaServer: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
832
832
|
//#endregion
|
|
833
833
|
export { $action, $route, ActionDescriptor, ActionDescriptorFn, ActionDescriptorOptions, AlephaServer, BadRequestError, ClientRequestEntry, ClientRequestEntryContainer, ClientRequestOptions, ClientRequestResponse, ConflictError, ErrorSchema, FetchActionArgs, FetchOptions, FetchResponse, ForbiddenError, HttpAction, HttpClient, HttpClientPendingRequests, HttpError, HttpErrorLike, NodeHttpServerProvider, NotFoundError, Ok, RequestConfigSchema, ResponseBodyType, ResponseKind, RouteDescriptor, RouteDescriptorOptions, RouteMethod, ServerActionHandler, ServerActionRequest, ServerHandler, ServerLoggerProvider, ServerNotReadyProvider, ServerProvider, ServerRawRequest, ServerReply, ServerRequest, ServerRequestConfig, ServerRequestConfigEntry, ServerResponse, ServerResponseBody, ServerRoute, ServerRouteMatcher, ServerRouteRequestHandler, ServerRouterProvider, ServerTimingProvider, TRequestBody, TResponseBody, UnauthorizedError, ValidationError, errorNameByStatus, errorSchema, isHttpError, isMultipart, okSchema, routeMethods };
|
|
834
834
|
//# sourceMappingURL=index.d.ts.map
|