@fiado/type-kit 3.4.0 → 3.5.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/bin/collector/enums/CollectorErrorCodeEnum.d.ts +22 -0
- package/bin/collector/enums/CollectorErrorCodeEnum.js +37 -0
- package/bin/collector/index.d.ts +1 -0
- package/bin/collector/index.js +1 -0
- package/package.json +1 -1
- package/src/collector/enums/CollectorErrorCodeEnum.ts +34 -0
- package/src/collector/index.ts +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Códigos estandarizados de errores del Collector API.
|
|
3
|
+
* Spec: PROCESO_05_COBRANZA.md §13.1
|
|
4
|
+
*/
|
|
5
|
+
export declare enum CollectorErrorCodeEnum {
|
|
6
|
+
INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
|
|
7
|
+
WALLET_FROZEN = "WALLET_FROZEN",
|
|
8
|
+
INVALID_DIRECTORY = "INVALID_DIRECTORY",
|
|
9
|
+
RATE_LIMIT = "RATE_LIMIT",
|
|
10
|
+
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
11
|
+
TIMEOUT = "TIMEOUT",
|
|
12
|
+
CONTRACT_FAILED = "CONTRACT_FAILED",
|
|
13
|
+
CONVERSION_ERROR = "CONVERSION_ERROR",
|
|
14
|
+
PARTIAL_FREEZE = "PARTIAL_FREEZE"
|
|
15
|
+
}
|
|
16
|
+
export declare enum CollectorErrorSeverityEnum {
|
|
17
|
+
CRITICAL = "CRITICAL",
|
|
18
|
+
HIGH = "HIGH",
|
|
19
|
+
MEDIUM = "MEDIUM",
|
|
20
|
+
LOW = "LOW"
|
|
21
|
+
}
|
|
22
|
+
export declare const DEFAULT_SEVERITY_BY_CODE: Record<CollectorErrorCodeEnum, CollectorErrorSeverityEnum>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_SEVERITY_BY_CODE = exports.CollectorErrorSeverityEnum = exports.CollectorErrorCodeEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Códigos estandarizados de errores del Collector API.
|
|
6
|
+
* Spec: PROCESO_05_COBRANZA.md §13.1
|
|
7
|
+
*/
|
|
8
|
+
var CollectorErrorCodeEnum;
|
|
9
|
+
(function (CollectorErrorCodeEnum) {
|
|
10
|
+
CollectorErrorCodeEnum["INSUFFICIENT_BALANCE"] = "INSUFFICIENT_BALANCE";
|
|
11
|
+
CollectorErrorCodeEnum["WALLET_FROZEN"] = "WALLET_FROZEN";
|
|
12
|
+
CollectorErrorCodeEnum["INVALID_DIRECTORY"] = "INVALID_DIRECTORY";
|
|
13
|
+
CollectorErrorCodeEnum["RATE_LIMIT"] = "RATE_LIMIT";
|
|
14
|
+
CollectorErrorCodeEnum["SERVICE_UNAVAILABLE"] = "SERVICE_UNAVAILABLE";
|
|
15
|
+
CollectorErrorCodeEnum["TIMEOUT"] = "TIMEOUT";
|
|
16
|
+
CollectorErrorCodeEnum["CONTRACT_FAILED"] = "CONTRACT_FAILED";
|
|
17
|
+
CollectorErrorCodeEnum["CONVERSION_ERROR"] = "CONVERSION_ERROR";
|
|
18
|
+
CollectorErrorCodeEnum["PARTIAL_FREEZE"] = "PARTIAL_FREEZE";
|
|
19
|
+
})(CollectorErrorCodeEnum || (exports.CollectorErrorCodeEnum = CollectorErrorCodeEnum = {}));
|
|
20
|
+
var CollectorErrorSeverityEnum;
|
|
21
|
+
(function (CollectorErrorSeverityEnum) {
|
|
22
|
+
CollectorErrorSeverityEnum["CRITICAL"] = "CRITICAL";
|
|
23
|
+
CollectorErrorSeverityEnum["HIGH"] = "HIGH";
|
|
24
|
+
CollectorErrorSeverityEnum["MEDIUM"] = "MEDIUM";
|
|
25
|
+
CollectorErrorSeverityEnum["LOW"] = "LOW";
|
|
26
|
+
})(CollectorErrorSeverityEnum || (exports.CollectorErrorSeverityEnum = CollectorErrorSeverityEnum = {}));
|
|
27
|
+
exports.DEFAULT_SEVERITY_BY_CODE = {
|
|
28
|
+
[CollectorErrorCodeEnum.INSUFFICIENT_BALANCE]: CollectorErrorSeverityEnum.LOW,
|
|
29
|
+
[CollectorErrorCodeEnum.WALLET_FROZEN]: CollectorErrorSeverityEnum.HIGH,
|
|
30
|
+
[CollectorErrorCodeEnum.INVALID_DIRECTORY]: CollectorErrorSeverityEnum.HIGH,
|
|
31
|
+
[CollectorErrorCodeEnum.RATE_LIMIT]: CollectorErrorSeverityEnum.MEDIUM,
|
|
32
|
+
[CollectorErrorCodeEnum.SERVICE_UNAVAILABLE]: CollectorErrorSeverityEnum.MEDIUM,
|
|
33
|
+
[CollectorErrorCodeEnum.TIMEOUT]: CollectorErrorSeverityEnum.MEDIUM,
|
|
34
|
+
[CollectorErrorCodeEnum.CONTRACT_FAILED]: CollectorErrorSeverityEnum.HIGH,
|
|
35
|
+
[CollectorErrorCodeEnum.CONVERSION_ERROR]: CollectorErrorSeverityEnum.HIGH,
|
|
36
|
+
[CollectorErrorCodeEnum.PARTIAL_FREEZE]: CollectorErrorSeverityEnum.LOW,
|
|
37
|
+
};
|
package/bin/collector/index.d.ts
CHANGED
package/bin/collector/index.js
CHANGED
|
@@ -24,3 +24,4 @@ __exportStar(require("./dtos/CreditContractResponse"), exports);
|
|
|
24
24
|
__exportStar(require("./dtos/CollectorTransactionUpdateRequest"), exports);
|
|
25
25
|
__exportStar(require("./dtos/CollectionOrderExecution"), exports);
|
|
26
26
|
__exportStar(require("./dtos/GetLastExchangeRateOutput"), exports);
|
|
27
|
+
__exportStar(require("./enums/CollectorErrorCodeEnum"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Códigos estandarizados de errores del Collector API.
|
|
3
|
+
* Spec: PROCESO_05_COBRANZA.md §13.1
|
|
4
|
+
*/
|
|
5
|
+
export enum CollectorErrorCodeEnum {
|
|
6
|
+
INSUFFICIENT_BALANCE = 'INSUFFICIENT_BALANCE',
|
|
7
|
+
WALLET_FROZEN = 'WALLET_FROZEN',
|
|
8
|
+
INVALID_DIRECTORY = 'INVALID_DIRECTORY',
|
|
9
|
+
RATE_LIMIT = 'RATE_LIMIT',
|
|
10
|
+
SERVICE_UNAVAILABLE = 'SERVICE_UNAVAILABLE',
|
|
11
|
+
TIMEOUT = 'TIMEOUT',
|
|
12
|
+
CONTRACT_FAILED = 'CONTRACT_FAILED',
|
|
13
|
+
CONVERSION_ERROR = 'CONVERSION_ERROR',
|
|
14
|
+
PARTIAL_FREEZE = 'PARTIAL_FREEZE',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum CollectorErrorSeverityEnum {
|
|
18
|
+
CRITICAL = 'CRITICAL',
|
|
19
|
+
HIGH = 'HIGH',
|
|
20
|
+
MEDIUM = 'MEDIUM',
|
|
21
|
+
LOW = 'LOW',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const DEFAULT_SEVERITY_BY_CODE: Record<CollectorErrorCodeEnum, CollectorErrorSeverityEnum> = {
|
|
25
|
+
[CollectorErrorCodeEnum.INSUFFICIENT_BALANCE]: CollectorErrorSeverityEnum.LOW,
|
|
26
|
+
[CollectorErrorCodeEnum.WALLET_FROZEN]: CollectorErrorSeverityEnum.HIGH,
|
|
27
|
+
[CollectorErrorCodeEnum.INVALID_DIRECTORY]: CollectorErrorSeverityEnum.HIGH,
|
|
28
|
+
[CollectorErrorCodeEnum.RATE_LIMIT]: CollectorErrorSeverityEnum.MEDIUM,
|
|
29
|
+
[CollectorErrorCodeEnum.SERVICE_UNAVAILABLE]: CollectorErrorSeverityEnum.MEDIUM,
|
|
30
|
+
[CollectorErrorCodeEnum.TIMEOUT]: CollectorErrorSeverityEnum.MEDIUM,
|
|
31
|
+
[CollectorErrorCodeEnum.CONTRACT_FAILED]: CollectorErrorSeverityEnum.HIGH,
|
|
32
|
+
[CollectorErrorCodeEnum.CONVERSION_ERROR]: CollectorErrorSeverityEnum.HIGH,
|
|
33
|
+
[CollectorErrorCodeEnum.PARTIAL_FREEZE]: CollectorErrorSeverityEnum.LOW,
|
|
34
|
+
};
|
package/src/collector/index.ts
CHANGED