@stemy/backend 5.2.1 → 6.0.0
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/commands/clear-command.d.ts +6 -6
- package/commands/fixtures-command.d.ts +9 -9
- package/commands/index.d.ts +2 -2
- package/common-types.d.ts +325 -326
- package/esm2020/services/assets.mjs +2 -2
- package/esm2022/commands/clear-command.mjs +15 -0
- package/esm2022/commands/fixtures-command.mjs +26 -0
- package/esm2022/commands/index.mjs +7 -0
- package/esm2022/common-types.mjs +26 -0
- package/esm2022/fixtures/index.mjs +5 -0
- package/esm2022/fixtures/ttl.fixture.mjs +23 -0
- package/esm2022/public_api.mjs +378 -0
- package/esm2022/requests/asset-image-params.mjs +60 -0
- package/esm2022/rest-controllers/assets.controller.mjs +177 -0
- package/esm2022/rest-controllers/auth.controller.mjs +57 -0
- package/esm2022/rest-controllers/gallery.controller.mjs +27 -0
- package/esm2022/rest-controllers/progresses.controller.mjs +38 -0
- package/esm2022/rest-controllers/terminal-styles.mjs +67 -0
- package/esm2022/rest-controllers/terminal.controller.mjs +132 -0
- package/esm2022/rest-middlewares/container.middleware.mjs +22 -0
- package/esm2022/rest-middlewares/error-handler.middleware.mjs +79 -0
- package/esm2022/rest-middlewares/language.middleware.mjs +21 -0
- package/esm2022/rest-middlewares/request-ended.middleware.mjs +26 -0
- package/esm2022/rest-middlewares/request-started.middleware.mjs +25 -0
- package/esm2022/services/asset-processor.mjs +90 -0
- package/esm2022/services/asset-resolver.mjs +36 -0
- package/esm2022/services/assets.mjs +154 -0
- package/esm2022/services/backend-provider.mjs +83 -0
- package/esm2022/services/cache-processor.mjs +16 -0
- package/esm2022/services/cache.mjs +70 -0
- package/esm2022/services/configuration.mjs +68 -0
- package/esm2022/services/drivers/asset-grid.driver.mjs +27 -0
- package/esm2022/services/drivers/asset-local.driver.mjs +41 -0
- package/esm2022/services/endpoint-provider.mjs +13 -0
- package/esm2022/services/entities/asset.mjs +61 -0
- package/esm2022/services/entities/base-entity.mjs +32 -0
- package/esm2022/services/entities/lazy-asset.mjs +87 -0
- package/esm2022/services/entities/progress.mjs +182 -0
- package/esm2022/services/entities/temp-asset.mjs +53 -0
- package/esm2022/services/fixtures.mjs +38 -0
- package/esm2022/services/gallery-cache.mjs +29 -0
- package/esm2022/services/gallery-image.mjs +42 -0
- package/esm2022/services/gallery.mjs +124 -0
- package/esm2022/services/id-generator.mjs +49 -0
- package/esm2022/services/job-manager.mjs +198 -0
- package/esm2022/services/lazy-assets.mjs +68 -0
- package/esm2022/services/logger.mjs +26 -0
- package/esm2022/services/mail-sender.mjs +42 -0
- package/esm2022/services/memory-cache.mjs +61 -0
- package/esm2022/services/mongo-connector.mjs +36 -0
- package/esm2022/services/open-api.mjs +124 -0
- package/esm2022/services/progresses.mjs +93 -0
- package/esm2022/services/template-renderer.mjs +71 -0
- package/esm2022/services/terminal-manager.mjs +88 -0
- package/esm2022/services/token-generator.mjs +37 -0
- package/esm2022/services/translation-provider.mjs +39 -0
- package/esm2022/services/translator.mjs +67 -0
- package/esm2022/services/user-manager.mjs +27 -0
- package/esm2022/socket-controllers/progress.controller.mjs +63 -0
- package/esm2022/socket-controllers/terminal.controller.mjs +61 -0
- package/esm2022/socket-controllers/terminal.mjs +89 -0
- package/esm2022/socket-middlewares/compression.middleware.mjs +14 -0
- package/esm2022/static.mjs +23 -0
- package/esm2022/stemy-backend.mjs +5 -0
- package/esm2022/utilities/base-doc.mjs +33 -0
- package/esm2022/utilities/decorators.mjs +51 -0
- package/esm2022/utilities/di-container.mjs +88 -0
- package/esm2022/utilities/empty-job.mjs +13 -0
- package/esm2022/utilities/lazy-asset-generator.mjs +38 -0
- package/esm2022/utilities/mongoose.mjs +216 -0
- package/esm2022/utilities/tree.mjs +119 -0
- package/esm2022/utils.mjs +726 -0
- package/esm2022/validators.mjs +46 -0
- package/fesm2015/stemy-backend.mjs +1 -1
- package/fesm2015/stemy-backend.mjs.map +1 -1
- package/fesm2020/stemy-backend.mjs +1 -1
- package/fesm2020/stemy-backend.mjs.map +1 -1
- package/fesm2022/stemy-backend.mjs +4690 -0
- package/fesm2022/stemy-backend.mjs.map +1 -0
- package/fixtures/index.d.ts +2 -2
- package/fixtures/ttl.fixture.d.ts +7 -7
- package/index.d.ts +5 -5
- package/package.json +43 -49
- package/public_api.d.ts +44 -44
- package/requests/asset-image-params.d.ts +12 -12
- package/rest-controllers/assets.controller.d.ts +25 -27
- package/rest-controllers/auth.controller.d.ts +14 -14
- package/rest-controllers/gallery.controller.d.ts +6 -7
- package/rest-controllers/progresses.controller.d.ts +9 -9
- package/rest-controllers/terminal-styles.d.ts +2 -2
- package/rest-controllers/terminal.controller.d.ts +10 -10
- package/rest-middlewares/container.middleware.d.ts +8 -8
- package/rest-middlewares/error-handler.middleware.d.ts +13 -13
- package/rest-middlewares/language.middleware.d.ts +8 -8
- package/rest-middlewares/request-ended.middleware.d.ts +8 -8
- package/rest-middlewares/request-started.middleware.d.ts +8 -8
- package/services/asset-processor.d.ts +10 -11
- package/services/asset-resolver.d.ts +10 -10
- package/services/assets.d.ts +24 -26
- package/services/backend-provider.d.ts +19 -20
- package/services/cache-processor.d.ts +4 -4
- package/services/cache.d.ts +23 -23
- package/services/configuration.d.ts +15 -15
- package/services/drivers/asset-grid.driver.d.ts +11 -11
- package/services/drivers/asset-local.driver.d.ts +10 -11
- package/services/endpoint-provider.d.ts +4 -4
- package/services/entities/asset.d.ts +19 -21
- package/services/entities/base-entity.d.ts +13 -13
- package/services/entities/lazy-asset.d.ts +25 -25
- package/services/entities/progress.d.ts +49 -49
- package/services/entities/temp-asset.d.ts +20 -22
- package/services/fixtures.d.ts +8 -8
- package/services/gallery-cache.d.ts +8 -9
- package/services/gallery-image.d.ts +10 -11
- package/services/gallery.d.ts +13 -13
- package/services/id-generator.d.ts +11 -11
- package/services/job-manager.d.ts +35 -35
- package/services/lazy-assets.d.ts +22 -22
- package/services/logger.d.ts +8 -8
- package/services/mail-sender.d.ts +20 -20
- package/services/memory-cache.d.ts +10 -10
- package/services/mongo-connector.d.ts +12 -12
- package/services/open-api.d.ts +13 -13
- package/services/progresses.d.ts +20 -20
- package/services/template-renderer.d.ts +14 -14
- package/services/terminal-manager.d.ts +15 -15
- package/services/token-generator.d.ts +6 -6
- package/services/translation-provider.d.ts +9 -9
- package/services/translator.d.ts +15 -15
- package/services/user-manager.d.ts +6 -6
- package/socket-controllers/progress.controller.d.ts +10 -10
- package/socket-controllers/terminal.controller.d.ts +13 -13
- package/socket-controllers/terminal.d.ts +19 -20
- package/socket-middlewares/compression.middleware.d.ts +4 -4
- package/static.d.ts +2 -2
- package/utilities/base-doc.d.ts +40 -40
- package/utilities/decorators.d.ts +10 -10
- package/utilities/di-container.d.ts +43 -43
- package/utilities/empty-job.d.ts +4 -4
- package/utilities/lazy-asset-generator.d.ts +15 -15
- package/utilities/mongoose.d.ts +36 -36
- package/utilities/tree.d.ts +15 -15
- package/utils.d.ts +120 -123
- package/validators.d.ts +7 -7
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { DependencyContainer } from "tsyringe";
|
|
2
|
-
import { Socket } from "zeromq";
|
|
3
|
-
import { Subject, Subscription } from "rxjs";
|
|
4
|
-
import { IJob, IJobTask, ISocketMessage, JobParams, JobScheduleTime, SocketParams, Type } from "../common-types";
|
|
5
|
-
import { Configuration } from "./configuration";
|
|
6
|
-
import { Logger } from "./logger";
|
|
7
|
-
export declare class JobManager {
|
|
8
|
-
readonly config: Configuration;
|
|
9
|
-
readonly logger: Logger;
|
|
10
|
-
readonly container: DependencyContainer;
|
|
11
|
-
protected jobTypes: Type<IJob>[];
|
|
12
|
-
protected jobs: {
|
|
13
|
-
[name: string]: (jobParams: JobParams, uniqueId: string) => Promise<any>;
|
|
14
|
-
};
|
|
15
|
-
protected messages: Subject<ISocketMessage>;
|
|
16
|
-
protected processing: Promise<any>;
|
|
17
|
-
protected apiPush: Socket;
|
|
18
|
-
protected apiPull: Socket;
|
|
19
|
-
protected workerPush: Socket;
|
|
20
|
-
protected workerPull: Socket;
|
|
21
|
-
readonly maxTimeout: number;
|
|
22
|
-
constructor(config: Configuration, logger: Logger, container: DependencyContainer, jobTypes: Type<IJob>[]);
|
|
23
|
-
on(message: string, cb: (params: SocketParams) => any): Subscription;
|
|
24
|
-
process(jobType: Type<IJob>, params?: JobParams): Promise<any>;
|
|
25
|
-
enqueueWithName(name: string, params?: JobParams): Promise<string>;
|
|
26
|
-
enqueue(jobType: Type<IJob>, params?: JobParams): Promise<string>;
|
|
27
|
-
schedule(minute: JobScheduleTime, hour: JobScheduleTime, dayOfMonth: JobScheduleTime, month: JobScheduleTime, dayOfWeek: JobScheduleTime, jobType: Type<IJob>, params?: JobParams): IJobTask;
|
|
28
|
-
protected initProcessing(): Promise<void>;
|
|
29
|
-
startProcessing(): Promise<void>;
|
|
30
|
-
tryResolve(jobType: Type<IJob>, params: JobParams): string;
|
|
31
|
-
protected tryResolveFromName(jobName: string, params: JobParams): string;
|
|
32
|
-
protected tryResolveAndInit(jobType: Type<IJob>, params: JobParams): string;
|
|
33
|
-
protected resolveJobInstance(jobType: Type<IJob>, params: JobParams, uniqueId?: string): IJob;
|
|
34
|
-
protected sendToWorkers(jobName: string, params: JobParams): Promise<string>;
|
|
35
|
-
}
|
|
1
|
+
import { DependencyContainer } from "tsyringe";
|
|
2
|
+
import { Socket } from "zeromq/v5-compat";
|
|
3
|
+
import { Subject, Subscription } from "rxjs";
|
|
4
|
+
import { IJob, IJobTask, ISocketMessage, JobParams, JobScheduleTime, SocketParams, Type } from "../common-types";
|
|
5
|
+
import { Configuration } from "./configuration";
|
|
6
|
+
import { Logger } from "./logger";
|
|
7
|
+
export declare class JobManager {
|
|
8
|
+
readonly config: Configuration;
|
|
9
|
+
readonly logger: Logger;
|
|
10
|
+
readonly container: DependencyContainer;
|
|
11
|
+
protected jobTypes: Type<IJob>[];
|
|
12
|
+
protected jobs: {
|
|
13
|
+
[name: string]: (jobParams: JobParams, uniqueId: string) => Promise<any>;
|
|
14
|
+
};
|
|
15
|
+
protected messages: Subject<ISocketMessage>;
|
|
16
|
+
protected processing: Promise<any>;
|
|
17
|
+
protected apiPush: Socket;
|
|
18
|
+
protected apiPull: Socket;
|
|
19
|
+
protected workerPush: Socket;
|
|
20
|
+
protected workerPull: Socket;
|
|
21
|
+
readonly maxTimeout: number;
|
|
22
|
+
constructor(config: Configuration, logger: Logger, container: DependencyContainer, jobTypes: Type<IJob>[]);
|
|
23
|
+
on(message: string, cb: (params: SocketParams) => any): Subscription;
|
|
24
|
+
process(jobType: Type<IJob>, params?: JobParams): Promise<any>;
|
|
25
|
+
enqueueWithName(name: string, params?: JobParams): Promise<string>;
|
|
26
|
+
enqueue(jobType: Type<IJob>, params?: JobParams): Promise<string>;
|
|
27
|
+
schedule(minute: JobScheduleTime, hour: JobScheduleTime, dayOfMonth: JobScheduleTime, month: JobScheduleTime, dayOfWeek: JobScheduleTime, jobType: Type<IJob>, params?: JobParams): IJobTask;
|
|
28
|
+
protected initProcessing(): Promise<void>;
|
|
29
|
+
startProcessing(): Promise<void>;
|
|
30
|
+
tryResolve(jobType: Type<IJob>, params: JobParams): string;
|
|
31
|
+
protected tryResolveFromName(jobName: string, params: JobParams): string;
|
|
32
|
+
protected tryResolveAndInit(jobType: Type<IJob>, params: JobParams): string;
|
|
33
|
+
protected resolveJobInstance(jobType: Type<IJob>, params: JobParams, uniqueId?: string): IJob;
|
|
34
|
+
protected sendToWorkers(jobName: string, params: JobParams): Promise<string>;
|
|
35
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { ObjectId } from "bson";
|
|
2
|
-
import { Collection } from "mongodb";
|
|
3
|
-
import { FilterQuery } from "mongoose";
|
|
4
|
-
import { IJob, ILazyAsset, JobParams, Type } from "../common-types";
|
|
5
|
-
import { MongoConnector } from "./mongo-connector";
|
|
6
|
-
import { Assets } from "./assets";
|
|
7
|
-
import { JobManager } from "./job-manager";
|
|
8
|
-
import { Logger } from "./logger";
|
|
9
|
-
import { Progresses } from "./progresses";
|
|
10
|
-
export declare class LazyAssets {
|
|
11
|
-
readonly connector: MongoConnector;
|
|
12
|
-
readonly assets: Assets;
|
|
13
|
-
readonly progresses: Progresses;
|
|
14
|
-
readonly logger: Logger;
|
|
15
|
-
readonly jobMan: JobManager;
|
|
16
|
-
protected collection: Collection<Partial<ILazyAsset>>;
|
|
17
|
-
constructor(connector: MongoConnector, assets: Assets, progresses: Progresses, logger: Logger, jobMan: JobManager);
|
|
18
|
-
create(jobType: Type<IJob>, jobParamsObj?: JobParams, jobQue?: string): Promise<ILazyAsset>;
|
|
19
|
-
read(id: string | ObjectId): Promise<ILazyAsset>;
|
|
20
|
-
find(where: FilterQuery<ILazyAsset>): Promise<ILazyAsset>;
|
|
21
|
-
unlink(id: string): Promise<any>;
|
|
22
|
-
}
|
|
1
|
+
import { ObjectId } from "bson";
|
|
2
|
+
import { Collection } from "mongodb";
|
|
3
|
+
import { FilterQuery } from "mongoose";
|
|
4
|
+
import { IJob, ILazyAsset, JobParams, Type } from "../common-types";
|
|
5
|
+
import { MongoConnector } from "./mongo-connector";
|
|
6
|
+
import { Assets } from "./assets";
|
|
7
|
+
import { JobManager } from "./job-manager";
|
|
8
|
+
import { Logger } from "./logger";
|
|
9
|
+
import { Progresses } from "./progresses";
|
|
10
|
+
export declare class LazyAssets {
|
|
11
|
+
readonly connector: MongoConnector;
|
|
12
|
+
readonly assets: Assets;
|
|
13
|
+
readonly progresses: Progresses;
|
|
14
|
+
readonly logger: Logger;
|
|
15
|
+
readonly jobMan: JobManager;
|
|
16
|
+
protected collection: Collection<Partial<ILazyAsset>>;
|
|
17
|
+
constructor(connector: MongoConnector, assets: Assets, progresses: Progresses, logger: Logger, jobMan: JobManager);
|
|
18
|
+
create(jobType: Type<IJob>, jobParamsObj?: JobParams, jobQue?: string): Promise<ILazyAsset>;
|
|
19
|
+
read(id: string | ObjectId): Promise<ILazyAsset>;
|
|
20
|
+
find(where: FilterQuery<ILazyAsset>): Promise<ILazyAsset>;
|
|
21
|
+
unlink(id: string): Promise<any>;
|
|
22
|
+
}
|
package/services/logger.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Configuration } from "./configuration";
|
|
2
|
-
export declare class Logger {
|
|
3
|
-
readonly config: Configuration;
|
|
4
|
-
protected tags: string[];
|
|
5
|
-
protected ignoredTags: string[];
|
|
6
|
-
constructor(config: Configuration);
|
|
7
|
-
log(tag: string, ...params: any[]): void;
|
|
8
|
-
}
|
|
1
|
+
import { Configuration } from "./configuration";
|
|
2
|
+
export declare class Logger {
|
|
3
|
+
readonly config: Configuration;
|
|
4
|
+
protected tags: string[];
|
|
5
|
+
protected ignoredTags: string[];
|
|
6
|
+
constructor(config: Configuration);
|
|
7
|
+
log(tag: string, ...params: any[]): void;
|
|
8
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import * as Mail from "nodemailer/lib/mailer";
|
|
2
|
-
import { TemplateRenderer } from "./template-renderer";
|
|
3
|
-
import { Translator } from "./translator";
|
|
4
|
-
import { Configuration } from "./configuration";
|
|
5
|
-
export interface MailOptions {
|
|
6
|
-
to: string;
|
|
7
|
-
from?: string;
|
|
8
|
-
subject?: string;
|
|
9
|
-
template: string;
|
|
10
|
-
context: any;
|
|
11
|
-
attachments?: Mail.Attachment[];
|
|
12
|
-
}
|
|
13
|
-
export declare class MailSender {
|
|
14
|
-
readonly config: Configuration;
|
|
15
|
-
readonly renderer: TemplateRenderer;
|
|
16
|
-
readonly transporter: Mail;
|
|
17
|
-
get translator(): Translator;
|
|
18
|
-
constructor(config: Configuration, renderer: TemplateRenderer);
|
|
19
|
-
sendMail(language: string, options: MailOptions): Promise<any>;
|
|
20
|
-
}
|
|
1
|
+
import * as Mail from "nodemailer/lib/mailer";
|
|
2
|
+
import { TemplateRenderer } from "./template-renderer";
|
|
3
|
+
import { Translator } from "./translator";
|
|
4
|
+
import { Configuration } from "./configuration";
|
|
5
|
+
export interface MailOptions {
|
|
6
|
+
to: string;
|
|
7
|
+
from?: string;
|
|
8
|
+
subject?: string;
|
|
9
|
+
template: string;
|
|
10
|
+
context: any;
|
|
11
|
+
attachments?: Mail.Attachment[];
|
|
12
|
+
}
|
|
13
|
+
export declare class MailSender {
|
|
14
|
+
readonly config: Configuration;
|
|
15
|
+
readonly renderer: TemplateRenderer;
|
|
16
|
+
readonly transporter: Mail;
|
|
17
|
+
get translator(): Translator;
|
|
18
|
+
constructor(config: Configuration, renderer: TemplateRenderer);
|
|
19
|
+
sendMail(language: string, options: MailOptions): Promise<any>;
|
|
20
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Cache, ICacheItem } from "./cache";
|
|
2
|
-
export declare class MemoryCache {
|
|
3
|
-
protected readonly cache: Cache;
|
|
4
|
-
protected readonly cacheMap: Map<string, ICacheItem>;
|
|
5
|
-
constructor(cache: Cache);
|
|
6
|
-
set(key: string, value: any, ttl?: number, expirationTimestamp?: number, tags?: any): Promise<any>;
|
|
7
|
-
get(key: string): Promise<any>;
|
|
8
|
-
getOrSet(key: string, valueCb: () => Promise<any>, ttl?: number, expirationTimestamp?: number, tags?: any): Promise<any>;
|
|
9
|
-
delete(key: string): Promise<any>;
|
|
10
|
-
}
|
|
1
|
+
import { Cache, ICacheItem } from "./cache";
|
|
2
|
+
export declare class MemoryCache {
|
|
3
|
+
protected readonly cache: Cache;
|
|
4
|
+
protected readonly cacheMap: Map<string, ICacheItem>;
|
|
5
|
+
constructor(cache: Cache);
|
|
6
|
+
set(key: string, value: any, ttl?: number, expirationTimestamp?: number, tags?: any): Promise<any>;
|
|
7
|
+
get(key: string): Promise<any>;
|
|
8
|
+
getOrSet(key: string, valueCb: () => Promise<any>, ttl?: number, expirationTimestamp?: number, tags?: any): Promise<any>;
|
|
9
|
+
delete(key: string): Promise<any>;
|
|
10
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Db } from "mongodb";
|
|
2
|
-
import mongoose from "mongoose";
|
|
3
|
-
import { Configuration } from "./configuration";
|
|
4
|
-
export declare class MongoConnector {
|
|
5
|
-
readonly configuration: Configuration;
|
|
6
|
-
get connection(): mongoose.Connection;
|
|
7
|
-
get database(): Db;
|
|
8
|
-
protected conn: mongoose.Connection;
|
|
9
|
-
protected db: Db;
|
|
10
|
-
constructor(configuration: Configuration);
|
|
11
|
-
connect(): Promise<Db>;
|
|
12
|
-
}
|
|
1
|
+
import { Db } from "mongodb";
|
|
2
|
+
import mongoose from "mongoose";
|
|
3
|
+
import { Configuration } from "./configuration";
|
|
4
|
+
export declare class MongoConnector {
|
|
5
|
+
readonly configuration: Configuration;
|
|
6
|
+
get connection(): mongoose.Connection;
|
|
7
|
+
get database(): Db;
|
|
8
|
+
protected conn: mongoose.Connection;
|
|
9
|
+
protected db: Db;
|
|
10
|
+
constructor(configuration: Configuration);
|
|
11
|
+
connect(): Promise<Db>;
|
|
12
|
+
}
|
package/services/open-api.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { OpenAPIObject, ReferenceObject, SchemaObject } from "openapi3-ts";
|
|
2
|
-
import { IDependencyContainer, IRequest, OpenApiValidation } from "../common-types";
|
|
3
|
-
export declare class OpenApi {
|
|
4
|
-
protected container: IDependencyContainer;
|
|
5
|
-
protected customValidation: OpenApiValidation;
|
|
6
|
-
protected docs: OpenAPIObject;
|
|
7
|
-
protected docsStr: string;
|
|
8
|
-
get apiDocs(): OpenAPIObject;
|
|
9
|
-
get apiDocsStr(): string;
|
|
10
|
-
constructor(container: IDependencyContainer, customValidation: OpenApiValidation);
|
|
11
|
-
schemaToExample(src: ReferenceObject | SchemaObject, req?: IRequest): Promise<any>;
|
|
12
|
-
protected createApiDocs(): OpenAPIObject;
|
|
13
|
-
}
|
|
1
|
+
import { OpenAPIObject, ReferenceObject, SchemaObject } from "openapi3-ts";
|
|
2
|
+
import { IDependencyContainer, IRequest, OpenApiValidation } from "../common-types";
|
|
3
|
+
export declare class OpenApi {
|
|
4
|
+
protected container: IDependencyContainer;
|
|
5
|
+
protected customValidation: OpenApiValidation;
|
|
6
|
+
protected docs: OpenAPIObject;
|
|
7
|
+
protected docsStr: string;
|
|
8
|
+
get apiDocs(): OpenAPIObject;
|
|
9
|
+
get apiDocsStr(): string;
|
|
10
|
+
constructor(container: IDependencyContainer, customValidation: OpenApiValidation);
|
|
11
|
+
schemaToExample(src: ReferenceObject | SchemaObject, req?: IRequest): Promise<any>;
|
|
12
|
+
protected createApiDocs(): OpenAPIObject;
|
|
13
|
+
}
|
package/services/progresses.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Collection } from "mongodb";
|
|
2
|
-
import { FilterQuery } from "mongoose";
|
|
3
|
-
import { IProgress } from "../common-types";
|
|
4
|
-
import { MongoConnector } from "./mongo-connector";
|
|
5
|
-
import { JobManager } from "./job-manager";
|
|
6
|
-
export declare class Progresses {
|
|
7
|
-
readonly connector: MongoConnector;
|
|
8
|
-
readonly jobMan: JobManager;
|
|
9
|
-
protected collection: Collection<Partial<IProgress>>;
|
|
10
|
-
protected progresses: {
|
|
11
|
-
[id: string]: IProgress;
|
|
12
|
-
};
|
|
13
|
-
constructor(connector: MongoConnector, jobMan: JobManager);
|
|
14
|
-
waitToFinish(id: string): Promise<IProgress>;
|
|
15
|
-
get(id: string): Promise<IProgress>;
|
|
16
|
-
find(where: FilterQuery<IProgress>): Promise<IProgress>;
|
|
17
|
-
create(max?: number): Promise<IProgress>;
|
|
18
|
-
remove(id: string): Promise<any>;
|
|
19
|
-
protected waitForProgress(id: string, cb: () => Promise<IProgress>, delay: number): Promise<IProgress>;
|
|
20
|
-
}
|
|
1
|
+
import { Collection } from "mongodb";
|
|
2
|
+
import { FilterQuery } from "mongoose";
|
|
3
|
+
import { IProgress } from "../common-types";
|
|
4
|
+
import { MongoConnector } from "./mongo-connector";
|
|
5
|
+
import { JobManager } from "./job-manager";
|
|
6
|
+
export declare class Progresses {
|
|
7
|
+
readonly connector: MongoConnector;
|
|
8
|
+
readonly jobMan: JobManager;
|
|
9
|
+
protected collection: Collection<Partial<IProgress>>;
|
|
10
|
+
protected progresses: {
|
|
11
|
+
[id: string]: IProgress;
|
|
12
|
+
};
|
|
13
|
+
constructor(connector: MongoConnector, jobMan: JobManager);
|
|
14
|
+
waitToFinish(id: string): Promise<IProgress>;
|
|
15
|
+
get(id: string): Promise<IProgress>;
|
|
16
|
+
find(where: FilterQuery<IProgress>): Promise<IProgress>;
|
|
17
|
+
create(max?: number): Promise<IProgress>;
|
|
18
|
+
remove(id: string): Promise<any>;
|
|
19
|
+
protected waitForProgress(id: string, cb: () => Promise<IProgress>, delay: number): Promise<IProgress>;
|
|
20
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Translator } from "./translator";
|
|
2
|
-
import { Configuration } from "./configuration";
|
|
3
|
-
export declare class TemplateRenderer {
|
|
4
|
-
readonly translator: Translator;
|
|
5
|
-
readonly config: Configuration;
|
|
6
|
-
templates: {
|
|
7
|
-
[name: string]: Function;
|
|
8
|
-
};
|
|
9
|
-
protected initPromise: Promise<any>;
|
|
10
|
-
constructor(translator: Translator, config: Configuration);
|
|
11
|
-
protected init(): Promise<any>;
|
|
12
|
-
parseTemplates(dir: string, dirPath: string[]): Promise<void>;
|
|
13
|
-
render(template: string, language: string, context?: any): Promise<string>;
|
|
14
|
-
}
|
|
1
|
+
import { Translator } from "./translator";
|
|
2
|
+
import { Configuration } from "./configuration";
|
|
3
|
+
export declare class TemplateRenderer {
|
|
4
|
+
readonly translator: Translator;
|
|
5
|
+
readonly config: Configuration;
|
|
6
|
+
templates: {
|
|
7
|
+
[name: string]: Function;
|
|
8
|
+
};
|
|
9
|
+
protected initPromise: Promise<any>;
|
|
10
|
+
constructor(translator: Translator, config: Configuration);
|
|
11
|
+
protected init(): Promise<any>;
|
|
12
|
+
parseTemplates(dir: string, dirPath: string[]): Promise<void>;
|
|
13
|
+
render(template: string, language: string, context?: any): Promise<string>;
|
|
14
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ICommandMap, ISuggestionMap } from "@stemy/terminal-commands-addon";
|
|
2
|
-
import { ITerminal, ITerminalCommand } from "../common-types";
|
|
3
|
-
import { Logger } from "./logger";
|
|
4
|
-
import { Configuration } from "./configuration";
|
|
5
|
-
export declare class TerminalManager {
|
|
6
|
-
protected logger: Logger;
|
|
7
|
-
protected config: Configuration;
|
|
8
|
-
protected servicePassword: string;
|
|
9
|
-
protected suggestions: ISuggestionMap;
|
|
10
|
-
protected commands: ICommandMap;
|
|
11
|
-
protected loggedOutCommands: string[];
|
|
12
|
-
protected loggedInCommands: string[];
|
|
13
|
-
constructor(logger: Logger, config: Configuration, commands: ITerminalCommand[]);
|
|
14
|
-
loadAddons(terminal: ITerminal): void;
|
|
15
|
-
}
|
|
1
|
+
import { ICommandMap, ISuggestionMap } from "@stemy/terminal-commands-addon";
|
|
2
|
+
import { ITerminal, ITerminalCommand } from "../common-types";
|
|
3
|
+
import { Logger } from "./logger";
|
|
4
|
+
import { Configuration } from "./configuration";
|
|
5
|
+
export declare class TerminalManager {
|
|
6
|
+
protected logger: Logger;
|
|
7
|
+
protected config: Configuration;
|
|
8
|
+
protected servicePassword: string;
|
|
9
|
+
protected suggestions: ISuggestionMap;
|
|
10
|
+
protected commands: ICommandMap;
|
|
11
|
+
protected loggedOutCommands: string[];
|
|
12
|
+
protected loggedInCommands: string[];
|
|
13
|
+
constructor(logger: Logger, config: Configuration, commands: ITerminalCommand[]);
|
|
14
|
+
loadAddons(terminal: ITerminal): void;
|
|
15
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare class TokenGenerator {
|
|
2
|
-
protected chars: string;
|
|
3
|
-
constructor();
|
|
4
|
-
generate(checkCb: (token: string) => Promise<boolean>): Promise<string>;
|
|
5
|
-
private generateToken;
|
|
6
|
-
}
|
|
1
|
+
export declare class TokenGenerator {
|
|
2
|
+
protected chars: string;
|
|
3
|
+
constructor();
|
|
4
|
+
generate(checkCb: (token: string) => Promise<boolean>): Promise<string>;
|
|
5
|
+
private generateToken;
|
|
6
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Configuration } from "./configuration";
|
|
2
|
-
import { ITranslations } from "../common-types";
|
|
3
|
-
import { Cache } from "./cache";
|
|
4
|
-
export declare class TranslationProvider {
|
|
5
|
-
readonly config: Configuration;
|
|
6
|
-
readonly cache: Cache;
|
|
7
|
-
constructor(config: Configuration, cache: Cache);
|
|
8
|
-
getDictionary(language: string): Promise<ITranslations>;
|
|
9
|
-
}
|
|
1
|
+
import { Configuration } from "./configuration";
|
|
2
|
+
import { ITranslations } from "../common-types";
|
|
3
|
+
import { Cache } from "./cache";
|
|
4
|
+
export declare class TranslationProvider {
|
|
5
|
+
readonly config: Configuration;
|
|
6
|
+
readonly cache: Cache;
|
|
7
|
+
constructor(config: Configuration, cache: Cache);
|
|
8
|
+
getDictionary(language: string): Promise<ITranslations>;
|
|
9
|
+
}
|
package/services/translator.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ITranslations } from "../common-types";
|
|
2
|
-
import { TranslationProvider } from "./translation-provider";
|
|
3
|
-
export declare class Translator {
|
|
4
|
-
private translationProvider;
|
|
5
|
-
protected dictionaries: {
|
|
6
|
-
[lang: string]: ITranslations;
|
|
7
|
-
};
|
|
8
|
-
constructor(translationProvider: TranslationProvider);
|
|
9
|
-
getDictionary(language: string): Promise<ITranslations>;
|
|
10
|
-
getTranslationSync(language: string, key: string, params?: any): string;
|
|
11
|
-
getTranslation(language: string, key: string, params?: any): Promise<string>;
|
|
12
|
-
getTranslations(language: string, ...keys: string[]): Promise<ITranslations>;
|
|
13
|
-
protected interpolate(expr: string | Function, params?: any): string;
|
|
14
|
-
protected interpolateString(expr: string, params?: any): string;
|
|
15
|
-
}
|
|
1
|
+
import { ITranslations } from "../common-types";
|
|
2
|
+
import { TranslationProvider } from "./translation-provider";
|
|
3
|
+
export declare class Translator {
|
|
4
|
+
private translationProvider;
|
|
5
|
+
protected dictionaries: {
|
|
6
|
+
[lang: string]: ITranslations;
|
|
7
|
+
};
|
|
8
|
+
constructor(translationProvider: TranslationProvider);
|
|
9
|
+
getDictionary(language: string): Promise<ITranslations>;
|
|
10
|
+
getTranslationSync(language: string, key: string, params?: any): string;
|
|
11
|
+
getTranslation(language: string, key: string, params?: any): Promise<string>;
|
|
12
|
+
getTranslations(language: string, ...keys: string[]): Promise<ITranslations>;
|
|
13
|
+
protected interpolate(expr: string | Function, params?: any): string;
|
|
14
|
+
protected interpolateString(expr: string, params?: any): string;
|
|
15
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IUser } from "../common-types";
|
|
2
|
-
export declare class UserManager {
|
|
3
|
-
getByCredentials(credentials: any): Promise<IUser>;
|
|
4
|
-
getById(id: string): Promise<IUser>;
|
|
5
|
-
serialize(user: IUser): Promise<any>;
|
|
6
|
-
}
|
|
1
|
+
import { IUser } from "../common-types";
|
|
2
|
+
export declare class UserManager {
|
|
3
|
+
getByCredentials(credentials: any): Promise<IUser>;
|
|
4
|
+
getById(id: string): Promise<IUser>;
|
|
5
|
+
serialize(user: IUser): Promise<any>;
|
|
6
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Server } from "socket.io";
|
|
2
|
-
import { IClientSocket } from "../common-types";
|
|
3
|
-
import { Progresses } from "../services/progresses";
|
|
4
|
-
export declare class ProgressController {
|
|
5
|
-
readonly progresses: Progresses;
|
|
6
|
-
readonly socketServer: Server;
|
|
7
|
-
constructor(progresses: Progresses, socketServer: Server);
|
|
8
|
-
advanceProgress(client: IClientSocket, progressId: string): Promise<void>;
|
|
9
|
-
setProgressInterest(client: IClientSocket, progressId: string): Promise<void>;
|
|
10
|
-
}
|
|
1
|
+
import { Server } from "socket.io";
|
|
2
|
+
import { IClientSocket } from "../common-types";
|
|
3
|
+
import { Progresses } from "../services/progresses";
|
|
4
|
+
export declare class ProgressController {
|
|
5
|
+
readonly progresses: Progresses;
|
|
6
|
+
readonly socketServer: Server;
|
|
7
|
+
constructor(progresses: Progresses, socketServer: Server);
|
|
8
|
+
advanceProgress(client: IClientSocket, progressId: string): Promise<void>;
|
|
9
|
+
setProgressInterest(client: IClientSocket, progressId: string): Promise<void>;
|
|
10
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { IClientSocket, ITerminalFile } from "../common-types";
|
|
2
|
-
import { TerminalManager } from "../services/terminal-manager";
|
|
3
|
-
import { Terminal } from "./terminal";
|
|
4
|
-
export declare class TerminalController {
|
|
5
|
-
protected manager: TerminalManager;
|
|
6
|
-
protected terminals: {
|
|
7
|
-
[id: string]: Terminal;
|
|
8
|
-
};
|
|
9
|
-
constructor(manager: TerminalManager);
|
|
10
|
-
terminalInit(client: IClientSocket): Promise<void>;
|
|
11
|
-
terminalData(client: IClientSocket, data: string): Promise<void>;
|
|
12
|
-
terminalUpload(client: IClientSocket, upload: ITerminalFile): Promise<void>;
|
|
13
|
-
}
|
|
1
|
+
import { IClientSocket, ITerminalFile } from "../common-types";
|
|
2
|
+
import { TerminalManager } from "../services/terminal-manager";
|
|
3
|
+
import { Terminal } from "./terminal";
|
|
4
|
+
export declare class TerminalController {
|
|
5
|
+
protected manager: TerminalManager;
|
|
6
|
+
protected terminals: {
|
|
7
|
+
[id: string]: Terminal;
|
|
8
|
+
};
|
|
9
|
+
constructor(manager: TerminalManager);
|
|
10
|
+
terminalInit(client: IClientSocket): Promise<void>;
|
|
11
|
+
terminalData(client: IClientSocket, data: string): Promise<void>;
|
|
12
|
+
terminalUpload(client: IClientSocket, upload: ITerminalFile): Promise<void>;
|
|
13
|
+
}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
protected
|
|
7
|
-
protected
|
|
8
|
-
protected
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
1
|
+
import { BehaviorSubject, Subject } from "rxjs";
|
|
2
|
+
import { IDisposable, ITerminalAddon } from "@stemy/terminal-commands-addon";
|
|
3
|
+
import { IClientSocket, ITerminal, ITerminalFile } from "../common-types";
|
|
4
|
+
export declare class Terminal implements ITerminal {
|
|
5
|
+
protected client: IClientSocket;
|
|
6
|
+
protected addons: ITerminalAddon[];
|
|
7
|
+
protected files$: BehaviorSubject<ITerminalFile[]>;
|
|
8
|
+
protected input$: Subject<string>;
|
|
9
|
+
constructor(client: IClientSocket);
|
|
10
|
+
onData(cb: (data: string) => any): IDisposable;
|
|
11
|
+
write(data: string): void;
|
|
12
|
+
writeln(data: string): void;
|
|
13
|
+
loadAddon(addon: ITerminalAddon): void;
|
|
14
|
+
dispose(): void;
|
|
15
|
+
suggestFiles(accept: string): Promise<ITerminalFile[]>;
|
|
16
|
+
downloadFile(filename: string, buffer: Buffer): Promise<void>;
|
|
17
|
+
addFile(upload: ITerminalFile): void;
|
|
18
|
+
input(data: string): void;
|
|
19
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MiddlewareInterface } from "socket-controllers";
|
|
2
|
-
export declare class CompressionMiddleware implements MiddlewareInterface {
|
|
3
|
-
use(socket: any, next: (err?: any) => any): void;
|
|
4
|
-
}
|
|
1
|
+
import { MiddlewareInterface } from "socket-controllers";
|
|
2
|
+
export declare class CompressionMiddleware implements MiddlewareInterface {
|
|
3
|
+
use(socket: any, next: (err?: any) => any): void;
|
|
4
|
+
}
|
package/static.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IDependencyContainer } from "./common-types";
|
|
2
|
-
export declare function setupStatic(rootFolder: string, container: IDependencyContainer): Promise<any>;
|
|
1
|
+
import { IDependencyContainer } from "./common-types";
|
|
2
|
+
export declare function setupStatic(rootFolder: string, container: IDependencyContainer): Promise<any>;
|
package/utilities/base-doc.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { RefType } from "mongoose";
|
|
2
|
-
import mongoose from "mongoose";
|
|
3
|
-
import { DocumentType, ReturnModelType } from "@typegoose/typegoose";
|
|
4
|
-
import { Constructor } from "../common-types";
|
|
5
|
-
export declare abstract class BaseDoc<IDType extends RefType = mongoose.Types.ObjectId> {
|
|
6
|
-
_id?: IDType;
|
|
7
|
-
/**
|
|
8
|
-
* This getter/setter doesn't exist if "schemaOptions.id" being set to "false"
|
|
9
|
-
*/
|
|
10
|
-
id: string;
|
|
11
|
-
/**
|
|
12
|
-
* This getter doesn't exist if "schemaOptions.timestamps" being set to "false"
|
|
13
|
-
*/
|
|
14
|
-
createdAt?: Date;
|
|
15
|
-
/**
|
|
16
|
-
* This getter doesn't exist if "schemaOptions.timestamps" being set to "false"
|
|
17
|
-
*/
|
|
18
|
-
updatedAt?: Date;
|
|
19
|
-
/**
|
|
20
|
-
* Returns the Document as JSON
|
|
21
|
-
*/
|
|
22
|
-
toJSON?(): any;
|
|
23
|
-
/**
|
|
24
|
-
* Returns the Document as an Object
|
|
25
|
-
*/
|
|
26
|
-
toObject?(): any;
|
|
27
|
-
/**
|
|
28
|
-
* Casts this to DocumentType<this> to allow using document methods in get/set-s
|
|
29
|
-
*/
|
|
30
|
-
cast<ImplType = this>(): DocumentType<ImplType>;
|
|
31
|
-
/**
|
|
32
|
-
* Gets a pre-compiled model from typegoose cache by its class type
|
|
33
|
-
* @param type
|
|
34
|
-
*/
|
|
35
|
-
model<T extends Constructor<any>>(type: T): ReturnModelType<T>;
|
|
36
|
-
}
|
|
37
|
-
export type PrimitiveArray<T> = mongoose.Types.Array<T>;
|
|
38
|
-
export declare const PrimitiveArray: typeof mongoose.Types.Array;
|
|
39
|
-
export type DocumentArray<T extends BaseDoc> = mongoose.Types.DocumentArray<DocumentType<T>>;
|
|
40
|
-
export declare const DocumentArray: typeof mongoose.Types.DocumentArray;
|
|
1
|
+
import { RefType } from "mongoose";
|
|
2
|
+
import mongoose from "mongoose";
|
|
3
|
+
import { DocumentType, ReturnModelType } from "@typegoose/typegoose";
|
|
4
|
+
import { Constructor } from "../common-types";
|
|
5
|
+
export declare abstract class BaseDoc<IDType extends RefType = mongoose.Types.ObjectId> {
|
|
6
|
+
_id?: IDType;
|
|
7
|
+
/**
|
|
8
|
+
* This getter/setter doesn't exist if "schemaOptions.id" being set to "false"
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* This getter doesn't exist if "schemaOptions.timestamps" being set to "false"
|
|
13
|
+
*/
|
|
14
|
+
createdAt?: Date;
|
|
15
|
+
/**
|
|
16
|
+
* This getter doesn't exist if "schemaOptions.timestamps" being set to "false"
|
|
17
|
+
*/
|
|
18
|
+
updatedAt?: Date;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the Document as JSON
|
|
21
|
+
*/
|
|
22
|
+
toJSON?(): any;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the Document as an Object
|
|
25
|
+
*/
|
|
26
|
+
toObject?(): any;
|
|
27
|
+
/**
|
|
28
|
+
* Casts this to DocumentType<this> to allow using document methods in get/set-s
|
|
29
|
+
*/
|
|
30
|
+
cast<ImplType = this>(): DocumentType<ImplType>;
|
|
31
|
+
/**
|
|
32
|
+
* Gets a pre-compiled model from typegoose cache by its class type
|
|
33
|
+
* @param type
|
|
34
|
+
*/
|
|
35
|
+
model<T extends Constructor<any>>(type: T): ReturnModelType<T>;
|
|
36
|
+
}
|
|
37
|
+
export type PrimitiveArray<T> = mongoose.Types.Array<T>;
|
|
38
|
+
export declare const PrimitiveArray: typeof mongoose.Types.Array;
|
|
39
|
+
export type DocumentArray<T extends BaseDoc> = mongoose.Types.DocumentArray<DocumentType<T>>;
|
|
40
|
+
export declare const DocumentArray: typeof mongoose.Types.DocumentArray;
|