polyv-live-cli
Version:
CLI tool for managing PolyV live streaming services.
38 lines • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WatchConditionServiceSdk = void 0;
const polyv_live_api_sdk_1 = require("polyv-live-api-sdk");
const errors_1 = require("../utils/errors");
class WatchConditionServiceSdk {
constructor(authConfig, _serviceConfig) {
this.client = new polyv_live_api_sdk_1.PolyVClient(authConfig);
this.web = this.client.web;
}
async getWatchCondition(params) {
try {
const result = await this.web.getWatchCondition(params);
return result;
}
catch (error) {
throw this.wrapError(error, 'getWatchCondition');
}
}
async setWatchCondition(params) {
try {
const result = await this.web.setWatchCondition(params);
return result;
}
catch (error) {
throw this.wrapError(error, 'setWatchCondition');
}
}
wrapError(error, operation) {
if (error instanceof errors_1.PolyVError) {
return error;
}
const message = error instanceof Error ? error.message : String(error);
return new errors_1.PolyVError(`${operation} failed: ${message}`, 'WATCH_CONDITION_API_ERROR', 1, { originalError: error });
}
}
exports.WatchConditionServiceSdk = WatchConditionServiceSdk;
//# sourceMappingURL=watch-condition-service.js.map