UNPKG

@bitrix24/b24jssdk

Version:

Bitrix24 REST API JavaScript SDK

58 lines (54 loc) 1.72 kB
/** * @package @bitrix24/b24jssdk * @version 2.0.0 * @copyright (c) 2026 Bitrix24 * @license MIT * @see https://github.com/bitrix24/b24jssdk * @see https://bitrix24.github.io/b24jssdk/ */ 'use strict'; const b24 = require('../types/b24.cjs'); var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); class VersionManager { static { __name(this, "VersionManager"); } static create() { return new VersionManager(); } /** * List of supported API versions. * The highest version must be first. */ getAllApiVersions() { return [b24.ApiVersion.v3, b24.ApiVersion.v2]; } /** * Retained for backward compatibility. The SDK no longer keeps a v3 method * allowlist, so support is not decided client-side any more — always returns * `true`. Method existence is validated by the server. */ isSupport(_version, _method) { return true; } /** * Returns the API version to use when the caller did not specify one. With the * allowlist removed there is no client-side signal that a method is a v3 * method, so this defaults to v2 (the universal endpoint). Use the explicit * `actions.v3.*` surface to call a method on v3. */ automaticallyObtainApiVersion(_method) { return b24.ApiVersion.v2; } /** * Batch counterpart of {@link automaticallyObtainApiVersion}. Defaults to v2; * call `actions.v3.batch.make` explicitly to run a batch on v3. */ automaticallyObtainApiVersionForBatch(_calls) { return b24.ApiVersion.v2; } } const versionManager = VersionManager.create(); exports.versionManager = versionManager; //# sourceMappingURL=version-manager.cjs.map