framework-do-dede 2.0.19 → 2.0.20
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.
|
@@ -2,5 +2,5 @@ import { Controller, Post, Get, Put, Delete, Patch, Validator, Middleware, Middl
|
|
|
2
2
|
import { Context, DecorateUseCase } from './usecase';
|
|
3
3
|
import { Inject } from './di';
|
|
4
4
|
import { Restrict, DbColumn, VirtualProperty, Expose } from './entity';
|
|
5
|
-
import { Storage } from './services';
|
|
6
|
-
export { Controller, Middleware, Middlewares, Validator, Metrics, OffConsoleLog, Post, Get, Put, Delete, Patch, Context, DecorateUseCase, Inject, Restrict, DbColumn, Storage, Expose, VirtualProperty };
|
|
5
|
+
import { Storage, StorageMock } from './services';
|
|
6
|
+
export { Controller, Middleware, Middlewares, Validator, Metrics, OffConsoleLog, Post, Get, Put, Delete, Patch, Context, DecorateUseCase, Inject, Restrict, DbColumn, Storage, StorageMock, Expose, VirtualProperty };
|
package/dist/decorators/index.js
CHANGED
|
@@ -2,5 +2,5 @@ import { Controller, Post, Get, Put, Delete, Patch, Validator, Middleware, Middl
|
|
|
2
2
|
import { Context, DecorateUseCase } from './usecase';
|
|
3
3
|
import { Inject } from './di';
|
|
4
4
|
import { Restrict, DbColumn, VirtualProperty, Expose } from './entity';
|
|
5
|
-
import { Storage } from './services';
|
|
6
|
-
export { Controller, Middleware, Middlewares, Validator, Metrics, OffConsoleLog, Post, Get, Put, Delete, Patch, Context, DecorateUseCase, Inject, Restrict, DbColumn, Storage, Expose, VirtualProperty };
|
|
5
|
+
import { Storage, StorageMock } from './services';
|
|
6
|
+
export { Controller, Middleware, Middlewares, Validator, Metrics, OffConsoleLog, Post, Get, Put, Delete, Patch, Context, DecorateUseCase, Inject, Restrict, DbColumn, Storage, StorageMock, Expose, VirtualProperty };
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { Registry } from "../di/registry";
|
|
2
|
+
export class StorageMock {
|
|
3
|
+
static enabled = false;
|
|
4
|
+
static on() {
|
|
5
|
+
StorageMock.enabled = true;
|
|
6
|
+
}
|
|
7
|
+
static off() {
|
|
8
|
+
StorageMock.enabled;
|
|
9
|
+
}
|
|
10
|
+
static isEnabled() {
|
|
11
|
+
return StorageMock.enabled;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
2
14
|
export function Storage(gatewayName) {
|
|
3
15
|
return function (target, propertyKey) {
|
|
16
|
+
if (StorageMock.isEnabled())
|
|
17
|
+
return;
|
|
4
18
|
const instanceSymbol = Symbol();
|
|
5
19
|
Object.defineProperty(target, propertyKey, {
|
|
6
20
|
get: function () {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dede, Register as DedeRegister, Options as DedeOptions } from './dede';
|
|
2
|
-
import { Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Middlewares, Context, DecorateUseCase, Inject, Restrict, Metrics, DbColumn, VirtualProperty, OffConsoleLog, Storage, Expose } from './decorators';
|
|
2
|
+
import { Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Middlewares, Context, DecorateUseCase, Inject, Restrict, Metrics, DbColumn, VirtualProperty, OffConsoleLog, Storage, StorageMock, Expose } from './decorators';
|
|
3
3
|
import { BadRequest, Conflict, Forbidden, HttpServer, NotFound, ServerError, Unauthorized, UnprocessableEntity } from './http';
|
|
4
4
|
import { Validation, HttpMiddleware, UseCase, CreateRepository, ExistsBy, NotExistsBy, DeleteRepository, DeleteRepositoryBy, UpdateRepository, RestoreRepository, RestoreRepositoryBy, RestoreManyRepository, RequestMetricsHandler, Request, RequestMetrics, HttpServerError, StorageGateway } from './protocols';
|
|
5
5
|
import { Entity } from './domain/Entity';
|
|
6
6
|
import { UseCaseHandler } from './handlers';
|
|
7
|
-
export { UseCase, HttpMiddleware, Validation, RequestMetricsHandler, RequestMetrics, HttpServerError, CreateRepository, DeleteRepository, DeleteRepositoryBy, UpdateRepository, RestoreRepository, RestoreRepositoryBy, ExistsBy, NotExistsBy, RestoreManyRepository, Request, Dede, DedeRegister, DedeOptions, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Middlewares, Context, DecorateUseCase, Inject, Entity, Restrict, DbColumn, VirtualProperty, Metrics, OffConsoleLog, StorageGateway, Storage, Expose };
|
|
7
|
+
export { UseCase, HttpMiddleware, Validation, RequestMetricsHandler, RequestMetrics, HttpServerError, CreateRepository, DeleteRepository, DeleteRepositoryBy, UpdateRepository, RestoreRepository, RestoreRepositoryBy, ExistsBy, NotExistsBy, RestoreManyRepository, Request, Dede, DedeRegister, DedeOptions, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Middlewares, Context, DecorateUseCase, Inject, Entity, Restrict, DbColumn, VirtualProperty, Metrics, OffConsoleLog, StorageGateway, Storage, StorageMock, Expose };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dede } from './dede';
|
|
2
|
-
import { Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Middlewares, Context, DecorateUseCase, Inject, Restrict, Metrics, DbColumn, VirtualProperty, OffConsoleLog, Storage, Expose } from './decorators';
|
|
2
|
+
import { Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Middlewares, Context, DecorateUseCase, Inject, Restrict, Metrics, DbColumn, VirtualProperty, OffConsoleLog, Storage, StorageMock, Expose } from './decorators';
|
|
3
3
|
import { BadRequest, Conflict, Forbidden, HttpServer, NotFound, ServerError, Unauthorized, UnprocessableEntity } from './http';
|
|
4
4
|
import { Entity } from './domain/Entity';
|
|
5
5
|
import { UseCaseHandler } from './handlers';
|
|
6
|
-
export { Dede, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Middlewares, Context, DecorateUseCase, Inject, Entity, Restrict, DbColumn, VirtualProperty, Metrics, OffConsoleLog, Storage, Expose };
|
|
6
|
+
export { Dede, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Middlewares, Context, DecorateUseCase, Inject, Entity, Restrict, DbColumn, VirtualProperty, Metrics, OffConsoleLog, Storage, StorageMock, Expose };
|