@riocrypto/common 1.0.365 → 1.0.367

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.
@@ -1,5 +1,5 @@
1
1
  import { CustomError } from "./custom-error";
2
- export declare class APIKeyNotFound extends CustomError {
2
+ export declare class APIKeyNotFoundError extends CustomError {
3
3
  statusCode: number;
4
4
  constructor();
5
5
  serializeErrors(): {
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.APIKeyNotFound = void 0;
3
+ exports.APIKeyNotFoundError = void 0;
4
4
  const custom_error_1 = require("./custom-error");
5
- class APIKeyNotFound extends custom_error_1.CustomError {
5
+ class APIKeyNotFoundError extends custom_error_1.CustomError {
6
6
  constructor() {
7
7
  super("API key not found");
8
8
  this.statusCode = 404;
9
- Object.setPrototypeOf(this, APIKeyNotFound.prototype);
9
+ Object.setPrototypeOf(this, APIKeyNotFoundError.prototype);
10
10
  }
11
11
  serializeErrors() {
12
12
  return [{ message: "API key not found" }];
13
13
  }
14
14
  }
15
- exports.APIKeyNotFound = APIKeyNotFound;
15
+ exports.APIKeyNotFoundError = APIKeyNotFoundError;
@@ -0,0 +1,8 @@
1
+ import { CustomError } from "./custom-error";
2
+ export declare class MissingKYCApprovalError extends CustomError {
3
+ statusCode: number;
4
+ constructor();
5
+ serializeErrors(): {
6
+ message: string;
7
+ }[];
8
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MissingKYCApprovalError = void 0;
4
+ const custom_error_1 = require("./custom-error");
5
+ class MissingKYCApprovalError extends custom_error_1.CustomError {
6
+ constructor() {
7
+ super("KYC status is not approved");
8
+ this.statusCode = 400;
9
+ Object.setPrototypeOf(this, MissingKYCApprovalError.prototype);
10
+ }
11
+ serializeErrors() {
12
+ return [{ message: "KYC status is not approved" }];
13
+ }
14
+ }
15
+ exports.MissingKYCApprovalError = MissingKYCApprovalError;
@@ -0,0 +1,8 @@
1
+ import { CustomError } from "./custom-error";
2
+ export declare class MissingUserError extends CustomError {
3
+ statusCode: number;
4
+ constructor();
5
+ serializeErrors(): {
6
+ message: string;
7
+ }[];
8
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MissingUserError = void 0;
4
+ const custom_error_1 = require("./custom-error");
5
+ class MissingUserError extends custom_error_1.CustomError {
6
+ constructor() {
7
+ super("Auth is not registered to a user");
8
+ this.statusCode = 400;
9
+ Object.setPrototypeOf(this, MissingUserError.prototype);
10
+ }
11
+ serializeErrors() {
12
+ return [{ message: "Auth is not registered to a user" }];
13
+ }
14
+ }
15
+ exports.MissingUserError = MissingUserError;
package/build/index.d.ts CHANGED
@@ -17,6 +17,8 @@ export * from "./errors/auth-not-found-error";
17
17
  export * from "./errors/missing-password-error";
18
18
  export * from "./errors/missing-security-question-error";
19
19
  export * from "./errors/api-key-not-found-error";
20
+ export * from "./errors/missing-user-error";
21
+ export * from "./errors/missing-kyc-approval-error";
20
22
  export * from "./middlewares/error-handler";
21
23
  export * from "./middlewares/validate-request";
22
24
  export * from "./middlewares/current-auth";
package/build/index.js CHANGED
@@ -33,6 +33,8 @@ __exportStar(require("./errors/auth-not-found-error"), exports);
33
33
  __exportStar(require("./errors/missing-password-error"), exports);
34
34
  __exportStar(require("./errors/missing-security-question-error"), exports);
35
35
  __exportStar(require("./errors/api-key-not-found-error"), exports);
36
+ __exportStar(require("./errors/missing-user-error"), exports);
37
+ __exportStar(require("./errors/missing-kyc-approval-error"), exports);
36
38
  __exportStar(require("./middlewares/error-handler"), exports);
37
39
  __exportStar(require("./middlewares/validate-request"), exports);
38
40
  __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.365",
3
+ "version": "1.0.367",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",