@metatell/bot-sdk 0.0.7 → 0.0.9
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/dist/sdk/errors.d.ts +2 -33
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +2 -58
- package/dist/sdk/errors.js.map +1 -1
- package/package.json +2 -2
package/dist/sdk/errors.d.ts
CHANGED
|
@@ -1,36 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SDK error definitions
|
|
2
|
+
* SDK error definitions - re-export from core
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
abstract readonly code: string;
|
|
6
|
-
readonly timestamp: Date;
|
|
7
|
-
constructor(message: string);
|
|
8
|
-
}
|
|
9
|
-
export declare class AuthenticationError extends MetatellError {
|
|
10
|
-
readonly status?: number | undefined;
|
|
11
|
-
readonly code = "AUTH_ERROR";
|
|
12
|
-
constructor(message: string, status?: number | undefined);
|
|
13
|
-
}
|
|
14
|
-
export declare class RateLimitedError extends MetatellError {
|
|
15
|
-
readonly retryAfterMs?: number | undefined;
|
|
16
|
-
readonly code = "RATE_LIMITED";
|
|
17
|
-
constructor(message: string, retryAfterMs?: number | undefined);
|
|
18
|
-
}
|
|
19
|
-
export declare class TransportError extends MetatellError {
|
|
20
|
-
readonly reason?: string | undefined;
|
|
21
|
-
readonly code = "TRANSPORT_ERROR";
|
|
22
|
-
constructor(message: string, reason?: string | undefined);
|
|
23
|
-
}
|
|
24
|
-
export declare class ProtocolError extends MetatellError {
|
|
25
|
-
readonly data?: unknown | undefined;
|
|
26
|
-
readonly code = "PROTOCOL_ERROR";
|
|
27
|
-
constructor(message: string, data?: unknown | undefined);
|
|
28
|
-
}
|
|
29
|
-
export declare class TimeoutError extends MetatellError {
|
|
30
|
-
readonly timeoutMs: number;
|
|
31
|
-
readonly code = "TIMEOUT_ERROR";
|
|
32
|
-
constructor(message: string, timeoutMs: number);
|
|
33
|
-
}
|
|
34
|
-
export declare function isMetatellError(error: unknown): error is MetatellError;
|
|
35
|
-
export declare function isRetryableError(error: unknown): boolean;
|
|
4
|
+
export { AuthenticationError, isMetatellError, isRetryableError, MetatellError, ProtocolError, RateLimitedError, TimeoutError, TransportError, } from '@metatell/bot-core';
|
|
36
5
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/sdk/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/sdk/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/sdk/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACf,MAAM,oBAAoB,CAAA"}
|
package/dist/sdk/errors.js
CHANGED
|
@@ -1,61 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SDK error definitions
|
|
2
|
+
* SDK error definitions - re-export from core
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
timestamp = new Date();
|
|
6
|
-
constructor(message) {
|
|
7
|
-
super(message);
|
|
8
|
-
this.name = this.constructor.name;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export class AuthenticationError extends MetatellError {
|
|
12
|
-
status;
|
|
13
|
-
code = 'AUTH_ERROR';
|
|
14
|
-
constructor(message, status) {
|
|
15
|
-
super(message);
|
|
16
|
-
this.status = status;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export class RateLimitedError extends MetatellError {
|
|
20
|
-
retryAfterMs;
|
|
21
|
-
code = 'RATE_LIMITED';
|
|
22
|
-
constructor(message, retryAfterMs) {
|
|
23
|
-
super(message);
|
|
24
|
-
this.retryAfterMs = retryAfterMs;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export class TransportError extends MetatellError {
|
|
28
|
-
reason;
|
|
29
|
-
code = 'TRANSPORT_ERROR';
|
|
30
|
-
constructor(message, reason) {
|
|
31
|
-
super(message);
|
|
32
|
-
this.reason = reason;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
export class ProtocolError extends MetatellError {
|
|
36
|
-
data;
|
|
37
|
-
code = 'PROTOCOL_ERROR';
|
|
38
|
-
constructor(message, data) {
|
|
39
|
-
super(message);
|
|
40
|
-
this.data = data;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
export class TimeoutError extends MetatellError {
|
|
44
|
-
timeoutMs;
|
|
45
|
-
code = 'TIMEOUT_ERROR';
|
|
46
|
-
constructor(message, timeoutMs) {
|
|
47
|
-
super(message);
|
|
48
|
-
this.timeoutMs = timeoutMs;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
export function isMetatellError(error) {
|
|
52
|
-
return error instanceof MetatellError;
|
|
53
|
-
}
|
|
54
|
-
export function isRetryableError(error) {
|
|
55
|
-
if (!isMetatellError(error))
|
|
56
|
-
return false;
|
|
57
|
-
return (error instanceof TransportError ||
|
|
58
|
-
error instanceof TimeoutError ||
|
|
59
|
-
(error instanceof RateLimitedError && error.retryAfterMs !== undefined));
|
|
60
|
-
}
|
|
4
|
+
export { AuthenticationError, isMetatellError, isRetryableError, MetatellError, ProtocolError, RateLimitedError, TimeoutError, TransportError, } from '@metatell/bot-core';
|
|
61
5
|
//# sourceMappingURL=errors.js.map
|
package/dist/sdk/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/sdk/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/sdk/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACf,MAAM,oBAAoB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metatell/bot-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@types/uuid": "10.0.0",
|
|
19
|
-
"@metatell/bot-core": "0.0.
|
|
19
|
+
"@metatell/bot-core": "0.0.9"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@types/node": "*",
|