@rc-ex/ws 1.3.14 → 1.3.15
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/cjs/exceptions/ClosedException.js +4 -21
- package/dist/cjs/exceptions/ConnectionException.js +10 -27
- package/dist/cjs/exceptions/TimeoutException.js +4 -21
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +301 -482
- package/dist/cjs/rest.js +46 -96
- package/dist/cjs/subscription.js +69 -151
- package/dist/cjs/types.d.ts +1 -1
- package/dist/cjs/utils.js +33 -77
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/types.d.ts +1 -1
- package/package.json +6 -6
|
@@ -1,25 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return _super.call(this, message !== null && message !== void 0 ? message : "WebSocket has been closed") || this;
|
|
3
|
+
class ClosedException extends Error {
|
|
4
|
+
constructor(message) {
|
|
5
|
+
super(message ?? "WebSocket has been closed");
|
|
22
6
|
}
|
|
23
|
-
|
|
24
|
-
}(Error));
|
|
7
|
+
}
|
|
25
8
|
exports.default = ClosedException;
|
|
@@ -1,34 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return _this;
|
|
6
|
+
const utils_js_1 = __importDefault(require("../utils.js"));
|
|
7
|
+
class ConnectionException extends Error {
|
|
8
|
+
wsgEvent;
|
|
9
|
+
wsgError;
|
|
10
|
+
constructor(wsgEvent) {
|
|
11
|
+
const [, wsgError] = utils_js_1.default.splitWsgData(wsgEvent.data);
|
|
12
|
+
super(JSON.stringify(wsgError, null, 2));
|
|
13
|
+
this.wsgEvent = wsgEvent;
|
|
14
|
+
this.wsgError = wsgError;
|
|
31
15
|
}
|
|
32
|
-
|
|
33
|
-
}(Error));
|
|
16
|
+
}
|
|
34
17
|
exports.default = ConnectionException;
|
|
@@ -1,25 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return _super.call(this, message !== null && message !== void 0 ? message : "Failed to receive expected WebSocket message in time.") || this;
|
|
3
|
+
class TimeoutException extends Error {
|
|
4
|
+
constructor(message) {
|
|
5
|
+
super(message ?? "Failed to receive expected WebSocket message in time.");
|
|
22
6
|
}
|
|
23
|
-
|
|
24
|
-
}(Error));
|
|
7
|
+
}
|
|
25
8
|
exports.default = TimeoutException;
|
package/dist/cjs/index.d.ts
CHANGED