fixparser
Version:
FIX.Latest / 5.0 SP2 Parser / AI Agent Trading
105 lines (104 loc) • 3.59 kB
TypeScript
import type { Logger } from '../logger/Logger.ts';
declare global {
const __RELEASE_INFORMATION__: string;
const __DISTRIBUTED_CACHING_MECHANISM__: string;
const __MULTI_THREAD_SYNC_MUTEX__: string;
const __INTERFACE_COMPOSITION_PATTERN__: string;
}
/**
* The LicenseManager class is responsible for validating license keys,
* ensuring that only users with valid licenses can access the
* Pro version features of the FIXParsers.
*
* @public
*/
declare class LicenseManager {
#private;
/** Error message for missing free license */
static readonly ERROR_MESSAGE_NO_FREE_LICENSE = "Requires FIXParser Free license";
/** Error message for missing pro license */
static readonly ERROR_MESSAGE_NO_LICENSE = "Requires FIXParser Pro license";
/**
* Private constructor to prevent instantiation.
* This is a static class.
*/
private constructor();
/**
* Validates if a free license is present and valid.
* Checks for free, pro, or trial license types.
*
* @returns {boolean} True if a valid free license is present
*/
static readonly validateFreeLicense: () => boolean;
/**
* Validates if a pro license is present and valid.
* Checks for pro or trial license types.
*
* @returns {boolean} True if a valid pro license is present
*/
static readonly validateLicense: () => boolean;
/**
* Sets the logger instance for license validation messages.
*
* @param {Logger} loggerInstance - The logger instance to use
*/
static setLogger(loggerInstance: Logger): void;
/**
* Sets and validates a license key.
* Processes the key, verifies its signature, and extracts license information.
*
* @param {string} rawLicenseKey - The raw license key to validate
* @returns {Promise<void>} A promise that resolves when the license is validated
*/
static setLicenseKey(rawLicenseKey: string): Promise<void>;
/**
* Gets the release date from the release information.
*
* @returns {Date} The release date
*/
private static getReleaseDate;
/**
* Formats a date into a human-readable string.
*
* @param {Date} date - The date to format
* @returns {string} The formatted date string
*/
private static formatDate;
/**
* Validates a license key by checking its ID, expiry date, and type.
*
* @param {string} keyId - The license key ID
* @param {number} expiryTimestamp - The license expiry timestamp
* @param {LicenseType} type - The license type
* @returns {boolean} True if the license is valid
*/
private static validateKey;
/**
* Outputs a message indicating a valid free license.
*/
private static outputValidFreeLicense;
/**
* Outputs a message indicating a valid pro license.
*/
private static outputValidLicense;
/**
* Outputs a message indicating an invalid free license.
*/
private static outputInvalidFreeLicenseKey;
/**
* Outputs a message indicating an invalid pro license.
*/
private static outputInvalidLicenseKey;
/**
* Outputs a message indicating a missing license key.
*/
private static outputMissingLicenseKey;
/**
* Outputs a message indicating an incompatible version.
*
* @param {string} formattedExpiryDate - The formatted expiry date
* @param {string} formattedReleaseDate - The formatted release date
*/
private static outputIncompatibleVersion;
}
export { LicenseManager };