framework-do-dede 0.0.24 → 0.0.26
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/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/protocols/CreateRepository.d.ts +4 -0
- package/dist/protocols/CreateRepository.js +1 -0
- package/dist/protocols/DeleteRepository.d.ts +4 -0
- package/dist/protocols/DeleteRepository.js +1 -0
- package/dist/protocols/RestoreRepository.d.ts +4 -0
- package/dist/protocols/RestoreRepository.js +1 -0
- package/dist/protocols/UpdateRepository.d.ts +4 -0
- package/dist/protocols/UpdateRepository.js +1 -0
- package/dist/protocols/index.d.ts +5 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dede, Register as DedeRegister, Options as DedeOptions } from './dede';
|
|
2
2
|
import { Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Auth, Inject, Restrict } from './decorators';
|
|
3
3
|
import { BadRequest, Conflict, Forbidden, HttpServer, NotFound, ServerError, Unauthorized, UnprocessableEntity } from './http';
|
|
4
|
-
import { Validation, HttpMiddleware, UseCase } from './protocols';
|
|
4
|
+
import { Validation, HttpMiddleware, UseCase, CreateRepository, DeleteRepository, UpdateRepository, RestoreRepository } from './protocols';
|
|
5
5
|
import { Entity } from './domain/Entity';
|
|
6
6
|
declare class RequestData {
|
|
7
7
|
headers: any;
|
|
@@ -12,4 +12,4 @@ declare class RequestData {
|
|
|
12
12
|
declare class UseCaseHandler {
|
|
13
13
|
static load<T extends UseCase<any, any>>(useCaseClass: new (...args: any[]) => T, request?: RequestData): T;
|
|
14
14
|
}
|
|
15
|
-
export { UseCase, HttpMiddleware, Validation, RequestData, Dede, DedeRegister, DedeOptions, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Auth, Inject, Entity, Restrict };
|
|
15
|
+
export { UseCase, HttpMiddleware, Validation, CreateRepository, DeleteRepository, UpdateRepository, RestoreRepository, RequestData, Dede, DedeRegister, DedeOptions, UseCaseHandler, ServerError, BadRequest, Conflict, Forbidden, HttpServer, NotFound, Unauthorized, UnprocessableEntity, Controller, Post, Put, Get, Delete, Patch, Validator, Middleware, Auth, Inject, Entity, Restrict };
|
package/dist/index.js
CHANGED
|
@@ -16,10 +16,10 @@ class RequestData {
|
|
|
16
16
|
class UseCaseHandler {
|
|
17
17
|
static load(useCaseClass, request) {
|
|
18
18
|
const instance = Registry.classLoader(useCaseClass);
|
|
19
|
-
const
|
|
19
|
+
const authProperty = Reflect.getMetadata("auth", useCaseClass.prototype.constructor);
|
|
20
20
|
const context = request;
|
|
21
|
-
if (
|
|
22
|
-
instance[
|
|
21
|
+
if (authProperty && context?.middlewareData?.[authProperty]) {
|
|
22
|
+
instance[authProperty] = { ...context.middlewareData[authProperty] };
|
|
23
23
|
}
|
|
24
24
|
return instance;
|
|
25
25
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { HttpMiddleware } from './HttpMiddleware';
|
|
2
2
|
import type { UseCase } from './UseCase';
|
|
3
3
|
import type { Validation } from './Validation';
|
|
4
|
-
|
|
4
|
+
import type { CreateRepository } from './CreateRepository';
|
|
5
|
+
import type { DeleteRepository } from './DeleteRepository';
|
|
6
|
+
import type { UpdateRepository } from './UpdateRepository';
|
|
7
|
+
import type { RestoreRepository } from './RestoreRepository';
|
|
8
|
+
export type { HttpMiddleware, UseCase, Validation, CreateRepository, DeleteRepository, UpdateRepository, RestoreRepository };
|