UNPKG

@eventcatalog/license

Version:

License verification for EventCatalog

48 lines 1.73 kB
import type { Entitlements, VerifyOptions } from './types.js'; /** * Verifies a JWT license file and returns entitlements * Results are cached after first successful verification * * @param opts Verification options * @returns Promise resolving to verified entitlements * @throws Error if verification fails */ export declare function verifyOfflineLicense(opts?: VerifyOptions): Promise<Entitlements>; /** * Verifies a license key online using the EventCatalog API * @param key - The license key to verify * @returns The license data * @throws Error if verification fails */ export declare function verifyOnlineLicense(key: string, plugin: string): Promise<boolean>; /** * Checks if a specific plugin/feature is enabled in the current license * * @param name Plugin or feature name to check * @returns true if the feature is enabled, false otherwise */ export declare function isFeatureEnabled(name: string): boolean; /** * Returns the currently cached entitlements, if any * * @returns Cached entitlements or null if not verified yet */ export declare function getEntitlements(): Entitlements | null; /** * Clears the cached entitlements (useful for testing) */ export declare function clearCache(): void; /** * Utility to normalize plugin names for comparison * Handles both string and object plugin specifications * * @param plugins Array of plugin specifications * @returns Array of normalized plugin names */ export declare function normalizePluginNames(plugins: any[]): string[]; /** * Checks if an offline license key is available * @returns true if a license file is found, false otherwise */ export declare function hasOfflineLicenseKey(): boolean; //# sourceMappingURL=verify.d.ts.map