@riocrypto/common 1.0.348 → 1.0.350

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.
@@ -0,0 +1,8 @@
1
+ import { CustomError } from "./custom-error";
2
+ export declare class AdminAlreadyExistsError extends CustomError {
3
+ statusCode: number;
4
+ constructor();
5
+ serializeErrors(): {
6
+ message: string;
7
+ }[];
8
+ }
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AdminExistsError = void 0;
3
+ exports.AdminAlreadyExistsError = void 0;
4
4
  const custom_error_1 = require("./custom-error");
5
- class AdminExistsError extends custom_error_1.CustomError {
5
+ class AdminAlreadyExistsError extends custom_error_1.CustomError {
6
6
  constructor() {
7
7
  super("Admin with provided email already exists");
8
8
  this.statusCode = 409;
9
- Object.setPrototypeOf(this, AdminExistsError.prototype);
9
+ Object.setPrototypeOf(this, AdminAlreadyExistsError.prototype);
10
10
  }
11
11
  serializeErrors() {
12
12
  return [{ message: "Admin with provided email already exists" }];
13
13
  }
14
14
  }
15
- exports.AdminExistsError = AdminExistsError;
15
+ exports.AdminAlreadyExistsError = AdminAlreadyExistsError;
@@ -1,5 +1,5 @@
1
1
  import { CustomError } from "./custom-error";
2
- export declare class AdminExistsError extends CustomError {
2
+ export declare class AdminNotFoundError extends CustomError {
3
3
  statusCode: number;
4
4
  constructor();
5
5
  serializeErrors(): {
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminNotFoundError = void 0;
4
+ const custom_error_1 = require("./custom-error");
5
+ class AdminNotFoundError extends custom_error_1.CustomError {
6
+ constructor() {
7
+ super("Admin not found");
8
+ this.statusCode = 404;
9
+ Object.setPrototypeOf(this, AdminNotFoundError.prototype);
10
+ }
11
+ serializeErrors() {
12
+ return [{ message: "Admin not found" }];
13
+ }
14
+ }
15
+ exports.AdminNotFoundError = AdminNotFoundError;
package/build/index.d.ts CHANGED
@@ -8,7 +8,8 @@ export * from "./errors/user-already-exists-error";
8
8
  export * from "./errors/not-authorized-error";
9
9
  export * from "./errors/wrong-processor-error";
10
10
  export * from "./errors/authorization-failed-error";
11
- export * from "./errors/admin-exists-error";
11
+ export * from "./errors/admin-already-exists-error";
12
+ export * from "./errors/admin-not-found-error";
12
13
  export * from "./middlewares/error-handler";
13
14
  export * from "./middlewares/validate-request";
14
15
  export * from "./middlewares/current-auth";
package/build/index.js CHANGED
@@ -24,7 +24,8 @@ __exportStar(require("./errors/user-already-exists-error"), exports);
24
24
  __exportStar(require("./errors/not-authorized-error"), exports);
25
25
  __exportStar(require("./errors/wrong-processor-error"), exports);
26
26
  __exportStar(require("./errors/authorization-failed-error"), exports);
27
- __exportStar(require("./errors/admin-exists-error"), exports);
27
+ __exportStar(require("./errors/admin-already-exists-error"), exports);
28
+ __exportStar(require("./errors/admin-not-found-error"), exports);
28
29
  __exportStar(require("./middlewares/error-handler"), exports);
29
30
  __exportStar(require("./middlewares/validate-request"), exports);
30
31
  __exportStar(require("./middlewares/current-auth"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.348",
3
+ "version": "1.0.350",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",