@riocrypto/common 1.0.780 → 1.0.782

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,11 @@
1
+ import { CustomError } from "./custom-error";
2
+ export declare class GenericInputError extends CustomError {
3
+ private customMessage?;
4
+ statusCode: number;
5
+ internalCode: number;
6
+ constructor(customMessage?: string | undefined);
7
+ serializeErrors(): {
8
+ code: number;
9
+ message: string;
10
+ }[];
11
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GenericInputError = void 0;
4
+ const custom_error_1 = require("./custom-error");
5
+ class GenericInputError extends custom_error_1.CustomError {
6
+ constructor(customMessage) {
7
+ super(customMessage || "Unknown input error");
8
+ this.customMessage = customMessage;
9
+ this.statusCode = 400;
10
+ this.internalCode = 39;
11
+ Object.setPrototypeOf(this, GenericInputError.prototype);
12
+ }
13
+ serializeErrors() {
14
+ return [
15
+ {
16
+ code: this.internalCode,
17
+ message: this.customMessage || "Unknown input error",
18
+ },
19
+ ];
20
+ }
21
+ }
22
+ exports.GenericInputError = GenericInputError;
@@ -0,0 +1,11 @@
1
+ import { CustomError } from "./custom-error";
2
+ export declare class GenericInternalError extends CustomError {
3
+ private customMessage?;
4
+ statusCode: number;
5
+ internalCode: number;
6
+ constructor(customMessage?: string | undefined);
7
+ serializeErrors(): {
8
+ code: number;
9
+ message: string;
10
+ }[];
11
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GenericInternalError = void 0;
4
+ const custom_error_1 = require("./custom-error");
5
+ class GenericInternalError extends custom_error_1.CustomError {
6
+ constructor(customMessage) {
7
+ super(customMessage || "Unknown internal error");
8
+ this.customMessage = customMessage;
9
+ this.statusCode = 500;
10
+ this.internalCode = 40;
11
+ Object.setPrototypeOf(this, GenericInternalError.prototype);
12
+ }
13
+ serializeErrors() {
14
+ return [
15
+ {
16
+ code: this.internalCode,
17
+ message: this.customMessage || "Unknown internal error",
18
+ },
19
+ ];
20
+ }
21
+ }
22
+ exports.GenericInternalError = GenericInternalError;
@@ -0,0 +1,10 @@
1
+ import { CustomError } from "./custom-error";
2
+ export declare class InvalidRefreshTokenError extends CustomError {
3
+ statusCode: number;
4
+ internalCode: number;
5
+ constructor();
6
+ serializeErrors(): {
7
+ code: number;
8
+ message: string;
9
+ }[];
10
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvalidRefreshTokenError = void 0;
4
+ const custom_error_1 = require("./custom-error");
5
+ class InvalidRefreshTokenError extends custom_error_1.CustomError {
6
+ constructor() {
7
+ super("Invalid refresh token");
8
+ this.statusCode = 400;
9
+ this.internalCode = 37;
10
+ Object.setPrototypeOf(this, InvalidRefreshTokenError.prototype);
11
+ }
12
+ serializeErrors() {
13
+ return [
14
+ {
15
+ code: this.internalCode,
16
+ message: "Invalid refresh token",
17
+ },
18
+ ];
19
+ }
20
+ }
21
+ exports.InvalidRefreshTokenError = InvalidRefreshTokenError;
@@ -0,0 +1,10 @@
1
+ import { CustomError } from "./custom-error";
2
+ export declare class SecretManagerError extends CustomError {
3
+ statusCode: number;
4
+ internalCode: number;
5
+ constructor();
6
+ serializeErrors(): {
7
+ code: number;
8
+ message: string;
9
+ }[];
10
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SecretManagerError = void 0;
4
+ const custom_error_1 = require("./custom-error");
5
+ class SecretManagerError extends custom_error_1.CustomError {
6
+ constructor() {
7
+ super("Internal error");
8
+ this.statusCode = 500;
9
+ this.internalCode = 38;
10
+ Object.setPrototypeOf(this, SecretManagerError.prototype);
11
+ }
12
+ serializeErrors() {
13
+ return [
14
+ {
15
+ code: this.internalCode,
16
+ message: "Internal errror",
17
+ },
18
+ ];
19
+ }
20
+ }
21
+ exports.SecretManagerError = SecretManagerError;
@@ -0,0 +1,10 @@
1
+ import { CustomError } from "./custom-error";
2
+ export declare class UnavailableInSandboxError extends CustomError {
3
+ statusCode: number;
4
+ internalCode: number;
5
+ constructor();
6
+ serializeErrors(): {
7
+ code: number;
8
+ message: string;
9
+ }[];
10
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UnavailableInSandboxError = void 0;
4
+ const custom_error_1 = require("./custom-error");
5
+ class UnavailableInSandboxError extends custom_error_1.CustomError {
6
+ constructor() {
7
+ super("This endpoint is not available in sandbox");
8
+ this.statusCode = 501;
9
+ this.internalCode = 36;
10
+ Object.setPrototypeOf(this, UnavailableInSandboxError.prototype);
11
+ }
12
+ serializeErrors() {
13
+ return [
14
+ {
15
+ code: this.internalCode,
16
+ message: "This endpoint is not available in sandbox",
17
+ },
18
+ ];
19
+ }
20
+ }
21
+ exports.UnavailableInSandboxError = UnavailableInSandboxError;
package/build/index.d.ts CHANGED
@@ -34,6 +34,11 @@ export * from "./errors/partner-auth-already-exists-error";
34
34
  export * from "./errors/partner-auth-not-found-error";
35
35
  export * from "./errors/missing-cpf-error";
36
36
  export * from "./errors/active-sell-order-error";
37
+ export * from "./errors/unavailable-in-sandbox-error";
38
+ export * from "./errors/generic-input-error";
39
+ export * from "./errors/generic-internal-error";
40
+ export * from "./errors/invalid-refresh-token-error";
41
+ export * from "./errors/secret-manager-error";
37
42
  export * from "./events/base-listener";
38
43
  export * from "./events/base-publisher";
39
44
  export * from "./events/subjects";
package/build/index.js CHANGED
@@ -50,6 +50,11 @@ __exportStar(require("./errors/partner-auth-already-exists-error"), exports);
50
50
  __exportStar(require("./errors/partner-auth-not-found-error"), exports);
51
51
  __exportStar(require("./errors/missing-cpf-error"), exports);
52
52
  __exportStar(require("./errors/active-sell-order-error"), exports);
53
+ __exportStar(require("./errors/unavailable-in-sandbox-error"), exports);
54
+ __exportStar(require("./errors/generic-input-error"), exports);
55
+ __exportStar(require("./errors/generic-internal-error"), exports);
56
+ __exportStar(require("./errors/invalid-refresh-token-error"), exports);
57
+ __exportStar(require("./errors/secret-manager-error"), exports);
53
58
  __exportStar(require("./events/base-listener"), exports);
54
59
  __exportStar(require("./events/base-publisher"), exports);
55
60
  __exportStar(require("./events/subjects"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.780",
3
+ "version": "1.0.782",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",