framework-do-dede 0.0.13 → 0.0.14
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/decorators/controller.d.ts +35 -0
- package/dist/decorators/controller.js +88 -0
- package/dist/decorators/di.d.ts +1 -0
- package/dist/decorators/di.js +7 -0
- package/dist/decorators/index.d.ts +4 -0
- package/dist/decorators/index.js +4 -0
- package/dist/decorators/usecase.d.ts +1 -0
- package/dist/decorators/usecase.js +5 -0
- package/dist/dede.d.ts +15 -44
- package/dist/dede.js +29 -0
- package/dist/di/registry.d.ts +15 -0
- package/dist/di/registry.js +47 -0
- package/dist/example.d.ts +0 -40
- package/dist/example.js +102 -0
- package/dist/handlers/controller.handler.d.ts +6 -0
- package/dist/handlers/controller.handler.js +77 -0
- package/dist/handlers/index.d.ts +2 -0
- package/dist/handlers/index.js +2 -0
- package/dist/handlers/usecase.handler.d.ts +5 -0
- package/dist/handlers/usecase.handler.js +12 -0
- package/dist/http/ElysiaHttpServer.d.ts +5 -0
- package/dist/http/ElysiaHttpServer.js +13 -0
- package/dist/http/ExpressHttpServer.d.ts +5 -0
- package/dist/http/ExpressHttpServer.js +14 -0
- package/dist/http/FrameworkError.d.ts +3 -0
- package/dist/http/FrameworkError.js +5 -0
- package/dist/http/HttpServer.d.ts +31 -0
- package/dist/http/HttpServer.js +91 -0
- package/dist/http/ServerError.d.ts +23 -0
- package/dist/http/ServerError.js +41 -0
- package/dist/http/index.d.ts +3 -0
- package/dist/http/index.js +3 -0
- package/dist/index.d.ts +12 -35
- package/dist/index.js +26 -15466
- package/dist/protocols/Controller.d.ts +14 -0
- package/dist/protocols/Controller.js +1 -0
- package/dist/protocols/HttpMiddleware.d.ts +3 -0
- package/dist/protocols/HttpMiddleware.js +1 -0
- package/dist/protocols/UseCase.d.ts +3 -0
- package/dist/protocols/UseCase.js +1 -0
- package/dist/protocols/Validation.d.ts +3 -0
- package/dist/protocols/Validation.js +1 -0
- package/dist/protocols/index.d.ts +4 -0
- package/dist/protocols/index.js +1 -0
- package/package.json +15 -6
- package/dist/Controller.d.ts +0 -13
- package/dist/ElysiaHttpServer.d.ts +0 -12
- package/dist/ExpressHttpServer.d.ts +0 -13
- package/dist/FrameworkError.d.ts +0 -5
- package/dist/HttpMiddleware.d.ts +0 -3
- package/dist/HttpServer.d.ts +0 -114
- package/dist/ServerError.d.ts +0 -42
- package/dist/UseCase.d.ts +0 -3
- package/dist/Validation.d.ts +0 -3
- package/dist/controller.d.ts +0 -11
- package/dist/controller.handler.d.ts +0 -86
- package/dist/di.d.ts +0 -1
- package/dist/index.cjs +0 -15485
- package/dist/registry.d.ts +0 -4
- package/dist/usecase.d.ts +0 -1
- package/dist/usecase.handler.d.ts +0 -23
package/dist/registry.d.ts
DELETED
package/dist/usecase.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function Auth(propertyName: string): Function;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { UseCase } from '@/protocols';
|
|
2
|
-
|
|
3
|
-
declare type RequestData = {
|
|
4
|
-
headers: any,
|
|
5
|
-
data?: any,
|
|
6
|
-
middlewareData?: any
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export class UseCaseHandler {
|
|
11
|
-
static load<T extends UseCase<any, any>>(
|
|
12
|
-
useCaseClass: new (...args: any[]) => T,
|
|
13
|
-
request?: RequestData
|
|
14
|
-
): T {
|
|
15
|
-
const instance = Registry.classLoader(useCaseClass);
|
|
16
|
-
const auth = Reflect.getMetadata("auth", useCaseClass);
|
|
17
|
-
const context = request
|
|
18
|
-
if (auth && context?.middlewareData) {
|
|
19
|
-
(instance as any)[auth] = context.middlewareData[auth]
|
|
20
|
-
}
|
|
21
|
-
return instance
|
|
22
|
-
}
|
|
23
|
-
}
|