@clairejs/server 3.6.22 → 3.7.1
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/.prettierrc +8 -8
- package/README.md +685 -677
- package/dist/common/FileOperation.d.ts +5 -5
- package/dist/common/ServerModelMetadata.d.ts +10 -10
- package/dist/common/auth/AbstractPrincipalResolver.d.ts +4 -4
- package/dist/common/auth/IPrincipal.d.ts +4 -4
- package/dist/common/constants.d.ts +1 -1
- package/dist/common/request/EndpointMetadata.d.ts +40 -40
- package/dist/common/request/HttpData.d.ts +1 -1
- package/dist/common/request/HttpEndpoint.d.ts +8 -8
- package/dist/common/request/JobData.d.ts +1 -1
- package/dist/common/request/MountedEndpointInfo.d.ts +6 -6
- package/dist/common/request/RequestOptions.d.ts +6 -6
- package/dist/common/request/SocketData.d.ts +1 -1
- package/dist/common/request/types.d.ts +1 -1
- package/dist/http/auth/AbstractHttpAuthorizationProvider.d.ts +9 -9
- package/dist/http/auth/AbstractRbacAuthProvider.d.ts +18 -18
- package/dist/http/auth/RedisRbacAuthProvider.d.ts +23 -23
- package/dist/http/auth/SocketRbacAuthProvider.d.ts +25 -25
- package/dist/http/auth/rbac.d.ts +34 -34
- package/dist/http/common/HttpRequest.d.ts +37 -37
- package/dist/http/common/HttpResponse.d.ts +25 -25
- package/dist/http/controller/AbstractHttpController.d.ts +9 -9
- package/dist/http/controller/AbstractHttpMiddleware.d.ts +5 -5
- package/dist/http/controller/AbstractHttpRequestHandler.d.ts +16 -16
- package/dist/http/controller/ControllerMetadata.d.ts +6 -6
- package/dist/http/controller/CrudHttpController.d.ts +55 -55
- package/dist/http/controller/DefaultHttpRequestHandler.d.ts +19 -19
- package/dist/http/decorators.d.ts +32 -32
- package/dist/http/file-upload/AbstractFileUploadHandler.d.ts +6 -6
- package/dist/http/file-upload/FileUploadHandler.d.ts +10 -10
- package/dist/http/file-upload/types.d.ts +3 -3
- package/dist/http/repository/AbstractRepository.d.ts +10 -10
- package/dist/http/repository/DtoRepository.d.ts +58 -58
- package/dist/http/repository/ICrudRepository.d.ts +27 -27
- package/dist/http/repository/ModelRepository.d.ts +37 -37
- package/dist/http/security/AbstractAccessCondition.d.ts +7 -7
- package/dist/http/security/access-conditions/DtoFieldValidation.d.ts +4 -4
- package/dist/http/security/access-conditions/FilterModelFieldAccessCondition.d.ts +4 -4
- package/dist/http/security/access-conditions/MaximumQueryLimit.d.ts +8 -8
- package/dist/index.d.ts +53 -55
- package/dist/index.js +1 -1
- package/dist/job/AbstractJobController.d.ts +4 -4
- package/dist/job/AbstractJobRepository.d.ts +17 -0
- package/dist/job/AbstractJobScheduler.d.ts +38 -8
- package/dist/job/AwsJobScheduler.d.ts +47 -5
- package/dist/job/LocalJobScheduler.d.ts +88 -21
- package/dist/job/decorators.d.ts +5 -4
- package/dist/job/interfaces.d.ts +49 -16
- package/dist/logging/FileLogMedium.d.ts +13 -13
- package/dist/service/AbstractCacheService.d.ts +22 -22
- package/dist/service/AbstractFileService.d.ts +8 -8
- package/dist/service/AbstractService.d.ts +7 -7
- package/dist/socket/AbstractServerSocket.d.ts +18 -18
- package/dist/socket/AbstractServerSocketManager.d.ts +46 -46
- package/dist/socket/AbstractSocketConnectionHandler.d.ts +6 -6
- package/dist/socket/AbstractSocketController.d.ts +14 -14
- package/dist/socket/AwsSocketManager.d.ts +30 -30
- package/dist/socket/IServerSocket.d.ts +16 -16
- package/dist/socket/LocalSocketManager.d.ts +47 -47
- package/dist/system/ClaireServer.d.ts +13 -13
- package/dist/system/ExpressWrapper.d.ts +17 -17
- package/dist/system/LambdaWrapper.d.ts +20 -19
- package/dist/system/ServerGlobalStore.d.ts +5 -5
- package/dist/system/errors.d.ts +14 -14
- package/dist/system/lamba-request-mapper.d.ts +17 -12
- package/package.json +61 -59
- package/dist/job/AbstractJobExecutor.d.ts +0 -10
- package/dist/job/AwsJobExecutor.d.ts +0 -8
- package/dist/job/LocalJobExecutor.d.ts +0 -8
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { AbstractLogger, IInit } from "@clairejs/core";
|
|
2
|
-
import { AbstractHttpRequestHandler } from "../http/controller/AbstractHttpRequestHandler";
|
|
3
|
-
import { AbstractServerSocketManager, ServerSocketInfo } from "./AbstractServerSocketManager";
|
|
4
|
-
import { AbstractServerSocket } from "./AbstractServerSocket";
|
|
5
|
-
import { AbstractHttpAuthorizationProvider } from "../http/auth/AbstractHttpAuthorizationProvider";
|
|
6
|
-
import { IPrincipal } from "../common/auth/IPrincipal";
|
|
7
|
-
import { IServerSocket } from "./IServerSocket";
|
|
8
|
-
export declare class AwsSocketManager extends AbstractServerSocketManager implements IInit {
|
|
9
|
-
protected readonly authenticationRequired: boolean;
|
|
10
|
-
protected readonly region: string;
|
|
11
|
-
protected readonly socketDomainUrl: string;
|
|
12
|
-
protected readonly redisServerUrl: string;
|
|
13
|
-
protected readonly httpRequestHandler: AbstractHttpRequestHandler;
|
|
14
|
-
protected readonly authorizationProvider: AbstractHttpAuthorizationProvider<IPrincipal>;
|
|
15
|
-
protected readonly authResolver: (queries?: any) => any;
|
|
16
|
-
protected readonly logger: AbstractLogger;
|
|
17
|
-
private readonly apiGatewayManagement;
|
|
18
|
-
constructor(authenticationRequired: boolean, region: string, socketDomainUrl: string, redisServerUrl: string, httpRequestHandler: AbstractHttpRequestHandler, authorizationProvider: AbstractHttpAuthorizationProvider<IPrincipal>, authResolver: (queries?: any) => any, logger: AbstractLogger);
|
|
19
|
-
init(): Promise<void>;
|
|
20
|
-
exit(): void;
|
|
21
|
-
removeSocketFromRedis(socketId: string): Promise<void>;
|
|
22
|
-
physicSend(socketId: string, data: any): Promise<void>;
|
|
23
|
-
configure(data?: any): void;
|
|
24
|
-
getSocketsByChannel(channel: string): Promise<IServerSocket[]>;
|
|
25
|
-
broadcastToChannel(channel: string, data: any): Promise<void>;
|
|
26
|
-
addSocket(socketInfo: ServerSocketInfo, data: any): Promise<AbstractServerSocket>;
|
|
27
|
-
removeSocket(socketId: string, physicRemove?: boolean): Promise<void>;
|
|
28
|
-
private getSocketBySerialized;
|
|
29
|
-
getById(socketId: string): Promise<AbstractServerSocket | undefined>;
|
|
30
|
-
}
|
|
1
|
+
import { AbstractLogger, IInit } from "@clairejs/core";
|
|
2
|
+
import { AbstractHttpRequestHandler } from "../http/controller/AbstractHttpRequestHandler";
|
|
3
|
+
import { AbstractServerSocketManager, ServerSocketInfo } from "./AbstractServerSocketManager";
|
|
4
|
+
import { AbstractServerSocket } from "./AbstractServerSocket";
|
|
5
|
+
import { AbstractHttpAuthorizationProvider } from "../http/auth/AbstractHttpAuthorizationProvider";
|
|
6
|
+
import { IPrincipal } from "../common/auth/IPrincipal";
|
|
7
|
+
import { IServerSocket } from "./IServerSocket";
|
|
8
|
+
export declare class AwsSocketManager extends AbstractServerSocketManager implements IInit {
|
|
9
|
+
protected readonly authenticationRequired: boolean;
|
|
10
|
+
protected readonly region: string;
|
|
11
|
+
protected readonly socketDomainUrl: string;
|
|
12
|
+
protected readonly redisServerUrl: string;
|
|
13
|
+
protected readonly httpRequestHandler: AbstractHttpRequestHandler;
|
|
14
|
+
protected readonly authorizationProvider: AbstractHttpAuthorizationProvider<IPrincipal>;
|
|
15
|
+
protected readonly authResolver: (queries?: any) => any;
|
|
16
|
+
protected readonly logger: AbstractLogger;
|
|
17
|
+
private readonly apiGatewayManagement;
|
|
18
|
+
constructor(authenticationRequired: boolean, region: string, socketDomainUrl: string, redisServerUrl: string, httpRequestHandler: AbstractHttpRequestHandler, authorizationProvider: AbstractHttpAuthorizationProvider<IPrincipal>, authResolver: (queries?: any) => any, logger: AbstractLogger);
|
|
19
|
+
init(): Promise<void>;
|
|
20
|
+
exit(): void;
|
|
21
|
+
removeSocketFromRedis(socketId: string): Promise<void>;
|
|
22
|
+
physicSend(socketId: string, data: any): Promise<void>;
|
|
23
|
+
configure(data?: any): void;
|
|
24
|
+
getSocketsByChannel(channel: string): Promise<IServerSocket[]>;
|
|
25
|
+
broadcastToChannel(channel: string, data: any): Promise<void>;
|
|
26
|
+
addSocket(socketInfo: ServerSocketInfo, data: any): Promise<AbstractServerSocket>;
|
|
27
|
+
removeSocket(socketId: string, physicRemove?: boolean): Promise<void>;
|
|
28
|
+
private getSocketBySerialized;
|
|
29
|
+
getById(socketId: string): Promise<AbstractServerSocket | undefined>;
|
|
30
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { IPrincipal } from "../common/auth/IPrincipal";
|
|
2
|
-
export interface IServerSocket {
|
|
3
|
-
getId(): string;
|
|
4
|
-
getAuthInfo(): IPrincipal | undefined;
|
|
5
|
-
/**
|
|
6
|
-
* Send back data to client
|
|
7
|
-
* @param data The data to send, will be serialized using JSON.stringify
|
|
8
|
-
*/
|
|
9
|
-
send(data: any, channel?: string): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Disconnect the socket and optionally provide the error which cause the disconnection.
|
|
12
|
-
* The client socket will treat this error as intended reason for socket termination.
|
|
13
|
-
* @param err The error which cause the disconnection
|
|
14
|
-
*/
|
|
15
|
-
disconnect(err?: any): Promise<void>;
|
|
16
|
-
}
|
|
1
|
+
import { IPrincipal } from "../common/auth/IPrincipal";
|
|
2
|
+
export interface IServerSocket {
|
|
3
|
+
getId(): string;
|
|
4
|
+
getAuthInfo(): IPrincipal | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Send back data to client
|
|
7
|
+
* @param data The data to send, will be serialized using JSON.stringify
|
|
8
|
+
*/
|
|
9
|
+
send(data: any, channel?: string): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Disconnect the socket and optionally provide the error which cause the disconnection.
|
|
12
|
+
* The client socket will treat this error as intended reason for socket termination.
|
|
13
|
+
* @param err The error which cause the disconnection
|
|
14
|
+
*/
|
|
15
|
+
disconnect(err?: any): Promise<void>;
|
|
16
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { AbstractLogger, IInit } from "@clairejs/core";
|
|
3
|
-
import WebSocket from "ws";
|
|
4
|
-
import { Server } from "http";
|
|
5
|
-
import { AbstractServerSocketManager, ChannelInfo, ServerSocketInfo } from "./AbstractServerSocketManager";
|
|
6
|
-
import { AbstractServerSocket } from "./AbstractServerSocket";
|
|
7
|
-
import { AbstractHttpAuthorizationProvider } from "../http/auth/AbstractHttpAuthorizationProvider";
|
|
8
|
-
import { IServerSocket } from "./IServerSocket";
|
|
9
|
-
export declare class LocalSocketManager extends AbstractServerSocketManager implements IInit {
|
|
10
|
-
protected readonly authenticationRequired: boolean;
|
|
11
|
-
protected readonly redisServerUrl: string;
|
|
12
|
-
protected readonly logger: AbstractLogger;
|
|
13
|
-
protected readonly authProvider: AbstractHttpAuthorizationProvider;
|
|
14
|
-
protected readonly authResolver: (queries?: any) => any;
|
|
15
|
-
/**
|
|
16
|
-
* Use to subscribe to the socket-self channels
|
|
17
|
-
*/
|
|
18
|
-
private readonly subClient;
|
|
19
|
-
/**
|
|
20
|
-
* Use to subscribe to channels
|
|
21
|
-
*/
|
|
22
|
-
private readonly channelSubClient;
|
|
23
|
-
/**
|
|
24
|
-
* Use to publish data
|
|
25
|
-
*/
|
|
26
|
-
private readonly sendClient;
|
|
27
|
-
private allSockets;
|
|
28
|
-
private subscribedChannels;
|
|
29
|
-
constructor(authenticationRequired: boolean, redisServerUrl: string, logger: AbstractLogger, authProvider: AbstractHttpAuthorizationProvider, authResolver: (queries?: any) => any);
|
|
30
|
-
init(): Promise<void>;
|
|
31
|
-
exit(): void;
|
|
32
|
-
private channelMessageListenner;
|
|
33
|
-
private socketMessageListener;
|
|
34
|
-
protected getUniqueDataChannelName(channel: string): string;
|
|
35
|
-
protected getSocketChannelKeyPrefix(): string;
|
|
36
|
-
protected getSocketChannelKey(socketId: string): string;
|
|
37
|
-
broadcastToChannel(channel: string, data: any): Promise<void>;
|
|
38
|
-
addSocketToChannel(socketId: string, channelInfos: ChannelInfo[]): Promise<AbstractServerSocket | undefined>;
|
|
39
|
-
removeSocketFromChannel(socketId: string, channels: string[], persist?: boolean): Promise<void>;
|
|
40
|
-
addSocket(socketInfo: ServerSocketInfo, { socket }: {
|
|
41
|
-
socket: WebSocket;
|
|
42
|
-
}): Promise<AbstractServerSocket>;
|
|
43
|
-
removeSocket(socketId: string, physicRemove?: boolean): Promise<void>;
|
|
44
|
-
getById(socketId: string): Promise<AbstractServerSocket | undefined>;
|
|
45
|
-
getSocketsByChannel(channel: string): Promise<IServerSocket[]>;
|
|
46
|
-
configure(httpServer?: Server): void;
|
|
47
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { AbstractLogger, IInit } from "@clairejs/core";
|
|
3
|
+
import WebSocket from "ws";
|
|
4
|
+
import { Server } from "http";
|
|
5
|
+
import { AbstractServerSocketManager, ChannelInfo, ServerSocketInfo } from "./AbstractServerSocketManager";
|
|
6
|
+
import { AbstractServerSocket } from "./AbstractServerSocket";
|
|
7
|
+
import { AbstractHttpAuthorizationProvider } from "../http/auth/AbstractHttpAuthorizationProvider";
|
|
8
|
+
import { IServerSocket } from "./IServerSocket";
|
|
9
|
+
export declare class LocalSocketManager extends AbstractServerSocketManager implements IInit {
|
|
10
|
+
protected readonly authenticationRequired: boolean;
|
|
11
|
+
protected readonly redisServerUrl: string;
|
|
12
|
+
protected readonly logger: AbstractLogger;
|
|
13
|
+
protected readonly authProvider: AbstractHttpAuthorizationProvider;
|
|
14
|
+
protected readonly authResolver: (queries?: any) => any;
|
|
15
|
+
/**
|
|
16
|
+
* Use to subscribe to the socket-self channels
|
|
17
|
+
*/
|
|
18
|
+
private readonly subClient;
|
|
19
|
+
/**
|
|
20
|
+
* Use to subscribe to channels
|
|
21
|
+
*/
|
|
22
|
+
private readonly channelSubClient;
|
|
23
|
+
/**
|
|
24
|
+
* Use to publish data
|
|
25
|
+
*/
|
|
26
|
+
private readonly sendClient;
|
|
27
|
+
private allSockets;
|
|
28
|
+
private subscribedChannels;
|
|
29
|
+
constructor(authenticationRequired: boolean, redisServerUrl: string, logger: AbstractLogger, authProvider: AbstractHttpAuthorizationProvider, authResolver: (queries?: any) => any);
|
|
30
|
+
init(): Promise<void>;
|
|
31
|
+
exit(): void;
|
|
32
|
+
private channelMessageListenner;
|
|
33
|
+
private socketMessageListener;
|
|
34
|
+
protected getUniqueDataChannelName(channel: string): string;
|
|
35
|
+
protected getSocketChannelKeyPrefix(): string;
|
|
36
|
+
protected getSocketChannelKey(socketId: string): string;
|
|
37
|
+
broadcastToChannel(channel: string, data: any): Promise<void>;
|
|
38
|
+
addSocketToChannel(socketId: string, channelInfos: ChannelInfo[]): Promise<AbstractServerSocket | undefined>;
|
|
39
|
+
removeSocketFromChannel(socketId: string, channels: string[], persist?: boolean): Promise<void>;
|
|
40
|
+
addSocket(socketInfo: ServerSocketInfo, { socket }: {
|
|
41
|
+
socket: WebSocket;
|
|
42
|
+
}): Promise<AbstractServerSocket>;
|
|
43
|
+
removeSocket(socketId: string, physicRemove?: boolean): Promise<void>;
|
|
44
|
+
getById(socketId: string): Promise<AbstractServerSocket | undefined>;
|
|
45
|
+
getSocketsByChannel(channel: string): Promise<IServerSocket[]>;
|
|
46
|
+
configure(httpServer?: Server): void;
|
|
47
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { AbstractLogger, ClaireApp } from "@clairejs/core";
|
|
2
|
-
import { AbstractHttpRequestHandler } from "../http/controller/AbstractHttpRequestHandler";
|
|
3
|
-
import { AbstractServerSocketManager } from "../socket/AbstractServerSocketManager";
|
|
4
|
-
export declare class ClaireServer extends ClaireApp {
|
|
5
|
-
readonly logger: AbstractLogger;
|
|
6
|
-
readonly httpRequestHandler: AbstractHttpRequestHandler | undefined;
|
|
7
|
-
readonly socketManager: AbstractServerSocketManager | undefined;
|
|
8
|
-
private booted;
|
|
9
|
-
constructor(logger: AbstractLogger, httpRequestHandler: AbstractHttpRequestHandler | undefined, socketManager: AbstractServerSocketManager | undefined);
|
|
10
|
-
init(): Promise<void>;
|
|
11
|
-
exit(): void;
|
|
12
|
-
private stop;
|
|
13
|
-
}
|
|
1
|
+
import { AbstractLogger, ClaireApp } from "@clairejs/core";
|
|
2
|
+
import { AbstractHttpRequestHandler } from "../http/controller/AbstractHttpRequestHandler";
|
|
3
|
+
import { AbstractServerSocketManager } from "../socket/AbstractServerSocketManager";
|
|
4
|
+
export declare class ClaireServer extends ClaireApp {
|
|
5
|
+
readonly logger: AbstractLogger;
|
|
6
|
+
readonly httpRequestHandler: AbstractHttpRequestHandler | undefined;
|
|
7
|
+
readonly socketManager: AbstractServerSocketManager | undefined;
|
|
8
|
+
private booted;
|
|
9
|
+
constructor(logger: AbstractLogger, httpRequestHandler: AbstractHttpRequestHandler | undefined, socketManager: AbstractServerSocketManager | undefined);
|
|
10
|
+
init(): Promise<void>;
|
|
11
|
+
exit(): void;
|
|
12
|
+
private stop;
|
|
13
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ClaireServer } from "./ClaireServer";
|
|
2
|
-
interface ExpressWrapperConfig {
|
|
3
|
-
maxBodySizeKB?: number;
|
|
4
|
-
}
|
|
5
|
-
export declare class ExpressWrapper {
|
|
6
|
-
private readonly injector;
|
|
7
|
-
private readonly socketManager?;
|
|
8
|
-
private readonly logger;
|
|
9
|
-
private readonly server;
|
|
10
|
-
private readonly config?;
|
|
11
|
-
private readonly httpRequestHandler?;
|
|
12
|
-
private httpServer?;
|
|
13
|
-
constructor(server: ClaireServer, config?: ExpressWrapperConfig);
|
|
14
|
-
close(): void;
|
|
15
|
-
listen(listenPort: number): Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
1
|
+
import { ClaireServer } from "./ClaireServer";
|
|
2
|
+
interface ExpressWrapperConfig {
|
|
3
|
+
maxBodySizeKB?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare class ExpressWrapper {
|
|
6
|
+
private readonly injector;
|
|
7
|
+
private readonly socketManager?;
|
|
8
|
+
private readonly logger;
|
|
9
|
+
private readonly server;
|
|
10
|
+
private readonly config?;
|
|
11
|
+
private readonly httpRequestHandler?;
|
|
12
|
+
private httpServer?;
|
|
13
|
+
constructor(server: ClaireServer, config?: ExpressWrapperConfig);
|
|
14
|
+
close(): void;
|
|
15
|
+
listen(listenPort: number): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { RequestOptions } from "../common/request/RequestOptions";
|
|
2
|
-
import { ClaireServer } from "./ClaireServer";
|
|
3
|
-
interface LambdaResponse {
|
|
4
|
-
statusCode: number;
|
|
5
|
-
body: string;
|
|
6
|
-
headers: any;
|
|
7
|
-
}
|
|
8
|
-
export declare class LambdaWrapper {
|
|
9
|
-
readonly serverFactory: () => Promise<ClaireServer>;
|
|
10
|
-
readonly requestMapper: (event: any) => RequestOptions | undefined;
|
|
11
|
-
private readonly injector;
|
|
12
|
-
private readonly httpRequestHandler?;
|
|
13
|
-
private readonly socketManager?;
|
|
14
|
-
private
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { RequestOptions } from "../common/request/RequestOptions";
|
|
2
|
+
import { ClaireServer } from "./ClaireServer";
|
|
3
|
+
interface LambdaResponse {
|
|
4
|
+
statusCode: number;
|
|
5
|
+
body: string;
|
|
6
|
+
headers: any;
|
|
7
|
+
}
|
|
8
|
+
export declare class LambdaWrapper {
|
|
9
|
+
readonly serverFactory: () => Promise<ClaireServer>;
|
|
10
|
+
readonly requestMapper: (event: any) => RequestOptions | undefined;
|
|
11
|
+
private readonly injector;
|
|
12
|
+
private readonly httpRequestHandler?;
|
|
13
|
+
private readonly socketManager?;
|
|
14
|
+
private readonly jobScheduler?;
|
|
15
|
+
private _server?;
|
|
16
|
+
constructor(serverFactory: () => Promise<ClaireServer>, requestMapper: (event: any) => RequestOptions | undefined);
|
|
17
|
+
private bootServer;
|
|
18
|
+
handler(event: any): Promise<LambdaResponse>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CoreGlobalStore } from "@clairejs/core";
|
|
2
|
-
import { MountedEndpointInfo } from "../common/request/MountedEndpointInfo";
|
|
3
|
-
export interface ServerGlobalStore extends CoreGlobalStore {
|
|
4
|
-
mountedEndpointInfo?: MountedEndpointInfo[];
|
|
5
|
-
}
|
|
1
|
+
import { CoreGlobalStore } from "@clairejs/core";
|
|
2
|
+
import { MountedEndpointInfo } from "../common/request/MountedEndpointInfo";
|
|
3
|
+
export interface ServerGlobalStore extends CoreGlobalStore {
|
|
4
|
+
mountedEndpointInfo?: MountedEndpointInfo[];
|
|
5
|
+
}
|
package/dist/system/errors.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export declare const Errors: {
|
|
2
|
-
TFA_REQUIRED: string;
|
|
3
|
-
SYSTEM_ERROR: string;
|
|
4
|
-
HTTP_REQUEST_ERROR: string;
|
|
5
|
-
SESSION_EXPIRED: string;
|
|
6
|
-
ACCESS_DENIED: string;
|
|
7
|
-
AUTHENTICATION_ERROR: string;
|
|
8
|
-
NOT_FOUND: string;
|
|
9
|
-
VALIDATION_ERROR: string;
|
|
10
|
-
BAD_STATE: string;
|
|
11
|
-
QUERY_ERROR: string;
|
|
12
|
-
REQUEST_RATE_LIMIT: string;
|
|
13
|
-
CANNOT_LOCK: string;
|
|
14
|
-
};
|
|
1
|
+
export declare const Errors: {
|
|
2
|
+
TFA_REQUIRED: string;
|
|
3
|
+
SYSTEM_ERROR: string;
|
|
4
|
+
HTTP_REQUEST_ERROR: string;
|
|
5
|
+
SESSION_EXPIRED: string;
|
|
6
|
+
ACCESS_DENIED: string;
|
|
7
|
+
AUTHENTICATION_ERROR: string;
|
|
8
|
+
NOT_FOUND: string;
|
|
9
|
+
VALIDATION_ERROR: string;
|
|
10
|
+
BAD_STATE: string;
|
|
11
|
+
QUERY_ERROR: string;
|
|
12
|
+
REQUEST_RATE_LIMIT: string;
|
|
13
|
+
CANNOT_LOCK: string;
|
|
14
|
+
};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { HttpMethod, SocketMethod } from "@clairejs/core";
|
|
2
|
-
export declare const lambdaRequestMapper: (event: any) => {
|
|
3
|
-
method: SocketMethod;
|
|
4
|
-
rawPath: any;
|
|
5
|
-
body: any;
|
|
6
|
-
headers?: undefined;
|
|
7
|
-
} | {
|
|
8
|
-
method:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
headers
|
|
12
|
-
}
|
|
1
|
+
import { HttpMethod, SocketMethod } from "@clairejs/core";
|
|
2
|
+
export declare const lambdaRequestMapper: (event: any) => {
|
|
3
|
+
method: SocketMethod;
|
|
4
|
+
rawPath: any;
|
|
5
|
+
body: any;
|
|
6
|
+
headers?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
method: string;
|
|
9
|
+
body: any;
|
|
10
|
+
rawPath?: undefined;
|
|
11
|
+
headers?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
method: HttpMethod;
|
|
14
|
+
rawPath: string;
|
|
15
|
+
body: any;
|
|
16
|
+
headers: any;
|
|
17
|
+
};
|
package/package.json
CHANGED
|
@@ -1,59 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@clairejs/server",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Claire server NodeJs framework written in Typescript.",
|
|
5
|
-
"types": "dist/index.d.ts",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test-http": "mocha -r ts-node/register ./test/e2e/e2e.test.ts",
|
|
9
|
-
"test-socket": "mocha -r ts-node/register ./test/socket/socket.test.ts",
|
|
10
|
-
"test": "npm run test-http && npm run test-socket",
|
|
11
|
-
"build": "rm -rf ./dist && webpack --mode production",
|
|
12
|
-
"push": "npm run build && npm publish && git push"
|
|
13
|
-
},
|
|
14
|
-
"author": "immort",
|
|
15
|
-
"license": "ISC",
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"aws-sdk": "^2.841.0",
|
|
18
|
-
"cors": "^2.8.5",
|
|
19
|
-
"express": "^4.17.1",
|
|
20
|
-
"express-fileupload": "^1.2.1",
|
|
21
|
-
"ioredis": "^5.2.0",
|
|
22
|
-
"mysql2": "^2.2.5",
|
|
23
|
-
"node-cron": "^3.0.1",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"pg
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"@clairejs/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"@types/
|
|
40
|
-
"@types/
|
|
41
|
-
"@types/express
|
|
42
|
-
"@types/
|
|
43
|
-
"@types/
|
|
44
|
-
"@types/
|
|
45
|
-
"@types/
|
|
46
|
-
"@types/
|
|
47
|
-
"@types/
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"webpack
|
|
58
|
-
|
|
59
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@clairejs/server",
|
|
3
|
+
"version": "3.7.1",
|
|
4
|
+
"description": "Claire server NodeJs framework written in Typescript.",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test-http": "mocha -r ts-node/register ./test/e2e/e2e.test.ts",
|
|
9
|
+
"test-socket": "mocha -r ts-node/register ./test/socket/socket.test.ts",
|
|
10
|
+
"test": "npm run test-http && npm run test-socket",
|
|
11
|
+
"build": "rm -rf ./dist && webpack --mode production",
|
|
12
|
+
"push": "npm run build && npm publish && git push"
|
|
13
|
+
},
|
|
14
|
+
"author": "immort",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"aws-sdk": "^2.841.0",
|
|
18
|
+
"cors": "^2.8.5",
|
|
19
|
+
"express": "^4.17.1",
|
|
20
|
+
"express-fileupload": "^1.2.1",
|
|
21
|
+
"ioredis": "^5.2.0",
|
|
22
|
+
"mysql2": "^2.2.5",
|
|
23
|
+
"node-cron": "^3.0.1",
|
|
24
|
+
"node-schedule": "^2.1.0",
|
|
25
|
+
"parseurl": "^1.3.3",
|
|
26
|
+
"path-to-regexp": "^6.2.0",
|
|
27
|
+
"pg": "^8.5.1",
|
|
28
|
+
"pg-hstore": "^2.3.4",
|
|
29
|
+
"query-string": "^6.14.0",
|
|
30
|
+
"redlock": "^5.0.0-beta.2",
|
|
31
|
+
"reflect-metadata": "^0.1.13",
|
|
32
|
+
"ws": "^7.5.5"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@clairejs/core": "^3.1.15",
|
|
36
|
+
"@clairejs/orm": "^3.0.11"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/body-parser": "^1.19.0",
|
|
40
|
+
"@types/cors": "^2.8.9",
|
|
41
|
+
"@types/express": "^4.17.11",
|
|
42
|
+
"@types/express-fileupload": "^1.1.6",
|
|
43
|
+
"@types/mocha": "^8.2.2",
|
|
44
|
+
"@types/node": "^14.14.25",
|
|
45
|
+
"@types/node-schedule": "^2.1.0",
|
|
46
|
+
"@types/parseurl": "^1.3.1",
|
|
47
|
+
"@types/validator": "^13.1.3",
|
|
48
|
+
"@types/webpack-env": "^1.16.0",
|
|
49
|
+
"@types/ws": "^7.4.0",
|
|
50
|
+
"axios": "^0.21.1",
|
|
51
|
+
"mocha": "^10.0.0",
|
|
52
|
+
"terser-webpack-plugin": "^4.2.3",
|
|
53
|
+
"ts-loader": "^8.4.0",
|
|
54
|
+
"ts-node": "^10.8.1",
|
|
55
|
+
"tslib": "^2.1.0",
|
|
56
|
+
"typescript": "^4.4.4",
|
|
57
|
+
"webpack": "^5.73.0",
|
|
58
|
+
"webpack-cli": "^4.10.0",
|
|
59
|
+
"webpack-node-externals": "^2.5.1"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { JobInfo } from "./interfaces";
|
|
2
|
-
export declare abstract class AbstractJobExecutor {
|
|
3
|
-
private _allJobs;
|
|
4
|
-
init(): Promise<void>;
|
|
5
|
-
protected getAllJobs(): Promise<{
|
|
6
|
-
jobName: string;
|
|
7
|
-
handlerFn: (jobInfo?: JobInfo | undefined) => Promise<void>;
|
|
8
|
-
}[]>;
|
|
9
|
-
abstract executeJob(jobInfo: JobInfo, schedulerInterval: number): Promise<void>;
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AbstractLogger } from "@clairejs/core";
|
|
2
|
-
import { AbstractJobExecutor } from "./AbstractJobExecutor";
|
|
3
|
-
import { JobInfo } from "./interfaces";
|
|
4
|
-
export declare class AwsJobExecutor extends AbstractJobExecutor {
|
|
5
|
-
readonly logger: AbstractLogger;
|
|
6
|
-
constructor(logger: AbstractLogger);
|
|
7
|
-
executeJob(jobInfo: JobInfo, schedulerInterval: number): Promise<void>;
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AbstractLogger } from "@clairejs/core";
|
|
2
|
-
import { AbstractJobExecutor } from "./AbstractJobExecutor";
|
|
3
|
-
import { JobInfo } from "./interfaces";
|
|
4
|
-
export declare class LocalJobExecutor extends AbstractJobExecutor {
|
|
5
|
-
readonly logger: AbstractLogger;
|
|
6
|
-
constructor(logger: AbstractLogger);
|
|
7
|
-
executeJob(jobInfo: JobInfo, schedulerInterval: number): Promise<void>;
|
|
8
|
-
}
|