UNPKG

@slavmak2486/bx24ts

Version:

Library for bitrix24

49 lines (48 loc) 1.52 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Bx24Hook = void 0; const BX24_1 = require("./base/BX24"); class Bx24Hook extends BX24_1.baseBX24 { constructor(url) { super(); this.logger = null; this.AUTH_EXPIRES = new Date().getTime() + 365 * 24 * 60 * 60 * 1000; this.url = url; } refreshAuth(cb) { var _a; if (this.logger) { (_a = this.logger) === null || _a === void 0 ? void 0 : _a.log('Dont use refresh auth for Bx24Hook'); } if (cb) cb(this.getAuth()); } refreshAuthAsync() { return new Promise(reject => { var _a; if (this.logger) { (_a = this.logger) === null || _a === void 0 ? void 0 : _a.log('Dont use refresh auth for Bx24Hook'); } reject({ access_token: '', domain: this.url, expires_in: 0, member_id: '', refresh_token: '' }); }); } runCallback(e) { var _a; if (this.logger) { (_a = this.logger) === null || _a === void 0 ? void 0 : _a.log('Dont use runCallback for Bx24Hook', e); } } sendMessage(cmd, params, cb) { var _a; if (this.logger) { (_a = this.logger) === null || _a === void 0 ? void 0 : _a.log('Dont use sendMessage for Bx24Hook', [cmd, params, cb]); } } } exports.Bx24Hook = Bx24Hook;