plutin 1.0.0
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/base-controller-cec5714c.d.ts +46 -0
- package/dist/core/decorators/controller-http-decorator.cjs +752 -0
- package/dist/core/decorators/controller-http-decorator.cjs.map +1 -0
- package/dist/core/decorators/controller-http-decorator.d.cts +13 -0
- package/dist/core/decorators/controller-http-decorator.d.ts +13 -0
- package/dist/core/decorators/controller-http-decorator.js +735 -0
- package/dist/core/decorators/controller-http-decorator.js.map +1 -0
- package/dist/core/decorators/dependency-container.cjs +92 -0
- package/dist/core/decorators/dependency-container.cjs.map +1 -0
- package/dist/core/decorators/dependency-container.d.cts +22 -0
- package/dist/core/decorators/dependency-container.d.ts +22 -0
- package/dist/core/decorators/dependency-container.js +69 -0
- package/dist/core/decorators/dependency-container.js.map +1 -0
- package/dist/core/entities/aggregate-root.cjs +99 -0
- package/dist/core/entities/aggregate-root.cjs.map +1 -0
- package/dist/core/entities/aggregate-root.d.cts +8 -0
- package/dist/core/entities/aggregate-root.d.ts +8 -0
- package/dist/core/entities/aggregate-root.js +74 -0
- package/dist/core/entities/aggregate-root.js.map +1 -0
- package/dist/core/entities/common-dto.cjs +19 -0
- package/dist/core/entities/common-dto.cjs.map +1 -0
- package/dist/core/entities/common-dto.d.cts +10 -0
- package/dist/core/entities/common-dto.d.ts +10 -0
- package/dist/core/entities/common-dto.js +1 -0
- package/dist/core/entities/common-dto.js.map +1 -0
- package/dist/core/entities/domain-event.cjs +19 -0
- package/dist/core/entities/domain-event.cjs.map +1 -0
- package/dist/core/entities/domain-event.d.cts +6 -0
- package/dist/core/entities/domain-event.d.ts +6 -0
- package/dist/core/entities/domain-event.js +1 -0
- package/dist/core/entities/domain-event.js.map +1 -0
- package/dist/core/entities/entity.cjs +92 -0
- package/dist/core/entities/entity.cjs.map +1 -0
- package/dist/core/entities/entity.d.cts +17 -0
- package/dist/core/entities/entity.d.ts +17 -0
- package/dist/core/entities/entity.js +67 -0
- package/dist/core/entities/entity.js.map +1 -0
- package/dist/core/entities/optional.cjs +19 -0
- package/dist/core/entities/optional.cjs.map +1 -0
- package/dist/core/entities/optional.d.cts +3 -0
- package/dist/core/entities/optional.d.ts +3 -0
- package/dist/core/entities/optional.js +1 -0
- package/dist/core/entities/optional.js.map +1 -0
- package/dist/core/entities/unique-entity-id.cjs +50 -0
- package/dist/core/entities/unique-entity-id.cjs.map +1 -0
- package/dist/core/entities/unique-entity-id.d.cts +9 -0
- package/dist/core/entities/unique-entity-id.d.ts +9 -0
- package/dist/core/entities/unique-entity-id.js +27 -0
- package/dist/core/entities/unique-entity-id.js.map +1 -0
- package/dist/core/entities/value-object.cjs +40 -0
- package/dist/core/entities/value-object.cjs.map +1 -0
- package/dist/core/entities/value-object.d.cts +6 -0
- package/dist/core/entities/value-object.d.ts +6 -0
- package/dist/core/entities/value-object.js +17 -0
- package/dist/core/entities/value-object.js.map +1 -0
- package/dist/core/entities/watched-list.cjs +121 -0
- package/dist/core/entities/watched-list.cjs.map +1 -0
- package/dist/core/entities/watched-list.d.cts +27 -0
- package/dist/core/entities/watched-list.d.ts +27 -0
- package/dist/core/entities/watched-list.js +98 -0
- package/dist/core/entities/watched-list.js.map +1 -0
- package/dist/core/entities/watched-list.test.cjs +186 -0
- package/dist/core/entities/watched-list.test.cjs.map +1 -0
- package/dist/core/entities/watched-list.test.d.cts +2 -0
- package/dist/core/entities/watched-list.test.d.ts +2 -0
- package/dist/core/entities/watched-list.test.js +185 -0
- package/dist/core/entities/watched-list.test.js.map +1 -0
- package/dist/core/errors/api-common-error.cjs +38 -0
- package/dist/core/errors/api-common-error.cjs.map +1 -0
- package/dist/core/errors/api-common-error.d.cts +28 -0
- package/dist/core/errors/api-common-error.d.ts +28 -0
- package/dist/core/errors/api-common-error.js +13 -0
- package/dist/core/errors/api-common-error.js.map +1 -0
- package/dist/core/errors/application-error.cjs +54 -0
- package/dist/core/errors/application-error.cjs.map +1 -0
- package/dist/core/errors/application-error.d.cts +8 -0
- package/dist/core/errors/application-error.d.ts +8 -0
- package/dist/core/errors/application-error.js +33 -0
- package/dist/core/errors/application-error.js.map +1 -0
- package/dist/core/errors/conflict-error.cjs +56 -0
- package/dist/core/errors/conflict-error.cjs.map +1 -0
- package/dist/core/errors/conflict-error.d.cts +13 -0
- package/dist/core/errors/conflict-error.d.ts +13 -0
- package/dist/core/errors/conflict-error.js +35 -0
- package/dist/core/errors/conflict-error.js.map +1 -0
- package/dist/core/errors/domain-error.cjs +54 -0
- package/dist/core/errors/domain-error.cjs.map +1 -0
- package/dist/core/errors/domain-error.d.cts +8 -0
- package/dist/core/errors/domain-error.d.ts +8 -0
- package/dist/core/errors/domain-error.js +33 -0
- package/dist/core/errors/domain-error.js.map +1 -0
- package/dist/core/errors/http-client-error.cjs +54 -0
- package/dist/core/errors/http-client-error.cjs.map +1 -0
- package/dist/core/errors/http-client-error.d.cts +8 -0
- package/dist/core/errors/http-client-error.d.ts +8 -0
- package/dist/core/errors/http-client-error.js +33 -0
- package/dist/core/errors/http-client-error.js.map +1 -0
- package/dist/core/errors/infra-error.cjs +54 -0
- package/dist/core/errors/infra-error.cjs.map +1 -0
- package/dist/core/errors/infra-error.d.cts +8 -0
- package/dist/core/errors/infra-error.d.ts +8 -0
- package/dist/core/errors/infra-error.js +33 -0
- package/dist/core/errors/infra-error.js.map +1 -0
- package/dist/core/errors/validation-error.cjs +55 -0
- package/dist/core/errors/validation-error.cjs.map +1 -0
- package/dist/core/errors/validation-error.d.cts +8 -0
- package/dist/core/errors/validation-error.d.ts +8 -0
- package/dist/core/errors/validation-error.js +34 -0
- package/dist/core/errors/validation-error.js.map +1 -0
- package/dist/core/http/base-controller.cjs +731 -0
- package/dist/core/http/base-controller.cjs.map +1 -0
- package/dist/core/http/base-controller.d.cts +1 -0
- package/dist/core/http/base-controller.d.ts +1 -0
- package/dist/core/http/base-controller.js +720 -0
- package/dist/core/http/base-controller.js.map +1 -0
- package/dist/core/http/dto-response.cjs +19 -0
- package/dist/core/http/dto-response.cjs.map +1 -0
- package/dist/core/http/dto-response.d.cts +10 -0
- package/dist/core/http/dto-response.d.ts +10 -0
- package/dist/core/http/dto-response.js +1 -0
- package/dist/core/http/dto-response.js.map +1 -0
- package/dist/core/http/error-notifier.cjs +19 -0
- package/dist/core/http/error-notifier.cjs.map +1 -0
- package/dist/core/http/error-notifier.d.cts +1 -0
- package/dist/core/http/error-notifier.d.ts +1 -0
- package/dist/core/http/error-notifier.js +1 -0
- package/dist/core/http/error-notifier.js.map +1 -0
- package/dist/core/http/get-take-and-skip.cjs +40 -0
- package/dist/core/http/get-take-and-skip.cjs.map +1 -0
- package/dist/core/http/get-take-and-skip.d.cts +6 -0
- package/dist/core/http/get-take-and-skip.d.ts +6 -0
- package/dist/core/http/get-take-and-skip.js +17 -0
- package/dist/core/http/get-take-and-skip.js.map +1 -0
- package/dist/core/http/health-connections.cjs +42 -0
- package/dist/core/http/health-connections.cjs.map +1 -0
- package/dist/core/http/health-connections.d.cts +16 -0
- package/dist/core/http/health-connections.d.ts +16 -0
- package/dist/core/http/health-connections.js +23 -0
- package/dist/core/http/health-connections.js.map +1 -0
- package/dist/core/http/http.cjs +19 -0
- package/dist/core/http/http.cjs.map +1 -0
- package/dist/core/http/http.d.cts +10 -0
- package/dist/core/http/http.d.ts +10 -0
- package/dist/core/http/http.js +1 -0
- package/dist/core/http/http.js.map +1 -0
- package/dist/core/http/pagination.cjs +19 -0
- package/dist/core/http/pagination.cjs.map +1 -0
- package/dist/core/http/pagination.d.cts +9 -0
- package/dist/core/http/pagination.d.ts +9 -0
- package/dist/core/http/pagination.js +1 -0
- package/dist/core/http/pagination.js.map +1 -0
- package/dist/core/http/validator.cjs +19 -0
- package/dist/core/http/validator.cjs.map +1 -0
- package/dist/core/http/validator.d.cts +11 -0
- package/dist/core/http/validator.d.ts +11 -0
- package/dist/core/http/validator.js +1 -0
- package/dist/core/http/validator.js.map +1 -0
- package/dist/core/index.cjs +957 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +18 -0
- package/dist/core/index.d.ts +18 -0
- package/dist/core/index.js +933 -0
- package/dist/core/index.js.map +1 -0
- package/dist/infra/adapters/http/express-adapter.cjs +577 -0
- package/dist/infra/adapters/http/express-adapter.cjs.map +1 -0
- package/dist/infra/adapters/http/express-adapter.d.cts +15 -0
- package/dist/infra/adapters/http/express-adapter.d.ts +15 -0
- package/dist/infra/adapters/http/express-adapter.js +556 -0
- package/dist/infra/adapters/http/express-adapter.js.map +1 -0
- package/dist/infra/adapters/http/fastify-adapter.cjs +562 -0
- package/dist/infra/adapters/http/fastify-adapter.cjs.map +1 -0
- package/dist/infra/adapters/http/fastify-adapter.d.cts +14 -0
- package/dist/infra/adapters/http/fastify-adapter.d.ts +14 -0
- package/dist/infra/adapters/http/fastify-adapter.js +541 -0
- package/dist/infra/adapters/http/fastify-adapter.js.map +1 -0
- package/dist/infra/adapters/http/response-error-code.cjs +35 -0
- package/dist/infra/adapters/http/response-error-code.cjs.map +1 -0
- package/dist/infra/adapters/http/response-error-code.d.cts +6 -0
- package/dist/infra/adapters/http/response-error-code.d.ts +6 -0
- package/dist/infra/adapters/http/response-error-code.js +10 -0
- package/dist/infra/adapters/http/response-error-code.js.map +1 -0
- package/dist/infra/adapters/http/validate-controller-metadata.cjs +42 -0
- package/dist/infra/adapters/http/validate-controller-metadata.cjs.map +1 -0
- package/dist/infra/adapters/http/validate-controller-metadata.d.cts +11 -0
- package/dist/infra/adapters/http/validate-controller-metadata.d.ts +11 -0
- package/dist/infra/adapters/http/validate-controller-metadata.js +19 -0
- package/dist/infra/adapters/http/validate-controller-metadata.js.map +1 -0
- package/dist/infra/adapters/notifications/discord.cjs +86 -0
- package/dist/infra/adapters/notifications/discord.cjs.map +1 -0
- package/dist/infra/adapters/notifications/discord.d.cts +14 -0
- package/dist/infra/adapters/notifications/discord.d.ts +14 -0
- package/dist/infra/adapters/notifications/discord.js +65 -0
- package/dist/infra/adapters/notifications/discord.js.map +1 -0
- package/dist/infra/adapters/notifications/in-memory.cjs +40 -0
- package/dist/infra/adapters/notifications/in-memory.cjs.map +1 -0
- package/dist/infra/adapters/notifications/in-memory.d.cts +8 -0
- package/dist/infra/adapters/notifications/in-memory.d.ts +8 -0
- package/dist/infra/adapters/notifications/in-memory.js +21 -0
- package/dist/infra/adapters/notifications/in-memory.js.map +1 -0
- package/dist/infra/adapters/notifications/sentry.cjs +129 -0
- package/dist/infra/adapters/notifications/sentry.cjs.map +1 -0
- package/dist/infra/adapters/notifications/sentry.d.cts +13 -0
- package/dist/infra/adapters/notifications/sentry.d.ts +13 -0
- package/dist/infra/adapters/notifications/sentry.js +96 -0
- package/dist/infra/adapters/notifications/sentry.js.map +1 -0
- package/dist/infra/adapters/validators/zod/index.cjs +179 -0
- package/dist/infra/adapters/validators/zod/index.cjs.map +1 -0
- package/dist/infra/adapters/validators/zod/index.d.cts +19 -0
- package/dist/infra/adapters/validators/zod/index.d.ts +19 -0
- package/dist/infra/adapters/validators/zod/index.js +154 -0
- package/dist/infra/adapters/validators/zod/index.js.map +1 -0
- package/dist/infra/adapters/validators/zod/zod-map-error.cjs +79 -0
- package/dist/infra/adapters/validators/zod/zod-map-error.cjs.map +1 -0
- package/dist/infra/adapters/validators/zod/zod-map-error.d.cts +15 -0
- package/dist/infra/adapters/validators/zod/zod-map-error.d.ts +15 -0
- package/dist/infra/adapters/validators/zod/zod-map-error.js +60 -0
- package/dist/infra/adapters/validators/zod/zod-map-error.js.map +1 -0
- package/dist/infra/adapters/validators/zod/zod-validator.cjs +178 -0
- package/dist/infra/adapters/validators/zod/zod-validator.cjs.map +1 -0
- package/dist/infra/adapters/validators/zod/zod-validator.d.cts +13 -0
- package/dist/infra/adapters/validators/zod/zod-validator.d.ts +13 -0
- package/dist/infra/adapters/validators/zod/zod-validator.js +153 -0
- package/dist/infra/adapters/validators/zod/zod-validator.js.map +1 -0
- package/dist/infra/env/index.cjs +473 -0
- package/dist/infra/env/index.cjs.map +1 -0
- package/dist/infra/env/index.d.cts +10 -0
- package/dist/infra/env/index.d.ts +10 -0
- package/dist/infra/env/index.js +456 -0
- package/dist/infra/env/index.js.map +1 -0
- package/dist/infra/index.cjs +781 -0
- package/dist/infra/index.cjs.map +1 -0
- package/dist/infra/index.d.cts +5 -0
- package/dist/infra/index.d.ts +5 -0
- package/dist/infra/index.js +752 -0
- package/dist/infra/index.js.map +1 -0
- package/package.json +82 -0
- package/readme.md +56 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
interface IErrorNotifier {
|
|
2
|
+
notify(error: Error, context: ContextError): Promise<void>;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
type AnyObject = Record<string, any>;
|
|
6
|
+
type Request = {
|
|
7
|
+
body: AnyObject;
|
|
8
|
+
params: AnyObject;
|
|
9
|
+
headers: AnyObject;
|
|
10
|
+
query: AnyObject;
|
|
11
|
+
};
|
|
12
|
+
type Response = {
|
|
13
|
+
code: number;
|
|
14
|
+
data: any;
|
|
15
|
+
};
|
|
16
|
+
type ContextError = {
|
|
17
|
+
env: string;
|
|
18
|
+
user?: {
|
|
19
|
+
id?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
email?: string;
|
|
22
|
+
};
|
|
23
|
+
request?: {
|
|
24
|
+
method?: string;
|
|
25
|
+
requestId?: string;
|
|
26
|
+
url?: string;
|
|
27
|
+
headers?: any;
|
|
28
|
+
query?: any;
|
|
29
|
+
body?: any;
|
|
30
|
+
params?: any;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
declare abstract class BaseController {
|
|
34
|
+
protected readonly errorNotifier: IErrorNotifier;
|
|
35
|
+
abstract handle<T>(request: T | Request): Promise<Response>;
|
|
36
|
+
constructor();
|
|
37
|
+
protected success<T>(dto?: T): Response;
|
|
38
|
+
protected noContent(): Response;
|
|
39
|
+
protected created<T>(dto?: T): Response;
|
|
40
|
+
protected paginated<T>(dto?: T): Response;
|
|
41
|
+
protected buildContextError(request: Request): ContextError;
|
|
42
|
+
failure(error: Error, context: ContextError): Promise<Response>;
|
|
43
|
+
execute(request: Request): Promise<Response>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { AnyObject as A, BaseController as B, ContextError as C, IErrorNotifier as I, Request as R, Response as a };
|