@twurple/api
Version:
Interact with Twitch's API.
56 lines (55 loc) • 1.64 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HelixEventSubConduit = void 0;
const tslib_1 = require("tslib");
const shared_utils_1 = require("@d-fischer/shared-utils");
const common_1 = require("@twurple/common");
/**
* Represents an EventSub conduit.
*/
let HelixEventSubConduit = class HelixEventSubConduit extends common_1.DataObject {
/** @internal */
constructor(data, client) {
super(data);
this._client = client;
}
/**
* The ID of the conduit.
*/
get id() {
return this[common_1.rawDataSymbol].id;
}
/**
* The shard count of the conduit.
*/
get shardCount() {
return this[common_1.rawDataSymbol].shard_count;
}
/**
* Update the conduit.
*
* @param shardCount The new shard count.
*/
async update(shardCount) {
return await this._client.eventSub.updateConduit(this[common_1.rawDataSymbol].id, shardCount);
}
/**
* Delete the conduit.
*/
async delete() {
await this._client.eventSub.deleteConduit(this[common_1.rawDataSymbol].id);
}
/**
* Get the conduit shards.
*/
async getShards() {
return await this._client.eventSub.getConduitShards(this[common_1.rawDataSymbol].id);
}
};
exports.HelixEventSubConduit = HelixEventSubConduit;
tslib_1.__decorate([
(0, shared_utils_1.Enumerable)(false)
], HelixEventSubConduit.prototype, "_client", void 0);
exports.HelixEventSubConduit = HelixEventSubConduit = tslib_1.__decorate([
(0, common_1.rtfm)('api', 'HelixEventSubConduit')
], HelixEventSubConduit);