plutin 1.3.0 → 1.3.2
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.cts +286 -28
- package/dist/index.d.ts +286 -28
- package/dist/{index.js → index.mjs} +1 -1
- package/package.json +4 -3
- package/dist/base-controller-68008870.d.ts +0 -46
- package/dist/core/decorators/controller-http-decorator.cjs +0 -310
- package/dist/core/decorators/controller-http-decorator.cjs.map +0 -1
- package/dist/core/decorators/controller-http-decorator.d.cts +0 -13
- package/dist/core/decorators/controller-http-decorator.d.ts +0 -13
- package/dist/core/decorators/controller-http-decorator.js +0 -285
- package/dist/core/decorators/controller-http-decorator.js.map +0 -1
- package/dist/core/decorators/dependency-container.cjs +0 -95
- package/dist/core/decorators/dependency-container.cjs.map +0 -1
- package/dist/core/decorators/dependency-container.d.cts +0 -22
- package/dist/core/decorators/dependency-container.d.ts +0 -22
- package/dist/core/decorators/dependency-container.js +0 -71
- package/dist/core/decorators/dependency-container.js.map +0 -1
- package/dist/core/entities/aggregate-root.cjs +0 -99
- package/dist/core/entities/aggregate-root.cjs.map +0 -1
- package/dist/core/entities/aggregate-root.d.cts +0 -8
- package/dist/core/entities/aggregate-root.d.ts +0 -8
- package/dist/core/entities/aggregate-root.js +0 -74
- package/dist/core/entities/aggregate-root.js.map +0 -1
- package/dist/core/entities/common-dto.cjs +0 -19
- package/dist/core/entities/common-dto.cjs.map +0 -1
- package/dist/core/entities/common-dto.d.cts +0 -10
- package/dist/core/entities/common-dto.d.ts +0 -10
- package/dist/core/entities/common-dto.js +0 -1
- package/dist/core/entities/common-dto.js.map +0 -1
- package/dist/core/entities/domain-event.cjs +0 -19
- package/dist/core/entities/domain-event.cjs.map +0 -1
- package/dist/core/entities/domain-event.d.cts +0 -6
- package/dist/core/entities/domain-event.d.ts +0 -6
- package/dist/core/entities/domain-event.js +0 -1
- package/dist/core/entities/domain-event.js.map +0 -1
- package/dist/core/entities/entity.cjs +0 -92
- package/dist/core/entities/entity.cjs.map +0 -1
- package/dist/core/entities/entity.d.cts +0 -18
- package/dist/core/entities/entity.d.ts +0 -18
- package/dist/core/entities/entity.js +0 -67
- package/dist/core/entities/entity.js.map +0 -1
- package/dist/core/entities/optional.cjs +0 -19
- package/dist/core/entities/optional.cjs.map +0 -1
- package/dist/core/entities/optional.d.cts +0 -3
- package/dist/core/entities/optional.d.ts +0 -3
- package/dist/core/entities/optional.js +0 -1
- package/dist/core/entities/optional.js.map +0 -1
- package/dist/core/entities/replace.cjs +0 -19
- package/dist/core/entities/replace.cjs.map +0 -1
- package/dist/core/entities/replace.d.cts +0 -5
- package/dist/core/entities/replace.d.ts +0 -5
- package/dist/core/entities/replace.js +0 -1
- package/dist/core/entities/replace.js.map +0 -1
- package/dist/core/entities/unique-entity-id.cjs +0 -50
- package/dist/core/entities/unique-entity-id.cjs.map +0 -1
- package/dist/core/entities/unique-entity-id.d.cts +0 -9
- package/dist/core/entities/unique-entity-id.d.ts +0 -9
- package/dist/core/entities/unique-entity-id.js +0 -27
- package/dist/core/entities/unique-entity-id.js.map +0 -1
- package/dist/core/entities/value-object.cjs +0 -40
- package/dist/core/entities/value-object.cjs.map +0 -1
- package/dist/core/entities/value-object.d.cts +0 -6
- package/dist/core/entities/value-object.d.ts +0 -6
- package/dist/core/entities/value-object.js +0 -17
- package/dist/core/entities/value-object.js.map +0 -1
- package/dist/core/entities/watched-list.cjs +0 -121
- package/dist/core/entities/watched-list.cjs.map +0 -1
- package/dist/core/entities/watched-list.d.cts +0 -27
- package/dist/core/entities/watched-list.d.ts +0 -27
- package/dist/core/entities/watched-list.js +0 -98
- package/dist/core/entities/watched-list.js.map +0 -1
- package/dist/core/entities/watched-list.test.cjs +0 -186
- package/dist/core/entities/watched-list.test.cjs.map +0 -1
- package/dist/core/entities/watched-list.test.d.cts +0 -2
- package/dist/core/entities/watched-list.test.d.ts +0 -2
- package/dist/core/entities/watched-list.test.js +0 -185
- package/dist/core/entities/watched-list.test.js.map +0 -1
- package/dist/core/errors/api-common-error.cjs +0 -38
- package/dist/core/errors/api-common-error.cjs.map +0 -1
- package/dist/core/errors/api-common-error.d.cts +0 -28
- package/dist/core/errors/api-common-error.d.ts +0 -28
- package/dist/core/errors/api-common-error.js +0 -13
- package/dist/core/errors/api-common-error.js.map +0 -1
- package/dist/core/errors/application-error.cjs +0 -54
- package/dist/core/errors/application-error.cjs.map +0 -1
- package/dist/core/errors/application-error.d.cts +0 -8
- package/dist/core/errors/application-error.d.ts +0 -8
- package/dist/core/errors/application-error.js +0 -33
- package/dist/core/errors/application-error.js.map +0 -1
- package/dist/core/errors/conflict-error.cjs +0 -56
- package/dist/core/errors/conflict-error.cjs.map +0 -1
- package/dist/core/errors/conflict-error.d.cts +0 -13
- package/dist/core/errors/conflict-error.d.ts +0 -13
- package/dist/core/errors/conflict-error.js +0 -35
- package/dist/core/errors/conflict-error.js.map +0 -1
- package/dist/core/errors/domain-error.cjs +0 -54
- package/dist/core/errors/domain-error.cjs.map +0 -1
- package/dist/core/errors/domain-error.d.cts +0 -8
- package/dist/core/errors/domain-error.d.ts +0 -8
- package/dist/core/errors/domain-error.js +0 -33
- package/dist/core/errors/domain-error.js.map +0 -1
- package/dist/core/errors/http-client-error.cjs +0 -54
- package/dist/core/errors/http-client-error.cjs.map +0 -1
- package/dist/core/errors/http-client-error.d.cts +0 -8
- package/dist/core/errors/http-client-error.d.ts +0 -8
- package/dist/core/errors/http-client-error.js +0 -33
- package/dist/core/errors/http-client-error.js.map +0 -1
- package/dist/core/errors/infra-error.cjs +0 -54
- package/dist/core/errors/infra-error.cjs.map +0 -1
- package/dist/core/errors/infra-error.d.cts +0 -8
- package/dist/core/errors/infra-error.d.ts +0 -8
- package/dist/core/errors/infra-error.js +0 -33
- package/dist/core/errors/infra-error.js.map +0 -1
- package/dist/core/errors/validation-error.cjs +0 -55
- package/dist/core/errors/validation-error.cjs.map +0 -1
- package/dist/core/errors/validation-error.d.cts +0 -8
- package/dist/core/errors/validation-error.d.ts +0 -8
- package/dist/core/errors/validation-error.js +0 -34
- package/dist/core/errors/validation-error.js.map +0 -1
- package/dist/core/http/base-controller.cjs +0 -295
- package/dist/core/http/base-controller.cjs.map +0 -1
- package/dist/core/http/base-controller.d.cts +0 -1
- package/dist/core/http/base-controller.d.ts +0 -1
- package/dist/core/http/base-controller.js +0 -270
- package/dist/core/http/base-controller.js.map +0 -1
- package/dist/core/http/dto-response.cjs +0 -19
- package/dist/core/http/dto-response.cjs.map +0 -1
- package/dist/core/http/dto-response.d.cts +0 -10
- package/dist/core/http/dto-response.d.ts +0 -10
- package/dist/core/http/dto-response.js +0 -1
- package/dist/core/http/dto-response.js.map +0 -1
- package/dist/core/http/error-notifier.cjs +0 -19
- package/dist/core/http/error-notifier.cjs.map +0 -1
- package/dist/core/http/error-notifier.d.cts +0 -1
- package/dist/core/http/error-notifier.d.ts +0 -1
- package/dist/core/http/error-notifier.js +0 -1
- package/dist/core/http/error-notifier.js.map +0 -1
- package/dist/core/http/get-take-and-skip.cjs +0 -40
- package/dist/core/http/get-take-and-skip.cjs.map +0 -1
- package/dist/core/http/get-take-and-skip.d.cts +0 -6
- package/dist/core/http/get-take-and-skip.d.ts +0 -6
- package/dist/core/http/get-take-and-skip.js +0 -17
- package/dist/core/http/get-take-and-skip.js.map +0 -1
- package/dist/core/http/health-connections.cjs +0 -42
- package/dist/core/http/health-connections.cjs.map +0 -1
- package/dist/core/http/health-connections.d.cts +0 -16
- package/dist/core/http/health-connections.d.ts +0 -16
- package/dist/core/http/health-connections.js +0 -23
- package/dist/core/http/health-connections.js.map +0 -1
- package/dist/core/http/http.cjs +0 -19
- package/dist/core/http/http.cjs.map +0 -1
- package/dist/core/http/http.d.cts +0 -10
- package/dist/core/http/http.d.ts +0 -10
- package/dist/core/http/http.js +0 -1
- package/dist/core/http/http.js.map +0 -1
- package/dist/core/http/pagination.cjs +0 -19
- package/dist/core/http/pagination.cjs.map +0 -1
- package/dist/core/http/pagination.d.cts +0 -9
- package/dist/core/http/pagination.d.ts +0 -9
- package/dist/core/http/pagination.js +0 -1
- package/dist/core/http/pagination.js.map +0 -1
- package/dist/core/http/validator.cjs +0 -19
- package/dist/core/http/validator.cjs.map +0 -1
- package/dist/core/http/validator.d.cts +0 -11
- package/dist/core/http/validator.d.ts +0 -11
- package/dist/core/http/validator.js +0 -1
- package/dist/core/http/validator.js.map +0 -1
- package/dist/infra/adapters/http/express-adapter.cjs +0 -139
- package/dist/infra/adapters/http/express-adapter.cjs.map +0 -1
- package/dist/infra/adapters/http/express-adapter.d.cts +0 -15
- package/dist/infra/adapters/http/express-adapter.d.ts +0 -15
- package/dist/infra/adapters/http/express-adapter.js +0 -106
- package/dist/infra/adapters/http/express-adapter.js.map +0 -1
- package/dist/infra/adapters/http/fastify-adapter.cjs +0 -124
- package/dist/infra/adapters/http/fastify-adapter.cjs.map +0 -1
- package/dist/infra/adapters/http/fastify-adapter.d.cts +0 -14
- package/dist/infra/adapters/http/fastify-adapter.d.ts +0 -14
- package/dist/infra/adapters/http/fastify-adapter.js +0 -91
- package/dist/infra/adapters/http/fastify-adapter.js.map +0 -1
- package/dist/infra/adapters/http/response-error-code.cjs +0 -35
- package/dist/infra/adapters/http/response-error-code.cjs.map +0 -1
- package/dist/infra/adapters/http/response-error-code.d.cts +0 -6
- package/dist/infra/adapters/http/response-error-code.d.ts +0 -6
- package/dist/infra/adapters/http/response-error-code.js +0 -10
- package/dist/infra/adapters/http/response-error-code.js.map +0 -1
- package/dist/infra/adapters/http/validate-controller-metadata.cjs +0 -42
- package/dist/infra/adapters/http/validate-controller-metadata.cjs.map +0 -1
- package/dist/infra/adapters/http/validate-controller-metadata.d.cts +0 -11
- package/dist/infra/adapters/http/validate-controller-metadata.d.ts +0 -11
- package/dist/infra/adapters/http/validate-controller-metadata.js +0 -19
- package/dist/infra/adapters/http/validate-controller-metadata.js.map +0 -1
- package/dist/infra/adapters/notifications/discord.cjs +0 -90
- package/dist/infra/adapters/notifications/discord.cjs.map +0 -1
- package/dist/infra/adapters/notifications/discord.d.cts +0 -14
- package/dist/infra/adapters/notifications/discord.d.ts +0 -14
- package/dist/infra/adapters/notifications/discord.js +0 -65
- package/dist/infra/adapters/notifications/discord.js.map +0 -1
- package/dist/infra/adapters/notifications/in-memory.cjs +0 -44
- package/dist/infra/adapters/notifications/in-memory.cjs.map +0 -1
- package/dist/infra/adapters/notifications/in-memory.d.cts +0 -8
- package/dist/infra/adapters/notifications/in-memory.d.ts +0 -8
- package/dist/infra/adapters/notifications/in-memory.js +0 -21
- package/dist/infra/adapters/notifications/in-memory.js.map +0 -1
- package/dist/infra/adapters/notifications/notification-factory.cjs +0 -219
- package/dist/infra/adapters/notifications/notification-factory.cjs.map +0 -1
- package/dist/infra/adapters/notifications/notification-factory.d.cts +0 -18
- package/dist/infra/adapters/notifications/notification-factory.d.ts +0 -18
- package/dist/infra/adapters/notifications/notification-factory.js +0 -184
- package/dist/infra/adapters/notifications/notification-factory.js.map +0 -1
- package/dist/infra/adapters/notifications/sentry.cjs +0 -129
- package/dist/infra/adapters/notifications/sentry.cjs.map +0 -1
- package/dist/infra/adapters/notifications/sentry.d.cts +0 -13
- package/dist/infra/adapters/notifications/sentry.d.ts +0 -13
- package/dist/infra/adapters/notifications/sentry.js +0 -96
- package/dist/infra/adapters/notifications/sentry.js.map +0 -1
- package/dist/infra/adapters/validators/zod/index.cjs +0 -179
- package/dist/infra/adapters/validators/zod/index.cjs.map +0 -1
- package/dist/infra/adapters/validators/zod/index.d.cts +0 -19
- package/dist/infra/adapters/validators/zod/index.d.ts +0 -19
- package/dist/infra/adapters/validators/zod/index.js +0 -154
- package/dist/infra/adapters/validators/zod/index.js.map +0 -1
- package/dist/infra/adapters/validators/zod/zod-map-error.cjs +0 -79
- package/dist/infra/adapters/validators/zod/zod-map-error.cjs.map +0 -1
- package/dist/infra/adapters/validators/zod/zod-map-error.d.cts +0 -15
- package/dist/infra/adapters/validators/zod/zod-map-error.d.ts +0 -15
- package/dist/infra/adapters/validators/zod/zod-map-error.js +0 -60
- package/dist/infra/adapters/validators/zod/zod-map-error.js.map +0 -1
- package/dist/infra/adapters/validators/zod/zod-validator.cjs +0 -178
- package/dist/infra/adapters/validators/zod/zod-validator.cjs.map +0 -1
- package/dist/infra/adapters/validators/zod/zod-validator.d.cts +0 -13
- package/dist/infra/adapters/validators/zod/zod-validator.d.ts +0 -13
- package/dist/infra/adapters/validators/zod/zod-validator.js +0 -153
- package/dist/infra/adapters/validators/zod/zod-validator.js.map +0 -1
- package/dist/infra/env/index.cjs +0 -467
- package/dist/infra/env/index.cjs.map +0 -1
- package/dist/infra/env/index.d.cts +0 -26
- package/dist/infra/env/index.d.ts +0 -26
- package/dist/infra/env/index.js +0 -452
- package/dist/infra/env/index.js.map +0 -1
- /package/dist/{index.js.map → index.mjs.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=dto-response.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/core/http/error-notifier.ts
|
|
17
|
-
var error_notifier_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(error_notifier_exports);
|
|
19
|
-
//# sourceMappingURL=error-notifier.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/http/error-notifier.ts"],"sourcesContent":["import type { ContextError } from './base-controller'\n\nexport interface IErrorNotifier {\n notify(error: Error, context: ContextError): Promise<void>\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAEA;;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { I as IErrorNotifier } from '../../base-controller-68008870.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { I as IErrorNotifier } from '../../base-controller-68008870.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=error-notifier.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/core/http/get-take-and-skip.ts
|
|
22
|
-
var get_take_and_skip_exports = {};
|
|
23
|
-
__export(get_take_and_skip_exports, {
|
|
24
|
-
getTakeAndSkip: () => getTakeAndSkip
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(get_take_and_skip_exports);
|
|
27
|
-
function getTakeAndSkip(size, page) {
|
|
28
|
-
const take = size ? Number(size) : 20;
|
|
29
|
-
const skip = page ? Number(page) : 1;
|
|
30
|
-
return {
|
|
31
|
-
take,
|
|
32
|
-
skip
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
__name(getTakeAndSkip, "getTakeAndSkip");
|
|
36
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
-
0 && (module.exports = {
|
|
38
|
-
getTakeAndSkip
|
|
39
|
-
});
|
|
40
|
-
//# sourceMappingURL=get-take-and-skip.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/http/get-take-and-skip.ts"],"sourcesContent":["export function getTakeAndSkip(size: string, page: string) {\n const take = size ? Number(size) : 20\n const skip = page ? Number(page) : 1\n\n return { take, skip }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAAO,SAASA,eAAeC,MAAcC,MAAY;AACvD,QAAMC,OAAOF,OAAOG,OAAOH,IAAAA,IAAQ;AACnC,QAAMI,OAAOH,OAAOE,OAAOF,IAAAA,IAAQ;AAEnC,SAAO;IAAEC;IAAME;EAAK;AACtB;AALgBL;","names":["getTakeAndSkip","size","page","take","Number","skip"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/core/http/get-take-and-skip.ts
|
|
5
|
-
function getTakeAndSkip(size, page) {
|
|
6
|
-
const take = size ? Number(size) : 20;
|
|
7
|
-
const skip = page ? Number(page) : 1;
|
|
8
|
-
return {
|
|
9
|
-
take,
|
|
10
|
-
skip
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
__name(getTakeAndSkip, "getTakeAndSkip");
|
|
14
|
-
export {
|
|
15
|
-
getTakeAndSkip
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=get-take-and-skip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/http/get-take-and-skip.ts"],"sourcesContent":["export function getTakeAndSkip(size: string, page: string) {\n const take = size ? Number(size) : 20\n const skip = page ? Number(page) : 1\n\n return { take, skip }\n}\n"],"mappings":";;;;AAAO,SAASA,eAAeC,MAAcC,MAAY;AACvD,QAAMC,OAAOF,OAAOG,OAAOH,IAAAA,IAAQ;AACnC,QAAMI,OAAOH,OAAOE,OAAOF,IAAAA,IAAQ;AAEnC,SAAO;IAAEC;IAAME;EAAK;AACtB;AALgBL;","names":["getTakeAndSkip","size","page","take","Number","skip"]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/core/http/health-connections.ts
|
|
22
|
-
var health_connections_exports = {};
|
|
23
|
-
__export(health_connections_exports, {
|
|
24
|
-
default: () => Health
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(health_connections_exports);
|
|
27
|
-
var Health = class {
|
|
28
|
-
static {
|
|
29
|
-
__name(this, "Health");
|
|
30
|
-
}
|
|
31
|
-
checkDB;
|
|
32
|
-
constructor(checkDB) {
|
|
33
|
-
this.checkDB = checkDB;
|
|
34
|
-
}
|
|
35
|
-
async check() {
|
|
36
|
-
const dbIsOnline = await this.checkDB.dbIsOnline();
|
|
37
|
-
return {
|
|
38
|
-
dbIsOnline
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=health-connections.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/http/health-connections.ts"],"sourcesContent":["type HealthCheckOutput = {\n dbIsOnline: boolean\n}\n\nexport interface IHealthCheck {\n check(): Promise<HealthCheckOutput>\n}\n\nexport default class Health implements IHealthCheck {\n constructor(private checkDB: ICheckDB) {}\n\n async check(): Promise<HealthCheckOutput> {\n const dbIsOnline = await this.checkDB.dbIsOnline()\n\n return { dbIsOnline }\n }\n}\n\nexport interface ICheckDB {\n dbIsOnline(): Promise<boolean>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA;;;;;AAAA,IAAqBA,SAArB,MAAqBA;EAArB,OAAqBA;;;;EACnBC,YAAoBC,SAAmB;SAAnBA,UAAAA;EAAoB;EAExC,MAAMC,QAAoC;AACxC,UAAMC,aAAa,MAAM,KAAKF,QAAQE,WAAU;AAEhD,WAAO;MAAEA;IAAW;EACtB;AACF;","names":["Health","constructor","checkDB","check","dbIsOnline"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
type HealthCheckOutput = {
|
|
2
|
-
dbIsOnline: boolean;
|
|
3
|
-
};
|
|
4
|
-
interface IHealthCheck {
|
|
5
|
-
check(): Promise<HealthCheckOutput>;
|
|
6
|
-
}
|
|
7
|
-
declare class Health implements IHealthCheck {
|
|
8
|
-
private checkDB;
|
|
9
|
-
constructor(checkDB: ICheckDB);
|
|
10
|
-
check(): Promise<HealthCheckOutput>;
|
|
11
|
-
}
|
|
12
|
-
interface ICheckDB {
|
|
13
|
-
dbIsOnline(): Promise<boolean>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { ICheckDB, IHealthCheck, Health as default };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
type HealthCheckOutput = {
|
|
2
|
-
dbIsOnline: boolean;
|
|
3
|
-
};
|
|
4
|
-
interface IHealthCheck {
|
|
5
|
-
check(): Promise<HealthCheckOutput>;
|
|
6
|
-
}
|
|
7
|
-
declare class Health implements IHealthCheck {
|
|
8
|
-
private checkDB;
|
|
9
|
-
constructor(checkDB: ICheckDB);
|
|
10
|
-
check(): Promise<HealthCheckOutput>;
|
|
11
|
-
}
|
|
12
|
-
interface ICheckDB {
|
|
13
|
-
dbIsOnline(): Promise<boolean>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { ICheckDB, IHealthCheck, Health as default };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/core/http/health-connections.ts
|
|
5
|
-
var Health = class {
|
|
6
|
-
static {
|
|
7
|
-
__name(this, "Health");
|
|
8
|
-
}
|
|
9
|
-
checkDB;
|
|
10
|
-
constructor(checkDB) {
|
|
11
|
-
this.checkDB = checkDB;
|
|
12
|
-
}
|
|
13
|
-
async check() {
|
|
14
|
-
const dbIsOnline = await this.checkDB.dbIsOnline();
|
|
15
|
-
return {
|
|
16
|
-
dbIsOnline
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
export {
|
|
21
|
-
Health as default
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=health-connections.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/http/health-connections.ts"],"sourcesContent":["type HealthCheckOutput = {\n dbIsOnline: boolean\n}\n\nexport interface IHealthCheck {\n check(): Promise<HealthCheckOutput>\n}\n\nexport default class Health implements IHealthCheck {\n constructor(private checkDB: ICheckDB) {}\n\n async check(): Promise<HealthCheckOutput> {\n const dbIsOnline = await this.checkDB.dbIsOnline()\n\n return { dbIsOnline }\n }\n}\n\nexport interface ICheckDB {\n dbIsOnline(): Promise<boolean>\n}\n"],"mappings":";;;;AAQA,IAAqBA,SAArB,MAAqBA;EAArB,OAAqBA;;;;EACnBC,YAAoBC,SAAmB;SAAnBA,UAAAA;EAAoB;EAExC,MAAMC,QAAoC;AACxC,UAAMC,aAAa,MAAM,KAAKF,QAAQE,WAAU;AAEhD,WAAO;MAAEA;IAAW;EACtB;AACF;","names":["Health","constructor","checkDB","check","dbIsOnline"]}
|
package/dist/core/http/http.cjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/core/http/http.ts
|
|
17
|
-
var http_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(http_exports);
|
|
19
|
-
//# sourceMappingURL=http.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/http/http.ts"],"sourcesContent":["import type { BaseController } from './base-controller'\n\nexport type MethodType = 'get' | 'post' | 'delete' | 'put' | 'patch'\n\nexport default interface IHttp {\n registerRoute(controller: BaseController): void\n startServer(port: number): Promise<void>\n closeServer(): Promise<void>\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAIA;;","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { B as BaseController } from '../../base-controller-68008870.js';
|
|
2
|
-
|
|
3
|
-
type MethodType = 'get' | 'post' | 'delete' | 'put' | 'patch';
|
|
4
|
-
interface IHttp {
|
|
5
|
-
registerRoute(controller: BaseController): void;
|
|
6
|
-
startServer(port: number): Promise<void>;
|
|
7
|
-
closeServer(): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { MethodType, IHttp as default };
|
package/dist/core/http/http.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { B as BaseController } from '../../base-controller-68008870.js';
|
|
2
|
-
|
|
3
|
-
type MethodType = 'get' | 'post' | 'delete' | 'put' | 'patch';
|
|
4
|
-
interface IHttp {
|
|
5
|
-
registerRoute(controller: BaseController): void;
|
|
6
|
-
startServer(port: number): Promise<void>;
|
|
7
|
-
closeServer(): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { MethodType, IHttp as default };
|
package/dist/core/http/http.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=http.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/core/http/pagination.ts
|
|
17
|
-
var pagination_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(pagination_exports);
|
|
19
|
-
//# sourceMappingURL=pagination.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/http/pagination.ts"],"sourcesContent":["export type Pagination<T> = {\n data: T[]\n count?: number\n}\n\nexport type NotPagination<T> = {\n data: T[]\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAKA;;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=pagination.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/core/http/validator.ts
|
|
17
|
-
var validator_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(validator_exports);
|
|
19
|
-
//# sourceMappingURL=validator.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/http/validator.ts"],"sourcesContent":["export type RequestHttp = {\n body: Record<string, any>\n params: Record<string, any>\n headers: Record<string, any>\n query: Record<string, any>\n}\n\nexport default interface IValidationHTTP {\n validate<T>(requestHttp: RequestHttp): Promise<T>\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAOA;;","names":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type RequestHttp = {
|
|
2
|
-
body: Record<string, any>;
|
|
3
|
-
params: Record<string, any>;
|
|
4
|
-
headers: Record<string, any>;
|
|
5
|
-
query: Record<string, any>;
|
|
6
|
-
};
|
|
7
|
-
interface IValidationHTTP {
|
|
8
|
-
validate<T>(requestHttp: RequestHttp): Promise<T>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { RequestHttp, IValidationHTTP as default };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type RequestHttp = {
|
|
2
|
-
body: Record<string, any>;
|
|
3
|
-
params: Record<string, any>;
|
|
4
|
-
headers: Record<string, any>;
|
|
5
|
-
query: Record<string, any>;
|
|
6
|
-
};
|
|
7
|
-
interface IValidationHTTP {
|
|
8
|
-
validate<T>(requestHttp: RequestHttp): Promise<T>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { RequestHttp, IValidationHTTP as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
|
|
31
|
-
// src/infra/adapters/http/express-adapter.ts
|
|
32
|
-
var express_adapter_exports = {};
|
|
33
|
-
__export(express_adapter_exports, {
|
|
34
|
-
ExpressAdapter: () => ExpressAdapter
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(express_adapter_exports);
|
|
37
|
-
var import_cors = __toESM(require("cors"), 1);
|
|
38
|
-
var import_express = __toESM(require("express"), 1);
|
|
39
|
-
|
|
40
|
-
// src/infra/adapters/http/response-error-code.ts
|
|
41
|
-
var ErrorResponseCode = /* @__PURE__ */ function(ErrorResponseCode2) {
|
|
42
|
-
ErrorResponseCode2["NO_CONTENT_BODY"] = "B001";
|
|
43
|
-
ErrorResponseCode2["NO_CONTENT_ERROR"] = "B002";
|
|
44
|
-
return ErrorResponseCode2;
|
|
45
|
-
}({});
|
|
46
|
-
|
|
47
|
-
// src/infra/adapters/http/validate-controller-metadata.ts
|
|
48
|
-
var import_reflect_metadata = require("reflect-metadata");
|
|
49
|
-
function validateControllerMetadata(controller) {
|
|
50
|
-
const metadata = Reflect.getMetadata("route", controller.constructor);
|
|
51
|
-
if (!metadata) {
|
|
52
|
-
throw new Error(`Controller ${controller.constructor.name} not have metadata. Need to add decorator.`);
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
metadata
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
__name(validateControllerMetadata, "validateControllerMetadata");
|
|
59
|
-
|
|
60
|
-
// src/infra/adapters/http/express-adapter.ts
|
|
61
|
-
var ExpressAdapter = class {
|
|
62
|
-
static {
|
|
63
|
-
__name(this, "ExpressAdapter");
|
|
64
|
-
}
|
|
65
|
-
env;
|
|
66
|
-
instance;
|
|
67
|
-
server;
|
|
68
|
-
constructor(env) {
|
|
69
|
-
this.env = env;
|
|
70
|
-
this.instance = (0, import_express.default)();
|
|
71
|
-
this.instance.use((0, import_cors.default)());
|
|
72
|
-
this.instance.use(import_express.default.json({
|
|
73
|
-
limit: "10mb"
|
|
74
|
-
}));
|
|
75
|
-
this.instance.use(import_express.default.urlencoded({
|
|
76
|
-
limit: "10mb",
|
|
77
|
-
extended: false
|
|
78
|
-
}));
|
|
79
|
-
this.instance.disable("x-powered-by");
|
|
80
|
-
}
|
|
81
|
-
registerRoute(controllerClass) {
|
|
82
|
-
const { metadata } = validateControllerMetadata(controllerClass);
|
|
83
|
-
this.instance[metadata.method](metadata.path, async (request, response) => {
|
|
84
|
-
const requestData = {
|
|
85
|
-
body: request.body,
|
|
86
|
-
params: request.params,
|
|
87
|
-
headers: request.headers,
|
|
88
|
-
query: request.query
|
|
89
|
-
};
|
|
90
|
-
try {
|
|
91
|
-
const output = await controllerClass.execute(requestData);
|
|
92
|
-
response.status(output.code || 204).json(output.data || {
|
|
93
|
-
code: ErrorResponseCode.NO_CONTENT_BODY
|
|
94
|
-
});
|
|
95
|
-
} catch (err) {
|
|
96
|
-
const error = await controllerClass.failure(err, {
|
|
97
|
-
env: this.env.ENVIRONMENT,
|
|
98
|
-
request: {
|
|
99
|
-
body: requestData.body,
|
|
100
|
-
headers: requestData.headers,
|
|
101
|
-
params: request.params,
|
|
102
|
-
query: requestData.query,
|
|
103
|
-
url: metadata.path,
|
|
104
|
-
method: metadata.method
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
response.status(error.code).json(error.data || {
|
|
108
|
-
error: ErrorResponseCode.NO_CONTENT_ERROR
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
async startServer(port) {
|
|
114
|
-
return new Promise((resolve) => {
|
|
115
|
-
this.server = this.instance.listen(port, () => {
|
|
116
|
-
console.log(`\u{1F680} Server is running on PORT ${port}`);
|
|
117
|
-
resolve();
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
async closeServer() {
|
|
122
|
-
return new Promise((resolve, reject) => {
|
|
123
|
-
if (this.server) {
|
|
124
|
-
this.server.close((err) => {
|
|
125
|
-
if (err)
|
|
126
|
-
return reject(err);
|
|
127
|
-
resolve();
|
|
128
|
-
});
|
|
129
|
-
} else {
|
|
130
|
-
resolve();
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
136
|
-
0 && (module.exports = {
|
|
137
|
-
ExpressAdapter
|
|
138
|
-
});
|
|
139
|
-
//# sourceMappingURL=express-adapter.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/infra/adapters/http/express-adapter.ts","../../../../src/infra/adapters/http/response-error-code.ts","../../../../src/infra/adapters/http/validate-controller-metadata.ts"],"sourcesContent":["import cors from 'cors'\nimport express, { Express, Request, Response } from 'express'\n\nimport type { BaseController } from '../../../core/http/base-controller'\nimport type IHttp from '../../../core/http/http'\n\nimport { ErrorResponseCode } from './response-error-code'\nimport { validateControllerMetadata } from './validate-controller-metadata'\n\nexport class ExpressAdapter implements IHttp {\n readonly instance: Express\n private server: any\n\n constructor(readonly env: Record<string, any>) {\n this.instance = express()\n this.instance.use(cors())\n this.instance.use(express.json({ limit: '10mb' }))\n this.instance.use(express.urlencoded({ limit: '10mb', extended: false }))\n this.instance.disable('x-powered-by')\n }\n\n registerRoute(controllerClass: BaseController): void {\n const { metadata } = validateControllerMetadata(controllerClass)\n\n this.instance[metadata.method](\n metadata.path,\n async (request: Request, response: Response) => {\n const requestData = {\n body: request.body,\n params: request.params,\n headers: request.headers,\n query: request.query,\n }\n\n try {\n const output = await controllerClass.execute(requestData)\n response\n .status(output.code || 204)\n .json(output.data || { code: ErrorResponseCode.NO_CONTENT_BODY })\n } catch (err: any) {\n const error = await controllerClass.failure(err, {\n env: this.env.ENVIRONMENT,\n request: {\n body: requestData.body,\n headers: requestData.headers,\n params: request.params,\n query: requestData.query,\n url: metadata.path,\n method: metadata.method,\n },\n })\n response.status(error.code).json(\n error.data || {\n error: ErrorResponseCode.NO_CONTENT_ERROR,\n }\n )\n }\n }\n )\n }\n\n async startServer(port: number): Promise<void> {\n return new Promise((resolve) => {\n this.server = this.instance.listen(port, () => {\n console.log(`🚀 Server is running on PORT ${port}`)\n resolve()\n })\n })\n }\n\n async closeServer(): Promise<void> {\n return new Promise((resolve, reject) => {\n if (this.server) {\n this.server.close((err: any) => {\n if (err) return reject(err)\n resolve()\n })\n } else {\n resolve()\n }\n })\n }\n}\n","export enum ErrorResponseCode {\n NO_CONTENT_BODY = 'B001',\n NO_CONTENT_ERROR = 'B002',\n}\n","import { BaseController } from '../../../core/http/base-controller'\nimport type { MethodType } from '../../../core/http/http'\n\nimport 'reflect-metadata'\n\nexport function validateControllerMetadata(controller: BaseController) {\n const metadata = Reflect.getMetadata('route', controller.constructor) as {\n method: MethodType\n path: string\n }\n\n if (!metadata) {\n throw new Error(\n `Controller ${controller.constructor.name} not have metadata. Need to add decorator.`\n )\n }\n\n return {\n metadata,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;kBAAiB;AACjB,qBAAoD;;;ACD7C,IAAKA,oBAAAA,yBAAAA,oBAAAA;;;SAAAA;;;;ACGZ,8BAAO;AAEA,SAASC,2BAA2BC,YAA0B;AACnE,QAAMC,WAAWC,QAAQC,YAAY,SAASH,WAAWI,WAAW;AAKpE,MAAI,CAACH,UAAU;AACb,UAAM,IAAII,MACR,cAAcL,WAAWI,YAAYE,IAAI,4CAA4C;EAEzF;AAEA,SAAO;IACLL;EACF;AACF;AAfgBF;;;AFIT,IAAMQ,iBAAN,MAAMA;EATb,OASaA;;;;EACFC;EACDC;EAERC,YAAqBC,KAA0B;SAA1BA,MAAAA;AACnB,SAAKH,eAAWI,eAAAA,SAAAA;AAChB,SAAKJ,SAASK,QAAIC,YAAAA,SAAAA,CAAAA;AAClB,SAAKN,SAASK,IAAID,eAAAA,QAAQG,KAAK;MAAEC,OAAO;IAAO,CAAA,CAAA;AAC/C,SAAKR,SAASK,IAAID,eAAAA,QAAQK,WAAW;MAAED,OAAO;MAAQE,UAAU;IAAM,CAAA,CAAA;AACtE,SAAKV,SAASW,QAAQ,cAAA;EACxB;EAEAC,cAAcC,iBAAuC;AACnD,UAAM,EAAEC,SAAQ,IAAKC,2BAA2BF,eAAAA;AAEhD,SAAKb,SAASc,SAASE,MAAM,EAC3BF,SAASG,MACT,OAAOC,SAAkBC,aAAAA;AACvB,YAAMC,cAAc;QAClBC,MAAMH,QAAQG;QACdC,QAAQJ,QAAQI;QAChBC,SAASL,QAAQK;QACjBC,OAAON,QAAQM;MACjB;AAEA,UAAI;AACF,cAAMC,SAAS,MAAMZ,gBAAgBa,QAAQN,WAAAA;AAC7CD,iBACGQ,OAAOF,OAAOG,QAAQ,GAAA,EACtBrB,KAAKkB,OAAOI,QAAQ;UAAED,MAAME,kBAAkBC;QAAgB,CAAA;MACnE,SAASC,KAAU;AACjB,cAAMC,QAAQ,MAAMpB,gBAAgBqB,QAAQF,KAAK;UAC/C7B,KAAK,KAAKA,IAAIgC;UACdjB,SAAS;YACPG,MAAMD,YAAYC;YAClBE,SAASH,YAAYG;YACrBD,QAAQJ,QAAQI;YAChBE,OAAOJ,YAAYI;YACnBY,KAAKtB,SAASG;YACdD,QAAQF,SAASE;UACnB;QACF,CAAA;AACAG,iBAASQ,OAAOM,MAAML,IAAI,EAAErB,KAC1B0B,MAAMJ,QAAQ;UACZI,OAAOH,kBAAkBO;QAC3B,CAAA;MAEJ;IACF,CAAA;EAEJ;EAEA,MAAMC,YAAYC,MAA6B;AAC7C,WAAO,IAAIC,QAAQ,CAACC,YAAAA;AAClB,WAAKxC,SAAS,KAAKD,SAAS0C,OAAOH,MAAM,MAAA;AACvCI,gBAAQC,IAAI,uCAAgCL,IAAAA,EAAM;AAClDE,gBAAAA;MACF,CAAA;IACF,CAAA;EACF;EAEA,MAAMI,cAA6B;AACjC,WAAO,IAAIL,QAAQ,CAACC,SAASK,WAAAA;AAC3B,UAAI,KAAK7C,QAAQ;AACf,aAAKA,OAAO8C,MAAM,CAACf,QAAAA;AACjB,cAAIA;AAAK,mBAAOc,OAAOd,GAAAA;AACvBS,kBAAAA;QACF,CAAA;MACF,OAAO;AACLA,gBAAAA;MACF;IACF,CAAA;EACF;AACF;","names":["ErrorResponseCode","validateControllerMetadata","controller","metadata","Reflect","getMetadata","constructor","Error","name","ExpressAdapter","instance","server","constructor","env","express","use","cors","json","limit","urlencoded","extended","disable","registerRoute","controllerClass","metadata","validateControllerMetadata","method","path","request","response","requestData","body","params","headers","query","output","execute","status","code","data","ErrorResponseCode","NO_CONTENT_BODY","err","error","failure","ENVIRONMENT","url","NO_CONTENT_ERROR","startServer","port","Promise","resolve","listen","console","log","closeServer","reject","close"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Express } from 'express';
|
|
2
|
-
import { B as BaseController } from '../../../base-controller-68008870.js';
|
|
3
|
-
import IHttp from '../../../core/http/http.cjs';
|
|
4
|
-
|
|
5
|
-
declare class ExpressAdapter implements IHttp {
|
|
6
|
-
readonly env: Record<string, any>;
|
|
7
|
-
readonly instance: Express;
|
|
8
|
-
private server;
|
|
9
|
-
constructor(env: Record<string, any>);
|
|
10
|
-
registerRoute(controllerClass: BaseController): void;
|
|
11
|
-
startServer(port: number): Promise<void>;
|
|
12
|
-
closeServer(): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { ExpressAdapter };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Express } from 'express';
|
|
2
|
-
import { B as BaseController } from '../../../base-controller-68008870.js';
|
|
3
|
-
import IHttp from '../../../core/http/http.js';
|
|
4
|
-
|
|
5
|
-
declare class ExpressAdapter implements IHttp {
|
|
6
|
-
readonly env: Record<string, any>;
|
|
7
|
-
readonly instance: Express;
|
|
8
|
-
private server;
|
|
9
|
-
constructor(env: Record<string, any>);
|
|
10
|
-
registerRoute(controllerClass: BaseController): void;
|
|
11
|
-
startServer(port: number): Promise<void>;
|
|
12
|
-
closeServer(): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { ExpressAdapter };
|