@cuenca-mx/cuenca-js 0.0.1-dev.4 → 0.0.1-dev.8
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/build/errors/index.mjs +64 -0
- package/build/index.mjs +1475 -0
- package/build/jwt/index.mjs +46 -0
- package/build/{queries-395c7467.js → queries-f146b91b.js} +1 -1
- package/build/requests/index.mjs +3 -0
- package/build/types/index.mjs +3 -0
- package/build/{walletTransactionRequest-17132eb5.js → walletTransactionRequest-bbfb87bd.js} +1 -1
- package/package.json +22 -9
- package/build/README.md +0 -7
- package/build/package.json +0 -37
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
class CuencaException extends Error {
|
|
2
|
+
constructor(msg) {
|
|
3
|
+
super(msg);
|
|
4
|
+
|
|
5
|
+
Object.setPrototypeOf(this, CuencaException.prototype);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
class CuencaResponseException extends CuencaException {
|
|
10
|
+
constructor(data, status) {
|
|
11
|
+
super(`Cuenca Response Error: ${status}`);
|
|
12
|
+
this.name = 'CuencaResponseError';
|
|
13
|
+
this.data = data;
|
|
14
|
+
this.status = status;
|
|
15
|
+
|
|
16
|
+
Object.setPrototypeOf(this, CuencaResponseException.prototype);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
class NoResultFound extends CuencaException {
|
|
21
|
+
constructor() {
|
|
22
|
+
super('No results were found');
|
|
23
|
+
this.name = 'NoResultFound';
|
|
24
|
+
|
|
25
|
+
Object.setPrototypeOf(this, NoResultFound.prototype);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
class MultipleResultsFound extends CuencaException {
|
|
30
|
+
constructor() {
|
|
31
|
+
super('One result was expected but multiple were found');
|
|
32
|
+
this.name = 'MultipleResultsFound';
|
|
33
|
+
|
|
34
|
+
Object.setPrototypeOf(this, MultipleResultsFound.prototype);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
class MalformedJwtToken extends CuencaException {
|
|
39
|
+
constructor() {
|
|
40
|
+
super('An invalid JWT token was obtained during authentication');
|
|
41
|
+
this.name = 'MalformedJwtToken';
|
|
42
|
+
|
|
43
|
+
Object.setPrototypeOf(this, MalformedJwtToken.prototype);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
class InvalidPassword extends CuencaException {
|
|
48
|
+
constructor() {
|
|
49
|
+
super('Invalid password');
|
|
50
|
+
this.name = 'InvalidPassword';
|
|
51
|
+
|
|
52
|
+
Object.setPrototypeOf(this, InvalidPassword.prototype);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
class ValidationError extends Error {
|
|
57
|
+
constructor(msg) {
|
|
58
|
+
super(msg);
|
|
59
|
+
|
|
60
|
+
Object.setPrototypeOf(this, ValidationError.prototype);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { CuencaException, CuencaResponseException, InvalidPassword, MalformedJwtToken, MultipleResultsFound, NoResultFound, ValidationError };
|