@stemy/backend 2.6.1 → 2.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bundles/stemy-backend.umd.js +5553 -5465
- package/bundles/stemy-backend.umd.js.map +1 -1
- package/bundles/stemy-backend.umd.min.js +1 -1
- package/bundles/stemy-backend.umd.min.js.map +1 -1
- package/common-types.d.ts +226 -214
- package/esm2015/common-types.js +18 -18
- package/esm2015/public_api.js +338 -338
- package/esm2015/rest-controllers/assets.controller.js +116 -116
- package/esm2015/rest-controllers/auth.controller.js +75 -75
- package/esm2015/rest-controllers/gallery.controller.js +37 -37
- package/esm2015/rest-controllers/progresses.controller.js +57 -57
- package/esm2015/rest-middlewares/container.middleware.js +32 -32
- package/esm2015/rest-middlewares/error-handler.middleware.js +83 -83
- package/esm2015/rest-middlewares/language.middleware.js +28 -28
- package/esm2015/rest-middlewares/request-ended.middleware.js +25 -25
- package/esm2015/rest-middlewares/request-started.middleware.js +24 -24
- package/esm2015/rest-openapi.js +44 -44
- package/esm2015/services/asset-processor.js +101 -101
- package/esm2015/services/asset-resolver.js +53 -53
- package/esm2015/services/assets.js +110 -110
- package/esm2015/services/backend-provider.js +32 -32
- package/esm2015/services/cache-processor.js +34 -34
- package/esm2015/services/cache.js +94 -94
- package/esm2015/services/configuration.js +55 -55
- package/esm2015/services/endpoint-provider.js +29 -29
- package/esm2015/services/entities/asset.js +166 -112
- package/esm2015/services/entities/lazy-asset.js +93 -93
- package/esm2015/services/entities/progress.js +181 -181
- package/esm2015/services/fixtures.js +45 -45
- package/esm2015/services/gallery-cache.js +36 -36
- package/esm2015/services/gallery-image.js +48 -48
- package/esm2015/services/gallery.js +138 -138
- package/esm2015/services/id-generator.js +63 -63
- package/esm2015/services/job-manager.js +203 -203
- package/esm2015/services/lazy-assets.js +74 -74
- package/esm2015/services/mail-sender.js +59 -59
- package/esm2015/services/memory-cache.js +84 -84
- package/esm2015/services/mongo-connector.js +61 -61
- package/esm2015/services/progresses.js +91 -91
- package/esm2015/services/template-renderer.js +89 -89
- package/esm2015/services/translation-provider.js +31 -31
- package/esm2015/services/translator.js +85 -85
- package/esm2015/services/user-manager.js +47 -47
- package/esm2015/socket-controllers/progress.controller.js +82 -82
- package/esm2015/socket-middlewares/compression.middleware.js +19 -19
- package/esm2015/static.js +33 -33
- package/esm2015/stemy-backend.js +4 -4
- package/esm2015/utilities/di-container.js +84 -84
- package/esm2015/utilities/lazy-asset-generator.js +40 -40
- package/esm2015/utilities/tree.js +111 -111
- package/esm2015/utils.js +618 -601
- package/esm2015/validators.js +51 -51
- package/fesm2015/stemy-backend.js +3656 -3585
- package/fesm2015/stemy-backend.js.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +33 -33
- package/rest-controllers/assets.controller.d.ts +16 -16
- package/rest-controllers/auth.controller.d.ts +14 -14
- package/rest-controllers/gallery.controller.d.ts +7 -7
- package/rest-controllers/progresses.controller.d.ts +9 -9
- 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 +5 -5
- package/rest-middlewares/request-started.middleware.d.ts +5 -5
- package/rest-openapi.d.ts +3 -3
- package/services/asset-processor.d.ts +12 -12
- package/services/asset-resolver.d.ts +9 -9
- package/services/assets.d.ts +19 -19
- package/services/backend-provider.d.ts +11 -11
- package/services/cache-processor.d.ts +4 -4
- package/services/cache.d.ts +23 -23
- package/services/configuration.d.ts +10 -10
- package/services/endpoint-provider.d.ts +4 -4
- package/services/entities/asset.d.ts +25 -23
- package/services/entities/lazy-asset.d.ts +29 -29
- package/services/entities/progress.d.ts +49 -49
- package/services/fixtures.d.ts +6 -6
- package/services/gallery-cache.d.ts +9 -9
- package/services/gallery-image.d.ts +11 -11
- package/services/gallery.d.ts +13 -13
- package/services/id-generator.d.ts +11 -11
- package/services/job-manager.d.ts +27 -27
- package/services/lazy-assets.d.ts +19 -19
- package/services/mail-sender.d.ts +20 -20
- package/services/memory-cache.d.ts +10 -10
- package/services/mongo-connector.d.ts +14 -14
- package/services/progresses.d.ts +18 -18
- package/services/template-renderer.d.ts +14 -14
- package/services/translation-provider.d.ts +10 -10
- 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-middlewares/compression.middleware.d.ts +4 -4
- package/static.d.ts +2 -2
- package/stemy-backend.d.ts +4 -4
- package/stemy-backend.metadata.json +1 -1
- package/utilities/di-container.d.ts +43 -43
- package/utilities/lazy-asset-generator.d.ts +15 -15
- package/utilities/tree.d.ts +14 -14
- package/utils.d.ts +76 -73
- package/validators.d.ts +7 -7
- package/di-container.d.ts +0 -40
- package/esm2015/di-container.js +0 -75
- package/esm2015/models/lazy-asset.js +0 -12
- package/esm2015/models/progress.js +0 -23
- package/esm2015/rest-middlewares/injector.middleware.js +0 -26
- package/esm2015/services/lazy-asset-helper.js +0 -74
- package/esm2015/services/logger.js +0 -14
- package/esm2015/services/progress-helper.js +0 -168
- package/models/lazy-asset.d.ts +0 -45
- package/models/progress.d.ts +0 -56
- package/rest-middlewares/injector.middleware.d.ts +0 -8
- package/services/lazy-asset-helper.d.ts +0 -15
- package/services/logger.d.ts +0 -2
- package/services/progress-helper.d.ts +0 -37
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
/// <reference types="socket.io-client" />
|
|
2
|
-
import { ObjectId } from "bson";
|
|
3
|
-
import { Collection } from "mongodb";
|
|
4
|
-
import { IProgress } from "../../common-types";
|
|
5
|
-
export declare class Progress implements IProgress {
|
|
6
|
-
readonly progressId: ObjectId;
|
|
7
|
-
protected mCurrent: number;
|
|
8
|
-
protected mMax: number;
|
|
9
|
-
protected mMessage: string;
|
|
10
|
-
protected mError: string;
|
|
11
|
-
protected client: SocketIOClient.Socket;
|
|
12
|
-
protected collection: Collection;
|
|
13
|
-
get id(): string;
|
|
14
|
-
get current(): number;
|
|
15
|
-
get max(): number;
|
|
16
|
-
get message(): string;
|
|
17
|
-
get error(): string;
|
|
18
|
-
get percent(): number;
|
|
19
|
-
get remaining(): number;
|
|
20
|
-
constructor(progressId: ObjectId, mCurrent: number, mMax: number, mMessage: string, mError: string, client: SocketIOClient.Socket, collection: Collection);
|
|
21
|
-
createSubProgress(progressValue: number, max?: number, message?: string): Promise<IProgress>;
|
|
22
|
-
setMax(max: number): Promise<any>;
|
|
23
|
-
setError(error: string): Promise<any>;
|
|
24
|
-
advance(value?: number): Promise<any>;
|
|
25
|
-
toJSON(): any;
|
|
26
|
-
save(): Promise<any>;
|
|
27
|
-
}
|
|
28
|
-
export declare class SubProgress implements IProgress {
|
|
29
|
-
private parent;
|
|
30
|
-
private progressFrom;
|
|
31
|
-
private progressValue;
|
|
32
|
-
private max;
|
|
33
|
-
get id(): string;
|
|
34
|
-
get message(): string;
|
|
35
|
-
set message(value: string);
|
|
36
|
-
get error(): string;
|
|
37
|
-
set error(value: string);
|
|
38
|
-
get percent(): number;
|
|
39
|
-
get current(): number;
|
|
40
|
-
get remaining(): number;
|
|
41
|
-
private currentValue;
|
|
42
|
-
constructor(parent: IProgress, progressFrom: number, progressValue: number, max?: number);
|
|
43
|
-
createSubProgress(progressValue: number, max?: number, message?: string): Promise<IProgress>;
|
|
44
|
-
setMax(max: number): Promise<any>;
|
|
45
|
-
setError(error: string): Promise<any>;
|
|
46
|
-
advance(value?: number): Promise<any>;
|
|
47
|
-
save(): Promise<any>;
|
|
48
|
-
toJSON(): any;
|
|
49
|
-
}
|
|
1
|
+
/// <reference types="socket.io-client" />
|
|
2
|
+
import { ObjectId } from "bson";
|
|
3
|
+
import { Collection } from "mongodb";
|
|
4
|
+
import { IProgress } from "../../common-types";
|
|
5
|
+
export declare class Progress implements IProgress {
|
|
6
|
+
readonly progressId: ObjectId;
|
|
7
|
+
protected mCurrent: number;
|
|
8
|
+
protected mMax: number;
|
|
9
|
+
protected mMessage: string;
|
|
10
|
+
protected mError: string;
|
|
11
|
+
protected client: SocketIOClient.Socket;
|
|
12
|
+
protected collection: Collection;
|
|
13
|
+
get id(): string;
|
|
14
|
+
get current(): number;
|
|
15
|
+
get max(): number;
|
|
16
|
+
get message(): string;
|
|
17
|
+
get error(): string;
|
|
18
|
+
get percent(): number;
|
|
19
|
+
get remaining(): number;
|
|
20
|
+
constructor(progressId: ObjectId, mCurrent: number, mMax: number, mMessage: string, mError: string, client: SocketIOClient.Socket, collection: Collection);
|
|
21
|
+
createSubProgress(progressValue: number, max?: number, message?: string): Promise<IProgress>;
|
|
22
|
+
setMax(max: number): Promise<any>;
|
|
23
|
+
setError(error: string): Promise<any>;
|
|
24
|
+
advance(value?: number): Promise<any>;
|
|
25
|
+
toJSON(): any;
|
|
26
|
+
save(): Promise<any>;
|
|
27
|
+
}
|
|
28
|
+
export declare class SubProgress implements IProgress {
|
|
29
|
+
private parent;
|
|
30
|
+
private progressFrom;
|
|
31
|
+
private progressValue;
|
|
32
|
+
private max;
|
|
33
|
+
get id(): string;
|
|
34
|
+
get message(): string;
|
|
35
|
+
set message(value: string);
|
|
36
|
+
get error(): string;
|
|
37
|
+
set error(value: string);
|
|
38
|
+
get percent(): number;
|
|
39
|
+
get current(): number;
|
|
40
|
+
get remaining(): number;
|
|
41
|
+
private currentValue;
|
|
42
|
+
constructor(parent: IProgress, progressFrom: number, progressValue: number, max?: number);
|
|
43
|
+
createSubProgress(progressValue: number, max?: number, message?: string): Promise<IProgress>;
|
|
44
|
+
setMax(max: number): Promise<any>;
|
|
45
|
+
setError(error: string): Promise<any>;
|
|
46
|
+
advance(value?: number): Promise<any>;
|
|
47
|
+
save(): Promise<any>;
|
|
48
|
+
toJSON(): any;
|
|
49
|
+
}
|
package/services/fixtures.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IFixture } from "../common-types";
|
|
2
|
-
export declare class Fixtures {
|
|
3
|
-
protected fixtures: IFixture[];
|
|
4
|
-
constructor(fixtures: IFixture[]);
|
|
5
|
-
load(): Promise<void>;
|
|
6
|
-
}
|
|
1
|
+
import { IFixture } from "../common-types";
|
|
2
|
+
export declare class Fixtures {
|
|
3
|
+
protected fixtures: IFixture[];
|
|
4
|
+
constructor(fixtures: IFixture[]);
|
|
5
|
+
load(): Promise<void>;
|
|
6
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IGalleryImage, IGalleryImageHandler, IGallerySize } from "../common-types";
|
|
3
|
-
export declare class GalleryCache {
|
|
4
|
-
private readonly imgCache;
|
|
5
|
-
constructor();
|
|
6
|
-
put(img: IGalleryImage): void;
|
|
7
|
-
serve(id: string): Promise<Buffer>;
|
|
8
|
-
create(folder: string, targetSize: IGallerySize, handler: IGalleryImageHandler): IGalleryImage;
|
|
9
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IGalleryImage, IGalleryImageHandler, IGallerySize } from "../common-types";
|
|
3
|
+
export declare class GalleryCache {
|
|
4
|
+
private readonly imgCache;
|
|
5
|
+
constructor();
|
|
6
|
+
put(img: IGalleryImage): void;
|
|
7
|
+
serve(id: string): Promise<Buffer>;
|
|
8
|
+
create(folder: string, targetSize: IGallerySize, handler: IGalleryImageHandler): IGalleryImage;
|
|
9
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IGalleryImage, IGallerySize, IGalleryImageHandler } from "../common-types";
|
|
3
|
-
export declare class GalleryImage implements IGalleryImage {
|
|
4
|
-
readonly folder: string;
|
|
5
|
-
readonly handler: IGalleryImageHandler;
|
|
6
|
-
readonly thumb: string;
|
|
7
|
-
readonly big: string;
|
|
8
|
-
readonly targetSize: IGallerySize;
|
|
9
|
-
constructor(folder: string, size: IGallerySize, handler: IGalleryImageHandler);
|
|
10
|
-
serve(id: string): Promise<Buffer>;
|
|
11
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IGalleryImage, IGallerySize, IGalleryImageHandler } from "../common-types";
|
|
3
|
+
export declare class GalleryImage implements IGalleryImage {
|
|
4
|
+
readonly folder: string;
|
|
5
|
+
readonly handler: IGalleryImageHandler;
|
|
6
|
+
readonly thumb: string;
|
|
7
|
+
readonly big: string;
|
|
8
|
+
readonly targetSize: IGallerySize;
|
|
9
|
+
constructor(folder: string, size: IGallerySize, handler: IGalleryImageHandler);
|
|
10
|
+
serve(id: string): Promise<Buffer>;
|
|
11
|
+
}
|
package/services/gallery.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { IGalleryImage, IGallerySize } from "../common-types";
|
|
2
|
-
import { Configuration } from "./configuration";
|
|
3
|
-
import { GalleryCache } from "./gallery-cache";
|
|
4
|
-
export declare class Gallery {
|
|
5
|
-
readonly config: Configuration;
|
|
6
|
-
readonly galleryCache: GalleryCache;
|
|
7
|
-
private readonly dir;
|
|
8
|
-
private readonly output;
|
|
9
|
-
private readonly cache;
|
|
10
|
-
constructor(config: Configuration, galleryCache: GalleryCache);
|
|
11
|
-
getFolder(folder: string, size?: IGallerySize): Promise<IGalleryImage[]>;
|
|
12
|
-
protected readRecursive(path: string, folder: string, size: IGallerySize): Promise<IGalleryImage[]>;
|
|
13
|
-
}
|
|
1
|
+
import { IGalleryImage, IGallerySize } from "../common-types";
|
|
2
|
+
import { Configuration } from "./configuration";
|
|
3
|
+
import { GalleryCache } from "./gallery-cache";
|
|
4
|
+
export declare class Gallery {
|
|
5
|
+
readonly config: Configuration;
|
|
6
|
+
readonly galleryCache: GalleryCache;
|
|
7
|
+
private readonly dir;
|
|
8
|
+
private readonly output;
|
|
9
|
+
private readonly cache;
|
|
10
|
+
constructor(config: Configuration, galleryCache: GalleryCache);
|
|
11
|
+
getFolder(folder: string, size?: IGallerySize): Promise<IGalleryImage[]>;
|
|
12
|
+
protected readRecursive(path: string, folder: string, size: IGallerySize): Promise<IGalleryImage[]>;
|
|
13
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Configuration } from "./configuration";
|
|
2
|
-
export declare class IdGenerator {
|
|
3
|
-
readonly config: Configuration;
|
|
4
|
-
protected prefix: string;
|
|
5
|
-
protected separator: string;
|
|
6
|
-
protected chars: string;
|
|
7
|
-
protected parts: number[];
|
|
8
|
-
constructor(config: Configuration);
|
|
9
|
-
generate(checkCb: (id: string) => Promise<boolean>): Promise<string>;
|
|
10
|
-
private generateId;
|
|
11
|
-
}
|
|
1
|
+
import { Configuration } from "./configuration";
|
|
2
|
+
export declare class IdGenerator {
|
|
3
|
+
readonly config: Configuration;
|
|
4
|
+
protected prefix: string;
|
|
5
|
+
protected separator: string;
|
|
6
|
+
protected chars: string;
|
|
7
|
+
protected parts: number[];
|
|
8
|
+
constructor(config: Configuration);
|
|
9
|
+
generate(checkCb: (id: string) => Promise<boolean>): Promise<string>;
|
|
10
|
+
private generateId;
|
|
11
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { DependencyContainer } from "tsyringe";
|
|
2
|
-
import { Queue, Scheduler, Worker } from "node-resque";
|
|
3
|
-
import { IJob, IJobTask, JobParams, JobScheduleTime, Type } from "../common-types";
|
|
4
|
-
import { Configuration } from "./configuration";
|
|
5
|
-
export declare class JobManager {
|
|
6
|
-
readonly config: Configuration;
|
|
7
|
-
readonly container: DependencyContainer;
|
|
8
|
-
protected jobs: any;
|
|
9
|
-
protected queue: Queue;
|
|
10
|
-
protected worker: Worker;
|
|
11
|
-
protected scheduler: Scheduler;
|
|
12
|
-
protected jobTypes: Type<IJob>[];
|
|
13
|
-
constructor(config: Configuration, container: DependencyContainer, jobTypes: Type<IJob>[]);
|
|
14
|
-
process(jobType: Type<IJob>, params?: JobParams): Promise<any>;
|
|
15
|
-
enqueueWithName(name: string, params?: JobParams, que?: string): Promise<any>;
|
|
16
|
-
enqueue(jobType: Type<IJob>, params?: JobParams, que?: string): Promise<any>;
|
|
17
|
-
enqueueAt(timestamp: number, jobType: Type<IJob>, params?: JobParams, que?: string): Promise<any>;
|
|
18
|
-
enqueueIn(time: number, jobType: Type<IJob>, params?: JobParams, que?: string): Promise<any>;
|
|
19
|
-
schedule(minute: JobScheduleTime, hour: JobScheduleTime, dayOfMonth: JobScheduleTime, month: JobScheduleTime, dayOfWeek: JobScheduleTime, jobType: Type<IJob>, params?: JobParams, que?: string): IJobTask;
|
|
20
|
-
startProcessing(): Promise<any>;
|
|
21
|
-
tryResolve(jobType: Type<IJob>, params: JobParams): string;
|
|
22
|
-
protected initialize(): void;
|
|
23
|
-
protected tryResolveFromName(jobName: string, params: JobParams): Promise<string>;
|
|
24
|
-
protected tryResolveAndConnect(jobType: Type<IJob>, params: JobParams): Promise<string>;
|
|
25
|
-
protected resolveJobInstance(jobType: Type<IJob>, params: JobParams): IJob;
|
|
26
|
-
protected toPerformFunction(jobType: Type<IJob>): Function;
|
|
27
|
-
}
|
|
1
|
+
import { DependencyContainer } from "tsyringe";
|
|
2
|
+
import { Queue, Scheduler, Worker } from "node-resque";
|
|
3
|
+
import { IJob, IJobTask, JobParams, JobScheduleTime, Type } from "../common-types";
|
|
4
|
+
import { Configuration } from "./configuration";
|
|
5
|
+
export declare class JobManager {
|
|
6
|
+
readonly config: Configuration;
|
|
7
|
+
readonly container: DependencyContainer;
|
|
8
|
+
protected jobs: any;
|
|
9
|
+
protected queue: Queue;
|
|
10
|
+
protected worker: Worker;
|
|
11
|
+
protected scheduler: Scheduler;
|
|
12
|
+
protected jobTypes: Type<IJob>[];
|
|
13
|
+
constructor(config: Configuration, container: DependencyContainer, jobTypes: Type<IJob>[]);
|
|
14
|
+
process(jobType: Type<IJob>, params?: JobParams): Promise<any>;
|
|
15
|
+
enqueueWithName(name: string, params?: JobParams, que?: string): Promise<any>;
|
|
16
|
+
enqueue(jobType: Type<IJob>, params?: JobParams, que?: string): Promise<any>;
|
|
17
|
+
enqueueAt(timestamp: number, jobType: Type<IJob>, params?: JobParams, que?: string): Promise<any>;
|
|
18
|
+
enqueueIn(time: number, jobType: Type<IJob>, params?: JobParams, que?: string): Promise<any>;
|
|
19
|
+
schedule(minute: JobScheduleTime, hour: JobScheduleTime, dayOfMonth: JobScheduleTime, month: JobScheduleTime, dayOfWeek: JobScheduleTime, jobType: Type<IJob>, params?: JobParams, que?: string): IJobTask;
|
|
20
|
+
startProcessing(): Promise<any>;
|
|
21
|
+
tryResolve(jobType: Type<IJob>, params: JobParams): string;
|
|
22
|
+
protected initialize(): void;
|
|
23
|
+
protected tryResolveFromName(jobName: string, params: JobParams): Promise<string>;
|
|
24
|
+
protected tryResolveAndConnect(jobType: Type<IJob>, params: JobParams): Promise<string>;
|
|
25
|
+
protected resolveJobInstance(jobType: Type<IJob>, params: JobParams): IJob;
|
|
26
|
+
protected toPerformFunction(jobType: Type<IJob>): Function;
|
|
27
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Collection } from "mongodb";
|
|
2
|
-
import { FilterQuery } from "mongoose";
|
|
3
|
-
import { IJob, ILazyAsset, JobParams, Type } from "../common-types";
|
|
4
|
-
import { MongoConnector } from "./mongo-connector";
|
|
5
|
-
import { Assets } from "./assets";
|
|
6
|
-
import { JobManager } from "./job-manager";
|
|
7
|
-
import { Progresses } from "./progresses";
|
|
8
|
-
export declare class LazyAssets {
|
|
9
|
-
readonly connector: MongoConnector;
|
|
10
|
-
readonly assets: Assets;
|
|
11
|
-
readonly progresses: Progresses;
|
|
12
|
-
readonly jobMan: JobManager;
|
|
13
|
-
protected collection: Collection;
|
|
14
|
-
constructor(connector: MongoConnector, assets: Assets, progresses: Progresses, jobMan: JobManager);
|
|
15
|
-
create(jobType: Type<IJob>, jobParams?: JobParams, jobQue?: string): Promise<ILazyAsset>;
|
|
16
|
-
read(id: string): Promise<ILazyAsset>;
|
|
17
|
-
find(where: FilterQuery<ILazyAsset>): Promise<ILazyAsset>;
|
|
18
|
-
unlink(id: string): Promise<any>;
|
|
19
|
-
}
|
|
1
|
+
import { Collection } from "mongodb";
|
|
2
|
+
import { FilterQuery } from "mongoose";
|
|
3
|
+
import { IJob, ILazyAsset, JobParams, Type } from "../common-types";
|
|
4
|
+
import { MongoConnector } from "./mongo-connector";
|
|
5
|
+
import { Assets } from "./assets";
|
|
6
|
+
import { JobManager } from "./job-manager";
|
|
7
|
+
import { Progresses } from "./progresses";
|
|
8
|
+
export declare class LazyAssets {
|
|
9
|
+
readonly connector: MongoConnector;
|
|
10
|
+
readonly assets: Assets;
|
|
11
|
+
readonly progresses: Progresses;
|
|
12
|
+
readonly jobMan: JobManager;
|
|
13
|
+
protected collection: Collection;
|
|
14
|
+
constructor(connector: MongoConnector, assets: Assets, progresses: Progresses, jobMan: JobManager);
|
|
15
|
+
create(jobType: Type<IJob>, jobParams?: JobParams, jobQue?: string): Promise<ILazyAsset>;
|
|
16
|
+
read(id: string): Promise<ILazyAsset>;
|
|
17
|
+
find(where: FilterQuery<ILazyAsset>): Promise<ILazyAsset>;
|
|
18
|
+
unlink(id: string): Promise<any>;
|
|
19
|
+
}
|
|
@@ -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,14 +1,14 @@
|
|
|
1
|
-
import { Db, GridFSBucket } from "mongodb";
|
|
2
|
-
import { Connection } from "mongoose";
|
|
3
|
-
import { Configuration } from "./configuration";
|
|
4
|
-
export declare class MongoConnector {
|
|
5
|
-
readonly configuration: Configuration;
|
|
6
|
-
get connection(): Connection;
|
|
7
|
-
get database(): Db;
|
|
8
|
-
get bucket(): GridFSBucket;
|
|
9
|
-
protected conn: Connection;
|
|
10
|
-
protected db: Db;
|
|
11
|
-
protected fsBucket: GridFSBucket;
|
|
12
|
-
constructor(configuration: Configuration);
|
|
13
|
-
connect(): Promise<Db>;
|
|
14
|
-
}
|
|
1
|
+
import { Db, GridFSBucket } from "mongodb";
|
|
2
|
+
import { Connection } from "mongoose";
|
|
3
|
+
import { Configuration } from "./configuration";
|
|
4
|
+
export declare class MongoConnector {
|
|
5
|
+
readonly configuration: Configuration;
|
|
6
|
+
get connection(): Connection;
|
|
7
|
+
get database(): Db;
|
|
8
|
+
get bucket(): GridFSBucket;
|
|
9
|
+
protected conn: Connection;
|
|
10
|
+
protected db: Db;
|
|
11
|
+
protected fsBucket: GridFSBucket;
|
|
12
|
+
constructor(configuration: Configuration);
|
|
13
|
+
connect(): Promise<Db>;
|
|
14
|
+
}
|
package/services/progresses.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/// <reference types="socket.io-client" />
|
|
2
|
-
import { FilterQuery } from "mongoose";
|
|
3
|
-
import { IProgress } from "../common-types";
|
|
4
|
-
import { Configuration } from "./configuration";
|
|
5
|
-
import { MongoConnector } from "./mongo-connector";
|
|
6
|
-
import { Collection } from "mongodb";
|
|
7
|
-
export declare class Progresses {
|
|
8
|
-
readonly connector: MongoConnector;
|
|
9
|
-
readonly config: Configuration;
|
|
10
|
-
protected client: SocketIOClient.Socket;
|
|
11
|
-
readonly collection: Collection;
|
|
12
|
-
constructor(connector: MongoConnector, config: Configuration);
|
|
13
|
-
waitToFinish(id: string): Promise<IProgress>;
|
|
14
|
-
get(id: string): Promise<IProgress>;
|
|
15
|
-
find(where: FilterQuery<IProgress>): Promise<IProgress>;
|
|
16
|
-
create(max?: number): Promise<IProgress>;
|
|
17
|
-
remove(id: string): Promise<any>;
|
|
18
|
-
}
|
|
1
|
+
/// <reference types="socket.io-client" />
|
|
2
|
+
import { FilterQuery } from "mongoose";
|
|
3
|
+
import { IProgress } from "../common-types";
|
|
4
|
+
import { Configuration } from "./configuration";
|
|
5
|
+
import { MongoConnector } from "./mongo-connector";
|
|
6
|
+
import { Collection } from "mongodb";
|
|
7
|
+
export declare class Progresses {
|
|
8
|
+
readonly connector: MongoConnector;
|
|
9
|
+
readonly config: Configuration;
|
|
10
|
+
protected client: SocketIOClient.Socket;
|
|
11
|
+
readonly collection: Collection;
|
|
12
|
+
constructor(connector: MongoConnector, config: Configuration);
|
|
13
|
+
waitToFinish(id: string): Promise<IProgress>;
|
|
14
|
+
get(id: string): Promise<IProgress>;
|
|
15
|
+
find(where: FilterQuery<IProgress>): Promise<IProgress>;
|
|
16
|
+
create(max?: number): Promise<IProgress>;
|
|
17
|
+
remove(id: string): Promise<any>;
|
|
18
|
+
}
|
|
@@ -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<any>;
|
|
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<any>;
|
|
13
|
+
render(template: string, language: string, context?: any): Promise<string>;
|
|
14
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Configuration } from "./configuration";
|
|
2
|
-
import { ITranslations } from "../common-types";
|
|
3
|
-
export declare class TranslationProvider {
|
|
4
|
-
readonly config: Configuration;
|
|
5
|
-
protected cache: {
|
|
6
|
-
[lang: string]: Promise<ITranslations>;
|
|
7
|
-
};
|
|
8
|
-
constructor(config: Configuration);
|
|
9
|
-
getDictionary(language: string): Promise<ITranslations>;
|
|
10
|
-
}
|
|
1
|
+
import { Configuration } from "./configuration";
|
|
2
|
+
import { ITranslations } from "../common-types";
|
|
3
|
+
export declare class TranslationProvider {
|
|
4
|
+
readonly config: Configuration;
|
|
5
|
+
protected cache: {
|
|
6
|
+
[lang: string]: Promise<ITranslations>;
|
|
7
|
+
};
|
|
8
|
+
constructor(config: Configuration);
|
|
9
|
+
getDictionary(language: string): Promise<ITranslations>;
|
|
10
|
+
}
|
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 cache: {
|
|
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 cache: {
|
|
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,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/stemy-backend.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public_api';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public_api';
|