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,54 @@
|
|
|
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/errors/application-error.ts
|
|
22
|
+
var application_error_exports = {};
|
|
23
|
+
__export(application_error_exports, {
|
|
24
|
+
default: () => ApplicationError
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(application_error_exports);
|
|
27
|
+
|
|
28
|
+
// src/core/errors/api-common-error.ts
|
|
29
|
+
var ApiErrorEnum = /* @__PURE__ */ function(ApiErrorEnum2) {
|
|
30
|
+
ApiErrorEnum2["DOMAIN"] = "ERR001";
|
|
31
|
+
ApiErrorEnum2["APPLICATION"] = "ERR002";
|
|
32
|
+
ApiErrorEnum2["INFRA"] = "ERR003";
|
|
33
|
+
ApiErrorEnum2["HTTP_CLIENT"] = "ERR004";
|
|
34
|
+
ApiErrorEnum2["VALIDATOR"] = "ERR005";
|
|
35
|
+
return ApiErrorEnum2;
|
|
36
|
+
}({});
|
|
37
|
+
|
|
38
|
+
// src/core/errors/application-error.ts
|
|
39
|
+
var ApplicationError = class extends Error {
|
|
40
|
+
static {
|
|
41
|
+
__name(this, "ApplicationError");
|
|
42
|
+
}
|
|
43
|
+
props;
|
|
44
|
+
constructor(message) {
|
|
45
|
+
super(message);
|
|
46
|
+
this.props = {
|
|
47
|
+
code: 400,
|
|
48
|
+
errorCode: ApiErrorEnum.APPLICATION,
|
|
49
|
+
message,
|
|
50
|
+
occurredAt: /* @__PURE__ */ new Date()
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=application-error.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors/application-error.ts","../../../src/core/errors/api-common-error.ts"],"sourcesContent":["import { type ApiCommonError, ApiErrorEnum } from './api-common-error'\n\nexport default class ApplicationError extends Error {\n props: ApiCommonError\n\n constructor(message: string) {\n super(message)\n this.props = {\n code: 400,\n errorCode: ApiErrorEnum.APPLICATION,\n message,\n occurredAt: new Date(),\n }\n }\n}\n","export type PropertiesError = {\n receivedValue?: any\n type: string\n message: string\n property: string | number | undefined\n propertyType?: string\n path?: string\n}\n\nexport type CommonError = {\n location: string\n propertyErrors?: PropertiesError[]\n}\n\nexport type ApiCommonError = {\n code: number\n occurredAt: Date\n message: string\n errorCode: string\n errors?: CommonError[]\n}\n\nexport enum ApiErrorEnum {\n DOMAIN = 'ERR001',\n APPLICATION = 'ERR002',\n INFRA = 'ERR003',\n HTTP_CLIENT = 'ERR004',\n VALIDATOR = 'ERR005',\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACsBO,IAAKA,eAAAA,yBAAAA,eAAAA;;;;;;SAAAA;;;;ADpBZ,IAAqBC,mBAArB,cAA8CC,MAAAA;EAF9C,OAE8CA;;;EAC5CC;EAEAC,YAAYC,SAAiB;AAC3B,UAAMA,OAAAA;AACN,SAAKF,QAAQ;MACXG,MAAM;MACNC,WAAWC,aAAaC;MACxBJ;MACAK,YAAY,oBAAIC,KAAAA;IAClB;EACF;AACF;","names":["ApiErrorEnum","ApplicationError","Error","props","constructor","message","code","errorCode","ApiErrorEnum","APPLICATION","occurredAt","Date"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/core/errors/api-common-error.ts
|
|
5
|
+
var ApiErrorEnum = /* @__PURE__ */ function(ApiErrorEnum2) {
|
|
6
|
+
ApiErrorEnum2["DOMAIN"] = "ERR001";
|
|
7
|
+
ApiErrorEnum2["APPLICATION"] = "ERR002";
|
|
8
|
+
ApiErrorEnum2["INFRA"] = "ERR003";
|
|
9
|
+
ApiErrorEnum2["HTTP_CLIENT"] = "ERR004";
|
|
10
|
+
ApiErrorEnum2["VALIDATOR"] = "ERR005";
|
|
11
|
+
return ApiErrorEnum2;
|
|
12
|
+
}({});
|
|
13
|
+
|
|
14
|
+
// src/core/errors/application-error.ts
|
|
15
|
+
var ApplicationError = class extends Error {
|
|
16
|
+
static {
|
|
17
|
+
__name(this, "ApplicationError");
|
|
18
|
+
}
|
|
19
|
+
props;
|
|
20
|
+
constructor(message) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.props = {
|
|
23
|
+
code: 400,
|
|
24
|
+
errorCode: ApiErrorEnum.APPLICATION,
|
|
25
|
+
message,
|
|
26
|
+
occurredAt: /* @__PURE__ */ new Date()
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
ApplicationError as default
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=application-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors/api-common-error.ts","../../../src/core/errors/application-error.ts"],"sourcesContent":["export type PropertiesError = {\n receivedValue?: any\n type: string\n message: string\n property: string | number | undefined\n propertyType?: string\n path?: string\n}\n\nexport type CommonError = {\n location: string\n propertyErrors?: PropertiesError[]\n}\n\nexport type ApiCommonError = {\n code: number\n occurredAt: Date\n message: string\n errorCode: string\n errors?: CommonError[]\n}\n\nexport enum ApiErrorEnum {\n DOMAIN = 'ERR001',\n APPLICATION = 'ERR002',\n INFRA = 'ERR003',\n HTTP_CLIENT = 'ERR004',\n VALIDATOR = 'ERR005',\n}\n","import { type ApiCommonError, ApiErrorEnum } from './api-common-error'\n\nexport default class ApplicationError extends Error {\n props: ApiCommonError\n\n constructor(message: string) {\n super(message)\n this.props = {\n code: 400,\n errorCode: ApiErrorEnum.APPLICATION,\n message,\n occurredAt: new Date(),\n }\n }\n}\n"],"mappings":";;;;AAsBO,IAAKA,eAAAA,yBAAAA,eAAAA;;;;;;SAAAA;;;;ACpBZ,IAAqBC,mBAArB,cAA8CC,MAAAA;EAF9C,OAE8CA;;;EAC5CC;EAEAC,YAAYC,SAAiB;AAC3B,UAAMA,OAAAA;AACN,SAAKF,QAAQ;MACXG,MAAM;MACNC,WAAWC,aAAaC;MACxBJ;MACAK,YAAY,oBAAIC,KAAAA;IAClB;EACF;AACF;","names":["ApiErrorEnum","ApplicationError","Error","props","constructor","message","code","errorCode","ApiErrorEnum","APPLICATION","occurredAt","Date"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
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/errors/conflict-error.ts
|
|
22
|
+
var conflict_error_exports = {};
|
|
23
|
+
__export(conflict_error_exports, {
|
|
24
|
+
default: () => ConflictError
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(conflict_error_exports);
|
|
27
|
+
|
|
28
|
+
// src/core/errors/api-common-error.ts
|
|
29
|
+
var ApiErrorEnum = /* @__PURE__ */ function(ApiErrorEnum2) {
|
|
30
|
+
ApiErrorEnum2["DOMAIN"] = "ERR001";
|
|
31
|
+
ApiErrorEnum2["APPLICATION"] = "ERR002";
|
|
32
|
+
ApiErrorEnum2["INFRA"] = "ERR003";
|
|
33
|
+
ApiErrorEnum2["HTTP_CLIENT"] = "ERR004";
|
|
34
|
+
ApiErrorEnum2["VALIDATOR"] = "ERR005";
|
|
35
|
+
return ApiErrorEnum2;
|
|
36
|
+
}({});
|
|
37
|
+
|
|
38
|
+
// src/core/errors/conflict-error.ts
|
|
39
|
+
var ConflictError = class extends Error {
|
|
40
|
+
static {
|
|
41
|
+
__name(this, "ConflictError");
|
|
42
|
+
}
|
|
43
|
+
props;
|
|
44
|
+
conflictProps;
|
|
45
|
+
constructor(conflictProps) {
|
|
46
|
+
super("Resource already exists.");
|
|
47
|
+
this.conflictProps = conflictProps;
|
|
48
|
+
this.props = {
|
|
49
|
+
code: 409,
|
|
50
|
+
errorCode: ApiErrorEnum.APPLICATION,
|
|
51
|
+
message: this.message,
|
|
52
|
+
occurredAt: /* @__PURE__ */ new Date()
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=conflict-error.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors/conflict-error.ts","../../../src/core/errors/api-common-error.ts"],"sourcesContent":["import { type ApiCommonError, ApiErrorEnum } from './api-common-error'\n\ntype ConflictProps = { id: string; [key: string]: unknown }\n\nexport default class ConflictError<T extends ConflictProps> extends Error {\n props: ApiCommonError\n conflictProps: T | T[]\n\n constructor(conflictProps: T | T[]) {\n super('Resource already exists.')\n this.conflictProps = conflictProps\n this.props = {\n code: 409,\n errorCode: ApiErrorEnum.APPLICATION,\n message: this.message,\n occurredAt: new Date(),\n }\n }\n}\n","export type PropertiesError = {\n receivedValue?: any\n type: string\n message: string\n property: string | number | undefined\n propertyType?: string\n path?: string\n}\n\nexport type CommonError = {\n location: string\n propertyErrors?: PropertiesError[]\n}\n\nexport type ApiCommonError = {\n code: number\n occurredAt: Date\n message: string\n errorCode: string\n errors?: CommonError[]\n}\n\nexport enum ApiErrorEnum {\n DOMAIN = 'ERR001',\n APPLICATION = 'ERR002',\n INFRA = 'ERR003',\n HTTP_CLIENT = 'ERR004',\n VALIDATOR = 'ERR005',\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACsBO,IAAKA,eAAAA,yBAAAA,eAAAA;;;;;;SAAAA;;;;ADlBZ,IAAqBC,gBAArB,cAAoEC,MAAAA;EAJpE,OAIoEA;;;EAClEC;EACAC;EAEAC,YAAYD,eAAwB;AAClC,UAAM,0BAAA;AACN,SAAKA,gBAAgBA;AACrB,SAAKD,QAAQ;MACXG,MAAM;MACNC,WAAWC,aAAaC;MACxBC,SAAS,KAAKA;MACdC,YAAY,oBAAIC,KAAAA;IAClB;EACF;AACF;","names":["ApiErrorEnum","ConflictError","Error","props","conflictProps","constructor","code","errorCode","ApiErrorEnum","APPLICATION","message","occurredAt","Date"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApiCommonError } from './api-common-error.cjs';
|
|
2
|
+
|
|
3
|
+
type ConflictProps = {
|
|
4
|
+
id: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
declare class ConflictError<T extends ConflictProps> extends Error {
|
|
8
|
+
props: ApiCommonError;
|
|
9
|
+
conflictProps: T | T[];
|
|
10
|
+
constructor(conflictProps: T | T[]);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ConflictError as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApiCommonError } from './api-common-error.js';
|
|
2
|
+
|
|
3
|
+
type ConflictProps = {
|
|
4
|
+
id: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
declare class ConflictError<T extends ConflictProps> extends Error {
|
|
8
|
+
props: ApiCommonError;
|
|
9
|
+
conflictProps: T | T[];
|
|
10
|
+
constructor(conflictProps: T | T[]);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ConflictError as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/core/errors/api-common-error.ts
|
|
5
|
+
var ApiErrorEnum = /* @__PURE__ */ function(ApiErrorEnum2) {
|
|
6
|
+
ApiErrorEnum2["DOMAIN"] = "ERR001";
|
|
7
|
+
ApiErrorEnum2["APPLICATION"] = "ERR002";
|
|
8
|
+
ApiErrorEnum2["INFRA"] = "ERR003";
|
|
9
|
+
ApiErrorEnum2["HTTP_CLIENT"] = "ERR004";
|
|
10
|
+
ApiErrorEnum2["VALIDATOR"] = "ERR005";
|
|
11
|
+
return ApiErrorEnum2;
|
|
12
|
+
}({});
|
|
13
|
+
|
|
14
|
+
// src/core/errors/conflict-error.ts
|
|
15
|
+
var ConflictError = class extends Error {
|
|
16
|
+
static {
|
|
17
|
+
__name(this, "ConflictError");
|
|
18
|
+
}
|
|
19
|
+
props;
|
|
20
|
+
conflictProps;
|
|
21
|
+
constructor(conflictProps) {
|
|
22
|
+
super("Resource already exists.");
|
|
23
|
+
this.conflictProps = conflictProps;
|
|
24
|
+
this.props = {
|
|
25
|
+
code: 409,
|
|
26
|
+
errorCode: ApiErrorEnum.APPLICATION,
|
|
27
|
+
message: this.message,
|
|
28
|
+
occurredAt: /* @__PURE__ */ new Date()
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
ConflictError as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=conflict-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors/api-common-error.ts","../../../src/core/errors/conflict-error.ts"],"sourcesContent":["export type PropertiesError = {\n receivedValue?: any\n type: string\n message: string\n property: string | number | undefined\n propertyType?: string\n path?: string\n}\n\nexport type CommonError = {\n location: string\n propertyErrors?: PropertiesError[]\n}\n\nexport type ApiCommonError = {\n code: number\n occurredAt: Date\n message: string\n errorCode: string\n errors?: CommonError[]\n}\n\nexport enum ApiErrorEnum {\n DOMAIN = 'ERR001',\n APPLICATION = 'ERR002',\n INFRA = 'ERR003',\n HTTP_CLIENT = 'ERR004',\n VALIDATOR = 'ERR005',\n}\n","import { type ApiCommonError, ApiErrorEnum } from './api-common-error'\n\ntype ConflictProps = { id: string; [key: string]: unknown }\n\nexport default class ConflictError<T extends ConflictProps> extends Error {\n props: ApiCommonError\n conflictProps: T | T[]\n\n constructor(conflictProps: T | T[]) {\n super('Resource already exists.')\n this.conflictProps = conflictProps\n this.props = {\n code: 409,\n errorCode: ApiErrorEnum.APPLICATION,\n message: this.message,\n occurredAt: new Date(),\n }\n }\n}\n"],"mappings":";;;;AAsBO,IAAKA,eAAAA,yBAAAA,eAAAA;;;;;;SAAAA;;;;AClBZ,IAAqBC,gBAArB,cAAoEC,MAAAA;EAJpE,OAIoEA;;;EAClEC;EACAC;EAEAC,YAAYD,eAAwB;AAClC,UAAM,0BAAA;AACN,SAAKA,gBAAgBA;AACrB,SAAKD,QAAQ;MACXG,MAAM;MACNC,WAAWC,aAAaC;MACxBC,SAAS,KAAKA;MACdC,YAAY,oBAAIC,KAAAA;IAClB;EACF;AACF;","names":["ApiErrorEnum","ConflictError","Error","props","conflictProps","constructor","code","errorCode","ApiErrorEnum","APPLICATION","message","occurredAt","Date"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
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/errors/domain-error.ts
|
|
22
|
+
var domain_error_exports = {};
|
|
23
|
+
__export(domain_error_exports, {
|
|
24
|
+
default: () => DomainError
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(domain_error_exports);
|
|
27
|
+
|
|
28
|
+
// src/core/errors/api-common-error.ts
|
|
29
|
+
var ApiErrorEnum = /* @__PURE__ */ function(ApiErrorEnum2) {
|
|
30
|
+
ApiErrorEnum2["DOMAIN"] = "ERR001";
|
|
31
|
+
ApiErrorEnum2["APPLICATION"] = "ERR002";
|
|
32
|
+
ApiErrorEnum2["INFRA"] = "ERR003";
|
|
33
|
+
ApiErrorEnum2["HTTP_CLIENT"] = "ERR004";
|
|
34
|
+
ApiErrorEnum2["VALIDATOR"] = "ERR005";
|
|
35
|
+
return ApiErrorEnum2;
|
|
36
|
+
}({});
|
|
37
|
+
|
|
38
|
+
// src/core/errors/domain-error.ts
|
|
39
|
+
var DomainError = class extends Error {
|
|
40
|
+
static {
|
|
41
|
+
__name(this, "DomainError");
|
|
42
|
+
}
|
|
43
|
+
props;
|
|
44
|
+
constructor(message) {
|
|
45
|
+
super(message);
|
|
46
|
+
this.props = {
|
|
47
|
+
code: 400,
|
|
48
|
+
errorCode: ApiErrorEnum.DOMAIN,
|
|
49
|
+
message,
|
|
50
|
+
occurredAt: /* @__PURE__ */ new Date()
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=domain-error.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors/domain-error.ts","../../../src/core/errors/api-common-error.ts"],"sourcesContent":["import { type ApiCommonError, ApiErrorEnum } from './api-common-error'\n\nexport default class DomainError extends Error {\n props: ApiCommonError\n\n constructor(message: string) {\n super(message)\n this.props = {\n code: 400,\n errorCode: ApiErrorEnum.DOMAIN,\n message,\n occurredAt: new Date(),\n }\n }\n}\n","export type PropertiesError = {\n receivedValue?: any\n type: string\n message: string\n property: string | number | undefined\n propertyType?: string\n path?: string\n}\n\nexport type CommonError = {\n location: string\n propertyErrors?: PropertiesError[]\n}\n\nexport type ApiCommonError = {\n code: number\n occurredAt: Date\n message: string\n errorCode: string\n errors?: CommonError[]\n}\n\nexport enum ApiErrorEnum {\n DOMAIN = 'ERR001',\n APPLICATION = 'ERR002',\n INFRA = 'ERR003',\n HTTP_CLIENT = 'ERR004',\n VALIDATOR = 'ERR005',\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACsBO,IAAKA,eAAAA,yBAAAA,eAAAA;;;;;;SAAAA;;;;ADpBZ,IAAqBC,cAArB,cAAyCC,MAAAA;EAFzC,OAEyCA;;;EACvCC;EAEAC,YAAYC,SAAiB;AAC3B,UAAMA,OAAAA;AACN,SAAKF,QAAQ;MACXG,MAAM;MACNC,WAAWC,aAAaC;MACxBJ;MACAK,YAAY,oBAAIC,KAAAA;IAClB;EACF;AACF;","names":["ApiErrorEnum","DomainError","Error","props","constructor","message","code","errorCode","ApiErrorEnum","DOMAIN","occurredAt","Date"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/core/errors/api-common-error.ts
|
|
5
|
+
var ApiErrorEnum = /* @__PURE__ */ function(ApiErrorEnum2) {
|
|
6
|
+
ApiErrorEnum2["DOMAIN"] = "ERR001";
|
|
7
|
+
ApiErrorEnum2["APPLICATION"] = "ERR002";
|
|
8
|
+
ApiErrorEnum2["INFRA"] = "ERR003";
|
|
9
|
+
ApiErrorEnum2["HTTP_CLIENT"] = "ERR004";
|
|
10
|
+
ApiErrorEnum2["VALIDATOR"] = "ERR005";
|
|
11
|
+
return ApiErrorEnum2;
|
|
12
|
+
}({});
|
|
13
|
+
|
|
14
|
+
// src/core/errors/domain-error.ts
|
|
15
|
+
var DomainError = class extends Error {
|
|
16
|
+
static {
|
|
17
|
+
__name(this, "DomainError");
|
|
18
|
+
}
|
|
19
|
+
props;
|
|
20
|
+
constructor(message) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.props = {
|
|
23
|
+
code: 400,
|
|
24
|
+
errorCode: ApiErrorEnum.DOMAIN,
|
|
25
|
+
message,
|
|
26
|
+
occurredAt: /* @__PURE__ */ new Date()
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
DomainError as default
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=domain-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors/api-common-error.ts","../../../src/core/errors/domain-error.ts"],"sourcesContent":["export type PropertiesError = {\n receivedValue?: any\n type: string\n message: string\n property: string | number | undefined\n propertyType?: string\n path?: string\n}\n\nexport type CommonError = {\n location: string\n propertyErrors?: PropertiesError[]\n}\n\nexport type ApiCommonError = {\n code: number\n occurredAt: Date\n message: string\n errorCode: string\n errors?: CommonError[]\n}\n\nexport enum ApiErrorEnum {\n DOMAIN = 'ERR001',\n APPLICATION = 'ERR002',\n INFRA = 'ERR003',\n HTTP_CLIENT = 'ERR004',\n VALIDATOR = 'ERR005',\n}\n","import { type ApiCommonError, ApiErrorEnum } from './api-common-error'\n\nexport default class DomainError extends Error {\n props: ApiCommonError\n\n constructor(message: string) {\n super(message)\n this.props = {\n code: 400,\n errorCode: ApiErrorEnum.DOMAIN,\n message,\n occurredAt: new Date(),\n }\n }\n}\n"],"mappings":";;;;AAsBO,IAAKA,eAAAA,yBAAAA,eAAAA;;;;;;SAAAA;;;;ACpBZ,IAAqBC,cAArB,cAAyCC,MAAAA;EAFzC,OAEyCA;;;EACvCC;EAEAC,YAAYC,SAAiB;AAC3B,UAAMA,OAAAA;AACN,SAAKF,QAAQ;MACXG,MAAM;MACNC,WAAWC,aAAaC;MACxBJ;MACAK,YAAY,oBAAIC,KAAAA;IAClB;EACF;AACF;","names":["ApiErrorEnum","DomainError","Error","props","constructor","message","code","errorCode","ApiErrorEnum","DOMAIN","occurredAt","Date"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
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/errors/http-client-error.ts
|
|
22
|
+
var http_client_error_exports = {};
|
|
23
|
+
__export(http_client_error_exports, {
|
|
24
|
+
default: () => HttpClientError
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(http_client_error_exports);
|
|
27
|
+
|
|
28
|
+
// src/core/errors/api-common-error.ts
|
|
29
|
+
var ApiErrorEnum = /* @__PURE__ */ function(ApiErrorEnum2) {
|
|
30
|
+
ApiErrorEnum2["DOMAIN"] = "ERR001";
|
|
31
|
+
ApiErrorEnum2["APPLICATION"] = "ERR002";
|
|
32
|
+
ApiErrorEnum2["INFRA"] = "ERR003";
|
|
33
|
+
ApiErrorEnum2["HTTP_CLIENT"] = "ERR004";
|
|
34
|
+
ApiErrorEnum2["VALIDATOR"] = "ERR005";
|
|
35
|
+
return ApiErrorEnum2;
|
|
36
|
+
}({});
|
|
37
|
+
|
|
38
|
+
// src/core/errors/http-client-error.ts
|
|
39
|
+
var HttpClientError = class extends Error {
|
|
40
|
+
static {
|
|
41
|
+
__name(this, "HttpClientError");
|
|
42
|
+
}
|
|
43
|
+
props;
|
|
44
|
+
constructor(message) {
|
|
45
|
+
super(message);
|
|
46
|
+
this.props = {
|
|
47
|
+
code: 400,
|
|
48
|
+
errorCode: ApiErrorEnum.HTTP_CLIENT,
|
|
49
|
+
message: message || "Request error",
|
|
50
|
+
occurredAt: /* @__PURE__ */ new Date()
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=http-client-error.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors/http-client-error.ts","../../../src/core/errors/api-common-error.ts"],"sourcesContent":["import { type ApiCommonError, ApiErrorEnum } from './api-common-error'\n\nexport default class HttpClientError extends Error {\n props: ApiCommonError\n\n constructor(message?: string) {\n super(message)\n this.props = {\n code: 400,\n errorCode: ApiErrorEnum.HTTP_CLIENT,\n message: message || 'Request error',\n occurredAt: new Date(),\n }\n }\n}\n","export type PropertiesError = {\n receivedValue?: any\n type: string\n message: string\n property: string | number | undefined\n propertyType?: string\n path?: string\n}\n\nexport type CommonError = {\n location: string\n propertyErrors?: PropertiesError[]\n}\n\nexport type ApiCommonError = {\n code: number\n occurredAt: Date\n message: string\n errorCode: string\n errors?: CommonError[]\n}\n\nexport enum ApiErrorEnum {\n DOMAIN = 'ERR001',\n APPLICATION = 'ERR002',\n INFRA = 'ERR003',\n HTTP_CLIENT = 'ERR004',\n VALIDATOR = 'ERR005',\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACsBO,IAAKA,eAAAA,yBAAAA,eAAAA;;;;;;SAAAA;;;;ADpBZ,IAAqBC,kBAArB,cAA6CC,MAAAA;EAF7C,OAE6CA;;;EAC3CC;EAEAC,YAAYC,SAAkB;AAC5B,UAAMA,OAAAA;AACN,SAAKF,QAAQ;MACXG,MAAM;MACNC,WAAWC,aAAaC;MACxBJ,SAASA,WAAW;MACpBK,YAAY,oBAAIC,KAAAA;IAClB;EACF;AACF;","names":["ApiErrorEnum","HttpClientError","Error","props","constructor","message","code","errorCode","ApiErrorEnum","HTTP_CLIENT","occurredAt","Date"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/core/errors/api-common-error.ts
|
|
5
|
+
var ApiErrorEnum = /* @__PURE__ */ function(ApiErrorEnum2) {
|
|
6
|
+
ApiErrorEnum2["DOMAIN"] = "ERR001";
|
|
7
|
+
ApiErrorEnum2["APPLICATION"] = "ERR002";
|
|
8
|
+
ApiErrorEnum2["INFRA"] = "ERR003";
|
|
9
|
+
ApiErrorEnum2["HTTP_CLIENT"] = "ERR004";
|
|
10
|
+
ApiErrorEnum2["VALIDATOR"] = "ERR005";
|
|
11
|
+
return ApiErrorEnum2;
|
|
12
|
+
}({});
|
|
13
|
+
|
|
14
|
+
// src/core/errors/http-client-error.ts
|
|
15
|
+
var HttpClientError = class extends Error {
|
|
16
|
+
static {
|
|
17
|
+
__name(this, "HttpClientError");
|
|
18
|
+
}
|
|
19
|
+
props;
|
|
20
|
+
constructor(message) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.props = {
|
|
23
|
+
code: 400,
|
|
24
|
+
errorCode: ApiErrorEnum.HTTP_CLIENT,
|
|
25
|
+
message: message || "Request error",
|
|
26
|
+
occurredAt: /* @__PURE__ */ new Date()
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
HttpClientError as default
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=http-client-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors/api-common-error.ts","../../../src/core/errors/http-client-error.ts"],"sourcesContent":["export type PropertiesError = {\n receivedValue?: any\n type: string\n message: string\n property: string | number | undefined\n propertyType?: string\n path?: string\n}\n\nexport type CommonError = {\n location: string\n propertyErrors?: PropertiesError[]\n}\n\nexport type ApiCommonError = {\n code: number\n occurredAt: Date\n message: string\n errorCode: string\n errors?: CommonError[]\n}\n\nexport enum ApiErrorEnum {\n DOMAIN = 'ERR001',\n APPLICATION = 'ERR002',\n INFRA = 'ERR003',\n HTTP_CLIENT = 'ERR004',\n VALIDATOR = 'ERR005',\n}\n","import { type ApiCommonError, ApiErrorEnum } from './api-common-error'\n\nexport default class HttpClientError extends Error {\n props: ApiCommonError\n\n constructor(message?: string) {\n super(message)\n this.props = {\n code: 400,\n errorCode: ApiErrorEnum.HTTP_CLIENT,\n message: message || 'Request error',\n occurredAt: new Date(),\n }\n }\n}\n"],"mappings":";;;;AAsBO,IAAKA,eAAAA,yBAAAA,eAAAA;;;;;;SAAAA;;;;ACpBZ,IAAqBC,kBAArB,cAA6CC,MAAAA;EAF7C,OAE6CA;;;EAC3CC;EAEAC,YAAYC,SAAkB;AAC5B,UAAMA,OAAAA;AACN,SAAKF,QAAQ;MACXG,MAAM;MACNC,WAAWC,aAAaC;MACxBJ,SAASA,WAAW;MACpBK,YAAY,oBAAIC,KAAAA;IAClB;EACF;AACF;","names":["ApiErrorEnum","HttpClientError","Error","props","constructor","message","code","errorCode","ApiErrorEnum","HTTP_CLIENT","occurredAt","Date"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
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/errors/infra-error.ts
|
|
22
|
+
var infra_error_exports = {};
|
|
23
|
+
__export(infra_error_exports, {
|
|
24
|
+
default: () => InfraError
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(infra_error_exports);
|
|
27
|
+
|
|
28
|
+
// src/core/errors/api-common-error.ts
|
|
29
|
+
var ApiErrorEnum = /* @__PURE__ */ function(ApiErrorEnum2) {
|
|
30
|
+
ApiErrorEnum2["DOMAIN"] = "ERR001";
|
|
31
|
+
ApiErrorEnum2["APPLICATION"] = "ERR002";
|
|
32
|
+
ApiErrorEnum2["INFRA"] = "ERR003";
|
|
33
|
+
ApiErrorEnum2["HTTP_CLIENT"] = "ERR004";
|
|
34
|
+
ApiErrorEnum2["VALIDATOR"] = "ERR005";
|
|
35
|
+
return ApiErrorEnum2;
|
|
36
|
+
}({});
|
|
37
|
+
|
|
38
|
+
// src/core/errors/infra-error.ts
|
|
39
|
+
var InfraError = class extends Error {
|
|
40
|
+
static {
|
|
41
|
+
__name(this, "InfraError");
|
|
42
|
+
}
|
|
43
|
+
props;
|
|
44
|
+
constructor(message) {
|
|
45
|
+
super(message);
|
|
46
|
+
this.props = {
|
|
47
|
+
code: 400,
|
|
48
|
+
errorCode: ApiErrorEnum.INFRA,
|
|
49
|
+
message,
|
|
50
|
+
occurredAt: /* @__PURE__ */ new Date()
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=infra-error.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors/infra-error.ts","../../../src/core/errors/api-common-error.ts"],"sourcesContent":["import { type ApiCommonError, ApiErrorEnum } from './api-common-error'\n\nexport default class InfraError extends Error {\n props: ApiCommonError\n\n constructor(message: string) {\n super(message)\n this.props = {\n code: 400,\n errorCode: ApiErrorEnum.INFRA,\n message,\n occurredAt: new Date(),\n }\n }\n}\n","export type PropertiesError = {\n receivedValue?: any\n type: string\n message: string\n property: string | number | undefined\n propertyType?: string\n path?: string\n}\n\nexport type CommonError = {\n location: string\n propertyErrors?: PropertiesError[]\n}\n\nexport type ApiCommonError = {\n code: number\n occurredAt: Date\n message: string\n errorCode: string\n errors?: CommonError[]\n}\n\nexport enum ApiErrorEnum {\n DOMAIN = 'ERR001',\n APPLICATION = 'ERR002',\n INFRA = 'ERR003',\n HTTP_CLIENT = 'ERR004',\n VALIDATOR = 'ERR005',\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACsBO,IAAKA,eAAAA,yBAAAA,eAAAA;;;;;;SAAAA;;;;ADpBZ,IAAqBC,aAArB,cAAwCC,MAAAA;EAFxC,OAEwCA;;;EACtCC;EAEAC,YAAYC,SAAiB;AAC3B,UAAMA,OAAAA;AACN,SAAKF,QAAQ;MACXG,MAAM;MACNC,WAAWC,aAAaC;MACxBJ;MACAK,YAAY,oBAAIC,KAAAA;IAClB;EACF;AACF;","names":["ApiErrorEnum","InfraError","Error","props","constructor","message","code","errorCode","ApiErrorEnum","INFRA","occurredAt","Date"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/core/errors/api-common-error.ts
|
|
5
|
+
var ApiErrorEnum = /* @__PURE__ */ function(ApiErrorEnum2) {
|
|
6
|
+
ApiErrorEnum2["DOMAIN"] = "ERR001";
|
|
7
|
+
ApiErrorEnum2["APPLICATION"] = "ERR002";
|
|
8
|
+
ApiErrorEnum2["INFRA"] = "ERR003";
|
|
9
|
+
ApiErrorEnum2["HTTP_CLIENT"] = "ERR004";
|
|
10
|
+
ApiErrorEnum2["VALIDATOR"] = "ERR005";
|
|
11
|
+
return ApiErrorEnum2;
|
|
12
|
+
}({});
|
|
13
|
+
|
|
14
|
+
// src/core/errors/infra-error.ts
|
|
15
|
+
var InfraError = class extends Error {
|
|
16
|
+
static {
|
|
17
|
+
__name(this, "InfraError");
|
|
18
|
+
}
|
|
19
|
+
props;
|
|
20
|
+
constructor(message) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.props = {
|
|
23
|
+
code: 400,
|
|
24
|
+
errorCode: ApiErrorEnum.INFRA,
|
|
25
|
+
message,
|
|
26
|
+
occurredAt: /* @__PURE__ */ new Date()
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
InfraError as default
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=infra-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors/api-common-error.ts","../../../src/core/errors/infra-error.ts"],"sourcesContent":["export type PropertiesError = {\n receivedValue?: any\n type: string\n message: string\n property: string | number | undefined\n propertyType?: string\n path?: string\n}\n\nexport type CommonError = {\n location: string\n propertyErrors?: PropertiesError[]\n}\n\nexport type ApiCommonError = {\n code: number\n occurredAt: Date\n message: string\n errorCode: string\n errors?: CommonError[]\n}\n\nexport enum ApiErrorEnum {\n DOMAIN = 'ERR001',\n APPLICATION = 'ERR002',\n INFRA = 'ERR003',\n HTTP_CLIENT = 'ERR004',\n VALIDATOR = 'ERR005',\n}\n","import { type ApiCommonError, ApiErrorEnum } from './api-common-error'\n\nexport default class InfraError extends Error {\n props: ApiCommonError\n\n constructor(message: string) {\n super(message)\n this.props = {\n code: 400,\n errorCode: ApiErrorEnum.INFRA,\n message,\n occurredAt: new Date(),\n }\n }\n}\n"],"mappings":";;;;AAsBO,IAAKA,eAAAA,yBAAAA,eAAAA;;;;;;SAAAA;;;;ACpBZ,IAAqBC,aAArB,cAAwCC,MAAAA;EAFxC,OAEwCA;;;EACtCC;EAEAC,YAAYC,SAAiB;AAC3B,UAAMA,OAAAA;AACN,SAAKF,QAAQ;MACXG,MAAM;MACNC,WAAWC,aAAaC;MACxBJ;MACAK,YAAY,oBAAIC,KAAAA;IAClB;EACF;AACF;","names":["ApiErrorEnum","InfraError","Error","props","constructor","message","code","errorCode","ApiErrorEnum","INFRA","occurredAt","Date"]}
|