harperdb
Version:
HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.
42 lines (41 loc) • 1.18 kB
TypeScript
export declare class PublicKey {
pem: string;
constructor(mode?: string);
getKey(): import("crypto").KeyObject;
toString(): string;
}
type HarperLicenseTyp = 'Harper-License';
type HarperLicenseAlg = 'EdDSA';
export interface LicenseHeader {
typ: HarperLicenseTyp;
alg: HarperLicenseAlg;
}
export interface LicensePayload {
id: string;
level: number;
region?: string;
reads: number;
writes: number;
readBytes: number;
writeBytes: number;
realTimeMessages: number;
realTimeBytes: number;
cpuTime: number;
storage: number;
expiration: string;
autoRenew?: boolean;
}
export type ValidatedLicense = LicensePayload;
export declare class LicenseEncodingError extends TypeError {
}
export declare class InvalidLicenseError extends TypeError {
}
export declare class InvalidLicenseSignatureError extends InvalidLicenseError {
}
export declare class InvalidHeaderError extends InvalidLicenseError {
}
export declare class InvalidPayloadError extends InvalidLicenseError {
}
export declare const publicKey: PublicKey;
export declare function validateLicense(encodedLicense: string): ValidatedLicense;
export {};