UNPKG

@bxshefby/b24jssdk

Version:

Bitrix24 REST API JavaScript SDK

50 lines (47 loc) • 1.35 kB
/** * @package @bxshefby/b24jssdk * @version 3.3.0 * @copyright (c) 2026 Bitrix24 * @license MIT * @see https://github.com/bx-shef/b24-js-sdk * @see https://b24-js-sdk.bx-shef.by/ */ import { Ping } from './ping.mjs'; import { HealthCheck } from './healthcheck.mjs'; import { LoggerFactory } from '../../logger/logger-factory.mjs'; var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); const pingName = /* @__PURE__ */ Symbol("ping"); const healthCheckName = /* @__PURE__ */ Symbol("healthCheck"); class ToolsManager { static { __name(this, "ToolsManager"); } _b24; _logger; _mapTools; constructor(b24) { this._b24 = b24; this._logger = LoggerFactory.createNullLogger(); this._mapTools = /* @__PURE__ */ new Map(); } setLogger(logger) { this._logger = logger; } getLogger() { return this._logger; } get ping() { if (!this._mapTools.has(pingName)) { this._mapTools.set(pingName, new Ping(this._b24, this._logger)); } return this._mapTools.get(pingName); } get healthCheck() { if (!this._mapTools.has(healthCheckName)) { this._mapTools.set(healthCheckName, new HealthCheck(this._b24, this._logger)); } return this._mapTools.get(healthCheckName); } } export { ToolsManager };