@clairejs/server 3.11.14 → 3.11.16
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 +775 -775
- 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 +8 -8
- package/dist/common/request/SocketData.d.ts +1 -1
- package/dist/common/request/types.d.ts +1 -1
- package/dist/controllers/FileManageController.d.ts +13 -13
- package/dist/controllers/FileUploadController.d.ts +13 -13
- package/dist/controllers/dto/permissions.d.ts +20 -20
- package/dist/controllers/dto/system.d.ts +12 -12
- package/dist/controllers/dto/upload.d.ts +40 -40
- package/dist/controllers/models/SystemSetting.d.ts +5 -5
- 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 +24 -24
- 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 +40 -40
- package/dist/http/common/HttpResponse.d.ts +34 -34
- package/dist/http/controller/AbstractHttpController.d.ts +9 -9
- package/dist/http/controller/AbstractHttpMiddleware.d.ts +10 -10
- package/dist/http/controller/AbstractHttpRequestHandler.d.ts +18 -18
- package/dist/http/controller/ControllerMetadata.d.ts +6 -6
- package/dist/http/controller/CrudHttpController.d.ts +41 -41
- package/dist/http/controller/DefaultHttpRequestHandler.d.ts +21 -21
- package/dist/http/decorators.d.ts +35 -35
- 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/http/security/cors.d.ts +6 -6
- package/dist/index.d.ts +71 -71
- package/dist/index.js +1 -1
- package/dist/job/AbstractJobController.d.ts +4 -4
- package/dist/job/AbstractJobRepository.d.ts +17 -17
- package/dist/job/AbstractJobScheduler.d.ts +38 -38
- package/dist/job/AwsJobScheduler.d.ts +48 -48
- package/dist/job/LocalJobScheduler.d.ts +88 -88
- package/dist/job/decorators.d.ts +5 -5
- package/dist/job/interfaces.d.ts +50 -50
- package/dist/logging/FileLogMedium.d.ts +13 -13
- package/dist/services/AbstractCacheService.d.ts +22 -22
- package/dist/services/AbstractFileService.d.ts +11 -11
- package/dist/services/AbstractMailService.d.ts +31 -31
- package/dist/services/AbstractService.d.ts +7 -7
- package/dist/services/AbstractSmsService.d.ts +25 -25
- package/dist/services/LocalFileService.d.ts +17 -17
- package/dist/services/ProxyFileService.d.ts +16 -16
- package/dist/services/RedisCacheService.d.ts +25 -25
- package/dist/services/S3FileService.d.ts +31 -31
- package/dist/services/SystemService.d.ts +15 -15
- 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 +19 -19
- package/dist/system/LambdaWrapper.d.ts +25 -25
- package/dist/system/ServerGlobalStore.d.ts +8 -8
- package/dist/system/errors.d.ts +14 -14
- package/dist/system/lamba-request-mapper.d.ts +2 -2
- package/dist/system/locale/LocaleEntry.d.ts +3 -3
- package/dist/system/locale/LocaleTranslation.d.ts +6 -6
- package/dist/system/locale/decorators.d.ts +2 -2
- package/package.json +67 -67
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { AbstractLogger } from "@clairejs/core";
|
|
2
|
-
export interface EmailInfo {
|
|
3
|
-
sender: string;
|
|
4
|
-
receivers: string[];
|
|
5
|
-
cc?: string[];
|
|
6
|
-
bcc?: string[];
|
|
7
|
-
subject: string;
|
|
8
|
-
content: string;
|
|
9
|
-
contentType: "html" | "text";
|
|
10
|
-
}
|
|
11
|
-
export declare abstract class AbstractMailService {
|
|
12
|
-
abstract send(email: EmailInfo): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export interface LocalMailServiceConfig {
|
|
15
|
-
LOCAL_MAIL_FOLDER: string;
|
|
16
|
-
}
|
|
17
|
-
export declare class LocalMailService extends AbstractMailService {
|
|
18
|
-
readonly config: LocalMailServiceConfig;
|
|
19
|
-
constructor(config: LocalMailServiceConfig);
|
|
20
|
-
send(email: EmailInfo): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
export interface SesMailServiceConfig {
|
|
23
|
-
SES_REGION: string;
|
|
24
|
-
}
|
|
25
|
-
export declare class SesMailService extends AbstractMailService {
|
|
26
|
-
readonly config: SesMailServiceConfig;
|
|
27
|
-
readonly logger: AbstractLogger;
|
|
28
|
-
private readonly emailClient;
|
|
29
|
-
constructor(config: SesMailServiceConfig, logger: AbstractLogger);
|
|
30
|
-
send(email: EmailInfo): Promise<void>;
|
|
31
|
-
}
|
|
1
|
+
import { AbstractLogger } from "@clairejs/core";
|
|
2
|
+
export interface EmailInfo {
|
|
3
|
+
sender: string;
|
|
4
|
+
receivers: string[];
|
|
5
|
+
cc?: string[];
|
|
6
|
+
bcc?: string[];
|
|
7
|
+
subject: string;
|
|
8
|
+
content: string;
|
|
9
|
+
contentType: "html" | "text";
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class AbstractMailService {
|
|
12
|
+
abstract send(email: EmailInfo): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export interface LocalMailServiceConfig {
|
|
15
|
+
LOCAL_MAIL_FOLDER: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class LocalMailService extends AbstractMailService {
|
|
18
|
+
readonly config: LocalMailServiceConfig;
|
|
19
|
+
constructor(config: LocalMailServiceConfig);
|
|
20
|
+
send(email: EmailInfo): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export interface SesMailServiceConfig {
|
|
23
|
+
SES_REGION: string;
|
|
24
|
+
}
|
|
25
|
+
export declare class SesMailService extends AbstractMailService {
|
|
26
|
+
readonly config: SesMailServiceConfig;
|
|
27
|
+
readonly logger: AbstractLogger;
|
|
28
|
+
private readonly emailClient;
|
|
29
|
+
constructor(config: SesMailServiceConfig, logger: AbstractLogger);
|
|
30
|
+
send(email: EmailInfo): Promise<void>;
|
|
31
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ITransactionFactory, ITransactionProvider } from "@clairejs/orm";
|
|
2
|
-
export declare abstract class AbstractService implements ITransactionProvider, ITransactionFactory {
|
|
3
|
-
protected readonly databaseAdapter: ITransactionFactory;
|
|
4
|
-
constructor(databaseAdapter: ITransactionFactory);
|
|
5
|
-
createTransaction(): Promise<import("@clairejs/orm").ITransaction>;
|
|
6
|
-
getCurrentTransaction(): Promise<import("@clairejs/orm").ITransaction>;
|
|
7
|
-
}
|
|
1
|
+
import { ITransactionFactory, ITransactionProvider } from "@clairejs/orm";
|
|
2
|
+
export declare abstract class AbstractService implements ITransactionProvider, ITransactionFactory {
|
|
3
|
+
protected readonly databaseAdapter: ITransactionFactory;
|
|
4
|
+
constructor(databaseAdapter: ITransactionFactory);
|
|
5
|
+
createTransaction(): Promise<import("@clairejs/orm").ITransaction>;
|
|
6
|
+
getCurrentTransaction(): Promise<import("@clairejs/orm").ITransaction>;
|
|
7
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { AbstractLogger } from "@clairejs/core";
|
|
2
|
-
export declare abstract class AbstractSmsService {
|
|
3
|
-
abstract send(fromNumber: string, toNumber: string, content: string): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
export interface LocalSmsServiceConfig {
|
|
6
|
-
LOCAL_SMS_FOLDER: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class LocalSmsService extends AbstractSmsService {
|
|
9
|
-
readonly config: LocalSmsServiceConfig;
|
|
10
|
-
constructor(config: LocalSmsServiceConfig);
|
|
11
|
-
exit(): number;
|
|
12
|
-
send(fromNumber: string, toNumber: string, content: string): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export interface TwilioSmsServiceConfig {
|
|
15
|
-
TWILIO_ACCOUNT_SID: string;
|
|
16
|
-
TWILIO_AUTH_TOKEN: string;
|
|
17
|
-
}
|
|
18
|
-
export declare class TwilioSmsService extends AbstractSmsService {
|
|
19
|
-
readonly config: TwilioSmsServiceConfig;
|
|
20
|
-
readonly logger: AbstractLogger;
|
|
21
|
-
private client;
|
|
22
|
-
constructor(config: TwilioSmsServiceConfig, logger: AbstractLogger);
|
|
23
|
-
exit(): number;
|
|
24
|
-
send(fromNumber: string, toNumber: string, content: string): Promise<void>;
|
|
25
|
-
}
|
|
1
|
+
import { AbstractLogger } from "@clairejs/core";
|
|
2
|
+
export declare abstract class AbstractSmsService {
|
|
3
|
+
abstract send(fromNumber: string, toNumber: string, content: string): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
export interface LocalSmsServiceConfig {
|
|
6
|
+
LOCAL_SMS_FOLDER: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class LocalSmsService extends AbstractSmsService {
|
|
9
|
+
readonly config: LocalSmsServiceConfig;
|
|
10
|
+
constructor(config: LocalSmsServiceConfig);
|
|
11
|
+
exit(): number;
|
|
12
|
+
send(fromNumber: string, toNumber: string, content: string): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export interface TwilioSmsServiceConfig {
|
|
15
|
+
TWILIO_ACCOUNT_SID: string;
|
|
16
|
+
TWILIO_AUTH_TOKEN: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class TwilioSmsService extends AbstractSmsService {
|
|
19
|
+
readonly config: TwilioSmsServiceConfig;
|
|
20
|
+
readonly logger: AbstractLogger;
|
|
21
|
+
private client;
|
|
22
|
+
constructor(config: TwilioSmsServiceConfig, logger: AbstractLogger);
|
|
23
|
+
exit(): number;
|
|
24
|
+
send(fromNumber: string, toNumber: string, content: string): Promise<void>;
|
|
25
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { FileOperation } from "../common/FileOperation";
|
|
2
|
-
import { AbstractFileService } from "./AbstractFileService";
|
|
3
|
-
export interface LocalFileServiceConfig {
|
|
4
|
-
FILE_SERVER_URL: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class LocalFileService extends AbstractFileService {
|
|
7
|
-
readonly config: LocalFileServiceConfig;
|
|
8
|
-
constructor(config: LocalFileServiceConfig);
|
|
9
|
-
getFileSize(objectKeys: string[]): Promise<number[]>;
|
|
10
|
-
getAccessUrls(uris: string[], _isPublic: boolean): Promise<string[]>;
|
|
11
|
-
getPresignedUrl(_operation: FileOperation, uris: string[]): Promise<string[]>;
|
|
12
|
-
moveObject(uris: {
|
|
13
|
-
fromURI: string;
|
|
14
|
-
toURI: string;
|
|
15
|
-
}[]): Promise<void>;
|
|
16
|
-
removeObject(uris: string[]): Promise<void>;
|
|
17
|
-
}
|
|
1
|
+
import { FileOperation } from "../common/FileOperation";
|
|
2
|
+
import { AbstractFileService } from "./AbstractFileService";
|
|
3
|
+
export interface LocalFileServiceConfig {
|
|
4
|
+
FILE_SERVER_URL: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class LocalFileService extends AbstractFileService {
|
|
7
|
+
readonly config: LocalFileServiceConfig;
|
|
8
|
+
constructor(config: LocalFileServiceConfig);
|
|
9
|
+
getFileSize(objectKeys: string[]): Promise<number[]>;
|
|
10
|
+
getAccessUrls(uris: string[], _isPublic: boolean): Promise<string[]>;
|
|
11
|
+
getPresignedUrl(_operation: FileOperation, uris: string[]): Promise<string[]>;
|
|
12
|
+
moveObject(uris: {
|
|
13
|
+
fromURI: string;
|
|
14
|
+
toURI: string;
|
|
15
|
+
}[]): Promise<void>;
|
|
16
|
+
removeObject(uris: string[]): Promise<void>;
|
|
17
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { AbstractHttpClient } from "@clairejs/client";
|
|
2
|
-
import { AbstractFileService } from "./AbstractFileService";
|
|
3
|
-
import { FileOperation } from "../common/FileOperation";
|
|
4
|
-
export declare class ProxyFileService extends AbstractFileService {
|
|
5
|
-
readonly fileServiceHttpClient: AbstractHttpClient;
|
|
6
|
-
readonly publicFileServerEndpoint: string;
|
|
7
|
-
constructor(fileServiceHttpClient: AbstractHttpClient, publicFileServerEndpoint: string);
|
|
8
|
-
getFileSize(objectKeys: string[]): Promise<number[]>;
|
|
9
|
-
getAccessUrls(uris: string[], isPublic: boolean): Promise<string[]>;
|
|
10
|
-
getPresignedUrl(_operation: FileOperation, _uris: string[]): Promise<string[]>;
|
|
11
|
-
moveObject(uris: {
|
|
12
|
-
fromURI: string;
|
|
13
|
-
toURI: string;
|
|
14
|
-
}[]): Promise<void>;
|
|
15
|
-
removeObject(uris: string[]): Promise<void>;
|
|
16
|
-
}
|
|
1
|
+
import { AbstractHttpClient } from "@clairejs/client";
|
|
2
|
+
import { AbstractFileService } from "./AbstractFileService";
|
|
3
|
+
import { FileOperation } from "../common/FileOperation";
|
|
4
|
+
export declare class ProxyFileService extends AbstractFileService {
|
|
5
|
+
readonly fileServiceHttpClient: AbstractHttpClient;
|
|
6
|
+
readonly publicFileServerEndpoint: string;
|
|
7
|
+
constructor(fileServiceHttpClient: AbstractHttpClient, publicFileServerEndpoint: string);
|
|
8
|
+
getFileSize(objectKeys: string[]): Promise<number[]>;
|
|
9
|
+
getAccessUrls(uris: string[], isPublic: boolean): Promise<string[]>;
|
|
10
|
+
getPresignedUrl(_operation: FileOperation, _uris: string[]): Promise<string[]>;
|
|
11
|
+
moveObject(uris: {
|
|
12
|
+
fromURI: string;
|
|
13
|
+
toURI: string;
|
|
14
|
+
}[]): Promise<void>;
|
|
15
|
+
removeObject(uris: string[]): Promise<void>;
|
|
16
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { AbstractLogger, IInit } from "@clairejs/core";
|
|
2
|
-
import Client from "ioredis";
|
|
3
|
-
import { AbstractCacheService, ICacheTransaction, MutexLock } from "./AbstractCacheService";
|
|
4
|
-
export interface RedisCacheServiceConfig {
|
|
5
|
-
REDIS_SERVER: string;
|
|
6
|
-
}
|
|
7
|
-
export declare class RedisCacheService extends AbstractCacheService implements IInit {
|
|
8
|
-
readonly config: RedisCacheServiceConfig;
|
|
9
|
-
readonly logger: AbstractLogger;
|
|
10
|
-
private _redisClient?;
|
|
11
|
-
constructor(config: RedisCacheServiceConfig, logger: AbstractLogger);
|
|
12
|
-
get redisClient(): Client;
|
|
13
|
-
createTransaction(): ICacheTransaction;
|
|
14
|
-
init(): Promise<void>;
|
|
15
|
-
exit(): number;
|
|
16
|
-
flush(): Promise<void>;
|
|
17
|
-
hkeys(hash: string): Promise<string[]>;
|
|
18
|
-
del(key: string): Promise<void>;
|
|
19
|
-
hdel(hash: string, key: string): Promise<void>;
|
|
20
|
-
hget<T>(hash: string, key: string): Promise<T | undefined>;
|
|
21
|
-
hset<T>(hash: string, key: string, data: T): Promise<void>;
|
|
22
|
-
get<T>(key: string): Promise<T | undefined>;
|
|
23
|
-
set<T>(key: string, value: T, expiredSeconds?: number): Promise<void>;
|
|
24
|
-
lock(key: string, durationMs: number, timeoutMs?: number): Promise<MutexLock>;
|
|
25
|
-
}
|
|
1
|
+
import { AbstractLogger, IInit } from "@clairejs/core";
|
|
2
|
+
import Client from "ioredis";
|
|
3
|
+
import { AbstractCacheService, ICacheTransaction, MutexLock } from "./AbstractCacheService";
|
|
4
|
+
export interface RedisCacheServiceConfig {
|
|
5
|
+
REDIS_SERVER: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class RedisCacheService extends AbstractCacheService implements IInit {
|
|
8
|
+
readonly config: RedisCacheServiceConfig;
|
|
9
|
+
readonly logger: AbstractLogger;
|
|
10
|
+
private _redisClient?;
|
|
11
|
+
constructor(config: RedisCacheServiceConfig, logger: AbstractLogger);
|
|
12
|
+
get redisClient(): Client;
|
|
13
|
+
createTransaction(): ICacheTransaction;
|
|
14
|
+
init(): Promise<void>;
|
|
15
|
+
exit(): number;
|
|
16
|
+
flush(): Promise<void>;
|
|
17
|
+
hkeys(hash: string): Promise<string[]>;
|
|
18
|
+
del(key: string): Promise<void>;
|
|
19
|
+
hdel(hash: string, key: string): Promise<void>;
|
|
20
|
+
hget<T>(hash: string, key: string): Promise<T | undefined>;
|
|
21
|
+
hset<T>(hash: string, key: string, data: T): Promise<void>;
|
|
22
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
23
|
+
set<T>(key: string, value: T, expiredSeconds?: number): Promise<void>;
|
|
24
|
+
lock(key: string, durationMs: number, timeoutMs?: number): Promise<MutexLock>;
|
|
25
|
+
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { AbstractLogger } from "@clairejs/core";
|
|
2
|
-
import { FileOperation } from "../common/FileOperation";
|
|
3
|
-
import { AbstractFileService } from "./AbstractFileService";
|
|
4
|
-
export interface S3FileServiceConfig {
|
|
5
|
-
S3_BUCKET_NAME: string;
|
|
6
|
-
S3_BUCKET_REGION: string;
|
|
7
|
-
PRESIGNED_URL_EXPIRATION_S: number;
|
|
8
|
-
CLOUD_FRONT_PUBLIC_KEY_ID: string;
|
|
9
|
-
CLOUD_FRONT_PRIVATE_KEY_BASE64: string;
|
|
10
|
-
CLOUD_FRONT_PUBLIC_DOMAIN: string;
|
|
11
|
-
}
|
|
12
|
-
export declare class S3FileService extends AbstractFileService {
|
|
13
|
-
readonly config: S3FileServiceConfig;
|
|
14
|
-
readonly logger: AbstractLogger;
|
|
15
|
-
private readonly s3Client;
|
|
16
|
-
private readonly cloudfrontSigner;
|
|
17
|
-
constructor(config: S3FileServiceConfig, logger: AbstractLogger);
|
|
18
|
-
getFileSize(objectKeys: string[]): Promise<number[]>;
|
|
19
|
-
getAccessUrls(uris: string[], isPublic: boolean): Promise<string[]>;
|
|
20
|
-
getPresignedUrl(operation: FileOperation, uris: string[]): Promise<string[]>;
|
|
21
|
-
moveObject(uris: {
|
|
22
|
-
fromURI: string;
|
|
23
|
-
toURI: string;
|
|
24
|
-
}[]): Promise<void>;
|
|
25
|
-
removeObject(uris: string[]): Promise<void>;
|
|
26
|
-
private getSingleFileSize;
|
|
27
|
-
private getSinglePresignedUrl;
|
|
28
|
-
private moveSingleObject;
|
|
29
|
-
private getSingleAccessUrl;
|
|
30
|
-
private removeSingleObject;
|
|
31
|
-
}
|
|
1
|
+
import { AbstractLogger } from "@clairejs/core";
|
|
2
|
+
import { FileOperation } from "../common/FileOperation";
|
|
3
|
+
import { AbstractFileService } from "./AbstractFileService";
|
|
4
|
+
export interface S3FileServiceConfig {
|
|
5
|
+
S3_BUCKET_NAME: string;
|
|
6
|
+
S3_BUCKET_REGION: string;
|
|
7
|
+
PRESIGNED_URL_EXPIRATION_S: number;
|
|
8
|
+
CLOUD_FRONT_PUBLIC_KEY_ID: string;
|
|
9
|
+
CLOUD_FRONT_PRIVATE_KEY_BASE64: string;
|
|
10
|
+
CLOUD_FRONT_PUBLIC_DOMAIN: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class S3FileService extends AbstractFileService {
|
|
13
|
+
readonly config: S3FileServiceConfig;
|
|
14
|
+
readonly logger: AbstractLogger;
|
|
15
|
+
private readonly s3Client;
|
|
16
|
+
private readonly cloudfrontSigner;
|
|
17
|
+
constructor(config: S3FileServiceConfig, logger: AbstractLogger);
|
|
18
|
+
getFileSize(objectKeys: string[]): Promise<number[]>;
|
|
19
|
+
getAccessUrls(uris: string[], isPublic: boolean): Promise<string[]>;
|
|
20
|
+
getPresignedUrl(operation: FileOperation, uris: string[]): Promise<string[]>;
|
|
21
|
+
moveObject(uris: {
|
|
22
|
+
fromURI: string;
|
|
23
|
+
toURI: string;
|
|
24
|
+
}[]): Promise<void>;
|
|
25
|
+
removeObject(uris: string[]): Promise<void>;
|
|
26
|
+
private getSingleFileSize;
|
|
27
|
+
private getSinglePresignedUrl;
|
|
28
|
+
private moveSingleObject;
|
|
29
|
+
private getSingleAccessUrl;
|
|
30
|
+
private removeSingleObject;
|
|
31
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Constructor } from "@clairejs/core";
|
|
2
|
-
import { AbstractDatabaseAdapter } from "@clairejs/orm";
|
|
3
|
-
import { AbstractCacheService } from "./AbstractCacheService";
|
|
4
|
-
import { AbstractService } from "./AbstractService";
|
|
5
|
-
import { ApiInfoResponse } from "../controllers/dto/permissions";
|
|
6
|
-
import { CacheOperation } from "../controllers/dto/system";
|
|
7
|
-
export declare class SystemService extends AbstractService {
|
|
8
|
-
readonly cacheService: AbstractCacheService;
|
|
9
|
-
readonly databaseAdapter: AbstractDatabaseAdapter;
|
|
10
|
-
constructor(cacheService: AbstractCacheService, databaseAdapter: AbstractDatabaseAdapter);
|
|
11
|
-
getApiInfo(): Promise<ApiInfoResponse>;
|
|
12
|
-
getCacheValue(operation: CacheOperation, keys: string[]): Promise<unknown>;
|
|
13
|
-
getSystemSettings<T>(settingTemplate: Constructor<T>): Promise<T>;
|
|
14
|
-
updateSystemSetting(settings: object): Promise<void>;
|
|
15
|
-
}
|
|
1
|
+
import { Constructor } from "@clairejs/core";
|
|
2
|
+
import { AbstractDatabaseAdapter } from "@clairejs/orm";
|
|
3
|
+
import { AbstractCacheService } from "./AbstractCacheService";
|
|
4
|
+
import { AbstractService } from "./AbstractService";
|
|
5
|
+
import { ApiInfoResponse } from "../controllers/dto/permissions";
|
|
6
|
+
import { CacheOperation } from "../controllers/dto/system";
|
|
7
|
+
export declare class SystemService extends AbstractService {
|
|
8
|
+
readonly cacheService: AbstractCacheService;
|
|
9
|
+
readonly databaseAdapter: AbstractDatabaseAdapter;
|
|
10
|
+
constructor(cacheService: AbstractCacheService, databaseAdapter: AbstractDatabaseAdapter);
|
|
11
|
+
getApiInfo(): Promise<ApiInfoResponse>;
|
|
12
|
+
getCacheValue(operation: CacheOperation, keys: string[]): Promise<unknown>;
|
|
13
|
+
getSystemSettings<T>(settingTemplate: Constructor<T>): Promise<T>;
|
|
14
|
+
updateSystemSetting(settings: object): Promise<void>;
|
|
15
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { SocketMessage } from "@clairejs/core";
|
|
2
|
-
import { IPrincipal } from "../common/auth/IPrincipal";
|
|
3
|
-
import { IServerSocket } from "./IServerSocket";
|
|
4
|
-
import { ChannelInfo, ServerSocketInfo } from "./AbstractServerSocketManager";
|
|
5
|
-
export declare abstract class AbstractServerSocket implements IServerSocket {
|
|
6
|
-
readonly socketInfo: ServerSocketInfo;
|
|
7
|
-
constructor(socketInfo: ServerSocketInfo);
|
|
8
|
-
getId(): string;
|
|
9
|
-
getAuthInfo(): IPrincipal | undefined;
|
|
10
|
-
send(data: any, channel?: string): Promise<void>;
|
|
11
|
-
sendRaw(data: SocketMessage): Promise<void>;
|
|
12
|
-
removeChannels(channels: string[]): void;
|
|
13
|
-
addChannels(channelInfos: ChannelInfo[]): void;
|
|
14
|
-
getChannelsInfo(): ChannelInfo[];
|
|
15
|
-
abstract disconnect(err?: any): Promise<void>;
|
|
16
|
-
abstract physicSend(data: any): Promise<void>;
|
|
17
|
-
abstract saveSocketInfo(): Promise<void>;
|
|
18
|
-
}
|
|
1
|
+
import { SocketMessage } from "@clairejs/core";
|
|
2
|
+
import { IPrincipal } from "../common/auth/IPrincipal";
|
|
3
|
+
import { IServerSocket } from "./IServerSocket";
|
|
4
|
+
import { ChannelInfo, ServerSocketInfo } from "./AbstractServerSocketManager";
|
|
5
|
+
export declare abstract class AbstractServerSocket implements IServerSocket {
|
|
6
|
+
readonly socketInfo: ServerSocketInfo;
|
|
7
|
+
constructor(socketInfo: ServerSocketInfo);
|
|
8
|
+
getId(): string;
|
|
9
|
+
getAuthInfo(): IPrincipal | undefined;
|
|
10
|
+
send(data: any, channel?: string): Promise<void>;
|
|
11
|
+
sendRaw(data: SocketMessage): Promise<void>;
|
|
12
|
+
removeChannels(channels: string[]): void;
|
|
13
|
+
addChannels(channelInfos: ChannelInfo[]): void;
|
|
14
|
+
getChannelsInfo(): ChannelInfo[];
|
|
15
|
+
abstract disconnect(err?: any): Promise<void>;
|
|
16
|
+
abstract physicSend(data: any): Promise<void>;
|
|
17
|
+
abstract saveSocketInfo(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { AbstractLogger, SocketMessage } from "@clairejs/core";
|
|
2
|
-
import Client from "ioredis";
|
|
3
|
-
import { SocketData } from "../common/request/SocketData";
|
|
4
|
-
import { AbstractSocketConnectionHandler } from "./AbstractSocketConnectionHandler";
|
|
5
|
-
import { IPrincipal } from "../common/auth/IPrincipal";
|
|
6
|
-
import { AbstractServerSocket } from "./AbstractServerSocket";
|
|
7
|
-
import { MountedEndpointInfo } from "../common/request/MountedEndpointInfo";
|
|
8
|
-
import { AbstractHttpAuthorizationProvider } from "../http/auth/AbstractHttpAuthorizationProvider";
|
|
9
|
-
import { IServerSocket } from "./IServerSocket";
|
|
10
|
-
export interface ChannelInfo {
|
|
11
|
-
name: string;
|
|
12
|
-
clientToServerAllowed: boolean;
|
|
13
|
-
serverToClientAllowed: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface ServerSocketInfo {
|
|
16
|
-
id: string;
|
|
17
|
-
createdAt: number;
|
|
18
|
-
channels: ChannelInfo[];
|
|
19
|
-
authInfo?: IPrincipal;
|
|
20
|
-
}
|
|
21
|
-
export declare abstract class AbstractServerSocketManager {
|
|
22
|
-
protected readonly requireAuthentication: boolean;
|
|
23
|
-
protected readonly logger: AbstractLogger;
|
|
24
|
-
protected readonly redisServerUrl: string;
|
|
25
|
-
protected readonly authProvider: AbstractHttpAuthorizationProvider;
|
|
26
|
-
protected readonly authResolver: (queries?: any) => any;
|
|
27
|
-
private mountedEndpointInfo?;
|
|
28
|
-
private _connectionHandler?;
|
|
29
|
-
protected redisClient: Client;
|
|
30
|
-
protected constructor(requireAuthentication: boolean, logger: AbstractLogger, redisServerUrl: string, authProvider: AbstractHttpAuthorizationProvider, authResolver: (queries?: any) => any);
|
|
31
|
-
abstract configure(data?: any): void;
|
|
32
|
-
protected getUniqueChannelPrefix(): string;
|
|
33
|
-
protected getSocketInfoHashKey(): string;
|
|
34
|
-
protected getConnectionHandler(): Promise<AbstractSocketConnectionHandler | undefined>;
|
|
35
|
-
protected formatBroadcastData(channel: string, data: any): SocketMessage;
|
|
36
|
-
protected getUniqueChannelName(channel: string): string;
|
|
37
|
-
protected getSocketIdsOfChannel(channel: string): Promise<string[]>;
|
|
38
|
-
addSocketToChannel(socketId: string, channelInfos: ChannelInfo[]): Promise<AbstractServerSocket | undefined>;
|
|
39
|
-
removeSocketFromChannel(socketId: string, channels: string[], persist?: boolean): Promise<void>;
|
|
40
|
-
abstract getSocketsByChannel(channel: string): Promise<IServerSocket[]>;
|
|
41
|
-
abstract broadcastToChannel(channel: string, data: any): Promise<void>;
|
|
42
|
-
removeSocket(socketId: string, physicRemove?: boolean): Promise<void>;
|
|
43
|
-
abstract getById(socketId: string): Promise<AbstractServerSocket | undefined>;
|
|
44
|
-
handle(socketData: SocketData): Promise<void>;
|
|
45
|
-
getMountedEndpointInfo(): Promise<MountedEndpointInfo[]>;
|
|
46
|
-
}
|
|
1
|
+
import { AbstractLogger, SocketMessage } from "@clairejs/core";
|
|
2
|
+
import Client from "ioredis";
|
|
3
|
+
import { SocketData } from "../common/request/SocketData";
|
|
4
|
+
import { AbstractSocketConnectionHandler } from "./AbstractSocketConnectionHandler";
|
|
5
|
+
import { IPrincipal } from "../common/auth/IPrincipal";
|
|
6
|
+
import { AbstractServerSocket } from "./AbstractServerSocket";
|
|
7
|
+
import { MountedEndpointInfo } from "../common/request/MountedEndpointInfo";
|
|
8
|
+
import { AbstractHttpAuthorizationProvider } from "../http/auth/AbstractHttpAuthorizationProvider";
|
|
9
|
+
import { IServerSocket } from "./IServerSocket";
|
|
10
|
+
export interface ChannelInfo {
|
|
11
|
+
name: string;
|
|
12
|
+
clientToServerAllowed: boolean;
|
|
13
|
+
serverToClientAllowed: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ServerSocketInfo {
|
|
16
|
+
id: string;
|
|
17
|
+
createdAt: number;
|
|
18
|
+
channels: ChannelInfo[];
|
|
19
|
+
authInfo?: IPrincipal;
|
|
20
|
+
}
|
|
21
|
+
export declare abstract class AbstractServerSocketManager {
|
|
22
|
+
protected readonly requireAuthentication: boolean;
|
|
23
|
+
protected readonly logger: AbstractLogger;
|
|
24
|
+
protected readonly redisServerUrl: string;
|
|
25
|
+
protected readonly authProvider: AbstractHttpAuthorizationProvider;
|
|
26
|
+
protected readonly authResolver: (queries?: any) => any;
|
|
27
|
+
private mountedEndpointInfo?;
|
|
28
|
+
private _connectionHandler?;
|
|
29
|
+
protected redisClient: Client;
|
|
30
|
+
protected constructor(requireAuthentication: boolean, logger: AbstractLogger, redisServerUrl: string, authProvider: AbstractHttpAuthorizationProvider, authResolver: (queries?: any) => any);
|
|
31
|
+
abstract configure(data?: any): void;
|
|
32
|
+
protected getUniqueChannelPrefix(): string;
|
|
33
|
+
protected getSocketInfoHashKey(): string;
|
|
34
|
+
protected getConnectionHandler(): Promise<AbstractSocketConnectionHandler | undefined>;
|
|
35
|
+
protected formatBroadcastData(channel: string, data: any): SocketMessage;
|
|
36
|
+
protected getUniqueChannelName(channel: string): string;
|
|
37
|
+
protected getSocketIdsOfChannel(channel: string): Promise<string[]>;
|
|
38
|
+
addSocketToChannel(socketId: string, channelInfos: ChannelInfo[]): Promise<AbstractServerSocket | undefined>;
|
|
39
|
+
removeSocketFromChannel(socketId: string, channels: string[], persist?: boolean): Promise<void>;
|
|
40
|
+
abstract getSocketsByChannel(channel: string): Promise<IServerSocket[]>;
|
|
41
|
+
abstract broadcastToChannel(channel: string, data: any): Promise<void>;
|
|
42
|
+
removeSocket(socketId: string, physicRemove?: boolean): Promise<void>;
|
|
43
|
+
abstract getById(socketId: string): Promise<AbstractServerSocket | undefined>;
|
|
44
|
+
handle(socketData: SocketData): Promise<void>;
|
|
45
|
+
getMountedEndpointInfo(): Promise<MountedEndpointInfo[]>;
|
|
46
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IServerSocket } from "./IServerSocket";
|
|
2
|
-
export declare abstract class AbstractSocketConnectionHandler {
|
|
3
|
-
abstract onSocketConnect(socket: IServerSocket): Promise<void>;
|
|
4
|
-
abstract onSocketDisconnect(socket: IServerSocket): Promise<void>;
|
|
5
|
-
abstract onMessage(socket: IServerSocket, message: any, channel?: string): Promise<void>;
|
|
6
|
-
}
|
|
1
|
+
import { IServerSocket } from "./IServerSocket";
|
|
2
|
+
export declare abstract class AbstractSocketConnectionHandler {
|
|
3
|
+
abstract onSocketConnect(socket: IServerSocket): Promise<void>;
|
|
4
|
+
abstract onSocketDisconnect(socket: IServerSocket): Promise<void>;
|
|
5
|
+
abstract onMessage(socket: IServerSocket, message: any, channel?: string): Promise<void>;
|
|
6
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IServerSocket } from "./IServerSocket";
|
|
2
|
-
export declare abstract class AbstractSocketController {
|
|
3
|
-
readonly channel: string;
|
|
4
|
-
constructor(channel: string);
|
|
5
|
-
onChannelJoin(socket: IServerSocket): Promise<void>;
|
|
6
|
-
onChannelLeave(socket: IServerSocket): Promise<void>;
|
|
7
|
-
/**
|
|
8
|
-
* Handle the message sent to this channel
|
|
9
|
-
* @param socket the socket sending message
|
|
10
|
-
* @param data the data payload being sent
|
|
11
|
-
* @returns return false to prevent message broadcast
|
|
12
|
-
*/
|
|
13
|
-
onMessage(socket: IServerSocket, message: any): Promise<boolean | void>;
|
|
14
|
-
}
|
|
1
|
+
import { IServerSocket } from "./IServerSocket";
|
|
2
|
+
export declare abstract class AbstractSocketController {
|
|
3
|
+
readonly channel: string;
|
|
4
|
+
constructor(channel: string);
|
|
5
|
+
onChannelJoin(socket: IServerSocket): Promise<void>;
|
|
6
|
+
onChannelLeave(socket: IServerSocket): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Handle the message sent to this channel
|
|
9
|
+
* @param socket the socket sending message
|
|
10
|
+
* @param data the data payload being sent
|
|
11
|
+
* @returns return false to prevent message broadcast
|
|
12
|
+
*/
|
|
13
|
+
onMessage(socket: IServerSocket, message: any): Promise<boolean | void>;
|
|
14
|
+
}
|
|
@@ -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
|
+
}
|