@bitrix24/b24jssdk
Version:
Bitrix24 REST API JavaScript SDK
49 lines (46 loc) • 1.64 kB
JavaScript
/**
* @package @bitrix24/b24jssdk
* @version 1.1.0
* @copyright (c) 2026 Bitrix24
* @license MIT
* @see https://github.com/bitrix24/b24jssdk
* @see https://bitrix24.github.io/b24jssdk/
*/
import { AbstractTool } from './abstract-tool.mjs';
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
class HealthCheck extends AbstractTool {
static {
__name(this, "HealthCheck");
}
/**
* Checks the availability of the Bitrix24 REST API.
* Performs a simple request to the API to verify the service is operational and that the required access rights are present.
*
* @note The method uses a minimal API request (`server.time`) to check availability.
* Does not overload the server with large amounts of data.
*
* @param options Some options for executing
* - `requestId?: string` - Unique request identifier for tracking. Used for query deduplication and debugging (default: undefined)
*
* @returns {Promise<false>} Promise that resolves to a Boolean value:
* - `true`: the API is available and responding
* - `false`: the API is unavailable, an error occurred, or the required access rights are missing
*
* @see {@link Ping} To measure API response speed
*/
async make(options) {
try {
const response = await this._b24.actions.v2.call.make({
method: "server.time",
params: {},
requestId: options?.requestId
});
return response.isSuccess;
} catch {
return false;
}
}
}
export { HealthCheck };
//# sourceMappingURL=healthcheck.mjs.map