@nest-yalc-2/errors 2.0.0 → 2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nest-yalc-2/errors",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "./src/index.js",
@@ -17,10 +17,10 @@
17
17
  "src"
18
18
  ],
19
19
  "dependencies": {
20
- "@nest-yalc-2/crud-gen": "^2.0.0",
21
- "@nest-yalc-2/event-manager": "^2.0.0",
22
- "@nest-yalc-2/logger": "^2.0.0",
23
- "@nest-yalc-2/utils": "^2.0.0",
20
+ "@nest-yalc-2/crud-gen": "^2.1.0",
21
+ "@nest-yalc-2/event-manager": "^2.1.0",
22
+ "@nest-yalc-2/logger": "^2.1.0",
23
+ "@nest-yalc-2/utils": "^2.1.0",
24
24
  "axios": "^1.15.0",
25
25
  "neverthrow": "^8.2.0",
26
26
  "tslib": "^2.6.3"
@@ -16,7 +16,7 @@ import {
16
16
  } from '@nestjs/common';
17
17
  import { EntityTarget } from 'typeorm';
18
18
  import { ConnectionNotFoundError, EntityNotFoundError } from 'typeorm';
19
- import { ExceptionContextEnum } from '@node-yalc/errors/error.enum.js';
19
+ import { ExceptionContextEnum } from '@node-yalc/errors/error.enum';
20
20
  import { DatabaseExceptionFilter } from '../filters/database-exception.filter.js';
21
21
 
22
22
  import { GqlArgumentsHost } from '@nestjs/graphql';
@@ -17,7 +17,7 @@ import {
17
17
  HttpException,
18
18
  HttpStatus,
19
19
  } from '@nestjs/common';
20
- import { getHttpStatusDescription } from '@node-yalc/utils/http.helper.js';
20
+ import { getHttpStatusDescription } from '@node-yalc/utils/http.helper';
21
21
 
22
22
  describe('DefaultErrorMixin', () => {
23
23
  it('should create a class that extends Error when no base class is provided', () => {
@@ -8,7 +8,7 @@ import {
8
8
  afterAll,
9
9
  afterEach,
10
10
  } from '@jest/globals';
11
- import { ErrorsEnum, ExceptionContextEnum } from '@node-yalc/errors/error.enum.js';
11
+ import { ErrorsEnum, ExceptionContextEnum } from '@node-yalc/errors/error.enum';
12
12
 
13
13
  describe('errors enum test', () => {
14
14
  it('ErrorsEnum should have all the values', () => {
@@ -1,4 +1,4 @@
1
- import { HttpStatusCodes } from '@node-yalc/utils/http.helper.js';
1
+ import { HttpStatusCodes } from '@node-yalc/utils/http.helper';
2
2
  import { httpStatusCodeToErrors } from '../http-status-code-to-errors.js';
3
3
  import {
4
4
  BadRequestError,
@@ -9,7 +9,7 @@ import {
9
9
  afterEach,
10
10
  } from '@jest/globals';
11
11
  import { BadRequestError, InputValidationError } from '../error.class.js';
12
- import { ErrorsEnum } from '@node-yalc/errors/error.enum.js';
12
+ import { ErrorsEnum } from '@node-yalc/errors/error.enum';
13
13
 
14
14
  describe('InputValidationError', () => {
15
15
  it('should have internal message without the custom message', () => {
@@ -1,5 +1,5 @@
1
1
  import { expect, describe, it } from '@jest/globals';
2
- import { ErrorsEnum } from '@node-yalc/errors/error.enum.js';
2
+ import { ErrorsEnum } from '@node-yalc/errors/error.enum';
3
3
  import { LoginError } from '../index.js';
4
4
 
5
5
  describe('Login error', () => {
@@ -11,7 +11,7 @@ import {
11
11
  import { createMock } from '@golevelup/ts-jest';
12
12
  import { LoggerService, UnprocessableEntityException } from '@nestjs/common';
13
13
 
14
- import { ExceptionContextEnum } from '@node-yalc/errors/error.enum.js';
14
+ import { ExceptionContextEnum } from '@node-yalc/errors/error.enum';
15
15
  import { SystemExceptionFilter } from '../filters/system-exception.filter.js';
16
16
 
17
17
  describe('System exceptions filter', () => {
@@ -2,7 +2,7 @@ import { expect, describe, it } from '@jest/globals';
2
2
  import {
3
3
  getHttpStatusDescription,
4
4
  HttpStatusCodes,
5
- } from '@node-yalc/utils/http.helper.js';
5
+ } from '@node-yalc/utils/http.helper';
6
6
  import { HttpException } from '@nestjs/common';
7
7
  import { AdditionalVerificationNeededError } from '../index.js';
8
8
 
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const graphql_1 = require("@nestjs/graphql");
6
6
  const common = tslib_1.__importStar(require("@nestjs/common"));
7
7
  const typeorm_1 = require("typeorm");
8
- const error_enum_js_1 = require("@node-yalc/errors/error.enum.js");
8
+ const error_enum_1 = require("@node-yalc/errors/error.enum");
9
9
  let DatabaseExceptionFilter = class DatabaseExceptionFilter {
10
10
  constructor(logger) {
11
11
  this.logger = logger;
@@ -15,11 +15,11 @@ let DatabaseExceptionFilter = class DatabaseExceptionFilter {
15
15
  gqlHost.getType();
16
16
  switch (true) {
17
17
  case error instanceof typeorm_1.EntityNotFoundError:
18
- this.logger.error(error, error_enum_js_1.ExceptionContextEnum.DATABASE);
18
+ this.logger.error(error, error_enum_1.ExceptionContextEnum.DATABASE);
19
19
  error = new common.InternalServerErrorException(error);
20
20
  break;
21
21
  default:
22
- this.logger.error(error, error.stack, error_enum_js_1.ExceptionContextEnum.DATABASE);
22
+ this.logger.error(error, error.stack, error_enum_1.ExceptionContextEnum.DATABASE);
23
23
  break;
24
24
  }
25
25
  return error;
@@ -1 +1 @@
1
- {"version":3,"file":"database-exception.filter.js","sourceRoot":"","sources":["database-exception.filter.ts"],"names":[],"mappings":";;;;AAAA,6CAAuE;AACvE,+DAAyC;AAEzC,qCAAuE;AACvE,mEAAuE;AAKhE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,KAAY,EAAE,IAA0B;QAC5C,MAAM,OAAO,GAAG,0BAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,CAAC,OAAO,EAAE,CAAC;QAWlB,QAAQ,IAAI,EAAE,CAAC;YAIb,KAAK,KAAK,YAAY,6BAAmB;gBACvC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,oCAAoB,CAAC,QAAQ,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AvB,uBAAuB;IADnC,MAAM,CAAC,KAAK,CAAC,6BAAmB,EAAE,iCAAuB,CAAC;;GAC9C,uBAAuB,CAmCnC"}
@@ -2,7 +2,7 @@ import { GqlExceptionFilter, GqlArgumentsHost } from '@nestjs/graphql';
2
2
  import * as common from '@nestjs/common';
3
3
  // We can import more errors from the typeorm/error folder if necessary, nothing is exported though, so use explicit paths.
4
4
  import { EntityNotFoundError, ConnectionNotFoundError } from 'typeorm';
5
- import { ExceptionContextEnum } from '@node-yalc/errors/error.enum.js';
5
+ import { ExceptionContextEnum } from '@node-yalc/errors/error.enum';
6
6
 
7
7
  import type { LoggerService } from '@nestjs/common';
8
8
 
@@ -5,7 +5,7 @@ import { DefaultErrorMixin, MissingArgumentsError } from '@nest-yalc-2/errors';
5
5
  import { FastifyReply as FResponse } from 'fastify';
6
6
  import { GqlError } from '@nest-yalc-2/graphql/plugins/gql.error.js';
7
7
  import { BaseExceptionFilter } from '@nestjs/core';
8
- import { type ImprovedLoggerService } from '@node-yalc/logger/logger-abstract.service.js';
8
+ import { type ImprovedLoggerService } from '@node-yalc/logger/logger-abstract.service';
9
9
  type HttpErrorType = common.HttpException | MissingArgumentsError | GqlError | DefaultErrorMixin;
10
10
  export declare class HttpExceptionFilter extends BaseExceptionFilter implements GqlExceptionFilter, common.ExceptionFilter {
11
11
  protected logger: ImprovedLoggerService;
@@ -8,7 +8,7 @@ const entity_error_js_1 = require("@nest-yalc-2/crud-gen/entity.error.js");
8
8
  const gql_error_js_1 = require("@nest-yalc-2/graphql/plugins/gql.error.js");
9
9
  const core_1 = require("@nestjs/core");
10
10
  const event_helper_js_1 = require("../../../event-manager/src/event.helper.js");
11
- const logger_enum_js_1 = require("@node-yalc/logger/logger.enum.js");
11
+ const logger_enum_1 = require("@node-yalc/logger/logger.enum");
12
12
  let HttpExceptionFilter = class HttpExceptionFilter extends core_1.BaseExceptionFilter {
13
13
  constructor(logger, applicationRef) {
14
14
  super(applicationRef);
@@ -44,7 +44,7 @@ let HttpExceptionFilter = class HttpExceptionFilter extends core_1.BaseException
44
44
  {
45
45
  const httpError = error;
46
46
  const logLevel = (0, event_helper_js_1.getLogLevelByStatus)(httpError.getStatus());
47
- if (logLevel === logger_enum_js_1.LogLevelEnum.ERROR) {
47
+ if (logLevel === logger_enum_1.LogLevelEnum.ERROR) {
48
48
  this.logger[logLevel](error.message, error.stack, {
49
49
  stack: httpError.stack,
50
50
  data: {
@@ -1 +1 @@
1
- {"version":3,"file":"http-exception.filter.js","sourceRoot":"","sources":["http-exception.filter.ts"],"names":[],"mappings":";;;;AACA,+DAAyC;AAEzC,gDAK6B;AAC7B,2EAG+C;AAE/C,4EAAqE;AACrE,uCAAmD;AACnD,gFAAiF;AACjF,qEAAgE;AAWzD,IAAM,mBAAmB,GAAzB,MAAM,mBACX,SAAQ,0BAAmB;IAG3B,YACY,MAA6B,EACvC,cAA2B;QAE3B,KAAK,CAAC,cAAc,CAAC,CAAC;QAHZ,WAAM,GAAN,MAAM,CAAuB;IAIzC,CAAC;IAED,KAAK,CACH,KAA4B,EAC5B,IAA0B,EAC1B,EAAE,YAAY,KAAgC,EAAE,YAAY,EAAE,IAAI,EAAE;QAEpE,IAAI,CAAC;YACH,MAAM,WAAW,GACf,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,MAAM,CAAC,aAAa,CAAC;YAEnE,QAAQ,IAAI,EAAE,CAAC;gBAEb,KAAK,KAAK,YAAY,8BAAqB;oBACzC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE;wBAC7B,KAAK,EAAE,KAAK,CAAC,KAAK;qBACnB,CAAC,CAAC;oBACH,MAAM;gBAER,KAAK,IAAA,4BAAmB,EAAC,KAAK,CAAC;oBAE7B,MAAM;gBAMR,KAAK,IAAA,+BAAa,EAAC,KAAK,CAAC;oBACvB,CAAC;wBACC,MAAM,WAAW,GAAG,KAAoB,CAAC;wBACzC,IAAI,CAAC,MAAM,CAAC,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AM;gBAGR;oBACE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE;wBAC5C,KAAK,EAAE,KAAK,CAAC,KAAK;wBAClB,IAAI,EAAE;4BACJ,KAAK,EAAE,IAAA,oBAAW,EAAC,KAAK,CAAC,KAAK,CAAC;4BAC/B,IAAI,EAAE,KAAK,CAAC,IAAI;yBACjB;qBACF,CAAC,CAAC;oBACH,MAAM;YACV,CAAC;YAED,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;gBAC9B,IAAI,YAAY,EAAE,CAAC;oBACjB,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;oBAChC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAa,CAAC;oBAC9C,IAAI,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC;oBACrD,IAAI,WAAW;wBAAE,MAAM,GAAI,KAA8B,CAAC,SAAS,EAAE,CAAC;oBACtE,OAAO,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACrD,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YAEX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AAnHY,kDAAmB;8BAAnB,mBAAmB;IAN/B,MAAM,CAAC,KAAK,CACX,MAAM,CAAC,aAAa,EACpB,8BAAqB,EACrB,uBAAQ,EACR,0BAAiB,CAClB;;GACY,mBAAmB,CAmH/B"}
@@ -15,8 +15,8 @@ import { FastifyReply as FResponse } from 'fastify';
15
15
  import { GqlError } from '@nest-yalc-2/graphql/plugins/gql.error.js';
16
16
  import { BaseExceptionFilter } from '@nestjs/core';
17
17
  import { getLogLevelByStatus } from '../../../event-manager/src/event.helper.js';
18
- import { LogLevelEnum } from '@node-yalc/logger/logger.enum.js';
19
- import { type ImprovedLoggerService } from '@node-yalc/logger/logger-abstract.service.js';
18
+ import { LogLevelEnum } from '@node-yalc/logger/logger.enum';
19
+ import { type ImprovedLoggerService } from '@node-yalc/logger/logger-abstract.service';
20
20
 
21
21
  type HttpErrorType =
22
22
  common.HttpException | MissingArgumentsError | GqlError | DefaultErrorMixin;
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SystemExceptionFilter = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const common_1 = require("@nestjs/common");
6
- const error_enum_js_1 = require("@node-yalc/errors/error.enum.js");
6
+ const error_enum_1 = require("@node-yalc/errors/error.enum");
7
7
  let SystemExceptionFilter = class SystemExceptionFilter {
8
8
  constructor(logger) {
9
9
  this.logger = logger;
10
10
  }
11
11
  catch(error) {
12
- this.logger.error(error, error.stack, error_enum_js_1.ExceptionContextEnum.SYSTEM);
12
+ this.logger.error(error, error.stack, error_enum_1.ExceptionContextEnum.SYSTEM);
13
13
  return error;
14
14
  }
15
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"system-exception.filter.js","sourceRoot":"","sources":["system-exception.filter.ts"],"names":[],"mappings":";;;;AAAA,2CAAwD;AAExD,mEAAuE;AAGhE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,KAAY;QAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,oCAAoB,CAAC,MAAM,CAAC,CAAC;QACnE,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AAPY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,cAAK,EAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,CAAC;;GACxD,qBAAqB,CAOjC"}
1
+ {"version":3,"file":"system-exception.filter.js","sourceRoot":"","sources":["system-exception.filter.ts"],"names":[],"mappings":";;;;AAAA,2CAAwD;AAExD,6DAAoE;AAG7D,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,KAAY;QAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,iCAAoB,CAAC,MAAM,CAAC,CAAC;QACnE,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AAPY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,cAAK,EAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,CAAC;;GACxD,qBAAqB,CAOjC"}
@@ -1,6 +1,6 @@
1
1
  import { Catch, ExceptionFilter } from '@nestjs/common';
2
2
  import type { LoggerService } from '@nestjs/common';
3
- import { ExceptionContextEnum } from '@node-yalc/errors/error.enum.js';
3
+ import { ExceptionContextEnum } from '@node-yalc/errors/error.enum';
4
4
 
5
5
  @Catch(TypeError, SyntaxError, RangeError, EvalError, ReferenceError)
6
6
  export class SystemExceptionFilter implements ExceptionFilter {
package/src/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  export { MissingArgumentsError } from '@nest-yalc-2/crud-gen';
2
- export * from '@node-yalc/errors';
2
+ export * from '@node-yalc/errors/error.enum';
3
+ export * from '@node-yalc/errors/error.class';
4
+ export * from '@node-yalc/errors/default.error';
5
+ export * from '@node-yalc/errors/result.error';
3
6
  export * from './filters/index.js';
package/src/index.js CHANGED
@@ -4,6 +4,9 @@ exports.MissingArgumentsError = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  var crud_gen_1 = require("@nest-yalc-2/crud-gen");
6
6
  Object.defineProperty(exports, "MissingArgumentsError", { enumerable: true, get: function () { return crud_gen_1.MissingArgumentsError; } });
7
- tslib_1.__exportStar(require("@node-yalc/errors"), exports);
7
+ tslib_1.__exportStar(require("@node-yalc/errors/error.enum"), exports);
8
+ tslib_1.__exportStar(require("@node-yalc/errors/error.class"), exports);
9
+ tslib_1.__exportStar(require("@node-yalc/errors/default.error"), exports);
10
+ tslib_1.__exportStar(require("@node-yalc/errors/result.error"), exports);
8
11
  tslib_1.__exportStar(require("./filters/index.js"), exports);
9
12
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAEA,kDAA8D;AAArD,iHAAA,qBAAqB,OAAA;AAC9B,4DAAkC;AAClC,6DAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAEA,kDAA8D;AAArD,iHAAA,qBAAqB,OAAA;AAC9B,uEAA6C;AAC7C,wEAA8C;AAC9C,0EAAgD;AAChD,yEAA+C;AAC/C,6DAAmC"}
package/src/index.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  /* istanbul ignore file */
2
2
 
3
3
  export { MissingArgumentsError } from '@nest-yalc-2/crud-gen';
4
- export * from '@node-yalc/errors';
4
+ export * from '@node-yalc/errors/error.enum';
5
+ export * from '@node-yalc/errors/error.class';
6
+ export * from '@node-yalc/errors/default.error';
7
+ export * from '@node-yalc/errors/result.error';
5
8
  export * from './filters/index.js';