@bitrix24/b24jssdk
Version:
Bitrix24 REST API JavaScript SDK
54 lines (51 loc) • 1.5 kB
JavaScript
/**
* @package @bitrix24/b24jssdk
* @version 1.0.3
* @copyright (c) 2026 Bitrix24
* @license MIT
* @see https://github.com/bitrix24/b24jssdk
* @see https://bitrix24.github.io/b24jssdk/
*/
import { ApiVersion } from '../../types/b24.mjs';
import { ActionsManagerV2 } from './v2/manager-v2.mjs';
import { ActionsManagerV3 } from './v3/manager-v3.mjs';
import { LoggerFactory } from '../../logger/logger-factory.mjs';
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
const apiV2Name = Symbol(ApiVersion.v2);
const apiV3Name = Symbol(ApiVersion.v3);
class ActionsManager {
static {
__name(this, "ActionsManager");
}
_b24;
_logger;
_mapActions;
constructor(b24) {
this._b24 = b24;
this._logger = LoggerFactory.createNullLogger();
this._mapActions = /* @__PURE__ */ new Map();
}
setLogger(logger) {
this._logger = logger;
this.v2.setLogger(this._logger);
this.v3.setLogger(this._logger);
}
getLogger() {
return this._logger;
}
get v2() {
if (!this._mapActions.has(apiV2Name)) {
this._mapActions.set(apiV2Name, new ActionsManagerV2(this._b24));
}
return this._mapActions.get(apiV2Name);
}
get v3() {
if (!this._mapActions.has(apiV3Name)) {
this._mapActions.set(apiV3Name, new ActionsManagerV3(this._b24));
}
return this._mapActions.get(apiV3Name);
}
}
export { ActionsManager };
//# sourceMappingURL=manager.mjs.map