@stemy/backend 5.0.6 → 5.0.8
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/esm2020/public_api.mjs +11 -21
- package/esm2020/services/backend-provider.mjs +52 -9
- package/esm2020/services/configuration.mjs +1 -1
- package/esm2020/services/entities/lazy-asset.mjs +4 -3
- package/esm2020/services/job-manager.mjs +12 -17
- package/esm2020/services/lazy-assets.mjs +5 -3
- package/esm2020/utils.mjs +40 -14
- package/fesm2015/stemy-backend.mjs +286 -233
- package/fesm2015/stemy-backend.mjs.map +1 -1
- package/fesm2020/stemy-backend.mjs +282 -231
- package/fesm2020/stemy-backend.mjs.map +1 -1
- package/package.json +4 -4
- package/public_api.d.ts +1 -1
- package/services/backend-provider.d.ts +13 -4
- package/services/job-manager.d.ts +3 -2
- package/services/lazy-assets.d.ts +1 -1
- package/utils.d.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stemy/backend",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "git@github.com:stemyke/node-backend.git",
|
|
6
6
|
"builders": "builders.json",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"express": "4.17.1",
|
|
17
17
|
"handlebars": "4.7.7",
|
|
18
18
|
"tsyringe": "4.5.0",
|
|
19
|
-
"nodemailer": "6.
|
|
19
|
+
"nodemailer": "6.9.10",
|
|
20
20
|
"reflect-metadata": "0.1.13",
|
|
21
21
|
"socket.io": "4.6.1",
|
|
22
22
|
"socket.io-client": "4.6.1",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"routing-controllers": "0.10.3",
|
|
25
25
|
"routing-controllers-openapi": "3.0.0",
|
|
26
26
|
"rxjs": "6.6.2",
|
|
27
|
-
"sharp": "0.
|
|
27
|
+
"sharp": "0.33.2",
|
|
28
28
|
"uuid": "8.3.0",
|
|
29
29
|
"bcrypt": "5.0.0",
|
|
30
30
|
"jsonwebtoken": "9.0.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"lodash.isstring": "3.0.1",
|
|
37
37
|
"lodash.once": "4.1.1",
|
|
38
38
|
"mongodb": "4.7.0",
|
|
39
|
-
"mongoose": "6.
|
|
39
|
+
"mongoose": "6.12.6",
|
|
40
40
|
"@typegoose/typegoose": "10.1.1",
|
|
41
41
|
"multer": "1.4.5-lts.1",
|
|
42
42
|
"dotenv": "8.2.0",
|
package/public_api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IBackendConfig, IDependencyContainer, IRequest, IUser, Provider } from "./common-types";
|
|
2
|
-
export { FilterPredicate, isNullOrUndefined, isDefined, getType, isObject, isArray, isBuffer, isBoolean, isDate, isPrimitive, isString, isFunction, isConstructor, isType, isInterface, ucFirst, lcFirst, isObjectId, firstItem, lastItem, regroup, uniqueItems, getValue, groupBy, convertValue, toImage, bufferToStream, streamToBuffer, copyStream, mkdirRecursive, deleteFile, readFile, readAndDeleteFile, writeFile, valueToPromise, promiseTimeout, getConstructorName, getFunctionParams, getFileName, getExtension, createIdString, idToString, createTransformer, broadcast, rand, random, multiSubscription, observableFromFunction, padLeft, padRight, camelCaseToDash, deleteFromBucket, filter, copy, assign, md5, runCommand, ConsoleColor, IJsonColors, colorize, jsonHighlight, replaceSpecialChars, regexEscape, flatten, wrapError, getDirName, prepareUrl, prepareUrlSlash, prepareUrlEmpty, fileTypeFromBuffer, fileTypeFromStream } from "./utils";
|
|
2
|
+
export { FilterPredicate, isNullOrUndefined, isDefined, getType, isObject, isArray, isBuffer, isBoolean, isDate, isPrimitive, isString, isFunction, isConstructor, isType, isInterface, ucFirst, lcFirst, isObjectId, firstItem, lastItem, regroup, uniqueItems, getValue, groupBy, convertValue, toImage, bufferToStream, streamToBuffer, copyStream, mkdirRecursive, deleteFile, readFile, readAndDeleteFile, writeFile, valueToPromise, promiseTimeout, getConstructorName, getFunctionParams, getFileName, getExtension, createIdString, idToString, createTransformer, broadcast, rand, random, multiSubscription, observableFromFunction, padLeft, padRight, camelCaseToDash, gzipPromised, gunzipPromised, deleteFromBucket, filter, copy, assign, md5, runCommand, ConsoleColor, IJsonColors, colorize, jsonHighlight, replaceSpecialChars, regexEscape, flatten, wrapError, getDirName, prepareUrl, prepareUrlSlash, prepareUrlEmpty, fileTypeFromBuffer, fileTypeFromStream } from "./utils";
|
|
3
3
|
export { IsFile, IsObjectId } from "./validators";
|
|
4
4
|
export { FIXTURE, JOB, TERMINAL_COMMAND, EXPRESS, HTTP_SERVER, SOCKET_SERVER, SOCKET_CONTROLLERS, PARAMETER, DI_CONTAINER, OPENAPI_VALIDATION, Type, FactoryProvider, IDependencyContainer, ClassBasedProvider, ValueBasedProvider, FactoryBasedProvider, TokenBasedProvider, SyringeProvider, Provider, Constructor, InferGeneric, PickMatching, OmitFirstArg, IMatchField, IProjectOptions, IUnwindOptions, IFixture, IFixtureOutput, SchemaConverter, OpenApiValidation, ParamResolver, Parameter, SocketParam, SocketParams, ISocketMessage, IMessageBridge, IJob, IJobTask, JobParams, JobScheduleRange, JobScheduleTime, ITerminalFile, ITerminal, ITerminalCommand, IProgress, IAssetCropInfo, IAssetMeta, IAssetImageParams, IAsset, ILazyAsset, IUser, IClientSocket, IRequestBase, IRequest, IGalleryImage, IGallerySize, IGalleryImageHandler, ITranslations, IPaginationMeta, IPaginationBase, IPagination, IPaginationParams, FontFormat, IFileType, RoutingOptions, SocketOptions, IBackendConfig } from "./common-types";
|
|
5
5
|
export { AssetProcessor } from "./services/asset-processor";
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Server } from "http";
|
|
3
|
-
import { Express } from "express";
|
|
4
3
|
import { Server as SocketServer } from "socket.io";
|
|
4
|
+
import { Express } from "express";
|
|
5
|
+
import { Configuration } from './configuration';
|
|
6
|
+
import { IDependencyContainer } from '../common-types';
|
|
7
|
+
import { OpenApi } from './open-api';
|
|
5
8
|
export declare class BackendProvider {
|
|
6
|
-
readonly
|
|
7
|
-
|
|
9
|
+
readonly config: Configuration;
|
|
10
|
+
protected container: IDependencyContainer;
|
|
8
11
|
get io(): SocketServer;
|
|
12
|
+
get express(): Express;
|
|
13
|
+
get server(): Server;
|
|
9
14
|
protected ioServer: SocketServer;
|
|
10
|
-
|
|
15
|
+
protected httpServer: Server;
|
|
16
|
+
protected expressApp: Express;
|
|
17
|
+
protected openApi: OpenApi;
|
|
18
|
+
constructor(config: Configuration, container: IDependencyContainer);
|
|
19
|
+
quickStart(): Promise<string>;
|
|
11
20
|
}
|
|
@@ -13,7 +13,7 @@ export declare class JobManager {
|
|
|
13
13
|
[name: string]: (jobParams: JobParams, uniqueId: string) => Promise<any>;
|
|
14
14
|
};
|
|
15
15
|
protected messages: Subject<ISocketMessage>;
|
|
16
|
-
protected processing:
|
|
16
|
+
protected processing: Promise<any>;
|
|
17
17
|
protected apiPush: Socket;
|
|
18
18
|
protected apiPull: Socket;
|
|
19
19
|
protected workerPush: Socket;
|
|
@@ -25,7 +25,8 @@ export declare class JobManager {
|
|
|
25
25
|
enqueueWithName(name: string, params?: JobParams): Promise<string>;
|
|
26
26
|
enqueue(jobType: Type<IJob>, params?: JobParams): Promise<string>;
|
|
27
27
|
schedule(minute: JobScheduleTime, hour: JobScheduleTime, dayOfMonth: JobScheduleTime, month: JobScheduleTime, dayOfWeek: JobScheduleTime, jobType: Type<IJob>, params?: JobParams): IJobTask;
|
|
28
|
-
|
|
28
|
+
protected initProcessing(): Promise<void>;
|
|
29
|
+
startProcessing(): Promise<void>;
|
|
29
30
|
tryResolve(jobType: Type<IJob>, params: JobParams): string;
|
|
30
31
|
protected tryResolveFromName(jobName: string, params: JobParams): string;
|
|
31
32
|
protected tryResolveAndInit(jobType: Type<IJob>, params: JobParams): string;
|
|
@@ -14,7 +14,7 @@ export declare class LazyAssets {
|
|
|
14
14
|
readonly jobMan: JobManager;
|
|
15
15
|
protected collection: Collection<Partial<ILazyAsset>>;
|
|
16
16
|
constructor(connector: MongoConnector, assets: Assets, progresses: Progresses, logger: Logger, jobMan: JobManager);
|
|
17
|
-
create(jobType: Type<IJob>,
|
|
17
|
+
create(jobType: Type<IJob>, jobParamsObj?: JobParams, jobQue?: string): Promise<ILazyAsset>;
|
|
18
18
|
read(id: string): Promise<ILazyAsset>;
|
|
19
19
|
find(where: FilterQuery<ILazyAsset>): Promise<ILazyAsset>;
|
|
20
20
|
unlink(id: string): Promise<any>;
|
package/utils.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
import { ZlibOptions } from "zlib";
|
|
3
5
|
import { DependencyContainer } from "tsyringe";
|
|
4
6
|
import { Observable, Subscription } from "rxjs";
|
|
5
7
|
import { Server } from "socket.io";
|
|
@@ -64,6 +66,8 @@ export declare function observableFromFunction(callbackFunc: () => any): Observa
|
|
|
64
66
|
export declare function padLeft(value: any, count?: number, padWith?: string): string;
|
|
65
67
|
export declare function padRight(value: any, count?: number, padWith?: string): string;
|
|
66
68
|
export declare function camelCaseToDash(str: string): string;
|
|
69
|
+
export declare function gzipPromised(data: string, opts?: ZlibOptions): Promise<string>;
|
|
70
|
+
export declare function gunzipPromised(data: string, opts?: ZlibOptions): Promise<string>;
|
|
67
71
|
export declare function deleteFromBucket(bucket: GridFSBucket, fileId: ObjectId): Promise<string>;
|
|
68
72
|
export declare function filter<T>(obj: T, predicate: FilterPredicate): Partial<T>;
|
|
69
73
|
export declare function copy<T>(obj: T): T;
|