UNPKG

pipebomb.js

Version:

Library for interacting with Pipe Bomb servers

35 lines (34 loc) 1.32 kB
import CollectionCache from "./collection/CollectionCache.js"; import Context from "./Context.js"; import TrackCache from "./music/TrackCache.js"; import HostInfo from "./HostInfo.js"; import V1 from "./version/V1.js"; export interface PipeBombOptions { token?: string; privateKey?: string; CollectionCacheTime?: number; playlistUpdateFrequency?: number; trackCacheTime?: number; includeAddressInIds?: boolean; } export default class PipeBomb { readonly context: Context; readonly collectionCache: CollectionCache; readonly trackCache: TrackCache; readonly v1: V1; constructor(serverURL: string, options?: PipeBombOptions); authenticate(username: string, options?: { privateKey?: string; createIfMissing?: boolean; }): Promise<string>; static checkHost(serverURL: string): Promise<HostInfo | null>; static getCredentialHash(username: string, password: string): string; static getUserIDFromPublicKey(publicKey: string): string; static generatePrivateKey(accountHash: string): string; static getAccountKeys(privateKey: string): { publicKey: string; userID: string; }; static encrypt(message: JSON | string, publicKey: string): string; static decrypt(message: string, privateKey: string): JSON | string; }